@allyhub/sdk 0.9.0 → 0.10.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 (134) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/node_modules/@allyhub/audio/package.json +1 -1
  3. package/dist/node_modules/@allyhub/chart/dist/chart-xml.d.ts +3 -0
  4. package/dist/node_modules/@allyhub/chart/dist/chart-xml.js +2 -2
  5. package/dist/node_modules/@allyhub/chart/dist/chart.d.ts +22 -0
  6. package/dist/node_modules/@allyhub/chart/dist/chart.js +1 -1
  7. package/dist/node_modules/@allyhub/chart/package.json +1 -1
  8. package/dist/node_modules/@allyhub/diagnostics/package.json +1 -1
  9. package/dist/node_modules/@allyhub/formats/dist/data/faces.d.ts +1 -1
  10. package/dist/node_modules/@allyhub/formats/dist/data/sheet.d.ts +87 -1
  11. package/dist/node_modules/@allyhub/formats/dist/data/sheet.js +1 -1
  12. package/dist/node_modules/@allyhub/formats/dist/data/slides.d.ts +89 -0
  13. package/dist/node_modules/@allyhub/formats/dist/data/slides.js +1 -1
  14. package/dist/node_modules/@allyhub/formats/dist/schemas.d.ts +50 -0
  15. package/dist/node_modules/@allyhub/formats/package.json +1 -1
  16. package/dist/node_modules/@allyhub/image-draw/package.json +1 -1
  17. package/dist/node_modules/@allyhub/image-measure/package.json +1 -1
  18. package/dist/node_modules/@allyhub/image-sdk/package.json +1 -1
  19. package/dist/node_modules/@allyhub/measure/package.json +1 -1
  20. package/dist/node_modules/@allyhub/ooxml/dist/geometry/index.js +1 -1
  21. package/dist/node_modules/@allyhub/ooxml/package.json +1 -1
  22. package/dist/node_modules/@allyhub/piece/dist/layout.d.ts +16 -0
  23. package/dist/node_modules/@allyhub/piece/dist/page/locate.js +1 -1
  24. package/dist/node_modules/@allyhub/piece/dist/stage.d.ts +6 -0
  25. package/dist/node_modules/@allyhub/piece/package.json +1 -1
  26. package/dist/node_modules/@allyhub/protocol/dist/account.d.ts +132 -0
  27. package/dist/node_modules/@allyhub/protocol/dist/account.js +1 -1
  28. package/dist/node_modules/@allyhub/protocol/dist/auth.d.ts +19 -1
  29. package/dist/node_modules/@allyhub/protocol/dist/auth.js +1 -1
  30. package/dist/node_modules/@allyhub/protocol/dist/browser-bridge.d.ts +337 -0
  31. package/dist/node_modules/@allyhub/protocol/dist/browser-bridge.js +2 -0
  32. package/dist/node_modules/@allyhub/protocol/dist/cloud.d.ts +153 -0
  33. package/dist/node_modules/@allyhub/protocol/dist/cloud.js +1 -1
  34. package/dist/node_modules/@allyhub/protocol/dist/editor.d.ts +4 -2
  35. package/dist/node_modules/@allyhub/protocol/dist/editor.js +1 -1
  36. package/dist/node_modules/@allyhub/protocol/dist/frame.d.ts +43 -188
  37. package/dist/node_modules/@allyhub/protocol/dist/frame.js +1 -1
  38. package/dist/node_modules/@allyhub/protocol/dist/index.d.ts +1 -0
  39. package/dist/node_modules/@allyhub/protocol/dist/index.js +1 -1
  40. package/dist/node_modules/@allyhub/protocol/dist/mail.d.ts +1 -0
  41. package/dist/node_modules/@allyhub/protocol/dist/mail.js +1 -1
  42. package/dist/node_modules/@allyhub/protocol/dist/notes.d.ts +51 -91
  43. package/dist/node_modules/@allyhub/protocol/dist/notes.js +1 -1
  44. package/dist/node_modules/@allyhub/protocol/dist/tools.d.ts +3 -3
  45. package/dist/node_modules/@allyhub/protocol/package.json +5 -1
  46. package/dist/node_modules/@allyhub/runtimes/package.json +1 -1
  47. package/dist/node_modules/@allyhub/scenery/dist/index.d.ts +2 -2
  48. package/dist/node_modules/@allyhub/scenery/dist/index.js +1 -1
  49. package/dist/node_modules/@allyhub/scenery/dist/moire.d.ts +45 -5
  50. package/dist/node_modules/@allyhub/scenery/dist/moire.js +2 -2
  51. package/dist/node_modules/@allyhub/scenery/dist/phone.d.ts +4 -3
  52. package/dist/node_modules/@allyhub/scenery/dist/phone.js +1 -1
  53. package/dist/node_modules/@allyhub/scenery/package.json +1 -1
  54. package/dist/node_modules/@allyhub/sheet/dist/calc/coerce.js +1 -1
  55. package/dist/node_modules/@allyhub/sheet/dist/calc/engine.d.ts +70 -0
  56. package/dist/node_modules/@allyhub/sheet/dist/calc/engine.js +1 -1
  57. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/criteria.d.ts +6 -0
  58. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/criteria.js +1 -1
  59. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/date.js +1 -1
  60. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/define.d.ts +3 -1
  61. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/define.js +1 -1
  62. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/info.js +1 -1
  63. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/kernels.js +1 -1
  64. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/lookup.js +1 -1
  65. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/maths.js +1 -1
  66. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/text.js +1 -1
  67. package/dist/node_modules/@allyhub/sheet/dist/calc/indexes.d.ts +9 -0
  68. package/dist/node_modules/@allyhub/sheet/dist/calc/indexes.js +1 -1
  69. package/dist/node_modules/@allyhub/sheet/dist/calc/types.d.ts +6 -0
  70. package/dist/node_modules/@allyhub/sheet/dist/calc/types.js +1 -1
  71. package/dist/node_modules/@allyhub/sheet/dist/chart.d.ts +9 -0
  72. package/dist/node_modules/@allyhub/sheet/dist/chart.js +1 -1
  73. package/dist/node_modules/@allyhub/sheet/dist/formula/ast.d.ts +12 -1
  74. package/dist/node_modules/@allyhub/sheet/dist/formula/move.d.ts +5 -1
  75. package/dist/node_modules/@allyhub/sheet/dist/formula/move.js +1 -1
  76. package/dist/node_modules/@allyhub/sheet/dist/formula/parse.js +1 -1
  77. package/dist/node_modules/@allyhub/sheet/dist/formula/print.js +1 -1
  78. package/dist/node_modules/@allyhub/sheet/dist/index.d.ts +2 -1
  79. package/dist/node_modules/@allyhub/sheet/dist/index.js +1 -1
  80. package/dist/node_modules/@allyhub/sheet/dist/inspect.d.ts +12 -2
  81. package/dist/node_modules/@allyhub/sheet/dist/inspect.js +1 -1
  82. package/dist/node_modules/@allyhub/sheet/dist/printed.d.ts +19 -0
  83. package/dist/node_modules/@allyhub/sheet/dist/printed.js +2 -0
  84. package/dist/node_modules/@allyhub/sheet/dist/values.d.ts +2 -0
  85. package/dist/node_modules/@allyhub/sheet/dist/values.js +1 -1
  86. package/dist/node_modules/@allyhub/sheet/dist/workbook.d.ts +2 -0
  87. package/dist/node_modules/@allyhub/sheet/dist/workbook.js +1 -1
  88. package/dist/node_modules/@allyhub/sheet/dist/write.js +15 -15
  89. package/dist/node_modules/@allyhub/sheet/dist/xlsx/charts.d.ts +6 -2
  90. package/dist/node_modules/@allyhub/sheet/dist/xlsx/charts.js +1 -1
  91. package/dist/node_modules/@allyhub/sheet/dist/xlsx/formula.js +2 -2
  92. package/dist/node_modules/@allyhub/sheet/dist/xlsx/import.d.ts +0 -1
  93. package/dist/node_modules/@allyhub/sheet/dist/xlsx/import.js +1 -1
  94. package/dist/node_modules/@allyhub/sheet/dist/xlsx/read.d.ts +3 -1
  95. package/dist/node_modules/@allyhub/sheet/dist/xlsx/read.js +2 -2
  96. package/dist/node_modules/@allyhub/sheet/dist/xlsx/sax.d.ts +7 -1
  97. package/dist/node_modules/@allyhub/sheet/dist/xlsx/sax.js +3 -1
  98. package/dist/node_modules/@allyhub/sheet/dist/xlsx/styles.d.ts +6 -0
  99. package/dist/node_modules/@allyhub/sheet/dist/xlsx/styles.js +1 -1
  100. package/dist/node_modules/@allyhub/sheet/dist/xlsx/write.d.ts +1 -1
  101. package/dist/node_modules/@allyhub/sheet/dist/xlsx/write.js +1 -1
  102. package/dist/node_modules/@allyhub/sheet/dist/xlsx/xml.d.ts +12 -1
  103. package/dist/node_modules/@allyhub/sheet/dist/xlsx/xml.js +3 -2
  104. package/dist/node_modules/@allyhub/sheet/package.json +1 -1
  105. package/dist/node_modules/@allyhub/slides-core/dist/api.d.ts +57 -7
  106. package/dist/node_modules/@allyhub/slides-core/dist/api.js +2 -2
  107. package/dist/node_modules/@allyhub/slides-core/dist/capabilities.js +1 -1
  108. package/dist/node_modules/@allyhub/slides-core/dist/enums.d.ts +24 -0
  109. package/dist/node_modules/@allyhub/slides-core/dist/enums.js +1 -1
  110. package/dist/node_modules/@allyhub/slides-core/dist/fact.d.ts +15 -0
  111. package/dist/node_modules/@allyhub/slides-core/dist/measure.js +1 -1
  112. package/dist/node_modules/@allyhub/slides-core/dist/model.d.ts +6 -2
  113. package/dist/node_modules/@allyhub/slides-core/dist/resolve.d.ts +3 -1
  114. package/dist/node_modules/@allyhub/slides-core/dist/resolve.js +1 -1
  115. package/dist/node_modules/@allyhub/slides-core/dist/sdk.d.ts +1 -1
  116. package/dist/node_modules/@allyhub/slides-core/dist/sdk.js +1 -1
  117. package/dist/node_modules/@allyhub/slides-core/package.json +1 -1
  118. package/dist/node_modules/@allyhub/video-core/dist/piece.d.ts +2 -2
  119. package/dist/node_modules/@allyhub/video-core/dist/schema.d.ts +2 -2
  120. package/dist/node_modules/@allyhub/video-core/dist/schema.js +1 -1
  121. package/dist/node_modules/@allyhub/video-core/package.json +1 -1
  122. package/dist/node_modules/@allyhub/video-sdk/dist/phone.d.ts +12 -5
  123. package/dist/node_modules/@allyhub/video-sdk/dist/phone.js +1 -1
  124. package/dist/node_modules/@allyhub/video-sdk/package.json +1 -1
  125. package/docs/README.md +2 -0
  126. package/docs/canvas.md +28 -0
  127. package/docs/defaults.md +20 -2
  128. package/docs/docs.md +8 -8
  129. package/docs/scenery.md +3 -4
  130. package/docs/sheets.md +22 -5
  131. package/docs/slides.md +50 -4
  132. package/docs/speech.md +1 -1
  133. package/docs/x.md +73 -0
  134. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import type { Numbering, AnimationEffect, AnimationFile, LineDash, TransitionFile, LineEnd, ShapeGeometry, TextAlign, ThemeColor } from "@allyhub/formats";
1
+ import type { ArrowSize, Numbering, AnimationEffect, AnimationFile, LineDash, TransitionFile, LineEnd, ShapeGeometry, TextAlign, ThemeColor } from "@allyhub/formats";
2
2
  import type { Anchor, AutoSize, FillType, PlaceholderType, ShapeType } from "./enums.js";
3
3
  import type { Color, ComponentContext, DeckDef, FontDef, Frame, GradientDef, FreeformPath, GeneratedSlideDef, GeneratorContext, LayoutDef, MasterDef, ParagraphDef, TableCellDef, TableDef, ParagraphFormatDef, PropSpec, RunDef, ShapeDef, TextFrameDef } from "./model.js";
4
4
  import type { SheetChartType } from "@allyhub/formats";
