@motionscript/math 0.0.0-stage → 0.1.0-alpha.4

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 (322) hide show
  1. package/CHANGELOG.md +92 -0
  2. package/LICENSE +201 -0
  3. package/NOTICE +48 -0
  4. package/README.md +385 -3
  5. package/dist/annotate/angle-mark.d.ts +46 -0
  6. package/dist/annotate/angle-mark.d.ts.map +1 -0
  7. package/dist/annotate/angle-mark.js +132 -0
  8. package/dist/annotate/angle-mark.js.map +1 -0
  9. package/dist/annotate/curly-brace.d.ts +46 -0
  10. package/dist/annotate/curly-brace.d.ts.map +1 -0
  11. package/dist/annotate/curly-brace.js +114 -0
  12. package/dist/annotate/curly-brace.js.map +1 -0
  13. package/dist/annotate/emphasis-mark.d.ts +20 -0
  14. package/dist/annotate/emphasis-mark.d.ts.map +1 -0
  15. package/dist/annotate/emphasis-mark.js +81 -0
  16. package/dist/annotate/emphasis-mark.js.map +1 -0
  17. package/dist/browser/THIRD_PARTY_LICENSES.txt +420 -0
  18. package/dist/browser/chunks/chunk-3GJB6AVO.js +2 -0
  19. package/dist/browser/chunks/chunk-3GJB6AVO.js.map +7 -0
  20. package/dist/browser/chunks/chunk-D5WHCVBC.js +2 -0
  21. package/dist/browser/chunks/chunk-D5WHCVBC.js.map +7 -0
  22. package/dist/browser/chunks/chunk-WL4KEX7Y.js +2 -0
  23. package/dist/browser/chunks/chunk-WL4KEX7Y.js.map +7 -0
  24. package/dist/browser/chunks/mathjax-DNP3YRES.js +61 -0
  25. package/dist/browser/chunks/mathjax-DNP3YRES.js.map +7 -0
  26. package/dist/browser/index.js +2 -0
  27. package/dist/browser/index.js.map +7 -0
  28. package/dist/browser/kit.js +2 -0
  29. package/dist/browser/kit.js.map +7 -0
  30. package/dist/browser/manifest.json +30 -0
  31. package/dist/browser/tex.js +2 -0
  32. package/dist/browser/tex.js.map +7 -0
  33. package/dist/engine.d.ts +64 -0
  34. package/dist/engine.d.ts.map +1 -0
  35. package/dist/engine.js +42 -0
  36. package/dist/engine.js.map +1 -0
  37. package/dist/index.d.ts +30 -0
  38. package/dist/index.d.ts.map +1 -0
  39. package/dist/index.js +30 -0
  40. package/dist/index.js.map +1 -0
  41. package/dist/kit/brace.d.ts +8 -0
  42. package/dist/kit/brace.d.ts.map +1 -0
  43. package/dist/kit/brace.js +36 -0
  44. package/dist/kit/brace.js.map +1 -0
  45. package/dist/kit/cache.d.ts +30 -0
  46. package/dist/kit/cache.d.ts.map +1 -0
  47. package/dist/kit/cache.js +53 -0
  48. package/dist/kit/cache.js.map +1 -0
  49. package/dist/kit/contour.d.ts +8 -0
  50. package/dist/kit/contour.d.ts.map +1 -0
  51. package/dist/kit/contour.js +93 -0
  52. package/dist/kit/contour.js.map +1 -0
  53. package/dist/kit/coords.d.ts +69 -0
  54. package/dist/kit/coords.d.ts.map +1 -0
  55. package/dist/kit/coords.js +224 -0
  56. package/dist/kit/coords.js.map +1 -0
  57. package/dist/kit/curve.d.ts +17 -0
  58. package/dist/kit/curve.d.ts.map +1 -0
  59. package/dist/kit/curve.js +22 -0
  60. package/dist/kit/curve.js.map +1 -0
  61. package/dist/kit/equation.d.ts +61 -0
  62. package/dist/kit/equation.d.ts.map +1 -0
  63. package/dist/kit/equation.js +168 -0
  64. package/dist/kit/equation.js.map +1 -0
  65. package/dist/kit/equation3d.d.ts +50 -0
  66. package/dist/kit/equation3d.d.ts.map +1 -0
  67. package/dist/kit/equation3d.js +103 -0
  68. package/dist/kit/equation3d.js.map +1 -0
  69. package/dist/kit/expression.d.ts +35 -0
  70. package/dist/kit/expression.d.ts.map +1 -0
  71. package/dist/kit/expression.js +124 -0
  72. package/dist/kit/expression.js.map +1 -0
  73. package/dist/kit/field-mark.d.ts +58 -0
  74. package/dist/kit/field-mark.d.ts.map +1 -0
  75. package/dist/kit/field-mark.js +129 -0
  76. package/dist/kit/field-mark.js.map +1 -0
  77. package/dist/kit/field.d.ts +14 -0
  78. package/dist/kit/field.d.ts.map +1 -0
  79. package/dist/kit/field.js +46 -0
  80. package/dist/kit/field.js.map +1 -0
  81. package/dist/kit/follow.d.ts +71 -0
  82. package/dist/kit/follow.d.ts.map +1 -0
  83. package/dist/kit/follow.js +159 -0
  84. package/dist/kit/follow.js.map +1 -0
  85. package/dist/kit/furniture.d.ts +30 -0
  86. package/dist/kit/furniture.d.ts.map +1 -0
  87. package/dist/kit/furniture.js +87 -0
  88. package/dist/kit/furniture.js.map +1 -0
  89. package/dist/kit/geometry.d.ts +13 -0
  90. package/dist/kit/geometry.d.ts.map +1 -0
  91. package/dist/kit/geometry.js +54 -0
  92. package/dist/kit/geometry.js.map +1 -0
  93. package/dist/kit/mark.d.ts +47 -0
  94. package/dist/kit/mark.d.ts.map +1 -0
  95. package/dist/kit/mark.js +103 -0
  96. package/dist/kit/mark.js.map +1 -0
  97. package/dist/kit/part-fills.d.ts +23 -0
  98. package/dist/kit/part-fills.d.ts.map +1 -0
  99. package/dist/kit/part-fills.js +46 -0
  100. package/dist/kit/part-fills.js.map +1 -0
  101. package/dist/kit/place.d.ts +18 -0
  102. package/dist/kit/place.d.ts.map +1 -0
  103. package/dist/kit/place.js +68 -0
  104. package/dist/kit/place.js.map +1 -0
  105. package/dist/kit/placement.d.ts +8 -0
  106. package/dist/kit/placement.d.ts.map +1 -0
  107. package/dist/kit/placement.js +8 -0
  108. package/dist/kit/placement.js.map +1 -0
  109. package/dist/kit/sampler.d.ts +17 -0
  110. package/dist/kit/sampler.d.ts.map +1 -0
  111. package/dist/kit/sampler.js +250 -0
  112. package/dist/kit/sampler.js.map +1 -0
  113. package/dist/kit/scale.d.ts +12 -0
  114. package/dist/kit/scale.d.ts.map +1 -0
  115. package/dist/kit/scale.js +37 -0
  116. package/dist/kit/scale.js.map +1 -0
  117. package/dist/kit/source.d.ts +22 -0
  118. package/dist/kit/source.d.ts.map +1 -0
  119. package/dist/kit/source.js +45 -0
  120. package/dist/kit/source.js.map +1 -0
  121. package/dist/kit/system.d.ts +33 -0
  122. package/dist/kit/system.d.ts.map +1 -0
  123. package/dist/kit/system.js +67 -0
  124. package/dist/kit/system.js.map +1 -0
  125. package/dist/kit/ticks.d.ts +19 -0
  126. package/dist/kit/ticks.d.ts.map +1 -0
  127. package/dist/kit/ticks.js +78 -0
  128. package/dist/kit/ticks.js.map +1 -0
  129. package/dist/kit/withdrawn.d.ts +9 -0
  130. package/dist/kit/withdrawn.d.ts.map +1 -0
  131. package/dist/kit/withdrawn.js +9 -0
  132. package/dist/kit/withdrawn.js.map +1 -0
  133. package/dist/marks/curve-area.d.ts +32 -0
  134. package/dist/marks/curve-area.d.ts.map +1 -0
  135. package/dist/marks/curve-area.js +82 -0
  136. package/dist/marks/curve-area.js.map +1 -0
  137. package/dist/marks/drop-lines.d.ts +22 -0
  138. package/dist/marks/drop-lines.d.ts.map +1 -0
  139. package/dist/marks/drop-lines.js +58 -0
  140. package/dist/marks/drop-lines.js.map +1 -0
  141. package/dist/marks/plot-point.d.ts +35 -0
  142. package/dist/marks/plot-point.d.ts.map +1 -0
  143. package/dist/marks/plot-point.js +97 -0
  144. package/dist/marks/plot-point.js.map +1 -0
  145. package/dist/marks/riemann-sum.d.ts +37 -0
  146. package/dist/marks/riemann-sum.d.ts.map +1 -0
  147. package/dist/marks/riemann-sum.js +91 -0
  148. package/dist/marks/riemann-sum.js.map +1 -0
  149. package/dist/marks/tangent-line.d.ts +27 -0
  150. package/dist/marks/tangent-line.d.ts.map +1 -0
  151. package/dist/marks/tangent-line.js +103 -0
  152. package/dist/marks/tangent-line.js.map +1 -0
  153. package/dist/marks/vector-arrow.d.ts +32 -0
  154. package/dist/marks/vector-arrow.d.ts.map +1 -0
  155. package/dist/marks/vector-arrow.js +87 -0
  156. package/dist/marks/vector-arrow.js.map +1 -0
  157. package/dist/nodes.d.ts +35 -0
  158. package/dist/nodes.d.ts.map +1 -0
  159. package/dist/nodes.js +63 -0
  160. package/dist/nodes.js.map +1 -0
  161. package/dist/plots/function-plot.d.ts +67 -0
  162. package/dist/plots/function-plot.d.ts.map +1 -0
  163. package/dist/plots/function-plot.js +215 -0
  164. package/dist/plots/function-plot.js.map +1 -0
  165. package/dist/plots/points-plot.d.ts +28 -0
  166. package/dist/plots/points-plot.d.ts.map +1 -0
  167. package/dist/plots/points-plot.js +99 -0
  168. package/dist/plots/points-plot.js.map +1 -0
  169. package/dist/plots/stream-lines.d.ts +35 -0
  170. package/dist/plots/stream-lines.d.ts.map +1 -0
  171. package/dist/plots/stream-lines.js +141 -0
  172. package/dist/plots/stream-lines.js.map +1 -0
  173. package/dist/plots/traced-path.d.ts +31 -0
  174. package/dist/plots/traced-path.d.ts.map +1 -0
  175. package/dist/plots/traced-path.js +56 -0
  176. package/dist/plots/traced-path.js.map +1 -0
  177. package/dist/plots/vector-field.d.ts +23 -0
  178. package/dist/plots/vector-field.d.ts.map +1 -0
  179. package/dist/plots/vector-field.js +91 -0
  180. package/dist/plots/vector-field.js.map +1 -0
  181. package/dist/structures/graph-layout.d.ts +11 -0
  182. package/dist/structures/graph-layout.d.ts.map +1 -0
  183. package/dist/structures/graph-layout.js +135 -0
  184. package/dist/structures/graph-layout.js.map +1 -0
  185. package/dist/structures/network-graph.d.ts +83 -0
  186. package/dist/structures/network-graph.d.ts.map +1 -0
  187. package/dist/structures/network-graph.js +289 -0
  188. package/dist/structures/network-graph.js.map +1 -0
  189. package/dist/structures/sample-space.d.ts +62 -0
  190. package/dist/structures/sample-space.d.ts.map +1 -0
  191. package/dist/structures/sample-space.js +199 -0
  192. package/dist/structures/sample-space.js.map +1 -0
  193. package/dist/systems/axes2d.d.ts +75 -0
  194. package/dist/systems/axes2d.d.ts.map +1 -0
  195. package/dist/systems/axes2d.js +193 -0
  196. package/dist/systems/axes2d.js.map +1 -0
  197. package/dist/systems/number-line.d.ts +49 -0
  198. package/dist/systems/number-line.d.ts.map +1 -0
  199. package/dist/systems/number-line.js +127 -0
  200. package/dist/systems/number-line.js.map +1 -0
  201. package/dist/systems/number-plane.d.ts +59 -0
  202. package/dist/systems/number-plane.d.ts.map +1 -0
  203. package/dist/systems/number-plane.js +193 -0
  204. package/dist/systems/number-plane.js.map +1 -0
  205. package/dist/systems/polar-plane.d.ts +48 -0
  206. package/dist/systems/polar-plane.d.ts.map +1 -0
  207. package/dist/systems/polar-plane.js +165 -0
  208. package/dist/systems/polar-plane.js.map +1 -0
  209. package/dist/tex/geometry.d.ts +85 -0
  210. package/dist/tex/geometry.d.ts.map +1 -0
  211. package/dist/tex/geometry.js +632 -0
  212. package/dist/tex/geometry.js.map +1 -0
  213. package/dist/tex/index.d.ts +11 -0
  214. package/dist/tex/index.d.ts.map +1 -0
  215. package/dist/tex/index.js +9 -0
  216. package/dist/tex/index.js.map +1 -0
  217. package/dist/tex/mathjax.d.ts +33 -0
  218. package/dist/tex/mathjax.d.ts.map +1 -0
  219. package/dist/tex/mathjax.js +74 -0
  220. package/dist/tex/mathjax.js.map +1 -0
  221. package/dist/tex/matrix.d.ts +31 -0
  222. package/dist/tex/matrix.d.ts.map +1 -0
  223. package/dist/tex/matrix.js +73 -0
  224. package/dist/tex/matrix.js.map +1 -0
  225. package/dist/tex/node.d.ts +215 -0
  226. package/dist/tex/node.d.ts.map +1 -0
  227. package/dist/tex/node.js +595 -0
  228. package/dist/tex/node.js.map +1 -0
  229. package/dist/tex/tween.d.ts +50 -0
  230. package/dist/tex/tween.d.ts.map +1 -0
  231. package/dist/tex/tween.js +253 -0
  232. package/dist/tex/tween.js.map +1 -0
  233. package/dist/three/axes3d.d.ts +87 -0
  234. package/dist/three/axes3d.d.ts.map +1 -0
  235. package/dist/three/axes3d.js +228 -0
  236. package/dist/three/axes3d.js.map +1 -0
  237. package/dist/three/curve-plot3d.d.ts +60 -0
  238. package/dist/three/curve-plot3d.d.ts.map +1 -0
  239. package/dist/three/curve-plot3d.js +143 -0
  240. package/dist/three/curve-plot3d.js.map +1 -0
  241. package/dist/three/label3d.d.ts +11 -0
  242. package/dist/three/label3d.d.ts.map +1 -0
  243. package/dist/three/label3d.js +40 -0
  244. package/dist/three/label3d.js.map +1 -0
  245. package/dist/three/plot-point3d.d.ts +26 -0
  246. package/dist/three/plot-point3d.d.ts.map +1 -0
  247. package/dist/three/plot-point3d.js +60 -0
  248. package/dist/three/plot-point3d.js.map +1 -0
  249. package/dist/three/space.d.ts +28 -0
  250. package/dist/three/space.d.ts.map +1 -0
  251. package/dist/three/space.js +47 -0
  252. package/dist/three/space.js.map +1 -0
  253. package/dist/three/surface-plot3d.d.ts +80 -0
  254. package/dist/three/surface-plot3d.d.ts.map +1 -0
  255. package/dist/three/surface-plot3d.js +290 -0
  256. package/dist/three/surface-plot3d.js.map +1 -0
  257. package/dist/three/vector-arrow3d.d.ts +25 -0
  258. package/dist/three/vector-arrow3d.d.ts.map +1 -0
  259. package/dist/three/vector-arrow3d.js +72 -0
  260. package/dist/three/vector-arrow3d.js.map +1 -0
  261. package/package.json +79 -3
  262. package/registry.json +251 -0
  263. package/src/annotate/angle-mark.ts +147 -0
  264. package/src/annotate/curly-brace.ts +126 -0
  265. package/src/annotate/emphasis-mark.ts +89 -0
  266. package/src/engine.ts +72 -0
  267. package/src/index.ts +29 -0
  268. package/src/kit/brace.ts +37 -0
  269. package/src/kit/cache.ts +61 -0
  270. package/src/kit/contour.ts +94 -0
  271. package/src/kit/coords.ts +278 -0
  272. package/src/kit/curve.ts +29 -0
  273. package/src/kit/equation.ts +181 -0
  274. package/src/kit/equation3d.ts +137 -0
  275. package/src/kit/expression.ts +159 -0
  276. package/src/kit/field-mark.ts +155 -0
  277. package/src/kit/field.ts +50 -0
  278. package/src/kit/follow.ts +203 -0
  279. package/src/kit/furniture.ts +108 -0
  280. package/src/kit/geometry.ts +49 -0
  281. package/src/kit/mark.ts +131 -0
  282. package/src/kit/part-fills.ts +61 -0
  283. package/src/kit/place.ts +101 -0
  284. package/src/kit/placement.ts +8 -0
  285. package/src/kit/sampler.ts +281 -0
  286. package/src/kit/scale.ts +39 -0
  287. package/src/kit/source.ts +57 -0
  288. package/src/kit/system.ts +99 -0
  289. package/src/kit/ticks.ts +85 -0
  290. package/src/kit/withdrawn.ts +8 -0
  291. package/src/marks/curve-area.ts +89 -0
  292. package/src/marks/drop-lines.ts +63 -0
  293. package/src/marks/plot-point.ts +107 -0
  294. package/src/marks/riemann-sum.ts +98 -0
  295. package/src/marks/tangent-line.ts +103 -0
  296. package/src/marks/vector-arrow.ts +98 -0
  297. package/src/nodes.ts +63 -0
  298. package/src/plots/function-plot.ts +236 -0
  299. package/src/plots/points-plot.ts +107 -0
  300. package/src/plots/stream-lines.ts +151 -0
  301. package/src/plots/traced-path.ts +52 -0
  302. package/src/plots/vector-field.ts +88 -0
  303. package/src/structures/graph-layout.ts +145 -0
  304. package/src/structures/network-graph.ts +308 -0
  305. package/src/structures/sample-space.ts +209 -0
  306. package/src/systems/axes2d.ts +217 -0
  307. package/src/systems/number-line.ts +131 -0
  308. package/src/systems/number-plane.ts +203 -0
  309. package/src/systems/polar-plane.ts +176 -0
  310. package/src/tex/geometry.ts +703 -0
  311. package/src/tex/index.ts +14 -0
  312. package/src/tex/mathjax.ts +82 -0
  313. package/src/tex/matrix.ts +75 -0
  314. package/src/tex/node.ts +641 -0
  315. package/src/tex/tween.ts +308 -0
  316. package/src/three/axes3d.ts +240 -0
  317. package/src/three/curve-plot3d.ts +147 -0
  318. package/src/three/label3d.ts +50 -0
  319. package/src/three/plot-point3d.ts +66 -0
  320. package/src/three/space.ts +67 -0
  321. package/src/three/surface-plot3d.ts +323 -0
  322. package/src/three/vector-arrow3d.ts +77 -0
