@allyhub/sdk 0.11.0 → 0.13.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 (158) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/node_modules/@allyhub/audio/dist/plan.d.ts +3 -0
  3. package/dist/node_modules/@allyhub/audio/dist/render.js +1 -1
  4. package/dist/node_modules/@allyhub/audio/package.json +1 -1
  5. package/dist/node_modules/@allyhub/chart/dist/chart-file.d.ts +2 -0
  6. package/dist/node_modules/@allyhub/chart/dist/chart-file.js +1 -1
  7. package/dist/node_modules/@allyhub/chart/dist/chart-xml.js +3 -2
  8. package/dist/node_modules/@allyhub/chart/dist/chart.d.ts +5 -12
  9. package/dist/node_modules/@allyhub/chart/dist/chart.js +2 -1
  10. package/dist/node_modules/@allyhub/chart/dist/color.d.ts +37 -0
  11. package/dist/node_modules/@allyhub/chart/dist/color.js +2 -0
  12. package/dist/node_modules/@allyhub/chart/dist/index.d.ts +1 -0
  13. package/dist/node_modules/@allyhub/chart/dist/index.js +1 -1
  14. package/dist/node_modules/@allyhub/chart/dist/svg.js +1 -1
  15. package/dist/node_modules/@allyhub/chart/package.json +1 -1
  16. package/dist/node_modules/@allyhub/diagnostics/package.json +1 -1
  17. package/dist/node_modules/@allyhub/formats/dist/data/deck-code.d.ts +130 -0
  18. package/dist/node_modules/@allyhub/formats/dist/data/deck-code.js +1 -1
  19. package/dist/node_modules/@allyhub/formats/dist/data/gen.d.ts +3 -1
  20. package/dist/node_modules/@allyhub/formats/dist/data/gen.js +1 -1
  21. package/dist/node_modules/@allyhub/formats/dist/data/sheet.d.ts +512 -166
  22. package/dist/node_modules/@allyhub/formats/dist/data/sheet.js +1 -1
  23. package/dist/node_modules/@allyhub/formats/dist/data/slides.d.ts +2523 -136
  24. package/dist/node_modules/@allyhub/formats/dist/data/slides.js +1 -1
  25. package/dist/node_modules/@allyhub/formats/dist/schemas.d.ts +931 -87
  26. package/dist/node_modules/@allyhub/formats/dist/schemas.js +1 -1
  27. package/dist/node_modules/@allyhub/formats/package.json +1 -1
  28. package/dist/node_modules/@allyhub/image-draw/package.json +1 -1
  29. package/dist/node_modules/@allyhub/image-measure/package.json +1 -1
  30. package/dist/node_modules/@allyhub/image-sdk/package.json +1 -1
  31. package/dist/node_modules/@allyhub/measure/package.json +1 -1
  32. package/dist/node_modules/@allyhub/ooxml/dist/color.d.ts +11 -0
  33. package/dist/node_modules/@allyhub/ooxml/dist/color.js +1 -1
  34. package/dist/node_modules/@allyhub/ooxml/dist/ext.d.ts +43 -0
  35. package/dist/node_modules/@allyhub/ooxml/dist/ext.js +1 -1
  36. package/dist/node_modules/@allyhub/ooxml/dist/index.d.ts +2 -1
  37. package/dist/node_modules/@allyhub/ooxml/dist/index.js +1 -1
  38. package/dist/node_modules/@allyhub/ooxml/dist/transform.d.ts +13 -0
  39. package/dist/node_modules/@allyhub/ooxml/dist/transform.js +2 -0
  40. package/dist/node_modules/@allyhub/ooxml/package.json +5 -1
  41. package/dist/node_modules/@allyhub/piece/dist/gen.d.ts +4 -4
  42. package/dist/node_modules/@allyhub/piece/dist/media.d.ts +2 -2
  43. package/dist/node_modules/@allyhub/piece/package.json +1 -1
  44. package/dist/node_modules/@allyhub/protocol/dist/account.d.ts +49 -5
  45. package/dist/node_modules/@allyhub/protocol/dist/account.js +1 -1
  46. package/dist/node_modules/@allyhub/protocol/dist/auth.d.ts +56 -0
  47. package/dist/node_modules/@allyhub/protocol/dist/auth.js +1 -1
  48. package/dist/node_modules/@allyhub/protocol/dist/cloud.d.ts +72 -9
  49. package/dist/node_modules/@allyhub/protocol/dist/cloud.js +1 -1
  50. package/dist/node_modules/@allyhub/protocol/dist/editor.d.ts +35 -20
  51. package/dist/node_modules/@allyhub/protocol/dist/editor.js +1 -1
  52. package/dist/node_modules/@allyhub/protocol/dist/errors.d.ts +7 -0
  53. package/dist/node_modules/@allyhub/protocol/dist/errors.js +2 -0
  54. package/dist/node_modules/@allyhub/protocol/dist/events.d.ts +328 -0
  55. package/dist/node_modules/@allyhub/protocol/dist/events.js +2 -0
  56. package/dist/node_modules/@allyhub/protocol/dist/frame.d.ts +28 -2
  57. package/dist/node_modules/@allyhub/protocol/dist/frame.js +1 -1
  58. package/dist/node_modules/@allyhub/protocol/dist/index.d.ts +2 -0
  59. package/dist/node_modules/@allyhub/protocol/dist/index.js +1 -1
  60. package/dist/node_modules/@allyhub/protocol/dist/jobs.d.ts +6 -6
  61. package/dist/node_modules/@allyhub/protocol/dist/mail.d.ts +2 -2
  62. package/dist/node_modules/@allyhub/protocol/dist/routes.js +1 -1
  63. package/dist/node_modules/@allyhub/protocol/dist/snapshots.d.ts +69 -6
  64. package/dist/node_modules/@allyhub/protocol/dist/snapshots.js +1 -1
  65. package/dist/node_modules/@allyhub/protocol/dist/tools.d.ts +9 -9
  66. package/dist/node_modules/@allyhub/protocol/package.json +1 -1
  67. package/dist/node_modules/@allyhub/runtimes/package.json +1 -1
  68. package/dist/node_modules/@allyhub/scenery/package.json +1 -1
  69. package/dist/node_modules/@allyhub/sheet/dist/annotations.d.ts +14 -0
  70. package/dist/node_modules/@allyhub/sheet/dist/annotations.js +2 -0
  71. package/dist/node_modules/@allyhub/sheet/dist/api/capabilities.js +1 -1
  72. package/dist/node_modules/@allyhub/sheet/dist/api/index.d.ts +1 -1
  73. package/dist/node_modules/@allyhub/sheet/dist/api/index.js +1 -1
  74. package/dist/node_modules/@allyhub/sheet/dist/api/rules.d.ts +24 -0
  75. package/dist/node_modules/@allyhub/sheet/dist/api/rules.js +1 -1
  76. package/dist/node_modules/@allyhub/sheet/dist/api/styles.d.ts +12 -0
  77. package/dist/node_modules/@allyhub/sheet/dist/api/styles.js +1 -1
  78. package/dist/node_modules/@allyhub/sheet/dist/api/workbook.d.ts +3 -1
  79. package/dist/node_modules/@allyhub/sheet/dist/api/workbook.js +1 -1
  80. package/dist/node_modules/@allyhub/sheet/dist/arrange.d.ts +28 -1
  81. package/dist/node_modules/@allyhub/sheet/dist/arrange.js +1 -1
  82. package/dist/node_modules/@allyhub/sheet/dist/data-tools.d.ts +42 -0
  83. package/dist/node_modules/@allyhub/sheet/dist/data-tools.js +2 -0
  84. package/dist/node_modules/@allyhub/sheet/dist/edit.d.ts +43 -2
  85. package/dist/node_modules/@allyhub/sheet/dist/edit.js +1 -1
  86. package/dist/node_modules/@allyhub/sheet/dist/fill.d.ts +10 -0
  87. package/dist/node_modules/@allyhub/sheet/dist/fill.js +1 -1
  88. package/dist/node_modules/@allyhub/sheet/dist/filter.js +1 -1
  89. package/dist/node_modules/@allyhub/sheet/dist/formula/rewrite.d.ts +14 -0
  90. package/dist/node_modules/@allyhub/sheet/dist/formula/rewrite.js +1 -1
  91. package/dist/node_modules/@allyhub/sheet/dist/html.js +10 -10
  92. package/dist/node_modules/@allyhub/sheet/dist/index.d.ts +6 -1
  93. package/dist/node_modules/@allyhub/sheet/dist/index.js +1 -1
  94. package/dist/node_modules/@allyhub/sheet/dist/outline.d.ts +30 -0
  95. package/dist/node_modules/@allyhub/sheet/dist/outline.js +2 -0
  96. package/dist/node_modules/@allyhub/sheet/dist/rich.d.ts +29 -0
  97. package/dist/node_modules/@allyhub/sheet/dist/rich.js +2 -0
  98. package/dist/node_modules/@allyhub/sheet/dist/rules.js +1 -1
  99. package/dist/node_modules/@allyhub/sheet/dist/table-style.d.ts +6 -0
  100. package/dist/node_modules/@allyhub/sheet/dist/table-style.js +1 -1
  101. package/dist/node_modules/@allyhub/sheet/dist/table-styles.js +1 -1
  102. package/dist/node_modules/@allyhub/sheet/dist/workbook.d.ts +5 -1
  103. package/dist/node_modules/@allyhub/sheet/dist/workbook.js +1 -1
  104. package/dist/node_modules/@allyhub/sheet/dist/xlsx/charts.js +1 -1
  105. package/dist/node_modules/@allyhub/sheet/dist/xlsx/import.js +1 -1
  106. package/dist/node_modules/@allyhub/sheet/dist/xlsx/read.d.ts +17 -1
  107. package/dist/node_modules/@allyhub/sheet/dist/xlsx/read.js +2 -2
  108. package/dist/node_modules/@allyhub/sheet/dist/xlsx/runs.d.ts +56 -0
  109. package/dist/node_modules/@allyhub/sheet/dist/xlsx/runs.js +2 -0
  110. package/dist/node_modules/@allyhub/sheet/dist/xlsx/styles.d.ts +6 -0
  111. package/dist/node_modules/@allyhub/sheet/dist/xlsx/styles.js +1 -1
  112. package/dist/node_modules/@allyhub/sheet/dist/xlsx/write.js +1 -1
  113. package/dist/node_modules/@allyhub/sheet/package.json +1 -1
  114. package/dist/node_modules/@allyhub/slides-core/dist/animation.d.ts +117 -21
  115. package/dist/node_modules/@allyhub/slides-core/dist/animation.js +1 -1
  116. package/dist/node_modules/@allyhub/slides-core/dist/api.d.ts +181 -30
  117. package/dist/node_modules/@allyhub/slides-core/dist/api.js +3 -3
  118. package/dist/node_modules/@allyhub/slides-core/dist/capabilities.js +1 -1
  119. package/dist/node_modules/@allyhub/slides-core/dist/chart-api.d.ts +28 -2
  120. package/dist/node_modules/@allyhub/slides-core/dist/chart-api.js +1 -1
  121. package/dist/node_modules/@allyhub/slides-core/dist/check.js +1 -1
  122. package/dist/node_modules/@allyhub/slides-core/dist/enums.d.ts +222 -4
  123. package/dist/node_modules/@allyhub/slides-core/dist/enums.js +1 -1
  124. package/dist/node_modules/@allyhub/slides-core/dist/file.d.ts +6 -0
  125. package/dist/node_modules/@allyhub/slides-core/dist/file.js +3 -3
  126. package/dist/node_modules/@allyhub/slides-core/dist/generated/table-styles.d.ts +3 -0
  127. package/dist/node_modules/@allyhub/slides-core/dist/generated/table-styles.js +2 -0
  128. package/dist/node_modules/@allyhub/slides-core/dist/index.d.ts +3 -0
  129. package/dist/node_modules/@allyhub/slides-core/dist/index.js +1 -1
  130. package/dist/node_modules/@allyhub/slides-core/dist/merge.js +1 -1
  131. package/dist/node_modules/@allyhub/slides-core/dist/model.d.ts +98 -10
  132. package/dist/node_modules/@allyhub/slides-core/dist/numbering.d.ts +6 -0
  133. package/dist/node_modules/@allyhub/slides-core/dist/numbering.js +2 -0
  134. package/dist/node_modules/@allyhub/slides-core/dist/office.d.ts +53 -0
  135. package/dist/node_modules/@allyhub/slides-core/dist/office.js +1 -1
  136. package/dist/node_modules/@allyhub/slides-core/dist/patterns.d.ts +8 -0
  137. package/dist/node_modules/@allyhub/slides-core/dist/patterns.js +2 -0
  138. package/dist/node_modules/@allyhub/slides-core/dist/resolve.d.ts +36 -6
  139. package/dist/node_modules/@allyhub/slides-core/dist/resolve.js +1 -1
  140. package/dist/node_modules/@allyhub/slides-core/dist/script.d.ts +11 -0
  141. package/dist/node_modules/@allyhub/slides-core/dist/script.js +2 -2
  142. package/dist/node_modules/@allyhub/slides-core/dist/sdk.d.ts +1 -1
  143. package/dist/node_modules/@allyhub/slides-core/dist/sdk.js +1 -1
  144. package/dist/node_modules/@allyhub/slides-core/dist/table-style.d.ts +48 -0
  145. package/dist/node_modules/@allyhub/slides-core/dist/table-style.js +2 -0
  146. package/dist/node_modules/@allyhub/slides-core/package.json +1 -1
  147. package/dist/node_modules/@allyhub/video-core/dist/mix-plan.js +1 -1
  148. package/dist/node_modules/@allyhub/video-core/dist/timeline.d.ts +4 -0
  149. package/dist/node_modules/@allyhub/video-core/package.json +1 -1
  150. package/dist/node_modules/@allyhub/video-sdk/package.json +1 -1
  151. package/docs/defaults.md +78 -4
  152. package/docs/image.md +1 -1
  153. package/docs/pictures.md +1 -1
  154. package/docs/project.md +1 -1
  155. package/docs/sheets.md +19 -9
  156. package/docs/slides.md +30 -16
  157. package/docs/speech.md +1 -1
  158. package/package.json +1 -1
