@allyhub/sdk 0.9.0 → 0.11.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 (148) hide show
  1. package/CHANGELOG.md +16 -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/dist/problem.d.ts +7 -0
  9. package/dist/node_modules/@allyhub/diagnostics/package.json +1 -1
  10. package/dist/node_modules/@allyhub/formats/dist/data/faces.d.ts +1 -1
  11. package/dist/node_modules/@allyhub/formats/dist/data/sheet.d.ts +87 -1
  12. package/dist/node_modules/@allyhub/formats/dist/data/sheet.js +1 -1
  13. package/dist/node_modules/@allyhub/formats/dist/data/slides.d.ts +89 -0
  14. package/dist/node_modules/@allyhub/formats/dist/data/slides.js +1 -1
  15. package/dist/node_modules/@allyhub/formats/dist/note-shape.d.ts +20 -0
  16. package/dist/node_modules/@allyhub/formats/dist/note-shape.js +1 -1
  17. package/dist/node_modules/@allyhub/formats/dist/schemas.d.ts +50 -0
  18. package/dist/node_modules/@allyhub/formats/package.json +1 -1
  19. package/dist/node_modules/@allyhub/image-draw/package.json +1 -1
  20. package/dist/node_modules/@allyhub/image-measure/package.json +1 -1
  21. package/dist/node_modules/@allyhub/image-sdk/dist/index.d.ts +1 -1
  22. package/dist/node_modules/@allyhub/image-sdk/package.json +1 -1
  23. package/dist/node_modules/@allyhub/measure/package.json +1 -1
  24. package/dist/node_modules/@allyhub/ooxml/dist/geometry/index.js +1 -1
  25. package/dist/node_modules/@allyhub/ooxml/package.json +1 -1
  26. package/dist/node_modules/@allyhub/piece/dist/layer.d.ts +2 -0
  27. package/dist/node_modules/@allyhub/piece/dist/layout.d.ts +16 -0
  28. package/dist/node_modules/@allyhub/piece/dist/page/index.d.ts +1 -1
  29. package/dist/node_modules/@allyhub/piece/dist/page/index.js +1 -1
  30. package/dist/node_modules/@allyhub/piece/dist/page/locate.d.ts +14 -1
  31. package/dist/node_modules/@allyhub/piece/dist/page/locate.js +1 -1
  32. package/dist/node_modules/@allyhub/piece/dist/stage.d.ts +18 -0
  33. package/dist/node_modules/@allyhub/piece/package.json +1 -1
  34. package/dist/node_modules/@allyhub/protocol/dist/account.d.ts +140 -0
  35. package/dist/node_modules/@allyhub/protocol/dist/account.js +1 -1
  36. package/dist/node_modules/@allyhub/protocol/dist/auth.d.ts +19 -1
  37. package/dist/node_modules/@allyhub/protocol/dist/auth.js +1 -1
  38. package/dist/node_modules/@allyhub/protocol/dist/cloud.d.ts +157 -0
  39. package/dist/node_modules/@allyhub/protocol/dist/cloud.js +1 -1
  40. package/dist/node_modules/@allyhub/protocol/dist/editor.d.ts +10 -2
  41. package/dist/node_modules/@allyhub/protocol/dist/editor.js +1 -1
  42. package/dist/node_modules/@allyhub/protocol/dist/frame.d.ts +101 -186
  43. package/dist/node_modules/@allyhub/protocol/dist/frame.js +1 -1
  44. package/dist/node_modules/@allyhub/protocol/dist/mail.d.ts +1 -0
  45. package/dist/node_modules/@allyhub/protocol/dist/mail.js +1 -1
  46. package/dist/node_modules/@allyhub/protocol/dist/notes.d.ts +92 -94
  47. package/dist/node_modules/@allyhub/protocol/dist/notes.js +1 -1
  48. package/dist/node_modules/@allyhub/protocol/dist/snapshots.d.ts +17 -0
  49. package/dist/node_modules/@allyhub/protocol/dist/snapshots.js +1 -1
  50. package/dist/node_modules/@allyhub/protocol/dist/teams.d.ts +7 -0
  51. package/dist/node_modules/@allyhub/protocol/dist/teams.js +1 -1
  52. package/dist/node_modules/@allyhub/protocol/dist/tools.d.ts +15 -3
  53. package/dist/node_modules/@allyhub/protocol/dist/tools.js +1 -1
  54. package/dist/node_modules/@allyhub/protocol/package.json +1 -1
  55. package/dist/node_modules/@allyhub/runtimes/package.json +1 -1
  56. package/dist/node_modules/@allyhub/scenery/dist/index.d.ts +2 -2
  57. package/dist/node_modules/@allyhub/scenery/dist/index.js +1 -1
  58. package/dist/node_modules/@allyhub/scenery/dist/moire.d.ts +45 -5
  59. package/dist/node_modules/@allyhub/scenery/dist/moire.js +2 -2
  60. package/dist/node_modules/@allyhub/scenery/dist/phone.d.ts +4 -3
  61. package/dist/node_modules/@allyhub/scenery/dist/phone.js +1 -1
  62. package/dist/node_modules/@allyhub/scenery/package.json +1 -1
  63. package/dist/node_modules/@allyhub/sheet/dist/calc/coerce.js +1 -1
  64. package/dist/node_modules/@allyhub/sheet/dist/calc/engine.d.ts +70 -0
  65. package/dist/node_modules/@allyhub/sheet/dist/calc/engine.js +1 -1
  66. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/criteria.d.ts +6 -0
  67. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/criteria.js +1 -1
  68. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/date.js +1 -1
  69. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/define.d.ts +3 -1
  70. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/define.js +1 -1
  71. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/info.js +1 -1
  72. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/kernels.js +1 -1
  73. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/lookup.js +1 -1
  74. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/maths.js +1 -1
  75. package/dist/node_modules/@allyhub/sheet/dist/calc/functions/text.js +1 -1
  76. package/dist/node_modules/@allyhub/sheet/dist/calc/indexes.d.ts +9 -0
  77. package/dist/node_modules/@allyhub/sheet/dist/calc/indexes.js +1 -1
  78. package/dist/node_modules/@allyhub/sheet/dist/calc/types.d.ts +6 -0
  79. package/dist/node_modules/@allyhub/sheet/dist/calc/types.js +1 -1
  80. package/dist/node_modules/@allyhub/sheet/dist/chart.d.ts +9 -0
  81. package/dist/node_modules/@allyhub/sheet/dist/chart.js +1 -1
  82. package/dist/node_modules/@allyhub/sheet/dist/export.d.ts +0 -8
  83. package/dist/node_modules/@allyhub/sheet/dist/export.js +2 -4
  84. package/dist/node_modules/@allyhub/sheet/dist/formula/ast.d.ts +12 -1
  85. package/dist/node_modules/@allyhub/sheet/dist/formula/move.d.ts +5 -1
  86. package/dist/node_modules/@allyhub/sheet/dist/formula/move.js +1 -1
  87. package/dist/node_modules/@allyhub/sheet/dist/formula/parse.js +1 -1
  88. package/dist/node_modules/@allyhub/sheet/dist/formula/print.js +1 -1
  89. package/dist/node_modules/@allyhub/sheet/dist/index.d.ts +3 -2
  90. package/dist/node_modules/@allyhub/sheet/dist/index.js +1 -1
  91. package/dist/node_modules/@allyhub/sheet/dist/inspect.d.ts +12 -2
  92. package/dist/node_modules/@allyhub/sheet/dist/inspect.js +1 -1
  93. package/dist/node_modules/@allyhub/sheet/dist/printed.d.ts +19 -0
  94. package/dist/node_modules/@allyhub/sheet/dist/printed.js +2 -0
  95. package/dist/node_modules/@allyhub/sheet/dist/values.d.ts +2 -0
  96. package/dist/node_modules/@allyhub/sheet/dist/values.js +1 -1
  97. package/dist/node_modules/@allyhub/sheet/dist/workbook.d.ts +2 -0
  98. package/dist/node_modules/@allyhub/sheet/dist/workbook.js +1 -1
  99. package/dist/node_modules/@allyhub/sheet/dist/write.js +15 -15
  100. package/dist/node_modules/@allyhub/sheet/dist/xlsx/charts.d.ts +6 -2
  101. package/dist/node_modules/@allyhub/sheet/dist/xlsx/charts.js +1 -1
  102. package/dist/node_modules/@allyhub/sheet/dist/xlsx/formula.js +2 -2
  103. package/dist/node_modules/@allyhub/sheet/dist/xlsx/import.d.ts +0 -1
  104. package/dist/node_modules/@allyhub/sheet/dist/xlsx/import.js +1 -1
  105. package/dist/node_modules/@allyhub/sheet/dist/xlsx/read.d.ts +3 -1
  106. package/dist/node_modules/@allyhub/sheet/dist/xlsx/read.js +2 -2
  107. package/dist/node_modules/@allyhub/sheet/dist/xlsx/sax.d.ts +7 -1
  108. package/dist/node_modules/@allyhub/sheet/dist/xlsx/sax.js +3 -1
  109. package/dist/node_modules/@allyhub/sheet/dist/xlsx/styles.d.ts +6 -0
  110. package/dist/node_modules/@allyhub/sheet/dist/xlsx/styles.js +1 -1
  111. package/dist/node_modules/@allyhub/sheet/dist/xlsx/write.d.ts +1 -1
  112. package/dist/node_modules/@allyhub/sheet/dist/xlsx/write.js +1 -1
  113. package/dist/node_modules/@allyhub/sheet/dist/xlsx/xml.d.ts +12 -1
  114. package/dist/node_modules/@allyhub/sheet/dist/xlsx/xml.js +3 -2
  115. package/dist/node_modules/@allyhub/sheet/package.json +1 -1
  116. package/dist/node_modules/@allyhub/slides-core/dist/api.d.ts +57 -7
  117. package/dist/node_modules/@allyhub/slides-core/dist/api.js +2 -2
  118. package/dist/node_modules/@allyhub/slides-core/dist/capabilities.js +1 -1
  119. package/dist/node_modules/@allyhub/slides-core/dist/enums.d.ts +24 -0
  120. package/dist/node_modules/@allyhub/slides-core/dist/enums.js +1 -1
  121. package/dist/node_modules/@allyhub/slides-core/dist/fact.d.ts +15 -0
  122. package/dist/node_modules/@allyhub/slides-core/dist/measure.js +1 -1
  123. package/dist/node_modules/@allyhub/slides-core/dist/model.d.ts +6 -2
  124. package/dist/node_modules/@allyhub/slides-core/dist/resolve.d.ts +3 -1
  125. package/dist/node_modules/@allyhub/slides-core/dist/resolve.js +1 -1
  126. package/dist/node_modules/@allyhub/slides-core/dist/sdk.d.ts +1 -1
  127. package/dist/node_modules/@allyhub/slides-core/dist/sdk.js +1 -1
  128. package/dist/node_modules/@allyhub/slides-core/package.json +1 -1
  129. package/dist/node_modules/@allyhub/video-core/dist/piece.d.ts +2 -2
  130. package/dist/node_modules/@allyhub/video-core/dist/schema.d.ts +2 -2
  131. package/dist/node_modules/@allyhub/video-core/dist/schema.js +1 -1
  132. package/dist/node_modules/@allyhub/video-core/package.json +1 -1
  133. package/dist/node_modules/@allyhub/video-sdk/dist/phone.d.ts +12 -5
  134. package/dist/node_modules/@allyhub/video-sdk/dist/phone.js +1 -1
  135. package/dist/node_modules/@allyhub/video-sdk/package.json +1 -1
  136. package/docs/README.md +4 -0
  137. package/docs/canvas.md +28 -0
  138. package/docs/defaults.md +30 -4
  139. package/docs/docs.md +10 -10
  140. package/docs/image.md +3 -3
  141. package/docs/linkedin.md +96 -0
  142. package/docs/reports.md +89 -0
  143. package/docs/scenery.md +3 -4
  144. package/docs/sheets.md +23 -6
  145. package/docs/slides.md +50 -4
  146. package/docs/speech.md +1 -1
  147. package/docs/x.md +73 -0
  148. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -2,6 +2,22 @@
2
2
 
3
3
  Feature highlights from each AllyHub release.
4
4
 
5
+ ## 0.11.0
6
+
7
+ - **Reports.** A page written freely in HTML, CSS and JavaScript, read on a screen and sent as a link; rendered as one self-contained HTML file, a PDF or one long PNG, with report styles to start from (`allyhub report style`).
8
+ - **LinkedIn posts, carousels and articles**, written beside LinkedIn's look and checked against its limits; a post shows where LinkedIn folds it at "… more", and an article copies as LinkedIn's editor takes it.
9
+ - **Exports go to your Downloads.** An export from an editor lands in one folder, Downloads unless you choose another (`allyhub dev --exports`), and never overwrites a file there.
10
+ - **Mark up a thing by picking it.** Select marks what is under the pointer, and Mark up from a selection starts with it marked, so the agent is told exactly what you mean.
11
+ - **Present a deck on two screens as in PowerPoint**, each full screen, with Swap and Duplicate Slide Show.
12
+
13
+ ## 0.10.0
14
+
15
+ - **Word, Excel and PowerPoint files that hold up in Office.** A deck's file holds what its preview shows; a workbook keeps iterative calculation, data tables and combination charts; a chart over dates shows dates.
16
+ - **Docs for professional work.** Figures and tables numbered, table heads and columns that never break a word, memo and business-letter pages; `allyhub render` says how a doc's pages printed.
17
+ - **`allyhub inspect` shows the important part first.** The most notable findings of each kind, with `--kind` and `--all` for the rest; a long answer is kept whole in a file.
18
+ - **A screen filmed by a phone looks filmed by default**, its colours following what fills the frame, and renders several times faster.
19
+ - **Mark up anywhere.** Mark up on a picture, an animation as it plays and an app in the conversation; a project's page shows its work as cards.
20
+
5
21
  ## 0.9.0
6
22
 
7
23
  - **A project lists its work.** `allyhub.yaml` names each piece's file, which can have any name in any folder. A project made before this version needs one for Studio to show its work.
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/audio",
3
- "version": "0.9.0",
3
+ "version": "0.11.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -7,6 +7,9 @@ export interface ChartRefs {
7
7
  categories: string | undefined;
8
8
  /** Whether its categories are numbers (dates, years): a numRef. */
9
9
  numeric?: boolean;
10
+ /** Those numbers, as their cells hold them, and their cells' format: cached so a reader shows the dates, not their serials. */
11
+ categoryNumbers?: readonly (number | null)[];
12
+ categoryFormat?: string | undefined;
10
13
  /** A series' values. */
11
14
  values: (series: number) => string;
12
15
  /** A scatter series' places across. */