@@ -0,0 +1,2 @@
1
+ import{$ as G,A as Be,Aa as Re,B as Ue,Ba as so,C as lt,Ca as lo,D as pt,Da as En,E as Qt,Ea as se,F as vn,Fa as po,G as wn,Ga as fo,H as Mn,I as _n,J as Pn,K as Sn,L as Rn,M as On,N as kn,O as Je,P as Qe,Q as zn,R as jt,S as Ct,T as Yt,U as Tn,V as Zt,W as Xt,X as Pe,Y as An,Z as Y,_ as Ln,a as Ke,aa as te,b as dn,ba as ee,c as Ut,ca as Ze,d as un,da as Q,e as hn,ea as to,f as We,fa as Fn,g as Ye,ga as oe,h as Xe,ha as dt,i as qe,ia as re,j as Me,ja as qt,k as _e,ka as ie,l as mn,la as ne,m as yn,ma as Vt,n as xn,na as eo,o as k,oa as Mt,p as v,pa as oo,q as gn,qa as jn,r as bn,ra as ae,s as Jt,sa as Se,t as Ft,ta as ro,u as ct,ua as io,v as K,va as Cn,w as T,wa as Dn,x as Ve,xa as Nn,y as st,ya as no,z as I,za as ao}from"./chunks/chunk-3GJB6AVO.js";import{a as cn,b as He}from"./chunks/chunk-D5WHCVBC.js";import{a as Zi,b as tn,c as en,d as on,e as rn,f as nn,g as an,h as sn,i as ln,j as pn,k as fn,l as Ne,m as Ee,n as Ie,o as we,p as nt,q as Ge,r as at,s as $e}from"./chunks/chunk-WL4KEX7Y.js";import{colorProperty as Do,command as No,Graphics2D as co,node as Eo,property as Z,strokeProperty as Io}from"@motionscript/sdk";var j=function(s,t,e,r){var i=arguments.length,o=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,e):r,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,t,e,r);else for(var a=s.length-1;a>=0;a--)(n=s[a])&&(o=(i<3?n(o):i>3?n(t,e,o):n(t,e))||o);return i>3&&o&&Object.defineProperty(t,e,o),o},A=class extends Jt{constructor(t){super(t??{})}rangeTo(t){return this.to({data:v(t.data),duration:t.duration,easing:t.easing})}declareAssets(t){super.declareAssets(t),this.fontFamily!==""&&t.font(this.fontFamily)}mapFor(t){return Ut({xRange:Ke(this.range,this.scaling),yRange:[t.minY,t.maxY],area:t,xScaling:this.scaling})}furniture(t){let e=this.stroke,{start:r,end:i}=this,[o,n]=t.xRange,a=t.toPoint(o,0),p=t.toPoint(n,0),l=[];e.length>0&&l.push(new co().line({points:[a,p],radius:0,start:r,end:i}).stroke(e));let c=Ft(t.xRange,this.step,p.x-a.x,this.scaling),f=this.labelSide==="below"?-1:1,u=new co,d=[],m=!1;for(let g of c.values){let h=t.toPoint(g,0);if(!Be(Ue(h,a,p),r,i))continue;let b=this.longTicks.includes(g)?this.tickSize:this.tickSize/2;this.ticks&&b>0&&(u.line({points:[{x:h.x,y:h.y-b},{x:h.x,y:h.y+b}],radius:0}),m=!0),this.labels&&!this.labelExclude.includes(g)&&d.push({text:ct(g,c.step),at:{x:h.x,y:h.y+f*(this.tickSize/2+this.labelSize*.9)},align:"center"})}return m&&e.length>0&&l.push(u.stroke(Ve(e))),l.push(...I(d,{fontSize:this.labelSize,fontFamily:this.fontFamily,color:this.labelColor})),l}};j([Z({default:[-5,5],mapper:pt,tween:lt})],A.prototype,"range",void 0);j([Z({default:0,min:0})],A.prototype,"step",void 0);j([Z({default:"linear",options:["linear","log"],animatable:!1})],A.prototype,"scaling",void 0);j([Z({default:!0,animatable:!1})],A.prototype,"ticks",void 0);j([Z({default:12,min:0,unit:"px"})],A.prototype,"tickSize",void 0);j([Z({default:[],animatable:!1})],A.prototype,"longTicks",void 0);j([Z({default:!0,animatable:!1})],A.prototype,"labels",void 0);j([Z({default:[],animatable:!1})],A.prototype,"labelExclude",void 0);j([Z({default:"below",options:["below","above"],animatable:!1})],A.prototype,"labelSide",void 0);j([Z({default:18,min:1,unit:"px"})],A.prototype,"labelSize",void 0);j([Do({default:K})],A.prototype,"labelColor",void 0);j([Z({default:"",animatable:!1})],A.prototype,"fontFamily",void 0);j([Io({default:{weight:2,fill:K,align:"center"}})],A.prototype,"stroke",void 0);j([No({args:["range"]})],A.prototype,"rangeTo",null);A=j([Eo({key:"numberLine",parentKey:"node",forkable:!0,layout:{children:"freeform",defaultWidthMode:"fixed",defaultHeightMode:"fixed",acceptsChildren:!0},seed:{width:800,height:120}})],A);import{command as mo,Graphics2D as Go,node as $o,property as Dt,strokeProperty as Oe}from"@motionscript/sdk";var X=function(s,t,e,r){var i=arguments.length,o=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,e):r,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,t,e,r);else for(var a=s.length-1;a>=0;a--)(n=s[a])&&(o=(i<3?n(o):i>3?n(t,e,o):n(t,e))||o);return i>3&&o&&Object.defineProperty(t,e,o),o},C=class extends Qt{constructor(t){super(t??{}),t?.clip===void 0&&this.applyProp("clip",()=>this.coordinates.spills===!0)}transformTo(t){return this.to({data:v(t.data),duration:t.duration,easing:t.easing})}warpTo(t){return this.to({data:v(t.data),duration:t.duration,easing:t.easing})}mapFor(t){let e=super.mapFor(t);this._flat=e;let r=Xe(this.matrix)?e:qe(e,this.matrix),{source:i,blend:o}=this.warp,n=ho(i);if(!o)return n?Me(r,n,i):r;let a=ho(o.from);if(!a&&!n)return r;let p={x:0,y:0};return Me(r,(l,c,f)=>!(a??uo)(l,c,p)||!(n??uo)(l,c,f)?!1:(f.x=p.x+(f.x-p.x)*o.t,f.y=p.y+(f.y-p.y)*o.t,!0),`${o.from}>${i}@${o.t}`)}backdrop(t,e,r){if(!this.grid)return[];let i=[],o=this._flat;if(this.ghost&&o&&o.revision!==t.revision){let[n,a]=this.axes(o);i.push(...this._ruled(o,n,a,!0))}return i.push(...this._ruled(t,e,r,!1)),i}_flat=null;_ruled(t,e,r,i){let{start:o,end:n}=this,[a,p]=t.xRange,[l,c]=t.yRange,f=(h,b)=>{let y=new Go;for(let x of h)y.line({points:b?_e(t,x,l,x,c):_e(t,a,x,p,x),radius:0,start:o,end:n});return y},u=[],d=this.minorStroke;if(i)return d.length===0||(e.marks.values.length>0&&u.push(f(e.marks.values,!0).stroke(d)),r.marks.values.length>0&&u.push(f(r.marks.values,!1).stroke(d))),u;let m=Math.round(this.minorDivisions);if(d.length>0&&m>1){let h=(x,[M,P])=>{let{step:w,values:O}=x.marks;if(!(w>0)||O.length===0)return[];let rt=[];for(let it=O[0]-w;it<P;it+=w)for(let Lt=1;Lt<m;Lt++){let ve=it+w*Lt/m;ve>M&&ve<P&&rt.push(ve)}return rt},b=h(e,t.xRange),y=h(r,t.yRange);b.length>0&&u.push(f(b,!0).stroke(d)),y.length>0&&u.push(f(y,!1).stroke(d))}let g=this.gridStroke;return g.length>0&&(e.marks.values.length>0&&u.push(f(e.marks.values,!0).stroke(g)),r.marks.values.length>0&&u.push(f(r.marks.values,!1).stroke(g))),u}};X([Dt({default:!0,animatable:!1})],C.prototype,"grid",void 0);X([Oe({default:{weight:1.5,fill:"#3b4658",align:"center"}})],C.prototype,"gridStroke",void 0);X([Oe({default:{weight:1,fill:"#232b38",align:"center"}})],C.prototype,"minorStroke",void 0);X([Dt({default:2,min:1,max:10,step:1})],C.prototype,"minorDivisions",void 0);X([Dt({default:[1,0,0,1],mapper:We,tween:Ye})],C.prototype,"matrix",void 0);X([Dt({default:"",mapper:jt,tween:Ct,kind:"fieldEquation"})],C.prototype,"warp",void 0);X([Dt({default:!0,animatable:!1})],C.prototype,"ghost",void 0);X([Dt({default:!0,animatable:!1})],C.prototype,"squareUnits",void 0);X([Oe({default:{weight:2,fill:K,align:"center"}})],C.prototype,"stroke",void 0);X([mo({args:["matrix"]})],C.prototype,"transformTo",null);X([mo({args:["warp"]})],C.prototype,"warpTo",null);C=X([$o({key:"numberPlane",parentKey:"axes2d",forkable:!0,layout:{children:"freeform",defaultWidthMode:"fixed",defaultHeightMode:"fixed",acceptsChildren:!0},seed:{width:800,height:500}})],C);var uo=(s,t,e)=>(e.x=s,e.y=t,!0);function ho(s){let t=s.trim()===""?null:Qe(s,Je(s));if(!t||t instanceof Error)return null;let{x:e,y:r}=t;return(i,o,n)=>{let a=e(i,o),p=r(i,o);return n.x=a,n.y=p,Number.isFinite(a)&&Number.isFinite(p)}}import{command as Ho,node as Ko,property as ke,strokeProperty as Wo}from"@motionscript/sdk";var Nt=function(s,t,e,r){var i=arguments.length,o=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,e):r,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,t,e,r);else for(var a=s.length-1;a>=0;a--)(n=s[a])&&(o=(i<3?n(o):i>3?n(t,e,o):n(t,e))||o);return i>3&&o&&Object.defineProperty(t,e,o),o};function Yo(s,t,e){let r=Math.max(s.length,t.length);if(s.length===0||t.length===0)return e<1?s:t;let i=new Array(r);for(let o=0;o<r;o++){let n=s[Math.min(o,s.length-1)],a=t[Math.min(o,t.length-1)];i[o]={x:n.x+(a.x-n.x)*e,y:n.y+(a.y-n.y)*e}}return i}var yo=16,ut=class extends Y{constructor(t){super(t??{})}pointsTo(t){return this.to({data:v(t.data),duration:t.duration,easing:t.easing})}isClosed(){return this.closed}paintsFill(){return this.closed}trace(t){let e=this.shift(),r=this.points.map(i=>t.toPoint(i.x+e.x,i.y+e.y));return r.length<2?[]:[this.smooth&&r.length>2?Xo(r,this.closed):r]}};Nt([ke({default:[],tween:Yo})],ut.prototype,"points",void 0);Nt([ke({default:!1,animatable:!1})],ut.prototype,"closed",void 0);Nt([ke({default:!1,animatable:!1})],ut.prototype,"smooth",void 0);Nt([Wo({default:{weight:3,fill:T,align:"center",cap:"round",join:"round"}})],ut.prototype,"stroke",void 0);Nt([Ho({args:["points"]})],ut.prototype,"pointsTo",null);ut=Nt([Ko({key:"pointsPlot",within:G,parentKey:"shape",forkable:!0,layout:{children:"freeform",defaultWidthMode:"hug",defaultHeightMode:"hug",acceptsChildren:!1},seed:{points:[{x:-2,y:-1},{x:0,y:1},{x:2,y:0}]}})],ut);function Xo(s,t){let e=s.length,r=n=>t?s[(n%e+e)%e]:s[Math.max(0,Math.min(e-1,n))],i=[],o=t?e:e-1;for(let n=0;n<o;n++){let a=r(n-1),p=r(n),l=r(n+1),c=r(n+2);for(let f=0;f<yo;f++){let u=f/yo,d=u*u,m=d*u;i.push({x:.5*(2*p.x+(l.x-a.x)*u+(2*a.x-5*p.x+4*l.x-c.x)*d+(3*p.x-a.x-3*l.x+c.x)*m),y:.5*(2*p.y+(l.y-a.y)*u+(2*a.y-5*p.y+4*l.y-c.y)*d+(3*p.y-a.y-3*l.y+c.y)*m)})}}return t||i.push(s[e-1]),i}import{colorProperty as qo,fillProperty as Vo,Graphics2D as Bo,node as Uo,PaintNode as Jo,property as Et,withdraw as Qo}from"@motionscript/sdk";var ht=function(s,t,e,r){var i=arguments.length,o=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,e):r,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,t,e,r);else for(var a=s.length-1;a>=0;a--)(n=s[a])&&(o=(i<3?n(o):i>3?n(t,e,o):n(t,e))||o);return i>3&&o&&Object.defineProperty(t,e,o),o},q=class extends Jo{constructor(t){super(t??{})}get value(){return this.anchorAt(this.x,this.y).y}anchorAt(t,e){let r=Q(this,this.on)?.valueAt(t);return{x:t,y:r!==void 0&&Number.isFinite(r)?r:e}}measure(){return{width:this.radius*2,height:this.radius*2}}declareAssets(t){super.declareAssets(t),this.label!==""&&this.fontFamily!==""&&t.font(this.fontFamily),st(t,[this.label])}shapeGraphics(){let t=this.radius*2;return t>0?new Bo().ellipse({x:0,y:0,width:t,height:t}):null}renderSelf(t){if(super.renderSelf(t),this.label==="")return;let e=this.radius+this.labelSize*.45,r=this.labelSide,i=r==="left"||r==="right",o={text:this.label,align:r==="left"?"right":r==="right"?"left":"center",at:{x:i?(r==="left"?-1:1)*e:0,y:i?0:(r==="below"?-1:1)*(e+this.labelSize/2)}},n={fontSize:this.labelSize,fontFamily:this.fontFamily,color:this.labelColor};for(let a of I([o],n))t.draw(a)}};ht([Et({default:"",kind:"nodeRef",nodeTypes:["functionPlot"],animatable:!1})],q.prototype,"on",void 0);ht([Et({default:7,min:0,unit:"px"})],q.prototype,"radius",void 0);ht([Et({default:"",animatable:!1})],q.prototype,"label",void 0);ht([Et({default:"above",options:["above","below","left","right"],animatable:!1})],q.prototype,"labelSide",void 0);ht([Et({default:18,min:1,unit:"px"})],q.prototype,"labelSize",void 0);ht([qo({default:"#e5e7eb"})],q.prototype,"labelColor",void 0);ht([Et({default:"",animatable:!1})],q.prototype,"fontFamily",void 0);ht([Vo({default:"#e5e7eb"})],q.prototype,"fill",void 0);q=ht([Uo({key:"plotPoint",within:te,parentKey:"shape",forkable:!0,layout:{children:"freeform",defaultWidthMode:"hug",defaultHeightMode:"hug",acceptsChildren:!1}}),Qo(...at)],q);import{command as Zo,node as tr,property as er,strokeProperty as or,vector2Property as xo,withdraw as rr}from"@motionscript/sdk";var It=function(s,t,e,r){var i=arguments.length,o=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,e):r,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,t,e,r);else for(var a=s.length-1;a>=0;a--)(n=s[a])&&(o=(i<3?n(o):i>3?n(t,e,o):n(t,e))||o);return i>3&&o&&Object.defineProperty(t,e,o),o},ir=4,mt=class extends Y{constructor(t){super(t??{})}endpointsTo(t){return this.to({data:v(t.data),duration:t.duration,easing:t.easing})}trace(t){let e=this.shift(),r=t.toPoint(this.tail.x+e.x,this.tail.y+e.y),i=t.toPoint(this.head.x+e.x,this.head.y+e.y),o=this.bend*Math.PI/180,n=Math.hypot(i.x-r.x,i.y-r.y);if(Math.abs(o)<.001||n===0)return[[r,i]];let a=n/(2*Math.sin(Math.abs(o)/2)),p=Math.sign(o),l=a*Math.cos(o/2),c=(r.x+i.x)/2+p*(i.y-r.y)*l/n,f=(r.y+i.y)/2-p*(i.x-r.x)*l/n,u=Math.atan2(r.y-f,r.x-c),d=Math.max(8,Math.ceil(Math.abs(this.bend)/ir)),m=[];for(let g=0;g<=d;g++){let h=u-o*g/d;m.push({x:c+a*Math.cos(h),y:f+a*Math.sin(h)})}return[m]}_handles(){return[{prop:"tail",at:this.ownPoint(this.tail)},{prop:"head",at:this.ownPoint(this.head)}]}_handleValue(t,e){return t==="tail"||t==="head"?this.graphPoint(e):null}};It([xo()],mt.prototype,"tail",void 0);It([xo({default:{x:1,y:1}})],mt.prototype,"head",void 0);It([er({default:0,min:-180,max:180,unit:"\xB0"})],mt.prototype,"bend",void 0);It([or({default:{weight:4,fill:"#e5e7eb",align:"center",endCap:"triangle"}})],mt.prototype,"stroke",void 0);It([Zo({args:["tail","head"]})],mt.prototype,"endpointsTo",null);mt=It([tr({key:"vectorArrow",within:G,parentKey:"shape",forkable:!0,layout:{children:"freeform",defaultWidthMode:"hug",defaultHeightMode:"hug",acceptsChildren:!1}}),rr(...nt)],mt);import{command as nr,fillProperty as ar,node as sr,property as ze,withdraw as lr}from"@motionscript/sdk";var Gt=function(s,t,e,r){var i=arguments.length,o=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,e):r,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,t,e,r);else for(var a=s.length-1;a>=0;a--)(n=s[a])&&(o=(i<3?n(o):i>3?n(t,e,o):n(t,e))||o);return i>3&&o&&Object.defineProperty(t,e,o),o},yt=class extends Y{constructor(t){super(t??{})}domainTo(t){return this.to({data:v(t.data),duration:t.duration,easing:t.easing})}isClosed(){return!0}trace(t){let e=Q(this,this.on);if(!e)return[];let r=Ze(this,this.under),[i,o]=t.yRange,n=Math.max(this.domain[0],t.xRange[0]),a=Math.min(this.domain[1],t.xRange[1]);if(!(a>n))return[];let p=Math.abs(t.toPoint(a,0).x-t.toPoint(n,0).x),l=Math.max(8,Math.min(600,Math.round(p/2))),c=d=>Number.isFinite(d)?k(d,i,o):k(0,i,o),f=[],u=[];for(let d=0;d<=l;d++){let m=n+(a-n)*d/l;f.push(t.toPoint(m,c(e.valueAt(m)))),u.push(t.toPoint(m,c(r?r.valueAt(m):0)))}return[[...f,...u.reverse()]]}};Gt([ze({default:"",kind:"nodeRef",nodeTypes:["functionPlot"],animatable:!1})],yt.prototype,"on",void 0);Gt([ze({default:"",kind:"nodeRef",nodeTypes:["functionPlot"],animatable:!1})],yt.prototype,"under",void 0);Gt([ze({default:[0,1],mapper:pt,tween:lt})],yt.prototype,"domain",void 0);Gt([ar({default:{type:"solid",color:T,opacity:.35}})],yt.prototype,"fill",void 0);Gt([nr({args:["domain"]})],yt.prototype,"domainTo",null);yt=Gt([sr({key:"curveArea",within:G,beside:["functionPlot"],parentKey:"shape",forkable:!0,layout:{children:"freeform",defaultWidthMode:"hug",defaultHeightMode:"hug",acceptsChildren:!1}}),lr(...Ge,...at)],yt);import{command as go,fillProperty as pr,node as fr,property as le,strokeProperty as cr,withdraw as dr}from"@motionscript/sdk";var xt=function(s,t,e,r){var i=arguments.length,o=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,e):r,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,t,e,r);else for(var a=s.length-1;a>=0;a--)(n=s[a])&&(o=(i<3?n(o):i>3?n(t,e,o):n(t,e))||o);return i>3&&o&&Object.defineProperty(t,e,o),o},ur=2e3,V=class extends Y{constructor(t){super(t??{})}refineTo(t){return this.to({data:v(t.data),duration:t.duration,easing:t.easing})}domainTo(t){return this.to({data:v(t.data),duration:t.duration,easing:t.easing})}isClosed(){return!0}trace(t){let e=Q(this,this.on),[r,i]=this.domain,o=this.dx;if(!e||!(i>r)||!(o>0))return[];let[n,a]=t.yRange,p=k(0,n,a),l=this.sample==="left"?0:this.sample==="right"?1:.5,c=Math.min(ur,Math.ceil((i-r)/o-1e-9)),f=[];for(let u=0;u<c;u++){let d=r+u*o,m=Math.min(i,d+o),g=e.valueAt(d+(m-d)*l);if(!Number.isFinite(g))continue;let h=k(g,n,a);f.push([t.toPoint(d,p),t.toPoint(d,h),t.toPoint(m,h),t.toPoint(m,p)])}return f}};xt([le({default:"",kind:"nodeRef",nodeTypes:["functionPlot"],animatable:!1})],V.prototype,"on",void 0);xt([le({default:[0,1],mapper:pt,tween:lt})],V.prototype,"domain",void 0);xt([le({default:.25,min:.001})],V.prototype,"dx",void 0);xt([le({default:"left",options:["left","right","center"],animatable:!1})],V.prototype,"sample",void 0);xt([pr({default:{type:"solid",color:T,opacity:.35}})],V.prototype,"fill",void 0);xt([cr({default:{weight:1.5,fill:T,align:"center",join:"round"}})],V.prototype,"stroke",void 0);xt([go({args:["dx"]})],V.prototype,"refineTo",null);xt([go({args:["domain"]})],V.prototype,"domainTo",null);V=xt([fr({key:"riemannSum",within:G,beside:["functionPlot"],parentKey:"shape",forkable:!0,layout:{children:"freeform",defaultWidthMode:"hug",defaultHeightMode:"hug",acceptsChildren:!1}}),dr(...at)],V);import{node as hr,property as pe,strokeProperty as mr,withdraw as yr}from"@motionscript/sdk";var $t=function(s,t,e,r){var i=arguments.length,o=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,e):r,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,t,e,r);else for(var a=s.length-1;a>=0;a--)(n=s[a])&&(o=(i<3?n(o):i>3?n(t,e,o):n(t,e))||o);return i>3&&o&&Object.defineProperty(t,e,o),o},xr=1e-4,gt=class extends Y{constructor(t){super(t??{})}get slope(){let t=Q(this,this.on);return t?this.dx>0?(t.valueAt(this.x+this.dx)-t.valueAt(this.x))/this.dx:gr(t,this.x,1e-6*Math.max(1,Math.abs(this.x))):NaN}trace(t){let e=Q(this,this.on);if(!e)return[];let r=this.x,i=e.valueAt(r);if(!Number.isFinite(i))return[];let o=this.length/2;if(this.dx>0){let b=e.valueAt(r+this.dx);if(!Number.isFinite(b))return[];let y=t.toPoint(r,i),x=t.toPoint(r+this.dx,b),M=Math.hypot(x.x-y.x,x.y-y.y);if(M===0)return[];let P=Math.max(o,M/2+16),w=(x.x-y.x)/M,O=(x.y-y.y)/M,rt=(y.x+x.x)/2,it=(y.y+x.y)/2,Lt=[{x:rt-w*P,y:it-O*P},{x:rt+w*P,y:it+O*P}];return this.legs?[Lt,[y,t.toPoint(r+this.dx,i),x]]:[Lt]}let[n,a]=t.xRange,p=Number.isFinite(a-n)?(a-n)*xr:1e-4,l=e.valueAt(r-p),c=e.valueAt(r+p);if(!Number.isFinite(l)||!Number.isFinite(c))return[];let f=t.toPoint(r,i),u=t.toPoint(r-p,l),d=t.toPoint(r+p,c),m=Math.hypot(d.x-u.x,d.y-u.y);if(m===0)return[];let g=(d.x-u.x)/m,h=(d.y-u.y)/m;return[[{x:f.x-g*o,y:f.y-h*o},{x:f.x+g*o,y:f.y+h*o}]]}};$t([pe({default:"",kind:"nodeRef",nodeTypes:["functionPlot"],animatable:!1})],gt.prototype,"on",void 0);$t([pe({default:260,min:0,unit:"px"})],gt.prototype,"length",void 0);$t([pe({default:0,min:0})],gt.prototype,"dx",void 0);$t([pe({default:!1,animatable:!1})],gt.prototype,"legs",void 0);$t([mr({default:{weight:3,fill:"#f59e0b",align:"center",cap:"round",join:"round"}})],gt.prototype,"stroke",void 0);gt=$t([hr({key:"tangentLine",within:["functionPlot"],parentKey:"shape",forkable:!0,layout:{children:"freeform",defaultWidthMode:"hug",defaultHeightMode:"hug",acceptsChildren:!1}}),yr(...nt)],gt);function gr(s,t,e){return(s.valueAt(t+e)-s.valueAt(t-e))/(2*e)}import{node as br,property as bo,strokeProperty as vr,withdraw as wr}from"@motionscript/sdk";var fe=function(s,t,e,r){var i=arguments.length,o=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,e):r,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,t,e,r);else for(var a=s.length-1;a>=0;a--)(n=s[a])&&(o=(i<3?n(o):i>3?n(t,e,o):n(t,e))||o);return i>3&&o&&Object.defineProperty(t,e,o),o},St=class extends Y{constructor(t){super(t??{})}trace(t){let e=this.x,r=Q(this,this.on),i=r?r.valueAt(e):this.y;if(!Number.isFinite(i))return[];let o=t.toPoint(e,i),n=[];return this.axis!=="y"&&n.push([t.toPoint(e,k(0,t.yRange[0],t.yRange[1])),o]),this.axis!=="x"&&n.push([t.toPoint(k(0,t.xRange[0],t.xRange[1]),i),o]),n}};fe([bo({default:"",kind:"nodeRef",nodeTypes:["functionPlot"],animatable:!1})],St.prototype,"on",void 0);fe([bo({default:"both",options:["x","y","both"],animatable:!1})],St.prototype,"axis",void 0);fe([vr({default:{weight:2,fill:K,align:"center",dash:[8,6]}})],St.prototype,"stroke",void 0);St=fe([br({key:"dropLines",within:te,parentKey:"shape",forkable:!0,layout:{children:"freeform",defaultWidthMode:"hug",defaultHeightMode:"hug",acceptsChildren:!1}}),wr(...nt)],St);import{colorProperty as Mr,node as _r,property as Ht,strokeProperty as Pr,vector2Property as vo}from"@motionscript/sdk";var tt=function(s,t,e,r){var i=arguments.length,o=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,e):r,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,t,e,r);else for(var a=s.length-1;a>=0;a--)(n=s[a])&&(o=(i<3?n(o):i>3?n(t,e,o):n(t,e))||o);return i>3&&o&&Object.defineProperty(t,e,o),o},Sr={below:[2,3],above:[0,1],left:[3,0],right:[1,2]},$=class extends oe{constructor(t){super(t??{})}declareAssets(t){super.declareAssets(t),this.label!==""&&this.fontFamily!==""&&t.font(this.fontFamily),st(t,[this.label])}quad(){return this._spans()?[this.head,this.tail,this.tail,this.head]:super.quad()}_spans(){return!this.retarget&&to(this,this.on)===null}outline(t){let{from:e,to:r,out:i}=this._span(t);return ne(e,r,i,this.reach)}renderSelf(t){if(super.renderSelf(t),this.label==="")return;let e=this.quad();if(!e)return;let{from:r,to:i,out:o}=this._span(e),n=Math.min(this.reach,qt(r,i).length/2)+this.labelSize*.75,a=dt(re(r,i),o,n),p=o.x>.5?"left":o.x<-.5?"right":"center",l={fontSize:this.labelSize,fontFamily:this.fontFamily,color:this.labelColor};for(let c of I([{text:this.label,at:a,align:p}],l))t.draw(c)}_span(t){let[e,r]=this._spans()?[1,0]:Sr[this.side],{unit:i}=qt(t[e],t[r]),o={x:-i.y,y:i.x};return{from:dt(t[e],o,this.clearance),to:dt(t[r],o,this.clearance),out:o}}_handles(){return this._spans()?[{prop:"tail",at:this.tail},{prop:"head",at:this.head}]:[]}_handleValue(t,e){return this._spans()&&(t==="tail"||t==="head")?{x:e.x,y:e.y}:null}};tt([Ht({default:"below",options:["below","above","left","right"],animatable:!1})],$.prototype,"side",void 0);tt([vo({default:{x:-80,y:0}})],$.prototype,"tail",void 0);tt([vo({default:{x:80,y:0}})],$.prototype,"head",void 0);tt([Ht({default:8,min:0,unit:"px"})],$.prototype,"clearance",void 0);tt([Ht({default:18,min:2,unit:"px"})],$.prototype,"reach",void 0);tt([Ht({default:"",animatable:!1})],$.prototype,"label",void 0);tt([Ht({default:28,min:1,unit:"px"})],$.prototype,"labelSize",void 0);tt([Mr({default:"#e5e7eb"})],$.prototype,"labelColor",void 0);tt([Ht({default:"",animatable:!1})],$.prototype,"fontFamily",void 0);tt([Pr({default:{weight:3,fill:"#e5e7eb",align:"center",cap:"round",join:"round"}})],$.prototype,"stroke",void 0);$=tt([_r({key:"curlyBrace",parentKey:"shape",forkable:!0,layout:{children:"freeform",defaultWidthMode:"hug",defaultHeightMode:"hug",acceptsChildren:!1}})],$);import{colorProperty as Rr,command as Or,Graphics2D as kr,node as zr,PaintNode as Tr,pathOps as Ar,property as Rt,strokeProperty as Lr,withdraw as Fr}from"@motionscript/sdk";var et=function(s,t,e,r){var i=arguments.length,o=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,e):r,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,t,e,r);else for(var a=s.length-1;a>=0;a--)(n=s[a])&&(o=(i<3?n(o):i>3?n(t,e,o):n(t,e))||o);return i>3&&o&&Object.defineProperty(t,e,o),o},jr=[-1,-1,1,1],Cr=4,Dr=.5,ce=(s,t)=>{let e=t*Math.PI/180;return{x:s*Math.cos(e),y:s*Math.sin(e)}},H=class extends Tr{constructor(t){super(t??{})}radiusTo(t){return this.to({data:v(t.data),duration:t.duration,easing:t.easing})}get value(){return this.toAngle-this.fromAngle}declareAssets(t){super.declareAssets(t),this.label!==""&&this.fontFamily!==""&&t.font(this.fontFamily),st(t,[this.label])}measure(){return{width:0,height:0}}shapeGraphics(){let t=this._outline();return t.length===0?null:new kr().path({data:t,centerBounds:jr,start:this.start,end:this.end})}renderSelf(t){if(super.renderSelf(t),this.label===""||this.radius<=0)return;let e=this.label==="\xB0"?`${Math.round(Math.abs(this.value)*10)/10}\xB0`:this.label,r=ce(this.radius+this.labelSize*.9,(this.fromAngle+this.toAngle)/2),i={fontSize:this.labelSize,fontFamily:this.fontFamily,color:this.labelColor};for(let o of I([{text:e,at:r,align:"center"}],i))t.draw(o)}_localBounds(){let t=Ar.bounds(this._outline());return t?{x:(t.minX+t.maxX)/2,y:(t.minY+t.maxY)/2,width:t.maxX-t.minX,height:t.maxY-t.minY}:{x:0,y:0,width:0,height:0}}_outline(){let{fromAngle:t,toAngle:e,radius:r}=this,i=e-t;if(r<=0||i===0)return[];if(this.corner==="square"||this.corner==="auto"&&Math.abs(Math.abs(i)-90)<Dr){let p=r*.6,l=ce(p,t),c=ce(p,e);return[{type:"M",x:l.x,y:l.y},{type:"L",x:l.x+c.x,y:l.y+c.y},{type:"L",x:c.x,y:c.y}]}let n=Math.max(2,Math.ceil(Math.abs(i)/Cr)),a=[];for(let p=0;p<=n;p++){let l=ce(r,t+i*p/n);a.push({type:p===0?"M":"L",x:l.x,y:l.y})}return a}};et([Rt({default:0,unit:"\xB0"})],H.prototype,"fromAngle",void 0);et([Rt({default:60,unit:"\xB0"})],H.prototype,"toAngle",void 0);et([Rt({default:48,min:0,unit:"px"})],H.prototype,"radius",void 0);et([Rt({default:"auto",options:["auto","arc","square"],animatable:!1})],H.prototype,"corner",void 0);et([Rt({default:"",animatable:!1})],H.prototype,"label",void 0);et([Rt({default:24,min:1,unit:"px"})],H.prototype,"labelSize",void 0);et([Rr({default:"#e5e7eb"})],H.prototype,"labelColor",void 0);et([Rt({default:"",animatable:!1})],H.prototype,"fontFamily",void 0);et([Lr({default:{weight:3,fill:"#e5e7eb",align:"center",cap:"round",join:"round"}})],H.prototype,"stroke",void 0);et([Or({args:["radius"]})],H.prototype,"radiusTo",null);H=et([zr({key:"angleMark",parentKey:"shape",forkable:!0,layout:{children:"freeform",defaultWidthMode:"hug",defaultHeightMode:"hug",acceptsChildren:!1}}),Fr(...nt)],H);import{node as Nr,property as wo,strokeProperty as Er}from"@motionscript/sdk";var de=function(s,t,e,r){var i=arguments.length,o=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,e):r,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,t,e,r);else for(var a=s.length-1;a>=0;a--)(n=s[a])&&(o=(i<3?n(o):i>3?n(t,e,o):n(t,e))||o);return i>3&&o&&Object.defineProperty(t,e,o),o},Ir=.5523,Te=(s,t)=>[{type:"M",x:s.x,y:s.y},{type:"L",x:t.x,y:t.y}],Gr={box:(s,t)=>{let[e,r,i,o]=ie(s,t);return[{type:"M",x:e.x,y:e.y},...[r,i,o].map(n=>({type:"L",x:n.x,y:n.y})),{type:"Z"}]},circle:(s,t)=>{let[e,r,i,o]=ie(s,t),n=re(e,i),a={x:(r.x-e.x)/2*Math.SQRT2,y:(r.y-e.y)/2*Math.SQRT2},p={x:(e.x-o.x)/2*Math.SQRT2,y:(e.y-o.y)/2*Math.SQRT2},l=(d,m)=>dt(dt(n,a,d),p,m),c=(d,m,g)=>({type:"C",x1:d.x,y1:d.y,x2:m.x,y2:m.y,x:g.x,y:g.y}),f=Ir,u=l(0,1);return[{type:"M",x:u.x,y:u.y},c(l(f,1),l(1,f),l(1,0)),c(l(1,-f),l(f,-1),l(0,-1)),c(l(-f,-1),l(-1,-f),l(-1,0)),c(l(-1,f),l(-f,1),u),{type:"Z"}]},underline:(s,t)=>{let[,,e,r]=s,i=qt(s[0],r).unit;return Te(dt(r,i,t),dt(e,i,t))},cross:(s,t)=>{let[e,r,i,o]=ie(s,t);return[...Te(e,i),...Te(o,r)]}},Ot=class extends oe{constructor(t){super(t??{})}outline(t){return Gr[this.shape](t,this.clearance)}};de([wo({default:"box",options:["box","circle","underline","cross"],animatable:!1})],Ot.prototype,"shape",void 0);de([wo({default:10,unit:"px"})],Ot.prototype,"clearance",void 0);de([Er({default:{weight:3,fill:"#facc15",align:"center",cap:"round",join:"round"}})],Ot.prototype,"stroke",void 0);Ot=de([Nr({key:"emphasisMark",parentKey:"shape",forkable:!0,layout:{children:"freeform",defaultWidthMode:"hug",defaultHeightMode:"hug",acceptsChildren:!1}})],Ot);import{Canvas3D as $r,colorProperty as Fe,command as Hr,Geo as Ae,Graphics3D as Kr,Mat as Wr,node as Yr,property as z}from"@motionscript/sdk";var S=function(s,t,e,r){var i=arguments.length,o=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,e):r,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,t,e,r);else for(var a=s.length-1;a>=0;a--)(n=s[a])&&(o=(i<3?n(o):i>3?n(t,e,o):n(t,e))||o);return i>3&&o&&Object.defineProperty(t,e,o),o},Xr=64,Le={x:[90,0,0],y:[0,0,-90],z:[0,0,0]},qr={x:"y",y:"x",z:"y"},_=class extends $r{constructor(t){super(t??{})}rangeTo(t){return this.to({data:v(t.data),duration:t.duration,easing:t.easing})}declareAssets(t){super.declareAssets(t),this.fontFamily!==""&&t.font(this.fontFamily)}_spaceOf(){return this._graphSpace()}_graphSpace(){let{xRange:t,yRange:e,zRange:r,xLength:i,yLength:o,zLength:n}=this,a=[t,e,r,i,o,n].join("|");return a!==this._spaceKey&&(this._space=eo(t,e,r,{x:i,y:o,z:n}),this._spaceKey=a),this._space}buildScene3D(){let t=super.buildScene3D();return t.draw(this._furniture()),t}_space=null;_spaceKey="";_furniture(){let t=this._graphSpace(),e=new Kr,r={x:t.xRange,y:t.yRange,z:t.zRange},i={x:this.xLength,y:this.yLength,z:this.zLength},o={x:this.xStep,y:this.yStep,z:this.zStep},n={x:this.xLabel,y:this.yLabel,z:this.zLabel},a={x:k(0,r.x[0],r.x[1]),y:k(0,r.y[0],r.y[1]),z:k(0,r.z[0],r.z[1])},p=(h,b,y={})=>{let x={...a,[h]:b},M=t.toLocal(x.x,x.y,x.z),P=t.offset(0,0,0);for(let w of["x","y","z"]){let O=y[w];O!==void 0&&(w==="x"?P.z+=O:w==="y"?P.x+=O:P.y+=O)}return{x:M.x+P.x,y:M.y+P.y,z:M.z+P.z}},{thickness:l,tickSize:c}=this,f=Wr.basic({color:this.color}),u={size:this.labelSize,color:this.labelColor,fontFamily:this.fontFamily},d=this.tips?l*9:0,m=[],g=[];for(let h of["x","y","z"]){let[b,y]=r[h],x=i[h];if(!(y>b)||!(x>0))continue;if(l>0){let w=p(h,b),O=p(h,y);e.mesh(Ae.cylinder({radius:l,height:x,segments:[12,1]}),f,{position:{x:(w.x+O.x)/2,y:(w.y+O.y)/2,z:(w.z+O.z)/2},rotation:Le[h]}),this.tips&&e.mesh(Ae.cone({radius:l*3.2,height:d,segments:[16,1]}),f,{position:p(h,y,{[h]:d/2}),rotation:Le[h]})}let M=Ft(r[h],o[h],x*Xr),P=qr[h];for(let w of M.values)Math.abs(w-a[h])<1e-9||this.tips&&Math.abs(w-y)<1e-9||(this.ticks&&c>0&&m.push({position:p(h,w),rotation:Le[P]}),this.labels&&Vt(e,ct(w,M.step),p(h,w,{[P]:-(c/2+u.size*.8)}),u));if(Vt(e,n[h],p(h,y,{[h]:d+u.size*.9}),u),this.grid&&h!=="z"){let w=h==="x"?"y":"x";for(let O of M.values){let rt={x:0,y:0,z:a.z,[h]:O,[w]:r[w][0]},it={...rt,[w]:r[w][1]};g.push(t.toLocal(rt.x,rt.y,rt.z),t.toLocal(it.x,it.y,it.z))}}}return m.length>0&&e.instances(Ae.cylinder({radius:Math.max(l*.7,.008),height:c,segments:[8,1]}),f,m),g.length>0&&e.line({points:g,segments:!0,stroke:{fill:this.gridLineColor}}),e}};S([z({default:[-3,3],mapper:pt,tween:lt})],_.prototype,"xRange",void 0);S([z({default:[-3,3],mapper:pt,tween:lt})],_.prototype,"yRange",void 0);S([z({default:[-2,2],mapper:pt,tween:lt})],_.prototype,"zRange",void 0);S([z({default:6,min:.01,step:.1})],_.prototype,"xLength",void 0);S([z({default:6,min:.01,step:.1})],_.prototype,"yLength",void 0);S([z({default:4,min:.01,step:.1})],_.prototype,"zLength",void 0);S([z({default:0,min:0})],_.prototype,"xStep",void 0);S([z({default:0,min:0})],_.prototype,"yStep",void 0);S([z({default:0,min:0})],_.prototype,"zStep",void 0);S([Fe({default:K})],_.prototype,"color",void 0);S([z({default:.02,min:0,step:.005})],_.prototype,"thickness",void 0);S([z({default:!0,animatable:!1})],_.prototype,"tips",void 0);S([z({default:!0,animatable:!1})],_.prototype,"ticks",void 0);S([z({default:.16,min:0,step:.01})],_.prototype,"tickSize",void 0);S([z({default:!1,animatable:!1})],_.prototype,"grid",void 0);S([Fe({default:"#374151"})],_.prototype,"gridLineColor",void 0);S([z({default:!1,animatable:!1})],_.prototype,"labels",void 0);S([z({default:.26,min:.01,step:.01})],_.prototype,"labelSize",void 0);S([Fe({default:K})],_.prototype,"labelColor",void 0);S([z({default:"",animatable:!1})],_.prototype,"fontFamily",void 0);S([z({default:"x",animatable:!1})],_.prototype,"xLabel",void 0);S([z({default:"y",animatable:!1})],_.prototype,"yLabel",void 0);S([z({default:"z",animatable:!1})],_.prototype,"zLabel",void 0);S([Hr({args:["xRange","yRange","zRange"]})],_.prototype,"rangeTo",null);_=S([Yr({key:"axes3d",parentKey:"canvas3d",forkable:!0,layout:{defaultWidthMode:"fixed",defaultHeightMode:"fixed",acceptsChildren:!0},seed:{width:800,height:500}})],_);import{colorOps as Vr,command as je,Geo as Mo,Graphics3D as Br,Mat as Ur,Mesh3D as Jr,node as Qr,property as bt}from"@motionscript/sdk";var W=function(s,t,e,r){var i=arguments.length,o=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,e):r,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,t,e,r);else for(var a=s.length-1;a>=0;a--)(n=s[a])&&(o=(i<3?n(o):i>3?n(t,e,o):n(t,e))||o);return i>3&&o&&Object.defineProperty(t,e,o),o},F=class extends Jr{constructor(t){super(t??{}),t?.fill===void 0&&this.applyProp("fill",T)}morphTo(t){return this.to({data:v(t.data),duration:t.duration,easing:t.easing})}paramsTo(t){return this.to({data:v(t.data),duration:t.duration,easing:t.easing})}domainTo(t){return this.to({data:v(t.data),duration:t.duration,easing:t.easing})}valueAt(t,e){let{source:r,blend:i}=this.expression,o=this._heightOf(r,t,e);if(!i)return o;let n=this._heightOf(i.from,t,e);return n+(o-n)*i.t}_spaceOf(){let t=Mt(this);return t?{toLocal:(e,r,i)=>{let o=this.valueAt(e,r);return t.offset(e,r,Number.isFinite(o)?o:i)}}:null}buildGeometry(){let t=Mt(this),e=t&&this._sampler(t);if(!t||!e)return;let r=this.colorScale,i={x:0,y:0,z:0},o=t.offset(0,0,t.zRange[0]-this.z).y,n=t.offset(0,0,t.zRange[1]-this.z).y;return Mo.parametric({segments:Math.max(2,Math.round(this.segments)),vertex:(a,p)=>(e(a,p,i),t.offset(i.x,i.y,i.z)),...r.length>0?{color:(a,p,l)=>Re(r,n>o?(l.y-o)/(n-o):0)}:{},computeNormals:!0,revision:Pe(`${this._key(t)}|${JSON.stringify(r)}`)})}materialShorthand(){let t=super.materialShorthand(),e=this.colorScale.length>0;return{faces:"both",...t,...e?{vertexColors:!0,fill:"white"}:{}}}buildGraphics3D(){let t=new Br,e=Mt(this),r=e?this._meshLines(e):[];for(let o of super.buildGraphics3D().ops())o.kind==="mesh"&&t.mesh(o.geometry,Zr(o.material,n=>({...n,...r.length>0?{polygonOffset:!0,polygonOffsetFactor:1,polygonOffsetUnits:1}:{},...(this.opacity??1)<1?{depthWrite:!1}:{}})),o.transform);if(r.length>0){let o=Vr.resolve(this.meshColor);t.line({points:r,segments:!0,stroke:{fill:o},opacity:o[3]*(this.opacity??1)})}let i=e&&this.floorShadow>0?this._floorShadow(e):void 0;if(i){let o=this.colorScale.length>0;t.mesh(i,Ur.basic({color:o?"white":T,vertexColors:o,opacity:this.floorShadow*(this.opacity??1),transparent:!0,depthWrite:!1,faces:"both"}))}return t}_linesKey="";_lines=[];_heightOf(t,e,r){let i=_o(t);return i?.kind!=="height"?NaN:i.f(e,r,Xt(ae(t),this.params))}_key(t){let{source:e,blend:r}=this.expression;return[e,r?.from,r?.t,t.revision,this.uDomain,this.vDomain,JSON.stringify(this.params),this.x,this.y,this.z].join("|")}_sampler(t){let{source:e,blend:r}=this.expression,i=this._surface(e,t);if(!i||!r)return i;let o=this._surface(r.from,t);if(!o)return i;let n={x:0,y:0,z:0};return(a,p,l)=>{o(a,p,n),i(a,p,l),l.x=n.x+(l.x-n.x)*r.t,l.y=n.y+(l.y-n.y)*r.t,l.z=n.z+(l.z-n.z)*r.t}}_surface(t,e){let r=_o(t);if(!r)return null;let i=Xt(ae(t),this.params);if(r.kind==="parametric"){let[u,d]=this.uDomain??[0,1],[m,g]=this.vDomain??[0,1],{x:h,y:b,z:y}=r;return(x,M,P)=>{let w=u+(d-u)*x,O=m+(g-m)*M;P.x=ue(h(w,O,i)),P.y=ue(b(w,O,i)),P.z=ue(y(w,O,i))}}let[o,n]=this.uDomain??[e.xRange[0]-this.x,e.xRange[1]-this.x],[a,p]=this.vDomain??[e.yRange[0]-this.y,e.yRange[1]-this.y],l=e.zRange[0]-this.z,c=e.zRange[1]-this.z,{f}=r;return(u,d,m)=>{m.x=o+(n-o)*u,m.y=a+(p-a)*d,m.z=k(ue(f(m.x,m.y,i)),l,c)}}_floorShadow(t){let e=this._sampler(t);if(!e)return;let r=this.colorScale,[i,o]=t.zRange,n=i-this.z,a={x:0,y:0,z:0};return Mo.parametric({segments:Math.max(2,Math.round(this.segments)),vertex:(p,l)=>(e(p,l,a),t.offset(a.x,a.y,n)),...r.length>0?{color:(p,l)=>(e(p,l,a),Re(r,o>i?(a.z+this.z-i)/(o-i):0))}:{},revision:Pe(`${this._key(t)}|${JSON.stringify(r)}|floor`)})}_meshLines(t){let e=Math.round(this.meshLines),r=e>0?this._sampler(t):null;if(!r)return[];let i=Math.max(2,Math.round(this.segments)),o=`${this._key(t)}|${e}|${i}`;if(o===this._linesKey)return this._lines;let n=[],a={x:0,y:0,z:0},p=(l,c)=>(r(l,c,a),t.offset(a.x,a.y,a.z));for(let l=0;l<=e;l++){let c=l/e;for(let f=0;f<i;f++)n.push(p(c,f/i),p(c,(f+1)/i)),n.push(p(f/i,c),p((f+1)/i,c))}return this._lines=n,this._linesKey=o,n}};W([bt({default:"",mapper:jt,tween:Ct,kind:"surfaceEquation"})],F.prototype,"expression",void 0);W([bt({default:null,tween:Yt,kind:"range",defaultMin:-3,defaultMax:3})],F.prototype,"uDomain",void 0);W([bt({default:null,tween:Yt,kind:"range",defaultMin:-3,defaultMax:3})],F.prototype,"vDomain",void 0);W([bt({default:{},tween:Zt})],F.prototype,"params",void 0);W([bt({default:48,min:2,max:256,step:1,animatable:!1})],F.prototype,"segments",void 0);W([bt({default:[],mapper:no,tween:ao,kind:"vector"})],F.prototype,"colorScale",void 0);W([bt({default:12,min:0,max:64,step:1,animatable:!1})],F.prototype,"meshLines",void 0);W([bt({default:"#0b1220",kind:"color"})],F.prototype,"meshColor",void 0);W([bt({default:0,min:0,max:1,step:.01})],F.prototype,"floorShadow",void 0);W([je({args:["expression"]})],F.prototype,"morphTo",null);W([je({args:["params"]})],F.prototype,"paramsTo",null);W([je({args:["uDomain","vDomain"]})],F.prototype,"domainTo",null);F=W([Qr({key:"surfacePlot3d",within:["axes3d"],closed:!0,forkable:!0,layout:{acceptsChildren:!0},seed:{expression:"sin(x) * cos(y)",fill:T}})],F);function _o(s){let t=ro(s,ae(s));return t instanceof Error?null:t}function ue(s){return Number.isFinite(s)?s:0}function Zr(s,t){return Array.isArray(s)?s.map(t):t(s)}import{command as he,Geo as ti,Mesh3D as ei,node as oi,property as kt}from"@motionscript/sdk";var B=function(s,t,e,r){var i=arguments.length,o=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,e):r,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,t,e,r);else for(var a=s.length-1;a>=0;a--)(n=s[a])&&(o=(i<3?n(o):i>3?n(t,e,o):n(t,e))||o);return i>3&&o&&Object.defineProperty(t,e,o),o},D=class extends ei{constructor(t){super(t??{}),t?.fill===void 0&&this.applyProp("fill",T)}morphTo(t){return this.to({data:v(t.data),duration:t.duration,easing:t.easing})}paramsTo(t){return this.to({data:v(t.data),duration:t.duration,easing:t.easing})}domainTo(t){return this.to({data:v(t.data),duration:t.duration,easing:t.easing})}progressTo(t){return this.to({data:v(t.data),duration:t.duration,easing:t.easing})}buildGeometry(){let t=Mt(this);if(!t)return;let e=this._points(t);if(!(e.length<2))return ti.tube({points:e,radius:this.thickness,segments:[e.length-1,8]})}_key="";_run=[];_points(t){let{source:e,blend:r}=this.expression,i=k(this.start,0,1),o=k(this.end,0,1),n=Math.max(2,Math.round(this.samples)),a=[e,r?.from,r?.t,t.revision,this.domain,JSON.stringify(this.params),i,o,n].join("|");if(a===this._key)return this._run;this._key=a,this._run=[];let p=this._curve(e);if(!p||!(o>i))return this._run;let l=r?this._curve(r.from):null,c=Math.max(1,Math.round(n*(o-i))),f={x:0,y:0,z:0},u={x:0,y:0,z:0};for(let d=0;d<=c;d++){let m=i+(o-i)*d/c;if(p(m,u)){if(l&&r){if(!l(m,f))continue;u.x=f.x+(u.x-f.x)*r.t,u.y=f.y+(u.y-f.y)*r.t,u.z=f.z+(u.z-f.z)*r.t}this._run.push(t.offset(u.x,u.y,u.z))}}return this._run}_curve(t){let e=ri(t);if(!e)return null;let r=Xt(Se(t),this.params),[i,o]=this.domain??[0,1],{x:n,y:a,z:p}=e;return(l,c)=>{let f=i+(o-i)*l;return c.x=n(f,0,r),c.y=a(f,0,r),c.z=p(f,0,r),Number.isFinite(c.x)&&Number.isFinite(c.y)&&Number.isFinite(c.z)}}};B([kt({default:"",mapper:jt,tween:Ct,kind:"spaceCurveEquation"})],D.prototype,"expression",void 0);B([kt({default:null,tween:Yt,kind:"range",defaultMin:0,defaultMax:1})],D.prototype,"domain",void 0);B([kt({default:{},tween:Zt})],D.prototype,"params",void 0);B([kt({default:160,min:2,max:2e3,step:1,animatable:!1})],D.prototype,"samples",void 0);B([kt({default:.04,min:.001,step:.005})],D.prototype,"thickness",void 0);B([kt({default:0,min:0,max:1,step:.01})],D.prototype,"start",void 0);B([kt({default:1,min:0,max:1,step:.01})],D.prototype,"end",void 0);B([he({args:["expression"]})],D.prototype,"morphTo",null);B([he({args:["params"]})],D.prototype,"paramsTo",null);B([he({args:["domain"]})],D.prototype,"domainTo",null);B([he({args:["start","end"]})],D.prototype,"progressTo",null);D=B([oi({key:"curvePlot3d",within:["axes3d"],forkable:!0,layout:{acceptsChildren:!1},seed:{expression:"(2cos(t), 2sin(t), t / 4)",domain:[-6.28,6.28],fill:T}})],D);function ri(s){let t=io(s,Se(s));return t instanceof Error?null:t}import{colorProperty as ii,Geo as ni,Mesh3D as ai,node as si,property as me}from"@motionscript/sdk";var Kt=function(s,t,e,r){var i=arguments.length,o=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,e):r,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,t,e,r);else for(var a=s.length-1;a>=0;a--)(n=s[a])&&(o=(i<3?n(o):i>3?n(t,e,o):n(t,e))||o);return i>3&&o&&Object.defineProperty(t,e,o),o},vt=class extends ai{constructor(t){super(t??{})}declareAssets(t){super.declareAssets(t),this.fontFamily!==""&&t.font(this.fontFamily)}buildGeometry(){return this.radius>0?ni.sphere({radius:this.radius,segments:[24,16]}):void 0}buildGraphics3D(){let t=super.buildGraphics3D();return Vt(t,this.label,{x:0,y:this.radius+this.labelSize*.85,z:0},{size:this.labelSize,color:this.labelColor,fontFamily:this.fontFamily}),t}};Kt([me({default:.1,min:0,step:.01})],vt.prototype,"radius",void 0);Kt([me({default:"",animatable:!1})],vt.prototype,"label",void 0);Kt([me({default:.26,min:.01,step:.01})],vt.prototype,"labelSize",void 0);Kt([ii({default:"#e5e7eb"})],vt.prototype,"labelColor",void 0);Kt([me({default:"",animatable:!1})],vt.prototype,"fontFamily",void 0);vt=Kt([si({key:"plotPoint3d",within:["axes3d","surfacePlot3d"],forkable:!0,layout:{acceptsChildren:!1},seed:{fill:"#facc15"}})],vt);import{command as li,Graphics3D as pi,lerpVector3 as Po,Mesh3D as fi,node as ci,property as ye,resolveVector3 as So}from"@motionscript/sdk";var Wt=function(s,t,e,r){var i=arguments.length,o=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,e):r,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,t,e,r);else for(var a=s.length-1;a>=0;a--)(n=s[a])&&(o=(i<3?n(o):i>3?n(t,e,o):n(t,e))||o);return i>3&&o&&Object.defineProperty(t,e,o),o},wt=class extends fi{constructor(t){super(t??{})}endpointsTo(t){return this.to({data:v(t.data),duration:t.duration,easing:t.easing})}buildGraphics3D(){let t=new pi,e=Mt(this),{tail:r,head:i,thickness:o}=this,n=e?e.offset(r.x,r.y,r.z):r,a=e?e.offset(i.x,i.y,i.z):i,p={x:a.x-n.x,y:a.y-n.y,z:a.z-n.z},l=Math.hypot(p.x,p.y,p.z);if(!(l>0))return t;let c=this.materialShorthand(),f=oo(p),u=this.tip?Math.min(o*8,l):0,d=l-u,m=g=>({x:n.x+p.x*g/l,y:n.y+p.y*g/l,z:n.z+p.z*g/l});return d>0&&t.cylinder({...c,radius:o,height:d,segments:[12,1],position:m(d/2),quaternion:f}),u>0&&t.cone({...c,radius:o*2.8,height:u,segments:[20,1],position:m(d+u/2),quaternion:f}),t}};Wt([ye({default:{x:0,y:0,z:0},mapper:So,tween:Po,kind:"vector3"})],wt.prototype,"tail",void 0);Wt([ye({default:{x:1,y:1,z:1},mapper:So,tween:Po,kind:"vector3"})],wt.prototype,"head",void 0);Wt([ye({default:.035,min:.001,step:.005})],wt.prototype,"thickness",void 0);Wt([ye({default:!0,animatable:!1})],wt.prototype,"tip",void 0);Wt([li({args:["tail","head"]})],wt.prototype,"endpointsTo",null);wt=Wt([ci({key:"vectorArrow3d",within:["axes3d"],forkable:!0,layout:{acceptsChildren:!1},seed:{head:{x:2,y:1,z:1.5},fill:"#f97316"}})],wt);import{colorProperty as di,command as ui,Graphics2D as Ro,node as hi,property as zt,strokeProperty as Oo}from"@motionscript/sdk";var U=function(s,t,e,r){var i=arguments.length,o=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,e):r,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,t,e,r);else for(var a=s.length-1;a>=0;a--)(n=s[a])&&(o=(i<3?n(o):i>3?n(t,e,o):n(t,e))||o);return i>3&&o&&Object.defineProperty(t,e,o),o},mi=2.2,N=class extends Jt{constructor(t){super(t??{})}rangeTo(t){return this.to({data:v(t.data),duration:t.duration,easing:t.easing})}declareAssets(t){super.declareAssets(t),this.fontFamily!==""&&t.font(this.fontFamily)}mapFor(t){let e=t.maxX-t.minX,r=t.maxY-t.minY,o=Math.max(1,Math.min(e,r)/2-(this.labels?this.labelSize*mi:0))/Math.max(this.radius,1e-9);return Ut({xRange:[-e/2/o,e/2/o],yRange:[-r/2/o,r/2/o],area:t})}furniture(t){let e=this.stroke,r=this.gridStroke,{start:i,end:o,radius:n}=this,a=t.toPoint(0,0),p=t.toPoint(n,0).x-a.x;if(!(p>0))return[];let l=(y,x)=>{let M=x*Math.PI/180;return t.toPoint(y*Math.cos(M),y*Math.sin(M))},c=(y,x)=>{let M=(t.toPoint(x,0).x-a.x)*2;return y.ellipse({x:a.x,y:a.y,width:M,height:M,start:i,end:o})},f=[],u=Ft([0,n],this.ringStep,p),d=u.values.filter(y=>y>0&&y<n*(1-1e-9)),m=Math.round(this.spokes),g=Array.from({length:m},(y,x)=>360*x/m);if(r.length>0){let y=new Ro;for(let x of d)c(y,x);for(let x of g)x%90!==0&&y.line({points:[a,l(n,x)],radius:0,start:i,end:o});(d.length>0||g.some(x=>x%90!==0))&&f.push(y.stroke(r))}if(e.length>0&&f.push(c(new Ro,n).line({points:[l(n,180),l(n,0)],radius:0,start:i,end:o}).line({points:[l(n,270),l(n,90)],radius:0,start:i,end:o}).stroke(e)),!this.labels)return f;let h=this.labelSize,b=[];for(let y of[...d,n]){let x=t.toPoint(y,0);b.push({text:ct(y,u.step),at:{x:x.x-h*.2,y:x.y-h*.95},align:"right"})}for(let y of g){let x=l(n,y),M=Math.cos(y*Math.PI/180),P=Math.sin(y*Math.PI/180);b.push({text:this.angleUnit==="degrees"?`${ct(y,1)}\xB0`:yi(y),at:{x:x.x+M*h*.6,y:x.y+P*h*1.05},align:M>.3?"left":M<-.3?"right":"center"})}return f.push(...I(b,{fontSize:h,fontFamily:this.fontFamily,color:this.labelColor})),f}};U([zt({default:4,min:1e-4,step:.5})],N.prototype,"radius",void 0);U([zt({default:0,min:0})],N.prototype,"ringStep",void 0);U([zt({default:12,min:0,max:72,step:1,animatable:!1})],N.prototype,"spokes",void 0);U([zt({default:"degrees",options:["degrees","radians"],animatable:!1})],N.prototype,"angleUnit",void 0);U([Oo({default:{weight:1.25,fill:"#3b4658",align:"center"}})],N.prototype,"gridStroke",void 0);U([Oo({default:{weight:2,fill:K,align:"center"}})],N.prototype,"stroke",void 0);U([zt({default:!0,animatable:!1})],N.prototype,"labels",void 0);U([zt({default:16,min:1,unit:"px"})],N.prototype,"labelSize",void 0);U([di({default:K})],N.prototype,"labelColor",void 0);U([zt({default:"",animatable:!1})],N.prototype,"fontFamily",void 0);U([ui({args:["radius"]})],N.prototype,"rangeTo",null);N=U([hi({key:"polarPlane",parentKey:"node",forkable:!0,layout:{children:"freeform",defaultWidthMode:"fixed",defaultHeightMode:"fixed",acceptsChildren:!0},seed:{width:560,height:560}})],N);function yi(s){if(s===0)return"0";let t=Math.round(s),e=180;for(let i=t,o=e;;[i,o]=[o,i%o])if(o===0){t/=i,e/=i;break}let r=t===1?"\u03C0":`${t}\u03C0`;return e===1?r:`${r}/${e}`}import{node as xi,property as zo,strokeProperty as gi}from"@motionscript/sdk";var xe=function(s,t,e,r){var i=arguments.length,o=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,e):r,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,t,e,r);else for(var a=s.length-1;a>=0;a--)(n=s[a])&&(o=(i<3?n(o):i>3?n(t,e,o):n(t,e))||o);return i>3&&o&&Object.defineProperty(t,e,o),o},bi=2400,vi=.38,wi=11,ko=26*Math.PI/180,Tt=class extends se{constructor(t){super(t??{})}own(){return`${this.spacing}|${this.arrowScale}`}strokes(t,e){let[r,i]=t.xRange,[o,n]=t.yRange,a=Math.max(this.spacing,1e-6),p=()=>(Math.floor((i-r)/a)+1)*(Math.floor((n-o)/a)+1);for(;p()>bi;)a*=2;let l=[],c={x:0,y:0},f=a*.9;for(let u=Math.ceil(r/a-1e-9);u*a<=i+1e-9;u++)for(let d=Math.ceil(o/a-1e-9);d*a<=n+1e-9;d++){let m=u*a,g=d*a;if(!e(m,g,c))continue;let h=Math.hypot(c.x,c.y),b=Math.min(h*this.arrowScale,f);if(!(b>0))continue;let y=c.x/h*b/2,x=c.y/h*b/2,M=t.toPoint(m-y,g-x),P=t.toPoint(m+y,g+x);l.push({runs:Mi(M,P),magnitude:h})}return l}};xe([zo({default:1,min:.01,step:.1})],Tt.prototype,"spacing",void 0);xe([zo({default:.4,min:0,step:.05})],Tt.prototype,"arrowScale",void 0);xe([gi({default:{weight:2.5,fill:T,align:"center",cap:"round",join:"round"}})],Tt.prototype,"stroke",void 0);Tt=xe([xi({key:"vectorField",within:G,parentKey:"shape",forkable:!0,layout:{children:"freeform",defaultWidthMode:"hug",defaultHeightMode:"hug",acceptsChildren:!1},seed:{expression:"(-y, x)"}})],Tt);function Mi(s,t){let e=t.x-s.x,r=t.y-s.y,i=Math.hypot(e,r);if(!(i>0))return[];let o=Math.min(i*vi,wi),n=Math.atan2(r,e)+Math.PI,a=p=>({x:t.x+Math.cos(p)*o,y:t.y+Math.sin(p)*o});return[[s,t],[a(n-ko),t,a(n+ko)]]}import{command as _i,node as Pi,property as ge,strokeProperty as Si}from"@motionscript/sdk";var At=function(s,t,e,r){var i=arguments.length,o=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,e):r,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,t,e,r);else for(var a=s.length-1;a>=0;a--)(n=s[a])&&(o=(i<3?n(o):i>3?n(t,e,o):n(t,e))||o);return i>3&&o&&Object.defineProperty(t,e,o),o},Ri=1600,Oi=8,ki=600,ft=class extends se{constructor(t){super(t??{})}flowTo(t){return this.to({data:v(t.data),duration:t.duration,easing:t.easing})}own(){return`${this.spacing}|${this.length}|${this.window}|${this.phase}`}strokes(t,e){let[r,i]=t.xRange,[o,n]=t.yRange,a=Math.max(this.spacing,1e-6),p=()=>(Math.floor((i-r)/a)+1)*(Math.floor((n-o)/a)+1);for(;p()>Ri;)a*=2;let l=a/Oi,c=Math.min(ki,Math.round(this.length/l));if(c<1)return[];let f=(g,h)=>g>=r-a&&g<=i+a&&h>=o-a&&h<=n+a,u=k(this.window,0,1),d=[],m=0;for(let g=Math.ceil(r/a-1e-9);g*a<=i+1e-9;g++)for(let h=Math.ceil(o/a-1e-9);h*a<=n+1e-9;h++){let b=zi(e,g*a,h*a,l,c,f);if(m++,b.points.length<2)continue;let y=u>=1?b.points:Ti(b.points,u,this.phase+Ai(m));y.length<2||d.push({runs:[y.map(x=>t.toPoint(x.x,x.y))],magnitude:b.magnitude})}return d}};At([ge({default:1,min:.01,step:.1})],ft.prototype,"spacing",void 0);At([ge({default:3,min:0,step:.1})],ft.prototype,"length",void 0);At([ge({default:1,min:.01,max:1,step:.01})],ft.prototype,"window",void 0);At([ge({default:0,step:.01})],ft.prototype,"phase",void 0);At([Si({default:{weight:2,fill:T,align:"center",cap:"round",join:"round"}})],ft.prototype,"stroke",void 0);At([_i({args:["phase"]})],ft.prototype,"flowTo",null);ft=At([Pi({key:"streamLines",within:G,parentKey:"shape",forkable:!0,layout:{children:"freeform",defaultWidthMode:"hug",defaultHeightMode:"hug",acceptsChildren:!1},seed:{expression:"(sin(y), cos(x))"}})],ft);function zi(s,t,e,r,i,o){let n=[{x:t,y:e}],a={x:0,y:0},p=0,l=0,c=(d,m,g)=>{if(!s(d,m,a))return!1;let h=Math.hypot(a.x,a.y);return h>1e-9?(g.x=a.x/h,g.y=a.y/h,p+=h,l++,!0):!1},f={x:0,y:0},u={x:0,y:0};for(let d=0;d<i&&!(!c(t,e,f)||!c(t+f.x*r/2,e+f.y*r/2,u)||(t+=u.x*r,e+=u.y*r,!o(t,e)));d++)n.push({x:t,y:e});return{points:n,magnitude:l>0?p/l:0}}function Ti(s,t,e){let i=(e-Math.floor(e))*(1+t),o=Math.max(0,i-t),n=Math.min(1,i);if(!(n>o))return[];let a=s.length-1;return s.slice(Math.floor(o*a),Math.ceil(n*a)+1)}function Ai(s){let t=Math.sin(s*12.9898)*43758.5453;return t-Math.floor(t)}import{command as Li,node as Fi,property as Ce,withdraw as ji}from"@motionscript/sdk";var Bt=function(s,t,e,r){var i=arguments.length,o=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,e):r,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,t,e,r);else for(var a=s.length-1;a>=0;a--)(n=s[a])&&(o=(i<3?n(o):i>3?n(t,e,o):n(t,e))||o);return i>3&&o&&Object.defineProperty(t,e,o),o},_t=class extends ee{constructor(t){super(t??{})}traceTo(t){return this.to({data:v(t.data),duration:t.duration,easing:t.easing})}span(){let{from:t,value:e,tail:r}=this,i=r>0?Math.min(Math.abs(e-t),r):Math.abs(e-t);return e>=t?[e-i,e]:[e,e+i]}};Bt([Ce({default:0,step:.1})],_t.prototype,"from",void 0);Bt([Ce({default:0,step:.1})],_t.prototype,"value",void 0);Bt([Ce({default:0,min:0,step:.1})],_t.prototype,"tail",void 0);Bt([Li({args:["value"]})],_t.prototype,"traceTo",null);_t=Bt([Fi({key:"tracedPath",within:G,parentKey:"functionPlot",forkable:!0,layout:{children:"freeform",defaultWidthMode:"hug",defaultHeightMode:"hug",acceptsChildren:!1},seed:{expression:"(2cos(t), sin(2t))",value:6.28}}),ji(...at)],_t);import{colorProperty as Ci,command as To,fillProperty as Di,Graphics2D as be,node as Ni,PaintNode as Ei,property as ot,strokeProperty as Ao}from"@motionscript/sdk";var L=function(s,t,e,r){var i=arguments.length,o=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,e):r,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,t,e,r);else for(var a=s.length-1;a>=0;a--)(n=s[a])&&(o=(i<3?n(o):i>3?n(t,e,o):n(t,e))||o);return i>3&&o&&Object.defineProperty(t,e,o),o};function Ii(s){return(Array.isArray(s)?s:[]).map(t=>String(t??""))}function Gi(s){return(Array.isArray(s)?s:[]).map(t=>{let[e,r]=Array.isArray(t)?t:[t?.from,t?.to];return{from:String(e??""),to:String(r??"")}})}function $i(s){let t=e=>typeof e=="number"&&Number.isFinite(e)?e:0;return(Array.isArray(s)?s:[]).map(e=>({vertex:String(e?.vertex??""),x:t(e?.x),y:t(e?.y)}))}var Hi=.12,R=class extends Ei{constructor(t){super(t??{}),this.applyProp("_layoutFrom",""),this.applyProp("_layoutMix",1)}arrangeTo(t){let e=this.arrangement,r=t.data?.arrangement??e;return this.command(i=>({arrangement:r,_layoutFrom:e,_layoutMix:i}),t.duration,t.easing)}partFillTo(t){let{part:e,fill:r}=t.data??{};return!e||r==null?this.to({data:{},duration:t.duration,easing:t.easing}):this.to({data:{partFills:Ie(this.partFills,{part:e,fill:r})},duration:t.duration,easing:t.easing})}declareAssets(t){super.declareAssets(t),this.fontFamily!==""&&t.font(this.fontFamily),this.labels&&st(t,this._names())}vertexPoints(){let{width:t,height:e}=this.layoutBounds,r=this.vertexRadius+Math.max(2,this.labelSize*.2),i=Math.max(0,t/2-r),o=Math.max(0,e/2-r),n=this._placed(this.arrangement),a=this._layoutMix<1&&this._layoutFrom!==""?this._placed(this._layoutFrom):null,p=this._layoutMix,l=new Map;for(let[c,f]of n){let u=a?.get(c)??f;l.set(c,{x:(u.x+(f.x-u.x)*p)*i,y:(u.y+(f.y-u.y)*p)*o})}return l}renderSelf(t){let e=this.vertexPoints();if(e.size===0)return;let r=new Map(this.partFills.map(i=>[i.part,i]));this._drawEdges(t,e,r),this._drawVertices(t,e,r)}renderStroke(){}_layouts=new Map;_placed(t){let e=this._names(),r=this._links(),i=[t,this.root,e.join("\0"),JSON.stringify(r),JSON.stringify(this.positions)].join("|"),o=this._layouts.get(i);if(!o){o=fo(t,e,r,this.root.trim());for(let{vertex:n,x:a,y:p}of this.positions){let l=n.trim();o.has(l)&&o.set(l,{x:a,y:p})}this._layouts.size>4&&this._layouts.clear(),this._layouts.set(i,o)}return o}_drawEdges(t,e,r){let i=this.stroke;if(i.length===0)return;let o=this.vertexRadius,n=this._links(),a=new Set(n.map(({from:c,to:f})=>`${c}\0${f}`)),p=new be,l=!1;for(let{from:c,to:f}of n){let u=e.get(c),d=e.get(f);if(!u||!d)continue;let m=c===f?Wi(u,o):Ki(u,d,o,this.directed&&a.has(`${f}\0${c}`)?Hi:0);if(m.length<2)continue;let g=r.get(`${c}-${f}`)??(this.directed?void 0:r.get(`${f}-${c}`)),h=this.directed||g!==void 0,b=h?new be:p;if(b.line({points:m,radius:0,start:this.start,end:this.end}),!h){l=!0;continue}let y=i;g&&(y=y.map(x=>({...x,fill:we(x.fill,g)}))),this.directed&&c!==f&&(y=y.map(x=>({...x,endCap:x.endCap??"triangle"}))),t.draw(b.stroke(y))}l&&t.draw(p.stroke(i))}_drawVertices(t,e,r){let i=this.vertexRadius,o=this.fill,n=this.vertexStroke,a=[];for(let[p,l]of e){if(i>0){let c=we(o,r.get(p)),f=new be().ellipse({x:l.x,y:l.y,width:i*2,height:i*2});t.draw(f.shadow(this.shadow).fill(c)),n.length>0&&t.draw(new be().ellipse({x:l.x,y:l.y,width:i*2,height:i*2}).stroke(n))}this.labels&&a.push({text:p,at:{x:l.x,y:l.y},align:"center"})}for(let p of I(a,{fontSize:this.labelSize,fontFamily:this.fontFamily,color:this.labelColor}))t.draw(p)}_names(){return[...new Set(this.vertices.map(t=>t.trim()).filter(t=>t!==""))]}_links(){return this.edges.flatMap(({from:t,to:e})=>{let r=t.trim(),i=e.trim();return r===""||i===""?[]:[{from:r,to:i}]})}};L([ot({default:[],mapper:Ii,animatable:!1,kind:"vector"})],R.prototype,"vertices",void 0);L([ot({default:[],mapper:Gi,animatable:!1,kind:"vector"})],R.prototype,"edges",void 0);L([ot({default:!1,animatable:!1})],R.prototype,"directed",void 0);L([ot({default:"circular",options:po,animatable:!1})],R.prototype,"arrangement",void 0);L([ot({default:"",animatable:!1})],R.prototype,"root",void 0);L([ot({default:[],mapper:$i,animatable:!1,kind:"vector"})],R.prototype,"positions",void 0);L([ot({default:18,min:0,unit:"px"})],R.prototype,"vertexRadius",void 0);L([Ao({default:[]})],R.prototype,"vertexStroke",void 0);L([ot({default:!0,animatable:!1})],R.prototype,"labels",void 0);L([ot({default:18,min:1,unit:"px"})],R.prototype,"labelSize",void 0);L([Ci({default:"#111827"})],R.prototype,"labelColor",void 0);L([ot({default:"",animatable:!1})],R.prototype,"fontFamily",void 0);L([ot({default:[],mapper:Ne,tween:Ee,kind:"vector"})],R.prototype,"partFills",void 0);L([Di({default:"#e5e7eb"})],R.prototype,"fill",void 0);L([Ao({default:{weight:3,fill:"#9ca3af",align:"center",cap:"round"}})],R.prototype,"stroke",void 0);L([To({args:["arrangement"]})],R.prototype,"arrangeTo",null);L([To({args:[{key:"part",kind:"text",default:""},{key:"fill",kind:"fills",default:"#facc15"}]})],R.prototype,"partFillTo",null);R=L([Ni({key:"networkGraph",parentKey:"shape",forkable:!0,layout:{children:"freeform",defaultWidthMode:"fixed",defaultHeightMode:"fixed",acceptsChildren:!1},seed:{width:560,height:400,vertices:["1","2","3","4","5"],edges:[{from:"1",to:"2"},{from:"2",to:"3"},{from:"3",to:"4"},{from:"4",to:"5"},{from:"5",to:"1"},{from:"1",to:"3"}]}})],R);function Ki(s,t,e,r){let i=t.x-s.x,o=t.y-s.y,n=Math.hypot(i,o);if(!(n>2*e))return[];if(r===0){let c=i/n,f=o/n;return[{x:s.x+c*e,y:s.y+f*e},{x:t.x-c*e,y:t.y-f*e}]}let a={x:(s.x+t.x)/2-o/n*r*n,y:(s.y+t.y)/2+i/n*r*n},p=[];for(let c=0;c<=16;c++){let f=c/16,u=1-f;p.push({x:u*u*s.x+2*u*f*a.x+f*f*t.x,y:u*u*s.y+2*u*f*a.y+f*f*t.y})}let l=(c,f)=>Math.hypot(c.x-f.x,c.y-f.y)>=e;return p.filter(c=>l(c,s)&&l(c,t))}function Wi(s,t){let e=[],r=Math.max(t*.8,6),i=s.y+t+r*.6;for(let o=0;o<=24;o++){let n=-Math.PI/2+2*Math.PI*o/24,a={x:s.x+Math.cos(n)*r,y:i+Math.sin(n)*r};Math.hypot(a.x-s.x,a.y-s.y)>=t&&e.push(a)}return e}import{colorProperty as Yi,command as Xi,fillOps as Lo,Graphics2D as De,node as qi,PaintNode as Vi,property as Pt,strokeProperty as Bi,withdraw as Ui}from"@motionscript/sdk";var J=function(s,t,e,r){var i=arguments.length,o=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,e):r,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(s,t,e,r);else for(var a=s.length-1;a>=0;a--)(n=s[a])&&(o=(i<3?n(o):i>3?n(t,e,o):n(t,e))||o);return i>3&&o&&Object.defineProperty(t,e,o),o},Fo=["#58a6ff","#f59e0b","#4ade80","#f472b6","#a78bfa","#2dd4bf"],Ji=.45;function jo(s){return(Array.isArray(s)?s:[]).map(t=>Number.isFinite(t)&&t>0?t:0)}function Co(s,t,e){return s.length!==t.length?e<1?s:t:t.map((r,i)=>s[i]+(r-s[i])*e)}var E=class extends Vi{constructor(t){super(t??{})}divideTo(t){let e={};return t.data?.columnShares!==void 0&&(e.columnShares=t.data.columnShares),t.data?.rowShares!==void 0&&(e.rowShares=t.data.rowShares),this.to({data:e,duration:t.duration,easing:t.easing})}declareAssets(t){super.declareAssets(t),this.fontFamily!==""&&t.font(this.fontFamily),st(t,[...this.columnLabels,...this.rowLabels])}parts(){let t=this._box(),e=this.columnShares,r=e.reduce((n,a)=>n+a,0);if(!(r>0)||t.width<=0||t.height<=0)return[];let i=[],o=t.x-t.width/2;return e.forEach((n,a)=>{let p=t.width*n/r,l=n/r,c=this.rowShares[a],f=t.y+t.height/2;if(c===void 0)i.push({x:o+p/2,y:t.y,width:p,height:t.height,probability:l,column:a,upper:!0});else{let u=Math.min(1,Math.max(0,c)),d=t.height*u;i.push({x:o+p/2,y:f-d/2,width:p,height:d,probability:l*u,column:a,upper:!0}),i.push({x:o+p/2,y:f-d-(t.height-d)/2,width:p,height:t.height-d,probability:l*(1-u),column:a,upper:!1})}o+=p}),i}renderSelf(t){let e=this.parts();if(e.length===0)return;let r=this.columnFills,i=this.stroke,o=[];for(let a of e){if(!(a.width>0)||!(a.height>0))continue;let p=r.length>0?r[a.column%r.length]:Lo.resolve(Fo[a.column%Fo.length]),l=a.upper?p:p.map(f=>({...f,opacity:(f.opacity??1)*Ji})),c=new De().rect({x:a.x,y:a.y,width:a.width,height:a.height});t.draw(c.shadow(this.shadow).fill(l)),i.length>0&&t.draw(new De().rect({x:a.x,y:a.y,width:a.width,height:a.height}).stroke(i)),this.values&&a.height>this.labelSize&&a.width>this.labelSize&&o.push({text:ct(Math.round(a.probability*1e3)/1e3,.001),at:{x:a.x,y:a.y},align:"center"})}o.push(...this._braces(t,e));let n={fontSize:this.labelSize,fontFamily:this.fontFamily,color:this.labelColor};for(let a of I(o,n))t.draw(a)}renderStroke(){}_box(){let{width:t,height:e}=this.layoutBounds,r=this.labelSize*2.6,i=this.columnLabels.some(n=>n!=="")?r:0,o=this.rowLabels.some(n=>n!=="")?r*1.6:0;return{x:o/2,y:i/2,width:Math.max(0,t-o),height:Math.max(0,e-i)}}_braces(t,e){let r=this._box(),i=this.labelSize*.8,o=6,n=new De,a=[],p=!1,l=(d,m,g,h,b)=>{if(h==="")return;n.path({data:ne(d,m,g,i),centerBounds:[-1,-1,1,1]}),p=!0;let y={x:(d.x+m.x)/2,y:(d.y+m.y)/2},x=i+this.labelSize*.75;a.push({text:h,at:{x:y.x+g.x*x,y:y.y+g.y*x},align:b})},c=r.y-r.height/2-o;for(let d of e){if(!d.upper&&this.rowShares[d.column]!==void 0)continue;let m=this.columnLabels[d.column]??"";l({x:d.x+d.width/2,y:c},{x:d.x-d.width/2,y:c},{x:0,y:-1},m,"center")}let f=e.filter(d=>d.column===0),u=r.x-r.width/2-o;if(this.rowShares[0]!==void 0&&f.forEach(d=>{let m=this.rowLabels[d.upper?0:1]??"";l({x:u,y:d.y-d.height/2},{x:u,y:d.y+d.height/2},{x:-1,y:0},m,"right")}),p){let d=Lo.resolve({type:"solid",color:this.labelColor});t.draw(n.stroke({weight:2,fill:d,align:"center",cap:"round",join:"round"}))}return a}};J([Pt({default:[1],mapper:jo,tween:Co,kind:"vector"})],E.prototype,"columnShares",void 0);J([Pt({default:[],mapper:jo,tween:Co,kind:"vector"})],E.prototype,"rowShares",void 0);J([Pt({default:[],mapper:so,tween:lo,kind:"vector"})],E.prototype,"columnFills",void 0);J([Pt({default:[],animatable:!1,kind:"vector"})],E.prototype,"columnLabels",void 0);J([Pt({default:[],animatable:!1,kind:"vector"})],E.prototype,"rowLabels",void 0);J([Pt({default:!1,animatable:!1})],E.prototype,"values",void 0);J([Pt({default:20,min:1,unit:"px"})],E.prototype,"labelSize",void 0);J([Yi({default:"#e5e7eb"})],E.prototype,"labelColor",void 0);J([Pt({default:"",animatable:!1})],E.prototype,"fontFamily",void 0);J([Bi({default:{weight:2,fill:"#0b0d12",align:"center"}})],E.prototype,"stroke",void 0);J([Xi({args:["columnShares","rowShares"]})],E.prototype,"divideTo",null);E=J([qi({key:"sampleSpace",parentKey:"shape",forkable:!0,layout:{children:"freeform",defaultWidthMode:"fixed",defaultHeightMode:"fixed",acceptsChildren:!1},seed:{width:520,height:420,columnShares:[.4,.6],rowShares:[.7,.25],columnLabels:["A","not A"],rowLabels:["B","not B"]}}),Ui(...nt,...at)],E);var Qi=[$e,He,A,Qt,C,ee,ut,q,mt,yt,V,gt,St,$,H,Ot,_,F,D,vt,wt,N,Tt,ft,_t,R,E];export{K as AXIS_COLOR,H as AngleMark,Qt as Axes2d,_ as Axes3d,Jt as CoordinateSystem,$ as CurlyBrace,yt as CurveArea,D as CurvePlot3d,St as DropLines,Nn as EQUATION_KINDS,Pn as EQUATION_VARIABLES,jn as EQUATION_VARIABLES_3D,Ot as EmphasisMark,kn as FIELD_VARIABLES,nt as FILL_PAINT,se as FieldMark,oe as FollowMark,ee as FunctionPlot,po as GRAPH_LAYOUTS,hn as IDENTITY_MATRIX,$e as Latex,an as LatexError,He as LatexMatrix,nn as LatexNotLoaded,tn as MATHJAX_LOADER,vn as MATH_DIALECT,Y as Mark,Qi as NODES,R as NetworkGraph,A as NumberLine,C as NumberPlane,at as OUTLINE_TRIM,un as PIXEL_MAP,T as PLOT_COLOR,q as PlotPoint,vt as PlotPoint3d,ut as PointsPlot,N as PolarPlane,V as RiemannSum,Ge as STROKE_PAINT,G as SYSTEMS,te as SYSTEMS_AND_PLOT,E as SampleSpace,ft as StreamLines,F as SurfacePlot3d,gt as TangentLine,_t as TracedPath,Tn as UNSET_PARAM,mt as VectorArrow,wt as VectorArrow3d,Tt as VectorField,dt as add,oo as aim,Ue as along,dn as axisScale,re as between,rn as blankLatex,yn as boundsOfRuns,ne as braceOutline,sn as buildLatexPath,Ut as cartesianMap,k as clamp,Re as colorAt,Mn as compileExpression,_n as compileExpressionCached,Zi as createBoundedCache,Ze as curveNamed,Q as curveOf,fn as defaultLatexMorph,Vt as drawLabel3D,I as drawLabels,Be as drawn,Rn as equationError,On as equationParams,wn as expressionVocabulary,zn as fieldError,Je as fieldParams,En as fillAt,pn as findLatexParts,to as followed,ct as formatTick,eo as graphSpace,ie as grown,qt as heading,xn as inflate,Xe as isIdentityMatrix,ln as latexPartNames,fo as layOut,Yt as lerpDomain,lo as lerpFillScale,lt as lerpInterval,Ye as lerpMatrix,Zt as lerpParams,Ee as lerpPartFills,ao as lerpScale,Ct as lerpSource,_e as lineThrough,en as loadMathJax,on as mathJaxLoaded,cn as matrixSource,bn as openPlane,Sn as parseEquation,Qe as parseField,io as parseSpaceCurve,ro as parseSurface,we as partPaint,gn as placeOnMap,Fn as quadOf,so as readFillScale,pt as readInterval,We as readMatrix,Ne as readPartFills,no as readScale,jt as readSource,Ke as resolveInterval,Pe as revisionOf,mn as runsToPath,Ln as sampleCurve,Xt as scopeFor,Dn as spaceCurveError,Se as spaceCurveParams,Mt as spaceOf,v as stated,Cn as surfaceError,ae as surfaceParams,Ft as ticksFor,An as traceContour,qe as transformedMap,Me as warpedMap,Ie as withPartFill,Ve as withoutTips};
2
+ //# sourceMappingURL=index.js.map