@@ -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{SCRIPT_NAME as g}from"./script.js";const s=o.string().regex(g,"A name is letters, digits, _ and -.");export const THEME_COLORS=["dk1","lt1","dk2","lt2","accent1","accent2","accent3","accent4","accent5","accent6","hlink","folHlink"],TEXT_ALIGNS=["l","ctr","r","just"],SHAPE_GEOMETRIES=["line","lineInv","triangle","rtTriangle","rect","diamond","parallelogram","trapezoid","nonIsoscelesTrapezoid","pentagon","hexagon","heptagon","octagon","decagon","dodecagon","star4","star5","star6","star7","star8","star10","star12","star16","star24","star32","roundRect","round1Rect","round2SameRect","round2DiagRect","snipRoundRect","snip1Rect","snip2SameRect","snip2DiagRect","plaque","ellipse","teardrop","homePlate","chevron","pieWedge","pie","blockArc","donut","noSmoking","rightArrow","leftArrow","upArrow","downArrow","stripedRightArrow","notchedRightArrow","bentUpArrow","leftRightArrow","upDownArrow","leftUpArrow","leftRightUpArrow","quadArrow","leftArrowCallout","rightArrowCallout","upArrowCallout","downArrowCallout","leftRightArrowCallout","upDownArrowCallout","quadArrowCallout","bentArrow","uturnArrow","circularArrow","leftCircularArrow","leftRightCircularArrow","curvedRightArrow","curvedLeftArrow","curvedUpArrow","curvedDownArrow","swooshArrow","cube","can","lightningBolt","heart","sun","moon","smileyFace","irregularSeal1","irregularSeal2","foldedCorner","bevel","frame","halfFrame","corner","diagStripe","chord","arc","leftBracket","rightBracket","leftBrace","rightBrace","bracketPair","bracePair","straightConnector1","bentConnector2","bentConnector3","bentConnector4","bentConnector5","curvedConnector2","curvedConnector3","curvedConnector4","curvedConnector5","callout1","callout2","callout3","accentCallout1","accentCallout2","accentCallout3","borderCallout1","borderCallout2","borderCallout3","accentBorderCallout1","accentBorderCallout2","accentBorderCallout3","wedgeRectCallout","wedgeRoundRectCallout","wedgeEllipseCallout","cloudCallout","cloud","ribbon","ribbon2","ellipseRibbon","ellipseRibbon2","leftRightRibbon","verticalScroll","horizontalScroll","wave","doubleWave","plus","flowChartProcess","flowChartDecision","flowChartInputOutput","flowChartPredefinedProcess","flowChartInternalStorage","flowChartDocument","flowChartMultidocument","flowChartTerminator","flowChartPreparation","flowChartManualInput","flowChartManualOperation","flowChartConnector","flowChartPunchedCard","flowChartPunchedTape","flowChartSummingJunction","flowChartOr","flowChartCollate","flowChartSort","flowChartExtract","flowChartMerge","flowChartOfflineStorage","flowChartOnlineStorage","flowChartMagneticTape","flowChartMagneticDisk","flowChartMagneticDrum","flowChartDisplay","flowChartDelay","flowChartAlternateProcess","flowChartOffpageConnector","actionButtonBlank","actionButtonHome","actionButtonHelp","actionButtonInformation","actionButtonForwardNext","actionButtonBackPrevious","actionButtonEnd","actionButtonBeginning","actionButtonReturn","actionButtonDocument","actionButtonSound","actionButtonMovie","gear6","gear9","funnel","mathPlus","mathMinus","mathMultiply","mathDivide","mathEqual","mathNotEqual","cornerTabs","squareTabs","plaqueTabs","chartX","chartStar","chartPlus"],ANIMATION_EFFECTS=["appear","fade","wipe","fly-in","zoom","disappear","fade-out","wipe-out","fly-out","zoom-out","pulse","path"],ANIMATION_STARTS=["on-click","with-previous","after-previous"],ANIMATION_DIRECTIONS=["from-bottom","from-top","from-left","from-right"],LINE_DASHES=["solid","sysDash","sysDot","dash","dashDot","lgDash","lgDashDot","lgDashDotDot"],LINE_ENDS=["none","triangle","arrow","stealth","diamond","oval"],ARROW_SIZES=["sm","med","lg"],LineEndSizeSchema=o.strictObject({w:o.enum(ARROW_SIZES).optional(),len:o.enum(ARROW_SIZES).optional()}),FrameSchema=o.strictObject({x:o.number(),y:o.number(),w:o.number().nonnegative(),h:o.number().nonnegative()});const b=new RegExp(`^(${THEME_COLORS.join("|")}) (lighter|darker) (100(?:\\.0{1,3})?|[1-9]?\\d(?:\\.\\d{1,3})?)%$`,"u"),f=/^#[0-9A-Fa-f]{6}$/u,w=t=>THEME_COLORS.includes(t);export function colorOfFile(t){if(w(t))return t;if(f.test(t))return{rgb:t.toUpperCase()};const n=b.exec(t),[,i="",e,a=""]=n??[],l=Math.round(Number(a)*1e3);if(!(!n||!w(i)||l<=0||l>1e5))return{theme_color:i,brightness:(e==="lighter"?l:-l)/1e5}}export function colorFile(t){if(typeof t=="string")return t;if("rgb"in t)return t.rgb;const n=Math.round(Math.abs(t.brightness)*1e5)/1e3;return n===0?t.theme_color:`${t.theme_color} ${t.brightness>0?"lighter":"darker"} ${String(n)}%`}const m=`A colour is one of the theme's (${THEME_COLORS.join(", ")}), one of them lighter or darker by a share over 0 up to 100% ("accent1 lighter 40%", "dk1 darker 25%"), or #RRGGBB.`;export const ColorFileSchema=o.union([o.enum(THEME_COLORS),o.string().regex(b,m),o.string().regex(f,m)]).refine(t=>colorOfFile(t)!==void 0,m),NUMBERINGS=["arabicPeriod","arabicParenR","alphaLcPeriod","alphaUcPeriod","romanLcPeriod","romanUcPeriod"],TEXT_ANCHORS=["t","ctr","b"],TextStyleSchema=o.strictObject({size:o.number().positive().max(4e3).optional(),bold:o.boolean().optional(),italic:o.boolean().optional(),underline:o.boolean().optional(),strike:o.boolean().optional(),color:ColorFileSchema.optional(),font:o.string().min(1).optional(),align:o.enum(TEXT_ALIGNS).optional(),line_spacing:o.number().positive().max(10).optional(),space_before:o.number().min(0).max(1584).optional(),space_after:o.number().min(0).max(1584).optional(),anchor:o.enum(TEXT_ANCHORS).optional(),bullet:o.union([o.literal(!1),o.string().min(1).max(2)]).optional(),numbered:o.enum(NUMBERINGS).optional()});const A=o.strictObject({left:o.number().lt(1).optional(),top:o.number().lt(1).optional(),right:o.number().lt(1).optional(),bottom:o.number().lt(1).optional()}).refine(t=>(t.left??0)+(t.right??0)<1,{message:"left and right together cut the whole picture away"}).refine(t=>(t.top??0)+(t.bottom??0)<1,{message:"top and bottom together cut the whole picture away"}),d=o.lazy(()=>o.union([o.string(),o.number(),o.boolean(),o.null(),o.array(d),o.record(o.string(),d)]));export const CHART_TYPES=["column-clustered","column-stacked","column-stacked-100","bar-clustered","bar-stacked","bar-stacked-100","line","line-markers","area","area-stacked","area-stacked-100","pie","doughnut"],SHEET_CHART_TYPES=[...CHART_TYPES,"scatter","scatter-lines","scatter-smooth"],CHART_LEGEND_POSITIONS=["bottom","top","left","right"];const C=o.strictObject({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(),gridline_color:ColorFileSchema.optional(),line_color:ColorFileSchema.optional()});export const ChartSchema=o.strictObject({type:o.enum(SHEET_CHART_TYPES),data:o.string().min(1).optional(),categories:o.union([o.string().min(1),o.array(o.string())]).optional(),series:o.array(o.union([o.string().min(1),o.strictObject({name:o.string().min(1),values:o.array(o.number().nullable()).optional(),x:o.array(o.number().nullable()).optional(),color:ColorFileSchema.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()})])).min(1),legend:o.enum(CHART_LEGEND_POSITIONS).optional(),labels:o.union([o.boolean(),o.strictObject({value:o.boolean().optional(),percentage:o.boolean().optional(),category:o.boolean().optional(),series:o.boolean().optional(),format:o.string().min(1).optional(),position:o.enum(["outEnd","inEnd","ctr","inBase","t","b","l","r","bestFit"]).optional(),size:o.number().positive().optional(),color:ColorFileSchema.optional()})]).optional(),gap_width:o.number().min(0).max(500).optional(),overlap:o.number().min(-100).max(100).optional(),vary_by_categories:o.boolean().optional(),category_colors:o.array(ColorFileSchema).min(1).optional(),hole_size:o.number().min(10).max(90).optional(),value_axis:C.optional(),category_axis:C.optional(),size:o.number().positive().optional(),title_size:o.number().positive().optional(),color:ColorFileSchema.optional()});const c=o.number().min(0).max(1);export const GradientSchema=o.strictObject({angle:o.number().min(0).max(360).optional(),stops:o.array(o.strictObject({at:c,color:ColorFileSchema,transparency:c.optional()})).min(2).max(10)}),BackgroundSchema=o.strictObject({fill:ColorFileSchema.optional(),gradient:GradientSchema.optional(),picture:o.string().min(1).optional()}).refine(t=>[t.fill,t.gradient,t.picture].filter(n=>n!==void 0).length===1,{message:"A background is a fill, a gradient or a picture: one of them."}),ShadowSchema=o.strictObject({color:ColorFileSchema.optional(),blur:o.number().min(0).max(100).optional(),distance:o.number().min(0).max(200).optional(),angle:o.number().min(0).max(360).optional(),transparency:c.optional()});const S=o.union([o.strictObject({shape:o.string().min(1),site:o.int().min(0)}),o.literal("none")]);export const ShapeSchema=o.strictObject({frame:FrameSchema.optional(),rotation:o.number().min(0).lt(360).optional(),flip_h:o.literal(!0).optional(),flip_v:o.literal(!0).optional(),connect:o.strictObject({begin:S.optional(),end:S.optional()}).optional(),z:o.int().optional(),fill:o.union([ColorFileSchema,o.literal("none")]).optional(),fill_transparency:c.optional(),gradient:GradientSchema.optional(),shadow:ShadowSchema.optional(),line:o.union([ColorFileSchema,o.literal("none")]).optional(),line_width:o.number().positive().max(1584).optional(),line_dash:o.enum(LINE_DASHES).optional(),line_begin:o.enum(LINE_ENDS).optional(),line_end:o.enum(LINE_ENDS).optional(),line_begin_size:LineEndSizeSchema.optional(),line_end_size:LineEndSizeSchema.optional(),text:TextStyleSchema.optional(),textbox:o.literal(!0).optional(),picture:o.string().min(1).optional(),crop:A.optional(),movie:o.string().min(1).optional(),poster:o.number().min(0).optional(),geometry:o.enum(SHAPE_GEOMETRIES).optional(),adjustments:o.array(o.number()).max(8).optional(),path:o.strictObject({w:o.number().positive(),h:o.number().positive(),d:o.string().min(1)}).optional(),table:o.strictObject({columns:o.array(o.number().positive()).min(1),rows:o.array(o.strictObject({height:o.number().positive(),fill:ColorFileSchema.optional(),text:TextStyleSchema.optional(),line:ColorFileSchema.optional()})).min(1)}).optional(),chart:ChartSchema.optional(),group:s.optional(),locked:o.literal(!0).optional(),component:o.union([s,o.string().regex(/^[^#\s]+\.[cm]?[jt]sx?(?:#[A-Za-z_$][\w$]*)?$/u,"A component is a name the deck's module registers, or a module's path and export: ../ui.ts#Dialog.")]).optional(),props:o.record(o.string(),d).optional(),dur:o.number().positive().optional()}),SHAPE_KINDS=["textbox","picture","movie","geometry","path","table","chart","component"],SLIDE_TRANSITIONS=["fade","push","wipe","morph"],TransitionSchema=o.strictObject({type:o.enum(SLIDE_TRANSITIONS),direction:o.enum(ANIMATION_DIRECTIONS).optional(),duration:o.number().positive().optional()}),AnimationSchema=o.strictObject({shape:o.string().min(1),paragraph:o.int().min(0).optional(),effect:o.enum(ANIMATION_EFFECTS),direction:o.enum(ANIMATION_DIRECTIONS).optional(),start:o.enum(ANIMATION_STARTS).optional(),duration:o.number().min(0).optional(),delay:o.number().min(0).optional(),path:o.string().min(1).optional()}),SlideSchema=o.strictObject({id:s,layout:o.string().min(1).optional(),generate:s.optional(),hidden:o.union([o.literal(!0),o.array(o.string())]).optional(),shapes:o.record(o.string().min(1),ShapeSchema).optional(),animations:o.array(AnimationSchema).optional(),transition:TransitionSchema.optional(),advance_after:o.number().min(0).max(86400).optional(),background:BackgroundSchema.optional()}),SlidesFileSchema=o.strictObject({slides:o.array(SlideSchema).default([])}).superRefine((t,n)=>{const i=new Set;t.slides.forEach((e,a)=>{i.has(e.id)&&n.addIssue({code:"custom",path:["slides",a,"id"],message:`Two slides are "${e.id}".`}),i.add(e.id),(e.layout===void 0?0:1)+(e.generate===void 0?0:1)!==1&&n.addIssue({code:"custom",path:["slides",a],message:`Slide ${e.id} has a layout or a generator: one of them.`}),e.hidden!==void 0&&e.generate===void 0&&e.hidden!==!0&&n.addIssue({code:"custom",path:["slides",a,"hidden"],message:`Slide ${e.id} is hidden (true); a list of ids is a generated block's.`});for(const[r,x]of Object.entries(e.shapes??{})){const h=SHAPE_KINDS.filter(u=>x[u]!==void 0);h.length>1&&n.addIssue({code:"custom",path:["slides",a,"shapes",r],message:`Shape ${r} is one kind of shape, not ${h.join(" and ")}.`});const p=r.includes("/")?r.split("/"):[r];(!(p.length<=2&&p.every(u=>g.test(u)))||p.length===2&&e.generate===void 0)&&n.addIssue({code:"custom",path:["slides",a,"shapes",r],message:"A shape's name is letters, digits, _ and -; <slide>/<shape> only in a generated block."})}})});
2
+ import{z as o}from"zod";import{SCRIPT_NAME as _}from"./script.js";const h=o.string().regex(_,"A name is letters, digits, _ and -.");export const THEME_COLORS=["dk1","lt1","dk2","lt2","accent1","accent2","accent3","accent4","accent5","accent6","hlink","folHlink"],TEXT_ALIGNS=["l","ctr","r","just"],SHAPE_GEOMETRIES=["line","lineInv","triangle","rtTriangle","rect","diamond","parallelogram","trapezoid","nonIsoscelesTrapezoid","pentagon","hexagon","heptagon","octagon","decagon","dodecagon","star4","star5","star6","star7","star8","star10","star12","star16","star24","star32","roundRect","round1Rect","round2SameRect","round2DiagRect","snipRoundRect","snip1Rect","snip2SameRect","snip2DiagRect","plaque","ellipse","teardrop","homePlate","chevron","pieWedge","pie","blockArc","donut","noSmoking","rightArrow","leftArrow","upArrow","downArrow","stripedRightArrow","notchedRightArrow","bentUpArrow","leftRightArrow","upDownArrow","leftUpArrow","leftRightUpArrow","quadArrow","leftArrowCallout","rightArrowCallout","upArrowCallout","downArrowCallout","leftRightArrowCallout","upDownArrowCallout","quadArrowCallout","bentArrow","uturnArrow","circularArrow","leftCircularArrow","leftRightCircularArrow","curvedRightArrow","curvedLeftArrow","curvedUpArrow","curvedDownArrow","swooshArrow","cube","can","lightningBolt","heart","sun","moon","smileyFace","irregularSeal1","irregularSeal2","foldedCorner","bevel","frame","halfFrame","corner","diagStripe","chord","arc","leftBracket","rightBracket","leftBrace","rightBrace","bracketPair","bracePair","straightConnector1","bentConnector2","bentConnector3","bentConnector4","bentConnector5","curvedConnector2","curvedConnector3","curvedConnector4","curvedConnector5","callout1","callout2","callout3","accentCallout1","accentCallout2","accentCallout3","borderCallout1","borderCallout2","borderCallout3","accentBorderCallout1","accentBorderCallout2","accentBorderCallout3","wedgeRectCallout","wedgeRoundRectCallout","wedgeEllipseCallout","cloudCallout","cloud","ribbon","ribbon2","ellipseRibbon","ellipseRibbon2","leftRightRibbon","verticalScroll","horizontalScroll","wave","doubleWave","plus","flowChartProcess","flowChartDecision","flowChartInputOutput","flowChartPredefinedProcess","flowChartInternalStorage","flowChartDocument","flowChartMultidocument","flowChartTerminator","flowChartPreparation","flowChartManualInput","flowChartManualOperation","flowChartConnector","flowChartPunchedCard","flowChartPunchedTape","flowChartSummingJunction","flowChartOr","flowChartCollate","flowChartSort","flowChartExtract","flowChartMerge","flowChartOfflineStorage","flowChartOnlineStorage","flowChartMagneticTape","flowChartMagneticDisk","flowChartMagneticDrum","flowChartDisplay","flowChartDelay","flowChartAlternateProcess","flowChartOffpageConnector","actionButtonBlank","actionButtonHome","actionButtonHelp","actionButtonInformation","actionButtonForwardNext","actionButtonBackPrevious","actionButtonEnd","actionButtonBeginning","actionButtonReturn","actionButtonDocument","actionButtonSound","actionButtonMovie","gear6","gear9","funnel","mathPlus","mathMinus","mathMultiply","mathDivide","mathEqual","mathNotEqual","cornerTabs","squareTabs","plaqueTabs","chartX","chartStar","chartPlus"],ANIMATION_EFFECTS=["appear","fade","fly-in","float-in","split","wipe","zoom","disappear","fade-out","fly-out","float-out","split-out","wipe-out","zoom-out","pulse","grow-shrink","spin","transparency","path"],ANIMATE_TEXT=["word","letter"],ANIMATION_REPEATS=["until-next-click","until-end-of-slide"],ANIMATION_STARTS=["on-click","with-previous","after-previous"],ANIMATION_DIRECTIONS=["from-bottom","from-top","from-left","from-right","from-top-right","from-bottom-right","from-top-left","from-bottom-left","vertical-out","vertical-in","horizontal-out","horizontal-in","in","out","rotate","up","down","clockwise","counterclockwise","both","horizontal","vertical"],LINE_DASHES=["solid","sysDot","sysDash","dash","dashDot","lgDash","lgDashDot","lgDashDotDot","dot","sysDashDot","sysDashDotDot"],LINE_CAPS=["flat","rnd","sq"],LINE_JOINS=["round","bevel","miter"],LINE_COMPOUNDS=["sng","dbl","thickThin","thinThick","tri"],LINE_ENDS=["none","triangle","arrow","stealth","diamond","oval"],ARROW_SIZES=["sm","med","lg"],LineEndSizeSchema=o.strictObject({w:o.enum(ARROW_SIZES).optional(),len:o.enum(ARROW_SIZES).optional()}),FrameSchema=o.strictObject({x:o.number(),y:o.number(),w:o.number().nonnegative(),h:o.number().nonnegative()}),MAPPED_COLORS=["tx1","bg1","tx2","bg2"],COLOR_NAMES=[...THEME_COLORS,...MAPPED_COLORS],COLOR_TRANSFORMS=["tint","shade","lumMod","lumOff","lum","satMod","satOff","sat","hueMod","hueOff","hue","alpha","alphaMod","alphaOff"];const C=`(?:${COLOR_NAMES.join("|")})`,k=`(?:${COLOR_TRANSFORMS.join("|")}) -?\\d+(?:\\.\\d+)?(?:%|°)`,A=new RegExp(`^(${C}) (lighter|darker) (100(?:\\.0{1,3})?|[1-9]?\\d(?:\\.\\d{1,3})?)%$`,"u"),v=new RegExp(`^(${C}|#[0-9A-Fa-f]{6})((?: ${k})+)$`,"u"),O=/^#[0-9A-Fa-f]{6}$/u,g=t=>COLOR_NAMES.includes(t),E=t=>COLOR_TRANSFORMS.includes(t),y=new Set(["hue","hueOff"]);export function colorOfFile(t){if(g(t))return t;if(O.test(t))return{rgb:t.toUpperCase()};const e=v.exec(t);if(e){const[,l="",p=""]=e,m=[];for(const w of p.matchAll(/ (\w+) (-?[\d.]+)(%|°)/gu)){const[,u="",D="",x]=w;if(!E(u)||x==="°"!==y.has(u))return;const S=Number(D);m.push({name:u,value:x==="%"?Math.round(S*1e3)/1e5:S})}return g(l)?{theme_color:l,transforms:m}:{rgb:l.toUpperCase(),transforms:m}}const r=A.exec(t),[,n="",i,s=""]=r??[],a=Math.round(Number(s)*1e3);if(!(!r||!g(n)||a<=0||a>1e5))return{theme_color:n,brightness:(i==="lighter"?a:-a)/1e5}}const P=t=>y.has(t.name)?`${t.name} ${String(Math.round(t.value*1e3)/1e3)}°`:`${t.name} ${String(Math.round(t.value*1e5)/1e3)}%`;export function colorFile(t){if(typeof t=="string")return t;if("rgb"in t)return t.transforms&&t.transforms.length>0?`${t.rgb} ${t.transforms.map(P).join(" ")}`:t.rgb;if("transforms"in t)return t.transforms.length===0?t.theme_color:`${t.theme_color} ${t.transforms.map(P).join(" ")}`;const e=Math.round(Math.abs(t.brightness)*1e5)/1e3;return e===0?t.theme_color:`${t.theme_color} ${t.brightness>0?"lighter":"darker"} ${String(e)}%`}const d=`A colour is one of the theme's (${THEME_COLORS.join(", ")}) or the colour map's (${MAPPED_COLORS.join(", ")}), one of them lighter or darker by a share over 0 up to 100% ("accent1 lighter 40%", "dk1 darker 25%"), #RRGGBB, or one of them with DrawingML's transforms in order ("accent1 lumMod 75% lumOff 25%", "#4472C4 alpha 50%", "accent2 hueOff 30°": ${COLOR_TRANSFORMS.join(", ")}).`;export const ColorFileSchema=o.union([o.enum(COLOR_NAMES),o.string().regex(A,d),o.string().regex(O,d),o.string().regex(v,d)]).refine(t=>colorOfFile(t)!==void 0,d),NUMBERINGS=["alphaLcParenBoth","alphaUcParenBoth","alphaLcParenR","alphaUcParenR","alphaLcPeriod","alphaUcPeriod","arabicParenBoth","arabicParenR","arabicPeriod","arabicPlain","romanLcParenBoth","romanUcParenBoth","romanLcParenR","romanUcParenR","romanLcPeriod","romanUcPeriod","circleNumDbPlain","circleNumWdBlackPlain","circleNumWdWhitePlain","arabicDbPeriod","arabicDbPlain","ea1ChsPeriod","ea1ChsPlain","ea1ChtPeriod","ea1ChtPlain","ea1JpnChsDbPeriod","ea1JpnKorPlain","ea1JpnKorPeriod","arabic1Minus","arabic2Minus","hebrew2Minus","thaiAlphaPeriod","thaiAlphaParenR","thaiAlphaParenBoth","thaiNumPeriod","thaiNumParenR","thaiNumParenBoth","hindiAlphaPeriod","hindiNumPeriod","hindiNumParenR","hindiAlpha1Period"],UNDERLINES=["sng","dbl","heavy","dotted","dottedHeavy","dash","dashHeavy","dashLong","dashLongHeavy","dotDash","dotDashHeavy","dotDotDash","dotDotDashHeavy","wavy","wavyHeavy","wavyDbl","words"],STRIKES=["sngStrike","dblStrike"],CAPS=["all","small","none"],TEXT_ORIENTATIONS=["horz","vert","vert270","eaVert","wordArtVert","wordArtVertRtl","mongolianVert"],TEXT_ANCHORS=["t","ctr","b"],ParagraphSpaceSchema=o.union([o.number().min(0).max(1584),o.object({lines:o.number().min(0).max(100)})]),TextStyleSchema=o.strictObject({size:o.number().positive().max(4e3).optional(),bold:o.boolean().optional(),italic:o.boolean().optional(),underline:o.union([o.boolean(),o.enum(UNDERLINES)]).optional(),strike:o.union([o.boolean(),o.enum(STRIKES)]).optional(),caps:o.enum(CAPS).optional(),color:ColorFileSchema.optional(),font:o.string().min(1).optional(),align:o.enum(TEXT_ALIGNS).optional(),line_spacing:o.number().positive().max(10).optional(),space_before:ParagraphSpaceSchema.optional(),space_after:ParagraphSpaceSchema.optional(),anchor:o.enum(TEXT_ANCHORS).optional(),orientation:o.enum(TEXT_ORIENTATIONS).optional(),bullet:o.union([o.literal(!1),o.string().min(1).max(2)]).optional(),numbered:o.enum(NUMBERINGS).optional(),bullet_color:ColorFileSchema.optional(),bullet_size:o.number().min(.25).max(4).optional(),start_at:o.int().min(1).max(32767).optional()});const T=o.strictObject({left:o.number().lt(1).optional(),top:o.number().lt(1).optional(),right:o.number().lt(1).optional(),bottom:o.number().lt(1).optional()}).refine(t=>(t.left??0)+(t.right??0)<1,{message:"left and right together cut the whole picture away"}).refine(t=>(t.top??0)+(t.bottom??0)<1,{message:"top and bottom together cut the whole picture away"}),b=o.lazy(()=>o.union([o.string(),o.number(),o.boolean(),o.null(),o.array(b),o.record(o.string(),b)]));export const CHART_TYPES=["column-clustered","column-stacked","column-stacked-100","bar-clustered","bar-stacked","bar-stacked-100","line","line-markers","area","area-stacked","area-stacked-100","pie","doughnut"],SHEET_CHART_TYPES=[...CHART_TYPES,"scatter","scatter-lines","scatter-smooth"],CHART_LEGEND_POSITIONS=["bottom","top","left","right"],CHART_COMBINED_TYPES=["column-clustered","column-stacked","column-stacked-100","line","line-markers","area","area-stacked","area-stacked-100"];const f=o.strictObject({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(),gridline_color:ColorFileSchema.optional(),line_color:ColorFileSchema.optional()});export const ChartSchema=o.strictObject({type:o.enum(SHEET_CHART_TYPES),data:o.string().min(1).optional(),categories:o.union([o.string().min(1),o.array(o.string())]).optional(),series:o.array(o.union([o.string().min(1),o.strictObject({name:o.string().min(1),values:o.array(o.number().nullable()).optional(),x:o.array(o.number().nullable()).optional(),color:ColorFileSchema.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(),type:o.enum(CHART_COMBINED_TYPES).optional(),secondary:o.boolean().optional()})])).min(1),legend:o.enum(CHART_LEGEND_POSITIONS).optional(),labels:o.union([o.boolean(),o.strictObject({value:o.boolean().optional(),percentage:o.boolean().optional(),category:o.boolean().optional(),series:o.boolean().optional(),format:o.string().min(1).optional(),position:o.enum(["outEnd","inEnd","ctr","inBase","t","b","l","r","bestFit"]).optional(),size:o.number().positive().optional(),color:ColorFileSchema.optional()})]).optional(),gap_width:o.number().min(0).max(500).optional(),overlap:o.number().min(-100).max(100).optional(),vary_by_categories:o.boolean().optional(),category_colors:o.array(ColorFileSchema).min(1).optional(),hole_size:o.number().min(10).max(90).optional(),value_axis:f.optional(),category_axis:f.optional(),secondary_axis:f.optional(),size:o.number().positive().optional(),title_size:o.number().positive().optional(),color:ColorFileSchema.optional()});const c=o.number().min(0).max(1);export const GRADIENT_PATHS=["circle","rect","shape"],GradientSchema=o.strictObject({angle:o.number().min(0).max(360).optional(),path:o.enum(GRADIENT_PATHS).optional(),focus:o.strictObject({left:o.number().optional(),top:o.number().optional(),right:o.number().optional(),bottom:o.number().optional()}).optional(),stops:o.array(o.strictObject({at:c,color:ColorFileSchema,transparency:c.optional()})).min(2).max(10)}),PATTERNS=["pct5","pct10","pct20","pct25","pct30","pct40","pct50","pct60","pct70","pct75","pct80","pct90","horz","vert","ltHorz","ltVert","dkHorz","dkVert","narHorz","narVert","dashHorz","dashVert","cross","dnDiag","upDiag","ltDnDiag","ltUpDiag","dkDnDiag","dkUpDiag","wdDnDiag","wdUpDiag","dashDnDiag","dashUpDiag","diagCross","smCheck","lgCheck","smGrid","lgGrid","dotGrid","smConfetti","lgConfetti","horzBrick","diagBrick","solidDmnd","openDmnd","dotDmnd","plaid","sphere","weave","divot","shingle","wave","trellis","zigZag"],PatternSchema=o.strictObject({preset:o.enum(PATTERNS),fg:ColorFileSchema.optional(),bg:ColorFileSchema.optional()}),TILE_ALIGNMENTS=["tl","t","tr","l","ctr","r","bl","b","br"],PictureFillSchema=o.strictObject({path:o.string().min(1),tile:o.strictObject({scale_x:o.number().positive().max(100).optional(),scale_y:o.number().positive().max(100).optional(),x:o.number().optional(),y:o.number().optional(),align:o.enum(TILE_ALIGNMENTS).optional()}).optional(),transparency:c.optional()}),BackgroundSchema=o.strictObject({fill:ColorFileSchema.optional(),gradient:GradientSchema.optional(),picture:o.string().min(1).optional()}).refine(t=>[t.fill,t.gradient,t.picture].filter(e=>e!==void 0).length===1,{message:"A background is a fill, a gradient or a picture: one of them."}),ShadowSchema=o.strictObject({color:ColorFileSchema.optional(),blur:o.number().min(0).max(100).optional(),distance:o.number().min(0).max(200).optional(),angle:o.number().min(0).max(360).optional(),transparency:c.optional()}),InnerShadowSchema=o.strictObject({color:ColorFileSchema.optional(),blur:o.number().min(0).max(100).optional(),distance:o.number().min(0).max(200).optional(),angle:o.number().min(0).max(360).optional(),transparency:c.optional()}),GlowSchema=o.strictObject({color:ColorFileSchema.optional(),size:o.number().min(0).max(150).optional(),transparency:c.optional()}),ReflectionSchema=o.strictObject({transparency:c.optional(),size:c.optional(),distance:o.number().min(0).max(100).optional(),blur:o.number().min(0).max(100).optional()});const R=o.union([o.strictObject({shape:o.string().min(1),site:o.int().min(0)}),o.literal("none")]);export const MergedCellsSchema=o.object({row:o.int().min(0),column:o.int().min(0),rows:o.int().min(1).optional(),columns:o.int().min(1).optional()});function N(t,e,r,n){const i=t.rows??1,s=t.columns??1;if(i*s<2)return"A merge takes two cells or more.";if(t.row+i>e||t.column+s>r)return`A merge from row ${String(t.row)}, column ${String(t.column)} goes past the table's ${String(e)} rows and ${String(r)} columns.`;for(let a=t.row;a<t.row+i;a++)for(let l=t.column;l<t.column+s;l++){const p=`${String(a)},${String(l)}`;if(n.has(p))return`Two merges take the cell at row ${String(a)}, column ${String(l)}.`;n.add(p)}}export const MEDIA_STARTS=["auto","on-click"],PlaybackSchema=o.strictObject({start:o.enum(MEDIA_STARTS).optional(),trim:o.strictObject({start:o.number().min(0).optional(),end:o.number().positive().optional()}).refine(t=>t.start===void 0||t.end===void 0||t.end>t.start,{message:"A trim ends after it starts."}).optional(),loop:o.boolean().optional(),volume:o.number().min(0).max(1).optional(),fullscreen:o.boolean().optional(),hide:o.boolean().optional()}),ShapeSchema=o.strictObject({frame:FrameSchema.optional(),rotation:o.number().min(0).lt(360).optional(),flip_h:o.literal(!0).optional(),flip_v:o.literal(!0).optional(),connect:o.strictObject({begin:R.optional(),end:R.optional()}).optional(),z:o.int().optional(),fill:o.union([ColorFileSchema,o.literal("none")]).optional(),fill_transparency:c.optional(),gradient:GradientSchema.optional(),pattern:PatternSchema.optional(),picture_fill:PictureFillSchema.optional(),shadow:ShadowSchema.optional(),inner_shadow:InnerShadowSchema.optional(),glow:GlowSchema.optional(),soft_edges:o.number().positive().max(100).optional(),reflection:ReflectionSchema.optional(),line:o.union([ColorFileSchema,o.literal("none")]).optional(),line_width:o.number().positive().max(1584).optional(),line_dash:o.enum(LINE_DASHES).optional(),line_cap:o.enum(LINE_CAPS).optional(),line_join:o.enum(LINE_JOINS).optional(),line_compound:o.enum(LINE_COMPOUNDS).optional(),line_begin:o.enum(LINE_ENDS).optional(),line_end:o.enum(LINE_ENDS).optional(),line_begin_size:LineEndSizeSchema.optional(),line_end_size:LineEndSizeSchema.optional(),text:TextStyleSchema.optional(),textbox:o.literal(!0).optional(),picture:o.string().min(1).optional(),crop:T.optional(),movie:o.string().min(1).optional(),audio:o.string().min(1).optional(),poster:o.number().min(0).optional(),playback:PlaybackSchema.optional(),geometry:o.enum(SHAPE_GEOMETRIES).optional(),adjustments:o.array(o.number()).max(8).optional(),path:o.strictObject({w:o.number().positive(),h:o.number().positive(),d:o.string().min(1)}).optional(),table:o.strictObject({columns:o.array(o.number().positive()).min(1),rows:o.array(o.strictObject({height:o.number().positive(),fill:ColorFileSchema.optional(),text:TextStyleSchema.optional(),line:ColorFileSchema.optional()})).min(1),merged:o.array(MergedCellsSchema).optional(),style:o.string().min(1).optional(),first_row:o.boolean().optional(),last_row:o.boolean().optional(),first_col:o.boolean().optional(),last_col:o.boolean().optional(),horz_banding:o.boolean().optional(),vert_banding:o.boolean().optional()}).superRefine((t,e)=>{const r=new Set;(t.merged??[]).forEach((n,i)=>{const s=N(n,t.rows.length,t.columns.length,r);s!==void 0&&e.addIssue({code:"custom",path:["merged",i],message:s})})}).optional(),chart:ChartSchema.optional(),link:o.string().trim().min(1).optional(),group:o.string().regex(/^[A-Za-z0-9_-]+(?:\/[A-Za-z0-9_-]+)*$/u,"A group is a name of letters, digits, _ and -; a group in a group is outer/inner.").optional(),locked:o.literal(!0).optional(),component:o.union([h,o.string().regex(/^[^#\s]+\.[cm]?[jt]sx?(?:#[A-Za-z_$][\w$]*)?$/u,"A component is a name the deck's module registers, or a module's path and export: ../ui.ts#Dialog.")]).optional(),props:o.record(o.string(),b).optional(),dur:o.number().positive().optional()}),groupLevels=t=>t.split("/").map((e,r,n)=>n.slice(0,r+1).join("/")),inGroup=(t,e)=>t!==void 0&&(t===e||t.startsWith(`${e}/`)),SHOW_JUMPS=["firstslide","lastslide","nextslide","previousslide","endshow"],showJumpLink=t=>`ppaction://hlinkshowjump?jump=${t}`;export function showJumpOf(t){const e=/^ppaction:\/\/hlinkshowjump\?jump=([a-z]+)$/u.exec(t);return SHOW_JUMPS.find(r=>r===e?.[1])}export const slideLinkOf=t=>t.startsWith("#")&&t.length>1?t.slice(1):void 0,SHAPE_KINDS=["textbox","picture","movie","audio","geometry","path","table","chart","component"],SLIDE_TRANSITIONS=["fade","push","wipe","split","reveal","cut","cover","uncover","zoom","morph"],TransitionSchema=o.strictObject({type:o.enum(SLIDE_TRANSITIONS),direction:o.enum(ANIMATION_DIRECTIONS).optional(),through_black:o.literal(!0).optional(),duration:o.number().min(0).optional()}),AnimationSchema=o.strictObject({shape:o.string().min(1),paragraph:o.int().min(0).optional(),effect:o.enum(ANIMATION_EFFECTS),direction:o.enum(ANIMATION_DIRECTIONS).optional(),amount:o.number().positive().max(36e3).optional(),start:o.enum(ANIMATION_STARTS).optional(),duration:o.number().min(0).optional(),delay:o.number().min(0).optional(),path:o.string().min(1).optional(),animate_text:o.enum(ANIMATE_TEXT).optional(),text_delay:o.number().min(0).max(100).optional(),repeat:o.union([o.number().min(1).max(1e4),o.enum(ANIMATION_REPEATS)]).optional(),rewind:o.literal(!0).optional()}),SlideSchema=o.strictObject({id:h,layout:o.string().min(1).optional(),generate:h.optional(),hidden:o.union([o.literal(!0),o.array(o.string())]).optional(),shapes:o.record(o.string().min(1),ShapeSchema).optional(),animations:o.array(AnimationSchema).optional(),transition:TransitionSchema.optional(),advance_after:o.number().min(0).max(86400).optional(),background:BackgroundSchema.optional(),section:o.string().trim().min(1).max(255).optional()}),SlidesFileSchema=o.strictObject({slides:o.array(SlideSchema).default([])}).superRefine((t,e)=>{const r=new Set;t.slides.forEach((n,i)=>{r.has(n.id)&&e.addIssue({code:"custom",path:["slides",i,"id"],message:`Two slides are "${n.id}".`}),r.add(n.id),(n.layout===void 0?0:1)+(n.generate===void 0?0:1)!==1&&e.addIssue({code:"custom",path:["slides",i],message:`Slide ${n.id} has a layout or a generator: one of them.`}),n.hidden!==void 0&&n.generate===void 0&&n.hidden!==!0&&e.addIssue({code:"custom",path:["slides",i,"hidden"],message:`Slide ${n.id} is hidden (true); a list of ids is a generated block's.`});for(const[a,l]of Object.entries(n.shapes??{})){const p=SHAPE_KINDS.filter(u=>l[u]!==void 0);p.length>1&&e.addIssue({code:"custom",path:["slides",i,"shapes",a],message:`Shape ${a} is one kind of shape, not ${p.join(" and ")}.`});const m=a.includes("/")?a.split("/"):[a];(!(m.length<=2&&m.every(u=>_.test(u)))||m.length===2&&n.generate===void 0)&&e.addIssue({code:"custom",path:["slides",i,"shapes",a],message:"A shape's name is letters, digits, _ and -; <slide>/<shape> only in a generated block."})}})});