@@ -1,3 +1,3 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{lumOf as X}from"@allyhub/ooxml/brightness";import{accentOf as j,CHART_DEFAULTS as d,chartDrawing as D,groupingOf as z,hasLines as E,hasMarkers as U,isArea as R,isBar as C,isHorizontal as T,isLine as P,isRound as h,isScatter as k,labelPositionOf as V,variesOf as w}from"./chart.js";const B="http://schemas.openxmlformats.org/drawingml/2006/chart",W="http://schemas.openxmlformats.org/drawingml/2006/main",H="http://schemas.openxmlformats.org/officeDocument/2006/relationships",Z=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
3
- `,y="2118791784",x="2140495176",q={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"},K=e=>{const n=e.charCodeAt(0);return n<32&&n!==9&&n!==10&&n!==13||n===65534||n===65535},l=e=>Array.from(e,n=>K(n)?"":q[n]??n).join("");function r(e,n={},...c){const o=Object.entries(n).filter(([,s])=>s!==void 0).map(([s,i])=>` ${s}="${l(typeof i=="boolean"?i?"1":"0":String(i))}"`).join(""),a=c.join("");return a===""?`<${e}${o}/>`:`<${e}${o}>${a}</${e}>`}const Y=e=>{if(typeof e=="string")return r("a:schemeClr",{val:e});if("rgb"in e)return r("a:srgbClr",{val:e.rgb.replace("#","").toUpperCase()});const{lumMod:n,lumOff:c}=X(e.brightness);return r("a:schemeClr",{val:e.theme_color},t("a:lumMod",n),...c===void 0?[]:[t("a:lumOff",c)])},p=e=>e===null?r("a:noFill"):r("a:solidFill",{},Y(e)),t=(e,n)=>r(e,{val:typeof n=="boolean"?n?1:0:n}),m=(e,n)=>r("a:ln",n===void 0?{}:{w:Math.round(n*12700)},p(e)),F=(e,n)=>r("c:txPr",{},r("a:bodyPr"),r("a:lstStyle"),r("a:p",{},r("a:pPr",{},r("a:defRPr",e===void 0?{}:{sz:Math.round(e*100)},n===void 0?"":p(n))),r("a:endParaRPr",{lang:"en-US"}))),S=e=>r("c:strCache",{},t("c:ptCount",e.length),...e.map((n,c)=>r("c:pt",{idx:c},`<c:v>${l(n)}</c:v>`))),A=(e,n)=>r("c:numCache",{},`<c:formatCode>${l(e??"General")}</c:formatCode>`,t("c:ptCount",n.length),...n.flatMap((c,o)=>c===null?[]:[r("c:pt",{idx:o},`<c:v>${String(c)}</c:v>`)])),J=(e,n)=>r("c:tx",{},n===void 0?`<c:v>${l(e.name)}</c:v>`:r("c:strRef",{},`<c:f>${l(n)}</c:f>`,S([e.name]))),Q=(e,n)=>n===void 0?"":r("c:xVal",{},r("c:numRef",{},`<c:f>${l(n)}</c:f>`,A("General",e.x??[])));function ee(e,n,c,o){const a=n.color??j(c),s=h(e.type),i=k(e.type),u=P(e.type)||i,g=U(e.type),N=u?r("c:spPr",{},E(e.type)?m(a,n.line_width??d.lineWidth):r("a:ln",{w:19050},p(null))):r("c:spPr",{},p(a),s?m("lt1",1):""),_=o.categories;return r("c:ser",{},t("c:idx",c),t("c:order",c),J(n,o.name(c)),N,C(e.type)?t("c:invertIfNegative",!1):"",u?r("c:marker",{},t("c:symbol",g?"circle":"none"),g?t("c:size",n.marker_size??d.marker):"",g?r("c:spPr",{},p(a),m(a)):""):"",...w(e)&&!u&&!R(e.type)?e.categories.map((v,f)=>r("c:dPt",{},t("c:idx",f),C(e.type)?t("c:invertIfNegative",!1):"",t("c:bubble3D",!1),r("c:spPr",{},p(e.category_colors?.[f]??j(f)),s?m("lt1",1):""))):[],i?Q(n,o.x?.(c)):_===void 0?"":r("c:cat",{},o.numeric===!0?r("c:numRef",{},`<c:f>${l(_)}</c:f>`,A("General",e.categories.map(v=>{const f=Number(v);return v===""||!Number.isFinite(f)?null:f}))):r("c:strRef",{},`<c:f>${l(_)}</c:f>`,S(e.categories))),r(i?"c:yVal":"c:val",{},r("c:numRef",{},`<c:f>${l(o.values(c))}</c:f>`,A(n.number_format,n.values))),u?t("c:smooth",n.smooth===!0||e.type==="scatter-smooth"):"")}function b(e){const n=e.labels;if(!n)return"";const c=n.show_percentage===!0,o=V(e);return r("c:dLbls",{},n.number_format===void 0?"":r("c:numFmt",{formatCode:n.number_format,sourceLinked:0}),n.size===void 0&&n.color===void 0&&!h(e.type)?"":F(n.size,n.color??(h(e.type)?"lt1":void 0)),o===void 0?"":t("c:dLblPos",o),t("c:showLegendKey",!1),t("c:showVal",n.show_value??!c),t("c:showCatName",n.show_category_name===!0),t("c:showSerName",n.show_series_name===!0),t("c:showPercent",c),t("c:showBubbleSize",!1))}function te(e,n){const c=e.series.map((s,i)=>ee(e,s,i,n)).join(""),o=z(e.type),a=t("c:axId",y)+t("c:axId",x);if(h(e.type)){const s=e.type==="pie";return r(s?"c:pieChart":"c:doughnutChart",{},t("c:varyColors",w(e)),c,b(e),t("c:firstSliceAng",0),s?"":t("c:holeSize",e.hole_size??50))}if(k(e.type))return r("c:scatterChart",{},t("c:scatterStyle","lineMarker"),t("c:varyColors",!1),c,b(e),a);if(C(e.type)){const s=o!=="clustered";return r("c:barChart",{},t("c:barDir",T(e.type)?"bar":"col"),t("c:grouping",o),t("c:varyColors",w(e)),c,b(e),t("c:gapWidth",e.gap_width??150),e.overlap!==void 0||s?t("c:overlap",e.overlap??100):"",a)}return r(P(e.type)?"c:lineChart":"c:areaChart",{},t("c:grouping",o),t("c:varyColors",!1),c,b(e),P(e.type)?t("c:marker",!0):"",a)}const L=e=>r("c:scaling",{},t("c:orientation",e.reverse_order===!0?"maxMin":"minMax"),e.maximum_scale===void 0?"":t("c:max",e.maximum_scale),e.minimum_scale===void 0?"":t("c:min",e.minimum_scale)),O=e=>r("c:spPr",{},m(e.line_color??{rgb:d.axisLine},d.gridWidth)),M=e=>e.has_major_gridlines===!0?r("c:majorGridlines",{},r("c:spPr",{},m(e.gridline_color??{rgb:d.gridline},d.gridWidth))):"",I=(e,n)=>r("c:rich",{},r("a:bodyPr"),r("a:lstStyle"),r("a:p",{},r("a:pPr",{},r("a:defRPr",{sz:n,b:0})),r("a:r",{},r("a:rPr",{lang:"en-US",sz:n,b:0}),`<a:t>${l(e)}</a:t>`))),$=(e,n)=>e===void 0||e===""?"":r("c:title",{},r("c:tx",{},I(e,n)),t("c:overlay",!1));function ne(e){if(h(e.type))return"";const n=k(e.type),c=T(e.type),o=e.category_axis??{},a={has_major_gridlines:!0,...e.value_axis},s=z(e.type)==="percentStacked",i=a.number_format??(s?"0%":e.series[0]?.number_format??"General"),u=Math.round((e.font_size??d.fontSize)*100);return(n?r("c:valAx",{},t("c:axId",y),L(o),t("c:delete",o.visible===!1),t("c:axPos","b"),M(o),$(o.title,u),r("c:numFmt",{formatCode:o.number_format??"General",sourceLinked:o.number_format===void 0?1:0}),t("c:majorTickMark","none"),t("c:minorTickMark","none"),t("c:tickLblPos","nextTo"),O(o),t("c:crossAx",x),t("c:crosses","autoZero"),t("c:crossBetween","midCat"),o.major_unit===void 0?"":t("c:majorUnit",o.major_unit)):r("c:catAx",{},t("c:axId",y),L(o),t("c:delete",o.visible===!1),t("c:axPos",c?"l":"b"),M(o),$(o.title,u),r("c:numFmt",{formatCode:"General",sourceLinked:0}),t("c:majorTickMark","none"),t("c:minorTickMark","none"),t("c:tickLblPos","nextTo"),O(o),t("c:crossAx",x),t("c:crosses","autoZero"),t("c:auto",!0),t("c:lblAlgn","ctr"),t("c:lblOffset",100),t("c:noMultiLvlLbl",!1)))+r("c:valAx",{},t("c:axId",x),L(a),t("c:delete",a.visible===!1),t("c:axPos",c?"b":"l"),M(a),$(a.title,u),r("c:numFmt",{formatCode:i,sourceLinked:a.number_format===void 0&&!s?1:0}),t("c:majorTickMark","none"),t("c:minorTickMark","none"),t("c:tickLblPos","nextTo"),r("c:spPr",{},m(null)),t("c:crossAx",y),t("c:crosses","autoZero"),t("c:crossBetween",R(e.type)||n?"midCat":"between"),a.major_unit===void 0?"":t("c:majorUnit",a.major_unit))}const re={bottom:"b",top:"t",left:"l",right:"r"};function oe(e,n){const c=n.width,o=n.height,{plot:a}=D(e,c,o),s=i=>Number(i.toFixed(5));return r("c:layout",{},r("c:manualLayout",{},t("c:layoutTarget","inner"),t("c:xMode","edge"),t("c:yMode","edge"),t("c:x",s(a.x/c)),t("c:y",s(a.y/o)),t("c:w",s(a.width/c)),t("c:h",s(a.height/o))))}const G=r("c:spPr",{},r("a:noFill"),r("a:ln",{},r("a:noFill")));export function chartSpaceXml(e,n){const c=e.title!==void 0&&e.title!==""?e.title:void 0,o=e.font_size??d.fontSize,a=Math.round((e.title_size??o*d.titleScale)*100);return Z+r("c:chartSpace",{"xmlns:c":B,"xmlns:a":W,"xmlns:r":H},t("c:date1904",!1),t("c:roundedCorners",!1),r("c:chart",{},c===void 0?"":r("c:title",{},r("c:tx",{},n.titleRef===void 0?I(c,a):r("c:strRef",{},`<c:f>${l(n.titleRef)}</c:f>`,S([c]))),t("c:overlay",!1)),t("c:autoTitleDeleted",c===void 0),r("c:plotArea",{},n.frame?oe(e,n.frame):r("c:layout"),te(e,n.refs),ne(e),n.frameless===!0?G:""),e.legend===void 0?"":r("c:legend",{},t("c:legendPos",re[e.legend]),t("c:overlay",e.legend_overlay===!0)),t("c:plotVisOnly",n.plotVisible??!0),t("c:dispBlanksAs","gap")),n.frameless===!0?G:"",F(o,e.font_color??"dk1"),n.tail??"")}
2
+ import{lumOf as V}from"@allyhub/ooxml/brightness";import{accentOf as I,CHART_DEFAULTS as m,chartDrawing as B,groupingOf as A,groupsOf as R,hasLines as W,hasMarkers as Z,isArea as O,isBar as L,isHorizontal as G,isLine as S,isRound as g,isScatter as w,labelPositionOf as H,variesOf as M}from"./chart.js";const Y="http://schemas.openxmlformats.org/drawingml/2006/chart",q="http://schemas.openxmlformats.org/drawingml/2006/main",K="http://schemas.openxmlformats.org/officeDocument/2006/relationships",J=`<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
3
+ `,b="2118791784",y="2140495176",j="2118791785",T="2140495177",Q={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;"},ee=e=>{const n=e.charCodeAt(0);return n<32&&n!==9&&n!==10&&n!==13||n===65534||n===65535},d=e=>Array.from(e,n=>ee(n)?"":Q[n]??n).join("");function r(e,n={},...c){const a=Object.entries(n).filter(([,s])=>s!==void 0).map(([s,i])=>` ${s}="${d(typeof i=="boolean"?i?"1":"0":String(i))}"`).join(""),o=c.join("");return o===""?`<${e}${a}/>`:`<${e}${a}>${o}</${e}>`}const te=e=>{if(typeof e=="string")return r("a:schemeClr",{val:e});if("rgb"in e)return r("a:srgbClr",{val:e.rgb.replace("#","").toUpperCase()});const{lumMod:n,lumOff:c}=V(e.brightness);return r("a:schemeClr",{val:e.theme_color},t("a:lumMod",n),...c===void 0?[]:[t("a:lumOff",c)])},h=e=>e===null?r("a:noFill"):r("a:solidFill",{},te(e)),t=(e,n)=>r(e,{val:typeof n=="boolean"?n?1:0:n}),f=(e,n)=>r("a:ln",n===void 0?{}:{w:Math.round(n*12700)},h(e)),X=(e,n)=>r("c:txPr",{},r("a:bodyPr"),r("a:lstStyle"),r("a:p",{},r("a:pPr",{},r("a:defRPr",e===void 0?{}:{sz:Math.round(e*100)},n===void 0?"":h(n))),r("a:endParaRPr",{lang:"en-US"}))),$=e=>r("c:strCache",{},t("c:ptCount",e.length),...e.map((n,c)=>r("c:pt",{idx:c},`<c:v>${d(n)}</c:v>`))),F=(e,n)=>r("c:numCache",{},`<c:formatCode>${d(e??"General")}</c:formatCode>`,t("c:ptCount",n.length),...n.flatMap((c,a)=>c===null?[]:[r("c:pt",{idx:a},`<c:v>${String(c)}</c:v>`)])),ne=(e,n)=>r("c:tx",{},n===void 0?`<c:v>${d(e.name)}</c:v>`:r("c:strRef",{},`<c:f>${d(n)}</c:f>`,$([e.name]))),re=(e,n)=>n===void 0?"":r("c:xVal",{},r("c:numRef",{},`<c:f>${d(n)}</c:f>`,F("General",e.x??[])));function oe(e,n,c,a){const o=n.color??I(c),s=g(e.type),i=w(e.type),l=S(e.type)||i,u=Z(e.type),z=l?r("c:spPr",{},W(e.type)?f(o,n.line_width??m.lineWidth):r("a:ln",{w:19050},h(null))):r("c:spPr",{},h(o),s?f("lt1",1):""),v=a.categories;return r("c:ser",{},t("c:idx",c),t("c:order",c),ne(n,a.name(c)),z,L(e.type)?t("c:invertIfNegative",!1):"",l?r("c:marker",{},t("c:symbol",u?"circle":"none"),u?t("c:size",n.marker_size??m.marker):"",u?r("c:spPr",{},h(o),f(o)):""):"",...M(e)&&!l&&!O(e.type)?e.categories.map((P,p)=>r("c:dPt",{},t("c:idx",p),L(e.type)?t("c:invertIfNegative",!1):"",t("c:bubble3D",!1),r("c:spPr",{},h(e.category_colors?.[p]??I(p)),s?f("lt1",1):""))):[],i?re(n,a.x?.(c)):v===void 0?"":r("c:cat",{},a.numeric===!0?r("c:numRef",{},`<c:f>${d(v)}</c:f>`,F(a.categoryFormat??"General",a.categoryNumbers??e.categories.map(P=>{const p=Number(P);return P===""||!Number.isFinite(p)?null:p}))):r("c:strRef",{},`<c:f>${d(v)}</c:f>`,$(e.categories))),r(i?"c:yVal":"c:val",{},r("c:numRef",{},`<c:f>${d(a.values(c))}</c:f>`,F(n.number_format,n.values))),l?t("c:smooth",n.smooth===!0||e.type==="scatter-smooth"):"")}function _(e){const n=e.labels;if(!n)return"";const c=n.show_percentage===!0,a=H(e);return r("c:dLbls",{},n.number_format===void 0?"":r("c:numFmt",{formatCode:n.number_format,sourceLinked:0}),n.size===void 0&&n.color===void 0&&!g(e.type)?"":X(n.size,n.color??(g(e.type)?"lt1":void 0)),a===void 0?"":t("c:dLblPos",a),t("c:showLegendKey",!1),t("c:showVal",n.show_value??!c),t("c:showCatName",n.show_category_name===!0),t("c:showSerName",n.show_series_name===!0),t("c:showPercent",c),t("c:showBubbleSize",!1))}function ce(e,n){const c=R(e),[a]=c;return c.length<=1&&a?.secondary!==!0?E(e,e.series.map((o,s)=>s),n,!1):c.map(o=>E({...e,type:o.kind},o.series,n,o.secondary)).join("")}function E(e,n,c,a){const o=n.map(l=>{const u=e.series[l];return u?oe(e,u,l,c):""}).join(""),s=A(e.type),i=a?t("c:axId",j)+t("c:axId",T):t("c:axId",b)+t("c:axId",y);if(g(e.type)){const l=e.type==="pie";return r(l?"c:pieChart":"c:doughnutChart",{},t("c:varyColors",M(e)),o,_(e),t("c:firstSliceAng",0),l?"":t("c:holeSize",e.hole_size??50))}if(w(e.type))return r("c:scatterChart",{},t("c:scatterStyle","lineMarker"),t("c:varyColors",!1),o,_(e),i);if(L(e.type)){const l=s!=="clustered";return r("c:barChart",{},t("c:barDir",G(e.type)?"bar":"col"),t("c:grouping",s),t("c:varyColors",M(e)),o,_(e),t("c:gapWidth",e.gap_width??150),e.overlap!==void 0||l?t("c:overlap",e.overlap??100):"",i)}return r(S(e.type)?"c:lineChart":"c:areaChart",{},t("c:grouping",s),t("c:varyColors",!1),o,_(e),S(e.type)?t("c:marker",!0):"",i)}const x=e=>r("c:scaling",{},t("c:orientation",e.reverse_order===!0?"maxMin":"minMax"),e.maximum_scale===void 0?"":t("c:max",e.maximum_scale),e.minimum_scale===void 0?"":t("c:min",e.minimum_scale)),N=e=>r("c:spPr",{},f(e.line_color??{rgb:m.axisLine},m.gridWidth)),k=e=>e.has_major_gridlines===!0?r("c:majorGridlines",{},r("c:spPr",{},f(e.gridline_color??{rgb:m.gridline},m.gridWidth))):"",U=(e,n)=>r("c:rich",{},r("a:bodyPr"),r("a:lstStyle"),r("a:p",{},r("a:pPr",{},r("a:defRPr",{sz:n,b:0})),r("a:r",{},r("a:rPr",{lang:"en-US",sz:n,b:0}),`<a:t>${d(e)}</a:t>`))),C=(e,n)=>e===void 0||e===""?"":r("c:title",{},r("c:tx",{},U(e,n)),t("c:overlay",!1));function ae(e,n){if(g(e.type))return"";const c=w(e.type),a=G(e.type),o=e.category_axis??{},s={has_major_gridlines:!0,...e.value_axis},i=A(e.type)==="percentStacked",l=s.number_format??(i?"0%":e.series[0]?.number_format??"General"),u=Math.round((e.font_size??m.fontSize)*100);return(c?r("c:valAx",{},t("c:axId",b),x(o),t("c:delete",o.visible===!1),t("c:axPos","b"),k(o),C(o.title,u),r("c:numFmt",{formatCode:o.number_format??"General",sourceLinked:o.number_format===void 0?1:0}),t("c:majorTickMark","none"),t("c:minorTickMark","none"),t("c:tickLblPos","nextTo"),N(o),t("c:crossAx",y),t("c:crosses","autoZero"),t("c:crossBetween","midCat"),o.major_unit===void 0?"":t("c:majorUnit",o.major_unit)):r("c:catAx",{},t("c:axId",b),x(o),t("c:delete",o.visible===!1),t("c:axPos",a?"l":"b"),k(o),C(o.title,u),n?.numeric===!0?r("c:numFmt",{formatCode:o.number_format??n.categoryFormat??"General",sourceLinked:o.number_format===void 0?1:0}):r("c:numFmt",{formatCode:"General",sourceLinked:0}),t("c:majorTickMark","none"),t("c:minorTickMark","none"),t("c:tickLblPos","nextTo"),N(o),t("c:crossAx",y),t("c:crosses","autoZero"),t("c:auto",!0),t("c:lblAlgn","ctr"),t("c:lblOffset",100),t("c:noMultiLvlLbl",!1)))+r("c:valAx",{},t("c:axId",y),x(s),t("c:delete",s.visible===!1),t("c:axPos",a?"b":"l"),k(s),C(s.title,u),r("c:numFmt",{formatCode:l,sourceLinked:s.number_format===void 0&&!i?1:0}),t("c:majorTickMark","none"),t("c:minorTickMark","none"),t("c:tickLblPos","nextTo"),r("c:spPr",{},f(null)),t("c:crossAx",b),t("c:crosses","autoZero"),t("c:crossBetween",O(e.type)||c?"midCat":"between"),s.major_unit===void 0?"":t("c:majorUnit",s.major_unit))+se(e,u)}function se(e,n){const c=R(e).find(i=>i.secondary);if(!c)return"";const a=e.secondary_axis??{},o=A(c.kind)==="percentStacked",s=a.number_format??(o?"0%":e.series[c.series[0]??0]?.number_format??"General");return r("c:catAx",{},t("c:axId",j),x({}),t("c:delete",!0),t("c:axPos","b"),r("c:numFmt",{formatCode:"General",sourceLinked:1}),t("c:majorTickMark","out"),t("c:minorTickMark","none"),t("c:tickLblPos","nextTo"),t("c:crossAx",T),t("c:crosses","autoZero"),t("c:auto",!0),t("c:lblAlgn","ctr"),t("c:lblOffset",100),t("c:noMultiLvlLbl",!1))+r("c:valAx",{},t("c:axId",T),x(a),t("c:delete",a.visible===!1),t("c:axPos","r"),k(a),C(a.title,n),r("c:numFmt",{formatCode:s,sourceLinked:a.number_format===void 0&&!o?1:0}),t("c:majorTickMark","none"),t("c:minorTickMark","none"),t("c:tickLblPos","nextTo"),r("c:spPr",{},f(null)),t("c:crossAx",j),t("c:crosses","max"),t("c:crossBetween","between"),a.major_unit===void 0?"":t("c:majorUnit",a.major_unit))}const ie={bottom:"b",top:"t",left:"l",right:"r"};function le(e,n){const c=n.width,a=n.height,{plot:o}=B(e,c,a),s=i=>Number(i.toFixed(5));return r("c:layout",{},r("c:manualLayout",{},t("c:layoutTarget","inner"),t("c:xMode","edge"),t("c:yMode","edge"),t("c:x",s(o.x/c)),t("c:y",s(o.y/a)),t("c:w",s(o.width/c)),t("c:h",s(o.height/a))))}const D=r("c:spPr",{},r("a:noFill"),r("a:ln",{},r("a:noFill")));export function chartSpaceXml(e,n){const c=e.title!==void 0&&e.title!==""?e.title:void 0,a=e.font_size??m.fontSize,o=Math.round((e.title_size??a*m.titleScale)*100);return J+r("c:chartSpace",{"xmlns:c":Y,"xmlns:a":q,"xmlns:r":K},t("c:date1904",!1),t("c:roundedCorners",!1),r("c:chart",{},c===void 0?"":r("c:title",{},r("c:tx",{},n.titleRef===void 0?U(c,o):r("c:strRef",{},`<c:f>${d(n.titleRef)}</c:f>`,$([c]))),t("c:overlay",!1)),t("c:autoTitleDeleted",c===void 0),r("c:plotArea",{},n.frame?le(e,n.frame):r("c:layout"),ce(e,n.refs),ae(e,n.refs),n.frameless===!0?D:""),e.legend===void 0?"":r("c:legend",{},t("c:legendPos",ie[e.legend]),t("c:overlay",e.legend_overlay===!0)),t("c:plotVisOnly",n.plotVisible??!0),t("c:dispBlanksAs","gap")),n.frameless===!0?D:"",X(a,e.font_color??"dk1"),n.tail??"")}
@@ -30,6 +30,10 @@ export interface ChartSeriesDef {
30
30
  line_width?: number;
31
31
  /** A marker's size in points. */
32
32
  marker_size?: number;
33
+ /** What it is drawn as when not the chart's kind: a combination chart's column, line or area. */
34
+ type?: ChartKind;
35
+ /** On a second value axis, at the right. */
36
+ secondary?: boolean;
33
37
  }
34
38
  export interface ChartAxisDef {
35
39
  minimum_scale?: number;
@@ -83,6 +87,8 @@ export interface ChartDef {
83
87
  hole_size?: number;
84
88
  value_axis?: ChartAxisDef;
85
89
  category_axis?: ChartAxisDef;
90
+ /** A combination chart's second value axis, at the right, for its series that say `secondary`. */
91
+ secondary_axis?: ChartAxisDef;
86
92
  /** Its text's size in points. */
87
93
  font_size?: number;
88
94
  /** Its title's size in points. */
@@ -130,6 +136,22 @@ export declare const groupingOf: (t: ChartKind) => "clustered" | "stacked" | "pe
130
136
  export declare function labelPositionsOf(t: ChartKind): readonly ChartLabelPosition[];
131
137
  /** Where a chart's labels are: where it says if its kind can, else where this one draws them. */
132
138
  export declare function labelPositionOf(c: Pick<ChartDef, "type" | "labels">): ChartLabelPosition | undefined;
139
+ /** The kinds a combination chart's series may be drawn as: columns, lines and areas, as Excel combines them. */
140
+ export declare const isCombinable: (t: ChartKind) => boolean;
141
+ /** Series drawn alike: of one kind, on one value axis. */
142
+ export interface ChartGroup {
143
+ kind: ChartKind;
144
+ secondary: boolean;
145
+ /** Its series, by their place in the chart. */
146
+ series: number[];
147
+ }
148
+ /**
149
+ * A chart's series by how they are drawn, as Excel draws a combination
150
+ * chart's: areas, then columns, then lines, those on the second axis after
151
+ * the first's. A chart of one kind on one axis is one group; a series' own
152
+ * kind counts only where both it and the chart's are columns, lines or areas.
153
+ */
154
+ export declare function groupsOf(c: Pick<ChartDef, "type" | "series">): ChartGroup[];
133
155
  /** Whether each category has its own colour. */
134
156
  export declare const variesOf: (c: Pick<ChartDef, "type" | "vary_by_categories">) => boolean;
135
157
  /** A number as an Excel format shows it. */
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{format as Ct,isValidFormat as Lt}from"numfmt";import{brightened as jt}from"@allyhub/ooxml/brightness";export const themeColor=(t,s=0)=>s===0?t:{theme_color:t,brightness:s},themeColorOf=t=>typeof t=="string"?t:"theme_color"in t?t.theme_color:void 0;export function colorRgb(t,s){return typeof t=="string"?s[t]:"rgb"in t?t.rgb:jt(s[t.theme_color],t.brightness)}export const CHART_DEFAULTS={fontSize:12,titleScale:1.2,gapWidth:150,holeSize:50,margin:6,gridline:"#D9D9D9",axisLine:"#BFBFBF",letter:.55,lineWidth:2.25,gridWidth:.75,marker:5};const vt=["accent1","accent2","accent3","accent4","accent5","accent6"];export const accentOf=t=>vt[t%vt.length]??"accent1",isBar=t=>t.startsWith("column")||t.startsWith("bar"),isHorizontal=t=>t.startsWith("bar"),isLine=t=>t.startsWith("line"),isArea=t=>t.startsWith("area"),isRound=t=>t==="pie"||t==="doughnut",isScatter=t=>t.startsWith("scatter"),hasLines=t=>!isScatter(t)||t!=="scatter",hasMarkers=t=>t==="line-markers"||t==="scatter"||t==="scatter-lines",groupingOf=t=>t.endsWith("-100")?"percentStacked":t.endsWith("-stacked")?"stacked":isBar(t)?"clustered":"standard";export function labelPositionsOf(t){return isArea(t)||t==="doughnut"?[]:t==="pie"?["bestFit","outEnd","inEnd","ctr"]:isLine(t)||isScatter(t)?["t","b","l","r","ctr"]:groupingOf(t)==="clustered"?["outEnd","inEnd","ctr","inBase"]:["inEnd","ctr","inBase"]}export function labelPositionOf(t){const s=labelPositionsOf(t.type),l=t.labels?.position;if(l!==void 0&&s.includes(l))return l;if(s.length!==0)return t.type==="pie"?"ctr":isLine(t.type)||isScatter(t.type)?"t":groupingOf(t.type)==="clustered"?"outEnd":"ctr"}export const variesOf=t=>t.vary_by_categories??isRound(t.type);export function formatValue(t,s="General"){return s==="General"||!Lt(s)?String(Number(t.toPrecision(10))):Ct(s,t)}const Ft=[1,2,5,10];export function chartScale(t,s,l,r,e={}){const h=t>0&&(s-t)/s<.16666666666666666?t:Math.min(t,0),a=s<=0&&t<0?0:s,o=e.minimum_scale??h,j=e.maximum_scale??a,b=j>o?j-o:1,F=Math.max(1,Math.floor(l/r)),w=b/F,P=10**Math.floor(Math.log10(w)),O=e.major_unit??(Ft.find(E=>E*P>=w)??10)*P,B=(E,C)=>Number((C(Number((E/O).toFixed(9)))*O).toPrecision(12)),Z=a>0?a+b*.05:a===h?b:a,g=e.maximum_scale??B(Z,Math.ceil),R=h<0?h-b*.05:h,W=e.minimum_scale??B(R,Math.floor),N=[],x=Math.round((g-W)/O);for(let E=0;E<=x;E++)N.push(Number((W+E*O).toPrecision(12)));return{min:W,max:g,major:O,ticks:N}}const it=(t,s)=>{let l=0;for(const r of t)l+=(r.codePointAt(0)??0)>11903?1:CHART_DEFAULTS.letter;return l*s},m=t=>String(Number(t.toFixed(3)));function kt(t){const s=l=>t[Math.max(0,Math.min(t.length-1,l))]??[0,0];return t.map(([l,r],e)=>{if(e===0)return`M${m(l)} ${m(r)}`;const[h,a]=s(e-2),[o,j]=s(e-1),[b,F]=s(e+1),w=`${m(o+(l-h)/6)} ${m(j+(r-a)/6)}`,P=`${m(l-(b-o)/6)} ${m(r-(F-j)/6)}`;return`C${w} ${P} ${m(l)} ${m(r)}`}).join(" ")}const lt=t=>t.map(([s,l],r)=>`${r===0?"M":"L"}${m(s)} ${m(l)}`).join(" ");function Ot(t,s,l,r,e,h){const a=(F,w)=>`${m(t+F*Math.sin(w))} ${m(s-F*Math.cos(w))}`,o=h-e>=Math.PI*2?e+Math.PI*2-1e-4:h,j=o-e>Math.PI?1:0,b=`M${a(l,e)} A${m(l)} ${m(l)} 0 ${String(j)} 1 ${a(l,o)}`;return r<=0?`${b} L${m(t)} ${m(s)} Z`:`${b} L${a(r,o)} A${m(r)} ${m(r)} 0 ${String(j)} 0 ${a(r,e)} Z`}function Wt(t,s,l,r){const e=r*1.5;return s!==void 0&&s!==""&&(t.bottom-=e),l!==void 0&&l!==""&&(t.left+=e),{x:t.left-e/2,y:t.bottom+e/2}}function Et(t,s,l,r,e,h,a){r!==void 0&&r!==""&&t.words.push({x:s.x+s.width/2,y:l.y,text:r,size:h,anchor:"middle",color:a}),e!==void 0&&e!==""&&t.words.push({x:l.x,y:s.y+s.height/2,text:e,size:h,anchor:"middle",color:a,rotate:-90})}const ht=(t,s,l,r,e)=>{const h=t.labels;if(!h)return"";const a=isRound(t.type),o=[];return h.show_series_name&&o.push(r.name),h.show_category_name&&o.push(e),(h.show_value??!(h.show_percentage??!1))&&o.push(formatValue(s,h.number_format??r.number_format)),h.show_percentage&&a&&o.push(formatValue(l,h.number_format??"0%")),o.join(", ")};function Bt(t,s,l,r,e){const h=CHART_DEFAULTS,a=t.category_axis??{},o=t.value_axis??{},j=Wt(l,a.title,o.title,r),b=t.series.map(c=>c.values.flatMap(($,H)=>{const I=c.x?.[H]??(c.x?null:H+1);return I===null||$===null?[]:[[I,$]]})),F=b.flat().map(c=>c[0]),w=b.flat().map(c=>c[1]),P=c=>c.length>0?Math.min(...c):0,O=c=>c.length>0?Math.max(...c):1,B=o.number_format??t.series[0]?.number_format??"General",Z=a.number_format??"General",g=r*.5,R=chartScale(P(w),O(w),l.bottom-l.top,r*2.4,o),W=o.visible===!1?0:Math.max(0,...R.ticks.map(c=>it(formatValue(c,B),r)))+g,N=a.visible===!1?0:r*1.2+g,x={x:l.left+W,y:l.top,width:l.right-l.left-W,height:l.bottom-l.top-N};s.plot=x,Et(s,x,j,a.title,o.title,r,e);const E=chartScale(P(F),O(F),x.width,r*5,a),C=chartScale(P(w),O(w),x.height,r*2.4,o),z=c=>x.x+(Math.min(E.max,Math.max(E.min,c))-E.min)/(E.max-E.min)*x.width,D=c=>x.y+x.height-(Math.min(C.max,Math.max(C.min,c))-C.min)/(C.max-C.min)*x.height;for(const c of C.ticks){const $=D(c);(o.has_major_gridlines??!0)&&s.grid.push({d:`M${m(x.x)} ${m($)} H${m(x.x+x.width)}`,color:o.gridline_color??{rgb:h.gridline},width:h.gridWidth}),o.visible!==!1&&s.words.push({x:x.x-g,y:$,text:formatValue(c,B),size:r,anchor:"end",color:e})}for(const c of E.ticks){const $=z(c);a.has_major_gridlines===!0&&s.grid.push({d:`M${m($)} ${m(x.y)} V${m(x.y+x.height)}`,color:a.gridline_color??{rgb:h.gridline},width:h.gridWidth}),a.visible!==!1&&s.words.push({x:$,y:x.y+x.height+g+r*.6,text:formatValue(c,Z),size:r,anchor:"middle",color:e})}s.axes.push({d:`M${m(x.x)} ${m(D(Math.max(C.min,Math.min(C.max,0))))} H${m(x.x+x.width)}`,color:a.line_color??{rgb:h.axisLine},width:h.gridWidth}),t.series.forEach((c,$)=>{const H=c.color??accentOf($),I=(b[$]??[]).map(([U,Y])=>[z(U),D(Y)]);if(I.length!==0&&(hasLines(t.type)&&s.lines.push({d:t.type==="scatter-smooth"||c.smooth===!0?kt(I):lt(I),color:H,width:c.line_width??h.lineWidth,series:$}),hasMarkers(t.type)))for(const[U,Y]of I)s.dots.push({x:U,y:Y,r:(c.marker_size??h.marker)/2,color:H})})}export function chartDrawing(t,s,l){const r=CHART_DEFAULTS,e=t.font_size??r.fontSize,h=t.font_color??"dk1",a={grid:[],shapes:[],boxes:[],lines:[],axes:[],dots:[],keys:[],words:[],plot:{x:0,y:0,width:0,height:0}},o={left:r.margin,top:r.margin,right:s-r.margin,bottom:l-r.margin};if(t.title!==void 0&&t.title!==""){const n=t.title_size??e*r.titleScale;a.words.push({x:s/2,y:o.top+n*.7,text:t.title,size:n,anchor:"middle",color:h}),o.top+=n*1.6}const j=isRound(t.type),b=variesOf(t),F=(n,d)=>b?t.category_colors?.[d]??accentOf(d):t.series[n]?.color??accentOf(n);if(t.legend!==void 0){const n=b?t.categories:t.series.map(p=>p.name),d=e*.6,f=e*.4,i=e*1.5,y=n.map(p=>d+f+it(p,e)),S=(p,M,_)=>{a.keys.push({x:M,y:_-d/2,width:d,height:d,color:b?t.category_colors?.[p]??accentOf(p):t.series[p]?.color??accentOf(p),series:b?0:p,category:b?p:0}),a.words.push({x:M+d+f,y:_,text:n[p]??"",size:e,anchor:"start",color:h})};if(t.legend==="top"||t.legend==="bottom"){const p=y.reduce((A,v)=>A+v,0)+e*(n.length-1),M=t.legend==="top"?o.top+i/2:o.bottom-i/2;let _=(s-p)/2;n.forEach((A,v)=>{S(v,_,M),_+=(y[v]??0)+e}),t.legend_overlay!==!0&&(t.legend==="top"?o.top+=i:o.bottom-=i)}else{const p=Math.max(0,...y),M=t.legend==="left"?o.left:o.right-p,_=(o.top+o.bottom-i*n.length)/2+i/2;n.forEach((A,v)=>{S(v,M,_+v*i)}),t.legend_overlay!==!0&&(t.legend==="left"?o.left+=p+e:o.right-=p+e)}}const w=t.labels,P=w?.size??e,O=w?.color??h,B=(n,d,f,i,y=O)=>{f!==""&&a.words.push({x:n,y:d,text:f,size:P,anchor:i,color:y})};if(j){const n=t.series[0],d=(n?.values??[]).map(_=>Math.max(0,_??0)),f=d.reduce((_,A)=>_+A,0),i=Math.max(0,Math.min(o.right-o.left,o.bottom-o.top)/2),y=(o.left+o.right)/2,S=(o.top+o.bottom)/2,p=t.type==="doughnut"?i*((t.hole_size??r.holeSize)/100):0;a.plot={x:y-i,y:S-i,width:i*2,height:i*2};let M=0;return d.forEach((_,A)=>{const v=f>0?_/f:0,V=M+v*Math.PI*2;if(v>0){a.shapes.push({d:Ot(y,S,i,p,M,V),color:"lt1",width:1,fill:F(0,A),series:0,category:A});const L=(M+V)/2,k=p>0?(i+p)/2:labelPositionOf(t)==="inEnd"?i*.85:i*.6;n&&B(y+k*Math.sin(L),S-k*Math.cos(L),ht(t,_,v,n,t.categories[A]??""),"middle",w?.color??"lt1")}M=V}),a}if(isScatter(t.type))return Bt(t,a,o,e,h),a;const Z=Math.max(1,t.categories.length),g=isHorizontal(t.type),R=groupingOf(t.type),W=R!=="clustered"&&R!=="standard",N=R==="percentStacked",x=t.series.map(n=>t.categories.map((d,f)=>n.values[f]??null)),E=t.categories.map((n,d)=>x.reduce((f,i)=>f+Math.abs(i[d]??0),0)),C=(n,d)=>{const f=x[n]?.[d];if(f==null)return null;const i=E[d]??0;return N?i>0?f/i:0:f};let z=0,D=0;if(t.categories.forEach((n,d)=>{let f=0,i=0;t.series.forEach((y,S)=>{const p=C(S,d)??0;W?p>=0?f+=p:i+=p:(f=Math.max(f,p),i=Math.min(i,p))}),D=Math.max(D,f),z=Math.min(z,i)}),!W){const n=x.flat().filter(d=>d!==null);n.length>0&&Math.min(...n)>0&&(z=Math.min(...n))}N&&(D=1,z=Math.min(z,0));const c=t.value_axis??{},$=t.category_axis??{},H=c.number_format??(N?"0%":t.series[0]?.number_format??"General"),I=g?o.right-o.left:o.bottom-o.top,U=g?e*5:e*2.4,Y=chartScale(z,D,I,U,{...c,...N?{maximum_scale:c.maximum_scale??1}:{}}),dt=c.visible===!1?[]:Y.ticks.map(n=>formatValue(n,H)),mt=Math.max(0,...dt.map(n=>it(n,e))),ot=$.visible!==!1,ft=ot?Math.max(0,...t.categories.map(n=>it(n,e))):0,T=e*.5,ut=g?c.title:$.title,pt=g?$.title:c.title,St=Wt(o,ut,pt,e),u=g?{x:o.left+(ot?ft+T:0),y:o.top,width:0,height:o.bottom-o.top-(c.visible===!1?0:e*1.2+T)}:{x:o.left+(c.visible===!1?0:mt+T),y:o.top,width:0,height:o.bottom-o.top-(ot?e*1.2+T:0)};u.width=o.right-u.x-(g&&dt.length>0?mt/2:0),a.plot=u,Et(a,u,St,ut,pt,e,h);const G=chartScale(z,D,g?u.width:u.height,U,{...c,...N?{maximum_scale:c.maximum_scale??1}:{}}),gt=n=>(Math.min(G.max,Math.max(G.min,n))-G.min)/(G.max-G.min)*(g?u.width:u.height),q=n=>g?u.x+gt(n):u.y+u.height-gt(n),xt=isArea(t.type),yt=$.reverse_order===!0,Mt=g?!yt:yt,at=(g?u.height:u.width)/Z,_t=xt?(g?u.height:u.width)/Math.max(1,Z-1):at,ct=n=>{const d=xt?n*_t:(n+.5)*at,f=g?u.height:u.width,i=Mt?f-d:d;return(g?u.y:u.x)+i},bt=q(Math.max(G.min,Math.min(G.max,0)));for(const n of G.ticks){const d=q(n);(c.has_major_gridlines??!0)&&a.grid.push({d:g?`M${m(d)} ${m(u.y)} V${m(u.y+u.height)}`:`M${m(u.x)} ${m(d)} H${m(u.x+u.width)}`,color:c.gridline_color??{rgb:r.gridline},width:r.gridWidth}),c.visible!==!1&&a.words.push(g?{x:d,y:u.y+u.height+T+e*.6,text:formatValue(n,H),size:e,anchor:"middle",color:h}:{x:u.x-T,y:d,text:formatValue(n,H),size:e,anchor:"end",color:h})}if(a.axes.push({d:g?`M${m(bt)} ${m(u.y)} V${m(u.y+u.height)}`:`M${m(u.x)} ${m(bt)} H${m(u.x+u.width)}`,color:$.line_color??{rgb:r.axisLine},width:r.gridWidth}),ot){const n=g?e*1.3:ft+e,d=Math.max(1,Math.ceil(n/Math.max(1,_t)));t.categories.forEach((f,i)=>{if(i%d!==0)return;const y=ct(i);a.words.push(g?{x:u.x-T,y,text:f,size:e,anchor:"end",color:h}:{x:y,y:u.y+u.height+T+e*.6,text:f,size:e,anchor:"middle",color:h})})}if(isBar(t.type)){const n=(t.gap_width??r.gapWidth)/100,d=W?1:t.series.length,f=W?1:(t.overlap??0)/100,i=at/(Math.max(1,d-(d-1)*f)+n),y=i*(1-f),S=i+y*(d-1);t.categories.forEach((p,M)=>{const _=ct(M);let A=0,v=0;t.series.forEach((V,L)=>{const k=C(L,M);if(k===null)return;const nt=W?k>=0?A:v:0,tt=nt+k;W&&(k>=0?A=tt:v=tt);const J=q(nt),K=q(tt),st=(W?_-i/2:_-S/2+L*y)+(g&&Mt&&!W?S-i-2*L*y:0),Pt=g?{x:Math.min(J,K),y:st,width:Math.abs(K-J),height:i}:{x:st,y:Math.min(J,K),width:i,height:Math.abs(K-J)};if(a.boxes.push({...Pt,color:F(L,M),series:L,category:M}),!w)return;const wt=ht(t,x[L]?.[M]??0,0,V,t.categories[M]??""),rt=labelPositionOf(t),Q=P*.8,At=k>=0?1:-1,$t=(et,X)=>rt==="ctr"?(et+X)/2:rt==="inBase"?et+(X>et?Q:-Q):rt==="inEnd"?X-(X>et?Q:-Q):X+(X>=et?Q:-Q);g?B($t(J,K),st+i/2,wt,rt==="outEnd"?At>0?"start":"end":"middle"):B(st+i/2,$t(J,K),wt,"middle")})})}else{const n=t.categories.map(()=>0),d=t.series.map((f,i)=>{const y=[],S=[];return t.categories.forEach((p,M)=>{const _=C(i,M);if(_===null)return;const A=W?n[M]??0:0,v=A+_;W&&(n[M]=v);const V=ct(M),L=k=>g?[q(k),V]:[V,q(k)];if(y.push(L(v)),S.push(L(A)),isLine(t.type)&&w){const k=labelPositionOf(t),[nt,tt]=L(v);B(nt+(k==="r"?P:k==="l"?-P:0),tt+(k==="t"?-P:k==="b"?P:0),ht(t,x[i]?.[M]??0,0,f,t.categories[M]??""),k==="r"?"start":k==="l"?"end":"middle")}}),{series:f,s:i,points:y,base:S}});for(const{series:f,s:i,points:y,base:S}of d){const p=f.color??accentOf(i);if(isArea(t.type)&&y.length>0)a.shapes.push({d:`${lt([...y,...[...S].reverse()])} Z`,color:p,width:0,fill:p,series:i});else if(y.length>0&&(a.lines.push({d:f.smooth===!0?kt(y):lt(y),color:p,width:f.line_width??r.lineWidth,series:i}),hasMarkers(t.type)))for(const[M,_]of y)a.dots.push({x:M,y:_,r:(f.marker_size??r.marker)/2,color:p})}a.shapes.reverse()}return a}
2
+ import{format as Vt,isValidFormat as Rt}from"numfmt";import{brightened as Zt}from"@allyhub/ooxml/brightness";export const themeColor=(t,s=0)=>s===0?t:{theme_color:t,brightness:s},themeColorOf=t=>typeof t=="string"?t:"theme_color"in t?t.theme_color:void 0;export function colorRgb(t,s){return typeof t=="string"?s[t]:"rgb"in t?t.rgb:Zt(s[t.theme_color],t.brightness)}export const CHART_DEFAULTS={fontSize:12,titleScale:1.2,gapWidth:150,holeSize:50,margin:6,gridline:"#D9D9D9",axisLine:"#BFBFBF",letter:.55,lineWidth:2.25,gridWidth:.75,marker:5};const Ft=["accent1","accent2","accent3","accent4","accent5","accent6"];export const accentOf=t=>Ft[t%Ft.length]??"accent1",isBar=t=>t.startsWith("column")||t.startsWith("bar"),isHorizontal=t=>t.startsWith("bar"),isLine=t=>t.startsWith("line"),isArea=t=>t.startsWith("area"),isRound=t=>t==="pie"||t==="doughnut",isScatter=t=>t.startsWith("scatter"),hasLines=t=>!isScatter(t)||t!=="scatter",hasMarkers=t=>t==="line-markers"||t==="scatter"||t==="scatter-lines",groupingOf=t=>t.endsWith("-100")?"percentStacked":t.endsWith("-stacked")?"stacked":isBar(t)?"clustered":"standard";export function labelPositionsOf(t){return isArea(t)||t==="doughnut"?[]:t==="pie"?["bestFit","outEnd","inEnd","ctr"]:isLine(t)||isScatter(t)?["t","b","l","r","ctr"]:groupingOf(t)==="clustered"?["outEnd","inEnd","ctr","inBase"]:["inEnd","ctr","inBase"]}export function labelPositionOf(t){const s=labelPositionsOf(t.type),h=t.labels?.position;if(h!==void 0&&s.includes(h))return h;if(s.length!==0)return t.type==="pie"?"ctr":isLine(t.type)||isScatter(t.type)?"t":groupingOf(t.type)==="clustered"?"outEnd":"ctr"}export const isCombinable=t=>t.startsWith("column")||isLine(t)||isArea(t);export function groupsOf(t){const s=isCombinable(t.type),h=[];t.series.forEach((o,c)=>{const n=o.type!==void 0&&s&&isCombinable(o.type)?o.type??t.type:t.type,S=s&&o.secondary===!0,_=h.find(O=>O.kind===n&&O.secondary===S);_?_.series.push(c):h.push({kind:n,secondary:S,series:[c]})});const r=o=>(o.secondary?3:0)+(isArea(o.kind)?0:isBar(o.kind)?1:2);return h.sort((o,c)=>r(o)-r(c))}export const variesOf=t=>t.vary_by_categories??isRound(t.type);export function formatValue(t,s="General"){return s==="General"||!Rt(s)?String(Number(t.toPrecision(10))):Vt(s,t)}const Ut=[1,2,5,10];export function chartScale(t,s,h,r,o={}){const c=t>0&&(s-t)/s<.16666666666666666?t:Math.min(t,0),a=s<=0&&t<0?0:s,n=o.minimum_scale??c,S=o.maximum_scale??a,_=S>n?S-n:1,O=Math.max(1,Math.floor(h/r)),k=_/O,P=10**Math.floor(Math.log10(k)),N=o.major_unit??(Ut.find(v=>v*P>=k)??10)*P,z=(v,j)=>Number((j(Number((v/N).toFixed(9)))*N).toPrecision(12)),q=a>0?a+_*.05:a===c?_:a,x=o.maximum_scale??z(q,Math.ceil),Z=c<0?c-_*.05:c,V=o.minimum_scale??z(Z,Math.floor),D=[],y=Math.round((x-V)/N);for(let v=0;v<=y;v++)D.push(Number((V+v*N).toPrecision(12)));return{min:V,max:x,major:N,ticks:D}}const it=(t,s)=>{let h=0;for(const r of t)h+=(r.codePointAt(0)??0)>11903?1:CHART_DEFAULTS.letter;return h*s},m=t=>String(Number(t.toFixed(3)));function jt(t){const s=h=>t[Math.max(0,Math.min(t.length-1,h))]??[0,0];return t.map(([h,r],o)=>{if(o===0)return`M${m(h)} ${m(r)}`;const[c,a]=s(o-2),[n,S]=s(o-1),[_,O]=s(o+1),k=`${m(n+(h-c)/6)} ${m(S+(r-a)/6)}`,P=`${m(h-(_-n)/6)} ${m(r-(O-S)/6)}`;return`C${k} ${P} ${m(h)} ${m(r)}`}).join(" ")}const gt=t=>t.map(([s,h],r)=>`${r===0?"M":"L"}${m(s)} ${m(h)}`).join(" ");function qt(t,s,h,r,o,c){const a=(O,k)=>`${m(t+O*Math.sin(k))} ${m(s-O*Math.cos(k))}`,n=c-o>=Math.PI*2?o+Math.PI*2-1e-4:c,S=n-o>Math.PI?1:0,_=`M${a(h,o)} A${m(h)} ${m(h)} 0 ${String(S)} 1 ${a(h,n)}`;return r<=0?`${_} L${m(t)} ${m(s)} Z`:`${_} L${a(r,n)} A${m(r)} ${m(r)} 0 ${String(S)} 0 ${a(r,o)} Z`}function Nt(t,s,h,r){const o=r*1.5;return s!==void 0&&s!==""&&(t.bottom-=o),h!==void 0&&h!==""&&(t.left+=o),{x:t.left-o/2,y:t.bottom+o/2}}function Bt(t,s,h,r,o,c,a){r!==void 0&&r!==""&&t.words.push({x:s.x+s.width/2,y:h.y,text:r,size:c,anchor:"middle",color:a}),o!==void 0&&o!==""&&t.words.push({x:h.x,y:s.y+s.height/2,text:o,size:c,anchor:"middle",color:a,rotate:-90})}const xt=(t,s,h,r,o)=>{const c=t.labels;if(!c)return"";const a=isRound(t.type),n=[];return c.show_series_name&&n.push(r.name),c.show_category_name&&n.push(o),(c.show_value??!(c.show_percentage??!1))&&n.push(formatValue(s,c.number_format??r.number_format)),c.show_percentage&&a&&n.push(formatValue(h,c.number_format??"0%")),n.join(", ")};function Jt(t,s,h,r,o){const c=CHART_DEFAULTS,a=t.category_axis??{},n=t.value_axis??{},S=Nt(h,a.title,n.title,r),_=t.series.map(f=>f.values.flatMap((W,B)=>{const I=f.x?.[B]??(f.x?null:B+1);return I===null||W===null?[]:[[I,W]]})),O=_.flat().map(f=>f[0]),k=_.flat().map(f=>f[1]),P=f=>f.length>0?Math.min(...f):0,N=f=>f.length>0?Math.max(...f):1,z=n.number_format??t.series[0]?.number_format??"General",q=a.number_format??"General",x=r*.5,Z=chartScale(P(k),N(k),h.bottom-h.top,r*2.4,n),V=n.visible===!1?0:Math.max(0,...Z.ticks.map(f=>it(formatValue(f,z),r)))+x,D=a.visible===!1?0:r*1.2+x,y={x:h.left+V,y:h.top,width:h.right-h.left-V,height:h.bottom-h.top-D};s.plot=y,Bt(s,y,S,a.title,n.title,r,o);const v=chartScale(P(O),N(O),y.width,r*5,a),j=chartScale(P(k),N(k),y.height,r*2.4,n),U=f=>y.x+(Math.min(v.max,Math.max(v.min,f))-v.min)/(v.max-v.min)*y.width,G=f=>y.y+y.height-(Math.min(j.max,Math.max(j.min,f))-j.min)/(j.max-j.min)*y.height;for(const f of j.ticks){const W=G(f);(n.has_major_gridlines??!0)&&s.grid.push({d:`M${m(y.x)} ${m(W)} H${m(y.x+y.width)}`,color:n.gridline_color??{rgb:c.gridline},width:c.gridWidth}),n.visible!==!1&&s.words.push({x:y.x-x,y:W,text:formatValue(f,z),size:r,anchor:"end",color:o})}for(const f of v.ticks){const W=U(f);a.has_major_gridlines===!0&&s.grid.push({d:`M${m(W)} ${m(y.y)} V${m(y.y+y.height)}`,color:a.gridline_color??{rgb:c.gridline},width:c.gridWidth}),a.visible!==!1&&s.words.push({x:W,y:y.y+y.height+x+r*.6,text:formatValue(f,q),size:r,anchor:"middle",color:o})}s.axes.push({d:`M${m(y.x)} ${m(G(Math.max(j.min,Math.min(j.max,0))))} H${m(y.x+y.width)}`,color:a.line_color??{rgb:c.axisLine},width:c.gridWidth}),t.series.forEach((f,W)=>{const B=f.color??accentOf(W),I=(_[W]??[]).map(([J,R])=>[U(J),G(R)]);if(I.length!==0&&(hasLines(t.type)&&s.lines.push({d:t.type==="scatter-smooth"||f.smooth===!0?jt(I):gt(I),color:B,width:f.line_width??c.lineWidth,series:W}),hasMarkers(t.type)))for(const[J,R]of I)s.dots.push({x:J,y:R,r:(f.marker_size??c.marker)/2,color:B})})}export function chartDrawing(t,s,h){const r=CHART_DEFAULTS,o=t.font_size??r.fontSize,c=t.font_color??"dk1",a={grid:[],shapes:[],boxes:[],lines:[],axes:[],dots:[],keys:[],words:[],plot:{x:0,y:0,width:0,height:0}},n={left:r.margin,top:r.margin,right:s-r.margin,bottom:h-r.margin};if(t.title!==void 0&&t.title!==""){const e=t.title_size??o*r.titleScale;a.words.push({x:s/2,y:n.top+e*.7,text:t.title,size:e,anchor:"middle",color:c}),n.top+=e*1.6}const S=isRound(t.type),_=variesOf(t),O=(e,i)=>_?t.category_colors?.[i]??accentOf(i):t.series[e]?.color??accentOf(e);if(t.legend!==void 0){const e=_?t.categories:t.series.map(d=>d.name),i=o*.6,g=o*.4,l=o*1.5,b=e.map(d=>i+g+it(d,o)),F=(d,w,u)=>{a.keys.push({x:w,y:u-i/2,width:i,height:i,color:_?t.category_colors?.[d]??accentOf(d):t.series[d]?.color??accentOf(d),series:_?0:d,category:_?d:0}),a.words.push({x:w+i+g,y:u,text:e[d]??"",size:o,anchor:"start",color:c})};if(t.legend==="top"||t.legend==="bottom"){const d=b.reduce((E,M)=>E+M,0)+o*(e.length-1),w=t.legend==="top"?n.top+l/2:n.bottom-l/2;let u=(s-d)/2;e.forEach((E,M)=>{F(M,u,w),u+=(b[M]??0)+o}),t.legend_overlay!==!0&&(t.legend==="top"?n.top+=l:n.bottom-=l)}else{const d=Math.max(0,...b),w=t.legend==="left"?n.left:n.right-d,u=(n.top+n.bottom-l*e.length)/2+l/2;e.forEach((E,M)=>{F(M,w,u+M*l)}),t.legend_overlay!==!0&&(t.legend==="left"?n.left+=d+o:n.right-=d+o)}}const k=t.labels,P=k?.size??o,N=k?.color??c,z=(e,i,g,l,b=N)=>{g!==""&&a.words.push({x:e,y:i,text:g,size:P,anchor:l,color:b})};if(S){const e=t.series[0],i=(e?.values??[]).map(u=>Math.max(0,u??0)),g=i.reduce((u,E)=>u+E,0),l=Math.max(0,Math.min(n.right-n.left,n.bottom-n.top)/2),b=(n.left+n.right)/2,F=(n.top+n.bottom)/2,d=t.type==="doughnut"?l*((t.hole_size??r.holeSize)/100):0;a.plot={x:b-l,y:F-l,width:l*2,height:l*2};let w=0;return i.forEach((u,E)=>{const M=g>0?u/g:0,$=w+M*Math.PI*2;if(M>0){a.shapes.push({d:qt(b,F,l,d,w,$),color:"lt1",width:1,fill:O(0,E),series:0,category:E});const A=(w+$)/2,T=d>0?(l+d)/2:labelPositionOf(t)==="inEnd"?l*.85:l*.6;e&&z(b+T*Math.sin(A),F-T*Math.cos(A),xt(t,u,M,e,t.categories[E]??""),"middle",k?.color??"lt1")}w=$}),a}if(isScatter(t.type))return Jt(t,a,n,o,c),a;const q=Math.max(1,t.categories.length),x=isHorizontal(t.type),Z=groupsOf(t),V=Z.every(e=>e.secondary)?Z.map(e=>({...e,secondary:!1})):Z,D=t.series.map(e=>t.categories.map((i,g)=>e.values[g]??null)),y=V.map(e=>{const i=groupingOf(e.kind),g=i!=="clustered"&&i!=="standard",l=i==="percentStacked",b=t.categories.map((F,d)=>e.series.reduce((w,u)=>w+Math.abs(D[u]?.[d]??0),0));return{...e,stacked:g,percent:l,totals:b}}),v=(e,i,g)=>{const l=D[i]?.[g];if(l==null)return null;const b=e.totals[g]??0;return e.percent?b>0?l/b:0:l},j=e=>{let i=0,g=0,l=1/0,b=!1;for(const u of y)if(u.secondary===e&&(b||=u.percent,t.categories.forEach((E,M)=>{let $=0,A=0;for(const T of u.series){const C=v(u,T,M)??0;u.stacked?C>=0?$+=C:A+=C:($=Math.max($,C),A=Math.min(A,C))}g=Math.max(g,$),i=Math.min(i,A)}),!u.stacked))for(const E of u.series)for(const M of D[E]??[])M!==null&&(l=Math.min(l,M));y.every(u=>u.secondary!==e||!u.stacked)&&Number.isFinite(l)&&l>0&&(i=l),b&&(g=1,i=Math.min(i,0));const d=y.find(u=>u.secondary===e),w=d===void 0?void 0:d.series[0];return{low:i,high:g,percent:b,format:w===void 0?void 0:t.series[w]?.number_format}},U=j(!1),G=y.some(e=>e.secondary)?j(!0):void 0,f=t.value_axis??{},W=t.secondary_axis??{},B=t.category_axis??{},I=f.number_format??(U.percent?"0%":U.format??"General"),J=W.number_format??(G?.percent===!0?"0%":G?.format??"General"),R=(e,i,g,l)=>chartScale(e.low,e.high,g,l,{...i,...e.percent?{maximum_scale:i.maximum_scale??1}:{}}),yt=x?n.right-n.left:n.bottom-n.top,at=x?o*5:o*2.4,It=R(U,f,yt,at),bt=f.visible===!1?[]:It.ticks.map(e=>formatValue(e,I)),Mt=Math.max(0,...bt.map(e=>it(e,o))),wt=G===void 0||W.visible===!1?0:Math.max(0,...R(G,W,yt,at).ticks.map(e=>it(formatValue(e,J),o))),ct=B.visible!==!1,_t=ct?Math.max(0,...t.categories.map(e=>it(e,o))):0,H=o*.5,$t=x?f.title:B.title,kt=x?B.title:f.title,zt=Nt(n,$t,kt,o),p=x?{x:n.left+(ct?_t+H:0),y:n.top,width:0,height:n.bottom-n.top-(f.visible===!1?0:o*1.2+H)}:{x:n.left+(f.visible===!1?0:Mt+H),y:n.top,width:0,height:n.bottom-n.top-(ct?o*1.2+H:0)};p.width=n.right-p.x-(x&&bt.length>0?Mt/2:0)-(wt>0?wt+H:0),a.plot=p,Bt(a,p,zt,$t,kt,o,c);const ft=x?p.width:p.height,et=R(U,f,ft,at),ot=G===void 0?void 0:R(G,W,ft,at),vt=(e,i)=>(Math.min(e.max,Math.max(e.min,i))-e.min)/(e.max-e.min)*ft,ut=(e,i)=>x?p.x+vt(e,i):p.y+p.height-vt(e,i),Wt=e=>ut(et,e),Et=y.every(e=>isArea(e.kind)),St=B.reverse_order===!0,Ot=x?!St:St,mt=(x?p.height:p.width)/q,Pt=Et?(x?p.height:p.width)/Math.max(1,q-1):mt,pt=e=>{const i=Et?e*Pt:(e+.5)*mt,g=x?p.height:p.width,l=Ot?g-i:i;return(x?p.y:p.x)+l},At=Wt(Math.max(et.min,Math.min(et.max,0)));for(const e of et.ticks){const i=Wt(e);(f.has_major_gridlines??!0)&&a.grid.push({d:x?`M${m(i)} ${m(p.y)} V${m(p.y+p.height)}`:`M${m(p.x)} ${m(i)} H${m(p.x+p.width)}`,color:f.gridline_color??{rgb:r.gridline},width:r.gridWidth}),f.visible!==!1&&a.words.push(x?{x:i,y:p.y+p.height+H+o*.6,text:formatValue(e,I),size:o,anchor:"middle",color:c}:{x:p.x-H,y:i,text:formatValue(e,I),size:o,anchor:"end",color:c})}if(ot&&W.visible!==!1)for(const e of ot.ticks)a.words.push({x:p.x+p.width+H,y:ut(ot,e),text:formatValue(e,J),size:o,anchor:"start",color:c});if(a.axes.push({d:x?`M${m(At)} ${m(p.y)} V${m(p.y+p.height)}`:`M${m(p.x)} ${m(At)} H${m(p.x+p.width)}`,color:B.line_color??{rgb:r.axisLine},width:r.gridWidth}),ct){const e=x?o*1.3:_t+o,i=Math.max(1,Math.ceil(e/Math.max(1,Pt)));t.categories.forEach((g,l)=>{if(l%i!==0)return;const b=pt(l);a.words.push(x?{x:p.x-H,y:b,text:g,size:o,anchor:"end",color:c}:{x:b,y:p.y+p.height+H+o*.6,text:g,size:o,anchor:"middle",color:c})})}for(const e of y){const i=e.secondary&&ot?ot:et,g=b=>ut(i,b),l={type:e.kind,...t.labels===void 0?{}:{labels:t.labels}};isBar(e.kind)?Dt(e,g,l):Gt(e,g,l)}return a;function Dt(e,i,g){const l=(t.gap_width??r.gapWidth)/100,b=e.stacked?1:e.series.length,F=e.stacked?1:(t.overlap??0)/100,d=mt/(Math.max(1,b-(b-1)*F)+l),w=d*(1-F),u=d+w*(b-1);t.categories.forEach((E,M)=>{const $=pt(M);let A=0,T=0;e.series.forEach((C,nt)=>{const K=t.series[C],L=v(e,C,M);if(L===null||!K)return;const lt=e.stacked?L>=0?A:T:0,st=lt+L;e.stacked&&(L>=0?A=st:T=st);const Q=i(lt),X=i(st),ht=(e.stacked?$-d/2:$-u/2+nt*w)+(x&&Ot&&!e.stacked?u-d-2*nt*w:0),Ht=x?{x:Math.min(Q,X),y:ht,width:Math.abs(X-Q),height:d}:{x:ht,y:Math.min(Q,X),width:d,height:Math.abs(X-Q)};if(a.boxes.push({...Ht,color:O(C,M),series:C,category:M}),!k)return;const Ct=xt(t,D[C]?.[M]??0,0,K,t.categories[M]??""),dt=labelPositionOf(g),Y=P*.8,Tt=L>=0?1:-1,Lt=(rt,tt)=>dt==="ctr"?(rt+tt)/2:dt==="inBase"?rt+(tt>rt?Y:-Y):dt==="inEnd"?tt-(tt>rt?Y:-Y):tt+(tt>=rt?Y:-Y);x?z(Lt(Q,X),ht+d/2,Ct,dt==="outEnd"?Tt>0?"start":"end":"middle"):z(ht+d/2,Lt(Q,X),Ct,"middle")})})}function Gt(e,i,g){const l=t.categories.map(()=>0),b=e.series.map(d=>{const w=t.series[d],u=[],E=[];return t.categories.forEach((M,$)=>{const A=v(e,d,$);if(A===null||!w)return;const T=e.stacked?l[$]??0:0,C=T+A;e.stacked&&(l[$]=C);const nt=pt($),K=L=>x?[i(L),nt]:[nt,i(L)];if(u.push(K(C)),E.push(K(T)),isLine(e.kind)&&k){const L=labelPositionOf(g),[lt,st]=K(C);z(lt+(L==="r"?P:L==="l"?-P:0),st+(L==="t"?-P:L==="b"?P:0),xt(t,D[d]?.[$]??0,0,w,t.categories[$]??""),L==="r"?"start":L==="l"?"end":"middle")}}),{series:w,s:d,points:u,base:E}}),F=[];for(const{series:d,s:w,points:u,base:E}of b){if(!d)continue;const M=d.color??accentOf(w);if(isArea(e.kind)&&u.length>0)F.push({d:`${gt([...u,...[...E].reverse()])} Z`,color:M,width:0,fill:M,series:w});else if(u.length>0&&(a.lines.push({d:d.smooth===!0?jt(u):gt(u),color:M,width:d.line_width??r.lineWidth,series:w}),hasMarkers(e.kind)))for(const[$,A]of u)a.dots.push({x:$,y:A,r:(d.marker_size??r.marker)/2,color:M})}a.shapes.push(...F.reverse())}}
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/chart",
3
- "version": "0.9.0",
3
+ "version": "0.11.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -26,6 +26,13 @@ export interface Problem {
26
26
  selector?: string;
27
27
  bbox?: Box;
28
28
  };
29
+ /**
30
+ * A fact of the page that drew it (its browser), not of the piece: where
31
+ * that page renders (frames, check, an export) it is the export's; where
32
+ * it is an editor's preview, the export is not affected, so it is not a
33
+ * problem of the version (allykit#502).
34
+ */
35
+ ofPage?: true;
29
36
  }
30
37
  /** A code no rule this process knows has: a mistake in the code that reports it, or in its extension's manifest. */
31
38
  export declare class UnknownRuleError extends Error {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@allyhub/diagnostics",
3
- "version": "0.9.0",
3
+ "version": "0.11.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -18,7 +18,7 @@ export interface TrackedFace {
18
18
  */
19
19
  export interface FaceTrack {
20
20
  version: 2;
21
- /** What found the faces: the cloud tool ("find-faces"), never the model behind it. */
21
+ /** What found the faces: the cloud tool ("detect-faces"), never the model behind it. */
22
22
  model: string;
23
23
  /** The displayed picture's pixels the boxes are in. */
24
24
  width: number;
@@ -175,6 +175,7 @@ declare const CellEntry: z.ZodUnion<readonly [z.ZodUnion<readonly [z.ZodNumber,
175
175
  value: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodBoolean, z.ZodString, z.ZodNull]>>;
176
176
  formula: z.ZodOptional<z.ZodString>;
177
177
  name: z.ZodOptional<z.ZodString>;
178
+ start: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodBoolean, z.ZodString, z.ZodNull]>>;
178
179
  }, z.core.$strict>]>;
179
180
  export type SheetCell = z.output<typeof CellEntry>;
180
181
  declare const FormatEntry: z.ZodObject<{
@@ -1639,7 +1640,6 @@ declare const Validation: z.ZodObject<{
1639
1640
  }, z.core.$strict>>;
1640
1641
  }, z.core.$strict>;
1641
1642
  export type SheetValidation = z.output<typeof Validation>;
1642
- /** A chart's series: where its numbers are read from, and its look. */
1643
1643
  declare const ChartSeries: z.ZodObject<{
1644
1644
  values: z.ZodString;
1645
1645
  x: z.ZodOptional<z.ZodString>;
@@ -1649,6 +1649,17 @@ declare const ChartSeries: z.ZodObject<{
1649
1649
  smooth: z.ZodOptional<z.ZodBoolean>;
1650
1650
  line_width: z.ZodOptional<z.ZodNumber>;
1651
1651
  marker_size: z.ZodOptional<z.ZodNumber>;
1652
+ type: z.ZodOptional<z.ZodEnum<{
1653
+ line: "line";
1654
+ "column-clustered": "column-clustered";
1655
+ "column-stacked": "column-stacked";
1656
+ "column-stacked-100": "column-stacked-100";
1657
+ "line-markers": "line-markers";
1658
+ area: "area";
1659
+ "area-stacked": "area-stacked";
1660
+ "area-stacked-100": "area-stacked-100";
1661
+ }>>;
1662
+ secondary: z.ZodOptional<z.ZodBoolean>;
1652
1663
  }, z.core.$strict>;
1653
1664
  export type SheetChartSeries = z.output<typeof ChartSeries>;
1654
1665
  declare const ChartAxis: z.ZodObject<{
@@ -1698,6 +1709,17 @@ declare const Chart: z.ZodObject<{
1698
1709
  smooth: z.ZodOptional<z.ZodBoolean>;
1699
1710
  line_width: z.ZodOptional<z.ZodNumber>;
1700
1711
  marker_size: z.ZodOptional<z.ZodNumber>;
1712
+ type: z.ZodOptional<z.ZodEnum<{
1713
+ line: "line";
1714
+ "column-clustered": "column-clustered";
1715
+ "column-stacked": "column-stacked";
1716
+ "column-stacked-100": "column-stacked-100";
1717
+ "line-markers": "line-markers";
1718
+ area: "area";
1719
+ "area-stacked": "area-stacked";
1720
+ "area-stacked-100": "area-stacked-100";
1721
+ }>>;
1722
+ secondary: z.ZodOptional<z.ZodBoolean>;
1701
1723
  }, z.core.$strict>>;
1702
1724
  legend: z.ZodOptional<z.ZodEnum<{
1703
1725
  left: "left";
@@ -1762,6 +1784,16 @@ declare const Chart: z.ZodObject<{
1762
1784
  format: z.ZodOptional<z.ZodString>;
1763
1785
  reverse: z.ZodOptional<z.ZodBoolean>;
1764
1786
  }, z.core.$strict>>;
1787
+ secondary_axis: z.ZodOptional<z.ZodObject<{
1788
+ title: z.ZodOptional<z.ZodString>;
1789
+ min: z.ZodOptional<z.ZodNumber>;
1790
+ max: z.ZodOptional<z.ZodNumber>;
1791
+ major: z.ZodOptional<z.ZodNumber>;
1792
+ gridlines: z.ZodOptional<z.ZodBoolean>;
1793
+ visible: z.ZodOptional<z.ZodBoolean>;
1794
+ format: z.ZodOptional<z.ZodString>;
1795
+ reverse: z.ZodOptional<z.ZodBoolean>;
1796
+ }, z.core.$strict>>;
1765
1797
  size: z.ZodOptional<z.ZodNumber>;
1766
1798
  title_size: z.ZodOptional<z.ZodNumber>;
1767
1799
  color: z.ZodOptional<z.ZodString>;
@@ -2451,6 +2483,7 @@ declare const Worksheet: z.ZodObject<{
2451
2483
  value: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodBoolean, z.ZodString, z.ZodNull]>>;
2452
2484
  formula: z.ZodOptional<z.ZodString>;
2453
2485
  name: z.ZodOptional<z.ZodString>;
2486
+ start: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodBoolean, z.ZodString, z.ZodNull]>>;
2454
2487
  }, z.core.$strict>]>>>;
2455
2488
  format: z.ZodOptional<z.ZodArray<z.ZodObject<{
2456
2489
  format: z.ZodOptional<z.ZodString>;
@@ -3317,6 +3350,17 @@ declare const Worksheet: z.ZodObject<{
3317
3350
  smooth: z.ZodOptional<z.ZodBoolean>;
3318
3351
  line_width: z.ZodOptional<z.ZodNumber>;
3319
3352
  marker_size: z.ZodOptional<z.ZodNumber>;
3353
+ type: z.ZodOptional<z.ZodEnum<{
3354
+ line: "line";
3355
+ "column-clustered": "column-clustered";
3356
+ "column-stacked": "column-stacked";
3357
+ "column-stacked-100": "column-stacked-100";
3358
+ "line-markers": "line-markers";
3359
+ area: "area";
3360
+ "area-stacked": "area-stacked";
3361
+ "area-stacked-100": "area-stacked-100";
3362
+ }>>;
3363
+ secondary: z.ZodOptional<z.ZodBoolean>;
3320
3364
  }, z.core.$strict>>;
3321
3365
  legend: z.ZodOptional<z.ZodEnum<{
3322
3366
  left: "left";
@@ -3381,6 +3425,16 @@ declare const Worksheet: z.ZodObject<{
3381
3425
  format: z.ZodOptional<z.ZodString>;
3382
3426
  reverse: z.ZodOptional<z.ZodBoolean>;
3383
3427
  }, z.core.$strict>>;
3428
+ secondary_axis: z.ZodOptional<z.ZodObject<{
3429
+ title: z.ZodOptional<z.ZodString>;
3430
+ min: z.ZodOptional<z.ZodNumber>;
3431
+ max: z.ZodOptional<z.ZodNumber>;
3432
+ major: z.ZodOptional<z.ZodNumber>;
3433
+ gridlines: z.ZodOptional<z.ZodBoolean>;
3434
+ visible: z.ZodOptional<z.ZodBoolean>;
3435
+ format: z.ZodOptional<z.ZodString>;
3436
+ reverse: z.ZodOptional<z.ZodBoolean>;
3437
+ }, z.core.$strict>>;
3384
3438
  size: z.ZodOptional<z.ZodNumber>;
3385
3439
  title_size: z.ZodOptional<z.ZodNumber>;
3386
3440
  color: z.ZodOptional<z.ZodString>;
@@ -3456,6 +3510,12 @@ declare const Check: z.ZodObject<{
3456
3510
  formula: z.ZodString;
3457
3511
  }, z.core.$strict>;
3458
3512
  export type SheetCheck = z.output<typeof Check>;
3513
+ /** Excel's iterative calculation: `true`, or its limits. */
3514
+ declare const Iteration: z.ZodUnion<readonly [z.ZodLiteral<true>, z.ZodObject<{
3515
+ max_iterations: z.ZodOptional<z.ZodNumber>;
3516
+ max_change: z.ZodOptional<z.ZodNumber>;
3517
+ }, z.core.$strict>]>;
3518
+ export type SheetIteration = z.output<typeof Iteration>;
3459
3519
  /** A sheet's file. */
3460
3520
  export declare const SheetFileSchema: z.ZodObject<{
3461
3521
  title: z.ZodOptional<z.ZodString>;
@@ -4051,6 +4111,7 @@ export declare const SheetFileSchema: z.ZodObject<{
4051
4111
  value: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodBoolean, z.ZodString, z.ZodNull]>>;
4052
4112
  formula: z.ZodOptional<z.ZodString>;
4053
4113
  name: z.ZodOptional<z.ZodString>;
4114
+ start: z.ZodOptional<z.ZodUnion<readonly [z.ZodNumber, z.ZodBoolean, z.ZodString, z.ZodNull]>>;
4054
4115
  }, z.core.$strict>]>>>;
4055
4116
  format: z.ZodOptional<z.ZodArray<z.ZodObject<{
4056
4117
  format: z.ZodOptional<z.ZodString>;
@@ -4917,6 +4978,17 @@ export declare const SheetFileSchema: z.ZodObject<{
4917
4978
  smooth: z.ZodOptional<z.ZodBoolean>;
4918
4979
  line_width: z.ZodOptional<z.ZodNumber>;
4919
4980
  marker_size: z.ZodOptional<z.ZodNumber>;
4981
+ type: z.ZodOptional<z.ZodEnum<{
4982
+ line: "line";
4983
+ "column-clustered": "column-clustered";
4984
+ "column-stacked": "column-stacked";
4985
+ "column-stacked-100": "column-stacked-100";
4986
+ "line-markers": "line-markers";
4987
+ area: "area";
4988
+ "area-stacked": "area-stacked";
4989
+ "area-stacked-100": "area-stacked-100";
4990
+ }>>;
4991
+ secondary: z.ZodOptional<z.ZodBoolean>;
4920
4992
  }, z.core.$strict>>;
4921
4993
  legend: z.ZodOptional<z.ZodEnum<{
4922
4994
  left: "left";
@@ -4981,6 +5053,16 @@ export declare const SheetFileSchema: z.ZodObject<{
4981
5053
  format: z.ZodOptional<z.ZodString>;
4982
5054
  reverse: z.ZodOptional<z.ZodBoolean>;
4983
5055
  }, z.core.$strict>>;
5056
+ secondary_axis: z.ZodOptional<z.ZodObject<{
5057
+ title: z.ZodOptional<z.ZodString>;
5058
+ min: z.ZodOptional<z.ZodNumber>;
5059
+ max: z.ZodOptional<z.ZodNumber>;
5060
+ major: z.ZodOptional<z.ZodNumber>;
5061
+ gridlines: z.ZodOptional<z.ZodBoolean>;
5062
+ visible: z.ZodOptional<z.ZodBoolean>;
5063
+ format: z.ZodOptional<z.ZodString>;
5064
+ reverse: z.ZodOptional<z.ZodBoolean>;
5065
+ }, z.core.$strict>>;
4984
5066
  size: z.ZodOptional<z.ZodNumber>;
4985
5067
  title_size: z.ZodOptional<z.ZodNumber>;
4986
5068
  color: z.ZodOptional<z.ZodString>;
@@ -5055,6 +5137,10 @@ export declare const SheetFileSchema: z.ZodObject<{
5055
5137
  formula: z.ZodString;
5056
5138
  }, z.core.$strict>>>;
5057
5139
  scenarios: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodNumber, z.ZodBoolean, z.ZodString, z.ZodNull]>>>>;
5140
+ iteration: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<true>, z.ZodObject<{
5141
+ max_iterations: z.ZodOptional<z.ZodNumber>;
5142
+ max_change: z.ZodOptional<z.ZodNumber>;
5143
+ }, z.core.$strict>]>>;
5058
5144
  }, z.core.$strict>;
5059
5145
  export type SheetFile = z.output<typeof SheetFileSchema>;
5060
5146
  /** What a sheet's code makes, beside what its file holds: sheets as sheet.yaml would hold them, with their tables' rows as CSV text, and names. */
@@ -1,2 +1,2 @@
1
1
  /*! AllyHub. Copyright (c) 2026 AllyHub, Inc. All rights reserved. Use is subject to LICENSE.md. */
2
- import{z as o}from"zod";import{CHART_LEGEND_POSITIONS as h,ChartSchema as e,SHEET_CHART_TYPES as y}from"./slides.js";export const SHEET_FILE="sheet.yaml",SHEET_SEPARATOR=", ",SHEET_PICTURE_HEIGHT=60;const t=o.string().regex(/^#[0-9a-fA-F]{6}$/u,"A colour is #RRGGBB.");export const SHEET_ALIGNS=["general","left","center","right","fill","justify","centerContinuous","distributed"],SHEET_VALIGNS=["top","center","bottom","justify","distributed"],SHEET_UNDERLINES=["single","double","singleAccounting","doubleAccounting"],SHEET_BORDERS=["none","thin","medium","thick","double","hair","dotted","dashed","dashDot","dashDotDot","mediumDashed","mediumDashDot","mediumDashDotDot","slantDashDot"],SHEET_PATTERNS=["solid","darkDown","darkGray","darkGrid","darkHorizontal","darkTrellis","darkUp","darkVertical","gray0625","gray125","lightDown","lightGray","lightGrid","lightHorizontal","lightTrellis","lightUp","lightVertical","mediumGray"];const l=o.strictObject({style:o.enum(SHEET_BORDERS),color:t.optional()}),m={bold:o.boolean().optional(),italic:o.boolean().optional(),underline:o.union([o.boolean(),o.enum(SHEET_UNDERLINES)]).optional(),strike:o.boolean().optional(),font:o.string().min(1).optional(),size:o.number().positive().optional(),color:t.optional(),fill:o.union([t,o.strictObject({pattern:o.enum(SHEET_PATTERNS),color:t.optional(),background:t.optional()})]).optional(),align:o.enum(SHEET_ALIGNS).optional(),valign:o.enum(SHEET_VALIGNS).optional(),wrap:o.boolean().optional(),shrink:o.boolean().optional(),indent:o.number().int().min(0).optional(),rotation:o.number().int().min(-90).max(180).optional(),border:o.strictObject({left:l.optional(),right:l.optional(),top:l.optional(),bottom:l.optional()}).optional()},a={...m,format:o.string().min(1).optional()},r=o.union([o.number(),o.boolean(),o.string(),o.null()]),O=o.strictObject({value:r.optional(),formula:o.string().min(1).optional(),name:o.string().min(1).optional(),...a}).refine(c=>c.value===void 0||c.formula===void 0,{message:"A cell has a value or a formula, not both."}),E=o.union([r,O]),f=o.strictObject({range:o.string().min(1),...a}),b=o.union([o.literal(!0),o.strictObject({separator:o.string().min(1).optional(),height:o.number().positive().optional()})]),j=o.strictObject({formula:o.string().min(1).optional(),...a,width:o.number().positive().optional(),files:b.optional()}),g=o.strictObject({values:o.array(o.string()).optional(),blanks:o.boolean().optional()}),x=o.strictObject({name:o.string().min(1),at:o.string().min(1),rows:o.string().min(1),key:o.string().min(1).optional(),style:o.string().min(1).optional(),columns:o.record(o.string(),j).optional(),filter:o.union([o.literal(!1),o.strictObject({columns:o.record(o.string(),g)})]).optional()}),S=o.strictObject({at:o.string().min(1),rows:o.string().min(1)}),T=o.strictObject({width:o.number().positive().optional(),hidden:o.boolean().optional(),level:o.number().int().min(1).max(7).optional(),...a,files:b.optional()}),_=o.strictObject({height:o.number().positive().optional(),hidden:o.boolean().optional(),level:o.number().int().min(1).max(7).optional(),...a}),v=o.strictObject({range:o.string().min(1),columns:o.record(o.string(),g).optional()});export const SHEET_OPERATORS=["between","notBetween","equal","notEqual","greaterThan","lessThan","greaterThanOrEqual","lessThanOrEqual"];const p=o.union([o.number(),o.string()]),i={bold:o.boolean().optional(),italic:o.boolean().optional(),underline:o.boolean().optional(),strike:o.boolean().optional(),color:t.optional(),fill:t.optional(),border:m.border},n={range:o.string().min(1),stop:o.boolean().optional()},s=o.strictObject({at:o.enum(["min","max","num","percent","percentile","formula"]),value:p.optional()});export const SHEET_ICONS=["3Arrows","3ArrowsGray","3Flags","3TrafficLights1","3TrafficLights2","3Signs","3Symbols","3Symbols2","4Arrows","4ArrowsGray","4RedToBlack","4Rating","4TrafficLights","5Arrows","5ArrowsGray","5Rating","5Quarters"];const w=o.discriminatedUnion("type",[o.strictObject({...n,...i,type:o.literal("cellIs"),operator:o.enum(SHEET_OPERATORS),formula:o.array(p).min(1).max(2)}),o.strictObject({...n,...i,type:o.literal("containsText"),operator:o.enum(["contains","notContains","beginsWith","endsWith"]).optional(),text:o.string()}),o.strictObject({...n,...i,type:o.enum(["duplicateValues","uniqueValues"])}),o.strictObject({...n,...i,type:o.literal("top10"),rank:o.number().int().positive(),percent:o.boolean().optional(),bottom:o.boolean().optional()}),o.strictObject({...n,...i,type:o.literal("aboveAverage"),below:o.boolean().optional(),equal:o.boolean().optional()}),o.strictObject({...n,...i,type:o.literal("expression"),formula:o.string().min(1)}),o.strictObject({...n,type:o.literal("dataBar"),color:t,min:s.optional(),max:s.optional(),show:o.boolean().optional()}),o.strictObject({...n,type:o.literal("colorScale"),stops:o.array(o.strictObject({...s.shape,color:t})).min(2).max(3)}),o.strictObject({...n,type:o.literal("iconSet"),icons:o.enum(SHEET_ICONS),stops:o.array(s).min(3).max(5).optional(),reverse:o.boolean().optional(),show:o.boolean().optional()})]);export const SHEET_VALIDATIONS=["whole","decimal","list","date","time","textLength","custom"];const A=o.strictObject({range:o.string().min(1),type:o.enum(SHEET_VALIDATIONS),operator:o.enum(SHEET_OPERATORS).optional(),formula:o.array(p).max(2).optional(),values:o.array(o.string()).optional(),multiple:o.boolean().optional(),separator:o.string().min(1).optional(),blank:o.boolean().optional(),dropdown:o.boolean().optional(),prompt:o.strictObject({title:o.string().optional(),message:o.string().optional(),show:o.boolean().optional()}).optional(),error:o.strictObject({style:o.enum(["stop","warning","information"]).optional(),title:o.string().optional(),message:o.string().optional(),show:o.boolean().optional()}).optional()}),k=o.strictObject({values:o.string().min(1),x:o.string().min(1).optional(),name:o.string().optional(),color:t.optional(),format:o.string().min(1).optional(),smooth:o.boolean().optional(),line_width:o.number().positive().optional(),marker_size:o.number().int().min(2).max(72).optional()}),u=o.strictObject({title:o.string().optional(),min:o.number().optional(),max:o.number().optional(),major:o.number().positive().optional(),gridlines:o.boolean().optional(),visible:o.boolean().optional(),format:o.string().min(1).optional(),reverse:o.boolean().optional()}),H=o.strictObject({type:o.enum(y),at:o.string().min(1),x:o.number().min(0).optional(),y:o.number().min(0).optional(),width:o.number().positive().optional(),height:o.number().positive().optional(),title:o.string().optional(),categories:o.string().min(1).optional(),series:o.array(k).min(1),legend:o.enum(h).optional(),labels:e.shape.labels,gap_width:e.shape.gap_width,overlap:e.shape.overlap,vary_by_categories:e.shape.vary_by_categories,hole_size:e.shape.hole_size,value_axis:u.optional(),category_axis:u.optional(),size:o.number().positive().optional(),title_size:o.number().positive().optional(),color:t.optional()});export const SHEET_PAPERS={letter:1,tabloid:3,ledger:4,legal:5,executive:7,a3:8,a4:9,a5:11,b4:12,b5:13},SHEET_MARGINS={left:.7,right:.7,top:.75,bottom:.75,header:.3,footer:.3},SHEET_NOTE_AUTHOR="AllyHub";const d=o.strictObject({left:o.string().optional(),center:o.string().optional(),right:o.string().optional()}),R=o.strictObject({area:o.string().min(1).optional(),title_rows:o.string().regex(/^\d+:\d+$/u).optional(),title_cols:o.string().regex(/^[A-Za-z]+:[A-Za-z]+$/u).optional(),orientation:o.enum(["portrait","landscape"]).optional(),paper:o.enum(Object.keys(SHEET_PAPERS)).optional(),fit:o.strictObject({width:o.number().int().min(0).optional(),height:o.number().int().min(0).optional()}).optional(),scale:o.number().int().min(10).max(400).optional(),breaks:o.strictObject({rows:o.array(o.number().int().min(2)).optional(),cols:o.array(o.string().regex(/^[A-Za-z]+$/u)).optional()}).optional(),margins:o.strictObject({left:o.number().min(0).optional(),right:o.number().min(0).optional(),top:o.number().min(0).optional(),bottom:o.number().min(0).optional(),header:o.number().min(0).optional(),footer:o.number().min(0).optional()}).optional(),header:d.optional(),footer:d.optional()}),C=o.strictObject({file:o.string().min(1),at:o.string().min(1),x:o.number().min(0).optional(),y:o.number().min(0).optional(),width:o.number().positive().optional(),height:o.number().positive().optional()}),D=o.union([o.string().min(1),o.strictObject({text:o.string().min(1),author:o.string().optional()})]),G=o.strictObject({name:o.string().min(1),hidden:o.boolean().optional(),gridlines:o.boolean().optional(),tab:t.optional(),freeze:o.string().min(1).optional(),tables:o.array(x).optional(),columns:o.record(o.string(),T).optional(),rows:o.record(o.string(),_).optional(),cells:o.record(o.string(),E).optional(),format:o.array(f).optional(),merges:o.array(o.string().min(1)).optional(),blocks:o.array(S).optional(),filter:v.optional(),conditional:o.array(w).optional(),validations:o.array(A).optional(),charts:o.array(H).optional(),pictures:o.array(C).optional(),links:o.record(o.string(),o.string().min(1)).optional(),notes:o.record(o.string(),D).optional(),print:R.optional(),protect:o.boolean().optional(),names:o.record(o.string(),r).optional(),hidden_names:o.array(o.string().min(1)).optional()}),z=o.strictObject({name:o.string().min(1),formula:o.string().min(1)});export const SheetFileSchema=o.strictObject({title:o.string().optional(),code:o.string().min(1).optional(),names:o.record(o.string(),r).optional(),hidden_names:o.array(o.string().min(1)).optional(),sheets:o.array(G).min(1),checks:o.array(z).optional(),scenarios:o.record(o.string(),o.record(o.string(),r)).optional()});
2
+ import{z as t}from"zod";import{CHART_LEGEND_POSITIONS as h,ChartSchema as r,SHEET_CHART_TYPES as y}from"./slides.js";export const SHEET_FILE="sheet.yaml",SHEET_SEPARATOR=", ",SHEET_PICTURE_HEIGHT=60;const o=t.string().regex(/^#[0-9a-fA-F]{6}$/u,"A colour is #RRGGBB.");export const SHEET_ALIGNS=["general","left","center","right","fill","justify","centerContinuous","distributed"],SHEET_VALIGNS=["top","center","bottom","justify","distributed"],SHEET_UNDERLINES=["single","double","singleAccounting","doubleAccounting"],SHEET_BORDERS=["none","thin","medium","thick","double","hair","dotted","dashed","dashDot","dashDotDot","mediumDashed","mediumDashDot","mediumDashDotDot","slantDashDot"],SHEET_PATTERNS=["solid","darkDown","darkGray","darkGrid","darkHorizontal","darkTrellis","darkUp","darkVertical","gray0625","gray125","lightDown","lightGray","lightGrid","lightHorizontal","lightTrellis","lightUp","lightVertical","mediumGray"];const s=t.strictObject({style:t.enum(SHEET_BORDERS),color:o.optional()}),b={bold:t.boolean().optional(),italic:t.boolean().optional(),underline:t.union([t.boolean(),t.enum(SHEET_UNDERLINES)]).optional(),strike:t.boolean().optional(),font:t.string().min(1).optional(),size:t.number().positive().optional(),color:o.optional(),fill:t.union([o,t.strictObject({pattern:t.enum(SHEET_PATTERNS),color:o.optional(),background:o.optional()})]).optional(),align:t.enum(SHEET_ALIGNS).optional(),valign:t.enum(SHEET_VALIGNS).optional(),wrap:t.boolean().optional(),shrink:t.boolean().optional(),indent:t.number().int().min(0).optional(),rotation:t.number().int().min(-90).max(180).optional(),border:t.strictObject({left:s.optional(),right:s.optional(),top:s.optional(),bottom:s.optional()}).optional()},l={...b,format:t.string().min(1).optional()},i=t.union([t.number(),t.boolean(),t.string(),t.null()]),O=t.strictObject({value:i.optional(),formula:t.string().min(1).optional(),name:t.string().min(1).optional(),start:i.optional(),...l}).refine(a=>a.value===void 0||a.formula===void 0,{message:"A cell has a value or a formula, not both."}).refine(a=>a.start===void 0||a.formula!==void 0,{message:"A cell's start is a formula's."}),E=t.union([i,O]),f=t.strictObject({range:t.string().min(1),...l}),u=t.union([t.literal(!0),t.strictObject({separator:t.string().min(1).optional(),height:t.number().positive().optional()})]),x=t.strictObject({formula:t.string().min(1).optional(),...l,width:t.number().positive().optional(),files:u.optional()}),g=t.strictObject({values:t.array(t.string()).optional(),blanks:t.boolean().optional()}),j=t.strictObject({name:t.string().min(1),at:t.string().min(1),rows:t.string().min(1),key:t.string().min(1).optional(),style:t.string().min(1).optional(),columns:t.record(t.string(),x).optional(),filter:t.union([t.literal(!1),t.strictObject({columns:t.record(t.string(),g)})]).optional()}),S=t.strictObject({at:t.string().min(1),rows:t.string().min(1)}),T=t.strictObject({width:t.number().positive().optional(),hidden:t.boolean().optional(),level:t.number().int().min(1).max(7).optional(),...l,files:u.optional()}),_=t.strictObject({height:t.number().positive().optional(),hidden:t.boolean().optional(),level:t.number().int().min(1).max(7).optional(),...l}),v=t.strictObject({range:t.string().min(1),columns:t.record(t.string(),g).optional()});export const SHEET_OPERATORS=["between","notBetween","equal","notEqual","greaterThan","lessThan","greaterThanOrEqual","lessThanOrEqual"];const c=t.union([t.number(),t.string()]),e={bold:t.boolean().optional(),italic:t.boolean().optional(),underline:t.boolean().optional(),strike:t.boolean().optional(),color:o.optional(),fill:o.optional(),border:b.border},n={range:t.string().min(1),stop:t.boolean().optional()},p=t.strictObject({at:t.enum(["min","max","num","percent","percentile","formula"]),value:c.optional()});export const SHEET_ICONS=["3Arrows","3ArrowsGray","3Flags","3TrafficLights1","3TrafficLights2","3Signs","3Symbols","3Symbols2","4Arrows","4ArrowsGray","4RedToBlack","4Rating","4TrafficLights","5Arrows","5ArrowsGray","5Rating","5Quarters"];const k=t.discriminatedUnion("type",[t.strictObject({...n,...e,type:t.literal("cellIs"),operator:t.enum(SHEET_OPERATORS),formula:t.array(c).min(1).max(2)}),t.strictObject({...n,...e,type:t.literal("containsText"),operator:t.enum(["contains","notContains","beginsWith","endsWith"]).optional(),text:t.string()}),t.strictObject({...n,...e,type:t.enum(["duplicateValues","uniqueValues"])}),t.strictObject({...n,...e,type:t.literal("top10"),rank:t.number().int().positive(),percent:t.boolean().optional(),bottom:t.boolean().optional()}),t.strictObject({...n,...e,type:t.literal("aboveAverage"),below:t.boolean().optional(),equal:t.boolean().optional()}),t.strictObject({...n,...e,type:t.literal("expression"),formula:t.string().min(1)}),t.strictObject({...n,type:t.literal("dataBar"),color:o,min:p.optional(),max:p.optional(),show:t.boolean().optional()}),t.strictObject({...n,type:t.literal("colorScale"),stops:t.array(t.strictObject({...p.shape,color:o})).min(2).max(3)}),t.strictObject({...n,type:t.literal("iconSet"),icons:t.enum(SHEET_ICONS),stops:t.array(p).min(3).max(5).optional(),reverse:t.boolean().optional(),show:t.boolean().optional()})]);export const SHEET_VALIDATIONS=["whole","decimal","list","date","time","textLength","custom"];const w=t.strictObject({range:t.string().min(1),type:t.enum(SHEET_VALIDATIONS),operator:t.enum(SHEET_OPERATORS).optional(),formula:t.array(c).max(2).optional(),values:t.array(t.string()).optional(),multiple:t.boolean().optional(),separator:t.string().min(1).optional(),blank:t.boolean().optional(),dropdown:t.boolean().optional(),prompt:t.strictObject({title:t.string().optional(),message:t.string().optional(),show:t.boolean().optional()}).optional(),error:t.strictObject({style:t.enum(["stop","warning","information"]).optional(),title:t.string().optional(),message:t.string().optional(),show:t.boolean().optional()}).optional()}),A=["column-clustered","column-stacked","column-stacked-100","line","line-markers","area","area-stacked","area-stacked-100"],H=t.strictObject({values:t.string().min(1),x:t.string().min(1).optional(),name:t.string().optional(),color:o.optional(),format:t.string().min(1).optional(),smooth:t.boolean().optional(),line_width:t.number().positive().optional(),marker_size:t.number().int().min(2).max(72).optional(),type:t.enum(A).optional(),secondary:t.boolean().optional()}),m=t.strictObject({title:t.string().optional(),min:t.number().optional(),max:t.number().optional(),major:t.number().positive().optional(),gridlines:t.boolean().optional(),visible:t.boolean().optional(),format:t.string().min(1).optional(),reverse:t.boolean().optional()}),R=t.strictObject({type:t.enum(y),at:t.string().min(1),x:t.number().min(0).optional(),y:t.number().min(0).optional(),width:t.number().positive().optional(),height:t.number().positive().optional(),title:t.string().optional(),categories:t.string().min(1).optional(),series:t.array(H).min(1),legend:t.enum(h).optional(),labels:r.shape.labels,gap_width:r.shape.gap_width,overlap:r.shape.overlap,vary_by_categories:r.shape.vary_by_categories,hole_size:r.shape.hole_size,value_axis:m.optional(),category_axis:m.optional(),secondary_axis:m.optional(),size:t.number().positive().optional(),title_size:t.number().positive().optional(),color:o.optional()});export const SHEET_PAPERS={letter:1,tabloid:3,ledger:4,legal:5,executive:7,a3:8,a4:9,a5:11,b4:12,b5:13},SHEET_MARGINS={left:.7,right:.7,top:.75,bottom:.75,header:.3,footer:.3},SHEET_NOTE_AUTHOR="AllyHub";const d=t.strictObject({left:t.string().optional(),center:t.string().optional(),right:t.string().optional()}),C=t.strictObject({area:t.string().min(1).optional(),title_rows:t.string().regex(/^\d+:\d+$/u).optional(),title_cols:t.string().regex(/^[A-Za-z]+:[A-Za-z]+$/u).optional(),orientation:t.enum(["portrait","landscape"]).optional(),paper:t.enum(Object.keys(SHEET_PAPERS)).optional(),fit:t.strictObject({width:t.number().int().min(0).optional(),height:t.number().int().min(0).optional()}).optional(),scale:t.number().int().min(10).max(400).optional(),breaks:t.strictObject({rows:t.array(t.number().int().min(2)).optional(),cols:t.array(t.string().regex(/^[A-Za-z]+$/u)).optional()}).optional(),margins:t.strictObject({left:t.number().min(0).optional(),right:t.number().min(0).optional(),top:t.number().min(0).optional(),bottom:t.number().min(0).optional(),header:t.number().min(0).optional(),footer:t.number().min(0).optional()}).optional(),header:d.optional(),footer:d.optional()}),D=t.strictObject({file:t.string().min(1),at:t.string().min(1),x:t.number().min(0).optional(),y:t.number().min(0).optional(),width:t.number().positive().optional(),height:t.number().positive().optional()}),G=t.union([t.string().min(1),t.strictObject({text:t.string().min(1),author:t.string().optional()})]),I=t.strictObject({name:t.string().min(1),hidden:t.boolean().optional(),gridlines:t.boolean().optional(),tab:o.optional(),freeze:t.string().min(1).optional(),tables:t.array(j).optional(),columns:t.record(t.string(),T).optional(),rows:t.record(t.string(),_).optional(),cells:t.record(t.string(),E).optional(),format:t.array(f).optional(),merges:t.array(t.string().min(1)).optional(),blocks:t.array(S).optional(),filter:v.optional(),conditional:t.array(k).optional(),validations:t.array(w).optional(),charts:t.array(R).optional(),pictures:t.array(D).optional(),links:t.record(t.string(),t.string().min(1)).optional(),notes:t.record(t.string(),G).optional(),print:C.optional(),protect:t.boolean().optional(),names:t.record(t.string(),i).optional(),hidden_names:t.array(t.string().min(1)).optional()}),z=t.strictObject({name:t.string().min(1),formula:t.string().min(1)}),L=t.union([t.literal(!0),t.strictObject({max_iterations:t.number().int().min(1).max(32767).optional(),max_change:t.number().min(0).optional()})]);export const SheetFileSchema=t.strictObject({title:t.string().optional(),code:t.string().min(1).optional(),names:t.record(t.string(),i).optional(),hidden_names:t.array(t.string().min(1)).optional(),sheets:t.array(I).min(1),checks:t.array(z).optional(),scenarios:t.record(t.string(),t.record(t.string(),i)).optional(),iteration:L.optional()});
@@ -29,6 +29,23 @@ export type LineDash = (typeof LINE_DASHES)[number];
29
29
  /** A line's end, as PresentationML names it (`a:headEnd/@type`, `a:tailEnd/@type`). */
30
30
  export declare const LINE_ENDS: readonly ["none", "triangle", "arrow", "stealth", "diamond", "oval"];
31
31
  export type LineEnd = (typeof LINE_ENDS)[number];
32
+ /** A line end's width or length, small, medium or large, as PresentationML names them (`a:headEnd/@w`, `@len`). */
33
+ export declare const ARROW_SIZES: readonly ["sm", "med", "lg"];
34
+ export type ArrowSize = (typeof ARROW_SIZES)[number];
35
+ /** A line end's size: its width across the line and its length along it; what it leaves out is medium. */
36
+ export declare const LineEndSizeSchema: z.ZodObject<{
37
+ w: z.ZodOptional<z.ZodEnum<{
38
+ sm: "sm";
39
+ med: "med";
40
+ lg: "lg";
41
+ }>>;
42
+ len: z.ZodOptional<z.ZodEnum<{
43
+ sm: "sm";
44
+ med: "med";
45
+ lg: "lg";
46
+ }>>;
47
+ }, z.core.$strict>;
48
+ export type LineEndSize = z.infer<typeof LineEndSizeSchema>;
32
49
  /** A shape's frame: its offset and extents (`a:xfrm`), in points. */
33
50
  export declare const FrameSchema: z.ZodObject<{
34
51
  x: z.ZodNumber;
@@ -543,6 +560,30 @@ export declare const ShapeSchema: z.ZodObject<{
543
560
  stealth: "stealth";
544
561
  oval: "oval";
545
562
  }>>;
563
+ line_begin_size: z.ZodOptional<z.ZodObject<{
564
+ w: z.ZodOptional<z.ZodEnum<{
565
+ sm: "sm";
566
+ med: "med";
567
+ lg: "lg";
568
+ }>>;
569
+ len: z.ZodOptional<z.ZodEnum<{
570
+ sm: "sm";
571
+ med: "med";
572
+ lg: "lg";
573
+ }>>;
574
+ }, z.core.$strict>>;
575
+ line_end_size: z.ZodOptional<z.ZodObject<{
576
+ w: z.ZodOptional<z.ZodEnum<{
577
+ sm: "sm";
578
+ med: "med";
579
+ lg: "lg";
580
+ }>>;
581
+ len: z.ZodOptional<z.ZodEnum<{
582
+ sm: "sm";
583
+ med: "med";
584
+ lg: "lg";
585
+ }>>;
586
+ }, z.core.$strict>>;
546
587
  text: z.ZodOptional<z.ZodObject<{
547
588
  size: z.ZodOptional<z.ZodNumber>;
548
589
  bold: z.ZodOptional<z.ZodBoolean>;
@@ -1250,6 +1291,30 @@ export declare const SlideSchema: z.ZodObject<{
1250
1291
  stealth: "stealth";
1251
1292
  oval: "oval";
1252
1293
  }>>;
1294
+ line_begin_size: z.ZodOptional<z.ZodObject<{
1295
+ w: z.ZodOptional<z.ZodEnum<{
1296
+ sm: "sm";
1297
+ med: "med";
1298
+ lg: "lg";
1299
+ }>>;
1300
+ len: z.ZodOptional<z.ZodEnum<{
1301
+ sm: "sm";
1302
+ med: "med";
1303
+ lg: "lg";
1304
+ }>>;
1305
+ }, z.core.$strict>>;
1306
+ line_end_size: z.ZodOptional<z.ZodObject<{
1307
+ w: z.ZodOptional<z.ZodEnum<{
1308
+ sm: "sm";
1309
+ med: "med";
1310
+ lg: "lg";
1311
+ }>>;
1312
+ len: z.ZodOptional<z.ZodEnum<{
1313
+ sm: "sm";
1314
+ med: "med";
1315
+ lg: "lg";
1316
+ }>>;
1317
+ }, z.core.$strict>>;
1253
1318
  text: z.ZodOptional<z.ZodObject<{
1254
1319
  size: z.ZodOptional<z.ZodNumber>;
1255
1320
  bold: z.ZodOptional<z.ZodBoolean>;
@@ -1989,6 +2054,30 @@ export declare const SlidesFileSchema: z.ZodObject<{
1989
2054
  stealth: "stealth";
1990
2055
  oval: "oval";
1991
2056
  }>>;
2057
+ line_begin_size: z.ZodOptional<z.ZodObject<{
2058
+ w: z.ZodOptional<z.ZodEnum<{
2059
+ sm: "sm";
2060
+ med: "med";
2061
+ lg: "lg";
2062
+ }>>;
2063
+ len: z.ZodOptional<z.ZodEnum<{
2064
+ sm: "sm";
2065
+ med: "med";
2066
+ lg: "lg";
2067
+ }>>;
2068
+ }, z.core.$strict>>;
2069
+ line_end_size: z.ZodOptional<z.ZodObject<{
2070
+ w: z.ZodOptional<z.ZodEnum<{
2071
+ sm: "sm";
2072
+ med: "med";
2073
+ lg: "lg";
2074
+ }>>;
2075
+ len: z.ZodOptional<z.ZodEnum<{
2076
+ sm: "sm";
2077
+ med: "med";
2078
+ lg: "lg";
2079
+ }>>;
2080
+ }, z.core.$strict>>;
1992
2081
  text: z.ZodOptional<z.ZodObject<{
1993
2082
  size: z.ZodOptional<z.ZodNumber>;
1994
2083
  bold: z.ZodOptional<z.ZodBoolean>;