m0saic 0.3.0 → 0.3.2

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 (347) hide show
  1. package/dist/browseE2e.js +1 -1
  2. package/dist/connectionsFromEnv.js +1 -1
  3. package/dist/e2eTemplateVariants.js +1 -1
  4. package/dist/frontDoor.js +1 -1
  5. package/dist/index.js +1 -1
  6. package/dist/inlineDsl.js +1 -1
  7. package/dist/mcp/bridgeClient.js +1 -1
  8. package/dist/mcp/server.js +1 -1
  9. package/dist/mcp/tools.js +1 -1
  10. package/dist/mosaicxRunner.js +1 -1
  11. package/dist/outputPattern.js +1 -1
  12. package/dist/showcaseFeed.js +1 -1
  13. package/dist/templateDoctor.js +1 -1
  14. package/dist/utils/checkFeasibility.js +1 -1
  15. package/dist/utils/collectRenderErrors.js +1 -1
  16. package/dist/utils/enrichImageAlphaFromDoc.js +1 -1
  17. package/dist/utils/ensureFfmpeg.js +1 -1
  18. package/dist/utils/extractLayoutMeta.js +1 -1
  19. package/dist/utils/failureHints.js +1 -1
  20. package/dist/utils/ffmpegProbe.js +1 -1
  21. package/dist/utils/formatM0saicForCli.js +1 -1
  22. package/dist/utils/hashFile.js +1 -1
  23. package/dist/utils/helpGroups.js +1 -1
  24. package/dist/utils/installContext.js +1 -1
  25. package/dist/utils/invocation.js +1 -1
  26. package/dist/utils/licenseActivation.js +1 -1
  27. package/dist/utils/licenseActivationWorker.js +1 -1
  28. package/dist/utils/mosaicSpinner.js +1 -1
  29. package/dist/utils/parseDimensions.js +1 -1
  30. package/dist/utils/pathInfo.js +1 -1
  31. package/dist/utils/readJsonArg.js +1 -1
  32. package/dist/utils/renderOutcome.js +1 -1
  33. package/dist/utils/renderReport.js +1 -1
  34. package/dist/utils/renderSignals.js +1 -1
  35. package/dist/utils/renderWorkspace.js +1 -1
  36. package/dist/utils/reportOutputFormat.js +1 -1
  37. package/dist/utils/setupFfmpeg.js +1 -1
  38. package/dist/utils/telemetry.js +1 -1
  39. package/dist/utils/telemetryFlushWorker.js +1 -1
  40. package/dist/utils/telemetryUpstream.js +1 -1
  41. package/dist/utils/telemetryUsage.js +1 -1
  42. package/dist/utils/toolchainConfig.js +1 -1
  43. package/dist/utils/tutorialDuration.js +1 -1
  44. package/dist/utils/updateCheck.js +1 -1
  45. package/dist/utils/updateCheckWorker.js +1 -1
  46. package/dist/utils/validateSourceCounts.js +1 -1
  47. package/dist/utils/versions.js +1 -1
  48. package/dist/webCustomizeLink.js +1 -1
  49. package/node_modules/@m0saic/community-m/release.json +2 -2
  50. package/node_modules/@m0saic/core/dist/core/buildChildMosaicSource.js +1 -1
  51. package/node_modules/@m0saic/core/dist/core/buildChunkCommands.js +1 -1
  52. package/node_modules/@m0saic/core/dist/core/buildEncodeCommands.js +1 -1
  53. package/node_modules/@m0saic/core/dist/core/buildLavfiSource.js +1 -1
  54. package/node_modules/@m0saic/core/dist/core/buildMediaSource.js +1 -1
  55. package/node_modules/@m0saic/core/dist/core/buildMosaicNode.js +1 -1
  56. package/node_modules/@m0saic/core/dist/core/buildMosaicPlanFromFile.js +1 -1
  57. package/node_modules/@m0saic/core/dist/core/buildSvgTextSource.js +1 -1
  58. package/node_modules/@m0saic/core/dist/core/buildTextRenderCommand.js +1 -1
  59. package/node_modules/@m0saic/core/dist/core/collectRefTargets.js +1 -1
  60. package/node_modules/@m0saic/core/dist/core/index.js +1 -1
  61. package/node_modules/@m0saic/core/dist/core/maskCacheDir.js +1 -1
  62. package/node_modules/@m0saic/core/dist/core/maskWorkerBridge.js +1 -1
  63. package/node_modules/@m0saic/core/dist/core/playbackPlaySpeed.js +1 -1
  64. package/node_modules/@m0saic/core/dist/core/prepareProps.js +1 -1
  65. package/node_modules/@m0saic/core/dist/core/primaryOutput.js +1 -1
  66. package/node_modules/@m0saic/core/dist/core/rasterizeMaskPng.js +1 -1
  67. package/node_modules/@m0saic/core/dist/core/rasterizeSvgMediaPng.js +1 -1
  68. package/node_modules/@m0saic/core/dist/core/refTargetTap.js +1 -1
  69. package/node_modules/@m0saic/core/dist/core/resolveMasks.js +1 -1
  70. package/node_modules/@m0saic/core/dist/core/resolveMasksSync.js +1 -1
  71. package/node_modules/@m0saic/core/dist/core/resolveStrokeRingsSync.js +1 -1
  72. package/node_modules/@m0saic/core/dist/core/roundedRectMask.js +1 -1
  73. package/node_modules/@m0saic/core/dist/core/strokeRing.js +1 -1
  74. package/node_modules/@m0saic/core/dist/core/svgRaster.js +1 -1
  75. package/node_modules/@m0saic/core/dist/defaults.js +1 -1
  76. package/node_modules/@m0saic/core/dist/ffmpeg/backgroundImageInput.js +1 -1
  77. package/node_modules/@m0saic/core/dist/ffmpeg/bufferGuard.js +1 -1
  78. package/node_modules/@m0saic/core/dist/ffmpeg/ffmpegCommands.js +1 -1
  79. package/node_modules/@m0saic/core/dist/ffmpeg/filters/applyBackdropBlur.js +1 -1
  80. package/node_modules/@m0saic/core/dist/ffmpeg/filters/applyBlur.js +1 -1
  81. package/node_modules/@m0saic/core/dist/ffmpeg/filters/applyBorderRadius.js +1 -1
  82. package/node_modules/@m0saic/core/dist/ffmpeg/filters/applyCamera.js +1 -1
  83. package/node_modules/@m0saic/core/dist/ffmpeg/filters/applyChromaKey.js +1 -1
  84. package/node_modules/@m0saic/core/dist/ffmpeg/filters/applyFade.js +1 -1
  85. package/node_modules/@m0saic/core/dist/ffmpeg/filters/applyGrade.js +1 -1
  86. package/node_modules/@m0saic/core/dist/ffmpeg/filters/applyMask.js +1 -1
  87. package/node_modules/@m0saic/core/dist/ffmpeg/filters/applyNoise.js +1 -1
  88. package/node_modules/@m0saic/core/dist/ffmpeg/filters/applyPixelize.js +1 -1
  89. package/node_modules/@m0saic/core/dist/ffmpeg/filters/applyRotate.js +1 -1
  90. package/node_modules/@m0saic/core/dist/ffmpeg/filters/applyStroke.js +1 -1
  91. package/node_modules/@m0saic/core/dist/ffmpeg/filters/applyTileEffects.js +1 -1
  92. package/node_modules/@m0saic/core/dist/ffmpeg/filters/coverCrop.js +1 -1
  93. package/node_modules/@m0saic/core/dist/ffmpeg/filters/index.js +1 -1
  94. package/node_modules/@m0saic/core/dist/ffmpeg/filters/sourceRectCrop.js +1 -1
  95. package/node_modules/@m0saic/core/dist/ffmpeg/gridLowering.js +1 -1
  96. package/node_modules/@m0saic/core/dist/ffmpeg/index.js +1 -1
  97. package/node_modules/@m0saic/core/dist/ffmpeg/splitAvMux.js +1 -1
  98. package/node_modules/@m0saic/core/dist/ffmpeg/threadGuard.js +1 -1
  99. package/node_modules/@m0saic/core/dist/flatten/index.js +1 -1
  100. package/node_modules/@m0saic/core/dist/fs/index.js +1 -1
  101. package/node_modules/@m0saic/core/dist/fs/tempWorkspace.js +1 -1
  102. package/node_modules/@m0saic/core/dist/index.js +1 -1
  103. package/node_modules/@m0saic/core/dist/media/buildAssetManifestFromInputs.js +1 -1
  104. package/node_modules/@m0saic/core/dist/media/buildMediaRegistryFromInput.js +1 -1
  105. package/node_modules/@m0saic/core/dist/media/collectMediaInputsFromInvocationProps.js +1 -1
  106. package/node_modules/@m0saic/core/dist/media/collectMediaInputsFromMosaicRenderableFile.js +1 -1
  107. package/node_modules/@m0saic/core/dist/media/collectMediaInputsFromProps.js +1 -1
  108. package/node_modules/@m0saic/core/dist/media/index.js +1 -1
  109. package/node_modules/@m0saic/core/dist/media/internalMintAsset.js +1 -1
  110. package/node_modules/@m0saic/core/dist/media/remoteUrl.js +1 -1
  111. package/node_modules/@m0saic/core/dist/media/stageUnsafeFilenames.js +1 -1
  112. package/node_modules/@m0saic/core/dist/media/types.js +1 -1
  113. package/node_modules/@m0saic/core/dist/output/index.js +1 -1
  114. package/node_modules/@m0saic/core/dist/output/resolveOutputFormat.js +1 -1
  115. package/node_modules/@m0saic/core/dist/output/types.js +1 -1
  116. package/node_modules/@m0saic/core/dist/probe/cellLuminanceProbe.js +1 -1
  117. package/node_modules/@m0saic/core/dist/probe/extractSubtitleCues.js +1 -1
  118. package/node_modules/@m0saic/core/dist/probe/helpers.js +1 -1
  119. package/node_modules/@m0saic/core/dist/probe/index.js +1 -1
  120. package/node_modules/@m0saic/core/dist/probe/luminanceProbe.js +1 -1
  121. package/node_modules/@m0saic/core/dist/probe/probeMedia.js +1 -1
  122. package/node_modules/@m0saic/core/dist/probe/runFFprobe.js +1 -1
  123. package/node_modules/@m0saic/core/dist/probe/types.js +1 -1
  124. package/node_modules/@m0saic/core/dist/runtime/engineRedaction.js +1 -1
  125. package/node_modules/@m0saic/core/dist/runtime/ffmpegFailure.js +1 -1
  126. package/node_modules/@m0saic/core/dist/runtime/filterPreflight.js +1 -1
  127. package/node_modules/@m0saic/core/dist/runtime/hashFile.js +1 -1
  128. package/node_modules/@m0saic/core/dist/runtime/index.js +1 -1
  129. package/node_modules/@m0saic/core/dist/runtime/pathInfo.js +1 -1
  130. package/node_modules/@m0saic/core/dist/runtime/perfHeatmap.js +1 -1
  131. package/node_modules/@m0saic/core/dist/runtime/perfReport.js +1 -1
  132. package/node_modules/@m0saic/core/dist/runtime/pipelineM0p.js +1 -1
  133. package/node_modules/@m0saic/core/dist/runtime/renderCostModel.constants.js +1 -1
  134. package/node_modules/@m0saic/core/dist/runtime/renderCostModel.js +1 -1
  135. package/node_modules/@m0saic/core/dist/runtime/renderReport.js +1 -1
  136. package/node_modules/@m0saic/core/dist/runtime/renderSidecars.js +1 -1
  137. package/node_modules/@m0saic/core/dist/runtime/resolveMosaicx.js +1 -1
  138. package/node_modules/@m0saic/core/dist/runtime/runPlan.js +1 -1
  139. package/node_modules/@m0saic/core/dist/runtime/types.js +1 -1
  140. package/node_modules/@m0saic/core/dist/runtime/upstream.js +1 -1
  141. package/node_modules/@m0saic/core/dist/runtime/writeSidecars.js +1 -1
  142. package/node_modules/@m0saic/core/dist/types/chunk.js +1 -1
  143. package/node_modules/@m0saic/core/dist/types/index.js +1 -1
  144. package/node_modules/@m0saic/core/dist/types/mosaic-plan.js +1 -1
  145. package/node_modules/@m0saic/core/dist/utils/assertTiming.js +1 -1
  146. package/node_modules/@m0saic/core/dist/utils/command.js +1 -1
  147. package/node_modules/@m0saic/core/dist/utils/createEngineContext.js +1 -1
  148. package/node_modules/@m0saic/core/dist/utils/createTemplateRenderCache.js +1 -1
  149. package/node_modules/@m0saic/core/dist/utils/ffmpegColor.js +1 -1
  150. package/node_modules/@m0saic/core/dist/utils/formatDuration.js +1 -1
  151. package/node_modules/@m0saic/core/dist/utils/fsSafeId.js +1 -1
  152. package/node_modules/@m0saic/core/dist/utils/index.js +1 -1
  153. package/node_modules/@m0saic/core/dist/utils/lowerRenderableToMosaicDocument.js +1 -1
  154. package/node_modules/@m0saic/core/dist/utils/movSafeCodec.js +1 -1
  155. package/node_modules/@m0saic/core/dist/utils/resolveBoxFrac.js +1 -1
  156. package/node_modules/@m0saic/core/dist/validate/index.js +1 -1
  157. package/node_modules/@m0saic/core/package.json +1 -1
  158. package/node_modules/@m0saic/core/scripts/mask-rasterize-core.js +1 -1
  159. package/node_modules/@m0saic/core/scripts/mask-rasterize-worker.js +1 -1
  160. package/node_modules/@m0saic/core/scripts/mask-worker-thread.js +1 -1
  161. package/node_modules/@m0saic/dictionary/package.json +1 -1
  162. package/node_modules/@m0saic/knowledge/docs/runtime/README.md +8 -1
  163. package/node_modules/@m0saic/knowledge/docs/runtime/agent-at-the-canvas.md +108 -0
  164. package/node_modules/@m0saic/knowledge/docs/runtime/cli-usage.md +35 -7
  165. package/node_modules/@m0saic/knowledge/docs/templates/output-resolution-tree.md +8 -0
  166. package/node_modules/@m0saic/knowledge/docs/templates/reference/prop-bindings.md +24 -10
  167. package/node_modules/@m0saic/knowledge/docs/templates/reference/template-flags.md +18 -6
  168. package/node_modules/@m0saic/knowledge/docs/templates/standalone-pack-authoring.md +20 -10
  169. package/node_modules/@m0saic/knowledge/package.json +1 -1
  170. package/node_modules/@m0saic/platform/dist/cjs/index.js +1 -1
  171. package/node_modules/@m0saic/platform/dist/cjs/mosaic/propBindings/index.js +1 -1
  172. package/node_modules/@m0saic/platform/dist/cjs/mosaic/propBindings/propBindings.js +1 -1
  173. package/node_modules/@m0saic/platform/dist/cjs/template-repos/index.js +1 -1
  174. package/node_modules/@m0saic/platform/dist/cjs/template-repos/loadTemplateRepoFromPath.js +4 -4
  175. package/node_modules/@m0saic/platform/dist/cjs/template-repos/templateCatalogSidecars.js +2 -0
  176. package/node_modules/@m0saic/platform/dist/cjs/templateCatalog/index.js +1 -0
  177. package/node_modules/@m0saic/platform/dist/cjs/templateCatalog/templateCatalog.js +1 -0
  178. package/node_modules/@m0saic/platform/package.json +1 -1
  179. package/node_modules/@m0saic/product/dist/communityRelease.js +1 -1
  180. package/node_modules/@m0saic/product/dist/freeTierLicense.js +1 -1
  181. package/node_modules/@m0saic/product/dist/index.js +1 -1
  182. package/node_modules/@m0saic/product/dist/licenseActivationNotice.js +1 -1
  183. package/node_modules/@m0saic/product/dist/licenseFile.js +1 -1
  184. package/node_modules/@m0saic/product/dist/licenseToken.js +1 -1
  185. package/node_modules/@m0saic/product/dist/makeScratchPath.js +1 -1
  186. package/node_modules/@m0saic/product/dist/postRenderWrapper.js +1 -1
  187. package/node_modules/@m0saic/product/dist/publicKeys.js +1 -1
  188. package/node_modules/@m0saic/product/dist/revokedKeys.js +1 -1
  189. package/node_modules/@m0saic/product/dist/upstreamDefaults.js +1 -1
  190. package/node_modules/@m0saic/product/dist/workspaceScaffold.js +1 -1
  191. package/node_modules/@m0saic/product/package.json +1 -1
  192. package/node_modules/@m0saic/template-utils/dist/brand/hello-world/helloWorld.js +1 -1
  193. package/node_modules/@m0saic/template-utils/dist/geometry-contract/frameResolution.js +1 -1
  194. package/node_modules/@m0saic/template-utils/dist/geometry-contract/layoutConstraint.js +1 -1
  195. package/node_modules/@m0saic/template-utils/dist/template/auditRenderedTemplate.js +5 -5
  196. package/node_modules/@m0saic/template-utils/dist/template/auditSchemaConventions.js +1 -1
  197. package/node_modules/@m0saic/template-utils/dist/template/defineMosaicTemplate.js +1 -1
  198. package/node_modules/@m0saic/template-utils/dist/template/resolveTemplateOutputHints.js +1 -1
  199. package/node_modules/@m0saic/template-utils/dist/template/templateCatalogStore.js +1 -0
  200. package/node_modules/@m0saic/template-utils/dist/template/templateConventions.js +4 -4
  201. package/node_modules/@m0saic/template-utils/dist/template/templateRegistry.js +3 -3
  202. package/node_modules/@m0saic/template-utils/package.json +1 -1
  203. package/node_modules/@m0saic/templates/dist/catalog.js +1 -0
  204. package/node_modules/@m0saic/templates/dist/freeze.js +8 -8
  205. package/node_modules/@m0saic/templates/dist/index.js +1 -1
  206. package/node_modules/@m0saic/templates/dist/m0saic/_shared/canvas-handles.js +1 -0
  207. package/node_modules/@m0saic/templates/dist/m0saic/_shared/stand-in.js +1 -0
  208. package/node_modules/@m0saic/templates/dist/m0saic/agents/commit-feed/index.js +1 -1
  209. package/node_modules/@m0saic/templates/dist/m0saic/agents/commit-feed/v2/commit-feed.js +1 -0
  210. package/node_modules/@m0saic/templates/dist/m0saic/agents/commit-feed/v2/index.js +1 -0
  211. package/node_modules/@m0saic/templates/dist/m0saic/agents/trace-timeline/index.js +1 -1
  212. package/node_modules/@m0saic/templates/dist/m0saic/agents/trace-timeline/v2/index.js +1 -0
  213. package/node_modules/@m0saic/templates/dist/m0saic/agents/trace-timeline/v2/trace-timeline.js +1 -0
  214. package/node_modules/@m0saic/templates/dist/m0saic/alpine/_shared/alpine-conventions.js +1 -0
  215. package/node_modules/@m0saic/templates/dist/m0saic/alpine/bar-graph/v2/bar-graph.js +1 -0
  216. package/node_modules/@m0saic/templates/dist/m0saic/alpine/bar-graph/v2/index.js +1 -0
  217. package/node_modules/@m0saic/templates/dist/m0saic/alpine/commit-feed/v3/commit-feed.js +1 -0
  218. package/node_modules/@m0saic/templates/dist/m0saic/alpine/commit-feed/v3/index.js +1 -0
  219. package/node_modules/@m0saic/templates/dist/m0saic/alpine/contributor-table/v2/contributor-table.js +1 -0
  220. package/node_modules/@m0saic/templates/dist/m0saic/alpine/contributor-table/v2/index.js +1 -0
  221. package/node_modules/@m0saic/templates/dist/m0saic/alpine/donut/v4/donut.js +1 -0
  222. package/node_modules/@m0saic/templates/dist/m0saic/alpine/donut/v4/index.js +1 -0
  223. package/node_modules/@m0saic/templates/dist/m0saic/alpine/heatmap/v3/heatmap.js +1 -0
  224. package/node_modules/@m0saic/templates/dist/m0saic/alpine/heatmap/v3/index.js +1 -0
  225. package/node_modules/@m0saic/templates/dist/m0saic/alpine/index.js +1 -1
  226. package/node_modules/@m0saic/templates/dist/m0saic/alpine/kpi-card/v3/index.js +1 -0
  227. package/node_modules/@m0saic/templates/dist/m0saic/alpine/kpi-card/v3/kpi-card.js +1 -0
  228. package/node_modules/@m0saic/templates/dist/m0saic/alpine/leaderboard/v2/index.js +1 -0
  229. package/node_modules/@m0saic/templates/dist/m0saic/alpine/leaderboard/v2/leaderboard.js +1 -0
  230. package/node_modules/@m0saic/templates/dist/m0saic/alpine/line-chart/v3/index.js +1 -0
  231. package/node_modules/@m0saic/templates/dist/m0saic/alpine/line-chart/v3/line-chart.js +1 -0
  232. package/node_modules/@m0saic/templates/dist/m0saic/alpine/progress-card/v2/index.js +1 -0
  233. package/node_modules/@m0saic/templates/dist/m0saic/alpine/progress-card/v2/progress-card.js +1 -0
  234. package/node_modules/@m0saic/templates/dist/m0saic/alpine/stat-card/v2/index.js +1 -0
  235. package/node_modules/@m0saic/templates/dist/m0saic/alpine/stat-card/v2/stat-card.js +1 -0
  236. package/node_modules/@m0saic/templates/dist/m0saic/alpine/timeline/v3/index.js +1 -0
  237. package/node_modules/@m0saic/templates/dist/m0saic/alpine/timeline/v3/timeline.js +4 -0
  238. package/node_modules/@m0saic/templates/dist/m0saic/alpine/treemap/v3/index.js +1 -0
  239. package/node_modules/@m0saic/templates/dist/m0saic/alpine/treemap/v3/treemap.js +1 -0
  240. package/node_modules/@m0saic/templates/dist/m0saic/benchmark/index.js +1 -1
  241. package/node_modules/@m0saic/templates/dist/m0saic/benchmark/report/v2/index.js +1 -0
  242. package/node_modules/@m0saic/templates/dist/m0saic/benchmark/report/v2/report.js +1 -0
  243. package/node_modules/@m0saic/templates/dist/m0saic/brand/business-card/v2/business-card.js +1 -0
  244. package/node_modules/@m0saic/templates/dist/m0saic/brand/business-card/v2/index.js +1 -0
  245. package/node_modules/@m0saic/templates/dist/m0saic/brand/index.js +1 -1
  246. package/node_modules/@m0saic/templates/dist/m0saic/brand/logo/v4/index.js +1 -0
  247. package/node_modules/@m0saic/templates/dist/m0saic/brand/logo/v4/logo_runner.js +1 -0
  248. package/node_modules/@m0saic/templates/dist/m0saic/charts/bar-graph/v3/bar-graph.js +1 -0
  249. package/node_modules/@m0saic/templates/dist/m0saic/charts/bar-graph/v3/index.js +1 -0
  250. package/node_modules/@m0saic/templates/dist/m0saic/charts/donut/v5/donut.js +1 -0
  251. package/node_modules/@m0saic/templates/dist/m0saic/charts/donut/v5/index.js +1 -0
  252. package/node_modules/@m0saic/templates/dist/m0saic/charts/index.js +1 -1
  253. package/node_modules/@m0saic/templates/dist/m0saic/charts/line-chart/v2/index.js +1 -0
  254. package/node_modules/@m0saic/templates/dist/m0saic/charts/line-chart/v2/line-chart.js +1 -0
  255. package/node_modules/@m0saic/templates/dist/m0saic/charts/stat-card/v2/index.js +1 -0
  256. package/node_modules/@m0saic/templates/dist/m0saic/charts/stat-card/v2/stat-card.js +1 -0
  257. package/node_modules/@m0saic/templates/dist/m0saic/code/index.js +1 -1
  258. package/node_modules/@m0saic/templates/dist/m0saic/code/snippet-morph/v2/snippet-morph.js +3 -0
  259. package/node_modules/@m0saic/templates/dist/m0saic/collage/image-collage/v2/image-collage.js +1 -0
  260. package/node_modules/@m0saic/templates/dist/m0saic/collage/image-collage/v2/index.js +1 -0
  261. package/node_modules/@m0saic/templates/dist/m0saic/collage/index.js +1 -1
  262. package/node_modules/@m0saic/templates/dist/m0saic/dsl-tutorial/index.js +1 -1
  263. package/node_modules/@m0saic/templates/dist/m0saic/dsl-tutorial/v2/dsl-tutorial.js +1 -0
  264. package/node_modules/@m0saic/templates/dist/m0saic/dsl-tutorial/v2/index.js +1 -0
  265. package/node_modules/@m0saic/templates/dist/m0saic/github/year-card/index.js +1 -1
  266. package/node_modules/@m0saic/templates/dist/m0saic/github/year-card/v2/index.js +1 -0
  267. package/node_modules/@m0saic/templates/dist/m0saic/github/year-card/v2/year-card.js +1 -0
  268. package/node_modules/@m0saic/templates/dist/m0saic/hero/ffmpeg-pulse/index.js +1 -1
  269. package/node_modules/@m0saic/templates/dist/m0saic/hero/ffmpeg-pulse/runner/v2/index.js +1 -0
  270. package/node_modules/@m0saic/templates/dist/m0saic/hero/ffmpeg-pulse/runner/v2/runner.js +1 -0
  271. package/node_modules/@m0saic/templates/dist/m0saic/media/barcode/v2/barcode.js +1 -0
  272. package/node_modules/@m0saic/templates/dist/m0saic/media/barcode/v2/index.js +1 -0
  273. package/node_modules/@m0saic/templates/dist/m0saic/media/blur-regions/index.js +1 -1
  274. package/node_modules/@m0saic/templates/dist/m0saic/media/blur-regions/v2/blur-regions.js +1 -0
  275. package/node_modules/@m0saic/templates/dist/m0saic/media/blur-regions/v2/index.js +1 -0
  276. package/node_modules/@m0saic/templates/dist/m0saic/media/highlights/index.js +1 -1
  277. package/node_modules/@m0saic/templates/dist/m0saic/media/highlights/v2/highlights.js +1 -0
  278. package/node_modules/@m0saic/templates/dist/m0saic/media/highlights/v2/index.js +1 -0
  279. package/node_modules/@m0saic/templates/dist/m0saic/media/index.js +1 -1
  280. package/node_modules/@m0saic/templates/dist/m0saic/media/logo-animate/index.js +1 -1
  281. package/node_modules/@m0saic/templates/dist/m0saic/media/logo-animate/v2/index.js +1 -0
  282. package/node_modules/@m0saic/templates/dist/m0saic/media/logo-animate/v2/logo-animate.js +1 -0
  283. package/node_modules/@m0saic/templates/dist/m0saic/media/metadata-stamp/index.js +1 -1
  284. package/node_modules/@m0saic/templates/dist/m0saic/media/metadata-stamp/v2/index.js +1 -0
  285. package/node_modules/@m0saic/templates/dist/m0saic/media/metadata-stamp/v2/metadata-stamp.js +1 -0
  286. package/node_modules/@m0saic/templates/dist/m0saic/media/qr/code/v2/index.js +1 -0
  287. package/node_modules/@m0saic/templates/dist/m0saic/media/qr/code/v2/qr-code.js +1 -0
  288. package/node_modules/@m0saic/templates/dist/m0saic/media/qr/index.js +1 -1
  289. package/node_modules/@m0saic/templates/dist/m0saic/media/qr/stamp/v2/qr-stamp-custom.js +1 -0
  290. package/node_modules/@m0saic/templates/dist/m0saic/media/screencap_grid/index.js +1 -1
  291. package/node_modules/@m0saic/templates/dist/m0saic/media/screencap_grid/v3/index.js +1 -0
  292. package/node_modules/@m0saic/templates/dist/m0saic/media/screencap_grid/v3/screencap-grid.js +4 -0
  293. package/node_modules/@m0saic/templates/dist/m0saic/media/screencap_grid_aspect_safe/index.js +1 -1
  294. package/node_modules/@m0saic/templates/dist/m0saic/media/screencap_grid_aspect_safe/v2/index.js +1 -0
  295. package/node_modules/@m0saic/templates/dist/m0saic/media/screencap_grid_aspect_safe/v2/screencap-grid-aspect-safe.js +3 -0
  296. package/node_modules/@m0saic/templates/dist/m0saic/media/scroll_wall/index.js +1 -1
  297. package/node_modules/@m0saic/templates/dist/m0saic/media/scroll_wall/v2/index.js +1 -0
  298. package/node_modules/@m0saic/templates/dist/m0saic/media/scroll_wall/v2/scroll-wall.js +1 -0
  299. package/node_modules/@m0saic/templates/dist/m0saic/media/subtitle-burn/index.js +1 -1
  300. package/node_modules/@m0saic/templates/dist/m0saic/media/subtitle-burn/v2/index.js +1 -0
  301. package/node_modules/@m0saic/templates/dist/m0saic/media/subtitle-burn/v2/subtitle-burn.js +4 -0
  302. package/node_modules/@m0saic/templates/dist/m0saic/media/trickplay/index.js +1 -1
  303. package/node_modules/@m0saic/templates/dist/m0saic/media/trickplay/v2/index.js +1 -0
  304. package/node_modules/@m0saic/templates/dist/m0saic/media/trickplay/v2/trickplay.js +1 -0
  305. package/node_modules/@m0saic/templates/dist/m0saic/media/video_to_png_sequence/index.js +1 -1
  306. package/node_modules/@m0saic/templates/dist/m0saic/media/video_to_png_sequence/v2/index.js +1 -0
  307. package/node_modules/@m0saic/templates/dist/m0saic/media/video_to_png_sequence/v2/video-to-png-sequence.js +1 -0
  308. package/node_modules/@m0saic/templates/dist/m0saic/media/watermark/index.js +1 -1
  309. package/node_modules/@m0saic/templates/dist/m0saic/media/watermark/v2/index.js +1 -0
  310. package/node_modules/@m0saic/templates/dist/m0saic/media/watermark/v2/watermark.js +1 -0
  311. package/node_modules/@m0saic/templates/dist/m0saic/primitives/grid/index.js +1 -1
  312. package/node_modules/@m0saic/templates/dist/m0saic/primitives/grid/v3/grid.js +1 -0
  313. package/node_modules/@m0saic/templates/dist/m0saic/social/quote-card/index.js +1 -1
  314. package/node_modules/@m0saic/templates/dist/m0saic/social/quote-card/v2/index.js +1 -0
  315. package/node_modules/@m0saic/templates/dist/m0saic/social/quote-card/v2/quote-card.js +1 -0
  316. package/node_modules/@m0saic/templates/dist/m0saic/story/index.js +1 -1
  317. package/node_modules/@m0saic/templates/dist/m0saic/story/narrated-chapters/index.js +1 -1
  318. package/node_modules/@m0saic/templates/dist/m0saic/story/narrated-chapters/v2/index.js +1 -0
  319. package/node_modules/@m0saic/templates/dist/m0saic/story/narrated-chapters/v2/narrated-chapters.js +4 -0
  320. package/node_modules/@m0saic/templates/dist/m0saic/story/scrapbook/v2/index.js +1 -0
  321. package/node_modules/@m0saic/templates/dist/m0saic/story/scrapbook/v2/props.js +1 -0
  322. package/node_modules/@m0saic/templates/dist/m0saic/story/scrapbook/v2/scrapbook.js +1 -0
  323. package/node_modules/@m0saic/templates/dist/m0saic/theming/index.js +1 -1
  324. package/node_modules/@m0saic/templates/dist/m0saic/theming/v2/index.js +1 -0
  325. package/node_modules/@m0saic/templates/dist/m0saic/theming/v2/theming.js +1 -0
  326. package/node_modules/@m0saic/templates/dist/m0saic/web/index.js +1 -1
  327. package/node_modules/@m0saic/templates/dist/m0saic/web/page-skeleton/v2/index.js +1 -0
  328. package/node_modules/@m0saic/templates/dist/m0saic/web/page-skeleton/v2/page-skeleton.js +1 -0
  329. package/node_modules/@m0saic/templates/dist/m0saic/wireframe/base/v3/index.js +1 -0
  330. package/node_modules/@m0saic/templates/dist/m0saic/wireframe/base/v3/wireframe.js +1 -0
  331. package/node_modules/@m0saic/templates/dist/m0saic/wireframe/index.js +1 -1
  332. package/node_modules/@m0saic/templates/dist/repo.js +1 -1
  333. package/node_modules/@m0saic/templates/dist/template-catalog.json +5429 -0
  334. package/node_modules/@m0saic/templates/dist/template-registry.js +1 -1
  335. package/node_modules/@m0saic/templates/dist/web.js +1 -1
  336. package/node_modules/@m0saic/templates/package.json +1 -1
  337. package/node_modules/@m0saic/templates/template-catalog.json +5429 -0
  338. package/node_modules/@m0saic/templates/template-manifest.json +1030 -286
  339. package/node_modules/@m0saic/templates/web-template-ids.json +38 -0
  340. package/node_modules/@m0saic/text/package.json +1 -1
  341. package/node_modules/@m0saic/types/dist/template/template.js +1 -1
  342. package/node_modules/@m0saic/types/package.json +1 -1
  343. package/node_modules/@m0saic/types-internal/dist/analytics/featureKeys.js +1 -1
  344. package/node_modules/@m0saic/types-internal/package.json +1 -1
  345. package/package.json +11 -11
  346. package/resources/starter-base/starter-base.json +5 -5
  347. package/resources/starter-base/starter-base.tgz +0 -0