@@ -203,9 +203,19 @@ export declare class FillFormat {
203
203
  /** A gradient's degrees, clockwise from left to right. python-pptx's run the other way. */
204
204
  get gradient_angle(): number;
205
205
  set gradient_angle(v: number);
206
- /** A gradient's stops: `[{ at, color, transparency }]`, `at` and `transparency` shares. */
207
- get gradient_stops(): GradientDef["stops"];
208
- set gradient_stops(v: GradientDef["stops"]);
206
+ /**
207
+ * A gradient's stops. Read, each is python-pptx's: its `color` a
208
+ * ColorFormat, its `position` a share. Set, a list of
209
+ * `{ at, color, transparency }`, `at` and `transparency` shares and a
210
+ * colour as the slides file writes one (`accent1`, `accent1 lighter 40%`,
211
+ * `#RRGGBB`) or a Color.
212
+ */
213
+ get gradient_stops(): GradientStop[];
214
+ set gradient_stops(v: readonly (GradientStop | {
215
+ at: number;
216
+ color: Exclude<Color, string> | string;
217
+ transparency?: number;
218
+ })[]);
209
219
  private _gradient;
210
220
  /** How much of the fill shows through, a share (PowerPoint's Transparency). */
211
221
  get transparency(): number;
@@ -215,6 +225,21 @@ export declare class FillFormat {
215
225
  /** A solid fill's colour; python-pptx refuses it for another fill: call solid() first. */
216
226
  get fore_color(): ColorFormat;
217
227
  }
228
+ /** python-pptx's `_GradientStop`: one of a gradient's stops. */
229
+ export declare class GradientStop {
230
+ private readonly stop;
231
+ constructor(stop: GradientDef["stops"][number]);
232
+ /** A stop as the model holds it, a copy: what setting gradient_stops to stops read back keeps. */
233
+ static defOf(s: GradientStop): GradientDef["stops"][number];
234
+ /** Its colour. */
235
+ get color(): ColorFormat;
236
+ /** Where it stands along the gradient, a share from 0 to 1. */
237
+ get position(): number;
238
+ set position(v: number);
239
+ /** How much of its colour shows through, a share; python-pptx has none. */
240
+ get transparency(): number;
241
+ set transparency(v: number);
242
+ }
218
243
  /**
219
244
  * python-pptx's `ShadowFormat`: a shape's shadow. Its `inherit` is there; what
220
245
  * a shadow is made of, python-pptx has no API for.
@@ -223,7 +248,7 @@ export declare class ShadowFormat {
223
248
  private readonly def;
224
249
  constructor(def: ShapeDef);
225
250
  private _shadow;
226
- /** Whether it has none of its own; false gives it SHADOW_DEFAULTS. */
251
+ /** Whether it takes its style's effects; false gives it none of its own (no shadow), as python-pptx's empty effect list does. */
227
252
  get inherit(): boolean;
228
253
  set inherit(v: boolean);
229
254
  get blur_radius(): LengthValue;
@@ -254,6 +279,18 @@ export declare class LineFormat {
254
279
  /** What the end of the line where it ends has (MSO_ARROWHEAD). */
255
280
  get end_arrow(): LineEnd;
256
281
  set end_arrow(v: LineEnd);
282
+ /** How wide the arrowhead where the line starts is (MSO_ARROWHEAD_SIZE). */
283
+ get begin_arrow_width(): ArrowSize;
284
+ set begin_arrow_width(v: ArrowSize);
285
+ /** How long the arrowhead where the line starts is (MSO_ARROWHEAD_SIZE). */
286
+ get begin_arrow_length(): ArrowSize;
287
+ set begin_arrow_length(v: ArrowSize);
288
+ /** How wide the arrowhead where the line ends is (MSO_ARROWHEAD_SIZE). */
289
+ get end_arrow_width(): ArrowSize;
290
+ set end_arrow_width(v: ArrowSize);
291
+ /** How long the arrowhead where the line ends is (MSO_ARROWHEAD_SIZE). */
292
+ get end_arrow_length(): ArrowSize;
293
+ set end_arrow_length(v: ArrowSize);
257
294
  }
258
295
  /** python-pptx's `_Background` of a slide, a layout or a master. */
259
296
  export declare class Background {
@@ -310,6 +347,13 @@ export declare class Shape {
310
347
  /** Degrees clockwise about its centre; python-pptx's, kept from 0 up to 360. */
311
348
  get rotation(): number;
312
349
  set rotation(v: number);
350
+ /** Whether it is mirrored left to right (`a:xfrm` flipH), as the slides file's flip_h; its text reads as it is. python-pptx has no such property. */
351
+ get flip_h(): boolean;
352
+ set flip_h(v: boolean);
353
+ /** Whether it is mirrored top to bottom (`a:xfrm` flipV), as the slides file's flip_v. */
354
+ get flip_v(): boolean;
355
+ set flip_v(v: boolean);
356
+ private _flip;
313
357
  get has_text_frame(): boolean;
314
358
  get text_frame(): TextFrame;
315
359
  /** Its text frame's text (python-pptx's `shape.text`). */
@@ -401,9 +445,15 @@ export declare class Cell {
401
445
  get text(): string;
402
446
  set text(v: string);
403
447
  get fill(): FillFormat;
404
- /** Its edges, each a colour and a width; python-pptx has none (`a:lnL`…). */
448
+ /**
449
+ * Its edges, each a colour (as the slides file writes one, or a Color)
450
+ * and a width, a Length (`Pt(1)`); python-pptx has none (`a:lnL`…).
451
+ */
405
452
  get borders(): NonNullable<TableCellDef["borders"]>;
406
- set borders(v: NonNullable<TableCellDef["borders"]>);
453
+ set borders(v: Partial<Record<"left" | "right" | "top" | "bottom", {
454
+ color: Exclude<Color, string> | string;
455
+ width: Length;
456
+ }>>);
407
457
  get margin_left(): LengthValue;
408
458
  set margin_left(v: Length);
409
459
  get margin_right(): LengthValue;
@@ -1,4 +1,4 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{themeColor as T,themeColorOf as M}from"@allyhub/chart";import{presetAdjustments as z}from"@allyhub/ooxml/geometry";import{connectorBetween as G,connectorEnds as I,siteOn as B,sitesOf as D}from"./connect.js";import{framedComponent as H}from"@allyhub/piece";import{MSO_CONNECTOR as U,MSO_SHAPE as v,MSO_SHAPE_TYPE as X,PP_PLACEHOLDER as j}from"./enums.js";import{Chart as Y}from"./chart-api.js";import{AUTOSHAPE_STYLE as p,SHADOW_DEFAULTS as P,CONNECTOR_GEOMETRIES as J,CONNECTOR_STYLE as R,FOOTER_IDX as Z,isConnectorGeometry as k,OFFICE_TEXT_STYLES as q,placeholderLevels as K,TEXT_INSETS as w,TEXTBOX_FRAME as W}from"./office.js";import{masterPlaceholder as F}from"./placeholders.js";import{strict as h}from"./strict.js";import{EMU_PER_PT as A,SLIDE_SIZES as $,length as l,lengthOr as y}from"./units.js";class Q extends Error{constructor(t){super(`${t} (allyhub slides capabilities lists what the API holds).`),this.name="Unsupported"}}const m=i=>{throw new Q(i)},V=/^#?[0-9a-f]{6}$/iu,C=i=>{if(!V.test(i))throw new Error(`rgb ${i} is not RRGGBB.`);return`#${i.replace("#","").toUpperCase()}`};export const RGBColor=Object.assign(function(t,e,s){for(const o of[t,e,s])if(!Number.isInteger(o)||o<0||o>255)throw new Error(`RGBColor(${String(t)}, ${String(e)}, ${String(s)}): each is 0 to 255.`);const r=`#${[t,e,s].map(o=>o.toString(16).padStart(2,"0")).join("").toUpperCase()}`;return new.target===void 0?r:new String(r)},{from_string:i=>C(i)});export class ColorFormat{read;write;constructor(t,e){return this.read=t,this.write=e,h(this,"ColorFormat")}get theme_color(){const t=this.read();return t===void 0?void 0:M(t)}set theme_color(t){this.write(t===void 0?void 0:T(t,this.brightness))}get brightness(){const t=this.read();return typeof t=="object"&&"brightness"in t?t.brightness:0}set brightness(t){if(!(t>=-1&&t<=1))throw new RangeError(`brightness ${String(t)} is not a number from -1.0 to 1.0.`);const e=this.read();if(e===void 0)throw new TypeError("There is no colour to set the brightness of: set theme_color first.");const s=M(e);if(s!==void 0)this.write(T(s,t));else if(t!==0)throw new TypeError("Only a theme colour has a brightness here, so an RGB colour does not: set theme_color first, or rgb to the colour it makes.")}get rgb(){const t=this.read();return typeof t=="object"&&"rgb"in t?t.rgb:void 0}set rgb(t){this.write(t===void 0?void 0:{rgb:C(t)})}}export class Font{def;constructor(t){return this.def=t,h(this,"Font")}_set(t,e){e===void 0?Reflect.deleteProperty(this.def,t):this.def[t]=e}get strike(){return this.def.strike}set strike(t){this._set("strike",t)}get baseline(){return this.def.baseline}set baseline(t){this._set("baseline",t)}get highlight(){return this.def.highlight}set highlight(t){this._set("highlight",t)}get name(){return this.def.name}set name(t){this._set("name",t)}get size(){return y(this.def.size)}set size(t){this._set("size",t)}get bold(){return this.def.bold}set bold(t){this._set("bold",t)}get italic(){return this.def.italic}set italic(t){this._set("italic",t)}get underline(){return this.def.underline}set underline(t){this._set("underline",t)}get spacing(){return y(this.def.spacing)}set spacing(t){this._set("spacing",t)}get color(){return new ColorFormat(()=>this.def.color,t=>{this._set("color",t)})}}export class Hyperlink{def;constructor(t){return this.def=t,h(this,"_Hyperlink")}get address(){return this.def.font?.link}set address(t){this.def.font??={},t===void 0?Reflect.deleteProperty(this.def.font,"link"):this.def.font.link=t}}export class Run{def;constructor(t){return this.def=t,h(this,"_Run")}get text(){return this.def.text}set text(t){this.def.text=t}get font(){return this.def.font??={},new Font(this.def.font)}get hyperlink(){return new Hyperlink(this.def)}}const tt=i=>{if(!Number.isFinite(i)||i<=0)throw new Error(`line_spacing ${String(i)} is not over 0.`);return Number.isInteger(i)&&i>=A?{fixed:i}:{lines:i}},et=i=>i===void 0?void 0:"lines"in i?i.lines:l(i.fixed),N=i=>i.split(/\n|\v/u).flatMap((t,e)=>[...e>0?[{text:"\v"}]:[],...t===""?[]:[{text:t}]]);class L{_set(t,e){e===void 0?Reflect.deleteProperty(this.fmt,t):this.fmt[t]=e}get alignment(){return this.fmt.alignment}set alignment(t){this._set("alignment",t)}get line_spacing(){return et(this.fmt.line_spacing)}set line_spacing(t){this._set("line_spacing",t===void 0?void 0:tt(t))}get space_before(){return y(this.fmt.space_before)}set space_before(t){this._set("space_before",t)}get space_after(){return y(this.fmt.space_after)}set space_after(t){this._set("space_after",t)}get font(){return this.fmt.font??={},new Font(this.fmt.font)}}export class Paragraph extends L{fmt;constructor(t){return super(),this.fmt=t,h(this,"_Paragraph")}get text(){return this.fmt.runs.map(t=>t.text).join("")}set text(t){this.fmt.runs=N(t)}get runs(){return this.fmt.runs.filter(t=>t.text!=="\v").map(t=>new Run(t))}add_run(){const t={text:""};return this.fmt.runs.push(t),new Run(t)}add_line_break(){this.fmt.runs.push({text:"\v"})}clear(){return this.fmt.runs=[],this}get level(){return this.fmt.level}set level(t){if(!Number.isInteger(t)||t<0||t>8)throw new Error(`level ${String(t)} is not 0 to 8.`);this.fmt.level=t}}export class ListLevel extends L{fmt;constructor(t){return super(),this.fmt=t,h(this,"ListLevel")}get numbered(){return this.fmt.numbered}set numbered(t){this._set("numbered",t)}get bullet(){return this.fmt.bullet}set bullet(t){this._set("bullet",t)}get bullet_font(){return this.fmt.bullet_font}set bullet_font(t){this._set("bullet_font",t)}get margin_left(){return y(this.fmt.margin_left)}set margin_left(t){this._set("margin_left",t)}get indent(){return y(this.fmt.indent)}set indent(t){this._set("indent",t)}}const S=i=>Object.freeze(i.map(t=>new ListLevel(t))),st=()=>Array.from({length:9},()=>({})),E=()=>({paragraphs:[],levels:st()});export class TextFrame{def;constructor(t){return this.def=t,h(this,"TextFrame")}_set(t,e){e===void 0?Reflect.deleteProperty(this.def,t):this.def[t]=e}get text(){return this.def.paragraphs.map(t=>t.runs.map(e=>e.text).join("")).join(`
2
+ import{themeColor as A,themeColorOf as T}from"@allyhub/chart";import{presetAdjustments as H}from"@allyhub/ooxml/geometry";import{connectorBetween as B,connectorEnds as U,siteOn as W,sitesOf as Z}from"./connect.js";import{framedComponent as X}from"@allyhub/piece";import{colorOfFile as Y}from"@allyhub/formats";import{MSO_ARROWHEAD as j,MSO_ARROWHEAD_SIZE as $,MSO_CONNECTOR as J,MSO_LINE as q,MSO_SHAPE as P,MSO_SHAPE_TYPE as K,PP_PLACEHOLDER as v}from"./enums.js";import{Chart as Q}from"./chart-api.js";import{AUTOSHAPE_STYLE as p,SHADOW_DEFAULTS as z,CONNECTOR_GEOMETRIES as V,CONNECTOR_STYLE as F,FOOTER_IDX as tt,isConnectorGeometry as k,OFFICE_TEXT_STYLES as et,placeholderLevels as st,TEXT_INSETS as w,TEXTBOX_FRAME as rt}from"./office.js";import{masterPlaceholder as C}from"./placeholders.js";import{strict as a}from"./strict.js";import{EMU_PER_PT as N,SLIDE_SIZES as M,length as l,lengthOr as E}from"./units.js";class it extends Error{constructor(t){super(`${t} (allyhub slides capabilities lists what the API holds).`),this.name="Unsupported"}}const g=i=>{throw new it(i)},nt=/^#?[0-9a-f]{6}$/iu,L=i=>{if(!nt.test(i))throw new Error(`rgb ${i} is not RRGGBB.`);return`#${i.replace("#","").toUpperCase()}`};function I(i,t){if(typeof i!="string")return i;const e=Y(i);if(e===void 0)throw new Error(`${t} is a theme colour (accent1), one lighter or darker (accent1 lighter 40%) or #RRGGBB, not ${i}.`);return e}export const RGBColor=Object.assign(function(t,e,s){for(const o of[t,e,s])if(!Number.isInteger(o)||o<0||o>255)throw new Error(`RGBColor(${String(t)}, ${String(e)}, ${String(s)}): each is 0 to 255.`);const r=`#${[t,e,s].map(o=>o.toString(16).padStart(2,"0")).join("").toUpperCase()}`;return new.target===void 0?r:new String(r)},{from_string:i=>L(i)});export class ColorFormat{read;write;constructor(t,e){return this.read=t,this.write=e,a(this,"ColorFormat")}get theme_color(){const t=this.read();return t===void 0?void 0:T(t)}set theme_color(t){this.write(t===void 0?void 0:A(t,this.brightness))}get brightness(){const t=this.read();return typeof t=="object"&&"brightness"in t?t.brightness:0}set brightness(t){if(!(t>=-1&&t<=1))throw new RangeError(`brightness ${String(t)} is not a number from -1.0 to 1.0.`);const e=this.read();if(e===void 0)throw new TypeError("There is no colour to set the brightness of: set theme_color first.");const s=T(e);if(s!==void 0)this.write(A(s,t));else if(t!==0)throw new TypeError("Only a theme colour has a brightness here, so an RGB colour does not: set theme_color first, or rgb to the colour it makes.")}get rgb(){const t=this.read();return typeof t=="object"&&"rgb"in t?t.rgb:void 0}set rgb(t){this.write(t===void 0?void 0:{rgb:L(t)})}}export class Font{def;constructor(t){return this.def=t,a(this,"Font")}_set(t,e){e===void 0?Reflect.deleteProperty(this.def,t):this.def[t]=e}get strike(){return this.def.strike}set strike(t){this._set("strike",t)}get baseline(){return this.def.baseline}set baseline(t){this._set("baseline",t)}get highlight(){return this.def.highlight}set highlight(t){this._set("highlight",t)}get name(){return this.def.name}set name(t){this._set("name",t)}get size(){return E(this.def.size)}set size(t){if(t!==void 0&&t<12700)throw new Error(`A font size is a Length of Pt(1) and over: Pt(${String(t)}) for ${String(t)} points; ${String(t)} alone is ${String(t)} EMU.`);this._set("size",t)}get bold(){return this.def.bold}set bold(t){this._set("bold",t)}get italic(){return this.def.italic}set italic(t){this._set("italic",t)}get underline(){return this.def.underline}set underline(t){this._set("underline",t)}get spacing(){return E(this.def.spacing)}set spacing(t){this._set("spacing",t)}get color(){return new ColorFormat(()=>this.def.color,t=>{this._set("color",t)})}}export class Hyperlink{def;constructor(t){return this.def=t,a(this,"_Hyperlink")}get address(){return this.def.font?.link}set address(t){this.def.font??={},t===void 0?Reflect.deleteProperty(this.def.font,"link"):this.def.font.link=t}}export class Run{def;constructor(t){return this.def=t,a(this,"_Run")}get text(){return this.def.text}set text(t){this.def.text=t}get font(){return this.def.font??={},new Font(this.def.font)}get hyperlink(){return new Hyperlink(this.def)}}const ot=i=>{if(!Number.isFinite(i)||i<=0)throw new Error(`line_spacing ${String(i)} is not over 0.`);return Number.isInteger(i)&&i>=N?{fixed:i}:{lines:i}},ht=i=>i===void 0?void 0:"lines"in i?i.lines:l(i.fixed),D=i=>i.split(/\n|\v/u).flatMap((t,e)=>[...e>0?[{text:"\v"}]:[],...t===""?[]:[{text:t}]]);class G{_set(t,e){e===void 0?Reflect.deleteProperty(this.fmt,t):this.fmt[t]=e}get alignment(){return this.fmt.alignment}set alignment(t){this._set("alignment",t)}get line_spacing(){return ht(this.fmt.line_spacing)}set line_spacing(t){this._set("line_spacing",t===void 0?void 0:ot(t))}get space_before(){return E(this.fmt.space_before)}set space_before(t){this._set("space_before",t)}get space_after(){return E(this.fmt.space_after)}set space_after(t){this._set("space_after",t)}get font(){return this.fmt.font??={},new Font(this.fmt.font)}}export class Paragraph extends G{fmt;constructor(t){return super(),this.fmt=t,a(this,"_Paragraph")}get text(){return this.fmt.runs.map(t=>t.text).join("")}set text(t){this.fmt.runs=D(t)}get runs(){return this.fmt.runs.filter(t=>t.text!=="\v").map(t=>new Run(t))}add_run(){const t={text:""};return this.fmt.runs.push(t),new Run(t)}add_line_break(){this.fmt.runs.push({text:"\v"})}clear(){return this.fmt.runs=[],this}get level(){return this.fmt.level}set level(t){if(!Number.isInteger(t)||t<0||t>8)throw new Error(`level ${String(t)} is not 0 to 8.`);this.fmt.level=t}}export class ListLevel extends G{fmt;constructor(t){return super(),this.fmt=t,a(this,"ListLevel")}get numbered(){return this.fmt.numbered}set numbered(t){this._set("numbered",t)}get bullet(){return this.fmt.bullet}set bullet(t){this._set("bullet",t)}get bullet_font(){return this.fmt.bullet_font}set bullet_font(t){this._set("bullet_font",t)}get margin_left(){return E(this.fmt.margin_left)}set margin_left(t){this._set("margin_left",t)}get indent(){return E(this.fmt.indent)}set indent(t){this._set("indent",t)}}const O=i=>Object.freeze(i.map(t=>new ListLevel(t))),at=()=>Array.from({length:9},()=>({})),S=()=>({paragraphs:[],levels:at()});export class TextFrame{def;constructor(t){return this.def=t,a(this,"TextFrame")}_set(t,e){e===void 0?Reflect.deleteProperty(this.def,t):this.def[t]=e}get text(){return this.def.paragraphs.map(t=>t.runs.map(e=>e.text).join("")).join(`
3
3
  `)}set text(t){this.def.paragraphs=t.split(`
4
- `).map(e=>({runs:N(e),level:0}))}get paragraphs(){return this.def.paragraphs.length===0&&this.def.paragraphs.push({runs:[],level:0}),this.def.paragraphs.map(t=>new Paragraph(t))}add_paragraph(){this.def.paragraphs.length===0&&this.def.paragraphs.push({runs:[],level:0});const t={runs:[],level:0};return this.def.paragraphs.push(t),new Paragraph(t)}clear(){const t=this.def.paragraphs[0];this.def.paragraphs=t?[{...t,runs:[]}]:[]}fit_text(t,e=18,s,r){this.def.auto_size="text",this.def.word_wrap=!0;for(const n of this.def.paragraphs)for(const o of n.runs)o.font={...o.font,size:Math.trunc(e*A),...t===void 0?{}:{name:t},...s===void 0?{}:{bold:s},...r===void 0?{}:{italic:r}}}get list_style(){return S(this.def.levels)}get vertical_anchor(){return this.def.vertical_anchor}set vertical_anchor(t){this._set("vertical_anchor",t)}get auto_size(){return this.def.auto_size}set auto_size(t){this._set("auto_size",t)}get word_wrap(){return this.def.word_wrap}set word_wrap(t){this._set("word_wrap",t)}get margin_left(){return l(this.def.margin_left??w.left)}set margin_left(t){this.def.margin_left=t}get margin_top(){return l(this.def.margin_top??w.top)}set margin_top(t){this.def.margin_top=t}get margin_right(){return l(this.def.margin_right??w.right)}set margin_right(t){this.def.margin_right=t}get margin_bottom(){return l(this.def.margin_bottom??w.bottom)}set margin_bottom(t){this.def.margin_bottom=t}}export class FillFormat{read;write;start;shape;constructor(t,e,s="lt1",r){return this.read=t,this.write=e,this.start=s,this.shape=r,h(this,"FillFormat")}solid(){const t=this.read();this.shape&&Reflect.deleteProperty(this.shape,"gradient"),t==null&&this.write(this.start)}background(){this.shape&&Reflect.deleteProperty(this.shape,"gradient"),this.write(null)}_shape(t){if(!this.shape)throw new TypeError(`Only a shape's fill has ${t}.`);return this.shape}gradient(){this._shape("a gradient").gradient??={angle:90,stops:[{at:0,color:"accent1"},{at:1,color:"accent2"}]}}get gradient_angle(){return this._gradient().angle}set gradient_angle(t){this._gradient().angle=t}get gradient_stops(){return this._gradient().stops}set gradient_stops(t){if(t.length<2)throw new Error("A gradient has two stops at least.");this._gradient().stops=t.map(e=>({...e}))}_gradient(){const{gradient:t}=this._shape("a gradient");if(!t)throw new TypeError("This fill is no gradient: call fill.gradient() first.");return t}get transparency(){return this._shape("a transparency").fill_transparency??0}set transparency(t){if(!(t>=0&&t<=1))throw new Error(`A transparency is a share, 0 to 1, not ${String(t)}.`);this._shape("a transparency").fill_transparency=t}get type(){if(this.shape?.gradient)return"gradient";const t=this.read();return t===void 0?void 0:t===null?"background":"solid"}get fore_color(){const t=this.read();if(t==null)throw new TypeError("This fill is not solid, so it has no fore_color: call fill.solid() first.");return new ColorFormat(()=>this.read()??void 0,e=>{this.write(e??this.start)})}}export class ShadowFormat{def;constructor(t){return this.def=t,h(this,"ShadowFormat")}_shadow(){return this.def.shadow??={...P},this.def.shadow}get inherit(){return this.def.shadow===void 0}set inherit(t){t?Reflect.deleteProperty(this.def,"shadow"):this._shadow()}get blur_radius(){return l(this._shadow().blur)}set blur_radius(t){this._shadow().blur=t}get distance(){return l(this._shadow().distance)}set distance(t){this._shadow().distance=t}get angle(){return this._shadow().angle}set angle(t){this._shadow().angle=t}get transparency(){return this._shadow().transparency}set transparency(t){this._shadow().transparency=t}get color(){const t=this._shadow();return new ColorFormat(()=>t.color,e=>{t.color=e??P.color})}}export class LineFormat{def;constructor(t){return this.def=t,h(this,"LineFormat")}get color(){return new ColorFormat(()=>this.def.line??void 0,t=>{this.def.line=t??null})}get fill(){return new FillFormat(()=>this.def.line,t=>{this.def.line=t},"dk1")}get width(){return l(this.def.line_width??0)}set width(t){this.def.line_width=t}get dash_style(){return this.def.line_dash??null}set dash_style(t){t===null?delete this.def.line_dash:this.def.line_dash=t}get begin_arrow(){return this.def.line_begin??"none"}set begin_arrow(t){this.def.line_begin=t}get end_arrow(){return this.def.line_end??"none"}set end_arrow(t){this.def.line_end=t}}export class Background{holder;constructor(t){return this.holder=t,h(this,"_Background")}get fill(){return new FillFormat(()=>this.holder.background,t=>{this.holder.background=t??"lt1"})}}export const adjustmentDefaults=i=>z(i).map(t=>t.value/1e5);export class Adjustments{def;constructor(t){return this.def=t,h(this,"Adjustments",{index:e=>this._values()[e],setIndex:(e,s)=>{this._set(e,Number(s))}})}_values(){return this.def.adjustments??adjustmentDefaults(this.def.geometry??"rect")}get length(){return this._values().length}_set(t,e){const s=this._values();if(t<0||t>=s.length)throw new RangeError(`adjustments[${String(t)}]: ${this.def.geometry??"this shape"} has ${String(s.length)}.`);if(!Number.isFinite(e))throw new Error(`adjustments[${String(t)}] = ${String(e)} is not a number.`);s[t]=e,this.def.adjustments=s}}const rt={left:0,top:0,width:0,height:0};export class Shape{def;inherit;constructor(t,e=()=>{}){return this.def=t,this.inherit=e,h(this,"Shape")}get _def(){return this.def}_frame(){return this.def.frame??this.inherit()??rt}_own(){return this.def.frame??={...this._frame()},this.def.frame}get name(){return this.def.name}set name(t){this.def.name=t}get shape_type(){return this.def.path?"freeform":k(this.def.geometry)?"line":this.def.kind}get is_placeholder(){return this.def.kind==="placeholder"}get has_table(){return this.def.table!==void 0}get has_chart(){return this.def.chart!==void 0}get chart(){if(!this.def.chart)throw new Error(`${this.def.name} is not a chart.`);return new Y(this.def.chart)}get table(){if(!this.def.table)throw new Error(`${this.def.name} is not a table.`);return new Table(this.def.table)}get placeholder_format(){if(!this.def.placeholder)throw new Error(`${this.def.name} is not a placeholder.`);return h({...this.def.placeholder},"_PlaceholderFormat")}get left(){return l(this._frame().left)}set left(t){this._own().left=t}get top(){return l(this._frame().top)}set top(t){this._own().top=t}get width(){return l(this._frame().width)}set width(t){this._own().width=t}get height(){return l(this._frame().height)}set height(t){this._own().height=t}get rotation(){return this.def.rotation??0}set rotation(t){if(!Number.isFinite(t))throw new Error(`${this.def.name}: rotation is a number of degrees.`);const e=(Math.trunc(t*6e4)%216e5+216e5)%216e5/6e4;e===0?Reflect.deleteProperty(this.def,"rotation"):this.def.rotation=e}get has_text_frame(){return this.def.text!==void 0}get text_frame(){if(!this.def.text)throw new Error(`${this.def.name} (a ${this.shape_type}) has no text frame: has_text_frame is false.`);return new TextFrame(this.def.text)}get text(){return this.text_frame.text}set text(t){this.text_frame.text=t}get fill(){return new FillFormat(()=>this.def.fill,t=>{this.def.fill=t},"lt1",this.def)}get line(){return new LineFormat(this.def)}get shadow(){return new ShadowFormat(this.def)}get adjustments(){return new Adjustments(this.def)}_ends(t){if(this.def.path||!k(this.def.geometry))throw new Error(`${this.def.name}.${t}: it is not a connector (add_connector makes one).`);return I(this._frame(),this.def.flip,this.def.rotation)}_move(t,e){const s=G(t,e,this.def.rotation);this.def.frame=s.frame,s.flip?this.def.flip=s.flip:Reflect.deleteProperty(this.def,"flip")}get begin_x(){return l(Math.round(this._ends("begin_x")[0][0]))}set begin_x(t){const[e,s]=this._ends("begin_x");this._move([t,e[1]],s)}get begin_y(){return l(Math.round(this._ends("begin_y")[0][1]))}set begin_y(t){const[e,s]=this._ends("begin_y");this._move([e[0],t],s)}get end_x(){return l(Math.round(this._ends("end_x")[1][0]))}set end_x(t){const[e,s]=this._ends("end_x");this._move(e,[t,s[1]])}get end_y(){return l(Math.round(this._ends("end_y")[1][1]))}set end_y(t){const[e,s]=this._ends("end_y");this._move(e,[s[0],t])}begin_connect(t,e){this._connect("begin",t,e)}end_connect(t,e){this._connect("end",t,e)}_connect(t,e,s){const r=`${t}_connect`,[n,o]=this._ends(r);if(!(e instanceof Shape))throw new Error(`${this.def.name}.${r}(): its shape is a Shape.`);const a=e._def,f={frame:e._frame(),geometry:a.geometry,adjustments:a.adjustments,flip:a.flip,rotation:a.rotation,path:a.path},u=D(f).length;if(!Number.isInteger(s)||s<0||s>=u)throw new Error(`${this.def.name}.${r}(): ${a.name} has connection sites 0 to ${String(u-1)}; ${String(s)} is not one.`);const c=B(f,s)??(t==="begin"?n:o);this.def.connect={...this.def.connect,[t]:{shape:a.name,site:s}},this._move(t==="begin"?c:n,t==="begin"?o:c)}}const it=i=>typeof i=="number"&&Number.isFinite(i),g=(i,t,e,s,{line:r=!1}={})=>{for(const[n,o]of Object.entries({left:i,top:t,width:e,height:s}))if(!it(o))throw new Error(`${n} ${String(o)} is not a length (Emu, Inches, Pt, Cm, Mm).`);if(r?e<0||s<0:e<=0||s<=0)throw new Error("A shape's width and height are over 0.");return{left:Math.trunc(i),top:Math.trunc(t),width:Math.trunc(e),height:Math.trunc(s)}},nt=new Set(Object.values(v));export class FreeformBuilder{steps;sx;sy;make;constructor(t,e,s){return this.steps=[{op:"move",x:t[0],y:t[1]}],[this.sx,this.sy]=typeof e=="number"?[e,e]:e,this.make=s,h(this,"FreeformBuilder")}add_line_segments(t,e=!0){for(const[s,r]of t)this.steps.push({op:"line",x:s,y:r});return e&&this.steps.push({op:"close"}),this}add_curve_segment(t,e,s,r,n,o){return this.steps.push({op:"curve",x1:t,y1:e,x2:s,y2:r,x:n,y:o}),this}move_to(t,e){return this.steps.push({op:"move",x:t,y:e}),this}convert_to_shape(t=0,e=0){this.steps.length<2&&m("convert_to_shape(): a freeform needs a segment.");const s=this.steps.flatMap(d=>d.op==="close"?[]:d.op==="curve"?[[d.x1,d.y1],[d.x2,d.y2],[d.x,d.y]]:[[d.x,d.y]]),r=s.map(d=>d[0]),n=s.map(d=>d[1]),o=Math.min(...r),a=Math.min(...n),f=Math.max(...r)-o,u=Math.max(...n)-a,c=(d,_)=>({x:d-o,y:_-a});return this.make({w:f,h:u,steps:this.steps.map(d=>{if(d.op==="close")return d;if(d.op!=="curve")return{op:d.op,...c(d.x,d.y)};const _=c(d.x1,d.y1),x=c(d.x2,d.y2);return{op:"curve",x1:_.x,y1:_.y,x2:x.x,y2:x.y,...c(d.x,d.y)}})},g(Math.round(o*this.sx)+t,Math.round(a*this.sy)+e,Math.round(f*this.sx),Math.round(u*this.sy)))}}export class GroupShape{list;_name;make;constructor(t,e,s){return this.list=t,this._name=e,this.make=s,h(this,"GroupShape")}members(){return this.list.filter(t=>t.group===this._name)}box(){const t=this.members().flatMap(r=>r.frame?[r.frame]:[]),e=Math.min(...t.map(r=>r.left)),s=Math.min(...t.map(r=>r.top));return{left:t.length>0?e:0,top:t.length>0?s:0,right:Math.max(0,...t.map(r=>r.left+r.width)),bottom:Math.max(0,...t.map(r=>r.top+r.height))}}get shapes(){return this.make(this._name)}get shape_type(){return X.GROUP}get name(){return this._name}set name(t){for(const e of this.members())e.group=t;this._name=t}get left(){return l(this.box().left)}set left(t){const e=t-this.box().left;for(const s of this.members())s.frame&&(s.frame.left+=e)}get top(){return l(this.box().top)}set top(t){const e=t-this.box().top;for(const s of this.members())s.frame&&(s.frame.top+=e)}get width(){const t=this.box();return l(t.right-t.left)}get height(){const t=this.box();return l(t.bottom-t.top)}}export class Cell{def;table;row;col;constructor(t,e,s,r){return this.def=t,this.table=e,this.row=s,this.col=r,h(this,"_Cell")}get text_frame(){return new TextFrame(this.def.text)}get text(){return this.text_frame.text}set text(t){this.text_frame.text=t}get fill(){return new FillFormat(()=>this.def.fill,t=>{this.def.fill=t})}get borders(){return this.def.borders??{}}set borders(t){this.def.borders=t}get margin_left(){return l(this.def.text.margin_left??w.left)}set margin_left(t){this.def.text.margin_left=t}get margin_right(){return l(this.def.text.margin_right??w.right)}set margin_right(t){this.def.text.margin_right=t}get margin_top(){return l(this.def.text.margin_top??w.top)}set margin_top(t){this.def.text.margin_top=t}get margin_bottom(){return l(this.def.text.margin_bottom??w.bottom)}set margin_bottom(t){this.def.text.margin_bottom=t}get vertical_anchor(){return this.def.text.vertical_anchor}set vertical_anchor(t){t===void 0?delete this.def.text.vertical_anchor:this.def.text.vertical_anchor=t}get is_merge_origin(){return(this.def.span_width??1)>1||(this.def.span_height??1)>1}get is_spanned(){return this.def.spanned===!0}get span_width(){return this.def.span_width??1}get span_height(){return this.def.span_height??1}merge(t){const e=[this.row,t.row].sort((f,u)=>f-u),s=[this.col,t.col].sort((f,u)=>f-u),[r=0,n=0]=e,[o=0,a=0]=s;for(let f=r;f<=n;f++)for(let u=o;u<=a;u++){const c=this.table.rows[f]?.cells[u];c&&(f===r&&u===o?(a>o&&(c.span_width=a-o+1),n>r&&(c.span_height=n-r+1)):c.spanned=!0)}}split(){const t=this.span_width,e=this.span_height;delete this.def.span_width,delete this.def.span_height;for(let s=this.row;s<this.row+e;s++)for(let r=this.col;r<this.col+t;r++){const n=this.table.rows[s]?.cells[r];n&&delete n.spanned}}}export class Column{def;at;constructor(t,e){return this.def=t,this.at=e,h(this,"_Column")}get width(){return l(this.def.columns[this.at]??0)}set width(t){this.def.columns[this.at]=t}}export class Row{def;at;constructor(t,e){return this.def=t,this.at=e,h(this,"_Row")}get row(){const t=this.def.rows[this.at];if(!t)throw new Error(`The table has no row ${String(this.at)}.`);return t}get height(){return l(this.row.height)}set height(t){this.row.height=t}}export class Table{def;constructor(t){return this.def=t,h(this,"Table")}cell(t,e){const s=this.def.rows[t]?.cells[e];if(!s)throw new Error(`cell(): the table has ${String(this.def.rows.length)} rows and ${String(this.def.columns.length)} columns.`);return new Cell(s,this.def,t,e)}*iter_cells(){for(let t=0;t<this.def.rows.length;t++)for(let e=0;e<this.def.columns.length;e++)yield this.cell(t,e)}get columns(){return this.def.columns.map((t,e)=>new Column(this.def,e))}get rows(){return this.def.rows.map((t,e)=>new Row(this.def,e))}flag(t){return this.def[t]===!0}get first_row(){return this.flag("first_row")}set first_row(t){this.def.first_row=t}get first_col(){return this.flag("first_col")}set first_col(t){this.def.first_col=t}get last_row(){return this.flag("last_row")}set last_row(t){this.def.last_row=t}get last_col(){return this.flag("last_col")}set last_col(t){this.def.last_col=t}get horz_banding(){return this.flag("horz_banding")}set horz_banding(t){this.def.horz_banding=t}get vert_banding(){return this.flag("vert_banding")}set vert_banding(t){this.def.vert_banding=t}}function ot(i,t,e=[]){const s=new Set([...i,...e].map(n=>n.name));let r=1;for(;s.has(`${t}-${String(r)}`);)r++;return`${t}-${String(r)}`}export class ShapeCollection{list;base;components;inherit;group;under;constructor(t,e,s,r=()=>{},n=()=>[],o){return this.list=t,this.base=e,this.components=s,this.inherit=r,this.under=n,this.group=o,h(this,"SlideShapes",{index:a=>this._at(a)})}_wrap(t){return new Shape(t,()=>this.inherit(t))}_at(t){const e=this.list[t];return e?this._wrap(e):void 0}*[Symbol.iterator](){for(const t of this.list)yield this._wrap(t)}get length(){return this.list.length}get(t){const e=this.list.find(s=>s.name===t);return e?this._wrap(e):void 0}get title(){const t=this.list.find(e=>e.placeholder?.type==="title"||e.placeholder?.type==="ctrTitle");return t?this._wrap(t):void 0}get placeholders(){return new Placeholders(this.list,this.inherit)}_add(t,e){const s={name:ot(this.list,t,this.under()),...e,...this.group===void 0?{}:{group:this.group}};return this.list.push(s),this._wrap(s)}add_textbox(t,e,s,r){return this._add("textbox",{kind:"textbox",frame:g(t,e,s,r),text:{...E(),...W}})}add_picture(t,e,s,r,n){return(r===void 0||n===void 0)&&m("add_picture() takes a width and a height here: a picture's own size is not read while a deck's code runs"),this._add("picture",{kind:"picture",frame:g(e,s,r??0,n??0),media:{path:t,base:this.base}})}add_movie(t,e,s,r,n,o={}){return this._add("movie",{kind:"movie",frame:g(e,s,r,n),media:{path:t,base:this.base,...o.poster_frame_time===void 0?{}:{poster:o.poster_frame_time}}})}add_shape(t,e,s,r,n){nt.has(t)||m(`add_shape(): ${t} is not one of MSO_SHAPE's ${Object.keys(v).join(", ")}`);const o=E();return o.vertical_anchor=p.vertical_anchor,o.paragraphs=[{runs:[],level:0,alignment:p.alignment}],this._add("shape",{kind:"autoshape",frame:g(e,s,r,n),geometry:t,fill:p.fill,line:p.line,line_width:p.line_width,text:o})}add_table(t,e,s,r,n,o){(t<1||e<1)&&m("add_table(): a table has at least a row and a column.");const a=Math.floor(n/e),f=Math.floor(o/t);return this._add("table",{kind:"table",frame:g(s,r,n,o),table:{columns:Array.from({length:e},()=>a),rows:Array.from({length:t},()=>({height:f,cells:Array.from({length:e},()=>({text:E()}))}))}})}add_chart(t,e,s,r,n,o){return this._add("chart",{kind:"chart",frame:g(e,s,r,n),chart:{type:t,categories:[...o.categories],series:o._series()}})}add_group_shape(){this.group!==void 0&&m("add_group_shape(): a group here holds shapes, not another group.");let t=1;for(;this.list.some(e=>e.group===`group-${String(t)}`);)t++;return new GroupShape(this.list,`group-${String(t)}`,e=>new ShapeCollection(this.list,this.base,this.components,this.inherit,this.under,e))}build_freeform(t=0,e=0,s=1){return new FreeformBuilder([t,e],s,(r,n)=>{const o=E();return o.vertical_anchor=p.vertical_anchor,o.paragraphs=[{runs:[],level:0,alignment:p.alignment}],this._add("freeform",{kind:"autoshape",frame:n,path:r,fill:p.fill,line:p.line,line_width:p.line_width,text:o})})}add_connector(t,e,s,r,n){k(t)||m(`add_connector(): ${t} is not one of MSO_CONNECTOR's ${Object.keys(U).join(", ")}, nor a connector's preset (${J.join(", ")})`);const o=g(Math.min(e,r),Math.min(s,n),Math.abs(r-e),Math.abs(n-s),{line:!0}),a=r<e,f=n<s;return this._add("connector",{kind:"autoshape",frame:o,geometry:t,...a||f?{flip:{...a?{h:a}:{},...f?{v:f}:{}}}:{},line:R.line,line_width:R.line_width})}add_component(t,e,s,r,n,o={},a={}){if(!Object.hasOwn(this.components(),t))throw new Error(`add_component(): the presentation has no component ${t}; add it with prs.components.add("${t}", { … }) first.`);if(a.dur!==void 0&&!(Number.isFinite(a.dur)&&a.dur>0))throw new Error(`add_component(): dur is how long ${t} moves, seconds over 0; it was ${String(a.dur)}.`);return this._add(t,{kind:"component",frame:g(e,s,r,n),component:{name:t,props:o,...a.dur===void 0?{}:{dur:a.dur}}})}}export const NAME_OF_TYPE={title:"title",ctrTitle:"title",subTitle:"subtitle",body:"body",pic:"picture",media:"media",obj:"content",dt:"date",ftr:"footer",sldNum:"slide-number"};export class Placeholders{list;inherit;constructor(t,e=()=>{}){return this.list=t,this.inherit=e,h(this,"placeholders",{index:s=>this.get(s)})}_wrap(t){return new Shape(t,()=>this.inherit(t))}*[Symbol.iterator](){for(const t of this.list)t.kind==="placeholder"&&(yield this._wrap(t))}get length(){return this.list.filter(t=>t.kind==="placeholder").length}get(t){const e=this.list.find(s=>s.kind==="placeholder"&&(typeof t=="number"?s.placeholder?.idx===t:s.name===t||s.placeholder?.type===t));return e?this._wrap(e):void 0}add(t,e,s,r,n,o={}){const a=typeof e=="object"?e:o,f=typeof e=="object"?void 0:e;Object.values(j).includes(t)||m(`placeholders.add(): ${t} is not one of PP_PLACEHOLDER's ${Object.keys(j).join(", ")}`);const u=this.list.filter(b=>b.kind==="placeholder"),c=new Set(u.map(b=>b.placeholder?.idx));let d=t==="title"||t==="ctrTitle"?0:Z[t]??1;for(;c.has(d)&&d!==0;)d++;if(c.has(d))throw new Error("A layout has one title placeholder (idx 0).");const _=a.name??NAME_OF_TYPE[t];if(this.list.some(b=>b.name===_))throw new Error(`Two shapes are ${_}: give the placeholder a name ({ name }).`);const x=[f,s,r,n].filter(b=>b!==void 0);if(x.length!==0&&x.length!==4)throw new Error("placeholders.add(type, left, top, width, height): give all four, or none to take the master's frame.");const O={name:_,kind:"placeholder",placeholder:{type:t,idx:d},...x.length===4?{frame:g(f??0,s??0,r??0,n??0)}:{},text:{paragraphs:[],levels:K(t)}};return this.list.push(O),this._wrap(O)}}export class SlideLayout{def;master;ctx;constructor(t,e,s){return this.def=t,this.master=e,this.ctx=s,h(this,"SlideLayout")}get _def(){return this.def}inherit=t=>t.placeholder?F(this.master._def,t.placeholder.type)?.frame:void 0;get name(){return this.def.name}get slide_master(){return this.master}get display_master_shapes(){return this.def.display_master_shapes??!0}set display_master_shapes(t){t?delete this.def.display_master_shapes:this.def.display_master_shapes=!1}get background(){return new Background(this.def)}get placeholders(){return new Placeholders(this.def.shapes,this.inherit)}get shapes(){return new ShapeCollection(this.def.shapes,this.ctx.base,this.ctx.components,this.inherit,()=>this.master._def.shapes)}}export class SlideLayouts{list;make;constructor(t,e){return this.list=t,this.make=e,h(this,"SlideLayouts",{index:s=>this.list[s]})}*[Symbol.iterator](){yield*this.list}get length(){return this.list.length}get_by_name(t,e){return this.list.find(s=>s.name===t)??e}index(t){const e=this.list.indexOf(t);if(e<0)throw new Error(`${t.name} is not among these layouts.`);return e}add(t,e){if(!this.make)throw new Error("A layout is added to a master: master.slide_layouts.add(name).");const s=this.make(t);return e?.(s),s}}export class TextStyles{def;constructor(t){return this.def=t,h(this,"text_styles")}get title_style(){return S(this.def.title)}get body_style(){return S(this.def.body)}get other_style(){return S(this.def.other)}}export class SlideMaster{def;layouts=[];ctx;allLayouts;constructor(t,e,s){return this.def=t,this.ctx=e,this.allLayouts=s,h(this,"SlideMaster")}get _def(){return this.def}get name(){return this.def.name}get background(){return new Background(this.def)}get placeholders(){return new Placeholders(this.def.shapes)}get shapes(){return new ShapeCollection(this.def.shapes,this.ctx.base,this.ctx.components)}get text_styles(){return new TextStyles(this.def.text_styles)}get slide_layouts(){return new SlideLayouts(this.layouts,t=>{if(this.allLayouts.some(r=>r.name===t))throw new Error(`Two layouts are "${t}": a layout's name is unique in the deck, as its slides file names it.`);const e={name:t,master:this.def.name,shapes:[]};this.def.layouts.push(e);const s=new SlideLayout(e,this,this.ctx);return this.layouts.push(s),this.allLayouts.push(s),s})}}export class SlideMasters{list;make;constructor(t,e){return this.list=t,this.make=e,h(this,"SlideMasters",{index:s=>this.list[s]})}*[Symbol.iterator](){yield*this.list}get length(){return this.list.length}index(t){return this.list.indexOf(t)}add(t,e){const s=this.make(t);return e?.(s),s}}export class GeneratedSlide{own;def;layout;constructor(t,e,s){this.def=t,this.layout=e,this.own=e._def.shapes.filter(n=>n.kind==="placeholder").map(n=>({name:n.name,kind:"placeholder",...n.placeholder?{placeholder:{...n.placeholder}}:{},text:E()}));const r=n=>{const o=e._def.shapes.find(a=>a.kind==="placeholder"&&a.placeholder?.idx===n.placeholder?.idx);return o?o.frame??(o.placeholder?F(e.slide_master._def,o.placeholder.type)?.frame:void 0):void 0};return this._shapes=new ShapeCollection(this.own,s.base,s.components,r,()=>[...e.slide_master._def.shapes,...e._def.shapes]),this._placeholders=new Placeholders(this.own,r),h(this,"Slide")}_shapes;_placeholders;get shapes(){return this._shapes}get placeholders(){return this._placeholders}get slide_id(){return this.def.id}get slide_layout(){return this.layout}get has_notes_slide(){return this.def.notes!==void 0}get notes_slide(){const t=this.def;return h({notes_text_frame:h({get text(){return t.notes??""},set text(e){t.notes=e}},"TextFrame")},"NotesSlide")}get transition(){return this.def.transition}set transition(t){t===void 0?delete this.def.transition:this.def.transition=t}get animations(){return new Animations(this.def.animations??=[])}_done(){const t={},e=[];for(const s of this.own)s.kind==="placeholder"&&s.placeholder?(s.text?.paragraphs.some(r=>r.runs.length>0)&&(t[s.placeholder.idx]=s.text.paragraphs),s.frame&&e.push({...s,text:E()})):e.push(s);return{...this.def,shapes:e,text:t}}}export class Animations{list;constructor(t){return this.list=t,h(this,"Animations")}add(t,e,s={}){this.list.push({shape:typeof t=="string"?t:t.name,effect:e,...s})}get length(){return this.list.length}}class ht{gen;constructor(t){return this.gen=t,h(this,"slides")}add_slide(t,e){return this.gen._add(t,e)}}export class Generator{list=[];prs;ctx;constructor(t,e){return this.prs=t,this.ctx=e,h(this,"Generator")}data(t){return this.ctx.data(t)}get slides(){return new ht(this)}_add(t,e){const s=typeof t=="string"?this.prs._layout(t):t;if(!s)throw new Error(`add_slide(): the presentation has no layout ${typeof t=="string"?t:t.name}.`);if(!/^[A-Za-z0-9_-]+$/u.test(e))throw new Error(`add_slide(): ${e} is not an id of letters, digits, _ and -.`);if(this.list.some(n=>n.slide_id===e))throw new Error(`add_slide(): two slides are ${e}.`);const r=new GeneratedSlide({id:e,layout:s.name,shapes:[],text:{}},s,this.prs._ctx);return this.list.push(r),r}_made(){return this.list.map(t=>t._done())}}const at=()=>JSON.parse(JSON.stringify(q));export class Presentation{masters=[];layouts=[];def;_ctx;constructor(t,e){return this.def={slide_width:t[0],slide_height:t[1],masters:[],components:{},generators:{}},this._ctx={base:e,components:()=>this.def.components},h(this,"Presentation")}get _def(){return this.def}get slide_width(){return l(this.def.slide_width)}set slide_width(t){this.def.slide_width=t}get slide_height(){return l(this.def.slide_height)}set slide_height(t){this.def.slide_height=t}get slide_masters(){return new SlideMasters(this.masters,t=>{if(this.masters.some(r=>r.name===t))throw new Error(`Two masters are "${t}".`);const e={name:t,background:"lt1",text_styles:at(),shapes:[],layouts:[]};this.def.masters.push(e);const s=new SlideMaster(e,this._ctx,this.layouts);return this.masters.push(s),s})}get slide_master(){const t=this.masters[0];if(!t)throw new Error("The presentation has no master yet: prs.slide_masters.add(name) makes one.");return t}get slide_layouts(){const t=this.masters[0];return t?t.slide_layouts:new SlideLayouts([])}get slides(){return m("A deck's slides are in the slides file presentation({ slides }) names, in order, each on a layout, and their words in its script; slides made from data are a generator's (prs.generators.add)")}save(){return m("A deck is not saved by its code: allyhub render writes its PDF, pictures and PPTX")}get theme(){return this.def.theme??={},this.def.theme}set theme(t){this.def.theme=t}get components(){return h({add:(t,e)=>{if(Object.hasOwn(this.def.components,t))throw new Error(`Two components are "${t}".`);const s=H(t,e);if(!s)throw new Error(`Component ${t} is not a component: give what defineComponent makes, or { props, layers }.`);this.def.components[t]=s}},"components")}get generators(){return h({add:(t,e)=>{if(Object.hasOwn(this.def.generators,t))throw new Error(`Two generators are "${t}".`);this.def.generators[t]={name:t,make:s=>{const r=new Generator(this,s);return e(r),r._made()}}}},"generators")}_layout(t){return this.layouts.find(e=>e.name===t)}}export const DECK_BRAND="__allyhubDeck";export function isDeck(i){return typeof i=="object"&&i!==null&&DECK_BRAND in i}export const presentationFor=i=>(t,e)=>{const[s,r]=typeof t=="function"?[{},t]:[t,e];if(typeof r!="function")throw new Error(`A deck's module exports one deck: export default presentation({ slides: "./deck.yaml", script: "./deck.{locale}.yaml", size }, (prs) => { … masters, layouts, components … }), its slides and its script named from its folder.`);if(s.script!==void 0&&!s.script.includes("{locale}"))throw new Error(`presentation(): script ${s.script} names one file: write {locale} in its name for each language (./deck.{locale}.yaml).`);if(typeof s.size=="string"&&!Object.hasOwn($,s.size))throw new Error(`presentation(): size ${s.size} is not one of ${Object.keys($).join(", ")}, or { width, height } in EMU.`);return{[DECK_BRAND]:!0,kind:"slides",options:s,build:r,written:{file:i}}};export function evaluateDeck(i){const t=i.options.size??"16:9",e=typeof t=="string"?$[t]:[t.width,t.height],s=i.written.file.split("/").slice(0,-1).join("/"),r=new Presentation(e,s);return i.options.theme&&(r.theme=JSON.parse(JSON.stringify(i.options.theme))),i.build(r),r._def}
4
+ `).map(e=>({runs:D(e),level:0}))}get paragraphs(){return this.def.paragraphs.length===0&&this.def.paragraphs.push({runs:[],level:0}),this.def.paragraphs.map(t=>new Paragraph(t))}add_paragraph(){this.def.paragraphs.length===0&&this.def.paragraphs.push({runs:[],level:0});const t={runs:[],level:0};return this.def.paragraphs.push(t),new Paragraph(t)}clear(){const t=this.def.paragraphs[0];this.def.paragraphs=t?[{...t,runs:[]}]:[]}fit_text(t,e=18,s,r){this.def.auto_size="text",this.def.word_wrap=!0;for(const n of this.def.paragraphs)for(const o of n.runs)o.font={...o.font,size:Math.trunc(e*N),...t===void 0?{}:{name:t},...s===void 0?{}:{bold:s},...r===void 0?{}:{italic:r}}}get list_style(){return O(this.def.levels)}get vertical_anchor(){return this.def.vertical_anchor}set vertical_anchor(t){this._set("vertical_anchor",t)}get auto_size(){return this.def.auto_size}set auto_size(t){this._set("auto_size",t)}get word_wrap(){return this.def.word_wrap}set word_wrap(t){this._set("word_wrap",t)}get margin_left(){return l(this.def.margin_left??w.left)}set margin_left(t){this.def.margin_left=t}get margin_top(){return l(this.def.margin_top??w.top)}set margin_top(t){this.def.margin_top=t}get margin_right(){return l(this.def.margin_right??w.right)}set margin_right(t){this.def.margin_right=t}get margin_bottom(){return l(this.def.margin_bottom??w.bottom)}set margin_bottom(t){this.def.margin_bottom=t}}export class FillFormat{read;write;start;shape;constructor(t,e,s="lt1",r){return this.read=t,this.write=e,this.start=s,this.shape=r,a(this,"FillFormat")}solid(){const t=this.read();this.shape&&Reflect.deleteProperty(this.shape,"gradient"),t==null&&this.write(this.start)}background(){this.shape&&Reflect.deleteProperty(this.shape,"gradient"),this.write(null)}_shape(t){if(!this.shape)throw new TypeError(`Only a shape's fill has ${t}.`);return this.shape}gradient(){this._shape("a gradient").gradient??={angle:90,stops:[{at:0,color:"accent1"},{at:1,color:"accent2"}]}}get gradient_angle(){return this._gradient().angle}set gradient_angle(t){this._gradient().angle=t}get gradient_stops(){return this._gradient().stops.map(t=>new GradientStop(t))}set gradient_stops(t){if(t.length<2)throw new Error("A gradient has two stops at least.");this._gradient().stops=t.map(e=>e instanceof GradientStop?GradientStop.defOf(e):{...e,color:I(e.color,"A gradient stop's colour")})}_gradient(){const{gradient:t}=this._shape("a gradient");if(!t)throw new TypeError("This fill is no gradient: call fill.gradient() first.");return t}get transparency(){return this._shape("a transparency").fill_transparency??0}set transparency(t){if(!(t>=0&&t<=1))throw new Error(`A transparency is a share, 0 to 1, not ${String(t)}.`);this._shape("a transparency").fill_transparency=t}get type(){if(this.shape?.gradient)return"gradient";const t=this.read();return t===void 0?void 0:t===null?"background":"solid"}get fore_color(){const t=this.read();if(t==null)throw new TypeError("This fill is not solid, so it has no fore_color: call fill.solid() first.");return new ColorFormat(()=>this.read()??void 0,e=>{this.write(e??this.start)})}}export class GradientStop{stop;constructor(t){return this.stop=t,a(this,"GradientStop")}static defOf(t){return{...t.stop}}get color(){return new ColorFormat(()=>this.stop.color,t=>{t!==void 0&&(this.stop.color=t)})}get position(){return this.stop.at}set position(t){if(!(t>=0&&t<=1))throw new Error(`A stop's position is a share, 0 to 1, not ${String(t)}.`);this.stop.at=t}get transparency(){return this.stop.transparency??0}set transparency(t){if(!(t>=0&&t<=1))throw new Error(`A transparency is a share, 0 to 1, not ${String(t)}.`);t===0?Reflect.deleteProperty(this.stop,"transparency"):this.stop.transparency=t}}export class ShadowFormat{def;constructor(t){return this.def=t,a(this,"ShadowFormat")}_shadow(){return this.def.shadow??={...z},this.def.shadow}get inherit(){return this.def.shadow===void 0}set inherit(t){t?Reflect.deleteProperty(this.def,"shadow"):this.def.shadow??=null}get blur_radius(){return l(this._shadow().blur)}set blur_radius(t){this._shadow().blur=t}get distance(){return l(this._shadow().distance)}set distance(t){this._shadow().distance=t}get angle(){return this._shadow().angle}set angle(t){this._shadow().angle=t}get transparency(){return this._shadow().transparency}set transparency(t){this._shadow().transparency=t}get color(){const t=this._shadow();return new ColorFormat(()=>t.color,e=>{t.color=e??z.color})}}export class LineFormat{def;constructor(t){return this.def=t,a(this,"LineFormat")}get color(){return new ColorFormat(()=>this.def.line??void 0,t=>{this.def.line=t??null})}get fill(){return new FillFormat(()=>this.def.line,t=>{this.def.line=t},"dk1")}get width(){return l(this.def.line_width??0)}set width(t){this.def.line_width=t}get dash_style(){return this.def.line_dash??null}set dash_style(t){t===null?delete this.def.line_dash:this.def.line_dash=x(q,"MSO_LINE","dash_style",t)}get begin_arrow(){return this.def.line_begin??"none"}set begin_arrow(t){this.def.line_begin=x(j,"MSO_ARROWHEAD","begin_arrow",t)}get end_arrow(){return this.def.line_end??"none"}set end_arrow(t){this.def.line_end=x(j,"MSO_ARROWHEAD","end_arrow",t)}get begin_arrow_width(){return this.def.line_begin_size?.w??"med"}set begin_arrow_width(t){this.def.line_begin_size={...this.def.line_begin_size,w:x($,"MSO_ARROWHEAD_SIZE","begin_arrow_width",t)}}get begin_arrow_length(){return this.def.line_begin_size?.len??"med"}set begin_arrow_length(t){this.def.line_begin_size={...this.def.line_begin_size,len:x($,"MSO_ARROWHEAD_SIZE","begin_arrow_length",t)}}get end_arrow_width(){return this.def.line_end_size?.w??"med"}set end_arrow_width(t){this.def.line_end_size={...this.def.line_end_size,w:x($,"MSO_ARROWHEAD_SIZE","end_arrow_width",t)}}get end_arrow_length(){return this.def.line_end_size?.len??"med"}set end_arrow_length(t){this.def.line_end_size={...this.def.line_end_size,len:x($,"MSO_ARROWHEAD_SIZE","end_arrow_length",t)}}}function x(i,t,e,s){if(Object.values(i).includes(s))return s;throw new Error(`${e}: ${String(s)} is not one of ${t}'s ${Object.keys(i).join(", ")}.`)}export class Background{holder;constructor(t){return this.holder=t,a(this,"_Background")}get fill(){return new FillFormat(()=>this.holder.background,t=>{this.holder.background=t??"lt1"})}}export const adjustmentDefaults=i=>H(i).map(t=>t.value/1e5);export class Adjustments{def;constructor(t){return this.def=t,a(this,"Adjustments",{index:e=>this._values()[e],setIndex:(e,s)=>{this._set(e,Number(s))}})}_values(){return this.def.adjustments??adjustmentDefaults(this.def.geometry??"rect")}get length(){return this._values().length}_set(t,e){const s=this._values();if(t<0||t>=s.length)throw new RangeError(`adjustments[${String(t)}]: ${this.def.geometry??"this shape"} has ${String(s.length)}.`);if(!Number.isFinite(e))throw new Error(`adjustments[${String(t)}] = ${String(e)} is not a number.`);s[t]=e,this.def.adjustments=s}}const dt={left:0,top:0,width:0,height:0};export class Shape{def;inherit;constructor(t,e=()=>{}){return this.def=t,this.inherit=e,a(this,"Shape")}get _def(){return this.def}_frame(){return this.def.frame??this.inherit()??dt}_own(){return this.def.frame??={...this._frame()},this.def.frame}get name(){return this.def.name}set name(t){this.def.name=t}get shape_type(){return this.def.path?"freeform":k(this.def.geometry)?"line":this.def.kind}get is_placeholder(){return this.def.kind==="placeholder"}get has_table(){return this.def.table!==void 0}get has_chart(){return this.def.chart!==void 0}get chart(){if(!this.def.chart)throw new Error(`${this.def.name} is not a chart.`);return new Q(this.def.chart)}get table(){if(!this.def.table)throw new Error(`${this.def.name} is not a table.`);return new Table(this.def.table)}get placeholder_format(){if(!this.def.placeholder)throw new Error(`${this.def.name} is not a placeholder.`);return a({...this.def.placeholder},"_PlaceholderFormat")}get left(){return l(this._frame().left)}set left(t){this._own().left=t}get top(){return l(this._frame().top)}set top(t){this._own().top=t}get width(){return l(this._frame().width)}set width(t){this._own().width=t}get height(){return l(this._frame().height)}set height(t){this._own().height=t}get rotation(){return this.def.rotation??0}set rotation(t){if(!Number.isFinite(t))throw new Error(`${this.def.name}: rotation is a number of degrees.`);const e=(Math.trunc(t*6e4)%216e5+216e5)%216e5/6e4;e===0?Reflect.deleteProperty(this.def,"rotation"):this.def.rotation=e}get flip_h(){return this.def.flip?.h===!0}set flip_h(t){this._flip("h",t)}get flip_v(){return this.def.flip?.v===!0}set flip_v(t){this._flip("v",t)}_flip(t,e){const s={...this.def.flip};e?s[t]=!0:Reflect.deleteProperty(s,t),Object.keys(s).length===0?Reflect.deleteProperty(this.def,"flip"):this.def.flip=s}get has_text_frame(){return this.def.text!==void 0}get text_frame(){if(!this.def.text)throw new Error(`${this.def.name} (a ${this.shape_type}) has no text frame: has_text_frame is false.`);return new TextFrame(this.def.text)}get text(){return this.text_frame.text}set text(t){this.text_frame.text=t}get fill(){return new FillFormat(()=>this.def.fill,t=>{this.def.fill=t},"lt1",this.def)}get line(){return new LineFormat(this.def)}get shadow(){return new ShadowFormat(this.def)}get adjustments(){return new Adjustments(this.def)}_ends(t){if(this.def.path||!k(this.def.geometry))throw new Error(`${this.def.name}.${t}: it is not a connector (add_connector makes one).`);return U(this._frame(),this.def.flip,this.def.rotation)}_move(t,e){const s=B(t,e,this.def.rotation);this.def.frame=s.frame,s.flip?this.def.flip=s.flip:Reflect.deleteProperty(this.def,"flip")}get begin_x(){return l(Math.round(this._ends("begin_x")[0][0]))}set begin_x(t){const[e,s]=this._ends("begin_x");this._move([t,e[1]],s)}get begin_y(){return l(Math.round(this._ends("begin_y")[0][1]))}set begin_y(t){const[e,s]=this._ends("begin_y");this._move([e[0],t],s)}get end_x(){return l(Math.round(this._ends("end_x")[1][0]))}set end_x(t){const[e,s]=this._ends("end_x");this._move(e,[t,s[1]])}get end_y(){return l(Math.round(this._ends("end_y")[1][1]))}set end_y(t){const[e,s]=this._ends("end_y");this._move(e,[s[0],t])}begin_connect(t,e){this._connect("begin",t,e)}end_connect(t,e){this._connect("end",t,e)}_connect(t,e,s){const r=`${t}_connect`,[n,o]=this._ends(r);if(!(e instanceof Shape))throw new Error(`${this.def.name}.${r}(): its shape is a Shape.`);const h=e._def,f={frame:e._frame(),geometry:h.geometry,adjustments:h.adjustments,flip:h.flip,rotation:h.rotation,path:h.path},u=Z(f).length;if(!Number.isInteger(s)||s<0||s>=u)throw new Error(`${this.def.name}.${r}(): ${h.name} has connection sites 0 to ${String(u-1)}; ${String(s)} is not one.`);const c=W(f,s)??(t==="begin"?n:o);this.def.connect={...this.def.connect,[t]:{shape:h.name,site:s}},this._move(t==="begin"?c:n,t==="begin"?o:c)}}const lt=i=>typeof i=="number"&&Number.isFinite(i),_=(i,t,e,s)=>{for(const[r,n]of Object.entries({left:i,top:t,width:e,height:s}))if(!lt(n))throw new Error(`${r} ${String(n)} is not a length (Emu, Inches, Pt, Cm, Mm).`);if(e<0||s<0)throw new Error("A shape's width and height are 0 or more.");return{left:Math.trunc(i),top:Math.trunc(t),width:Math.trunc(e),height:Math.trunc(s)}},ft=new Set(Object.values(P));export class FreeformBuilder{steps;sx;sy;make;constructor(t,e,s){return this.steps=[{op:"move",x:t[0],y:t[1]}],[this.sx,this.sy]=typeof e=="number"?[e,e]:e,this.make=s,a(this,"FreeformBuilder")}add_line_segments(t,e=!0){for(const[s,r]of t)this.steps.push({op:"line",x:s,y:r});return e&&this.steps.push({op:"close"}),this}add_curve_segment(t,e,s,r,n,o){if(![t,e,s,r,n,o].every(h=>Number.isFinite(h)))throw new Error("add_curve_segment(x1, y1, x2, y2, x, y) takes six numbers in local units: its two control points and the point it ends at.");return this.steps.push({op:"curve",x1:t,y1:e,x2:s,y2:r,x:n,y:o}),this}move_to(t,e){return this.steps.push({op:"move",x:t,y:e}),this}convert_to_shape(t=0,e=0){this.steps.length<2&&g("convert_to_shape(): a freeform needs a segment.");const s=this.steps.flatMap(d=>d.op==="close"?[]:d.op==="curve"?[[d.x1,d.y1],[d.x2,d.y2],[d.x,d.y]]:[[d.x,d.y]]),r=s.map(d=>d[0]),n=s.map(d=>d[1]),o=Math.min(...r),h=Math.min(...n),f=Math.max(...r)-o,u=Math.max(...n)-h;f===0&&u===0&&g("convert_to_shape(): a freeform's points are all one point.");const c=(d,m)=>({x:d-o,y:m-h});return this.make({w:f,h:u,steps:this.steps.map(d=>{if(d.op==="close")return d;if(d.op!=="curve")return{op:d.op,...c(d.x,d.y)};const m=c(d.x1,d.y1),y=c(d.x2,d.y2);return{op:"curve",x1:m.x,y1:m.y,x2:y.x,y2:y.y,...c(d.x,d.y)}})},_(Math.round(o*this.sx)+t,Math.round(h*this.sy)+e,Math.round(f*this.sx),Math.round(u*this.sy)))}}export class GroupShape{list;_name;make;constructor(t,e,s){return this.list=t,this._name=e,this.make=s,a(this,"GroupShape")}members(){return this.list.filter(t=>t.group===this._name)}box(){const t=this.members().flatMap(r=>r.frame?[r.frame]:[]),e=Math.min(...t.map(r=>r.left)),s=Math.min(...t.map(r=>r.top));return{left:t.length>0?e:0,top:t.length>0?s:0,right:Math.max(0,...t.map(r=>r.left+r.width)),bottom:Math.max(0,...t.map(r=>r.top+r.height))}}get shapes(){return this.make(this._name)}get shape_type(){return K.GROUP}get name(){return this._name}set name(t){for(const e of this.members())e.group=t;this._name=t}get left(){return l(this.box().left)}set left(t){const e=t-this.box().left;for(const s of this.members())s.frame&&(s.frame.left+=e)}get top(){return l(this.box().top)}set top(t){const e=t-this.box().top;for(const s of this.members())s.frame&&(s.frame.top+=e)}get width(){const t=this.box();return l(t.right-t.left)}get height(){const t=this.box();return l(t.bottom-t.top)}}export class Cell{def;table;row;col;constructor(t,e,s,r){return this.def=t,this.table=e,this.row=s,this.col=r,a(this,"_Cell")}get text_frame(){return new TextFrame(this.def.text)}get text(){return this.text_frame.text}set text(t){this.text_frame.text=t}get fill(){return new FillFormat(()=>this.def.fill,t=>{this.def.fill=t})}get borders(){return this.def.borders??{}}set borders(t){this.def.borders=Object.fromEntries(Object.entries(t).map(([e,s])=>[e,{...s,color:I(s.color,`A cell's ${e} border`)}]))}get margin_left(){return l(this.def.text.margin_left??w.left)}set margin_left(t){this.def.text.margin_left=t}get margin_right(){return l(this.def.text.margin_right??w.right)}set margin_right(t){this.def.text.margin_right=t}get margin_top(){return l(this.def.text.margin_top??w.top)}set margin_top(t){this.def.text.margin_top=t}get margin_bottom(){return l(this.def.text.margin_bottom??w.bottom)}set margin_bottom(t){this.def.text.margin_bottom=t}get vertical_anchor(){return this.def.text.vertical_anchor}set vertical_anchor(t){t===void 0?delete this.def.text.vertical_anchor:this.def.text.vertical_anchor=t}get is_merge_origin(){return(this.def.span_width??1)>1||(this.def.span_height??1)>1}get is_spanned(){return this.def.spanned===!0}get span_width(){return this.def.span_width??1}get span_height(){return this.def.span_height??1}merge(t){const e=[this.row,t.row].sort((f,u)=>f-u),s=[this.col,t.col].sort((f,u)=>f-u),[r=0,n=0]=e,[o=0,h=0]=s;for(let f=r;f<=n;f++)for(let u=o;u<=h;u++){const c=this.table.rows[f]?.cells[u];c&&(f===r&&u===o?(h>o&&(c.span_width=h-o+1),n>r&&(c.span_height=n-r+1)):c.spanned=!0)}}split(){const t=this.span_width,e=this.span_height;delete this.def.span_width,delete this.def.span_height;for(let s=this.row;s<this.row+e;s++)for(let r=this.col;r<this.col+t;r++){const n=this.table.rows[s]?.cells[r];n&&delete n.spanned}}}export class Column{def;at;constructor(t,e){return this.def=t,this.at=e,a(this,"_Column")}get width(){return l(this.def.columns[this.at]??0)}set width(t){this.def.columns[this.at]=t}}export class Row{def;at;constructor(t,e){return this.def=t,this.at=e,a(this,"_Row")}get row(){const t=this.def.rows[this.at];if(!t)throw new Error(`The table has no row ${String(this.at)}.`);return t}get height(){return l(this.row.height)}set height(t){this.row.height=t}}export class Table{def;constructor(t){return this.def=t,a(this,"Table")}cell(t,e){const s=this.def.rows[t]?.cells[e];if(!s)throw new Error(`cell(): the table has ${String(this.def.rows.length)} rows and ${String(this.def.columns.length)} columns.`);return new Cell(s,this.def,t,e)}*iter_cells(){for(let t=0;t<this.def.rows.length;t++)for(let e=0;e<this.def.columns.length;e++)yield this.cell(t,e)}get columns(){return this.def.columns.map((t,e)=>new Column(this.def,e))}get rows(){return this.def.rows.map((t,e)=>new Row(this.def,e))}flag(t){return this.def[t]===!0}get first_row(){return this.flag("first_row")}set first_row(t){this.def.first_row=t}get first_col(){return this.flag("first_col")}set first_col(t){this.def.first_col=t}get last_row(){return this.flag("last_row")}set last_row(t){this.def.last_row=t}get last_col(){return this.flag("last_col")}set last_col(t){this.def.last_col=t}get horz_banding(){return this.flag("horz_banding")}set horz_banding(t){this.def.horz_banding=t}get vert_banding(){return this.flag("vert_banding")}set vert_banding(t){this.def.vert_banding=t}}function ut(i,t,e=[]){const s=new Set([...i,...e].map(n=>n.name));let r=1;for(;s.has(`${t}-${String(r)}`);)r++;return`${t}-${String(r)}`}export class ShapeCollection{list;base;components;inherit;group;under;constructor(t,e,s,r=()=>{},n=()=>[],o){return this.list=t,this.base=e,this.components=s,this.inherit=r,this.under=n,this.group=o,a(this,"SlideShapes",{index:h=>this._at(h)})}_wrap(t){return new Shape(t,()=>this.inherit(t))}_at(t){const e=this.list[t];return e?this._wrap(e):void 0}*[Symbol.iterator](){for(const t of this.list)yield this._wrap(t)}get length(){return this.list.length}get(t){const e=this.list.find(s=>s.name===t);return e?this._wrap(e):void 0}get title(){const t=this.list.find(e=>e.placeholder?.type==="title"||e.placeholder?.type==="ctrTitle");return t?this._wrap(t):void 0}get placeholders(){return new Placeholders(this.list,this.inherit)}_add(t,e){const s={name:ut(this.list,t,this.under()),...e,...this.group===void 0?{}:{group:this.group}};return this.list.push(s),this._wrap(s)}add_textbox(t,e,s,r){return this._add("textbox",{kind:"textbox",frame:_(t,e,s,r),text:{...S(),...rt}})}add_picture(t,e,s,r,n){return(r===void 0||n===void 0)&&g("add_picture() takes a width and a height here: a picture's own size is not read while a deck's code runs"),this._add("picture",{kind:"picture",frame:_(e,s,r??0,n??0),media:{path:t,base:this.base}})}add_movie(t,e,s,r,n,o={}){return this._add("movie",{kind:"movie",frame:_(e,s,r,n),media:{path:t,base:this.base,...o.poster_frame_time===void 0?{}:{poster:o.poster_frame_time}}})}add_shape(t,e,s,r,n){ft.has(t)||g(`add_shape(): ${t} is not one of MSO_SHAPE's ${Object.keys(P).join(", ")}`);const o=S();return o.vertical_anchor=p.vertical_anchor,o.paragraphs=[{runs:[],level:0,alignment:p.alignment}],this._add("shape",{kind:"autoshape",frame:_(e,s,r,n),geometry:t,fill:p.fill,line:p.line,line_width:p.line_width,text:o})}add_table(t,e,s,r,n,o){(t<1||e<1)&&g("add_table(): a table has at least a row and a column.");const h=Math.floor(n/e),f=Math.floor(o/t);return this._add("table",{kind:"table",frame:_(s,r,n,o),table:{columns:Array.from({length:e},()=>h),rows:Array.from({length:t},()=>({height:f,cells:Array.from({length:e},()=>({text:S()}))}))}})}add_chart(t,e,s,r,n,o){return this._add("chart",{kind:"chart",frame:_(e,s,r,n),chart:{type:t,categories:[...o.categories],series:o._series()}})}add_group_shape(){this.group!==void 0&&g("add_group_shape(): a group here holds shapes, not another group.");let t=1;for(;this.list.some(e=>e.group===`group-${String(t)}`);)t++;return new GroupShape(this.list,`group-${String(t)}`,e=>new ShapeCollection(this.list,this.base,this.components,this.inherit,this.under,e))}build_freeform(t=0,e=0,s=1){return new FreeformBuilder([t,e],s,(r,n)=>{const o=S();return o.vertical_anchor=p.vertical_anchor,o.paragraphs=[{runs:[],level:0,alignment:p.alignment}],this._add("freeform",{kind:"autoshape",frame:n,path:r,fill:p.fill,line:p.line,line_width:p.line_width,text:o})})}add_connector(t,e,s,r,n){k(t)||g(`add_connector(): ${t} is not one of MSO_CONNECTOR's ${Object.keys(J).join(", ")}, nor a connector's preset (${V.join(", ")})`);const o=_(Math.min(e,r),Math.min(s,n),Math.abs(r-e),Math.abs(n-s)),h=r<e,f=n<s;return this._add("connector",{kind:"autoshape",frame:o,geometry:t,...h||f?{flip:{...h?{h}:{},...f?{v:f}:{}}}:{},line:F.line,line_width:F.line_width})}add_component(t,e,s,r,n,o={},h={}){if(!Object.hasOwn(this.components(),t))throw new Error(`add_component(): the presentation has no component ${t}; add it with prs.components.add("${t}", { … }) first.`);if(h.dur!==void 0&&!(Number.isFinite(h.dur)&&h.dur>0))throw new Error(`add_component(): dur is how long ${t} moves, seconds over 0; it was ${String(h.dur)}.`);return this._add(t,{kind:"component",frame:_(e,s,r,n),component:{name:t,props:o,...h.dur===void 0?{}:{dur:h.dur}}})}}export const NAME_OF_TYPE={title:"title",ctrTitle:"title",subTitle:"subtitle",body:"body",pic:"picture",media:"media",obj:"content",dt:"date",ftr:"footer",sldNum:"slide-number"};export class Placeholders{list;inherit;constructor(t,e=()=>{}){return this.list=t,this.inherit=e,a(this,"placeholders",{index:s=>this.get(s)})}_wrap(t){return new Shape(t,()=>this.inherit(t))}*[Symbol.iterator](){for(const t of this.list)t.kind==="placeholder"&&(yield this._wrap(t))}get length(){return this.list.filter(t=>t.kind==="placeholder").length}get(t){const e=this.list.find(s=>s.kind==="placeholder"&&(typeof t=="number"?s.placeholder?.idx===t:s.name===t||s.placeholder?.type===t));return e?this._wrap(e):void 0}add(t,e,s,r,n,o={}){const h=typeof e=="object"?e:o,f=typeof e=="object"?void 0:e;Object.values(v).includes(t)||g(`placeholders.add(): ${t} is not one of PP_PLACEHOLDER's ${Object.keys(v).join(", ")}`);const u=this.list.filter(b=>b.kind==="placeholder"),c=new Set(u.map(b=>b.placeholder?.idx));let d=t==="title"||t==="ctrTitle"?0:tt[t]??1;for(c.has(d)&&d===0&&(d=1);c.has(d);)d++;const m=h.name??NAME_OF_TYPE[t];if(this.list.some(b=>b.name===m))throw new Error(`Two shapes are ${m}: give the placeholder a name ({ name }).`);const y=[f,s,r,n].filter(b=>b!==void 0);if(y.length!==0&&y.length!==4)throw new Error("placeholders.add(type, left, top, width, height): give all four, or none to take the master's frame.");const R={name:m,kind:"placeholder",placeholder:{type:t,idx:d},...y.length===4?{frame:_(f??0,s??0,r??0,n??0)}:{},text:{paragraphs:[],levels:st(t)}};return this.list.push(R),this._wrap(R)}}export class SlideLayout{def;master;ctx;constructor(t,e,s){return this.def=t,this.master=e,this.ctx=s,a(this,"SlideLayout")}get _def(){return this.def}inherit=t=>t.placeholder?C(this.master._def,t.placeholder.type)?.frame:void 0;get name(){return this.def.name}get slide_master(){return this.master}get display_master_shapes(){return this.def.display_master_shapes??!0}set display_master_shapes(t){t?delete this.def.display_master_shapes:this.def.display_master_shapes=!1}get background(){return new Background(this.def)}get placeholders(){return new Placeholders(this.def.shapes,this.inherit)}get shapes(){return new ShapeCollection(this.def.shapes,this.ctx.base,this.ctx.components,this.inherit,()=>this.master._def.shapes)}}export class SlideLayouts{list;make;constructor(t,e){return this.list=t,this.make=e,a(this,"SlideLayouts",{index:s=>this.list[s]})}*[Symbol.iterator](){yield*this.list}get length(){return this.list.length}get_by_name(t,e){return this.list.find(s=>s.name===t)??e}index(t){const e=this.list.indexOf(t);if(e<0)throw new Error(`${t.name} is not among these layouts.`);return e}add(t,e){if(!this.make)throw new Error("A layout is added to a master: master.slide_layouts.add(name).");const s=this.make(t);return e?.(s),s}}export class TextStyles{def;constructor(t){return this.def=t,a(this,"text_styles")}get title_style(){return O(this.def.title)}get body_style(){return O(this.def.body)}get other_style(){return O(this.def.other)}}export class SlideMaster{def;layouts=[];ctx;allLayouts;constructor(t,e,s){return this.def=t,this.ctx=e,this.allLayouts=s,a(this,"SlideMaster")}get _def(){return this.def}get name(){return this.def.name}get background(){return new Background(this.def)}get placeholders(){return new Placeholders(this.def.shapes)}get shapes(){return new ShapeCollection(this.def.shapes,this.ctx.base,this.ctx.components)}get text_styles(){return new TextStyles(this.def.text_styles)}get slide_layouts(){return new SlideLayouts(this.layouts,t=>{if(this.allLayouts.some(r=>r.name===t))throw new Error(`Two layouts are "${t}": a layout's name is unique in the deck, as its slides file names it.`);const e={name:t,master:this.def.name,shapes:[]};this.def.layouts.push(e);const s=new SlideLayout(e,this,this.ctx);return this.layouts.push(s),this.allLayouts.push(s),s})}}export class SlideMasters{list;make;constructor(t,e){return this.list=t,this.make=e,a(this,"SlideMasters",{index:s=>this.list[s]})}*[Symbol.iterator](){yield*this.list}get length(){return this.list.length}index(t){return this.list.indexOf(t)}add(t,e){const s=this.make(t);return e?.(s),s}}export class GeneratedSlide{own;def;layout;constructor(t,e,s){this.def=t,this.layout=e,this.own=e._def.shapes.filter(n=>n.kind==="placeholder").map(n=>({name:n.name,kind:"placeholder",...n.placeholder?{placeholder:{...n.placeholder}}:{},text:S()}));const r=n=>{const o=e._def.shapes.find(h=>h.kind==="placeholder"&&h.placeholder?.idx===n.placeholder?.idx);return o?o.frame??(o.placeholder?C(e.slide_master._def,o.placeholder.type)?.frame:void 0):void 0};return this._shapes=new ShapeCollection(this.own,s.base,s.components,r,()=>[...e.slide_master._def.shapes,...e._def.shapes]),this._placeholders=new Placeholders(this.own,r),a(this,"Slide")}_shapes;_placeholders;get shapes(){return this._shapes}get placeholders(){return this._placeholders}get slide_id(){return this.def.id}get slide_layout(){return this.layout}get has_notes_slide(){return this.def.notes!==void 0}get notes_slide(){const t=this.def;return a({notes_text_frame:a({get text(){return t.notes??""},set text(e){t.notes=e}},"TextFrame")},"NotesSlide")}get transition(){return this.def.transition}set transition(t){t===void 0?delete this.def.transition:this.def.transition=t}get animations(){return new Animations(this.def.animations??=[])}_done(){const t={},e=[];for(const s of this.own)s.kind==="placeholder"&&s.placeholder?(s.text?.paragraphs.some(r=>r.runs.length>0)&&(t[s.placeholder.idx]=s.text.paragraphs),s.frame&&e.push({...s,text:S()})):e.push(s);return{...this.def,shapes:e,text:t}}}export class Animations{list;constructor(t){return this.list=t,a(this,"Animations")}add(t,e,s={}){this.list.push({shape:typeof t=="string"?t:t.name,effect:e,...s})}get length(){return this.list.length}}class ct{gen;constructor(t){return this.gen=t,a(this,"slides")}add_slide(t,e){return this.gen._add(t,e)}}export class Generator{list=[];prs;ctx;constructor(t,e){return this.prs=t,this.ctx=e,a(this,"Generator")}data(t){return this.ctx.data(t)}get slides(){return new ct(this)}_add(t,e){const s=typeof t=="string"?this.prs._layout(t):t;if(!s)throw new Error(`add_slide(): the presentation has no layout ${typeof t=="string"?t:t.name}.`);if(!/^[A-Za-z0-9_-]+$/u.test(e))throw new Error(`add_slide(): ${e} is not an id of letters, digits, _ and -.`);if(this.list.some(n=>n.slide_id===e))throw new Error(`add_slide(): two slides are ${e}.`);const r=new GeneratedSlide({id:e,layout:s.name,shapes:[],text:{}},s,this.prs._ctx);return this.list.push(r),r}_made(){return this.list.map(t=>t._done())}}const pt=()=>JSON.parse(JSON.stringify(et));export class Presentation{masters=[];layouts=[];def;_ctx;constructor(t,e){return this.def={slide_width:t[0],slide_height:t[1],masters:[],components:{},generators:{}},this._ctx={base:e,components:()=>this.def.components},a(this,"Presentation")}get _def(){return this.def}get slide_width(){return l(this.def.slide_width)}set slide_width(t){this.def.slide_width=t}get slide_height(){return l(this.def.slide_height)}set slide_height(t){this.def.slide_height=t}get slide_masters(){return new SlideMasters(this.masters,t=>{if(this.masters.some(r=>r.name===t))throw new Error(`Two masters are "${t}".`);const e={name:t,background:"lt1",text_styles:pt(),shapes:[],layouts:[]};this.def.masters.push(e);const s=new SlideMaster(e,this._ctx,this.layouts);return this.masters.push(s),s})}get slide_master(){const t=this.masters[0];if(!t)throw new Error("The presentation has no master yet: prs.slide_masters.add(name) makes one.");return t}get slide_layouts(){const t=this.masters[0];return t?t.slide_layouts:new SlideLayouts([])}get slides(){return g("A deck's slides are in the slides file presentation({ slides }) names, in order, each on a layout, and their words in its script; slides made from data are a generator's (prs.generators.add)")}save(){return g("A deck is not saved by its code: allyhub render writes its PDF, pictures and PPTX")}get theme(){return this.def.theme??={},this.def.theme}set theme(t){this.def.theme=t}get components(){return a({add:(t,e)=>{if(Object.hasOwn(this.def.components,t))throw new Error(`Two components are "${t}".`);const s=X(t,e);if(!s)throw new Error(`Component ${t} is not a component: give what defineComponent makes, or { props, layers }.`);this.def.components[t]=s}},"components")}get generators(){return a({add:(t,e)=>{if(Object.hasOwn(this.def.generators,t))throw new Error(`Two generators are "${t}".`);this.def.generators[t]={name:t,make:s=>{const r=new Generator(this,s);return e(r),r._made()}}}},"generators")}_layout(t){return this.layouts.find(e=>e.name===t)}}export const DECK_BRAND="__allyhubDeck";export function isDeck(i){return typeof i=="object"&&i!==null&&DECK_BRAND in i}export const presentationFor=i=>(t,e)=>{const[s,r]=typeof t=="function"?[{},t]:[t,e];if(typeof r!="function")throw new Error(`A deck's module exports one deck: export default presentation({ slides: "./deck.yaml", script: "./deck.{locale}.yaml", size }, (prs) => { … masters, layouts, components … }), its slides and its script named from its folder.`);if(s.script!==void 0&&!s.script.includes("{locale}"))throw new Error(`presentation(): script ${s.script} names one file: write {locale} in its name for each language (./deck.{locale}.yaml).`);if(typeof s.size=="string"&&!Object.hasOwn(M,s.size))throw new Error(`presentation(): size ${s.size} is not one of ${Object.keys(M).join(", ")}, or { width, height } in EMU.`);return{[DECK_BRAND]:!0,kind:"slides",options:s,build:r,written:{file:i}}};export function evaluateDeck(i){const t=i.options.size??"16:9",e=typeof t=="string"?M[t]:[t.width,t.height],s=i.written.file.split("/").slice(0,-1).join("/"),r=new Presentation(e,s);return i.options.theme&&(r.theme=JSON.parse(JSON.stringify(i.options.theme))),i.build(r),r._def}
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{Animations as l,Background as p,Cell as h,ColorFormat as d,Column as c,FillFormat as m,Font as y,FreeformBuilder as u,GeneratedSlide as f,Generator as _,GroupShape as g,Hyperlink as w,LineFormat as b,ListLevel as S,ShadowFormat as P,Paragraph as A,Placeholders as L,Presentation as O,Row as C,Run as E,Shape as x,ShapeCollection as T,SlideLayout as R,SlideLayouts as k,SlideMaster as v,SlideMasters as M,Table as F,TextFrame as I,TextStyles as G}from"./api.js";import{CategoryChartData as B,Chart as H,XyChartData as D,XySeriesData as N,ChartAxis as j,ChartFormat as X,ChartLegend as W,MajorGridlines as z,TickLabels as U,ChartPlot as Y,ChartPoint as Z,ChartSeries as K,DataLabels as V}from"./chart-api.js";import{MSO_ANCHOR as q,MSO_ARROWHEAD as J,MSO_AUTO_SIZE as Q,MSO_CONNECTOR as $,MSO_FILL as ee,MSO_LINE as te,MSO_SHAPE as ae,MSO_SHAPE_TYPE as oe,MSO_THEME_COLOR as se,PP_ALIGN as re,PP_PLACEHOLDER as ne,THEME_FONT as ie,XL_CHART_TYPE as le,XL_LABEL_POSITION as pe,XL_LEGEND_POSITION as he}from"./enums.js";import{publicNames as s}from"./strict.js";const a={Presentation:{theme:"The theme's colours (dk1…folHlink) and fonts (major, minor), over the project's look.",components:"components.add(name, { props, layers }): a shape drawn by code, by the layer contract.",generators:"generators.add(name, (g) => { g.data(path); g.slides.add_slide(layout, id) … }): slides made from data, placed in the slides file as one block."},SlideMasters:{add:"add(name): a master, with Office's text styles and no placeholders yet."},_Cell:{borders:"Its edges: { left, right, top, bottom }, each { color, width } (a:lnL…)."},LineFormat:{begin_arrow:"What the end of the line where it starts has (MSO_ARROWHEAD): PowerPoint's Begin Arrow type (a:headEnd).",end_arrow:"What the end of the line where it ends has (MSO_ARROWHEAD): PowerPoint's End Arrow type (a:tailEnd)."},FillFormat:{transparency:"How much of the fill shows through, a share: PowerPoint's Transparency (a:alpha).",gradient_stops:"Its stops, [{ at, color, transparency }], `at` and `transparency` shares; python-pptx's stops can only be read and changed in place."},ShadowFormat:{blur_radius:"How far the shadow blurs, a Length (a:outerShdw blurRad).",distance:"How far it falls from the shape, a Length (dist).",angle:"The way it falls, degrees clockwise from the right (dir).",transparency:"How much shows through it, a share (a:alpha).",color:"Its colour, a ColorFormat."},FreeformBuilder:{add_curve_segment:"add_curve_segment(x1, y1, x2, y2, x, y): a cubic Bézier segment by its two control points (a:cubicBezTo)."},Font:{strike:"A line through it (@strike).",baseline:"Raised or lowered, a share of its size: superscript 0.3, subscript -0.25 (@baseline).",highlight:"The colour behind it, #RRGGBB as RGBColor gives one (a:highlight).",spacing:"Space added between letters, a Length, negative to tighten (PowerPoint's Character Spacing, a:rPr spc)."},SlideMaster:{text_styles:"Its text styles (p:txStyles): title_style, body_style, other_style, nine ListLevels each, Office's to start with."},SlideLayouts:{add:"add(name): a layout on this master."},SlideLayout:{display_master_shapes:"Whether its master's shapes are drawn on its slides, true unless set: PowerPoint's Hide Background Graphics (@showMasterSp)."},placeholders:{add:"add(PP_PLACEHOLDER.X, left?, top?, width?, height?, { name }): a placeholder on a master or a layout; a layout's without a frame takes its master's of its base type."},SlideShapes:{add_component:"add_component(name, left, top, width, height, props): a component of the presentation in a frame.",get:"get(name): a shape by its name."},TextFrame:{list_style:"Its list style (a:lstStyle): nine ListLevels, level 0 first, what its paragraphs take where they set nothing."},ListLevel:{"*":"A level of a list style: alignment, line_spacing, space_before, space_after, font, bullet (a character, or null for none), bullet_font, numbered (a:buAutoNum: arabicPeriod, alphaLcPeriod…), margin_left, indent."},text_styles:{"*":"title_style, body_style, other_style: a master's text styles, nine ListLevels each."},Animations:{"*":"A generated slide's Animation Pane: add(shape, effect, { start, direction, duration, delay, paragraph, path }), in order."},Slide:{animations:"Its Animation Pane, which python-pptx has no API for.",transition:"How it comes on from the slide before: { type, direction, duration }, which python-pptx has no API for."},Generator:{"*":"What a generator's function is given: data(path), and slides.add_slide(layout, id)."}},de={Presentation:{slides:"A deck's slides are in the slides file it names, their words in its script; slides from data are a generator's.",save:"A deck is not saved by its code: allyhub render writes its files."}},ce={Presentation:O.prototype,SlideMasters:M.prototype,SlideMaster:v.prototype,SlideLayouts:k.prototype,SlideLayout:R.prototype,Slide:f.prototype,placeholders:L.prototype,SlideShapes:T.prototype,Shape:x.prototype,TextFrame:I.prototype,_Paragraph:A.prototype,_Run:E.prototype,_Hyperlink:w.prototype,Font:y.prototype,ColorFormat:d.prototype,FillFormat:m.prototype,LineFormat:b.prototype,ShadowFormat:P.prototype,FreeformBuilder:u.prototype,GroupShape:g.prototype,Table:F.prototype,CategoryChartData:B.prototype,XyChartData:D.prototype,XySeriesData:N.prototype,Chart:H.prototype,Plot:Y.prototype,Series:K.prototype,Point:Z.prototype,DataLabels:V.prototype,Legend:W.prototype,Axis:j.prototype,TickLabels:U.prototype,MajorGridlines:z.prototype,ChartFormat:X.prototype,_Cell:h.prototype,_Column:c.prototype,_Row:C.prototype,_Background:p.prototype},me={Animations:l.prototype,ListLevel:S.prototype,text_styles:G.prototype,Generator:_.prototype},ye=()=>{const e={};for(const[t,r]of Object.entries(ce)){const n=a[t]??{},i=de[t]??{};e[t]=s(r).filter(o=>!Object.hasOwn(n,o)&&!Object.hasOwn(i,o))}return e};export const CAPABILITIES={reference:{library:"python-pptx",version:"1.0.2",docs:"https://python-pptx.readthedocs.io/"},holds:ye(),enums:Object.fromEntries(Object.entries({MSO_THEME_COLOR:se,PP_ALIGN:re,MSO_ANCHOR:q,MSO_AUTO_SIZE:Q,PP_PLACEHOLDER:ne,MSO_SHAPE:ae,MSO_CONNECTOR:$,MSO_SHAPE_TYPE:oe,MSO_FILL:ee,MSO_LINE:te,XL_CHART_TYPE:le,XL_LABEL_POSITION:pe,XL_LEGEND_POSITION:he,MSO_ARROWHEAD:J,THEME_FONT:ie}).map(([e,t])=>[e,Object.keys(t)])),units:["Emu","Inches","Pt","Cm","Mm","Centipoints","RGBColor"],differs:["The entry is export default presentation({ slides: ./deck.yaml, script: ./deck.{locale}.yaml, size, theme }, (prs) => { … }), not Presentation(path): a deck is made by its code, never opened from a template. Its masters and layouts are made with the additions below; its slides are in the slides file it names.","A name python-pptx has that is not held throws where it is used, naming what the class holds; python-pptx's x[i] is held where it indexes (slide_masters[0], slide_layouts[0], placeholders[idx], shapes[0]), and len(x) is x.length.","A Length (what Inches(1) and Pt(12) give, and what a length reads, shape.width) is a Number of EMU with python-pptx's emu, inches, cm, mm, pt, centipoints and twips. Arithmetic on Lengths gives a plain number, as python's int does; two Lengths of one value are ===, and one is compared with a plain number by its .emu.",`An enumeration's members are PresentationML's values (MSO_THEME_COLOR.ACCENT_1 is "accent1", PP_ALIGN.CENTER "ctr"), not integers; TEXT_1 and BACKGROUND_1 are dk1 and lt1, a master's standard colour map. MSO_SHAPE_TYPE.COMPONENT is a component's.`,`A colour's rgb is "#RRGGBB": RGBColor(r, g, b), new RGBColor(r, g, b) and RGBColor.from_string("RRGGBB") make one.`,"A colour's brightness is a theme colour's: python-pptx also gives an RGB colour one, which is refused here (set rgb to the colour it makes).","line_spacing is a number of lines, or a Length of Pt(1) and over for a fixed height (python-pptx tells them apart by type).","add_picture() takes both width and height: a picture's own size is not read while a deck's code runs.","add_connector() takes MSO_CONNECTOR's STRAIGHT, ELBOW and CURVE, and also a connector's preset by name where python-pptx has none (straightConnector1, bentConnector2 to 5, curvedConnector2 to 5); a connector's adjustments (an elbow's middle) are its shape.adjustments.","begin_connect() and end_connect() take a site of the shape's own geometry, as PowerPoint numbers them (a rectangle's 0 top, 1 left, 2 bottom, 3 right; an ellipse has 8), where python-pptx places an end on those four of its box whatever its shape; a site the shape has not throws. A glued end follows its shape where the slides file or a person moves it, as PowerPoint's does.","add_movie(movie_file, left, top, width, height, { poster_frame_time }) takes a video file, its poster a moment of it in seconds, not poster_frame_image.","A shape's name is its kind and a number (textbox-1, shape-2), and a placeholder's its type's (title, body, subtitle): the slides file and the script name shapes by name.","fit_text() sets the frame to shrink its text when it is drawn (MSO_AUTO_SIZE.TEXT_TO_FIT_SHAPE) from max_size: it reads no font file.","Font.underline is a single underline or none.","A chart holds column, bar, line, area, pie, doughnut and XY scatter types; it has no 3D, no bubble, no radar and no second axis. A chart in the slides file can read its numbers from a project file: data, categories and series name it and its columns.","A Point holds format.fill alone, and its fill is its category's colour, one for every series of the chart (the slides file's category_colors), shown where the chart varies by categories; python-pptx's point is its own series'.","A table has no style, where python-pptx's starts with Medium Style 2: its look is its cells' (fill, borders, text), and first_row and the like say what its rows are and paint nothing. add_table returns its shape, whose .table is the table.","A group is its shapes: they are listed with the shapes the group is among, drawn as they are, and a group holds no group; its box is theirs, so left and top move them and width and height only read.","A presentation is 16:9 (12192000 × 6858000) and its theme Office 2013–2022's over the project's look; python-pptx's template is 4:3 with Office 2007's.","prs.slide_layouts and prs.slide_master are the first master's, as python-pptx's; a generator's add_slide also takes a layout of any master by name."],adds:{...a,...Object.fromEntries(Object.entries(me).map(([e,t])=>[e,{...a[e]??{},names:s(t).join(", ")}]))}};
2
+ import{Animations as l,Background as h,Cell as d,ColorFormat as p,Column as c,FillFormat as m,Font as y,FreeformBuilder as _,GeneratedSlide as w,Generator as f,GroupShape as u,Hyperlink as g,LineFormat as b,ListLevel as S,ShadowFormat as A,GradientStop as P,Paragraph as E,Placeholders as O,Presentation as L,Row as C,Run as x,Shape as R,ShapeCollection as M,SlideLayout as T,SlideLayouts as k,SlideMaster as H,SlideMasters as v,Table as I,TextFrame as G,TextStyles as F}from"./api.js";import{CategoryChartData as B,Chart as D,XyChartData as N,XySeriesData as j,ChartAxis as W,ChartFormat as z,ChartLegend as X,MajorGridlines as Z,TickLabels as U,ChartPlot as Y,ChartPoint as V,ChartSeries as K,DataLabels as q}from"./chart-api.js";import{MSO_ANCHOR as J,MSO_ARROWHEAD as Q,MSO_ARROWHEAD_SIZE as $,MSO_AUTO_SIZE as ee,MSO_CONNECTOR as te,MSO_FILL as ae,MSO_LINE as oe,MSO_SHAPE as se,MSO_SHAPE_TYPE as re,MSO_THEME_COLOR as ie,PP_ALIGN as ne,PP_PLACEHOLDER as le,THEME_FONT as he,XL_CHART_TYPE as de,XL_LABEL_POSITION as pe,XL_LEGEND_POSITION as ce}from"./enums.js";import{publicNames as s}from"./strict.js";const a={Presentation:{theme:"The theme's colours (dk1…folHlink) and fonts (major, minor), over the project's look.",components:"components.add(name, { props, layers }): a shape drawn by code, by the layer contract.",generators:"generators.add(name, (g) => { g.data(path); g.slides.add_slide(layout, id) … }): slides made from data, placed in the slides file as one block."},SlideMasters:{add:"add(name): a master, with Office's text styles and no placeholders yet."},_Cell:{borders:"Its edges: { left, right, top, bottom }, each { color, width } (a:lnL…)."},LineFormat:{begin_arrow:"What the end of the line where it starts has (MSO_ARROWHEAD): PowerPoint's Begin Arrow type (a:headEnd).",end_arrow:"What the end of the line where it ends has (MSO_ARROWHEAD): PowerPoint's End Arrow type (a:tailEnd).",begin_arrow_width:"How wide the arrowhead where the line starts is (MSO_ARROWHEAD_SIZE): PowerPoint's Begin Arrow size (a:headEnd@w).",begin_arrow_length:"How long the arrowhead where the line starts is (MSO_ARROWHEAD_SIZE): PowerPoint's Begin Arrow size (a:headEnd@len).",end_arrow_width:"How wide the arrowhead where the line ends is (MSO_ARROWHEAD_SIZE): PowerPoint's End Arrow size (a:tailEnd@w).",end_arrow_length:"How long the arrowhead where the line ends is (MSO_ARROWHEAD_SIZE): PowerPoint's End Arrow size (a:tailEnd@len)."},FillFormat:{transparency:"How much of the fill shows through, a share: PowerPoint's Transparency (a:alpha).",gradient_stops:"Its stops: each read as python-pptx's (color, position), and set whole as [{ at, color, transparency }], `at` and `transparency` shares, a colour as the slides file writes one (accent1, accent1 lighter 40%, #RRGGBB) or a Color; python-pptx's stops can only be read and changed in place."},_GradientStop:{transparency:"How much of its colour shows through, a share (a:alpha)."},ShadowFormat:{blur_radius:"How far the shadow blurs, a Length (a:outerShdw blurRad).",distance:"How far it falls from the shape, a Length (dist).",angle:"The way it falls, degrees clockwise from the right (dir).",transparency:"How much shows through it, a share (a:alpha).",color:"Its colour, a ColorFormat."},Shape:{flip_h:"Mirrored left to right (a:xfrm flipH), as the slides file's flip_h; its text reads as it is.",flip_v:"Mirrored top to bottom (a:xfrm flipV), as the slides file's flip_v."},FreeformBuilder:{add_curve_segment:"add_curve_segment(x1, y1, x2, y2, x, y): a cubic Bézier segment by its two control points (a:cubicBezTo)."},Font:{strike:"A line through it (@strike).",baseline:"Raised or lowered, a share of its size: superscript 0.3, subscript -0.25 (@baseline).",highlight:"The colour behind it, #RRGGBB as RGBColor gives one (a:highlight).",spacing:"Space added between letters, a Length, negative to tighten (PowerPoint's Character Spacing, a:rPr spc)."},SlideMaster:{text_styles:"Its text styles (p:txStyles): title_style, body_style, other_style, nine ListLevels each, Office's to start with."},SlideLayouts:{add:"add(name): a layout on this master."},SlideLayout:{display_master_shapes:"Whether its master's shapes are drawn on its slides, true unless set: PowerPoint's Hide Background Graphics (@showMasterSp)."},placeholders:{add:"add(PP_PLACEHOLDER.X, left?, top?, width?, height?, { name }): a placeholder on a master or a layout; a layout's without a frame takes its master's of its base type."},SlideShapes:{add_component:"add_component(name, left, top, width, height, props): a component of the presentation in a frame.",get:"get(name): a shape by its name."},TextFrame:{list_style:"Its list style (a:lstStyle): nine ListLevels, level 0 first, what its paragraphs take where they set nothing."},ListLevel:{"*":"A level of a list style: alignment, line_spacing, space_before, space_after, font, bullet (a character, or null for none), bullet_font, numbered (a:buAutoNum: arabicPeriod, alphaLcPeriod…), margin_left, indent."},text_styles:{"*":"title_style, body_style, other_style: a master's text styles, nine ListLevels each."},Animations:{"*":"A generated slide's Animation Pane: add(shape, effect, { start, direction, duration, delay, paragraph, path }), in order."},Slide:{animations:"Its Animation Pane, which python-pptx has no API for.",transition:"How it comes on from the slide before: { type, direction, duration }, which python-pptx has no API for."},Generator:{"*":"What a generator's function is given: data(path), and slides.add_slide(layout, id)."}},me={Presentation:{slides:"A deck's slides are in the slides file it names, their words in its script; slides from data are a generator's.",save:"A deck is not saved by its code: allyhub render writes its files."}},ye={Presentation:L.prototype,SlideMasters:v.prototype,SlideMaster:H.prototype,SlideLayouts:k.prototype,SlideLayout:T.prototype,Slide:w.prototype,placeholders:O.prototype,SlideShapes:M.prototype,Shape:R.prototype,TextFrame:G.prototype,_Paragraph:E.prototype,_Run:x.prototype,_Hyperlink:g.prototype,Font:y.prototype,ColorFormat:p.prototype,FillFormat:m.prototype,LineFormat:b.prototype,ShadowFormat:A.prototype,_GradientStop:P.prototype,FreeformBuilder:_.prototype,GroupShape:u.prototype,Table:I.prototype,CategoryChartData:B.prototype,XyChartData:N.prototype,XySeriesData:j.prototype,Chart:D.prototype,Plot:Y.prototype,Series:K.prototype,Point:V.prototype,DataLabels:q.prototype,Legend:X.prototype,Axis:W.prototype,TickLabels:U.prototype,MajorGridlines:Z.prototype,ChartFormat:z.prototype,_Cell:d.prototype,_Column:c.prototype,_Row:C.prototype,_Background:h.prototype},_e={Animations:l.prototype,ListLevel:S.prototype,text_styles:F.prototype,Generator:f.prototype},we=()=>{const e={};for(const[t,r]of Object.entries(ye)){const i=a[t]??{},n=me[t]??{};e[t]=s(r).filter(o=>!Object.hasOwn(i,o)&&!Object.hasOwn(n,o))}return e};export const CAPABILITIES={reference:{library:"python-pptx",version:"1.0.2",docs:"https://python-pptx.readthedocs.io/"},holds:we(),enums:Object.fromEntries(Object.entries({MSO_THEME_COLOR:ie,PP_ALIGN:ne,MSO_ANCHOR:J,MSO_AUTO_SIZE:ee,PP_PLACEHOLDER:le,MSO_SHAPE:se,MSO_CONNECTOR:te,MSO_SHAPE_TYPE:re,MSO_FILL:ae,MSO_LINE:oe,XL_CHART_TYPE:de,XL_LABEL_POSITION:pe,XL_LEGEND_POSITION:ce,MSO_ARROWHEAD:Q,MSO_ARROWHEAD_SIZE:$,THEME_FONT:he}).map(([e,t])=>[e,Object.keys(t)])),units:["Emu","Inches","Pt","Cm","Mm","Centipoints","RGBColor"],differs:["The entry is export default presentation({ slides: ./deck.yaml, script: ./deck.{locale}.yaml, size, theme }, (prs) => { … }), not Presentation(path): a deck is made by its code, never opened from a template. Its masters and layouts are made with the additions below; its slides are in the slides file it names.","A name python-pptx has that is not held throws where it is used, naming what the class holds; python-pptx's x[i] is held where it indexes (slide_masters[0], slide_layouts[0], placeholders[idx], shapes[0]), and len(x) is x.length.","A Length (what Inches(1) and Pt(12) give, and what a length reads, shape.width) is a Number of EMU with python-pptx's emu, inches, cm, mm, pt, centipoints and twips. Arithmetic on Lengths gives a plain number, as python's int does; two Lengths of one value are ===, and one is compared with a plain number by its .emu.",`An enumeration's members are PresentationML's values (MSO_THEME_COLOR.ACCENT_1 is "accent1", PP_ALIGN.CENTER "ctr"), not integers; TEXT_1 and BACKGROUND_1 are dk1 and lt1, a master's standard colour map. MSO_SHAPE_TYPE.COMPONENT is a component's. PP_PARAGRAPH_ALIGNMENT and MSO_LINE_DASH_STYLE are PP_ALIGN and MSO_LINE by python-pptx's other names.`,`A colour's rgb is "#RRGGBB": RGBColor(r, g, b), new RGBColor(r, g, b) and RGBColor.from_string("RRGGBB") make one.`,"A colour's brightness is a theme colour's: python-pptx also gives an RGB colour one, which is refused here (set rgb to the colour it makes).","line_spacing is a number of lines, or a Length of Pt(1) and over for a fixed height (python-pptx tells them apart by type).","add_picture() takes both width and height: a picture's own size is not read while a deck's code runs.","add_connector() takes MSO_CONNECTOR's STRAIGHT, ELBOW and CURVE, and also a connector's preset by name where python-pptx has none (straightConnector1, bentConnector2 to 5, curvedConnector2 to 5); a connector's adjustments (an elbow's middle) are its shape.adjustments.","begin_connect() and end_connect() take a site of the shape's own geometry, as PowerPoint numbers them (a rectangle's 0 top, 1 left, 2 bottom, 3 right; an ellipse has 8), where python-pptx places an end on those four of its box whatever its shape; a site the shape has not throws. A glued end follows its shape where the slides file or a person moves it, as PowerPoint's does.","add_movie(movie_file, left, top, width, height, { poster_frame_time }) takes a video file, its poster a moment of it in seconds, not poster_frame_image.","A shape's name is its kind and a number (textbox-1, shape-2), and a placeholder's its type's (title, body, subtitle): the slides file and the script name shapes by name.","fit_text() sets the frame to shrink its text when it is drawn (MSO_AUTO_SIZE.TEXT_TO_FIT_SHAPE) from max_size: it reads no font file.","Font.underline is a single underline or none.","Font.size refuses a size under Pt(1): a bare number is EMU, so size = 12 (python-pptx takes it) draws nothing.","A chart holds column, bar, line, area, pie, doughnut and XY scatter types; it has no 3D, no bubble, no radar and no second axis. A chart in the slides file can read its numbers from a project file: data, categories and series name it and its columns.","A Point holds format.fill alone, and its fill is its category's colour, one for every series of the chart (the slides file's category_colors), shown where the chart varies by categories; python-pptx's point is its own series'.","A table has no style, where python-pptx's starts with Medium Style 2: its look is its cells' (fill, borders, text), and first_row and the like say what its rows are and paint nothing. add_table returns its shape, whose .table is the table.","A group is its shapes: they are listed with the shapes the group is among, drawn as they are, and a group holds no group; its box is theirs, so left and top move them and width and height only read.","A presentation is 16:9 (12192000 × 6858000) and its theme Office 2013–2022's over the project's look; python-pptx's template is 4:3 with Office 2007's.","prs.slide_layouts and prs.slide_master are the first master's, as python-pptx's; a generator's add_slide also takes a layout of any master by name."],adds:{...a,...Object.fromEntries(Object.entries(_e).map(([e,t])=>[e,{...a[e]??{},names:s(t).join(", ")}]))}};
@@ -22,6 +22,13 @@ export declare const PP_ALIGN: {
22
22
  readonly RIGHT: "r";
23
23
  readonly JUSTIFY: "just";
24
24
  };
25
+ /** python-pptx's PP_PARAGRAPH_ALIGNMENT, PP_ALIGN by its other name. */
26
+ export declare const PP_PARAGRAPH_ALIGNMENT: {
27
+ readonly LEFT: "l";
28
+ readonly CENTER: "ctr";
29
+ readonly RIGHT: "r";
30
+ readonly JUSTIFY: "just";
31
+ };
25
32
  /** A text frame's vertical anchor (`a:bodyPr/@anchor`). */
26
33
  export declare const MSO_ANCHOR: {
27
34
  readonly TOP: "t";
@@ -252,6 +259,17 @@ export declare const MSO_LINE: {
252
259
  readonly LONG_DASH: "lgDash";
253
260
  readonly LONG_DASH_DOT: "lgDashDot";
254
261
  };
262
+ /** python-pptx's MSO_LINE_DASH_STYLE, MSO_LINE by its other name. */
263
+ export declare const MSO_LINE_DASH_STYLE: {
264
+ readonly SOLID: "solid";
265
+ readonly SQUARE_DOT: "sysDash";
266
+ readonly ROUND_DOT: "sysDot";
267
+ readonly DASH: "dash";
268
+ readonly DASH_DOT: "dashDot";
269
+ readonly DASH_DOT_DOT: "lgDashDotDot";
270
+ readonly LONG_DASH: "lgDash";
271
+ readonly LONG_DASH_DOT: "lgDashDot";
272
+ };
255
273
  /** What a line's end has (`line.begin_arrow`, `line.end_arrow`): PowerPoint's arrow types; python-pptx has no such enumeration. */
256
274
  export declare const MSO_ARROWHEAD: {
257
275
  readonly NONE: "none";
@@ -261,6 +279,12 @@ export declare const MSO_ARROWHEAD: {
261
279
  readonly DIAMOND: "diamond";
262
280
  readonly OVAL: "oval";
263
281
  };
282
+ /** How wide or long a line's arrowhead is (`line.begin_arrow_width` and the like): PowerPoint's Begin and End Arrow size; python-pptx has no such enumeration. */
283
+ export declare const MSO_ARROWHEAD_SIZE: {
284
+ readonly SMALL: "sm";
285
+ readonly MEDIUM: "med";
286
+ readonly LARGE: "lg";
287
+ };
264
288
  /** What a shape is (`shape.shape_type`). `COMPONENT` is AllyHub's: a shape drawn by code. */
265
289
  export declare const MSO_SHAPE_TYPE: {
266
290
  readonly AUTO_SHAPE: "autoshape";
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{strictEnum as _}from"./strict.js";export const MSO_THEME_COLOR=_("MSO_THEME_COLOR",{DARK_1:"dk1",LIGHT_1:"lt1",DARK_2:"dk2",LIGHT_2:"lt2",ACCENT_1:"accent1",ACCENT_2:"accent2",ACCENT_3:"accent3",ACCENT_4:"accent4",ACCENT_5:"accent5",ACCENT_6:"accent6",HYPERLINK:"hlink",FOLLOWED_HYPERLINK:"folHlink",TEXT_1:"dk1",BACKGROUND_1:"lt1",TEXT_2:"dk2",BACKGROUND_2:"lt2"}),PP_ALIGN=_("PP_ALIGN",{LEFT:"l",CENTER:"ctr",RIGHT:"r",JUSTIFY:"just"}),MSO_ANCHOR=_("MSO_ANCHOR",{TOP:"t",MIDDLE:"ctr",BOTTOM:"b"}),MSO_AUTO_SIZE=_("MSO_AUTO_SIZE",{NONE:"none",SHAPE_TO_FIT_TEXT:"shape",TEXT_TO_FIT_SHAPE:"text"}),PP_PLACEHOLDER=_("PP_PLACEHOLDER",{TITLE:"title",CENTER_TITLE:"ctrTitle",SUBTITLE:"subTitle",BODY:"body",PICTURE:"pic",MEDIA_CLIP:"media",OBJECT:"obj",DATE:"dt",FOOTER:"ftr",SLIDE_NUMBER:"sldNum"}),MSO_SHAPE=_("MSO_SHAPE",{ACTION_BUTTON_BACK_OR_PREVIOUS:"actionButtonBackPrevious",ACTION_BUTTON_BEGINNING:"actionButtonBeginning",ACTION_BUTTON_CUSTOM:"actionButtonBlank",ACTION_BUTTON_DOCUMENT:"actionButtonDocument",ACTION_BUTTON_END:"actionButtonEnd",ACTION_BUTTON_FORWARD_OR_NEXT:"actionButtonForwardNext",ACTION_BUTTON_HELP:"actionButtonHelp",ACTION_BUTTON_HOME:"actionButtonHome",ACTION_BUTTON_INFORMATION:"actionButtonInformation",ACTION_BUTTON_MOVIE:"actionButtonMovie",ACTION_BUTTON_RETURN:"actionButtonReturn",ACTION_BUTTON_SOUND:"actionButtonSound",ARC:"arc",BALLOON:"wedgeRoundRectCallout",BENT_ARROW:"bentArrow",BENT_UP_ARROW:"bentUpArrow",BEVEL:"bevel",BLOCK_ARC:"blockArc",CAN:"can",CHART_PLUS:"chartPlus",CHART_STAR:"chartStar",CHART_X:"chartX",CHEVRON:"chevron",CHORD:"chord",CIRCULAR_ARROW:"circularArrow",CLOUD:"cloud",CLOUD_CALLOUT:"cloudCallout",CORNER:"corner",CORNER_TABS:"cornerTabs",CROSS:"plus",CUBE:"cube",CURVED_DOWN_ARROW:"curvedDownArrow",CURVED_DOWN_RIBBON:"ellipseRibbon",CURVED_LEFT_ARROW:"curvedLeftArrow",CURVED_RIGHT_ARROW:"curvedRightArrow",CURVED_UP_ARROW:"curvedUpArrow",CURVED_UP_RIBBON:"ellipseRibbon2",DECAGON:"decagon",DIAGONAL_STRIPE:"diagStripe",DIAMOND:"diamond",DODECAGON:"dodecagon",DONUT:"donut",DOUBLE_BRACE:"bracePair",DOUBLE_BRACKET:"bracketPair",DOUBLE_WAVE:"doubleWave",DOWN_ARROW:"downArrow",DOWN_ARROW_CALLOUT:"downArrowCallout",DOWN_RIBBON:"ribbon",EXPLOSION1:"irregularSeal1",EXPLOSION2:"irregularSeal2",FLOWCHART_ALTERNATE_PROCESS:"flowChartAlternateProcess",FLOWCHART_CARD:"flowChartPunchedCard",FLOWCHART_COLLATE:"flowChartCollate",FLOWCHART_CONNECTOR:"flowChartConnector",FLOWCHART_DATA:"flowChartInputOutput",FLOWCHART_DECISION:"flowChartDecision",FLOWCHART_DELAY:"flowChartDelay",FLOWCHART_DIRECT_ACCESS_STORAGE:"flowChartMagneticDrum",FLOWCHART_DISPLAY:"flowChartDisplay",FLOWCHART_DOCUMENT:"flowChartDocument",FLOWCHART_EXTRACT:"flowChartExtract",FLOWCHART_INTERNAL_STORAGE:"flowChartInternalStorage",FLOWCHART_MAGNETIC_DISK:"flowChartMagneticDisk",FLOWCHART_MANUAL_INPUT:"flowChartManualInput",FLOWCHART_MANUAL_OPERATION:"flowChartManualOperation",FLOWCHART_MERGE:"flowChartMerge",FLOWCHART_MULTIDOCUMENT:"flowChartMultidocument",FLOWCHART_OFFLINE_STORAGE:"flowChartOfflineStorage",FLOWCHART_OFFPAGE_CONNECTOR:"flowChartOffpageConnector",FLOWCHART_OR:"flowChartOr",FLOWCHART_PREDEFINED_PROCESS:"flowChartPredefinedProcess",FLOWCHART_PREPARATION:"flowChartPreparation",FLOWCHART_PROCESS:"flowChartProcess",FLOWCHART_PUNCHED_TAPE:"flowChartPunchedTape",FLOWCHART_SEQUENTIAL_ACCESS_STORAGE:"flowChartMagneticTape",FLOWCHART_SORT:"flowChartSort",FLOWCHART_STORED_DATA:"flowChartOnlineStorage",FLOWCHART_SUMMING_JUNCTION:"flowChartSummingJunction",FLOWCHART_TERMINATOR:"flowChartTerminator",FOLDED_CORNER:"foldedCorner",FRAME:"frame",FUNNEL:"funnel",GEAR_6:"gear6",GEAR_9:"gear9",HALF_FRAME:"halfFrame",HEART:"heart",HEPTAGON:"heptagon",HEXAGON:"hexagon",HORIZONTAL_SCROLL:"horizontalScroll",ISOSCELES_TRIANGLE:"triangle",LEFT_ARROW:"leftArrow",LEFT_ARROW_CALLOUT:"leftArrowCallout",LEFT_BRACE:"leftBrace",LEFT_BRACKET:"leftBracket",LEFT_CIRCULAR_ARROW:"leftCircularArrow",LEFT_RIGHT_ARROW:"leftRightArrow",LEFT_RIGHT_ARROW_CALLOUT:"leftRightArrowCallout",LEFT_RIGHT_CIRCULAR_ARROW:"leftRightCircularArrow",LEFT_RIGHT_RIBBON:"leftRightRibbon",LEFT_RIGHT_UP_ARROW:"leftRightUpArrow",LEFT_UP_ARROW:"leftUpArrow",LIGHTNING_BOLT:"lightningBolt",LINE_CALLOUT_1:"borderCallout1",LINE_CALLOUT_1_ACCENT_BAR:"accentCallout1",LINE_CALLOUT_1_BORDER_AND_ACCENT_BAR:"accentBorderCallout1",LINE_CALLOUT_1_NO_BORDER:"callout1",LINE_CALLOUT_2:"borderCallout2",LINE_CALLOUT_2_ACCENT_BAR:"accentCallout2",LINE_CALLOUT_2_BORDER_AND_ACCENT_BAR:"accentBorderCallout2",LINE_CALLOUT_2_NO_BORDER:"callout2",LINE_CALLOUT_3:"borderCallout3",LINE_CALLOUT_3_ACCENT_BAR:"accentCallout3",LINE_CALLOUT_3_BORDER_AND_ACCENT_BAR:"accentBorderCallout3",LINE_CALLOUT_3_NO_BORDER:"callout3",LINE_CALLOUT_4:"borderCallout3",LINE_CALLOUT_4_ACCENT_BAR:"accentCallout3",LINE_CALLOUT_4_BORDER_AND_ACCENT_BAR:"accentBorderCallout3",LINE_CALLOUT_4_NO_BORDER:"callout3",LINE_INVERSE:"lineInv",MATH_DIVIDE:"mathDivide",MATH_EQUAL:"mathEqual",MATH_MINUS:"mathMinus",MATH_MULTIPLY:"mathMultiply",MATH_NOT_EQUAL:"mathNotEqual",MATH_PLUS:"mathPlus",MOON:"moon",NON_ISOSCELES_TRAPEZOID:"nonIsoscelesTrapezoid",NOTCHED_RIGHT_ARROW:"notchedRightArrow",NO_SYMBOL:"noSmoking",OCTAGON:"octagon",OVAL:"ellipse",OVAL_CALLOUT:"wedgeEllipseCallout",PARALLELOGRAM:"parallelogram",PENTAGON:"homePlate",PIE:"pie",PIE_WEDGE:"pieWedge",PLAQUE:"plaque",PLAQUE_TABS:"plaqueTabs",QUAD_ARROW:"quadArrow",QUAD_ARROW_CALLOUT:"quadArrowCallout",RECTANGLE:"rect",RECTANGULAR_CALLOUT:"wedgeRectCallout",REGULAR_PENTAGON:"pentagon",RIGHT_ARROW:"rightArrow",RIGHT_ARROW_CALLOUT:"rightArrowCallout",RIGHT_BRACE:"rightBrace",RIGHT_BRACKET:"rightBracket",RIGHT_TRIANGLE:"rtTriangle",ROUNDED_RECTANGLE:"roundRect",ROUNDED_RECTANGULAR_CALLOUT:"wedgeRoundRectCallout",ROUND_1_RECTANGLE:"round1Rect",ROUND_2_DIAG_RECTANGLE:"round2DiagRect",ROUND_2_SAME_RECTANGLE:"round2SameRect",SMILEY_FACE:"smileyFace",SNIP_1_RECTANGLE:"snip1Rect",SNIP_2_DIAG_RECTANGLE:"snip2DiagRect",SNIP_2_SAME_RECTANGLE:"snip2SameRect",SNIP_ROUND_RECTANGLE:"snipRoundRect",SQUARE_TABS:"squareTabs",STAR_10_POINT:"star10",STAR_12_POINT:"star12",STAR_16_POINT:"star16",STAR_24_POINT:"star24",STAR_32_POINT:"star32",STAR_4_POINT:"star4",STAR_5_POINT:"star5",STAR_6_POINT:"star6",STAR_7_POINT:"star7",STAR_8_POINT:"star8",STRIPED_RIGHT_ARROW:"stripedRightArrow",SUN:"sun",SWOOSH_ARROW:"swooshArrow",TEAR:"teardrop",TRAPEZOID:"trapezoid",UP_ARROW:"upArrow",UP_ARROW_CALLOUT:"upArrowCallout",UP_DOWN_ARROW:"upDownArrow",UP_DOWN_ARROW_CALLOUT:"upDownArrowCallout",UP_RIBBON:"ribbon2",U_TURN_ARROW:"uturnArrow",VERTICAL_SCROLL:"verticalScroll",WAVE:"wave"}),MSO_CONNECTOR=_("MSO_CONNECTOR",{STRAIGHT:"line",ELBOW:"bentConnector3",CURVE:"curvedConnector3"}),MSO_LINE=_("MSO_LINE",{SOLID:"solid",SQUARE_DOT:"sysDash",ROUND_DOT:"sysDot",DASH:"dash",DASH_DOT:"dashDot",DASH_DOT_DOT:"lgDashDotDot",LONG_DASH:"lgDash",LONG_DASH_DOT:"lgDashDot"}),MSO_ARROWHEAD=_("MSO_ARROWHEAD",{NONE:"none",TRIANGLE:"triangle",OPEN:"arrow",STEALTH:"stealth",DIAMOND:"diamond",OVAL:"oval"}),MSO_SHAPE_TYPE=_("MSO_SHAPE_TYPE",{AUTO_SHAPE:"autoshape",FREEFORM:"freeform",GROUP:"group",LINE:"line",TABLE:"table",CHART:"chart",MEDIA:"movie",PICTURE:"picture",PLACEHOLDER:"placeholder",TEXT_BOX:"textbox",COMPONENT:"component"}),XL_CHART_TYPE=_("XL_CHART_TYPE",{COLUMN_CLUSTERED:"column-clustered",COLUMN_STACKED:"column-stacked",COLUMN_STACKED_100:"column-stacked-100",BAR_CLUSTERED:"bar-clustered",BAR_STACKED:"bar-stacked",BAR_STACKED_100:"bar-stacked-100",LINE:"line",LINE_MARKERS:"line-markers",AREA:"area",AREA_STACKED:"area-stacked",AREA_STACKED_100:"area-stacked-100",PIE:"pie",DOUGHNUT:"doughnut",XY_SCATTER:"scatter",XY_SCATTER_LINES:"scatter-lines",XY_SCATTER_SMOOTH:"scatter-smooth"}),XL_LEGEND_POSITION=_("XL_LEGEND_POSITION",{BOTTOM:"bottom",TOP:"top",LEFT:"left",RIGHT:"right"}),XL_LABEL_POSITION=_("XL_LABEL_POSITION",{ABOVE:"t",BELOW:"b",BEST_FIT:"bestFit",CENTER:"ctr",INSIDE_BASE:"inBase",INSIDE_END:"inEnd",LEFT:"l",OUTSIDE_END:"outEnd",RIGHT:"r"}),MSO_FILL=_("MSO_FILL",{SOLID:"solid",BACKGROUND:"background",GRADIENT:"gradient"}),THEME_FONT=_("THEME_FONT",{MAJOR:"+mj-lt",MINOR:"+mn-lt"});
2
+ import{strictEnum as _}from"./strict.js";export const MSO_THEME_COLOR=_("MSO_THEME_COLOR",{DARK_1:"dk1",LIGHT_1:"lt1",DARK_2:"dk2",LIGHT_2:"lt2",ACCENT_1:"accent1",ACCENT_2:"accent2",ACCENT_3:"accent3",ACCENT_4:"accent4",ACCENT_5:"accent5",ACCENT_6:"accent6",HYPERLINK:"hlink",FOLLOWED_HYPERLINK:"folHlink",TEXT_1:"dk1",BACKGROUND_1:"lt1",TEXT_2:"dk2",BACKGROUND_2:"lt2"}),PP_ALIGN=_("PP_ALIGN",{LEFT:"l",CENTER:"ctr",RIGHT:"r",JUSTIFY:"just"}),PP_PARAGRAPH_ALIGNMENT=PP_ALIGN,MSO_ANCHOR=_("MSO_ANCHOR",{TOP:"t",MIDDLE:"ctr",BOTTOM:"b"}),MSO_AUTO_SIZE=_("MSO_AUTO_SIZE",{NONE:"none",SHAPE_TO_FIT_TEXT:"shape",TEXT_TO_FIT_SHAPE:"text"}),PP_PLACEHOLDER=_("PP_PLACEHOLDER",{TITLE:"title",CENTER_TITLE:"ctrTitle",SUBTITLE:"subTitle",BODY:"body",PICTURE:"pic",MEDIA_CLIP:"media",OBJECT:"obj",DATE:"dt",FOOTER:"ftr",SLIDE_NUMBER:"sldNum"}),MSO_SHAPE=_("MSO_SHAPE",{ACTION_BUTTON_BACK_OR_PREVIOUS:"actionButtonBackPrevious",ACTION_BUTTON_BEGINNING:"actionButtonBeginning",ACTION_BUTTON_CUSTOM:"actionButtonBlank",ACTION_BUTTON_DOCUMENT:"actionButtonDocument",ACTION_BUTTON_END:"actionButtonEnd",ACTION_BUTTON_FORWARD_OR_NEXT:"actionButtonForwardNext",ACTION_BUTTON_HELP:"actionButtonHelp",ACTION_BUTTON_HOME:"actionButtonHome",ACTION_BUTTON_INFORMATION:"actionButtonInformation",ACTION_BUTTON_MOVIE:"actionButtonMovie",ACTION_BUTTON_RETURN:"actionButtonReturn",ACTION_BUTTON_SOUND:"actionButtonSound",ARC:"arc",BALLOON:"wedgeRoundRectCallout",BENT_ARROW:"bentArrow",BENT_UP_ARROW:"bentUpArrow",BEVEL:"bevel",BLOCK_ARC:"blockArc",CAN:"can",CHART_PLUS:"chartPlus",CHART_STAR:"chartStar",CHART_X:"chartX",CHEVRON:"chevron",CHORD:"chord",CIRCULAR_ARROW:"circularArrow",CLOUD:"cloud",CLOUD_CALLOUT:"cloudCallout",CORNER:"corner",CORNER_TABS:"cornerTabs",CROSS:"plus",CUBE:"cube",CURVED_DOWN_ARROW:"curvedDownArrow",CURVED_DOWN_RIBBON:"ellipseRibbon",CURVED_LEFT_ARROW:"curvedLeftArrow",CURVED_RIGHT_ARROW:"curvedRightArrow",CURVED_UP_ARROW:"curvedUpArrow",CURVED_UP_RIBBON:"ellipseRibbon2",DECAGON:"decagon",DIAGONAL_STRIPE:"diagStripe",DIAMOND:"diamond",DODECAGON:"dodecagon",DONUT:"donut",DOUBLE_BRACE:"bracePair",DOUBLE_BRACKET:"bracketPair",DOUBLE_WAVE:"doubleWave",DOWN_ARROW:"downArrow",DOWN_ARROW_CALLOUT:"downArrowCallout",DOWN_RIBBON:"ribbon",EXPLOSION1:"irregularSeal1",EXPLOSION2:"irregularSeal2",FLOWCHART_ALTERNATE_PROCESS:"flowChartAlternateProcess",FLOWCHART_CARD:"flowChartPunchedCard",FLOWCHART_COLLATE:"flowChartCollate",FLOWCHART_CONNECTOR:"flowChartConnector",FLOWCHART_DATA:"flowChartInputOutput",FLOWCHART_DECISION:"flowChartDecision",FLOWCHART_DELAY:"flowChartDelay",FLOWCHART_DIRECT_ACCESS_STORAGE:"flowChartMagneticDrum",FLOWCHART_DISPLAY:"flowChartDisplay",FLOWCHART_DOCUMENT:"flowChartDocument",FLOWCHART_EXTRACT:"flowChartExtract",FLOWCHART_INTERNAL_STORAGE:"flowChartInternalStorage",FLOWCHART_MAGNETIC_DISK:"flowChartMagneticDisk",FLOWCHART_MANUAL_INPUT:"flowChartManualInput",FLOWCHART_MANUAL_OPERATION:"flowChartManualOperation",FLOWCHART_MERGE:"flowChartMerge",FLOWCHART_MULTIDOCUMENT:"flowChartMultidocument",FLOWCHART_OFFLINE_STORAGE:"flowChartOfflineStorage",FLOWCHART_OFFPAGE_CONNECTOR:"flowChartOffpageConnector",FLOWCHART_OR:"flowChartOr",FLOWCHART_PREDEFINED_PROCESS:"flowChartPredefinedProcess",FLOWCHART_PREPARATION:"flowChartPreparation",FLOWCHART_PROCESS:"flowChartProcess",FLOWCHART_PUNCHED_TAPE:"flowChartPunchedTape",FLOWCHART_SEQUENTIAL_ACCESS_STORAGE:"flowChartMagneticTape",FLOWCHART_SORT:"flowChartSort",FLOWCHART_STORED_DATA:"flowChartOnlineStorage",FLOWCHART_SUMMING_JUNCTION:"flowChartSummingJunction",FLOWCHART_TERMINATOR:"flowChartTerminator",FOLDED_CORNER:"foldedCorner",FRAME:"frame",FUNNEL:"funnel",GEAR_6:"gear6",GEAR_9:"gear9",HALF_FRAME:"halfFrame",HEART:"heart",HEPTAGON:"heptagon",HEXAGON:"hexagon",HORIZONTAL_SCROLL:"horizontalScroll",ISOSCELES_TRIANGLE:"triangle",LEFT_ARROW:"leftArrow",LEFT_ARROW_CALLOUT:"leftArrowCallout",LEFT_BRACE:"leftBrace",LEFT_BRACKET:"leftBracket",LEFT_CIRCULAR_ARROW:"leftCircularArrow",LEFT_RIGHT_ARROW:"leftRightArrow",LEFT_RIGHT_ARROW_CALLOUT:"leftRightArrowCallout",LEFT_RIGHT_CIRCULAR_ARROW:"leftRightCircularArrow",LEFT_RIGHT_RIBBON:"leftRightRibbon",LEFT_RIGHT_UP_ARROW:"leftRightUpArrow",LEFT_UP_ARROW:"leftUpArrow",LIGHTNING_BOLT:"lightningBolt",LINE_CALLOUT_1:"borderCallout1",LINE_CALLOUT_1_ACCENT_BAR:"accentCallout1",LINE_CALLOUT_1_BORDER_AND_ACCENT_BAR:"accentBorderCallout1",LINE_CALLOUT_1_NO_BORDER:"callout1",LINE_CALLOUT_2:"borderCallout2",LINE_CALLOUT_2_ACCENT_BAR:"accentCallout2",LINE_CALLOUT_2_BORDER_AND_ACCENT_BAR:"accentBorderCallout2",LINE_CALLOUT_2_NO_BORDER:"callout2",LINE_CALLOUT_3:"borderCallout3",LINE_CALLOUT_3_ACCENT_BAR:"accentCallout3",LINE_CALLOUT_3_BORDER_AND_ACCENT_BAR:"accentBorderCallout3",LINE_CALLOUT_3_NO_BORDER:"callout3",LINE_CALLOUT_4:"borderCallout3",LINE_CALLOUT_4_ACCENT_BAR:"accentCallout3",LINE_CALLOUT_4_BORDER_AND_ACCENT_BAR:"accentBorderCallout3",LINE_CALLOUT_4_NO_BORDER:"callout3",LINE_INVERSE:"lineInv",MATH_DIVIDE:"mathDivide",MATH_EQUAL:"mathEqual",MATH_MINUS:"mathMinus",MATH_MULTIPLY:"mathMultiply",MATH_NOT_EQUAL:"mathNotEqual",MATH_PLUS:"mathPlus",MOON:"moon",NON_ISOSCELES_TRAPEZOID:"nonIsoscelesTrapezoid",NOTCHED_RIGHT_ARROW:"notchedRightArrow",NO_SYMBOL:"noSmoking",OCTAGON:"octagon",OVAL:"ellipse",OVAL_CALLOUT:"wedgeEllipseCallout",PARALLELOGRAM:"parallelogram",PENTAGON:"homePlate",PIE:"pie",PIE_WEDGE:"pieWedge",PLAQUE:"plaque",PLAQUE_TABS:"plaqueTabs",QUAD_ARROW:"quadArrow",QUAD_ARROW_CALLOUT:"quadArrowCallout",RECTANGLE:"rect",RECTANGULAR_CALLOUT:"wedgeRectCallout",REGULAR_PENTAGON:"pentagon",RIGHT_ARROW:"rightArrow",RIGHT_ARROW_CALLOUT:"rightArrowCallout",RIGHT_BRACE:"rightBrace",RIGHT_BRACKET:"rightBracket",RIGHT_TRIANGLE:"rtTriangle",ROUNDED_RECTANGLE:"roundRect",ROUNDED_RECTANGULAR_CALLOUT:"wedgeRoundRectCallout",ROUND_1_RECTANGLE:"round1Rect",ROUND_2_DIAG_RECTANGLE:"round2DiagRect",ROUND_2_SAME_RECTANGLE:"round2SameRect",SMILEY_FACE:"smileyFace",SNIP_1_RECTANGLE:"snip1Rect",SNIP_2_DIAG_RECTANGLE:"snip2DiagRect",SNIP_2_SAME_RECTANGLE:"snip2SameRect",SNIP_ROUND_RECTANGLE:"snipRoundRect",SQUARE_TABS:"squareTabs",STAR_10_POINT:"star10",STAR_12_POINT:"star12",STAR_16_POINT:"star16",STAR_24_POINT:"star24",STAR_32_POINT:"star32",STAR_4_POINT:"star4",STAR_5_POINT:"star5",STAR_6_POINT:"star6",STAR_7_POINT:"star7",STAR_8_POINT:"star8",STRIPED_RIGHT_ARROW:"stripedRightArrow",SUN:"sun",SWOOSH_ARROW:"swooshArrow",TEAR:"teardrop",TRAPEZOID:"trapezoid",UP_ARROW:"upArrow",UP_ARROW_CALLOUT:"upArrowCallout",UP_DOWN_ARROW:"upDownArrow",UP_DOWN_ARROW_CALLOUT:"upDownArrowCallout",UP_RIBBON:"ribbon2",U_TURN_ARROW:"uturnArrow",VERTICAL_SCROLL:"verticalScroll",WAVE:"wave"}),MSO_CONNECTOR=_("MSO_CONNECTOR",{STRAIGHT:"line",ELBOW:"bentConnector3",CURVE:"curvedConnector3"}),MSO_LINE=_("MSO_LINE",{SOLID:"solid",SQUARE_DOT:"sysDash",ROUND_DOT:"sysDot",DASH:"dash",DASH_DOT:"dashDot",DASH_DOT_DOT:"lgDashDotDot",LONG_DASH:"lgDash",LONG_DASH_DOT:"lgDashDot"}),MSO_LINE_DASH_STYLE=MSO_LINE,MSO_ARROWHEAD=_("MSO_ARROWHEAD",{NONE:"none",TRIANGLE:"triangle",OPEN:"arrow",STEALTH:"stealth",DIAMOND:"diamond",OVAL:"oval"}),MSO_ARROWHEAD_SIZE=_("MSO_ARROWHEAD_SIZE",{SMALL:"sm",MEDIUM:"med",LARGE:"lg"}),MSO_SHAPE_TYPE=_("MSO_SHAPE_TYPE",{AUTO_SHAPE:"autoshape",FREEFORM:"freeform",GROUP:"group",LINE:"line",TABLE:"table",CHART:"chart",MEDIA:"movie",PICTURE:"picture",PLACEHOLDER:"placeholder",TEXT_BOX:"textbox",COMPONENT:"component"}),XL_CHART_TYPE=_("XL_CHART_TYPE",{COLUMN_CLUSTERED:"column-clustered",COLUMN_STACKED:"column-stacked",COLUMN_STACKED_100:"column-stacked-100",BAR_CLUSTERED:"bar-clustered",BAR_STACKED:"bar-stacked",BAR_STACKED_100:"bar-stacked-100",LINE:"line",LINE_MARKERS:"line-markers",AREA:"area",AREA_STACKED:"area-stacked",AREA_STACKED_100:"area-stacked-100",PIE:"pie",DOUGHNUT:"doughnut",XY_SCATTER:"scatter",XY_SCATTER_LINES:"scatter-lines",XY_SCATTER_SMOOTH:"scatter-smooth"}),XL_LEGEND_POSITION=_("XL_LEGEND_POSITION",{BOTTOM:"bottom",TOP:"top",LEFT:"left",RIGHT:"right"}),XL_LABEL_POSITION=_("XL_LABEL_POSITION",{ABOVE:"t",BELOW:"b",BEST_FIT:"bestFit",CENTER:"ctr",INSIDE_BASE:"inBase",INSIDE_END:"inEnd",LEFT:"l",OUTSIDE_END:"outEnd",RIGHT:"r"}),MSO_FILL=_("MSO_FILL",{SOLID:"solid",BACKGROUND:"background",GRADIENT:"gradient"}),THEME_FONT=_("THEME_FONT",{MAJOR:"+mj-lt",MINOR:"+mn-lt"});
@@ -174,6 +174,21 @@ export interface DeckFactData {
174
174
  /** The project file its numbers came from; absent: written in the slides file or the code. */
175
175
  source?: string;
176
176
  };
177
+ /**
178
+ * A line's two ends (a connector, or a freeform left open): each one's
179
+ * point, the arrowhead it has, the shape it is glued to, and the shape
180
+ * whose box's outline is nearest it, how far in points (0 on it).
181
+ */
182
+ "line-ends": {
183
+ shape: string;
184
+ ends: {
185
+ at: [x: number, y: number];
186
+ head: string;
187
+ glued?: string;
188
+ near?: string;
189
+ by?: number;
190
+ }[];
191
+ };
177
192
  "table-grown": {
178
193
  shape: string;
179
194
  /** Its height as set and as drawn. */
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{READ_DEFAULTS as W,phoneScale as X}from"@allyhub/piece";import{deckFact as m}from"./fact.js";import{STANDARD_FONTS as Y}from"./theme.js";export const DECK_FACT_DEFAULTS={within:8,aligned:.5,drift:1,phone:W.phone,slack:1};const E=e=>e[0]+e[2],$=e=>e[1]+e[3],F=e=>Math.max(0,e[2])*Math.max(0,e[3]),w=(e,h=2)=>{const d=10**h;return Math.round(e*d)/d};function N(e,h,d){const M=[],a=(r,k)=>{k>d&&M.push({side:r,px:k})};return a("left",h[0]-e[0]),a("top",h[1]-e[1]),a("right",E(e)-E(h)),a("bottom",$(e)-$(h)),M}const R=(e,h)=>{const d=Math.max(e[0],h[0]),M=Math.max(e[1],h[1]);return[d,M,Math.min(E(e),E(h))-d,Math.min($(e),$(h))-M]},Z=(e,h,d)=>e[0]>=h[0]-d&&e[1]>=h[1]-d&&E(e)<=E(h)+d&&$(e)<=$(h)+d,O={left:e=>e[0],right:E,"centre-x":e=>e[0]+e[2]/2,top:e=>e[1],bottom:$,"centre-y":e=>e[1]+e[3]/2},A=e=>e.opaque||!e.text?.glyphs?e.box:e.text.glyphs,ee=new Set(Object.keys(O)),se=new Set(["left","right","top","bottom"]);function Q(e){if(e.opaque)return ee;if(!e.text?.glyphs)return se;const h=e.text.align??"l";return new Set([h==="ctr"?"centre-x":h==="r"?"right":"left"])}const te=(e,h)=>h.some(d=>new RegExp(`^${d.split("*").map(M=>M.replace(/[.*+?^${}()|[\]\\]/gu,"\\$&")).join(".*")}$`,"su").test(e)),ne=e=>e.box[2]>0||e.box[3]>0;export function deckFacts(e,h,d,M={}){const a={...DECK_FACT_DEFAULTS,...M},r=s=>w(s/e.pxPerPt),k=s=>[r(s[0]),r(s[1]),r(s[2]),r(s[3])],q=s=>s.map(n=>({side:n.side,pt:w(n.px/e.pxPerPt,1)})),H=s=>w(s,3),B=s=>s.opaque||!s.text?.glyphs?"frame":"glyphs",T=(s,n,x)=>n==="left"||n==="right"||n==="centre-x"?{shape:s.name,x:w(r(s.frame[0])+x)}:{shape:s.name,y:w(r(s.frame[1])+x)},g=[],D=[0,0,h.width,h.height],_=new Map,j=new Map,I=new Map;for(const s of e.slides){const n={...d,part:s.slide,t:s.t},x=j.get(s.slide)??{at:n,total:s.steps??1,measured:0,shapes:new Map};j.set(s.slide,x),x.measured++;for(const c of s.shapes){if(c.level!=="slide")continue;const t=x.shapes.get(c.name)??{hidden:0,by:[]};c.hidden===!0&&t.hidden++,x.shapes.set(c.name,t)}const b=s.shapes.filter(c=>ne(c)&&c.hidden!==!0&&(a.levels===void 0||a.levels.includes(c.level))&&!te(c.name,a.except??[]));let L=0,J=0,K=0;for(const[c,t]of b.entries()){t.chart&&g.push(m("chart-data",n,{shape:t.name,...t.chart}));const p=(t.rows??[]).flatMap((l,u)=>l.drawn>l.set+a.slack?[{row:u,set:r(l.set),drawn:r(l.drawn)}]:[]);p.length>0&&g.push(m("table-grown",n,{shape:t.name,set:r(t.frame[3]),drawn:r(t.box[3]),rows:p}));const o=t.text;if(o?.glyphs){K++,L+=o.words,J+=o.lines.length;const l=N(o.glyphs,t.box,a.slack);l.length>0&&g.push(m("text-overflow",n,{shape:t.name,text:o.text,box:k(t.box),glyphs:k(o.glyphs),edges:q(l),lines:o.lines.length,past:o.lines.filter(i=>N(i,t.box,a.slack).length>0).length,...o.scale===void 0?{}:{scale:o.scale}}));const u=N(o.glyphs,D,a.slack);if(u.length>0){const i=F(o.glyphs);g.push(m("text-off-slide",n,{shape:t.name,text:o.text,glyphs:k(o.glyphs),edges:q(u),share:i>0?H(1-F(R(o.glyphs,D))/i):1}))}for(const i of o.type){const v=`${String(i.size)}/${String(i.weight)}`,z=_.get(v)??{size:i.size,weight:i.weight,slides:new Set,shapes:new Set};z.slides.add(s.slide),z.shapes.add(`${s.slide}/${t.name}`),_.set(v,z)}const f=o.type.reduce((i,v)=>i===void 0||v.size<i.size?v:i,void 0);if(f){const i=a.room,v=f.xHeight===void 0?"em":"x",z=i&&(f.xHeight??f.size)*(i.screen*1e3/(h.width/e.pxPerPt));g.push(m("read-size",n,{shape:t.name,text:o.text,size:f.size,...f.xHeight===void 0?{}:{xHeight:f.xHeight},...i&&z!==void 0?{screen:{by:v,mm:w(z,1),arcmin:w(Math.atan(z/1e3/i.distance)*180*60/Math.PI,1)}}:{},phone:w(f.size*e.pxPerPt*X([h.width,h.height],a.phone),1),options:{...i?{room:{...i}}:{},phone:[...a.phone]}}))}}const S=N(t.box,D,a.slack);if(S.length>0){const l=F(t.box);g.push(m("shape-off-slide",n,{shape:t.name,box:k(t.box),edges:q(S),share:l>0?H(1-F(R(t.box,D))/l):1}))}if(t.picture){const[l,u]=t.picture.shown;if(l>0&&u>0){const f=Math.max(t.box[2]/l,t.box[3]/u),i=v=>v/e.pxPerPt/72;g.push(m("picture-resolution",n,{shape:t.name,source:t.picture.source,shown:t.picture.shown,box:k(t.box),scale:w(f),ppi:Math.round(Math.min(l/i(t.box[2]),u/i(t.box[3]))),stretch:w(t.box[2]/l/(t.box[3]/u)-1)}))}}const P=b.slice(c+1).find(l=>l.opaque&&Z(t.box,l.box,a.slack)),y=x.shapes.get(t.name);if(y?y.by.push(P?.name):P&&g.push(m("shape-hidden",n,{shape:t.name,by:P.name})),t.level==="slide"){const l=`${s.layout}\0${t.name}`,u=I.get(l)??new Map,f=[r(t.frame[0]),r(t.frame[1]),r(t.frame[2]),r(t.frame[3])],i=[...u.values()].find(v=>v.frame.every((z,V)=>Math.abs(z-(f[V]??0))<=a.drift));i?i.slides.includes(s.slide)||i.slides.push(s.slide):u.set(f.join(","),{frame:f,slides:[s.slide]}),I.set(l,u)}}for(let c=0;c<b.length;c++)for(let t=c+1;t<b.length;t++){const p=b[c],o=b[t];if(!p||!o)continue;const S=p.level==="slide"||o.level==="slide",P=R(A(p),A(o));if(S&&p.level==="slide"&&o.level==="slide"&&P[2]>a.slack&&P[3]>a.slack){const y=F(P);g.push(m("shape-overlap",n,{a:p.name,b:o.name,area:w(y/e.pxPerPt**2,1),share:H(y/Math.max(1,Math.min(F(A(p)),F(A(o)))))}))}if(S)for(const[y,l]of Object.entries(O)){if(!Q(p).has(y)||!Q(o).has(y))continue;const u=r(l(A(p))),f=r(l(A(o))),i=Math.abs(u-f);i>a.aligned&&i<=a.within&&g.push(m("near-alignment",n,{a:p.name,b:o.name,line:y,gap:w(i),at:{a:u,b:f},by:{a:B(p),b:B(o)},align:p.level==="slide"?T(p,y,f-u):T(o,y,u-f),options:{within:a.within,aligned:a.aligned}}))}}for(const c of b)if(!(c.level!=="slide"||!c.opaque))for(const t of["centre-x","centre-y"]){const p=r(O[t](c.box)),o=r(O[t](D)),S=Math.abs(p-o);S>a.aligned&&S<=a.within&&g.push(m("near-alignment",n,{a:c.name,b:"slide",line:t,gap:w(S),at:{a:p,b:o},by:{a:"frame",b:"frame"},align:T(c,t,o-p),options:{within:a.within,aligned:a.aligned}}))}g.push(m("words-on-slide",n,{words:L,lines:J,texts:K}))}for(const[s,n]of I){if(n.size<2)continue;const[x="",b=""]=s.split("\0");g.push(m("placement-drift",d,{layout:x,shape:b,places:[...n.values()],options:{drift:a.drift}}))}if(e.fonts&&e.fonts.length>0){const s=new Set(M.standard??Y);g.push(m("deck-fonts",d,{fonts:e.fonts.map(n=>({...n,standard:s.has(n.name)})),options:{standard:[...s]}}))}const C=[..._.values()].map(s=>({size:s.size,weight:s.weight,slides:s.slides.size,shapes:s.shapes.size})).sort((s,n)=>s.size-n.size||s.weight-n.weight),U=C[0];U&&g.push(m("type-in-use",d,{type:C,smallest:U.size}));for(const s of j.values())for(const[n,x]of s.shapes){const[b]=x.by;b!==void 0&&x.by.every(L=>L!==void 0)&&g.push(m("shape-hidden",s.at,{shape:n,by:b})),s.measured>=s.total&&x.hidden===s.measured&&g.push(m("shape-hidden",s.at,{shape:n,never:!0}))}const G=new Set;return g.filter(s=>{const n=JSON.stringify([s.kind,s.part,s.data]);return G.has(n)?!1:(G.add(n),!0)})}
2
+ import{READ_DEFAULTS as Y,phoneScale as Z}from"@allyhub/piece";import{deckFact as m}from"./fact.js";import{STANDARD_FONTS as ee}from"./theme.js";export const DECK_FACT_DEFAULTS={within:8,aligned:.5,drift:1,phone:Y.phone,slack:1};const k=e=>e[0]+e[2],P=e=>e[1]+e[3],F=e=>Math.max(0,e[2])*Math.max(0,e[3]),M=(e,n=2)=>{const c=10**n;return Math.round(e*c)/c};function te(e,n){const[c,x]=e;if(c>=n[0]&&c<=k(n)&&x>=n[1]&&x<=P(n))return Math.min(c-n[0],k(n)-c,x-n[1],P(n)-x);const r=Math.max(n[0]-c,0,c-k(n)),z=Math.max(n[1]-x,0,x-P(n));return Math.hypot(r,z)}function O(e,n,c){const x=[],h=(r,z)=>{z>c&&x.push({side:r,px:z})};return h("left",n[0]-e[0]),h("top",n[1]-e[1]),h("right",k(e)-k(n)),h("bottom",P(e)-P(n)),x}const B=(e,n)=>{const c=Math.max(e[0],n[0]),x=Math.max(e[1],n[1]);return[c,x,Math.min(k(e),k(n))-c,Math.min(P(e),P(n))-x]},se=(e,n,c)=>e[0]>=n[0]-c&&e[1]>=n[1]-c&&k(e)<=k(n)+c&&P(e)<=P(n)+c,_={left:e=>e[0],right:k,"centre-x":e=>e[0]+e[2]/2,top:e=>e[1],bottom:P,"centre-y":e=>e[1]+e[3]/2},L=e=>e.opaque||!e.text?.glyphs?e.box:e.text.glyphs,ne=new Set(Object.keys(_)),oe=new Set,C=e=>e.kind==="line"||e.ends!==void 0,ie=new Set(["left","right","top","bottom"]);function W(e){if(C(e))return oe;if(e.opaque)return ne;if(!e.text?.glyphs)return ie;const n=e.text.align??"l";return new Set([n==="ctr"?"centre-x":n==="r"?"right":"left"])}const ae=(e,n)=>n.some(c=>new RegExp(`^${c.split("*").map(x=>x.replace(/[.*+?^${}()|[\]\\]/gu,"\\$&")).join(".*")}$`,"su").test(e)),he=e=>e.box[2]>0||e.box[3]>0;export function deckFacts(e,n,c,x={}){const h={...DECK_FACT_DEFAULTS,...x},r=s=>M(s/e.pxPerPt),z=s=>[r(s[0]),r(s[1]),r(s[2]),r(s[3])],q=s=>s.map(i=>({side:i.side,pt:M(i.px/e.pxPerPt,1)})),H=s=>M(s,3),U=s=>s.opaque||!s.text?.glyphs?"frame":"glyphs",T=(s,i,w)=>i==="left"||i==="right"||i==="centre-x"?{shape:s.name,x:M(r(s.frame[0])+w)}:{shape:s.name,y:M(r(s.frame[1])+w)},f=[],N=[0,0,n.width,n.height],j=new Map,I=new Map,R=new Map;for(const s of e.slides){const i={...c,part:s.slide,t:s.t},w=I.get(s.slide)??{at:i,total:s.steps??1,measured:0,shapes:new Map};I.set(s.slide,w),w.measured++;for(const d of s.shapes){if(d.level!=="slide")continue;const t=w.shapes.get(d.name)??{hidden:0,by:[]};d.hidden===!0&&t.hidden++,w.shapes.set(d.name,t)}const y=s.shapes.filter(d=>he(d)&&d.hidden!==!0&&(h.levels===void 0||h.levels.includes(d.level))&&!ae(d.name,h.except??[]));let A=0,Q=0,V=0;const X=y.filter(d=>d.ends===void 0);for(const d of y)d.ends&&f.push(m("line-ends",i,{shape:d.name,ends:d.ends.map(t=>{let l;for(const o of X){const v=te(t.at,o.box);(!l||v<l.by)&&(l={name:o.name,by:v})}return{at:[r(t.at[0]),r(t.at[1])],head:t.head,...t.glued===void 0?{}:{glued:t.glued},...l?{near:l.name,by:r(l.by)}:{}}})}));for(const[d,t]of y.entries()){t.chart&&f.push(m("chart-data",i,{shape:t.name,...t.chart}));const l=(t.rows??[]).flatMap((a,g)=>a.drawn>a.set+h.slack?[{row:g,set:r(a.set),drawn:r(a.drawn)}]:[]);l.length>0&&f.push(m("table-grown",i,{shape:t.name,set:r(t.frame[3]),drawn:r(t.box[3]),rows:l}));const o=t.text;if(o?.glyphs){V++,A+=o.words,Q+=o.lines.length;const a=o.own??{box:t.box,glyphs:o.glyphs,lines:o.lines},g=a.glyphs?O(a.glyphs,a.box,h.slack):[];g.length>0&&a.glyphs&&f.push(m("text-overflow",i,{shape:t.name,text:o.text,box:z(a.box),glyphs:z(a.glyphs),edges:q(g),lines:a.lines.length,past:a.lines.filter(p=>O(p,a.box,h.slack).length>0).length,...o.scale===void 0?{}:{scale:o.scale}}));const b=O(o.glyphs,N,h.slack);if(b.length>0){const p=F(o.glyphs);f.push(m("text-off-slide",i,{shape:t.name,text:o.text,glyphs:z(o.glyphs),edges:q(b),share:p>0?H(1-F(B(o.glyphs,N))/p):1}))}for(const p of o.type){const E=`${String(p.size)}/${String(p.weight)}`,$=j.get(E)??{size:p.size,weight:p.weight,slides:new Set,shapes:new Set};$.slides.add(s.slide),$.shapes.add(`${s.slide}/${t.name}`),j.set(E,$)}const u=o.type.reduce((p,E)=>p===void 0||E.size<p.size?E:p,void 0);if(u){const p=h.room,E=u.xHeight===void 0?"em":"x",$=p&&(u.xHeight??u.size)*(p.screen*1e3/(n.width/e.pxPerPt));f.push(m("read-size",i,{shape:t.name,text:o.text,size:u.size,...u.xHeight===void 0?{}:{xHeight:u.xHeight},...p&&$!==void 0?{screen:{by:E,mm:M($,1),arcmin:M(Math.atan($/1e3/p.distance)*180*60/Math.PI,1)}}:{},phone:M(u.size*e.pxPerPt*Z([n.width,n.height],h.phone),1),options:{...p?{room:{...p}}:{},phone:[...h.phone]}}))}}const v=O(t.box,N,h.slack);if(v.length>0){const a=F(t.box);f.push(m("shape-off-slide",i,{shape:t.name,box:z(t.box),edges:q(v),share:a>0?H(1-F(B(t.box,N))/a):1}))}if(t.picture){const[a,g]=t.picture.shown;if(a>0&&g>0){const b=Math.max(t.box[2]/a,t.box[3]/g),u=p=>p/e.pxPerPt/72;f.push(m("picture-resolution",i,{shape:t.name,source:t.picture.source,shown:t.picture.shown,box:z(t.box),scale:M(b),ppi:Math.round(Math.min(a/u(t.box[2]),g/u(t.box[3]))),stretch:M(t.box[2]/a/(t.box[3]/g)-1)}))}}const D=y.slice(d+1).find(a=>a.opaque&&se(t.box,a.box,h.slack)),S=w.shapes.get(t.name);if(S?S.by.push(D?.name):D&&f.push(m("shape-hidden",i,{shape:t.name,by:D.name})),t.level==="slide"){const a=`${s.layout}\0${t.name}`,g=R.get(a)??new Map,b=[r(t.frame[0]),r(t.frame[1]),r(t.frame[2]),r(t.frame[3])],u=[...g.values()].find(p=>p.frame.every((E,$)=>Math.abs(E-(b[$]??0))<=h.drift));u?u.slides.includes(s.slide)||u.slides.push(s.slide):g.set(b.join(","),{frame:b,slides:[s.slide]}),R.set(a,g)}}for(let d=0;d<y.length;d++)for(let t=d+1;t<y.length;t++){const l=y[d],o=y[t];if(!l||!o)continue;const v=l.level==="slide"||o.level==="slide",D=B(L(l),L(o));if(v&&!C(l)&&!C(o)&&l.level==="slide"&&o.level==="slide"&&D[2]>h.slack&&D[3]>h.slack){const S=F(D);f.push(m("shape-overlap",i,{a:l.name,b:o.name,area:M(S/e.pxPerPt**2,1),share:H(S/Math.max(1,Math.min(F(L(l)),F(L(o)))))}))}if(v)for(const[S,a]of Object.entries(_)){if(!W(l).has(S)||!W(o).has(S))continue;const g=r(a(L(l))),b=r(a(L(o))),u=Math.abs(g-b);u>h.aligned&&u<=h.within&&f.push(m("near-alignment",i,{a:l.name,b:o.name,line:S,gap:M(u),at:{a:g,b},by:{a:U(l),b:U(o)},align:l.level==="slide"?T(l,S,b-g):T(o,S,g-b),options:{within:h.within,aligned:h.aligned}}))}}for(const d of y)if(!(d.level!=="slide"||!d.opaque))for(const t of["centre-x","centre-y"]){const l=r(_[t](d.box)),o=r(_[t](N)),v=Math.abs(l-o);v>h.aligned&&v<=h.within&&f.push(m("near-alignment",i,{a:d.name,b:"slide",line:t,gap:M(v),at:{a:l,b:o},by:{a:"frame",b:"frame"},align:T(d,t,o-l),options:{within:h.within,aligned:h.aligned}}))}f.push(m("words-on-slide",i,{words:A,lines:Q,texts:V}))}for(const[s,i]of R){if(i.size<2)continue;const[w="",y=""]=s.split("\0");f.push(m("placement-drift",c,{layout:w,shape:y,places:[...i.values()],options:{drift:h.drift}}))}if(e.fonts&&e.fonts.length>0){const s=new Set(x.standard??ee);f.push(m("deck-fonts",c,{fonts:e.fonts.map(i=>({...i,standard:s.has(i.name)})),options:{standard:[...s]}}))}const G=[...j.values()].map(s=>({size:s.size,weight:s.weight,slides:s.slides.size,shapes:s.shapes.size})).sort((s,i)=>s.size-i.size||s.weight-i.weight),J=G[0];J&&f.push(m("type-in-use",c,{type:G,smallest:J.size}));for(const s of I.values())for(const[i,w]of s.shapes){const[y]=w.by;y!==void 0&&w.by.every(A=>A!==void 0)&&f.push(m("shape-hidden",s.at,{shape:i,by:y})),s.measured>=s.total&&w.hidden===s.measured&&f.push(m("shape-hidden",s.at,{shape:i,never:!0}))}const K=new Set;return f.filter(s=>{const i=JSON.stringify([s.kind,s.part,s.data]);return K.has(i)?!1:(K.add(i),!0)})}
@@ -1,4 +1,4 @@
1
- import type { AnimationFile, LineDash, Numbering, TransitionFile, LineEnd, ShapeGeometry, TextAlign } from "@allyhub/formats";
1
+ import type { AnimationFile, LineDash, Numbering, TransitionFile, LineEnd, LineEndSize, ShapeGeometry, TextAlign } from "@allyhub/formats";
2
2
  import type { ChartDef, Color } from "@allyhub/chart";
3
3
  import type { ComponentFrame, FramedComponent, PropType } from "@allyhub/piece";
4
4
  import type { Anchor, AutoSize, PlaceholderType } from "./enums.js";
@@ -199,13 +199,17 @@ export interface ShapeDef {
199
199
  fill_transparency?: number;
200
200
  /** A gradient in place of its fill. */
201
201
  gradient?: GradientDef;
202
- shadow?: ShadowDef;
202
+ /** null: no effects of its own, an empty `a:effectLst` (python-pptx's `shadow.inherit = False`). */
203
+ shadow?: ShadowDef | null;
203
204
  line?: Color | null;
204
205
  line_width?: Length;
205
206
  line_dash?: LineDash;
206
207
  /** What the end of its line where it starts has (`a:headEnd`), and where it ends (`a:tailEnd`). */
207
208
  line_begin?: LineEnd;
208
209
  line_end?: LineEnd;
210
+ /** How large each end's arrowhead is (`a:headEnd/@w`, `@len`; `a:tailEnd`); what it leaves out is medium. */
211
+ line_begin_size?: LineEndSize;
212
+ line_end_size?: LineEndSize;
209
213
  geometry?: ShapeGeometry;
210
214
  /** A freeform's outline (`a:custGeom`), in place of a geometry. */
211
215
  path?: FreeformPath;
@@ -78,12 +78,14 @@ export interface ResolvedShape {
78
78
  fill?: Color | null;
79
79
  fill_transparency?: number;
80
80
  gradient?: GradientDef;
81
- shadow?: ShadowDef;
81
+ shadow?: ShadowDef | null;
82
82
  line?: Color | null;
83
83
  line_width?: Length;
84
84
  line_dash?: NonNullable<ShapeDef["line_dash"]>;
85
85
  line_begin?: NonNullable<ShapeDef["line_begin"]>;
86
86
  line_end?: NonNullable<ShapeDef["line_end"]>;
87
+ line_begin_size?: NonNullable<ShapeDef["line_begin_size"]>;
88
+ line_end_size?: NonNullable<ShapeDef["line_end_size"]>;
87
89
  path?: NonNullable<ShapeDef["path"]>;
88
90
  table?: ResolvedTable;
89
91
  chart?: ChartDef;