@motionscript/core 0.1.0-alpha.5 → 0.1.0-alpha.7

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 (615) hide show
  1. package/CHANGELOG.md +55 -0
  2. package/README.md +2 -4
  3. package/dist/assets/errors.js +4 -5
  4. package/dist/assets/errors.js.map +1 -1
  5. package/dist/assets/scope.d.ts +1 -1
  6. package/dist/assets/scope.d.ts.map +1 -1
  7. package/dist/assets/scope.js +1 -1
  8. package/dist/assets/scope.js.map +1 -1
  9. package/dist/attributes/audio/schedule.d.ts +3 -18
  10. package/dist/attributes/audio/schedule.d.ts.map +1 -1
  11. package/dist/attributes/audio/schedule.js.map +1 -1
  12. package/dist/attributes/index.d.ts +3 -5
  13. package/dist/attributes/index.d.ts.map +1 -1
  14. package/dist/attributes/index.js +2 -2
  15. package/dist/attributes/index.js.map +1 -1
  16. package/dist/attributes/layout/insets.d.ts +1 -1
  17. package/dist/attributes/layout/insets.js.map +1 -1
  18. package/dist/attributes/layout/size.d.ts +1 -1
  19. package/dist/attributes/layout/size.js +1 -1
  20. package/dist/attributes/layout/size.js.map +1 -1
  21. package/dist/attributes/properties/decorator.d.ts +44 -11
  22. package/dist/attributes/properties/decorator.d.ts.map +1 -1
  23. package/dist/attributes/properties/decorator.js +37 -9
  24. package/dist/attributes/properties/decorator.js.map +1 -1
  25. package/dist/attributes/properties/inputs.d.ts +1 -1
  26. package/dist/attributes/properties/inputs.js +1 -1
  27. package/dist/attributes/properties/inputs.js.map +1 -1
  28. package/dist/attributes/properties/typed.d.ts +19 -140
  29. package/dist/attributes/properties/typed.d.ts.map +1 -1
  30. package/dist/attributes/properties/typed.js +12 -108
  31. package/dist/attributes/properties/typed.js.map +1 -1
  32. package/dist/attributes/shape/corners/corner-radius.d.ts +1 -1
  33. package/dist/attributes/shape/corners/corner-radius.js +1 -1
  34. package/dist/attributes/shape/corners/corner-radius.js.map +1 -1
  35. package/dist/attributes/shape/effects/implementations/drop-shadow.d.ts +1 -1
  36. package/dist/attributes/shape/effects/implementations/drop-shadow.js.map +1 -1
  37. package/dist/attributes/shape/fill/color/parser.d.ts +1 -1
  38. package/dist/attributes/shape/fill/color/parser.js +1 -1
  39. package/dist/attributes/shape/fill/color/parser.js.map +1 -1
  40. package/dist/attributes/shape/fill/implementations/canvas3d.d.ts +2 -2
  41. package/dist/attributes/shape/fill/implementations/canvas3d.js.map +1 -1
  42. package/dist/attributes/shape/fill/implementations/shader.d.ts +2 -2
  43. package/dist/attributes/shape/fill/implementations/shader.js.map +1 -1
  44. package/dist/attributes/shape/fill/implementations/video.d.ts +1 -1
  45. package/dist/attributes/shape/fill/implementations/video.js +1 -1
  46. package/dist/attributes/shape/fill/implementations/video.js.map +1 -1
  47. package/dist/attributes/shape/fill/lerp.d.ts +1 -1
  48. package/dist/attributes/shape/fill/lerp.js.map +1 -1
  49. package/dist/attributes/shape/filters/chain.d.ts +1 -1
  50. package/dist/attributes/shape/filters/chain.js +1 -1
  51. package/dist/attributes/shape/filters/chain.js.map +1 -1
  52. package/dist/attributes/shape/filters/union.d.ts +4 -3
  53. package/dist/attributes/shape/filters/union.d.ts.map +1 -1
  54. package/dist/attributes/shape/filters/union.js.map +1 -1
  55. package/dist/attributes/shape/path/ops.d.ts +1 -2
  56. package/dist/attributes/shape/path/ops.d.ts.map +1 -1
  57. package/dist/attributes/shape/path/ops.js.map +1 -1
  58. package/dist/attributes/shared/operators.d.ts +2 -2
  59. package/dist/attributes/shared/operators.js.map +1 -1
  60. package/dist/attributes/text/types.d.ts +2 -3
  61. package/dist/attributes/text/types.d.ts.map +1 -1
  62. package/dist/attributes/text/types.js.map +1 -1
  63. package/dist/browser/chunks/chunk-D4FSTPML.js +14 -0
  64. package/dist/browser/chunks/chunk-D4FSTPML.js.map +7 -0
  65. package/dist/browser/chunks/chunk-LKUYVFU3.js +2 -0
  66. package/dist/browser/chunks/chunk-LKUYVFU3.js.map +7 -0
  67. package/dist/browser/chunks/chunk-RTNATFWX.js +5 -0
  68. package/dist/browser/chunks/chunk-RTNATFWX.js.map +7 -0
  69. package/dist/browser/chunks/chunk-ZRPZPWZU.js +3 -0
  70. package/dist/browser/chunks/chunk-ZRPZPWZU.js.map +7 -0
  71. package/dist/browser/component.js +1 -1
  72. package/dist/browser/component.js.map +4 -4
  73. package/dist/browser/experimental.js +2 -0
  74. package/dist/browser/index.js +1 -1
  75. package/dist/browser/index.js.map +4 -4
  76. package/dist/browser/manifest.json +3 -4
  77. package/dist/browser/sdk.js +1 -1
  78. package/dist/component/api.d.ts +508 -0
  79. package/dist/component/api.d.ts.map +1 -0
  80. package/dist/component/api.js +4 -0
  81. package/dist/component/api.js.map +1 -0
  82. package/dist/component/builtins/audio.d.ts +26 -0
  83. package/dist/component/builtins/audio.d.ts.map +1 -0
  84. package/dist/component/builtins/audio.js +41 -0
  85. package/dist/component/builtins/audio.js.map +1 -0
  86. package/dist/component/builtins/canvas3d.d.ts +98 -0
  87. package/dist/component/builtins/canvas3d.d.ts.map +1 -0
  88. package/dist/component/builtins/canvas3d.js +21 -0
  89. package/dist/component/builtins/canvas3d.js.map +1 -0
  90. package/dist/component/builtins/composite.d.ts +56 -0
  91. package/dist/component/builtins/composite.d.ts.map +1 -0
  92. package/dist/component/builtins/composite.js +25 -0
  93. package/dist/component/builtins/composite.js.map +1 -0
  94. package/dist/component/builtins/geometry.d.ts +505 -0
  95. package/dist/component/builtins/geometry.d.ts.map +1 -0
  96. package/dist/component/builtins/geometry.js +107 -0
  97. package/dist/component/builtins/geometry.js.map +1 -0
  98. package/dist/component/builtins/layout.d.ts +88 -0
  99. package/dist/component/builtins/layout.d.ts.map +1 -0
  100. package/dist/component/builtins/layout.js +84 -0
  101. package/dist/component/builtins/layout.js.map +1 -0
  102. package/dist/component/builtins/media.d.ts +95 -0
  103. package/dist/component/builtins/media.d.ts.map +1 -0
  104. package/dist/component/builtins/media.js +149 -0
  105. package/dist/component/builtins/media.js.map +1 -0
  106. package/dist/component/builtins/providers.d.ts +23 -0
  107. package/dist/component/builtins/providers.d.ts.map +1 -0
  108. package/dist/component/builtins/providers.js +30 -0
  109. package/dist/component/builtins/providers.js.map +1 -0
  110. package/dist/component/builtins/text.d.ts +193 -0
  111. package/dist/component/builtins/text.d.ts.map +1 -0
  112. package/dist/component/builtins/text.js +113 -0
  113. package/dist/component/builtins/text.js.map +1 -0
  114. package/dist/component/builtins/three.d.ts +1085 -0
  115. package/dist/component/builtins/three.d.ts.map +1 -0
  116. package/dist/component/builtins/three.js +265 -0
  117. package/dist/component/builtins/three.js.map +1 -0
  118. package/dist/component/clip-of.d.ts +5 -0
  119. package/dist/component/clip-of.d.ts.map +1 -0
  120. package/dist/component/clip-of.js +33 -0
  121. package/dist/component/clip-of.js.map +1 -0
  122. package/dist/component/commands-for.d.ts +19 -0
  123. package/dist/component/commands-for.d.ts.map +1 -0
  124. package/dist/component/commands-for.js +5 -0
  125. package/dist/component/commands-for.js.map +1 -0
  126. package/dist/component/component-audio.d.ts +9 -0
  127. package/dist/component/component-audio.d.ts.map +1 -0
  128. package/dist/component/component-audio.js +18 -0
  129. package/dist/component/component-audio.js.map +1 -0
  130. package/dist/component/component2d.d.ts +9 -0
  131. package/dist/component/component2d.d.ts.map +1 -0
  132. package/dist/component/component2d.js +239 -0
  133. package/dist/component/component2d.js.map +1 -0
  134. package/dist/component/component3d.d.ts +9 -0
  135. package/dist/component/component3d.d.ts.map +1 -0
  136. package/dist/component/component3d.js +99 -0
  137. package/dist/component/component3d.js.map +1 -0
  138. package/dist/component/factory.d.ts +63 -0
  139. package/dist/component/factory.d.ts.map +1 -0
  140. package/dist/component/factory.js +313 -0
  141. package/dist/component/factory.js.map +1 -0
  142. package/dist/component/modules/aim.d.ts +30 -0
  143. package/dist/component/modules/aim.d.ts.map +1 -0
  144. package/dist/component/modules/aim.js +39 -0
  145. package/dist/component/modules/aim.js.map +1 -0
  146. package/dist/component/modules/corners.d.ts +13 -0
  147. package/dist/component/modules/corners.d.ts.map +1 -0
  148. package/dist/component/modules/corners.js +12 -0
  149. package/dist/component/modules/corners.js.map +1 -0
  150. package/dist/component/modules/flow.d.ts +26 -0
  151. package/dist/component/modules/flow.d.ts.map +1 -0
  152. package/dist/component/modules/flow.js +55 -0
  153. package/dist/component/modules/flow.js.map +1 -0
  154. package/dist/component/modules/material.d.ts +40 -0
  155. package/dist/component/modules/material.d.ts.map +1 -0
  156. package/dist/component/modules/material.js +75 -0
  157. package/dist/component/modules/material.js.map +1 -0
  158. package/dist/component/modules/paint.d.ts +71 -0
  159. package/dist/component/modules/paint.d.ts.map +1 -0
  160. package/dist/component/modules/paint.js +106 -0
  161. package/dist/component/modules/paint.js.map +1 -0
  162. package/dist/component/modules/shapes.d.ts +31 -0
  163. package/dist/component/modules/shapes.d.ts.map +1 -0
  164. package/dist/component/modules/shapes.js +43 -0
  165. package/dist/component/modules/shapes.js.map +1 -0
  166. package/dist/component/modules/text-layout.d.ts +26 -0
  167. package/dist/component/modules/text-layout.d.ts.map +1 -0
  168. package/dist/component/modules/text-layout.js +57 -0
  169. package/dist/component/modules/text-layout.js.map +1 -0
  170. package/dist/component/modules/text-style.d.ts +48 -0
  171. package/dist/component/modules/text-style.d.ts.map +1 -0
  172. package/dist/component/modules/text-style.js +63 -0
  173. package/dist/component/modules/text-style.js.map +1 -0
  174. package/dist/component/modules/three-entries.d.ts +23 -0
  175. package/dist/component/modules/three-entries.d.ts.map +1 -0
  176. package/dist/component/modules/three-entries.js +41 -0
  177. package/dist/component/modules/three-entries.js.map +1 -0
  178. package/dist/component/modules/view3d.d.ts +55 -0
  179. package/dist/component/modules/view3d.d.ts.map +1 -0
  180. package/dist/component/modules/view3d.js +160 -0
  181. package/dist/component/modules/view3d.js.map +1 -0
  182. package/dist/component/timeline.d.ts +22 -0
  183. package/dist/component/timeline.d.ts.map +1 -0
  184. package/dist/component/timeline.js +128 -0
  185. package/dist/component/timeline.js.map +1 -0
  186. package/dist/component/type-def.d.ts +26 -0
  187. package/dist/component/type-def.d.ts.map +1 -0
  188. package/dist/component/type-def.js +16 -0
  189. package/dist/component/type-def.js.map +1 -0
  190. package/dist/component/types.d.ts +91 -0
  191. package/dist/component/types.d.ts.map +1 -0
  192. package/dist/component/types.js +88 -0
  193. package/dist/component/types.js.map +1 -0
  194. package/dist/component/views.d.ts +121 -0
  195. package/dist/component/views.d.ts.map +1 -0
  196. package/dist/component/views.js +413 -0
  197. package/dist/component/views.js.map +1 -0
  198. package/dist/component.d.ts +10 -19
  199. package/dist/component.d.ts.map +1 -1
  200. package/dist/component.js +10 -19
  201. package/dist/component.js.map +1 -1
  202. package/dist/components/builtins/audio/audio.d.ts +53 -0
  203. package/dist/components/builtins/audio/audio.d.ts.map +1 -0
  204. package/dist/components/builtins/audio/audio.js +41 -0
  205. package/dist/components/builtins/audio/audio.js.map +1 -0
  206. package/dist/components/builtins/geometry/composite.d.ts +93 -0
  207. package/dist/components/builtins/geometry/composite.d.ts.map +1 -0
  208. package/dist/components/builtins/geometry/composite.js +25 -0
  209. package/dist/components/builtins/geometry/composite.js.map +1 -0
  210. package/dist/components/builtins/geometry/geometry.d.ts +921 -0
  211. package/dist/components/builtins/geometry/geometry.d.ts.map +1 -0
  212. package/dist/components/builtins/geometry/geometry.js +107 -0
  213. package/dist/components/builtins/geometry/geometry.js.map +1 -0
  214. package/dist/components/builtins/geometry/shape-outline.d.ts +93 -0
  215. package/dist/components/builtins/geometry/shape-outline.d.ts.map +1 -0
  216. package/dist/components/builtins/geometry/shape-outline.js +470 -0
  217. package/dist/components/builtins/geometry/shape-outline.js.map +1 -0
  218. package/dist/components/builtins/layout/layout.d.ts +186 -0
  219. package/dist/components/builtins/layout/layout.d.ts.map +1 -0
  220. package/dist/components/builtins/layout/layout.js +84 -0
  221. package/dist/components/builtins/layout/layout.js.map +1 -0
  222. package/dist/components/builtins/media/media.d.ts +240 -0
  223. package/dist/components/builtins/media/media.d.ts.map +1 -0
  224. package/dist/components/builtins/media/media.js +149 -0
  225. package/dist/components/builtins/media/media.js.map +1 -0
  226. package/dist/components/builtins/providers/providers.d.ts +47 -0
  227. package/dist/components/builtins/providers/providers.d.ts.map +1 -0
  228. package/dist/components/builtins/providers/providers.js +30 -0
  229. package/dist/components/builtins/providers/providers.js.map +1 -0
  230. package/dist/components/builtins/text/number-format.d.ts +66 -0
  231. package/dist/components/builtins/text/number-format.d.ts.map +1 -0
  232. package/dist/components/builtins/text/number-format.js +227 -0
  233. package/dist/components/builtins/text/number-format.js.map +1 -0
  234. package/dist/components/builtins/text/number-pattern.d.ts +51 -0
  235. package/dist/components/builtins/text/number-pattern.d.ts.map +1 -0
  236. package/dist/components/builtins/text/number-pattern.js +77 -0
  237. package/dist/components/builtins/text/number-pattern.js.map +1 -0
  238. package/dist/components/builtins/text/text-defaults.d.ts +32 -0
  239. package/dist/components/builtins/text/text-defaults.d.ts.map +1 -0
  240. package/dist/components/builtins/text/text-defaults.js +37 -0
  241. package/dist/components/builtins/text/text-defaults.js.map +1 -0
  242. package/dist/components/builtins/text/text-layout.d.ts +82 -0
  243. package/dist/components/builtins/text/text-layout.d.ts.map +1 -0
  244. package/dist/components/builtins/text/text-layout.js +331 -0
  245. package/dist/components/builtins/text/text-layout.js.map +1 -0
  246. package/dist/components/builtins/text/text.d.ts +409 -0
  247. package/dist/components/builtins/text/text.d.ts.map +1 -0
  248. package/dist/components/builtins/text/text.js +113 -0
  249. package/dist/components/builtins/text/text.js.map +1 -0
  250. package/dist/components/builtins/three/canvas3d.d.ts +245 -0
  251. package/dist/components/builtins/three/canvas3d.d.ts.map +1 -0
  252. package/dist/components/builtins/three/canvas3d.js +21 -0
  253. package/dist/components/builtins/three/canvas3d.js.map +1 -0
  254. package/dist/components/builtins/three/grid-geometry3d.d.ts +62 -0
  255. package/dist/components/builtins/three/grid-geometry3d.d.ts.map +1 -0
  256. package/dist/components/builtins/three/grid-geometry3d.js +114 -0
  257. package/dist/components/builtins/three/grid-geometry3d.js.map +1 -0
  258. package/dist/components/builtins/three/three.d.ts +1889 -0
  259. package/dist/components/builtins/three/three.d.ts.map +1 -0
  260. package/dist/components/builtins/three/three.js +305 -0
  261. package/dist/components/builtins/three/three.js.map +1 -0
  262. package/dist/components/factory/api.d.ts +516 -0
  263. package/dist/components/factory/api.d.ts.map +1 -0
  264. package/dist/components/factory/api.js +4 -0
  265. package/dist/components/factory/api.js.map +1 -0
  266. package/dist/components/factory/clip-of.d.ts +5 -0
  267. package/dist/components/factory/clip-of.d.ts.map +1 -0
  268. package/dist/components/factory/clip-of.js +33 -0
  269. package/dist/components/factory/clip-of.js.map +1 -0
  270. package/dist/components/factory/commands-for.d.ts +19 -0
  271. package/dist/components/factory/commands-for.d.ts.map +1 -0
  272. package/dist/components/factory/commands-for.js +5 -0
  273. package/dist/components/factory/commands-for.js.map +1 -0
  274. package/dist/components/factory/component-audio.d.ts +9 -0
  275. package/dist/components/factory/component-audio.d.ts.map +1 -0
  276. package/dist/components/factory/component-audio.js +18 -0
  277. package/dist/components/factory/component-audio.js.map +1 -0
  278. package/dist/components/factory/component2d.d.ts +8 -0
  279. package/dist/components/factory/component2d.d.ts.map +1 -0
  280. package/dist/components/factory/component2d.js +240 -0
  281. package/dist/components/factory/component2d.js.map +1 -0
  282. package/dist/components/factory/component3d.d.ts +9 -0
  283. package/dist/components/factory/component3d.d.ts.map +1 -0
  284. package/dist/components/factory/component3d.js +99 -0
  285. package/dist/components/factory/component3d.js.map +1 -0
  286. package/dist/components/factory/factory.d.ts +63 -0
  287. package/dist/components/factory/factory.d.ts.map +1 -0
  288. package/dist/components/factory/factory.js +313 -0
  289. package/dist/components/factory/factory.js.map +1 -0
  290. package/dist/components/factory/timeline.d.ts +22 -0
  291. package/dist/components/factory/timeline.d.ts.map +1 -0
  292. package/dist/components/factory/timeline.js +128 -0
  293. package/dist/components/factory/timeline.js.map +1 -0
  294. package/dist/components/factory/type-def.d.ts +26 -0
  295. package/dist/components/factory/type-def.d.ts.map +1 -0
  296. package/dist/components/factory/type-def.js +16 -0
  297. package/dist/components/factory/type-def.js.map +1 -0
  298. package/dist/components/factory/types.d.ts +91 -0
  299. package/dist/components/factory/types.d.ts.map +1 -0
  300. package/dist/components/factory/types.js +88 -0
  301. package/dist/components/factory/types.js.map +1 -0
  302. package/dist/components/factory/views.d.ts +121 -0
  303. package/dist/components/factory/views.d.ts.map +1 -0
  304. package/dist/components/factory/views.js +413 -0
  305. package/dist/components/factory/views.js.map +1 -0
  306. package/dist/components/modules/aim.d.ts +30 -0
  307. package/dist/components/modules/aim.d.ts.map +1 -0
  308. package/dist/components/modules/aim.js +39 -0
  309. package/dist/components/modules/aim.js.map +1 -0
  310. package/dist/components/modules/corners.d.ts +13 -0
  311. package/dist/components/modules/corners.d.ts.map +1 -0
  312. package/dist/components/modules/corners.js +12 -0
  313. package/dist/components/modules/corners.js.map +1 -0
  314. package/dist/components/modules/flow.d.ts +26 -0
  315. package/dist/components/modules/flow.d.ts.map +1 -0
  316. package/dist/components/modules/flow.js +57 -0
  317. package/dist/components/modules/flow.js.map +1 -0
  318. package/dist/components/modules/material.d.ts +40 -0
  319. package/dist/components/modules/material.d.ts.map +1 -0
  320. package/dist/components/modules/material.js +75 -0
  321. package/dist/components/modules/material.js.map +1 -0
  322. package/dist/components/modules/paint.d.ts +71 -0
  323. package/dist/components/modules/paint.d.ts.map +1 -0
  324. package/dist/components/modules/paint.js +106 -0
  325. package/dist/components/modules/paint.js.map +1 -0
  326. package/dist/components/modules/shapes.d.ts +31 -0
  327. package/dist/components/modules/shapes.d.ts.map +1 -0
  328. package/dist/components/modules/shapes.js +43 -0
  329. package/dist/components/modules/shapes.js.map +1 -0
  330. package/dist/components/modules/text-layout.d.ts +26 -0
  331. package/dist/components/modules/text-layout.d.ts.map +1 -0
  332. package/dist/components/modules/text-layout.js +57 -0
  333. package/dist/components/modules/text-layout.js.map +1 -0
  334. package/dist/components/modules/text-style.d.ts +48 -0
  335. package/dist/components/modules/text-style.d.ts.map +1 -0
  336. package/dist/components/modules/text-style.js +63 -0
  337. package/dist/components/modules/text-style.js.map +1 -0
  338. package/dist/components/modules/three-entries.d.ts +23 -0
  339. package/dist/components/modules/three-entries.d.ts.map +1 -0
  340. package/dist/components/modules/three-entries.js +41 -0
  341. package/dist/components/modules/three-entries.js.map +1 -0
  342. package/dist/components/modules/view3d.d.ts +59 -0
  343. package/dist/components/modules/view3d.d.ts.map +1 -0
  344. package/dist/components/modules/view3d.js +171 -0
  345. package/dist/components/modules/view3d.js.map +1 -0
  346. package/dist/components/trees/2d/group-bounds.d.ts +56 -0
  347. package/dist/components/trees/2d/group-bounds.d.ts.map +1 -0
  348. package/dist/components/trees/2d/group-bounds.js +87 -0
  349. package/dist/components/trees/2d/group-bounds.js.map +1 -0
  350. package/dist/components/trees/2d/node-lifecycle.d.ts +46 -0
  351. package/dist/components/trees/2d/node-lifecycle.d.ts.map +1 -0
  352. package/dist/components/trees/2d/node-lifecycle.js +264 -0
  353. package/dist/components/trees/2d/node-lifecycle.js.map +1 -0
  354. package/dist/components/trees/2d/node-motion.d.ts +56 -0
  355. package/dist/components/trees/2d/node-motion.d.ts.map +1 -0
  356. package/dist/components/trees/2d/node-motion.js +86 -0
  357. package/dist/components/trees/2d/node-motion.js.map +1 -0
  358. package/dist/components/trees/2d/node-render.d.ts +36 -0
  359. package/dist/components/trees/2d/node-render.d.ts.map +1 -0
  360. package/dist/components/trees/2d/node-render.js +67 -0
  361. package/dist/components/trees/2d/node-render.js.map +1 -0
  362. package/dist/components/trees/2d/node-space.d.ts +63 -0
  363. package/dist/components/trees/2d/node-space.d.ts.map +1 -0
  364. package/dist/components/trees/2d/node-space.js +131 -0
  365. package/dist/components/trees/2d/node-space.js.map +1 -0
  366. package/dist/components/trees/2d/node-transform.d.ts +55 -0
  367. package/dist/components/trees/2d/node-transform.d.ts.map +1 -0
  368. package/dist/components/trees/2d/node-transform.js +73 -0
  369. package/dist/components/trees/2d/node-transform.js.map +1 -0
  370. package/dist/components/trees/2d/node2d.d.ts +1020 -0
  371. package/dist/components/trees/2d/node2d.d.ts.map +1 -0
  372. package/dist/components/trees/2d/node2d.js +1481 -0
  373. package/dist/components/trees/2d/node2d.js.map +1 -0
  374. package/dist/components/trees/audio/index.d.ts +2 -0
  375. package/dist/components/trees/audio/index.d.ts.map +1 -0
  376. package/dist/components/trees/audio/index.js +2 -0
  377. package/dist/components/trees/audio/index.js.map +1 -0
  378. package/dist/components/trees/audio/node-audio.d.ts +109 -0
  379. package/dist/components/trees/audio/node-audio.d.ts.map +1 -0
  380. package/dist/components/trees/audio/node-audio.js +167 -0
  381. package/dist/components/trees/audio/node-audio.js.map +1 -0
  382. package/dist/components/trees/index.d.ts +10 -0
  383. package/dist/components/trees/index.d.ts.map +1 -0
  384. package/dist/components/trees/index.js +14 -0
  385. package/dist/components/trees/index.js.map +1 -0
  386. package/dist/components/trees/node/node-editor-state.d.ts +53 -0
  387. package/dist/components/trees/node/node-editor-state.d.ts.map +1 -0
  388. package/dist/components/trees/node/node-editor-state.js +23 -0
  389. package/dist/components/trees/node/node-editor-state.js.map +1 -0
  390. package/dist/components/trees/node/node-reactive.d.ts +89 -0
  391. package/dist/components/trees/node/node-reactive.d.ts.map +1 -0
  392. package/dist/components/trees/node/node-reactive.js +135 -0
  393. package/dist/components/trees/node/node-reactive.js.map +1 -0
  394. package/dist/components/trees/node/node-time.d.ts +39 -0
  395. package/dist/components/trees/node/node-time.d.ts.map +1 -0
  396. package/dist/components/trees/node/node-time.js +14 -0
  397. package/dist/components/trees/node/node-time.js.map +1 -0
  398. package/dist/components/trees/node/node-walk.d.ts +46 -0
  399. package/dist/components/trees/node/node-walk.d.ts.map +1 -0
  400. package/dist/components/trees/node/node-walk.js +74 -0
  401. package/dist/components/trees/node/node-walk.js.map +1 -0
  402. package/dist/components/trees/node/node.d.ts +401 -0
  403. package/dist/components/trees/node/node.d.ts.map +1 -0
  404. package/dist/components/trees/node/node.js +680 -0
  405. package/dist/components/trees/node/node.js.map +1 -0
  406. package/dist/components/trees/root/canvas2d-node.d.ts +163 -0
  407. package/dist/components/trees/root/canvas2d-node.d.ts.map +1 -0
  408. package/dist/components/trees/root/canvas2d-node.js +216 -0
  409. package/dist/components/trees/root/canvas2d-node.js.map +1 -0
  410. package/dist/components/trees/three/node3d.d.ts +222 -0
  411. package/dist/components/trees/three/node3d.d.ts.map +1 -0
  412. package/dist/components/trees/three/node3d.js +289 -0
  413. package/dist/components/trees/three/node3d.js.map +1 -0
  414. package/dist/document/audio.d.ts +9 -1
  415. package/dist/document/audio.d.ts.map +1 -1
  416. package/dist/document/audio.js +41 -0
  417. package/dist/document/audio.js.map +1 -1
  418. package/dist/document/builtins.d.ts.map +1 -1
  419. package/dist/document/builtins.js +13 -31
  420. package/dist/document/builtins.js.map +1 -1
  421. package/dist/document/command-traits.d.ts +2 -2
  422. package/dist/document/command-traits.js +4 -1
  423. package/dist/document/command-traits.js.map +1 -1
  424. package/dist/document/deny-globals.d.ts +2 -2
  425. package/dist/document/deny-globals.js +2 -2
  426. package/dist/document/deny-globals.js.map +1 -1
  427. package/dist/document/diff.d.ts.map +1 -1
  428. package/dist/document/diff.js +3 -3
  429. package/dist/document/diff.js.map +1 -1
  430. package/dist/document/doc-index.d.ts.map +1 -1
  431. package/dist/document/doc-index.js +3 -3
  432. package/dist/document/doc-index.js.map +1 -1
  433. package/dist/document/expression/index.d.ts +1 -1
  434. package/dist/document/expression/index.js +1 -1
  435. package/dist/document/expression/index.js.map +1 -1
  436. package/dist/document/expression/ops.js +1 -1
  437. package/dist/document/expression/ops.js.map +1 -1
  438. package/dist/document/index.d.ts +1 -2
  439. package/dist/document/index.d.ts.map +1 -1
  440. package/dist/document/index.js +1 -2
  441. package/dist/document/index.js.map +1 -1
  442. package/dist/document/node-decorator.d.ts +14 -10
  443. package/dist/document/node-decorator.d.ts.map +1 -1
  444. package/dist/document/node-decorator.js +14 -10
  445. package/dist/document/node-decorator.js.map +1 -1
  446. package/dist/document/node-descriptor.d.ts +9 -3
  447. package/dist/document/node-descriptor.d.ts.map +1 -1
  448. package/dist/document/node-descriptor.js.map +1 -1
  449. package/dist/document/placement.js +2 -2
  450. package/dist/document/placement.js.map +1 -1
  451. package/dist/document/registry.d.ts +29 -36
  452. package/dist/document/registry.d.ts.map +1 -1
  453. package/dist/document/registry.js +29 -35
  454. package/dist/document/registry.js.map +1 -1
  455. package/dist/document/settled-index.d.ts +49 -0
  456. package/dist/document/settled-index.d.ts.map +1 -0
  457. package/dist/document/settled-index.js +247 -0
  458. package/dist/document/settled-index.js.map +1 -0
  459. package/dist/document/timeline.d.ts +29 -3
  460. package/dist/document/timeline.d.ts.map +1 -1
  461. package/dist/document/timeline.js +99 -3
  462. package/dist/document/timeline.js.map +1 -1
  463. package/dist/document/types.d.ts +4 -4
  464. package/dist/document/types.js.map +1 -1
  465. package/dist/document/validate.d.ts +1 -1
  466. package/dist/document/validate.js.map +1 -1
  467. package/dist/experimental.d.ts +22 -0
  468. package/dist/experimental.d.ts.map +1 -0
  469. package/dist/experimental.js +20 -0
  470. package/dist/experimental.js.map +1 -0
  471. package/dist/index.d.ts +10 -2
  472. package/dist/index.d.ts.map +1 -1
  473. package/dist/index.js +10 -2
  474. package/dist/index.js.map +1 -1
  475. package/dist/layout/types.d.ts +1 -1
  476. package/dist/layout/types.js.map +1 -1
  477. package/dist/nodes/audio/index.d.ts +2 -2
  478. package/dist/nodes/audio/index.d.ts.map +1 -1
  479. package/dist/nodes/audio/index.js +0 -2
  480. package/dist/nodes/audio/index.js.map +1 -1
  481. package/dist/nodes/audio/sound-node.d.ts +2 -1
  482. package/dist/nodes/audio/sound-node.d.ts.map +1 -1
  483. package/dist/nodes/audio/sound-node.js +3 -0
  484. package/dist/nodes/audio/sound-node.js.map +1 -1
  485. package/dist/nodes/index.d.ts +39 -27
  486. package/dist/nodes/index.d.ts.map +1 -1
  487. package/dist/nodes/index.js +16 -30
  488. package/dist/nodes/index.js.map +1 -1
  489. package/dist/nodes/node/node.d.ts +7 -1
  490. package/dist/nodes/node/node.d.ts.map +1 -1
  491. package/dist/nodes/node/node.js +23 -8
  492. package/dist/nodes/node/node.js.map +1 -1
  493. package/dist/nodes/root/canvas2d-node.d.ts +2 -1
  494. package/dist/nodes/root/canvas2d-node.d.ts.map +1 -1
  495. package/dist/nodes/root/canvas2d-node.js +3 -0
  496. package/dist/nodes/root/canvas2d-node.js.map +1 -1
  497. package/dist/nodes/text/richtext-node.d.ts +0 -5
  498. package/dist/nodes/text/richtext-node.d.ts.map +1 -1
  499. package/dist/nodes/text/richtext-node.js +5 -71
  500. package/dist/nodes/text/richtext-node.js.map +1 -1
  501. package/dist/nodes/text/text-base.d.ts +5 -22
  502. package/dist/nodes/text/text-base.d.ts.map +1 -1
  503. package/dist/nodes/text/text-base.js +12 -363
  504. package/dist/nodes/text/text-base.js.map +1 -1
  505. package/dist/nodes/text/text-layout.d.ts +87 -0
  506. package/dist/nodes/text/text-layout.d.ts.map +1 -0
  507. package/dist/nodes/text/text-layout.js +368 -0
  508. package/dist/nodes/text/text-layout.js.map +1 -0
  509. package/dist/nodes/three/canvas3d-node.d.ts +3 -1
  510. package/dist/nodes/three/canvas3d-node.d.ts.map +1 -1
  511. package/dist/nodes/three/canvas3d-node.js +6 -0
  512. package/dist/nodes/three/canvas3d-node.js.map +1 -1
  513. package/dist/props/host.d.ts +1 -1
  514. package/dist/props/host.js.map +1 -1
  515. package/dist/props/slot.d.ts +1 -1
  516. package/dist/props/slot.js +1 -1
  517. package/dist/props/slot.js.map +1 -1
  518. package/dist/render/clip.d.ts +1 -1
  519. package/dist/render/clip.js +1 -1
  520. package/dist/render/clip.js.map +1 -1
  521. package/dist/render/descriptors/rect.js.map +1 -1
  522. package/dist/render/descriptors/text.d.ts +11 -5
  523. package/dist/render/descriptors/text.d.ts.map +1 -1
  524. package/dist/render/descriptors/text.js +7 -1
  525. package/dist/render/descriptors/text.js.map +1 -1
  526. package/dist/render/render-context2d.d.ts +2 -2
  527. package/dist/render/render-context2d.js.map +1 -1
  528. package/dist/render3d/builders.d.ts +1 -1
  529. package/dist/render3d/builders.js +1 -1
  530. package/dist/render3d/builders.js.map +1 -1
  531. package/dist/render3d/graphics3d.d.ts +13 -19
  532. package/dist/render3d/graphics3d.d.ts.map +1 -1
  533. package/dist/render3d/graphics3d.js +13 -19
  534. package/dist/render3d/graphics3d.js.map +1 -1
  535. package/dist/render3d/scene3d.d.ts +1 -1
  536. package/dist/render3d/scene3d.js +1 -1
  537. package/dist/render3d/scene3d.js.map +1 -1
  538. package/dist/render3d/texture.d.ts +2 -2
  539. package/dist/render3d/texture.d.ts.map +1 -1
  540. package/dist/render3d/texture.js.map +1 -1
  541. package/dist/render3d/vector3.d.ts +2 -2
  542. package/dist/render3d/vector3.js +2 -2
  543. package/dist/render3d/vector3.js.map +1 -1
  544. package/dist/runtime/asset-refine.d.ts +1 -1
  545. package/dist/runtime/asset-refine.d.ts.map +1 -1
  546. package/dist/runtime/asset-refine.js +1 -1
  547. package/dist/runtime/asset-refine.js.map +1 -1
  548. package/dist/runtime/asset-update.js +1 -1
  549. package/dist/runtime/asset-update.js.map +1 -1
  550. package/dist/runtime/audio-index.d.ts +0 -11
  551. package/dist/runtime/audio-index.d.ts.map +1 -1
  552. package/dist/runtime/audio-index.js +0 -25
  553. package/dist/runtime/audio-index.js.map +1 -1
  554. package/dist/runtime/clip-instance.d.ts +7 -4
  555. package/dist/runtime/clip-instance.d.ts.map +1 -1
  556. package/dist/runtime/clip-instance.js +21 -7
  557. package/dist/runtime/clip-instance.js.map +1 -1
  558. package/dist/runtime/clip-store.d.ts +11 -3
  559. package/dist/runtime/clip-store.d.ts.map +1 -1
  560. package/dist/runtime/clip-store.js +83 -23
  561. package/dist/runtime/clip-store.js.map +1 -1
  562. package/dist/runtime/engine.d.ts +3 -3
  563. package/dist/runtime/engine.js +2 -2
  564. package/dist/runtime/engine.js.map +1 -1
  565. package/dist/runtime/node-picking.d.ts +2 -2
  566. package/dist/runtime/node-picking.d.ts.map +1 -1
  567. package/dist/runtime/node-picking.js +9 -10
  568. package/dist/runtime/node-picking.js.map +1 -1
  569. package/dist/runtime/node-picking3d.d.ts +12 -5
  570. package/dist/runtime/node-picking3d.d.ts.map +1 -1
  571. package/dist/runtime/node-picking3d.js +6 -1
  572. package/dist/runtime/node-picking3d.js.map +1 -1
  573. package/dist/runtime/playback-controller.d.ts +2 -2
  574. package/dist/runtime/playback-controller.d.ts.map +1 -1
  575. package/dist/runtime/playback-controller.js +1 -1
  576. package/dist/runtime/playback-controller.js.map +1 -1
  577. package/dist/runtime/state-evaluator.d.ts +2 -2
  578. package/dist/runtime/state-evaluator.d.ts.map +1 -1
  579. package/dist/runtime/state-evaluator.js.map +1 -1
  580. package/dist/runtime/text-geometry.d.ts +1 -1
  581. package/dist/runtime/text-geometry.d.ts.map +1 -1
  582. package/dist/runtime/text-geometry.js +6 -3
  583. package/dist/runtime/text-geometry.js.map +1 -1
  584. package/dist/sdk/index.d.ts +46 -21
  585. package/dist/sdk/index.d.ts.map +1 -1
  586. package/dist/sdk/index.js +47 -43
  587. package/dist/sdk/index.js.map +1 -1
  588. package/dist/tween/command-decorator.d.ts +7 -9
  589. package/dist/tween/command-decorator.d.ts.map +1 -1
  590. package/dist/tween/command-decorator.js +2 -2
  591. package/dist/tween/command-decorator.js.map +1 -1
  592. package/dist/tween/command.d.ts +13 -1
  593. package/dist/tween/command.d.ts.map +1 -1
  594. package/dist/tween/command.js +14 -0
  595. package/dist/tween/command.js.map +1 -1
  596. package/dist/tween/index.d.ts +2 -1
  597. package/dist/tween/index.d.ts.map +1 -1
  598. package/dist/tween/index.js +1 -1
  599. package/dist/tween/index.js.map +1 -1
  600. package/dist/tween/loop.d.ts +1 -1
  601. package/dist/tween/loop.js +1 -1
  602. package/dist/tween/loop.js.map +1 -1
  603. package/dist/util/reference.d.ts +6 -6
  604. package/dist/util/reference.js.map +1 -1
  605. package/package.json +7 -10
  606. package/dist/browser/chunks/chunk-FUZVFT3W.js +0 -18
  607. package/dist/browser/chunks/chunk-FUZVFT3W.js.map +0 -7
  608. package/dist/browser/chunks/chunk-QG6C23IJ.js +0 -3
  609. package/dist/browser/chunks/chunk-QG6C23IJ.js.map +0 -7
  610. package/dist/browser/chunks/chunk-SFNJRPBV.js +0 -2
  611. package/dist/browser/chunks/chunk-SFNJRPBV.js.map +0 -7
  612. package/dist/browser/jsx-jsx-dev-runtime.js +0 -2
  613. package/dist/browser/jsx-jsx-runtime.js +0 -2
  614. package/dist/browser/jsx-jsx-runtime.js.map +0 -7
  615. /package/dist/browser/{jsx-jsx-dev-runtime.js.map → experimental.js.map} +0 -0
@@ -0,0 +1,2 @@
1
+ var m={plain:"#.#",number:"#,##0.##",currency:"$#,##0.00",percent:"#,##0.#%"},b={prefix:"",suffix:"",grouped:!1,minInt:1,minFrac:0,maxFrac:1,percent:!1};function g(n,e){let t=!1;for(let r of n){if(r==="'"){t=!t;continue}e(r,t)}}function p(n,e){let t=!1;return g(n,(r,c)=>{r===e&&!c&&(t=!0)}),t}function d(n,e){let t="",r=!1;for(let c of n){if(c==="'"){r=!r,t+=c;continue}c===e&&!r||(t+=c)}return t}function x(n){let e="";return g(n,t=>{e+=t}),e}function N(n){let e=!1,t=-1;for(let r=0;r<n.length;r++){let c=n[r];if(c==="'"){if(e=!e,t>=0)return[t,r];continue}let o=!e&&"#0,.".includes(c);if(o&&t<0)t=r;else if(!o&&t>=0)return[t,r]}return t<0?null:[t,n.length]}function P(n){let e=N(n);if(!e)return b;let t=n.slice(e[0],e[1]),r=n.slice(0,e[0]),c=n.slice(e[1]),o=p(r,"%")||p(c,"%"),f=x(o?d(r,"%"):r),s=x(o?d(c,"%"):c),u=t.indexOf("."),i=u<0?t:t.slice(0,u),a=u<0?"":t.slice(u+1),l=(F,$)=>F.split($).length-1;return{prefix:f,suffix:o?`${s}%`:s,grouped:i.includes(","),minInt:Math.max(1,l(i,"0")),minFrac:l(a,"0"),maxFrac:a.length,percent:o}}var h=new Map;function S(n){let e=h.get(n);if(e)return e;let t=P(n);return h.set(n,t),t}function y(n){return n.replace(/\B(?=(\d{3})+(?!\d))/g,",")}function I(n,e){if(!Number.isFinite(n))return"";let t=S(e),c=(t.percent?n*100:n).toFixed(t.maxFrac),o=c.startsWith("-"),[f="0",s=""]=(o?c.slice(1):c).split("."),u=f.padStart(t.minInt,"0"),i=s;for(;i.length>t.minFrac&&i.endsWith("0");)i=i.slice(0,-1);let a=(t.grouped?y(u):u)+(i?`.${i}`:"");return`${o&&Number(c)!==0?"-":""}${t.prefix}${a}${t.suffix}`}function M(n,e){if(n==="custom"){let t=e?.trim()??"";return t===""?m.plain:t}return m[n??"plain"]??m.plain}var E=["number","currency","percent","custom"],A=10;function T(n){if(n.format==="custom")return M("custom",n.customPattern);let e=Math.min(A,Math.max(0,Math.round(n.fractionDigits))),t=n.grouped?"#,##0":"0",r=e>0?`.${"0".repeat(e)}`:"",c=`${t}${r}`;return n.format==="currency"?`${D(n.currencySymbol)}${c}`:n.format==="percent"?`${c}%`:c}function D(n){let e=n.replaceAll("'","");return e===""?"":`'${e}'`}function w(n){if(n<=0)return 1;let e=Math.pow(10,Math.floor(Math.log10(n))),t=n/e;return(t<=1?1:t<=2?2:t<=5?5:10)*e}function q(n,e,t,r){let c=t?n*.3:0,o=Math.max(0,n-c),f=Math.max(0,e-1);if(r!==void 0)return{step:r,per:Math.max(0,o-r*f),caption:c};let s=o/(1+f/5);return{step:s/5,per:s,caption:c}}export{m as a,I as b,M as c,E as d,A as e,T as f,w as g,q as h};
2
+ //# sourceMappingURL=chunk-LKUYVFU3.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/components/builtins/text/number-format.ts", "../../../src/components/builtins/text/number-pattern.ts", "../../../src/util/metrics.ts"],
4
+ "sourcesContent": ["/**\r\n * How a chart writes a number down.\r\n *\r\n * One formatter, driven by a **pattern**, and the named formats are patterns\r\n * too — `currency` is `$#,##0.00` and nothing more. That is the whole design:\r\n * a dropdown of four presets and a free-text pattern are otherwise two features\r\n * that drift, one of them gaining a thousands separator or a negative sign the\r\n * other never hears about. Here the preset *is* the custom case with the\r\n * pattern filled in, so there is one set of rules to get right.\r\n *\r\n * The grammar is the spreadsheet one, because that is where the numbers come\r\n * from and what an author already knows:\r\n *\r\n * | Pattern | 1234.5 | 0.07 |\r\n * | ------------ | --------- | ------ |\r\n * | `#,##0.##` | `1,234.5` | `0.07` |\r\n * | `0` | `1235` | `0` |\r\n * | `$#,##0.00` | `$1,234.50` | `$0.07` |\r\n * | `0.#%` | `123450%` | `7%` |\r\n * | `#,##0 kg` | `1,235 kg` | `0 kg` |\r\n *\r\n * - `0` is a digit that is always written, `#` one that is written only when\r\n * the number needs it. So `0.00` pads to two decimals and `0.##` trims.\r\n * - A `,` anywhere in the integer run turns grouping on; where it sits doesn't\r\n * matter, since `#,##0` and `#,###,##0` mean the same thing to everyone who\r\n * writes them.\r\n * - `%` scales by 100 as well as printing — that is what makes it a percent\r\n * rather than a suffix, and it is why `0.07` under `0.#%` is `7%`. A column\r\n * that is *already* in percent points wants `#,##0'%'`: quoted, so the sign\r\n * is printed and nothing is scaled.\r\n * - Anything else is literal, before the digits or after them. Quote it to be\r\n * sure — `'#'#,##0` prints a leading hash.\r\n *\r\n * Deliberately **not** `Intl.NumberFormat`. Its output is locale-dependent, and\r\n * a chart is a picture with a fixed layout: the same project rendering\r\n * `1,234.50` on the author's machine and `1.234,50` on the export box is a\r\n * silently different image, and the wider string can reflow an axis. What an\r\n * author wants here is the format they *typed*.\r\n */\r\n\r\n/** The named formats the inspector offers, plus the escape hatch. */\r\nexport type NumberFormatName = \"plain\" | \"number\" | \"currency\" | \"percent\" | \"custom\"\r\n\r\n/**\r\n * The pattern behind each named format.\r\n *\r\n * `plain` is the historic behaviour — integers bare, everything else to one\r\n * decimal — kept as the default so no existing chart re-labels itself. The rest\r\n * are the three formats a chart of money, counts or shares actually needs.\r\n */\r\nexport const NUMBER_PATTERNS: Record<Exclude<NumberFormatName, \"custom\">, string> = {\r\n // Ungrouped on purpose: this is what `formatMarker` did before there were\r\n // formats at all, and it is the default, so every chart already drawn keeps\r\n // the labels it has. Grouping is what the reader picks `number` for.\r\n plain: \"#.#\",\r\n number: \"#,##0.##\",\r\n currency: \"$#,##0.00\",\r\n percent: \"#,##0.#%\",\r\n}\r\n\r\n/** A pattern taken apart once, so formatting a tick is not a parse. */\r\ninterface ParsedPattern {\r\n prefix: string\r\n suffix: string\r\n grouped: boolean\r\n /** Digits always written left of the point — the count of `0`s there. */\r\n minInt: number\r\n /** Digits always written right of it. */\r\n minFrac: number\r\n /** The most that may be written right of it. */\r\n maxFrac: number\r\n /** Scale by 100 and print a `%`. */\r\n percent: boolean\r\n}\r\n\r\n/** What a pattern with no digits in it falls back to: the `plain` reading. */\r\nconst DEFAULT_PARSED: ParsedPattern = {\r\n prefix: \"\",\r\n suffix: \"\",\r\n grouped: false,\r\n minInt: 1,\r\n minFrac: 0,\r\n maxFrac: 1,\r\n percent: false,\r\n}\r\n\r\n/** Walk `text`, calling `visit` with each character and whether it is quoted. */\r\nfunction scan(text: string, visit: (ch: string, quoted: boolean) => void): void {\r\n let quoted = false\r\n for (const ch of text) {\r\n if (ch === \"'\") {\r\n quoted = !quoted\r\n continue\r\n }\r\n visit(ch, quoted)\r\n }\r\n}\r\n\r\n/** Does `text` hold `ch` outside quotes? */\r\nfunction hasBare(text: string, ch: string): boolean {\r\n let found = false\r\n scan(text, (c, quoted) => {\r\n if (c === ch && !quoted) found = true\r\n })\r\n return found\r\n}\r\n\r\n/** `text` with every unquoted `ch` dropped, quoting preserved. */\r\nfunction removeBare(text: string, ch: string): string {\r\n let out = \"\"\r\n let quoted = false\r\n for (const c of text) {\r\n if (c === \"'\") {\r\n quoted = !quoted\r\n out += c\r\n continue\r\n }\r\n if (c === ch && !quoted) continue\r\n out += c\r\n }\r\n return out\r\n}\r\n\r\n/** `text` with its quotes taken off — what actually gets printed. */\r\nfunction literal(text: string): string {\r\n let out = \"\"\r\n scan(text, (ch) => {\r\n out += ch\r\n })\r\n return out\r\n}\r\n\r\n/**\r\n * The `[start, end)` of the pattern's digit run — the first stretch of `#0,.`\r\n * outside quotes.\r\n *\r\n * Quote-aware, so `'#'#,##0` reads its leading hash as text and its run as the\r\n * three characters after it. Without that, a quoted `#` would be taken for the\r\n * number and the real digits for a suffix.\r\n */\r\nfunction digitRun(pattern: string): [number, number] | null {\r\n let quoted = false\r\n let start = -1\r\n for (let i = 0; i < pattern.length; i++) {\r\n const ch = pattern[i]\r\n if (ch === \"'\") {\r\n quoted = !quoted\r\n if (start >= 0) return [start, i]\r\n continue\r\n }\r\n const isDigit = !quoted && \"#0,.\".includes(ch)\r\n if (isDigit && start < 0) start = i\r\n else if (!isDigit && start >= 0) return [start, i]\r\n }\r\n return start < 0 ? null : [start, pattern.length]\r\n}\r\n\r\n/**\r\n * Split `pattern` into its literal edges and its digit run.\r\n *\r\n * Everything before the run is a prefix and everything after it a suffix, which\r\n * is what lets `$#,##0.00`, `#,##0 kg` and `€ #,##0` all work without the\r\n * language needing a quoting rule for the parts that are only ever text.\r\n */\r\nfunction parsePattern(pattern: string): ParsedPattern {\r\n const run = digitRun(pattern)\r\n if (!run) {\r\n // No digits at all is not a number format. Fall back rather than print the\r\n // literal for every tick, which would read as an axis of identical labels.\r\n return DEFAULT_PARSED\r\n }\r\n\r\n const digits = pattern.slice(run[0], run[1])\r\n const rawPrefix = pattern.slice(0, run[0])\r\n const rawSuffix = pattern.slice(run[1])\r\n\r\n // An **unquoted** `%` is the percent operator; a quoted one is a sign the\r\n // author wants printed over data that is already in percent points.\r\n const percent = hasBare(rawPrefix, \"%\") || hasBare(rawSuffix, \"%\")\r\n const prefix = literal(percent ? removeBare(rawPrefix, \"%\") : rawPrefix)\r\n const suffix = literal(percent ? removeBare(rawSuffix, \"%\") : rawSuffix)\r\n\r\n const point = digits.indexOf(\".\")\r\n const intPart = point < 0 ? digits : digits.slice(0, point)\r\n const fracPart = point < 0 ? \"\" : digits.slice(point + 1)\r\n\r\n const count = (s: string, ch: string) => s.split(ch).length - 1\r\n\r\n return {\r\n prefix,\r\n suffix: percent ? `${suffix}%` : suffix,\r\n grouped: intPart.includes(\",\"),\r\n minInt: Math.max(1, count(intPart, \"0\")),\r\n minFrac: count(fracPart, \"0\"),\r\n maxFrac: fracPart.length,\r\n percent,\r\n }\r\n}\r\n\r\n/** Parsed patterns are reused across every tick of every frame. */\r\nconst cache = new Map<string, ParsedPattern>()\r\n\r\nfunction parsed(pattern: string): ParsedPattern {\r\n const held = cache.get(pattern)\r\n if (held) return held\r\n const next = parsePattern(pattern)\r\n cache.set(pattern, next)\r\n return next\r\n}\r\n\r\n/** `1234567` → `1,234,567`. Only the integer run is grouped. */\r\nfunction group(digits: string): string {\r\n return digits.replace(/\\B(?=(\\d{3})+(?!\\d))/g, \",\")\r\n}\r\n\r\n/**\r\n * `value` written the way `pattern` says.\r\n *\r\n * A non-finite value prints empty rather than `NaN`: a tick with no number\r\n * behind it is a tick that shouldn't caption itself, and `NaN` on an axis reads\r\n * as a broken chart rather than as missing data.\r\n */\r\nexport function formatNumber(value: number, pattern: string): string {\r\n if (!Number.isFinite(value)) return \"\"\r\n const p = parsed(pattern)\r\n\r\n const scaled = p.percent ? value * 100 : value\r\n const rounded = scaled.toFixed(p.maxFrac)\r\n // Rounding is what decides the sign, not the input: -0.001 at two decimals is\r\n // \"0.00\", and printing it as \"-0.00\" puts a minus sign on an axis's zero.\r\n const negative = rounded.startsWith(\"-\")\r\n const [rawInt = \"0\", rawFrac = \"\"] = (\r\n negative ? rounded.slice(1) : rounded\r\n ).split(\".\")\r\n\r\n const intDigits = rawInt.padStart(p.minInt, \"0\")\r\n // `#` trims, `0` pads: drop trailing zeros down to the required minimum.\r\n let frac = rawFrac\r\n while (frac.length > p.minFrac && frac.endsWith(\"0\")) frac = frac.slice(0, -1)\r\n\r\n const body = (p.grouped ? group(intDigits) : intDigits) + (frac ? `.${frac}` : \"\")\r\n const sign = negative && Number(rounded) !== 0 ? \"-\" : \"\"\r\n return `${sign}${p.prefix}${body}${p.suffix}`\r\n}\r\n\r\n/**\r\n * The pattern a `(format, custom)` pair names.\r\n *\r\n * A blank custom pattern falls back to the plain one rather than to the empty\r\n * string, so an axis switched to Custom is readable while it is being typed\r\n * into rather than a column of nothing.\r\n */\r\nexport function patternFor(\r\n format: NumberFormatName | undefined,\r\n custom: string | undefined\r\n): string {\r\n if (format === \"custom\") {\r\n const trimmed = custom?.trim() ?? \"\"\r\n return trimmed === \"\" ? NUMBER_PATTERNS.plain : trimmed\r\n }\r\n return NUMBER_PATTERNS[format ?? \"plain\"] ?? NUMBER_PATTERNS.plain\r\n}\r\n", "/**\r\n * The Number node's format controls, resolved into the one pattern the app's\r\n * formatter takes.\r\n *\r\n * There is already exactly one answer in this package to \"how is a number\r\n * written down\" — `./number-format`, whose docblock has the grammar and\r\n * the argument for it. This module adds no second one. What it adds is the\r\n * *panel's* half: a figure on the canvas is set up by picking a format and\r\n * saying how many decimals, where a chart axis is set up by picking a preset,\r\n * and those two are the same statement typed differently.\r\n *\r\n * So the controls compose a pattern rather than being honoured beside one. A\r\n * Number node showing `$1,234.50` and an axis labelled `$#,##0.00` go through\r\n * the same parser and round the same way, which is the thing that would drift\r\n * if the node reached for `Intl.NumberFormat` instead.\r\n */\r\n\r\nimport { patternFor } from \"./number-format\";\r\n\r\n/**\r\n * How a Number node writes its figure.\r\n *\r\n * The chart's five minus `plain`, which exists there only to keep charts drawn\r\n * before there were formats labelling themselves the way they always have. A\r\n * node has no such history, and \"plain\" beside \"number\" is a distinction\r\n * nobody browsing a dropdown can make.\r\n */\r\nexport const NUMBER_NODE_FORMATS = [\r\n \"number\",\r\n \"currency\",\r\n \"percent\",\r\n \"custom\",\r\n] as const\r\n\r\nexport type NumberNodeFormat = (typeof NUMBER_NODE_FORMATS)[number]\r\n\r\n/** The most decimals the panel will let a figure carry. */\r\nexport const MAX_FRACTION_DIGITS = 10\r\n\r\n/** The Number node's format controls, as the class holds them. */\r\nexport interface NumberFormatOptions {\r\n /** How the figure is written — see {@link NumberNode.format}. */\r\n format: string\r\n /** The pattern typed by hand — read only when the format is `custom`. */\r\n customPattern: string\r\n fractionDigits: number\r\n grouped: boolean\r\n /** Printed before the figure when the format is `currency`. */\r\n currencySymbol: string\r\n}\r\n\r\n/**\r\n * The pattern `options` names.\r\n *\r\n * `custom` hands the typed pattern straight to {@link patternFor}, which is what\r\n * makes the escape hatch the *same* language the presets are written in rather\r\n * than a second one. Every other format is composed here, because the three\r\n * controls beside the dropdown — decimals, grouping, the symbol — are what a\r\n * preset would otherwise have to be duplicated for (`#,##0.00` and `#,##0.000`\r\n * and `0.00` and…).\r\n */\r\nexport function numberNodePattern(options: NumberFormatOptions): string {\r\n if (options.format === \"custom\") {\r\n return patternFor(\"custom\", options.customPattern)\r\n }\r\n\r\n const digits = Math.min(\r\n MAX_FRACTION_DIGITS,\r\n Math.max(0, Math.round(options.fractionDigits))\r\n )\r\n const integer = options.grouped ? \"#,##0\" : \"0\"\r\n const fraction = digits > 0 ? `.${\"0\".repeat(digits)}` : \"\"\r\n const body = `${integer}${fraction}`\r\n\r\n if (options.format === \"currency\") {\r\n return `${quoted(options.currencySymbol)}${body}`\r\n }\r\n // Bare, so the parser reads it as the percent *operator* and scales by 100 —\r\n // which is what makes a stored 0.42 read as \"42%\". A symbol an author wants\r\n // printed over data that is already in percent points is a custom pattern\r\n // with the sign quoted, exactly as it is on an axis.\r\n if (options.format === \"percent\") return `${body}%`\r\n return body\r\n}\r\n\r\n/**\r\n * `symbol` as a pattern literal.\r\n *\r\n * Quoted rather than concatenated, because the two most likely symbols after `$`\r\n * are `€` and `£` and the two after those are whatever an author types — and an\r\n * unquoted `#`, `0`, `,`, `.` or `%` in there would be read as part of the\r\n * number. The quote character itself is dropped rather than escaped: the grammar\r\n * has no escape for it, and a currency symbol containing an apostrophe is not a\r\n * thing anyone has.\r\n */\r\nfunction quoted(symbol: string): string {\r\n const literal = symbol.replaceAll(\"'\", \"\")\r\n return literal === \"\" ? \"\" : `'${literal}'`\r\n}\r\n", "/**\r\n * Two numbers a component ends up needing, neither of which belongs to any one\r\n * of them.\r\n *\r\n * Both were written for the chart family and are used well outside it — a\r\n * graph's plane rounds its ticks with one, a diagram divides its entrance with\r\n * the other. Leaving them there would make a package with nothing to do with\r\n * charts depend on charts for a page of arithmetic.\r\n */\r\n\r\n/** Round a raw step up to a tidy value (1/2/5 × 10ⁿ) so markers land round. */\r\nexport function niceStep(raw: number): number {\r\n if (raw <= 0) return 1\r\n const mag = Math.pow(10, Math.floor(Math.log10(raw)))\r\n const norm = raw / mag\r\n const nice = norm <= 1 ? 1 : norm <= 2 ? 2 : norm <= 5 ? 5 : 10\r\n return nice * mag\r\n}\r\n\r\n/**\r\n * How an axis's staggered entrance is divided up, so the whole thing fits inside\r\n * `duration` instead of running past it.\r\n *\r\n * The standalone components this family was ported from read `duration` as *one\r\n * marker's* slide, and then added the stagger between them and a full-length\r\n * caption move on the end — so `enter(0.8)` on a five-marker axis actually took\r\n * about 2.2 seconds. That's fine when a scene is a hand-written script whose\r\n * beats are whatever they turn out to be. It is not fine here: an editor lays a\r\n * command out on the timeline at the duration it declares, times its parallel\r\n * siblings against it, and sums those durations into the scene's length. A\r\n * generator that overruns is a command that renders in the wrong place.\r\n *\r\n * So the budget runs the other way: the caption takes a fixed share off the top,\r\n * and the markers' per-move duration is solved for from what's left, given the\r\n * stagger. Same shape of animation, honest arithmetic.\r\n */\r\nexport function enterBudget(\r\n duration: number,\r\n count: number,\r\n hasCaption: boolean,\r\n /** An explicit gap between markers; derived from `duration` when omitted. */\r\n stagger?: number\r\n): { step: number; per: number; caption: number } {\r\n // The caption lands *after* the last marker, so it needs its own slice.\r\n const caption = hasCaption ? duration * 0.3 : 0\r\n const markers = Math.max(0, duration - caption)\r\n const gaps = Math.max(0, count - 1)\r\n\r\n if (stagger !== undefined) {\r\n // An explicit gap wins; the per-marker move takes whatever is left, and\r\n // can't go negative on an axis with more markers than budget.\r\n return {\r\n step: stagger,\r\n per: Math.max(0, markers - stagger * gaps),\r\n caption,\r\n }\r\n }\r\n // Default rhythm: each gap is a fifth of a marker's own move, which is the\r\n // ratio the original used — solved for here rather than assumed.\r\n const per = markers / (1 + gaps / 5)\r\n return { step: per / 5, per, caption }\r\n}\r\n"],
5
+ "mappings": "AAkDO,IAAMA,EAAuE,CAIlF,MAAO,MACP,OAAQ,WACR,SAAU,YACV,QAAS,YAmBLC,EAAgC,CACpC,OAAQ,GACR,OAAQ,GACR,QAAS,GACT,OAAQ,EACR,QAAS,EACT,QAAS,EACT,QAAS,IAIX,SAASC,EAAKC,EAAcC,EAA4C,CACtE,IAAIC,EAAS,GACb,QAAWC,KAAMH,EAAM,CACrB,GAAIG,IAAO,IAAK,CACdD,EAAS,CAACA,EACV,QACF,CACAD,EAAME,EAAID,CAAM,CAClB,CACF,CAGA,SAASE,EAAQJ,EAAcG,EAAU,CACvC,IAAIE,EAAQ,GACZ,OAAAN,EAAKC,EAAM,CAACM,EAAGJ,IAAU,CACnBI,IAAMH,GAAM,CAACD,IAAQG,EAAQ,GACnC,CAAC,EACMA,CACT,CAGA,SAASE,EAAWP,EAAcG,EAAU,CAC1C,IAAIK,EAAM,GACNN,EAAS,GACb,QAAW,KAAKF,EAAM,CACpB,GAAI,IAAM,IAAK,CACbE,EAAS,CAACA,EACVM,GAAO,EACP,QACF,CACI,IAAML,GAAM,CAACD,IACjBM,GAAO,EACT,CACA,OAAOA,CACT,CAGA,SAASC,EAAQT,EAAY,CAC3B,IAAIQ,EAAM,GACV,OAAAT,EAAKC,EAAOG,GAAM,CAChBK,GAAOL,CACT,CAAC,EACMK,CACT,CAUA,SAASE,EAASC,EAAe,CAC/B,IAAIT,EAAS,GACTU,EAAQ,GACZ,QAASC,EAAI,EAAGA,EAAIF,EAAQ,OAAQE,IAAK,CACvC,IAAMV,EAAKQ,EAAQE,CAAC,EACpB,GAAIV,IAAO,IAAK,CAEd,GADAD,EAAS,CAACA,EACNU,GAAS,EAAG,MAAO,CAACA,EAAOC,CAAC,EAChC,QACF,CACA,IAAMC,EAAU,CAACZ,GAAU,OAAO,SAASC,CAAE,EAC7C,GAAIW,GAAWF,EAAQ,EAAGA,EAAQC,UACzB,CAACC,GAAWF,GAAS,EAAG,MAAO,CAACA,EAAOC,CAAC,CACnD,CACA,OAAOD,EAAQ,EAAI,KAAO,CAACA,EAAOD,EAAQ,MAAM,CAClD,CASA,SAASI,EAAaJ,EAAe,CACnC,IAAMK,EAAMN,EAASC,CAAO,EAC5B,GAAI,CAACK,EAGH,OAAOlB,EAGT,IAAMmB,EAASN,EAAQ,MAAMK,EAAI,CAAC,EAAGA,EAAI,CAAC,CAAC,EACrCE,EAAYP,EAAQ,MAAM,EAAGK,EAAI,CAAC,CAAC,EACnCG,EAAYR,EAAQ,MAAMK,EAAI,CAAC,CAAC,EAIhCI,EAAUhB,EAAQc,EAAW,GAAG,GAAKd,EAAQe,EAAW,GAAG,EAC3DE,EAASZ,EAAQW,EAAUb,EAAWW,EAAW,GAAG,EAAIA,CAAS,EACjEI,EAASb,EAAQW,EAAUb,EAAWY,EAAW,GAAG,EAAIA,CAAS,EAEjEI,EAAQN,EAAO,QAAQ,GAAG,EAC1BO,EAAUD,EAAQ,EAAIN,EAASA,EAAO,MAAM,EAAGM,CAAK,EACpDE,EAAWF,EAAQ,EAAI,GAAKN,EAAO,MAAMM,EAAQ,CAAC,EAElDG,EAAQ,CAACC,EAAWxB,IAAewB,EAAE,MAAMxB,CAAE,EAAE,OAAS,EAE9D,MAAO,CACL,OAAAkB,EACA,OAAQD,EAAU,GAAGE,CAAM,IAAMA,EACjC,QAASE,EAAQ,SAAS,GAAG,EAC7B,OAAQ,KAAK,IAAI,EAAGE,EAAMF,EAAS,GAAG,CAAC,EACvC,QAASE,EAAMD,EAAU,GAAG,EAC5B,QAASA,EAAS,OAClB,QAAAL,EAEJ,CAGA,IAAMQ,EAAQ,IAAI,IAElB,SAASC,EAAOlB,EAAe,CAC7B,IAAMmB,EAAOF,EAAM,IAAIjB,CAAO,EAC9B,GAAImB,EAAM,OAAOA,EACjB,IAAMC,EAAOhB,EAAaJ,CAAO,EACjC,OAAAiB,EAAM,IAAIjB,EAASoB,CAAI,EAChBA,CACT,CAGA,SAASC,EAAMf,EAAc,CAC3B,OAAOA,EAAO,QAAQ,wBAAyB,GAAG,CACpD,CASM,SAAUgB,EAAaC,EAAevB,EAAe,CACzD,GAAI,CAAC,OAAO,SAASuB,CAAK,EAAG,MAAO,GACpC,IAAMC,EAAIN,EAAOlB,CAAO,EAGlByB,GADSD,EAAE,QAAUD,EAAQ,IAAMA,GAClB,QAAQC,EAAE,OAAO,EAGlCE,EAAWD,EAAQ,WAAW,GAAG,EACjC,CAACE,EAAS,IAAKC,EAAU,EAAE,GAC/BF,EAAWD,EAAQ,MAAM,CAAC,EAAIA,GAC9B,MAAM,GAAG,EAELI,EAAYF,EAAO,SAASH,EAAE,OAAQ,GAAG,EAE3CM,EAAOF,EACX,KAAOE,EAAK,OAASN,EAAE,SAAWM,EAAK,SAAS,GAAG,GAAGA,EAAOA,EAAK,MAAM,EAAG,EAAE,EAE7E,IAAMC,GAAQP,EAAE,QAAUH,EAAMQ,CAAS,EAAIA,IAAcC,EAAO,IAAIA,CAAI,GAAK,IAE/E,MAAO,GADMJ,GAAY,OAAOD,CAAO,IAAM,EAAI,IAAM,EACzC,GAAGD,EAAE,MAAM,GAAGO,CAAI,GAAGP,EAAE,MAAM,EAC7C,CASM,SAAUQ,EACdC,EACAC,EAA0B,CAE1B,GAAID,IAAW,SAAU,CACvB,IAAME,EAAUD,GAAQ,KAAI,GAAM,GAClC,OAAOC,IAAY,GAAKjD,EAAgB,MAAQiD,CAClD,CACA,OAAOjD,EAAgB+C,GAAU,OAAO,GAAK/C,EAAgB,KAC/D,CC1OO,IAAMkD,EAAsB,CACjC,SACA,WACA,UACA,UAMWC,EAAsB,GAwB7B,SAAUC,EAAkBC,EAA4B,CAC5D,GAAIA,EAAQ,SAAW,SACrB,OAAOC,EAAW,SAAUD,EAAQ,aAAa,EAGnD,IAAME,EAAS,KAAK,IAClBJ,EACA,KAAK,IAAI,EAAG,KAAK,MAAME,EAAQ,cAAc,CAAC,CAAC,EAE3CG,EAAUH,EAAQ,QAAU,QAAU,IACtCI,EAAWF,EAAS,EAAI,IAAI,IAAI,OAAOA,CAAM,CAAC,GAAK,GACnDG,EAAO,GAAGF,CAAO,GAAGC,CAAQ,GAElC,OAAIJ,EAAQ,SAAW,WACd,GAAGM,EAAON,EAAQ,cAAc,CAAC,GAAGK,CAAI,GAM7CL,EAAQ,SAAW,UAAkB,GAAGK,CAAI,IACzCA,CACT,CAYA,SAASC,EAAOC,EAAc,CAC5B,IAAMC,EAAUD,EAAO,WAAW,IAAK,EAAE,EACzC,OAAOC,IAAY,GAAK,GAAK,IAAIA,CAAO,GAC1C,CCvFM,SAAUC,EAASC,EAAW,CAClC,GAAIA,GAAO,EAAG,MAAO,GACrB,IAAMC,EAAM,KAAK,IAAI,GAAI,KAAK,MAAM,KAAK,MAAMD,CAAG,CAAC,CAAC,EAC9CE,EAAOF,EAAMC,EAEnB,OADaC,GAAQ,EAAI,EAAIA,GAAQ,EAAI,EAAIA,GAAQ,EAAI,EAAI,IAC/CD,CAChB,CAmBM,SAAUE,EACdC,EACAC,EACAC,EAEAC,EAAgB,CAGhB,IAAMC,EAAUF,EAAaF,EAAW,GAAM,EACxCK,EAAU,KAAK,IAAI,EAAGL,EAAWI,CAAO,EACxCE,EAAO,KAAK,IAAI,EAAGL,EAAQ,CAAC,EAElC,GAAIE,IAAY,OAGd,MAAO,CACL,KAAMA,EACN,IAAK,KAAK,IAAI,EAAGE,EAAUF,EAAUG,CAAI,EACzC,QAAAF,GAKJ,IAAMG,EAAMF,GAAW,EAAIC,EAAO,GAClC,MAAO,CAAE,KAAMC,EAAM,EAAG,IAAAA,EAAK,QAAAH,CAAO,CACtC",
6
+ "names": ["NUMBER_PATTERNS", "DEFAULT_PARSED", "scan", "text", "visit", "quoted", "ch", "hasBare", "found", "c", "removeBare", "out", "literal", "digitRun", "pattern", "start", "i", "isDigit", "parsePattern", "run", "digits", "rawPrefix", "rawSuffix", "percent", "prefix", "suffix", "point", "intPart", "fracPart", "count", "s", "cache", "parsed", "held", "next", "group", "formatNumber", "value", "p", "rounded", "negative", "rawInt", "rawFrac", "intDigits", "frac", "body", "patternFor", "format", "custom", "trimmed", "NUMBER_NODE_FORMATS", "MAX_FRACTION_DIGITS", "numberNodePattern", "options", "patternFor", "digits", "integer", "fraction", "body", "quoted", "symbol", "literal", "niceStep", "raw", "mag", "norm", "enterBudget", "duration", "count", "hasCaption", "stagger", "caption", "markers", "gaps", "per"]
7
+ }
@@ -0,0 +1,5 @@
1
+ import{A as mo,a as he,b as u,c as co,d as b,e as $n,g as uo,h as z,m as te,p as fo,t as ho,u as _t,v as po}from"./chunk-ZRPZPWZU.js";function yo(t){return{topLeft:t,topRight:t,bottomLeft:t,bottomRight:t}}function Hl(t,e){return{topLeft:t.top??e.topLeft,topRight:t.top??e.topRight,bottomLeft:t.bottom??e.bottomLeft,bottomRight:t.bottom??e.bottomRight}}function Yl(t,e){return{topLeft:t.left??e.topLeft,topRight:t.right??e.topRight,bottomLeft:t.left??e.bottomLeft,bottomRight:t.right??e.bottomRight}}function St(t,e,n,r){if(r(t))return yo(t);let o=n??yo(e),i=t;if("topLeft"in i||"topRight"in i||"bottomLeft"in i||"bottomRight"in i){let s=t;return{topLeft:s.topLeft??o.topLeft,topRight:s.topRight??o.topRight,bottomLeft:s.bottomLeft??o.bottomLeft,bottomRight:s.bottomRight??o.bottomRight}}return"top"in i||"bottom"in i?Hl(t,o):"left"in i||"right"in i?Yl(t,o):{...o}}function vt(t,e,n,r){return{topLeft:r(t.topLeft,e.topLeft,n),topRight:r(t.topRight,e.topRight,n),bottomLeft:r(t.bottomLeft,e.bottomLeft,n),bottomRight:r(t.bottomRight,e.bottomRight,n)}}function kt(t,e=Object.is){return e(t.topLeft,t.topRight)&&e(t.topLeft,t.bottomLeft)&&e(t.topLeft,t.bottomRight)}var De={resolve:(t,e)=>St(t,0,e,n=>typeof n=="number"),lerp:(t,e,n)=>vt(t,e,n,u),isUniformInput:t=>typeof t=="number",isUniform:t=>kt(t),isZero:t=>t.topLeft===0&&t.topRight===0&&t.bottomLeft===0&&t.bottomRight===0};var Vn={resolve:(t,e)=>St(t,"rounded",e,n=>n==="rounded"||n==="angled"),lerp:(t,e,n)=>vt(t,e,n,(r,o)=>n<.5?r:o),isUniformInput:t=>t==="rounded"||t==="angled",isUniform:t=>kt(t)},Uh=(t,e,n)=>n<.5?t:e;function Ke(t){switch(t){case"x":return{x:1,y:0};case"y":return{x:0,y:1};case"both":return{x:1,y:1};default:return{x:t.x,y:t.y}}}function ye(t,e){let n=Ke(t),r=Ke(e);return n.x===r.x&&n.y===r.y}function F(t){return Array.isArray(t)?t:z(t)}function G(t,e){if(t===e)return!0;let n=F(t),r=F(e);return n[0]===r[0]&&n[1]===r[1]&&n[2]===r[2]&&n[3]===r[3]}var Hn=["mode","clip"];function C(t,e){let n={...t};if(!e)return n;for(let r of Hn){let o=e[r];o!==void 0&&(n[r]=o)}return n}function A(t,e){return t===void 0?{}:typeof t=="number"?{[e]:t}:t}function Mt(t){switch(t){case"behind":return-1;case"centered":return 0;case"ahead":return 1;default:return Math.max(-1,Math.min(1,t))}}var go={lerp:(t,e,n)=>({type:"motionBlur",length:u(t.length,e.length,n),alignment:u(Mt(t.alignment),Mt(e.alignment),n),samples:u(t.samples,e.samples,n),strength:u(t.strength,e.strength,n),axis:b(Ke(t.axis),Ke(e.axis),n),mode:n<.5?t.mode:e.mode}),equals:(t,e)=>t.length===e.length&&Mt(t.alignment)===Mt(e.alignment)&&t.samples===e.samples&&t.strength===e.strength&&ye(t.axis,e.axis)&&t.mode===e.mode};function L(t,e,n){return[t[0]+(e[0]-t[0])*n,t[1]+(e[1]-t[1])*n,t[2]+(e[2]-t[2])*n,t[3]+(e[3]-t[3])*n]}var Re={resolve:xo,lerp:L,hex(t){let[e,n,r,o]=xo(t),i=Ct(o);return`#${Ct(e)}${Ct(n)}${Ct(r)}${i==="ff"?"":i}`}};function xo(t){return Array.isArray(t)?t:z(t)}function Ct(t){return Math.round(Math.min(1,Math.max(0,t))*255).toString(16).padStart(2,"0")}var Xl={standard:" .:-=+*#%@",blocks:" \u2591\u2592\u2593\u2588",braille:" \u2804\u28C0\u28C4\u28E4\u28F6\u28F7\u28FF",binary:"01",hex:"0123456789ABCDEF"};function ad(t){return Xl[t]??t}var wo={lerp:(t,e,n)=>({type:"ascii",size:u(t.size,e.size,n),charset:n<.5?t.charset:e.charset,fontFamily:n<.5?t.fontFamily:e.fontFamily,ink:L(F(t.ink),F(e.ink),n),background:L(F(t.background),F(e.background),n),colored:n<.5?t.colored:e.colored,mode:n<.5?t.mode:e.mode}),equals:(t,e)=>t.size===e.size&&t.charset===e.charset&&t.fontFamily===e.fontFamily&&G(t.ink,e.ink)&&G(t.background,e.background)&&t.colored===e.colored&&t.mode===e.mode,surface:"shader"};var bt=new Set;function Ie(t,e){let n=`${t}\0${e}`;bt.has(n)||(bt.size>512&&bt.clear(),bt.add(n),console.warn(`[SkSL] ${e}`))}function Ul(t,e){if(typeof e=="number")return Number.isFinite(e)?e:(Ie("normalize",`uniform "${t}" is ${e}; ignoring it.`),null);if(!Array.isArray(e))return Ie("normalize",`uniform "${t}" is not a number or number array; ignoring it.`),null;let n=e.flat(1/0),r=[];for(let o of n){if(typeof o!="number"||!Number.isFinite(o))return Ie("normalize",`uniform "${t}" contains a non-finite entry; ignoring it.`),null;r.push(o)}return r}function oe(t){if(!t)return{};let e=Array.isArray(t)?t.map(r=>[r.name,r.value]):Object.entries(t),n={};for(let[r,o]of e.sort(([i],[s])=>i<s?-1:i>s?1:0)){let i=Ul(r,o);i!==null&&(n[r]=i)}return n}function Gl(t,e,n){if(typeof t=="number"&&typeof e=="number")return u(t,e,n);if(Array.isArray(t)&&Array.isArray(e)){let r=Math.max(t.length,e.length);return Array.from({length:r},(o,i)=>u(t[i]??0,e[i]??0,n))}return n<.5?t:e}function Kl(t,e){return typeof t=="number"&&typeof e=="number"?t===e:Array.isArray(t)&&Array.isArray(e)?t.length===e.length&&t.every((n,r)=>n===e[r]):!1}function At(t,e,n){let r={};for(let o of[...Object.keys(t),...Object.keys(e)].sort()){if(o in r)continue;let i=t[o],s=e[o];i===void 0?r[o]=s:s===void 0?r[o]=i:r[o]=Gl(i,s,n)}return r}function Ot(t,e){let n=Object.keys(t);return n.length!==Object.keys(e).length?!1:n.every(r=>{let o=e[r];return o!==void 0&&Kl(t[r],o)})}function ud(t){let e=[],n=t.getUniformCount();for(let r=0;r<n;r++){let o=t.getUniform(r);e.push({name:t.getUniformName(r),slot:o.slot,length:Math.max(1,o.columns*o.rows),isInteger:!!o.isInteger})}return e}function fd(t,e,n,r,o){let i=new Float32Array(Math.max(0,e)),s=new Int32Array(i.buffer);for(let a of t){let l=a.name in n?n[a.name]:r[a.name];if(l===void 0){Ie(o,`uniform "${a.name}" is declared but was not supplied; it will read as 0.`);continue}let c=typeof l=="number"?[l]:l;c.length!==a.length&&Ie(o,`uniform "${a.name}" expects ${a.length} float(s) but got ${c.length}; the rest will read as 0.`);let f=Math.min(c.length,a.length);for(let h=0;h<f;h++){let d=a.slot+h;if(d<0||d>=i.length)break;a.isInteger?s[d]=Math.round(c[h]):i[d]=c[h]}}for(let a of Object.keys(n))t.some(l=>l.name===a)||Ie(o,`uniform "${a}" was supplied but the shader declares no such uniform.`);return i}function hd(t,e){let n=e.right-e.left,r=e.bottom-e.top;switch(t){case"centered":return[r,0,e.left+n/2,0,r,e.top+r/2,0,0,1];case"normalized":return[n,0,e.left,0,r,e.top,0,0,1];default:return[1,0,0,0,1,0,0,0,1]}}var _o=/\buniform\s+(shader|colorFilter|blender)\s+([A-Za-z_]\w*)\s*;/g;function dd(t){let e=t.replace(/\/\*[\s\S]*?\*\//g," ").replace(/\/\/[^\n]*/g," "),n=[];_o.lastIndex=0;let r;for(;(r=_o.exec(e))!==null;)n.push({kind:r[1],name:r[2]});return n}var So={lerp:(t,e,n)=>({type:"blur",radius:u(t.radius,e.radius,n),mode:n<.5?t.mode:e.mode}),equals:(t,e)=>t.radius===e.radius&&t.mode===e.mode};var vo={lerp:(t,e,n)=>({type:"directionalBlur",radius:u(t.radius,e.radius,n),angle:u(t.angle,e.angle,n),mode:n<.5?t.mode:e.mode}),equals:(t,e)=>t.radius===e.radius&&t.angle===e.angle&&t.mode===e.mode};var ko={lerp:(t,e,n)=>({type:"grayscale",amount:u(t.amount,e.amount,n),mode:n<.5?t.mode:e.mode}),equals:(t,e)=>t.amount===e.amount&&t.mode===e.mode};var Mo={lerp:(t,e,n)=>({type:"pixelate",blocks:b(t.blocks,e.blocks,n),sharpColors:n<.5?t.sharpColors:e.sharpColors,mode:n<.5?t.mode:e.mode}),equals:(t,e)=>t.blocks.x===e.blocks.x&&t.blocks.y===e.blocks.y&&t.sharpColors===e.sharpColors&&t.mode===e.mode};var Co={lerp:(t,e,n)=>({type:"bulge",strength:u(t.strength,e.strength,n),center:b(t.center,e.center,n),mode:n<.5?t.mode:e.mode}),equals:(t,e)=>t.strength===e.strength&&t.center.x===e.center.x&&t.center.y===e.center.y&&t.mode===e.mode,surface:"shader"};var bo={lerp:(t,e,n)=>({type:"magnify",center:b(t.center,e.center,n),scale:u(t.scale,e.scale,n),mode:n<.5?t.mode:e.mode}),equals:(t,e)=>t.center.x===e.center.x&&t.center.y===e.center.y&&t.scale===e.scale&&t.mode===e.mode,surface:"shader"};var Ao={lerp:(t,e,n)=>({type:"bloom",threshold:u(t.threshold,e.threshold,n),radius:u(t.radius,e.radius,n),intensity:u(t.intensity,e.intensity,n),mode:n<.5?t.mode:e.mode}),equals:(t,e)=>t.threshold===e.threshold&&t.radius===e.radius&&t.intensity===e.intensity&&t.mode===e.mode};var Oo={lerp:(t,e,n)=>({type:"vintage",amount:u(t.amount,e.amount,n),warmth:u(t.warmth,e.warmth,n),mode:n<.5?t.mode:e.mode}),equals:(t,e)=>t.amount===e.amount&&t.warmth===e.warmth&&t.mode===e.mode};var Eo={lerp:(t,e,n)=>({type:"chromaticAberration",amount:u(t.amount,e.amount,n),angle:u(t.angle,e.angle,n),mode:n<.5?t.mode:e.mode}),equals:(t,e)=>t.amount===e.amount&&t.angle===e.angle&&t.mode===e.mode};var To={lerp:(t,e,n)=>({type:"invert",channel:n<.5?t.channel:e.channel,strength:u(t.strength,e.strength,n),mode:n<.5?t.mode:e.mode}),equals:(t,e)=>t.channel===e.channel&&t.strength===e.strength&&t.mode===e.mode};var Po={lerp:(t,e,n)=>({type:"scatter",strength:u(t.strength,e.strength,n),axis:n<.5?t.axis:e.axis,mode:n<.5?t.mode:e.mode}),equals:(t,e)=>t.strength===e.strength&&ye(t.axis,e.axis)&&t.mode===e.mode,surface:"shader"};var zo={lerp:(t,e,n)=>({type:"posterize",levels:u(t.levels,e.levels,n),mode:n<.5?t.mode:e.mode}),equals:(t,e)=>t.levels===e.levels&&t.mode===e.mode,surface:"shader"};var Fo={resolve:t=>{let e=t;if(!(t.type!=="shader"||e.shader!==void 0))return t;let{shader:r,...o}=e;return{...o,type:"shader",source:t.source??r??""}},lerp:(t,e,n)=>{let r=n<.5?t:e;return{type:"shader",source:r.source,...r.shaderId!==void 0?{shaderId:r.shaderId}:{},mode:r.mode,blendMode:r.blendMode,uniforms:At(oe(t.uniforms),oe(e.uniforms),n)}},equals:(t,e)=>t.source===e.source&&t.mode===e.mode&&t.blendMode===e.blendMode&&Ot(oe(t.uniforms),oe(e.uniforms)),surface:t=>t.mode==="backdrop"?"shader":"filter"};var No={lerp:(t,e,n)=>({type:"outline",width:u(t.width,e.width,n),color:L(F(t.color),F(e.color),n),position:n<.5?t.position:e.position,mode:n<.5?t.mode:e.mode}),equals:(t,e)=>t.width===e.width&&G(t.color,e.color)&&t.position===e.position&&t.mode===e.mode,surface:"shader"};var Do={lerp:(t,e,n)=>({type:"dropShadow",offsetX:u(t.offsetX,e.offsetX,n),offsetY:u(t.offsetY,e.offsetY,n),blur:u(t.blur,e.blur,n),spread:u(t.spread,e.spread,n),color:L(F(t.color),F(e.color),n),mode:n<.5?t.mode:e.mode}),equals:(t,e)=>t.offsetX===e.offsetX&&t.offsetY===e.offsetY&&t.blur===e.blur&&t.spread===e.spread&&G(t.color,e.color)&&t.mode===e.mode,surface:"shader"};var Ro={lerp:(t,e,n)=>({type:"vignette",amount:u(t.amount,e.amount,n),radius:u(t.radius,e.radius,n),softness:u(t.softness,e.softness,n),color:L(F(t.color),F(e.color),n),mode:n<.5?t.mode:e.mode}),equals:(t,e)=>t.amount===e.amount&&t.radius===e.radius&&t.softness===e.softness&&G(t.color,e.color)&&t.mode===e.mode,surface:"shader"};var Io={lerp:(t,e,n)=>({type:"grain",amount:u(t.amount,e.amount,n),size:u(t.size,e.size,n),seed:u(t.seed,e.seed,n),animated:n<.5?t.animated:e.animated,colored:n<.5?t.colored:e.colored,mode:n<.5?t.mode:e.mode}),equals:(t,e)=>t.amount===e.amount&&t.size===e.size&&t.seed===e.seed&&t.animated===e.animated&&t.colored===e.colored&&t.mode===e.mode,surface:"shader"};var Lo={lerp:(t,e,n)=>({type:"sharpen",amount:u(t.amount,e.amount,n),radius:u(t.radius,e.radius,n),mode:n<.5?t.mode:e.mode}),equals:(t,e)=>t.amount===e.amount&&t.radius===e.radius&&t.mode===e.mode,surface:"shader"};var Bo={lerp:(t,e,n)=>({type:"edges",strength:u(t.strength,e.strength,n),kernel:n<.5?t.kernel:e.kernel,colored:n<.5?t.colored:e.colored,mode:n<.5?t.mode:e.mode}),equals:(t,e)=>t.strength===e.strength&&t.kernel===e.kernel&&t.colored===e.colored&&t.mode===e.mode,surface:"shader"};var jo={lerp:(t,e,n)=>({type:"threshold",level:u(t.level,e.level,n),smoothness:u(t.smoothness,e.smoothness,n),mode:n<.5?t.mode:e.mode}),equals:(t,e)=>t.level===e.level&&t.smoothness===e.smoothness&&t.mode===e.mode,surface:"shader"};var Wo={lerp:(t,e,n)=>({type:"radialBlur",amount:u(t.amount,e.amount,n),style:n<.5?t.style:e.style,center:b(t.center,e.center,n),samples:n<.5?t.samples:e.samples,mode:n<.5?t.mode:e.mode}),equals:(t,e)=>t.amount===e.amount&&t.style===e.style&&t.center.x===e.center.x&&t.center.y===e.center.y&&t.samples===e.samples&&t.mode===e.mode,surface:"shader"};var qo={lerp:(t,e,n)=>({type:"halftone",size:u(t.size,e.size,n),angle:u(t.angle,e.angle,n),shape:n<.5?t.shape:e.shape,separation:n<.5?t.separation:e.separation,mode:n<.5?t.mode:e.mode}),equals:(t,e)=>t.size===e.size&&t.angle===e.angle&&t.shape===e.shape&&t.separation===e.separation&&t.mode===e.mode,surface:"shader"};var $o={lerp:(t,e,n)=>({type:"dither",levels:u(t.levels,e.levels,n),matrix:n<.5?t.matrix:e.matrix,scale:u(t.scale,e.scale,n),monochrome:n<.5?t.monochrome:e.monochrome,noise:n<.5?t.noise:e.noise,mode:n<.5?t.mode:e.mode}),equals:(t,e)=>t.levels===e.levels&&t.matrix===e.matrix&&t.scale===e.scale&&t.monochrome===e.monochrome&&t.noise===e.noise&&t.mode===e.mode,surface:"shader"};var Vo={lerp:(t,e,n)=>({type:"duotone",amount:u(t.amount,e.amount,n),shadows:L(F(t.shadows),F(e.shadows),n),highlights:L(F(t.highlights),F(e.highlights),n),mode:n<.5?t.mode:e.mode}),equals:(t,e)=>t.amount===e.amount&&G(t.shadows,e.shadows)&&G(t.highlights,e.highlights)&&t.mode===e.mode};var Ho={lerp:(t,e,n)=>({type:"curves",channel:n<.5?t.channel:e.channel,points:t.points.map(([r,o],i)=>{let[s,a]=e.points[i]??[r,o];return[u(r,s,n),u(o,a,n)]}),mode:n<.5?t.mode:e.mode}),equals:(t,e)=>t.channel===e.channel&&t.mode===e.mode&&t.points.length===e.points.length&&t.points.every(([n,r],o)=>n===e.points[o]?.[0]&&r===e.points[o]?.[1]),surface:"shader"};var Yo={lerp:(t,e,n)=>({type:"colorAdjustment",brightness:u(t.brightness??0,e.brightness??0,n),contrast:u(t.contrast??1,e.contrast??1,n),saturation:u(t.saturation??1,e.saturation??1,n),hue:u(t.hue??0,e.hue??0,n),vibrance:u(t.vibrance??0,e.vibrance??0,n),shadows:u(t.shadows??0,e.shadows??0,n),highlights:u(t.highlights??0,e.highlights??0,n),temperature:u(t.temperature??0,e.temperature??0,n),tint:u(t.tint??0,e.tint??0,n),mode:n<.5?t.mode:e.mode}),equals:(t,e)=>t.brightness===e.brightness&&t.contrast===e.contrast&&t.saturation===e.saturation&&t.hue===e.hue&&t.vibrance===e.vibrance&&t.shadows===e.shadows&&t.highlights===e.highlights&&t.temperature===e.temperature&&t.tint===e.tint&&t.mode===e.mode};var Yn=(t,e)=>t.x===e.x&&t.y===e.y,Xo={lerp:(t,e,n)=>({type:"rgbShift",red:b(t.red,e.red,n),green:b(t.green,e.green,n),blue:b(t.blue,e.blue,n),mode:n<.5?t.mode:e.mode}),equals:(t,e)=>Yn(t.red,e.red)&&Yn(t.green,e.green)&&Yn(t.blue,e.blue)&&t.mode===e.mode,surface:"shader"};var Uo={lerp:(t,e,n)=>({type:"scanlines",spacing:u(t.spacing,e.spacing,n),thickness:u(t.thickness,e.thickness,n),darkness:u(t.darkness,e.darkness,n),offset:u(t.offset,e.offset,n),angle:u(t.angle,e.angle,n),mode:n<.5?t.mode:e.mode}),equals:(t,e)=>t.spacing===e.spacing&&t.thickness===e.thickness&&t.darkness===e.darkness&&t.offset===e.offset&&t.angle===e.angle&&t.mode===e.mode,surface:"shader"};var Go={lerp:(t,e,n)=>({type:"blockDisplace",amount:u(t.amount,e.amount,n),size:u(t.size,e.size,n),density:u(t.density,e.density,n),seed:u(t.seed,e.seed,n),axis:n<.5?t.axis:e.axis,mode:n<.5?t.mode:e.mode}),equals:(t,e)=>t.amount===e.amount&&t.size===e.size&&t.density===e.density&&t.seed===e.seed&&ye(t.axis,e.axis)&&t.mode===e.mode,surface:"shader"};var Ko={lerp:(t,e,n)=>({type:"bitCrush",bits:u(t.bits,e.bits,n),palette:n<.5?t.palette:e.palette,amount:u(t.amount,e.amount,n),mode:n<.5?t.mode:e.mode}),equals:(t,e)=>t.bits===e.bits&&t.palette===e.palette&&t.amount===e.amount&&t.mode===e.mode,surface:"shader"};var Zo={lerp:(t,e,n)=>({type:"streak",intensity:u(t.intensity,e.intensity,n),threshold:u(t.threshold,e.threshold,n),length:u(t.length,e.length,n),angle:u(t.angle,e.angle,n),mode:n<.5?t.mode:e.mode}),equals:(t,e)=>t.intensity===e.intensity&&t.threshold===e.threshold&&t.length===e.length&&t.angle===e.angle&&t.mode===e.mode};function Zl(t,e,n){return t.colors.length!==e.colors.length?n<.5?t:e:{colors:t.colors.map((r,o)=>L(F(r),F(e.colors[o]),n)),stops:t.stops.map((r,o)=>u(r,e.stops[o]??r,n))}}function Jl(t,e){return t.colors.length!==e.colors.length||t.stops.length!==e.stops.length?!1:t.colors.every((n,r)=>G(n,e.colors[r]))&&t.stops.every((n,r)=>n===e.stops[r])}var Jo={lerp:(t,e,n)=>({type:"glow",threshold:u(t.threshold,e.threshold,n),radius:u(t.radius,e.radius,n),spread:u(t.spread,e.spread,n),intensity:u(t.intensity,e.intensity,n),cycles:u(t.cycles,e.cycles,n),phase:u(t.phase,e.phase,n),color:L(F(t.color),F(e.color),n),...Zl(t,e,n),channel:n<.5?t.channel:e.channel,axis:n<.5?t.axis:e.axis,original:n<.5?t.original:e.original,blend:n<.5?t.blend:e.blend,tint:n<.5?t.tint:e.tint,loopStyle:n<.5?t.loopStyle:e.loopStyle,mode:n<.5?t.mode:e.mode}),equals:(t,e)=>t.channel===e.channel&&t.threshold===e.threshold&&t.radius===e.radius&&t.spread===e.spread&&t.intensity===e.intensity&&ye(t.axis,e.axis)&&t.original===e.original&&t.blend===e.blend&&t.tint===e.tint&&G(t.color,e.color)&&Jl(t,e)&&t.loopStyle===e.loopStyle&&t.cycles===e.cycles&&t.phase===e.phase&&t.mode===e.mode,surface:"shader"};var Qo={lerp:(t,e,n)=>({type:"oilPaint",radius:u(t.radius,e.radius,n),mode:n<.5?t.mode:e.mode}),equals:(t,e)=>t.radius===e.radius&&t.mode===e.mode,surface:"shader"};var ei={lerp:(t,e,n)=>({type:"wave",amplitude:b(t.amplitude,e.amplitude,n),wavelength:u(t.wavelength,e.wavelength,n),phase:u(t.phase,e.phase,n),shape:n<.5?t.shape:e.shape,angle:u(t.angle,e.angle,n),center:b(t.center,e.center,n),mode:n<.5?t.mode:e.mode}),equals:(t,e)=>t.amplitude.x===e.amplitude.x&&t.amplitude.y===e.amplitude.y&&t.wavelength===e.wavelength&&t.phase===e.phase&&t.shape===e.shape&&t.angle===e.angle&&t.center.x===e.center.x&&t.center.y===e.center.y&&t.mode===e.mode,surface:"shader"};var ti={lerp:(t,e,n)=>({type:"twirl",angle:u(t.angle,e.angle,n),radius:u(t.radius,e.radius,n),center:b(t.center,e.center,n),mode:n<.5?t.mode:e.mode}),equals:(t,e)=>t.angle===e.angle&&t.radius===e.radius&&t.center.x===e.center.x&&t.center.y===e.center.y&&t.mode===e.mode,surface:"shader"};var ni={lerp:(t,e,n)=>({type:"progressiveBlur",radius:u(t.radius,e.radius,n),startRadius:u(t.startRadius,e.startRadius,n),shape:n<.5?t.shape:e.shape,start:u(t.start,e.start,n),end:u(t.end,e.end,n),angle:u(t.angle,e.angle,n),center:b(t.center,e.center,n),samples:n<.5?t.samples:e.samples,mode:n<.5?t.mode:e.mode}),equals:(t,e)=>t.radius===e.radius&&t.startRadius===e.startRadius&&t.shape===e.shape&&t.start===e.start&&t.end===e.end&&t.angle===e.angle&&t.center.x===e.center.x&&t.center.y===e.center.y&&t.samples===e.samples&&t.mode===e.mode,surface:"shader"};var ri={lerp:(t,e,n)=>({type:"kaleidoscope",segments:n<.5?t.segments:e.segments,angle:u(t.angle,e.angle,n),center:b(t.center,e.center,n),offset:u(t.offset,e.offset,n),amount:u(t.amount,e.amount,n),mode:n<.5?t.mode:e.mode}),equals:(t,e)=>t.segments===e.segments&&t.angle===e.angle&&t.center.x===e.center.x&&t.center.y===e.center.y&&t.offset===e.offset&&t.amount===e.amount&&t.mode===e.mode,surface:"shader"};var oi={lerp:(t,e,n)=>({type:"glass",lightAngle:u(t.lightAngle,e.lightAngle,n),lightIntensity:u(t.lightIntensity,e.lightIntensity,n),refraction:u(t.refraction,e.refraction,n),depth:u(t.depth,e.depth,n),dispersion:u(t.dispersion,e.dispersion,n),frost:u(t.frost,e.frost,n),splay:u(t.splay,e.splay,n),mode:n<.5?t.mode:e.mode}),equals:(t,e)=>t.lightAngle===e.lightAngle&&t.lightIntensity===e.lightIntensity&&t.refraction===e.refraction&&t.depth===e.depth&&t.dispersion===e.dispersion&&t.frost===e.frost&&t.splay===e.splay&&t.mode===e.mode,surface:"shader"};var ii={lerp:(t,e,n)=>({type:"lut",table:n<.5?t.table:e.table,size:n<.5?t.size:e.size,amount:u(t.amount,e.amount,n),mode:n<.5?t.mode:e.mode}),equals:(t,e)=>t.table===e.table&&t.size===e.size&&t.amount===e.amount&&t.mode===e.mode,surface:"shader"};var si=new Map([["blur",So],["directionalBlur",vo],["grayscale",ko],["pixelate",Mo],["bulge",Co],["magnify",bo],["bloom",Ao],["vintage",Oo],["chromaticAberration",Eo],["invert",To],["scatter",Po],["posterize",zo],["motionBlur",go],["shader",Fo],["outline",No],["dropShadow",Do],["vignette",Ro],["grain",Io],["sharpen",Lo],["edges",Bo],["threshold",jo],["radialBlur",Wo],["halftone",qo],["dither",$o],["duotone",Vo],["curves",Ho],["colorAdjustment",Yo],["rgbShift",Xo],["scanlines",Uo],["blockDisplace",Go],["bitCrush",Ko],["ascii",wo],["streak",Zo],["glow",Jo],["oilPaint",Qo],["wave",ei],["twirl",ti],["progressiveBlur",ni],["kaleidoscope",ri],["glass",oi],["lut",ii]]),Ql=new Map([["sksl","shader"]]);function Ze(t){let e=si.get(t);if(e)return e;let n=Ql.get(t);return n?si.get(n):void 0}function Et(t){let e=Ze(t.type);return e?.resolve?e.resolve(t):t}function ai(t){return Ze(t)!==void 0}function Tt(t){let e=Ze(t.type)?.surface;return e===void 0?"filter":typeof e=="function"?e(t):e}function li(t,e){Ze(t.type)?.declare?.(t,e)}function Pt(t,e,n){if(t.type!==e.type)return n<.5?t:e;let r=Ze(t.type);if(!r)return n<.5?t:e;let o=r.lerp(t,e,n),i=n<.5?t:e,s;for(let a of Hn){if(o[a]===i[a])continue;s??={...o};let l=s;i[a]===void 0?delete l[a]:l[a]=i[a]}return s??o}var ec=["x","y","z","w"],tc=["r","g","b","a"];function Nt(t,e){let n={...t.uniforms??{}};for(let[r,o]of Object.entries(t.properties)){let i=e&&r in e?e[r]:o.default,s=nc(o,i,r,t.name);if(s)for(let[a,l]of Object.entries(o.inputs)){let c=s[a];if(c===void 0){Ft(`shader "${t.name}" property "${r}" has no "${a}" to write to "${l}".`);continue}n[l]=c}}if(e)for(let r of Object.keys(e))r in t.properties||Ft(`shader "${t.name}" has no property "${r}"; the override is ignored.`);return n}function nc(t,e,n,r){let o=rc(t,e,n,r);if(o===void 0)return;let i=Object.keys(t.inputs);if(i.length===1&&i[0]==="value")return{value:o};let s=typeof o=="number"?[o]:o,a={value:o};for(let[l,c]of ec.entries())s[l]!==void 0&&(a[c]=s[l]);for(let[l,c]of tc.entries())s[l]!==void 0&&(a[c]=s[l]);return a}function rc(t,e,n,r){switch(t.kind){case"number":case"slider":case"angle":case"hue":return oc(e,n,r);case"boolean":return e?1:0;case"color":return ic(e,n,r);case"vector":case"point":return ci(e,n,r);default:return typeof e=="number"||Array.isArray(e)?e:void 0}}function oc(t,e,n){if(typeof t=="number"&&Number.isFinite(t))return t;Ft(`shader "${n}" property "${e}" expects a number, got ${JSON.stringify(t)}.`)}function ic(t,e,n){if(typeof t=="string"){let[r,o,i,s]=z(t);return[r,o,i,s]}return ci(t,e,n)}function ci(t,e,n){if(Array.isArray(t)&&t.every(r=>typeof r=="number"&&Number.isFinite(r)))return t;if(typeof t=="object"&&t!==null){let r=t;if(typeof r.x=="number"&&typeof r.y=="number")return[r.x,r.y]}Ft(`shader "${n}" property "${e}" expects numbers, got ${JSON.stringify(t)}.`)}var zt=new Set;function Ft(t){zt.has(t)||(zt.size>256&&zt.clear(),zt.add(t),console.warn(`[shader] ${t}`))}var be={x:.5,y:.5},sc=["white","#ffa640"],ac=[0,1],lc={x:0,y:0},cc=t=>typeof t=="number"?{x:t,y:t}:t,uc=t=>typeof t=="number"?{x:0,y:t}:t,O=class t{list;constructor(e=[]){this.list=e}append(e){return new t([...this.list,e])}blur(e){let n=A(e,"radius");return this.append(C({type:"blur",radius:n.radius??0},n))}directionalBlur(e){let n=A(e,"radius");return this.append(C({type:"directionalBlur",radius:n.radius??0,angle:n.angle??0},n))}pixelate(e){let n=A(e,"blocks");return this.append(C({type:"pixelate",blocks:cc(n.blocks??1),sharpColors:n.sharpColors??!0},n))}grayscale(e){let n=A(e,"amount");return this.append(C({type:"grayscale",amount:n.amount??0},n))}bulge(e){let n=A(e,"strength");return this.append(C({type:"bulge",strength:n.strength??0,center:n.center??be},n))}magnify(e){let n=A(e,"scale");return this.append(C({type:"magnify",scale:n.scale??2,center:n.center??be},{...n,mode:n.mode??"backdrop"}))}bloom(e){let n=A(e,"intensity");return this.append(C({type:"bloom",threshold:n.threshold??.7,radius:n.radius??12,intensity:n.intensity??1},n))}vintage(e){let n=A(e,"amount");return this.append(C({type:"vintage",amount:n.amount??1,warmth:n.warmth??.2},n))}chromaticAberration(e){let n=A(e,"amount");return this.append(C({type:"chromaticAberration",amount:n.amount??4,angle:n.angle??0},n))}invert(e){let n=A(e,"strength");return this.append(C({type:"invert",channel:n.channel??"rgba",strength:n.strength??1},n))}scatter(e){let n=A(e,"strength");return this.append(C({type:"scatter",strength:n.strength??10,axis:n.axis??"both"},n))}posterize(e){let n=A(e,"levels");return this.append(C({type:"posterize",levels:n.levels??4},n))}motionBlur(e){let n=A(e,"length");return this.append(C({type:"motionBlur",length:n.length??50,alignment:n.alignment??"centered",samples:n.samples??16,strength:n.strength??1,axis:n.axis??"both"},n))}outline(e){let n=A(e,"width");return this.append(C({type:"outline",width:n.width??4,color:n.color??"black",position:n.position??"outside"},n))}dropShadow(e){let n=A(e,"blur");return this.append(C({type:"dropShadow",offsetX:n.offsetX??0,offsetY:n.offsetY??-8,blur:n.blur??16,spread:n.spread??0,color:n.color??"black"},n))}vignette(e){let n=A(e,"amount");return this.append(C({type:"vignette",amount:n.amount??.5,radius:n.radius??.75,softness:n.softness??.5,color:n.color??"black"},n))}lut(e){return this.append(C({type:"lut",table:e.table,size:e.size,amount:e.amount??1},e))}grain(e){let n=A(e,"amount");return this.append(C({type:"grain",amount:n.amount??.25,size:n.size??1,seed:n.seed??0,animated:n.animated??!1,colored:n.colored??!1},n))}sharpen(e){let n=A(e,"amount");return this.append(C({type:"sharpen",amount:n.amount??1,radius:n.radius??1},n))}edges(e){let n=A(e,"strength");return this.append(C({type:"edges",strength:n.strength??1,kernel:n.kernel??"sobel",colored:n.colored??!1},n))}threshold(e){let n=A(e,"level");return this.append(C({type:"threshold",level:n.level??.5,smoothness:n.smoothness??.05},n))}radialBlur(e){let n=A(e,"amount");return this.append(C({type:"radialBlur",amount:n.amount??.5,style:n.style??"zoom",center:n.center??be,samples:n.samples??16},n))}halftone(e){let n=A(e,"size");return this.append(C({type:"halftone",size:n.size??8,angle:n.angle??45,shape:n.shape??"dot",separation:n.separation??"mono"},n))}dither(e){let n=A(e,"levels");return this.append(C({type:"dither",levels:n.levels??2,matrix:n.matrix??4,scale:n.scale??1,monochrome:n.monochrome??!1,noise:n.noise??"bayer"},n))}duotone(e){let n=A(e,"amount");return this.append(C({type:"duotone",amount:n.amount??1,shadows:n.shadows??"black",highlights:n.highlights??"white"},n))}curves(e){return this.append(C({type:"curves",points:e.points,channel:e.channel??"rgb"},e))}colorAdjustment(e){let{mode:n,...r}=e;return this.append(C({type:"colorAdjustment",...r},{mode:n}))}rgbShift(e){let n=A(e,"amount"),r=n.amount??4;return this.append(C({type:"rgbShift",red:n.red??{x:r,y:0},green:n.green??lc,blue:n.blue??{x:-r,y:0}},n))}scanlines(e){let n=A(e,"darkness");return this.append(C({type:"scanlines",spacing:n.spacing??4,thickness:n.thickness??.5,darkness:n.darkness??.5,offset:n.offset??0,angle:n.angle??0},n))}blockDisplace(e){let n=A(e,"amount");return this.append(C({type:"blockDisplace",amount:n.amount??20,size:n.size??16,density:n.density??.3,seed:n.seed??0,axis:n.axis??"x"},n))}bitCrush(e){let n=A(e,"bits");return this.append(C({type:"bitCrush",bits:n.bits??3,palette:n.palette??"none",amount:n.amount??1},n))}ascii(e){let n=A(e,"size");return this.append(C({type:"ascii",size:n.size??12,charset:n.charset??"standard",fontFamily:n.fontFamily??"monospace",ink:n.ink??"white",background:n.background??"black",colored:n.colored??!1},n))}oilPaint(e){let n=A(e,"radius");return this.append(C({type:"oilPaint",radius:n.radius??3},n))}streak(e){let n=A(e,"intensity");return this.append(C({type:"streak",intensity:n.intensity??1,threshold:n.threshold??.7,length:n.length??120,angle:n.angle??0},n))}glow(e){let n=A(e,"intensity");return this.append(C({type:"glow",channel:n.channel??"luminance",threshold:n.threshold??.5,radius:n.radius??25,spread:n.spread??0,intensity:n.intensity??1,axis:n.axis??"both",original:n.original??"behind",blend:n.blend??"screen",tint:n.tint??"none",color:n.color??"white",colors:n.colors??[...sc],stops:n.stops??[...ac],loopStyle:n.loopStyle??"mirror",cycles:n.cycles??1,phase:n.phase??0},n))}shader(e){let n=typeof e.source=="string"?void 0:e.source;if(n&&n.scope!=="effect")throw new Error(`Effects.shader was given a "${n.scope}" shader ("${n.name}"). A fill shader has no backdrop to sample and is bound to a shape's box; use Fills.shader.`);let r=e.mode??(n?.backdrop?"backdrop":"foreground"),o=n?n.source:e.source,i=n?{...Nt(n,e.values),...oe(e.uniforms??{})}:e.uniforms??{},s={type:"shader",source:o,uniforms:i,...n?.id!==void 0?{shaderId:n.id}:{}},a=r==="foreground"?{...s,blendMode:e.blendMode??"screen"}:s;return this.append(C(a,{mode:r}))}sksl(e){let{shader:n,...r}=e;return this.shader({...r,source:n})}wave(e){let n=A(e,"amplitude");return this.append(C({type:"wave",amplitude:uc(n.amplitude??20),wavelength:n.wavelength??120,phase:n.phase??0,shape:n.shape??"linear",angle:n.angle??0,center:n.center??be},n))}twirl(e){let n=A(e,"angle");return this.append(C({type:"twirl",angle:n.angle??180,radius:n.radius??1,center:n.center??be},n))}progressiveBlur(e){let n=A(e,"radius");return this.append(C({type:"progressiveBlur",radius:n.radius??24,startRadius:n.startRadius??0,shape:n.shape??"linear",start:n.start??0,end:n.end??1,angle:n.angle??90,center:n.center??be,samples:n.samples??20},n))}kaleidoscope(e){let n=A(e,"segments");return this.append(C({type:"kaleidoscope",segments:Math.round(n.segments??6),angle:n.angle??0,center:n.center??be,offset:n.offset??0,amount:n.amount??1},n))}glass(e){let n=A(e,"refraction");return this.append(C({type:"glass",lightAngle:n.lightAngle??-45,lightIntensity:n.lightIntensity??80,refraction:n.refraction??80,depth:n.depth??20,dispersion:n.dispersion??50,frost:n.frost??4,splay:n.splay??0},{...n,mode:n.mode??"backdrop"}))}*[Symbol.iterator](){yield*this.list}toJSON(){return this.list}},Qm=new O;function fi(t){if(t===void 0)return[];if(t instanceof O)return ui(t.list);if(Array.isArray(t)){let e=[];for(let n of t)n instanceof O?e.push(...ui(n.list)):Array.isArray(n)?e.push(...fi(n)):e.push(Et(n));return e}return[Et(t)]}function ui(t){let e;for(let n=0;n<t.length;n++){let r=Et(t[n]);!e&&r!==t[n]&&(e=t.slice(0,n)),e?.push(r)}return e??t}var ge={resolve:t=>fi(t),lerp:(t,e,n)=>{if(t===e)return t;let r=Math.max(t.length,e.length),o=[];for(let i=0;i<r;i++){let s=t[i],a=e[i];s&&a?o.push(Pt(s,a,n)):s?o.push(s):a&&o.push(a)}return o}};var fc=t=>t.mode==="backdrop",hi=[],di=t=>t.length===0?hi:t.filter(fc);function pi(t){return t.length===0?hi:t.filter(e=>e.mode!=="backdrop"&&Tt(e)==="shader")}function ee(t,e={}){let n={...t};return e.opacity!==void 0&&(n.opacity=e.opacity),e.blend!==void 0&&(n.blend=e.blend),e.space!==void 0&&(n.space=e.space),n}var Je=class t{list;constructor(e=[]){this.list=e}color(e,n){return new t([...this.list,ee({type:"solid",color:e},n)])}image(e,n){let{fit:r,crop:o,zoom:i,anchor:s,matrix:a,preset:l,filters:c,...f}=n??{};return new t([...this.list,ee({type:"image",src:e,fit:r,crop:o,zoom:i,anchor:s,matrix:a,preset:l,filters:c},f)])}video(e,n){let{fit:r,crop:o,zoom:i,anchor:s,matrix:a,preset:l,filters:c,timestamp:f,playing:h,trimStart:d,trimEnd:p,playStart:y,speed:x,loop:g,duration:m,...w}=n??{};return new t([...this.list,ee({type:"video",src:e,fit:r,crop:o,zoom:i,anchor:s,matrix:a,preset:l,filters:c,timestamp:f,playing:h??!0,trimStart:d,trimEnd:p,playStart:y,speed:x,loop:g,duration:m},w)])}linearGradient(e,n){let{stops:r,start:o,end:i,...s}=n??{};return new t([...this.list,ee({type:"linear-gradient",colors:e,stops:r,start:o,end:i},s)])}radialGradient(e,n){let{stops:r,center:o,radius:i,...s}=n??{};return new t([...this.list,ee({type:"radial-gradient",colors:e,stops:r,center:o,radius:i},s)])}conicGradient(e,n){let{stops:r,center:o,startAngle:i,...s}=n??{};return new t([...this.list,ee({type:"conic-gradient",colors:e,stops:r,center:o,startAngle:i},s)])}noise(e){let{size:n,density:r,color:o,seed:i,...s}=e??{};return new t([...this.list,ee({type:"noise",size:n,density:r,color:o,seed:i},s)])}fractalNoise(e){let{basis:n,octaves:r,frequency:o,lacunarity:i,gain:s,seed:a,offset:l,angle:c,colors:f,stops:h,contrast:d,...p}=e??{};return new t([...this.list,ee({type:"fractalNoise",basis:n,octaves:r,frequency:o,lacunarity:i,gain:s,seed:a,offset:l,angle:c,colors:f,stops:h,contrast:d},p)])}shader(e,n){let r=typeof e=="string"?void 0:e;if(r&&r.scope!=="fill")throw new Error(`Fills.shader was given a "${r.scope}" shader ("${r.name}"). An effect shader samples a backdrop a fill does not have; use Effects.shader.`);let{uniforms:o,coords:i,textures:s,values:a,...l}=n??{},c=r?{...Nt(r,a),...oe(o??{})}:o;return new t([...this.list,ee({type:"shader",source:typeof e=="string"?e:e.source,uniforms:c,coords:i??r?.coords,textures:s,...r?.id!==void 0?{shaderId:r.id}:{}},l)])}stripe(e){let{gap:n,strokeWidth:r,angle:o,color:i,...s}=e??{};return new t([...this.list,ee({type:"stripe",gap:n,strokeWidth:r,angle:o,color:i},s)])}dotGrid(e){let{radius:n,spacing:r,offset:o,color:i,...s}=e??{};return new t([...this.list,ee({type:"dotGrid",radius:n,spacing:r,offset:o,color:i},s)])}grid(e){let{divisions:n,subdivisions:r,offset:o,strokeWidth:i,subdivisionWidth:s,color:a,...l}=e??{};return new t([...this.list,ee({type:"grid",divisions:n,subdivisions:r,offset:o,strokeWidth:i,subdivisionWidth:s,color:a},l)])}canvas3D(e,n){let{maxPixelRatio:r,antialias:o,...i}=n??{};return new t([...this.list,ee({type:"canvas3D",scene:e,maxPixelRatio:r,antialias:o},i)])}*[Symbol.iterator](){yield*this.list}toJSON(){return this.list}},mi=new Je;function Xn(t){if(t==null)return[];if(t instanceof Je)return t.list;if(Array.isArray(t)){let e=[];for(let n of t)n instanceof Je?e.push(...n.list):Array.isArray(n)?e.push(...Xn(n)):e.push(n);return e}return[t]}var hc=4,dc=1,pc=1,mc=.5,yi={resolve:t=>{let e=t.color??[0,0,0,1],n=t.strokeWidth??pc;return{type:"grid",divisions:t.divisions??hc,subdivisions:t.subdivisions??dc,offset:t.offset??{x:0,y:0},strokeWidth:n,subdivisionWidth:t.subdivisionWidth??n*mc,color:Array.isArray(e)?e:z(e),opacity:t.opacity,blend:t.blend}},lerp:(t,e,n)=>({divisions:u(t.divisions,e.divisions,n),subdivisions:u(t.subdivisions,e.subdivisions,n),offset:{x:u(t.offset.x,e.offset.x,n),y:u(t.offset.y,e.offset.y,n)},strokeWidth:u(t.strokeWidth,e.strokeWidth,n),subdivisionWidth:u(t.subdivisionWidth,e.subdivisionWidth,n),color:[u(t.color[0],e.color[0],n),u(t.color[1],e.color[1],n),u(t.color[2],e.color[2],n),u(t.color[3],e.color[3],n)],opacity:u(t.opacity??1,e.opacity??1,n)}),equals:(t,e)=>t.divisions===e.divisions&&t.subdivisions===e.subdivisions&&t.offset.x===e.offset.x&&t.offset.y===e.offset.y&&t.strokeWidth===e.strokeWidth&&t.subdivisionWidth===e.subdivisionWidth&&t.color[0]===e.color[0]&&t.color[1]===e.color[1]&&t.color[2]===e.color[2]&&t.color[3]===e.color[3]};var gi={lerp:(t,e,n)=>({type:"exposure",amount:u(t.amount,e.amount,n)}),equals:(t,e)=>t.amount===e.amount};var xi={lerp:(t,e,n)=>({type:"blur",radius:u(t.radius,e.radius,n)}),equals:(t,e)=>t.radius===e.radius};var wi={lerp:(t,e,n)=>({type:"grayscale",amount:u(t.amount,e.amount,n)}),equals:(t,e)=>t.amount===e.amount};var _i={lerp:(t,e,n)=>({type:"alpha",amount:u(t.amount,e.amount,n)}),equals:(t,e)=>t.amount===e.amount};var Si={lerp:(t,e,n)=>({type:"colorMatrix",matrix:t.matrix.map((r,o)=>u(r,e.matrix[o]??r,n))}),equals:(t,e)=>t.matrix.length===e.matrix.length&&t.matrix.every((n,r)=>n===e.matrix[r])};var vi={lerp:(t,e,n)=>({type:"curves",channel:n<.5?t.channel:e.channel,points:t.points.map(([r,o],i)=>{let[s,a]=e.points[i]??[r,o];return[u(r,s,n),u(o,a,n)]})}),equals:(t,e)=>t.channel===e.channel&&t.points.length===e.points.length&&t.points.every(([n,r],o)=>n===e.points[o]?.[0]&&r===e.points[o]?.[1])};var ki={lerp:(t,e,n)=>({type:"colorAdjustment",brightness:u(t.brightness??0,e.brightness??0,n),contrast:u(t.contrast??1,e.contrast??1,n),saturation:u(t.saturation??1,e.saturation??1,n),hue:u(t.hue??0,e.hue??0,n),vibrance:u(t.vibrance??0,e.vibrance??0,n),shadows:u(t.shadows??0,e.shadows??0,n),highlights:u(t.highlights??0,e.highlights??0,n),temperature:u(t.temperature??0,e.temperature??0,n),tint:u(t.tint??0,e.tint??0,n),vignette:u(t.vignette??0,e.vignette??0,n)}),equals:(t,e)=>t.brightness===e.brightness&&t.contrast===e.contrast&&t.saturation===e.saturation&&t.hue===e.hue&&t.vibrance===e.vibrance&&t.shadows===e.shadows&&t.highlights===e.highlights&&t.temperature===e.temperature&&t.tint===e.tint&&t.vignette===e.vignette};var Mi={lerp:(t,e,n)=>({type:"posterizeTime",fps:u(t.fps,e.fps,n)}),equals:(t,e)=>t.fps===e.fps};var Ci={lerp:(t,e,n)=>({type:"echo",echoes:Math.round(u(t.echoes,e.echoes,n)),delay:u(t.delay,e.delay,n),decay:u(t.decay??.5,e.decay??.5,n),blend:n<.5?t.blend:e.blend}),equals:(t,e)=>t.echoes===e.echoes&&t.delay===e.delay&&(t.decay??.5)===(e.decay??.5)&&t.blend===e.blend};var Dt=new Map([["exposure",gi],["blur",xi],["grayscale",wi],["alpha",_i],["colorMatrix",Si],["curves",vi],["colorAdjustment",ki],["posterizeTime",Mi],["echo",Ci]]),yc=new Set(["posterizeTime","echo"]);function Iy(t){return!yc.has(t)}function Ly(t){return Dt.has(t)||ai(t)}function gc(t,e,n){if(t.type!==e.type)return n<.5?t:e;let r=Dt.get(t.type);return r?r.lerp(t,e,n):Pt(t,e,n)}function bi(t,e){Dt.has(t.type)||li(t,e)}function By(t){return Dt.has(t.type)?"filter":Tt({...t,mode:"foreground"})}function Ai(t,e,n){let r=Math.max(t.length,e.length),o=[];for(let i=0;i<r;i++){let s=t[i],a=e[i];s&&a?o.push(gc(s,a,n)):s?o.push(s):a&&o.push(a)}return o}function Qe(t,e){return typeof t=="number"?{[e]:t}:t}function T(t){return t.list[0]}var et=class{list;constructor(e=[]){this.list=e}append(e){let n=this.constructor;return new n([...this.list,e])}blur(e){let{radius:n}=Qe(e,"radius");return this.append({type:"blur",radius:n})}grayscale(e){let{amount:n}=Qe(e,"amount");return this.append({type:"grayscale",amount:n})}alpha(e){let{amount:n}=Qe(e,"amount");return this.append({type:"alpha",amount:n})}exposure(e){let{amount:n}=Qe(e,"amount");return this.append({type:"exposure",amount:n})}colorAdjustment(e){return this.append({type:"colorAdjustment",...e})}colorMatrix(e){let n=Array.isArray(e)?e:e.matrix;return this.append({type:"colorMatrix",matrix:n})}curves(e){return this.append({type:"curves",points:e.points,channel:e.channel})}directionalBlur(e){return this.append(T(new O().directionalBlur(e)))}radialBlur(e){return this.append(T(new O().radialBlur(e)))}progressiveBlur(e){return this.append(T(new O().progressiveBlur(e)))}bloom(e){return this.append(T(new O().bloom(e)))}streak(e){return this.append(T(new O().streak(e)))}sharpen(e){return this.append(T(new O().sharpen(e)))}invert(e){return this.append(T(new O().invert(e)))}vintage(e){return this.append(T(new O().vintage(e)))}duotone(e){return this.append(T(new O().duotone(e)))}posterize(e){return this.append(T(new O().posterize(e)))}threshold(e){return this.append(T(new O().threshold(e)))}bitCrush(e){return this.append(T(new O().bitCrush(e)))}dither(e){return this.append(T(new O().dither(e)))}halftone(e){return this.append(T(new O().halftone(e)))}grain(e){return this.append(T(new O().grain(e)))}lut(e){return this.append(T(new O().lut(e)))}scanlines(e){return this.append(T(new O().scanlines(e)))}pixelate(e){return this.append(T(new O().pixelate(e)))}oilPaint(e){return this.append(T(new O().oilPaint(e)))}ascii(e){return this.append(T(new O().ascii(e)))}edges(e){return this.append(T(new O().edges(e)))}vignette(e){return this.append(T(new O().vignette(e)))}chromaticAberration(e){return this.append(T(new O().chromaticAberration(e)))}rgbShift(e){return this.append(T(new O().rgbShift(e)))}scatter(e){return this.append(T(new O().scatter(e)))}blockDisplace(e){return this.append(T(new O().blockDisplace(e)))}bulge(e){return this.append(T(new O().bulge(e)))}twirl(e){return this.append(T(new O().twirl(e)))}wave(e){return this.append(T(new O().wave(e)))}kaleidoscope(e){return this.append(T(new O().kaleidoscope(e)))}shader(e){return this.append(T(new O().shader(e)))}sksl(e){return this.append(T(new O().sksl(e)))}*[Symbol.iterator](){yield*this.list}toJSON(){return this.list}},Un=class extends et{posterizeTime(e){let{fps:n}=Qe(e,"fps");return this.append({type:"posterizeTime",fps:n})}echo(e){return this.append({type:"echo",...e})}},xc=new et,wc=new Un,qy=xc,$y=wc;function Oi(t){return t===void 0?[]:t instanceof et?t.list:Array.isArray(t)?t:[t]}var Rt={topLeft:{x:-1,y:1},topCenter:{x:0,y:1},topRight:{x:1,y:1},centerLeft:{x:-1,y:0},center:{x:0,y:0},centerRight:{x:1,y:0},bottomLeft:{x:-1,y:-1},bottomCenter:{x:0,y:-1},bottomRight:{x:1,y:-1}},Gn=Object.keys(Rt);function Kn(t){if(typeof t=="string"){let e=Object.hasOwn(Rt,t)?Rt[t]:void 0;if(!e)throw new Error(`Unknown alignment value: '${t}'`);return{...e}}return{x:t.x,y:t.y}}var N={resolve:Kn,lerp:b,keys:Gn,isKey(t){return typeof t=="string"&&Object.hasOwn(Rt,t)},validateProps(t){let e=Gn.filter(n=>t[n]!==void 0);if(e.length>1)throw new Error(`Cannot set multiple alignment props at once: ${e.join(", ")}`);if(e.length===1&&t.pivot!==void 0)throw new Error(`Cannot set both alignment prop '${e[0]}' and 'pivot' at the same time`)},findKey(t){return Gn.find(e=>t[e]!==void 0)},resolveTargetOnce(t,e,n){let r=Kn(t);return{pivot:r,x:n.x-r.x*(e.width/2),y:n.y-r.y*(e.height/2)}},bindTarget(t,e,n){let r=Kn(t);return{pivot:r,x:()=>e().x-r.x*(n().width/2),y:()=>e().y-r.y*(n().height/2)}}};var $={resolve:(t,e)=>typeof t=="number"?{left:t,right:t,top:t,bottom:t}:{left:t.left??t.horizontal??e?.left??0,right:t.right??t.horizontal??e?.right??0,top:t.top??t.vertical??e?.top??0,bottom:t.bottom??t.vertical??e?.bottom??0},lerp:(t,e,n)=>({left:u(t.left,e.left,n),right:u(t.right,e.right,n),top:u(t.top,e.top,n),bottom:u(t.bottom,e.bottom,n)}),insetBounds:(t,e,n)=>({width:Math.max(0,t-n.left-n.right),height:Math.max(0,e-n.top-n.bottom),x:(n.left-n.right)/2,y:(n.top-n.bottom)/2}),outsetSize:(t,e,n)=>({width:t+n.left+n.right,height:e+n.top+n.bottom})};function It(t,e){let n=t?.adjustments??e,r=Oi(n);if(r.length!==0)return{adjustments:r,intensity:Math.min(1,Math.max(0,t?.intensity??1))}}function Lt(t,e,n){if(!t&&!e)return;let r=t??{adjustments:e.adjustments,intensity:0},o=e??{adjustments:t.adjustments,intensity:0};return{adjustments:Ai(r.adjustments,o.adjustments,n),intensity:u(r.intensity,o.intensity,n)}}function Bt(t,e){for(let n of t?.adjustments??[])bi(n,e)}var Ei={left:0,right:0,top:0,bottom:0},Ti={x:0,y:0};function Zn(t){return{crop:t.crop===void 0?void 0:$.resolve(t.crop),anchor:t.anchor===void 0?void 0:N.resolve(t.anchor)}}function Jn(t,e,n){return{matrix:n<.5?t.matrix:e.matrix,crop:t.crop||e.crop?$.lerp(t.crop??Ei,e.crop??Ei,n):void 0,zoom:u(t.zoom??1,e.zoom??1,n),anchor:b(t.anchor??Ti,e.anchor??Ti,n)}}var Pi={resolve:({crop:t,anchor:e,preset:n,filters:r,...o})=>({...o,...Zn({crop:t,anchor:e}),preset:It(n,r)}),lerp:(t,e,n)=>({src:n<.5?t.src:e.src,fit:n<.5?t.fit:e.fit,...Jn(t,e,n),opacity:(t.opacity??1)+((e.opacity??1)-(t.opacity??1))*n,preset:Lt(t.preset,e.preset,n)}),equals:(t,e)=>t.src===e.src,declare:(t,e)=>{e.image(t.src),Bt(t.preset,e)}};function lg(t,e,n){let r=t.trimStart??0;return kc(t,r,_c(t,e,n,r))}function _c(t,e,n,r){if(t.timestamp!=null)return t.timestamp;if(!t.playing)return r;let o=Math.max(0,e-(t.playStart??0))*(t.speed??1);return vc(o,r,Sc(t,n),t.loop,t.duration)}function Sc(t,e){let n=e!==void 0&&Number.isFinite(e)&&e>0;return t.trimEnd??(n?e:1/0)}function vc(t,e,n,r,o){let i=o??(n!==1/0?n-e:void 0),s=i!==void 0&&i>0?i:void 0;if((r??"none")!=="none"&&s!==void 0){let l=t%s;if(r==="reverse"){let c=Math.floor(t/s)%2===0;return e+(c?l:s-l)}return e+l}let a=e+t;return n!==1/0?Math.min(a,n):a}function kc(t,e,n){let r=t.preset?.adjustments.find(i=>i.type==="posterizeTime");if(!r||r.fps<=0)return n;let o=1/r.fps;return e+Math.floor((n-e)/o)*o}var zi={resolve:({crop:t,anchor:e,preset:n,filters:r,...o})=>({...o,...Zn({crop:t,anchor:e}),preset:It(n,r),playing:o.playing??!0}),lerp:(t,e,n)=>({src:n<.5?t.src:e.src,fit:n<.5?t.fit:e.fit,...Jn(t,e,n),loop:n<.5?t.loop:e.loop,duration:n<.5?t.duration:e.duration,trimStart:n<.5?t.trimStart:e.trimStart,trimEnd:n<.5?t.trimEnd:e.trimEnd,playStart:n<.5?t.playStart:e.playStart,playing:n<.5?t.playing:e.playing,opacity:(t.opacity??1)+((e.opacity??1)-(t.opacity??1))*n,timestamp:t.timestamp==null&&e.timestamp==null?void 0:u(t.timestamp??0,e.timestamp??0,n),speed:u(t.speed??1,e.speed??1,n),preset:Lt(t.preset,e.preset,n)}),equals:(t,e)=>t.src===e.src,declare:(t,e)=>{e.video(t.src,{start:t.trimStart??0,end:t.trimEnd}),Bt(t.preset,e)}};var ae=class{_cmds=[];_x=0;_y=0;_startX=0;_startY=0;_open=!1;moveTo(e,n){return this._cmds.push({type:"M",x:e,y:n}),this._startX=e,this._startY=n,this._at(e,n)}lineTo(e,n){return this._cmds.push({type:"L",x:e,y:n}),this._at(e,n)}bezierCurveTo(e,n,r,o,i,s){return this._cmds.push({type:"C",x1:e,y1:n,x2:r,y2:o,x:i,y:s}),this._at(i,s)}quadraticCurveTo(e,n,r,o){return this._cmds.push({type:"Q",x1:e,y1:n,x:r,y:o}),this._at(r,o)}arcTo(e,n,r,o,i,s,a){return this._cmds.push({type:"A",rx:e,ry:n,rotation:r,largeArc:o,sweep:i,x:s,y:a}),this._at(s,a)}arc(e){let{cx:n,cy:r,rx:o,ry:i,from:s,sweep:a}=Fi(e),l=Qn(n,r,o,i,s);return this._open?(l.x!==this._x||l.y!==this._y)&&this.lineTo(l.x,l.y):this.moveTo(l.x,l.y),this._sweep(n,r,o,i,s,a)}ellipse(e){let{cx:n,cy:r,rx:o,ry:i,from:s,sweep:a}=Fi(e),l=Qn(n,r,o,i,s);return this.moveTo(l.x,l.y),this._sweep(n,r,o,i,s,a),this.close()}close(){return this._cmds.push({type:"Z"}),this._at(this._startX,this._startY)}toCommands(){return[...this._cmds]}toPathState(e={}){return{...e,data:this._cmds}}_at(e,n){return this._x=e,this._y=n,this._open=!0,this}_sweep(e,n,r,o,i,s){if(s===0)return this;let a=Math.ceil(Math.abs(s)/90),l=s/a,c=s>0?1:0;for(let f=1;f<=a;f++){let h=Qn(e,n,r,o,i+l*f);this.arcTo(r,o,0,0,c,h.x,h.y)}return this}};function Fi(t){return{cx:t.x??0,cy:t.y??0,rx:t.width/2,ry:(t.height??t.width)/2,from:t.startAngle??0,sweep:t.sweep??360}}function Qn(t,e,n,r,o){let i=o*Math.PI/180;return{x:t+n*Math.cos(i),y:e+r*Math.sin(i)}}var Mc=new Set(["rect","ellipse","path","line","polygon","polygram","text","richText"]),B=class t{_ops=[];_opacity=1;_rotation=0;_scale=1;_transformCenter;rect(e){return this._ops.push({kind:"rect",state:e}),this}ellipse(e){return this._ops.push({kind:"ellipse",state:e}),this}path(e){let n=e instanceof ae?e.toPathState():e;return this._ops.push({kind:"path",state:n}),this}line(e){return this._ops.push({kind:"line",state:e}),this}polygon(e){return this._ops.push({kind:"polygon",state:e}),this}polygram(e){return this._ops.push({kind:"polygram",state:e}),this}text(e){return this._ops.push({kind:"text",state:e}),this}richText(e){return this._ops.push({kind:"richText",state:e}),this}fill(e){return this._ops.push({kind:"fill",fills:e}),this}stroke(e){return this._ops.push({kind:"stroke",strokes:e}),this}shadow(e){return this._ops.push({kind:"shadow",shadows:e}),this}cut(){return this._ops.push({kind:"cut"}),this}mask(e){return this._ops.push({kind:"mask",options:e}),this}applyMask(){return this._ops.push({kind:"applyMask"}),this}endMask(){return this._ops.push({kind:"endMask"}),this}opacity(e){return this._opacity=e,this}effects(e){return this._ops.push({kind:"effects",effects:ge.resolve(e)}),this}rotation(e,n){return this._rotation=e,n!==void 0&&(this._transformCenter=n),this}scale(e,n){return this._scale=e,n!==void 0&&(this._transformCenter=n),this}ops(){return this._ops}groupOpacity(){return this._opacity}needsGroupLayer(){return this._opacity<1}groupTransform(){return this._rotation===0&&this._scale===1?null:{rotation:this._rotation,scale:this._scale,center:this._transformCenter}}isPaintOnly(){return!this._ops.some(e=>Mc.has(e.kind))}_withOps(e){let n=new t;return n._ops=e,n._opacity=this._opacity,n._rotation=this._rotation,n._scale=this._scale,n._transformCenter=this._transformCenter,n}};function jt(t){return typeof t.ops=="function"?{kind:"graphics",graphics:t}:{kind:"node",node:t}}function Cc(t){return typeof t!="string"&&"data"in t}function tt(t){return typeof t!="string"&&"source"in t}function pg(t){return typeof t=="string"?{src:t}:t}function Ni(t){return typeof t=="string"?t:Cc(t)||tt(t)?null:t.src}function nt(t){return t.startsWith("/")||t.startsWith(".")||/\.(png|jpe?g|webp|avif|svg|ktx2?|hdr|exr|mp4|webm|mov)$/i.test(t)}var qt=512;function rt(t,e={}){if(t==null)return{};if(typeof t=="string")return nt(t)?{map:t}:{color:t};if(Array.isArray(t))return t.every(n=>typeof n=="number")?{color:t}:{map:Di(t,e)};if(typeof t=="object"){if(Oc(t))return{map:bc(t,e)};if(Ac(t))return{map:t};if(Bi(t))return{color:t.color}}return{map:Di(t,e)}}function bc(t,e){return{source:t,width:e.width??qt,height:e.height??qt}}function Di(t,e){let n=e.width??qt,r=e.height??qt;return{source:new B().rect({width:n,height:r}).fill(t),width:n,height:r,static:!0,identity:`fill:${Wt(t)}:${n}x${r}`}}function Ac(t){return"src"in t||"data"in t||"source"in t&&"width"in t}function Oc(t){let e=t;return typeof e.cameraDescriptor=="function"?!1:typeof e.ops=="function"?!0:typeof e.id=="string"&&typeof e.attach=="function"}function Bi(t){let e=t;return e.type!=="solid"||e.color===void 0?!1:e.opacity===void 0&&e.blend===void 0&&e.space===void 0}function ji(t,e,n){let r=Ri(t),o=Ri(e);return r!==null&&o!==null?L(Ii(r),Ii(o),n):n<1?t:e}function Ri(t){return t==null?null:typeof t=="string"?nt(t)?null:t:Array.isArray(t)?t.every(e=>typeof e=="number")?t:null:typeof t=="object"&&Bi(t)?t.color:null}function Ii(t){return Array.isArray(t)?t:z(t)}var Li=new WeakMap,Ec=0;function Wt(t){if(t===null||typeof t!="object")return String(t);if(Array.isArray(t))return`[${t.map(Wt).join(",")}]`;let e=t.list;if(Array.isArray(e))return Wt(e);let n=Object.getPrototypeOf(t);if(n!==Object.prototype&&n!==null){let o=Li.get(t);return o===void 0&&(o=`@${Ec++}`,Li.set(t,o)),o}let r=t;return`{${Object.keys(r).sort().map(o=>`${o}:${Wt(r[o])}`).join(",")}}`}var Wi=new Set,Tc;function qi(){return Tc??=!1}function Ae(t,e){!qi()||Wi.has(t)||(Wi.add(t),console.warn(`[motionscript] ${e}`))}function $i(t){if(qi()){if("geometry"in t){let e=t.geometry.params;e&&Object.keys(e).length>0&&Ae(`geometry-params:${t.geometry.type}`,`\`params\` on a "${t.geometry.type}" geometry is not applied: three builds a geometry from its named fields and nothing assigns \`params\` onto it. Set the geometry's own fields instead. (\`params\` is applied on materials, lights and cameras.)`)}if("material"in t){let e=Array.isArray(t.material)?t.material:[t.material];for(let n of e)n.type==="shader"&&n.extends!=null&&Ae("shader-extends",`\`extends: "${n.extends}"\` on a shader material is not applied: the shader replaces the built-in model, so scene lighting, shadows and fog do not reach it. Write the lighting you need in the shader.`)}t.kind==="model"&&/\.obj(?:$|[?#])/i.test(t.src)&&Ae("model-obj",`The model "${t.src}" is an OBJ file, and only glTF/GLB models load: it will draw nothing. Convert it to .glb.`)}}var Vi=new Set(["mesh","light","instances","points","line","sprite","model"]),Hi=["position","rotation","quaternion","scale","lookAt","visible","shadow","renderOrder"],Yi=["opacity","roughness","metalness","emission","emissionStrength","normalMap","roughnessMap","metalnessMap","aoMap","alphaMap","envMapIntensity","wireframe","shading","faces","vertexColors","blend"],Pc=[...Yi,"fill","material","unlit"];function $t(t){let e=t,n;for(let r of Hi)e[r]!==void 0&&((n??={})[r]=e[r]);return n}function Vt(t){if(t.material!==void 0)return t.material;let e={type:t.unlit?"basic":"standard"},n=rt(t.fill);n.color!==void 0&&(e.color=n.color),n.map!==void 0&&(e.map=n.map);for(let r of Yi){let o=t[r];o!==void 0&&(e[r]=o)}return e}function zc(t,e){let n=t,r={type:e};for(let o in n)Pc.includes(o)||Hi.includes(o)||n[o]!==void 0&&(r[o]=n[o]);return r}var Le=class{_ops=[];record(e){$i(e),this._ops.push(e)}mesh(e,n,r){return this.record({kind:"mesh",geometry:e,material:n??{type:"standard"},transform:r}),this}sugar(e,n){let r=n??{};return this.mesh(zc(r,e),Vt(r),$t(r))}box(e){return this.sugar("box",e)}sphere(e){return this.sugar("sphere",e)}plane(e){return this.sugar("plane",e)}cylinder(e){return this.sugar("cylinder",e)}cone(e){return this.sugar("cone",e)}torus(e){return this.sugar("torus",e)}torusKnot(e){return this.sugar("torusKnot",e)}circle(e){return this.sugar("circle",e)}ring(e){return this.sugar("ring",e)}capsule(e){return this.sugar("capsule",e)}polyhedron(e){return this.sugar("polyhedron",e)}extrude(e){return this.sugar("extrude",e)}lathe(e){return this.sugar("lathe",e)}tube(e){return this.sugar("tube",e)}instances(e,n,r,o){return this.record({kind:"instances",geometry:e,material:n,instances:r,colors:o?.colors,transform:o?.transform}),this}points(e,n,r){return this.record({kind:"points",geometry:e,material:n??{type:"points"},transform:r}),this}line(e){let{points:n,geometry:r,material:o,closed:i,segments:s,stroke:a,opacity:l}=e;if(!n&&!r)throw new Error("Graphics3D.line() needs either `points` or `geometry`.");let c=o??{type:a?.dash!==void 0?"lineDashed":"lineBasic",...a?.fill!==void 0?{color:a.fill}:{},...a?.weight!==void 0?{width:a.weight}:{},...a?.dash!==void 0?{dashSize:a.dash[0],gapSize:a.dash[1]??a.dash[0]}:{},...l!==void 0?{opacity:l}:{}};return this.record({kind:"line",geometry:r??{type:"buffer",position:Fc(n)},material:c,mode:s?"segments":i?"loop":"strip",transform:$t(e)}),this}sprite(e){let{fill:n,material:r,opacity:o}=e,i=rt(n),s=r??{type:"sprite",...i.map!==void 0?{map:i.map}:{},...i.color!==void 0?{color:i.color}:{},...o!==void 0?{opacity:o}:{}};return this.record({kind:"sprite",material:s,transform:$t(e)}),this}model(e){let{src:n,animation:r,override:o}=e;return this.record({kind:"model",src:n,animation:r===void 0?void 0:Array.isArray(r)?r:[r],override:o,transform:$t(e)}),this}ops(){return this._ops}isEmpty(){return this._ops.length===0}};function Fc(t){let e=[];for(let n of t)if(typeof n=="number")e.push(n,n,n);else if(Array.isArray(n))e.push(n[0]??0,n[1]??0,n[2]??0);else{let r=n;e.push(r.x??0,r.y??0,r.z??0)}return e}var Ht=class{};function Yt(t){return t===void 0||t===!1?null:t===!0?{enabled:!0}:{enabled:!0,...t}}var J=class extends Ht{_ops=[];_camera=null;_fog=null;_environment=null;_shadows=null;_tone=null;_post=[];_depth=0;_shadowScopes=[];begin(e){this._ops.push({kind:"push",transform:{...e.transform,key:e.id}}),this._shadowScopes.push(e.transform?.shadow),this._depth++}end(){this._ops.push({kind:"pop"}),this._shadowScopes.pop(),this._depth--}draw(e){let n=e.ops(),r=this._shadowScopes[this._shadowScopes.length-1];for(let o=0;o<n.length;o++){let i=n[o];r===void 0||i.transform?.shadow!==void 0?this._ops.push(i):this._ops.push({...i,transform:{...i.transform,shadow:r}})}return this}light(e,n){return this._ops.push({kind:"light",light:e,transform:n}),this}camera(e){return this._camera=e,this._ops.push({kind:"camera",camera:e}),this}perspective(e){return this.camera({type:"perspective",...e})}orthographic(e){return this.camera({type:"orthographic",...e})}fog(e){return e===null?this._fog=null:typeof e=="object"&&!Array.isArray(e)?this._fog=e:this._fog={color:e},this}environment(e){return e&&((e.src!==void 0||(e.faces?.length??0)>0)&&Ae("environment-src",'An environment\'s `src` and `faces` (HDR, EXR, cubemap) are recorded, and no backend loads them. Only `preset: "studio"` is rendered: without a preset the scene gets no image-based light and its `background` is not drawn.'),e.params&&Object.keys(e.params).length>0&&Ae("environment-params","`params` on an environment is not applied: nothing assigns it onto the generated environment.")),this._environment=e,this}shadows(e){return this._shadows=Yt(e??!0),this}tone(e){return this._tone=e,this}post(e){let n=Array.isArray(e)?e:[e];return n.length>0&&Ae("post",`Post-processing (${n.map(r=>`"${r.type}"`).join(", ")}) is recorded, and no backend applies a pass: the scene renders exactly as it would without \`post\`. Use the Canvas3D's 2D \`effects\` over the composited result instead.`),this._post.push(...n),this}ops(){return this._ops}cameraDescriptor(){return this._camera}fogDescriptor(){return this._fog}environmentDescriptor(){return this._environment}shadowSettings(){return this._shadows}toneSettings(){return this._tone}postEffects(){return this._post}isEmpty(){return!this._ops.some(e=>Vi.has(e.kind))}assertBalanced(){if(this._depth!==0){let e=this._depth>0?"unclosed begin()":"extra end()";throw new Error(`Scene3D has ${Math.abs(this._depth)} ${e}.`)}}};function Xi(t,e){return`three:${t}:${e}`}function zg(t){if(!t.startsWith("three:"))return null;let e=t.slice(6),n=e.indexOf(":");return n<=0?null:{kind:e.slice(0,n),src:e.slice(n+1)}}var er=null,Ui=null;function Fg(t){er=t}function Ng(t){Ui=t}function Gi(){return er?.()}function Ki(){return Ui}function Dg(){return er!==null}var Nc=["map","alphaMap","aoMap","normalMap","displacementMap","envMap","lightMap","emissionMap","roughnessMap","metalnessMap","specularMap","gradientMap","matcap","clearcoatMap","clearcoatNormalMap","clearcoatRoughnessMap","transmissionMap","thicknessMap"];function Dc(t){return typeof t!="object"||t===null||Array.isArray(t)?!1:"src"in t||"data"in t||"source"in t}function Xt(t,e){let n=o=>{if(o)for(let i in o){let s=o[i];(typeof s=="string"&&nt(s)||Dc(s))&&e(s)}},r=o=>{if(o===void 0)return;let i=Array.isArray(o)?o:[o];for(let s of i){let a=s;for(let l of Nc)a[l]!==void 0&&e(a[l]);n(a.uniforms)}};for(let o of t.ops())switch(o.kind){case"mesh":case"points":case"line":case"instances":r(o.material);break;case"sprite":r(o.material);break;case"model":if(o.override)for(let i in o.override)r(o.override[i]);break}if(t instanceof J)for(let o of t.postEffects())n(o.uniforms)}var Rc=new Set(["linear-gradient","radial-gradient","conic-gradient"]);function Ut(t){return Rc.has(t)}function tr(t,e){let n=t.type==="solid"||Ut(t.type),r=e.type==="solid"||Ut(e.type);return!n||!r?!1:Ut(t.type)||Ut(e.type)}function Ic(t){return Array.from({length:t},(e,n)=>n/Math.max(1,t-1))}function Zi(t,e,n,r,o,i){let s=Math.max(2,i),a=Array.from({length:s},()=>[...t]),l=Ic(s),c={colors:a,stops:l,opacity:e,blend:n,space:r};switch(o){case"linear-gradient":return{type:"linear-gradient",...c,start:{x:-1,y:1},end:{x:1,y:-1}};case"radial-gradient":return{type:"radial-gradient",...c,center:{x:0,y:0},radius:100};case"conic-gradient":return{type:"conic-gradient",...c,center:{x:0,y:0},startAngle:0}}}function Lc(t,e){if(t.type===e)return t;let n={colors:t.colors,stops:t.stops,opacity:t.opacity,blend:t.blend,space:t.space};switch(e){case"linear-gradient":return{type:"linear-gradient",...n,start:{x:-1,y:1},end:{x:1,y:-1}};case"radial-gradient":return{type:"radial-gradient",...n,center:{x:0,y:0},radius:100};case"conic-gradient":return{type:"conic-gradient",...n,center:{x:0,y:0},startAngle:0}}}function Ji(t,e){let n=t.type==="solid",r=e.type==="solid";if(n&&!r){let s=e;return[Zi(t.color,t.opacity,t.blend,t.space,s.type,s.colors.length),s]}if(r&&!n){let s=t,a=Zi(e.color,e.opacity,e.blend,e.space,s.type,s.colors.length);return[s,a]}let o=t,i=e;return[Lc(o,i.type),i]}var Qi={resolve:t=>({type:"solid",color:Array.isArray(t.color)?t.color:z(t.color),opacity:t.opacity,blend:t.blend}),lerp:(t,e,n)=>({color:[u(t.color[0],e.color[0],n),u(t.color[1],e.color[1],n),u(t.color[2],e.color[2],n),u(t.color[3],e.color[3],n)],opacity:(t.opacity??1)+((e.opacity??1)-(t.opacity??1))*n}),equals:(t,e)=>t.color===e.color};function Bc(t,e){let{colors:n,stops:r}=t,o=n.length-1;if(e<=r[0])return n[0];if(e>=r[o])return n[o];let i=1;for(;r[i]<e;)i++;let s=i-1,a=r[i]-r[s];return L(n[s],n[i],a>0?(e-r[s])/a:0)}function es(t,e,n){let r=t.stops.indexOf(e);if(r===-1)return Bc(t,e);let o=1;for(;t.stops[r+o]===e;)o++;return t.colors[r+Math.min(n,o-1)]}var jc=(t,e)=>t.length===e.length&&t.every((n,r)=>n===e[r]);function xe(t,e,n){if(jc(t.stops,e.stops))return{colors:t.colors.map((s,a)=>L(s,e.colors[a],n)),stops:t.stops.slice()};let r=new Map;for(let s of[t,e]){let a=new Map;for(let l of s.stops)a.set(l,(a.get(l)??0)+1);for(let[l,c]of a)r.set(l,Math.max(r.get(l)??0,c))}let o=[],i=[];for(let s of[...r.keys()].sort((a,l)=>a-l))for(let a=0;a<r.get(s);a++)o.push(L(es(t,s,a),es(e,s,a),n)),i.push(s);return{colors:o,stops:i}}function Wc(t){return Array.isArray(t)?t:z(t)}var ts={resolve:t=>({type:"linear-gradient",colors:t.colors.map(Wc),stops:t.stops??t.colors.map((e,n)=>n/Math.max(1,t.colors.length-1)),start:t.start??{x:-1,y:1},end:t.end??{x:1,y:-1},opacity:t.opacity,blend:t.blend}),lerp:(t,e,n)=>({...xe(t,e,n),start:b(t.start,e.start,n),end:b(t.end,e.end,n),opacity:(t.opacity??1)+((e.opacity??1)-(t.opacity??1))*n}),equals:(t,e)=>t.start.x===e.start.x&&t.start.y===e.start.y&&t.end.x===e.end.x&&t.end.y===e.end.y&&t.colors.length===e.colors.length&&t.colors.every((n,r)=>n===e.colors[r])};function qc(t){return Array.isArray(t)?t:z(t)}var ns={resolve:t=>({type:"radial-gradient",colors:t.colors.map(qc),stops:t.stops??t.colors.map((e,n)=>n/Math.max(1,t.colors.length-1)),center:t.center??{x:0,y:0},radius:t.radius??100,opacity:t.opacity,blend:t.blend}),lerp:(t,e,n)=>({...xe(t,e,n),center:b(t.center,e.center,n),radius:u(t.radius,e.radius,n),opacity:u(t.opacity??1,e.opacity??1,n)}),equals:(t,e)=>t.center.x===e.center.x&&t.center.y===e.center.y&&t.radius===e.radius&&t.colors.length===e.colors.length&&t.colors.every((n,r)=>n===e.colors[r])};function $c(t){return Array.isArray(t)?t:z(t)}var rs={resolve:t=>({type:"conic-gradient",colors:t.colors.map($c),stops:t.stops??t.colors.map((e,n)=>n/Math.max(1,t.colors.length-1)),center:t.center??{x:0,y:0},startAngle:t.startAngle,opacity:t.opacity,blend:t.blend}),lerp:(t,e,n)=>({...xe(t,e,n),center:b(t.center,e.center,n),startAngle:u(t.startAngle??0,e.startAngle??0,n),opacity:u(t.opacity??1,e.opacity??1,n)}),equals:(t,e)=>t.center.x===e.center.x&&t.center.y===e.center.y&&(t.startAngle??0)===(e.startAngle??0)&&t.colors.length===e.colors.length&&t.colors.every((n,r)=>n===e.colors[r])};var os={resolve:t=>{let e=t.color??[0,0,0,1];return{type:"noise",size:t.size??{x:1,y:1},density:t.density??1,color:Array.isArray(e)?e:z(e),seed:t.seed??0,opacity:t.opacity,blend:t.blend}},lerp:(t,e,n)=>({size:{x:u(t.size.x,e.size.x,n),y:u(t.size.y,e.size.y,n)},density:u(t.density,e.density,n),seed:u(t.seed,e.seed,n),color:[u(t.color[0],e.color[0],n),u(t.color[1],e.color[1],n),u(t.color[2],e.color[2],n),u(t.color[3],e.color[3],n)],opacity:u(t.opacity??1,e.opacity??1,n)}),equals:(t,e)=>t.size.x===e.size.x&&t.size.y===e.size.y&&t.density===e.density&&t.seed===e.seed&&t.color[0]===e.color[0]&&t.color[1]===e.color[1]&&t.color[2]===e.color[2]&&t.color[3]===e.color[3]};function Vc(t){return Array.isArray(t)?t:z(t)}var Hc=[0,0,0,1],Yc=[1,1,1,1],Xc=t=>t===void 0?{x:3,y:3}:typeof t=="number"?{x:t,y:t}:t,is={resolve:t=>{let e=t.colors?.length?t.colors.map(Vc):[Hc,Yc];return{type:"fractalNoise",basis:t.basis??"simplex",octaves:Math.max(1,Math.min(8,Math.round(t.octaves??4))),frequency:Xc(t.frequency),lacunarity:t.lacunarity??2,gain:t.gain??.5,seed:t.seed??0,offset:t.offset??{x:0,y:0},angle:t.angle??0,colors:e,stops:t.stops??e.map((n,r)=>r/Math.max(1,e.length-1)),contrast:t.contrast??1,opacity:t.opacity,blend:t.blend}},lerp:(t,e,n)=>({basis:n<.5?t.basis:e.basis,octaves:n<.5?t.octaves:e.octaves,frequency:b(t.frequency,e.frequency,n),lacunarity:u(t.lacunarity,e.lacunarity,n),gain:u(t.gain,e.gain,n),seed:u(t.seed,e.seed,n),offset:b(t.offset,e.offset,n),angle:u(t.angle,e.angle,n),...xe(t,e,n),contrast:u(t.contrast,e.contrast,n),opacity:u(t.opacity??1,e.opacity??1,n)}),equals:(t,e)=>t.basis===e.basis&&t.octaves===e.octaves&&t.frequency.x===e.frequency.x&&t.frequency.y===e.frequency.y&&t.lacunarity===e.lacunarity&&t.gain===e.gain&&t.seed===e.seed&&t.offset.x===e.offset.x&&t.offset.y===e.offset.y&&t.angle===e.angle&&t.contrast===e.contrast&&t.colors.length===e.colors.length&&t.colors.every((n,r)=>{let o=e.colors[r];return o!=null&&n[0]===o[0]&&n[1]===o[1]&&n[2]===o[2]&&n[3]===o[3]})&&t.stops.length===e.stops.length&&t.stops.every((n,r)=>n===e.stops[r])};var ss={resolve:t=>({type:"stripe",gap:t.gap,strokeWidth:t.strokeWidth,angle:t.angle,color:t.color!=null?Array.isArray(t.color)?t.color:z(t.color):void 0,opacity:t.opacity,blend:t.blend}),lerp:(t,e,n)=>({gap:u(t.gap??8,e.gap??8,n),strokeWidth:u(t.strokeWidth??1,e.strokeWidth??1,n),angle:u(t.angle??-45,e.angle??-45,n),color:t.color&&e.color?[u(t.color[0],e.color[0],n),u(t.color[1],e.color[1],n),u(t.color[2],e.color[2],n),u(t.color[3],e.color[3],n)]:t.color??e.color,opacity:u(t.opacity??1,e.opacity??1,n)}),equals:(t,e)=>t.gap===e.gap&&t.strokeWidth===e.strokeWidth&&t.angle===e.angle&&t.color?.[0]===e.color?.[0]&&t.color?.[1]===e.color?.[1]&&t.color?.[2]===e.color?.[2]&&t.color?.[3]===e.color?.[3]};var Uc=2,Gc=16,as={resolve:t=>{let e=t.color??[0,0,0,1];return{type:"dotGrid",radius:t.radius??Uc,spacing:t.spacing??Gc,offset:t.offset??{x:0,y:0},color:Array.isArray(e)?e:z(e),opacity:t.opacity,blend:t.blend}},lerp:(t,e,n)=>({radius:u(t.radius,e.radius,n),spacing:u(t.spacing,e.spacing,n),offset:{x:u(t.offset.x,e.offset.x,n),y:u(t.offset.y,e.offset.y,n)},color:[u(t.color[0],e.color[0],n),u(t.color[1],e.color[1],n),u(t.color[2],e.color[2],n),u(t.color[3],e.color[3],n)],opacity:u(t.opacity??1,e.opacity??1,n)}),equals:(t,e)=>t.radius===e.radius&&t.spacing===e.spacing&&t.offset.x===e.offset.x&&t.offset.y===e.offset.y&&t.color[0]===e.color[0]&&t.color[1]===e.color[1]&&t.color[2]===e.color[2]&&t.color[3]===e.color[3]};var ls=4;function Kc(t){if(!t?.length)return;let e=[];for(let n of t)if(!(!n?.name||!n?.src)){if(e.length>=ls){console.warn(`[SkSL] A shader fill declares more than ${ls} textures; the rest are ignored.`);break}e.push({name:n.name,src:n.src})}return e.length?e:void 0}function Zc(t,e){return t===e?!0:!t||!e||t.length!==e.length?!1:t.every((n,r)=>n.name===e[r].name&&n.src===e[r].src)}var cs={resolve:t=>({type:"shader",source:t.source??"",...t.shaderId!==void 0?{shaderId:t.shaderId}:{},uniforms:oe(t.uniforms),coords:t.coords??"normalized",textures:Kc(t.textures),opacity:t.opacity,blend:t.blend}),lerp:(t,e,n)=>({source:n<.5?t.source:e.source,uniforms:At(t.uniforms,e.uniforms,n),coords:n<.5?t.coords:e.coords,textures:n<.5?t.textures:e.textures,opacity:(t.opacity??1)+((e.opacity??1)-(t.opacity??1))*n}),equals:(t,e)=>t.source===e.source&&t.coords===e.coords&&Ot(t.uniforms,e.uniforms)&&Zc(t.textures,e.textures),declare:(t,e)=>{for(let n of t.textures??[])e.image(n.src)}};function Kt(t,e){Xt(t,r=>{if(tt(r)){let i=jt(r.source);i.kind==="node"&&e.subtree(i.node);return}let o=Ni(r);o!==null&&e.image(o)});let n=r=>{r!==void 0&&(r.type==="modelGeometry"?Gt("gltf",r.src,e):(r.type==="edges"||r.type==="wireframe")&&n(r.source))};for(let r of t.ops())switch(r.kind){case"mesh":case"points":case"line":case"instances":n(r.geometry);break;case"model":Gt("gltf",r.src,e);break}t instanceof J&&nr(t.environmentDescriptor(),e)}function nr(t,e){if(t!==null){t.src!==void 0&&Gt(fs(t.src),t.src,e);for(let n of t.faces??[])Gt(fs(n),n,e)}}var us=new WeakMap;function Gt(t,e,n){let r=Ki();if(!r)return;let o=Xi(t,e),i=us.get(r);i||us.set(r,i=new Map);let s=i.get(o);s||i.set(o,s=()=>r(t,e)),n.loader(o,s)}function fs(t){return t.toLowerCase().endsWith(".exr")?"exr":"hdr"}var hs={resolve:t=>({...t}),lerp:(t,e,n)=>({scene:n<.5?t.scene:e.scene,maxPixelRatio:t.maxPixelRatio??e.maxPixelRatio,antialias:t.antialias??e.antialias,opacity:(t.opacity??1)+((e.opacity??1)-(t.opacity??1))*n}),equals:(t,e)=>t.scene===e.scene,declare:(t,e)=>{Kt(t.scene,e)}};var ps=new Map([["solid",Qi],["linear-gradient",ts],["radial-gradient",ns],["conic-gradient",rs],["noise",os],["fractalNoise",is],["stripe",ss],["dotGrid",as],["grid",yi],["shader",cs],["image",Pi],["video",zi],["canvas3D",hs]]);function or(t){let e=ps.get(t);if(!e)throw new Error(`Fill "${t}" is not registered`);return e}function Zt(t){if(typeof t=="string")return Zt({type:"solid",color:t});if(t instanceof J)return Zt({type:"canvas3D",scene:t});let e=or(t.type).resolve(t),n=t.space;return n!==void 0?{...e,space:n}:e}var Hx=Zt({type:"image",src:""});function Jc(t,e){return t.type===e.type?t.blend===e.blend:tr(t,e)}function rr(t,e,n){let r=Math.min(1,Math.max(0,n));if(t.type!==e.type){if(!tr(t,e))throw new Error(`No registered lerp for fills of type "${t.type}" and "${e.type}"`);let[o,i]=Ji(t,e);return{...o,...or(o.type).lerp(o,i,r)}}if(t.blend!==e.blend)throw new Error(`No registered lerp for fills of type "${t.type}" and "${e.type}"`);return{...t,...or(t.type).lerp(t,e,r)}}function ds(t,e){return{...t,opacity:(t.opacity??1)*Math.max(0,e)}}function Yx(t,e){ps.get(t.type)?.declare?.(t,e)}var V={resolve:t=>Xn(t).map(Zt),lerp:(t,e,n)=>{if(t===e)return t;if(!t.length&&!e.length)return[];let r=Math.min(1,Math.max(0,n)),o=Math.max(t.length,e.length),i=[];for(let s=0;s<o;s++){let a=t[s],l=e[s];a&&l?Jc(a,l)?i.push(rr(a,l,r)):(r<1&&i.push(ds(a,1-r)),r>0&&i.push(ds(l,r))):a?i.push(rr(a,{...a,opacity:0},r)):l&&i.push(rr({...l,opacity:0},l,r))}return i}};function Qc(t,e){return{blur:t.blur??e?.blur??0,offset:t.offset??e?.offset,fill:t.fill!=null?V.resolve(t.fill):e?.fill??V.resolve("transparent"),inner:t.inner??e?.inner??!1,spread:t.spread??e?.spread??0}}function eu(t,e,n){return{blur:t.blur+(e.blur-t.blur)*n,offset:b(t.offset??{x:0,y:0},e.offset??{x:0,y:0},n),fill:V.lerp(t.fill,e.fill,n),inner:n<1?t.inner:e.inner,spread:t.spread+(e.spread-t.spread)*n}}var Be={resolve:(t,e)=>t==null?[]:(Array.isArray(t)?t:[t]).map((r,o)=>Qc(r,e?.[o])),lerp:(t,e,n)=>{if(t===e)return t;let r=Math.max(t.length,e.length),o=[];for(let i=0;i<r;i++){let s=t[i],a=e[i];if(!s){o.push(a);continue}if(!a){o.push(s);continue}o.push(eu(s,a,n))}return o}};function tu(t,e){if(t==null)return e;if(typeof t=="number")return Math.max(-1,Math.min(1,t));switch(t){case"inside":return-1;case"center":return 0;case"outside":return 1}return e}var nu=4;function ru(t){switch(t){case"arrow":case"triangle":case"stealth":case"dot":case"box":case"diamond":case"bar":return!0}return!1}function ys(t,e){if(t==null)return e;switch(t){case"butt":case"round":case"square":return t}return e}function ms(t,e){return ru(t)?t:ys(t,e)}function ou(t,e){if(t==null)return e;switch(t){case"miter":case"round":case"bevel":return t}return e}function iu(t,e){let n;if(t.dash!=null){let o=Array.isArray(t.dash)?t.dash:[t.dash];n=o.length===1?[o[0],o[0]]:o}else n=e?.dash;let r=ys(t.cap,e?.cap??"butt");return{weight:t.weight??e?.weight??1,fill:t.fill!=null?V.resolve(t.fill):e?.fill??V.resolve("transparent"),dash:n,dashOffset:t.dashOffset??e?.dashOffset??0,align:tu(t.align,e?.align??-1),cap:r,startCap:t.startCap!=null?ms(t.startCap,r):e?.startCap,endCap:t.endCap!=null?ms(t.endCap,r):e?.endCap,capScale:Math.max(0,t.capScale??e?.capScale??nu),join:ou(t.join,e?.join??"miter"),miterLimit:t.miterLimit??e?.miterLimit??4}}function su(t,e,n){let r=t||[],o=e||[];if(r.length===0&&o.length===0)return t;let i=Math.max(r.length,o.length),s=new Array(i);for(let a=0;a<i;a++){let l=r[a]??0,c=o[a]??0;s[a]=l+(c-l)*n}return s}function au(t,e,n){return{weight:t.weight+(e.weight-t.weight)*n,fill:V.lerp(t.fill,e.fill,n),dash:su(t.dash,e.dash,n),dashOffset:t.dashOffset+(e.dashOffset-t.dashOffset)*n,align:t.align+(e.align-t.align)*n,cap:n<.5?t.cap:e.cap,startCap:n<.5?t.startCap:e.startCap,endCap:n<.5?t.endCap:e.endCap,capScale:t.capScale+(e.capScale-t.capScale)*n,join:n<.5?t.join:e.join,miterLimit:t.miterLimit+(e.miterLimit-t.miterLimit)*n}}var Oe={resolve:(t,e)=>t==null?[]:(Array.isArray(t)?t:[t]).map((r,o)=>iu(r,e?.[o])),lerp:(t,e,n)=>{if(t===e)return t;let r=Math.max(t.length,e.length),o=[];for(let i=0;i<r;i++){let s=t[i],a=e[i];if(!s){o.push(a);continue}if(!a){o.push(s);continue}o.push(au(s,a,n))}return o}};var ir=(t,e,n)=>Math.max(e,Math.min(t,n));function K(t){return ir(t,0,1)}var xs=new WeakMap,gs=new WeakMap,lu=0;function ot(t,e){return xs.set(t,e),t}function ws(t){let e=xs.get(t);if(e!==void 0)return e;let n=gs.get(t);return n===void 0&&(n=`fn#${lu++}`,gs.set(t,n)),n}var _s="quad",sr=Math.PI,ar=t=>t===void 0?{type:_s}:typeof t=="string"?{type:t}:{...t,type:t.type??_s},Jt={sine:t=>1-Math.cos(t*sr/2),quad:t=>t*t,cubic:t=>t*t*t,quart:t=>t*t*t*t,quint:t=>t*t*t*t*t,expo:t=>t===0?0:Math.pow(2,10*(t-1)),circ:t=>1-Math.sqrt(1-t*t),back:(t,e)=>{let n=e.overshoot??1.70158;return t*t*((n+1)*t-n)},elastic:(t,e)=>{if(t===0||t===1)return t;let n=e.amplitude??1,r=e.period??.3,o=r/(2*sr)*Math.asin(1/n);return-(n*Math.pow(2,10*(t-1))*Math.sin((t-1-o)*2*sr/r))},bounce:t=>1-(n=>n<.36363636363636365?7.5625*n*n:n<.7272727272727273?7.5625*(n-=.5454545454545454)*n+.75:n<.9090909090909091?7.5625*(n-=.8181818181818182)*n+.9375:7.5625*(n-=.9545454545454546)*n+.984375)(1-t)},lr=(t,e)=>`${t}:${e.type}:${e.overshoot??"_"}:${e.amplitude??"_"}:${e.period??"_"}`,Ss=()=>ot(t=>K(t),"lin"),r0=t=>{let e=ar(t);return ot(n=>Jt[e.type](K(n),e),lr("in",e))},o0=t=>{let e=ar(t);return ot(n=>1-Jt[e.type](1-K(n),e),lr("out",e))},i0=t=>{let e=ar(t),n=e.type==="back"?{...e,overshoot:(e.overshoot??1.70158)*1.525}:e.type==="elastic"?{...e,period:e.period??.45}:e;return ot(r=>(r=K(r),r<.5?Jt[n.type](2*r,n)/2:1-Jt[n.type](2*(1-r),n)/2),lr("inOut",e))};var cr=Ss(),Ee=class t{segments;constructor(e=[]){this.segments=e}ramp(e,n,r,o){return new t([...this.segments,{from:e,to:n,duration:r,ease:o?.ease}])}hold(e){return new t([...this.segments,{duration:e}])}fadeIn(e,n){return new t([...this.segments,{from:0,to:1,duration:e,ease:n?.ease}])}fadeOut(e,n){return new t([...this.segments,{to:0,duration:e,ease:n?.ease}])}resolve(e,n){let r=this.segments;if(r.length===0)return[];let o=Number.isFinite(e)&&e>0?e:0,i=0,s=0;for(let d of r)d.duration===void 0?s++:i+=Math.max(0,d.duration);s>1,i>o;let a=Math.max(0,o-i),l=s>0?r.findIndex(d=>d.duration===void 0):a>0?r.length-1:-1,c=[],f=0,h=n;for(let d=0;d<r.length;d++){let p=r[d];if(s===0&&d===l&&a>0){let M=Math.min(f,o),S=Math.min(f+a,o);c.push({startTime:M,endTime:S,from:h,to:h,ease:cr,isLinear:!0}),f+=a}let y;p.duration===void 0?y=d===l?a:0:y=Math.max(0,p.duration);let x=p.from??h,g=p.to??x,m=Math.min(f,o),w=Math.min(f+y,o),v=p.ease??cr;c.push({startTime:m,endTime:w,from:x,to:g,ease:v,isLinear:v===cr}),f+=y,h=g}return c}sampleAt(e,n,r){let o=this.resolve(n,r);if(o.length===0)return r;if(e<=o[0].startTime)return o[0].from;for(let i of o)if(e>=i.startTime&&e<=i.endTime){let s=i.endTime-i.startTime,a=s>0?(e-i.startTime)/s:1;return u(i.from,i.to,i.ease(a))}return o[o.length-1].to}staticValue(e){return this.segments[0]?.from??e}};function u0(t,e,n,r){return new Ee().ramp(t,e,n,r)}function f0(t){return new Ee().hold(t)}function h0(t,e){return new Ee().fadeIn(t,e)}function d0(t,e){return new Ee().fadeOut(t,e)}function Qt(t){return t instanceof Ee}function p0(t,e=0){return Qt(t)?t.staticValue(e):t}function m0(t){return t===void 0?"_":Qt(t)?"c["+t.segments.map(e=>`${e.from??"_"},${e.to??"_"},${e.duration??"_"},${e.ease?ws(e.ease):"lin"}`).join(";")+"]":String(t)}function H(t,e,n){return typeof t=="number"&&typeof e=="number"?u(t,e,n):n<.5?t:e}var vs={resolve:t=>t,lerp:H};function X(t,e){return t===e?!0:typeof t=="number"&&typeof e=="number"?t===e:!1}var ks=.001;function y0(t,e,n=e,r=ks){let o=Math.min(n,e);if(o<=0)return 0;let i=0;for(let s=0;s<o;s+=r){let a=Math.min(r,o-s),l=Math.max(1e-6,t.sampleAt(s+a/2,e,1));i+=a/l}return i}function g0(t,e,n,r=ks){if(n<=0)return 0;let o=0,i=0;for(;i<e;){let s=Math.min(r,e-i),a=Math.max(1e-6,t.sampleAt(i+s/2,e,1)),l=s/a;if(o+l>=n){let c=l>0?(n-o)/l:0;return i+s*c}o+=l,i+=s}return e}function je(t,e){return typeof t=="number"||Qt(t)?{[e]:t}:t}var en=class t{list;constructor(e=[]){this.list=e}append(e){return new t([...this.list,e])}gain(e){let{value:n}=je(e,"value");return this.append({type:"gain",value:n})}volume(e){return this.gain(e)}highpass(e){let{frequency:n,q:r}=je(e,"frequency");return this.append({type:"highpass",frequency:n,q:r})}lowpass(e){let{frequency:n,q:r}=je(e,"frequency");return this.append({type:"lowpass",frequency:n,q:r})}tremolo(e){let{rate:n,depth:r}=je(e,"rate");return this.append({type:"tremolo",rate:n,depth:r??.5})}speed(e){let{value:n}=je(e,"value");return this.append({type:"speed",value:n})}echo(e){let{delay:n,feedback:r,mix:o}=je(e,"delay");return this.append({type:"echo",delay:n,feedback:r??.4,mix:o})}*[Symbol.iterator](){yield*this.list}toJSON(){return this.list}},_0=new en;function Ms(t){return t===void 0?[]:t instanceof en?t.list:Array.isArray(t)?t:[t]}var Cs={lerp:(t,e,n)=>({type:"gain",value:H(t.value,e.value,n)}),equals:(t,e)=>X(t.value,e.value)};var bs={lerp:(t,e,n)=>({type:"highpass",frequency:H(t.frequency,e.frequency,n),q:H(t.q??1,e.q??1,n)}),equals:(t,e)=>X(t.frequency,e.frequency)&&X(t.q??1,e.q??1)};var As={lerp:(t,e,n)=>({type:"lowpass",frequency:H(t.frequency,e.frequency,n),q:H(t.q??1,e.q??1,n)}),equals:(t,e)=>X(t.frequency,e.frequency)&&X(t.q??1,e.q??1)};var Os={lerp:(t,e,n)=>({type:"tremolo",rate:H(t.rate,e.rate,n),depth:H(t.depth,e.depth,n)}),equals:(t,e)=>X(t.rate,e.rate)&&X(t.depth,e.depth)};var Es={lerp:(t,e,n)=>({type:"speed",value:H(t.value,e.value,n)}),equals:(t,e)=>X(t.value,e.value)};var Ts={lerp:(t,e,n)=>({type:"echo",delay:H(t.delay,e.delay,n),feedback:H(t.feedback,e.feedback,n),mix:H(t.mix??.5,e.mix??.5,n)}),equals:(t,e)=>X(t.delay,e.delay)&&X(t.feedback,e.feedback)&&X(t.mix??.5,e.mix??.5)};var cu={gain:Cs,highpass:bs,lowpass:As,tremolo:Os,speed:Es,echo:Ts},ur=class t{static registry=new Map(Object.entries(cu));static register(e,n){if(this.registry.has(e))throw new Error(`Audio filter "${e}" is already registered`);this.registry.set(e,n)}static get(e){return this.registry.get(e)}static has(e){return this.registry.has(e)}static lerp(e,n,r){if(e.type!==n.type)return r<.5?e:n;let o=this.registry.get(e.type);return o?o.lerp(e,n,r):r<.5?e:n}static lerpArray(e,n,r){let o=Math.max(e.length,n.length),i=[];for(let s=0;s<o;s++){let a=e[s],l=n[s];a&&l?i.push(t.lerp(a,l,r)):a?i.push(a):l&&i.push(l)}return i}},fr={resolve:Ms,lerp:ur.lerpArray};function nn(t){return(t.g??0)!==0||(t.h??0)!==0||(t.i??1)!==1}var tn=1e-6;function uu(t){return t>tn||t<-tn?t:t<0?-tn:tn}function Ps(){return{a:1,b:0,c:0,d:1,e:0,f:0}}function zs(t,e){return{a:1,b:0,c:0,d:1,e:t,f:e}}function we(t,e){return nn(t)||nn(e)?fu(t,e):{a:t.a*e.a+t.c*e.b,b:t.b*e.a+t.d*e.b,c:t.a*e.c+t.c*e.d,d:t.b*e.c+t.d*e.d,e:t.a*e.e+t.c*e.f+t.e,f:t.b*e.e+t.d*e.f+t.f}}function fu(t,e){let n=t.g??0,r=t.h??0,o=t.i??1,i=e.g??0,s=e.h??0,a=e.i??1;return{a:t.a*e.a+t.c*e.b+t.e*i,c:t.a*e.c+t.c*e.d+t.e*s,e:t.a*e.e+t.c*e.f+t.e*a,b:t.b*e.a+t.d*e.b+t.f*i,d:t.b*e.c+t.d*e.d+t.f*s,f:t.b*e.e+t.d*e.f+t.f*a,g:n*e.a+r*e.b+o*i,h:n*e.c+r*e.d+o*s,i:n*e.e+r*e.f+o*a}}function We(t,e){let n=t.a*e.x+t.c*e.y+t.e,r=t.b*e.x+t.d*e.y+t.f;if(!nn(t))return{x:n,y:r};let o=uu((t.g??0)*e.x+(t.h??0)*e.y+(t.i??1));return{x:n/o,y:r/o}}function rn(t){if(nn(t))return hu(t);let e=t.a*t.d-t.b*t.c;if(e===0||!Number.isFinite(e))return null;let n=1/e;return{a:t.d*n,b:-t.b*n,c:-t.c*n,d:t.a*n,e:(t.c*t.f-t.d*t.e)*n,f:(t.b*t.e-t.a*t.f)*n}}function hu(t){let{a:e,b:n,c:r,d:o,e:i,f:s}=t,a=t.g??0,l=t.h??0,c=t.i??1,f=o*c-s*l,h=s*a-n*c,d=n*l-o*a,p=e*f+r*h+i*d;if(p===0||!Number.isFinite(p))return null;let y=1/p;return{a:f*y,c:(i*l-r*c)*y,e:(r*s-i*o)*y,b:h*y,d:(e*c-i*a)*y,f:(i*n-e*s)*y,g:d*y,h:(r*a-e*l)*y,i:(e*o-r*n)*y}}function q0(t,e,n,r,o){let i=-o*Math.PI/180,s=Math.cos(i),a=Math.sin(i),l=r*s,c=r*a,f=r*-a,h=r*s,d=-n.x,p=n.y;return{a:l,b:c,c:f,d:h,e:t+l*d+f*p,f:e+c*d+h*p}}function du(t,e,n,r,o,i){let s=n*Math.PI/180,a=Math.cos(s),l=Math.sin(s),c=r*a,f=r*l,h=r*-l,d=r*a;return{a:c,b:f,c:h,d,e:t+o-(c*o+h*i),f:e+i-(f*o+d*i)}}var on={rotationX:0,rotationY:0,rotationZ:0,depth:0,perspective:0,flipHorizontal:!1,flipVertical:!1};function hr(t){return t.rotationX!==0||t.rotationY!==0||t.rotationZ!==0||t.flipHorizontal||t.flipVertical||t.perspective!==0&&t.depth!==0}function Fs(t,e){let n=Math.PI/180;return Math.cos(t*n)*Math.cos(e*n)<0}function Ns(t,e,n,r,o,i,s){if(!hr(s))return du(t,e,n,r,o,i);let a=Math.PI/180,l=Math.cos(s.rotationX*a),c=Math.sin(s.rotationX*a),f=Math.cos(s.rotationY*a),h=Math.sin(s.rotationY*a),d=(n+s.rotationZ)*a,p=Math.cos(d),y=Math.sin(d),x=f*p*r,g=-f*y*r,m=(c*h*p+l*y)*r,w=(l*p-c*h*y)*r,v=(c*y-l*h*p)*r,M=(l*h*y+c*p)*r,S=s.perspective!==0?1/s.perspective:0,E=-v*S,R=-M*S,U=1-(s.depth-(v*o+M*i))*S,se=t+o,jn=e+i,Wn=s.flipHorizontal?-1:1,qn=s.flipVertical?-1:1;return{a:(x+se*E)*Wn,c:(g+se*R)*qn,e:-(x*o+g*i)+se*U,b:(m+jn*E)*Wn,d:(w+jn*R)*qn,f:-(m*o+w*i)+jn*U,g:E*Wn,h:R*qn,i:U}}function pu(t,e,n){let r={x:u(t.x,e.x,n),y:u(t.y,e.y,n)};return(t.z!==void 0||e.z!==void 0)&&(r.z=u(t.z??0,e.z??0,n)),r}function ln(t,e){let n=new Array(12);for(let r=0;r<3;r++){let o=t[r*4],i=t[r*4+1],s=t[r*4+2],a=t[r*4+3];n[r*4]=o*e[0]+i*e[4]+s*e[8],n[r*4+1]=o*e[1]+i*e[5]+s*e[9],n[r*4+2]=o*e[2]+i*e[6]+s*e[10],n[r*4+3]=o*e[3]+i*e[7]+s*e[11]+a}return n}function cn(t,e,n,r,o,i,s){let a=Math.PI/180,l=Math.cos(s.rotationX*a),c=Math.sin(s.rotationX*a),f=Math.cos(s.rotationY*a),h=Math.sin(s.rotationY*a),d=(n+s.rotationZ)*a,p=Math.cos(d),y=Math.sin(d),x=f*p*r,g=-f*y*r,m=h*r,w=(c*h*p+l*y)*r,v=(l*p-c*h*y)*r,M=-c*f*r,S=(c*y-l*h*p)*r,E=(l*h*y+c*p)*r,R=l*f*r,U=s.flipHorizontal?-1:1,se=s.flipVertical?-1:1;return[x*U,g*se,m,t+o-(x*o+g*i),w*U,v*se,M,e+i-(w*o+v*i),S*U,E*se,R,s.depth-(S*o+E*i)]}function sn(t){let e=Math.PI/180,n=Math.sin(t.orbit*e),r=Math.cos(t.orbit*e),o=Math.sin(t.elevation*e),i=Math.cos(t.elevation*e),s=r,a=0,l=-n,c=n*o,f=i,h=r*o,d=n*i,p=-o,y=r*i,x=t.lookAt.x,g=-t.lookAt.y,m=t.lookAt.z??0;return[s,a,l,-(s*x+a*g+l*m),c,f,h,-(c*x+f*g+h*m),d,p,y,-(d*x+p*g+y*m)+t.dolly]}function pr(t,e){let n=t.perspective>0?1/t.perspective:0,r=-e[8]*n,o=-e[9]*n,i=1-e[11]*n,s=-t.heading*Math.PI/180,a=t.zoom,l=a*Math.cos(s),c=-a*Math.sin(s),f=a*Math.sin(s),h=a*Math.cos(s),d=t.viewportX,p=t.viewportY,y={a:l*e[0]+c*e[4]+d*r,c:l*e[1]+c*e[5]+d*o,e:l*e[3]+c*e[7]+d*i,b:f*e[0]+h*e[4]+p*r,d:f*e[1]+h*e[5]+p*o,f:f*e[3]+h*e[7]+p*i};return n!==0&&(y.g=r,y.h=o,y.i=i),y}function mr(t,e){let n=e.width/2,r=e.height/2,o=[e.x-n,e.x+n,e.x+n,e.x-n],i=[e.y-r,e.y-r,e.y+r,e.y+r],s=new Array(12);for(let l=0;l<4;l++){let c=o[l],f=i[l];s[l*3]=t[0]*c+t[1]*f+t[3],s[l*3+1]=t[4]*c+t[5]*f+t[7],s[l*3+2]=t[8]*c+t[9]*f+t[11]}let a=Math.hypot(t[2],t[6],t[10])||1;return{corners:s,cx:t[0]*e.x+t[1]*e.y+t[3],cy:t[4]*e.x+t[5]*e.y+t[7],cz:t[8]*e.x+t[9]*e.y+t[11],nx:t[2]/a,ny:t[6]/a,nz:t[10]/a}}var yr=.01,Ds=.001;function an(t,e){if(t.perspective>0){let n=-e.cx,r=-e.cy,o=t.perspective-e.cz,i=e.nx*n+e.ny*r+e.nz*o;return{side:i,edgeOn:Math.abs(i)<=Ds*Math.hypot(n,r,o)}}return{side:e.nz,edgeOn:Math.abs(e.nz)<=Ds}}function Ls(t,e){if(t.perspective<=0)return"all";let n=0;for(let r=0;r<4;r++)1-e.corners[r*3+2]/t.perspective>yr&&n++;return n===4?"all":n===0?"none":"some"}function Bs(t,e,n){let r=t.g??0,o=t.h??0,i=t.i??1,s=e.width/2+n,a=e.height/2+n,l=[{x:e.x-s,y:e.y-a},{x:e.x+s,y:e.y-a},{x:e.x+s,y:e.y+a},{x:e.x-s,y:e.y+a}],c=h=>r*h.x+o*h.y+i-yr,f=[];for(let h=0;h<l.length;h++){let d=l[h],p=l[(h+1)%l.length],y=c(d),x=c(p);if(y>=0&&f.push(d),y>=0!=x>=0){let g=y/(y-x);f.push({x:d.x+(p.x-d.x)*g,y:d.y+(p.y-d.y)*g})}}return f.length>=3?f:null}var dr=.01;function Rs(t,e,n){let r=0,o=0;for(let s=0;s<4;s++){let a=t.nx*(e.corners[s*3]-t.cx)+t.ny*(e.corners[s*3+1]-t.cy)+t.nz*(e.corners[s*3+2]-t.cz);a>dr?r++:a<-dr&&o++}if(r===0&&o===0)return 0;let i=n>0?1:-1;return o===0?i:r===0?-i:0}function it(t,e){return t.perspective>0?e.cx*e.cx+e.cy*e.cy+(t.perspective-e.cz)**2:-e.cz}function mu(t,e,n){let r=an(t,e);if(!r.edgeOn){let a=Rs(e,n,r.side);if(a!==0)return a>0?-1:1;if(yu(e,n))return 0}let o=an(t,n);if(!o.edgeOn){let a=Rs(n,e,o.side);if(a!==0)return a>0?1:-1}let i=it(t,e),s=it(t,n);return i===s?0:i>s?-1:1}function yu(t,e){for(let n=0;n<4;n++){let r=t.nx*(e.corners[n*3]-t.cx)+t.ny*(e.corners[n*3+1]-t.cy)+t.nz*(e.corners[n*3+2]-t.cz);if(Math.abs(r)>dr)return!1}return!0}function Is(t){return{...t,viewportX:0,viewportY:0}}var H0={lerpLookAt:pu,project(t,e){let n=Is(t),r=sn(n),o=e.x,i=-e.y,s=e.z??0,a=r[0]*o+r[1]*i+r[2]*s+r[3],l=r[4]*o+r[5]*i+r[6]*s+r[7],c=r[8]*o+r[9]*i+r[10]*s+r[11],f=n.perspective>0?1-c/n.perspective:1;if(f<=yr)return null;let h=-n.heading*Math.PI/180,d=n.zoom*a/f,p=n.zoom*l/f;return{x:Math.cos(h)*d-Math.sin(h)*p,y:-(Math.sin(h)*d+Math.cos(h)*p)}},focusVector(t,e){let n=Is(t),r=-n.heading*Math.PI/180,o=n.zoom||1,i=e.x,s=-e.y,a=(Math.cos(r)*i+Math.sin(r)*s)/o,l=(-Math.sin(r)*i+Math.cos(r)*s)/o,c=n.perspective>0?1-n.dolly/n.perspective:1,f=sn(n),h=a*c,d=l*c;return{x:h*f[0]+d*f[4],y:-(h*f[1]+d*f[5]),z:h*f[2]+d*f[6]}}},gu=96;function js(t,e){let n=e.length;if(n>gu)return e.map((a,l)=>l).sort((a,l)=>it(t,e[l])-it(t,e[a])||a-l);let r=Array.from({length:n},()=>[]),o=new Array(n).fill(0);for(let a=0;a<n;a++)for(let l=a+1;l<n;l++){let c=mu(t,e[a],e[l]);c<0?(r[a].push(l),o[l]++):c>0&&(r[l].push(a),o[a]++)}let i=[],s=new Array(n).fill(!1);for(;i.length<n;){let a=-1;for(let l=0;l<n;l++)if(!s[l]&&o[l]===0){a=l;break}if(a===-1){let l=-1/0;for(let c=0;c<n;c++){if(s[c])continue;let f=it(t,e[c]);f>l&&(l=f,a=c)}}s[a]=!0,i.push(a);for(let l of r[a])o[l]--}return i}var gr={resolve:t=>t,lerp:(t,e,n)=>({width:u(t.width,e.width,n),height:u(t.height,e.height,n)}),expand:t=>{t.size!==void 0&&(t.width===void 0&&(t.width=t.size),t.height===void 0&&(t.height=t.size))}},Q={resolve:t=>t,lerp:(t,e,n)=>typeof t=="number"&&typeof e=="number"?u(t,e,n):n===1?e:t,resolveLayout:(t,e,n)=>typeof t=="number"?t:t==="fill"?e:t==="hug"?n:e,isAuto:t=>typeof t!="number"};var xu=["fontFamily","fontSize","fontWeight","fontStyle","letterSpacing","lineHeight","textAlign","fill","stroke","shadow"],wr=["fontFamily","fontSize","fontWeight","fontStyle","letterSpacing","lineHeight","textAlign"],st=Object.freeze({}),q={resolve:t=>t,lerp:wu,preset:_u,mergeStyle:Ws,resolveStyle:Su,lerpStyle:vu,lerpFontSize:qs,styleProps:ku,flatten:Mu,applyCase:bu};function wu(t,e,n){if(n<=0)return t;if(n>=1)return e;let r=0,o=Math.min(t.length,e.length);for(;r<o&&t.charCodeAt(r)===e.charCodeAt(r);)r++;let i=0,s=Math.min(t.length-r,e.length-r);for(;i<s&&t.charCodeAt(t.length-1-i)===e.charCodeAt(e.length-1-i);)i++;let a=t.length-r-i,l=e.length-r-i,c=a+l;if(c===0)return e;let f=t.substring(0,r),h=t.substring(t.length-i),d=a/c;if(n<d){let x=d===0?1:n/d,g=Math.round(a*(1-x));return f+t.substring(r,r+g)+h}let p=d===1?1:(n-d)/(1-d),y=Math.round(l*p);return f+e.substring(r,r+y)+h}function _u(t){return uo(t)??st}function Ws(t,e){let n=null;for(let r of xu){let o=e?.[r];o!==void 0&&((n??={...t})[r]=o)}return n??t}function Su(t,e){let n=t??{};return{fontFamily:n.fontFamily??e.fontFamily,fontSize:n.fontSize??e.fontSize,fontWeight:n.fontWeight??e.fontWeight,fontStyle:n.fontStyle??e.fontStyle,letterSpacing:n.letterSpacing??e.letterSpacing,lineHeight:n.lineHeight??e.lineHeight,textAlign:n.textAlign??e.textAlign,fill:V.resolve(n.fill??e.fill??[]),stroke:Oe.resolve(n.stroke??e.stroke??[]),shadow:Be.resolve(n.shadow??e.shadow??[])}}function vu(t,e,n){return{fontFamily:n<.5?t.fontFamily:e.fontFamily,fontSize:qs(t.fontSize,e.fontSize,n),fontWeight:xr(t.fontWeight,e.fontWeight,n),fontStyle:n<.5?t.fontStyle:e.fontStyle,letterSpacing:xr(t.letterSpacing,e.letterSpacing,n),lineHeight:xr(t.lineHeight,e.lineHeight,n),textAlign:n<.5?t.textAlign:e.textAlign,fill:V.lerp(t.fill,e.fill,n),stroke:Oe.lerp(t.stroke,e.stroke,n),shadow:Be.lerp(t.shadow,e.shadow,n)}}function ku(t){return Ws({},t)}function Mu(t,e){let n=[],r=(o,i)=>{let s={fontFamily:o.fontFamily??i.fontFamily,fontSize:o.fontSize??i.fontSize,fontWeight:o.fontWeight??i.fontWeight,fontStyle:o.fontStyle??i.fontStyle,letterSpacing:o.letterSpacing??i.letterSpacing,fill:o.fill!=null?V.resolve(o.fill):i.fill,stroke:o.stroke!=null?Oe.resolve(o.stroke):i.stroke};o.text&&n.push({text:o.text,...s});for(let a of o.children??[])r(a,s)};for(let o of t)r(o,e);return n}var Cu=/[\p{L}\p{N}'\u2019]/u;function bu(t,e){if(e!=="upper"&&e!=="lower"&&e!=="title")return t;let n="",r="";for(let o of t){let i=e==="upper"||e==="title"&&!Cu.test(r),s=e==="lower"?o.toLowerCase():i?o.toUpperCase():o;n+=s.length===o.length?s:o,r=o}return n}function qs(t,e,n){return typeof t=="number"&&typeof e=="number"?u(t,e,n):n<.5?t:e}function xr(t,e,n){return t==null||e==null?n<.5?t:e:u(t,e,n)}var un=Symbol("propertyMeta");function at(t){return _r(t,un)}function _r(t,e){let n=[],r=Object.getPrototypeOf(t);for(;r&&r!==Object.prototype;)n.unshift(r),r=Object.getPrototypeOf(r);let o=[],i=new Map;for(let s of n)if(Object.prototype.hasOwnProperty.call(s,e))for(let a of s[e]){let l=i.get(a.key);l===void 0?(i.set(a.key,o.length),o.push(a)):o[l]=a}return o}function _e(t,e){for(let[n,r]of Object.entries(e))r(t.prototype,n)}function k(t){return function(e,n){let r=n,{default:o,mapper:i,tween:s,...a}=t??{},l={key:r,default:o,options:i!=null||s!=null?{mapper:i,tween:s}:void 0,...Object.keys(a).length>0?{editor:a}:{}};Object.prototype.hasOwnProperty.call(e,un)||(e[un]=[]);let c=e[un];c.some(f=>f.key===r)||c.push(l)}}var P=null;function lt(t){let e=P;return P=t,e}var Se=class{_host;_name;_value;_fn=null;_running=!1;constructor(e,n=null,r=""){this._host=n,this._name=r,this._value=e}get(){if(P!==null&&P.read(this),!this._fn||this._running)return this._value;this._running=!0;try{return this._value=this._fn()}finally{this._running=!1}}set(e){P!==null&&P.write(this),this._fn=null,this._value=e}bind(e){P!==null&&P.write(this),this._fn=e}unbind(){this._fn&&(P!==null&&P.write(this),this._value=this.get(),this._fn=null)}isBound(){return this._fn!==null}snapshot(){return this._fn?{value:this.get(),fn:this._fn}:{value:this._value}}restoreFrom(e){e.fn?this.bind(e.fn):this.set(e.value)}dispose(){this._fn=null,this._value=void 0}};var Sr=class{target;props;duration;easing;atPrepared=null;constructor(e,n,r,o){this.target=e,this.props=n,this.duration=r,this.easing=o}at(e){return this.atPrepared||(this.atPrepared=this.prepare()),this.atPrepared.seek(K(e)*this.duration),{}}_stepper(){return this.prepare()}prepare(){return this.target._prepareStep(this.props,this.duration,this.easing)}};function $s(t,e,n,r){return new Sr(t,e,n,r)}function fn(t){return t.count===null?1/0:Math.max(0,Math.floor(t.count))+1}function sw(t){return t!==void 0&&(t.count===null||t.count>=1)}function Vs(t,e,n=e){return e<=0?e:t.count===null?Math.max(e,n):e*fn(t)}function Hs(t,e,n){if(n<=0)return 1;let r=fn(t),o=Math.min(Math.max(e,0)/n,r),i=Math.min(Math.floor(o),r-1),s=K(o-i);switch(t.direction??"normal"){case"reverse":return 1-s;case"alternate":return i%2===0?s:1-s;default:return s}}var Ys=Symbol("settles");function ct(t){return t[Ys]=!0,t}function Xs(t){return t[Ys]===!0}function uw(t){return typeof t?.at=="function"&&typeof t?.duration=="number"}function vr(t,e,n,r){return kr(t,n,i=>e(r?r(K(i)):K(i)))}function ve(t,e,n){return vr({set:()=>{}},o=>(e(o),{}),t,n)}function fw(t,e,n){let r=t.duration;if(r<=0||fn(e)<=1)return t;let o=Vs(e,r,n),i=s=>t.at(Hs(e,K(s)*o,r));return{duration:o,at:i,_stepper(){let s=0;return{seek:a=>{s=a,i(a/o)},advance:a=>{s+=a;let l=s>=o;return i(l?1:s/o),l}}}}}function hn(t,...e){let n=e.reduce((r,o)=>r+o.duration,0);return kr(t,n,r=>{let o=r*n,i={},s=0;for(let a of e){if(o<s)break;let l=a.duration>0?(o-s)/a.duration:1;Object.assign(i,a.at(K(l))),s+=a.duration}return i})}function ut(t,...e){let n=e.reduce((r,o)=>Math.max(r,o.duration),0);return kr(t,n,r=>{let o=r*n,i={};for(let s of e){let a=s.duration>0?o/s.duration:1;Object.assign(i,s.at(K(a)))}return i})}function kr(t,e,n){let r=o=>e>0?o/e:1;return{duration:e,at(o){let i=n(o);return t.set(i),i},_stepper(){let o=0;return{seek:i=>{o=i,t.set(n(r(i)))},advance:i=>{o+=i;let s=o>=e;return t.set(n(s?1:r(o))),s}}}}}function dw(t,e){let n=Object.keys(e).filter(i=>e[i]!==void 0),r=new Array(n.length),o=new Array(n.length);for(let i=0;i<n.length;i++)r[i]=t[n[i]],o[i]=e[n[i]];return i=>{for(let s=0;s<n.length;s++)t[n[s]]=r[s]+(o[s]-r[s])*i}}function Us(t,e,n){return r=>{for(let o=0;o<t.length;o++)t[o].set(e[o]+(n[o]-e[o])*r)}}function ht(t,e){return{id:Symbol(e??"context"),defaultValue:t,name:e}}var ft=class t{entries;constructor(e){this.entries=e}static EMPTY=new t(new Map);with(e,n){let r=new Map(this.entries);return r.set(e.id,n),new t(r)}get(e){return this.entries.has(e.id)?this.entries.get(e.id):e.defaultValue}};function yw(t,e){return t.__cells?.slots.get(e)}function dn(t){return t.__cells??={slots:new Map}}var pn=Symbol("commandMeta");function Gs(t){return _r(t,pn)}function j(t){return function(e,n){let r=n,o=t?.key??r;Object.prototype.hasOwnProperty.call(e,pn)||(e[pn]=[]);let i=e[pn];i.some(s=>s.key===o)||i.push({key:o,method:r,...t?.name?{name:t.name}:{},...t?.args?{args:t.args}:{}})}}var Ks="layoutBounds",Sw="var:",vw="presence:",Zs="structure";function kw(t,e){let n=lt(t);try{return e()}finally{lt(n)}}function Mw(t){let e=lt(null);try{return t()}finally{lt(e)}}function Cw(t){return t._host?`${t._host.id}.${t._name}`:t._name}function Js(t,e){return{duration:e,at:()=>({}),_stepper:()=>Mr(e)}}function Mr(t){let e=0;return{seek:n=>{e=n},advance:n=>(e+=n,e>=t)}}function Au(t,e,n){let r=new Se(void 0,t,e),o=dn(t);o.slots.set(e,r),n?.tween&&(o.tweens??=new Map).set(e,n.tween),n?.mapper&&(o.mappers??=new Map).set(e,n.mapper),Object.defineProperty(t,e,{get:()=>r.get(),set:i=>t._writeProp(e,i),enumerable:!0,configurable:!0})}function Qs(t,e,n,r){t.__cells?.slots.get(e)?r&&(r.tween&&(dn(t).tweens??=new Map).set(e,r.tween),r.mapper&&(dn(t).mappers??=new Map).set(e,r.mapper)):Au(t,e,r),t._writeProp(e,n)}function ea(t){let e={};if(t.__cells)for(let n of t.__cells.slots.keys())e[n]=t[n];return e}function Ou(t){let e=new Map,n=t.__cells?.slots;if(!n)return e;for(let[r,o]of n)e.set(r,o.snapshot());return e}function ta(t){t.__cells&&t._stateStack.push(Ou(t))}function na(t){return t._stateStack.pop()}function Cr(t,e){let n=t.__cells?.slots;if(n)for(let[r,o]of e)n.get(r)?.restoreFrom(o)}function ra(t,e,n,r){let o=null;return ve(n,i=>{if(!o){let s={};if(e)for(let[a,l]of e)s[a]=l.value;o=t._prepareStep(s,n)}o.seek(i*n),e&&i>=1&&Cr(t,e)},r)}function oa(){return{total:0,creation:0,elapsed:0,started:!1}}function ia(t,e){t.started||(t.creation=e,t.started=!0),t.total=e,t.elapsed=e-t.creation}var Eu={"2d":"2D nodes go in the 2D tree, or inside a Canvas3D as a HUD over its scene.","3d":"Put 3D nodes inside a Canvas3D, which is the one node that holds both.",audio:"Put audio nodes under an AudioBus, or directly on the scene root."},de=class t{get _childTrees(){return[this.dimension]}constructor(e){this._props=e;let n=e;this.key=n?.key,this.id=n?.id??crypto.randomUUID()}key;_hidden=!1;_locked=!1;get hidden(){return this._hidden}get locked(){return this._locked}_setEditorState(e,n){this._hidden=e,this._locked=n}initProps(e){e?.ref&&e.ref(this);for(let n of at(this)){let r=e?e[n.key]:void 0,o=r!==void 0?r:n.default;this.applyProp(n.key,o,n.options)}}adoptChildrenProp(e){if(e&&e.children){let r=(Array.isArray(e.children)?e.children:[e.children]).flat(1/0).filter(o=>o instanceof t);r.length>0&&this._addChildren(r)}}acceptsChild(e){return e.dimension===this.dimension}assertAcceptsChild(e){if(!this.acceptsChild(e)){let r=e.dimension===this.dimension?this._childRule():Eu[e.dimension];throw new TypeError(`${this.className} (${this.dimension}) cannot hold ${e.className} (${e.dimension}).${r?` ${r}`:""}`)}let n=e._parentRefusal(this);if(n)throw new TypeError(n)}_childRule(){return""}_parentRefusal(e){return null}_assets=null;_parent=null;_mounted=!1;get mounted(){return this._mounted}get parent(){return P!==null&&P.read(this._structureSlot()),this._parent}get assets(){if(!this._assets)throw new Error("Assets not bound \u2014 this node is not attached to a scene. See Node.attach().");return this._assets}_context=ft.EMPTY;_contextBound=!1;_props;useContext(e){return this._context.get(e)}id;__cells;_children=[];static flattenChildrenProp(e){let n=e?e.children:void 0;return n?(Array.isArray(n)?n:[n]).flat(1/0).filter(o=>o instanceof t):[]}applyProp(e,n,r){Qs(this,e,n,r)}_writeProp(e,n){if(n===void 0)return;let r=this.__cells?.slots.get(e);if(!r)return;let o=this.__cells?.mappers?.get(e);if(typeof n=="function"){let i=n;if(o){let s;r.bind(()=>{let a=i();return a===void 0?(s??={value:this._unsetValue(e,o)}).value:o(a,r.get())})}else r.bind(i)}else r.set(o?o(n,r.get()):n)}get properties(){return ea(this)}get className(){return this.constructor.name}set(e){let n=this.__cells?.slots;if(n)for(let r in e){let o=e[r];o!==void 0&&n.has(r)&&this._writeProp(r,o)}}to(e){return $s(this,e.data??{},e.duration,e.easing)}command(e,n=1,r){return this._mounted?vr(this,e,n,r):Js(this,n)}_prepareStep(e,n,r){if(!this._mounted)return Mr(n);let o=[],i=[],s=[],a=[],l=[];for(let y of Object.keys(e)){let x=this.__cells?.slots.get(y);if(!x)continue;let g=e[y],m=this.__cells?.mappers?.get(y),w=m?m(g,this[y]):g,v=this.__cells?.tweens?.get(y);if(v){let M=this[y];a.push(S=>{x.set(v(M,w,S))})}else typeof w=="number"?(o.push(x),i.push(this[y]),s.push(w)):typeof w=="string"&&l.push([x,w])}let c=Us(o,i,s),f=a.length>0,h=l.length>0,d=y=>{let x=r?r(y):y;if(c(x),f)for(let g of a)g(x);if(h&&y>=1)for(let[g,m]of l)g.set(m)},p=0;return{seek:y=>{p=y,d(n>0?Math.min(y/n,1):1)},advance:y=>(p+=y,p<n?(d(p/n),!1):(d(1),!0))}}_unsetValue(e,n){let r=at(this).find(i=>i.key===e)?.default,o=typeof r=="function"?r():r;return o===void 0?void 0:n(o,void 0)}_stateStack=[];save(){ta(this)}restore(e){let n=na(this),r=e?.duration;if(r===void 0||r<=0){n&&Cr(this,n);return}return ra(this,n,r,e?.easing)}_time=oa();get time(){return P!==null&&P.clock?.(this),this._time}_advanceOwnTime(e){ia(this._time,e),this._sample()}_sample(){}_primeMotion(e){}attach(e){let n=!this._mounted;this._mounted=!0,this._assets!==e.assets&&(this._assets=e.assets);let r=this.provideContext(e.context);if((!this._contextBound||this._context!==r)&&(this._context=r,this._contextBound=!0),n&&this.resolveContext(r),this._advanceOwnTime(e.time),this._children.length===0)return;let i=r===e.context?e:{...e,context:r};for(let s of this._children)s.attach(i)}detach(){if(this._mounted){this._mounted=!1;for(let e of this._children)e.detach()}}_currentScope(){return this._assets&&this._contextBound?{assets:this._assets,context:this._context,time:this._time.total}:null}_attachChild(e){if(!this._mounted)return;let n=this._currentScope();n&&e.attach(n)}resolveContext(e){}provideContext(e){return e}attachDetached(e){let n=this._currentScope();n&&e.attach(n)}declareAssets(e){}get children(){return P!==null&&P.read(this._structureSlot()),this._children}get _allChildren(){return P!==null&&P.read(this._structureSlot()),this._children}add(e){if(e instanceof t){this._addChild(e);return}let n=t.flattenChildrenProp({children:e});n.length>0&&this._addChildren(n)}remove(e){if(e instanceof t){this._removeChild(e);return}for(let n of t.flattenChildrenProp({children:e}))this._removeChild(n)}clear(){for(let e of this._children)P!==null&&this._structureChanged(e),e._parent=null,e.detach();this._children.length=0}addChildAt(e){let{child:n,index:r}=e.data;this.assertAcceptsChild(n),this._insertChildAt(n,r)}_insertChildAt(e,n){P!==null&&this._structureChanged(e),this._children.splice(n,0,e),e._parent=this,this._attachChild(e)}_structureSlot(){return this._structure??=new Se(null,this,Zs)}_structureChanged(e){P.write(this._structureSlot()),e&&P.write(e._structureSlot())}_structure=null;_addChild(e){this.assertAcceptsChild(e),P!==null&&this._structureChanged(e),this._children.push(e),e._parent=this,this._attachChild(e)}_addChildren(e){for(let n of e)this.assertAcceptsChild(n);if(P!==null)for(let n of e)this._structureChanged(n);this._children.push(...e);for(let n of e)n._parent=this;for(let n of e)this._attachChild(n)}_removeChild(e){let n=this._children.indexOf(e);if(n<0)return;P!==null&&this._structureChanged(e);let[r]=this._children.splice(n,1);r&&(r._parent=null,r.detach())}dispose(){if(this.__cells)for(let e of this.__cells.slots.values())e.dispose();this.__cells=void 0,this._assets=null,this._mounted=!1,this._context=ft.EMPTY,this._contextBound=!1}};_e(de,{to:j(),restore:j(),addChildAt:j({args:["child","index"]})});var mn=class extends Error{assetType;src;nodeId;constructor(e,n,r){super(`${e} asset "${n}" is not loaded. `+(r??Tu(e))),this.name="AssetNotLoadedError",this.assetType=e,this.src=n}};function Tu(t){return t==="audio"?"Play it from a command (`timeline.sound(...)`), so the asset timeline loads it before this frame draws.":`Declare it from the node's declareAssets() (e.g. assets.${t}(...)), so the asset timeline loads it before this frame draws.`}function le(t,e,n){if(t.measure){let r=t.measure(e,n);return{width:r.width??0,height:r.height??0}}return{width:sa(t.width,e.maxWidth),height:sa(t.height,e.maxHeight)}}function sa(t,e){return typeof t=="number"?t:t==="fill"?e??0:0}function la(t,e,n,r,o){let i=e?"width":"height",s=e?"height":"width",a=(e?r.hugWidth:r.hugHeight)===!0,l=(e?r.hugHeight:r.hugWidth)===!0,c={maxWidth:r.width,maxHeight:r.height},f=t.length,h=new Array(f),d=t.map(S=>zu(S.gapScale)),p=n==="auto"?0:n*Math.max(0,d.reduce((S,E)=>S+E,0)-1),y=0,x=0;for(let S=0;S<f;S++)t[S][i]==="fill"||l&&t[S][s]==="fill"||(h[S]=le(t[S],c,o),y+=h[S][i],h[S][s]>x&&(x=h[S][s]));let g=l?x:r[s];if(l)for(let S=0;S<f;S++){if(t[S][i]==="fill"||t[S][s]!=="fill")continue;let E=le(t[S],c,o);h[S]=ha(E,g,e),y+=E[i]}let m=Math.max(0,r[i]-p-y),w=0;for(let S of t)S[i]==="fill"&&(w+=aa(S.flex));for(let S=0;S<f;S++){let E=t[S];if(E[i]!=="fill")continue;let R,U;a?(U=ca(E,e,r,o),R=U[i]):(R=w>0?m*aa(E.flex)/w:0,U=le(E,e?{maxWidth:R,maxHeight:r.height}:{maxWidth:r.width,maxHeight:R},o));let se=E[s]==="fill"?g:U[s];h[S]=e?{width:R,height:se}:{width:se,height:R}}let v=p,M=0;for(let S of h)v+=S[i],S[s]>M&&(M=S[s]);return{sizes:h,lines:f>0?[{start:0,end:f,cross:M}]:[],gapScales:d,hug:e?{width:v,height:M}:{width:M,height:v}}}function ca(t,e,n,r){let o=le(t,e?{maxWidth:1/0,maxHeight:n.height}:{maxWidth:n.width,maxHeight:1/0},r),i=e?"width":"height";return Number.isFinite(o[i])?o:{...o,[i]:0}}function ua(t,e,n,r,o,i){let s=e?"width":"height",a=e?"height":"width",l=(e?o.hugWidth:o.hugHeight)===!0,c=l?1/0:o[s],f=n==="auto"?0:n,h={maxWidth:o.width,maxHeight:o.height},d=t.map(m=>l&&m[s]==="fill"?ca(m,e,o,i):le(m,h,i)),p=[],y=0,x=0,g=0;for(;g<d.length;){let m=g+1,w=d[g][s];for(;m<d.length&&w+f+d[m][s]<=c;)w+=f+d[m][s],m++;let v=0;for(let M=g;M<m;M++)t[M][a]!=="fill"&&d[M][a]>v&&(v=d[M][a]);for(let M=g;M<m;M++)t[M][a]==="fill"&&(d[M]=ha(d[M],v,e));p.push({start:g,end:m,cross:v}),w>y&&(y=w),x+=v,g=m}return x+=r*Math.max(0,p.length-1),{sizes:d,lines:p,gapScales:d.map(()=>1),hug:e?{width:y,height:x}:{width:x,height:y}}}function fa(t,e,n,r,o,i,s,a){let l=r?"width":"height",c=r?"height":"width",f=r?(1+s.x)/2:(1-s.y)/2,h=r?(1-s.y)/2:(1+s.x)/2,d=i*Math.max(0,e.length-1);for(let x of e)d+=x.cross;let p=h*(a[c]-d),y=new Array(t.length);for(let x of e){let g=x.end-x.start,m=0,w=0;for(let E=x.start;E<x.end;E++)m+=t[E][l],w+=n[E];let v,M=0;if(o==="auto"){let E=g>1?Math.max(0,a[l]-m)/(g-1):0;v=()=>E,m+=E*(g-1)}else{let E=R=>R<x.end?n[R]:1;v=R=>o*(n[R]+E(R+1))/2,m+=o*Math.max(0,w-1),M=o*(1-n[x.start])/2}let S=f*(a[l]-m)-M;for(let E=x.start;E<x.end;E++){let R=t[E],U=p+h*(x.cross-R[c]);y[E]=Pu(r?S:U,r?U:S,R,a),S+=R[l]+v(E)}p+=x.cross+i}return y}function Pu(t,e,n,r){return{x:t+n.width/2-r.width/2,y:r.height/2-e-n.height/2,width:n.width,height:n.height}}function ha(t,e,n){return n?{width:t.width,height:e}:{width:e,height:t.height}}function aa(t){return t==null?1:Number.isFinite(t)&&t>=0?t:1}function zu(t){return t==null?1:Number.isFinite(t)?ir(t,0,1):1}function da(t,e,n){let r={maxWidth:e.width,maxHeight:e.height},o=[],i={width:0,height:0};for(let s of t){let a=le(s,r,n);o.push(a),a.width>i.width&&(i.width=a.width),a.height>i.height&&(i.height=a.height)}return{sizes:o,hug:i}}function br(t,e,n){return t.map(r=>({x:n.x*Math.max(0,e.width-r.width)/2,y:n.y*Math.max(0,e.height-r.height)/2,width:r.width,height:r.height}))}function pa(t,e,n,r,o,i){let s=Math.max(1,Math.round(e)),a=Math.max(0,(o.width-n*(s-1))/s),l=Fu(t,s),c=l.reduce((w,v)=>Math.max(w,v.row+v.rowSpan),0),f=o.hugHeight!==!0&&c>0,h=f?Math.max(0,(o.height-r*(c-1))/c):0,d=new Array(c).fill(h),p=t.map((w,v)=>{let M=l[v],S=Ar(a,M.colSpan,n),E=f?{maxWidth:S,maxHeight:Ar(h,M.rowSpan,r)}:{maxWidth:S},R=le(w,E,i);return f||Nu(d,M.row,M.rowSpan,R.height,r),R}),y=[],x=0;for(let w of d)y.push(x),x+=w+r;let g=l.map(w=>({x:w.col*(a+n),y:y[w.row]??0,width:Ar(a,w.colSpan,n),height:ya(d,w.row,w.rowSpan,r)})),m=d.reduce((w,v)=>w+v,0)+r*Math.max(0,c-1);return{sizes:p,cells:g,hug:{width:o.width,height:m}}}function ma(t,e){return t.map(n=>({x:n.x+n.width/2-e.width/2,y:e.height/2-n.y-n.height/2,width:Math.min(n.width,e.width),height:Math.min(n.height,e.height)}))}function Fu(t,e){let n=[],r=[],o=(l,c,f,h)=>{for(let d=0;d<h;d++)for(let p=0;p<f;p++)if(r[l+d]?.[c+p])return!1;return!0},i=(l,c,f,h)=>{for(let d=0;d<h;d++){r[l+d]??=[];for(let p=0;p<f;p++)r[l+d][c+p]=!0}},s=0,a=0;for(let l of t){let c=Math.min(l.colSpan??1,e),f=l.rowSpan??1;if(l.column!==void 0&&l.row!==void 0){i(l.row-1,l.column-1,c,f),n.push({col:l.column-1,row:l.row-1,colSpan:c,rowSpan:f});continue}for(;a+c>e&&(s++,a=0),!o(s,a,c,f);)a++;i(s,a,c,f),n.push({col:a,row:s,colSpan:c,rowSpan:f}),a+=c}return n}function Nu(t,e,n,r,o){if(n===1){r>t[e]&&(t[e]=r);return}let i=r-ya(t,e,n,o);i>0&&(t[e]+=i)}function Ar(t,e,n){return t*e+n*(e-1)}function ya(t,e,n,r){let o=r*(n-1);for(let i=e;i<e+n;i++)o+=t[i]??0;return o}var Du={x:0,y:0};function Ru(t,e,n,r){let o=$.insetBounds(n.width,n.height,$.resolve(t.padding??0));return Sa(_a(t,e,o,r),t,o).map(s=>({x:s.x+o.x,y:s.y-o.y,width:s.width,height:s.height}))}function _a(t,e,n,r){let o=t.flow??"freeform";if(typeof o=="string")return Or(o,t,e,n,r);let i=Or(o.from,t,e,n,r),s=Or(o.to,t,e,n,r);return{...s,hug:$u(i.hug,s.hug,o.t),from:i,t:o.t}}function Sa(t,e,n){let r=ga(t,e,n),o=t.from;if(!o)return r;let i=ga(o,e,n),s=t.t??1;return r.map((a,l)=>({x:u(i[l].x,a.x,s),y:u(i[l].y,a.y,s),width:u(i[l].width,a.width,s),height:u(i[l].height,a.height,s)}))}function Iu(t,e){let{space:n,hug:r}=t;return xa(e.width,n.width,n.hugWidth,r.width)&&xa(e.height,n.height,n.hugHeight,r.height)}function Lu(t,e,n){let r=yn(t.width,e.maxWidth),o=yn(t.height,e.maxHeight),i=$.insetBounds(r,o,n);return{width:i.width,height:i.height,hugWidth:t.width==="hug",hugHeight:t.height==="hug"}}function Bu(t,e,n,r){let o=$.outsetSize(r.width,r.height,n);return{width:t.width==="hug"?o.width:yn(t.width,e.maxWidth),height:t.height==="hug"?o.height:yn(t.height,e.maxHeight)}}function ju(t,e){if(t.mode!=="horizontal"&&t.mode!=="vertical"||(t.mode==="horizontal"?e.width:e.height)>0)return null;let n=t.sizes.filter(r=>r.width>0||r.height>0).length;return n===0?null:`is laying out ${n} sized child${n===1?"":"ren"} in a run of length 0 (${e.width}\xD7${e.height}, ${t.mode}). They will be positioned from its centre rather than its leading edge.`}function Wu(t,e,n){let r=typeof t=="string"?t:t.to,o=typeof e=="string"?e:e.to;return n>=1||r===o?o:{from:r,to:o,t:n}}function Or(t,e,n,r,o){if(t==="freeform")return{mode:t,items:n,space:r,...da(n,r,o)};if(t==="grid"){let a=pa(n,e.columns??1,ka(e),Er(e),r,o);return{mode:t,items:n,space:r,...a}}let i=t==="horizontal",s=e.wrap?ua(n,i,e.gap??0,Er(e),r,o):la(n,i,e.gap??0,r,o);return{mode:t,items:n,space:r,...s}}function ga(t,e,n){if(t.mode==="grid")return ma(t.cells??[],n);let r=va(e);return t.mode==="freeform"?br(t.sizes,n,r):fa(t.sizes,t.lines??[],t.gapScales??[],t.mode==="horizontal",e.gap??0,Er(e),r,n)}function qu(t,e,n){return(t.flow??"freeform")!=="freeform"?null:br([n],e,va(t))[0]}function va(t){let e=t.align;return e===void 0?Du:typeof e=="string"?N.resolve(e):e}function ka(t){let e=t.gap??0;return e==="auto"?0:e}function Er(t){return t.crossGap??ka(t)}function yn(t,e){let n=e??0;return t==="hug"?n:Q.resolveLayout(t,n,0)}function $u(t,e,n){return{width:u(t.width,e.width,n),height:u(t.height,e.height,n)}}function xa(t,e,n,r){return wa(t,e)||n===!0&&wa(t,r)}function wa(t,e){return t===e?!0:!Number.isFinite(t)||!Number.isFinite(e)?!1:Math.abs(t-e)<=1e-6*Math.max(1,Math.abs(t),Math.abs(e))}var I={resolve:t=>t,lerp:Wu,arrange:Ru,measure:_a,place:Sa,reusable:Iu,freeSlot:qu,contentBox:Lu,size:Bu,collapsedRun:ju};var Ma={x:0,y:0,z:0};function qe(t){if(t===void 0)return{...Ma};if(typeof t=="number")return{x:t,y:t,z:t};if(Array.isArray(t))return{x:t[0]??0,y:t[1]??0,z:t[2]??0};let e=t;return{x:e.x??0,y:e.y??0,z:e.z??0}}function Tr(t,e,n){return{x:u(t.x,e.x,n),y:u(t.y,e.y,n),z:u(t.z,e.z,n)}}var c_={resolve:t=>qe(t),lerp:Tr};function gn(t){return t===void 0?void 0:qe(t)}function xn(t,e,n,r){return e===void 0?t:t!==void 0?Tr(t,e,n):r==="origin"?Tr(Ma,e,n):n>=1?e:t}function Vu(t,e,n){return{x:u(t.x,e.x,n),y:u(t.y,e.y,n),z:u(t.z,e.z,n),order:n<.5?t.order:e.order}}var u_={resolve:t=>{let e=qe(t),n=t?.order;return n?{...e,order:n}:e},lerp:Vu},Hu={x:0,y:0,z:0,w:1};function Yu(t,e,n){let{x:r,y:o,z:i,w:s}=e,a=t.x*r+t.y*o+t.z*i+t.w*s;if(a<0&&(r=-r,o=-o,i=-i,s=-s,a=-a),a>.9995)return Xu({x:u(t.x,r,n),y:u(t.y,o,n),z:u(t.z,i,n),w:u(t.w,s,n)});let l=Math.acos(a),c=Math.sin(l),f=Math.sin((1-n)*l)/c,h=Math.sin(n*l)/c;return{x:t.x*f+r*h,y:t.y*f+o*h,z:t.z*f+i*h,w:t.w*f+s*h}}function Xu(t){let e=Math.hypot(t.x,t.y,t.z,t.w);return e===0?{...Hu}:{x:t.x/e,y:t.y/e,z:t.z/e,w:t.w/e}}function f_(t){let e=Math.PI/360,n=Math.cos(t.x*e),r=Math.sin(t.x*e),o=Math.cos(t.y*e),i=Math.sin(t.y*e),s=Math.cos(t.z*e),a=Math.sin(t.z*e);switch(t.order??"XYZ"){case"YXZ":return{x:r*o*s+n*i*a,y:n*i*s-r*o*a,z:n*o*a-r*i*s,w:n*o*s+r*i*a};case"ZXY":return{x:r*o*s-n*i*a,y:n*i*s+r*o*a,z:n*o*a+r*i*s,w:n*o*s-r*i*a};case"ZYX":return{x:r*o*s-n*i*a,y:n*i*s+r*o*a,z:n*o*a-r*i*s,w:n*o*s+r*i*a};case"YZX":return{x:r*o*s+n*i*a,y:n*i*s+r*o*a,z:n*o*a-r*i*s,w:n*o*s-r*i*a};case"XZY":return{x:r*o*s-n*i*a,y:n*i*s-r*o*a,z:n*o*a+r*i*s,w:n*o*s+r*i*a};default:return{x:r*o*s+n*i*a,y:n*i*s-r*o*a,z:n*o*a+r*i*s,w:n*o*s-r*i*a}}}var Ca={resolve:t=>t,lerp:Yu};var $e=class{_ops=[];rect(e){return this._ops.push({kind:"rect",state:e}),this}ellipse(e){return this._ops.push({kind:"ellipse",state:e}),this}path(e){let n=e instanceof ae?e.toPathState():e;return this._ops.push({kind:"path",state:n}),this}line(e){return this._ops.push({kind:"line",state:e}),this}polygon(e){return this._ops.push({kind:"polygon",state:e}),this}polygram(e){return this._ops.push({kind:"polygram",state:e}),this}cut(){return this._ops.push({kind:"cut"}),this}ops(){return this._ops}isEmpty(){return!this._ops.some(e=>e.kind!=="cut")}};function ke(t,e,n,r){return o=>k({default:o&&"default"in o?o.default:t(),mapper:o?.mapper??e,tween:o?.tween??n,...o?.kind??r?{kind:o?.kind??r}:{}})}var M_=ke(()=>[],V.resolve,V.lerp,"fills"),ba=ke(()=>[],ge.resolve,ge.lerp,"effects"),Aa=ke(()=>0,$.resolve,$.lerp,"insets"),Oa=ke(()=>"center",N.resolve,N.lerp,"alignment"),C_=ke(()=>"freeform",void 0,I.lerp);function Ea(t){return k({default:void 0,mapper:gn,tween:(e,n,r)=>xn(e,n,r,t),kind:"vector3"})}var Ta=ke(()=>({x:0,y:0,z:0,w:1}),void 0,Ca.lerp,"quaternion"),Pr=ke(()=>0,void 0,vs.lerp,"audioParam"),Pa=ke(()=>[],fr.resolve,fr.lerp,"audioFilters");function za(t,e,n,r,o,i){t.prevPos?(t.prevPos.x=e,t.prevPos.y=n):t.prevPos={x:e,y:n},t.prevTime=i,t.prevRotation=r,t.prevScale=o}function Fa(){return{prevPos:null,prevTime:0,prevRotation:0,prevScale:1}}function Na(t,e,n,r,o,i,s){let a=s-e.prevTime,l=e.prevPos;if(l&&a>0&&a<=.2){let c=(n-l.x)/a,f=(r-l.y)/a;t.dt=a,t.velocity.x=c,t.velocity.y=f,t.speed=Math.hypot(c,f),t.direction=Math.atan2(f,c)*180/Math.PI,t.angularVelocity=(o-e.prevRotation)/a,t.scaleVelocity=(i-e.prevScale)/a}else t.dt=0,t.velocity.x=0,t.velocity.y=0,t.speed=0,t.direction=0,t.angularVelocity=0,t.scaleVelocity=0;l?(l.x=n,l.y=r):e.prevPos={x:n,y:r},e.prevTime=s,e.prevRotation=o,e.prevScale=i}function Uu(t,e){let n=t.lastMeasure,r=n?.measurer;if(!r)return null;let o=n?.constraints??{maxWidth:t.measuredWidth||Number.MAX_SAFE_INTEGER,maxHeight:t.measuredHeight||Number.MAX_SAFE_INTEGER},i=e.measure(o,r);return{width:i.width??0,height:i.height??0}}var wn=.7;function Da(t,e,n,r,o){let i=null,s=!1,a=!1,l,c,f=()=>{let h=e.opacity;l=e.width,c=e.height,s=typeof l=="number",a=typeof c=="number";let d=s&&a?null:Uu(t,e),p=s||d!==null,y=a||d!==null,x=s?l:d?.width??0,g=a?c:d?.height??0;e.set({opacity:0,gapScale:0,...p?{width:0}:{},...y?{height:0}:{}}),t.addChildAt({data:{child:e,index:n}});let m={};p&&(m.width=x),y&&(m.height=g);let w=r*wn,v=r-w;return hn(e,ut(e,e.to({data:m,duration:w,easing:o}),e.to({data:{gapScale:1},duration:w,easing:o})),e.to({data:{opacity:h},duration:v,easing:o}))};return ve(r,h=>{if(i||(i=f()),i.at(h),h>=1){let d={};s||(d.width=l),a||(d.height=c),(!s||!a)&&e.set(d)}})}function Ra(t,e,n,r){let o=null,i=null,s=!1,a=()=>{if(s=!0,e<0||e>=t.children.length)return;o=t.children[e];let l=o.measuredWidth,c=o.measuredHeight;o.set({width:l,height:c});let f=n*(1-wn),h=n-f;i=hn(o,o.to({data:{opacity:0},duration:f,easing:r}),ut(o,o.to({data:{width:0,height:0},duration:h,easing:r}),o.to({data:{gapScale:0},duration:h,easing:r})))};return ve(n,l=>{if(s||a(),!i||!o)return;let c=l>=1;!c&&o.parent!==t&&t.addChildAt({data:{child:o,index:Math.min(e,t.children.length)}}),i.at(l),c&&(t.remove(o),o.set({gapScale:1}))})}function Ia(t,e,n,r){let o=n/2,i=null,s=null,a=()=>{let l=t.opacity;s=t.parent;let c=t.measuredWidth,f=t.measuredHeight;t.set({width:c,height:f});let h=o*(1-wn),d=o-h,p=o*wn,y=o-p;return hn(t,t.to({data:{opacity:0},duration:h,easing:r}),ut(t,t.to({data:{width:0,height:0},duration:d,easing:r}),t.to({data:{gapScale:0},duration:d,easing:r})),ut(t,t.to({data:{width:c,height:f},duration:p,easing:r}),t.to({data:{gapScale:1},duration:p,easing:r})),t.to({data:{opacity:l},duration:y,easing:r}))};return ve(n,l=>{i||(i=a());let f=l*n>=o;f&&t.parent!==e?(s&&s.remove(t),e.add(t)):!f&&t.parent!==s&&(e.remove(t),s&&s.add(t)),i.at(l)})}var Gu=[["rotationX","rotationX"],["rotationY","rotationY"],["rotationZ","rotationZ"],["depth","depth"],["perspective","perspective"],["backfaceVisible","backfaceVisible"],["flipHorizontal","flipHorizontal"],["flipVertical","flipVertical"],["origin","transformOrigin"]];function _n(t){let e=t.transform3D;if(e==null||typeof e!="object")return;let n=e;for(let[r,o]of Gu){let i=n[r];i!==void 0&&t[o]===void 0&&(t[o]=i)}}function zr(t,e,n,r,o){if(n===0)return{x:t+r,y:e+o};let i=n*Math.PI/180,s=Math.cos(i),a=Math.sin(i);return{x:t+s*r+a*o,y:e-a*r+s*o}}function Te(t,e,n,r,o,i,s,a=on){let l=o.x*(i/2),c=-o.y*(s/2);return Ns(t,e,n,r,l,c,a)}function Sn(t,e,n){let r=(o,i)=>{let s=We(t,{x:o,y:-i});return{x:s.x,y:-s.y}};return{center:r(0,0),topLeft:r(-e,n),topRight:r(e,n),bottomLeft:r(-e,-n),bottomRight:r(e,-n),topCenter:r(0,n),bottomCenter:r(0,-n),centerLeft:r(-e,0),centerRight:r(e,0)}}var vn=Ps();function Mn(t,e){let n=sn(e);return{root:t,camera:e,view:n,screen:pr(e,n),pushed:vn,local:vn,flat:!0,plane:mr(n,{x:0,y:0,width:0,height:0}),paints:!1,facesAway:!1,nearCut:null}}function kn(t,e){let n=e._spaceMatrix(),r=ln(t.view,n),o=t.camera,i=pr(o,r),s=Zu(e),a=mr(r,s),{side:l,edgeOn:c}=an(o,a),f=Ls(o,a),h=vn,d=!c&&f!=="none";if(d)if(t.pushed===vn)h=i;else{let p=rn(t.pushed);p?h=we(p,i):d=!1}return{root:t.root,camera:o,view:r,screen:i,pushed:d?i:t.pushed,local:h,flat:n[2]===0&&n[6]===0&&n[8]===0&&n[9]===0&&n[11]===0,plane:a,paints:d,facesAway:!c&&l<0,nearCut:d&&f==="some"?Qu(i,s):null}}function Ku(t){let e=[];for(let n=t.parent;n;n=n.parent){let r=n._spaceCamera();if(r){let o=Mn(n,r);for(let i=e.length-1;i>=0;i--)o=kn(o,e[i]);return kn(o,t)}if(!n._rendersChildrenInSpace())return null;e.push(n)}return null}function I_(t){let e=t._spaceCamera();return e?Mn(t,e):t._rendersChildrenInSpace()?Ku(t):null}function La(t){return t.length<2||t.every(e=>e.flat)?t.map((e,n)=>n):js(t[0].camera,t.map(e=>e.plane))}function Zu(t){let e=t._localBounds();return{x:e.x,y:-e.y,width:e.width,height:e.height}}var Ju=128;function Qu(t,e){let n=Bs(t,e,Math.max(e.width,e.height)/2+Ju);if(!n)return null;let r=new ae().moveTo(n[0].x,-n[0].y);for(let i=1;i<n.length;i++)r.lineTo(n[i].x,-n[i].y);let o=Math.max(...n.map(i=>Math.max(Math.abs(i.x),Math.abs(i.y))));return new $e().path(r.close().toPathState({centerBounds:[-o,-o,o,o]}))}function Ba(t,e,n,r){if(!t)return{};let o=e.x+n,i=e.y-r;return{parent:{left:-t.width/2-o,top:-t.height/2-i,right:t.width/2-o,bottom:t.height/2-i}}}function ja(t,e,n,r,o){let i=di(e);i.length!==0&&(!n||n.isEmpty()||(t.beginClip(n),t.beginEffects(i,"backdrop",r,o),t.endEffects(),t.endClip()))}function Wa(t,e,n,r,o){let i=pi(e),s=i.length>0;s&&t.beginEffects(i,"foreground",n,r),o(),s&&t.endEffects()}var ef={},Fr={x:0,y:0},tf=[],Cn={rotationX:0,rotationY:0,rotationZ:0,depth:0,perspective:0,flipHorizontal:!1,flipVertical:!1};function qa(t){return Cn.rotationX=t.rotationX,Cn.rotationY=t.rotationY,Cn.depth=t.depth,Cn}var nf=Object.freeze({}),rf={width:0,height:0},Y=class t extends de{get dimension(){return"2d"}get parent2D(){let e=this._parent;return e instanceof t?e:null}get parent(){return P!==null&&P.read(this._structureSlot()),this.parent2D}get children(){P!==null&&P.read(this._structureSlot());let e=this._children;for(let n=0;n<e.length;n++)if(!(e[n]instanceof t))return e.filter(r=>r instanceof t);return e}constructor(e){if(super(e),e&&(gr.expand(e),_n(e)),this.initProps(e),e&&e.flex!==void 0?(e.width===void 0&&this.applyProp("width","fill",{tween:Q.lerp}),e.height===void 0&&this.applyProp("height","fill",{tween:Q.lerp})):this.applyDefaultSize(e),e){N.validateProps(e);let n=N.findKey(e);if(n){let r=e[n],o=typeof r=="function"?r:()=>r,{pivot:i,x:s,y:a}=N.bindTarget(n,o,()=>this._layoutBounds.get());this._writeProp("pivot",i),this._writeProp("x",s),this._writeProp("y",a)}}this.adoptChildrenProp(e)}set(e){let n=e.size;e.transform3D!==void 0&&(e={...e},_n(e)),super.set(e),n!==void 0&&(e.width===void 0&&this._writeProp("width",n),e.height===void 0&&this._writeProp("height",n))}_prepareStep(e,n,r){gr.expand(e),_n(e);let o=e.pivot;o!==void 0&&delete e.pivot,N.validateProps(e);let i=N.findKey(e);if(i){let s=e[i],{pivot:a,x:l,y:c}=N.resolveTargetOnce(i,this._layoutBounds.get(),s);this._writeProp("transformOrigin",o!==void 0?N.resolve(o):a),e.x=l,e.y=c}else o!==void 0&&this._writeProp("transformOrigin",N.resolve(o));return super._prepareStep(e,n,r)}declareAssets(e){e.effects(this.effects)}_sample(){this._sampleMotion()}_primeMotion(e){let n=this.layoutBounds,r=this._offset();za(this._motionHistory,(n?.x??0)+r.x,(n?.y??0)-r.y,this.rotation,this.scale,e)}_layoutBounds=new Se({x:0,y:0,width:0,height:0},this,Ks);lastMeasure;get layoutBounds(){return this._layoutBounds.get()}static flowChildrenProp(e){return t.flattenChildrenProp(e).filter(n=>n instanceof t)}static hasFillChild(e,n){return e.some(r=>(n==="width"?r.width:r.height)==="fill")}applyDefaultSize(e){let r=t.flowChildrenProp(e).length>0?"hug":"fill";(!e||e.width===void 0)&&this.applyProp("width",r,{tween:Q.lerp}),(!e||e.height===void 0)&&this.applyProp("height",r,{tween:Q.lerp})}moveTo(e){let{path:n,target:r,targetAnchor:o,...i}=e.data??{},s=i.x!==void 0||i.y!==void 0,a=typeof r=="string"&&r!=="";if(a&&s)throw new Error("moveTo takes a `target` or an `x`/`y` destination, not both \u2014 the target's anchor is where the move ends.");let l=a?this._pointOnNode(r,o):null;if(n==null)return this.to({data:{...i,...l},duration:e.duration,easing:e.easing});if(s)throw new Error("moveTo takes a `path` or an `x`/`y` destination, not both \u2014 the path's own end is where the move ends.");let c=te.sampler(n instanceof ae?n.toCommands():n),{length:f}=c,h=c.frameAt(0),d=c.frameAt(f),p=l&&h&&d?te.endFit(h,d,l):null,y=i.pivot;return this.command(x=>{let g=c.frameAt(f*x);if(!g)return{};let m=p?p(g):g,w={x:m.x,y:m.y};return y!==void 0&&(w.transformOrigin=y),w},e.duration,e.easing)}fadeTo(e){return this.to({data:e.data,duration:e.duration,easing:e.easing})}rotateTo(e){return this.to({data:e.data,duration:e.duration,easing:e.easing})}scaleTo(e){return this.to({data:e.data,duration:e.duration,easing:e.easing})}layoutTo(e){return this.to({data:$a(e.data),duration:e.duration,easing:e.easing})}pulse(e){let n=this.scale,r=e.data?.factor??1.2;return this.command(o=>({scale:n*(1+(r-1)*Math.sin(Math.PI*o))}),e.duration,e.easing)}wiggle(e){let n=this.rotation,r=e.data?.angle??8,o=e.data?.turns??3;return this.command(i=>({rotation:n+r*Math.sin(2*Math.PI*o*i)*Math.sin(Math.PI*i)}),e.duration,e.easing)}effectTo(e){return this.to({data:$a(e.data),duration:e.duration,easing:e.easing})}get measuredWidth(){return this.layoutBounds.width}get measuredHeight(){return this.layoutBounds.height}_rotateOffset(e,n){let r=this._offset();return zr(r.x,r.y,this.rotation,e,n)}get center(){let e=this._offset();return{x:e.x,y:e.y}}get topLeft(){let e=this.layoutBounds;return this._rotateOffset(-e.width/2,e.height/2)}get topRight(){let e=this.layoutBounds;return this._rotateOffset(e.width/2,e.height/2)}get bottomLeft(){let e=this.layoutBounds;return this._rotateOffset(-e.width/2,-e.height/2)}get bottomRight(){let e=this.layoutBounds;return this._rotateOffset(e.width/2,-e.height/2)}get topCenter(){let e=this.layoutBounds;return this._rotateOffset(0,e.height/2)}get bottomCenter(){let e=this.layoutBounds;return this._rotateOffset(0,-e.height/2)}get centerLeft(){let e=this.layoutBounds;return this._rotateOffset(-e.width/2,0)}get centerRight(){let e=this.layoutBounds;return this._rotateOffset(e.width/2,0)}_localMatrix(){let e=this.layoutBounds,n=this._slotMatrix(),{x:r,y:o}=this._offset();if(n)return we(n,Te(r,-o,this.rotation,this.scale,this._transformOrigin(),e?.width??0,e?.height??0));let i=(e?.x??0)+r,s=(e?.y??0)-o;return Te(i,s,this.rotation,this.scale,this._transformOrigin(),e?.width??0,e?.height??0)}_placement(){return this.parent2D?._placementOf(this)??null}_placementOf(e){return null}_planeOf(e){return null}_slotFor(e){let n=this._childSpace,r=n?I.freeSlot(n.settings,n.inner,e):null;return n&&r?{x:n.inner.x+r.x,y:n.inner.y-r.y}:null}_centreShift(e=this.rotation,n=this.scale){let r=this.layoutBounds,o=Te(0,0,e,n,this._transformOrigin(),r?.width??0,r?.height??0);return We(o,{x:0,y:0})}_handles(){return tf}_handleValue(e,n){return null}_offsetScratch={x:0,y:0};_offset(){let e=this.parent2D?._planeOf(this);if(e)return e.toOffset(this.x,this.y);let n=this._offsetScratch;return n.x=this.x,n.y=this.y,n}_slotMatrix(e=!1){let n=this._placement();if(!n)return null;let r=this.layoutBounds;return Te(r?.x??0,r?.y??0,n.rotation,n.scale,Fr,0,0,e?qa(n):void 0)}_slotAffine(){let e=this._placement();if(!e)return null;let n=this.layoutBounds;return cn(n?.x??0,n?.y??0,e.rotation,e.scale,0,0,qa(e))}_transformOrigin(){return this.transformOrigin??this.pivot}_projectionScratch={rotationX:0,rotationY:0,rotationZ:0,depth:0,perspective:0,flipHorizontal:!1,flipVertical:!1};_projection(){let e=this._projectionScratch;return e.rotationX=this.rotationX,e.rotationY=this.rotationY,e.rotationZ=this.rotationZ,e.depth=this.depth,e.perspective=this.perspective,e.flipHorizontal=this.flipHorizontal,e.flipVertical=this.flipVertical,e}_spaceMatrix(){let e=this.layoutBounds,n=e?.width??0,r=e?.height??0,o=this._transformOrigin(),i=this._slotAffine(),{x:s,y:a}=this._offset();return i?ln(i,cn(s,-a,this.rotation,this.scale,o.x*(n/2),-o.y*(r/2),this._projection())):cn((e?.x??0)+s,(e?.y??0)-a,this.rotation,this.scale,o.x*(n/2),-o.y*(r/2),this._projection())}worldMatrix(){let e=this._localMatrix(),n=this.parent2D;return n?we(n.worldMatrix(),e):e}get global(){let e=this.layoutBounds,n=Sn(this.worldMatrix(),(e?.width??0)/2,(e?.height??0)/2),r=0,o=1,i=1;for(let s=this;s;s=s.parent2D){let a=s._placement();r+=s.rotation+(a?.rotation??0),o*=s.scale*(a?.scale??1),i*=s.opacity*(a?.opacity??1)}return{x:n.center.x,y:n.center.y,...n,rotation:r,scale:o,opacity:i}}_pointOnNode(e,n){let r=of(this,e);if(!r)return null;let o=N.resolve(n??"center"),i=r.layoutBounds,s=We(r.worldMatrix(),{x:o.x*((i?.width??0)/2),y:-o.y*((i?.height??0)/2)}),a=this.parent2D,l=a?rn(a.worldMatrix()):null;if(a&&!l)return null;let c=l?We(l,s):s,f=this.layoutBounds,h=c.x-(f?.x??0),d=(f?.y??0)-c.y;return a?._planeOf(this)?.toCoords(h,d)??{x:h,y:d}}addChildAt(e){let{child:n,index:r}=e.data;if(this.assertAcceptsChild(n),e.duration===void 0){this._insertChildAt(n,r);return}return Da(this,n,r,e.duration,e.easing)}removeChildAt(e){let n=e.data.index;if(e.duration===void 0){if(n<0||n>=this._children.length)return null;P!==null&&this._structureChanged(this._children[n]);let[r]=this._children.splice(n,1);return r&&(r._parent=null,r.detach()),r??null}return Ra(this,n,e.duration,e.easing)}_transformScratch={x:0,y:0,width:0,height:0,scale:1,rotation:0,opacity:1,blend:"pass-through",effects:[],pivot:{x:0,y:0}};_motionHistory=Fa();_renderState={id:this.id,rects:{},elapsed:0,dt:0,velocity:{x:0,y:0},direction:0,speed:0,angularVelocity:0,scaleVelocity:0};_sampleMotion(){let e=this.layoutBounds,n=this._offset(),r=(e?.x??0)+n.x,o=(e?.y??0)-n.y;Na(this._renderState,this._motionHistory,r,o,this.rotation,this.scale,this._time.total)}applyTransform(e){let n=this.layoutBounds,r=this._transformScratch,{x:o,y:i}=this._offset();r.x=(n?.x??0)+o,r.y=(n?.y??0)-i,r.width=n?.width??0,r.height=n?.height??0,r.scale=this.scale,r.rotation=this.rotation,r.opacity=this.opacity,r.blend=this.blend,r.effects=this.effects,r.pivot=this._transformOrigin();let s=this._placement()?.opacity;s!==void 0&&(r.opacity*=s);let a=this._spaceFrame,l=a?null:this._slotMatrix(!0);if(a)r.matrix=a.local;else if(l)r.matrix=we(l,Te(o,-i,r.rotation,r.scale,r.pivot,r.width,r.height,this._projection()));else{let c=this._projection();r.matrix=hr(c)?Te(r.x,r.y,r.rotation,r.scale,r.pivot,r.width,r.height,c):void 0}e.transform(r)}renderSelf(e){}renderOverlay(e){}clipSelf(){return null}_cameraScope(){return null}_spaceCamera(){return null}_rendersChildrenInSpace(){return!0}_spaceFrame=null;_confinesChildren(){if(this._cameraScope()!==null)return!0;if(!this.clip)return!1;let e=this.clipSelf();return e!==null&&!e.isEmpty()}hitTestSelf(e,n){let r=this._localBounds();return Math.abs(e.x-r.x)<=r.width/2+n&&Math.abs(e.y-r.y)<=r.height/2+n}_localBounds(){return{x:0,y:0,width:this.measuredWidth,height:this.measuredHeight}}_hitTestSelf(e,n){return this.hitTestSelf(e,n)}applyClip(e){let n=this.clipSelf();return!n||n.isEmpty()?!1:(e.beginClip(n),!0)}applyBackdropEffects(e){let n=this.effects;n.length!==0&&ja(e,n,this.clipSelf(),this.layoutBounds?.width??0,this.layoutBounds?.height??0)}renderContentWithEffects(e,n){this.applyBackdropEffects(e),Wa(e,this.effects,this.layoutBounds?.width??0,this.layoutBounds?.height??0,n)}renderChildren(e){let n=this._spaceCamera();if(n){this._renderInSpace(e,Mn(this,n));return}let r=this._spaceFrame;if(r){this._renderInSpace(e,r);return}for(let o of this._children)o instanceof t&&o.render(e)}_renderInSpace(e,n){let r=[];for(let s of this._children)s instanceof t&&r.push(s);let o=r.map(s=>kn(n,s)),i=e.drawsVisibleOnly?La(o):o.map((s,a)=>a);for(let s of i){let a=r[s];a._spaceFrame=o[s];try{a.render(e)}finally{a._spaceFrame=null}}}_paintInFront(e,n,r){if(!n){r();return}e.beginClip(n);try{r()}finally{e.endClip()}}renderState(e){let n=this._renderState;return n.rects=e.readsSpaceRects?this._spaceRects():ef,n.elapsed=this._time.elapsed,n}_spaceRects(){let e=this._offset();return Ba(this.parent2D?.layoutBounds,this.layoutBounds,e.x,e.y)}render(e){if(!this.mounted||e.drawsVisibleOnly&&this.opacity*(this._placement()?.opacity??1)<=0||e.drawsVisibleOnly&&this.hidden)return;let n=this._spaceFrame;if(!(e.drawsVisibleOnly&&!this.backfaceVisible&&this._facesAway(n))&&!(e.drawsVisibleOnly&&n&&!n.paints&&!this._rendersChildrenInSpace()))try{e.begin(this.renderState(e));try{this.renderContent(e)}finally{e.end()}}catch(r){throw r instanceof mn&&(r.nodeId??=this.id),r}}renderContent(e){this.applyTransform(e);let n=this._spaceFrame;if(n&&!n.paints){this.renderChildren(e);return}let r=n?.nearCut??null;this.renderContentWithEffects(e,()=>{this._paintInFront(e,r,()=>this.renderSelf(e));let o=this.clip&&this.applyClip(e);this.renderChildren(e),o&&e.endClip(),this._paintInFront(e,r,()=>this.renderOverlay(e))})}_facesAway(e){if(e)return e.facesAway;let n=this._projection();return Fs(n.rotationX,n.rotationY)}_flowMeasure=null;_childSpace=null;_flowWarned=!1;setLayoutBounds(e){let n=this._layoutBounds.get();n.x===e.x&&n.y===e.y&&n.width===e.width&&n.height===e.height||this._layoutBounds.set(e)}flowChildren(){let e=this._children,n=0;for(;n<e.length;n++){let r=e[n];if(!(r instanceof t)||r.hidden)break}return n===e.length?e:e.filter(r=>r instanceof t&&!r.hidden)}effectivePadding(){return this.padding}flowArrangement(){return nf}layout(e,n){this.setLayoutBounds(e),this.layoutChildren(e,n)}layoutChildren(e,n){let r=this._flowMeasure;this._flowMeasure=null;let o=$.insetBounds(e.width,e.height,this.effectivePadding()),i=this.flowArrangement();this._childSpace={settings:i,inner:o};let s=this.flowChildren();if(s.length===0)return;let a=r&&I.reusable(r,o)?r:I.measure(i,s,{width:o.width,height:o.height,hugWidth:this.width==="hug",hugHeight:this.height==="hug"},n),l=I.place(a,i,o);for(let f=0;f<l.length;f++){let h=l[f];a.items[f].layout({x:o.x+h.x,y:o.y-h.y,width:h.width,height:h.height},n)}if(this._flowWarned)return;let c=I.collapsedRun(a,e);c!==null&&(this._flowWarned=!0,console.warn(`[motionscript] "${this.className}" ${c}`))}measure(e,n){this.lastMeasure={constraints:e,measurer:n};let r=this.effectivePadding(),o=this.flowChildren();if(o.length===0)return this._flowMeasure=null,I.size(this,e,r,rf);let i=I.contentBox(this,e,r),s=I.measure(this.flowArrangement(),o,i,n);return this._flowMeasure=s,I.size(this,e,r,s.hug)}reparent(e){let n=e.data.newParent;if(e.duration===void 0){let r=this.parent;r&&r.remove(this),n.add(this);return}return Ia(this,n,e.duration,e.easing)}};_e(Y,{x:k({default:0}),y:k({default:0}),width:k({default:"fill",tween:Q.lerp}),height:k({default:"fill",tween:Q.lerp}),scale:k({default:1}),rotation:k({default:0}),opacity:k({default:1}),blend:k({default:"pass-through"}),effects:ba(),padding:Aa(),pivot:Oa(),flipHorizontal:k({default:!1}),flipVertical:k({default:!1}),rotationX:k({default:0}),rotationY:k({default:0}),rotationZ:k({default:0}),depth:k({default:0}),perspective:k({default:0,tween:co}),backfaceVisible:k({default:!0}),transformOrigin:k({default:void 0,mapper:t=>t==null?void 0:N.resolve(t),tween:(t,e,n)=>N.lerp(t??e??Fr,e??Fr,n)}),clip:k({default:!1}),flex:k({default:1}),gapScale:k({default:1}),column:k({default:void 0}),row:k({default:void 0}),colSpan:k({default:1}),rowSpan:k({default:1}),moveTo:j({args:["x","y",{key:"path",kind:"path"},{key:"target",kind:"nodeRef"},{key:"targetAnchor",kind:"alignment"}]}),fadeTo:j({args:["opacity"]}),rotateTo:j({args:["rotation"]}),scaleTo:j({args:["scale"]}),layoutTo:j({args:[{key:"width",kind:"size"},{key:"height",kind:"size"},{key:"padding",kind:"insets"}]}),pulse:j({args:[{key:"factor",kind:"number",min:0,step:.05,unit:"\xD7",default:1.2}]}),wiggle:j({args:[{key:"angle",kind:"number",min:0,unit:"\xB0",default:8},{key:"turns",kind:"number",min:1,step:1,default:3}]}),effectTo:j({args:[{key:"effects",kind:"effects"}]}),removeChildAt:j({args:["index"]}),reparent:j({args:["newParent"]})});function $a(t){let e={};for(let n in t)t[n]!==void 0&&(e[n]=t[n]);return e}function of(t,e){let n=t;for(;n.parent;)n=n.parent;return Va(n,e)}function Va(t,e){if(t.id===e)return t instanceof Y?t:null;for(let n of t._allChildren){let r=Va(n,e);if(r)return r}return null}function Ha(t,e){let n=e.global,r=t.global,o=r.scale===0?0:1/r.scale,i=zr(0,0,-r.rotation,(n.x-r.x)*o,(n.y-r.y)*o);return{x:i.x,y:i.y,rotation:n.rotation-r.rotation,scale:n.scale*o}}var Me=class t extends de{get dimension(){return"audio"}constructor(e){super(e),this.initProps(e),this.adoptChildrenProp(e)}get childrenAudio(){return this._allChildren.filter(e=>e instanceof t)}get _busId(){let e=this._props?.id;return`bus:${typeof e=="string"?e:lf(this)}`}_prepareStep(e,n,r){for(let o of sf)if(o in e)throw new TypeError(`${this.className}: "${o}" cannot be tweened \u2014 an audio level is scheduled once, not written per frame, so a tween on it would render flat. Automate it with a curve instead: ${o}: fadeOut(1), or filters: AudioFilters.gain(ramp(1, 0, 1)).`);return super._prepareStep(e,n,r)}};_e(Me,{volume:Pr({default:1}),pan:Pr({default:0}),mute:k({default:!1}),filters:Pa()});var sf=["volume","pan"];function af(t,e){let n=[],r=t.parent;for(;r instanceof Me;)n.push(Xa(r,e)),r=r.parent;return n.length>0?n:void 0}function dS(t,e){return[Xa(t,e),...af(t,e)??[]]}function pS(t,e){let n=t;for(;n.parent;)n=n.parent;return Ya(n,e)}function Ya(t,e){if(t instanceof Me&&t.id===e)return t;for(let n of t._allChildren){let r=Ya(n,e);if(r)return r}return null}function Xa(t,e){let n=t.filters,r=e(t);return{id:t._busId,volume:t.volume,pan:t.pan,mute:t.mute,...n.length>0?{filters:n}:{},startAt:r.start,endAt:r.end}}function lf(t){let e=[],n=t;for(;n;){let r=n.parent;if(!r)break;e.push(String(r._allChildren.indexOf(n))),n=r}return e.reverse().join(".")}function cf(t){let e=t.parent;return typeof e?._spaceOf=="function"?e._spaceOf(t):null}var Ua={position:["x","y","z"],rotation:["rotationX","rotationY","rotationZ"],scale:["scaleX","scaleY","scaleZ"]},pe=class t extends de{get dimension(){return"3d"}constructor(e){super(e),this.initProps(Nr(e)),this.adoptChildrenProp(e)}moveTo(e){return this.to({data:Dr(e.data),duration:e.duration,easing:e.easing})}rotateTo(e){return this.to({data:Dr(e.data),duration:e.duration,easing:e.easing})}scaleTo(e){return this.to({data:Dr(e.data),duration:e.duration,easing:e.easing})}get position(){return{x:this.x,y:this.y,z:this.z}}set position(e){this.set({position:e})}get rotation(){return{x:this.rotationX,y:this.rotationY,z:this.rotationZ,order:this.rotationOrder}}set rotation(e){this.set({rotation:e})}get scale(){return{x:this.scaleX,y:this.scaleY,z:this.scaleZ}}set scale(e){this.set({scale:e})}set(e){super.set(Nr(e))}_prepareStep(e,n,r){return super._prepareStep(Nr(e),n,r)}transform3D(){let e=this.quaternion,n=e.x===0&&e.y===0&&e.z===0&&e.w===1,r=cf(this);return{position:r?r.toLocal(this.x,this.y,this.z):this.position,rotation:this.rotation,quaternion:n?void 0:e,scale:this.scale,lookAt:this.lookAt,visible:this.visible,shadow:this.shadow,renderOrder:this.renderOrder}}_spaceOf(e){return null}groupTransform(){return this.transform3D()}renderSelf(e){}render(e){if(this.hidden){e.begin({id:this.id,transform:{...this.groupTransform(),visible:!1}}),e.end();return}e.begin({id:this.id,transform:this.groupTransform()}),this.renderSelf(e);for(let n of this._children)n instanceof t&&n.render(e);e.end()}declareAssets(e){if(this.renderSelf===t.prototype.renderSelf)return;let n=new J;this.renderSelf(n),Kt(n,e)}};_e(pe,{x:k({default:0}),y:k({default:0}),z:k({default:0}),rotationX:k({default:0}),rotationY:k({default:0}),rotationZ:k({default:0}),rotationOrder:k({default:"XYZ"}),quaternion:Ta(),scaleX:k({default:1}),scaleY:k({default:1}),scaleZ:k({default:1}),lookAt:Ea("snap"),visible:k({default:!0}),shadow:k({default:!0}),renderOrder:k({default:0}),moveTo:j({args:["x","y","z"]}),rotateTo:j({args:["rotationX","rotationY","rotationZ"]}),scaleTo:j({args:[{key:"scale",kind:"number",min:0,step:.05,unit:"\xD7"},"scaleX","scaleY","scaleZ"]})});function Nr(t){if(!t)return t;let e;for(let n in Ua){let r=t[n];if(r===void 0)continue;e??={...t},delete e[n];let o=Ua[n];if(typeof r=="function"){let s=r;for(let a=0;a<3;a++){let l=o[a];e[l]===void 0&&(e[l]=()=>Ga(qe(s()),a))}continue}let i=qe(r);for(let s=0;s<3;s++){let a=o[s];e[a]===void 0&&(e[a]=Ga(i,s))}if(n==="rotation"){let s=r.order;s!==void 0&&e.rotationOrder===void 0&&(e.rotationOrder=s)}}return e??t}function Dr(t){let e={};for(let n in t)t[n]!==void 0&&(e[n]=t[n]);return e}function Ga(t,e){return e===0?t.x:e===1?t.y:t.z}var Rr=Symbol("nodeMeta");function Ka(t){return function(e){let n=typeof t=="string"?{key:t}:t;return e.prototype[Rr]=n,e}}function bn(t){let e=t.prototype;if(!(!e||!Object.prototype.hasOwnProperty.call(e,Rr)))return e[Rr]}function ne(t){return N.resolve(t??{x:0,y:0})}var An=["center","topLeft","topRight","bottomLeft","bottomRight","topCenter","bottomCenter","centerLeft","centerRight"];function uf(t){let e=An.filter(n=>t[n]!==void 0);if(e.length>1)throw new Error(`Cannot set multiple shape alignment props at once: ${e.join(", ")}`);if(e.length===1){let n=["pivot","x","y"].find(r=>t[r]!==void 0);if(n)throw new Error(`Cannot set both shape alignment prop '${e[0]}' and '${n}' at the same time`)}}function ce(t){let e={...t};for(let n of An)delete e[n];return e}function ue(t,e,n){uf(t);let r=An.find(o=>t[o]!==void 0);if(r){let o=t[r],i=N.resolve(r);return{x:o.x-i.x*(e/2),y:o.y-i.y*(n/2),pivot:i}}return{x:t.x??0,y:t.y??0,pivot:t.pivot??{x:0,y:0}}}function bS(t,e,n){if(An.find(s=>t[s]!==void 0)||t.pivot===void 0)return t;let o=N.resolve(t.pivot);if(o.x===0&&o.y===0)return t;let i={x:t.x??0,y:t.y??0};return{...t,x:i.x-o.x*(e/2),y:i.y-o.y*(n/2),pivot:o}}function Za(t){let e=t.width??0,n=t.height??0,{x:r,y:o,pivot:i}=ue(t,e,n);return{...ce(t),opacity:t.opacity??1,rotation:t.rotation??0,scale:t.scale??1,x:r,y:o,start:t.start??0,end:t.end??1,pivot:ne(i),width:e,height:n,cornerRadius:t.cornerRadius??0,cornerStyle:t.cornerStyle??"rounded"}}function Ja(t){let e=t.width??0,n=t.height??0,{x:r,y:o,pivot:i}=ue(t,e,n);return{...ce(t),opacity:t.opacity??1,rotation:t.rotation??0,scale:t.scale??1,x:r,y:o,start:t.start??0,end:t.end??1,pivot:ne(i),width:e,height:n,ratio:t.ratio??0,sweep:t.sweep??360,startAngle:t.startAngle??0}}function Qa(t){let e=t.width??0,n=t.height??0,{x:r,y:o,pivot:i}=ue(t,e,n);return{...ce(t),opacity:t.opacity??1,rotation:t.rotation??0,scale:t.scale??1,x:r,y:o,start:t.start??0,end:t.end??1,pivot:ne(i),width:e,height:n,sides:t.sides??5,cornerRadius:t.cornerRadius??0,cornerStyle:t.cornerStyle??"rounded"}}function el(t){let e=t.width??0,n=t.height??0,{x:r,y:o,pivot:i}=ue(t,e,n);return{...ce(t),opacity:t.opacity??1,rotation:t.rotation??0,scale:t.scale??1,x:r,y:o,start:t.start??0,end:t.end??1,pivot:ne(i),width:e,height:n,sides:t.sides??5,ratio:t.ratio??.5,cornerRadius:t.cornerRadius??0,cornerStyle:t.cornerStyle??"rounded"}}function tl(t){return{opacity:t.opacity??1,rotation:t.rotation??0,scale:t.scale??1,x:t.x??0,y:t.y??0,start:t.start??0,end:t.end??1,width:t.width??0,height:t.height??0,pivot:ne(t.pivot),points:t.points??[],radius:t.radius??0,closed:t.closed??!1}}var On=1e-9;function il(t,e,n=0){return ff(t.ops(),e,n)}function ff(t,e,n=0){let r=!1,o=null,i=()=>{o&&nl(o,e,n)&&(r=!0),o=null};for(let s of t){if(s.kind==="cut"){o&&nl(o,e,n)&&(r=!1),o=null;continue}i(),o=s}return i(),r}function nl(t,e,n){switch(t.kind){case"rect":{let r=Za(t.state),o=dt(e,r,r.width,r.height);return o!==null&&rl(o,r.width,r.height,De.resolve(r.cornerRadius),n)}case"ellipse":{let r=Ja(t.state),o=dt(e,r,r.width,r.height);return o!==null&&hf(o,r.width,r.height,r.ratio,r.sweep,r.startAngle,n)}case"polygon":{let r=Qa(t.state),o=dt(e,r,r.width,r.height);return o!==null&&Ir(o,pf(r.width,r.height,r.sides),!0,n)}case"polygram":{let r=el(t.state),o=dt(e,r,r.width,r.height);return o!==null&&Ir(o,mf(r.width,r.height,r.sides,r.ratio),!0,n)}case"line":{let r=tl(t.state),o=dt(e,r,r.width,r.height);return o===null||r.points.length===0?!1:r.points.length>=3&&Ir(o,r.points,!0,n)?!0:sl(o,r.points,r.closed,n)}case"path":{let r=t.state,o={x:e.x-(r.x??0),y:e.y-(r.y??0)};return rl(o,r.width??0,r.height??0,De.resolve(0),n)}}}function dt(t,e,n,r){if(e.scale===0)return null;let o=e.pivot,i=o.x*(n/2),s=o.y*(r/2),a=t.x-(e.x+i),l=t.y-(e.y+s),c=e.rotation*Math.PI/180,f=Math.cos(c),h=Math.sin(c),d=(f*a-h*l)/e.scale,p=(h*a+f*l)/e.scale;return{x:d+i,y:p+s}}function rl(t,e,n,r,o){let i=e/2+o,s=n/2+o;if(Math.abs(t.x)>i||Math.abs(t.y)>s)return!1;let a=Math.min(e,n)/2,l=Math.min(a,t.x<=0?t.y>=0?r.topLeft:r.bottomLeft:t.y>=0?r.topRight:r.bottomRight);if(l<=0)return!0;let c=Math.sign(t.x||1),f=Math.sign(t.y||1),h=t.x-c*(e/2-l),d=t.y-f*(n/2-l);return Math.sign(h||1)!==c||Math.sign(d||1)!==f?!0:h*h+d*d<=(l+o)*(l+o)}function hf(t,e,n,r,o,i,s){let a=e/2,l=n/2;if(a<=0||l<=0)return!1;let c=Math.max(0,Math.min(1,r)),f=Math.abs(o)>=360;return ol(t,a+s,l+s)>1||c>0&&ol(t,Math.max(On,a*c-s),Math.max(On,l*c-s))<1?!1:f?!0:df(Math.atan2(t.y/l,t.x/a)*(180/Math.PI),i,o,t,s)}function ol(t,e,n){return Math.hypot(t.x/e,t.y/n)}function df(t,e,n,r,o){let i=n>=0?e:e+n,s=Math.abs(n),a=Math.hypot(r.x,r.y);if(a<=o)return!0;let l=o>0?o/Math.max(a,On)*(180/Math.PI):0,c=(t-i)%360;return c<0&&(c+=360),c<=s+l||c>=360-l}function pf(t,e,n){let r=Math.max(3,Math.round(n)),o=t/2,i=e/2,s=2*Math.PI/r,a=[];for(let l=0;l<r;l++){let c=Math.PI/2-l*s;a.push({x:o*Math.cos(c),y:i*Math.sin(c)})}return a}function mf(t,e,n,r){let o=Math.max(3,Math.round(n)),i=Math.max(0,Math.min(1,r)),s=t/2,a=e/2,l=Math.PI/o,c=[];for(let f=0;f<o*2;f++){let h=Math.PI/2-f*l,d=f%2===0?1:i;c.push({x:s*d*Math.cos(h),y:a*d*Math.sin(h)})}return c}function Ir(t,e,n,r){return e.length>=3&&yf(t,e)?!0:r>0&&sl(t,e,n,r)}function yf(t,e){if(e.length<3)return!1;let n=!1;for(let r=0,o=e.length-1;r<e.length;o=r++){let i=e[r],s=e[o];i.y>t.y!=s.y>t.y&&t.x<(s.x-i.x)*(t.y-i.y)/(s.y-i.y)+i.x&&(n=!n)}return n}function sl(t,e,n,r){if(e.length===0)return!1;if(e.length===1)return Math.hypot(t.x-e[0].x,t.y-e[0].y)<=r;let o=n?e.length:e.length-1;for(let i=0;i<o;i++)if(gf(t,e[i],e[(i+1)%e.length])<=r)return!0;return!1}function gf(t,e,n){let r=n.x-e.x,o=n.y-e.y,i=r*r+o*o;if(i<=On)return Math.hypot(t.x-e.x,t.y-e.y);let s=((t.x-e.x)*r+(t.y-e.y)*o)/i;return s=s<0?0:s>1?1:s,Math.hypot(t.x-(e.x+s*r),t.y-(e.y+s*o))}var xf=["fontFamily","fontSize","fontWeight","fontStyle","letterSpacing"],wf=["lineHeight","textAlign"];function ll(t,e){let n=al(e)?e:st,r=t.ops(),o=null;for(let i=0;i<r.length;i++){let s=r[i];if(s.kind!=="text"&&s.kind!=="richText")continue;let a=_f(s.state.variant,n);if(!al(a))continue;let l=s.kind==="text"?Sf(s,a):vf(s,a);l&&(o||(o=r.slice()),o[i]=l)}return o?t._withOps(o):t}function _f(t,e){return q.mergeStyle(e,t?q.preset(t):void 0)}function al(t){for(let e of wr)if(t[e]!==void 0)return!0;return!1}function Sf(t,e){let n=Lr(t.state,e,wr);return n?{kind:"text",state:n}:null}function vf(t,e){let n=Lr(t.state,e,wf),r=kf(t.state.spans,e);return r&&(n={...n??t.state,spans:r}),n?{kind:"richText",state:n}:null}function kf(t,e){if(!t||t.length===0)return null;let n=e.fontSize==="autofit"?{...e,fontSize:void 0}:e,r=null;for(let o=0;o<t.length;o++){let i=Lr(t[o],n,xf);i&&((r??=t.slice())[o]=i)}return r}function Lr(t,e,n){let r=t,o=null;for(let i of n){if(r[i]!==void 0)continue;let s=e[i];s!==void 0&&((o??={...r})[i]=s)}return o}var En=class{textStyleStack=[];pushTextStyle(e){this.textStyleStack.push(e===null?st:q.mergeStyle(this.defaultTextStyle,e))}popTextStyle(){this.textStyleStack.pop()}get defaultTextStyle(){return this.textStyleStack[this.textStyleStack.length-1]??q.preset("default")}draw(e){this.drawGraphics(ll(e,this.defaultTextStyle))}layoutTextBlock(e){return null}currentNodeStack=[];currentNodeId(){if(this.currentNodeStack.length===0)throw new Error("No current node in context");return this.currentNodeStack[this.currentNodeStack.length-1]}_disposed=!1;isDisposed(){return this._disposed}dispose(){this._disposed=!0}beginEffects(e,n,r,o){}endEffects(){}rasterize(e,n,r,o){return null}renderStateStack=[];readsSpaceRects=!0;drawsVisibleOnly=!0;begin(e){this.currentNodeStack.push(e.id),this.renderStateStack.push(e)}end(){this.currentNodeStack.pop(),this.renderStateStack.pop()}currentSpaceRects(){return this.renderStateStack[this.renderStateStack.length-1]?.rects??{}}currentRenderState(){return this.renderStateStack[this.renderStateStack.length-1]}_resetScopes(){this.textStyleStack.length=0,this.currentNodeStack.length=0,this.renderStateStack.length=0}};var Mf={width:0,height:0},Tn=class extends En{readsSpaceRects=!1;drawGraphics(e){}measureText(){return Mf}unmount(){}execute(e){e()}screenshot(){}rasterize(e,n,r){return r(),null}transform(e){return this}beginBoolean(e){}endBoolean(){}beginMask(e){}applyMask(){}endMask(){}beginClip(e){}endClip(){}beginCamera(e,n,r,o){}endCamera(){}};function Ve(t){let e=new $e;for(let n of t.ops())switch(n.kind){case"rect":e.rect(n.state);break;case"ellipse":e.ellipse(n.state);break;case"path":e.path(n.state);break;case"line":e.line(n.state);break;case"polygon":e.polygon(n.state);break;case"polygram":e.polygram(n.state);break;case"cut":e.cut();break;default:break}return e}var Pe=t=>({_piece:t});function jr(t,e,n,r){return{args:t,duration:e,easing:n,node:r,tween:o=>Pe({kind:"tween",targets:o}),animate:(o,i)=>Pe({kind:"animate",frame:o,eased:i?.eased!==!1}),ease:o=>n?n(o):o,sound:(o,i)=>Pe({kind:"sound",src:o,options:i??{}}),wait:o=>Pe({kind:"wait",seconds:o}),together:o=>Pe({kind:"together",pieces:o}),sequence:o=>Pe({kind:"sequence",pieces:o}),stagger:(o,i)=>Pe({kind:"stagger",pieces:o,overlap:i?.overlap??0})}}var zn=[];function Pn(t,e,n=!0){return t.at(1),{duration:e,settles:n,sounds:zn,apply:r=>t.at(e>0?r/e:1)}}function Br(t,e){return{duration:t.reduce((r,o,i)=>Math.max(r,e[i]+o.duration),0),settles:t.every(r=>r.settles),sounds:t.flatMap((r,o)=>r.sounds.map(i=>({...i,at:i.at+e[o],until:i.until===void 0?void 0:i.until+e[o]}))),apply(r){for(let o=0;o<t.length;o++)r<e[o]||t[o].apply(Math.min(r-e[o],t[o].duration))}}}function Fn(t,e,n,r){let o=e._piece;switch(o.kind){case"tween":return Pn(t.to({data:o.targets,duration:n,easing:r}),n);case"animate":return Pn(t._animate(o.frame,n,o.eased?r:void 0),n);case"child":return Pn(o.node.to({data:o.targets,duration:n,easing:r}),n);case"run":{let i=Cf(o.node,o.name,o.args,n,r);return Pn(i,n,Xs(i))}case"wait":return{duration:o.seconds,settles:!0,sounds:zn,apply:()=>{}};case"sound":return{duration:0,settles:!0,sounds:o.src?[{at:0,until:void 0,src:o.src,options:o.options}]:zn,apply:()=>{}};case"together":{let i=o.pieces.map(s=>Fn(t,s,n,r));return Br(i,i.map(()=>0))}case"sequence":{let i=o.pieces.reduce((h,d)=>h+(d._piece.kind==="wait"?d._piece.seconds:0),0),s=o.pieces.filter(h=>h._piece.kind!=="wait").length,a=s>0?Math.max(0,n-i)/s:0,l=[],c=[],f=0;for(let h of o.pieces){let d=Fn(t,h,a,r);l.push(d),c.push(f),f+=d.duration}return Br(l,c)}case"stagger":{let i=o.pieces.length;if(i===0)return{duration:n,settles:!0,sounds:zn,apply:()=>{}};let s=1-Math.min(1,Math.max(0,o.overlap)),a=n/(1+(i-1)*s),l=o.pieces.map(c=>Fn(t,c,a,r));return Br(l,l.map((c,f)=>f*a*s))}}}function Cf(t,e,n,r,o){let i=Gs(t).find(l=>l.key===e),s=i?t[i.method]:void 0;if(typeof s!="function")throw new Error(`${t.className} has no command "${e}".`);let a=s.call(t,{data:n??{},duration:r,easing:o});if(!a||typeof a!="object"||!("at"in a))throw new Error(`${t.className}.${e} did not return a command.`);return a}var cl=new WeakMap;function nv(t){return cl.get(t)}function Wr(t,e,n,r){if(e._piece.kind==="tween")return ct(t.to({data:e._piece.targets,duration:n,easing:r}));let o=Fn(t,e,n,r),i=ve(n,a=>o.apply(a*n)),s=o.sounds.map(a=>a.until===void 0&&n>0?{...a,until:n}:a);return s.length>0&&cl.set(i,{host:t,sounds:s}),o.settles?ct(i):i}var bf="_def";function qr(t){return(typeof t=="object"||typeof t=="function")&&t!==null&&bf in t}function He(t){if(qr(t))return t._def;switch(typeof t){case"number":return{default:t,editor:{kind:"number"},private:!1};case"string":return{default:t,editor:{kind:"text"},private:!1};case"boolean":return{default:t,editor:{kind:"boolean"},private:!1};default:throw new TypeError(`A state entry is a Types.* value, a number, a string or a boolean; got ${String(t)}.`)}}var D=Symbol("componentNode"),Ce=null;function Yr(t,e,n,r){let o=Ce;Ce={node:t,scope:e,room:n,sizes:new Map};try{return r()}finally{Ce=o}}var pl=new WeakSet;function ml(t){pl.add(t)}function yl(t){return pl.delete(t)}function ze(){if(!Ce)throw new Error("A component's measure or layout helper ran outside a measure or layout pass.");return Ce}function ul(t,e){let n=ze(),r={maxWidth:e.width,maxHeight:e.height},o=t.measure(r,n.scope),i={width:o.width??0,height:o.height??0};return n.sizes.set(t,i),i}var fl=new WeakMap,Vr=class{[D];state;constructor(e){this[D]=e,this.state=new Proxy(e,{set:()=>{throw new TypeError("A child's state is read-only to its parent; animate it with a command.")}})}get id(){return this[D].id}get key(){return Xr(this[D])??this[D].className}get size(){if(!Ce){let e=this[D].layoutBounds;return{width:e?.width??0,height:e?.height??0}}return Ce.sizes.get(this[D])??ul(this[D],Ce.room)}get children(){let e=this[D];return e._commandChildren?e._commandChildren():e.children.map(me)}measure(e){return ul(this[D],e)}to(e){return{_piece:{kind:"child",node:this[D],targets:e}}}run(e,n){return{_piece:{kind:"run",node:this[D],name:e,args:n}}}};function me(t){let e=fl.get(t);return e||fl.set(t,e=new Vr(t)),e}function pt(t){return t[D]}var hl=new WeakMap,Af={x:0,y:0,rotation:0,scale:1},Hr=class{reader;[D];state;constructor(e,n){this.reader=n,this[D]=e;let r=e._view??e;this.state=new Proxy(r,{get:(o,i)=>{if(i==="constructor")return e.constructor;if(i in o)return Reflect.get(o,i);let s=Reflect.get(e,i);return typeof s=="function"?s.bind(e):s},set:()=>{throw new TypeError("Another node's state is read-only to a component; animate it with a command.")}})}get id(){return this[D].id}get key(){return Xr(this[D])??this[D].className}get size(){let e=this[D],n=e instanceof Y?e.layoutBounds:void 0;return{width:n?.width??0,height:n?.height??0}}get frame(){let e=this[D];return e instanceof Y&&this.reader instanceof Y?Ha(this.reader,e):Af}};function mt(t,e){let n=hl.get(t);n||hl.set(t,n=new WeakMap);let r=n.get(e);return r||n.set(e,r=new Hr(t,e)),r}function gl(t){return t[D]}var dl=new WeakMap;function Of(t,e){if(typeof e!="string"||e==="")return null;let n=dl.get(t),r=n?.get(e);if(!r||r.id!==e||$r(r)!==$r(t)){if(r=xl($r(t),e)??void 0,!r)return n?.delete(e),null;n||dl.set(t,n=new Map),n.set(e,r)}return mt(r,t)}function $r(t){let e=t;for(;e.parent;)e=e.parent;return e}function xl(t,e){if(t.id===e)return t;for(let n of t._allChildren){let r=xl(n,e);if(r)return r}return null}var Xr=()=>{};function Dn(t){Xr=t}function wl(t,e=new Set){let n={};for(let o of t)n[o]=e.has(o)?{get(){return Of(this[D],this[D][o])},enumerable:!0}:{get(){return this[D][o]},enumerable:!0};let r={};return Object.defineProperty(r,"children",{get(){return this[D]._commandChildren()},enumerable:!1}),{proto:r,entries:n}}function Ur(t,e){let n=Object.create(t.proto);return Object.defineProperties(n,t.entries),n[D]=e,n}function Gr(t){let e={};for(let n in t)e[n]=t[n];return e}var Nn=class{host;max={};scope=null;constructor(e){this.host=e}get time(){return this.host.time}text(e,n){if(!this.scope)throw new Error("measurer.text was called outside measure.");return this.scope.measureText(e,n.fontSize,n.fontFamily,n.fontWeight,n.letterSpacing)}},Ye=class{host;probing;pass=null;cut=null;constructor(e,n=!1){this.host=e,this.probing=n}get size(){let e=this.host.layoutBounds;return{width:e?.width??0,height:e?.height??0}}get time(){return this.host.time}draw(e){if(!e||this.probing)return;let n=this.target();if(Array.isArray(e))for(let r of e)n.draw(r);else n.draw(e)}children(){this.probing||(this.composite||(this.host._record=null),this.host._renderOwnChildren(this.target()))}composite=null;_declare(e){this.composite={...this.composite,...e},this.probing||(this.host._record=this.composite)}mask(e){if(this._declare({bounds:"first"}),this.probing)return;let n=this.target(),[r,...o]=this.host.children;if(r){if(o.length===0){r.render(n);return}n.beginMask({mode:e.mode,inverted:e.inverted}),r.render(n),n.applyMask();for(let i of o)i.render(n);n.endMask()}}merge(e,n){if(this._declare({bounds:e==="subtract"?"first":e==="intersect"?"intersect":"union"}),this.probing)return;let r=this.target();r.beginBoolean(e);for(let o of this.host._allChildren)o instanceof Y&&o.render(r);r.endBoolean(),r.draw(new B().shadow(n.shadow).fill(n.fill)),n.overlay&&n.overlay.length>0&&r.draw(new B().fill(n.overlay)),r.draw(new B().stroke(n.stroke))}camera(e){if(this._declare({camera:e}),this.probing)return;let n=this.target(),r=this.host.layoutBounds;n.beginCamera({x:r?.x??0,y:-(r?.y??0),width:r?.width??0,height:r?.height??0},e.lookAt,e.zoom,e.heading);for(let o of this.host._allChildren)o instanceof Y&&o.render(n);n.endCamera()}scene3D(){let e=new J;for(let n of this.host._allChildren)n instanceof pe&&n.render(e);return this._declare({scene:e}),e}space(e){this._declare({space:e}),this.probing||this.host._renderOwnChildren(this.target())}textStyle(e,n){if(this.probing)return n();let r=this.target();r.pushTextStyle(e);try{n()}finally{r.popTextStyle()}}clip(e,n){if(this.probing)return n();let r=Ve(e);if(r.isEmpty())return n();let o=this.target();o.beginClip(r);try{n()}finally{o.endClip()}}get inSpace(){for(let e=this.host.parent;e;e=e.parent){if(!(e instanceof Y))return!1;if(e._spaceCamera())return!0;if(!e._rendersChildrenInSpace())return!1}return!1}ancestor(e){for(let n=this.host.parent;n;n=n.parent)if(n instanceof e.node)return mt(n,this.host);return null}inFront(e){if(this.probing)return;let n=this.target();if(!this.cut){e();return}n.beginClip(this.cut);try{e()}finally{n.endClip()}}target(){if(this.probing)return Ef;if(!this.pass)throw new Error("A component's render context was used outside render.");return this.pass}},Ef=new Tn;function fe(t){if(!(t instanceof Ye))throw new TypeError("Paint.draw takes the render context its render field was given.");return t}function Xe(t,e,n=new Set){let r=new Map(at(Object.create(e.prototype)).map(a=>[a.key,a])),o=new Map(Object.entries(t.state??{}).map(([a,l])=>[a,He(l)])),i=t.defaults??{};for(let[a,l]of Object.entries(i)){if(typeof l=="function")continue;let c=o.get(a);if(c)o.set(a,{...c,default:l});else if(!r.has(a))throw new TypeError(`${t.key}: "defaults.${a}" names no entry.`)}let s=new Set([...o].filter(([,a])=>a.editor.kind==="nodeRef").map(([a])=>a));return{spec:t,entries:o,defaults:i,builtIn:r,view:wl([...r.keys(),...o.keys()],s),ownsDefault:n}}function Rn(t){return typeof t.default=="function"?t.default():t.default}function Ue(t,e){let{spec:n,entries:r,defaults:o}=e;class i extends t{constructor(...a){let l=a[0],c=n.children?l?.children:void 0;super(n.children&&l?{...l,children:void 0}:l),this._view=Ur(e.view,this),this._built=0;for(let[h,d]of r)d.private?this.applyProp(h,Rn(d),{mapper:d.mapper,tween:d.tween}):typeof d.default=="function"&&l?.[h]===void 0&&this._writeProp(h,Rn(d));let f;for(let[h,d]of Object.entries(o))if(typeof d=="function"&&l?.[h]===void 0){let p=f??=Object.freeze({...l});this._writeProp(h,()=>d(this._view,p))}if(n.children){let h=Ur(e.view,this);Object.defineProperty(h,"children",{value:[c??[]].flat(1/0).filter(Boolean)});let d=[n.children(h)].flat(1/0).filter(Boolean);for(let p of d)this.add(p);this._built=d.length}}resolveContext(a){super.resolveContext(a);let l=this._props??{},c=this;for(let[f,h]of r){if(!h.inherit||l[f]!==void 0)continue;let d=h.inherit(p=>a.get(p),l);d!==void 0&&(c[f]=d)}}provideContext(a){if(!n.provide)return super.provideContext(a);let l=n.provide(this._view,h=>a.get(h)),c=this._provided;if(c&&c.parent===a&&c.values.length===l.length&&c.values.every((h,d)=>h.context===l[d].context&&h.value===l[d].value))return c.map;let f=a;for(let{context:h,value:d}of l)f.get(h)!==d&&(f=f.with(h,d));return this._provided={parent:a,values:l,map:f},f}declareAssets(a){super.declareAssets(a);let l=this;for(let[c,f]of r)Nf(a,f.editor.kind??"",l[c]);n.load&&n.load(Rf(a),this._view)}acceptsChild(a){let l=n.allowedChildren;return l==null?super.acceptsChild(a):l.some(c=>_l(a,c))}_childRule(){let a=n.allowedChildren;return a?a.length===0?"It takes no children.":`It takes only ${Sl(a)}.`:super._childRule()}_parentRefusal(a){let l=n.allowedParents;return!l||l.some(c=>_l(a,c))?null:`${this.className} goes only inside ${Sl(l)}, not ${a.className}.`}_commandChildren(){return[]}_animate(a,l,c){return this.command(a,l,c)}}return i}function Ge(t,e){let{spec:n,entries:r,defaults:o,builtIn:i}=e;Object.defineProperty(t,"name",{value:Pf(n.key)});let s=t.prototype;n.provide||yt(s,"provideContext"),[...r.values()].some(c=>c.inherit)||yt(s,"resolveContext"),(n.allowedChildren===void 0||n.allowedChildren===null)&&(yt(s,"acceptsChild"),yt(s,"_childRule")),n.allowedParents||yt(s,"_parentRefusal");let a=n.allowedChildren;if(a){let c=[...new Set(a.map(f=>typeof f=="string"?f:Object.create(f.node.prototype).dimension))];Object.defineProperty(s,"_childTrees",{get:()=>c,configurable:!0})}for(let[c,f]of r)f.private||k({default:typeof f.default=="function"?void 0:f.default,mapper:f.mapper,tween:f.tween,...f.editor})(s,c);for(let[c,f]of Object.entries(o)){if(r.has(c)||e.ownsDefault.has(c)||typeof f=="function")continue;let h=i.get(c);k({default:f,mapper:h.options?.mapper,tween:h.options?.tween,...h.editor})(s,c)}let l=Object.getPrototypeOf(Object.getPrototypeOf(s));for(let[c,f]of Object.entries(n.commands??{})){let h=c in l?`_command_${c}`:c,d;if(typeof f=="function")s[h]=function(p={}){let y=p.duration??0,x=jr({},y,p.easing,mt(this,this)),g=f(x,Gr(this._view),this._commandChildren());return Wr(this,g,y,p.easing)};else{let{args:p,run:y,easing:x}=f;if(Array.isArray(p)){let g=p;for(let m of g)if(!r.has(m)&&!i.has(m))throw new TypeError(`${n.key}.${c}: args names "${m}", which is no entry.`);d=g.map(m=>({key:m,...r.get(m)?.editor??i.get(m)?.editor??{}})),s[h]=function(m={}){let w=zf(m.data,g),v={};for(let M of g)w[M]!==void 0&&(v[M]=w[M]);return ct(this.to({data:v,duration:m.duration??0,easing:m.easing??x}))}}else{let g=p;d=Object.entries(g).map(([m,w])=>{let v=He(w);return{key:m,default:qr(w)?Rn(v):w,...v.editor}}),s[h]=function(m={}){let w=m.duration??0,v=m.easing??x,M=jr(Ff(g,m.data),w,v,mt(this,this)),S=y(M,Gr(this._view),this._commandChildren());return Wr(this,S,w,v)}}}j({key:c,...d?{args:d}:{}})(s,h)}return Ka({key:n.key})(t),Tf(n.key,t)}function yt(t,e){for(let n=t;n;n=Object.getPrototypeOf(n))if(Object.prototype.hasOwnProperty.call(n,e)){delete n[e];return}}function Tf(t,e){let n=function(r){return new e(r)};return n.prototype=e.prototype,Object.defineProperty(n,"name",{value:e.name}),Object.assign(n,{key:t,node:e,is:r=>pt(r)instanceof e})}function Pf(t){return t.replace(/(^|[-_ ])(\w)/g,(e,n,r)=>r.toUpperCase())}function _l(t,e){return typeof e=="string"?t.dimension===e:t instanceof e.node}function Sl(t){let e=t.map(n=>typeof n=="string"?`any ${n.toUpperCase()} node`:n.node.name);return e.length===1?e[0]:`${e.slice(0,-1).join(", ")} or ${e.at(-1)}`}function zf(t,e){return e.length===1&&!(typeof t=="object"&&t!==null&&!Array.isArray(t)&&Object.getPrototypeOf(t)===Object.prototype&&e[0]in t)?{[e[0]]:t}:t??{}}function Ff(t,e){let n=e??{},r={};for(let o in t){let i=He(t[o]),s=n[o]===void 0?Rn(i):n[o];r[o]=i.mapper?i.mapper(s):s}return r}function Nf(t,e,n){if(!(n==null||n===""))switch(e){case"fills":return t.fill(n);case"strokes":for(let r of n)t.fill(r.fill);return;case"shadows":for(let r of n)t.fill(r.fill);return;case"image":return t.image(n);case"video":return t.video(n);case"font":return t.font(n)}}var vl=new WeakMap;function Df(t){let e=vl.get(t);return e||(e=async()=>{let n=await t();return typeof n=="function"?n:void 0},vl.set(t,e)),e}function Rf(t){return{font:(e,n)=>t.font(e,n),image:e=>t.image(e),video:(e,n)=>t.video(e,n),task:(e,n,r)=>t.loader(e,Df(n),{gate:r?.before==="layout"?"layout":"render"}),fill:e=>t.fill(e)}}function Kr(t){let e=t._localBounds(),n=t._localMatrix(),r=e.x===0&&e.y===0?n:we(n,zs(e.x,-e.y)),o=Sn(r,e.width/2,e.height/2);return[o.topLeft,o.topRight,o.bottomRight,o.bottomLeft]}function Zr(t){if(t.length===0)return null;let e=1/0,n=1/0,r=-1/0,o=-1/0;for(let i of t)i.x<e&&(e=i.x),i.x>r&&(r=i.x),i.y<n&&(n=i.y),i.y>o&&(o=i.y);return{minX:e,minY:n,maxX:r,maxY:o}}function Jr(t){return{x:(t.minX+t.maxX)/2,y:(t.minY+t.maxY)/2,width:t.maxX-t.minX,height:t.maxY-t.minY}}function kl(t,e){let n=t.children;if(n.length===0)return null;if(e==="first"){let o=Zr(Kr(n[0]));return o?Jr(o):null}if(e==="union"){let o=Zr(n.flatMap(Kr));return o?Jr(o):null}let r=null;for(let o of n){let i=Zr(Kr(o));if(!i||(r=r?{minX:Math.max(r.minX,i.minX),minY:Math.max(r.minY,i.minY),maxX:Math.min(r.maxX,i.maxX),maxY:Math.min(r.maxY,i.maxY)}:i,r.minX>r.maxX||r.minY>r.maxY))return null}return r?Jr(r):null}var If={left:0,right:0,top:0,bottom:0},Ml=new Set(["width","height"]);Dn(t=>bn(t.constructor)?.key);function Lf(t){return t.rotation===void 0&&t.scale===void 0&&t.opacity===void 0&&t.depth===void 0&&t.rotationX===void 0&&t.rotationY===void 0?null:{rotation:t.rotation??0,scale:t.scale??1,opacity:t.opacity??1,depth:t.depth??0,rotationX:t.rotationX??0,rotationY:t.rotationY??0}}function Fv(t){let e=t,n=Xe(e,Y,Ml),{defaults:r}=n,o=n.entries.has("flow");class i extends Ue(Y,n){_lastShape=null;constructor(l){if(super(l),this._measurer=new Nn(this),this._ctx=new Ye(this),this._slots=null,this._planes=null,this._box=null,this._built>0&&l?.flex===void 0)for(let c of Ml)l?.[c]===void 0&&r[c]===void 0&&this.applyProp(c,"hug",{tween:Q.lerp})}applyDefaultSize(l){let c=Y.flowChildrenProp(l),f=l?.flow??"freeform",h=o?{width:f!=="vertical",height:f==="vertical"||f==="freeform"}:{width:!1,height:!1};for(let d of["width","height"]){if(l?.[d]!==void 0)continue;let p=r[d],y=p!==void 0&&typeof p!="function"?p:c.length===0||h[d]&&Y.hasFillChild(c,d)?"fill":"hug";this.applyProp(d,y,{tween:Q.lerp})}}measure(l,c){if(!e.measure)return super.measure(l,c);this.lastMeasure={constraints:l,measurer:c};let f=this._measurer;f.max={width:l.maxWidth,height:l.maxHeight},f.scope=c;let h=Yr(this,c,f.max,()=>e.measure(f,this._view,this.flowChildren().map(me)));return yl(this)?h:I.size(this,l,If,h)}layoutChildren(l,c){if(!e.layout)return super.layoutChildren(l,c);let f=this.flowChildren(),h={x:0,y:0,width:l.width,height:l.height,time:this.time};this._box=h,this._childSpace=null;let d=Yr(this,c,{width:l.width,height:l.height},()=>e.layout(h,this._view,f.map(me))),p=null,y=null;d.forEach((x,g)=>{let m=f[g];if(!m)return;m.layout({x:x.x,y:0-x.y,width:x.width,height:x.height},c);let w=Lf(x);w&&(p??=new Map).set(m,w),x.plane&&(y??=new Map).set(m,x.plane)}),this._slots=p,this._planes=y}_placementOf(l){return this._slots?.get(l)??super._placementOf(l)}_planeOf(l){if(l)return this._planes?.get(l)??null;let c=this._box??{x:0,y:0,width:this.layoutBounds?.width??0,height:this.layoutBounds?.height??0,time:this.time};return e.plane?e.plane(c,this._view):null}renderContent(l){if(!e.render)return super.renderContent(l);this.applyTransform(l);let c=this._spaceFrame;if(c&&!c.paints){this.renderChildren(l);return}let f=this._ctx;f.pass=l,f.cut=c?.nearCut??null,f.composite=null;try{this.renderContentWithEffects(l,()=>e.render(f,this._view))}finally{f.pass=null,f.cut=null,this._record=f.composite}}clipSelf(){return this._probeRender(),this._lastShape?Ve(this._lastShape):null}_rendersChildrenInSpace(){let l=this._observed();return!(l?.bounds||l?.camera)&&super._rendersChildrenInSpace()}_localBounds(){let l=this._observed()?.bounds;return(l&&kl(this,l))??super._localBounds()}_cameraScope(){return this._observed()?.camera??super._cameraScope()}_spaceCamera(){return this._observed()?.space??super._spaceCamera()}_projection(){return this._observed()?.space?on:super._projection()}_isViewport3D(){return this._observed()?.scene!==void 0}_scene3D(){return this._probeRender()?.scene??null}_observed(){return this._record===void 0&&this._probeRender(),this._record??null}_probeRender(){if(!e.render)return this._record=null;let l=this._probe??=new Ye(this,!0);return this._lastShape=null,l.composite=null,e.render(l,this._view),this._record=l.composite}hitTestSelf(l,c){let f=this.clipSelf();return!f||f.isEmpty()?super.hitTestSelf(l,c):il(f,l,c)}_renderOwnChildren(l){this.renderChildren(l)}_commandChildren(){return this.flowChildren().map(me)}}let s=i.prototype;if(e.handles){let a=Object.entries(e.handles),l=c=>({width:c.layoutBounds?.width??0,height:c.layoutBounds?.height??0});s._handles=function(){let c=[];for(let[f,h]of a){let d=h.at(this._view,l(this));d&&c.push({prop:f,at:d})}return c},s._handleValue=function(c,f){let h=e.handles[c];return h?h.value?h.value(f,this._view,l(this)):{x:f.x,y:f.y}:null}}if(e.bounds){let a=e.bounds;s._localBounds=function(){return a({width:this.layoutBounds?.width??0,height:this.layoutBounds?.height??0},this._view)}}if(e.space){let a=e.space;i.prototype._spaceOf=function(){return a(this._view)}}return Ge(i,n)}function Z(t){return{_def:t}}function Fe(t,e,n){let{private:r,typing:o,inherit:i,...s}=e??{};return{kind:t,...n,...s}}function re(t,e,n,r){let o={default:e,mapper:n,tween:r,editor:{kind:t},private:!1};return Object.assign((s,a)=>Z({...o,default:s===void 0?o.default:s,editor:Fe(t,a),private:a?.private===!0,inherit:a?.inherit}),{_def:o})}function Bf(t){let e={};for(let n in t)e[n]=He(t[n]).default;return e}var _={number(t=0,e){return Z({default:t,editor:Fe("number",e),private:e?.private===!0,inherit:e?.inherit})},text(t="",e){return Z({default:t,tween:e?.typing?q.lerp:void 0,editor:Fe("text",e),private:e?.private===!0,inherit:e?.inherit})},boolean(t=!1,e){return Z({default:t,editor:Fe("boolean",e),private:e?.private===!0,inherit:e?.inherit})},oneOf(t,e){let{default:n,...r}=e??{};return Z({default:n??t[0],editor:Fe("enum",r,{options:t}),private:e?.private===!0,inherit:e?.inherit})},fill:re("fills",[],V.resolve,V.lerp),stroke:re("strokes",[],Oe.resolve,Oe.lerp),shadow:re("shadows",[],Be.resolve,Be.lerp),effects:re("effects",[],ge.resolve,ge.lerp),color:re("color","black",Re.resolve,Re.lerp),cornerRadius:re("cornerRadius",0,De.resolve,De.lerp),cornerStyle:re("cornerStyle","rounded",Vn.resolve,Vn.lerp),path:re("path","",void 0,te.lerp),insets:re("insets",0,$.resolve,$.lerp),alignment:re("alignment","center",N.resolve,N.lerp),vector2:re("vector2",{x:0,y:0},void 0,$n.lerp),size:re("size","fill",void 0,Q.lerp),point(t={x:0,y:0},e){return Z({default:t,tween:$n.lerp,editor:Fe("point",e),private:e?.private===!0,inherit:e?.inherit})},list(t,e){return Z({default:()=>[],editor:Fe("list",e,{item:t._def.editor}),private:e?.private===!0,inherit:e?.inherit})},object(t){return Z({default:()=>Bf(t),editor:{kind:"object"},private:!1})},custom(t,e){let{resolve:n,lerp:r,private:o,inherit:i,...s}=e??{};return Z({default:t,mapper:n,tween:r,editor:s,private:e?.private===!0,inherit:e?.inherit})},image:(t="")=>Z({default:t,editor:{kind:"image"},private:!1}),video:(t="")=>Z({default:t,editor:{kind:"video"},private:!1}),audio:(t="")=>Z({default:t,editor:{kind:"audio"},private:!1}),font:(t="")=>Z({default:t,editor:{kind:"font"},private:!1}),nodeRef:(t="")=>Z({default:t,editor:{kind:"nodeRef",animatable:!1},private:!1}),seed:(t=1)=>Z({default:t,editor:{kind:"seed"},private:!1})};var Cl={};he(Cl,{rect:()=>gt,state:()=>Qr});var Qr={cornerRadius:_.cornerRadius,cornerStyle:_.cornerStyle};function gt(t,e){return new B().rect({width:t.width,height:t.height,cornerRadius:e.cornerRadius,cornerStyle:e.cornerStyle})}var Vf={};he(Vf,{layout:()=>$f,measure:()=>qf,state:()=>jf});var jf={flow:_.custom("freeform",{lerp:I.lerp}),gap:_.custom(0),wrap:!1,crossGap:_.custom(void 0),columns:_.number(1),align:_.alignment},Wf={width:0,height:0},In=new WeakMap;function bl(t,e){let n=t.padding;return e?{left:n.left+e.left,right:n.right+e.right,top:n.top+e.top,bottom:n.bottom+e.bottom}:n}function qf(t,e,n,r){let{node:o,scope:i}=ze(),s=bl(e,r),a={maxWidth:t.max.width,maxHeight:t.max.height};if(n.length===0)return In.delete(o),I.size(e,a,s,Wf);let l=I.contentBox(e,a,s),c=I.measure(e,n.map(pt),l,i);return In.set(o,c),I.size(e,a,s,c.hug)}function $f(t,e,n,r){let{node:o,scope:i}=ze(),s=In.get(o);In.delete(o);let a=$.insetBounds(t.width,t.height,bl(e,r));if(o._childSpace={settings:{flow:e.flow,align:e.align},inner:a},n.length===0)return[];let l=s&&I.reusable(s,a)?s:I.measure(e,n.map(pt),{width:a.width,height:a.height,hugWidth:e.width==="hug",hugHeight:e.height==="hug"},i);return I.place(l,e,a).map(c=>({x:a.x+c.x,y:c.y-a.y,width:c.width,height:c.height}))}function Ln(t,e){return e}var Ol={};he(Ol,{commands:()=>Hf,draw:()=>to,inset:()=>Gf,state:()=>Al});var eo={min:0,max:1,step:.01,scale:100,unit:"%"},Al={fill:_.fill,stroke:_.stroke,shadow:_.shadow,overlay:_.fill,start:_.number(0,eo),end:_.number(1,eo)},Hf=Ln(Al,{fillTo:{args:["fill"]},strokeTo:{args:["stroke"]},shadowTo:{args:["shadow"]},overlayTo:{args:["overlay"]},progressTo:{args:["start","end"]},flash:{args:{portion:_.number(.25,{...eo,min:.01})},run:(t,e)=>{let n={start:e.start,end:e.end},r=Math.min(1,Math.max(.01,t.args.portion));return t.animate(o=>{if(o<=0||o>=1)return n;let i=o*(1+r);return{start:Math.max(0,i-r),end:Math.min(1,i)}})}}}),Yf=new Set(["rect","ellipse","path","line","polygon","polygram"]);function Xf(t,e,n){return t._withOps(t.ops().map(r=>Yf.has(r.kind)?{...r,state:{...r.state,start:e,end:n}}:r))}function xt(t){return t._withOps([...t.ops()])}function Uf(t){return t.shadow.length===0?!1:!t.fill.some(e=>(e.opacity??1)>0)}function to(t,e,n,r={}){let o=fe(t),i=o.target(),s=r.clipShape===void 0?n:r.clipShape;if(o.host._lastShape=s,o.probing){r.children?.();return}let a=n?Xf(n,e.start,e.end):null;o.inFront(()=>{a&&i.draw(xt(a).shadow(e.shadow).fill(r.fill??e.fill))});let l=e.clip&&s?Ve(s):null,c=l!==null&&!l.isEmpty();c&&i.beginClip(l),r.children?r.children():t.children(),c&&i.endClip(),o.inFront(()=>{if(!a)return;if(e.overlay&&e.overlay.length>0){let h=r.overlay?r.overlay(xt(a)):xt(a).fill(e.overlay);h&&i.draw(h)}let f=e.stroke;f.length!==0&&i.draw(Uf(e)?xt(a).shadow(e.shadow).stroke(f):xt(a).stroke(f))})}function Gf(t){let e=0;for(let n of t.stroke){let r=n.weight*(1-n.align)/2;r>e&&(e=r)}return{left:e,right:e,top:e,bottom:e}}var rh={};he(rh,{box:()=>Qf,corners:()=>Qr,ellipse:()=>Kf,facePath:()=>th,outline:()=>nh,polygon:()=>Zf,polygram:()=>Jf,rect:()=>gt,unitPath:()=>eh});function Kf(t,e){return new B().ellipse({width:t.width,height:t.height,startAngle:e.startAngle,sweep:e.sweep,ratio:e.ratio})}function Zf(t,e){return new B().polygon({width:t.width,height:t.height,sides:e.sides,cornerRadius:e.cornerRadius,cornerStyle:e.cornerStyle})}function Jf(t,e){return new B().polygram({width:t.width,height:t.height,sides:e.sides,ratio:e.ratio,cornerRadius:e.cornerRadius,cornerStyle:e.cornerStyle})}function Qf(t){return new B().rect({x:0,y:0,width:t.width,height:t.height})}function eh(t,e){let{width:n,height:r}=t;return new B().path({data:te.anchorCommands(te.anchors(e),o=>({x:o.x*n,y:-o.y*r})),centerBounds:[-n/2,-r/2,n/2,r/2]})}function th(t){let e=te.bounds(t);return new B().path({data:t,centerBounds:e?[e.minX,e.minY,e.maxX,e.maxY]:void 0})}function nh(t,e,n){let{width:r,height:o}=e;return new B().path({data:te.anchorCommands(fo(t,{...n,width:r,height:o}),i=>({x:i.x,y:-i.y})),centerBounds:[-r/2,-o/2,r/2,o/2]})}var ah={};he(ah,{aim:()=>Tl,camera:()=>ih,commands:()=>oh,state:()=>El});var El={zoom:_.number(1,{min:.01,step:.1,unit:"\xD7"}),lookAt:_.custom({x:0,y:0},{lerp:b,kind:"vector2",properties:{x:{kind:"number"},y:{kind:"number"}}}),heading:_.number(0,{step:1,unit:"\xB0"}),follow:_.nodeRef()},oh=Ln(El,{zoomTo:{args:["zoom"]},panTo:{args:["lookAt"]},headingTo:{args:["heading"]}});function Tl(t,e){let n=e.follow;if(!n)return e.lookAt;let r=gl(n);if(!(r instanceof Y)||!sh(r,fe(t).host))return e.lookAt;let o=n.frame;return{x:o.x+e.lookAt.x,y:o.y+e.lookAt.y}}function ih(t,e){t.camera({lookAt:Tl(t,e),zoom:e.zoom,heading:e.heading})}function sh(t,e){for(let n=t.parent;n;n=n.parent)if(n===e)return!0;return!1}var Pl=100;function x1(t){return t.x===0&&t.y===0&&t.scale===1&&t.rotation===0}function lh(t){let e=t.fontFamily;if(typeof e=="string"&&e!=="")return e;let n=ho();if(n!=="")return n;let r=t.text?` drawing "${t.text.slice(0,32)}"`:"";throw new Error(`Text${r} has no fontFamily. Set one on the text itself, on an enclosing <DefaultTextStyle>, or as the theme's \`default\` typography preset \u2014 there is no fallback face.`)}function w1(t){let e=t.width??0,n=t.height??0,{x:r,y:o,pivot:i}=ue(t,e,n);return{...ce(t),opacity:t.opacity??1,rotation:t.rotation??0,scale:t.scale??1,x:r,y:o,start:t.start??0,end:t.end??1,pivot:ne(i),text:t.text??"",fontSize:t.fontSize??48,fontFamily:lh(t),fontWeight:t.fontWeight??400,fontStyle:t.fontStyle??"normal",letterSpacing:t.letterSpacing??0,lineHeight:t.lineHeight??0,textAlign:t.textAlign??"center",verticalAlign:t.verticalAlign??"center",textDecoration:t.textDecoration??"none",wrap:t.wrap??!1,minFontSize:t.minFontSize??12,width:t.width??0,height:t.height??0,segments:t.segments,path:t.path??null}}var wh={};he(wh,{draw:()=>dh,drawRichText:()=>gh,load:()=>ph,loadRichText:()=>xh,measure:()=>hh,measureRichText:()=>yh,textStateOf:()=>mh});function no(t,e){return q.applyCase(e.text,t.textCase)}function zl(t,e,n,r){if(e.glyphPath!=null){let{width:g,height:m}=te.size(e.glyphPath),w=t.width,v=t.height;return{width:typeof w=="number"?w:w==="hug"?g:n.maxWidth??g,height:typeof v=="number"?v:v==="hug"?m:n.maxHeight??m}}let o=t.fontSize==="autofit"?16:t.fontSize,i=no(t,e).split(`
2
+ `),s=ro(t,e),a=s===null?null:ch(s,{fontFamily:t.fontFamily,fontSize:o,fontStyle:t.fontStyle,fontWeight:t.fontWeight,letterSpacing:t.letterSpacing}),l=o*t.lineHeight,c=Math.max(...a?a.map(g=>g.runs.reduce((m,w)=>m+r.measureText(w.text,w.fontSize,w.fontFamily,w.fontWeight,w.letterSpacing,w.fontStyle).width,0)):i.map(g=>r.measureText(g,o,t.fontFamily,t.fontWeight,t.letterSpacing,t.fontStyle).width)),f=t.width,h=t.height,d=typeof f=="number"?f:f==="hug"?c:n.maxWidth??0,p=e.wraps&&d>0,y=a===null?null:p?uh(a,d,r):a.map(g=>Math.max(...g.runs.map(m=>m.fontSize))),x=y?y.reduce((g,m)=>g+m*t.lineHeight,0):(p?i.reduce((g,m)=>g+fh(m,d,o,t.fontFamily,t.fontWeight,r,t.letterSpacing,t.fontStyle),0):i.length)*l;return{width:d,height:typeof h=="number"?h:x}}function ro(t,e){if(e.glyphPath!=null)return null;let n=e.runs.filter(p=>p.end>p.start),r=no(t,e);if(r.length===0)return null;let o=t.start>0||t.end<1;if(n.length===0&&!o)return null;let i=Math.round(t.start*r.length),s=Math.round(t.end*r.length),a=typeof t.fontSize=="number"?t.fontSize:Pl,l=t.fill,c=t.stroke,f=new Set([0,r.length]);for(let p of n)f.add(p.start),f.add(p.end);o&&(f.add(i),f.add(s));let h=[...f].filter(p=>p>=0&&p<=r.length).sort((p,y)=>p-y),d=[];for(let p=0;p<h.length-1;p++){let y=h[p],x=h[p+1];if(x<=y)continue;let g={text:r.slice(y,x),fontFamily:t.fontFamily,fontSize:a,fontStyle:t.fontStyle,fontWeight:t.fontWeight,letterSpacing:t.letterSpacing,textDecoration:t.textDecoration,opacity:1,x:0,y:0,scale:1,rotation:0,fill:l,stroke:c};for(let m of n)y<m.start||x>m.end||(m.fontFamily!==void 0&&(g.fontFamily=m.fontFamily),m.fontSize!==void 0&&(g.fontSize=m.fontSize),m.fontStyle!==void 0&&(g.fontStyle=m.fontStyle),m.fontWeight!==void 0&&(g.fontWeight=m.fontWeight),m.letterSpacing!==void 0&&(g.letterSpacing=m.letterSpacing),m.textDecoration!==void 0&&(g.textDecoration=m.textDecoration),m.fill!==void 0&&(g.fill=m.fill),m.stroke!==void 0&&(g.stroke=m.stroke));o&&!(y>=i&&x<=s)&&(g.opacity=0),d.push(g)}return d}function oo(t,e,n){return{text:no(t,e),fontSize:t.fontSize,fontFamily:t.fontFamily,fontWeight:t.fontWeight,fontStyle:t.fontStyle,letterSpacing:t.letterSpacing,lineHeight:t.lineHeight,textAlign:t.textAlign,verticalAlign:t.verticalAlign,textDecoration:t.textDecoration,wrap:e.wraps,minFontSize:t.minFontSize,width:n?.width??0,height:n?.height??0,segments:ro(t,e)??void 0,path:e.glyphPath}}function Fl(t,e,n){t.fontFamily&&n.font(t.fontFamily,t.fontWeight);for(let r of ro(t,e)??[]){let o=r.fontFamily??t.fontFamily;o&&n.font(o,r.fontWeight),n.fill(r.fill??[]);for(let i of r.stroke??[])n.fill(i.fill)}}function ch(t,e){let n=[{runs:[]}];for(let r of t){let o={fontFamily:r.fontFamily??e.fontFamily,fontSize:r.fontSize??e.fontSize,fontStyle:r.fontStyle??e.fontStyle,fontWeight:r.fontWeight,letterSpacing:r.letterSpacing},i=r.text.split(`
3
+ `);for(let s=0;s<i.length;s++)s>0&&n.push({runs:[]}),n[n.length-1].runs.push({text:i[s],...o})}for(let r of n)r.runs.length===0&&r.runs.push({...e,text:""});return n}function uh(t,e,n){let r=[];for(let o of t){let i=[];for(let l of o.runs)for(let c of l.text.split(/(\s+)/)){if(c.length===0)continue;let f=/^\s+$/.test(c),h=n.measureText(c,l.fontSize,l.fontFamily,l.fontWeight,l.letterSpacing,l.fontStyle).width,d=i[i.length-1];d&&!d.space&&!f?(d.width+=h,d.size=Math.max(d.size,l.fontSize)):i.push({width:h,size:l.fontSize,space:f})}if(i.length===0){r.push(Math.max(...o.runs.map(l=>l.fontSize)));continue}let s=i[0].width,a=i[0].size;for(let l of i.slice(1))s+l.width<=e?(s+=l.width,a=Math.max(a,l.size)):(r.push(a),s=l.space?0:l.width,a=l.space?0:l.size);r.push(a>0?a:Math.max(...o.runs.map(l=>l.fontSize)))}return r}function fh(t,e,n,r,o,i,s=0,a="normal"){if(t.length===0||i.measureText(t,n,r,o,s,a).width<=e)return 1;let l=t.split(/(\s+)/).filter(h=>h.length>0),c=1,f=0;for(let h of l){let d=i.measureText(h,n,r,o,s,a).width;f===0?f=d:f+d<=e?f+=d:(c++,f=/^\s+$/.test(h)?0:d)}return c}function io(t){return q.flatten(t.spans,{fontFamily:t.fontFamily,fontSize:t.fontSize,fontWeight:t.fontWeight,fontStyle:t.fontStyle,letterSpacing:t.letterSpacing,fill:t.fill,stroke:t.stroke})}function Nl(t,e,n){let r=0,o=0,i=0,s=0,a=()=>{r>i&&(i=r),s+=o,r=0,o=0};for(let f of io(t)){let h=f.fontSize*t.lineHeight,d=f.text.split(`
4
+ `);for(let p=0;p<d.length;p++)p>0&&a(),r+=n.measureText(d[p],f.fontSize,f.fontFamily,f.fontWeight,f.letterSpacing,f.fontStyle).width,h>o&&(o=h)}a(),s===0&&(s=t.fontSize*t.lineHeight);let l=t.width,c=t.height;return{width:typeof l=="number"?l:l==="hug"?i:e.maxWidth??0,height:typeof c=="number"?c:c==="hug"?s:e.maxHeight??0}}function Dl(t,e){return{spans:io(t),lineHeight:t.lineHeight,textAlign:t.textAlign,width:e?.width??0,height:e?.height??0}}function Rl(t,e){for(let n of io(t)){n.fontFamily&&e.font(n.fontFamily,n.fontWeight),e.fill(n.fill);for(let r of n.stroke)e.fill(r.fill)}}function hh(t,e,n){let{node:r,scope:o}=ze();return ml(r),zl(e,n,{maxWidth:t.max.width,maxHeight:t.max.height},o)}var Il=new WeakMap;function dh(t,e,n){let r=fe(t);if(Il.set(r.host,{s:e,source:n}),r.probing)return;let o=r.target(),i=oo(e,n,r.host.layoutBounds),s=i.segments!=null;r.inFront(()=>{let a=new B().text(i).shadow(e.shadow);s||a.fill(e.fill),o.draw(a)}),t.children(),r.inFront(()=>{let a=e.stroke;a.length===0||s||o.draw(new B().text(i).stroke(a))})}function ph(t,e,n){Fl(e,n,t)}function mh(t){let e=Il.get(t);return e?oo(e.s,e.source,t.layoutBounds):null}function yh(t,e){let{scope:n}=ze();return Nl(e,{maxWidth:t.max.width,maxHeight:t.max.height},n)}function gh(t,e){let n=fe(t);if(n.probing)return;let r=n.target();n.inFront(()=>r.draw(new B().richText(Dl(e,n.host.layoutBounds)))),t.children()}function xh(t,e){Rl(e,t)}var Bn=ht({},"text-style"),E1=ht({},"theme"),T1=ht({},"data"),P1=ht(void 0,"seed");function Ll(t,e){return{context:t,value:e}}var Ch={};he(Ch,{current:()=>Mh,inherit:()=>ie,provide:()=>kh,provided:()=>vh,state:()=>Sh});function _h(t,e){let n=e.variant;return q.mergeStyle(q.mergeStyle(q.preset("default"),t(Bn)),n?q.preset(n):void 0)}function ie(t,e={}){return(n,r)=>{let o=_h(n,r)[t];return t==="fontSize"&&o==="autofit"&&e.autofit===!1?void 0:o}}var Sh={fontFamily:_.custom(void 0,{inherit:ie("fontFamily")}),fontSize:_.custom(48,{lerp:(t,e,n)=>q.lerpFontSize(t,e,n),inherit:ie("fontSize")}),fontWeight:_.number(400,{inherit:ie("fontWeight")}),fontStyle:_.custom("normal",{inherit:ie("fontStyle")}),letterSpacing:_.number(0,{inherit:ie("letterSpacing")}),lineHeight:_.number(1.2,{inherit:ie("lineHeight")}),textAlign:_.custom("center",{inherit:ie("textAlign")}),verticalAlign:_.oneOf(["top","center","bottom"],{default:"center"}),textDecoration:_.oneOf(["none","underline","line-through"]),textCase:_.oneOf(["none","upper","lower","title"]),minFontSize:_.number(12),variant:_.custom(void 0),fill:_.fill(void 0,{inherit:ie("fill")}),stroke:_.stroke(void 0,{inherit:ie("stroke")}),shadow:_.shadow(void 0,{inherit:ie("shadow")})},vh={fontFamily:_.custom(void 0),fontSize:_.custom(void 0),fontWeight:_.custom(void 0),fontStyle:_.custom(void 0),letterSpacing:_.custom(void 0),lineHeight:_.custom(void 0),textAlign:_.custom(void 0),fill:_.custom(void 0),stroke:_.custom(void 0),shadow:_.custom(void 0)};function kh(t,e){return[Ll(Bn,q.mergeStyle(e(Bn),t))]}function Mh(t){return q.mergeStyle({},t)}function W1(t){let e=Xe(t,Me);class n extends Ue(Me,e){_commandChildren(){return this.childrenAudio.map(me)}}return Ge(n,e)}Dn(t=>bn(t.constructor)?.key);var so=class{host;target=null;camera3D=!1;environment3D=null;constructor(e){this.host=e}get time(){return this.host.time}draw(e){e&&this.target?.draw(e)}light(e,n){this.target?.light(e,n)}camera(e){this.camera3D=!0,this.target?.camera({...this.host._ownTransform(),...e})}fog(e){this.target?.fog(e)}environment(e){this.environment3D=e,this.target?.environment(e)}};function U1(t){let e=t,n=Xe(e,pe);class r extends Ue(pe,n){constructor(i){super(i),this._ctx3d=new so(this)}renderSelf(i){if(!e.render)return;let s=this._ctx3d;s.target=i;try{e.render(s,this._view)}finally{s.target=null}}groupTransform(){return this._rendersCamera()?{}:super.groupTransform()}_rendersCamera(){if(this._isCamera===void 0){let i=this._ctx3d;i.camera3D=!1,e.render&&e.render(i,this._view),this._isCamera=i.camera3D}return this._isCamera}_ownTransform(){return this.transform3D()}declareAssets(i){this._ctx3d.environment3D=null,super.declareAssets(i),nr(this._ctx3d.environment3D,i)}_commandChildren(){return this.children.filter(i=>i instanceof pe).map(me)}}if(e.space){let o=e.space;r.prototype._spaceOf=function(){return o(this._view)}}return Ge(r,n)}var Fh={};he(Fh,{mesh:()=>Eh,points:()=>zh,shorthand:()=>ao,single:()=>Th,state:()=>Ah});function W(){return _.custom(void 0)}function Q1(t){return _.custom(void 0,{kind:"number",...t})}function Bl(){return _.custom(void 0,{resolve:t=>t===void 0?void 0:Re.resolve(t),lerp:Re.lerp,kind:"color"})}function ek(t){return _.custom(void 0,{resolve:gn,lerp:(e,n,r)=>xn(e,n,r,t),kind:"vector3"})}function bh(t,e){let n={};for(let r of e){let o=t[r];o!==void 0&&(n[r]=o)}return n}function tk(t,e,n){return{type:t,...bh(e,n)}}var Ah={material:W(),fill:_.custom("white",{lerp:ji}),opacity:W(),roughness:W(),metalness:W(),emission:Bl(),emissionStrength:W(),normalMap:W(),roughnessMap:W(),metalnessMap:W(),aoMap:W(),alphaMap:W(),envMapIntensity:W(),wireframe:W(),shading:W(),faces:W(),vertexColors:W(),blend:W(),unlit:_.custom(!1)},Oh=["opacity","roughness","metalness","emission","emissionStrength","normalMap","roughnessMap","metalnessMap","aoMap","alphaMap","envMapIntensity","wireframe","shading","faces","vertexColors","blend"];function ao(t){let e={};t.material!==void 0&&(e.material=t.material),t.fill!==void 0&&(e.fill=t.fill);for(let n of Oh)t[n]!==void 0&&(e[n]=t[n]);return t.unlit&&(e.unlit=!0),e}function Eh(t,e){let n=new Le;return e&&n.mesh(e,Vt(ao(t))),n}function Th(t){let e=Vt(ao(t));return Array.isArray(e)?e[0]:e}var Ph=["opacity","alphaMap","blend","vertexColors"];function zh(t){if(t.material!==void 0)return Array.isArray(t.material)?t.material[0]:t.material;let e={type:"points"},n=rt(t.fill);n.color!==void 0&&(e.color=n.color),n.map!==void 0&&(e.map=n.map);for(let r of Ph)t[r]!==void 0&&(e[r]=t[r]);return e}var qh={};he(qh,{commands:()=>Dh,draw:()=>Lh,load:()=>Ih,scene:()=>Vl,state:()=>Nh});function ql(t){let{size:e,divisions:n,majorEvery:r,showAxes:o,fade:i}=t,s=e/2,a=e/n,l=wt(t.minorColor),c=wt(t.majorColor),f=wt(t.axisXColor),h=wt(t.axisZColor),d=wt(t.fadeTo),p=[],y=[],x=(g,m,w,v,M)=>{p.push(g,0,m,w,0,v),Wl(y,M,d,jl(g,m,s,i)),Wl(y,M,d,jl(w,v,s,i))};for(let g=0;g<=n;g++){let m=-s+g*a,w=Math.abs(g-n/2);if(Math.abs(m)<a/2&&o)continue;let M=Number.isInteger(w)&&w%r===0?c:l;x(m,-s,m,s,M),x(-s,m,s,m,M)}return o&&(x(-s,0,s,0,f),x(0,-s,0,s,h)),{type:"buffer",position:new Float32Array(p),color:new Float32Array(y),computeNormals:!1,staticData:!0}}function jl(t,e,n,r){if(r<=0)return 0;let o=Math.hypot(t,e)/n,i=1-r;if(o<=i)return 0;let s=Math.min(1,(o-i)/Math.max(r,1e-6));return s*s}function Wl(t,e,n,r){t.push(e[0]+(n[0]-e[0])*r,e[1]+(n[1]-e[1])*r,e[2]+(n[2]-e[2])*r)}function wt(t){let[e,n,r]=_t(t);return[lo(e),lo(n),lo(r)]}function lo(t){return t<.04045?t*.0773993808:Math.pow(t*.9478672986+.0521327014,2.4)}function Ne(t){return _.custom(t,{resolve:_t,lerp:po})}var Nh={orbit:_.number(35,{step:1,unit:"\xB0"}),elevation:_.number(20,{min:-89,max:89,step:1,unit:"\xB0"}),zoom:_.number(12,{min:.01,step:.1}),fov:_.custom(45),ambientIntensity:_.custom(.45),ambientColor:Ne("#ffffff"),keyIntensity:_.custom(2.4),keyColor:Ne("#ffffff"),showGrid:_.custom(!1),gridSize:_.custom(40),gridDivisions:_.custom(40),gridMajorEvery:_.custom(5),gridColor:Ne("#26292f"),gridMajorColor:Ne("#363a42"),showAxes:_.custom(!1),axisXColor:Ne("#c8404f"),axisZColor:Ne("#2f6fd0"),gridFade:_.custom(.55),gridFadeColor:Ne("#0b0d12"),maxPixelRatio:_.custom(2),antialias:_.custom(!0),shadows:_.custom(!1),tone:W(),exposure:W(),post:W()},Dh={orbitTo:{args:["orbit","elevation","zoom"]}},Rh=async()=>{await Gi()};function Ih(t,e){if(t.task("three:runtime",Rh),!e)return;let n=new J;e(n);let r={type:"canvas3D",scene:n};t.fill(r)}var $l=new WeakMap;function Vl(t,e,n){let r=t.scene3D(),o=r.ops().length>0,i=Yt(e.shadows);i&&r.shadows(i),(e.tone!==void 0||e.exposure!==void 0)&&r.tone({mapping:e.tone,exposure:e.exposure}),e.post!==void 0&&r.post(e.post);let s=r.fogDescriptor();if(s&&s.color===void 0){let a=Wh(e.fill);a!==void 0&&r.fog({...s,color:a})}return e.showGrid&&r.draw(new Le().line({geometry:Bh(fe(t).host,e),segments:!0,material:{type:"lineBasic",vertexColors:!0,toneMapped:!1}})),!n&&r.isEmpty()&&!o?null:(r.cameraDescriptor()===null&&r.perspective({fov:e.fov,orbit:mo(e.orbit),elevation:e.elevation,distance:e.zoom}),r.ops().some(a=>a.kind==="light")||r.light({type:"ambient",intensity:e.ambientIntensity,color:e.ambientColor}).light({type:"directional",intensity:e.keyIntensity,color:e.keyColor},{position:[4,6,3]}).light({type:"directional",intensity:e.keyIntensity*.35,color:e.keyColor},{position:[-5,-2,-4]}),n?.(r),r.isEmpty()?null:r)}function Lh(t,e,n){let r=Vl(t,e,n),o=fe(t);if(r&&!o.probing){r.assertBalanced();let s=o.host;Xt(r,a=>{if(!tt(a))return;let l=jt(a.source);l.kind==="node"&&s.attachDetached(l.node)})}let i=r?[...e.fill,...mi.canvas3D(r,{maxPixelRatio:e.maxPixelRatio,antialias:e.antialias})]:e.fill;to(t,e,gt(t.size,e),{fill:i})}function Bh(t,e){let n={size:e.gridSize,divisions:Math.max(1,Math.round(e.gridDivisions)),majorEvery:Math.max(1,Math.round(e.gridMajorEvery)),minorColor:e.gridColor,majorColor:e.gridMajorColor,axisXColor:e.axisXColor,axisZColor:e.axisZColor,showAxes:e.showAxes,fadeTo:jh(e),fade:e.gridFade},r=JSON.stringify(n),o=$l.get(t);return o?.key!==r&&$l.set(t,o={key:r,geometry:ql(n)}),o.geometry}function jh(t){for(let e of t.fill){if(e?.type!=="solid")continue;let n=e.color;if(typeof n=="string"||Array.isArray(n)&&(n[3]??1)>0)return n}return t.gridFadeColor}function Wh(t){for(let e of t)if(e&&e.type==="solid")return e.color}export{St as a,vt as b,kt as c,De as d,Vn as e,Uh as f,Ke as g,ye as h,F as i,G as j,Hn as k,C as l,Mt as m,L as n,Re as o,Xl as p,ad as q,oe as r,Gl as s,Kl as t,At as u,Ot as v,ud as w,fd as x,hd as y,dd as z,Tt as A,li as B,Pt as C,Nt as D,O as E,Qm as F,fi as G,ge as H,fc as I,di as J,pi as K,Je as L,mi as M,Xn as N,mc as O,Iy as P,Ly as Q,gc as R,By as S,Ai as T,et as U,Un as V,xc as W,wc as X,qy as Y,$y as Z,Oi as _,N as $,$ as aa,lg as ba,vc as ca,ae as da,B as ea,jt as fa,Cc as ga,tt as ha,pg as ia,Ni as ja,nt as ka,rt as la,ji as ma,Vi as na,Vt as oa,Le as pa,Ht as qa,Yt as ra,J as sa,Xi as ta,zg as ua,Fg as va,Ng as wa,Gi as xa,Ki as ya,Dg as za,Nc as Aa,Dc as Ba,Xt as Ca,Zt as Da,Hx as Ea,Jc as Fa,rr as Ga,Yx as Ha,V as Ia,Qc as Ja,Be as Ka,tu as La,nu as Ma,ru as Na,ys as Oa,ms as Pa,ou as Qa,iu as Ra,Oe as Sa,ir as Ta,K as Ua,ot as Va,_s as Wa,Ss as Xa,r0 as Ya,o0 as Za,i0 as _a,Ee as $a,u0 as ab,f0 as bb,h0 as cb,d0 as db,Qt as eb,p0 as fb,m0 as gb,H as hb,vs as ib,X as jb,y0 as kb,g0 as lb,en as mb,_0 as nb,Ms as ob,ur as pb,fr as qb,nn as rb,Ps as sb,zs as tb,we as ub,We as vb,rn as wb,q0 as xb,du as yb,on as zb,hr as Ab,Fs as Bb,Ns as Cb,pu as Db,ln as Eb,pr as Fb,H0 as Gb,gr as Hb,Q as Ib,xu as Jb,wr as Kb,st as Lb,q as Mb,at as Nb,_e as Ob,k as Pb,P as Qb,Se as Rb,Ks as Sb,Sw as Tb,vw as Ub,Zs as Vb,kw as Wb,Mw as Xb,Cw as Yb,$s as Zb,fn as _b,sw as $b,Vs as ac,Hs as bc,ct as cc,Xs as dc,uw as ec,vr as fc,ve as gc,fw as hc,hn as ic,ut as jc,dw as kc,Us as lc,ht as mc,ft as nc,yw as oc,Ou as pc,Cr as qc,pn as rc,Gs as sc,j as tc,de as uc,mn as vc,I as wc,qe as xc,Tr as yc,c_ as zc,Vu as Ac,u_ as Bc,Hu as Cc,Yu as Dc,Xu as Ec,f_ as Fc,Ca as Gc,M_ as Hc,Oa as Ic,C_ as Jc,Sn as Kc,$e as Lc,Mn as Mc,kn as Nc,Ku as Oc,I_ as Pc,La as Qc,Y as Rc,of as Sc,Ha as Tc,Me as Uc,af as Vc,dS as Wc,pS as Xc,lf as Yc,cf as Zc,pe as _c,Rr as $c,bn as ad,ne as bd,An as cd,uf as dd,ce as ed,ue as fd,bS as gd,Za as hd,Ja as id,Qa as jd,el as kd,tl as ld,il as md,ff as nd,pf as od,mf as pd,yf as qd,sl as rd,gf as sd,nv as td,En as ud,Tn as vd,fe as wd,Fv as xd,_ as yd,Qr as zd,gt as Ad,Cl as Bd,jf as Cd,qf as Dd,$f as Ed,Vf as Fd,Ln as Gd,Al as Hd,Hf as Id,to as Jd,Gf as Kd,Ol as Ld,Kf as Md,Zf as Nd,Jf as Od,Qf as Pd,eh as Qd,th as Rd,nh as Sd,rh as Td,El as Ud,oh as Vd,ih as Wd,ah as Xd,Pl as Yd,x1 as Zd,lh as _d,w1 as $d,hh as ae,dh as be,ph as ce,mh as de,yh as ee,gh as fe,xh as ge,wh as he,Bn as ie,E1 as je,T1 as ke,P1 as le,Ll as me,ie as ne,Sh as oe,vh as pe,kh as qe,Mh as re,Ch as se,W1 as te,U1 as ue,W as ve,Q1 as we,Bl as xe,ek as ye,bh as ze,tk as Ae,Ah as Be,Eh as Ce,Th as De,zh as Ee,Fh as Fe,Nh as Ge,Dh as He,Ih as Ie,Lh as Je,qh as Ke};
5
+ //# sourceMappingURL=chunk-RTNATFWX.js.map