@@ -1,8 +1,8 @@
1
- "use strict";var F=Object.defineProperty;var a=(t,n)=>F(t,"name",{value:n,configurable:!0});var __createBinding=this&&this.__createBinding||(Object.create?(function(t,n,i,s){s===void 0&&(s=i);var e=Object.getOwnPropertyDescriptor(n,i);(!e||("get"in e?!n.__esModule:e.writable||e.configurable))&&(e={enumerable:!0,get:a(function(){return n[i]},"get")}),Object.defineProperty(t,s,e)}):(function(t,n,i,s){s===void 0&&(s=i),t[s]=n[i]})),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?(function(t,n){Object.defineProperty(t,"default",{enumerable:!0,value:n})}):function(t,n){t.default=n}),__importStar=this&&this.__importStar||(function(){var t=a(function(n){return t=Object.getOwnPropertyNames||function(i){var s=[];for(var e in i)Object.prototype.hasOwnProperty.call(i,e)&&(s[s.length]=e);return s},t(n)},"ownKeys");return function(n){if(n&&n.__esModule)return n;var i={};if(n!=null)for(var s=t(n),e=0;e<s.length;e++)s[e]!=="default"&&__createBinding(i,n,s[e]);return __setModuleDefault(i,n),i}})();Object.defineProperty(exports,"__esModule",{value:!0}),exports.TEMPLATE_WRAPPED_FROM_KEY=exports.RENDER_PIN_FIELDS=exports.DEFINITION_PIN_FIELDS=exports.FREEZE_HASH_VERSION=exports.FROZEN_SRC_ROOT=exports.FREEZE_MANIFEST_FILE=void 0,exports.stripComments=stripComments,exports.hashSource=hashSource,exports.manifestHashVersion=manifestHashVersion,exports.describeHashVersionMismatch=describeHashVersionMismatch,exports.canonicalJson=canonicalJson,exports.renderSourceText=renderSourceText,exports.definitionFieldsSha256=definitionFieldsSha256,exports.definitionSha256=definitionSha256,exports.registeringSourcePath=registeringSourcePath,exports.liveRegistrationOf=liveRegistrationOf,exports.checkRegistryPins=checkRegistryPins,exports.pinnedWebIds=pinnedWebIds,exports.webRegistryPins=webRegistryPins,exports.unfrozenPinFiles=unfrozenPinFiles,exports.isFrozenPath=isFrozenPath,exports.relativeImportSpecifiers=relativeImportSpecifiers,exports.collectFrozenFiles=collectFrozenFiles,exports.readFreezeManifest=readFreezeManifest,exports.checkFreeze=checkFreeze,exports.mintFreezeManifest=mintFreezeManifest;const fs=__importStar(require("fs")),path=__importStar(require("path")),crypto_1=require("crypto");exports.FREEZE_MANIFEST_FILE="frozen.manifest.json",exports.FROZEN_SRC_ROOT="src/m0saic",exports.FREEZE_HASH_VERSION=2;const LINE_TERMINATOR_RE=/[\n\r\u2028\u2029]/,isLineTerminator=a(t=>t===`
2
- `||t==="\r"||t==="\u2028"||t==="\u2029","isLineTerminator"),REGEX_MAY_FOLLOW=new Set("(,=:[!&|?{};+-*%<>~^".split("")),REGEX_MAY_FOLLOW_WORDS=new Set(["return","typeof","case","in","of","new","delete","void","throw","do","else","yield","await"]);function stripComments(t){const n=[];let i="",s="",e=0;const o=t.length,r=a(()=>{const f=n[n.length-1];n.length&&f!==" "&&f!==`
3
- `&&n.push(" ")},"pushSpace"),c=a(()=>{n[n.length-1]===" "&&n.pop(),n.length&&n[n.length-1]!==`
4
- `&&n.push(`
5
- `)},"pushNewline"),l=a(f=>{n.push(f);const d=f.trim();d&&(i=d[d.length-1],s=/[A-Za-z_$]/.test(d[0])?d:"")},"pushCode");for(;e<o;){const f=t[e],d=t[e+1];if(f==="/"&&d==="/"){for(;e<o&&!isLineTerminator(t[e]);)e++;r();continue}if(f==="/"&&d==="*"){const u=t.indexOf("*/",e+2);if(u===-1)return{text:t,confident:!1};const p=LINE_TERMINATOR_RE.test(t.slice(e+2,u));e=u+2,p?c():r();continue}if(f==='"'||f==="'"||f==="`"){const u=e,p=f;e++;let h=!1;for(;e<o;){const _=t[e];if(_==="\\"){e+=2;continue}if(p==="`"&&_==="$"&&t[e+1]==="{"){let S=1;for(e+=2;e<o&&S>0;){const E=t[e];if(E==="{")S++;else if(E==="}")S--;else if(E==='"'||E==="'"||E==="`"){const g=E;for(e++;e<o&&t[e]!==g;)t[e]==="\\"&&e++,e++}e++}continue}if(_===p){e++,h=!0;break}e++}if(!h)return{text:t,confident:!1};l(t.slice(u,e));continue}if(f==="/"){if(i===""||REGEX_MAY_FOLLOW.has(i)||REGEX_MAY_FOLLOW_WORDS.has(s)){const p=e;e++;let h=!1,_=!1;for(;e<o;){const S=t[e];if(S==="\\"){e+=2;continue}if(isLineTerminator(S))break;if(S==="[")h=!0;else if(S==="]")h=!1;else if(S==="/"&&!h){e++,_=!0;break}e++}if(!_)return{text:t,confident:!1};for(;e<o&&/[gimsuyd]/.test(t[e]);)e++;l(t.slice(p,e));continue}l(f),e++;continue}if(f===" "||f===" "||isLineTerminator(f)){let u=!1;for(;e<o&&(t[e]===" "||t[e]===" "||isLineTerminator(t[e]));)isLineTerminator(t[e])&&(u=!0),e++;u?c():r();continue}if(/[A-Za-z_$]/.test(f)){const u=e;for(;e<o&&/[A-Za-z0-9_$]/.test(t[e]);)e++;l(t.slice(u,e));continue}l(f),e++}return{text:n.join("").trim(),confident:!0}}a(stripComments,"stripComments");function hashSource(t){const{text:n,confident:i}=stripComments(t.replace(/\r\n?/g,`
6
- `));return{hash:(0,crypto_1.createHash)("sha256").update(n,"utf8").digest("hex"),confident:i}}a(hashSource,"hashSource");function manifestHashVersion(t){return typeof t.hashVersion=="number"?t.hashVersion:1}a(manifestHashVersion,"manifestHashVersion");function describeHashVersionMismatch(t){const n=`manifest minted with hash v${t}, checker is v${exports.FREEZE_HASH_VERSION} \u2014 the hashes are incomparable.`;return t>exports.FREEZE_HASH_VERSION?`${n} The manifest is NEWER than this build of dist/freeze.js: rebuild the package (npm run build --workspace packages/templates); do NOT re-mint.`:`${n} Re-mint at a release (node tools/check-registry.mjs --update-freeze); this is never fixed by editing a frozen file.`}a(describeHashVersionMismatch,"describeHashVersionMismatch"),exports.DEFINITION_PIN_FIELDS=["version","capabilities","role","primitive","internal","deprecated","aspectRatio","outputHints","lattice","defaultFinalizeOpts","skipAutoCompact","propsSchema","defaultProps","outputsSchema","upstreamVariablesSchema","upstreamDataSchema","sidecarsSchema","defaultOutputs"];function canonicalJson(t){const n=a(i=>{if(i==null)return i;if(typeof i=="function")return"[Function]";if(typeof i=="bigint")return`${i}n`;if(typeof i=="number")return Number.isFinite(i)?i:null;if(typeof i!="object")return i;if(Array.isArray(i))return i.map(o=>o===void 0?null:n(o));if(i instanceof Date)return i.toISOString();const s=i,e={};for(const o of Object.keys(s).sort()){const r=n(s[o]);r!==void 0&&(e[o]=r)}return e},"walk");return JSON.stringify(n(t))}a(canonicalJson,"canonicalJson"),exports.RENDER_PIN_FIELDS=["render","renderLite","renderCover","resolveOutputHints"],exports.TEMPLATE_WRAPPED_FROM_KEY=Symbol.for("m0saic.templateWrappedFrom");function renderSourceText(t){if(typeof t!="function")return;let n=t;const i=new Set;for(;;){const s=n[exports.TEMPLATE_WRAPPED_FROM_KEY];if(typeof s!="function"||i.has(s))break;i.add(n),n=s}return stripComments(Function.prototype.toString.call(n).replace(/\r\n?/g,`
7
- `)).text}a(renderSourceText,"renderSourceText");function pickDefinitionFields(t){const n={};for(const i of exports.DEFINITION_PIN_FIELDS)n[i]=t[i];return n}a(pickDefinitionFields,"pickDefinitionFields");function definitionFieldsSha256(t){return(0,crypto_1.createHash)("sha256").update(canonicalJson(pickDefinitionFields(t)),"utf8").digest("hex")}a(definitionFieldsSha256,"definitionFieldsSha256");function definitionSha256(t){const n=pickDefinitionFields(t);for(const i of exports.RENDER_PIN_FIELDS)n[i]=renderSourceText(t[i]);return(0,crypto_1.createHash)("sha256").update(canonicalJson(n),"utf8").digest("hex")}a(definitionSha256,"definitionSha256");function registeringSourcePath(t,n){let i=n.split(path.sep).join("/");return path.isAbsolute(n)?i=path.relative(t,n).split(path.sep).join("/"):i.startsWith("packages/templates/")&&(i=i.slice(19)),i.startsWith("dist/")&&i.endsWith(".js")&&(i=`src/${i.slice(5,-3)}.ts`),i}a(registeringSourcePath,"registeringSourcePath");function liveRegistrationOf(t,n,i){return{id:t,file:n,definitionSha256:definitionSha256(i),fieldsSha256:definitionFieldsSha256(i)}}a(liveRegistrationOf,"liveRegistrationOf");function checkRegistryPins(t,n){var i,s;const e=(i=t.registry)!==null&&i!==void 0?i:{},o=new Map(n.map(c=>[c.id,c])),r={ok:!0,pinned:Object.keys(e).length,held:[],missing:[],moved:[],redefined:[],unpinned:[]};for(const c of Object.keys(e).sort()){const l=e[c],f=o.get(c);if(!f){r.missing.push({id:c,file:l.file});continue}if(f.file!==l.file){r.moved.push({id:c,pinnedFile:l.file,file:f.file});continue}if(f.definitionSha256!==l.definitionSha256){const d=(s=l.fieldsSha256)!==null&&s!==void 0?s:l.definitionSha256,u=f.fieldsSha256!==void 0&&f.fieldsSha256===d?"render body":"fields";r.redefined.push({id:c,file:f.file,reason:u});continue}r.held.push(c)}for(const c of n)c.id in e||r.unpinned.push(c.id);return r.unpinned.sort(),r.ok=r.missing.length===0&&r.moved.length===0&&r.redefined.length===0,r}a(checkRegistryPins,"checkRegistryPins");function pinnedWebIds(t){var n;const i=(n=t.registry)!==null&&n!==void 0?n:{};return Object.keys(i).filter(s=>i[s].web===!0).sort()}a(pinnedWebIds,"pinnedWebIds");function webRegistryPins(t){var n,i,s,e;const o=(n=t.registry)!==null&&n!==void 0?n:{},r={};for(const c of pinnedWebIds(t)){const l=o[c],f={file:(i=l.webFile)!==null&&i!==void 0?i:l.file,definitionSha256:(s=l.webDefinitionSha256)!==null&&s!==void 0?s:l.definitionSha256},d=(e=l.webFieldsSha256)!==null&&e!==void 0?e:l.webDefinitionSha256===void 0?l.fieldsSha256:void 0;d!==void 0&&(f.fieldsSha256=d),r[c]=f}return{registry:r}}a(webRegistryPins,"webRegistryPins");function unfrozenPinFiles(t){var n;const i=[],s=(n=t.registry)!==null&&n!==void 0?n:{};for(const e of Object.keys(s).sort()){const o=s[e];for(const r of[o.file,o.webFile])r!==void 0&&t.files[r]===void 0&&i.push({id:e,file:r})}return i}a(unfrozenPinFiles,"unfrozenPinFiles");function isFrozenPath(t){const n=t.split(path.sep).join("/");return!n.startsWith(`${exports.FROZEN_SRC_ROOT}/`)||!isFreezableSource(n)?!1:n.split("/").some(s=>/^v\d+$/.test(s)||s==="_shared")}a(isFrozenPath,"isFrozenPath");function isFreezableSource(t){return t.endsWith(".ts")&&!t.endsWith(".test.ts")&&!t.endsWith(".d.ts")}a(isFreezableSource,"isFreezableSource");function relativeImportSpecifiers(t){const{text:n}=stripComments(t.replace(/\r\n?/g,`
8
- `)),i=/(?:\bfrom\s*|\bimport\s*\(?\s*|\brequire\s*\(\s*)["']([^"']+)["']/g,s=[];let e;for(;e=i.exec(n);){const o=e[1];(o.startsWith("./")||o.startsWith("../"))&&s.push(o)}return s}a(relativeImportSpecifiers,"relativeImportSpecifiers");function resolveFrozenImport(t,n,i){const s=path.join(t,"src"),e=path.resolve(path.dirname(n),i),o=e.endsWith(".ts")?[e]:e.endsWith(".js")?[`${e.slice(0,-3)}.ts`]:[`${e}.ts`,path.join(e,"index.ts")];for(const r of o){if(!r.startsWith(s+path.sep))continue;let c=!1;try{c=fs.statSync(r).isFile()}catch{}if(!c)continue;const l=path.relative(t,r).split(path.sep).join("/");return isFreezableSource(l)?l:void 0}}a(resolveFrozenImport,"resolveFrozenImport");function collectFrozenFiles(t){const n=[],i=a(o=>{let r;try{r=fs.readdirSync(o,{withFileTypes:!0})}catch{return}for(const c of r){const l=path.join(o,c.name);if(c.isDirectory()){i(l);continue}const f=path.relative(t,l).split(path.sep).join("/");isFrozenPath(f)&&n.push(f)}},"walk");i(path.join(t,exports.FROZEN_SRC_ROOT));const s=new Set(n),e=[...n];for(;e.length;){const o=e.pop(),r=path.join(t,o);let c;try{c=fs.readFileSync(r,"utf8")}catch{continue}for(const l of relativeImportSpecifiers(c)){const f=resolveFrozenImport(t,r,l);f!==void 0&&!s.has(f)&&(s.add(f),e.push(f))}}return[...s].sort()}a(collectFrozenFiles,"collectFrozenFiles");function readFreezeManifest(t){const n=path.join(t,exports.FREEZE_MANIFEST_FILE);return fs.existsSync(n)?JSON.parse(fs.readFileSync(n,"utf8")):null}a(readFreezeManifest,"readFreezeManifest");function checkFreeze(t,n){const i={ok:!0,unchanged:[],changed:[],deleted:[],unfrozen:[],lowConfidence:[]},s=manifestHashVersion(n);if(s!==exports.FREEZE_HASH_VERSION)return i.ok=!1,i.hashVersionMismatch={manifest:s,checker:exports.FREEZE_HASH_VERSION,message:describeHashVersionMismatch(s)},i;const e=new Set(collectFrozenFiles(t));for(const o of Object.keys(n.files))!e.has(o)&&fs.existsSync(path.join(t,o))&&e.add(o);for(const o of[...e].sort()){const r=n.files[o];if(r===void 0){i.unfrozen.push(o);continue}const{hash:c,confident:l}=hashSource(fs.readFileSync(path.join(t,o),"utf8"));l||i.lowConfidence.push(o),c===r?i.unchanged.push(o):i.changed.push(o)}for(const o of Object.keys(n.files))e.has(o)||i.deleted.push(o);return i.ok=i.changed.length===0&&i.deleted.length===0,i}a(checkFreeze,"checkFreeze");function mintFreezeManifest(t,n,i){var s,e;const o={};for(const c of collectFrozenFiles(t))o[c]=hashSource(fs.readFileSync(path.join(t,c),"utf8")).hash;const r={...n,hashVersion:exports.FREEZE_HASH_VERSION,files:o};if(i){const c=new Set((s=i.webIds)!==null&&s!==void 0?s:[]),l=new Map(((e=i.webLive)!==null&&e!==void 0?e:[]).map(u=>[u.id,u])),f={};for(const u of[...i.live].sort((p,h)=>p.id<h.id?-1:p.id>h.id?1:0)){const p={file:u.file,definitionSha256:u.definitionSha256};if(u.fieldsSha256!==void 0&&(p.fieldsSha256=u.fieldsSha256),c.has(u.id)){p.web=!0;const h=l.get(u.id);h&&(h.file!==u.file||h.definitionSha256!==u.definitionSha256)&&(p.webFile=h.file,p.webDefinitionSha256=h.definitionSha256,h.fieldsSha256!==void 0&&(p.webFieldsSha256=h.fieldsSha256))}f[u.id]=p}r.registry=f;const d=unfrozenPinFiles(r);if(d.length)throw new Error(`refusing to mint: ${d.length} registry pin(s) name a file the manifest does not hash \u2014 `+d.map(u=>`${u.id} \u2190 ${u.file}`).join("; ")+". A pin over unhashed code is not a lock; the frozen set is the import closure of every vN/ and _shared/ file, so this means the registering module was not reached from a frozen file (or its provenance is unknown).")}return r}a(mintFreezeManifest,"mintFreezeManifest");
1
+ "use strict";var O=Object.defineProperty;var d=(t,e)=>O(t,"name",{value:e,configurable:!0});var __createBinding=this&&this.__createBinding||(Object.create?(function(t,e,i,s){s===void 0&&(s=i);var n=Object.getOwnPropertyDescriptor(e,i);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:d(function(){return e[i]},"get")}),Object.defineProperty(t,s,n)}):(function(t,e,i,s){s===void 0&&(s=i),t[s]=e[i]})),__setModuleDefault=this&&this.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),__importStar=this&&this.__importStar||(function(){var t=d(function(e){return t=Object.getOwnPropertyNames||function(i){var s=[];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(s[s.length]=n);return s},t(e)},"ownKeys");return function(e){if(e&&e.__esModule)return e;var i={};if(e!=null)for(var s=t(e),n=0;n<s.length;n++)s[n]!=="default"&&__createBinding(i,e,s[n]);return __setModuleDefault(i,e),i}})();Object.defineProperty(exports,"__esModule",{value:!0}),exports.TEMPLATE_WRAPPED_FROM_KEY=exports.RENDER_PIN_FIELDS=exports.DEFINITION_PIN_FIELDS=exports.FREEZE_HASH_VERSION=exports.FROZEN_SRC_ROOT=exports.FREEZE_MANIFEST_FILE=void 0,exports.stripComments=stripComments,exports.hashSource=hashSource,exports.manifestHashVersion=manifestHashVersion,exports.describeHashVersionMismatch=describeHashVersionMismatch,exports.canonicalJson=canonicalJson,exports.renderSourceText=renderSourceText,exports.definitionFieldsSha256=definitionFieldsSha256,exports.definitionSha256=definitionSha256,exports.registeringSourcePath=registeringSourcePath,exports.liveRegistrationOf=liveRegistrationOf,exports.checkRegistryPins=checkRegistryPins,exports.pinnedWebIds=pinnedWebIds,exports.webRegistryPins=webRegistryPins,exports.unfrozenPinFiles=unfrozenPinFiles,exports.isFrozenPath=isFrozenPath,exports.relativeImportSpecifiers=relativeImportSpecifiers,exports.collectFrozenFiles=collectFrozenFiles,exports.templateFolderOf=templateFolderOf,exports.templateFolderOfId=templateFolderOfId,exports.mintShippedMap=mintShippedMap,exports.shippedLineFor=shippedLineFor,exports.shippedLineCounts=shippedLineCounts,exports.checkTemplateCatalog=checkTemplateCatalog,exports.readFreezeManifest=readFreezeManifest,exports.checkFreeze=checkFreeze,exports.mintFreezeManifest=mintFreezeManifest;const fs=__importStar(require("fs")),path=__importStar(require("path")),crypto_1=require("crypto");exports.FREEZE_MANIFEST_FILE="frozen.manifest.json",exports.FROZEN_SRC_ROOT="src/m0saic",exports.FREEZE_HASH_VERSION=2;const LINE_TERMINATOR_RE=/[\n\r\u2028\u2029]/,isLineTerminator=d(t=>t===`
2
+ `||t==="\r"||t==="\u2028"||t==="\u2029","isLineTerminator"),REGEX_MAY_FOLLOW=new Set("(,=:[!&|?{};+-*%<>~^".split("")),REGEX_MAY_FOLLOW_WORDS=new Set(["return","typeof","case","in","of","new","delete","void","throw","do","else","yield","await"]);function stripComments(t){const e=[];let i="",s="",n=0;const o=t.length,r=d(()=>{const f=e[e.length-1];e.length&&f!==" "&&f!==`
3
+ `&&e.push(" ")},"pushSpace"),c=d(()=>{e[e.length-1]===" "&&e.pop(),e.length&&e[e.length-1]!==`
4
+ `&&e.push(`
5
+ `)},"pushNewline"),l=d(f=>{e.push(f);const u=f.trim();u&&(i=u[u.length-1],s=/[A-Za-z_$]/.test(u[0])?u:"")},"pushCode");for(;n<o;){const f=t[n],u=t[n+1];if(f==="/"&&u==="/"){for(;n<o&&!isLineTerminator(t[n]);)n++;r();continue}if(f==="/"&&u==="*"){const p=t.indexOf("*/",n+2);if(p===-1)return{text:t,confident:!1};const E=LINE_TERMINATOR_RE.test(t.slice(n+2,p));n=p+2,E?c():r();continue}if(f==='"'||f==="'"||f==="`"){const p=n,E=f;n++;let S=!1;for(;n<o;){const b=t[n];if(b==="\\"){n+=2;continue}if(E==="`"&&b==="$"&&t[n+1]==="{"){let h=1;for(n+=2;n<o&&h>0;){const F=t[n];if(F==="{")h++;else if(F==="}")h--;else if(F==='"'||F==="'"||F==="`"){const a=F;for(n++;n<o&&t[n]!==a;)t[n]==="\\"&&n++,n++}n++}continue}if(b===E){n++,S=!0;break}n++}if(!S)return{text:t,confident:!1};l(t.slice(p,n));continue}if(f==="/"){if(i===""||REGEX_MAY_FOLLOW.has(i)||REGEX_MAY_FOLLOW_WORDS.has(s)){const E=n;n++;let S=!1,b=!1;for(;n<o;){const h=t[n];if(h==="\\"){n+=2;continue}if(isLineTerminator(h))break;if(h==="[")S=!0;else if(h==="]")S=!1;else if(h==="/"&&!S){n++,b=!0;break}n++}if(!b)return{text:t,confident:!1};for(;n<o&&/[gimsuyd]/.test(t[n]);)n++;l(t.slice(E,n));continue}l(f),n++;continue}if(f===" "||f===" "||isLineTerminator(f)){let p=!1;for(;n<o&&(t[n]===" "||t[n]===" "||isLineTerminator(t[n]));)isLineTerminator(t[n])&&(p=!0),n++;p?c():r();continue}if(/[A-Za-z_$]/.test(f)){const p=n;for(;n<o&&/[A-Za-z0-9_$]/.test(t[n]);)n++;l(t.slice(p,n));continue}l(f),n++}return{text:e.join("").trim(),confident:!0}}d(stripComments,"stripComments");function hashSource(t){const{text:e,confident:i}=stripComments(t.replace(/\r\n?/g,`
6
+ `));return{hash:(0,crypto_1.createHash)("sha256").update(e,"utf8").digest("hex"),confident:i}}d(hashSource,"hashSource");function manifestHashVersion(t){return typeof t.hashVersion=="number"?t.hashVersion:1}d(manifestHashVersion,"manifestHashVersion");function describeHashVersionMismatch(t){const e=`manifest minted with hash v${t}, checker is v${exports.FREEZE_HASH_VERSION} \u2014 the hashes are incomparable.`;return t>exports.FREEZE_HASH_VERSION?`${e} The manifest is NEWER than this build of dist/freeze.js: rebuild the package (npm run build --workspace packages/templates); do NOT re-mint.`:`${e} Re-mint at a release (node tools/check-registry.mjs --update-freeze); this is never fixed by editing a frozen file.`}d(describeHashVersionMismatch,"describeHashVersionMismatch"),exports.DEFINITION_PIN_FIELDS=["version","capabilities","role","primitive","internal","deprecated","aspectRatio","outputHints","lattice","defaultFinalizeOpts","skipAutoCompact","propsSchema","defaultProps","outputsSchema","upstreamVariablesSchema","upstreamDataSchema","sidecarsSchema","defaultOutputs"];function canonicalJson(t){const e=d(i=>{if(i==null)return i;if(typeof i=="function")return"[Function]";if(typeof i=="bigint")return`${i}n`;if(typeof i=="number")return Number.isFinite(i)?i:null;if(typeof i!="object")return i;if(Array.isArray(i))return i.map(o=>o===void 0?null:e(o));if(i instanceof Date)return i.toISOString();const s=i,n={};for(const o of Object.keys(s).sort()){const r=e(s[o]);r!==void 0&&(n[o]=r)}return n},"walk");return JSON.stringify(e(t))}d(canonicalJson,"canonicalJson"),exports.RENDER_PIN_FIELDS=["render","renderLite","renderCover","resolveOutputHints"],exports.TEMPLATE_WRAPPED_FROM_KEY=Symbol.for("m0saic.templateWrappedFrom");function renderSourceText(t){if(typeof t!="function")return;let e=t;const i=new Set;for(;;){const s=e[exports.TEMPLATE_WRAPPED_FROM_KEY];if(typeof s!="function"||i.has(s))break;i.add(e),e=s}return stripComments(Function.prototype.toString.call(e).replace(/\r\n?/g,`
7
+ `)).text}d(renderSourceText,"renderSourceText");function pickDefinitionFields(t){const e={};for(const i of exports.DEFINITION_PIN_FIELDS)e[i]=t[i];return e}d(pickDefinitionFields,"pickDefinitionFields");function definitionFieldsSha256(t){return(0,crypto_1.createHash)("sha256").update(canonicalJson(pickDefinitionFields(t)),"utf8").digest("hex")}d(definitionFieldsSha256,"definitionFieldsSha256");function definitionSha256(t){const e=pickDefinitionFields(t);for(const i of exports.RENDER_PIN_FIELDS)e[i]=renderSourceText(t[i]);return(0,crypto_1.createHash)("sha256").update(canonicalJson(e),"utf8").digest("hex")}d(definitionSha256,"definitionSha256");function registeringSourcePath(t,e){let i=e.split(path.sep).join("/");return path.isAbsolute(e)?i=path.relative(t,e).split(path.sep).join("/"):i.startsWith("packages/templates/")&&(i=i.slice(19)),i.startsWith("dist/")&&i.endsWith(".js")&&(i=`src/${i.slice(5,-3)}.ts`),i}d(registeringSourcePath,"registeringSourcePath");function liveRegistrationOf(t,e,i){return{id:t,file:e,definitionSha256:definitionSha256(i),fieldsSha256:definitionFieldsSha256(i)}}d(liveRegistrationOf,"liveRegistrationOf");function checkRegistryPins(t,e){var i,s;const n=(i=t.registry)!==null&&i!==void 0?i:{},o=new Map(e.map(c=>[c.id,c])),r={ok:!0,pinned:Object.keys(n).length,held:[],missing:[],moved:[],redefined:[],unpinned:[]};for(const c of Object.keys(n).sort()){const l=n[c],f=o.get(c);if(!f){r.missing.push({id:c,file:l.file});continue}if(f.file!==l.file){r.moved.push({id:c,pinnedFile:l.file,file:f.file});continue}if(f.definitionSha256!==l.definitionSha256){const u=(s=l.fieldsSha256)!==null&&s!==void 0?s:l.definitionSha256,p=f.fieldsSha256!==void 0&&f.fieldsSha256===u?"render body":"fields";r.redefined.push({id:c,file:f.file,reason:p});continue}r.held.push(c)}for(const c of e)c.id in n||r.unpinned.push(c.id);return r.unpinned.sort(),r.ok=r.missing.length===0&&r.moved.length===0&&r.redefined.length===0,r}d(checkRegistryPins,"checkRegistryPins");function pinnedWebIds(t){var e;const i=(e=t.registry)!==null&&e!==void 0?e:{};return Object.keys(i).filter(s=>i[s].web===!0).sort()}d(pinnedWebIds,"pinnedWebIds");function webRegistryPins(t){var e,i,s,n;const o=(e=t.registry)!==null&&e!==void 0?e:{},r={};for(const c of pinnedWebIds(t)){const l=o[c],f={file:(i=l.webFile)!==null&&i!==void 0?i:l.file,definitionSha256:(s=l.webDefinitionSha256)!==null&&s!==void 0?s:l.definitionSha256},u=(n=l.webFieldsSha256)!==null&&n!==void 0?n:l.webDefinitionSha256===void 0?l.fieldsSha256:void 0;u!==void 0&&(f.fieldsSha256=u),r[c]=f}return{registry:r}}d(webRegistryPins,"webRegistryPins");function unfrozenPinFiles(t){var e;const i=[],s=(e=t.registry)!==null&&e!==void 0?e:{};for(const n of Object.keys(s).sort()){const o=s[n];for(const r of[o.file,o.webFile])r!==void 0&&t.files[r]===void 0&&i.push({id:n,file:r})}return i}d(unfrozenPinFiles,"unfrozenPinFiles");function isFrozenPath(t){const e=t.split(path.sep).join("/");return!e.startsWith(`${exports.FROZEN_SRC_ROOT}/`)||!isFreezableSource(e)?!1:e.split("/").some(s=>/^v\d+$/.test(s)||s==="_shared")}d(isFrozenPath,"isFrozenPath");function isFreezableSource(t){return t.endsWith(".ts")&&!t.endsWith(".test.ts")&&!t.endsWith(".d.ts")}d(isFreezableSource,"isFreezableSource");function relativeImportSpecifiers(t){const{text:e}=stripComments(t.replace(/\r\n?/g,`
8
+ `)),i=/(?:\bfrom\s*|\bimport\s*\(?\s*|\brequire\s*\(\s*)["']([^"']+)["']/g,s=[];let n;for(;n=i.exec(e);){const o=n[1];(o.startsWith("./")||o.startsWith("../"))&&s.push(o)}return s}d(relativeImportSpecifiers,"relativeImportSpecifiers");function resolveFrozenImport(t,e,i){const s=path.join(t,"src"),n=path.resolve(path.dirname(e),i),o=n.endsWith(".ts")?[n]:n.endsWith(".js")?[`${n.slice(0,-3)}.ts`]:[`${n}.ts`,path.join(n,"index.ts")];for(const r of o){if(!r.startsWith(s+path.sep))continue;let c=!1;try{c=fs.statSync(r).isFile()}catch{}if(!c)continue;const l=path.relative(t,r).split(path.sep).join("/");return isFreezableSource(l)?l:void 0}}d(resolveFrozenImport,"resolveFrozenImport");function collectFrozenFiles(t){const e=[],i=d(o=>{let r;try{r=fs.readdirSync(o,{withFileTypes:!0})}catch{return}for(const c of r){const l=path.join(o,c.name);if(c.isDirectory()){i(l);continue}const f=path.relative(t,l).split(path.sep).join("/");isFrozenPath(f)&&e.push(f)}},"walk");i(path.join(t,exports.FROZEN_SRC_ROOT));const s=new Set(e),n=[...e];for(;n.length;){const o=n.pop(),r=path.join(t,o);let c;try{c=fs.readFileSync(r,"utf8")}catch{continue}for(const l of relativeImportSpecifiers(c)){const f=resolveFrozenImport(t,r,l);f!==void 0&&!s.has(f)&&(s.add(f),n.push(f))}}return[...s].sort()}d(collectFrozenFiles,"collectFrozenFiles");function templateFolderOf(t){const e=t.split(path.sep).join("/").split("/"),i=exports.FROZEN_SRC_ROOT.split("/");if(!i.some((s,n)=>e[n]!==s))for(let s=i.length;s<e.length-1;s++){if(e[s].startsWith("_"))return;if(/^v\d+$/.test(e[s]))return e.slice(0,s+1).join("/")}}d(templateFolderOf,"templateFolderOf");function templateFolderOfId(t){const e=t.split("/");if(!(e.length<3||!/^v\d+$/.test(e[e.length-1])))return`${exports.FROZEN_SRC_ROOT}/${e.slice(1).join("/")}`}d(templateFolderOfId,"templateFolderOfId");function mintShippedMap(t,e,i){var s;const n=new Map;for(const l of Object.keys(t)){const f=templateFolderOf(l);if(!f)continue;const u=n.get(f);u?u.push(l):n.set(f,[l])}const o=(s=e?.files)!==null&&s!==void 0?s:{},r=e!==null&&manifestHashVersion(e)===exports.FREEZE_HASH_VERSION,c={};for(const l of[...n.keys()].sort()){const u=n.get(l).every(E=>o[E]!==void 0&&(!r||o[E]===t[E])),p=e?e.shipped!==void 0?e.shipped[l]:e.release:void 0;c[l]=u&&typeof p=="string"&&p?p:i}return c}d(mintShippedMap,"mintShippedMap");function shippedLineFor(t,e,i){if(!t)return null;if(t.shipped===void 0)return typeof t.release=="string"?t.release:null;for(const s of[templateFolderOfId(e),i?templateFolderOf(i):void 0])if(s!==void 0&&typeof t.shipped[s]=="string")return t.shipped[s];return null}d(shippedLineFor,"shippedLineFor");function shippedLineCounts(t){var e;const i={};for(const s of Object.values(t))i[s]=((e=i[s])!==null&&e!==void 0?e:0)+1;return i}d(shippedLineCounts,"shippedLineCounts");function checkTemplateCatalog(t){var e,i;const s=t.problems.map(o=>`catalog: ${o}`),n=[];for(const o of Object.keys(t.catalog).sort()){t.registeredIds.has(o)||s.push(`${o}: described in the catalog but not registered \u2014 drop the entry or fix the id`);const r=(e=t.catalog[o].deprecated)===null||e===void 0?void 0:e.replacement;r!==void 0&&(t.registeredIds.has(String(r))?t.deprecatedIds.has(String(r))&&n.push(`${o}: deprecated.replacement ${r} is itself deprecated \u2014 point at the live version`):s.push(`${o}: deprecated.replacement ${r} is not registered`))}for(const o of Object.keys(t.declaredInFile).sort()){const r=t.declaredInFile[o];r.length&&!t.pinnedIds.has(o)&&s.push(`${o}: declares ${r.join(", ")} in its code \u2014 since 0.3.1 these live in its catalog sidecar, <name>.catalog.json beside the code (catalogSidecar)`)}for(const o of[...(i=t.minted)!==null&&i!==void 0?i:[]].sort())t.deprecatedIds.has(o)||s.push(`${o}: deprecated at the last release \u2014 a shipped deprecation is permanent; restore its catalog entry`);return{ok:s.length===0,errors:s,warnings:n}}d(checkTemplateCatalog,"checkTemplateCatalog");function readFreezeManifest(t){const e=path.join(t,exports.FREEZE_MANIFEST_FILE);return fs.existsSync(e)?JSON.parse(fs.readFileSync(e,"utf8")):null}d(readFreezeManifest,"readFreezeManifest");function checkFreeze(t,e){const i={ok:!0,unchanged:[],changed:[],deleted:[],unfrozen:[],lowConfidence:[]},s=manifestHashVersion(e);if(s!==exports.FREEZE_HASH_VERSION)return i.ok=!1,i.hashVersionMismatch={manifest:s,checker:exports.FREEZE_HASH_VERSION,message:describeHashVersionMismatch(s)},i;const n=new Set(collectFrozenFiles(t));for(const o of Object.keys(e.files))!n.has(o)&&fs.existsSync(path.join(t,o))&&n.add(o);for(const o of[...n].sort()){const r=e.files[o];if(r===void 0){i.unfrozen.push(o);continue}const{hash:c,confident:l}=hashSource(fs.readFileSync(path.join(t,o),"utf8"));l||i.lowConfidence.push(o),c===r?i.unchanged.push(o):i.changed.push(o)}for(const o of Object.keys(e.files))n.has(o)||i.deleted.push(o);return i.ok=i.changed.length===0&&i.deleted.length===0,i}d(checkFreeze,"checkFreeze");function mintFreezeManifest(t,e,i,s){var n,o,r,c,l;const f={};for(const p of collectFrozenFiles(t))f[p]=hashSource(fs.readFileSync(path.join(t,p),"utf8")).hash;const u={...e,hashVersion:exports.FREEZE_HASH_VERSION,files:f};if(u.shipped=mintShippedMap(f,(n=s?.previous)!==null&&n!==void 0?n:null,e.release),s?.deprecated&&(u.deprecated=[...new Set(s.deprecated)].sort()),i){const p=new Set((o=i.webIds)!==null&&o!==void 0?o:[]),E=new Map(((r=i.webLive)!==null&&r!==void 0?r:[]).map(a=>[a.id,a])),S={};for(const a of[...i.live].sort((g,_)=>g.id<_.id?-1:g.id>_.id?1:0)){const g={file:a.file,definitionSha256:a.definitionSha256};if(a.fieldsSha256!==void 0&&(g.fieldsSha256=a.fieldsSha256),p.has(a.id)){g.web=!0;const _=E.get(a.id);_&&(_.file!==a.file||_.definitionSha256!==a.definitionSha256)&&(g.webFile=_.file,g.webDefinitionSha256=_.definitionSha256,_.fieldsSha256!==void 0&&(g.webFieldsSha256=_.fieldsSha256))}S[a.id]=g}u.registry=S;const b=unfrozenPinFiles(u);if(b.length)throw new Error(`refusing to mint: ${b.length} registry pin(s) name a file the manifest does not hash \u2014 `+b.map(a=>`${a.id} \u2190 ${a.file}`).join("; ")+". A pin over unhashed code is not a lock; the frozen set is the import closure of every vN/ and _shared/ file, so this means the registering module was not reached from a frozen file (or its provenance is unknown).");const h=(c=s?.previous)!==null&&c!==void 0?c:null;for(const a of Object.keys(S)){if(shippedLineFor(u,a,S[a].file)!==null)continue;const g=templateFolderOfId(a);if(!g)continue;const _=(l=h?.registry)===null||l===void 0?void 0:l[a],m=h?h.shipped!==void 0?h.shipped[g]:h.release:void 0;u.shipped[g]=_&&_.definitionSha256===S[a].definitionSha256&&typeof m=="string"&&m?m:e.release}u.shipped=Object.fromEntries(Object.keys(u.shipped).sort().map(a=>[a,u.shipped[a]]));const F=Object.keys(S).filter(a=>shippedLineFor(u,a,S[a].file)===null);if(F.length)throw new Error(`refusing to mint: ${F.length} registry pin(s) sit in no template folder the manifest hashes, so no shipped line can be recorded \u2014 `+F.map(a=>`${a} \u2190 ${S[a].file}`).join("; "))}return u}d(mintFreezeManifest,"mintFreezeManifest");
@@ -1 +1 @@
1
- "use strict";var a=Object.defineProperty;var u=(r,e)=>a(r,"name",{value:e,configurable:!0});var __createBinding=this&&this.__createBinding||(Object.create?(function(r,e,t,i){i===void 0&&(i=t);var n=Object.getOwnPropertyDescriptor(e,t);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:u(function(){return e[t]},"get")}),Object.defineProperty(r,i,n)}):(function(r,e,t,i){i===void 0&&(i=t),r[i]=e[t]})),__exportStar=this&&this.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&__createBinding(e,r,t)};Object.defineProperty(exports,"__esModule",{value:!0}),exports.listRegisteredTemplateIds=exports.getTemplate=exports.requireTemplate=void 0,require("./m0saic");var template_utils_1=require("@m0saic/template-utils");Object.defineProperty(exports,"requireTemplate",{enumerable:!0,get:u(function(){return template_utils_1.requireTemplate},"get")}),Object.defineProperty(exports,"getTemplate",{enumerable:!0,get:u(function(){return template_utils_1.getTemplate},"get")}),Object.defineProperty(exports,"listRegisteredTemplateIds",{enumerable:!0,get:u(function(){return template_utils_1.listRegisteredTemplateIds},"get")}),__exportStar(require("./m0saic"),exports),__exportStar(require("./repo"),exports),__exportStar(require("./webTemplateIds"),exports);
1
+ "use strict";var a=Object.defineProperty;var u=(r,e)=>a(r,"name",{value:e,configurable:!0});var __createBinding=this&&this.__createBinding||(Object.create?(function(r,e,t,i){i===void 0&&(i=t);var n=Object.getOwnPropertyDescriptor(e,t);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:u(function(){return e[t]},"get")}),Object.defineProperty(r,i,n)}):(function(r,e,t,i){i===void 0&&(i=t),r[i]=e[t]})),__exportStar=this&&this.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&__createBinding(e,r,t)};Object.defineProperty(exports,"__esModule",{value:!0}),exports.listRegisteredTemplateIds=exports.getTemplate=exports.requireTemplate=void 0,require("./catalog"),require("./m0saic");var template_utils_1=require("@m0saic/template-utils");Object.defineProperty(exports,"requireTemplate",{enumerable:!0,get:u(function(){return template_utils_1.requireTemplate},"get")}),Object.defineProperty(exports,"getTemplate",{enumerable:!0,get:u(function(){return template_utils_1.getTemplate},"get")}),Object.defineProperty(exports,"listRegisteredTemplateIds",{enumerable:!0,get:u(function(){return template_utils_1.listRegisteredTemplateIds},"get")}),__exportStar(require("./m0saic"),exports),__exportStar(require("./repo"),exports),__exportStar(require("./webTemplateIds"),exports),__exportStar(require("./catalog"),exports);
@@ -0,0 +1 @@
1
+ "use strict";var O=Object.defineProperty;var u=(n,e)=>O(n,"name",{value:e,configurable:!0});Object.defineProperty(exports,"__esModule",{value:!0}),exports.labelOf=void 0,exports.withAddHandles=withAddHandles,exports.addHandlesByLabel=addHandlesByLabel,exports.sourcesOfTree=sourcesOfTree,exports.firstLabelPresent=firstLabelPresent;const template_utils_1=require("@m0saic/template-utils"),sameEntry=u((n,e)=>{var i,t;return n.propKey===e.propKey&&n.index===e.index&&JSON.stringify((i=n.path)!==null&&i!==void 0?i:null)===JSON.stringify((t=e.path)!==null&&t!==void 0?t:null)},"sameEntry");function withAddHandles(n,e){var i,t,l;const s=n,r=(t=(i=s.editor)===null||i===void 0?void 0:i.bindings)!==null&&t!==void 0?t:!((l=s.editor)===null||l===void 0)&&l.binding?[s.editor.binding]:[],o=e.filter(a=>!r.some(f=>sameEntry(f,a)));if(o.length===0)return n;const d=(0,template_utils_1.bindProps)(s,[...r,...o]);return r.forEach((a,f)=>{var p,v;const c=(v=(p=d.editor)===null||p===void 0?void 0:p.bindings)===null||v===void 0?void 0:v[f],{range:b,focus:_}=a;c&&b&&(c.range={...b}),c&&_&&(c.focus={..._})}),d.editor&&delete d.editor.binding,d}u(withAddHandles,"withAddHandles");const labelOf=u(n=>{var e;return(e=n.editor)===null||e===void 0?void 0:e.label},"labelOf");exports.labelOf=labelOf;function addHandlesByLabel(n,e,i={}){var t,l;const s=new Map;for(const r of n){const o=(0,exports.labelOf)(r);if(!o||!Object.prototype.hasOwnProperty.call(e,o))continue;const d=(t=s.get(o))!==null&&t!==void 0?t:0;if(s.set(o,d+1),d>0&&(!((l=i.first)===null||l===void 0)&&l.includes(o)))continue;const a=e[o];withAddHandles(r,typeof a=="function"?a(r,d):a)}}u(addHandlesByLabel,"addHandlesByLabel");function sourcesOfTree(n,e){const i=[...n],t=new Set,l=u(s=>{var r;for(const o of Object.values(s??{}))!o||t.has(o)||(t.add(o),i.push(...(r=o.sources)!==null&&r!==void 0?r:[]),l(o.children))},"walk");return l(e),i}u(sourcesOfTree,"sourcesOfTree");function firstLabelPresent(n,e){return e.find(i=>n.some(t=>(0,exports.labelOf)(t)===i))}u(firstLabelPresent,"firstLabelPresent");
@@ -0,0 +1 @@
1
+ "use strict";var _=Object.defineProperty;var o=(t,n)=>_(t,"name",{value:n,configurable:!0});Object.defineProperty(exports,"__esModule",{value:!0}),exports.STAND_IN_TILE_ALT=exports.STAND_IN_TILE=exports.STAND_IN_CANVAS=void 0,exports.markIncomplete=markIncomplete,exports.isStandIn=isStandIn,exports.mediaStandInDocument=mediaStandInDocument;const dsl_stdlib_1=require("@m0saic/dsl-stdlib"),template_utils_1=require("@m0saic/template-utils");exports.STAND_IN_CANVAS="#11141a",exports.STAND_IN_TILE="#1c212b",exports.STAND_IN_TILE_ALT="#232a36";const STAND_IN_EDGE="#3a4352",STAND_IN_INK="#e6e9ef",STAND_IN_INK_SOFT="#9aa3b2";function markIncomplete(t,n){return t.engine={renderStatus:"incomplete",renderError:{message:n}},t}o(markIncomplete,"markIncomplete");function isStandIn(t){var n;return((n=t?.sources)!==null&&n!==void 0?n:[]).some(e=>{var i;return((i=e?.engine)===null||i===void 0?void 0:i.renderStatus)==="incomplete"})}o(isStandIn,"isStandIn");const line=o((t,n,e,i)=>(0,template_utils_1.tag)({type:"text",visual:{backgroundColor:"black@0"},layers:[{content:{kind:"literal",text:t},style:{fontSize:n,fontColor:e},placement:{fit:"contain",hAlign:"center",vAlign:"middle"}}]},i),"line");function mediaStandInDocument(t){const n=Math.max(1,Math.round(t.width)),e=Math.max(1,Math.round(t.height)),i=Math.min(n,e),a=Math.max(14,Math.round(i*.055)),l=Math.max(11,Math.round(i*.028)),s=(0,template_utils_1.bindProps)((0,template_utils_1.tag)((0,template_utils_1.makeColorTile)(exports.STAND_IN_TILE,{effects:{rounding:{cornerStyle:"rounded",borderRadius:.06},stroke:{position:"inner",width:.004,color:STAND_IN_EDGE,alpha:1}}}),"stand-in-slot"),t.handles),d=t.nested?s:markIncomplete(s,`${t.name}: ${t.title}`),r=!!(t.hint&&t.hint.trim()),c=`1{${String(r?(0,dsl_stdlib_1.weightedSplit)([40,12,8,40],"row",{claimants:["-","1","1","-"]}):(0,dsl_stdlib_1.weightedSplit)([44,12,44],"row",{claimants:["-","1","-"]}))}}`,u=String((0,dsl_stdlib_1.weightedSplit)([7,86,7],"col",{claimants:["-",c,"-"]})),m=String((0,dsl_stdlib_1.weightedSplit)([9,82,9],"row",{claimants:["-",u,"-"]}));return{kind:"mosaic_document",version:1,assets:{},m0:m,sources:[d,line(t.title,a,STAND_IN_INK,"stand-in-title"),...r?[line(t.hint,l,STAND_IN_INK_SOFT,"stand-in-hint")]:[]],backgroundColor:exports.STAND_IN_CANVAS,size:{width:n,height:e},...t.fps!=null?{fps:t.fps}:{},...t.durationMs!=null?{durationMs:t.durationMs}:{},audio:{mode:"off"}}}o(mediaStandInDocument,"mediaStandInDocument");
@@ -1 +1 @@
1
- "use strict";var c=Object.defineProperty;var o=(r,e)=>c(r,"name",{value:e,configurable:!0});var __createBinding=this&&this.__createBinding||(Object.create?(function(r,e,t,i){i===void 0&&(i=t);var n=Object.getOwnPropertyDescriptor(e,t);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(r,i,n)}):(function(r,e,t,i){i===void 0&&(i=t),r[i]=e[t]})),__exportStar=this&&this.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&__createBinding(e,r,t)};Object.defineProperty(exports,"__esModule",{value:!0}),__exportStar(require("./v1"),exports);
1
+ "use strict";var u=Object.defineProperty;var o=(r,e)=>u(r,"name",{value:e,configurable:!0});var __createBinding=this&&this.__createBinding||(Object.create?(function(r,e,t,i){i===void 0&&(i=t);var n=Object.getOwnPropertyDescriptor(e,t);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(r,i,n)}):(function(r,e,t,i){i===void 0&&(i=t),r[i]=e[t]})),__exportStar=this&&this.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&__createBinding(e,r,t)};Object.defineProperty(exports,"__esModule",{value:!0}),__exportStar(require("./v1"),exports),__exportStar(require("./v2"),exports);
@@ -0,0 +1 @@
1
+ "use strict";var de=Object.defineProperty;var l=(t,n)=>de(t,"name",{value:n,configurable:!0});Object.defineProperty(exports,"__esModule",{value:!0}),exports.AgentCommitFeedV2=exports.SAMPLE_COMMITS=void 0;const types_1=require("@m0saic/types"),dsl_stdlib_1=require("@m0saic/dsl-stdlib"),template_utils_1=require("@m0saic/template-utils"),alpine_card_1=require("../../../alpine/_shared/alpine-card"),alpine_theme_1=require("../../../alpine/_shared/alpine-theme"),alpine_anim_1=require("../../../alpine/_shared/alpine-anim"),alpine_conventions_1=require("../../../alpine/_shared/alpine-conventions"),canvas_handles_1=require("../../../_shared/canvas-handles"),TEMPLATE_ID="@m0saic/agents/commit-feed/v2",FEED_TEMPLATE_ID="@m0saic/alpine/commit-feed/v2",MAX_COMMITS=7,DEFAULT_AGENT_COLOR="#EF7525",DEFAULT_HUMAN_COLOR="#388bfd",DEFAULT_ANIM={renderMode:"premium",introFrac:.7,reduceMotion:!1};exports.SAMPLE_COMMITS=[{title:"dsl: snapGrid builder \u2014 zero-distortion guttered grids",author:"Quentin S",agent:"Claude Code",pr:412,date:"Sep 8",reviewers:["Ada L"]},{title:"release: dsl-stdlib v2.0.0",author:"Quentin S",pr:415,date:"Sep 9",area:"release"},{title:"tests: goldens for placeRects at the 7-canvas sweep",author:"Ada L",agent:"Copilot",pr:418,date:"Sep 10",reviewers:["Quentin S"]},{title:"fix: overlay alpha lost under alphamerge",author:"Quentin S",agent:"Claude Code",pr:421,date:"Sep 11",reviewers:["Ada L","Sam K"]},{title:"docs: handbook \u2014 feasibility vs precision",author:"Sam K",pr:423,date:"Sep 11",area:"handbook"},{title:"perf: cache mask rasters by content hash",author:"Ada L",agent:"Cursor",pr:426,date:"Sep 12",reviewers:["Quentin S"]},{title:"ci: pin the darwin golden toolchain",author:"Sam K",pr:428,date:"Sep 12",area:"ci",reviewers:["Ada L"]}];const propsSchema=(0,template_utils_1.definePropsSchema)({title:{type:"string",required:!1},subtitle:{type:"string",required:!1},commits:{type:"list",required:!0,meta:{list:{max:24}},itemSchema:{title:{type:"string",required:!0,description:"Commit subject.",meta:{ui:{label:"Title"}}},author:{type:"string",required:!0,description:"The human on the commit.",meta:{ui:{label:"Author"}}},agent:{type:"string",required:!1,description:"The coding agent that wrote it; empty = human.",meta:{control:{placeholder:"human"},ui:{label:"Agent"}}},pr:{type:"string",required:!1,description:"PR number.",meta:{control:{placeholder:"none"},ui:{label:"PR"}}},date:{type:"string",required:!1,description:"Short date.",meta:{control:{placeholder:"none"},ui:{label:"Date"}}},area:{type:"string",required:!1,description:"Area touched (human rows).",meta:{control:{placeholder:"none"},ui:{label:"Area"}}},reviewers:{type:"list",required:!1,description:"Reviewer names.",meta:{ui:{label:"Reviewers"}},itemSchema:{type:"string"}}}},preset:{type:"string",required:!1,meta:{constraints:{oneOf:["light","dark"]}}},agentColor:{type:"string",required:!1,meta:{constraints:{isColor:!0},control:{colorPicker:!0}}},humanColor:{type:"string",required:!1,meta:{constraints:{isColor:!0},control:{colorPicker:!0}}},anim:{type:"group",required:!1,fields:{reduceMotion:alpine_conventions_1.ALPINE_ANIM_FIELDS_BARE.reduceMotion,introFrac:alpine_conventions_1.ALPINE_ANIM_FIELDS_BARE.introFrac,renderMode:(0,alpine_conventions_1.bEnum)(["premium","light"])}},theme:{type:"json",required:!1,meta:{ui:{consumer:"agent"}}},debugLayout:{type:"boolean",required:!1}}),pct=l((t,n)=>n>0?Math.round(100*t/n):0,"pct"),isAgent=l(t=>typeof t.agent=="string"&&t.agent.trim().length>0,"isAgent");function roundTile(t,n){return(0,template_utils_1.makeColorTile)(t,{effects:{rounding:{cornerStyle:"rounded",borderRadius:n}}})}l(roundTile,"roundTile");function shareTile(t,n,i,c,s){const o=l((g,p,M)=>Math.max(M,Math.min(g,Math.floor((c*.94-2)/(Math.max(1,(0,template_utils_1.textEmUnits)(p))*.72)))),"cap"),d=o(Math.round(s*.42),`${t}%`,14),r=o(Math.round(s*.15),n,9),m=(0,alpine_card_1.rowSplit)([{weight:8,node:alpine_card_1.EMPTY},{weight:52,node:(0,alpine_card_1.paint)((0,template_utils_1.tag)((0,alpine_card_1.textCell)(`${t}%`,d,i.title,"center","bottom"),"share-value"))},{weight:24,node:(0,alpine_card_1.paint)((0,template_utils_1.tag)((0,alpine_card_1.textCell)(n,r,i.muted,"center","top"),"share-label"))},{weight:16,node:alpine_card_1.EMPTY}]);return(0,alpine_card_1.overlay)([(0,alpine_card_1.paint)((0,template_utils_1.tag)(roundTile(i.grid,.12),"share-tile")),m])}l(shareTile,"shareTile");function shareBar(t,n,i,c){const s=Math.max(1,t+n),o=Math.max(1,Math.round(t/s*100)),d=Math.max(1,100-o);return(0,alpine_card_1.colSplit)([{weight:o,node:(0,alpine_card_1.paint)((0,template_utils_1.tag)(roundTile(i,.5),"bar-agent"))},{weight:1,node:alpine_card_1.EMPTY},{weight:d,node:(0,alpine_card_1.paint)((0,template_utils_1.tag)(roundTile(c,.5),"bar-human"))}])}l(shareBar,"shareBar");function legendEntry(t,n,i,c,s,o,d){const r=Math.max(6,Math.round(d*.42)),m=Math.round(r*.6),g=Math.max(8,o-r-m),p=Math.max(4,g*.94-2),M=Math.max(1,(0,template_utils_1.textEmUnits)(n)),f=Math.max(10,Math.min(i,Math.floor(p/(M*.72)))),T=(0,template_utils_1.fitEmUnits)(n,Math.floor(p/(f*.72))),_=l(y=>Math.max(1,Math.round(y/o*100)),"w"),u=Math.max(0,Math.round((d-r)/2)),b=(0,alpine_card_1.rowSplit)([{weight:Math.max(1,u),node:alpine_card_1.EMPTY},{weight:Math.max(1,r),node:(0,alpine_card_1.paint)((0,template_utils_1.tag)(roundTile(t,1),`${s}-dot`))},{weight:Math.max(1,d-r-u),node:alpine_card_1.EMPTY}]);return(0,alpine_card_1.colSplit)([{weight:_(r),node:b},{weight:_(m),node:alpine_card_1.EMPTY},{weight:_(g),node:(0,alpine_card_1.paint)((0,template_utils_1.tag)((0,alpine_card_1.textCell)(T,f,c,"left","middle"),`${s}-text`))}])}l(legendEntry,"legendEntry"),exports.AgentCommitFeedV2={id:(0,types_1.asTemplateId)(TEMPLATE_ID),version:2,capabilities:{tier:"core"},aspectRatio:{ideal:16/10,min:1,max:2.2,mode:"warn"},outputHints:{format:{kind:"video",container:"mp4"},width:1280,height:800,fps:30,durationMs:3e3,posterTimeMs:2850},propsSchema,bindings:{unbound:{...alpine_conventions_1.ALPINE_ANIM_UNBOUND,theme:"theme source"}},defaultProps:{title:"Who wrote this week's commits?",subtitle:"m0saic-dsl/m0 \xB7 Sep 8\u201312",commits:exports.SAMPLE_COMMITS,preset:"light",agentColor:DEFAULT_AGENT_COLOR,humanColor:DEFAULT_HUMAN_COLOR,anim:{...DEFAULT_ANIM},debugLayout:!1},async render(t,n){var i,c,s,o,d,r,m,g,p;const M=Math.max(1,Math.round(n.target.width)),f=Math.max(1,Math.round(n.target.height)),T=l(e=>(0,template_utils_1.makeErrorMosaic)(e,{title:"Agent Commit Feed",width:M,height:f}),"fail"),_=((i=t.commits)!==null&&i!==void 0?i:[]).map((e,h)=>({c:e,srcIndex:h})).filter(({c:e})=>e&&typeof e.title=="string"&&e.title.trim()).slice(0,MAX_COMMITS),u=_.map(e=>e.c);if(u.length===0)return(0,template_utils_1.makeIncompleteMosaic)("Add a commit \u2014 each one needs a title and an author.",{title:"Agent Commit Feed",width:M,height:f});const b=await(0,alpine_theme_1.resolveAlpineTheme)((c=t.preset)!==null&&c!==void 0?c:"light",n,t.theme),y=t.agentColor&&t.agentColor.trim()?t.agentColor:DEFAULT_AGENT_COLOR,I=t.humanColor&&t.humanColor.trim()?t.humanColor:DEFAULT_HUMAN_COLOR,A={...DEFAULT_ANIM,...(s=t.anim)!==null&&s!==void 0?s:{}},Q=!A.reduceMotion,V=Math.max(.1,((o=n.target.durationMs)!==null&&o!==void 0?o:3e3)/1e3),z=Math.max(.1,Math.min(1,A.introFrac)*V),x=u.filter(isAgent).length,N=u.length-x,$=pct(x,u.length),D=[...new Set(u.filter(isAgent).map(e=>e.agent.trim()))],P=(0,alpine_card_1.alpineCard)({theme:b,W:M,H:f,title:t.title,subtitle:t.subtitle}),a=P.contentRect,H=Math.round(a.h*.03),F=Math.round(a.h*.22),K=Math.round(a.h*.05),L=Math.max(1,a.h-H-F-K),w=l((e,h)=>Math.max(1,Math.round(e/h*100)),"wOf"),q=Math.round(a.w*.2),R=Math.round(a.w*.03),U=Math.max(10,Math.round(f*.024)),X=`${x} by ${D.length?D.join(", "):"agents"}`,J=`${N} by ${N===1?"a human":"humans"}`,W=a.w-q-R,G=Math.round(F*.3),Z=Math.round(W*.04),j=Math.round((W-Z)/2),ee=(0,alpine_card_1.rowSplit)([{weight:18,node:alpine_card_1.EMPTY},{weight:22,node:shareBar(x,N,y,I)},{weight:16,node:alpine_card_1.EMPTY},{weight:30,node:(0,alpine_card_1.colSplit)([{weight:48,node:legendEntry(y,X,U,b.label,"legend-agent",j,G)},{weight:4,node:alpine_card_1.EMPTY},{weight:48,node:legendEntry(I,J,U,b.label,"legend-human",j,G)}])},{weight:14,node:alpine_card_1.EMPTY}]),B=(0,alpine_card_1.colSplit)([{weight:w(q,a.w),node:shareTile($,"agent-authored",b,q,F)},{weight:w(R,a.w),node:alpine_card_1.EMPTY},{weight:w(a.w-q-R,a.w),node:ee}]),Y=a.w,te=u.map(e=>{var h;const v=isAgent(e);return{kind:v?"agent":"human",title:e.title,author:e.author,area:v?e.agent.trim():e.area,...e.pr!=null&&e.pr!==""?{pr:e.pr}:{},...e.date?{date:e.date}:{},...!((h=e.reviewers)===null||h===void 0)&&h.length?{reviewers:e.reviewers}:{},signal:"neutral"}}),ne={...n,target:{width:Y,height:L,fps:n.target.fps,durationMs:n.target.durationMs},output:{...n.output,width:Y,height:L}};let E;try{E=await(0,template_utils_1.renderNestedTemplate)(FEED_TEMPLATE_ID,{rows:te,preset:(d=t.preset)!==null&&d!==void 0?d:"light",showHeader:!1,backgroundColor:b.card,washColor:b.card,accent:y,kindColors:{agent:y,human:I},kindGlyphs:{agent:"blocks",human:"dot"},anim:{renderMode:A.renderMode,introFrac:A.introFrac,reduceMotion:A.reduceMotion}},ne,{slot:{width:Y,height:L,fps:n.target.fps,durationMs:n.target.durationMs}})}catch(e){return T(`the nested commit feed failed: ${e instanceof Error?e.message:String(e)}`)}if(E.kind!=="mosaic_document")return T(`the nested commit feed rendered a ${E.kind}`);const ae=(0,alpine_card_1.paint)((0,template_utils_1.tag)({type:"mosaic",ref:"feed",placement:{fit:"contain"}},"feed")),oe=Q?(0,alpine_anim_1.revealFadeNode)(B,0,Math.max(.1,z*.35)):B,re=(0,alpine_card_1.rowSplit)([{weight:w(H,a.h),node:alpine_card_1.EMPTY},{weight:w(F,a.h),node:oe},{weight:w(K,a.h),node:alpine_card_1.EMPTY},{weight:w(L,a.h),node:ae}]),k=P.compose(re);for(const e of(r=E.sources)!==null&&r!==void 0?r:[]){const h=(g=(m=e.editor)===null||m===void 0?void 0:m.bindings)!==null&&g!==void 0?g:!((p=e.editor)===null||p===void 0)&&p.binding?[e.editor.binding]:[];if(!e.editor||h.length===0)continue;delete e.editor.binding,delete e.editor.bindings;const v=[];for(const S of h){if(S.propKey!=="rows"||!Array.isArray(S.path)||typeof S.path[0]!="number")continue;const O=_[S.path[0]];if(!O)continue;const C=S.path[1]==="area"?isAgent(O.c)?"agent":"area":S.path[1];C!=="title"&&C!=="author"&&C!=="date"&&C!=="pr"&&C!=="agent"&&C!=="area"||v.push({propKey:"commits",path:[O.srcIndex,C],kind:"string"})}v.length&&(0,template_utils_1.bindProps)(e,v)}(0,canvas_handles_1.addHandlesByLabel)(k.sources,{"bar-agent":[{propKey:"agentColor"}],"legend-agent-dot":[{propKey:"agentColor"}],"bar-human":[{propKey:"humanColor"}],"legend-human-dot":[{propKey:"humanColor"}]}),(0,alpine_conventions_1.bindHeaderAddHandles)(k.sources,t,"share-value");const ie={kind:"mosaic_document",version:1,assets:{},m0:(0,dsl_stdlib_1.toM0String)(k.m0,"AgentCommitFeedV1"),sources:(0,alpine_conventions_1.bindCardSurface)(k.sources),backgroundColor:P.backgroundColor,fps:n.target.fps,durationMs:n.target.durationMs,size:{width:M,height:f},children:{feed:E},editor:{label:`Agent Commit Feed \xB7 ${$}% agent-authored`}},se=[...P.constraints,{label:"share-value",textFits:{}},{label:"share-label",textFits:{}},{label:"legend-agent-text",textFits:{}},{label:"legend-human-text",textFits:{}},{label:"legend-agent-dot",aspect:1,aspectTolerance:.2},{label:"legend-human-dot",aspect:1,aspectTolerance:.2},{label:"feed",minHeightFrac:.4}];return(0,template_utils_1.withLayoutContract)(ie,n,{templateId:TEMPLATE_ID,constraints:se,relations:[],flatten:!1,debug:t.debugLayout===!0})}},(0,template_utils_1.registerTemplate)(exports.AgentCommitFeedV2),exports.default=exports.AgentCommitFeedV2;
@@ -0,0 +1 @@
1
+ "use strict";var u=Object.defineProperty;var t=(e,r)=>u(e,"name",{value:r,configurable:!0});var __importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.AgentCommitFeedV2=void 0;var commit_feed_1=require("./commit-feed");Object.defineProperty(exports,"AgentCommitFeedV2",{enumerable:!0,get:t(function(){return commit_feed_1.AgentCommitFeedV2},"get")});var commit_feed_2=require("./commit-feed");Object.defineProperty(exports,"default",{enumerable:!0,get:t(function(){return __importDefault(commit_feed_2).default},"get")});
@@ -1 +1 @@
1
- "use strict";var c=Object.defineProperty;var o=(r,e)=>c(r,"name",{value:e,configurable:!0});var __createBinding=this&&this.__createBinding||(Object.create?(function(r,e,t,i){i===void 0&&(i=t);var n=Object.getOwnPropertyDescriptor(e,t);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(r,i,n)}):(function(r,e,t,i){i===void 0&&(i=t),r[i]=e[t]})),__exportStar=this&&this.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&__createBinding(e,r,t)};Object.defineProperty(exports,"__esModule",{value:!0}),__exportStar(require("./v1"),exports);
1
+ "use strict";var u=Object.defineProperty;var o=(r,e)=>u(r,"name",{value:e,configurable:!0});var __createBinding=this&&this.__createBinding||(Object.create?(function(r,e,t,i){i===void 0&&(i=t);var n=Object.getOwnPropertyDescriptor(e,t);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:o(function(){return e[t]},"get")}),Object.defineProperty(r,i,n)}):(function(r,e,t,i){i===void 0&&(i=t),r[i]=e[t]})),__exportStar=this&&this.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&__createBinding(e,r,t)};Object.defineProperty(exports,"__esModule",{value:!0}),__exportStar(require("./v1"),exports),__exportStar(require("./v2"),exports);
@@ -0,0 +1 @@
1
+ "use strict";var i=Object.defineProperty;var t=(e,r)=>i(e,"name",{value:r,configurable:!0});var __importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.default=exports.TraceTimelineV2=void 0;var trace_timeline_1=require("./trace-timeline");Object.defineProperty(exports,"TraceTimelineV2",{enumerable:!0,get:t(function(){return trace_timeline_1.TraceTimelineV2},"get")});var trace_timeline_2=require("./trace-timeline");Object.defineProperty(exports,"default",{enumerable:!0,get:t(function(){return __importDefault(trace_timeline_2).default},"get")});
@@ -0,0 +1 @@
1
+ "use strict";var At=Object.defineProperty;var i=(e,n)=>At(e,"name",{value:n,configurable:!0});Object.defineProperty(exports,"__esModule",{value:!0}),exports.TraceTimelineV2=exports.SAMPLE_SPANS=void 0,exports.fmtTokens=fmtTokens,exports.fmtSeconds=fmtSeconds,exports.fmtTick=fmtTick,exports.tickStepMs=tickStepMs;const types_1=require("@m0saic/types"),dsl_stdlib_1=require("@m0saic/dsl-stdlib"),template_utils_1=require("@m0saic/template-utils"),alpine_card_1=require("../../../alpine/_shared/alpine-card"),alpine_theme_1=require("../../../alpine/_shared/alpine-theme"),alpine_anim_1=require("../../../alpine/_shared/alpine-anim"),alpine_conventions_1=require("../../../alpine/_shared/alpine-conventions"),canvas_handles_1=require("../../../_shared/canvas-handles"),TEMPLATE_ID="@m0saic/agents/trace-timeline/v2",MAX_SPANS=10,DEFAULT_ERROR="#f85149",DEFAULT_RETRY="#e3b341",DEFAULT_CACHED="#8b949e",DEFAULT_ANIM={renderMode:"premium",introFrac:.7,reduceMotion:!1},STATUSES=["ok","error","retry","cached"];exports.SAMPLE_SPANS=[{tool:"plan",target:"read the failing report, pick a fix",startMs:0,durMs:1800,tokens:1900},{tool:"read_file",target:"package.json",startMs:1800,durMs:500,tokens:400},{tool:"grep",target:"renderNested",startMs:2300,durMs:800,tokens:600},{tool:"read_file",target:"render/renderNestedTemplate.ts",startMs:3100,durMs:900,tokens:2200},{tool:"edit",target:"business-card.ts",startMs:4e3,durMs:2500,tokens:3100},{tool:"bash",target:"npm test -w templates",startMs:6500,durMs:12700,tokens:900,status:"error"},{tool:"read_file",target:"layout.test.ts",startMs:19200,durMs:800,tokens:800},{tool:"edit",target:"layout.ts",startMs:2e4,durMs:2400,tokens:1400},{tool:"bash",target:"npm test -w templates",startMs:22400,durMs:12200,tokens:900,status:"retry"},{tool:"git",target:"diff --stat",startMs:34600,durMs:900,tokens:300,status:"cached"}];const propsSchema=(0,template_utils_1.definePropsSchema)({title:{type:"string",required:!1},subtitle:{type:"string",required:!1},spans:{type:"list",required:!0,meta:{list:{max:40}},itemSchema:{tool:{type:"string",required:!0,description:"Tool or phase.",meta:{ui:{label:"Tool"}}},target:{type:"string",required:!1,description:"What it touched.",meta:{control:{placeholder:"none"},ui:{label:"Target"}}},startMs:{type:"number",required:!0,description:"Start (ms from run start).",meta:{ui:{label:"Start ms"}}},durMs:{type:"number",required:!0,description:"Duration (ms).",meta:{ui:{label:"Duration ms"}}},tokens:{type:"number",required:!1,description:"Tokens on this hop.",meta:{control:{placeholder:"none"},ui:{label:"Tokens"}}},status:{type:"string",required:!1,description:"ok \xB7 error \xB7 retry \xB7 cached.",meta:{constraints:{oneOf:STATUSES},control:{placeholder:"ok"},ui:{label:"Status"}}}}},preset:{type:"string",required:!1,meta:{constraints:{oneOf:["light","dark"]}}},accent:{type:"string",required:!1,meta:{constraints:{isColor:!0},control:{colorPicker:!0}}},errorColor:{type:"string",required:!1,meta:{constraints:{isColor:!0},control:{colorPicker:!0}}},retryColor:{type:"string",required:!1,meta:{constraints:{isColor:!0},control:{colorPicker:!0}}},cachedColor:{type:"string",required:!1,meta:{constraints:{isColor:!0},control:{colorPicker:!0}}},showTokens:{type:"boolean",required:!1},anim:{type:"group",required:!1,fields:{reduceMotion:alpine_conventions_1.ALPINE_ANIM_FIELDS_BARE.reduceMotion,introFrac:alpine_conventions_1.ALPINE_ANIM_FIELDS_BARE.introFrac,renderMode:(0,alpine_conventions_1.bEnum)(["premium","light"])}},theme:{type:"json",required:!1,meta:{ui:{consumer:"agent"}}},debugLayout:{type:"boolean",required:!1}}),color=i((e,n)=>e&&e.trim()?e:n,"color");function fmtTokens(e){return e>=1e6?`${(e/1e6).toFixed(1)}M`:e>=1e3?`${(e/1e3).toFixed(1)}k`:String(Math.round(e))}i(fmtTokens,"fmtTokens");function fmtSeconds(e){const n=e/1e3;return n>=100?`${Math.round(n)}s`:n>=10?`${n.toFixed(1)}s`:`${n.toFixed(2)}s`}i(fmtSeconds,"fmtSeconds");function fmtTick(e,n){return e===0?"0":n>=1e3&&e%1e3===0?`${e/1e3}s`:n<1e3?`${e}ms`:fmtSeconds(e)}i(fmtTick,"fmtTick");function tickStepMs(e){const n=e/6,d=Math.pow(10,Math.floor(Math.log10(Math.max(1,n))));for(const p of[1,2,5,10])if(p*d>=n)return p*d;return 10*d}i(tickStepMs,"tickStepMs");function roundTile(e,n){return(0,template_utils_1.makeColorTile)(e,{effects:{rounding:{cornerStyle:"rounded",borderRadius:n}}})}i(roundTile,"roundTile");function capFont(e,n,d,p){return Math.max(p,Math.min(e,Math.floor((d*.94-2)/(Math.max(1,(0,template_utils_1.textEmUnits)(n))*.72))))}i(capFont,"capFont");function fitText(e,n,d){return(0,template_utils_1.fitEmUnits)(e,Math.floor((d*.94-2)/(n*.72)))}i(fitText,"fitText"),exports.TraceTimelineV2={id:(0,types_1.asTemplateId)(TEMPLATE_ID),version:2,capabilities:{tier:"core"},aspectRatio:{ideal:16/10,min:1,max:2.2,mode:"warn"},outputHints:{format:{kind:"video",container:"mp4"},width:1280,height:800,fps:30,durationMs:3e3,posterTimeMs:2850},propsSchema,bindings:{unbound:{...alpine_conventions_1.ALPINE_ANIM_UNBOUND,theme:"theme source"}},defaultProps:{title:"One agent run, end to end",spans:exports.SAMPLE_SPANS,preset:"light",errorColor:DEFAULT_ERROR,retryColor:DEFAULT_RETRY,cachedColor:DEFAULT_CACHED,showTokens:!0,anim:{...DEFAULT_ANIM},debugLayout:!1},async render(e,n){var d,p,A,F,q;const v=Math.max(1,Math.round(n.target.width)),M=Math.max(1,Math.round(n.target.height)),U=((d=e.spans)!==null&&d!==void 0?d:[]).map((t,o)=>({s:t,srcIndex:o})).filter(({s:t})=>t&&typeof t.tool=="string"&&t.tool.trim()&&Number.isFinite(t.startMs)&&Number.isFinite(t.durMs)&&t.durMs>=0&&t.startMs>=0).slice(0,MAX_SPANS),g=U.map(t=>t.s);if(g.length===0)return(0,template_utils_1.makeIncompleteMosaic)("Add a span \u2014 a tool name, when it started and how long it ran.",{title:"Agent Trace Timeline",width:v,height:M});const B={ok:"accent",error:"errorColor",retry:"retryColor",cached:"cachedColor"},f=i((t,o,s)=>({propKey:"spans",path:[U[t].srcIndex,o],kind:s}),"leaf"),u=await(0,alpine_theme_1.resolveAlpineTheme)((p=e.preset)!==null&&p!==void 0?p:"light",n,e.theme),W={ok:color(e.accent,u.primary),error:color(e.errorColor,DEFAULT_ERROR),retry:color(e.retryColor,DEFAULT_RETRY),cached:color(e.cachedColor,DEFAULT_CACHED)},V=e.showTokens!==!1,L={...DEFAULT_ANIM,...(A=e.anim)!==null&&A!==void 0?A:{}},st=!L.reduceMotion,it=L.renderMode==="light",lt=Math.max(.1,((F=n.target.durationMs)!==null&&F!==void 0?F:3e3)/1e3),j=Math.max(.1,Math.min(1,L.introFrac)*lt),h=Math.max(1,...g.map(t=>t.startMs+t.durMs)),K=g.reduce((t,o)=>{var s;return t+((s=o.tokens)!==null&&s!==void 0?s:0)},0),G=((q=e.subtitle)!==null&&q!==void 0?q:"").trim()||`${g.length} tool calls \xB7 ${fmtSeconds(h)} wall time${K>0?` \xB7 ${fmtTokens(K)} tokens`:""}`,_=(0,alpine_card_1.alpineCard)({theme:u,W:v,H:M,title:e.title,subtitle:G}),r=_.contentRect,a=i((t,o)=>Math.max(1,Math.round(t/o*100)),"wOf"),N=g.length,z=Math.round(r.h*.07),b=Math.round(r.h*.08),X=Math.round(r.h*.02),J=Math.round(r.h*.04),Q=Math.max(1,r.h-z-X-b-J),Z=Math.max(1,Math.floor(Q/N)),tt=Math.max(2,Math.round(Z*.18)),et=Math.max(1,Z-tt),c=Math.round(r.w*.28),y=Math.round(r.w*.02),l=Math.max(1,r.w-c-y),dt=V?Math.round(r.w*.06):0,ct=Math.max(10,Math.round(M*.024)),$=Math.max(9,Math.round(M*.018)),ut=Math.max(9,Math.round(M*.018)),ht=Math.max(9,Math.round(M*.017)),mt=Math.max(10,Math.round(M*.02)),pt=Math.max(.05,j/(1+.5*Math.max(0,N-1))),Mt=i((t,o)=>{if(!st)return t;const s=j*o/Math.max(1,N);return it?(0,alpine_anim_1.revealGateNode)(t,s):(0,alpine_anim_1.revealFadeNode)(t,s,pt)},"reveal"),ot=tickStepMs(h),Y=[];for(let t=0;t<=h;t+=ot)Y.push(t);const gt=Y.map((t,o)=>{var s;const x=(s=Y[o+1])!==null&&s!==void 0?s:h,w=Math.max(1,Math.round((x-t)/h*l)),m=fmtTick(t,ot);return{weight:a(w,l),node:(0,alpine_card_1.paint)((0,template_utils_1.tag)((0,alpine_card_1.textCell)(m,capFont(ut,m,w,8),u.muted,"left","bottom"),"axis-tick"))}}),ft=(0,alpine_card_1.colSplit)([{weight:a(c+y,r.w),node:alpine_card_1.EMPTY},{weight:a(l,r.w),node:(0,alpine_card_1.colSplit)(gt)}]),xt=i((t,o)=>{var s;const x=STATUSES.includes(t.status)?t.status:"ok",w=W[x],m=t.tool.trim(),O=((s=t.target)!==null&&s!==void 0?s:"").trim(),E=capFont(ct,m,c,9),Pt=O?(0,alpine_card_1.rowSplit)([{weight:55,node:(0,alpine_card_1.paint)((0,template_utils_1.bindProps)((0,template_utils_1.tag)((0,alpine_card_1.textCell)(fitText(m,E,c),E,u.title,"left","bottom"),"span-tool"),[f(o,"tool","string")]))},{weight:45,node:(0,alpine_card_1.paint)((0,template_utils_1.bindProps)((0,template_utils_1.tag)((0,alpine_card_1.textCell)(fitText(O,$,c),capFont($,fitText(O,$,c),c,8),u.muted,"left","top"),"span-target"),[f(o,"target","string")]))}]):(0,alpine_card_1.paint)((0,template_utils_1.bindProps)((0,template_utils_1.tag)((0,alpine_card_1.textCell)(fitText(m,E,c),E,u.title,"left","middle"),"span-tool"),[f(o,"tool","string"),f(o,"target","string")])),H=Math.round(Math.min(t.startMs,h)/h*l),nt=Math.max(Math.round(et*.35),Math.round(t.durMs/h*l)),rt=Math.max(0,l-H-nt),C=V&&t.tokens!=null&&t.tokens>0?fmtTokens(t.tokens):"",k=C?Math.min(rt,dt):0,at=Math.max(0,rt-k),St=(0,alpine_card_1.rowSplit)([{weight:20,node:alpine_card_1.EMPTY},{weight:60,node:(0,alpine_card_1.paint)((0,template_utils_1.bindProps)((0,template_utils_1.tag)(roundTile(w,.5),`span-bar-${x}`),[f(o,"durMs","number"),f(o,"startMs","number"),{propKey:B[x]},...C&&k>0?[]:[f(o,"tokens","number")]]))},{weight:20,node:alpine_card_1.EMPTY}]),T=[];H>0&&T.push({weight:a(H,l),node:alpine_card_1.EMPTY}),T.push({weight:a(nt,l),node:St}),k>0&&T.push({weight:a(k,l),node:(0,alpine_card_1.paint)((0,template_utils_1.bindProps)((0,template_utils_1.tag)((0,alpine_card_1.textCell)(C,capFont(ht,C,k*.86,8),u.muted,"left","middle",{left:.14}),"span-tokens"),[f(o,"tokens","number")]))}),at>0&&T.push({weight:a(at,l),node:alpine_card_1.EMPTY});const Et=(0,alpine_card_1.overlay)([(0,alpine_card_1.paint)((0,template_utils_1.tag)(roundTile(u.grid,.3),"lane-wash")),(0,alpine_card_1.colSplit)(T)]),Ct=(0,alpine_card_1.colSplit)([{weight:a(c,r.w),node:Pt},{weight:a(y,r.w),node:alpine_card_1.EMPTY},{weight:a(l,r.w),node:Et}]);return Mt(Ct,o)},"laneNode"),I=[];g.forEach((t,o)=>{o>0&&I.push({weight:tt,node:alpine_card_1.EMPTY}),I.push({weight:et,node:xt(t,o)})});const wt=(0,alpine_card_1.rowSplit)(I),R=STATUSES.filter(t=>t==="ok"||g.some(o=>o.status===t)),P=Math.round(l*.2),bt=i(t=>{const o=Math.max(8,Math.round(b*.5)),s=Math.round(o*.5),x=P-o-s,w=t==="ok"?"ok":t,m=Math.max(1,Math.round((b-o)/2));return(0,alpine_card_1.colSplit)([{weight:a(o,P),node:(0,alpine_card_1.rowSplit)([{weight:m,node:alpine_card_1.EMPTY},{weight:o,node:(0,alpine_card_1.paint)((0,template_utils_1.tag)(roundTile(W[t],1),`legend-${t}-dot`))},{weight:Math.max(1,b-o-m),node:alpine_card_1.EMPTY}])},{weight:a(s,P),node:alpine_card_1.EMPTY},{weight:a(x,P),node:(0,alpine_card_1.paint)((0,template_utils_1.tag)((0,alpine_card_1.textCell)(w,capFont(mt,w,x*.8,8),u.label,"left","middle"),`legend-${t}-text`))}])},"legendEntry"),D=[];R.forEach((t,o)=>{o>0&&D.push({weight:2,node:alpine_card_1.EMPTY}),D.push({weight:20,node:bt(t)})});const kt=(0,alpine_card_1.colSplit)([{weight:a(c+y,r.w),node:alpine_card_1.EMPTY},{weight:a(l,r.w),node:(0,alpine_card_1.colSplit)([...D,{weight:Math.max(1,100-R.length*22),node:alpine_card_1.EMPTY}])}]),Tt=(0,alpine_card_1.rowSplit)([{weight:a(z,r.h),node:ft},{weight:a(X,r.h),node:alpine_card_1.EMPTY},{weight:a(Q,r.h),node:wt},{weight:a(J,r.h),node:alpine_card_1.EMPTY},{weight:a(b,r.h),node:kt}]),S=_.compose(Tt);(0,canvas_handles_1.addHandlesByLabel)(S.sources,Object.fromEntries(STATUSES.map(t=>[`legend-${t}-dot`,[{propKey:B[t]}]]))),(0,alpine_conventions_1.bindHeaderAddHandles)(S.sources,{title:e.title,subtitle:G},"span-tool");const _t={kind:"mosaic_document",version:1,assets:{},m0:(0,dsl_stdlib_1.toM0String)(S.m0,"TraceTimelineV1"),sources:(0,alpine_conventions_1.bindCardSurface)(S.sources),backgroundColor:_.backgroundColor,fps:n.target.fps,durationMs:n.target.durationMs,size:{width:v,height:M},editor:{label:`Agent Trace Timeline \xB7 ${g.length} calls \xB7 ${fmtSeconds(h)}`}},yt=[..._.constraints,{label:"span-tool",textFits:{}},{label:"axis-tick",textFits:{}},{label:"lane-wash",minWidthFrac:.5},...R.flatMap(t=>[{label:`legend-${t}-dot`,aspect:1,aspectTolerance:.5},{label:`legend-${t}-text`,textFits:{}}])];return(0,template_utils_1.withLayoutContract)(_t,n,{templateId:TEMPLATE_ID,constraints:yt,relations:[],debug:e.debugLayout===!0})}},(0,template_utils_1.registerTemplate)(exports.TraceTimelineV2),exports.default=exports.TraceTimelineV2;
@@ -0,0 +1 @@
1
+ "use strict";var c=Object.defineProperty;var r=(e,t)=>c(e,"name",{value:t,configurable:!0});Object.defineProperty(exports,"__esModule",{value:!0}),exports.CARD_HANDLES=exports.withAddHandles=exports.ALPINE_ANIM_UNBOUND=exports.ALPINE_THEME_UNBOUND=exports.ALPINE_THEME_GROUP_BARE=exports.ALPINE_ANIM_FIELDS_BARE=exports.bFrac=exports.bNum=exports.bEnum=exports.bStr=exports.bBool=void 0,exports.findCardHeader=findCardHeader,exports.bindHeaderAddHandles=bindHeaderAddHandles,exports.bindCardSurface=bindCardSurface;const canvas_handles_1=require("../../_shared/canvas-handles"),bBool=r(()=>({type:"boolean",required:!1}),"bBool");exports.bBool=bBool;const bStr=r(()=>({type:"string",required:!1}),"bStr");exports.bStr=bStr;const bEnum=r(e=>({type:"string",required:!1,meta:{constraints:{oneOf:e}}}),"bEnum");exports.bEnum=bEnum;const bNum=r((e,t)=>({type:"number",required:!1,...e||t?{meta:{...t?{constraints:t}:{},...e?{control:e}:{}}}:{}}),"bNum");exports.bNum=bNum;const bFrac=r(()=>(0,exports.bNum)({flavor:"slider",step:.05},{min:0,max:1}),"bFrac");exports.bFrac=bFrac,exports.ALPINE_ANIM_FIELDS_BARE={reduceMotion:(0,exports.bBool)(),introFrac:(0,exports.bFrac)(),easing:(0,exports.bEnum)(["easeOut","smoothstep","easeInOut","linear"])},exports.ALPINE_THEME_GROUP_BARE={type:"group",required:!1,fields:{slug:(0,exports.bStr)(),preset:(0,exports.bStr)(),namespace:(0,exports.bStr)(),forceFetch:(0,exports.bBool)()}},exports.ALPINE_THEME_UNBOUND={"theme.slug":"theme source","theme.preset":"theme source","theme.namespace":"theme source"},exports.ALPINE_ANIM_UNBOUND={"anim.introFrac":"timing"};var canvas_handles_2=require("../../_shared/canvas-handles");Object.defineProperty(exports,"withAddHandles",{enumerable:!0,get:r(function(){return canvas_handles_2.withAddHandles},"get")});function findCardHeader(e){return e.find(t=>{var s;return((s=t.editor)===null||s===void 0?void 0:s.label)==="card-header"})}r(findCardHeader,"findCardHeader");const hasText=r(e=>typeof e=="string"&&e.trim().length>0,"hasText");function bindHeaderAddHandles(e,t,s,d={title:"title",subtitle:"subtitle"}){const n=[...hasText(t.title)?[]:[{propKey:d.title}],...hasText(t.subtitle)?[]:[{propKey:d.subtitle}]];if(n.length===0)return;const o=findCardHeader(e),u=(typeof s=="string"?[s]:s).find(i=>e.some(a=>{var p;return((p=a.editor)===null||p===void 0?void 0:p.label)===i})),l=o??e.find(i=>{var a;return((a=i.editor)===null||a===void 0?void 0:a.label)===u});l&&(0,canvas_handles_1.withAddHandles)(l,n)}r(bindHeaderAddHandles,"bindHeaderAddHandles"),exports.CARD_HANDLES=[{propKey:"preset"}];function bindCardSurface(e,t=exports.CARD_HANDLES){const s=e.find(d=>{var n;const o=d;return o.type==="lavfi"&&typeof o.color=="string"&&!!(!((n=o.effects)===null||n===void 0)&&n.rounding)&&!o.mask&&!o.overlay});return s&&(0,canvas_handles_1.withAddHandles)(s,t),e}r(bindCardSurface,"bindCardSurface");
@@ -0,0 +1 @@
1
+ "use strict";var Kt=Object.defineProperty;var i=(e,t)=>Kt(e,"name",{value:t,configurable:!0});Object.defineProperty(exports,"__esModule",{value:!0}),exports.AlpineBarGraphV2=void 0;const types_1=require("@m0saic/types"),template_utils_1=require("@m0saic/template-utils"),dsl_stdlib_1=require("@m0saic/dsl-stdlib"),alpine_card_1=require("../../_shared/alpine-card"),alpine_theme_1=require("../../_shared/alpine-theme"),onboarding_cover_1=require("../../../_shared/onboarding-cover"),alpine_conventions_1=require("../../_shared/alpine-conventions"),canvas_handles_1=require("../../../_shared/canvas-handles"),DEFAULT_PRESET="light",DEFAULT_RENDER_MODE="premium",DEFAULT_ORIENTATION="horizontal",DEFAULT_GAP=.55,DEFAULT_BAR_RADIUS=.4,DEFAULT_GRID={show:!0,count:3},DEFAULT_VALUE_LABELS={show:!0,format:"compact",decimals:1,suffix:""},DEFAULT_ANIM={renderMode:DEFAULT_RENDER_MODE,introFrac:.7,ease:"smoothstep",reduceMotion:!1};function easeExpr(e,t){return e==="linear"?t:`(${t})*(${t})*(3-2*(${t}))`}i(easeExpr,"easeExpr");const Q=100,STEP=2,snap=i((e,t)=>Math.max(t,Math.round(e/t)*t),"snap"),equalBands=i((e,t)=>Array.from({length:e},(n,r)=>({weight:1,node:t(r)})),"equalBands"),gapInsetFrac=i(e=>e/(2*(1+e)),"gapInsetFrac");function niceAxis(e,t,n){if(t===e)return{min:e,max:t+1,step:1,ticks:[e,t+1]};const h=Math.abs(t-e)/Math.max(1,n-1),m=!Number.isFinite(h)||h<=0?1:(0,dsl_stdlib_1.niceNum)(h,[1,2,2.5,5]),B=Math.floor(e/m)*m,R=Math.ceil(t/m)*m,U=[],H=m*1e-6;for(let k=B;k<=R+H;k+=m)U.push(Number(k.toFixed(6)));return{min:B,max:R,step:m,ticks:U}}i(niceAxis,"niceAxis");function formatCompact(e,t){const n=Math.abs(e),r=e<0?"-":"",h=i(m=>m.replace(/\.0+$/,""),"trim");return n>=1e12?r+h((n/1e12).toFixed(t))+"T":n>=1e9?r+h((n/1e9).toFixed(t))+"B":n>=1e6?r+h((n/1e6).toFixed(t))+"M":n>=1e3?r+h((n/1e3).toFixed(t))+"K":r+h(n.toFixed(t))}i(formatCompact,"formatCompact");function formatValue(e,t,n){let r;switch(t.format){case"raw":r=e.toFixed(t.decimals);break;case"percent":r=n===0?0 .toFixed(t.decimals)+"%":(e/n*100).toFixed(t.decimals)+"%";break;case"compact":default:r=formatCompact(e,t.decimals);break}return t.suffix?`${r}${t.suffix}`:r}i(formatValue,"formatValue");function edgeStrip(e,t,n){return{type:"lavfi",color:e,fitMode:"content",visual:{opacity:t},size:n==="top"||n==="bottom"?{wExpr:"TW",hExpr:"max(1,TH*0.004)"}:{wExpr:"max(1,TW*0.004)",hExpr:"TH"},placement:{fit:"contain",hAlign:n==="left"?"left":n==="right"?"right":"center",vAlign:n==="top"?"top":n==="bottom"?"bottom":"middle"}}}i(edgeStrip,"edgeStrip");const propsSchema=(0,template_utils_1.definePropsSchema)({values:{type:"number[]",required:!0,meta:{constraints:{minItems:1},control:{flavor:"numberList"}}},labels:{type:"string[]",required:!1},title:{type:"string",required:!1},subtitle:{type:"string",required:!1},orientation:{type:"string",required:!1,meta:{constraints:{oneOf:["horizontal","vertical"]}}},preset:{type:"string",required:!1,meta:{constraints:{oneOf:["light","dark"]}}},barColor:{type:"string",required:!1,meta:{constraints:{isColor:!0},control:{colorPicker:!0,defaultColor:"#2563EB"}}},bars:{type:"group",required:!1,fields:{thickness:(0,alpine_conventions_1.bNum)({flavor:"slider",step:.05},{min:.1,max:1}),gap:(0,alpine_conventions_1.bNum)({flavor:"slider",step:.05},{min:0,max:2}),cornerRadius:(0,alpine_conventions_1.bFrac)()}},grid:{type:"group",required:!1,fields:{show:(0,alpine_conventions_1.bBool)(),count:(0,alpine_conventions_1.bNum)({flavor:"slider",step:1},{min:1,max:8})}},valueLabels:{type:"group",required:!1,fields:{show:(0,alpine_conventions_1.bBool)(),format:(0,alpine_conventions_1.bEnum)(["compact","raw","percent"]),decimals:(0,alpine_conventions_1.bNum)(void 0,{min:0,max:6}),suffix:(0,alpine_conventions_1.bStr)()}},domain:{type:"group",required:!1,fields:{minValue:(0,alpine_conventions_1.bNum)(),maxValue:(0,alpine_conventions_1.bNum)()}},anim:{type:"group",required:!1,fields:{renderMode:(0,alpine_conventions_1.bEnum)(["premium","light"]),reduceMotion:alpine_conventions_1.ALPINE_ANIM_FIELDS_BARE.reduceMotion,introFrac:alpine_conventions_1.ALPINE_ANIM_FIELDS_BARE.introFrac,ease:(0,alpine_conventions_1.bEnum)(["smoothstep","easeInOut","linear"])}},theme:{type:"group",required:!1,fields:{slug:(0,alpine_conventions_1.bStr)(),preset:(0,alpine_conventions_1.bStr)(),namespace:(0,alpine_conventions_1.bStr)(),forceFetch:(0,alpine_conventions_1.bBool)()}},debugLayout:{type:"boolean",required:!1}});exports.AlpineBarGraphV2={id:(0,types_1.asTemplateId)("@m0saic/alpine/bar-graph/v2"),version:2,capabilities:{tier:"core"},outputHints:{format:{kind:"video",container:"mp4"},width:1280,height:800,fps:30,durationMs:2e3,posterTimeMs:1900},bindings:{unbound:{...alpine_conventions_1.ALPINE_THEME_UNBOUND,...alpine_conventions_1.ALPINE_ANIM_UNBOUND,"bars.gap":"geometry"}},propsSchema,defaultProps:{domain:{minValue:0},debugLayout:!1,theme:{forceFetch:!1},values:[12400,8700,5600,2100,1200],labels:["Email","Twitter","Reddit","Hacker News","Other"],title:"BAR CHART",subtitle:"Sales by Channel",orientation:DEFAULT_ORIENTATION,preset:DEFAULT_PRESET,bars:{gap:DEFAULT_GAP,cornerRadius:DEFAULT_BAR_RADIUS},grid:DEFAULT_GRID,valueLabels:DEFAULT_VALUE_LABELS,anim:DEFAULT_ANIM},async render(e,t){var n,r,h,m,B,R,U,H,k,ct,dt,ut;const z=Math.max(1,Math.round(t.target.width)),C=Math.max(1,Math.round(t.target.height));if(!Array.isArray(e.values)||e.values.length===0)return(0,template_utils_1.makeIncompleteMosaic)("Add a value \u2014 one number per bar.",{title:"Bar Chart",width:z,height:C});const s=await(0,alpine_theme_1.resolveAlpineTheme)((n=e.preset)!==null&&n!==void 0?n:DEFAULT_PRESET,t,e.theme),xt=(0,alpine_card_1.resolveColor)(e.barColor,s.primary),vt=(r=e.orientation)!==null&&r!==void 0?r:DEFAULT_ORIENTATION,j={gap:DEFAULT_GAP,cornerRadius:DEFAULT_BAR_RADIUS,...(h=e.bars)!==null&&h!==void 0?h:{}},J=(m=e.domain)!==null&&m!==void 0?m:{},Rt=Math.max(0,j.gap),Ut=Math.max(0,Math.min(1,j.cornerRadius)),G={...DEFAULT_GRID,...(B=e.grid)!==null&&B!==void 0?B:{}},P={...DEFAULT_VALUE_LABELS,...(R=e.valueLabels)!==null&&R!==void 0?R:{}},q={...DEFAULT_ANIM,...(U=e.anim)!==null&&U!==void 0?U:{}},wt=((H=q.renderMode)!==null&&H!==void 0?H:DEFAULT_RENDER_MODE)==="light",X=e.values,I=X.length,W=(k=e.labels)!==null&&k!==void 0?k:[],D=W.length>0,qt=Math.max(.1,((ct=t.target.durationMs)!==null&&ct!==void 0?ct:2e3)/1e3),_t=Math.max(.1,Math.min(1,q.introFrac)*qt),ht=Math.min(.15,_t*.08),Et=.45,Z=Math.max(.05,(_t-ht)/(1+Et*Math.max(0,I-1))),yt=Et*Z,At=(dt=J.minValue)!==null&&dt!==void 0?dt:0,St=(ut=J.maxValue)!==null&&ut!==void 0?ut:Math.max(...X),It=J.minValue!=null&&J.maxValue!=null;let V=At,S=St,E=Math.max(1,G.count);if(!It){const o=niceAxis(At,St,G.count+1);V=o.min,S=o.max,E=Math.max(1,o.ticks.length-1)}const Tt=S-V,Ft=X.map(o=>Tt===0?1:Math.max(0,Math.min(1,(o-V)/Tt))),K=(0,alpine_card_1.alpineCard)({theme:s,W:z,H:C,title:e.title,subtitle:e.subtitle}),tt=K.contentRect.w,kt=K.contentRect.h,et=Math.max(11,Math.round(C*.022)),at=Math.max(11,Math.round(C*.022)),ot=Math.max(10,Math.round(C*.018)),mt=X.map(o=>formatValue(o,P,S)),Dt=mt.reduce((o,p)=>Math.max(o,p.length),0),O=G.show&&E>=1,pt=j.thickness!=null?(1-Math.max(.05,Math.min(1,j.thickness)))/2:gapInsetFrac(Rt),Ct=i((o,p,x,v)=>{const d={rounding:{cornerStyle:"rounded",borderRadius:Ut}},y=pt>0?{inset:x==="x"?{y:pt}:{x:pt}}:void 0,w=y?{effects:d,placement:y}:{effects:d},_=i(F=>(F.editor={label:"bar"},F),"tag"),L=i(F=>(0,template_utils_1.bindProps)(_(F),[{propKey:"values",index:v},{propKey:"barColor"}]),"bind");if(q.reduceMotion)return(0,alpine_card_1.paint)(L((0,template_utils_1.makeColorTile)(o,w)));const T=easeExpr(q.ease,(0,template_utils_1.u01)(Z)),Y=wt?{}:{alpha:T},N=x==="y"?{startAtSec:p,...Y,yExpr:`h*(1-(${T}))`}:{startAtSec:p,...Y,xExpr:`-(w*(1-(${T})))`};return(0,alpine_card_1.paint)(L((0,template_utils_1.makeColorTile)(o,{...w,overlay:N})))},"barTile"),Pt=i((o,p,x,v,d,y)=>{const w=(0,template_utils_1.bindProp)((0,alpine_card_1.tag)((0,alpine_card_1.textCell)(o,at,s.label,v,d,y),"value-label"),"values",p);if(!q.reduceMotion){const _=x+Z*.45;w.overlay=wt?{startAtSec:_,enable:`gte(t,${_.toFixed(3)})`}:{startAtSec:_,alpha:(0,template_utils_1.u01)(Math.max(.1,Z*.5))}}return(0,alpine_card_1.paint)(w)},"valueLabelNode"),nt={},Lt=i((o,p)=>q.reduceMotion?p:(nt[o]={kind:"mosaic_document",version:1,assets:{},m0:p.m0,sources:p.sources,fps:t.target.fps,durationMs:t.target.durationMs},{m0:"F",sources:[{type:"mosaic",ref:o}]}),"wrapAsChild");let bt;if(vt==="vertical"){const o=O?Math.max(Math.round(tt*.08),ot*3):0,p=D?Math.round(et*1.9):0,x=tt-o,v=kt-p;if(x<16||v<16)return(0,template_utils_1.makeErrorMosaic)("plot area too small",{title:`${this.id}`,width:z,height:C});const d=P.show?snap(at*1.5/v*Q,STEP):0,y=P.show?snap(at*.6/v*Q,STEP):0,w=d+y,_=i(c=>equalBands(I,c),"columnBands"),L=i(c=>{let a=snap(Ft[c]*(Q-w),STEP);a=Math.min(Q-w,Math.max(STEP,a));const l=Q-a,b=d>0&&l>w,u=b?d:0,M=b?y:0,A=ht+c*yt;return(0,alpine_card_1.rowSplit)([{weight:l-u-M,node:alpine_card_1.EMPTY},...u>0?[{weight:u,node:Pt(mt[c],c,A,"center","bottom")}]:[],...M>0?[{weight:M,node:alpine_card_1.EMPTY}]:[],{weight:a,node:Ct(xt,A,"y",c)}])},"barColumn"),T=(0,alpine_card_1.colSplit)(_(L)),N=[...(G.show&&E>1?(0,template_utils_1.buildGridlineSources)({direction:"horizontal",count:E,excludeEdges:!1,origin:"bottom",color:s.grid,opacity:s.gridAlpha,thicknessFrac:.002}).slice(1):[]).map(c=>(0,alpine_card_1.paint)(c)),T];N.push((0,alpine_card_1.paint)(edgeStrip(s.axis,s.axisAlpha,"bottom"))),N.push((0,alpine_card_1.paint)(edgeStrip(s.axis,s.axisAlpha,"left")));const F=Lt("plot",(0,alpine_card_1.overlay)(N)),$=O?(()=>{const c=E+1,a=3,l=20,b=Array.from({length:c},(g,ft)=>formatValue(S-ft/E*(S-V),P,S)),u=Math.max(1,...b.map(g=>(0,template_utils_1.textEmUnits)(g))),M=Math.max(8,Math.min(ot,Math.floor((o-2)/(u*.62)))),A=[];for(let g=0;g<c;g++)A.push({weight:a,node:(0,alpine_card_1.paint)((0,alpine_card_1.tag)((0,alpine_card_1.textCell)(b[g],M,s.muted,"right","middle",{right:.18}),"axis-tick"))}),g<c-1&&A.push({weight:l,node:alpine_card_1.EMPTY});return(0,alpine_card_1.rowSplit)(A)})():alpine_card_1.EMPTY,rt=o>0?(0,alpine_card_1.colSplit)([{weight:o,node:$},{weight:x,node:F}]):F,it=D?(0,alpine_card_1.colSplit)(_(c=>{var a;const l=Math.max(1,...W.map(u=>(0,template_utils_1.textEmUnits)(u??""))),b=Math.max(9,Math.min(et,Math.floor(x/I*.94/(l*.62))));return(0,alpine_card_1.paint)((0,template_utils_1.bindProp)((0,alpine_card_1.tag)((0,alpine_card_1.textCell)((a=W[c])!==null&&a!==void 0?a:"",b,s.label,"center","middle"),"cat-label"),"labels",c))})):alpine_card_1.EMPTY,Mt=D&&o>0?(0,alpine_card_1.colSplit)([{weight:o,node:alpine_card_1.EMPTY},{weight:x,node:it}]):it;bt=(0,alpine_card_1.rowSplit)([{weight:v,node:rt},{weight:p,node:Mt}])}else{const o=D?Math.max(Math.round(tt*.16),et*5):0,p=Math.max(1,...W.map(a=>(0,template_utils_1.textEmUnits)(a??""))),x=Math.max(9,Math.min(et,Math.floor(o*.86/(p*.62)))),v=O?Math.round(ot*1.9):0,d=tt-o,y=kt-v;if(d<16||y<16)return(0,template_utils_1.makeErrorMosaic)("plot area too small",{title:`${this.id}`,width:z,height:C});const w=at*.9*(Dt+2),_=P.show?Math.min(38,snap(w/d*Q,STEP)):0,L=Math.max(STEP*2,Q-_),T=i(a=>equalBands(I,a),"rowBands"),Y=i(a=>{let l=snap(Ft[a]*L,STEP);l=Math.min(L,Math.max(STEP,l));const b=_,u=Q-l,M=ht+a*yt;return(0,alpine_card_1.colSplit)([{weight:l,node:Ct(xt,M,"x",a)},...b>0?[{weight:b,node:Pt(mt[a],a,M,"left","middle",{left:.12})}]:[],{weight:Math.max(0,u-b),node:alpine_card_1.EMPTY}])},"barRow"),N=(0,alpine_card_1.rowSplit)(T(Y)),$=[...(G.show&&E>1?(0,template_utils_1.buildGridlineSources)({direction:"vertical",count:E,excludeEdges:!1,origin:"left",color:s.grid,opacity:s.gridAlpha,thicknessFrac:.002}).slice(1):[]).map(a=>(0,alpine_card_1.paint)(a)),N];$.push((0,alpine_card_1.paint)(edgeStrip(s.axis,s.axisAlpha,"bottom"))),$.push((0,alpine_card_1.paint)(edgeStrip(s.axis,s.axisAlpha,"left")));const rt=Lt("plot",(0,alpine_card_1.overlay)($)),it=D?(0,alpine_card_1.rowSplit)(T(a=>{var l;return(0,alpine_card_1.paint)((0,template_utils_1.bindProp)((0,alpine_card_1.tag)((0,alpine_card_1.textCell)((l=W[a])!==null&&l!==void 0?l:"",x,s.label,"right","middle",{right:.14}),"cat-label"),"labels",a))})):alpine_card_1.EMPTY,Mt=o>0?(0,alpine_card_1.colSplit)([{weight:o,node:it},{weight:d,node:rt}]):rt,c=O?(0,alpine_card_1.colSplit)([...o>0?[{weight:o,node:alpine_card_1.EMPTY}]:[],{weight:d,node:(()=>{const a=E+1,l=20,b=[];for(let f=0;f<a;f++)b.push(formatValue(V+f/E*(S-V),P,S));let u=ot;const M=Math.max(1,...b.map(f=>(0,template_utils_1.textEmUnits)(f))),A=Math.floor(d/a);let g=Math.ceil(M*.62*u)+2;g>A&&(u=Math.max(8,Math.floor(A/(M*.62))),g=Math.ceil(M*.62*u)+2);const ft=d*3/(a*3+(a-1)*l),Ht=g<=ft?3:Math.min(60,Math.ceil(g*(a-1)*l/Math.max(1,d-g*a))),st=[];for(let f=0;f<a;f++)st.push(Ht),f<a-1&&st.push(l);const Gt=(0,template_utils_1.quantizedSections)(d,(0,template_utils_1.latticeWeights)(st)).filter((f,lt)=>lt%2===0),Bt=Math.max(1,Math.min(...Gt));g>Bt&&(u=Math.max(8,Math.floor((Bt-2)/(M*.62))));const Wt=st.map((f,lt)=>lt%2===0?{weight:f,node:(0,alpine_card_1.paint)((0,alpine_card_1.tag)((0,alpine_card_1.textCell)(b[lt/2],u,s.muted,"center","top"),"axis-tick"))}:{weight:f,node:alpine_card_1.EMPTY});return(0,alpine_card_1.colSplit)(Wt)})()}]):alpine_card_1.EMPTY;bt=(0,alpine_card_1.rowSplit)([{weight:y,node:Mt},{weight:v,node:c}])}const gt=K.compose(bt),Nt=(0,canvas_handles_1.sourcesOfTree)(gt.sources,nt);(0,canvas_handles_1.addHandlesByLabel)(Nt,{bar:[{propKey:"bars.cornerRadius"},{propKey:"bars.thickness"}],"value-label":[{propKey:"valueLabels.suffix"},{propKey:"valueLabels.decimals"}],"axis-tick":[{propKey:"grid.count"},{propKey:"domain.minValue"},{propKey:"domain.maxValue"}]}),(0,alpine_conventions_1.bindHeaderAddHandles)(Nt,e,["cat-label","bar"]);const Vt={kind:"mosaic_document",version:1,assets:{},m0:gt.m0,sources:(0,alpine_conventions_1.bindCardSurface)(gt.sources),...Object.keys(nt).length?{children:nt}:{},backgroundColor:K.backgroundColor,fps:t.target.fps,durationMs:t.target.durationMs};return Promise.resolve((0,template_utils_1.withLayoutContract)(Vt,t,{templateId:"@m0saic/alpine/bar-graph/v2",relations:I>=2?[{label:"bar",equal:vt==="horizontal"?"height":"width",tolerance:.02,tolerancePx:1}]:[],constraints:[...K.constraints,...P.show&&I>=1?[{label:"value-label",textFits:{charWidthEm:.62}}]:[],...D?[{label:"cat-label",textFits:{charWidthEm:.62}}]:[],...O?[{label:"axis-tick",textFits:{charWidthEm:.62,padPx:0}}]:[]],debug:e.debugLayout===!0}))},async renderCover(e,t){const n=(0,onboarding_cover_1.brandedCoverHeroBox)(t,"band"),r={...t,target:{...t.target,width:n.width,height:n.height}},h=await exports.AlpineBarGraphV2.render({...exports.AlpineBarGraphV2.defaultProps,anim:{renderMode:"light",introFrac:.7,ease:"smoothstep",reduceMotion:!0}},r);return(0,onboarding_cover_1.buildBrandedCover)({ctx:t,variant:"band",copy:{productName:"Bar Graph",title:"A bar chart."},hero:i(m=>(0,onboarding_cover_1.onboardingFrame)((0,onboarding_cover_1.inlineHeroDoc)(h),m.borderStrong),"hero"),heroAssets:h.assets})}},(0,template_utils_1.registerTemplate)(exports.AlpineBarGraphV2);
@@ -0,0 +1 @@
1
+ "use strict";var a=Object.defineProperty;var e=(r,t)=>a(r,"name",{value:t,configurable:!0});Object.defineProperty(exports,"__esModule",{value:!0}),exports.AlpineBarGraphV2=void 0;var bar_graph_1=require("./bar-graph");Object.defineProperty(exports,"AlpineBarGraphV2",{enumerable:!0,get:e(function(){return bar_graph_1.AlpineBarGraphV2},"get")});
@@ -0,0 +1 @@
1
+ "use strict";var Ae=Object.defineProperty;var r=(o,a)=>Ae(o,"name",{value:a,configurable:!0});Object.defineProperty(exports,"__esModule",{value:!0}),exports.AlpineCommitFeedV3=exports.KIND_MARKS=void 0;const types_1=require("@m0saic/types"),template_utils_1=require("@m0saic/template-utils"),alpine_card_1=require("../../_shared/alpine-card"),alpine_glyphs_1=require("../../_shared/alpine-glyphs"),onboarding_cover_1=require("../../../_shared/onboarding-cover"),alpine_theme_1=require("../../_shared/alpine-theme"),alpine_anim_1=require("../../_shared/alpine-anim"),alpine_conventions_1=require("../../_shared/alpine-conventions"),GLYPH_COLOR="#0d1117",DEFAULT_PRESET="light",SIGNAL_COLOR={win:"#3fb950",warn:"#e3b341",neutral:"#6e7681"};exports.KIND_MARKS={add:"M12.9 4.5a.9.9 0 0 0-1.8 0v6.6H4.5a.9.9 0 0 0 0 1.8h6.6v6.6a.9.9 0 0 0 1.8 0v-6.6h6.6a.9.9 0 0 0 0-1.8h-6.6V4.5Z",dash:"M4.5 10.5h15a1.5 1.5 0 0 1 0 3h-15a1.5 1.5 0 0 1 0-3Z",up:"M12 3.5 19.5 12H15v8.5H9V12H4.5L12 3.5Z",lines:"M5 5.4h14v2.4H5zM5 10.8h14v2.4H5zM5 16.2h9v2.4H5z",check:"M19.8 6.9a1 1 0 0 1 .15 1.41l-8.8 11a1 1 0 0 1-1.5.07l-4.6-4.6a1 1 0 1 1 1.4-1.42l3.8 3.8 8.13-10.16a1 1 0 0 1 1.42-.1Z",dot:"M12 8.4a3.6 3.6 0 1 0 0 7.2 3.6 3.6 0 0 0 0-7.2Z",shield:"M12 2 20 5v6c0 5-3.4 8.6-8 11-4.6-2.4-8-6-8-11V5l8-3Z",back:"M15 5 7 12l8 7V5Z",diamond:"M12 3l7 9-7 9-7-9 7-9Z",box:"M4 8l8-4 8 4v8l-8 4-8-4V8Z",blocks:"M5 5h6v6H5zM13 13h6v6h-6z"};const KIND_COLORS={feat:"#3fb950",fix:"#388bfd",perf:"#a371f7",docs:"#e3b341",test:"#2ea043",chore:"#8b949e",refactor:"#39c5cf",revert:"#f85149",security:"#f0883e",ci:"#db61a2",deps:"#58a6ff"},KIND_GLYPHS={feat:exports.KIND_MARKS.add,fix:exports.KIND_MARKS.dash,perf:exports.KIND_MARKS.up,docs:exports.KIND_MARKS.lines,test:exports.KIND_MARKS.check,chore:exports.KIND_MARKS.dot,refactor:exports.KIND_MARKS.blocks,revert:exports.KIND_MARKS.back,security:exports.KIND_MARKS.shield,ci:exports.KIND_MARKS.diamond,deps:exports.KIND_MARKS.box};function resolveKindMark(o){if(!o)return;if(o.startsWith("M"))return o;const a=exports.KIND_MARKS[o];if(!a)throw new Error(`@m0saic/alpine/commit-feed/v3: unknown kind mark "${o}" \u2014 a KIND_MARKS name (${Object.keys(exports.KIND_MARKS).join(", ")}) or a raw 24x24 SVG path.`);return a}r(resolveKindMark,"resolveKindMark");const REVIEWER_HUES=["#3fb950","#388bfd","#a371f7","#db61a2","#e3b341"],DEFAULT_RENDER_MODE="premium",DEFAULT_ANIM={renderMode:DEFAULT_RENDER_MODE,introFrac:.7,reduceMotion:!1},MAX_ROWS=7;function blend(o,a,c){const f=parseInt(o.slice(1),16),x=parseInt(a.slice(1),16),g=r(w=>Math.round((f>>w&255)+((x>>w&255)-(f>>w&255))*c),"mix");return"#"+[g(16),g(8),g(0)].map(w=>w.toString(16).padStart(2,"0")).join("")}r(blend,"blend");const fmtPr=r(o=>o==null||o===""?"":`#${o}`,"fmtPr"),propsSchema=(0,template_utils_1.definePropsSchema)({rows:{type:"array",required:!0,meta:{control:{flavor:"jsonModal"}}},title:{type:"string",required:!1},subtitle:{type:"string",required:!1},preset:{type:"string",required:!1,meta:{constraints:{oneOf:["light","dark"]}}},showHeader:{type:"boolean",required:!1},accent:{type:"string",required:!1,meta:{constraints:{isColor:!0},control:{colorPicker:!0,defaultColor:"#2563EB"}}},backgroundColor:{type:"string",required:!1,meta:{constraints:{isColor:!0},control:{colorPicker:!0,defaultColor:"#FFFFFF"}}},washColor:{type:"string",required:!1,meta:{constraints:{isColor:!0},control:{colorPicker:!0,defaultColor:"#FFFFFF"}}},anim:{type:"group",required:!1,fields:{renderMode:(0,alpine_conventions_1.bEnum)(["premium","light"]),reduceMotion:alpine_conventions_1.ALPINE_ANIM_FIELDS_BARE.reduceMotion,introFrac:alpine_conventions_1.ALPINE_ANIM_FIELDS_BARE.introFrac}},theme:{type:"group",required:!1,fields:{slug:(0,alpine_conventions_1.bStr)(),preset:(0,alpine_conventions_1.bStr)(),namespace:(0,alpine_conventions_1.bStr)(),forceFetch:(0,alpine_conventions_1.bBool)()}},icon:{type:"string",required:!1,meta:{constraints:{oneOf:alpine_glyphs_1.ALPINE_GLYPH_NAMES},ui:{consumer:"human"},control:{syncsTo:[{prop:"iconPath",map:{kind:"lookup",table:alpine_glyphs_1.ALPINE_GLYPHS}}]}}},iconPath:{type:"string",required:!1,meta:{ui:{consumer:"agent"}}},kindColors:{type:"group",required:!1,meta:{ui:{consumer:"agent"}}},kindGlyphs:{type:"group",required:!1,meta:{ui:{consumer:"agent"}}},debugLayout:{type:"boolean",required:!1}});exports.AlpineCommitFeedV3={id:(0,types_1.asTemplateId)("@m0saic/alpine/commit-feed/v3"),version:3,capabilities:{tier:"core"},outputHints:{format:{kind:"video",container:"mp4"},width:1280,height:720,fps:30,durationMs:3e3,posterTimeMs:2850},bindings:{unbound:{...alpine_conventions_1.ALPINE_THEME_UNBOUND,...alpine_conventions_1.ALPINE_ANIM_UNBOUND,iconPath:"agent value"}},propsSchema,defaultProps:{showHeader:!0,preset:"light",debugLayout:!1,theme:{forceFetch:!1},rows:[{kind:"perf",area:"avcodec",title:"avcodec: improve AV1 decode performance",hash:"a1b2c3d",author:"Anton Khirnov",date:"May 15",pr:14201,reviewers:["James Almer","Michael Niedermayer"],signal:"warn"},{kind:"feat",area:"avformat",title:"avformat: add support for new container",hash:"d4e5f6g",author:"James Almer",date:"May 14",pr:14198,reviewers:["Anton Khirnov"],signal:"neutral"},{kind:"fix",area:"avfilter",title:"avfilter: fix memory leak in overlay filter",hash:"h7i8j9k",author:"Marton Balint",date:"May 13",pr:14185,reviewers:["Anton Khirnov","Limin Wang"],signal:"win"},{kind:"docs",area:"doc",title:"doc: update HLS documentation",hash:"l0m1n2o",author:"Limin Wang",date:"May 12",pr:14180,reviewers:["Marton Balint"],signal:"neutral"},{kind:"test",area:"tests",title:"tests: add FATE test for edge case",hash:"p3q4r5s",author:"Michael Niedermayer",date:"May 16",pr:14205,reviewers:["James Almer"],signal:"win"}],title:"NOTABLE COMMITS",subtitle:"Highlight interesting work.",iconPath:alpine_glyphs_1.ALPINE_GLYPHS.commits,anim:DEFAULT_ANIM},async render(o,a){var c,f,x,g,w,$,Q,tt,et,ot,nt,at,rt;const y=Math.max(1,Math.round(a.target.width)),I=Math.max(1,Math.round(a.target.height)),wt=((c=o.rows)!==null&&c!==void 0?c:[]).map((t,e)=>({r:t,srcIndex:e})).filter(({r:t})=>t&&typeof t.title=="string").slice(0,MAX_ROWS),h=wt.map(t=>t.r);if(!h.length)return(0,template_utils_1.makeIncompleteMosaic)("Add a commit \u2014 each row needs at least a title.",{title:"Commit Feed",width:y,height:I});const E=await(0,alpine_theme_1.resolveAlpineTheme)((f=o.preset)!==null&&f!==void 0?f:DEFAULT_PRESET,a,o.theme),ft=E.card,Ot=E.grid,it=E.title,B=E.muted,Bt=E.label,Ut=(x=o.accent)!==null&&x!==void 0?x:E.primary,U=(g=o.backgroundColor)!==null&&g!==void 0?g:ft,st=typeof U=="string"&&U.startsWith("#"),xt=(w=o.washColor)!==null&&w!==void 0?w:st?U:ft,Gt={...KIND_COLORS,...($=o.kindColors)!==null&&$!==void 0?$:{}},Vt={...KIND_GLYPHS,...(Q=o.kindGlyphs)!==null&&Q!==void 0?Q:{}},lt={...DEFAULT_ANIM,...(tt=o.anim)!==null&&tt!==void 0?tt:{}},Zt=!lt.reduceMotion,zt=((et=lt.renderMode)!==null&&et!==void 0?et:DEFAULT_RENDER_MODE)==="light",S=(ot=o.showHeader)!==null&&ot!==void 0?ot:!0,K=y<820,D=h.length,jt=Math.max(.1,((nt=a.target.durationMs)!==null&&nt!==void 0?nt:3e3)/1e3),bt=Math.max(.1,Math.min(1,lt.introFrac)*jt),dt=Math.min(.15,bt*.1),_t=.5,vt=Math.max(.05,(bt-dt)/(1+_t*Math.max(0,D-1))),Jt=_t*vt,u=Math.round(Math.min(y,I)*.04),s=Math.max(1,y-2*u),b=Math.max(1,I-2*u),_=S?Math.round(b*.16):0,ct=S?Math.round(b*.04):0,yt=Math.max(1,b-_-ct),Et=Math.max(6,Math.round(yt*.025)),Xt=Math.max(1,Math.floor(yt/D)),i=Math.max(1,Xt-Et),l=r((t,e)=>Math.max(1,Math.round(t/e*100)),"wOf"),G=r((t,e)=>(0,template_utils_1.quantizedSections)(t,(0,template_utils_1.latticeWeights)(e)),"sectionsPx"),$t=G(y,[u,s,u])[1],Qt=G(I,[u,b,u])[1],St=S?[l(_,b),l(ct,b)]:[],Pt=Math.max(1,100-St.reduce((t,e)=>t+e,0)),P=r((t,e)=>(0,template_utils_1.makeColorTile)(t,{effects:{rounding:{cornerStyle:"rounded",borderRadius:e}}}),"roundTile"),At=r(t=>(0,template_utils_1.makeColorTile)(GLYPH_COLOR,{mask:{kind:"inline-mask",localPath:t,bounds:{x:0,y:0,width:24,height:24}}}),"glyphTile"),ht=r((t,e)=>Zt?zt?(0,alpine_anim_1.revealGateNode)(t,e):(0,alpine_anim_1.revealFadeNode)(t,e,vt):t,"reveal"),A=r((t,e,m,d)=>Math.max(d,Math.min(t,Math.floor(m/(Math.max(1,e)*.62)))),"capW"),C=Math.max(1,s-Math.round(i*.16)*2-Math.max(4,Math.round(i*.06))-Math.round(i*.18)-Math.round(i*.5)-Math.round(i*.2)),te=Math.max(1,...h.map(t=>(0,template_utils_1.textEmUnits)(t.title))),ut=!K&&h.some(t=>!!fmtPr(t.pr)),ee=Math.max(1,...h.map(t=>(0,template_utils_1.textEmUnits)(fmtPr(t.pr)))),oe=Math.max(1,...h.map(t=>{var e;return(0,template_utils_1.textEmUnits)((e=t.author)!==null&&e!==void 0?e:"")})),ne=Math.max(1,...h.map(t=>{var e;return(0,template_utils_1.textEmUnits)((e=t.date)!==null&&e!==void 0?e:"")})),ae=Math.max(1,...h.map(t=>{var e;return(0,template_utils_1.textEmUnits)((e=t.area)!==null&&e!==void 0?e:"")})),Ct=C*(ut?.84:1)*.95,Tt=A(Math.max(12,Math.round(i*.3)),te,Ct,12),re=Math.max(4,Ct/(Tt*.62)),ie=r(t=>(0,alpine_card_1.fitEmUnits)(t,re),"fitTitle");let p=Math.max(9,Math.round(i*.2));p=A(p,oe,C*.28,9),p=A(p,ne,C*(K?.26:.15),9),ut&&(p=A(p,ee,C*.16,9));const se=A(Math.max(8,Math.round(i*.18)),ae,C*.22*.84,8),kt=r((t,e)=>(0,alpine_card_1.fitEmUnits)(t,Math.max(2,e*.88/(p*.62))),"fitToSlot"),le=r(t=>kt(t,C*.16),"fitPr"),de=r(t=>{var e,m,d,T,k;const n=h[t],L=wt[t].srcIndex,M=r((v,F,O,...gt)=>(0,template_utils_1.bindPropPath)(v,"rows",[L,F,...gt],O),"bindRow"),pt=(m=SIGNAL_COLOR[(e=n.signal)!==null&&e!==void 0?e:"neutral"])!==null&&m!==void 0?m:SIGNAL_COLOR.neutral,W=n.kind&&Gt[n.kind]||B,N=n.kind?resolveKindMark(Vt[n.kind]):void 0,R=Math.round(i*.16),Z=Math.max(4,Math.round(i*.06)),Y=Math.round(i*.5),z=Math.round(i*.18),j=Math.round(i*.2),J=Math.max(1,s-R*2-Z-z-Y-j),me=(0,alpine_card_1.rowSplit)([{weight:2,node:alpine_card_1.EMPTY},{weight:6,node:(0,alpine_card_1.paint)(P(pt,.5))},{weight:2,node:alpine_card_1.EMPTY}]),Me=N?(0,alpine_card_1.overlay)([(0,alpine_card_1.paint)(P(W,.28)),(0,alpine_card_1.paint)({...At(N),placement:{inset:{x:.22,y:.22}}})]):(0,alpine_card_1.paint)(P(W,.28)),ge=(0,alpine_card_1.rowSplit)([{weight:1,node:alpine_card_1.EMPTY},{weight:2,node:Me},{weight:1,node:alpine_card_1.EMPTY}]),Rt=!K&&!!fmtPr(n.pr),we=[["author","string"],["date","string"],["area","string"],["pr","number"]].filter(([v])=>n[v]==null||n[v]==="").map(([v,F])=>({propKey:"rows",path:[L,v],kind:F})),fe=(0,alpine_card_1.colSplit)([{weight:Rt?84:100,node:(0,alpine_card_1.paint)((0,alpine_conventions_1.withAddHandles)(M((0,alpine_card_1.tag)((0,alpine_card_1.textCell)(ie(n.title),Tt,it,"left"),"row-title"),"title","string"),we))},...Rt?[{weight:16,node:(0,alpine_card_1.paint)(M((0,alpine_card_1.tag)((0,alpine_card_1.textCell)(le(fmtPr(n.pr)),p,B,"right"),"row-pr"),"pr","number"))}]:[]]),xe=n.area?(0,alpine_card_1.overlay)([(0,alpine_card_1.paint)(P(blend(xt,W,.24),.34)),(0,alpine_card_1.paint)(M((0,alpine_card_1.tag)((0,alpine_card_1.textCell)(n.area,se,it,"center","middle",{left:.08,right:.08}),"chip-text"),"area","string"))]):alpine_card_1.EMPTY,q=K?[]:((d=n.reviewers)!==null&&d!==void 0?d:[]).slice(0,2),be=Math.round(i*.24),X=Math.max(2,Math.round(be/J*100)),Ht=Math.max(1,Math.round(X*.4)),_e=q.length?(0,alpine_card_1.colSplit)(q.flatMap((v,F)=>{var O;const gt=((O=v.trim()[0])!==null&&O!==void 0?O:"?").toUpperCase(),Pe=(0,alpine_card_1.overlay)([(0,alpine_card_1.paint)(P(REVIEWER_HUES[F%REVIEWER_HUES.length],.5)),(0,alpine_card_1.paint)(M((0,alpine_card_1.textCell)(gt,Math.max(8,Math.round(i*.16)),GLYPH_COLOR,"center"),"reviewers","string",F))]),qt=(0,alpine_card_1.rowSplit)([{weight:1,node:alpine_card_1.EMPTY},{weight:3,node:Pe},{weight:1,node:alpine_card_1.EMPTY}]);return F>0?[{weight:Ht,node:alpine_card_1.EMPTY},{weight:X,node:qt}]:[{weight:X,node:qt}]})):alpine_card_1.EMPTY,mt=n.area?Math.min(22,Math.max(10,Math.round(n.area.length*2.4)+6)):0,Dt=K?26:15,Mt=q.length?K?0:q.length*X+(q.length-1)*Ht+3:0,Wt=Math.max(8,100-mt-(mt?2:0)-Mt-Dt-2),H=[];n.area&&(H.push({weight:mt,node:xe}),H.push({weight:2,node:alpine_card_1.EMPTY})),H.push({weight:Wt,node:(0,alpine_card_1.paint)(M((0,alpine_card_1.tag)((0,alpine_card_1.textCell)(kt((T=n.author)!==null&&T!==void 0?T:"",C*(Wt/100)),p,Bt,"left"),"row-author"),"author","string"))}),Mt&&H.push({weight:Mt,node:_e}),H.push({weight:Dt,node:(0,alpine_card_1.paint)(M((0,alpine_card_1.tag)((0,alpine_card_1.textCell)((k=n.date)!==null&&k!==void 0?k:"",p,B,"right"),"row-date"),"date","string"))});const ve=(0,alpine_card_1.colSplit)(H),ye=(0,alpine_card_1.rowSplit)([{weight:8,node:alpine_card_1.EMPTY},{weight:40,node:fe},{weight:6,node:alpine_card_1.EMPTY},{weight:30,node:ve},{weight:8,node:alpine_card_1.EMPTY}]),Ee=(0,alpine_card_1.colSplit)([{weight:l(R,s),node:alpine_card_1.EMPTY},{weight:l(Z,s),node:me},{weight:l(z,s),node:alpine_card_1.EMPTY},{weight:l(Y,s),node:ge},{weight:l(j,s),node:alpine_card_1.EMPTY},{weight:l(J,s),node:ye},{weight:l(R,s),node:alpine_card_1.EMPTY}]),Yt=P(blend(xt,Ot,.5),.12);Yt.editor={label:"row"};const Se=(0,alpine_card_1.paint)((0,template_utils_1.bindProp)(Yt,"washColor"));return(0,alpine_card_1.overlay)([Se,Ee])},"rowNode"),Nt=1,ce=Math.max(2,Math.round(2*i/Math.max(1,Et))),Ft=[];for(let t=0;t<D;t++){const e=dt+t*Jt,m=(0,alpine_card_1.rowSplit)([{weight:Nt,node:alpine_card_1.EMPTY},{weight:ce,node:ht(de(t),e)},{weight:Nt,node:alpine_card_1.EMPTY}]);Ft.push({weight:1,node:m})}const he=(0,alpine_card_1.rowSplit)(Ft);let It=alpine_card_1.EMPTY;if(S){const t=(at=o.title)!==null&&at!==void 0?at:"NOTABLE COMMITS",e=(rt=o.subtitle)!==null&&rt!==void 0?rt:"Highlight interesting work.",m=(0,alpine_glyphs_1.resolveAlpineGlyph)(o.icon,o.iconPath,"@m0saic/alpine/commit-feed/v3"),d=[l(_,s),l(Math.round(_*.22),s)];d.push(Math.max(1,100-d[0]-d[1]));const T=G($t,d)[0],k=G(Qt,[...St,Pt])[0],n=.6*Math.min(T,k),L=(T-n)/(2*T),M=(k-n)/(2*k),pt=L+(1-2*L)*.22,W=M+(1-2*M)*.22,N=(0,template_utils_1.makeColorTile)(Ut,{effects:{rounding:{cornerStyle:"rounded",borderRadius:.28}},placement:{inset:{x:L,y:M}}});N.editor={label:"header-icon"},(0,template_utils_1.bindProp)(N,"accent");const R=m?{...At(m),placement:{inset:{x:pt,y:W}}}:null,Z=R?(0,alpine_card_1.overlay)([(0,alpine_card_1.paint)(N),(0,alpine_card_1.paint)(R)]):(0,alpine_card_1.paint)(N),Y=Math.max(1,s-Math.round(_*1.22)),z=A(Math.max(14,Math.round(_*.4)),Math.ceil((0,template_utils_1.textEmUnits)(t)*1.16),Y*.95,14),j=A(Math.max(10,Math.round(_*.2)),(0,template_utils_1.textEmUnits)(e),Y*.95,10),J=(0,alpine_card_1.rowSplit)([{weight:58,node:(0,alpine_card_1.paint)((0,template_utils_1.bindProp)((0,alpine_card_1.tag)((0,alpine_card_1.textCell)(t,z,it,"left"),"feed-title"),"title"))},{weight:42,node:(0,alpine_card_1.paint)((0,template_utils_1.bindProp)((0,alpine_card_1.tag)((0,alpine_card_1.textCell)(e,j,B,"left"),"feed-subtitle"),"subtitle"))}]);It=ht((0,alpine_card_1.colSplit)([{weight:d[0],node:Z},{weight:d[1],node:alpine_card_1.EMPTY},{weight:d[2],node:J}]),dt)}const V=[];S&&(V.push({weight:l(_,b),node:It}),V.push({weight:l(ct,b),node:alpine_card_1.EMPTY})),V.push({weight:Pt,node:he});const ue=(0,alpine_card_1.rowSplit)(V),Kt=(0,alpine_card_1.insetNode)(ue,u,u,u,u,y,I),Lt=st?(0,alpine_card_1.overlay)([ht((0,alpine_card_1.paint)((0,template_utils_1.bindProps)(P(U,.04),[{propKey:"backgroundColor"},{propKey:"preset"}])),0),Kt]):Kt,pe={kind:"mosaic_document",version:1,assets:{},m0:Lt.m0,sources:(0,alpine_conventions_1.bindCardSurface)(Lt.sources),backgroundColor:st?E.canvas:"black@0",fps:a.target.fps,durationMs:a.target.durationMs,size:{width:y,height:I}};return Promise.resolve((0,template_utils_1.withLayoutContract)(pe,a,{templateId:"@m0saic/alpine/commit-feed/v3",relations:D>=2?[{label:"row",equal:"size",tolerance:.02,tolerancePx:1}]:[],constraints:[...S?[{label:"header-icon",aspect:1,aspectTolerance:.06}]:[],...S?[{label:"feed-title",textFits:{charWidthEm:.62}},{label:"feed-subtitle",textFits:{charWidthEm:.62}}]:[],...D>=2?[{label:"row-title",textFits:{charWidthEm:.62}},{label:"row-author",textFits:{charWidthEm:.62}},{label:"row-date",textFits:{charWidthEm:.62}},...ut?[{label:"row-pr",textFits:{charWidthEm:.62}}]:[],...h.some(t=>!!t.area)?[{label:"chip-text",textFits:{charWidthEm:.62}}]:[]]:[]],debug:o.debugLayout===!0}))},async renderCover(o,a){const c=(0,onboarding_cover_1.brandedCoverHeroBox)(a,"band"),f={...a,target:{...a.target,width:c.width,height:c.height},output:{...a.output,width:c.width,height:c.height}},x=await exports.AlpineCommitFeedV3.render({...exports.AlpineCommitFeedV3.defaultProps,anim:{renderMode:"light",introFrac:.7,reduceMotion:!0}},f);return(0,onboarding_cover_1.buildBrandedCover)({ctx:a,variant:"band",copy:{productName:"Commit Feed",title:"A commit feed."},hero:r(g=>(0,onboarding_cover_1.onboardingFrame)((0,onboarding_cover_1.inlineHeroDoc)(x),g.borderStrong),"hero"),heroAssets:x.assets})}},(0,template_utils_1.registerTemplate)(exports.AlpineCommitFeedV3);
@@ -0,0 +1 @@
1
+ "use strict";var i=Object.defineProperty;var e=(t,r)=>i(t,"name",{value:r,configurable:!0});Object.defineProperty(exports,"__esModule",{value:!0}),exports.AlpineCommitFeedV3=void 0;var commit_feed_1=require("./commit-feed");Object.defineProperty(exports,"AlpineCommitFeedV3",{enumerable:!0,get:e(function(){return commit_feed_1.AlpineCommitFeedV3},"get")});
@@ -0,0 +1 @@
1
+ "use strict";var $e=Object.defineProperty;var r=(t,o)=>$e(t,"name",{value:o,configurable:!0});Object.defineProperty(exports,"__esModule",{value:!0}),exports.AlpineContributorTableV2=void 0;const types_1=require("@m0saic/types"),template_utils_1=require("@m0saic/template-utils"),alpine_card_1=require("../../_shared/alpine-card"),alpine_glyphs_1=require("../../_shared/alpine-glyphs"),alpine_theme_1=require("../../_shared/alpine-theme"),alpine_anim_1=require("../../_shared/alpine-anim"),alpine_conventions_1=require("../../_shared/alpine-conventions"),onboarding_cover_1=require("../../../_shared/onboarding-cover"),ACCENT="#3fb950",NEG="#f85149",GLYPH_COLOR="#0d1117",DEFAULT_PRESET="light",DEFAULT_RENDER_MODE="premium",DEFAULT_ANIM={renderMode:DEFAULT_RENDER_MODE,introFrac:.7,countUp:!0,easing:"easeOut",reduceMotion:!1},MAX_ROWS=8,PAD_W=3,RANK_W=5,CONTRIB_W_NOMINAL=42;function tcell(t,o,l,a){return{type:"text",visual:{backgroundColor:"black@0"},layers:[{content:{kind:"literal",text:t||" "},style:{fontSize:o,fontColor:l},placement:{fit:"contain",hAlign:a,vAlign:"middle"}}]}}r(tcell,"tcell");function fcell(t,o,l,a){return{type:"text",visual:{backgroundColor:"black@0"},layers:[{content:{kind:"literal",text:t||" "},style:{fontSize:o,fontColor:l},placement:{hAlign:a,vAlign:"middle"}}]}}r(fcell,"fcell");function exprCell(t,o,l,a){return{type:"text",renderMode:{kind:"video"},visual:{backgroundColor:"black@0"},layers:[{content:{kind:"expr",expr:t,eval:"frame"},style:{fontSize:o,fontColor:l},placement:{hAlign:a,vAlign:"middle"}}]}}r(exprCell,"exprCell");function fadeIn(t,o,l,a){var i;if(!a)return t;const u=(i=t.overlay)!==null&&i!==void 0?i:{};return{...t,overlay:{...u,alpha:(0,template_utils_1.fadeInExpr)(o,l)}}}r(fadeIn,"fadeIn");function wrapFade(t,o,l,a){return a?{m0:t.m0,sources:t.sources.map(i=>{var u;return!((u=i.overlay)===null||u===void 0)&&u.alpha?i:fadeIn(i,o,l,!0)})}:t}r(wrapFade,"wrapFade");function wrapGate(t,o,l){return l?{m0:t.m0,sources:t.sources.map(a=>{var i;return!((i=a.overlay)===null||i===void 0)&&i.enable?a:(0,alpine_anim_1.revealGate)(a,o,!0)})}:t}r(wrapGate,"wrapGate");function blend(t,o,l){const a=parseInt(t.slice(1),16),i=parseInt(o.slice(1),16),u=r(M=>Math.round((a>>M&255)+((i>>M&255)-(a>>M&255))*l),"mix");return"#"+[u(16),u(8),u(0)].map(M=>M.toString(16).padStart(2,"0")).join("")}r(blend,"blend");function avatarDisc(t,o,l,a){var i;const u=((i=t.trim()[0])!==null&&i!==void 0?i:"?").toUpperCase(),M={type:"text",visual:{backgroundColor:"black@0"},layers:[{content:{kind:"literal",text:u},style:{fontSize:l,fontColor:"#0d1117"},placement:{hAlign:"center",vAlign:"middle"}}]},R=(0,template_utils_1.makeColorTile)(o,{effects:{rounding:{cornerStyle:"rounded",borderRadius:.5}},...a?{placement:{inset:a}}:{}});return R.editor={label:"avatar"},(0,alpine_card_1.overlay)([(0,alpine_card_1.paint)(R),(0,alpine_card_1.paint)(a?{...M,placement:{inset:a}}:M)])}r(avatarDisc,"avatarDisc");function discInCell(t){return(0,alpine_card_1.rowSplit)([{weight:2,node:alpine_card_1.EMPTY},{weight:7,node:(0,alpine_card_1.colSplit)([{weight:2,node:alpine_card_1.EMPTY},{weight:7,node:t},{weight:2,node:alpine_card_1.EMPTY}])},{weight:2,node:alpine_card_1.EMPTY}])}r(discInCell,"discInCell");const AVATAR_HUES=["#3fb950","#2ea043","#56d364","#388bfd","#a371f7","#db61a2","#e3b341","#f0883e"],propsSchema=(0,template_utils_1.definePropsSchema)({rows:{type:"array",required:!0,meta:{control:{flavor:"jsonModal"}}},columns:{type:"string[]",required:!0},title:{type:"string",required:!1},subtitle:{type:"string",required:!1},preset:{type:"string",required:!1,meta:{constraints:{oneOf:["light","dark"]}}},showHeader:{type:"boolean",required:!1},topTint:{type:"number",required:!1,meta:{constraints:{min:0,max:8}}},accent:{type:"string",required:!1,meta:{constraints:{isColor:!0},control:{colorPicker:!0,defaultColor:"#2563EB"}}},backgroundColor:{type:"string",required:!1,meta:{constraints:{isColor:!0},control:{colorPicker:!0,defaultColor:"#FFFFFF"}}},washColor:{type:"string",required:!1,meta:{constraints:{isColor:!0},control:{colorPicker:!0,defaultColor:"#FFFFFF"}}},anim:{type:"group",required:!1,fields:{renderMode:(0,alpine_conventions_1.bEnum)(["premium","light"]),reduceMotion:alpine_conventions_1.ALPINE_ANIM_FIELDS_BARE.reduceMotion,introFrac:alpine_conventions_1.ALPINE_ANIM_FIELDS_BARE.introFrac,countUp:(0,alpine_conventions_1.bBool)(),easing:alpine_conventions_1.ALPINE_ANIM_FIELDS_BARE.easing}},theme:{type:"group",required:!1,fields:{slug:(0,alpine_conventions_1.bStr)(),preset:(0,alpine_conventions_1.bStr)(),namespace:(0,alpine_conventions_1.bStr)(),forceFetch:(0,alpine_conventions_1.bBool)()}},icon:{type:"string",required:!1,meta:{constraints:{oneOf:alpine_glyphs_1.ALPINE_GLYPH_NAMES},ui:{consumer:"human"},control:{syncsTo:[{prop:"iconPath",map:{kind:"lookup",table:alpine_glyphs_1.ALPINE_GLYPHS}}]}}},iconPath:{type:"string",required:!1,meta:{ui:{consumer:"agent"}}},columnColors:{type:"array",required:!1,meta:{ui:{consumer:"agent"}}},columnSigns:{type:"string[]",required:!1,meta:{ui:{consumer:"agent"}}},debugLayout:{type:"boolean",required:!1}});exports.AlpineContributorTableV2={id:(0,types_1.asTemplateId)("@m0saic/alpine/contributor-table/v2"),version:2,capabilities:{tier:"core"},outputHints:{format:{kind:"video",container:"mp4"},width:1280,height:720,fps:30,durationMs:3e3,posterTimeMs:2850},propsSchema,bindings:{unbound:{...alpine_conventions_1.ALPINE_THEME_UNBOUND,...alpine_conventions_1.ALPINE_ANIM_UNBOUND,iconPath:"agent value"}},defaultProps:{showHeader:!0,preset:"light",debugLayout:!1,theme:{forceFetch:!1},rows:[{rank:1,name:"Anton Khirnov",values:[23,4512,2103]},{rank:2,name:"Michael Niedermayer",values:[18,3204,1034]},{rank:3,name:"James Almer",values:[14,2193,812]},{rank:4,name:"Marton Balint",values:[11,1842,1201]},{rank:5,name:"Limin Wang",values:[9,1503,623]}],columns:["Commits","Additions","Deletions"],title:"TOP CONTRIBUTORS",subtitle:"This week",topTint:3,columnColors:[void 0,ACCENT,NEG],columnSigns:["","+","-"],iconPath:alpine_glyphs_1.ALPINE_GLYPHS.contributors,anim:DEFAULT_ANIM},async render(t,o){var l,a,i,u,M,R,Tt,_t,St,Et,yt,Ct,kt,At,Ft,Nt,Lt,It,Yt;const c=Math.max(1,Math.round(o.target.width)),m=Math.max(1,Math.round(o.target.height)),dt=((l=t.rows)!==null&&l!==void 0?l:[]).map((e,d)=>({r:e,srcIndex:d})).filter(({r:e})=>e&&typeof e.name=="string").slice(0,MAX_ROWS),S=dt.map(e=>e.r),E=(a=t.columns)!==null&&a!==void 0?a:[];if(!S.length||!E.length)return(0,template_utils_1.makeIncompleteMosaic)("Add a row and a column \u2014 a name, and at least one number for it.",{title:"Contributor Table",width:c,height:m});const k=await(0,alpine_theme_1.resolveAlpineTheme)((i=t.preset)!==null&&i!==void 0?i:DEFAULT_PRESET,o,t.theme),ae=k.card,re=k.grid,ht=k.title,T=k.muted,Rt=k.label,Ot=(u=t.accent)!==null&&u!==void 0?u:k.primary,$=(M=t.backgroundColor)!==null&&M!==void 0?M:ae,ut=typeof $=="string"&&$.startsWith("#"),mt=(R=t.washColor)!==null&&R!==void 0?R:ut?$:ae,_={...DEFAULT_ANIM,...(Tt=t.anim)!==null&&Tt!==void 0?Tt:{}},gt=!_.reduceMotion,xe=((_t=_.renderMode)!==null&&_t!==void 0?_t:DEFAULT_RENDER_MODE)==="light",A=r((e,d,h)=>gt?xe?wrapGate(e,d,!0):wrapFade(e,d,h,!0):e,"wrapReveal"),ie=(St=t.topTint)!==null&&St!==void 0?St:3,F=(Et=t.showHeader)!==null&&Et!==void 0?Et:!0,O=S.length,B=E.length,Te=Math.max(1,(0,template_utils_1.textEmUnits)((yt=t.title)!==null&&yt!==void 0?yt:"TOP CONTRIBUTORS")),_e=Math.max(18,Math.min(Math.round(m*.05),Math.floor(c*.68/(Te*.62)))),Se=Math.max(1,(0,template_utils_1.textEmUnits)((Ct=t.subtitle)!==null&&Ct!==void 0?Ct:"This week")),Ee=Math.max(11,Math.min(Math.round(m*.026),Math.floor(c*.68/(Se*.62)))),Bt=Math.max(8,Math.floor((100-PAD_W*2-RANK_W-CONTRIB_W_NOMINAL)/B)),Ut=100-PAD_W*2-RANK_W-Bt*B,ye=Math.max(1,...E.map(e=>String(e).length),11),qt=Math.max(10,Math.min(Math.round(m*.024),Math.floor(c*(Bt/100)*.92/(ye*.62)))),je=Math.max(12,Math.round(m*.032)),le=Math.max(12,Math.round(m*.034)),Ce=Math.max(11,Math.round(m*.03)),ke=Math.max(14,Math.round(m*.042)),Ae=Math.max(.1,((kt=o.target.durationMs)!==null&&kt!==void 0?kt:3e3)/1e3),se=Math.max(.1,Math.min(1,_.introFrac)*Ae),U=Math.min(.15,se*.1),ce=.5,w=Math.max(.05,(se-U)/(1+ce*Math.max(0,O-1))),Ht=ce*w,j=r(e=>typeof e=="number"?Math.round(e).toLocaleString("en-US"):String(e??""),"fmt"),pt=r((e,d,h,b,...v)=>(0,template_utils_1.bindPropPath)(e,"rows",[dt[d].srcIndex,h,...v],b),"bindRow"),de=r(e=>{var d,h,b,v;return[...e<=((h=(d=t.columnSigns)===null||d===void 0?void 0:d.length)!==null&&h!==void 0?h:0)?[{propKey:"columnSigns",index:e}]:[],...e<=((v=(b=t.columnColors)===null||b===void 0?void 0:b.length)!==null&&v!==void 0?v:0)?[{propKey:"columnColors",path:[e],kind:"color"}]:[]]},"columnEntries"),he=r((e,d,h)=>(0,template_utils_1.bindProps)(e,[{propKey:"rows",path:[dt[d].srcIndex,"values",h],kind:"number"},...de(h)]),"bindCell"),ue=r(()=>{const e=(0,template_utils_1.makeColorTile)(Ot,{effects:{rounding:{cornerStyle:"rounded",borderRadius:.28}}});return e.editor={label:"header-icon"},(0,template_utils_1.bindProp)(e,"accent")},"chipTile"),me=(0,alpine_glyphs_1.resolveAlpineGlyph)(t.icon,t.iconPath,"@m0saic/alpine/contributor-table/v2"),ge=me?(0,alpine_card_1.overlay)([(0,alpine_card_1.paint)(ue()),(0,alpine_card_1.paint)((0,template_utils_1.makeColorTile)(GLYPH_COLOR,{mask:{kind:"inline-mask",localPath:me,bounds:{x:0,y:0,width:24,height:24}},placement:{inset:{x:.22,y:.22}}}))]):(0,alpine_card_1.paint)(ue());let Mt;if(m>c*1.15){const e=Math.round(Math.min(c,m)*.045),d=Math.max(1,c-2*e),h=Math.max(1,m-2*e),b=F?Math.round(h*.13):0,v=F?Math.round(h*.025):0,z=Math.max(1,h-b-v),X=Math.max(8,Math.round(z*.02)),Wt=Math.max(1,Math.floor(z/O)),J=Math.max(1,Wt-X),N=Math.round(d*.045),L=Math.round(J*.07),f=Math.max(1,d-2*N),Q=Math.max(1,J-2*L),q=Math.round(Q*.56),Dt=Math.max(1,Q-q),H=Math.round(f*.09),W=q,D=Math.round(f*.02),K=Math.round(f*.22),Z=Math.max(40,f-H-W-D-K),tt=H+W+D,I=r((n,p,lt,st)=>Math.max(st,Math.min(n,Math.floor(lt/(Math.max(1,p)*.62)))),"cap"),Kt=Math.max(1,...S.map(n=>(0,template_utils_1.textEmUnits)(n.name))),Gt=Math.max(1,...S.map(n=>(0,template_utils_1.textEmUnits)(j(n.values[0]))));let G=1;for(const n of S)for(let p=1;p<B;p++)G=Math.max(G,(0,template_utils_1.textEmUnits)(((Ft=(At=t.columnSigns)===null||At===void 0?void 0:At[p])!==null&&Ft!==void 0?Ft:"")+j(n.values[p])));const wt=(Nt=t.title)!==null&&Nt!==void 0?Nt:"TOP CONTRIBUTORS",bt=Math.max(1,B-1),et=Math.floor(Math.max(1,f-tt)/bt),vt=Math.max(12,Math.round(c*.042)),ft=I(Math.round(c*.05),Kt,Math.round(Z*.94),12),s=r(n=>(0,alpine_card_1.fitEmUnits)(n,Math.max(2,Z*.94/(ft*.62))),"fitNameP"),P=Math.max(14,Math.min(I(Math.round(c*.092),Gt,K,18),Math.round(q*.55))),y=Math.max(9,Math.round(c*.026)),Y=I(Math.round(c*.042),G,et,11),Vt=Math.max(14,Math.round(c*.052)),$t=I(Math.round(c*.062),wt.length,Math.round(d*.7),18),jt=Math.max(11,Math.round(c*.032)),Pt=!!(t.columnColors||t.columnSigns),g=r(n=>Math.max(1,Math.round(n/4)),"q"),pe=r(n=>{var p,lt,st,Qt,Zt,te;const ct=S[n],ee=U+n*Ht,Ne=(0,alpine_card_1.paint)((0,alpine_card_1.tag)(fcell(String((p=ct.rank)!==null&&p!==void 0?p:n+1),vt,T,"center"),"rank")),Le=avatarDisc(ct.name,AVATAR_HUES[n%AVATAR_HUES.length],Vt),Ie=(0,alpine_card_1.paint)(pt((0,alpine_card_1.tag)(fcell(s(ct.name),ft,ht,"left"),"row-name"),n,"name","string")),oe=j(ct.values[0]),Ye=_.countUp&&gt&&/\d/.test(oe)?(0,alpine_card_1.paint)(pt((0,alpine_card_1.tag)(exprCell((0,template_utils_1.animateNumbersInText)(oe,{startSec:ee,durationSec:w,ease:_.easing}),P,Rt,"right"),"row-value"),n,"values","number",0)):(0,alpine_card_1.paint)(pt((0,alpine_card_1.tag)(fcell(oe,P,Rt,"right"),"row-value"),n,"values","number",0)),Re=(0,alpine_card_1.rowSplit)([{weight:64,node:Ye},{weight:36,node:(0,alpine_card_1.paint)((0,template_utils_1.bindProp)((0,alpine_card_1.tag)(fcell((lt=E[0])!==null&&lt!==void 0?lt:"",y,T,"right"),"col-header"),"columns",0))}]),Oe=(0,alpine_card_1.colSplit)([{weight:g(H),node:Ne},{weight:g(W),node:discInCell(Le)},{weight:g(D),node:alpine_card_1.EMPTY},{weight:g(Z),node:Ie},{weight:g(K),node:Re}]),we=[{weight:g(tt),node:alpine_card_1.EMPTY}];for(let x=1;x<B;x++){const ne=j(ct.values[x]),De=(Qt=(st=t.columnSigns)===null||st===void 0?void 0:st[x])!==null&&Qt!==void 0?Qt:"",ve=(te=(Zt=t.columnColors)===null||Zt===void 0?void 0:Zt[x])!==null&&te!==void 0?te:T,fe=Pt?`${De}${ne}`:`${E[x]} ${ne}`,Pe=r(Ve=>(0,template_utils_1.bindProps)(Ve,[{propKey:"rows",path:[dt[n].srcIndex,"values",x],kind:"number"},...Pt?de(x):[{propKey:"columns",index:x}]]),"bindSec"),Ke=_.countUp&&gt&&/\d/.test(ne)?(0,alpine_card_1.paint)(Pe((0,alpine_card_1.tag)(exprCell((0,template_utils_1.animateNumbersInText)(fe,{startSec:ee,durationSec:w,ease:_.easing}),Y,ve,"left"),"row-value"))):(0,alpine_card_1.paint)(Pe((0,alpine_card_1.tag)(fcell(fe,Y,ve,"left"),"row-value"))),Ge=x===B-1?Math.max(1,f-tt-et*(bt-1)):et;we.push({weight:g(Ge),node:Ke})}const Be=(0,alpine_card_1.colSplit)(we),Ue=(0,alpine_card_1.rowSplit)([{weight:g(q),node:Oe},{weight:g(Dt),node:Be}]),qe=(0,alpine_card_1.rowSplit)([{weight:g(L),node:alpine_card_1.EMPTY},{weight:g(Q),node:(0,alpine_card_1.colSplit)([{weight:g(N),node:alpine_card_1.EMPTY},{weight:g(f),node:Ue},{weight:g(N),node:alpine_card_1.EMPTY}])},{weight:g(L),node:alpine_card_1.EMPTY}]),He=n<ie?blend(mt,Ot,.1):blend(mt,re,.55),be=(0,template_utils_1.makeColorTile)(He,{effects:{rounding:{cornerStyle:"rounded",borderRadius:.12}}});be.editor={label:"row"};const We=(0,alpine_card_1.paint)((0,template_utils_1.bindProps)(be,[{propKey:"washColor"},{propKey:"topTint"}]));return A((0,alpine_card_1.overlay)([We,qe]),ee,w)},"cardNode"),zt=Math.max(2,Math.round(2*J/Math.max(1,X))),ot=[];for(let n=0;n<O;n++)ot.push({weight:1,node:(0,alpine_card_1.rowSplit)([{weight:1,node:alpine_card_1.EMPTY},{weight:zt,node:pe(n)},{weight:1,node:alpine_card_1.EMPTY}])});const xt=(0,alpine_card_1.rowSplit)(ot),Xt=(0,alpine_card_1.rowSplit)([{weight:1,node:alpine_card_1.EMPTY},{weight:5,node:ge},{weight:2,node:alpine_card_1.EMPTY}]),Me=(0,alpine_card_1.rowSplit)([{weight:58,node:(0,alpine_card_1.paint)((0,template_utils_1.bindProp)((0,alpine_card_1.tag)(fcell(wt,$t,ht,"left"),"table-title"),"title"))},{weight:42,node:(0,alpine_card_1.paint)((0,template_utils_1.bindProp)((0,alpine_card_1.tag)(tcell((Lt=t.subtitle)!==null&&Lt!==void 0?Lt:"This week",jt,T,"left"),"table-subtitle"),"subtitle"))}]),C=Math.max(1,Math.round(b*(5/8))),V=Math.round(d*.04),nt=(0,alpine_card_1.colSplit)([{weight:C,node:Xt},{weight:V,node:alpine_card_1.EMPTY},{weight:Math.max(1,d-C-V),node:Me}]),at=A(nt,U,w),rt=F?(0,alpine_card_1.rowSplit)([{weight:b,node:at},{weight:v,node:alpine_card_1.EMPTY},{weight:z,node:xt}]):xt,it=(0,alpine_card_1.rowSplit)([{weight:e,node:alpine_card_1.EMPTY},{weight:h,node:(0,alpine_card_1.colSplit)([{weight:e,node:alpine_card_1.EMPTY},{weight:d,node:rt},{weight:e,node:alpine_card_1.EMPTY}])},{weight:e,node:alpine_card_1.EMPTY}]),Jt=A((0,alpine_card_1.paint)((0,template_utils_1.bindProps)((0,template_utils_1.makeColorTile)($,{effects:{rounding:{cornerStyle:"rounded",borderRadius:.04}}}),[{propKey:"backgroundColor"},{propKey:"preset"}])),0,w);Mt=ut?(0,alpine_card_1.overlay)([Jt,it]):it}else{const e=Math.round(Math.min(c,m)*.04),d=Bt,h=Math.max(1,Math.round((c-2*e)*(Ut/100)*.72)),b=Math.max(1,...S.map(s=>(0,template_utils_1.textEmUnits)(s.name))),v=Math.max(11,Math.min(Math.round(m*.04),Math.floor(h/(b*.6)))),z=r(s=>(0,alpine_card_1.fitEmUnits)(s,Math.max(2,h/(v*.6))),"fitName"),X=r((s,P,y)=>(0,alpine_card_1.colSplit)([{weight:PAD_W,node:alpine_card_1.EMPTY},{weight:RANK_W,node:s},{weight:Ut,node:P},...y.map(Y=>({weight:d,node:Y})),{weight:PAD_W,node:alpine_card_1.EMPTY}]),"rowCols"),Wt=X((0,alpine_card_1.paint)((0,alpine_card_1.tag)(tcell("#",qt,T,"left"),"col-header")),(0,alpine_card_1.paint)((0,alpine_card_1.tag)(tcell("Contributor",qt,T,"left"),"col-header")),E.map((s,P)=>(0,alpine_card_1.paint)((0,template_utils_1.bindProp)((0,alpine_card_1.tag)(tcell(s,qt,T,"right"),"col-header"),"columns",P)))),J=Math.max(1,(m-2*e)*((F?66:87)/100)),N=Math.max(1,J/O*.8),L=Math.max(1,(c-2*e)*(Ut/100)*(4/20)),f=.64*Math.min(L,N),Q={x:Math.max(0,(L-f)/(2*L)),y:Math.max(0,(N-f)/(2*N))},q=Math.min(ke,Math.max(10,Math.round(f*.6))),Dt=r(s=>{var P;const y=S[s],Y=U+s*Ht,Vt=(0,alpine_card_1.paint)((0,alpine_card_1.tag)(tcell(String((P=y.rank)!==null&&P!==void 0?P:s+1),Ce,T,"left"),"rank")),$t=avatarDisc(y.name,AVATAR_HUES[s%AVATAR_HUES.length],q,Q),jt=(0,alpine_card_1.colSplit)([{weight:4,node:$t},{weight:1,node:alpine_card_1.EMPTY},{weight:15,node:(0,alpine_card_1.paint)(pt((0,alpine_card_1.tag)(fcell(z(y.name),v,ht,"left"),"row-name"),s,"name","string"))}]),Pt=E.map((Me,C)=>{var V,nt,at,rt;const it=j(y.values[C]),Jt=(nt=(V=t.columnSigns)===null||V===void 0?void 0:V[C])!==null&&nt!==void 0?nt:"",n=(rt=(at=t.columnColors)===null||at===void 0?void 0:at[C])!==null&&rt!==void 0?rt:Rt,p=`${Jt}${it}`;return _.countUp&&gt&&/\d/.test(it)?(0,alpine_card_1.paint)(he((0,alpine_card_1.tag)(exprCell((0,template_utils_1.animateNumbersInText)(p,{startSec:Y,durationSec:w,ease:_.easing}),le,n,"right"),"row-value"),s,C)):(0,alpine_card_1.paint)(he((0,alpine_card_1.tag)(tcell(p,le,n,"right"),"row-value"),s,C))}),g=X(Vt,jt,Pt),zt=s<ie?blend(mt,Ot,.1):blend(mt,re,.55),ot=(0,template_utils_1.makeColorTile)(zt,{effects:{rounding:{cornerStyle:"rounded",borderRadius:.16}}});ot.editor={label:"row"};const xt=(0,alpine_card_1.paint)((0,template_utils_1.bindProps)(ot,[{propKey:"washColor"},{propKey:"topTint"}])),Xt=(0,alpine_card_1.overlay)([xt,g]);return A(Xt,Y,w)},"dataRow"),H=[];for(let s=0;s<O;s++)H.push({weight:1,node:(0,alpine_card_1.rowSplit)([{weight:1,node:alpine_card_1.EMPTY},{weight:8,node:Dt(s)},{weight:1,node:alpine_card_1.EMPTY}])});const W=(0,alpine_card_1.rowSplit)(H),D=Math.max(1,c-2*e),K=Math.round(Math.max(1,m-2*e)*.18),Z=(0,alpine_card_1.rowSplit)([{weight:15,node:alpine_card_1.EMPTY},{weight:70,node:(0,alpine_card_1.colSplit)([{weight:15,node:alpine_card_1.EMPTY},{weight:70,node:ge},{weight:15,node:alpine_card_1.EMPTY}])},{weight:15,node:alpine_card_1.EMPTY}]),tt=(0,alpine_card_1.rowSplit)([{weight:58,node:(0,alpine_card_1.paint)((0,template_utils_1.bindProp)((0,alpine_card_1.tag)(tcell((It=t.title)!==null&&It!==void 0?It:"TOP CONTRIBUTORS",_e,ht,"left"),"table-title"),"title"))},{weight:42,node:(0,alpine_card_1.paint)((0,template_utils_1.bindProp)((0,alpine_card_1.tag)(tcell((Yt=t.subtitle)!==null&&Yt!==void 0?Yt:"This week",Ee,T,"left"),"table-subtitle"),"subtitle"))}]),I=Math.round(D*.015),Kt=(0,alpine_card_1.colSplit)([{weight:K,node:Z},{weight:I,node:alpine_card_1.EMPTY},{weight:Math.max(1,D-K-I),node:tt}]),Gt=A(Kt,U,w),G=A(Wt,U+Ht*.5,w),wt=F?(0,alpine_card_1.rowSplit)([{weight:18,node:Gt},{weight:4,node:alpine_card_1.EMPTY},{weight:8,node:G},{weight:4,node:alpine_card_1.EMPTY},{weight:66,node:W}]):(0,alpine_card_1.rowSplit)([{weight:9,node:G},{weight:4,node:alpine_card_1.EMPTY},{weight:87,node:W}]),bt=Math.max(1,c-2*e),et=Math.max(1,m-2*e),vt=(0,alpine_card_1.rowSplit)([{weight:e,node:alpine_card_1.EMPTY},{weight:et,node:(0,alpine_card_1.colSplit)([{weight:e,node:alpine_card_1.EMPTY},{weight:bt,node:wt},{weight:e,node:alpine_card_1.EMPTY}])},{weight:e,node:alpine_card_1.EMPTY}]),ft=A((0,alpine_card_1.paint)((0,template_utils_1.bindProps)((0,template_utils_1.makeColorTile)($,{effects:{rounding:{cornerStyle:"rounded",borderRadius:.04}}}),[{propKey:"backgroundColor"},{propKey:"preset"}])),0,w);Mt=ut?(0,alpine_card_1.overlay)([ft,vt]):vt}const Fe={kind:"mosaic_document",version:1,assets:{},m0:Mt.m0,sources:(0,alpine_conventions_1.bindCardSurface)(Mt.sources),backgroundColor:ut?k.canvas:"black@0",fps:o.target.fps,durationMs:o.target.durationMs,size:{width:c,height:m}};return Promise.resolve((0,template_utils_1.withLayoutContract)(Fe,o,{templateId:"@m0saic/alpine/contributor-table/v2",relations:O>=2?[{label:"row",equal:"size",tolerance:.02,tolerancePx:1}]:[],constraints:[...F?[{label:"header-icon",aspect:1,aspectTolerance:.1}]:[],{label:"avatar",aspect:1,aspectTolerance:.25},...F?[{label:"table-title",textFits:{charWidthEm:.62}},{label:"table-subtitle",textFits:{charWidthEm:.62}}]:[],{label:"col-header",textFits:{charWidthEm:.62}},{label:"rank",textFits:{charWidthEm:.62}},{label:"row-name",textFits:{charWidthEm:.6}},...E.length>0?[{label:"row-value",textFits:{charWidthEm:.62}}]:[]],debug:t.debugLayout===!0}))},async renderCover(t,o){const l=(0,onboarding_cover_1.brandedCoverHeroBox)(o,"band"),a={...o,target:{...o.target,width:l.width,height:l.height},output:{...o.output,width:l.width,height:l.height}},i=await exports.AlpineContributorTableV2.render({...exports.AlpineContributorTableV2.defaultProps,anim:{...DEFAULT_ANIM,renderMode:"light",reduceMotion:!0}},a);return(0,onboarding_cover_1.buildBrandedCover)({ctx:o,variant:"band",copy:{productName:"Contributor Table",title:"A contributor table."},hero:r(u=>(0,onboarding_cover_1.onboardingFrame)((0,onboarding_cover_1.inlineHeroDoc)(i),u.borderStrong),"hero"),heroAssets:i.assets,children:i.children})}},(0,template_utils_1.registerTemplate)(exports.AlpineContributorTableV2);
@@ -0,0 +1 @@
1
+ "use strict";var o=Object.defineProperty;var e=(r,t)=>o(r,"name",{value:t,configurable:!0});Object.defineProperty(exports,"__esModule",{value:!0}),exports.AlpineContributorTableV2=void 0;var contributor_table_1=require("./contributor-table");Object.defineProperty(exports,"AlpineContributorTableV2",{enumerable:!0,get:e(function(){return contributor_table_1.AlpineContributorTableV2},"get")});
@@ -0,0 +1 @@
1
+ "use strict";var G=Object.defineProperty;var g=(e,n)=>G(e,"name",{value:n,configurable:!0});Object.defineProperty(exports,"__esModule",{value:!0}),exports.AlpineDonutV4=void 0;const types_1=require("@m0saic/types"),template_utils_1=require("@m0saic/template-utils"),geometry_1=require("../../../charts/donut/v3/geometry"),anim_1=require("../../../charts/donut/v3/anim"),alpine_card_1=require("../../_shared/alpine-card"),alpine_theme_1=require("../../_shared/alpine-theme"),onboarding_cover_1=require("../../../_shared/onboarding-cover"),alpine_anim_1=require("../../_shared/alpine-anim"),alpine_conventions_1=require("../../_shared/alpine-conventions"),canvas_handles_1=require("../../../_shared/canvas-handles"),DEFAULT_PRESET="light",DEFAULT_RENDER_MODE="premium",DEFAULT_THICKNESS=.42,DEFAULT_SEG_LABELS="percent",DEFAULT_LEGEND="right",DEFAULT_ANIM={renderMode:DEFAULT_RENDER_MODE,introFrac:.7,countUp:!0,easing:"easeOut",reduceMotion:!1},RADIUS_SCALE=.9,GAP_DEG=2,VALUE_FONT_FRAC=.26,CAPTION_FONT_FRAC=.1,SEG_LABEL_FONT_FRAC=.42,SEG_LABEL_MIN_SWEEP_DEG=16,RING_FRAC_WITH_LEGEND=.56;function cellText(e,n,r){return{type:"text",visual:{backgroundColor:"black@0"},layers:[{content:{kind:"literal",text:e||" "},style:{fontSize:n,fontColor:r},placement:{hAlign:"center",vAlign:"middle"}}]}}g(cellText,"cellText");function cellExprText(e,n,r){return{type:"text",renderMode:{kind:"video"},visual:{backgroundColor:"black@0"},layers:[{content:{kind:"expr",expr:e,eval:"frame"},style:{fontSize:n,fontColor:r},placement:{hAlign:"center",vAlign:"middle"}}]}}g(cellExprText,"cellExprText");function textBBox(e,n,r,i){const c=Math.max(i,r.length*i*.85+i),u=i*1.6;return{minX:e-c/2,minY:n-u/2,maxX:e+c/2,maxY:n+u/2}}g(textBBox,"textBBox");function labelColorFor(e,n,r){const i=/^#?([0-9a-f]{6})/i.exec(String(e));if(!i)return n;const c=parseInt(i[1],16);return(.2126*(c>>16&255)+.7152*(c>>8&255)+.0722*(c&255))/255>.6?r:n}g(labelColorFor,"labelColorFor");const clampI=g((e,n,r)=>Math.max(n,Math.min(r,Math.round(e))),"clampI");function buildSegmentRing(e){var n;const{cw:r,ch:i,values:c,colors:u,theme:E,light:w}=e,C=g((t,l,h)=>e.reduceMotion?t:w?(0,alpine_anim_1.revealGate)(t,l):(0,alpine_anim_1.revealFade)(t,l,h),"revealText"),p=r/2,f=i/2,D=Math.min(r,i)/2*RADIUS_SCALE,v=D*(1-Math.max(.05,Math.min(.9,e.thicknessFrac))),T=v*2,q={x:0,y:0,width:r,height:i},M=g((t,l)=>{const h=clampI(l.minX,0,r-2),b=clampI(l.minY,0,i-2),_=clampI(r-l.maxX,0,r-h-1),d=clampI(i-l.maxY,0,i-b-1);return(0,alpine_card_1.insetNode)(t,b,_,d,h,r,i)},"placeAt"),s=(0,geometry_1.segmentsToAngles)(c,{gapDeg:c.length>1?GAP_DEG:0}),x=g(t=>u[t%u.length],"segColor"),R=2,O=!e.reduceMotion&&!w;let I;if(O){const t=s.length,l=Math.max(t,Math.min(14,20-t-2)),h=s.reduce((d,m)=>d+(m.endDeg-m.startDeg),0),b=s.map(d=>1);let _=l-t;for(;_>0;){let d=0,m=-1;for(let A=0;A<t;A++){const o=(s[A].endDeg-s[A].startDeg)/h*l-b[A];o>m&&(m=o,d=A)}b[d]++,_--}I=[];for(let d=0;d<t;d++){const m=s[d],A=b[d],W=(m.endDeg-m.startDeg)/A;for(let o=0;o<A;o++){const k=m.startDeg+o*W;I.push({segIdx:d,startDeg:o>0?Math.max(m.startDeg,k-R):k,endDeg:m.startDeg+(o+1)*W,fadeStartDeg:k})}}}else I=s.map((t,l)=>({segIdx:l,startDeg:t.startDeg,endDeg:t.endDeg,fadeStartDeg:t.startDeg}));const F=[];for(const t of I){let l;if(!e.reduceMotion){const h=Math.max(.01,(t.endDeg-t.fadeStartDeg)/360),b=Math.max(.12,e.introSec*h*1.15),_=Math.max(0,(e.introSec-b)*(0,anim_1.sweepInverseEase)(e.ease,t.fadeStartDeg/360));l=w?{startAtSec:_,enable:`gte(t,${_.toFixed(3)})`}:{startAtSec:_,alpha:(0,template_utils_1.fadeInExpr)(_,b)}}F.push((0,alpine_card_1.paint)((0,template_utils_1.bindPropPath)((0,alpine_card_1.tag)((0,template_utils_1.makeColorTile)(x(t.segIdx),{mask:{kind:"inline-mask",localPath:(0,geometry_1.annularSectorPath)({cx:p,cy:f,rOuter:D,rInner:v,startDeg:t.startDeg,endDeg:t.endDeg}),bounds:q},...l?{overlay:l}:{}}),"sector"),"segments",[e.srcIndices[t.segIdx],"color"],"color")))}const U=[],B=D-v;if(e.segLabels==="percent"&&B>=14){const t=Math.max(9,Math.round(B*SEG_LABEL_FONT_FRAC));for(let l=0;l<s.length;l++){const h=s[l];if(h.endDeg-h.startDeg<SEG_LABEL_MIN_SWEEP_DEG)continue;const{x:b,y:_}=(0,geometry_1.sectorCentroid)({cx:p,cy:f,rOuter:D,rInner:v,startDeg:h.startDeg,endDeg:h.endDeg}),d=`${Math.round(h.frac*100)}%`;U.push(M((0,alpine_card_1.paint)(C((0,template_utils_1.bindPropPath)((0,alpine_card_1.tag)(cellText(d,t,labelColorFor(x(l),E.card,E.title)),"seg-label"),"segments",[e.srcIndices[l],"value"],"number"),e.introSec*.6,Math.max(.1,e.introSec*.3))),textBBox(b,_,d,t)))}}const S=e.centerValue,N=!!(e.centerLabel&&e.centerLabel.trim()),L=Math.max(10,Math.round(Math.min(T*VALUE_FONT_FRAC,T*.72/Math.max(1,S.length*.62)))),V=(n=e.centerLabel)!==null&&n!==void 0?n:"",P=Math.max(8,Math.min(Math.round(T*CAPTION_FONT_FRAC),Math.floor(T*.8/Math.max(1,V.length*.62)))),H=N?f-v*.12:f,y=e.countUp&&!e.reduceMotion&&/\d/.test(S),a=[M((0,alpine_card_1.paint)((0,template_utils_1.bindProp)((0,alpine_card_1.tag)(y?cellExprText((0,template_utils_1.animateNumbersInText)(S,{durationSec:e.introSec,ease:e.ease}),L,E.title):cellText(S,L,E.title),"center-value"),"centerValue")),textBBox(p,H,S,L))];return N&&a.push(M((0,alpine_card_1.paint)(C((0,template_utils_1.bindProp)((0,alpine_card_1.tag)(cellText(e.centerLabel,P,E.subtitle),"center-label"),"centerLabel"),e.introSec*.7,Math.max(.1,e.introSec*.3))),textBBox(p,f+v*.44,e.centerLabel,P))),(0,alpine_card_1.overlay)([...F,...U,...a])}g(buildSegmentRing,"buildSegmentRing");function legendNode(e){var n,r;const{labels:i,percents:c,srcIndices:u,colors:E,theme:w,cellH:C,cellW:p}=e,f=i.length,D=g((a,t)=>Math.ceil(Math.max(1,a)*.62*t*1.08)+2,"need"),v=Math.max(1,...i.map(a=>(a??"").length)),T=Math.max(1,...c.map(a=>(a??"").length)),q=g((a,t)=>Math.ceil(Math.max(1,a)*.85*t),"needPct"),M=g(a=>Math.round(a*1.1)+2*Math.round(a*.55)+D(v,a)+q(T,a),"rowWAt");let s=e.font;M(s)>p&&(s=Math.max(9,Math.floor(s*(p/M(s)))));const x=Math.round(s*1.1),R=Math.round(s*.55),O=D(v,s),I=q(T,s),F=x+R+O+R+I,U=Math.max(s,Math.round(s*1.7)),B=Math.round(s*.5),S=f*(U+B),N=Math.max(0,Math.round((C-S)/2)),L=g(a=>Math.max(1,Math.round(a/4)),"q"),V=Math.max(2,Math.round(2*U/Math.max(1,B))),P=[];for(let a=0;a<f;a++){const t=(0,template_utils_1.makeColorTile)(E[a%E.length],{effects:{rounding:{cornerStyle:"rounded",borderRadius:.4}},placement:{inset:{y:.25}}});t.editor={label:"legend-swatch"},(0,template_utils_1.bindPropPath)(t,"segments",[u[a],"color"],"color");const l=(0,alpine_card_1.colSplit)([{weight:L(x),node:(0,alpine_card_1.paint)(t)},{weight:L(R),node:alpine_card_1.EMPTY},{weight:L(O),node:(0,alpine_card_1.paint)((0,template_utils_1.bindPropPath)((0,alpine_card_1.tag)((0,alpine_card_1.textCell)((n=i[a])!==null&&n!==void 0?n:"",s,w.label,"left","middle"),"legend-label"),"segments",[u[a],"label"],"string"))},{weight:L(R),node:alpine_card_1.EMPTY},{weight:L(I),node:(0,alpine_card_1.paint)((0,template_utils_1.bindPropPath)((0,alpine_card_1.tag)((0,alpine_card_1.textCell)((r=c[a])!==null&&r!==void 0?r:"",s,w.subtitle,"right","middle"),"legend-pct"),"segments",[u[a],"value"],"number"))},...p-F>4?[{weight:L(p-F),node:alpine_card_1.EMPTY}]:[]]);P.push((0,alpine_card_1.rowSplit)([{weight:1,node:alpine_card_1.EMPTY},{weight:V,node:l},{weight:1,node:alpine_card_1.EMPTY}]))}const H=(0,alpine_card_1.rowSplit)(P.map(a=>({weight:1,node:a}))),y=[];return N>0&&y.push({weight:N,node:alpine_card_1.EMPTY}),y.push({weight:S,node:H}),N>0&&y.push({weight:N,node:alpine_card_1.EMPTY}),(0,alpine_card_1.rowSplit)(y)}g(legendNode,"legendNode");const propsSchema=(0,template_utils_1.definePropsSchema)({segments:{type:"array",required:!0,meta:{control:{flavor:"objectRows",columns:[{label:"Label",key:"label",kind:"text",placeholder:"Segment"},{label:"Value",key:"value",kind:"number"},{label:"Color",key:"color",kind:"color"}],palette:alpine_theme_1.ALPINE_PALETTE}}},title:{type:"string",required:!1},subtitle:{type:"string",required:!1},centerValue:{type:"string",required:!1},centerLabel:{type:"string",required:!1},legend:{type:"string",required:!1,meta:{constraints:{oneOf:["right","none"]}}},segmentLabels:{type:"string",required:!1,meta:{constraints:{oneOf:["none","percent"]}}},preset:{type:"string",required:!1,meta:{constraints:{oneOf:["light","dark"]}}},ringThicknessFrac:{type:"number",required:!1,meta:{constraints:{min:.05,max:.9},control:{flavor:"slider",step:.02}}},anim:{type:"group",required:!1,fields:{renderMode:(0,alpine_conventions_1.bEnum)(["premium","light"]),reduceMotion:alpine_conventions_1.ALPINE_ANIM_FIELDS_BARE.reduceMotion,introFrac:alpine_conventions_1.ALPINE_ANIM_FIELDS_BARE.introFrac,countUp:(0,alpine_conventions_1.bBool)(),easing:alpine_conventions_1.ALPINE_ANIM_FIELDS_BARE.easing}},theme:{type:"group",required:!1,fields:{slug:(0,alpine_conventions_1.bStr)(),preset:(0,alpine_conventions_1.bStr)(),namespace:(0,alpine_conventions_1.bStr)(),forceFetch:(0,alpine_conventions_1.bBool)()}},debugLayout:{type:"boolean",required:!1}});exports.AlpineDonutV4={id:(0,types_1.asTemplateId)("@m0saic/alpine/donut/v4"),version:4,capabilities:{tier:"core"},outputHints:{format:{kind:"video",container:"mp4"},width:1280,height:800,fps:30,durationMs:2e3,posterTimeMs:1900},bindings:{unbound:{...alpine_conventions_1.ALPINE_THEME_UNBOUND,...alpine_conventions_1.ALPINE_ANIM_UNBOUND}},propsSchema,defaultProps:{debugLayout:!1,theme:{forceFetch:!1},segments:[{label:"Enterprise",value:42,color:alpine_theme_1.ALPINE_PALETTE[0]},{label:"Pro",value:33,color:alpine_theme_1.ALPINE_PALETTE[1]},{label:"Free",value:25,color:alpine_theme_1.ALPINE_PALETTE[2]}],title:"DONUT CHART",subtitle:"Revenue Mix",centerValue:"$12,480",centerLabel:"Total",preset:DEFAULT_PRESET,ringThicknessFrac:DEFAULT_THICKNESS,segmentLabels:DEFAULT_SEG_LABELS,legend:DEFAULT_LEGEND,anim:DEFAULT_ANIM},async render(e,n){var r,i,c,u,E,w,C,p,f,D;const v=Math.max(1,Math.round(n.target.width)),T=Math.max(1,Math.round(n.target.height)),q=((r=e.segments)!==null&&r!==void 0?r:[]).map((o,k)=>({s:o,srcIndex:k})).slice(0,geometry_1.MAX_SEGMENTS).filter(({s:o})=>o&&Number.isFinite(o.value)&&o.value>0),M=q.map(o=>o.s);if(M.length===0)return(0,template_utils_1.makeIncompleteMosaic)("Add a segment \u2014 a label and a value above zero.",{title:"Donut Chart",width:v,height:T});const s=await(0,alpine_theme_1.resolveAlpineTheme)((i=e.preset)!==null&&i!==void 0?i:DEFAULT_PRESET,n,e.theme),x={...DEFAULT_ANIM,...(c=e.anim)!==null&&c!==void 0?c:{}},R=(u=x.renderMode)!==null&&u!==void 0?u:DEFAULT_RENDER_MODE,O=(E=x.reduceMotion)!==null&&E!==void 0?E:!1,I=(w=e.legend)!==null&&w!==void 0?w:DEFAULT_LEGEND,F=M.map(o=>o.value),U=F.reduce((o,k)=>o+k,0),B=M.map((o,k)=>(0,alpine_card_1.resolveColor)(o.color,alpine_theme_1.ALPINE_PALETTE[k%alpine_theme_1.ALPINE_PALETTE.length])),S=F.map(o=>`${Math.round(o/U*100)}%`),N=Math.max(.1,((C=n.target.durationMs)!==null&&C!==void 0?C:2e3)/1e3),L=Math.max(.1,Math.min(1,x.introFrac)*N),V=(0,alpine_card_1.alpineCard)({theme:s,W:v,H:T,title:e.title,subtitle:e.subtitle}),P=V.contentRect,H=I==="right"&&M.length>0,y=H?Math.max(16,Math.round(P.w*RING_FRAC_WITH_LEGEND)):P.w,a=P.w-y,t=((p=e.centerValue)!==null&&p!==void 0?p:"").trim()||String(Math.round(U)),l=x.countUp&&!O&&/\d/.test(t),h={cw:y,ch:P.h,values:F,colors:B,srcIndices:q.map(o=>o.srcIndex),thicknessFrac:(f=e.ringThicknessFrac)!==null&&f!==void 0?f:DEFAULT_THICKNESS,segLabels:(D=e.segmentLabels)!==null&&D!==void 0?D:DEFAULT_SEG_LABELS,centerValue:t,centerLabel:e.centerLabel,theme:s,introSec:L,ease:x.easing,countUp:x.countUp},b=buildSegmentRing({...h,reduceMotion:O,light:R==="light"}),_=Math.max(11,Math.round(T*.024)),d=H?(0,alpine_card_1.colSplit)([{weight:y,node:b},{weight:a,node:legendNode({labels:M.map(o=>o.label),percents:S,srcIndices:q.map(o=>o.srcIndex),colors:B,theme:s,font:_,cellH:P.h,cellW:a})}]):b,m=V.compose(d),A=m.sources;(0,canvas_handles_1.addHandlesByLabel)(A,{sector:[{propKey:"ringThicknessFrac"}],"center-value":e.centerLabel&&e.centerLabel.trim()?[]:[{propKey:"centerLabel"}]}),(0,alpine_conventions_1.bindHeaderAddHandles)(A,e,"center-value");const W={kind:"mosaic_document",version:1,assets:{},m0:m.m0,sources:(0,alpine_conventions_1.bindCardSurface)(m.sources),backgroundColor:V.backgroundColor,fps:n.target.fps,durationMs:n.target.durationMs};return Promise.resolve((0,template_utils_1.withLayoutContract)(W,n,{templateId:"@m0saic/alpine/donut/v4",relations:H&&M.length>=2?[{label:"legend-swatch",equal:"size",tolerance:.02,tolerancePx:1}]:[],constraints:l?[]:[...V.constraints,...H?[{label:"legend-label",textFits:{charWidthEm:.62,padPx:0}},{label:"legend-pct",textFits:{charWidthEm:.62,padPx:0}}]:[],{label:"center-value",textFits:{charWidthEm:.62,padPx:0}},...e.centerLabel&&e.centerLabel.trim()?[{label:"center-label",textFits:{charWidthEm:.62,padPx:0}}]:[]],debug:e.debugLayout===!0}))},async renderCover(e,n){const r=(0,onboarding_cover_1.brandedCoverHeroBox)(n,"band"),i={...n,target:{...n.target,width:r.width,height:r.height},output:{...n.output,width:r.width,height:r.height}},c=await exports.AlpineDonutV4.render({...exports.AlpineDonutV4.defaultProps,anim:{...DEFAULT_ANIM,renderMode:"light",reduceMotion:!0}},i);return(0,onboarding_cover_1.buildBrandedCover)({ctx:n,variant:"band",copy:{productName:"Donut",title:"A donut chart."},hero:g(u=>(0,onboarding_cover_1.onboardingFrame)((0,onboarding_cover_1.inlineHeroDoc)(c),u.borderStrong),"hero"),heroAssets:c.assets})}},(0,template_utils_1.registerTemplate)(exports.AlpineDonutV4);
@@ -0,0 +1 @@
1
+ "use strict";var n=Object.defineProperty;var e=(t,r)=>n(t,"name",{value:r,configurable:!0});Object.defineProperty(exports,"__esModule",{value:!0}),exports.AlpineDonutV4=void 0;var donut_1=require("./donut");Object.defineProperty(exports,"AlpineDonutV4",{enumerable:!0,get:e(function(){return donut_1.AlpineDonutV4},"get")});
@@ -0,0 +1 @@
1
+ "use strict";var He=Object.defineProperty;var s=(t,e)=>He(t,"name",{value:e,configurable:!0});Object.defineProperty(exports,"__esModule",{value:!0}),exports.AlpineHeatmapV3=void 0;const types_1=require("@m0saic/types"),template_utils_1=require("@m0saic/template-utils"),dsl_stdlib_1=require("@m0saic/dsl-stdlib"),dsl_1=require("@m0saic/dsl"),alpine_card_1=require("../../_shared/alpine-card"),alpine_theme_1=require("../../_shared/alpine-theme"),alpine_anim_1=require("../../_shared/alpine-anim"),alpine_conventions_1=require("../../_shared/alpine-conventions"),canvas_handles_1=require("../../../_shared/canvas-handles"),onboarding_cover_1=require("../../../_shared/onboarding-cover"),DEFAULT_PRESET="light",DEFAULT_RENDER_MODE="premium",DEFAULT_ANIM={renderMode:DEFAULT_RENDER_MODE,introFrac:.7,easing:"easeOut",reduceMotion:!1},DEFAULT_LEVELS=5,MAX_ROWS=14,MAX_COLS=30,SNAP_PX=4,EDGE_PAD=1.5,EMPTY_LIGHT="#EBEEF2",EMPTY_DARK="#1B2434";function hexToRgb(t){const e=/^#?([0-9a-f]{6})/i.exec(String(t));if(!e)return[0,0,0];const a=parseInt(e[1],16);return[a>>16&255,a>>8&255,a&255]}s(hexToRgb,"hexToRgb");function rgbToHex(t,e,a){const l=s(i=>Math.max(0,Math.min(255,Math.round(i))).toString(16).padStart(2,"0"),"c");return`#${l(t)}${l(e)}${l(a)}`}s(rgbToHex,"rgbToHex");function mix(t,e,a){const[l,i,c]=hexToRgb(t),[u,h,p]=hexToRgb(e),d=Math.max(0,Math.min(1,a));return rgbToHex(l+(u-l)*d,i+(h-i)*d,c+(p-c)*d)}s(mix,"mix");function luminance(t){const[e,a,l]=hexToRgb(t);return(.2126*e+.7152*a+.0722*l)/255}s(luminance,"luminance");function onColor(t,e,a){return luminance(t)>.6?a:e}s(onColor,"onColor");const clampInt=s((t,e,a)=>Math.max(e,Math.min(a,Math.round(t))),"clampInt"),snapGrid=s(t=>Math.round(t/SNAP_PX)*SNAP_PX,"snapGrid");function rectPiece(t,e,a,l,i,c,u,h){const p=clampInt(snapGrid(a),0,t-SNAP_PX),d=clampInt(snapGrid(l),0,e-SNAP_PX),f=clampInt(snapGrid(a+i),p+SNAP_PX,t),x=clampInt(snapGrid(l+c),d+SNAP_PX,e);return{rect:{x:p,y:d,w:f-p,h:x-d,claimant:"F",importance:h},source:u}}s(rectPiece,"rectPiece");function placeText(t,e,a,l,i){const c=s(x=>Math.floor((x-EDGE_PAD)/SNAP_PX)*SNAP_PX,"snapDown"),u=s(x=>Math.ceil((x+EDGE_PAD)/SNAP_PX)*SNAP_PX,"snapUp"),h=clampInt(c(a.minX),0,t-1),p=clampInt(c(a.minY),0,e-1),d=clampInt(u(a.maxX),h+SNAP_PX,t),f=clampInt(u(a.maxY),p+SNAP_PX,e);return{rect:{x:h,y:p,w:d-h,h:f-p,claimant:"F",importance:i},source:l}}s(placeText,"placeText");function cellText(t,e,a,l="center"){return{type:"text",visual:{backgroundColor:"black@0"},layers:[{content:{kind:"literal",text:t||" "},style:{fontSize:e,fontColor:a},placement:{hAlign:l,vAlign:"middle"}}]}}s(cellText,"cellText");function compactNum(t){const e=Math.round(t),a=Math.abs(e),l=s((i,c)=>`${i.toFixed(1).replace(/\.0$/,"")}${c}`,"fmt");return a<1e3?String(e):a<1e6?l(e/1e3,"K"):a<1e9?l(e/1e6,"M"):l(e/1e9,"B")}s(compactNum,"compactNum");function textBBox(t,e,a,l,i){const c=Math.max(l,a.length*l*.62+l*.5),u=l*1.6,h=i==="left"?t:i==="right"?t-c:t-c/2;return{minX:h,minY:e-u/2,maxX:h+c,maxY:e+u/2}}s(textBBox,"textBBox");function parseValues(t){return Array.isArray(t)?t.map(e=>Number.isFinite(e)?Number(e):0):typeof t=="string"?t.split(/[\s,]+/).map(e=>e.trim()).filter(e=>e!=="").map(e=>{const a=Number(e);return Number.isFinite(a)?a:0}):[]}s(parseValues,"parseValues");const propsSchema=(0,template_utils_1.definePropsSchema)({rows:{type:"array",required:!0,meta:{control:{flavor:"objectRows",columns:[{label:"Label",key:"label",kind:"text",placeholder:"Mon"},{label:"Values",key:"values",kind:"text",placeholder:"3, 5, 1, 0, 8"}]}}},colLabels:{type:"string[]",required:!1},title:{type:"string",required:!1},subtitle:{type:"string",required:!1},color:{type:"string",required:!1,meta:{constraints:{isColor:!0},control:{colorPicker:!0,defaultColor:"#2563EB"}}},preset:{type:"string",required:!1,meta:{constraints:{oneOf:["light","dark"]}}},levels:{type:"number",required:!1,meta:{constraints:{min:2,max:9}}},showValues:{type:"boolean",required:!1},showLegend:{type:"boolean",required:!1},scale:{type:"group",required:!1,fields:{min:(0,alpine_conventions_1.bNum)(),max:(0,alpine_conventions_1.bNum)(),emptyColor:{type:"string",required:!1,meta:{constraints:{isColor:!0},control:{colorPicker:!0}}},cellRadius:(0,alpine_conventions_1.bNum)({flavor:"slider",step:.05},{min:0,max:.5})}},anim:{type:"group",required:!1,fields:{renderMode:(0,alpine_conventions_1.bEnum)(["premium","light"]),reduceMotion:alpine_conventions_1.ALPINE_ANIM_FIELDS_BARE.reduceMotion,introFrac:alpine_conventions_1.ALPINE_ANIM_FIELDS_BARE.introFrac,easing:alpine_conventions_1.ALPINE_ANIM_FIELDS_BARE.easing}},theme:{type:"group",required:!1,fields:{slug:(0,alpine_conventions_1.bStr)(),preset:(0,alpine_conventions_1.bStr)(),namespace:(0,alpine_conventions_1.bStr)(),forceFetch:(0,alpine_conventions_1.bBool)()}},debugLayout:{type:"boolean",required:!1}});exports.AlpineHeatmapV3={id:(0,types_1.asTemplateId)("@m0saic/alpine/heatmap/v3"),version:3,capabilities:{tier:"core"},outputHints:{format:{kind:"video",container:"mp4"},width:1280,height:800,fps:30,durationMs:2e3,posterTimeMs:1900},bindings:{unbound:{...alpine_conventions_1.ALPINE_THEME_UNBOUND,...alpine_conventions_1.ALPINE_ANIM_UNBOUND}},propsSchema,defaultProps:{debugLayout:!1,theme:{forceFetch:!1},rows:[{label:"Mon",values:[0,2,1,4,3,5,2,6]},{label:"Tue",values:[1,3,2,5,4,6,3,7]},{label:"Wed",values:[2,4,3,6,5,8,4,9]},{label:"Thu",values:[1,2,4,5,7,6,5,8]},{label:"Fri",values:[3,5,6,8,9,7,8,10]},{label:"Sat",values:[0,1,0,2,1,3,1,2]},{label:"Sun",values:[0,0,1,1,0,2,0,1]}],colLabels:["W1","W2","W3","W4","W5","W6","W7","W8"],title:"CONTRIBUTIONS",subtitle:"Commits by day",preset:DEFAULT_PRESET,levels:DEFAULT_LEVELS,showLegend:!0,showValues:!1,scale:{min:0,cellRadius:.25},anim:DEFAULT_ANIM},async render(t,e){var a,l,i,c,u,h,p,d,f,x,A,y;const N=Math.max(1,Math.round(e.target.width)),L=Math.max(1,Math.round(e.target.height)),w=((a=t.rows)!==null&&a!==void 0?a:[]).map((n,r)=>({label:typeof n?.label=="string"?n.label:"",values:parseValues(n?.values),srcIndex:r,cellLeaves:Array.isArray(n?.values)})).filter(n=>n.values.length>0).slice(0,MAX_ROWS);if(w.length===0)return(0,template_utils_1.makeIncompleteMosaic)("Add a row \u2014 a label and its values, one number per cell.",{title:"Heatmap",width:N,height:L});const v=Math.min(MAX_COLS,Math.max(...w.map(n=>n.values.length))),_=w.length,o=await(0,alpine_theme_1.resolveAlpineTheme)((l=t.preset)!==null&&l!==void 0?l:DEFAULT_PRESET,e,t.theme),m=((i=t.preset)!==null&&i!==void 0?i:DEFAULT_PRESET)==="dark",ne={...DEFAULT_ANIM,...(c=t.anim)!==null&&c!==void 0?c:{}},ae=!ne.reduceMotion,ue=((u=ne.renderMode)!==null&&u!==void 0?u:DEFAULT_RENDER_MODE)==="light",K=(h=t.showLegend)!==null&&h!==void 0?h:!0,Pe=(p=t.showValues)!==null&&p!==void 0?p:!1,T=Math.max(2,Math.min(9,Math.round((d=t.levels)!==null&&d!==void 0?d:DEFAULT_LEVELS))),P=(f=t.scale)!==null&&f!==void 0?f:{},oe=t.color&&String(t.color).trim()&&String(t.color).toLowerCase()!=="none"?t.color:o.primary,Ee=P.emptyColor&&String(P.emptyColor).trim()&&String(P.emptyColor).toLowerCase()!=="none"?P.emptyColor:m?EMPTY_DARK:EMPTY_LIGHT,Le=mix(oe,o.card,.78),Te=w.flatMap(n=>n.values),Se=Math.max(...Te),I=Number.isFinite(P.min)?P.min:0,Ce=Number.isFinite(P.max)?P.max:Math.max(I+1,Se),he=s(n=>{if(n<=I)return 0;const r=(n-I)/Math.max(1e-6,Ce-I);return Math.max(1,Math.min(T-1,1+Math.floor(r*(T-1)*.99999)))},"bucketOf"),me=s(n=>n<=0?Ee:T<=2?oe:mix(Le,oe,(n-1)/(T-2)),"bucketColor"),pe=Math.max(0,Math.min(.5,(x=P.cellRadius)!==null&&x!==void 0?x:.25)),$=(0,alpine_card_1.alpineCard)({theme:o,W:N,H:L,title:t.title,subtitle:t.subtitle}),S=$.contentRect,le=!!(t.colLabels&&t.colLabels.some(n=>n&&n.trim())),G=w.some(n=>n.label&&n.label.trim()),C=Math.max(10,Math.round(L*.022)),R=Math.max(9,Math.round(L*.02)),j=le?Math.round(C*1.7):0,q=K?Math.round(R*2.2):0,re=Math.max(0,...w.map(n=>{var r;return((r=n.label)!==null&&r!==void 0?r:"").length}))*C*.62,B=G?re>3*C?Math.round((re+C*.5)*6/5):Math.round(re+C*.8):0,ge=S.w-B,Me=S.h-j-q,z=Math.max(SNAP_PX,snapGrid(Math.min(ge/v,Me/_))),F=v*z,se=_*z,Fe=Math.max(SNAP_PX,snapGrid(z*.14)),k=Math.max(0,Math.round((ge-F)/2)),ie=Math.max(0,Math.round((Me-se)/2)),Ae=Math.max(.1,((A=e.target.durationMs)!==null&&A!==void 0?A:2e3)/1e3),be=Math.max(.1,Math.min(1,ne.introFrac)*Ae),Ne=Math.max(1,_+v-2),H=Math.max(.08,be*.35),Ie=s(n=>ae?ue?{startAtSec:n,enable:`gte(t,${n.toFixed(3)})`}:{startAtSec:n,alpha:(0,template_utils_1.fadeInExpr)(n,H)}:{},"cellReveal"),fe=String((0,dsl_stdlib_1.grid)({rows:_,cols:v}).m0),ce=[],J=[];let Q=!1;for(let n=0;n<_;n++){const r=w[n].values,{srcIndex:g,cellLeaves:V}=w[n],O=s((M,b)=>V?(0,template_utils_1.bindPropPath)(M,"rows",[g,"values",b],"number"):M,"bindCell");for(let M=0;M<v;M++){const b=M<r.length?r[M]:I,ee=me(he(b)),X=ae?(be-H)*((n+M)/Ne):0,U=Ie(X),W=(0,template_utils_1.makeColorTile)(ee,{effects:{rounding:{cornerStyle:"rounded",borderRadius:pe}},...Object.keys(U).length?{overlay:U}:{}});if(W.editor={label:"cell"},he(b)===0?(0,template_utils_1.bindProps)(W,[...V?[{propKey:"rows",path:[g,"values",M],kind:"number"}]:[],{propKey:"scale.emptyColor"}]):O(W,M),ce.push(W),Pe&&b>I){Q=!0;const te=compactNum(b),E=Math.max(8,Math.round(z*.34)),D=onColor(ee,"#FFFFFF",o.title),de=O((0,alpine_card_1.tag)(cellText(te,E,D,"center"),"cell-value"),M);J.push(ae?ue?(0,alpine_anim_1.revealGate)(de,X+H*.5):(0,alpine_anim_1.revealFade)(de,X+H*.5,H):de)}else J.push(cellText(" ",8,"black@0","center"))}}const xe={m0:fe,sources:ce},Re=Q?(0,alpine_card_1.overlay)([xe,{m0:fe,sources:J}]):xe,qe=G?(0,alpine_card_1.rowSplit)(w.map(n=>{var r,g;return{weight:1,node:((r=n.label)!==null&&r!==void 0?r:"").trim()?(0,alpine_card_1.colSplit)([{weight:5,node:(0,alpine_card_1.paint)((0,template_utils_1.bindPropPath)((0,alpine_card_1.tag)(cellText((g=n.label)!==null&&g!==void 0?g:"",C,o.label,"right"),"row-label"),"rows",[n.srcIndex,"label"],"string"))},{weight:1,node:alpine_card_1.EMPTY}]):alpine_card_1.EMPTY}})):alpine_card_1.EMPTY,Be=(0,alpine_card_1.colSplit)([...k>0?[{weight:k,node:alpine_card_1.EMPTY}]:[],...G?[{weight:B,node:qe}]:[],{weight:F,node:Re},...S.w-k-B-F>0?[{weight:S.w-k-B-F,node:alpine_card_1.EMPTY}]:[]]),we=(y=t.colLabels)!==null&&y!==void 0?y:[],ke=Math.max(1,...we.map(n=>(n??"").length)),Ye=Math.max(9,Math.min(C,Math.floor(F/v*.94/(ke*.62)))),We=le?(0,alpine_card_1.colSplit)([{weight:B+k,node:alpine_card_1.EMPTY},{weight:F,node:(0,alpine_card_1.colSplit)(Array.from({length:v},(n,r)=>{const g=we[r];return{weight:1,node:g&&g.trim()?(0,alpine_card_1.paint)((0,template_utils_1.bindProp)((0,alpine_card_1.tag)(cellText(g,Ye,o.muted,"center"),"col-label"),"colLabels",r)):alpine_card_1.EMPTY}}))},{weight:Math.max(1,S.w-B-k-F),node:alpine_card_1.EMPTY}]):alpine_card_1.EMPTY;let ve=alpine_card_1.EMPTY;if(K){const n=Math.max(SNAP_PX*2,Math.round(R*1.1)),r=Math.max(2,Math.round(n*.28)),g=Math.max(1,Math.round(textBBoxWidth("Less",R))),V=Math.max(1,Math.round(textBBoxWidth("More",R))),O=T*(n+r),M=g+r*2+O+r*2+V,b=s(E=>Math.max(1,Math.round(E/4)),"q"),ee=n+r,X=r/(2*ee),U=[];for(let E=0;E<T;E++){const D=(0,template_utils_1.makeColorTile)(me(E),{effects:{rounding:{cornerStyle:"rounded",borderRadius:pe}},placement:{inset:{x:X}}});D.editor={label:"legend-swatch"},E===0?(0,template_utils_1.bindProp)(D,"scale.emptyColor"):E===T-1&&(0,template_utils_1.bindProp)(D,"color"),U.push({weight:1,node:(0,alpine_card_1.paint)(D)})}const W=(0,alpine_card_1.colSplit)([{weight:b(Math.max(1,S.w-M)),node:alpine_card_1.EMPTY},{weight:b(g),node:(0,alpine_card_1.paint)((0,alpine_card_1.tag)(cellText("Less",R,o.muted,"left"),"legend-caption"))},{weight:b(r*2),node:alpine_card_1.EMPTY},{weight:b(O),node:(0,alpine_card_1.colSplit)(U)},{weight:b(r*2),node:alpine_card_1.EMPTY},{weight:b(V),node:(0,alpine_card_1.paint)((0,alpine_card_1.tag)(cellText("More",R,o.muted,"left"),"legend-caption"))}]),te=Math.max(0,Math.round((q-n)/2));ve=(0,alpine_card_1.rowSplit)([{weight:Math.max(1,te),node:alpine_card_1.EMPTY},{weight:n,node:W},{weight:Math.max(1,q-n-te),node:alpine_card_1.EMPTY}])}const ye=Math.max(0,S.h-q-ie-j-se),Y=[];ie>0&&Y.push({weight:ie,node:alpine_card_1.EMPTY}),j>0&&Y.push({weight:j,node:We}),Y.push({weight:se,node:Be}),ye>0&&Y.push({weight:ye,node:alpine_card_1.EMPTY}),q>0&&Y.push({weight:q,node:ve});const Z=$.compose((0,alpine_card_1.rowSplit)(Y)),_e=Z.sources;(0,canvas_handles_1.addHandlesByLabel)(_e,{"legend-swatch":s((n,r)=>[...r===0?[{propKey:"scale.min"}]:[],...r===T-1?[{propKey:"scale.max"}]:[],{propKey:"levels"},{propKey:"scale.cellRadius"}],"legend-swatch")}),(0,alpine_conventions_1.bindHeaderAddHandles)(_e,t,["row-label","col-label","cell"]),applyLatticeGapInsets({root:Z,cellSources:ce,valueSources:Q?J:null,nRows:_,nCols:v,gapPx:Fe,W:N,H:L});const De={kind:"mosaic_document",version:1,assets:{},m0:Z.m0,sources:(0,alpine_conventions_1.bindCardSurface)(Z.sources),backgroundColor:$.backgroundColor,fps:e.target.fps,durationMs:e.target.durationMs};return Promise.resolve((0,template_utils_1.withLayoutContract)(De,e,{templateId:"@m0saic/alpine/heatmap/v3",relations:[..._*v>=2?[{label:"cell",equal:"size",tolerance:.02,tolerancePx:1}]:[],...K?[{label:"legend-swatch",equal:"size",tolerance:.02,tolerancePx:1}]:[]],constraints:[...$.constraints,...Q?[{label:"cell-value",textFits:{charWidthEm:.62,padPx:0}}]:[],...G?[{label:"row-label",textFits:{charWidthEm:.62,padPx:0}}]:[],...le?[{label:"col-label",textFits:{charWidthEm:.62,padPx:0}}]:[],...K?[{label:"legend-caption",textFits:{charWidthEm:.62,padPx:0}}]:[]],debug:t.debugLayout===!0}))},async renderCover(t,e){const a=(0,onboarding_cover_1.brandedCoverHeroBox)(e,"band"),l={...e,target:{...e.target,width:a.width,height:a.height},output:{...e.output,width:a.width,height:a.height}},i=await exports.AlpineHeatmapV3.render({...exports.AlpineHeatmapV3.defaultProps,anim:{...DEFAULT_ANIM,renderMode:"light",reduceMotion:!0}},l);return(0,onboarding_cover_1.buildBrandedCover)({ctx:e,variant:"band",copy:{productName:"Heatmap",title:"A heatmap."},hero:s(c=>(0,onboarding_cover_1.onboardingFrame)((0,onboarding_cover_1.inlineHeroDoc)(i),c.borderStrong),"hero"),heroAssets:i.assets,children:i.children})}};function textBBoxWidth(t,e){return Math.max(e,t.length*e*.62+e*.5)}s(textBBoxWidth,"textBBoxWidth");function applyLatticeGapInsets(t){const{root:e,cellSources:a,valueSources:l,nRows:i,nCols:c,gapPx:u,W:h,H:p}=t;if(u<=0||a.length===0)return;const d=i*c;try{const f=e.sources.indexOf(a[0]);if(f<0||e.sources[f+d-1]!==a[d-1])return;const x=(0,dsl_1.parseM0StringToRenderFrames)(e.m0,h,p),A=[];for(const o of x)A[o.logicalIndex]=o;const y=[];for(let o=0;o<d;o++){const m=A[f+o];if(!m||m.width<1||m.height<1)return;y.push({x:m.x,y:m.y,w:m.width,h:m.height})}const N=Math.min(...y.map(o=>o.x)),L=Math.min(...y.map(o=>o.y)),w=Math.max(...y.map(o=>o.x+o.w)),v=Math.max(...y.map(o=>o.y+o.h)),_=(0,template_utils_1.latticeCellInset)({cols:c,rows:i,canvasW:w-N,canvasH:v-L,gutterXPx:u,gutterYPx:u,marginPx:0,cells:y.map((o,m)=>({unit:{c0:m%c,r0:Math.floor(m/c),cs:1,rs:1},raw:{x:o.x-N,y:o.y-L,w:o.w,h:o.h}}))});for(let o=0;o<d;o++){const m=_.insetAt(o);m&&(a[o].placement={inset:m},l&&(l[o].placement={inset:m}))}}catch{}}s(applyLatticeGapInsets,"applyLatticeGapInsets"),(0,template_utils_1.registerTemplate)(exports.AlpineHeatmapV3);
@@ -0,0 +1 @@
1
+ "use strict";var a=Object.defineProperty;var e=(t,r)=>a(t,"name",{value:r,configurable:!0});Object.defineProperty(exports,"__esModule",{value:!0}),exports.AlpineHeatmapV3=void 0;var heatmap_1=require("./heatmap");Object.defineProperty(exports,"AlpineHeatmapV3",{enumerable:!0,get:e(function(){return heatmap_1.AlpineHeatmapV3},"get")});
@@ -1 +1 @@
1
- "use strict";var p=Object.defineProperty;var u=(t,e)=>p(t,"name",{value:e,configurable:!0});var __createBinding=this&&this.__createBinding||(Object.create?(function(t,e,r,i){i===void 0&&(i=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:u(function(){return e[r]},"get")}),Object.defineProperty(t,i,o)}):(function(t,e,r,i){i===void 0&&(i=r),t[i]=e[r]})),__exportStar=this&&this.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&__createBinding(e,t,r)};Object.defineProperty(exports,"__esModule",{value:!0}),__exportStar(require("./bar-graph/v1"),exports),__exportStar(require("./donut/v1"),exports),__exportStar(require("./donut/v2"),exports),__exportStar(require("./donut/v3"),exports),__exportStar(require("./line-chart/v1"),exports),__exportStar(require("./line-chart/v2"),exports),__exportStar(require("./kpi-card/v1"),exports),__exportStar(require("./kpi-card/v2"),exports),__exportStar(require("./stat-card/v1"),exports),__exportStar(require("./contributor-table/v1"),exports),__exportStar(require("./commit-feed/v1"),exports),__exportStar(require("./commit-feed/v2"),exports),__exportStar(require("./progress-card/v1"),exports),__exportStar(require("./leaderboard/v1"),exports),__exportStar(require("./heatmap/v1"),exports),__exportStar(require("./heatmap/v2"),exports),__exportStar(require("./timeline/v1"),exports),__exportStar(require("./timeline/v2"),exports),__exportStar(require("./treemap/v1"),exports),__exportStar(require("./treemap/v2"),exports);
1
+ "use strict";var p=Object.defineProperty;var u=(t,e)=>p(t,"name",{value:e,configurable:!0});var __createBinding=this&&this.__createBinding||(Object.create?(function(t,e,r,i){i===void 0&&(i=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:u(function(){return e[r]},"get")}),Object.defineProperty(t,i,o)}):(function(t,e,r,i){i===void 0&&(i=r),t[i]=e[r]})),__exportStar=this&&this.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&__createBinding(e,t,r)};Object.defineProperty(exports,"__esModule",{value:!0}),__exportStar(require("./bar-graph/v1"),exports),__exportStar(require("./bar-graph/v2"),exports),__exportStar(require("./donut/v1"),exports),__exportStar(require("./donut/v2"),exports),__exportStar(require("./donut/v3"),exports),__exportStar(require("./donut/v4"),exports),__exportStar(require("./line-chart/v1"),exports),__exportStar(require("./line-chart/v2"),exports),__exportStar(require("./line-chart/v3"),exports),__exportStar(require("./kpi-card/v1"),exports),__exportStar(require("./kpi-card/v2"),exports),__exportStar(require("./kpi-card/v3"),exports),__exportStar(require("./stat-card/v1"),exports),__exportStar(require("./stat-card/v2"),exports),__exportStar(require("./contributor-table/v1"),exports),__exportStar(require("./contributor-table/v2"),exports),__exportStar(require("./commit-feed/v1"),exports),__exportStar(require("./commit-feed/v2"),exports),__exportStar(require("./commit-feed/v3"),exports),__exportStar(require("./progress-card/v1"),exports),__exportStar(require("./progress-card/v2"),exports),__exportStar(require("./leaderboard/v1"),exports),__exportStar(require("./leaderboard/v2"),exports),__exportStar(require("./heatmap/v1"),exports),__exportStar(require("./heatmap/v2"),exports),__exportStar(require("./heatmap/v3"),exports),__exportStar(require("./timeline/v1"),exports),__exportStar(require("./timeline/v2"),exports),__exportStar(require("./timeline/v3"),exports),__exportStar(require("./treemap/v1"),exports),__exportStar(require("./treemap/v2"),exports),__exportStar(require("./treemap/v3"),exports);
@@ -0,0 +1 @@
1
+ "use strict";var t=Object.defineProperty;var e=(r,i)=>t(r,"name",{value:i,configurable:!0});Object.defineProperty(exports,"__esModule",{value:!0}),exports.AlpineKpiCardV3=void 0;var kpi_card_1=require("./kpi-card");Object.defineProperty(exports,"AlpineKpiCardV3",{enumerable:!0,get:e(function(){return kpi_card_1.AlpineKpiCardV3},"get")});
@@ -0,0 +1 @@
1
+ "use strict";var _e=Object.defineProperty;var l=(e,t)=>_e(e,"name",{value:t,configurable:!0});Object.defineProperty(exports,"__esModule",{value:!0}),exports.AlpineKpiCardV3=void 0;const types_1=require("@m0saic/types"),template_utils_1=require("@m0saic/template-utils"),geometry_1=require("../../../charts/line-chart/v1/geometry"),alpine_card_1=require("../../_shared/alpine-card"),alpine_theme_1=require("../../_shared/alpine-theme"),alpine_anim_1=require("../../_shared/alpine-anim"),alpine_conventions_1=require("../../_shared/alpine-conventions"),onboarding_cover_1=require("../../../_shared/onboarding-cover"),DEFAULT_PRESET="light",DEFAULT_RENDER_MODE="premium",DEFAULT_DIRECTION="up",DEFAULT_ANIM={renderMode:DEFAULT_RENDER_MODE,introFrac:.7,countUp:!0,easing:"easeOut",reduceMotion:!1},ASC_TREND=[10,14,12,18,16,23,21,28,26,34];function defaultSpark(e){return e==="down"?ASC_TREND.slice().reverse():e==="flat"?[20,22,19,21,20,22,19,21,20,21]:ASC_TREND.slice()}l(defaultSpark,"defaultSpark");const LABEL_W=13,VALUE_W=34,DELTA_W=14,SPARK_W=30,GAP_W=3;function leftText(e,t,n){return{type:"text",visual:{backgroundColor:"black@0"},layers:[{content:{kind:"literal",text:e||" "},style:{fontSize:t,fontColor:n},placement:{fit:"contain",hAlign:"left",vAlign:"middle"}}]}}l(leftText,"leftText");function leftExprText(e,t,n){return{type:"text",renderMode:{kind:"video"},visual:{backgroundColor:"black@0"},layers:[{content:{kind:"expr",expr:e,eval:"frame"},style:{fontSize:t,fontColor:n},placement:{hAlign:"left",vAlign:"middle"}}]}}l(leftExprText,"leftExprText");function centerText(e,t,n){return{type:"text",visual:{backgroundColor:"black@0"},layers:[{content:{kind:"literal",text:e||" "},style:{fontSize:t,fontColor:n},placement:{fit:"contain",hAlign:"center",vAlign:"middle"}}]}}l(centerText,"centerText");function fadeIn(e,t,n,s){var o;if(!s)return e;const i=(o=e.overlay)!==null&&o!==void 0?o:{};return{...e,overlay:{...i,alpha:(0,template_utils_1.fadeInExpr)(t,n)}}}l(fadeIn,"fadeIn");function triangleSource(e,t,n,s){const o=Math.min(n,s)*.7,i=n/2,f=s/2,u=o/2,m=o*.866,h=f-m/2,c=f+m/2,a=l(g=>Math.round(g*10)/10,"n"),b=e==="up"?`M ${a(i)} ${a(h)} L ${a(i+u)} ${a(c)} L ${a(i-u)} ${a(c)} Z`:`M ${a(i-u)} ${a(h)} L ${a(i+u)} ${a(h)} L ${a(i)} ${a(c)} Z`;return(0,template_utils_1.makeColorTile)(t,{mask:{kind:"inline-mask",localPath:b,bounds:{x:0,y:0,width:n,height:s}}})}l(triangleSource,"triangleSource");function sparklineBand(e){const{bandW:t,bandH:n,color:s}=e,o=e.values.filter(d=>Number.isFinite(d));if(o.length<2||t<=0||n<=0)return alpine_card_1.EMPTY;const i=Math.min(...o),f=Math.max(...o),u=f-i||1,m=Math.max(2,Math.round(n*.06)),h=m+2,c=l(d=>d/(o.length-1)*t,"xAt"),a=l(d=>h+(1-(d-i)/u)*(n-2*h),"yAt"),b=o.map((d,q)=>({x:c(q),y:a(d)})),g=n,{poly:p}=(0,geometry_1.curvePolyline)(b,"smooth"),E=p.map(d=>({x:d.x,y:Math.max(0,Math.min(g,d.y))})),x=e.animate&&!e.light,k=x?`(${(0,template_utils_1.fadeInExpr)(0,Math.max(.12,e.introSec*.5))})*0.16`:"0.16",M=x?(0,template_utils_1.fadeInExpr)(0,Math.max(.12,e.introSec*.5)):void 0,v={x:0,y:0,width:t,height:n},H=(0,template_utils_1.makeColorTile)(s,{mask:{kind:"inline-mask",localPath:(0,geometry_1.areaPolygonPath)(E,g),bounds:v},overlay:{alpha:k}}),C=(0,template_utils_1.makeColorTile)(s,{mask:{kind:"inline-mask",localPath:(0,geometry_1.polylineStrokePath)(E,m),bounds:v},...M?{overlay:{alpha:M}}:{}});return(0,alpine_card_1.overlay)([(0,alpine_card_1.paint)(H),(0,alpine_card_1.paint)(C)])}l(sparklineBand,"sparklineBand");const propsSchema=(0,template_utils_1.definePropsSchema)({label:{type:"string",required:!0},value:{type:"string",required:!0},delta:{type:"string",required:!1},sublabel:{type:"string",required:!1},title:{type:"string",required:!1},subtitle:{type:"string",required:!1},direction:{type:"string",required:!1,meta:{constraints:{oneOf:["up","down","flat"]}}},preset:{type:"string",required:!1,meta:{constraints:{oneOf:["light","dark"]}}},valueColor:{type:"string",required:!1,meta:{constraints:{isColor:!0},control:{colorPicker:!0,defaultColor:"#0F172A"}}},sparkline:{type:"number[]",required:!1,meta:{control:{flavor:"numberList"}}},anim:{type:"group",required:!1,fields:{renderMode:(0,alpine_conventions_1.bEnum)(["premium","light"]),reduceMotion:alpine_conventions_1.ALPINE_ANIM_FIELDS_BARE.reduceMotion,introFrac:alpine_conventions_1.ALPINE_ANIM_FIELDS_BARE.introFrac,countUp:(0,alpine_conventions_1.bBool)(),easing:alpine_conventions_1.ALPINE_ANIM_FIELDS_BARE.easing}},theme:alpine_conventions_1.ALPINE_THEME_GROUP_BARE,debugLayout:{type:"boolean",required:!1}});exports.AlpineKpiCardV3={id:(0,types_1.asTemplateId)("@m0saic/alpine/kpi-card/v3"),version:3,capabilities:{tier:"core"},outputHints:{format:{kind:"video",container:"mp4"},width:1280,height:800,fps:30,durationMs:2e3,posterTimeMs:1900},propsSchema,bindings:{unbound:{...alpine_conventions_1.ALPINE_THEME_UNBOUND,...alpine_conventions_1.ALPINE_ANIM_UNBOUND,sparkline:"series"}},defaultProps:{debugLayout:!1,theme:{forceFetch:!1},label:"MONTHLY REVENUE",value:"$48,250",delta:"+12.5%",direction:"up",sublabel:"vs last month",preset:DEFAULT_PRESET,anim:DEFAULT_ANIM},async render(e,t){var n,s,o,i,f,u,m;const h=Math.max(1,Math.round(t.target.width)),c=Math.max(1,Math.round(t.target.height));if(!e.value||!String(e.value).trim())return(0,template_utils_1.makeIncompleteMosaic)("Type the headline value \u2014 the number this card is about.",{title:"KPI Card",width:h,height:c});const a=await(0,alpine_theme_1.resolveAlpineTheme)((n=e.preset)!==null&&n!==void 0?n:DEFAULT_PRESET,t,e.theme),b={...DEFAULT_ANIM,...(s=e.anim)!==null&&s!==void 0?s:{}},g=((o=b.renderMode)!==null&&o!==void 0?o:DEFAULT_RENDER_MODE)==="light",p=(i=e.direction)!==null&&i!==void 0?i:DEFAULT_DIRECTION,E=(0,alpine_card_1.resolveColor)(e.valueColor,a.title),x=p==="up"?a.positive:p==="down"?a.negative:a.subtitle,k=!!(e.delta&&e.delta.trim()),M=k&&(p==="up"||p==="down"),v=!!(e.sublabel&&e.sublabel.trim()),C=(e.sparkline!==void 0?(f=e.sparkline)!==null&&f!==void 0?f:[]:defaultSpark(p)).filter(r=>Number.isFinite(r)),d=C.length>=2,q=Math.max(.1,((u=t.target.durationMs)!==null&&u!==void 0?u:2e3)/1e3),A=Math.max(.1,Math.min(1,b.introFrac)*q),P=!b.reduceMotion,re=b.countUp&&P&&/\d/.test(e.value),K=(0,alpine_card_1.alpineCard)({theme:a,W:h,H:c,title:e.title,subtitle:e.subtitle}),T=K.contentRect,le=Math.max(11,Math.round(c*.032)),O=Math.max(28,Math.min(Math.round(c*.15),Math.floor(T.w*.94/(Math.max(1,e.value.length)*.62)))),y=Math.max(12,Math.round(c*.034)),S=Math.max(10,Math.round(c*.026)),se=!!(e.title&&e.title.trim())||!!(e.subtitle&&e.subtitle.trim()),de=[...k?[]:[{propKey:"delta"}],...v||k?[]:[{propKey:"sublabel"}]],ce=(0,template_utils_1.bindProps)(re?leftExprText((0,template_utils_1.animateNumbersInText)(e.value,{durationSec:A,ease:b.easing}),O,E):(0,alpine_card_1.tag)(leftText(e.value,O,E),"kpi-value"),[{propKey:"value"},{propKey:"valueColor"},...de]),I=A*.5,V=Math.max(.1,A*.35),L=l(r=>P?g?(0,alpine_anim_1.revealGate)(r,I):fadeIn(r,I,V,!0):r,"ff");let B=alpine_card_1.EMPTY,F=0;if(k){const r=Math.round(y*1.9),j=M?Math.round(r*.8):0,z=M?Math.round(y*.3):0,J=Math.round(y*.62*e.delta.length+y),w=Math.round(y*.6),$=M?2*w+r:0,Q=(M?$:w)+J+w,N=l(_=>Math.max(1,Math.round(_/Q*100)),"wq");let ee=[];if(M){const _=triangleSource(p,x,r,r),ye=w/$;_.placement={inset:{x:ye}},_.editor={label:"delta-arrow"},ee=[{weight:N($),node:(0,alpine_card_1.paint)(L(_))}]}const pe=(0,alpine_card_1.colSplit)([...M?[]:[{weight:N(w),node:alpine_card_1.EMPTY}],...ee,{weight:N(J),node:(0,alpine_card_1.paint)(L((0,template_utils_1.bindProps)((0,alpine_card_1.tag)(centerText(e.delta,y,x),"kpi-delta"),[{propKey:"delta"},...v?[]:[{propKey:"sublabel"}]])))},{weight:N(w),node:alpine_card_1.EMPTY}]),me=P?g?{alpha:"0.14",enable:`gte(t,${I.toFixed(3)})`}:{alpha:`(${(0,template_utils_1.fadeInExpr)(I,V)})*0.14`}:{alpha:"0.14"},te=(0,template_utils_1.makeColorTile)(x,{effects:{rounding:{cornerStyle:"rounded",borderRadius:.5}},overlay:me});te.editor={label:"delta-pill"};const be=(0,alpine_card_1.paint)(te),R=Q;F=R/Math.max(1,h);const ge=LABEL_W+GAP_W+VALUE_W+GAP_W+DELTA_W+(d?GAP_W+SPARK_W:0),ne=Math.max(r,Math.round(DELTA_W/ge*T.h)),U=l(_=>Math.max(1,Math.round(_/2)),"q2"),Y=Math.max(0,Math.round((ne-r)/2)),ae=Math.max(0,ne-r-Y),Me=(0,alpine_card_1.rowSplit)([...Y>2?[{weight:U(Y),node:alpine_card_1.EMPTY}]:[],{weight:U(r),node:(0,alpine_card_1.overlay)([be,pe])},...ae>2?[{weight:U(ae),node:alpine_card_1.EMPTY}]:[]]),oe=Math.round(y*.6),ie=Math.round(S*.62*((m=e.sublabel)!==null&&m!==void 0?m:"").length+S),fe=v?[{weight:oe,node:alpine_card_1.EMPTY},{weight:ie,node:(0,alpine_card_1.paint)(L((0,template_utils_1.bindProp)((0,alpine_card_1.tag)(leftText(e.sublabel,S,a.muted),"kpi-sublabel"),"sublabel")))}]:[],ve=Math.max(1,Math.round(T.w)-R-(v?oe+ie:0));B=(0,alpine_card_1.colSplit)([{weight:R,node:Me},...fe,{weight:ve,node:alpine_card_1.EMPTY}])}else v&&(B=(0,alpine_card_1.colSplit)([{weight:1,node:(0,alpine_card_1.paint)(L((0,template_utils_1.bindProp)((0,alpine_card_1.tag)(leftText(e.sublabel,S,a.muted),"kpi-sublabel"),"sublabel")))}]));let G=alpine_card_1.EMPTY;if(d){const r=LABEL_W+VALUE_W+DELTA_W+SPARK_W+GAP_W*3,j=Math.max(1,Math.round(SPARK_W/r*T.h)),z=p==="up"?a.positive:p==="down"?a.negative:a.primary;G=sparklineBand({bandW:Math.round(T.w),bandH:j,values:C,color:z,introSec:A,animate:P,light:g})}const X=(0,template_utils_1.bindProps)((0,alpine_card_1.tag)(leftText(e.label,le,a.subtitle),"kpi-label"),[{propKey:"label"},...se?[]:[{propKey:"title"},{propKey:"subtitle"}]]),D=[{weight:LABEL_W,node:(0,alpine_card_1.paint)(P&&!g?fadeIn(X,0,Math.max(.1,A*.25),!0):X)},{weight:GAP_W,node:alpine_card_1.EMPTY},{weight:VALUE_W,node:(0,alpine_card_1.paint)(ce)},{weight:GAP_W,node:alpine_card_1.EMPTY},{weight:DELTA_W,node:B}];d&&(D.push({weight:GAP_W,node:alpine_card_1.EMPTY}),D.push({weight:SPARK_W,node:G}));const ue=(0,alpine_card_1.rowSplit)(D),W=K.compose(ue),Z=(0,alpine_conventions_1.findCardHeader)(W.sources);Z&&(0,alpine_conventions_1.withAddHandles)(Z,[...e.title&&e.title.trim()?[]:[{propKey:"title"}],...e.subtitle&&e.subtitle.trim()?[]:[{propKey:"subtitle"}]]);const he={kind:"mosaic_document",version:1,assets:{},m0:W.m0,sources:(0,alpine_conventions_1.bindCardSurface)(W.sources),backgroundColor:K.backgroundColor,fps:t.target.fps,durationMs:t.target.durationMs};return Promise.resolve((0,template_utils_1.withLayoutContract)(he,t,{templateId:"@m0saic/alpine/kpi-card/v3",relations:[],constraints:[...F>0?[{label:"delta-pill",minWidthFrac:Math.max(.005,F*.7),maxWidthFrac:Math.min(1,F*1.3)}]:[]],debug:e.debugLayout===!0}))},async renderCover(e,t){const n=(0,onboarding_cover_1.brandedCoverHeroBox)(t,"band"),s={...t,target:{...t.target,width:n.width,height:n.height},output:{...t.output,width:n.width,height:n.height}},o=await exports.AlpineKpiCardV3.render({...exports.AlpineKpiCardV3.defaultProps,anim:{...DEFAULT_ANIM,renderMode:"light",reduceMotion:!0}},s);return(0,onboarding_cover_1.buildBrandedCover)({ctx:t,variant:"band",copy:{productName:"KPI Card",title:"A KPI card."},hero:l(i=>(0,onboarding_cover_1.onboardingFrame)((0,onboarding_cover_1.inlineHeroDoc)(o),i.borderStrong),"hero"),heroAssets:o.assets,children:o.children})}},(0,template_utils_1.registerTemplate)(exports.AlpineKpiCardV3);
@@ -0,0 +1 @@
1
+ "use strict";var t=Object.defineProperty;var e=(r,d)=>t(r,"name",{value:d,configurable:!0});Object.defineProperty(exports,"__esModule",{value:!0}),exports.AlpineLeaderboardV2=void 0;var leaderboard_1=require("./leaderboard");Object.defineProperty(exports,"AlpineLeaderboardV2",{enumerable:!0,get:e(function(){return leaderboard_1.AlpineLeaderboardV2},"get")});