@motionscript/core 0.1.0-alpha.9 → 0.1.1-alpha.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1064) hide show
  1. package/CHANGELOG.md +29 -0
  2. package/dist/assets/asset-index.d.ts +1 -8
  3. package/dist/assets/asset-index.d.ts.map +1 -1
  4. package/dist/assets/asset-index.js +1 -8
  5. package/dist/assets/asset-index.js.map +1 -1
  6. package/dist/assets/catalog.d.ts +10 -72
  7. package/dist/assets/catalog.d.ts.map +1 -1
  8. package/dist/assets/catalog.js +3 -29
  9. package/dist/assets/catalog.js.map +1 -1
  10. package/dist/assets/errors.d.ts +8 -20
  11. package/dist/assets/errors.d.ts.map +1 -1
  12. package/dist/assets/errors.js +8 -20
  13. package/dist/assets/errors.js.map +1 -1
  14. package/dist/assets/index.d.ts.map +1 -1
  15. package/dist/assets/index.js.map +1 -1
  16. package/dist/assets/manager.d.ts +9 -51
  17. package/dist/assets/manager.d.ts.map +1 -1
  18. package/dist/assets/manager.js +13 -78
  19. package/dist/assets/manager.js.map +1 -1
  20. package/dist/assets/record.d.ts +2 -18
  21. package/dist/assets/record.d.ts.map +1 -1
  22. package/dist/assets/record.js.map +1 -1
  23. package/dist/assets/scope.d.ts +3 -18
  24. package/dist/assets/scope.d.ts.map +1 -1
  25. package/dist/assets/scope.js +2 -11
  26. package/dist/assets/scope.js.map +1 -1
  27. package/dist/attributes/audio/effects/chain.d.ts +2 -12
  28. package/dist/attributes/audio/effects/chain.d.ts.map +1 -1
  29. package/dist/attributes/audio/effects/chain.js +1 -7
  30. package/dist/attributes/audio/effects/chain.js.map +1 -1
  31. package/dist/attributes/audio/effects/registry.d.ts +3 -18
  32. package/dist/attributes/audio/effects/registry.d.ts.map +1 -1
  33. package/dist/attributes/audio/effects/registry.js +4 -23
  34. package/dist/attributes/audio/effects/registry.js.map +1 -1
  35. package/dist/attributes/audio/ramp.d.ts +5 -38
  36. package/dist/attributes/audio/ramp.d.ts.map +1 -1
  37. package/dist/attributes/audio/ramp.js +3 -28
  38. package/dist/attributes/audio/ramp.js.map +1 -1
  39. package/dist/attributes/audio/request.d.ts +10 -80
  40. package/dist/attributes/audio/request.d.ts.map +1 -1
  41. package/dist/attributes/audio/request.js +1 -4
  42. package/dist/attributes/audio/request.js.map +1 -1
  43. package/dist/attributes/audio/schedule.d.ts +2 -12
  44. package/dist/attributes/audio/schedule.d.ts.map +1 -1
  45. package/dist/attributes/audio/schedule.js +2 -11
  46. package/dist/attributes/audio/schedule.js.map +1 -1
  47. package/dist/attributes/audio/sound.d.ts +2 -26
  48. package/dist/attributes/audio/sound.d.ts.map +1 -1
  49. package/dist/attributes/audio/sound.js +1 -9
  50. package/dist/attributes/audio/sound.js.map +1 -1
  51. package/dist/attributes/audio/transition.d.ts +1 -8
  52. package/dist/attributes/audio/transition.d.ts.map +1 -1
  53. package/dist/attributes/audio/transition.js.map +1 -1
  54. package/dist/attributes/layout/alignment.d.ts +6 -38
  55. package/dist/attributes/layout/alignment.d.ts.map +1 -1
  56. package/dist/attributes/layout/alignment.js.map +1 -1
  57. package/dist/attributes/layout/insets.d.ts +2 -27
  58. package/dist/attributes/layout/insets.d.ts.map +1 -1
  59. package/dist/attributes/layout/insets.js.map +1 -1
  60. package/dist/attributes/layout/matrix2d.d.ts +29 -114
  61. package/dist/attributes/layout/matrix2d.d.ts.map +1 -1
  62. package/dist/attributes/layout/matrix2d.js +26 -110
  63. package/dist/attributes/layout/matrix2d.js.map +1 -1
  64. package/dist/attributes/layout/size.d.ts +3 -25
  65. package/dist/attributes/layout/size.d.ts.map +1 -1
  66. package/dist/attributes/layout/size.js +2 -18
  67. package/dist/attributes/layout/size.js.map +1 -1
  68. package/dist/attributes/layout/space3d.d.ts +16 -79
  69. package/dist/attributes/layout/space3d.d.ts.map +1 -1
  70. package/dist/attributes/layout/space3d.js +17 -81
  71. package/dist/attributes/layout/space3d.js.map +1 -1
  72. package/dist/attributes/layout/transform3d.d.ts +2 -23
  73. package/dist/attributes/layout/transform3d.d.ts.map +1 -1
  74. package/dist/attributes/layout/transform3d.js +1 -7
  75. package/dist/attributes/layout/transform3d.js.map +1 -1
  76. package/dist/attributes/layout/world-transform.d.ts +2 -16
  77. package/dist/attributes/layout/world-transform.d.ts.map +1 -1
  78. package/dist/attributes/layout/world-transform.js.map +1 -1
  79. package/dist/attributes/properties/decorator.d.ts +13 -73
  80. package/dist/attributes/properties/decorator.d.ts.map +1 -1
  81. package/dist/attributes/properties/decorator.js +9 -40
  82. package/dist/attributes/properties/decorator.js.map +1 -1
  83. package/dist/attributes/properties/typed.d.ts +6 -45
  84. package/dist/attributes/properties/typed.d.ts.map +1 -1
  85. package/dist/attributes/properties/typed.js +6 -37
  86. package/dist/attributes/properties/typed.js.map +1 -1
  87. package/dist/attributes/render3d/orbit.d.ts +11 -83
  88. package/dist/attributes/render3d/orbit.d.ts.map +1 -1
  89. package/dist/attributes/render3d/orbit.js +10 -73
  90. package/dist/attributes/render3d/orbit.js.map +1 -1
  91. package/dist/attributes/shape/corners/corner-radius.d.ts +1 -6
  92. package/dist/attributes/shape/corners/corner-radius.d.ts.map +1 -1
  93. package/dist/attributes/shape/corners/corner-radius.js.map +1 -1
  94. package/dist/attributes/shape/corners/corner-style.d.ts +4 -25
  95. package/dist/attributes/shape/corners/corner-style.d.ts.map +1 -1
  96. package/dist/attributes/shape/corners/corner-style.js +2 -12
  97. package/dist/attributes/shape/corners/corner-style.js.map +1 -1
  98. package/dist/attributes/shape/corners/corners.d.ts +2 -21
  99. package/dist/attributes/shape/corners/corners.d.ts.map +1 -1
  100. package/dist/attributes/shape/corners/corners.js +2 -12
  101. package/dist/attributes/shape/corners/corners.js.map +1 -1
  102. package/dist/attributes/shape/effects/backdrop.d.ts +2 -18
  103. package/dist/attributes/shape/effects/backdrop.d.ts.map +1 -1
  104. package/dist/attributes/shape/effects/backdrop.js +3 -26
  105. package/dist/attributes/shape/effects/backdrop.js.map +1 -1
  106. package/dist/attributes/shape/effects/chain.d.ts +36 -328
  107. package/dist/attributes/shape/effects/chain.d.ts.map +1 -1
  108. package/dist/attributes/shape/effects/chain.js +24 -242
  109. package/dist/attributes/shape/effects/chain.js.map +1 -1
  110. package/dist/attributes/shape/effects/effect-data.d.ts +19 -127
  111. package/dist/attributes/shape/effects/effect-data.d.ts.map +1 -1
  112. package/dist/attributes/shape/effects/effect-data.js +6 -33
  113. package/dist/attributes/shape/effects/effect-data.js.map +1 -1
  114. package/dist/attributes/shape/effects/implementations/ascii.d.ts +6 -26
  115. package/dist/attributes/shape/effects/implementations/ascii.d.ts.map +1 -1
  116. package/dist/attributes/shape/effects/implementations/ascii.js +0 -3
  117. package/dist/attributes/shape/effects/implementations/ascii.js.map +1 -1
  118. package/dist/attributes/shape/effects/implementations/bit-crush.d.ts +2 -21
  119. package/dist/attributes/shape/effects/implementations/bit-crush.d.ts.map +1 -1
  120. package/dist/attributes/shape/effects/implementations/bit-crush.js +0 -1
  121. package/dist/attributes/shape/effects/implementations/bit-crush.js.map +1 -1
  122. package/dist/attributes/shape/effects/implementations/block-displace.d.ts +1 -14
  123. package/dist/attributes/shape/effects/implementations/block-displace.d.ts.map +1 -1
  124. package/dist/attributes/shape/effects/implementations/block-displace.js +0 -1
  125. package/dist/attributes/shape/effects/implementations/block-displace.js.map +1 -1
  126. package/dist/attributes/shape/effects/implementations/bloom.d.ts +0 -1
  127. package/dist/attributes/shape/effects/implementations/bloom.d.ts.map +1 -1
  128. package/dist/attributes/shape/effects/implementations/bloom.js +0 -1
  129. package/dist/attributes/shape/effects/implementations/bloom.js.map +1 -1
  130. package/dist/attributes/shape/effects/implementations/blur.d.ts +0 -1
  131. package/dist/attributes/shape/effects/implementations/blur.d.ts.map +1 -1
  132. package/dist/attributes/shape/effects/implementations/blur.js +0 -1
  133. package/dist/attributes/shape/effects/implementations/blur.js.map +1 -1
  134. package/dist/attributes/shape/effects/implementations/bulge.d.ts +0 -1
  135. package/dist/attributes/shape/effects/implementations/bulge.d.ts.map +1 -1
  136. package/dist/attributes/shape/effects/implementations/bulge.js +0 -1
  137. package/dist/attributes/shape/effects/implementations/bulge.js.map +1 -1
  138. package/dist/attributes/shape/effects/implementations/chromatic-aberration.d.ts +0 -1
  139. package/dist/attributes/shape/effects/implementations/chromatic-aberration.d.ts.map +1 -1
  140. package/dist/attributes/shape/effects/implementations/chromatic-aberration.js +0 -1
  141. package/dist/attributes/shape/effects/implementations/chromatic-aberration.js.map +1 -1
  142. package/dist/attributes/shape/effects/implementations/color-adjustment.d.ts +1 -12
  143. package/dist/attributes/shape/effects/implementations/color-adjustment.d.ts.map +1 -1
  144. package/dist/attributes/shape/effects/implementations/color-adjustment.js +0 -1
  145. package/dist/attributes/shape/effects/implementations/color-adjustment.js.map +1 -1
  146. package/dist/attributes/shape/effects/implementations/curves.d.ts +1 -11
  147. package/dist/attributes/shape/effects/implementations/curves.d.ts.map +1 -1
  148. package/dist/attributes/shape/effects/implementations/curves.js +1 -6
  149. package/dist/attributes/shape/effects/implementations/curves.js.map +1 -1
  150. package/dist/attributes/shape/effects/implementations/directional-blur.d.ts +0 -1
  151. package/dist/attributes/shape/effects/implementations/directional-blur.d.ts.map +1 -1
  152. package/dist/attributes/shape/effects/implementations/directional-blur.js +0 -1
  153. package/dist/attributes/shape/effects/implementations/directional-blur.js.map +1 -1
  154. package/dist/attributes/shape/effects/implementations/dither.d.ts +4 -35
  155. package/dist/attributes/shape/effects/implementations/dither.d.ts.map +1 -1
  156. package/dist/attributes/shape/effects/implementations/dither.js +1 -7
  157. package/dist/attributes/shape/effects/implementations/dither.js.map +1 -1
  158. package/dist/attributes/shape/effects/implementations/drop-shadow.d.ts +1 -22
  159. package/dist/attributes/shape/effects/implementations/drop-shadow.d.ts.map +1 -1
  160. package/dist/attributes/shape/effects/implementations/drop-shadow.js +0 -1
  161. package/dist/attributes/shape/effects/implementations/drop-shadow.js.map +1 -1
  162. package/dist/attributes/shape/effects/implementations/duotone.d.ts +1 -9
  163. package/dist/attributes/shape/effects/implementations/duotone.d.ts.map +1 -1
  164. package/dist/attributes/shape/effects/implementations/duotone.js +0 -1
  165. package/dist/attributes/shape/effects/implementations/duotone.js.map +1 -1
  166. package/dist/attributes/shape/effects/implementations/edges.d.ts +2 -15
  167. package/dist/attributes/shape/effects/implementations/edges.d.ts.map +1 -1
  168. package/dist/attributes/shape/effects/implementations/edges.js +0 -1
  169. package/dist/attributes/shape/effects/implementations/edges.js.map +1 -1
  170. package/dist/attributes/shape/effects/implementations/glass.d.ts +1 -14
  171. package/dist/attributes/shape/effects/implementations/glass.d.ts.map +1 -1
  172. package/dist/attributes/shape/effects/implementations/glass.js +0 -1
  173. package/dist/attributes/shape/effects/implementations/glass.js.map +1 -1
  174. package/dist/attributes/shape/effects/implementations/glow.d.ts +7 -47
  175. package/dist/attributes/shape/effects/implementations/glow.d.ts.map +1 -1
  176. package/dist/attributes/shape/effects/implementations/glow.js +1 -9
  177. package/dist/attributes/shape/effects/implementations/glow.js.map +1 -1
  178. package/dist/attributes/shape/effects/implementations/grain.d.ts +1 -14
  179. package/dist/attributes/shape/effects/implementations/grain.d.ts.map +1 -1
  180. package/dist/attributes/shape/effects/implementations/grain.js +0 -1
  181. package/dist/attributes/shape/effects/implementations/grain.js.map +1 -1
  182. package/dist/attributes/shape/effects/implementations/grayscale.d.ts +0 -1
  183. package/dist/attributes/shape/effects/implementations/grayscale.d.ts.map +1 -1
  184. package/dist/attributes/shape/effects/implementations/grayscale.js +0 -1
  185. package/dist/attributes/shape/effects/implementations/grayscale.js.map +1 -1
  186. package/dist/attributes/shape/effects/implementations/halftone.d.ts +5 -29
  187. package/dist/attributes/shape/effects/implementations/halftone.d.ts.map +1 -1
  188. package/dist/attributes/shape/effects/implementations/halftone.js +0 -1
  189. package/dist/attributes/shape/effects/implementations/halftone.js.map +1 -1
  190. package/dist/attributes/shape/effects/implementations/invert.d.ts +3 -12
  191. package/dist/attributes/shape/effects/implementations/invert.d.ts.map +1 -1
  192. package/dist/attributes/shape/effects/implementations/invert.js +0 -1
  193. package/dist/attributes/shape/effects/implementations/invert.js.map +1 -1
  194. package/dist/attributes/shape/effects/implementations/kaleidoscope.d.ts +2 -19
  195. package/dist/attributes/shape/effects/implementations/kaleidoscope.d.ts.map +1 -1
  196. package/dist/attributes/shape/effects/implementations/kaleidoscope.js +1 -5
  197. package/dist/attributes/shape/effects/implementations/kaleidoscope.js.map +1 -1
  198. package/dist/attributes/shape/effects/implementations/lut.d.ts +11 -36
  199. package/dist/attributes/shape/effects/implementations/lut.d.ts.map +1 -1
  200. package/dist/attributes/shape/effects/implementations/lut.js +2 -8
  201. package/dist/attributes/shape/effects/implementations/lut.js.map +1 -1
  202. package/dist/attributes/shape/effects/implementations/magnify.d.ts +0 -1
  203. package/dist/attributes/shape/effects/implementations/magnify.d.ts.map +1 -1
  204. package/dist/attributes/shape/effects/implementations/magnify.js +0 -1
  205. package/dist/attributes/shape/effects/implementations/magnify.js.map +1 -1
  206. package/dist/attributes/shape/effects/implementations/motion-blur.d.ts +3 -17
  207. package/dist/attributes/shape/effects/implementations/motion-blur.d.ts.map +1 -1
  208. package/dist/attributes/shape/effects/implementations/motion-blur.js +2 -11
  209. package/dist/attributes/shape/effects/implementations/motion-blur.js.map +1 -1
  210. package/dist/attributes/shape/effects/implementations/oil-paint.d.ts +1 -12
  211. package/dist/attributes/shape/effects/implementations/oil-paint.d.ts.map +1 -1
  212. package/dist/attributes/shape/effects/implementations/oil-paint.js +0 -1
  213. package/dist/attributes/shape/effects/implementations/oil-paint.js.map +1 -1
  214. package/dist/attributes/shape/effects/implementations/outline.d.ts +2 -14
  215. package/dist/attributes/shape/effects/implementations/outline.d.ts.map +1 -1
  216. package/dist/attributes/shape/effects/implementations/outline.js +0 -1
  217. package/dist/attributes/shape/effects/implementations/outline.js.map +1 -1
  218. package/dist/attributes/shape/effects/implementations/pixelate.d.ts +1 -15
  219. package/dist/attributes/shape/effects/implementations/pixelate.d.ts.map +1 -1
  220. package/dist/attributes/shape/effects/implementations/pixelate.js +0 -1
  221. package/dist/attributes/shape/effects/implementations/pixelate.js.map +1 -1
  222. package/dist/attributes/shape/effects/implementations/posterize.d.ts +1 -10
  223. package/dist/attributes/shape/effects/implementations/posterize.d.ts.map +1 -1
  224. package/dist/attributes/shape/effects/implementations/posterize.js +0 -1
  225. package/dist/attributes/shape/effects/implementations/posterize.js.map +1 -1
  226. package/dist/attributes/shape/effects/implementations/progressive-blur.d.ts +3 -26
  227. package/dist/attributes/shape/effects/implementations/progressive-blur.d.ts.map +1 -1
  228. package/dist/attributes/shape/effects/implementations/progressive-blur.js +1 -2
  229. package/dist/attributes/shape/effects/implementations/progressive-blur.js.map +1 -1
  230. package/dist/attributes/shape/effects/implementations/radial-blur.d.ts +2 -16
  231. package/dist/attributes/shape/effects/implementations/radial-blur.d.ts.map +1 -1
  232. package/dist/attributes/shape/effects/implementations/radial-blur.js +0 -1
  233. package/dist/attributes/shape/effects/implementations/radial-blur.js.map +1 -1
  234. package/dist/attributes/shape/effects/implementations/rgb-shift.d.ts +1 -13
  235. package/dist/attributes/shape/effects/implementations/rgb-shift.d.ts.map +1 -1
  236. package/dist/attributes/shape/effects/implementations/rgb-shift.js +0 -1
  237. package/dist/attributes/shape/effects/implementations/rgb-shift.js.map +1 -1
  238. package/dist/attributes/shape/effects/implementations/scanlines.d.ts +1 -8
  239. package/dist/attributes/shape/effects/implementations/scanlines.d.ts.map +1 -1
  240. package/dist/attributes/shape/effects/implementations/scanlines.js +0 -1
  241. package/dist/attributes/shape/effects/implementations/scanlines.js.map +1 -1
  242. package/dist/attributes/shape/effects/implementations/scatter.d.ts +0 -1
  243. package/dist/attributes/shape/effects/implementations/scatter.d.ts.map +1 -1
  244. package/dist/attributes/shape/effects/implementations/scatter.js +0 -1
  245. package/dist/attributes/shape/effects/implementations/scatter.js.map +1 -1
  246. package/dist/attributes/shape/effects/implementations/shader.d.ts +10 -53
  247. package/dist/attributes/shape/effects/implementations/shader.d.ts.map +1 -1
  248. package/dist/attributes/shape/effects/implementations/shader.js +2 -9
  249. package/dist/attributes/shape/effects/implementations/shader.js.map +1 -1
  250. package/dist/attributes/shape/effects/implementations/sharpen.d.ts +1 -12
  251. package/dist/attributes/shape/effects/implementations/sharpen.d.ts.map +1 -1
  252. package/dist/attributes/shape/effects/implementations/sharpen.js +0 -1
  253. package/dist/attributes/shape/effects/implementations/sharpen.js.map +1 -1
  254. package/dist/attributes/shape/effects/implementations/streak.d.ts +1 -8
  255. package/dist/attributes/shape/effects/implementations/streak.d.ts.map +1 -1
  256. package/dist/attributes/shape/effects/implementations/streak.js +0 -1
  257. package/dist/attributes/shape/effects/implementations/streak.js.map +1 -1
  258. package/dist/attributes/shape/effects/implementations/threshold.d.ts +1 -9
  259. package/dist/attributes/shape/effects/implementations/threshold.d.ts.map +1 -1
  260. package/dist/attributes/shape/effects/implementations/threshold.js +0 -1
  261. package/dist/attributes/shape/effects/implementations/threshold.js.map +1 -1
  262. package/dist/attributes/shape/effects/implementations/twirl.d.ts +1 -13
  263. package/dist/attributes/shape/effects/implementations/twirl.d.ts.map +1 -1
  264. package/dist/attributes/shape/effects/implementations/twirl.js +0 -1
  265. package/dist/attributes/shape/effects/implementations/twirl.js.map +1 -1
  266. package/dist/attributes/shape/effects/implementations/vignette.d.ts +1 -9
  267. package/dist/attributes/shape/effects/implementations/vignette.d.ts.map +1 -1
  268. package/dist/attributes/shape/effects/implementations/vignette.js +0 -1
  269. package/dist/attributes/shape/effects/implementations/vignette.js.map +1 -1
  270. package/dist/attributes/shape/effects/implementations/vintage.d.ts +0 -1
  271. package/dist/attributes/shape/effects/implementations/vintage.d.ts.map +1 -1
  272. package/dist/attributes/shape/effects/implementations/vintage.js +0 -1
  273. package/dist/attributes/shape/effects/implementations/vintage.js.map +1 -1
  274. package/dist/attributes/shape/effects/implementations/wave.d.ts +3 -24
  275. package/dist/attributes/shape/effects/implementations/wave.d.ts.map +1 -1
  276. package/dist/attributes/shape/effects/implementations/wave.js +1 -5
  277. package/dist/attributes/shape/effects/implementations/wave.js.map +1 -1
  278. package/dist/attributes/shape/effects/registry.d.ts +6 -41
  279. package/dist/attributes/shape/effects/registry.d.ts.map +1 -1
  280. package/dist/attributes/shape/effects/registry.js +7 -45
  281. package/dist/attributes/shape/effects/registry.js.map +1 -1
  282. package/dist/attributes/shape/effects/spec.d.ts +6 -30
  283. package/dist/attributes/shape/effects/spec.d.ts.map +1 -1
  284. package/dist/attributes/shape/effects/spec.js +3 -9
  285. package/dist/attributes/shape/effects/spec.js.map +1 -1
  286. package/dist/attributes/shape/fill/blend.d.ts +1 -17
  287. package/dist/attributes/shape/fill/blend.d.ts.map +1 -1
  288. package/dist/attributes/shape/fill/blend.js +2 -15
  289. package/dist/attributes/shape/fill/blend.js.map +1 -1
  290. package/dist/attributes/shape/fill/chain.d.ts +17 -125
  291. package/dist/attributes/shape/fill/chain.d.ts.map +1 -1
  292. package/dist/attributes/shape/fill/chain.js +22 -109
  293. package/dist/attributes/shape/fill/chain.js.map +1 -1
  294. package/dist/attributes/shape/fill/coerce.d.ts +10 -35
  295. package/dist/attributes/shape/fill/coerce.d.ts.map +1 -1
  296. package/dist/attributes/shape/fill/coerce.js +12 -47
  297. package/dist/attributes/shape/fill/coerce.js.map +1 -1
  298. package/dist/attributes/shape/fill/color/parser.d.ts +10 -44
  299. package/dist/attributes/shape/fill/color/parser.d.ts.map +1 -1
  300. package/dist/attributes/shape/fill/color/parser.js +35 -96
  301. package/dist/attributes/shape/fill/color/parser.js.map +1 -1
  302. package/dist/attributes/shape/fill/gradient-stops.d.ts +1 -8
  303. package/dist/attributes/shape/fill/gradient-stops.d.ts.map +1 -1
  304. package/dist/attributes/shape/fill/gradient-stops.js +2 -13
  305. package/dist/attributes/shape/fill/gradient-stops.js.map +1 -1
  306. package/dist/attributes/shape/fill/implementations/canvas3d.d.ts +2 -24
  307. package/dist/attributes/shape/fill/implementations/canvas3d.d.ts.map +1 -1
  308. package/dist/attributes/shape/fill/implementations/canvas3d.js +2 -9
  309. package/dist/attributes/shape/fill/implementations/canvas3d.js.map +1 -1
  310. package/dist/attributes/shape/fill/implementations/dot-grid.d.ts +1 -14
  311. package/dist/attributes/shape/fill/implementations/dot-grid.d.ts.map +1 -1
  312. package/dist/attributes/shape/fill/implementations/dot-grid.js.map +1 -1
  313. package/dist/attributes/shape/fill/implementations/fractal-noise.d.ts +5 -28
  314. package/dist/attributes/shape/fill/implementations/fractal-noise.d.ts.map +1 -1
  315. package/dist/attributes/shape/fill/implementations/fractal-noise.js +0 -1
  316. package/dist/attributes/shape/fill/implementations/fractal-noise.js.map +1 -1
  317. package/dist/attributes/shape/fill/implementations/grid.d.ts +8 -21
  318. package/dist/attributes/shape/fill/implementations/grid.d.ts.map +1 -1
  319. package/dist/attributes/shape/fill/implementations/grid.js +2 -8
  320. package/dist/attributes/shape/fill/implementations/grid.js.map +1 -1
  321. package/dist/attributes/shape/fill/implementations/image.d.ts +13 -79
  322. package/dist/attributes/shape/fill/implementations/image.d.ts.map +1 -1
  323. package/dist/attributes/shape/fill/implementations/image.js +6 -23
  324. package/dist/attributes/shape/fill/implementations/image.js.map +1 -1
  325. package/dist/attributes/shape/fill/implementations/noise.d.ts +2 -15
  326. package/dist/attributes/shape/fill/implementations/noise.d.ts.map +1 -1
  327. package/dist/attributes/shape/fill/implementations/noise.js.map +1 -1
  328. package/dist/attributes/shape/fill/implementations/shader.d.ts +11 -45
  329. package/dist/attributes/shape/fill/implementations/shader.d.ts.map +1 -1
  330. package/dist/attributes/shape/fill/implementations/shader.js +5 -17
  331. package/dist/attributes/shape/fill/implementations/shader.js.map +1 -1
  332. package/dist/attributes/shape/fill/implementations/video.d.ts +12 -64
  333. package/dist/attributes/shape/fill/implementations/video.d.ts.map +1 -1
  334. package/dist/attributes/shape/fill/implementations/video.js +12 -50
  335. package/dist/attributes/shape/fill/implementations/video.js.map +1 -1
  336. package/dist/attributes/shape/fill/lerp.d.ts +2 -13
  337. package/dist/attributes/shape/fill/lerp.d.ts.map +1 -1
  338. package/dist/attributes/shape/fill/lerp.js +2 -9
  339. package/dist/attributes/shape/fill/lerp.js.map +1 -1
  340. package/dist/attributes/shape/fill/media-preset.d.ts +8 -49
  341. package/dist/attributes/shape/fill/media-preset.d.ts.map +1 -1
  342. package/dist/attributes/shape/fill/media-preset.js +8 -35
  343. package/dist/attributes/shape/fill/media-preset.js.map +1 -1
  344. package/dist/attributes/shape/fill/registry.d.ts +2 -26
  345. package/dist/attributes/shape/fill/registry.d.ts.map +1 -1
  346. package/dist/attributes/shape/fill/registry.js +5 -40
  347. package/dist/attributes/shape/fill/registry.js.map +1 -1
  348. package/dist/attributes/shape/fill/union.d.ts +6 -30
  349. package/dist/attributes/shape/fill/union.d.ts.map +1 -1
  350. package/dist/attributes/shape/fill/union.js +1 -9
  351. package/dist/attributes/shape/fill/union.js.map +1 -1
  352. package/dist/attributes/shape/filters/chain.d.ts +15 -168
  353. package/dist/attributes/shape/filters/chain.d.ts.map +1 -1
  354. package/dist/attributes/shape/filters/chain.js +8 -132
  355. package/dist/attributes/shape/filters/chain.js.map +1 -1
  356. package/dist/attributes/shape/filters/implementations/color-matrix.d.ts +1 -7
  357. package/dist/attributes/shape/filters/implementations/color-matrix.d.ts.map +1 -1
  358. package/dist/attributes/shape/filters/implementations/color-matrix.js.map +1 -1
  359. package/dist/attributes/shape/filters/implementations/curves.d.ts +1 -7
  360. package/dist/attributes/shape/filters/implementations/curves.d.ts.map +1 -1
  361. package/dist/attributes/shape/filters/implementations/curves.js.map +1 -1
  362. package/dist/attributes/shape/filters/implementations/echo.d.ts +1 -11
  363. package/dist/attributes/shape/filters/implementations/echo.d.ts.map +1 -1
  364. package/dist/attributes/shape/filters/implementations/echo.js.map +1 -1
  365. package/dist/attributes/shape/filters/index.d.ts +1 -6
  366. package/dist/attributes/shape/filters/index.d.ts.map +1 -1
  367. package/dist/attributes/shape/filters/index.js +0 -2
  368. package/dist/attributes/shape/filters/index.js.map +1 -1
  369. package/dist/attributes/shape/filters/registry.d.ts +5 -35
  370. package/dist/attributes/shape/filters/registry.d.ts.map +1 -1
  371. package/dist/attributes/shape/filters/registry.js +7 -50
  372. package/dist/attributes/shape/filters/registry.js.map +1 -1
  373. package/dist/attributes/shape/filters/union.d.ts +10 -51
  374. package/dist/attributes/shape/filters/union.d.ts.map +1 -1
  375. package/dist/attributes/shape/filters/union.js.map +1 -1
  376. package/dist/attributes/shape/path/anchors.d.ts +18 -106
  377. package/dist/attributes/shape/path/anchors.d.ts.map +1 -1
  378. package/dist/attributes/shape/path/anchors.js +15 -124
  379. package/dist/attributes/shape/path/anchors.js.map +1 -1
  380. package/dist/attributes/shape/path/bezier.d.ts +6 -54
  381. package/dist/attributes/shape/path/bezier.d.ts.map +1 -1
  382. package/dist/attributes/shape/path/bezier.js +10 -98
  383. package/dist/attributes/shape/path/bezier.js.map +1 -1
  384. package/dist/attributes/shape/path/index.d.ts +1 -11
  385. package/dist/attributes/shape/path/index.d.ts.map +1 -1
  386. package/dist/attributes/shape/path/index.js +1 -11
  387. package/dist/attributes/shape/path/index.js.map +1 -1
  388. package/dist/attributes/shape/path/measure.d.ts +5 -41
  389. package/dist/attributes/shape/path/measure.d.ts.map +1 -1
  390. package/dist/attributes/shape/path/measure.js +8 -57
  391. package/dist/attributes/shape/path/measure.js.map +1 -1
  392. package/dist/attributes/shape/path/morph.d.ts +4 -41
  393. package/dist/attributes/shape/path/morph.d.ts.map +1 -1
  394. package/dist/attributes/shape/path/morph.js +17 -117
  395. package/dist/attributes/shape/path/morph.js.map +1 -1
  396. package/dist/attributes/shape/path/ops.d.ts +5 -19
  397. package/dist/attributes/shape/path/ops.d.ts.map +1 -1
  398. package/dist/attributes/shape/path/ops.js.map +1 -1
  399. package/dist/attributes/shape/path/types.d.ts +10 -67
  400. package/dist/attributes/shape/path/types.d.ts.map +1 -1
  401. package/dist/attributes/shape/path/types.js +0 -1
  402. package/dist/attributes/shape/path/types.js.map +1 -1
  403. package/dist/attributes/shape/path/walk.d.ts +9 -63
  404. package/dist/attributes/shape/path/walk.d.ts.map +1 -1
  405. package/dist/attributes/shape/path/walk.js +21 -100
  406. package/dist/attributes/shape/path/walk.js.map +1 -1
  407. package/dist/attributes/shape/shaders/language.d.ts +2 -14
  408. package/dist/attributes/shape/shaders/language.d.ts.map +1 -1
  409. package/dist/attributes/shape/shaders/language.js +1 -8
  410. package/dist/attributes/shape/shaders/language.js.map +1 -1
  411. package/dist/attributes/shape/shaders/pack.d.ts +13 -78
  412. package/dist/attributes/shape/shaders/pack.d.ts.map +1 -1
  413. package/dist/attributes/shape/shaders/pack.js +1 -10
  414. package/dist/attributes/shape/shaders/pack.js.map +1 -1
  415. package/dist/attributes/shape/shaders/resolve.d.ts +1 -11
  416. package/dist/attributes/shape/shaders/resolve.d.ts.map +1 -1
  417. package/dist/attributes/shape/shaders/resolve.js +3 -28
  418. package/dist/attributes/shape/shaders/resolve.js.map +1 -1
  419. package/dist/attributes/shape/shaders/uniforms.d.ts +3 -24
  420. package/dist/attributes/shape/shaders/uniforms.d.ts.map +1 -1
  421. package/dist/attributes/shape/shaders/uniforms.js +0 -0
  422. package/dist/attributes/shape/shaders/uniforms.js.map +1 -1
  423. package/dist/attributes/shape/shadow/shadow.d.ts +3 -20
  424. package/dist/attributes/shape/shadow/shadow.d.ts.map +1 -1
  425. package/dist/attributes/shape/shadow/shadow.js +0 -3
  426. package/dist/attributes/shape/shadow/shadow.js.map +1 -1
  427. package/dist/attributes/shape/stroke/stroke.d.ts +9 -58
  428. package/dist/attributes/shape/stroke/stroke.d.ts.map +1 -1
  429. package/dist/attributes/shape/stroke/stroke.js +0 -6
  430. package/dist/attributes/shape/stroke/stroke.js.map +1 -1
  431. package/dist/attributes/shared/operators.d.ts +1 -8
  432. package/dist/attributes/shared/operators.d.ts.map +1 -1
  433. package/dist/attributes/shared/operators.js.map +1 -1
  434. package/dist/attributes/text/index.d.ts +1 -11
  435. package/dist/attributes/text/index.d.ts.map +1 -1
  436. package/dist/attributes/text/index.js +1 -11
  437. package/dist/attributes/text/index.js.map +1 -1
  438. package/dist/attributes/text/ops.d.ts +4 -30
  439. package/dist/attributes/text/ops.d.ts.map +1 -1
  440. package/dist/attributes/text/ops.js +7 -23
  441. package/dist/attributes/text/ops.js.map +1 -1
  442. package/dist/attributes/text/types.d.ts +5 -28
  443. package/dist/attributes/text/types.d.ts.map +1 -1
  444. package/dist/attributes/text/types.js.map +1 -1
  445. package/dist/browser/chunks/chunk-3ZIUZZC7.js +13 -0
  446. package/dist/browser/chunks/chunk-3ZIUZZC7.js.map +7 -0
  447. package/dist/browser/chunks/chunk-5TDMGUXQ.js +3 -0
  448. package/dist/browser/chunks/chunk-5TDMGUXQ.js.map +7 -0
  449. package/dist/browser/chunks/chunk-7YOYMMXK.js +6 -0
  450. package/dist/browser/chunks/chunk-7YOYMMXK.js.map +7 -0
  451. package/dist/browser/chunks/{chunk-4BDLFEOC.js → chunk-GEJEQQER.js} +1 -1
  452. package/dist/browser/chunks/chunk-GEJEQQER.js.map +7 -0
  453. package/dist/browser/component.js +1 -1
  454. package/dist/browser/experimental.js +1 -1
  455. package/dist/browser/index.js +1 -1
  456. package/dist/browser/index.js.map +4 -4
  457. package/dist/browser/manifest.json +1 -1
  458. package/dist/browser/sdk.js +1 -1
  459. package/dist/component.d.ts +3 -10
  460. package/dist/component.d.ts.map +1 -1
  461. package/dist/component.js +3 -10
  462. package/dist/component.js.map +1 -1
  463. package/dist/components/builtins/geometry/geometry.d.ts +15 -62
  464. package/dist/components/builtins/geometry/geometry.d.ts.map +1 -1
  465. package/dist/components/builtins/geometry/geometry.js.map +1 -1
  466. package/dist/components/builtins/geometry/shape-outline.d.ts +12 -61
  467. package/dist/components/builtins/geometry/shape-outline.d.ts.map +1 -1
  468. package/dist/components/builtins/geometry/shape-outline.js +29 -168
  469. package/dist/components/builtins/geometry/shape-outline.js.map +1 -1
  470. package/dist/components/builtins/layout/layout.d.ts +1 -14
  471. package/dist/components/builtins/layout/layout.d.ts.map +1 -1
  472. package/dist/components/builtins/layout/layout.js.map +1 -1
  473. package/dist/components/builtins/media/media.d.ts +11 -51
  474. package/dist/components/builtins/media/media.d.ts.map +1 -1
  475. package/dist/components/builtins/media/media.js +3 -7
  476. package/dist/components/builtins/media/media.js.map +1 -1
  477. package/dist/components/builtins/text/number-format.d.ts +14 -47
  478. package/dist/components/builtins/text/number-format.d.ts.map +1 -1
  479. package/dist/components/builtins/text/number-format.js +19 -69
  480. package/dist/components/builtins/text/number-format.js.map +1 -1
  481. package/dist/components/builtins/text/number-pattern.d.ts +3 -37
  482. package/dist/components/builtins/text/number-pattern.d.ts.map +1 -1
  483. package/dist/components/builtins/text/number-pattern.js +6 -48
  484. package/dist/components/builtins/text/number-pattern.js.map +1 -1
  485. package/dist/components/builtins/text/text-defaults.d.ts +7 -25
  486. package/dist/components/builtins/text/text-defaults.d.ts.map +1 -1
  487. package/dist/components/builtins/text/text-defaults.js +7 -25
  488. package/dist/components/builtins/text/text-defaults.js.map +1 -1
  489. package/dist/components/builtins/text/text-layout.d.ts +2 -11
  490. package/dist/components/builtins/text/text-layout.d.ts.map +1 -1
  491. package/dist/components/builtins/text/text-layout.js +7 -22
  492. package/dist/components/builtins/text/text-layout.js.map +1 -1
  493. package/dist/components/builtins/text/text.d.ts +8 -46
  494. package/dist/components/builtins/text/text.d.ts.map +1 -1
  495. package/dist/components/builtins/text/text.js.map +1 -1
  496. package/dist/components/builtins/three/canvas3d.d.ts +6 -51
  497. package/dist/components/builtins/three/canvas3d.d.ts.map +1 -1
  498. package/dist/components/builtins/three/canvas3d.js.map +1 -1
  499. package/dist/components/builtins/three/grid-geometry3d.d.ts +3 -39
  500. package/dist/components/builtins/three/grid-geometry3d.d.ts.map +1 -1
  501. package/dist/components/builtins/three/grid-geometry3d.js +8 -46
  502. package/dist/components/builtins/three/grid-geometry3d.js.map +1 -1
  503. package/dist/components/builtins/three/three.d.ts +22 -117
  504. package/dist/components/builtins/three/three.d.ts.map +1 -1
  505. package/dist/components/builtins/three/three.js +5 -17
  506. package/dist/components/builtins/three/three.js.map +1 -1
  507. package/dist/components/factory/api.d.ts.map +1 -1
  508. package/dist/components/factory/api.js.map +1 -1
  509. package/dist/components/factory/views.d.ts.map +1 -1
  510. package/dist/components/factory/views.js +41 -3
  511. package/dist/components/factory/views.js.map +1 -1
  512. package/dist/components/trees/2d/group-bounds.d.ts +12 -41
  513. package/dist/components/trees/2d/group-bounds.d.ts.map +1 -1
  514. package/dist/components/trees/2d/group-bounds.js +3 -22
  515. package/dist/components/trees/2d/group-bounds.js.map +1 -1
  516. package/dist/components/trees/2d/node-lifecycle.d.ts +8 -36
  517. package/dist/components/trees/2d/node-lifecycle.d.ts.map +1 -1
  518. package/dist/components/trees/2d/node-lifecycle.js +35 -127
  519. package/dist/components/trees/2d/node-lifecycle.js.map +1 -1
  520. package/dist/components/trees/2d/node-motion.d.ts +4 -36
  521. package/dist/components/trees/2d/node-motion.d.ts.map +1 -1
  522. package/dist/components/trees/2d/node-motion.js +3 -31
  523. package/dist/components/trees/2d/node-motion.js.map +1 -1
  524. package/dist/components/trees/2d/node-render.d.ts +3 -20
  525. package/dist/components/trees/2d/node-render.d.ts.map +1 -1
  526. package/dist/components/trees/2d/node-render.js +4 -23
  527. package/dist/components/trees/2d/node-render.js.map +1 -1
  528. package/dist/components/trees/2d/node-space.d.ts +4 -23
  529. package/dist/components/trees/2d/node-space.d.ts.map +1 -1
  530. package/dist/components/trees/2d/node-space.js +3 -17
  531. package/dist/components/trees/2d/node-space.js.map +1 -1
  532. package/dist/components/trees/2d/node-transform.d.ts +4 -33
  533. package/dist/components/trees/2d/node-transform.d.ts.map +1 -1
  534. package/dist/components/trees/2d/node-transform.js +4 -33
  535. package/dist/components/trees/2d/node-transform.js.map +1 -1
  536. package/dist/components/trees/2d/node2d.d.ts +112 -622
  537. package/dist/components/trees/2d/node2d.d.ts.map +1 -1
  538. package/dist/components/trees/2d/node2d.js +131 -605
  539. package/dist/components/trees/2d/node2d.js.map +1 -1
  540. package/dist/components/trees/audio/node-audio.d.ts +17 -65
  541. package/dist/components/trees/audio/node-audio.d.ts.map +1 -1
  542. package/dist/components/trees/audio/node-audio.js +18 -68
  543. package/dist/components/trees/audio/node-audio.js.map +1 -1
  544. package/dist/components/trees/node/node-editor-state.d.ts +5 -45
  545. package/dist/components/trees/node/node-editor-state.d.ts.map +1 -1
  546. package/dist/components/trees/node/node-editor-state.js +1 -13
  547. package/dist/components/trees/node/node-editor-state.js.map +1 -1
  548. package/dist/components/trees/node/node-reactive.d.ts +6 -54
  549. package/dist/components/trees/node/node-reactive.d.ts.map +1 -1
  550. package/dist/components/trees/node/node-reactive.js +13 -39
  551. package/dist/components/trees/node/node-reactive.js.map +1 -1
  552. package/dist/components/trees/node/node-time.d.ts +2 -15
  553. package/dist/components/trees/node/node-time.d.ts.map +1 -1
  554. package/dist/components/trees/node/node-time.js.map +1 -1
  555. package/dist/components/trees/node/node-walk.d.ts +7 -32
  556. package/dist/components/trees/node/node-walk.d.ts.map +1 -1
  557. package/dist/components/trees/node/node-walk.js +7 -32
  558. package/dist/components/trees/node/node-walk.js.map +1 -1
  559. package/dist/components/trees/node/node.d.ts +43 -248
  560. package/dist/components/trees/node/node.d.ts.map +1 -1
  561. package/dist/components/trees/node/node.js +51 -229
  562. package/dist/components/trees/node/node.js.map +1 -1
  563. package/dist/components/trees/root/canvas2d-node.d.ts +7 -60
  564. package/dist/components/trees/root/canvas2d-node.d.ts.map +1 -1
  565. package/dist/components/trees/root/canvas2d-node.js +7 -47
  566. package/dist/components/trees/root/canvas2d-node.js.map +1 -1
  567. package/dist/components/trees/three/node3d.d.ts +24 -112
  568. package/dist/components/trees/three/node3d.d.ts.map +1 -1
  569. package/dist/components/trees/three/node3d.js +22 -104
  570. package/dist/components/trees/three/node3d.js.map +1 -1
  571. package/dist/document/audio.d.ts +9 -21
  572. package/dist/document/audio.d.ts.map +1 -1
  573. package/dist/document/audio.js +13 -28
  574. package/dist/document/audio.js.map +1 -1
  575. package/dist/document/builtins.d.ts +3 -9
  576. package/dist/document/builtins.d.ts.map +1 -1
  577. package/dist/document/builtins.js +43 -89
  578. package/dist/document/builtins.js.map +1 -1
  579. package/dist/document/command-traits.d.ts +15 -30
  580. package/dist/document/command-traits.d.ts.map +1 -1
  581. package/dist/document/command-traits.js +31 -31
  582. package/dist/document/command-traits.js.map +1 -1
  583. package/dist/document/deny-globals.d.ts +9 -43
  584. package/dist/document/deny-globals.d.ts.map +1 -1
  585. package/dist/document/deny-globals.js +18 -58
  586. package/dist/document/deny-globals.js.map +1 -1
  587. package/dist/document/diff.d.ts +6 -16
  588. package/dist/document/diff.d.ts.map +1 -1
  589. package/dist/document/diff.js +5 -11
  590. package/dist/document/diff.js.map +1 -1
  591. package/dist/document/doc-index.d.ts +5 -13
  592. package/dist/document/doc-index.d.ts.map +1 -1
  593. package/dist/document/doc-index.js +0 -2
  594. package/dist/document/doc-index.js.map +1 -1
  595. package/dist/document/expression/compile.d.ts +2 -2
  596. package/dist/document/expression/compile.d.ts.map +1 -1
  597. package/dist/document/expression/compile.js +8 -18
  598. package/dist/document/expression/compile.js.map +1 -1
  599. package/dist/document/expression/index.d.ts +11 -41
  600. package/dist/document/expression/index.d.ts.map +1 -1
  601. package/dist/document/expression/index.js +11 -41
  602. package/dist/document/expression/index.js.map +1 -1
  603. package/dist/document/expression/ops.d.ts +3 -12
  604. package/dist/document/expression/ops.d.ts.map +1 -1
  605. package/dist/document/expression/ops.js +4 -20
  606. package/dist/document/expression/ops.js.map +1 -1
  607. package/dist/document/expression/parse.d.ts +4 -14
  608. package/dist/document/expression/parse.d.ts.map +1 -1
  609. package/dist/document/expression/parse.js +34 -55
  610. package/dist/document/expression/parse.js.map +1 -1
  611. package/dist/document/expression/refs.d.ts +2 -8
  612. package/dist/document/expression/refs.d.ts.map +1 -1
  613. package/dist/document/expression/refs.js +2 -6
  614. package/dist/document/expression/refs.js.map +1 -1
  615. package/dist/document/expression/types.d.ts +18 -63
  616. package/dist/document/expression/types.d.ts.map +1 -1
  617. package/dist/document/expression/types.js +4 -15
  618. package/dist/document/expression/types.js.map +1 -1
  619. package/dist/document/expression/walk.d.ts +6 -20
  620. package/dist/document/expression/walk.d.ts.map +1 -1
  621. package/dist/document/expression/walk.js +18 -44
  622. package/dist/document/expression/walk.js.map +1 -1
  623. package/dist/document/index.js +2 -3
  624. package/dist/document/index.js.map +1 -1
  625. package/dist/document/migrate.d.ts +7 -22
  626. package/dist/document/migrate.d.ts.map +1 -1
  627. package/dist/document/migrate.js +44 -15
  628. package/dist/document/migrate.js.map +1 -1
  629. package/dist/document/missing-node.d.ts +4 -11
  630. package/dist/document/missing-node.d.ts.map +1 -1
  631. package/dist/document/missing-node.js +2 -5
  632. package/dist/document/missing-node.js.map +1 -1
  633. package/dist/document/node-decorator.d.ts +12 -53
  634. package/dist/document/node-decorator.d.ts.map +1 -1
  635. package/dist/document/node-decorator.js +16 -57
  636. package/dist/document/node-decorator.js.map +1 -1
  637. package/dist/document/node-descriptor.d.ts +25 -62
  638. package/dist/document/node-descriptor.d.ts.map +1 -1
  639. package/dist/document/node-descriptor.js.map +1 -1
  640. package/dist/document/placement.d.ts +18 -41
  641. package/dist/document/placement.d.ts.map +1 -1
  642. package/dist/document/placement.js +4 -11
  643. package/dist/document/placement.js.map +1 -1
  644. package/dist/document/project.d.ts +19 -52
  645. package/dist/document/project.d.ts.map +1 -1
  646. package/dist/document/project.js +2 -6
  647. package/dist/document/project.js.map +1 -1
  648. package/dist/document/prop-evolution.d.ts +10 -20
  649. package/dist/document/prop-evolution.d.ts.map +1 -1
  650. package/dist/document/prop-evolution.js +3 -7
  651. package/dist/document/prop-evolution.js.map +1 -1
  652. package/dist/document/registry.d.ts +80 -318
  653. package/dist/document/registry.d.ts.map +1 -1
  654. package/dist/document/registry.js +43 -147
  655. package/dist/document/registry.js.map +1 -1
  656. package/dist/document/settled-index.d.ts +12 -18
  657. package/dist/document/settled-index.d.ts.map +1 -1
  658. package/dist/document/settled-index.js +29 -31
  659. package/dist/document/settled-index.js.map +1 -1
  660. package/dist/document/timeline-patch.d.ts +6 -15
  661. package/dist/document/timeline-patch.d.ts.map +1 -1
  662. package/dist/document/timeline-patch.js +12 -21
  663. package/dist/document/timeline-patch.js.map +1 -1
  664. package/dist/document/timeline.d.ts +56 -263
  665. package/dist/document/timeline.d.ts.map +1 -1
  666. package/dist/document/timeline.js +97 -281
  667. package/dist/document/timeline.js.map +1 -1
  668. package/dist/document/types.d.ts +90 -264
  669. package/dist/document/types.d.ts.map +1 -1
  670. package/dist/document/types.js +13 -30
  671. package/dist/document/types.js.map +1 -1
  672. package/dist/document/validate.d.ts +10 -40
  673. package/dist/document/validate.d.ts.map +1 -1
  674. package/dist/document/validate.js +72 -137
  675. package/dist/document/validate.js.map +1 -1
  676. package/dist/document/vocabulary.d.ts +4 -7
  677. package/dist/document/vocabulary.d.ts.map +1 -1
  678. package/dist/document/vocabulary.js +0 -1
  679. package/dist/document/vocabulary.js.map +1 -1
  680. package/dist/index.d.ts +0 -1
  681. package/dist/index.d.ts.map +1 -1
  682. package/dist/index.js +0 -1
  683. package/dist/index.js.map +1 -1
  684. package/dist/layout/bounds.d.ts +1 -11
  685. package/dist/layout/bounds.d.ts.map +1 -1
  686. package/dist/layout/bounds.js.map +1 -1
  687. package/dist/layout/flex.d.ts +6 -20
  688. package/dist/layout/flex.d.ts.map +1 -1
  689. package/dist/layout/flex.js +7 -28
  690. package/dist/layout/flex.js.map +1 -1
  691. package/dist/layout/ops.d.ts +2 -11
  692. package/dist/layout/ops.d.ts.map +1 -1
  693. package/dist/layout/ops.js +2 -22
  694. package/dist/layout/ops.js.map +1 -1
  695. package/dist/layout/types.d.ts +11 -55
  696. package/dist/layout/types.d.ts.map +1 -1
  697. package/dist/layout/types.js.map +1 -1
  698. package/dist/platform/audio-sink.d.ts +7 -43
  699. package/dist/platform/audio-sink.d.ts.map +1 -1
  700. package/dist/platform/audio-sink.js +4 -29
  701. package/dist/platform/audio-sink.js.map +1 -1
  702. package/dist/platform/exporter.d.ts +5 -31
  703. package/dist/platform/exporter.d.ts.map +1 -1
  704. package/dist/platform/exporter.js.map +1 -1
  705. package/dist/platform/stepped-clock.d.ts +1 -16
  706. package/dist/platform/stepped-clock.d.ts.map +1 -1
  707. package/dist/platform/stepped-clock.js +1 -16
  708. package/dist/platform/stepped-clock.js.map +1 -1
  709. package/dist/platform/storage-adapter.d.ts +8 -68
  710. package/dist/platform/storage-adapter.d.ts.map +1 -1
  711. package/dist/platform/storage-adapter.js +8 -60
  712. package/dist/platform/storage-adapter.js.map +1 -1
  713. package/dist/platform/ticker.d.ts +11 -45
  714. package/dist/platform/ticker.d.ts.map +1 -1
  715. package/dist/platform/ticker.js +10 -37
  716. package/dist/platform/ticker.js.map +1 -1
  717. package/dist/project/config.d.ts +4 -14
  718. package/dist/project/config.d.ts.map +1 -1
  719. package/dist/project/config.js.map +1 -1
  720. package/dist/project/tree.d.ts +6 -35
  721. package/dist/project/tree.d.ts.map +1 -1
  722. package/dist/project/tree.js +1 -8
  723. package/dist/project/tree.js.map +1 -1
  724. package/dist/props/host.d.ts +7 -13
  725. package/dist/props/host.d.ts.map +1 -1
  726. package/dist/props/host.js +3 -1
  727. package/dist/props/host.js.map +1 -1
  728. package/dist/props/layout.d.ts +18 -0
  729. package/dist/props/layout.d.ts.map +1 -0
  730. package/dist/props/layout.js +73 -0
  731. package/dist/props/layout.js.map +1 -0
  732. package/dist/props/observer.d.ts +1 -7
  733. package/dist/props/observer.d.ts.map +1 -1
  734. package/dist/props/observer.js.map +1 -1
  735. package/dist/props/slot.d.ts +6 -19
  736. package/dist/props/slot.d.ts.map +1 -1
  737. package/dist/props/slot.js +5 -14
  738. package/dist/props/slot.js.map +1 -1
  739. package/dist/render/canvas-render-context2d.d.ts +8 -68
  740. package/dist/render/canvas-render-context2d.d.ts.map +1 -1
  741. package/dist/render/canvas-render-context2d.js +8 -69
  742. package/dist/render/canvas-render-context2d.js.map +1 -1
  743. package/dist/render/clip-contains.d.ts +2 -16
  744. package/dist/render/clip-contains.d.ts.map +1 -1
  745. package/dist/render/clip-contains.js +21 -82
  746. package/dist/render/clip-contains.js.map +1 -1
  747. package/dist/render/clip.d.ts +7 -25
  748. package/dist/render/clip.d.ts.map +1 -1
  749. package/dist/render/clip.js +5 -17
  750. package/dist/render/clip.js.map +1 -1
  751. package/dist/render/descriptors/ellipse.d.ts.map +1 -1
  752. package/dist/render/descriptors/ellipse.js +0 -1
  753. package/dist/render/descriptors/ellipse.js.map +1 -1
  754. package/dist/render/descriptors/line.d.ts.map +1 -1
  755. package/dist/render/descriptors/line.js +0 -1
  756. package/dist/render/descriptors/line.js.map +1 -1
  757. package/dist/render/descriptors/path-builder.d.ts +4 -32
  758. package/dist/render/descriptors/path-builder.d.ts.map +1 -1
  759. package/dist/render/descriptors/path-builder.js +3 -25
  760. package/dist/render/descriptors/path-builder.js.map +1 -1
  761. package/dist/render/descriptors/path.d.ts +1 -11
  762. package/dist/render/descriptors/path.d.ts.map +1 -1
  763. package/dist/render/descriptors/path.js +0 -1
  764. package/dist/render/descriptors/path.js.map +1 -1
  765. package/dist/render/descriptors/polygon.d.ts.map +1 -1
  766. package/dist/render/descriptors/polygon.js +0 -1
  767. package/dist/render/descriptors/polygon.js.map +1 -1
  768. package/dist/render/descriptors/polygram.d.ts.map +1 -1
  769. package/dist/render/descriptors/polygram.js +0 -1
  770. package/dist/render/descriptors/polygram.js.map +1 -1
  771. package/dist/render/descriptors/rect.d.ts.map +1 -1
  772. package/dist/render/descriptors/rect.js +0 -1
  773. package/dist/render/descriptors/rect.js.map +1 -1
  774. package/dist/render/descriptors/richtext.d.ts.map +1 -1
  775. package/dist/render/descriptors/richtext.js +0 -1
  776. package/dist/render/descriptors/richtext.js.map +1 -1
  777. package/dist/render/descriptors/shape.d.ts +17 -77
  778. package/dist/render/descriptors/shape.d.ts.map +1 -1
  779. package/dist/render/descriptors/shape.js +13 -47
  780. package/dist/render/descriptors/shape.js.map +1 -1
  781. package/dist/render/descriptors/text.d.ts +15 -94
  782. package/dist/render/descriptors/text.d.ts.map +1 -1
  783. package/dist/render/descriptors/text.js +8 -50
  784. package/dist/render/descriptors/text.js.map +1 -1
  785. package/dist/render/descriptors/transform.d.ts +5 -16
  786. package/dist/render/descriptors/transform.d.ts.map +1 -1
  787. package/dist/render/descriptors/transform.js +1 -17
  788. package/dist/render/descriptors/transform.js.map +1 -1
  789. package/dist/render/graphics2d.d.ts +24 -116
  790. package/dist/render/graphics2d.d.ts.map +1 -1
  791. package/dist/render/graphics2d.js +23 -108
  792. package/dist/render/graphics2d.js.map +1 -1
  793. package/dist/render/measure-context.d.ts +5 -29
  794. package/dist/render/measure-context.d.ts.map +1 -1
  795. package/dist/render/measure-context.js.map +1 -1
  796. package/dist/render/null-render-context.d.ts +2 -20
  797. package/dist/render/null-render-context.d.ts.map +1 -1
  798. package/dist/render/null-render-context.js +2 -20
  799. package/dist/render/null-render-context.js.map +1 -1
  800. package/dist/render/render-context2d.d.ts +52 -208
  801. package/dist/render/render-context2d.d.ts.map +1 -1
  802. package/dist/render/render-context2d.js.map +1 -1
  803. package/dist/render/surface.d.ts +2 -19
  804. package/dist/render/surface.d.ts.map +1 -1
  805. package/dist/render/surface.js.map +1 -1
  806. package/dist/render/text-defaults.d.ts +1 -17
  807. package/dist/render/text-defaults.d.ts.map +1 -1
  808. package/dist/render/text-defaults.js +6 -40
  809. package/dist/render/text-defaults.js.map +1 -1
  810. package/dist/render/text-layout.d.ts +12 -55
  811. package/dist/render/text-layout.d.ts.map +1 -1
  812. package/dist/render/text-layout.js +2 -16
  813. package/dist/render/text-layout.js.map +1 -1
  814. package/dist/render3d/bounds3d.d.ts +10 -32
  815. package/dist/render3d/bounds3d.d.ts.map +1 -1
  816. package/dist/render3d/bounds3d.js +2 -12
  817. package/dist/render3d/bounds3d.js.map +1 -1
  818. package/dist/render3d/builders.d.ts +8 -35
  819. package/dist/render3d/builders.d.ts.map +1 -1
  820. package/dist/render3d/builders.js +8 -35
  821. package/dist/render3d/builders.js.map +1 -1
  822. package/dist/render3d/camera.d.ts +10 -57
  823. package/dist/render3d/camera.d.ts.map +1 -1
  824. package/dist/render3d/camera.js +4 -26
  825. package/dist/render3d/camera.js.map +1 -1
  826. package/dist/render3d/fill3d.d.ts +7 -45
  827. package/dist/render3d/fill3d.d.ts.map +1 -1
  828. package/dist/render3d/fill3d.js +15 -85
  829. package/dist/render3d/fill3d.js.map +1 -1
  830. package/dist/render3d/geometry.d.ts +18 -106
  831. package/dist/render3d/geometry.d.ts.map +1 -1
  832. package/dist/render3d/geometry.js +2 -20
  833. package/dist/render3d/geometry.js.map +1 -1
  834. package/dist/render3d/graphics3d.d.ts +29 -133
  835. package/dist/render3d/graphics3d.d.ts.map +1 -1
  836. package/dist/render3d/graphics3d.js +23 -110
  837. package/dist/render3d/graphics3d.js.map +1 -1
  838. package/dist/render3d/index.d.ts +1 -16
  839. package/dist/render3d/index.d.ts.map +1 -1
  840. package/dist/render3d/index.js +1 -16
  841. package/dist/render3d/index.js.map +1 -1
  842. package/dist/render3d/inert.d.ts.map +1 -1
  843. package/dist/render3d/inert.js +1 -14
  844. package/dist/render3d/inert.js.map +1 -1
  845. package/dist/render3d/light.d.ts +3 -26
  846. package/dist/render3d/light.d.ts.map +1 -1
  847. package/dist/render3d/light.js.map +1 -1
  848. package/dist/render3d/material.d.ts +13 -87
  849. package/dist/render3d/material.d.ts.map +1 -1
  850. package/dist/render3d/material.js +2 -16
  851. package/dist/render3d/material.js.map +1 -1
  852. package/dist/render3d/matrix4.d.ts +14 -68
  853. package/dist/render3d/matrix4.d.ts.map +1 -1
  854. package/dist/render3d/matrix4.js +11 -60
  855. package/dist/render3d/matrix4.js.map +1 -1
  856. package/dist/render3d/render-context3d.d.ts +13 -51
  857. package/dist/render3d/render-context3d.d.ts.map +1 -1
  858. package/dist/render3d/render-context3d.js +9 -21
  859. package/dist/render3d/render-context3d.js.map +1 -1
  860. package/dist/render3d/resources.d.ts +9 -53
  861. package/dist/render3d/resources.d.ts.map +1 -1
  862. package/dist/render3d/resources.js +8 -48
  863. package/dist/render3d/resources.js.map +1 -1
  864. package/dist/render3d/rounded-box.d.ts +7 -21
  865. package/dist/render3d/rounded-box.d.ts.map +1 -1
  866. package/dist/render3d/rounded-box.js +7 -46
  867. package/dist/render3d/rounded-box.js.map +1 -1
  868. package/dist/render3d/scene-settings.d.ts +20 -78
  869. package/dist/render3d/scene-settings.d.ts.map +1 -1
  870. package/dist/render3d/scene-settings.js.map +1 -1
  871. package/dist/render3d/scene3d.d.ts +11 -53
  872. package/dist/render3d/scene3d.d.ts.map +1 -1
  873. package/dist/render3d/scene3d.js +12 -59
  874. package/dist/render3d/scene3d.js.map +1 -1
  875. package/dist/render3d/segments.d.ts +2 -25
  876. package/dist/render3d/segments.d.ts.map +1 -1
  877. package/dist/render3d/segments.js +1 -11
  878. package/dist/render3d/segments.js.map +1 -1
  879. package/dist/render3d/texture.d.ts +25 -112
  880. package/dist/render3d/texture.d.ts.map +1 -1
  881. package/dist/render3d/texture.js +3 -27
  882. package/dist/render3d/texture.js.map +1 -1
  883. package/dist/render3d/tracking.d.ts +2 -19
  884. package/dist/render3d/tracking.d.ts.map +1 -1
  885. package/dist/render3d/tracking.js +2 -19
  886. package/dist/render3d/tracking.js.map +1 -1
  887. package/dist/render3d/transform.d.ts +14 -60
  888. package/dist/render3d/transform.d.ts.map +1 -1
  889. package/dist/render3d/transform.js +0 -2
  890. package/dist/render3d/transform.js.map +1 -1
  891. package/dist/render3d/vector3.d.ts +6 -48
  892. package/dist/render3d/vector3.d.ts.map +1 -1
  893. package/dist/render3d/vector3.js +4 -38
  894. package/dist/render3d/vector3.js.map +1 -1
  895. package/dist/render3d/walk.d.ts +3 -27
  896. package/dist/render3d/walk.d.ts.map +1 -1
  897. package/dist/render3d/walk.js +5 -33
  898. package/dist/render3d/walk.js.map +1 -1
  899. package/dist/runtime/asset-refine.d.ts +34 -20
  900. package/dist/runtime/asset-refine.d.ts.map +1 -1
  901. package/dist/runtime/asset-refine.js +127 -31
  902. package/dist/runtime/asset-refine.js.map +1 -1
  903. package/dist/runtime/asset-timeline.d.ts +14 -53
  904. package/dist/runtime/asset-timeline.d.ts.map +1 -1
  905. package/dist/runtime/asset-timeline.js +6 -27
  906. package/dist/runtime/asset-timeline.js.map +1 -1
  907. package/dist/runtime/asset-update.d.ts +7 -26
  908. package/dist/runtime/asset-update.d.ts.map +1 -1
  909. package/dist/runtime/asset-update.js +6 -18
  910. package/dist/runtime/asset-update.js.map +1 -1
  911. package/dist/runtime/audio-index.d.ts +0 -2
  912. package/dist/runtime/audio-index.d.ts.map +1 -1
  913. package/dist/runtime/audio-index.js +0 -2
  914. package/dist/runtime/audio-index.js.map +1 -1
  915. package/dist/runtime/builtin-context.d.ts +3 -9
  916. package/dist/runtime/builtin-context.d.ts.map +1 -1
  917. package/dist/runtime/builtin-context.js +3 -9
  918. package/dist/runtime/builtin-context.js.map +1 -1
  919. package/dist/runtime/clip-instance.d.ts +12 -39
  920. package/dist/runtime/clip-instance.d.ts.map +1 -1
  921. package/dist/runtime/clip-instance.js +21 -45
  922. package/dist/runtime/clip-instance.js.map +1 -1
  923. package/dist/runtime/clip-store.d.ts +26 -68
  924. package/dist/runtime/clip-store.d.ts.map +1 -1
  925. package/dist/runtime/clip-store.js +47 -81
  926. package/dist/runtime/clip-store.js.map +1 -1
  927. package/dist/runtime/engine.d.ts +31 -85
  928. package/dist/runtime/engine.d.ts.map +1 -1
  929. package/dist/runtime/engine.js +16 -49
  930. package/dist/runtime/engine.js.map +1 -1
  931. package/dist/runtime/frame-time.d.ts +4 -15
  932. package/dist/runtime/frame-time.d.ts.map +1 -1
  933. package/dist/runtime/frame-time.js +5 -12
  934. package/dist/runtime/frame-time.js.map +1 -1
  935. package/dist/runtime/index.d.ts +0 -1
  936. package/dist/runtime/index.d.ts.map +1 -1
  937. package/dist/runtime/index.js +0 -1
  938. package/dist/runtime/index.js.map +1 -1
  939. package/dist/runtime/node-picking.d.ts +59 -139
  940. package/dist/runtime/node-picking.d.ts.map +1 -1
  941. package/dist/runtime/node-picking.js +87 -157
  942. package/dist/runtime/node-picking.js.map +1 -1
  943. package/dist/runtime/node-picking3d.d.ts +39 -96
  944. package/dist/runtime/node-picking3d.d.ts.map +1 -1
  945. package/dist/runtime/node-picking3d.js +98 -141
  946. package/dist/runtime/node-picking3d.js.map +1 -1
  947. package/dist/runtime/placement.d.ts +8 -17
  948. package/dist/runtime/placement.d.ts.map +1 -1
  949. package/dist/runtime/placement.js +7 -16
  950. package/dist/runtime/placement.js.map +1 -1
  951. package/dist/runtime/playback-controller.d.ts +78 -207
  952. package/dist/runtime/playback-controller.d.ts.map +1 -1
  953. package/dist/runtime/playback-controller.js +111 -226
  954. package/dist/runtime/playback-controller.js.map +1 -1
  955. package/dist/runtime/playback.d.ts +6 -14
  956. package/dist/runtime/playback.d.ts.map +1 -1
  957. package/dist/runtime/playback.js +6 -14
  958. package/dist/runtime/playback.js.map +1 -1
  959. package/dist/runtime/project-assets.d.ts +6 -14
  960. package/dist/runtime/project-assets.d.ts.map +1 -1
  961. package/dist/runtime/project-assets.js +7 -16
  962. package/dist/runtime/project-assets.js.map +1 -1
  963. package/dist/runtime/session.d.ts +22 -45
  964. package/dist/runtime/session.d.ts.map +1 -1
  965. package/dist/runtime/session.js +26 -46
  966. package/dist/runtime/session.js.map +1 -1
  967. package/dist/runtime/settle.d.ts +4 -10
  968. package/dist/runtime/settle.d.ts.map +1 -1
  969. package/dist/runtime/settle.js +4 -10
  970. package/dist/runtime/settle.js.map +1 -1
  971. package/dist/runtime/state-evaluator.d.ts +15 -37
  972. package/dist/runtime/state-evaluator.d.ts.map +1 -1
  973. package/dist/runtime/state-evaluator.js +27 -44
  974. package/dist/runtime/state-evaluator.js.map +1 -1
  975. package/dist/runtime/text-geometry.d.ts +18 -47
  976. package/dist/runtime/text-geometry.d.ts.map +1 -1
  977. package/dist/runtime/text-geometry.js +13 -27
  978. package/dist/runtime/text-geometry.js.map +1 -1
  979. package/dist/sdk/index.d.ts +1 -7
  980. package/dist/sdk/index.d.ts.map +1 -1
  981. package/dist/sdk/index.js +30 -138
  982. package/dist/sdk/index.js.map +1 -1
  983. package/dist/tween/command-decorator.d.ts +6 -26
  984. package/dist/tween/command-decorator.d.ts.map +1 -1
  985. package/dist/tween/command-decorator.js +1 -6
  986. package/dist/tween/command-decorator.js.map +1 -1
  987. package/dist/tween/command.d.ts +6 -53
  988. package/dist/tween/command.d.ts.map +1 -1
  989. package/dist/tween/command.js +5 -40
  990. package/dist/tween/command.js.map +1 -1
  991. package/dist/tween/ease/curve.d.ts +2 -17
  992. package/dist/tween/ease/curve.d.ts.map +1 -1
  993. package/dist/tween/ease/curve.js +1 -6
  994. package/dist/tween/ease/curve.js.map +1 -1
  995. package/dist/tween/ease/describe.d.ts +0 -11
  996. package/dist/tween/ease/describe.d.ts.map +1 -1
  997. package/dist/tween/ease/describe.js +0 -23
  998. package/dist/tween/ease/describe.js.map +1 -1
  999. package/dist/tween/ease/spec.d.ts +2 -18
  1000. package/dist/tween/ease/spec.d.ts.map +1 -1
  1001. package/dist/tween/ease/spec.js.map +1 -1
  1002. package/dist/tween/inert.d.ts +1 -14
  1003. package/dist/tween/inert.d.ts.map +1 -1
  1004. package/dist/tween/inert.js +1 -14
  1005. package/dist/tween/inert.js.map +1 -1
  1006. package/dist/tween/lerp.d.ts +2 -26
  1007. package/dist/tween/lerp.d.ts.map +1 -1
  1008. package/dist/tween/lerp.js +2 -26
  1009. package/dist/tween/lerp.js.map +1 -1
  1010. package/dist/tween/loop.d.ts +9 -50
  1011. package/dist/tween/loop.d.ts.map +1 -1
  1012. package/dist/tween/loop.js +6 -31
  1013. package/dist/tween/loop.js.map +1 -1
  1014. package/dist/tween/prepare.d.ts +2 -30
  1015. package/dist/tween/prepare.d.ts.map +1 -1
  1016. package/dist/tween/prepare.js +2 -30
  1017. package/dist/tween/prepare.js.map +1 -1
  1018. package/dist/tween/stepper.d.ts +4 -25
  1019. package/dist/tween/stepper.d.ts.map +1 -1
  1020. package/dist/tween/stepper.js.map +1 -1
  1021. package/dist/tween/to-command.d.ts +1 -8
  1022. package/dist/tween/to-command.d.ts.map +1 -1
  1023. package/dist/tween/to-command.js +2 -25
  1024. package/dist/tween/to-command.js.map +1 -1
  1025. package/dist/util/context.d.ts +4 -29
  1026. package/dist/util/context.d.ts.map +1 -1
  1027. package/dist/util/context.js +3 -15
  1028. package/dist/util/context.js.map +1 -1
  1029. package/dist/util/csv.d.ts +4 -29
  1030. package/dist/util/csv.d.ts.map +1 -1
  1031. package/dist/util/csv.js +3 -22
  1032. package/dist/util/csv.js.map +1 -1
  1033. package/dist/util/metrics.d.ts +2 -26
  1034. package/dist/util/metrics.d.ts.map +1 -1
  1035. package/dist/util/metrics.js +2 -26
  1036. package/dist/util/metrics.js.map +1 -1
  1037. package/dist/util/random.d.ts +20 -87
  1038. package/dist/util/random.d.ts.map +1 -1
  1039. package/dist/util/random.js +20 -87
  1040. package/dist/util/random.js.map +1 -1
  1041. package/dist/util/reference.d.ts +6 -35
  1042. package/dist/util/reference.d.ts.map +1 -1
  1043. package/dist/util/reference.js +1 -4
  1044. package/dist/util/reference.js.map +1 -1
  1045. package/dist/util/scheduler.d.ts +6 -27
  1046. package/dist/util/scheduler.d.ts.map +1 -1
  1047. package/dist/util/scheduler.js +8 -35
  1048. package/dist/util/scheduler.js.map +1 -1
  1049. package/package.json +1 -1
  1050. package/dist/browser/chunks/chunk-4BDLFEOC.js.map +0 -7
  1051. package/dist/browser/chunks/chunk-7DB6BI27.js +0 -6
  1052. package/dist/browser/chunks/chunk-7DB6BI27.js.map +0 -7
  1053. package/dist/browser/chunks/chunk-IX53IFBD.js +0 -13
  1054. package/dist/browser/chunks/chunk-IX53IFBD.js.map +0 -7
  1055. package/dist/browser/chunks/chunk-Q55UPA3E.js +0 -3
  1056. package/dist/browser/chunks/chunk-Q55UPA3E.js.map +0 -7
  1057. package/dist/renamed-scene-names.d.ts +0 -17
  1058. package/dist/renamed-scene-names.d.ts.map +0 -1
  1059. package/dist/renamed-scene-names.js +0 -9
  1060. package/dist/renamed-scene-names.js.map +0 -1
  1061. package/dist/runtime/precompisition.d.ts +0 -24
  1062. package/dist/runtime/precompisition.d.ts.map +0 -1
  1063. package/dist/runtime/precompisition.js +0 -7
  1064. package/dist/runtime/precompisition.js.map +0 -1
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/tween/lerp.ts", "../../../src/attributes/layout/vector2.ts", "../../../src/attributes/shape/fill/color/constants.ts", "../../../src/attributes/shape/fill/color/parser.ts", "../../../src/attributes/shape/path/bezier.ts", "../../../src/attributes/shape/path/walk.ts", "../../../src/attributes/shape/path/anchors.ts", "../../../src/attributes/shape/path/measure.ts", "../../../src/attributes/shape/path/morph.ts", "../../../src/attributes/shape/path/ops.ts", "../../../src/components/builtins/geometry/shape-outline.ts", "../../../src/components/builtins/text/text-defaults.ts", "../../../src/attributes/render3d/orbit.ts"],
4
+ "sourcesContent": ["import { EasingFunction } from \"./ease/type\";\n\n/** Linearly interpolates `from + (to - from) * t`; `t` outside [0, 1] extrapolates. */\nexport function lerpNumber(from: number, to: number, t: number): number {\n return from + (to - from) * t;\n}\n\n/** Interpolates a CSS-style perspective distance (px; `0` is a parallel projection). Perspective enters the matrix as its reciprocal (`x / (1 - z/perspective)`), so `1/perspective` varies smoothly with visual strength: lerping the raw px value would sweep through small positive numbers near `0` where the reciprocal diverges, flashing a near-degenerate projection at the start of a `0 → 800` tween. Lerping the reciprocal (`0` standing for `0`, as in `isProjective`/`invP` in `matrix2d.ts`) stays monotonic and bounded. */\nexport function lerpPerspective(from: number, to: number, t: number): number {\n const invFrom = from !== 0 ? 1 / from : 0;\n const invTo = to !== 0 ? 1 / to : 0;\n const inv = invFrom + (invTo - invFrom) * t;\n return inv !== 0 ? 1 / inv : 0;\n}\n\nexport type LerpFunction<T> = (from: T, to: T, t: number) => T;\nexport type TweenOptions<T> = { ease?: EasingFunction, lerp?: LerpFunction<T> };", "import { lerpNumber } from \"@/tween/lerp\";\nimport type { AttributeOps } from \"@/attributes/shared/operators\";\n\n/** A 2D point or offset in pixel space. */\nexport interface Vector2 {\n x: number;\n y: number;\n}\n\n/** Linear interpolation between two Vector2 positions. t=0 returns `from`, t=1 returns `to`. */\nexport function lerpVector2(from: Vector2, to: Vector2, t: number): Vector2 {\n return { x: lerpNumber(from.x, to.x, t), y: lerpNumber(from.y, to.y, t) };\n}\n\n/** The `Vector2` attribute's op set: resolve is the identity (already a loose number pair). */\nexport const vector2Ops: AttributeOps<Vector2, Vector2> = {\n resolve: (value) => value,\n lerp: lerpVector2,\n};\n", "/**\n * Pre-normalized CSS named color table.\n *\n * All 148 CSS Level 4 named colors stored as `[R, G, B, A]` float tuples in\n * the 0–1 range. Map lookup is O(1) and avoids per-call string parsing or\n * floating-point division at runtime — callers just copy the tuple out.\n *\n * Source values are rounded to three decimal places (≈ 0.4 ULP error for an\n * 8-bit channel), which is well within display precision.\n */\n\nimport type { NormalizedColor } from './parser';\n\nexport const CSS_COLOR_MAP: ReadonlyMap<string, NormalizedColor> = new Map([\n ['aliceblue', [0.941, 0.973, 1.000, 1]],\n ['antiquewhite', [0.980, 0.922, 0.843, 1]],\n ['aqua', [0.000, 1.000, 1.000, 1]],\n ['aquamarine', [0.498, 1.000, 0.831, 1]],\n ['azure', [0.941, 1.000, 1.000, 1]],\n ['beige', [0.961, 0.961, 0.863, 1]],\n ['bisque', [1.000, 0.894, 0.769, 1]],\n ['black', [0.000, 0.000, 0.000, 1]],\n ['blanchedalmond', [1.000, 0.922, 0.804, 1]],\n ['blue', [0.000, 0.000, 1.000, 1]],\n ['blueviolet', [0.541, 0.169, 0.886, 1]],\n ['brown', [0.647, 0.165, 0.165, 1]],\n ['burlywood', [0.871, 0.722, 0.529, 1]],\n ['cadetblue', [0.373, 0.620, 0.627, 1]],\n ['chartreuse', [0.498, 1.000, 0.000, 1]],\n ['chocolate', [0.824, 0.412, 0.118, 1]],\n ['coral', [1.000, 0.498, 0.314, 1]],\n ['cornflowerblue', [0.392, 0.584, 0.929, 1]],\n ['cornsilk', [1.000, 0.973, 0.863, 1]],\n ['crimson', [0.863, 0.078, 0.235, 1]],\n ['cyan', [0.000, 1.000, 1.000, 1]],\n ['darkblue', [0.000, 0.000, 0.545, 1]],\n ['darkcyan', [0.000, 0.545, 0.545, 1]],\n ['darkgoldenrod', [0.722, 0.525, 0.043, 1]],\n ['darkgray', [0.663, 0.663, 0.663, 1]],\n ['darkgreen', [0.000, 0.392, 0.000, 1]],\n ['darkgrey', [0.663, 0.663, 0.663, 1]],\n ['darkkhaki', [0.741, 0.718, 0.420, 1]],\n ['darkmagenta', [0.545, 0.000, 0.545, 1]],\n ['darkolivegreen', [0.333, 0.420, 0.184, 1]],\n ['darkorange', [1.000, 0.549, 0.000, 1]],\n ['darkorchid', [0.600, 0.196, 0.800, 1]],\n ['darkred', [0.545, 0.000, 0.000, 1]],\n ['darksalmon', [0.914, 0.588, 0.478, 1]],\n ['darkseagreen', [0.561, 0.737, 0.561, 1]],\n ['darkslateblue', [0.282, 0.239, 0.545, 1]],\n ['darkslategray', [0.184, 0.310, 0.310, 1]],\n ['darkslategrey', [0.184, 0.310, 0.310, 1]],\n ['darkturquoise', [0.000, 0.808, 0.820, 1]],\n ['darkviolet', [0.580, 0.000, 0.827, 1]],\n ['deeppink', [1.000, 0.078, 0.576, 1]],\n ['deepskyblue', [0.000, 0.749, 1.000, 1]],\n ['dimgray', [0.412, 0.412, 0.412, 1]],\n ['dimgrey', [0.412, 0.412, 0.412, 1]],\n ['dodgerblue', [0.118, 0.565, 1.000, 1]],\n ['firebrick', [0.698, 0.133, 0.133, 1]],\n ['floralwhite', [1.000, 0.980, 0.941, 1]],\n ['forestgreen', [0.133, 0.545, 0.133, 1]],\n ['fuchsia', [1.000, 0.000, 1.000, 1]],\n ['gainsboro', [0.863, 0.863, 0.863, 1]],\n ['ghostwhite', [0.973, 0.973, 1.000, 1]],\n ['gold', [1.000, 0.843, 0.000, 1]],\n ['goldenrod', [0.855, 0.647, 0.125, 1]],\n ['gray', [0.502, 0.502, 0.502, 1]],\n ['green', [0.000, 0.502, 0.000, 1]],\n ['greenyellow', [0.678, 1.000, 0.184, 1]],\n ['grey', [0.502, 0.502, 0.502, 1]],\n ['honeydew', [0.941, 1.000, 0.941, 1]],\n ['hotpink', [1.000, 0.412, 0.706, 1]],\n ['indianred', [0.804, 0.361, 0.361, 1]],\n ['indigo', [0.294, 0.000, 0.510, 1]],\n ['ivory', [1.000, 1.000, 0.941, 1]],\n ['khaki', [0.941, 0.902, 0.549, 1]],\n ['lavender', [0.902, 0.902, 0.980, 1]],\n ['lavenderblush', [1.000, 0.941, 0.961, 1]],\n ['lawngreen', [0.486, 0.988, 0.000, 1]],\n ['lemonchiffon', [1.000, 0.980, 0.804, 1]],\n ['lightblue', [0.678, 0.847, 0.902, 1]],\n ['lightcoral', [0.941, 0.502, 0.502, 1]],\n ['lightcyan', [0.878, 1.000, 1.000, 1]],\n ['lightgoldenrodyellow', [0.980, 0.980, 0.824, 1]],\n ['lightgray', [0.827, 0.827, 0.827, 1]],\n ['lightgreen', [0.565, 0.933, 0.565, 1]],\n ['lightgrey', [0.827, 0.827, 0.827, 1]],\n ['lightpink', [1.000, 0.714, 0.757, 1]],\n ['lightsalmon', [1.000, 0.627, 0.478, 1]],\n ['lightseagreen', [0.125, 0.698, 0.667, 1]],\n ['lightskyblue', [0.529, 0.808, 0.980, 1]],\n ['lightslategray', [0.467, 0.533, 0.600, 1]],\n ['lightslategrey', [0.467, 0.533, 0.600, 1]],\n ['lightsteelblue', [0.690, 0.769, 0.871, 1]],\n ['lightyellow', [1.000, 1.000, 0.878, 1]],\n ['lime', [0.000, 1.000, 0.000, 1]],\n ['limegreen', [0.196, 0.804, 0.196, 1]],\n ['linen', [0.980, 0.941, 0.902, 1]],\n ['magenta', [1.000, 0.000, 1.000, 1]],\n ['maroon', [0.502, 0.000, 0.000, 1]],\n ['mediumaquamarine', [0.400, 0.804, 0.667, 1]],\n ['mediumblue', [0.000, 0.000, 0.804, 1]],\n ['mediumorchid', [0.729, 0.333, 0.827, 1]],\n ['mediumpurple', [0.576, 0.439, 0.859, 1]],\n ['mediumseagreen', [0.235, 0.702, 0.443, 1]],\n ['mediumslateblue', [0.482, 0.408, 0.933, 1]],\n ['mediumspringgreen', [0.000, 0.980, 0.604, 1]],\n ['mediumturquoise', [0.282, 0.820, 0.800, 1]],\n ['mediumvioletred', [0.780, 0.082, 0.522, 1]],\n ['midnightblue', [0.098, 0.098, 0.439, 1]],\n ['mintcream', [0.961, 1.000, 0.980, 1]],\n ['mistyrose', [1.000, 0.894, 0.882, 1]],\n ['moccasin', [1.000, 0.894, 0.710, 1]],\n ['navajowhite', [1.000, 0.871, 0.678, 1]],\n ['navy', [0.000, 0.000, 0.502, 1]],\n ['oldlace', [0.992, 0.961, 0.902, 1]],\n ['olive', [0.502, 0.502, 0.000, 1]],\n ['olivedrab', [0.420, 0.557, 0.137, 1]],\n ['orange', [1.000, 0.647, 0.000, 1]],\n ['orangered', [1.000, 0.271, 0.000, 1]],\n ['orchid', [0.855, 0.439, 0.839, 1]],\n ['palegoldenrod', [0.933, 0.910, 0.667, 1]],\n ['palegreen', [0.596, 0.984, 0.596, 1]],\n ['paleturquoise', [0.686, 0.933, 0.933, 1]],\n ['palevioletred', [0.859, 0.439, 0.576, 1]],\n ['papayawhip', [1.000, 0.937, 0.835, 1]],\n ['peachpuff', [1.000, 0.855, 0.725, 1]],\n ['peru', [0.804, 0.522, 0.247, 1]],\n ['pink', [1.000, 0.753, 0.796, 1]],\n ['plum', [0.867, 0.627, 0.867, 1]],\n ['powderblue', [0.690, 0.878, 0.902, 1]],\n ['purple', [0.502, 0.000, 0.502, 1]],\n ['rebeccapurple', [0.400, 0.200, 0.600, 1]],\n ['red', [1.000, 0.000, 0.000, 1]],\n ['rosybrown', [0.737, 0.561, 0.561, 1]],\n ['royalblue', [0.255, 0.412, 0.882, 1]],\n ['saddlebrown', [0.545, 0.271, 0.075, 1]],\n ['salmon', [0.980, 0.502, 0.447, 1]],\n ['sandybrown', [0.957, 0.643, 0.376, 1]],\n ['seagreen', [0.180, 0.545, 0.341, 1]],\n ['seashell', [1.000, 0.961, 0.933, 1]],\n ['sienna', [0.627, 0.322, 0.176, 1]],\n ['silver', [0.753, 0.753, 0.753, 1]],\n ['skyblue', [0.529, 0.808, 0.922, 1]],\n ['slateblue', [0.416, 0.353, 0.804, 1]],\n ['slategray', [0.439, 0.502, 0.565, 1]],\n ['slategrey', [0.439, 0.502, 0.565, 1]],\n ['snow', [1.000, 0.980, 0.980, 1]],\n ['springgreen', [0.000, 1.000, 0.498, 1]],\n ['steelblue', [0.275, 0.510, 0.706, 1]],\n ['tan', [0.824, 0.706, 0.549, 1]],\n ['teal', [0.000, 0.502, 0.502, 1]],\n ['thistle', [0.847, 0.749, 0.847, 1]],\n ['tomato', [1.000, 0.388, 0.278, 1]],\n ['transparent', [0.000, 0.000, 0.000, 0]],\n ['turquoise', [0.251, 0.878, 0.816, 1]],\n ['violet', [0.933, 0.510, 0.933, 1]],\n ['wheat', [0.961, 0.871, 0.702, 1]],\n ['white', [1.000, 1.000, 1.000, 1]],\n ['whitesmoke', [0.961, 0.961, 0.961, 1]],\n ['yellow', [1.000, 1.000, 0.000, 1]],\n ['yellowgreen', [0.604, 0.804, 0.196, 1]],\n]);\n", "/**\n * CSS colour string -> normalized [R, G, B, A] tuple (0-1, for GPU uniforms). Accepts named colours (CSS plus theme\n * aliases via {@link setTheme}), hex, rgb/hsl, lab/lch, oklab/oklch and a Tailwind-style opacity suffix (`\"white/10\"`).\n * No DOM, no `getComputedStyle`.\n */\n\nimport { CSS_COLOR_MAP } from './constants';\n\n/** Normalized RGBA color: `[red, green, blue, alpha]` each in the 0–1 range. */\nexport type NormalizedColor = [number, number, number, number];\n\n/** Loose color input accepted by prop interfaces — CSS string or pre-normalized tuple. */\nexport type Color = string | NormalizedColor;\n\nfunction gammaEncode(c: number): number {\n c = Math.max(0, Math.min(1, c));\n return c <= 0.0031308 ? 12.92 * c : 1.055 * Math.pow(c, 1 / 2.4) - 0.055;\n}\n\nfunction linearToSrgb(r: number, g: number, b: number, a: number): NormalizedColor {\n return [gammaEncode(r), gammaEncode(g), gammaEncode(b), a];\n}\n\n/** Bradford-adapted XYZ D65 → linear-light sRGB matrix (IEC 61966-2-1). */\nfunction xyzD65ToLinearSrgb(X: number, Y: number, Z: number): [number, number, number] {\n return [\n 3.2404542 * X - 1.5371385 * Y - 0.4985314 * Z,\n -0.9692660 * X + 1.8760108 * Y + 0.0415560 * Z,\n 0.0556434 * X - 0.2040259 * Y + 1.0572252 * Z,\n ];\n}\n\n/** Splits a colour function's inner content into three channel tokens and an alpha (slash or legacy comma form, via {@link readAlpha}). `null` on a wrong argument count or non-numeric alpha. */\nfunction parseArgs(inner: string): { tokens: string[]; alpha: number } | null {\n const slashIdx = inner.lastIndexOf('/');\n let alphaToken: string | undefined;\n let colorPart = inner;\n if (slashIdx !== -1) {\n alphaToken = inner.slice(slashIdx + 1).trim();\n colorPart = inner.slice(0, slashIdx);\n }\n const tokens = colorPart.trim().split(/[\\s,]+/).filter(Boolean);\n if (tokens.length === 4 && alphaToken === undefined) alphaToken = tokens.pop();\n if (tokens.length !== 3) return null;\n const alpha = alphaToken === undefined ? 1 : readAlpha(alphaToken);\n if (!Number.isFinite(alpha)) return null;\n return { tokens, alpha };\n}\n\n/** Reads an alpha token: a number, or a percentage (`50%` is 0.5). `NaN` if neither. */\nfunction readAlpha(token: string): number {\n return token.endsWith('%') ? Number(token.slice(0, -1)) / 100 : Number(token);\n}\n\n/** Reads a channel token as a number, scaling a percentage to `percentScale` and a bare number by `1 / numberScale`. `NaN` if it is not a number. */\nfunction readChannel(token: string, percentScale: number, numberScale = 1): number {\n return token.endsWith('%') ? (Number(token.slice(0, -1)) / 100) * percentScale : Number(token) / numberScale;\n}\n\nconst ANGLE_UNIT_DEGREES: Record<string, number> = { deg: 1, grad: 0.9, rad: 180 / Math.PI, turn: 360 };\n\n/** Reads a CSS hue/angle token to degrees. A bare number is degrees; an unknown unit or a non-number is `NaN`. */\nfunction readHue(token: string): number {\n const m = token.match(/^([+-]?(?:\\d+\\.?\\d*|\\.\\d+)(?:e[+-]?\\d+)?)(deg|grad|rad|turn)?$/);\n if (!m) return NaN;\n return Number(m[1]) * ANGLE_UNIT_DEGREES[m[2] ?? 'deg'];\n}\n\n/** Returns `color` when every component is finite, otherwise `null` (unsupported format). */\nfunction finiteColor(color: NormalizedColor): NormalizedColor | null {\n return color.every(Number.isFinite) ? color : null;\n}\n\n// Use a globalThis key so multiple bundled copies of this module (e.g. the\n// prebuilt player bundle and the Vite-compiled user code) share one map.\nconst _g = globalThis as Record<string, unknown>;\nif (!_g.__msThemeMap) _g.__msThemeMap = new Map<string, NormalizedColor>();\nconst THEME_COLOR_MAP = _g.__msThemeMap as Map<string, NormalizedColor>;\n\n// Colours already parsed, by the string as given: a scene repeats its strings every\n// frame. Shared like the theme, and cleared with it, since a name resolves through it.\nif (!_g.__msParsedColors) _g.__msParsedColors = new Map<string, NormalizedColor>();\nconst PARSED = _g.__msParsedColors as Map<string, NormalizedColor>;\n\n// Typography presets share the same global-map pattern so bundled copies read one registry.\nif (!_g.__msTypographyMap) _g.__msTypographyMap = new Map<string, Record<string, unknown>>();\nconst TYPOGRAPHY_MAP = _g.__msTypographyMap as Map<string, Record<string, unknown>>;\n\n// Structural mirror of `Theme` declared locally so this module stays a leaf (`config.ts` imports `Color` from\n// here; importing `Theme` back would be a cycle). Typography presets are stored opaquely, hence the loose `object`.\ntype ColorTokenInput = Color | { [key: string]: ColorTokenInput };\ninterface ThemeInput {\n colors?: Record<string, ColorTokenInput>;\n typography?: Record<string, object>;\n}\n\n/** Flattens nested colour groups into dash-joined lowercase keys (`brand-500`), parsing each leaf. Arrays and strings are leaves. */\nfunction flattenColors(\n tokens: Record<string, ColorTokenInput> | undefined,\n prefix: string,\n out: Map<string, NormalizedColor>,\n): void {\n if (!tokens) return;\n for (const [name, token] of Object.entries(tokens)) {\n const key = prefix ? `${prefix}-${name}` : name;\n if (token != null && !Array.isArray(token) && typeof token === 'object') {\n flattenColors(token as Record<string, ColorTokenInput>, key, out);\n } else {\n const color = token as Color;\n out.set(key.toLowerCase(), Array.isArray(color) ? (color as NormalizedColor) : parseColor(color));\n }\n }\n}\n\n/**\n * Registers a project theme: named colours (usable in any colour string; they win over CSS names) and typography\n * presets (selected via `variant`). No argument, `null` or `{}` clears both, since a host reading a document's\n * optional `theme` from storage gets `null`. The `default` typography key is reserved: it is the project-wide base\n * style read by {@link applyTextDefaults}.\n *\n * @example\n * setTheme({ colors: { brand: \"#ff6b35\", accent: { 500: \"oklch(70% 0.2 145)\" } }, typography: { header: { fontSize: 96 } } });\n */\nexport function setTheme(input: ThemeInput | null = {}): void {\n const theme = input ?? {};\n PARSED.clear();\n THEME_COLOR_MAP.clear();\n TYPOGRAPHY_MAP.clear();\n flattenColors(theme.colors, '', THEME_COLOR_MAP);\n if (theme.typography) {\n for (const [name, preset] of Object.entries(theme.typography)) {\n // Stored opaquely; widened to the readable record shape at this boundary only.\n TYPOGRAPHY_MAP.set(name.toLowerCase(), preset as Record<string, unknown>);\n }\n }\n}\n\n/** Case-insensitive; `undefined` if none is registered. */\nexport function getTypographyPreset(name: string): Record<string, unknown> | undefined {\n return TYPOGRAPHY_MAP.get(name.toLowerCase());\n}\n\nfunction parseNamedColor(str: string): NormalizedColor | null {\n return THEME_COLOR_MAP.get(str) ?? CSS_COLOR_MAP.get(str) ?? null;\n}\n\nfunction parseHex(str: string): NormalizedColor | null {\n if (!str.startsWith('#')) return null;\n let hex = str.slice(1);\n if (!/^[0-9a-f]+$/.test(hex)) return null;\n if (hex.length === 3 || hex.length === 4)\n hex = hex.split('').map(c => c + c).join('');\n const int = parseInt(hex, 16);\n if (hex.length === 6)\n return [(int >> 16 & 255) / 255, (int >> 8 & 255) / 255, (int & 255) / 255, 1];\n if (hex.length === 8)\n return [(int >>> 24) / 255, (int >> 16 & 255) / 255, (int >> 8 & 255) / 255, (int & 255) / 255];\n return null;\n}\n\nfunction parseRgb(str: string): NormalizedColor | null {\n const m = str.match(/^rgba?\\s*\\((.+)\\)/);\n if (!m) return null;\n const args = parseArgs(m[1]);\n if (!args) return null;\n const [r, g, b] = args.tokens.map(t => readChannel(t, 1, 255));\n return finiteColor([r, g, b, args.alpha]);\n}\n\n/** Parses `hsl()` / `hsla()`. The hue takes `deg`, `grad`, `rad` or `turn` (a bare number is degrees). */\nfunction parseHsl(str: string): NormalizedColor | null {\n const m = str.match(/^hsla?\\s*\\((.+)\\)/);\n if (!m) return null;\n const args = parseArgs(m[1]);\n if (!args) return null;\n const h = readHue(args.tokens[0]);\n const s = parseFloat(args.tokens[1]) / 100;\n const l = parseFloat(args.tokens[2]) / 100;\n const k = (n: number) => (((n + h / 30) % 12) + 12) % 12;\n const chroma = s * Math.min(l, 1 - l);\n const f = (n: number) => l - chroma * Math.max(-1, Math.min(k(n) - 3, Math.min(9 - k(n), 1)));\n return finiteColor([f(0), f(8), f(4), args.alpha]);\n}\n\n/** Parses `lab(L a b)` (CIE L*a*b*, D50 white point). */\nfunction parseLab(str: string): NormalizedColor | null {\n const m = str.match(/^lab\\s*\\((.+)\\)/);\n if (!m) return null;\n const args = parseArgs(m[1]);\n if (!args) return null;\n const L = parseFloat(args.tokens[0]);\n const a = parseFloat(args.tokens[1]);\n const b = parseFloat(args.tokens[2]);\n return finiteColor(labToNormalized(L, a, b, args.alpha));\n}\n\n/** Parses `lch(L C H)` (CIE L*C*h°, polar form of Lab). */\nfunction parseLch(str: string): NormalizedColor | null {\n const m = str.match(/^lch\\s*\\((.+)\\)/);\n if (!m) return null;\n const args = parseArgs(m[1]);\n if (!args) return null;\n const L = parseFloat(args.tokens[0]);\n const C = parseFloat(args.tokens[1]);\n const rad = readHue(args.tokens[2]) * (Math.PI / 180);\n return finiteColor(labToNormalized(L, C * Math.cos(rad), C * Math.sin(rad), args.alpha));\n}\n\nfunction parseOklab(str: string): NormalizedColor | null {\n const m = str.match(/^oklab\\s*\\((.+)\\)/);\n if (!m) return null;\n const args = parseArgs(m[1]);\n if (!args) return null;\n // L: 0–1 as number, or 0%–100% (100% = 1); a, b: 100% = 0.4 per CSS Color 4.\n const [L, a, b] = [readChannel(args.tokens[0], 1), readChannel(args.tokens[1], 0.4), readChannel(args.tokens[2], 0.4)];\n return finiteColor(oklabToNormalized(L, a, b, args.alpha));\n}\n\nfunction parseOklch(str: string): NormalizedColor | null {\n const m = str.match(/^oklch\\s*\\((.+)\\)/);\n if (!m) return null;\n const args = parseArgs(m[1]);\n if (!args) return null;\n // L: 0–1 or percentage; C: 0–0.4 or percentage (100% = 0.4).\n const L = readChannel(args.tokens[0], 1);\n const C = readChannel(args.tokens[1], 0.4);\n const rad = readHue(args.tokens[2]) * (Math.PI / 180);\n return finiteColor(oklabToNormalized(L, C * Math.cos(rad), C * Math.sin(rad), args.alpha));\n}\n\n/** Converts CIE L*a*b* (D50) to a normalized sRGB color. */\nfunction labToNormalized(L: number, a: number, b: number, alpha: number): NormalizedColor {\n const e = 0.008856, k = 903.3;\n const fy = (L + 16) / 116;\n const fx = a / 500 + fy;\n const fz = fy - b / 200;\n const X = (fx ** 3 > e ? fx ** 3 : (116 * fx - 16) / k) * 0.95047;\n const Y = L > k * e ? ((L + 16) / 116) ** 3 : L / k;\n const Z = (fz ** 3 > e ? fz ** 3 : (116 * fz - 16) / k) * 1.08883;\n const [lr, lg, lb] = xyzD65ToLinearSrgb(X, Y, Z);\n return linearToSrgb(lr, lg, lb, alpha);\n}\n\n/** Converts Oklab to a normalized sRGB color using the standard Björn Ottosson matrix. */\nfunction oklabToNormalized(L: number, a: number, b: number, alpha: number): NormalizedColor {\n const l_ = L + 0.3963377774 * a + 0.2158037573 * b;\n const m_ = L - 0.1055613458 * a - 0.0638541728 * b;\n const s_ = L - 0.0894841775 * a - 1.2914855480 * b;\n const l = l_ ** 3, m = m_ ** 3, s = s_ ** 3;\n return linearToSrgb(\n 4.0767416621 * l - 3.3077115913 * m + 0.2309699292 * s,\n -1.2684380046 * l + 2.6097574011 * m - 0.3413193965 * s,\n -0.0041960863 * l - 0.7034186147 * m + 1.6956065236 * s,\n alpha,\n );\n}\n\n/** Splits a Tailwind-style opacity suffix (`\"white/10\"`, percent 0-100) off a colour string. Only a slash outside parentheses counts, so `rgb(0 0 255 / 0.25)` is untouched. Returns the bare string and the opacity fraction. */\nfunction splitOpacitySuffix(str: string): { color: string; opacity: number } {\n if (str.includes('(')) return { color: str, opacity: 1 };\n const m = str.match(/^(.*[^/])\\/\\s*([\\d.]+)%?$/);\n if (!m) return { color: str, opacity: 1 };\n const pct = parseFloat(m[2]);\n if (!Number.isFinite(pct)) return { color: str, opacity: 1 };\n return { color: m[1].trim(), opacity: Math.max(0, Math.min(1, pct / 100)) };\n}\n\n/** Parses a CSS colour string into normalized `[R, G, B, A]`; warns and returns opaque black for unrecognised input. */\nexport function parseColor(cssStr: string): NormalizedColor {\n const known = PARSED.get(cssStr);\n if (known) return known;\n const { color: str, opacity } = splitOpacitySuffix(cssStr.trim().toLowerCase());\n const parsed =\n parseNamedColor(str) ??\n parseHex(str) ??\n parseRgb(str) ??\n parseHsl(str) ??\n parseLab(str) ??\n parseLch(str) ??\n parseOklab(str) ??\n parseOklch(str);\n if (!parsed) {\n console.warn(`[Motion Engine] Unsupported color format: \"${cssStr}\". Defaulting to black.`);\n return [0, 0, 0, 1];\n }\n // Clone before applying opacity: named/theme lookups return cached tuples.\n const color: NormalizedColor = opacity !== 1 ? [parsed[0], parsed[1], parsed[2], parsed[3] * opacity] : parsed;\n if (PARSED.size >= PARSED_MAX) PARSED.clear();\n PARSED.set(cssStr, color);\n return color;\n}\n\nconst PARSED_MAX = 16384;\n", "import { Vector2, lerpVector2 } from \"@/attributes/layout/vector2\";\nimport { PathCommand } from \"@/render/descriptors/path\";\nimport type { ArcParams, Cubic } from \"./types\";\n\n/**\n * Shared Bézier, arc and path-geometry primitives: everything under `shape/path/` that evaluates, splits, measures or\n * bounds a curve uses these rather than its own copy. Scalar evaluators (`cubicAxis` / `quadAxis`) avoid allocating a\n * {@link Vector2}; vector ones (`cubicPoint` / `quadPoint`) evaluate both axes.\n */\n\n/** SVG curve commands whose tangent feeds the reflected control point of a following S/s/T/t. */\nconst SMOOTH_CURVE_TYPES: ReadonlySet<PathCommand[\"type\"]> = new Set([\n \"C\", \"c\", \"S\", \"s\", \"Q\", \"q\", \"T\", \"t\",\n]);\n\n\n\n/** Whether a command's trailing control point is remembered for the next S/s/T/t to reflect; per SVG, after any other command the implied control point is the current point. */\nexport function isSmoothCurveType(type: PathCommand[\"type\"]): boolean {\n return SMOOTH_CURVE_TYPES.has(type);\n}\n\n/** Reflect a control point through the current point: `2 * current - control`. */\nexport function reflectControlPoint(current: number, control: number): number {\n return 2 * current - control;\n}\n\nexport function distance(a: Vector2, b: Vector2): number {\n const dx = b.x - a.x;\n const dy = b.y - a.y;\n return Math.sqrt(dx * dx + dy * dy);\n}\n\nexport function cubicAxis(t: number, p0: number, p1: number, p2: number, p3: number): number {\n const u = 1 - t;\n return u * u * u * p0 + 3 * u * u * t * p1 + 3 * u * t * t * p2 + t * t * t * p3;\n}\n\nexport function quadAxis(t: number, p0: number, p1: number, p2: number): number {\n const u = 1 - t;\n return u * u * p0 + 2 * u * t * p1 + t * t * p2;\n}\n\nexport function cubicPoint(p0: Vector2, p1: Vector2, p2: Vector2, p3: Vector2, t: number): Vector2 {\n return {\n x: cubicAxis(t, p0.x, p1.x, p2.x, p3.x),\n y: cubicAxis(t, p0.y, p1.y, p2.y, p3.y),\n };\n}\n\nexport function quadPoint(p0: Vector2, p1: Vector2, p2: Vector2, t: number): Vector2 {\n return {\n x: quadAxis(t, p0.x, p1.x, p2.x),\n y: quadAxis(t, p0.y, p1.y, p2.y),\n };\n}\n\n/** Approximates a parametric curve's arc length by summing a polyline's segments; more `steps` trade speed for accuracy. */\nexport function sampleCurveLength(pointAt: (t: number) => Vector2, steps = 32): number {\n let length = 0;\n let prev = pointAt(0);\n for (let i = 1; i <= steps; i++) {\n const next = pointAt(i / steps);\n length += distance(prev, next);\n prev = next;\n }\n return length;\n}\n\n/** A straight line as a cubic: controls sit on the line at 1/3 and 2/3. */\nexport function lineToCubic(from: Vector2, to: Vector2): Cubic {\n return {\n p0: from,\n c1: lerpVector2(from, to, 1 / 3),\n c2: lerpVector2(from, to, 2 / 3),\n p1: to,\n };\n}\n\n/** Elevate a quadratic Bézier to the equivalent cubic (exact, not an approximation). */\nexport function quadToCubic(from: Vector2, cp: Vector2, to: Vector2): Cubic {\n return {\n p0: from,\n c1: { x: from.x + (2 / 3) * (cp.x - from.x), y: from.y + (2 / 3) * (cp.y - from.y) },\n c2: { x: to.x + (2 / 3) * (cp.x - to.x), y: to.y + (2 / 3) * (cp.y - to.y) },\n p1: to,\n };\n}\n\n// De Casteljau split at `t`: the two sub-curves trace the exact same shape, so trimming preserves curvature.\n\nexport function splitCubicAt(p0: Vector2, p1: Vector2, p2: Vector2, p3: Vector2, t: number) {\n const a = lerpVector2(p0, p1, t);\n const b = lerpVector2(p1, p2, t);\n const c = lerpVector2(p2, p3, t);\n const d = lerpVector2(a, b, t);\n const e = lerpVector2(b, c, t);\n const f = lerpVector2(d, e, t);\n return {\n left: { from: p0, cp1: a, cp2: d, to: f },\n right: { from: f, cp1: e, cp2: c, to: p3 },\n };\n}\n\n/** The sub-cubic spanning parameters `t0..t1` of the original cubic. */\nexport function extractCubicRange(p0: Vector2, p1: Vector2, p2: Vector2, p3: Vector2, t0: number, t1: number) {\n if (t0 === 0) return splitCubicAt(p0, p1, p2, p3, t1).left;\n const { right } = splitCubicAt(p0, p1, p2, p3, t0);\n const adj = (t1 - t0) / (1 - t0);\n return splitCubicAt(right.from, right.cp1, right.cp2, right.to, adj).left;\n}\n\nexport function splitQuadAt(p0: Vector2, p1: Vector2, p2: Vector2, t: number) {\n const a = lerpVector2(p0, p1, t);\n const b = lerpVector2(p1, p2, t);\n const c = lerpVector2(a, b, t);\n return {\n left: { from: p0, cp: a, to: c },\n right: { from: c, cp: b, to: p2 },\n };\n}\n\n/** The sub-quadratic spanning parameters `t0..t1` of the original quadratic. */\nexport function extractQuadRange(p0: Vector2, p1: Vector2, p2: Vector2, t0: number, t1: number) {\n if (t0 === 0) return splitQuadAt(p0, p1, p2, t1).left;\n const { right } = splitQuadAt(p0, p1, p2, t0);\n const adj = (t1 - t0) / (1 - t0);\n return splitQuadAt(right.from, right.cp, right.to, adj).left;\n}\n\n/** The `t` values in (0, 1) where a cubic's one-dimensional derivative is zero. */\nexport function cubicExtrema(p0: number, p1: number, p2: number, p3: number): number[] {\n // B'(t) = 3[(p1−p0)(1−t)² + 2(p2−p1)t(1−t) + (p3−p2)t²], written as at² + bt + c.\n const a = -p0 + 3 * p1 - 3 * p2 + p3;\n const b = 2 * (p0 - 2 * p1 + p2);\n const c = p1 - p0;\n const roots: number[] = [];\n const push = (t: number) => {\n if (t > 0 && t < 1) roots.push(t);\n };\n if (Math.abs(a) < 1e-12) {\n if (Math.abs(b) > 1e-12) push(-c / b);\n return roots;\n }\n const disc = b * b - 4 * a * c;\n if (disc < 0) return roots;\n const root = Math.sqrt(disc);\n push((-b + root) / (2 * a));\n push((-b - root) / (2 * a));\n return roots;\n}\n\n/** The `t` value in (0, 1) where a quadratic's one-dimensional derivative is zero. */\nexport function quadExtrema(p0: number, p1: number, p2: number): number[] {\n // B'(t) = 2[(p1−p0)(1−t) + (p2−p1)t] = 0.\n const denominator = p0 - 2 * p1 + p2;\n if (Math.abs(denominator) < 1e-12) return [];\n const t = (p0 - p1) / denominator;\n return t > 0 && t < 1 ? [t] : [];\n}\n\nfunction angleBetween(ux: number, uy: number, vx: number, vy: number): number {\n const dot = ux * vx + uy * vy;\n const len = Math.sqrt(ux * ux + uy * uy) * Math.sqrt(vx * vx + vy * vy);\n let angle = Math.acos(Math.max(-1, Math.min(1, dot / len)));\n if (ux * vy - uy * vx < 0) angle = -angle;\n return angle;\n}\n\n\n/** The endpoint→center conversion of an SVG `A` command, returned as the ellipse's own parameters (not a sampler): flattening wants points, bounding wants the angles where each axis turns around. */\nexport function arcParams(\n from: Vector2, to: Vector2,\n rxRaw: number, ryRaw: number, rotation: number, largeArc: 0 | 1, sweep: 0 | 1,\n): ArcParams {\n const phi = rotation * Math.PI / 180;\n const cosPhi = Math.cos(phi), sinPhi = Math.sin(phi);\n\n const dx = (from.x - to.x) / 2;\n const dy = (from.y - to.y) / 2;\n const x1p = cosPhi * dx + sinPhi * dy;\n const y1p = -sinPhi * dx + cosPhi * dy;\n\n let rx = Math.abs(rxRaw), ry = Math.abs(ryRaw);\n const lambda = (x1p * x1p) / (rx * rx) + (y1p * y1p) / (ry * ry);\n if (lambda > 1) {\n const s = Math.sqrt(lambda);\n rx *= s;\n ry *= s;\n }\n\n const rx2 = rx * rx, ry2 = ry * ry;\n const x1p2 = x1p * x1p, y1p2 = y1p * y1p;\n const sq = Math.max(0, (rx2 * ry2 - rx2 * y1p2 - ry2 * x1p2) / (rx2 * y1p2 + ry2 * x1p2));\n const sign = (largeArc === sweep) ? -1 : 1;\n const cxp = sign * Math.sqrt(sq) * (rx * y1p / ry);\n const cyp = sign * Math.sqrt(sq) * -(ry * x1p / rx);\n\n const cx = cosPhi * cxp - sinPhi * cyp + (from.x + to.x) / 2;\n const cy = sinPhi * cxp + cosPhi * cyp + (from.y + to.y) / 2;\n\n const theta1 = angleBetween(1, 0, (x1p - cxp) / rx, (y1p - cyp) / ry);\n let dtheta = angleBetween((x1p - cxp) / rx, (y1p - cyp) / ry, (-x1p - cxp) / rx, (-y1p - cyp) / ry);\n if (sweep === 0 && dtheta > 0) dtheta -= 2 * Math.PI;\n if (sweep === 1 && dtheta < 0) dtheta += 2 * Math.PI;\n\n return { cx, cy, rx, ry, phi, theta1, dtheta };\n}\n\nexport function arcPointAtAngle(arc: ArcParams, theta: number): Vector2 {\n const cosPhi = Math.cos(arc.phi), sinPhi = Math.sin(arc.phi);\n const cosT = Math.cos(theta), sinT = Math.sin(theta);\n return {\n x: cosPhi * arc.rx * cosT - sinPhi * arc.ry * sinT + arc.cx,\n y: sinPhi * arc.rx * cosT + cosPhi * arc.ry * sinT + arc.cy,\n };\n}\n\nfunction arcDerivativeAtAngle(arc: ArcParams, theta: number): Vector2 {\n const cosPhi = Math.cos(arc.phi), sinPhi = Math.sin(arc.phi);\n const cosT = Math.cos(theta), sinT = Math.sin(theta);\n return {\n x: -arc.rx * cosPhi * sinT - arc.ry * sinPhi * cosT,\n y: -arc.rx * sinPhi * sinT + arc.ry * cosPhi * cosT,\n };\n}\n\n/** The arc's `theta0..theta1` span as cubics, the one place an arc is approximated. Split so no piece spans more than 90° (the `(4/3)·tan(Δ/4)` construction is exact at both endpoints and the midpoint, worst-case radial error ~2.7e-4 of the radius over a quarter turn). */\nexport function arcSweepToCubics(arc: ArcParams, theta0: number, theta1: number): Cubic[] {\n const sweep = theta1 - theta0;\n if (Math.abs(sweep) < 1e-12) return [];\n const pieces = Math.max(1, Math.ceil(Math.abs(sweep) / (Math.PI / 2)));\n const step = sweep / pieces;\n const alpha = (4 / 3) * Math.tan(step / 4);\n\n const cubics: Cubic[] = [];\n for (let i = 0; i < pieces; i++) {\n const a0 = theta0 + step * i;\n const a1 = a0 + step;\n const p0 = arcPointAtAngle(arc, a0);\n const p1 = arcPointAtAngle(arc, a1);\n const d0 = arcDerivativeAtAngle(arc, a0);\n const d1 = arcDerivativeAtAngle(arc, a1);\n cubics.push({\n p0,\n c1: { x: p0.x + alpha * d0.x, y: p0.y + alpha * d0.y },\n c2: { x: p1.x - alpha * d1.x, y: p1.y - alpha * d1.y },\n p1,\n });\n }\n return cubics;\n}\n\n/** The ellipse angles at which each axis turns around: the candidates an exact bounding box tests against the swept range. */\nexport function arcAxisAngles(arc: ArcParams): { x: number[]; y: number[] } {\n const cosPhi = Math.cos(arc.phi), sinPhi = Math.sin(arc.phi);\n // dx/dθ = 0 and dy/dθ = 0, each giving one angle and its antipode.\n const tx = Math.atan2(-arc.ry * sinPhi, arc.rx * cosPhi);\n const ty = Math.atan2(arc.ry * cosPhi, arc.rx * sinPhi);\n return {\n x: [tx, tx + Math.PI],\n y: [ty, ty + Math.PI],\n };\n}\n\n/** Whether ellipse angle `theta` lies within the arc's sweep, compared as distance travelled in the sweep's direction: `theta1 + dtheta` routinely leaves `[-π, π]` and an interval test would reject angles inside it. */\nexport function arcContainsAngle(arc: ArcParams, theta: number): boolean {\n const TAU = Math.PI * 2;\n const forward = arc.dtheta >= 0;\n const delta = forward ? theta - arc.theta1 : arc.theta1 - theta;\n const travelled = ((delta % TAU) + TAU) % TAU;\n return travelled <= Math.abs(arc.dtheta) + 1e-9;\n}\n\n/** Re-exported so curve math and point lerping live behind a single import. */\nexport { lerpVector2 };\n", "/**\n * From a `d` string to the normal form: the scanner, the parser, the one pen walk, and everything that reads a\n * {@link PathSegment}. Everything downstream takes {@link PathContour}s from here, so the pen rules (`Z` returns the\n * cursor to the contour start, `S`/`T` reflect from separate cubic and quadratic slots, arcs are exact) live once.\n */\nimport { Vector2 } from \"@/attributes/layout/vector2\";\nimport { PathCommand, PathData } from \"@/render/descriptors/path\";\nimport {\n arcAxisAngles, arcContainsAngle, arcParams, arcPointAtAngle, arcSweepToCubics,\n cubicExtrema, cubicPoint, extractCubicRange, extractQuadRange,\n lerpVector2, lineToCubic, quadExtrema, quadPoint, quadToCubic,\n} from \"./bezier\";\nimport type { Extents } from \"@/layout/bounds\";\nimport type { ArcParams, Cubic, PathContour, PathSegment } from \"./types\";\n\ninterface PathScanner {\n atEnd(): boolean;\n /** The next command letter, consumed, or `null` if a number comes first. */\n takeLetter(): string | null;\n hasNumber(): boolean;\n takeNumber(): number | null;\n /** A single-character `0`/`1` arc flag, consumed, or `null`. */\n takeFlag(): 0 | 1 | null;\n}\n\n/**\n * The one `d`-string scanner. **It scans on demand rather than tokenizing up front**: SVG's grammar is not\n * context-free, since an arc's `largeArc`/`sweep` are single characters that may run together with what follows\n * (`A9.564 9.564 0 0112 6.844`: `0112` is flag `0`, flag `1`, coordinate `12`). A regex split also reads `.5.5` as\n * one token.\n *\n * Deliberately forgiving otherwise: the value may come from a stored column or a pasted path, so a token it can't\n * read ends the scan and keeps everything before it (\"missing its last curve\", not \"the node is empty\").\n */\n\n/** Every command letter, including arcs; those become cubics at the *model* boundary, a deliberate conversion rather than a silent truncation. */\nconst COMMAND_LETTERS = \"MmLlHhVvCcSsQqTtAaZz\";\n\nfunction isSeparator(ch: string): boolean {\n return ch === \" \" || ch === \",\" || ch === \"\\t\" || ch === \"\\n\" || ch === \"\\r\";\n}\n\nfunction isDigit(ch: string): boolean {\n return ch >= \"0\" && ch <= \"9\";\n}\n\nfunction createPathScanner(data: string): PathScanner {\n let i = 0;\n\n const skip = () => {\n while (i < data.length && isSeparator(data[i])) i++;\n };\n\n const scanNumber = (): number | null => {\n skip();\n const start = i;\n if (data[i] === \"+\" || data[i] === \"-\") i++;\n while (i < data.length && isDigit(data[i])) i++;\n if (data[i] === \".\") {\n i++;\n while (i < data.length && isDigit(data[i])) i++;\n }\n if (data[i] === \"e\" || data[i] === \"E\") {\n const mark = i;\n i++;\n if (data[i] === \"+\" || data[i] === \"-\") i++;\n if (i < data.length && isDigit(data[i])) {\n while (i < data.length && isDigit(data[i])) i++;\n } else {\n i = mark;\n }\n }\n if (i === start) return null;\n const value = Number(data.slice(start, i));\n if (!Number.isFinite(value)) {\n i = start;\n return null;\n }\n return value;\n };\n\n return {\n atEnd: () => {\n skip();\n return i >= data.length;\n },\n takeLetter: () => {\n skip();\n if (i < data.length && COMMAND_LETTERS.includes(data[i])) return data[i++];\n return null;\n },\n hasNumber: () => {\n skip();\n if (i >= data.length) return false;\n const ch = data[i];\n return isDigit(ch) || ch === \".\" || ch === \"+\" || ch === \"-\";\n },\n takeNumber: scanNumber,\n takeFlag: () => {\n skip();\n // One character, no sign and no decimal point: reading a flag as a number is the bug.\n if (data[i] === \"0\") { i++; return 0; }\n if (data[i] === \"1\") { i++; return 1; }\n return null;\n },\n };\n}\n\nexport function lineSegment(from: Vector2, to: Vector2): PathSegment {\n return { kind: \"line\", from, to };\n}\n\nexport function quadSegment(from: Vector2, c: Vector2, to: Vector2): PathSegment {\n return { kind: \"quad\", from, c, to };\n}\n\nexport function cubicSegment(from: Vector2, c1: Vector2, c2: Vector2, to: Vector2): PathSegment {\n return { kind: \"cubic\", from, c1, c2, to };\n}\n\n/** An arc, or the line it degenerates to: a zero radius or coincident endpoints make the endpoint->center conversion divide by zero, and SVG says both draw as a straight line. */\nexport function arcSegment(\n from: Vector2, to: Vector2,\n rx: number, ry: number, rotation: number, largeArc: 0 | 1, sweep: 0 | 1,\n): PathSegment {\n if (rx === 0 || ry === 0 || (from.x === to.x && from.y === to.y)) {\n return lineSegment(from, to);\n }\n return { kind: \"arc\", from, to, rx, ry, rotation, largeArc, sweep };\n}\n\n/** The ellipse an arc segment names. Cheap, but not free — hoist it in a loop. */\nexport function segmentArc(segment: PathSegment & { kind: \"arc\" }): ArcParams {\n return arcParams(\n segment.from, segment.to,\n segment.rx, segment.ry, segment.rotation, segment.largeArc, segment.sweep,\n );\n}\n\nexport function segmentPointAt(segment: PathSegment, t: number): Vector2 {\n switch (segment.kind) {\n case \"line\": return lerpVector2(segment.from, segment.to, t);\n case \"quad\": return quadPoint(segment.from, segment.c, segment.to, t);\n case \"cubic\": return cubicPoint(segment.from, segment.c1, segment.c2, segment.to, t);\n case \"arc\": {\n const arc = segmentArc(segment);\n return arcPointAtAngle(arc, arc.theta1 + t * arc.dtheta);\n }\n }\n}\n\nfunction boxOf(points: Vector2[]): Extents {\n let minX = Infinity, minY = Infinity, maxX = -Infinity, maxY = -Infinity;\n for (const p of points) {\n if (p.x < minX) minX = p.x;\n if (p.x > maxX) maxX = p.x;\n if (p.y < minY) minY = p.y;\n if (p.y > maxY) maxY = p.y;\n }\n return { minX, minY, maxX, maxY };\n}\n\n/** The segment's tight box (its own extrema, solved, not its control hull, which can sit far outside the curve); closed form on every kind so it stays cheap enough for `measure()`. */\nexport function segmentBounds(segment: PathSegment): Extents {\n switch (segment.kind) {\n case \"line\":\n return boxOf([segment.from, segment.to]);\n case \"quad\": {\n const at = (t: number) => quadPoint(segment.from, segment.c, segment.to, t);\n return boxOf([\n segment.from, segment.to,\n ...quadExtrema(segment.from.x, segment.c.x, segment.to.x).map(at),\n ...quadExtrema(segment.from.y, segment.c.y, segment.to.y).map(at),\n ]);\n }\n case \"cubic\": {\n const at = (t: number) => cubicPoint(segment.from, segment.c1, segment.c2, segment.to, t);\n return boxOf([\n segment.from, segment.to,\n ...cubicExtrema(segment.from.x, segment.c1.x, segment.c2.x, segment.to.x).map(at),\n ...cubicExtrema(segment.from.y, segment.c1.y, segment.c2.y, segment.to.y).map(at),\n ]);\n }\n case \"arc\": {\n const arc = segmentArc(segment);\n const points: Vector2[] = [segment.from, segment.to];\n const angles = arcAxisAngles(arc);\n for (const theta of [...angles.x, ...angles.y]) {\n if (arcContainsAngle(arc, theta)) points.push(arcPointAtAngle(arc, theta));\n }\n return boxOf(points);\n }\n }\n}\n\n/** The segment as cubics. Exact for every kind but `arc`. */\nexport function segmentCubics(segment: PathSegment): Cubic[] {\n switch (segment.kind) {\n case \"line\": return [lineToCubic(segment.from, segment.to)];\n case \"quad\": return [quadToCubic(segment.from, segment.c, segment.to)];\n case \"cubic\": return [{ p0: segment.from, c1: segment.c1, c2: segment.c2, p1: segment.to }];\n case \"arc\": {\n const arc = segmentArc(segment);\n const cubics = arcSweepToCubics(arc, arc.theta1, arc.theta1 + arc.dtheta);\n return cubics.length > 0 ? cubics : [lineToCubic(segment.from, segment.to)];\n }\n }\n}\n\n/** The sub-range `t0..t1` as commands, no leading move. A sub-range of an arc stays an arc rather than being refitted with cubics. */\nexport function segmentSplit(segment: PathSegment, t0: number, t1: number): PathCommand[] {\n switch (segment.kind) {\n case \"line\": {\n const p = lerpVector2(segment.from, segment.to, t1);\n return [{ type: \"L\", x: p.x, y: p.y }];\n }\n case \"quad\": {\n const sub = extractQuadRange(segment.from, segment.c, segment.to, t0, t1);\n return [{ type: \"Q\", x1: sub.cp.x, y1: sub.cp.y, x: sub.to.x, y: sub.to.y }];\n }\n case \"cubic\": {\n const sub = extractCubicRange(segment.from, segment.c1, segment.c2, segment.to, t0, t1);\n return [{ type: \"C\", x1: sub.cp1.x, y1: sub.cp1.y, x2: sub.cp2.x, y2: sub.cp2.y, x: sub.to.x, y: sub.to.y }];\n }\n case \"arc\": {\n const arc = segmentArc(segment);\n const a0 = arc.theta1 + t0 * arc.dtheta;\n const a1 = arc.theta1 + t1 * arc.dtheta;\n const to = arcPointAtAngle(arc, a1);\n return [{\n type: \"A\",\n rx: arc.rx, ry: arc.ry, rotation: segment.rotation,\n largeArc: (Math.abs(a1 - a0) > Math.PI ? 1 : 0) as 0 | 1,\n sweep: segment.sweep,\n x: to.x, y: to.y,\n }];\n }\n }\n}\n\n/** The closing line of a closed contour, when it has any length. */\nexport function closingSegment(contour: PathContour): PathSegment | null {\n if (!contour.closed || contour.segments.length === 0) return null;\n const end = contour.segments[contour.segments.length - 1].to;\n if (Math.abs(end.x - contour.start.x) < 1e-9 && Math.abs(end.y - contour.start.y) < 1e-9) return null;\n return lineSegment(end, contour.start);\n}\n\nexport function contourSegments(contour: PathContour): PathSegment[] {\n const closing = closingSegment(contour);\n return closing ? [...contour.segments, closing] : contour.segments;\n}\n\n/** The union of every segment's box, or `null` when there is no geometry at all. */\nexport function contourBounds(contours: PathContour[]): Extents | null {\n let minX = Infinity, minY = Infinity, maxX = -Infinity, maxY = -Infinity;\n let seen = false;\n const include = (box: Extents) => {\n seen = true;\n if (box.minX < minX) minX = box.minX;\n if (box.minY < minY) minY = box.minY;\n if (box.maxX > maxX) maxX = box.maxX;\n if (box.maxY > maxY) maxY = box.maxY;\n };\n for (const contour of contours) {\n // A lone `M` still occupies a point. The closing line joins two points\n // already counted, so it never widens the box.\n if (contour.segments.length === 0) {\n include({ minX: contour.start.x, minY: contour.start.y, maxX: contour.start.x, maxY: contour.start.y });\n continue;\n }\n for (const segment of contour.segments) include(segmentBounds(segment));\n }\n return seen ? { minX, minY, maxX, maxY } : null;\n}\n\n/** Parses a `d` string into commands **as written** (relative stays relative, shorthands stay short, arcs stay arcs) so a stored string round-trips; {@link contours} resolves it later. */\nexport function parseCommands(d: string): PathCommand[] {\n const scan = createPathScanner(d);\n const commands: PathCommand[] = [];\n let letter: string | null = null;\n\n while (!scan.atEnd()) {\n const next = scan.takeLetter();\n if (next !== null) {\n letter = next;\n } else if (letter === null) {\n // Numbers before any command: nothing says what they mean.\n return commands;\n } else if (letter === \"M\") {\n // The pair after an `M` is an implicit `L` — the one case where a\n // coordinate run continues as a *different* command than its letter.\n letter = \"L\";\n } else if (letter === \"m\") {\n letter = \"l\";\n } else if (letter === \"Z\" || letter === \"z\") {\n // `Z` takes no arguments, so a number after one is a malformed\n // string rather than a repeat.\n return commands;\n }\n\n const upper = letter.toUpperCase();\n const rel = letter !== upper;\n\n if (upper === \"Z\") {\n commands.push({ type: \"Z\" });\n continue;\n }\n\n // `null` anywhere below means the string ran out or turned to garbage\n // mid-command; the partial command is dropped and the rest kept.\n const n = (count: number): number[] | null => {\n const out: number[] = [];\n for (let i = 0; i < count; i++) {\n const value = scan.takeNumber();\n if (value === null) return null;\n out.push(value);\n }\n return out;\n };\n\n switch (upper) {\n case \"M\": case \"L\": case \"T\": {\n const a = n(2);\n if (!a) return commands;\n const type = upper === \"M\" ? \"M\" : upper === \"L\" ? \"L\" : \"T\";\n commands.push({ type: (rel ? type.toLowerCase() : type) as never, x: a[0], y: a[1] });\n break;\n }\n case \"H\": {\n const a = n(1);\n if (!a) return commands;\n commands.push({ type: rel ? \"h\" : \"H\", x: a[0] });\n break;\n }\n case \"V\": {\n const a = n(1);\n if (!a) return commands;\n commands.push({ type: rel ? \"v\" : \"V\", y: a[0] });\n break;\n }\n case \"C\": {\n const a = n(6);\n if (!a) return commands;\n commands.push({ type: rel ? \"c\" : \"C\", x1: a[0], y1: a[1], x2: a[2], y2: a[3], x: a[4], y: a[5] });\n break;\n }\n case \"S\": case \"Q\": {\n const a = n(4);\n if (!a) return commands;\n commands.push(upper === \"S\"\n ? { type: rel ? \"s\" : \"S\", x2: a[0], y2: a[1], x: a[2], y: a[3] }\n : { type: rel ? \"q\" : \"Q\", x1: a[0], y1: a[1], x: a[2], y: a[3] });\n break;\n }\n case \"A\": {\n // The flags are read as single characters, not numbers — see\n // `createPathScanner`.\n const radii = n(3);\n if (!radii) return commands;\n const largeArc = scan.takeFlag();\n const sweep = scan.takeFlag();\n if (largeArc === null || sweep === null) return commands;\n const end = n(2);\n if (!end) return commands;\n commands.push({\n type: rel ? \"a\" : \"A\",\n rx: radii[0], ry: radii[1], rotation: radii[2],\n largeArc, sweep,\n x: end[0], y: end[1],\n });\n break;\n }\n default:\n // An unknown letter: stop rather than guess how many numbers it eats.\n return commands;\n }\n\n if (!scan.hasNumber() && scan.atEnd()) break;\n }\n return commands;\n}\n\n/** Coerce loose {@link PathData} into commands. Nullish is an empty path, not a throw. */\nexport function commands(d: PathData | null | undefined): PathCommand[] {\n if (d == null) return [];\n return typeof d === \"string\" ? parseCommands(d) : d;\n}\n\n/**\n * Contours already walked, keyed by the value they were walked from: `Path.measure` and `Text.measure` re-walk the\n * same `d` every layout pass. A string key hits by value, an authored `PathCommand[]` by reference (a tweened path's\n * fresh array misses, as in `morph.ts`'s plan cache). Bounded and insertion-ordered so those age out. The cached\n * list is shared: treat it as read-only.\n */\nconst CONTOUR_CACHE = new Map<PathData, PathContour[]>();\nconst CONTOUR_CACHE_MAX = 32;\n\n/** Resolves commands into absolute contours of typed segments: relative commands resolve against the pen, `Z` returns the pen to the contour start, and `S`/`T` reflect from **separate** cubic and quadratic slots, each cleared by a command of the other kind. */\nexport function contours(d: PathData | null | undefined): PathContour[] {\n if (d == null) return [];\n const cached = CONTOUR_CACHE.get(d);\n if (cached) return cached;\n const walked = walkCommands(commands(d));\n if (CONTOUR_CACHE.size >= CONTOUR_CACHE_MAX) {\n CONTOUR_CACHE.delete(CONTOUR_CACHE.keys().next().value!);\n }\n CONTOUR_CACHE.set(d, walked);\n return walked;\n}\n\n/** {@link contours} without the memo — the walk itself. */\nexport function walkCommands(list: PathCommand[]): PathContour[] {\n const out: PathContour[] = [];\n\n let current: PathContour | null = null;\n let cursor: Vector2 = { x: 0, y: 0 };\n let contourStart: Vector2 = { x: 0, y: 0 };\n let prevCubicCp: Vector2 | null = null;\n let prevQuadCp: Vector2 | null = null;\n\n // Returns rather than assigning, so the compiler can still see that `current`\n // is non-null after a call — a closure that assigned it would defeat that.\n const open = (at: Vector2): PathContour => {\n const contour: PathContour = { start: at, segments: [], closed: false };\n out.push(contour);\n contourStart = at;\n return contour;\n };\n const push = (segment: PathSegment) => {\n // A drawing command before any `M` starts a contour at the pen (the origin): malformed but recoverable.\n if (!current) current = open(cursor);\n current.segments.push(segment);\n };\n\n for (const cmd of list) {\n const rel = cmd.type !== cmd.type.toUpperCase();\n const abs = (x: number, y: number): Vector2 =>\n rel ? { x: cursor.x + x, y: cursor.y + y } : { x, y };\n\n let cubicCp: Vector2 | null = null;\n let quadCp: Vector2 | null = null;\n\n switch (cmd.type) {\n case \"M\": case \"m\": {\n const to = abs(cmd.x, cmd.y);\n current = open(to);\n cursor = to;\n break;\n }\n case \"L\": case \"l\": {\n const to = abs(cmd.x, cmd.y);\n push(lineSegment(cursor, to));\n cursor = to;\n break;\n }\n case \"H\": case \"h\": {\n const to = { x: rel ? cursor.x + cmd.x : cmd.x, y: cursor.y };\n push(lineSegment(cursor, to));\n cursor = to;\n break;\n }\n case \"V\": case \"v\": {\n const to = { x: cursor.x, y: rel ? cursor.y + cmd.y : cmd.y };\n push(lineSegment(cursor, to));\n cursor = to;\n break;\n }\n case \"C\": case \"c\": {\n const c1 = abs(cmd.x1, cmd.y1);\n const c2 = abs(cmd.x2, cmd.y2);\n const to = abs(cmd.x, cmd.y);\n push(cubicSegment(cursor, c1, c2, to));\n cursor = to;\n cubicCp = c2;\n break;\n }\n case \"S\": case \"s\": {\n const c1 = prevCubicCp\n ? { x: 2 * cursor.x - prevCubicCp.x, y: 2 * cursor.y - prevCubicCp.y }\n : cursor;\n const c2 = abs(cmd.x2, cmd.y2);\n const to = abs(cmd.x, cmd.y);\n push(cubicSegment(cursor, c1, c2, to));\n cursor = to;\n cubicCp = c2;\n break;\n }\n case \"Q\": case \"q\": {\n const cp = abs(cmd.x1, cmd.y1);\n const to = abs(cmd.x, cmd.y);\n push(quadSegment(cursor, cp, to));\n cursor = to;\n quadCp = cp;\n break;\n }\n case \"T\": case \"t\": {\n // Annotated because `quadCp` feeds `prevQuadCp` feeds this — a\n // real cycle for inference, unlike `S`, whose slot takes `c2`.\n const cp: Vector2 = prevQuadCp\n ? { x: 2 * cursor.x - prevQuadCp.x, y: 2 * cursor.y - prevQuadCp.y }\n : cursor;\n const to = abs(cmd.x, cmd.y);\n push(quadSegment(cursor, cp, to));\n cursor = to;\n quadCp = cp;\n break;\n }\n case \"A\": case \"a\": {\n const to = abs(cmd.x, cmd.y);\n push(arcSegment(cursor, to, cmd.rx, cmd.ry, cmd.rotation, cmd.largeArc, cmd.sweep));\n cursor = to;\n break;\n }\n case \"Z\": case \"z\": {\n if (current) {\n current.closed = true;\n // The closing line is implied by `closed`, not stored: it would be zero-length whenever the contour already ends where it started.\n current = null;\n }\n cursor = contourStart;\n break;\n }\n }\n\n // Only a curve leaves a control point behind. Anything else clears both,\n // which is what makes an `S` after a line start from the cursor rather\n // than from a curve three commands back.\n prevCubicCp = cubicCp;\n prevQuadCp = quadCp;\n }\n\n return out;\n}\n\n/** The tight box, or `null` for a path with no geometry at all. */\nexport function bounds(d: PathData | null | undefined): Extents | null {\n return contourBounds(contours(d));\n}\n\n/** {@link bounds} as a size. An empty path is `0 x 0` rather than `null`. */\nexport function size(d: PathData | null | undefined): { width: number; height: number } {\n const box = bounds(d);\n if (!box) return { width: 0, height: 0 };\n return { width: box.maxX - box.minX, height: box.maxY - box.minY };\n}\n", "/**\n * The editable vector model: subpaths of anchors, each with the two bezier handles of the segments either side\n * (Figma's model). The **second** boundary where geometry is deliberately flattened to one curve type: an arc has\n * no handles to drag, so it becomes cubics on the way in.\n *\n * **The coordinate space is the node's own box**: `x`/`y` run -0.5 to +0.5 across its width and height, y pointing\n * *down* as in SVG. Resizing is then an ordinary width/height drag, since geometry is a fraction of the box. Points\n * *may* sit outside it (a point dragged past an edge); {@link normalize} pulls the box back around the geometry once,\n * on the way out of an edit.\n */\nimport { Vector2 } from \"@/attributes/layout/vector2\";\nimport { PathCommand, PathData } from \"@/render/descriptors/path\";\nimport { arcSweepToCubics, cubicAxis, cubicExtrema, quadToCubic, splitCubicAt } from \"./bezier\";\nimport { contours, segmentArc } from \"./walk\";\nimport type { Extents } from \"@/layout/bounds\";\nimport type { Cubic, PathAnchor, PathContour, PathNormalization, PathSubpath, VectorPath } from \"./types\";\n\n/** An empty path, as the value an unset `data` field resolves to. */\nexport const EMPTY_PATH_DATA = \"\";\n\n/** Whether two points are the same to within serialization noise. */\nfunction samePoint(a: Vector2, b: Vector2): boolean {\n return Math.abs(a.x - b.x) < 1e-6 && Math.abs(a.y - b.y) < 1e-6;\n}\n\n/** Marks a subpath closed, folding a duplicated last anchor into the first: a `d` ending `… L 0 0 Z` names the start twice, and left alone the round trip would grow an anchor on every load. */\nfunction closeSubpath(subpath: PathSubpath): void {\n subpath.closed = true;\n const { anchors } = subpath;\n if (anchors.length < 2) return;\n const first = anchors[0];\n const last = anchors[anchors.length - 1];\n if (!samePoint(first.point, last.point)) return;\n // The closing segment's own curvature belongs to the join, so the duplicate's\n // in-handle becomes the first anchor's.\n first.inHandle = last.inHandle;\n anchors.pop();\n}\n\n/** A copy of a point of the memoized contour — the model is edited in place. */\nconst copy = (v: Vector2): Vector2 => ({ x: v.x, y: v.y });\n\nfunction contourToSubpath(contour: PathContour): PathSubpath {\n // Every point and handle is copied out of the memoized contour: `contours`\n // shares its result between callers, and an editor moves these in place.\n const anchors: PathAnchor[] = [\n { point: copy(contour.start), inHandle: null, outHandle: null },\n ];\n const curve = (cubic: Cubic) => {\n anchors[anchors.length - 1].outHandle = copy(cubic.c1);\n anchors.push({ point: copy(cubic.p1), inHandle: copy(cubic.c2), outHandle: null });\n };\n\n for (const segment of contour.segments) {\n switch (segment.kind) {\n case \"line\":\n // Both handles stay null, which is what draws a straight segment.\n anchors.push({ point: copy(segment.to), inHandle: null, outHandle: null });\n break;\n case \"cubic\":\n curve({ p0: segment.from, c1: segment.c1, c2: segment.c2, p1: segment.to });\n break;\n case \"quad\":\n curve(quadToCubic(segment.from, segment.c, segment.to));\n break;\n case \"arc\": {\n const arc = segmentArc(segment);\n for (const cubic of arcSweepToCubics(arc, arc.theta1, arc.theta1 + arc.dtheta)) {\n curve(cubic);\n }\n break;\n }\n }\n }\n\n const subpath: PathSubpath = { anchors, closed: false };\n if (contour.closed) closeSubpath(subpath);\n return subpath;\n}\n\n/** Any {@link PathData} as the editable model. Takes `PathData`, not a string: a morph hands over a `PathCommand[]` at every `t` strictly between 0 and 1, which string-only callers drew as nothing. */\nexport function anchors(d: PathData | null | undefined): VectorPath {\n return contours(d)\n .map(contourToSubpath)\n .filter((subpath) => subpath.anchors.length > 0);\n}\n\n/** Decimals a stored coordinate keeps: sub-pixel on a 10,000px node (a coordinate is a fraction of its size) and stable, so a drag that lands where it started re-serializes identically. */\nconst COORD_PRECISION = 5;\n\nfunction fmt(value: number): string {\n if (!Number.isFinite(value)) return \"0\";\n const rounded = Number(value.toFixed(COORD_PRECISION));\n // `-0` serializes as \"0\": the two are the same point, and a sign that flips\n // with the wind would make the \"did anything change\" comparison lie.\n return String(rounded === 0 ? 0 : rounded);\n}\n\n/** What one segment between two anchors *is*: a line, or a cubic and its controls. Shared by both output formats (`d` string and `PathCommand`). */\nfunction segmentBetween(from: PathAnchor, to: PathAnchor):\n | { line: true; to: Vector2 }\n | { line: false; c1: Vector2; c2: Vector2; to: Vector2 } {\n if (from.outHandle === null && to.inHandle === null) {\n return { line: true, to: to.point };\n }\n // A missing handle stands in as its own anchor: the degenerate cubic that draws as a straight pull towards the other end.\n return {\n line: false,\n c1: from.outHandle ?? from.point,\n c2: to.inHandle ?? to.point,\n to: to.point,\n };\n}\n\n/** Serializes the model back to a `d` string. Only `M`, `L`, `C` and `Z` are emitted, so what is stored can always be edited. */\nexport function fromAnchors(path: VectorPath): string {\n const parts: string[] = [];\n for (const { anchors, closed } of path) {\n if (anchors.length === 0) continue;\n parts.push(`M ${fmt(anchors[0].point.x)} ${fmt(anchors[0].point.y)}`);\n for (let i = 1; i < anchors.length; i++) {\n const segment = segmentBetween(anchors[i - 1], anchors[i]);\n parts.push(segment.line\n ? `L ${fmt(segment.to.x)} ${fmt(segment.to.y)}`\n : `C ${fmt(segment.c1.x)} ${fmt(segment.c1.y)} ${fmt(segment.c2.x)} ${fmt(segment.c2.y)} ${fmt(segment.to.x)} ${fmt(segment.to.y)}`);\n }\n if (closed) {\n if (anchors.length > 1) {\n const join = segmentBetween(anchors[anchors.length - 1], anchors[0]);\n // A straight closing segment is what `Z` already draws, so emitting\n // it as well would add the duplicate anchor `closeSubpath` undoes.\n if (!join.line) {\n parts.push(`C ${fmt(join.c1.x)} ${fmt(join.c1.y)} ${fmt(join.c2.x)} ${fmt(join.c2.y)} ${fmt(join.to.x)} ${fmt(join.to.y)}`);\n }\n }\n parts.push(\"Z\");\n }\n }\n return parts.join(\" \");\n}\n\nconst identity = (point: Vector2): Vector2 => point;\n\n/** The model as drawable commands, with a transform (unit box -> laid-out pixels, y-down -> y-up) folded into the same pass: one allocation per repaint instead of two. */\nexport function anchorCommands(\n path: VectorPath,\n transform: (point: Vector2) => Vector2 = identity,\n): PathCommand[] {\n const out: PathCommand[] = [];\n const emit = (from: PathAnchor, to: PathAnchor) => {\n const segment = segmentBetween(from, to);\n const end = transform(segment.to);\n if (segment.line) {\n out.push({ type: \"L\", x: end.x, y: end.y });\n return;\n }\n const c1 = transform(segment.c1);\n const c2 = transform(segment.c2);\n out.push({ type: \"C\", x1: c1.x, y1: c1.y, x2: c2.x, y2: c2.y, x: end.x, y: end.y });\n };\n\n for (const { anchors, closed } of path) {\n if (anchors.length === 0) continue;\n const start = transform(anchors[0].point);\n out.push({ type: \"M\", x: start.x, y: start.y });\n for (let i = 1; i < anchors.length; i++) emit(anchors[i - 1], anchors[i]);\n if (closed) {\n if (anchors.length > 1) {\n const from = anchors[anchors.length - 1];\n const to = anchors[0];\n if (from.outHandle !== null || to.inHandle !== null) emit(from, to);\n }\n out.push({ type: \"Z\" });\n }\n }\n return out;\n}\n\n/** The path's tight bounding box (a cubic's own extrema, not the handle hull, which would leave a gap to the node's edge), or `null` when it has no points. */\nexport function anchorBounds(path: VectorPath): Extents | null {\n let minX = Infinity, minY = Infinity, maxX = -Infinity, maxY = -Infinity;\n let seen = false;\n\n const includeX = (x: number) => { seen = true; if (x < minX) minX = x; if (x > maxX) maxX = x; };\n const includeY = (y: number) => { seen = true; if (y < minY) minY = y; if (y > maxY) maxY = y; };\n\n for (const { anchors, closed } of path) {\n for (const anchor of anchors) {\n includeX(anchor.point.x);\n includeY(anchor.point.y);\n }\n // The closing join exists only with a second anchor to join: the writers\n // emit none for a lone one (`M x y Z` draws nothing), so its self-loop\n // must not widen the box either.\n const last = closed && anchors.length > 1 ? anchors.length : anchors.length - 1;\n for (let i = 0; i < last; i++) {\n const from = anchors[i];\n const to = anchors[(i + 1) % anchors.length];\n if (from.outHandle === null && to.inHandle === null) continue;\n const c1 = from.outHandle ?? from.point;\n const c2 = to.inHandle ?? to.point;\n for (const t of cubicExtrema(from.point.x, c1.x, c2.x, to.point.x)) {\n includeX(cubicAxis(t, from.point.x, c1.x, c2.x, to.point.x));\n }\n for (const t of cubicExtrema(from.point.y, c1.y, c2.y, to.point.y)) {\n includeY(cubicAxis(t, from.point.y, c1.y, c2.y, to.point.y));\n }\n }\n }\n\n return seen ? { minX, minY, maxX, maxY } : null;\n}\n\nexport function map(path: VectorPath, fn: (point: Vector2) => Vector2): VectorPath {\n return path.map((subpath) => ({\n closed: subpath.closed,\n anchors: subpath.anchors.map((anchor) => ({\n point: fn(anchor.point),\n inHandle: anchor.inHandle ? fn(anchor.inHandle) : null,\n outHandle: anchor.outHandle ? fn(anchor.outHandle) : null,\n })),\n }));\n}\n\n/** The turn-and-scale about `start` that carries `end` onto `to` (how `moveTo` fits a path at another node); translates when `start` and `end` coincide. */\nexport function endFit(start: Vector2, end: Vector2, to: Vector2): (point: Vector2) => Vector2 {\n const cx = end.x - start.x;\n const cy = end.y - start.y;\n const chord = cx * cx + cy * cy;\n if (chord < 1e-12) {\n const dx = to.x - end.x;\n const dy = to.y - end.y;\n return (p) => ({ x: p.x + dx, y: p.y + dy });\n }\n // (to - start) / (end - start) as complex numbers: a rotation and a uniform scale.\n const tx = to.x - start.x;\n const ty = to.y - start.y;\n const re = (tx * cx + ty * cy) / chord;\n const im = (ty * cx - tx * cy) / chord;\n return (p) => {\n const ux = p.x - start.x;\n const uy = p.y - start.y;\n return { x: start.x + re * ux - im * uy, y: start.y + im * ux + re * uy };\n };\n}\n\nexport function isEmpty(path: VectorPath): boolean {\n return path.every((subpath) => subpath.anchors.length < 2);\n}\n\n/** The unit box's extent: the node's layout rect as a fraction of itself. A renderer scales by it; an editor projects a screen point into it. */\nexport const PATH_UNIT_EXTENT = 1;\n\nexport const PATH_UNIT_HALF = PATH_UNIT_EXTENT / 2;\n\n/** The box a path's coordinates are quoted against: the node's own frame, {@link PATH_UNIT_HALF} either side of centre. */\nexport const UNIT_PATH_BOX: Extents = {\n minX: -PATH_UNIT_HALF,\n minY: -PATH_UNIT_HALF,\n maxX: PATH_UNIT_HALF,\n maxY: PATH_UNIT_HALF,\n};\n\n/** Pulls the unit box back around the geometry, run on the way out of a path edit. The caller pairs it with the node's size and position (grow by `scaleX`/`scaleY`, move by `centerX`/`centerY`) so the drawing doesn't shift on screen. */\nexport function normalize(path: VectorPath): PathNormalization {\n const bounds = anchorBounds(path);\n if (!bounds) return { path, scaleX: 1, scaleY: 1, centerX: 0, centerY: 0 };\n return fitToBox(path, bounds);\n}\n\n/** Re-quotes a path against `box`; {@link normalize} is this with the geometry's own bounds. A dialog can instead *state* the frame (margin, off-centre). A degenerate axis (all points on a line) keeps scale 1 instead of dividing by zero. */\nexport function fitToBox(path: VectorPath, box: Extents): PathNormalization {\n const width = box.maxX - box.minX;\n const height = box.maxY - box.minY;\n const centerX = (box.minX + box.maxX) / 2;\n const centerY = (box.minY + box.maxY) / 2;\n const scaleX = width > 1e-9 ? width / PATH_UNIT_EXTENT : 1;\n const scaleY = height > 1e-9 ? height / PATH_UNIT_EXTENT : 1;\n\n return {\n path: map(path, (p) => ({\n x: (p.x - centerX) / scaleX,\n y: (p.y - centerY) / scaleY,\n })),\n scaleX,\n scaleY,\n centerX,\n centerY,\n };\n}\n\nexport function translate(path: VectorPath, delta: Vector2): VectorPath {\n return map(path, (p) => ({ x: p.x + delta.x, y: p.y + delta.y }));\n}\n\n/** A point on the segment between two anchors at `t`: where a click landed, and the preview of the anchor an insertion would create. */\nexport function pointOn(from: PathAnchor, to: PathAnchor, t: number): Vector2 {\n if (from.outHandle === null && to.inHandle === null) {\n return {\n x: from.point.x + (to.point.x - from.point.x) * t,\n y: from.point.y + (to.point.y - from.point.y) * t,\n };\n }\n const c1 = from.outHandle ?? from.point;\n const c2 = to.inHandle ?? to.point;\n return {\n x: cubicAxis(t, from.point.x, c1.x, c2.x, to.point.x),\n y: cubicAxis(t, from.point.y, c1.y, c2.y, to.point.y),\n };\n}\n\n/** Splits the segment at `t` into the three anchors that replace the pair (ends with shortened outer handles, new anchor carrying both halves of the tangent). De Casteljau keeps the curve identical, so insertion is invisible. */\nexport function split(\n from: PathAnchor, to: PathAnchor, t: number,\n): { from: PathAnchor; middle: PathAnchor; to: PathAnchor } {\n if (from.outHandle === null && to.inHandle === null) {\n return {\n from,\n middle: { point: pointOn(from, to, t), inHandle: null, outHandle: null },\n to,\n };\n }\n\n const { left, right } = splitCubicAt(\n from.point,\n from.outHandle ?? from.point,\n to.inHandle ?? to.point,\n to.point,\n t,\n );\n return {\n from: { ...from, outHandle: left.cp1 },\n middle: { point: left.to, inHandle: left.cp2, outHandle: right.cp1 },\n to: { ...to, inHandle: right.cp2 },\n };\n}\n", "/**\n * Arc length and everything measured in it: length, the sampler, dashing and trimming. Separate from the normal form\n * because flattening is the expensive half of path geometry (bounding solves extrema in closed form, and `Path.measure`\n * / `Text.measure` run every layout pass), so it happens here on demand.\n *\n * **One resolution** ({@link SAMPLE_STEPS}) for all of it, so `length(d) === sampler(d).length` is an invariant rather\n * than a coincidence (`dash` once scaled its cycle against a length measured at 20 while walking the path at 50).\n */\nimport { Vector2 } from \"@/attributes/layout/vector2\";\nimport { PathCommand, PathData } from \"@/render/descriptors/path\";\nimport { distance } from \"./bezier\";\nimport { contourSegments, contours, segmentPointAt, segmentSplit } from \"./walk\";\nimport type {\n ContourMetric, PathContour, PathFrame, PathMetric, PathSampler, PathSegment, SegmentMetric,\n} from \"./types\";\n\n/** Line segments each curve is flattened into. */\nexport const SAMPLE_STEPS = 50;\n\nfunction flatten(segment: PathSegment): Vector2[] {\n // A line is already a polyline. Skipping the loop matters: a polygon path is\n // all lines, and 50 collinear samples per edge is pure waste.\n if (segment.kind === \"line\") return [segment.from, segment.to];\n const points: Vector2[] = [segment.from];\n for (let i = 1; i < SAMPLE_STEPS; i++) points.push(segmentPointAt(segment, i / SAMPLE_STEPS));\n points.push(segment.to);\n return points;\n}\n\nexport function measureSegment(segment: PathSegment): SegmentMetric {\n const points = flatten(segment);\n const cumulative: number[] = [0];\n let total = 0;\n for (let i = 1; i < points.length; i++) {\n total += distance(points[i - 1], points[i]);\n cumulative.push(total);\n }\n return { segment, points, cumulative, length: total };\n}\n\nexport function measureContours(contours: PathContour[]): PathMetric {\n let total = 0;\n const measured = contours.map((contour) => {\n const metrics = contourSegments(contour).map(measureSegment);\n const length = metrics.reduce((sum, m) => sum + m.length, 0);\n total += length;\n return { contour, metrics, length };\n });\n return { contours: measured, length: total };\n}\n\n/** The parameter `t` at arc-length `d` into a segment, read off the flattened table rather than binary-searched (re-sampling per probe cost 320 point evaluations per query and disagreed with the sampler). */\nexport function paramAtDist(metric: SegmentMetric, d: number): number {\n const { cumulative, length } = metric;\n if (length <= 0) return 0;\n if (d <= 0) return 0;\n if (d >= length) return 1;\n\n let lo = 0;\n let hi = cumulative.length - 1;\n while (lo < hi - 1) {\n const mid = (lo + hi) >> 1;\n if (cumulative[mid] <= d) lo = mid;\n else hi = mid;\n }\n const span = cumulative[hi] - cumulative[lo];\n const within = span > 0 ? (d - cumulative[lo]) / span : 0;\n const steps = cumulative.length - 1;\n return (lo + within) / steps;\n}\n\nexport function length(d: PathData | null | undefined): number {\n return measureContours(contours(d)).length;\n}\n\n/** Builds a {@link PathSampler}. The tangent is the chord of the flattened segment, not the analytic derivative: less exact, but every glyph on text-on-path is placed with it, so changing it is a visual change of its own. */\nexport function sampler(d: PathData): PathSampler {\n const metric = measureContours(contours(d));\n\n // One point list across every contour. The jump between contours carries no length (text does not flow across it, as in SVG `textPath`), so it is a zero-length step rather than a gap.\n const points: Vector2[] = [];\n const cumulative: number[] = [];\n let total = 0;\n for (const contourMetric of metric.contours) {\n const first = contourMetric.metrics[0]?.segment.from ?? contourMetric.contour.start;\n points.push(first);\n cumulative.push(total);\n for (const segmentMetric of contourMetric.metrics) {\n for (let i = 1; i < segmentMetric.points.length; i++) {\n total += distance(segmentMetric.points[i - 1], segmentMetric.points[i]);\n points.push(segmentMetric.points[i]);\n cumulative.push(total);\n }\n }\n }\n\n let cursor = 0; // last segment index used, for the monotonic fast path.\n\n const frameAt = (d: number): PathFrame | null => {\n if (total <= 0 || points.length < 2) return null;\n const target = Math.max(0, Math.min(total, d));\n\n // Reset the cursor if the caller stepped backwards.\n if (cumulative[cursor] > target) cursor = 0;\n // Advance to the step containing `target`, skipping the zero-length steps\n // that bridge contours so we land on real geometry.\n while (\n cursor < points.length - 2 &&\n (cumulative[cursor + 1] < target || cumulative[cursor + 1] === cumulative[cursor])\n ) {\n cursor++;\n }\n\n const a = points[cursor];\n const b = points[cursor + 1];\n const segStart = cumulative[cursor];\n const segLen = cumulative[cursor + 1] - segStart;\n const t = segLen > 0 ? (target - segStart) / segLen : 0;\n\n const dx = b.x - a.x;\n const dy = b.y - a.y;\n const segDist = Math.hypot(dx, dy);\n // Degenerate step: fall back to the point with no meaningful tangent.\n const tx = segDist > 0 ? dx / segDist : 1;\n const ty = segDist > 0 ? dy / segDist : 0;\n\n return { x: a.x + dx * t, y: a.y + dy * t, tx, ty };\n };\n\n return { length: total, frameAt };\n}\n\nfunction contourPoints(metric: ContourMetric): Vector2[] {\n const first = metric.metrics[0]?.segment.from ?? metric.contour.start;\n const points: Vector2[] = [first];\n for (const segment of metric.metrics) {\n for (let i = 1; i < segment.points.length; i++) points.push(segment.points[i]);\n }\n return points;\n}\n\n/** Walks a flattened subpath at constant speed emitting `M`/`L` for the \"on\" runs of the dash pattern (`scaledDash` alternates on/off from \"on\", wrapping; `offset` is the start into it). A zero-length dash is a dot, a sliver long so its cap has a direction, including the dots an open subpath is fit to start and end on. */\nfunction dashSubpath(points: Vector2[], scaledDash: number[], offset: number, closed: boolean): string {\n if (points.length < 2) return '';\n\n const cycle = scaledDash.reduce((a, b) => a + b, 0);\n const sliver = cycle * 1e-4;\n const tolerance = cycle * 1e-9;\n const into = ((offset % cycle) + cycle) % cycle;\n let dashIndex = 0;\n let passed = 0;\n while (passed + scaledDash[dashIndex] <= into) {\n if (scaledDash[dashIndex] === 0 && into - passed <= tolerance) break;\n passed += scaledDash[dashIndex];\n dashIndex = (dashIndex + 1) % scaledDash.length;\n if (dashIndex === 0) break;\n }\n\n const parts: string[] = [];\n let remaining = scaledDash[dashIndex] - (into - passed); // Distance left in the current dash segment.\n let isOn = dashIndex % 2 === 0; // Whether we're currently drawing (on) or skipping (off).\n let needMove = true; // Whether the next \"on\" run still needs an opening M.\n let last: { point: Vector2; x: number; y: number } | null = null;\n\n for (let i = 1; i < points.length; i++) {\n const p0 = points[i - 1];\n const p1 = points[i];\n const dx = p1.x - p0.x;\n const dy = p1.y - p0.y;\n const segLen = distance(p0, p1);\n\n if (segLen === 0) continue;\n last = { point: p1, x: dx / segLen, y: dy / segLen };\n\n let walked = 0;\n\n while (walked < segLen) {\n const available = segLen - walked;\n\n if (remaining >= available) {\n if (isOn) {\n if (needMove) {\n const t = walked / segLen;\n parts.push(`M ${p0.x + t * dx} ${p0.y + t * dy}`);\n needMove = false;\n }\n parts.push(`L ${p1.x} ${p1.y}`);\n }\n remaining -= available;\n walked = segLen;\n\n if (remaining <= tolerance) {\n dashIndex = (dashIndex + 1) % scaledDash.length;\n isOn = !isOn;\n remaining = scaledDash[dashIndex];\n if (isOn) needMove = true;\n }\n } else {\n const endT = (walked + remaining) / segLen;\n const endX = p0.x + endT * dx;\n const endY = p0.y + endT * dy;\n\n if (isOn) {\n if (needMove) {\n const startT = walked / segLen;\n parts.push(`M ${p0.x + startT * dx} ${p0.y + startT * dy}`);\n needMove = false;\n }\n const reach = remaining > 0 ? 0 : sliver / segLen;\n parts.push(`L ${endX + reach * dx} ${endY + reach * dy}`);\n }\n\n walked += remaining;\n dashIndex = (dashIndex + 1) % scaledDash.length;\n isOn = !isOn;\n remaining = scaledDash[dashIndex];\n if (isOn) needMove = true;\n }\n }\n }\n\n if (!closed && isOn && remaining <= tolerance && last) {\n const { point, x, y } = last;\n parts.push(`M ${point.x} ${point.y} L ${point.x - x * sliver} ${point.y - y * sliver}`);\n }\n\n return parts.join(' ');\n}\n\n/** How far `pattern` is stretched to fit one contour of a path `total` long (the renderer's rule too). A closed contour is fit with the rest of the path, to whole cycles of `total`; an open one alone, to whole cycles less the final gap so it starts and ends on a dash. An odd pattern alternates across cycles, has no final gap, and fits as closed. `null` when there is nothing to fit. */\nexport function dashScale(\n pattern: number[],\n contour: { length: number; closed: boolean },\n total: number,\n): number | null {\n const cycle = pattern.reduce((a, b) => a + b, 0);\n if (cycle <= 0 || total <= 0) return null;\n if (!contour.closed && contour.length > 0 && pattern.length % 2 === 0) {\n const lastGap = pattern[pattern.length - 1];\n const span = Math.max(1, Math.round((contour.length + lastGap) / cycle)) * cycle - lastGap;\n if (span > 0) return contour.length / span;\n }\n return total / (Math.max(1, Math.round(total / cycle)) * cycle);\n}\n\n/** Converts path geometry into a dashed SVG path string, each contour fit by {@link dashScale} and starting `offset` into the pattern as the renderer dashes a stroke. `dash` alternates on/off lengths; returns only the visible segments, or `''`. */\nexport function dash(d: PathData | null | undefined, dash: number[], offset = 0): string {\n if (!dash || dash.length === 0) return '';\n\n const metric = measureContours(contours(d));\n const runs: string[] = [];\n for (const contour of metric.contours) {\n const scale = dashScale(dash, { length: contour.length, closed: contour.contour.closed }, metric.length);\n if (scale === null) return '';\n const run = dashSubpath(\n contourPoints(contour), dash.map(value => value * scale), offset * scale, contour.contour.closed,\n );\n if (run) runs.push(run);\n }\n return runs.join(' ');\n}\n\n/** The portion of `d` between normalized arc-length fractions `start` and `end` (0..1) as a fresh command list. A full range or empty path returns unchanged; an empty or inverted range returns `[]`. */\nexport function trim(d: PathData, start: number, end: number): PathData {\n if (start === 0 && end === 1) return d;\n\n const s = Math.max(0, Math.min(1, start));\n const e = Math.max(s, Math.min(1, end));\n if (s === 0 && e === 1) return d;\n if (s >= e) return [];\n\n const metric = measureContours(contours(d));\n if (metric.length === 0) return d;\n\n const startDist = s * metric.length;\n const endDist = e * metric.length;\n\n const result: PathCommand[] = [];\n let accumulated = 0;\n\n for (const contour of metric.contours) {\n // Each contour opens its own `M`; sharing one would draw a line across the gap between contours.\n let needsMove = true;\n\n for (const metricEntry of contour.metrics) {\n const { segment, length } = metricEntry;\n const segEnd = accumulated + length;\n if (length === 0 || segEnd <= startDist || accumulated >= endDist) {\n accumulated = segEnd;\n continue;\n }\n\n const t0 = accumulated < startDist ? paramAtDist(metricEntry, startDist - accumulated) : 0;\n const t1 = segEnd > endDist ? paramAtDist(metricEntry, endDist - accumulated) : 1;\n\n if (needsMove) {\n const p = segmentPointAt(segment, t0);\n result.push({ type: \"M\", x: p.x, y: p.y });\n needsMove = false;\n }\n result.push(...segmentSplit(segment, t0, t1));\n accumulated = segEnd;\n }\n }\n\n return result;\n}\n", "/**\n * Path morphing: interpolation between two arbitrary path shapes (the GSAP MorphSVGPlugin approach). Commands can't be\n * lerped pairwise (different counts, types, start points, winding), so both paths are reshaped into a common form:\n * 1. {@link cubics} rewrites each path as {@link CubicSubpath}s (every drawing command becomes a cubic Bézier).\n * 2. {@link plan} pairs subpaths (padding the shorter side with collapsed ones), equalizes cubic counts by\n * subdividing the coarser along its perimeter, and rotates/reverses closed rings to start and wind together.\n * 3. {@link lerpPathData} samples that correspondence at `t`, lerping every control point.\n * The result is a {@link PathCommand} list (one `M` + N `C`s per subpath) the renderer draws unchanged.\n */\nimport { Vector2, lerpVector2 } from \"@/attributes/layout/vector2\";\nimport { PathCommand, PathData } from \"@/render/descriptors/path\";\nimport { distance, cubicPoint } from \"./bezier\";\nimport { commands, contourSegments, contours, segmentCubics } from \"./walk\";\nimport type { Cubic, CubicSubpath, MorphPlan } from \"./types\";\n\n/** A path as cubic subpaths: one of the two boundaries where geometry is deliberately flattened to a single curve type (an arc becomes cubics here and in the anchor model only). */\nexport function cubics(d: PathData | null | undefined): CubicSubpath[] {\n const out: CubicSubpath[] = [];\n for (const contour of contours(d)) {\n // A lone `M` has nothing to interpolate: it draws nothing and has no\n // first anchor to seed a partner from, so it is not a subpath here. It\n // stays in `contours`, where it still occupies a point of the bounds.\n const chain = contourSegments(contour).flatMap(segmentCubics);\n if (chain.length === 0) continue;\n // `contours` is memoized and shared, so hand out copies of its points: a\n // caller moving an anchor of the result must not move the cached path.\n out.push({\n cubics: chain.map((c) => ({ p0: { ...c.p0 }, c1: { ...c.c1 }, c2: { ...c.c2 }, p1: { ...c.p1 } })),\n closed: contour.closed,\n });\n }\n return out;\n}\n\nfunction startPoint(cubics: Cubic[]): Vector2 {\n return cubics[0].p0;\n}\n\n/** Approximate length of a cubic by flattening — cheap, used only for weighting. */\nfunction cubicLength(c: Cubic, steps = 8): number {\n let len = 0;\n let prev = c.p0;\n for (let i = 1; i <= steps; i++) {\n const p = cubicPoint(c.p0, c.c1, c.c2, c.p1, i / steps);\n len += distance(prev, p);\n prev = p;\n }\n return len;\n}\n\n/** Centroid of a subpath's anchor points — used to pair subpaths by proximity. */\nfunction centroid(cubics: Cubic[]): Vector2 {\n let x = 0, y = 0;\n for (const c of cubics) { x += c.p0.x; y += c.p0.y; }\n return { x: x / cubics.length, y: y / cubics.length };\n}\n\nfunction splitCubic(c: Cubic, t: number): [Cubic, Cubic] {\n const a = lerpVector2(c.p0, c.c1, t);\n const b = lerpVector2(c.c1, c.c2, t);\n const d = lerpVector2(c.c2, c.p1, t);\n const e = lerpVector2(a, b, t);\n const f = lerpVector2(b, d, t);\n const g = lerpVector2(e, f, t);\n return [\n { p0: c.p0, c1: a, c2: e, p1: g },\n { p0: g, c1: f, c2: d, p1: c.p1 },\n ];\n}\n\n/** Subdivides until it has exactly `target` cubics (>= current), splitting the longest segments first so added anchors land evenly along the perimeter; each becomes a correspondence point with the other shape. */\nfunction subdivideTo(cubics: Cubic[], target: number): Cubic[] {\n let work = cubics.slice();\n while (work.length < target) {\n let longest = 0;\n let maxLen = -1;\n for (let i = 0; i < work.length; i++) {\n const len = cubicLength(work[i]);\n if (len > maxLen) { maxLen = len; longest = i; }\n }\n const [left, right] = splitCubic(work[longest], 0.5);\n work.splice(longest, 1, left, right);\n }\n return work;\n}\n\nfunction reverseCubics(cubics: Cubic[]): Cubic[] {\n const out: Cubic[] = [];\n for (let i = cubics.length - 1; i >= 0; i--) {\n const c = cubics[i];\n out.push({ p0: c.p1, c1: c.c2, c2: c.c1, p1: c.p0 });\n }\n return out;\n}\n\nfunction rotateCubics(cubics: Cubic[], offset: number): Cubic[] {\n if (offset === 0) return cubics.slice();\n return cubics.slice(offset).concat(cubics.slice(0, offset));\n}\n\n/** Sum of squared distances between paired anchor points — the alignment cost. */\nfunction anchorCost(a: Cubic[], b: Cubic[]): number {\n let cost = 0;\n for (let i = 0; i < a.length; i++) {\n const dx = a[i].p0.x - b[i].p0.x;\n const dy = a[i].p0.y - b[i].p0.y;\n cost += dx * dx + dy * dy;\n }\n return cost;\n}\n\n/** Aligns a closed `to` ring against a fixed `from` ring (same cubic count): tries every rotation offset in both windings and keeps the one with least total anchor travel, so any point order or winding morphs without spinning or folding. */\nfunction alignClosedRing(from: Cubic[], to: Cubic[]): Cubic[] {\n const n = from.length;\n let best = to;\n let bestCost = Infinity;\n\n for (const candidate of [to, reverseCubics(to)]) {\n for (let offset = 0; offset < n; offset++) {\n const rotated = rotateCubics(candidate, offset);\n const cost = anchorCost(from, rotated);\n if (cost < bestCost) {\n bestCost = cost;\n best = rotated;\n }\n }\n }\n return best;\n}\n\n/** For an open subpath only the winding can flip (rotating would change the shape): picks the direction whose endpoints best match `from`. */\nfunction alignOpenSubpath(from: Cubic[], to: Cubic[]): Cubic[] {\n const reversed = reverseCubics(to);\n return anchorCost(from, to) <= anchorCost(from, reversed) ? to : reversed;\n}\n\n/** A subpath collapsed onto point `at` with `count` zero-length cubics: pairing a real subpath with one makes it grow out of / shrink into a point (added or removed subpaths). */\nfunction degenerateSubpath(at: Vector2, count: number): Cubic[] {\n const cubics: Cubic[] = [];\n for (let i = 0; i < count; i++) {\n cubics.push({ p0: { ...at }, c1: { ...at }, c2: { ...at }, p1: { ...at } });\n }\n return cubics;\n}\n\n/** Greedily pairs `from` subpaths with the nearest unused `to` subpath (by centroid), not by list order. Leftovers on either side pair with a degenerate partner at their own centroid and grow/shrink in place. */\nfunction pairSubpaths(\n fromSubs: CubicSubpath[],\n toSubs: CubicSubpath[],\n): Array<{ from: CubicSubpath; to: CubicSubpath }> {\n const pairs: Array<{ from: CubicSubpath; to: CubicSubpath }> = [];\n const toUsed = new Array(toSubs.length).fill(false);\n\n for (const f of fromSubs) {\n const fc = centroid(f.cubics);\n let bestIdx = -1;\n let bestDist = Infinity;\n for (let j = 0; j < toSubs.length; j++) {\n if (toUsed[j]) continue;\n const d = distance(fc, centroid(toSubs[j].cubics));\n if (d < bestDist) { bestDist = d; bestIdx = j; }\n }\n if (bestIdx >= 0) {\n toUsed[bestIdx] = true;\n pairs.push({ from: f, to: toSubs[bestIdx] });\n } else {\n // No `to` subpath left → collapse to this subpath's own centroid.\n pairs.push({\n from: f,\n to: { cubics: degenerateSubpath(fc, f.cubics.length), closed: f.closed },\n });\n }\n }\n\n // Any unused `to` subpaths grow out of their own centroid.\n for (let j = 0; j < toSubs.length; j++) {\n if (toUsed[j]) continue;\n const t = toSubs[j];\n const tc = centroid(t.cubics);\n pairs.push({\n from: { cubics: degenerateSubpath(tc, t.cubics.length), closed: t.closed },\n to: t,\n });\n }\n\n return pairs;\n}\n\n/** Builds a reusable {@link MorphPlan}. All the expensive work (cubics, pairing, equalizing, ring alignment) happens once here; {@link sample} is cheap per frame. */\nexport function plan(from: PathCommand[], to: PathCommand[]): MorphPlan {\n const fromSubs = cubics(from);\n const toSubs = cubics(to);\n\n if (fromSubs.length === 0 && toSubs.length === 0) {\n return { pairs: [] };\n }\n\n // One side empty → collapse/grow the other against a point at its start.\n if (fromSubs.length === 0) {\n const seed = startPoint(toSubs[0].cubics);\n fromSubs.push({ cubics: degenerateSubpath(seed, 1), closed: toSubs[0].closed });\n }\n if (toSubs.length === 0) {\n const seed = startPoint(fromSubs[0].cubics);\n toSubs.push({ cubics: degenerateSubpath(seed, 1), closed: fromSubs[0].closed });\n }\n\n const subPairs = pairSubpaths(fromSubs, toSubs);\n\n const pairs = subPairs.map(({ from: f, to: t }) => {\n const count = Math.max(f.cubics.length, t.cubics.length);\n const fromCubics = subdivideTo(f.cubics, count);\n let toCubics = subdivideTo(t.cubics, count);\n\n // Align the `to` side to the `from` side so points correspond and travel\n // the shortest path. Closed rings can rotate + reverse; open paths only\n // reverse (rotating an open path would tear it).\n const bothClosed = f.closed && t.closed;\n toCubics = bothClosed\n ? alignClosedRing(fromCubics, toCubics)\n : alignOpenSubpath(fromCubics, toCubics);\n\n return { from: fromCubics, to: toCubics, closed: bothClosed };\n });\n\n return { pairs };\n}\n\nfunction lerpCubic(from: Cubic, to: Cubic, t: number): Cubic {\n return {\n p0: lerpVector2(from.p0, to.p0, t),\n c1: lerpVector2(from.c1, to.c1, t),\n c2: lerpVector2(from.c2, to.c2, t),\n p1: lerpVector2(from.p1, to.p1, t),\n };\n}\n\n/** Samples a {@link MorphPlan} at progress `t` into a fresh {@link PathCommand} list. Closed subpaths end with `Z` rather than a line back to the start: the last cubic already lands on the first anchor, and `Z` makes the stroke join cleanly at the seam instead of two unjoined caps. */\nexport function sample(plan: MorphPlan, t: number): PathCommand[] {\n const out: PathCommand[] = [];\n for (const pair of plan.pairs) {\n const n = pair.from.length;\n if (n === 0) continue;\n const first = lerpCubic(pair.from[0], pair.to[0], t);\n out.push({ type: \"M\", x: first.p0.x, y: first.p0.y });\n out.push({ type: \"C\", x1: first.c1.x, y1: first.c1.y, x2: first.c2.x, y2: first.c2.y, x: first.p1.x, y: first.p1.y });\n for (let i = 1; i < n; i++) {\n const c = lerpCubic(pair.from[i], pair.to[i], t);\n out.push({ type: \"C\", x1: c.c1.x, y1: c.c1.y, x2: c.c2.x, y2: c.c2.y, x: c.p1.x, y: c.p1.y });\n }\n if (pair.closed) out.push({ type: \"Z\" });\n }\n return out;\n}\n\n/** One-entry plan cache: a tween holds its `(from, to)` pair fixed while `t` sweeps 0→1 and {@link lerp} runs per frame, so rebuilding (subdivision + ring alignment) every frame is avoided. */\nlet cachedPlan: { from: PathData; to: PathData; plan: MorphPlan } | null = null;\n\nfunction planFor(from: PathData, to: PathData): MorphPlan {\n if (cachedPlan && cachedPlan.from === from && cachedPlan.to === to) {\n return cachedPlan.plan;\n }\n const built = plan(commands(from), commands(to));\n cachedPlan = { from, to, plan: built };\n return built;\n}\n\n/** The {@link PathData} tween used by `Path`'s animatable `d` (usable as a `LerpFunction`). Endpoints need not share structure; they are reconciled into a cubic correspondence. At `t = 0` and `1` the endpoints are returned verbatim so the first and last frames are pixel-exact. */\nexport function lerp(from: PathData, to: PathData, t: number): PathData {\n if (t <= 0) return from;\n if (t >= 1) return to;\n return sample(planFor(from, to), t);\n}\n", "/**\n * Every path-geometry operation on one object, the repo's shape for an attribute whose operations go past\n * interpolation (like `insetsOps`, `alignmentOps`). Each method is the module function of the same name. Behind it is\n * **one** pen walk:\n *\n * PathData ── commands ──▶ PathCommand[] ── contours ──▶ PathContour[]\n * │\n * bounds · size · length · sampler · dash · trim ◀─────┤\n * cubics ── morph ◀──────────┤\n * anchors ── editing ◀────────┘\n *\n * `cubics` and `anchors` are the only places geometry is flattened to one curve type (a morph needs one segment kind\n * to pair up; nobody can drag an arc's handles). Everything that measures keeps the arc.\n */\nimport { PathCommand, PathData } from \"@/render/descriptors/path\";\nimport type { AttributeOps } from \"@/attributes/shared/operators\";\n\nimport { bounds, commands, contours, size } from \"./walk\";\nimport { dash, dashScale, length, sampler, trim } from \"./measure\";\nimport { cubics, lerp, plan, sample } from \"./morph\";\nimport {\n anchorBounds, anchorCommands, anchors, endFit, fitToBox, fromAnchors,\n isEmpty, map, normalize, pointOn, split, translate,\n} from \"./anchors\";\nimport type { Vector2 } from \"@/attributes/layout/vector2\";\nimport type { Extents } from \"@/layout/bounds\";\nimport { PathContour, CubicSubpath, VectorPath, PathSampler, MorphPlan, PathNormalization, PathAnchor } from \"./types\";\n\n\nexport interface PathOps {\n /** Parse. A `PathCommand[]` passes through by reference; nullish gives `[]`. */\n commands(d: PathData | null | undefined): PathCommand[];\n /** The normal form: absolute, shorthands expanded, grouped into contours. */\n contours(d: PathData | null | undefined): PathContour[];\n /** All-cubic form. Lossy for arcs — one of the two flattening boundaries. */\n cubics(d: PathData | null | undefined): CubicSubpath[];\n /** The editable anchor model. Lossy for arcs — the other boundary. */\n anchors(d: PathData | null | undefined): VectorPath;\n\n /** Tight box: each segment's own extrema, not its control hull. */\n bounds(d: PathData | null | undefined): Extents | null;\n /** {@link bounds} as a size; `0 x 0` for an empty path. */\n size(d: PathData | null | undefined): { width: number; height: number };\n /** Total arc length. An arc is measured along the arc, not across its chord. */\n length(d: PathData | null | undefined): number;\n /** Point and unit tangent at a distance along the path. */\n sampler(d: PathData): PathSampler;\n\n /** The portion between two arc-length fractions. Works on strings. */\n trim(d: PathData, start: number, end: number): PathData;\n /** Only the \"on\" runs of a dash pattern, fit as the renderer fits it, as a `d` string. */\n dash(d: PathData | null | undefined, pattern: number[], offset?: number): string;\n /** How far a pattern is stretched to fit one contour of a path — see `dash`. */\n dashScale(pattern: number[], contour: { length: number; closed: boolean }, total: number): number | null;\n\n /** A reusable correspondence between two paths. Expensive; `lerp` caches one. */\n plan(from: PathCommand[], to: PathCommand[]): MorphPlan;\n /** Sample a plan at `t`. Cheap. */\n sample(plan: MorphPlan, t: number): PathCommand[];\n\n /** Anchors back to a `d` string. Emits only `M`/`L`/`C`/`Z`. */\n fromAnchors(path: VectorPath): string;\n /** Anchors to commands, with a transform folded into the same pass. */\n anchorCommands(path: VectorPath, transform?: (p: Vector2) => Vector2): PathCommand[];\n /** Tight box of an anchor path. */\n anchorBounds(path: VectorPath): Extents | null;\n /** Every point and handle mapped. */\n map(path: VectorPath, fn: (p: Vector2) => Vector2): VectorPath;\n translate(path: VectorPath, delta: Vector2): VectorPath;\n /** The turn-and-scale about `start` carrying `end` onto `to` — a `map` fn. */\n endFit(start: Vector2, end: Vector2, to: Vector2): (p: Vector2) => Vector2;\n isEmpty(path: VectorPath): boolean;\n\n /** Re-quote against the geometry's own bounds. */\n normalize(path: VectorPath): PathNormalization;\n /** Re-quote against a stated box — the general form of {@link PathOps.normalize}. */\n fitToBox(path: VectorPath, box: Extents): PathNormalization;\n /** A point on the segment between two anchors, for hit-testing an insert. */\n pointOn(from: PathAnchor, to: PathAnchor, t: number): Vector2;\n /** De Casteljau split, so inserting an anchor does not move the curve. */\n split(from: PathAnchor, to: PathAnchor, t: number): { from: PathAnchor; middle: PathAnchor; to: PathAnchor };\n}\n\n\nexport const pathOps: AttributeOps<PathData, PathData> & PathOps = {\n // An SVG path string or command list needs no normalization.\n resolve: (value) => value,\n lerp,\n\n commands,\n contours,\n cubics,\n anchors,\n\n bounds,\n size,\n length,\n sampler,\n\n trim,\n dash,\n dashScale,\n\n plan,\n sample,\n\n fromAnchors,\n anchorCommands,\n anchorBounds,\n map,\n translate,\n endFit,\n isEmpty,\n\n normalize,\n fitToBox,\n pointOn,\n split,\n};\n", "/**\n * The silhouette of every shape type as a {@link VectorPath}, asked at two scales: the shape node classes draw it\n * every frame in pixels, and the path editor converts a shape to an editable Path node (in the unit box that node\n * stores) the moment a point moves. One definition keeps a converted triangle the same triangle, rounding included.\n *\n * Named shapes (triangle, pentagon, ...) are stretched to fill their box, whereas the parametric `polygon`/`polygram`\n * stay inscribed in the box's ellipse: that is what keeps a `sides` tween smooth, but a triangle then doesn't touch\n * the bottom of its bounds (its base vertices sit 30° below horizontal). Figma's polygon does the same.\n *\n * Everything works in **y-down** coordinates, as the stored `d` string does; the node classes flip once on the way\n * to the (y-up) renderer.\n */\n\nimport type { CornerRadiusResolved } from \"@/attributes/shape/corners/corner-radius\";\nimport type { CornerStyle } from \"@/attributes/shape/corners/corner-style\";\nimport type { Vector2 } from \"@/attributes/layout/vector2\";\nimport { distance } from \"@/attributes/shape/path/bezier\"\nimport { pathOps } from \"@/attributes/shape/path/ops\"\nimport type { PathAnchor, PathSubpath, VectorPath } from \"@/attributes/shape/path/types\";\n\n/** The shape types this module can draw an outline for. */\nexport type ShapeOutlineKind =\n | \"rect\"\n | \"ellipse\"\n | \"polygon\"\n | \"polygram\"\n | \"triangle\"\n | \"rightTriangle\"\n | \"pentagon\"\n | \"hexagon\"\n | \"octagon\"\n | \"star\"\n\n/** Everything an outline can depend on. Unstated fields take the schema's default. */\nexport interface ShapeOutlineOptions {\n /** The node's box, in pixels. */\n width: number\n height: number\n /** Vertex/corner rounding, in pixels. Ignored by the shapes that have no corners. */\n cornerRadius?: number | CornerRadiusResolved\n cornerStyle?: CornerStyle\n /** Vertex count — `polygon`/`polygram`'s `sides`, `star`'s number of points. */\n sides?: number\n /** Inner radius as a fraction of the outer: a polygram's or star's point depth, an ellipse's donut hole. */\n ratio?: number\n /** The ellipse's arc, in degrees. */\n startAngle?: number\n sweep?: number\n}\n\n/** The named shapes' vertex counts and turn from \"a vertex at the top\". The octagon is half a step off: with a vertex on top it reads as a rotated stop sign, which has a flat top. */\nconst NAMED_POLYGONS: Record<string, { sides: number; turn: number }> = {\n pentagon: { sides: 5, turn: 0 },\n hexagon: { sides: 6, turn: 0 },\n octagon: { sides: 8, turn: Math.PI / 8 },\n}\n\n/** A star's default point depth: the classic five-pointed star, inner vertices where a pentagram's extended edges cross. Not the polygram's round 50%, which is a control you move; this opens on the star people picture. */\nexport const STAR_DEFAULT_RATIO = 0.382\n\n/** The default number of points on a Star node. */\nexport const STAR_DEFAULT_POINTS = 5\n\n/** The outline in **pixel** space: centred on the origin, `width` x `height`, y-down. Empty for a degenerate box, which draws nothing rather than NaN coordinates. */\nexport function shapeOutlinePixels(\n kind: ShapeOutlineKind,\n options: ShapeOutlineOptions\n): VectorPath {\n const { width, height } = options\n if (!(width > 0) || !(height > 0)) return []\n\n switch (kind) {\n case \"rect\":\n return [rectOutline(width, height, options)]\n case \"ellipse\":\n return ellipseOutline(width, height, options)\n case \"triangle\":\n return [\n polygonOutline(\n [\n { x: 0, y: -height / 2 },\n { x: width / 2, y: height / 2 },\n { x: -width / 2, y: height / 2 },\n ],\n options\n ),\n ]\n case \"rightTriangle\":\n return [\n polygonOutline(\n [\n { x: -width / 2, y: -height / 2 },\n { x: width / 2, y: height / 2 },\n { x: -width / 2, y: height / 2 },\n ],\n options\n ),\n ]\n case \"polygon\":\n // The parametric one: inscribed, *not* stretched — see the module note.\n return [\n polygonOutline(\n regularVertices(sidesOf(options, 5), 0, width / 2, height / 2),\n options\n ),\n ]\n case \"polygram\":\n return [\n polygonOutline(\n starVertices(\n sidesOf(options, 5),\n clamp01(options.ratio ?? 0.5),\n width / 2,\n height / 2\n ),\n options\n ),\n ]\n case \"star\":\n return [\n polygonOutline(\n fillBox(\n starVertices(\n sidesOf(options, STAR_DEFAULT_POINTS),\n clamp01(options.ratio ?? STAR_DEFAULT_RATIO),\n 1,\n 1\n ),\n width,\n height\n ),\n options\n ),\n ]\n default: {\n const named = NAMED_POLYGONS[kind]\n if (!named) return []\n return [\n polygonOutline(\n fillBox(regularVertices(named.sides, named.turn, 1, 1), width, height),\n options\n ),\n ]\n }\n }\n}\n\n/** The same outline in the **unit box** a Path node stores (pixels divided by the node's size); what a shape-to-path conversion writes. Divided at the end rather than computed in unit space so a corner radius stays circular: 20px on 400x200 is 0.05 x 0.1 of the box and comes back round because the renderer multiplies by the same two numbers. */\nexport function shapeOutline(\n kind: ShapeOutlineKind,\n options: ShapeOutlineOptions\n): VectorPath {\n const { width, height } = options\n const pixels = shapeOutlinePixels(kind, options)\n if (!(width > 0) || !(height > 0)) return pixels\n return pathOps.map(pixels, (p) => ({ x: p.x / width, y: p.y / height }))\n}\n\n/** Whether this module knows how to draw a type — i.e. whether it can be edited as a path. */\nexport function hasShapeOutline(kind: string): kind is ShapeOutlineKind {\n return OUTLINE_KINDS.has(kind)\n}\n\nconst OUTLINE_KINDS: ReadonlySet<string> = new Set<ShapeOutlineKind>([\n \"rect\",\n \"ellipse\",\n \"polygon\",\n \"polygram\",\n \"triangle\",\n \"rightTriangle\",\n \"pentagon\",\n \"hexagon\",\n \"octagon\",\n \"star\",\n])\n\nfunction corner(point: Vector2): PathAnchor {\n return { point, inHandle: null, outHandle: null }\n}\n\nfunction sidesOf(options: ShapeOutlineOptions, fallback: number): number {\n return Math.max(3, Math.round(options.sides ?? fallback))\n}\n\nfunction clamp01(value: number): number {\n return Math.max(0, Math.min(1, value))\n}\n\n\n/** Vertices of a regular n-gon on the ellipse `rx` x `ry`, starting at the top and stepping clockwise as the engine's `polygonVertices` does, so a converted `polygon` keeps its point order. `turn` rotates the figure; see {@link NAMED_POLYGONS}. */\nfunction regularVertices(\n sides: number,\n turn: number,\n rx: number,\n ry: number\n): Vector2[] {\n const step = (2 * Math.PI) / sides\n const out: Vector2[] = []\n for (let i = 0; i < sides; i++) {\n // −π/2 is straight up in y-down coordinates.\n const a = -Math.PI / 2 + turn + i * step\n out.push({ x: rx * Math.cos(a), y: ry * Math.sin(a) })\n }\n return out\n}\n\n/** Outer and inner vertices alternating — a star with `points` points. */\nfunction starVertices(\n points: number,\n ratio: number,\n rx: number,\n ry: number\n): Vector2[] {\n const step = Math.PI / points\n const out: Vector2[] = []\n for (let i = 0; i < points * 2; i++) {\n const a = -Math.PI / 2 + i * step\n const k = i % 2 === 0 ? 1 : ratio\n out.push({ x: rx * k * Math.cos(a), y: ry * k * Math.sin(a) })\n }\n return out\n}\n\n/** Stretches a vertex ring so its bounding box is the node's box: the one step separating a shape from its parametric sibling (a triangle's base lands on the bottom edge). A ring with no extent on an axis keeps that axis rather than dividing by zero. */\nfunction fillBox(points: Vector2[], width: number, height: number): Vector2[] {\n if (points.length === 0) return points\n let minX = Infinity\n let minY = Infinity\n let maxX = -Infinity\n let maxY = -Infinity\n for (const p of points) {\n if (p.x < minX) minX = p.x\n if (p.x > maxX) maxX = p.x\n if (p.y < minY) minY = p.y\n if (p.y > maxY) maxY = p.y\n }\n const spanX = maxX - minX\n const spanY = maxY - minY\n const kx = spanX > 1e-9 ? width / spanX : 1\n const ky = spanY > 1e-9 ? height / spanY : 1\n const cx = (minX + maxX) / 2\n const cy = (minY + maxY) / 2\n return points.map((p) => ({ x: (p.x - cx) * kx, y: (p.y - cy) * ky }))\n}\n\n/** The cubic control-point offset approximating a circular arc, as a fraction of the tangent-point-to-corner distance: `k = (4/3)·tan(φ/4) / tan(φ/2)` for central angle φ. The familiar 0.5523 holds only at φ = 90°; a star's inner vertices turn nearly 180°, where it would visibly flatten the curve. */\nfunction arcHandleRatio(sweep: number): number {\n const half = sweep / 2\n if (Math.abs(half) < 1e-6) return 0\n return ((4 / 3) * Math.tan(sweep / 4)) / Math.tan(half)\n}\n\n/** A closed vertex ring as a subpath with each corner rounded or chamfered by `cornerRadius`, clamped per corner to half of each adjacent edge so a large radius can't turn the outline inside out. Zero radius returns the plain polygon. */\nfunction polygonOutline(\n points: Vector2[],\n options: ShapeOutlineOptions\n): PathSubpath {\n const radius = uniformRadius(options.cornerRadius)\n if (points.length < 3 || radius <= 0) {\n return { anchors: points.map(corner), closed: true }\n }\n const style = options.cornerStyle ?? \"rounded\"\n\n const anchors: PathAnchor[] = []\n for (let i = 0; i < points.length; i++) {\n const c = points[i]\n const prev = points[(i - 1 + points.length) % points.length]\n const next = points[(i + 1) % points.length]\n\n const toPrev = direction(c, prev)\n const toNext = direction(c, next)\n if (!toPrev || !toNext) {\n anchors.push(corner(c))\n continue\n }\n\n const cosine = Math.max(-1, Math.min(1, toPrev.x * toNext.x + toPrev.y * toNext.y))\n const interior = Math.acos(cosine)\n // Edges that double back have no corner to round; leave it sharp.\n if (interior < 1e-6 || Math.PI - interior < 1e-6) {\n anchors.push(corner(c))\n continue\n }\n\n // Never more than half the edge, so adjacent corners can't overlap.\n const tangent = Math.min(\n radius / Math.tan(interior / 2),\n distance(c, prev) / 2,\n distance(c, next) / 2\n )\n const a = { x: c.x + toPrev.x * tangent, y: c.y + toPrev.y * tangent }\n const b = { x: c.x + toNext.x * tangent, y: c.y + toNext.y * tangent }\n\n if (style === \"angled\") {\n // A chamfer: the same two tangent points, joined by a straight line.\n anchors.push(corner(a), corner(b))\n continue\n }\n\n const k = arcHandleRatio(Math.PI - interior)\n anchors.push(\n { point: a, inHandle: null, outHandle: { x: a.x + (c.x - a.x) * k, y: a.y + (c.y - a.y) * k } },\n { point: b, inHandle: { x: b.x + (c.x - b.x) * k, y: b.y + (c.y - b.y) * k }, outHandle: null }\n )\n }\n return { anchors, closed: true }\n}\n\n/** The unit vector from `from` towards `to`, or null when they coincide. */\nfunction direction(from: Vector2, to: Vector2): Vector2 | null {\n const dx = to.x - from.x\n const dy = to.y - from.y\n const len = Math.hypot(dx, dy)\n if (len < 1e-9) return null\n return { x: dx / len, y: dy / len }\n}\n\n\n/** A single radius from whichever shape the value arrived in. Per-corner values only mean something on a rect, so other shapes take the smallest of the four: converting a mixed-corner rect can't invent a radius bigger than any the author set. */\nfunction uniformRadius(value: number | CornerRadiusResolved | undefined): number {\n if (value === undefined) return 0\n if (typeof value === \"number\") return Math.max(0, value)\n return Math.max(\n 0,\n Math.min(value.topLeft, value.topRight, value.bottomLeft, value.bottomRight)\n )\n}\n\n/** A rectangle with per-corner radii. Written out rather than via {@link polygonOutline} because its corners are set individually and its right angles make the arc exact (tangent length equals the radius, handle ratio 0.5523). */\nfunction rectOutline(\n width: number,\n height: number,\n options: ShapeOutlineOptions\n): PathSubpath {\n const radii = perCornerRadii(options.cornerRadius, width, height)\n const style = options.cornerStyle ?? \"rounded\"\n const x = width / 2\n const y = height / 2\n const k = arcHandleRatio(Math.PI / 2)\n\n const anchors: PathAnchor[] = []\n /** One corner, walking clockwise from the top-left: `at` is the sharp corner, `from`/`to` the directions the outline arrives and leaves along. */\n const push = (\n at: Vector2,\n incoming: Vector2,\n outgoing: Vector2,\n r: number\n ) => {\n if (r <= 0) {\n anchors.push(corner(at))\n return\n }\n const a = { x: at.x - incoming.x * r, y: at.y - incoming.y * r }\n const b = { x: at.x + outgoing.x * r, y: at.y + outgoing.y * r }\n if (style === \"angled\") {\n anchors.push(corner(a), corner(b))\n return\n }\n anchors.push(\n { point: a, inHandle: null, outHandle: { x: a.x + (at.x - a.x) * k, y: a.y + (at.y - a.y) * k } },\n { point: b, inHandle: { x: b.x + (at.x - b.x) * k, y: b.y + (at.y - b.y) * k }, outHandle: null }\n )\n }\n\n const right = { x: 1, y: 0 }\n const down = { x: 0, y: 1 }\n const left = { x: -1, y: 0 }\n const up = { x: 0, y: -1 }\n // The incoming direction is the one the walk travels when it reaches the corner, not the edge it leaves along:\n // the loop closes into the top-left heading **up**, and `down` would reverse that corner.\n push({ x: -x, y: -y }, up, right, radii.topLeft)\n push({ x, y: -y }, right, down, radii.topRight)\n push({ x, y }, down, left, radii.bottomRight)\n push({ x: -x, y }, left, up, radii.bottomLeft)\n return { anchors, closed: true }\n}\n\n/** The four radii, clamped so opposite corners on an edge can't overlap. */\nfunction perCornerRadii(\n value: number | CornerRadiusResolved | undefined,\n width: number,\n height: number\n): CornerRadiusResolved {\n const raw: CornerRadiusResolved =\n value === undefined\n ? { topLeft: 0, topRight: 0, bottomLeft: 0, bottomRight: 0 }\n : typeof value === \"number\"\n ? {\n topLeft: value,\n topRight: value,\n bottomLeft: value,\n bottomRight: value,\n }\n : value\n const cap = Math.min(width, height) / 2\n return {\n topLeft: Math.max(0, Math.min(raw.topLeft, cap)),\n topRight: Math.max(0, Math.min(raw.topRight, cap)),\n bottomLeft: Math.max(0, Math.min(raw.bottomLeft, cap)),\n bottomRight: Math.max(0, Math.min(raw.bottomRight, cap)),\n }\n}\n\n/** The ellipse family: oval, arc (`sweep` under 360°), ring (`ratio` above 0) and wedge. The arc is emitted as cubics, not an SVG `A`: a Path node's geometry is a fraction of its box, so an `A` (whose parameters describe a circle) would come out of a non-uniform resize as a different curve, where cubics stretch exactly. */\nfunction ellipseOutline(\n width: number,\n height: number,\n options: ShapeOutlineOptions\n): VectorPath {\n const rx = width / 2\n const ry = height / 2\n const inner = clamp01(options.ratio ?? 0)\n const sweep = Math.max(0, Math.min(360, options.sweep ?? 360))\n if (sweep <= 0) return []\n\n const full = sweep >= 360\n // Degrees clockwise from twelve o'clock, matching the appearance schema's `startAngle` (a clock face, not `Math.atan2`).\n const from = ((options.startAngle ?? 0) - 90) * (Math.PI / 180)\n const to = from + sweep * (Math.PI / 180)\n\n if (full && inner <= 0) {\n return [{ anchors: arcAnchors(rx, ry, from, to, true), closed: true }]\n }\n if (full) {\n // A ring: two closed rings, the inner wound the other way so even-odd fill leaves a hole.\n return [\n { anchors: arcAnchors(rx, ry, from, to, true), closed: true },\n { anchors: arcAnchors(rx * inner, ry * inner, to, from, true), closed: true },\n ]\n }\n\n // An arc, closed back on itself: out along the outer edge, back along the\n // inner one (or through the centre, when there is no hole).\n const outer = arcAnchors(rx, ry, from, to, false)\n const back =\n inner > 0\n ? arcAnchors(rx * inner, ry * inner, to, from, false)\n : [corner({ x: 0, y: 0 })]\n return [{ anchors: [...outer, ...back], closed: true }]\n}\n\n/** An elliptical arc as anchors, split into segments of at most 90° (the span one cubic approximates to within a fraction of a pixel). `whole` drops the duplicated final anchor when the arc closes on its own start. */\nfunction arcAnchors(\n rx: number,\n ry: number,\n from: number,\n to: number,\n whole: boolean\n): PathAnchor[] {\n const total = to - from\n const steps = Math.max(1, Math.ceil(Math.abs(total) / (Math.PI / 2)))\n const step = total / steps\n // Each control point sits α along the curve's tangent, α = (4/3)·tan(Δ/4) for a segment spanning Δ; signed with\n // the step so a clockwise arc bulges the right way.\n const alpha = (4 / 3) * Math.tan(step / 4)\n\n const anchors: PathAnchor[] = []\n for (let i = 0; i <= steps; i++) {\n const a = from + step * i\n const point = { x: rx * Math.cos(a), y: ry * Math.sin(a) }\n // d/da of the point — the arc's tangent at this angle.\n const tangent = { x: -rx * Math.sin(a), y: ry * Math.cos(a) }\n const offset = { x: tangent.x * alpha, y: tangent.y * alpha }\n anchors.push({\n point,\n inHandle:\n i === 0 ? null : { x: point.x - offset.x, y: point.y - offset.y },\n outHandle:\n i === steps ? null : { x: point.x + offset.x, y: point.y + offset.y },\n })\n }\n\n if (whole && anchors.length > 1) {\n // The arc came back to where it started; fold the duplicate into the first\n // anchor so the ring has one anchor per corner rather than two stacked.\n const last = anchors.pop()!\n anchors[0].inHandle = last.inHandle\n }\n return anchors\n}\n", "/**\n * The family a component's text falls back to when the document names none. A caption a node draws itself (a button's\n * label, a window's title) needs *some* family: the font provider holds only what the manifest registered, and a family\n * called `\"\"` shapes against nothing and paints no glyphs. Which one is a fact about the application (fonts vendored\n * or licensed), so the host's composition root *supplies* it once through {@link setHostTextFamily}; until then it is `\"\"`.\n *\n * Deliberately **not** a prop: the prop is the node's own `fontFamily`, which a host's props mapping can fill from\n * here when left empty. This is only the answer to \"empty means what?\", one for the whole application.\n */\n\nlet fallbackFamily = \"\"\n\n/** Declares the family this application's components fall back to; called by the composition root before the first build. Unset it is `\"\"`, which paints no glyphs: a legible blank rather than a silently wrong typeface (the bargain an unregistered node type makes). */\nexport function setHostTextFamily(family: string): void {\n fallbackFamily = family\n}\n\n/** The family to use where the document names none. */\nexport function hostTextFamily(): string {\n return fallbackFamily\n}\n", "/** The vocabulary of an orbit camera and the lerps a 3D component tweens with. Shared by unrelated node types (a globe, a surface plot) that have a camera, not a subject, in common, so it belongs to none of them. */\nimport {\n parseColor,\n type Color,\n type NormalizedColor,\n} from \"@/attributes/shape/fill/color/parser\"\nimport type { Vector3 } from \"@/render3d/vector3\"\n\n/** Mapper: any {@link Color} to a normalized RGBA tuple. Resolved at *write* time because a tuple interpolates per channel while `\"#3B82F6\"` cannot; the tuple is still a valid `Color`. */\nexport function resolveColor3D(value: Color): NormalizedColor {\n return typeof value === \"string\" ? parseColor(value) : value\n}\n\n/** Tween: per-channel interpolation of two resolved colours. */\nexport function lerpColor3D(\n from: NormalizedColor,\n to: NormalizedColor,\n t: number\n): NormalizedColor {\n return [\n from[0] + (to[0] - from[0]) * t,\n from[1] + (to[1] - from[1]) * t,\n from[2] + (to[2] - from[2]) * t,\n from[3] + (to[3] - from[3]) * t,\n ]\n}\n\n/** Interpolates two numbers, tolerating non-finite endpoints: a resolved options bag can hold `Infinity` (unset `maxZoom` = no ceiling) and the plain form yields `NaN`. Non-finite endpoints hold `from` and switch at the end. */\nexport function lerpFinite(from: number, to: number, t: number): number {\n if (!Number.isFinite(from) || !Number.isFinite(to)) return t < 1 ? from : to\n return from + (to - from) * t\n}\n\n/** Interpolates a geometry-indexing value (segment or division count), rounded since a fractional count is meaningless to its loops. */\nexport function lerpCount(from: number, to: number, t: number): number {\n return Math.round(from + (to - from) * t)\n}\n\n/** Tweens a value with no in-between (a flag, a representation) by holding `from` until the tween lands. A mid-tween flip reads as a glitch, and snapping at the *midpoint* would land the change while the command still ran. */\nexport function snapValue<T>(from: T, to: T, t: number): T {\n return t < 1 ? from : to\n}\n\n/** {@link snapValue}, narrowed to a boolean where that is all a caller has. */\nexport const snapFlag: (from: boolean, to: boolean, t: number) => boolean =\n snapValue\n\n/** A camera placement in spherical terms — what `orbit`/`elevation`/`zoom` hold. */\nexport interface Orbit {\n /** Angle about the vertical axis, in **degrees**. */\n orbit: number\n /** Angle above the ground plane, in **degrees**. 0 is edge-on, 90 straight down. */\n elevation: number\n /** Distance from the target. */\n distance: number\n}\n\n/**\n * A stored `orbit` in the camera's own terms. A stored `orbit` is measured from **+X** and the camera's from **+Z**\n * (head-on): a quarter turn apart. Converting at this one seam keeps every existing document framed exactly as it\n * was; redefining the stored field would silently rotate every saved 3D scene by ninety degrees.\n */\nexport function cameraOrbit(orbit: number): number {\n return 90 - orbit\n}\n\n/** The Cartesian position for a spherical placement. Spherical suits a timeline: each number tweens independently, where a raw `[x, y, z]` couples \"spin\" and \"pull back\" and cuts a chord through the sphere. The camera takes the three numbers itself (see {@link cameraOrbit}); this places something *else* spherically (a light, a marker ring). */\nexport function orbitPosition({ orbit, elevation, distance }: Orbit): Vector3 {\n const orbitRad = orbit * (Math.PI / 180)\n const elevationRad = elevation * (Math.PI / 180)\n const horizontal = Math.cos(elevationRad) * distance\n return {\n x: Math.cos(orbitRad) * horizontal,\n y: Math.sin(elevationRad) * distance,\n z: Math.sin(orbitRad) * horizontal,\n }\n}\n\n/** A camera placement to move *to*, every axis optional: the argument of `orbitTo`. An object rather than positional numbers because the common edit is one axis. `zoom` rather than {@link Orbit}'s `distance`, the nodes' prop name. */\nexport interface OrbitTarget {\n /** Angle about the vertical axis, in degrees. */\n orbit?: number\n /** Angle above the ground plane, in degrees. */\n elevation?: number\n /** Distance from the target. */\n zoom?: number\n}\n\n/** `target` as props to write, omitting axes it does not name: an explicit `undefined` destination would tween towards `NaN`. */\nexport function orbitProps(target: OrbitTarget): Record<string, number> {\n const props: Record<string, number> = {}\n if (target.orbit !== undefined) props.orbit = target.orbit\n if (target.elevation !== undefined) props.elevation = target.elevation\n if (target.zoom !== undefined) props.zoom = target.zoom\n return props\n}\n"],
5
+ "mappings": "6FAGM,SAAUA,GAAWC,EAAcC,EAAY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,SAAUC,GAAc,CAAE,MAAAD,EAAO,UAAAE,EAAW,SAAAC,CAAQ,EAAS,CACjE,IAAMC,EAAWJ,GAAS,KAAK,GAAK,KAC9BK,EAAeH,GAAa,KAAK,GAAK,KACtCI,EAAa,KAAK,IAAID,CAAY,EAAIF,EAC5C,MAAO,CACL,EAAG,KAAK,IAAIC,CAAQ,EAAIE,EACxB,EAAG,KAAK,IAAID,CAAY,EAAIF,EAC5B,EAAG,KAAK,IAAIC,CAAQ,EAAIE,EAE5B,CAaM,SAAUC,GAAWC,EAAmB,CAC1C,IAAMC,EAAgC,CAAA,EACtC,OAAID,EAAO,QAAU,SAAWC,EAAM,MAAQD,EAAO,OACjDA,EAAO,YAAc,SAAWC,EAAM,UAAYD,EAAO,WACzDA,EAAO,OAAS,SAAWC,EAAM,KAAOD,EAAO,MAC5CC,CACX",
6
+ "names": ["lerpNumber", "from", "to", "t", "lerpPerspective", "invFrom", "invTo", "inv", "lerpVector2", "from", "to", "t", "lerpNumber", "vector2Ops", "value", "CSS_COLOR_MAP", "gammaEncode", "c", "linearToSrgb", "r", "g", "b", "a", "xyzD65ToLinearSrgb", "X", "Y", "Z", "parseArgs", "inner", "slashIdx", "alphaToken", "colorPart", "tokens", "alpha", "readAlpha", "token", "readChannel", "percentScale", "numberScale", "ANGLE_UNIT_DEGREES", "readHue", "m", "finiteColor", "color", "_g", "THEME_COLOR_MAP", "PARSED", "TYPOGRAPHY_MAP", "flattenColors", "prefix", "out", "name", "key", "parseColor", "setTheme", "input", "theme", "preset", "getTypographyPreset", "parseNamedColor", "str", "CSS_COLOR_MAP", "parseHex", "hex", "int", "parseRgb", "args", "t", "parseHsl", "h", "s", "l", "k", "n", "chroma", "f", "parseLab", "L", "labToNormalized", "parseLch", "C", "rad", "parseOklab", "oklabToNormalized", "parseOklch", "fy", "fx", "fz", "lr", "lg", "lb", "l_", "m_", "s_", "splitOpacitySuffix", "pct", "cssStr", "known", "opacity", "parsed", "PARSED_MAX", "distance", "a", "b", "dx", "dy", "cubicAxis", "p0", "p1", "p2", "p3", "u", "quadAxis", "cubicPoint", "t", "quadPoint", "lineToCubic", "from", "to", "lerpVector2", "quadToCubic", "cp", "splitCubicAt", "p0", "p1", "p2", "p3", "t", "a", "b", "c", "d", "e", "f", "extractCubicRange", "t0", "t1", "right", "adj", "splitQuadAt", "extractQuadRange", "cubicExtrema", "roots", "push", "disc", "root", "quadExtrema", "denominator", "angleBetween", "ux", "uy", "vx", "vy", "dot", "len", "angle", "arcParams", "rxRaw", "ryRaw", "rotation", "largeArc", "sweep", "phi", "cosPhi", "sinPhi", "dx", "dy", "x1p", "y1p", "rx", "ry", "lambda", "s", "rx2", "ry2", "x1p2", "y1p2", "sq", "sign", "cxp", "cyp", "cx", "cy", "theta1", "dtheta", "arcPointAtAngle", "arc", "theta", "cosT", "sinT", "arcDerivativeAtAngle", "arcSweepToCubics", "theta0", "pieces", "step", "alpha", "cubics", "a0", "a1", "d0", "d1", "arcAxisAngles", "tx", "ty", "arcContainsAngle", "TAU", "COMMAND_LETTERS", "isSeparator", "ch", "isDigit", "createPathScanner", "data", "i", "skip", "start", "mark", "value", "lineSegment", "from", "to", "quadSegment", "c", "cubicSegment", "c1", "c2", "arcSegment", "rx", "ry", "rotation", "largeArc", "sweep", "segmentArc", "segment", "arcParams", "segmentPointAt", "t", "lerpVector2", "quadPoint", "cubicPoint", "arc", "arcPointAtAngle", "boxOf", "points", "minX", "minY", "maxX", "maxY", "p", "segmentBounds", "at", "quadExtrema", "cubicExtrema", "angles", "arcAxisAngles", "theta", "arcContainsAngle", "segmentCubics", "lineToCubic", "quadToCubic", "cubics", "arcSweepToCubics", "segmentSplit", "t0", "t1", "sub", "extractQuadRange", "extractCubicRange", "a0", "a1", "closingSegment", "contour", "end", "contourSegments", "closing", "contourBounds", "contours", "seen", "include", "box", "parseCommands", "d", "scan", "commands", "letter", "next", "upper", "rel", "n", "count", "out", "a", "type", "radii", "CONTOUR_CACHE", "CONTOUR_CACHE_MAX", "cached", "walked", "walkCommands", "list", "current", "cursor", "contourStart", "prevCubicCp", "prevQuadCp", "open", "push", "cmd", "abs", "x", "y", "cubicCp", "quadCp", "cp", "bounds", "size", "EMPTY_PATH_DATA", "samePoint", "a", "b", "closeSubpath", "subpath", "anchors", "first", "last", "copy", "v", "contourToSubpath", "contour", "curve", "cubic", "segment", "quadToCubic", "arc", "segmentArc", "arcSweepToCubics", "d", "contours", "COORD_PRECISION", "fmt", "value", "rounded", "segmentBetween", "from", "to", "fromAnchors", "path", "parts", "closed", "i", "join", "identity", "point", "anchorCommands", "transform", "out", "emit", "end", "c1", "c2", "start", "anchorBounds", "minX", "minY", "maxX", "maxY", "seen", "includeX", "x", "includeY", "y", "anchor", "t", "cubicExtrema", "cubicAxis", "map", "fn", "endFit", "cx", "cy", "chord", "dx", "dy", "p", "tx", "ty", "re", "im", "ux", "uy", "isEmpty", "PATH_UNIT_EXTENT", "PATH_UNIT_HALF", "UNIT_PATH_BOX", "normalize", "bounds", "fitToBox", "box", "width", "height", "centerX", "centerY", "scaleX", "scaleY", "translate", "delta", "pointOn", "split", "left", "right", "splitCubicAt", "SAMPLE_STEPS", "flatten", "segment", "points", "i", "segmentPointAt", "measureSegment", "cumulative", "total", "distance", "measureContours", "contours", "contour", "metrics", "contourSegments", "length", "sum", "m", "paramAtDist", "metric", "d", "lo", "hi", "mid", "span", "within", "steps", "sampler", "contourMetric", "first", "segmentMetric", "cursor", "target", "b", "segStart", "segLen", "t", "dx", "dy", "segDist", "tx", "ty", "contourPoints", "dashSubpath", "scaledDash", "offset", "closed", "cycle", "a", "sliver", "tolerance", "into", "dashIndex", "passed", "parts", "remaining", "isOn", "needMove", "last", "p0", "p1", "walked", "available", "endT", "endX", "endY", "startT", "reach", "point", "x", "y", "dashScale", "pattern", "lastGap", "dash", "runs", "scale", "run", "value", "trim", "start", "end", "s", "e", "startDist", "endDist", "result", "accumulated", "needsMove", "metricEntry", "segEnd", "t0", "t1", "p", "segmentSplit", "cubics", "d", "out", "contour", "contours", "chain", "contourSegments", "segmentCubics", "c", "startPoint", "cubicLength", "steps", "len", "prev", "i", "p", "cubicPoint", "distance", "centroid", "x", "y", "splitCubic", "t", "a", "lerpVector2", "b", "e", "f", "g", "subdivideTo", "target", "work", "longest", "maxLen", "left", "right", "reverseCubics", "rotateCubics", "offset", "anchorCost", "cost", "dx", "dy", "alignClosedRing", "from", "to", "n", "best", "bestCost", "candidate", "rotated", "alignOpenSubpath", "reversed", "degenerateSubpath", "at", "count", "pairSubpaths", "fromSubs", "toSubs", "pairs", "toUsed", "fc", "bestIdx", "bestDist", "j", "tc", "plan", "seed", "fromCubics", "toCubics", "bothClosed", "lerpCubic", "sample", "pair", "first", "cachedPlan", "planFor", "built", "commands", "lerp", "pathOps", "value", "lerp", "commands", "contours", "cubics", "anchors", "bounds", "size", "length", "sampler", "trim", "dash", "dashScale", "plan", "sample", "fromAnchors", "anchorCommands", "anchorBounds", "map", "translate", "endFit", "isEmpty", "normalize", "fitToBox", "pointOn", "split", "NAMED_POLYGONS", "STAR_DEFAULT_RATIO", "STAR_DEFAULT_POINTS", "shapeOutlinePixels", "kind", "options", "width", "height", "rectOutline", "ellipseOutline", "polygonOutline", "regularVertices", "sidesOf", "starVertices", "clamp01", "fillBox", "named", "shapeOutline", "pixels", "pathOps", "p", "hasShapeOutline", "OUTLINE_KINDS", "corner", "point", "fallback", "value", "sides", "turn", "rx", "ry", "step", "out", "i", "a", "points", "ratio", "k", "minX", "minY", "maxX", "maxY", "spanX", "spanY", "kx", "ky", "cx", "cy", "arcHandleRatio", "sweep", "half", "radius", "uniformRadius", "style", "anchors", "c", "prev", "next", "toPrev", "direction", "toNext", "cosine", "interior", "tangent", "distance", "b", "from", "to", "dx", "dy", "len", "radii", "perCornerRadii", "x", "y", "push", "at", "incoming", "outgoing", "r", "right", "down", "left", "up", "raw", "cap", "inner", "full", "arcAnchors", "outer", "back", "whole", "total", "steps", "alpha", "offset", "last", "fallbackFamily", "setHostTextFamily", "family", "hostTextFamily", "resolveColor3D", "value", "parseColor", "lerpColor3D", "from", "to", "t", "lerpFinite", "lerpCount", "snapValue", "snapFlag", "cameraOrbit", "orbit", "orbitPosition", "elevation", "distance", "orbitRad", "elevationRad", "horizontal", "orbitProps", "target", "props"]
7
+ }