tsparticles 1.38.0 → 1.39.3

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 (1513) hide show
  1. package/Core/Canvas.d.ts +1 -1
  2. package/Core/Canvas.js +13 -13
  3. package/Core/Container.d.ts +5 -6
  4. package/Core/Container.js +11 -12
  5. package/Core/Interfaces/Gradients.d.ts +2 -2
  6. package/Core/Interfaces/ICircleBouncer.d.ts +1 -1
  7. package/Core/Interfaces/IContainerPlugin.d.ts +4 -4
  8. package/Core/Interfaces/IExternalInteractor.d.ts +1 -1
  9. package/Core/Interfaces/IInteractor.d.ts +1 -1
  10. package/Core/Interfaces/IMovePathGenerator.d.ts +1 -1
  11. package/Core/Interfaces/IParticle.d.ts +8 -8
  12. package/Core/Interfaces/IParticleGradientAnimation.d.ts +1 -1
  13. package/Core/Interfaces/IParticleSpin.d.ts +1 -1
  14. package/Core/Interfaces/IParticlesInteractor.d.ts +2 -2
  15. package/Core/Interfaces/IPlugin.d.ts +1 -1
  16. package/Core/Interfaces/index.d.ts +3 -1
  17. package/Core/Interfaces/index.js +3 -1
  18. package/Core/Loader.d.ts +1 -1
  19. package/Core/Loader.js +4 -3
  20. package/Core/Particle.d.ts +3 -6
  21. package/Core/Particle.js +41 -43
  22. package/Core/Particles.d.ts +3 -3
  23. package/Core/Particles.js +14 -20
  24. package/{Utils → Core/Utils}/Circle.d.ts +1 -1
  25. package/{Utils → Core/Utils}/Circle.js +2 -2
  26. package/{esm → Core}/Utils/CircleWarp.d.ts +2 -3
  27. package/{Utils → Core/Utils}/CircleWarp.js +1 -1
  28. package/{Utils → Core/Utils}/Constants.d.ts +0 -0
  29. package/{Utils → Core/Utils}/Constants.js +0 -0
  30. package/{Utils → Core/Utils}/EventListeners.d.ts +1 -1
  31. package/{Utils → Core/Utils}/EventListeners.js +10 -11
  32. package/Core/{ExternalInteractorBase.d.ts → Utils/ExternalInteractorBase.d.ts} +4 -4
  33. package/Core/{ExternalInteractorBase.js → Utils/ExternalInteractorBase.js} +1 -2
  34. package/{esm/Core → Core/Utils}/FrameManager.d.ts +1 -1
  35. package/Core/{FrameManager.js → Utils/FrameManager.js} +0 -0
  36. package/{esm/Core → Core/Utils}/InteractionManager.d.ts +5 -5
  37. package/Core/{InteractionManager.js → Utils/InteractionManager.js} +4 -3
  38. package/{esm/Core → Core/Utils}/ParticlesInteractorBase.d.ts +4 -4
  39. package/Core/{ParticlesInteractorBase.js → Utils/ParticlesInteractorBase.js} +1 -2
  40. package/{esm/Core/Particle/Mover.d.ts → Core/Utils/ParticlesMover.d.ts} +2 -2
  41. package/Core/{Particle/Mover.js → Utils/ParticlesMover.js} +6 -7
  42. package/{esm → Core}/Utils/Plugins.d.ts +5 -5
  43. package/{Utils → Core/Utils}/Plugins.js +0 -0
  44. package/{Utils → Core/Utils}/Point.d.ts +2 -2
  45. package/{Utils → Core/Utils}/Point.js +0 -0
  46. package/{Utils → Core/Utils}/QuadTree.d.ts +4 -4
  47. package/{Utils → Core/Utils}/QuadTree.js +3 -3
  48. package/{esm → Core}/Utils/Range.d.ts +1 -1
  49. package/{Utils → Core/Utils}/Range.js +0 -0
  50. package/{esm → Core}/Utils/Rectangle.d.ts +1 -2
  51. package/{Utils → Core/Utils}/Rectangle.js +0 -0
  52. package/Core/{Particle → Utils}/Vector.d.ts +0 -0
  53. package/Core/{Particle → Utils}/Vector.js +0 -0
  54. package/{esm/Core/Particle → Core/Utils}/Vector3d.d.ts +1 -1
  55. package/Core/{Particle → Utils}/Vector3d.js +0 -0
  56. package/Core/Utils/index.d.ts +16 -0
  57. package/Core/Utils/index.js +28 -0
  58. package/Core/index.d.ts +8 -0
  59. package/Core/index.js +20 -0
  60. package/Enums/AnimationStatus.d.ts +1 -1
  61. package/Enums/AnimationStatus.js +0 -6
  62. package/Enums/Directions/MoveDirection.d.ts +1 -1
  63. package/Enums/Directions/MoveDirection.js +0 -13
  64. package/Enums/Directions/OutModeDirection.d.ts +1 -1
  65. package/Enums/Directions/OutModeDirection.js +0 -8
  66. package/Enums/Directions/RotateDirection.d.ts +1 -1
  67. package/Enums/Directions/RotateDirection.js +0 -7
  68. package/Enums/Directions/TiltDirection.d.ts +1 -1
  69. package/Enums/Directions/TiltDirection.js +0 -7
  70. package/Enums/InteractivityDetect.d.ts +1 -1
  71. package/Enums/InteractivityDetect.js +0 -7
  72. package/Enums/Modes/ClickMode.d.ts +1 -1
  73. package/Enums/Modes/ClickMode.js +0 -11
  74. package/Enums/Modes/CollisionMode.d.ts +1 -1
  75. package/Enums/Modes/CollisionMode.js +0 -7
  76. package/Enums/Modes/DestroyMode.d.ts +1 -1
  77. package/Enums/Modes/DestroyMode.js +0 -6
  78. package/Enums/Modes/DivMode.d.ts +1 -1
  79. package/Enums/Modes/DivMode.js +0 -7
  80. package/Enums/Modes/HoverMode.d.ts +1 -1
  81. package/Enums/Modes/HoverMode.js +0 -13
  82. package/Enums/Modes/OutMode.d.ts +1 -1
  83. package/Enums/Modes/OutMode.js +0 -11
  84. package/Enums/Modes/ResponsiveMode.d.ts +1 -1
  85. package/Enums/Modes/ResponsiveMode.js +0 -6
  86. package/Enums/Modes/RollMode.d.ts +1 -1
  87. package/Enums/Modes/RollMode.js +0 -7
  88. package/Enums/Modes/SizeMode.d.ts +1 -1
  89. package/Enums/Modes/SizeMode.js +0 -6
  90. package/Enums/Modes/ThemeMode.d.ts +1 -1
  91. package/Enums/Modes/ThemeMode.js +0 -7
  92. package/Enums/Types/AlterType.d.ts +1 -1
  93. package/Enums/Types/AlterType.js +0 -6
  94. package/Enums/Types/DestroyType.d.ts +1 -1
  95. package/Enums/Types/DestroyType.js +0 -7
  96. package/Enums/Types/DivType.d.ts +1 -1
  97. package/Enums/Types/DivType.js +0 -6
  98. package/Enums/Types/EasingType.d.ts +1 -1
  99. package/Enums/Types/EasingType.js +0 -12
  100. package/Enums/Types/GradientType.d.ts +1 -1
  101. package/Enums/Types/GradientType.js +0 -7
  102. package/Enums/Types/InteractorType.d.ts +1 -1
  103. package/Enums/Types/InteractorType.js +0 -6
  104. package/Enums/Types/OrbitType.d.ts +1 -1
  105. package/Enums/Types/OrbitType.js +0 -6
  106. package/Enums/Types/ShapeType.d.ts +1 -1
  107. package/Enums/Types/ShapeType.js +0 -15
  108. package/Enums/Types/StartValueType.d.ts +1 -1
  109. package/Enums/Types/StartValueType.js +0 -7
  110. package/Interactions/External/Attract/Attractor.d.ts +2 -2
  111. package/Interactions/External/Attract/Attractor.js +9 -11
  112. package/Interactions/External/Attract/index.d.ts +2 -2
  113. package/Interactions/External/Attract/index.js +2 -2
  114. package/Interactions/External/Bounce/Bouncer.d.ts +2 -2
  115. package/Interactions/External/Bounce/Bouncer.js +15 -17
  116. package/Interactions/External/Bounce/index.d.ts +2 -2
  117. package/Interactions/External/Bounce/index.js +2 -2
  118. package/Interactions/External/Bubble/Bubbler.d.ts +3 -3
  119. package/Interactions/External/Bubble/Bubbler.js +20 -22
  120. package/Interactions/External/Bubble/ProcessBubbleType.d.ts +1 -1
  121. package/Interactions/External/Bubble/ProcessBubbleType.js +0 -7
  122. package/Interactions/External/Bubble/index.d.ts +2 -2
  123. package/Interactions/External/Bubble/index.js +2 -2
  124. package/Interactions/External/Connect/Connector.d.ts +2 -2
  125. package/Interactions/External/Connect/Connector.js +3 -4
  126. package/Interactions/External/Connect/index.d.ts +2 -2
  127. package/Interactions/External/Connect/index.js +2 -2
  128. package/Interactions/External/Grab/Grabber.d.ts +2 -2
  129. package/Interactions/External/Grab/Grabber.js +4 -5
  130. package/Interactions/External/Grab/index.d.ts +2 -2
  131. package/Interactions/External/Grab/index.js +2 -2
  132. package/Interactions/External/Repulse/Repulser.d.ts +2 -2
  133. package/Interactions/External/Repulse/Repulser.js +15 -17
  134. package/Interactions/External/Repulse/index.d.ts +2 -2
  135. package/Interactions/External/Repulse/index.js +2 -2
  136. package/Interactions/External/Trail/TrailMaker.d.ts +2 -3
  137. package/Interactions/External/Trail/TrailMaker.js +4 -5
  138. package/Interactions/External/Trail/index.d.ts +2 -2
  139. package/Interactions/External/Trail/index.js +2 -2
  140. package/Interactions/Particles/Attract/Attractor.d.ts +2 -4
  141. package/Interactions/Particles/Attract/Attractor.js +2 -2
  142. package/Interactions/Particles/Attract/index.d.ts +2 -2
  143. package/Interactions/Particles/Attract/index.js +2 -2
  144. package/Interactions/Particles/Collisions/Collider.d.ts +2 -3
  145. package/Interactions/Particles/Collisions/Collider.js +5 -6
  146. package/Interactions/Particles/Collisions/index.d.ts +2 -2
  147. package/Interactions/Particles/Collisions/index.js +2 -2
  148. package/Interactions/Particles/Links/LinkInstance.d.ts +1 -3
  149. package/Interactions/Particles/Links/LinkParticle.d.ts +1 -1
  150. package/Interactions/Particles/Links/Linker.d.ts +3 -4
  151. package/Interactions/Particles/Links/Linker.js +4 -4
  152. package/Interactions/Particles/Links/index.d.ts +2 -3
  153. package/Interactions/Particles/Links/index.js +5 -9
  154. package/Interactions/Particles/Links/interaction.d.ts +2 -0
  155. package/Interactions/Particles/Links/interaction.js +8 -0
  156. package/Interactions/Particles/Links/plugin.d.ts +2 -2
  157. package/Interactions/Particles/Links/plugin.js +4 -4
  158. package/Options/Classes/AnimatableColor.d.ts +3 -3
  159. package/Options/Classes/AnimatableColor.js +1 -1
  160. package/Options/Classes/AnimatableGradient.d.ts +6 -6
  161. package/Options/Classes/AnimatableGradient.js +3 -4
  162. package/Options/Classes/AnimationOptions.d.ts +2 -2
  163. package/Options/Classes/Background/Background.d.ts +2 -2
  164. package/Options/Classes/BackgroundMask/BackgroundMask.d.ts +2 -2
  165. package/Options/Classes/BackgroundMask/BackgroundMaskCover.d.ts +2 -2
  166. package/Options/Classes/ColorAnimation.d.ts +1 -1
  167. package/Options/Classes/HslAnimation.d.ts +2 -2
  168. package/Options/Classes/Interactivity/Events/ClickEvent.d.ts +2 -2
  169. package/Options/Classes/Interactivity/Events/DivEvent.d.ts +1 -1
  170. package/Options/Classes/Interactivity/Events/DivEvent.js +1 -2
  171. package/Options/Classes/Interactivity/Events/Events.d.ts +2 -2
  172. package/Options/Classes/Interactivity/Events/HoverEvent.d.ts +3 -3
  173. package/Options/Classes/Interactivity/Events/Parallax.d.ts +1 -1
  174. package/Options/Classes/Interactivity/Interactivity.d.ts +2 -2
  175. package/Options/Classes/Interactivity/Interactivity.js +5 -6
  176. package/Options/Classes/Interactivity/Modes/Attract.d.ts +2 -2
  177. package/Options/Classes/Interactivity/Modes/Attract.js +1 -2
  178. package/Options/Classes/Interactivity/Modes/Bubble.d.ts +2 -2
  179. package/Options/Classes/Interactivity/Modes/Bubble.js +1 -1
  180. package/Options/Classes/Interactivity/Modes/BubbleBase.d.ts +1 -1
  181. package/Options/Classes/Interactivity/Modes/BubbleDiv.d.ts +1 -1
  182. package/Options/Classes/Interactivity/Modes/Connect.d.ts +2 -2
  183. package/Options/Classes/Interactivity/Modes/ConnectLinks.d.ts +1 -1
  184. package/Options/Classes/Interactivity/Modes/Grab.d.ts +2 -2
  185. package/Options/Classes/Interactivity/Modes/GrabLinks.d.ts +2 -2
  186. package/Options/Classes/Interactivity/Modes/Light.d.ts +1 -1
  187. package/Options/Classes/Interactivity/Modes/Modes.d.ts +7 -7
  188. package/Options/Classes/Interactivity/Modes/Modes.js +4 -4
  189. package/Options/Classes/Interactivity/Modes/Push.d.ts +1 -1
  190. package/Options/Classes/Interactivity/Modes/Remove.d.ts +1 -1
  191. package/Options/Classes/Interactivity/Modes/Repulse.d.ts +3 -3
  192. package/Options/Classes/Interactivity/Modes/Repulse.js +1 -1
  193. package/Options/Classes/Interactivity/Modes/RepulseBase.d.ts +2 -2
  194. package/Options/Classes/Interactivity/Modes/RepulseBase.js +1 -2
  195. package/Options/Classes/Interactivity/Modes/RepulseDiv.d.ts +1 -1
  196. package/Options/Classes/Interactivity/Modes/Slow.d.ts +1 -1
  197. package/Options/Classes/Interactivity/Modes/Trail.d.ts +2 -2
  198. package/Options/Classes/ManualParticle.d.ts +2 -2
  199. package/Options/Classes/Motion/Motion.d.ts +1 -1
  200. package/Options/Classes/Options.d.ts +7 -7
  201. package/Options/Classes/Options.js +15 -15
  202. package/Options/Classes/OptionsColor.d.ts +2 -2
  203. package/Options/Classes/Particles/Bounce/Bounce.d.ts +1 -1
  204. package/Options/Classes/Particles/Collisions/Collisions.d.ts +4 -4
  205. package/Options/Classes/Particles/Collisions/Collisions.js +1 -2
  206. package/Options/Classes/Particles/Collisions/CollisionsOverlap.d.ts +2 -2
  207. package/Options/Classes/Particles/Destroy/Destroy.d.ts +1 -1
  208. package/Options/Classes/Particles/Destroy/Destroy.js +1 -2
  209. package/Options/Classes/Particles/Destroy/Split.d.ts +3 -3
  210. package/Options/Classes/Particles/Life/Life.d.ts +1 -1
  211. package/Options/Classes/Particles/Links/Links.d.ts +2 -2
  212. package/Options/Classes/Particles/Links/LinksShadow.d.ts +2 -2
  213. package/Options/Classes/Particles/Links/LinksTriangle.d.ts +1 -1
  214. package/Options/Classes/Particles/Move/Attract.d.ts +2 -2
  215. package/Options/Classes/Particles/Move/Move.d.ts +5 -5
  216. package/Options/Classes/Particles/Move/Move.js +4 -5
  217. package/Options/Classes/Particles/Move/OutModes.d.ts +2 -2
  218. package/Options/Classes/Particles/Move/OutModes.js +1 -2
  219. package/Options/Classes/Particles/Move/Path/Path.d.ts +3 -3
  220. package/Options/Classes/Particles/Move/Spin.d.ts +3 -3
  221. package/Options/Classes/Particles/Move/Trail.d.ts +2 -2
  222. package/Options/Classes/Particles/Number/Density.d.ts +1 -1
  223. package/Options/Classes/Particles/Number/ParticlesNumber.d.ts +2 -2
  224. package/Options/Classes/Particles/Opacity/Opacity.d.ts +1 -1
  225. package/Options/Classes/Particles/Opacity/OpacityAnimation.d.ts +3 -3
  226. package/Options/Classes/Particles/Opacity/OpacityAnimation.js +2 -3
  227. package/Options/Classes/Particles/Orbit/Orbit.d.ts +5 -5
  228. package/Options/Classes/Particles/Orbit/Orbit.js +2 -2
  229. package/Options/Classes/Particles/Orbit/OrbitRotation.d.ts +1 -1
  230. package/Options/Classes/Particles/ParticlesOptions.d.ts +16 -16
  231. package/Options/Classes/Particles/ParticlesOptions.js +13 -13
  232. package/Options/Classes/Particles/Repulse/Repulse.d.ts +1 -1
  233. package/Options/Classes/Particles/Roll/Roll.d.ts +2 -2
  234. package/Options/Classes/Particles/Roll/Roll.js +1 -2
  235. package/Options/Classes/Particles/Roll/RollLight.d.ts +1 -1
  236. package/Options/Classes/Particles/Rotate/Rotate.d.ts +3 -3
  237. package/Options/Classes/Particles/Rotate/Rotate.js +1 -2
  238. package/Options/Classes/Particles/Rotate/RotateAnimation.d.ts +1 -1
  239. package/Options/Classes/Particles/Shadow.d.ts +3 -3
  240. package/Options/Classes/Particles/Shape/Shape.d.ts +5 -5
  241. package/Options/Classes/Particles/Shape/Shape.js +13 -14
  242. package/Options/Classes/Particles/Size/Size.d.ts +2 -2
  243. package/Options/Classes/Particles/Size/SizeAnimation.d.ts +3 -3
  244. package/Options/Classes/Particles/Size/SizeAnimation.js +2 -3
  245. package/Options/Classes/Particles/Stroke.d.ts +2 -2
  246. package/Options/Classes/Particles/Tilt/Tilt.d.ts +3 -3
  247. package/Options/Classes/Particles/Tilt/Tilt.js +1 -2
  248. package/Options/Classes/Particles/Tilt/TiltAnimation.d.ts +1 -1
  249. package/Options/Classes/Particles/Twinkle/Twinkle.d.ts +1 -1
  250. package/Options/Classes/Particles/Twinkle/TwinkleValues.d.ts +2 -2
  251. package/Options/Classes/Particles/Wobble/Wobble.d.ts +2 -2
  252. package/Options/Classes/Particles/ZIndex/ZIndex.d.ts +1 -1
  253. package/Options/Classes/Random.d.ts +1 -1
  254. package/Options/Classes/Responsive.d.ts +2 -2
  255. package/Options/Classes/Responsive.js +4 -5
  256. package/Options/Classes/Theme/Theme.d.ts +2 -2
  257. package/Options/Classes/Theme/Theme.js +1 -1
  258. package/Options/Classes/Theme/ThemeDefault.d.ts +2 -2
  259. package/Options/Classes/Theme/ThemeDefault.js +1 -2
  260. package/Options/Classes/ValueWithRandom.d.ts +2 -2
  261. package/Options/Interfaces/BackgroundMask/IBackgroundMask.d.ts +1 -1
  262. package/Options/Interfaces/IAnimatableColor.d.ts +1 -1
  263. package/Options/Interfaces/IAnimatableGradient.d.ts +1 -1
  264. package/Options/Interfaces/IColorAnimation.d.ts +1 -1
  265. package/Options/Interfaces/IManualParticle.d.ts +1 -1
  266. package/Options/Interfaces/IOptions.d.ts +6 -6
  267. package/Options/Interfaces/IOptionsGradient.d.ts +2 -2
  268. package/Options/Interfaces/IResponsive.d.ts +2 -2
  269. package/Options/Interfaces/IValueWithRandom.d.ts +1 -1
  270. package/Options/Interfaces/Interactivity/Events/IEvents.d.ts +1 -1
  271. package/Options/Interfaces/Interactivity/IInteractivity.d.ts +1 -1
  272. package/Options/Interfaces/Interactivity/Modes/IBubble.d.ts +2 -2
  273. package/Options/Interfaces/Interactivity/Modes/IBubbleBase.d.ts +1 -1
  274. package/Options/Interfaces/Interactivity/Modes/IModes.d.ts +2 -2
  275. package/Options/Interfaces/Interactivity/Modes/IRepulse.d.ts +2 -2
  276. package/Options/Interfaces/Interactivity/Modes/IRepulseDiv.d.ts +1 -1
  277. package/Options/Interfaces/Particles/Destroy/ISplit.d.ts +1 -1
  278. package/Options/Interfaces/Particles/IParticles.d.ts +14 -14
  279. package/Options/Interfaces/Particles/IShadow.d.ts +1 -1
  280. package/Options/Interfaces/Particles/IStroke.d.ts +1 -1
  281. package/Options/Interfaces/Particles/Links/ILinks.d.ts +1 -1
  282. package/Options/Interfaces/Particles/Move/IMove.d.ts +5 -5
  283. package/Options/Interfaces/Particles/Move/Path/{iPath.d.ts → IPath.d.ts} +0 -0
  284. package/Options/Interfaces/Particles/Move/Path/{iPath.js → IPath.js} +0 -0
  285. package/Options/Interfaces/Particles/Orbit/IOrbit.d.ts +3 -3
  286. package/Options/Interfaces/Particles/Roll/IRoll.d.ts +1 -1
  287. package/Options/Interfaces/Particles/Rotate/IRotate.d.ts +1 -1
  288. package/Options/Interfaces/Particles/Shape/IShape.d.ts +3 -3
  289. package/Options/Interfaces/Particles/Tilt/ITilt.d.ts +1 -1
  290. package/Options/Interfaces/Theme/ITheme.d.ts +2 -2
  291. package/Plugins/Absorbers/AbsorberContainer.d.ts +1 -1
  292. package/Plugins/Absorbers/AbsorberInstance.d.ts +6 -7
  293. package/Plugins/Absorbers/AbsorberInstance.js +27 -28
  294. package/Plugins/Absorbers/Absorbers.d.ts +4 -7
  295. package/Plugins/Absorbers/Absorbers.js +2 -3
  296. package/Plugins/Absorbers/Enums/AbsorberClickMode.d.ts +1 -1
  297. package/Plugins/Absorbers/Enums/AbsorberClickMode.js +0 -5
  298. package/Plugins/Absorbers/Options/Classes/Absorber.d.ts +4 -4
  299. package/Plugins/Absorbers/Options/Classes/AbsorberSize.d.ts +2 -2
  300. package/Plugins/Absorbers/Options/Classes/AbsorberSize.js +1 -1
  301. package/Plugins/Absorbers/Options/Classes/AbsorberSizeLimit.d.ts +2 -2
  302. package/Plugins/Absorbers/Options/Interfaces/IAbsorber.d.ts +1 -2
  303. package/Plugins/Absorbers/Options/Interfaces/IAbsorberOptions.d.ts +1 -1
  304. package/Plugins/Absorbers/Options/Interfaces/IAbsorberSize.d.ts +1 -1
  305. package/Plugins/Absorbers/index.d.ts +2 -0
  306. package/Plugins/Absorbers/{plugin.js → index.js} +6 -7
  307. package/Plugins/Emitters/EmitterContainer.d.ts +2 -1
  308. package/Plugins/Emitters/EmitterInstance.d.ts +6 -5
  309. package/Plugins/Emitters/EmitterInstance.js +37 -39
  310. package/Plugins/Emitters/Emitters.d.ts +4 -5
  311. package/Plugins/Emitters/Emitters.js +12 -5
  312. package/Plugins/Emitters/EmittersMain.d.ts +2 -2
  313. package/Plugins/Emitters/Enums/EmitterClickMode.d.ts +1 -1
  314. package/Plugins/Emitters/Enums/EmitterClickMode.js +0 -5
  315. package/Plugins/Emitters/Enums/EmitterShapeType.d.ts +1 -1
  316. package/Plugins/Emitters/Enums/EmitterShapeType.js +0 -6
  317. package/Plugins/Emitters/IEmitterShape.d.ts +1 -1
  318. package/Plugins/Emitters/Options/Classes/Emitter.d.ts +7 -7
  319. package/Plugins/Emitters/Options/Classes/Emitter.js +4 -5
  320. package/Plugins/Emitters/Options/Classes/EmitterLife.d.ts +1 -1
  321. package/Plugins/Emitters/Options/Classes/EmitterRate.d.ts +1 -1
  322. package/Plugins/Emitters/Options/Classes/EmitterSize.d.ts +1 -1
  323. package/Plugins/Emitters/Options/Classes/EmitterSize.js +1 -2
  324. package/Plugins/Emitters/Options/Interfaces/IEmitter.d.ts +6 -6
  325. package/Plugins/Emitters/Options/Interfaces/IEmitterOptions.d.ts +1 -1
  326. package/Plugins/Emitters/Options/Interfaces/IEmitterSize.d.ts +1 -1
  327. package/Plugins/Emitters/Shapes/Circle/CircleShape.d.ts +1 -1
  328. package/Plugins/Emitters/Shapes/Square/SquareShape.d.ts +1 -1
  329. package/Plugins/Emitters/index.d.ts +3 -0
  330. package/Plugins/Emitters/{plugin.js → index.js} +10 -11
  331. package/Plugins/PolygonMask/Enums/PolygonMaskInlineArrangement.d.ts +8 -0
  332. package/Plugins/PolygonMask/{Options/Interfaces/IDraw.js → Enums/PolygonMaskInlineArrangement.js} +0 -0
  333. package/Plugins/PolygonMask/Enums/PolygonMaskMoveType.d.ts +4 -0
  334. package/Plugins/PolygonMask/{Options/Interfaces/IDrawStroke.js → Enums/PolygonMaskMoveType.js} +0 -0
  335. package/{esm/Plugins/PolygonMask/Enums/Type.d.ts → Plugins/PolygonMask/Enums/PolygonMaskType.d.ts} +1 -1
  336. package/Plugins/PolygonMask/{Options/Interfaces/IInline.js → Enums/PolygonMaskType.js} +0 -0
  337. package/Plugins/PolygonMask/Enums/index.d.ts +3 -3
  338. package/Plugins/PolygonMask/Enums/index.js +3 -3
  339. package/Plugins/PolygonMask/Options/Classes/PolygonMask.d.ts +14 -14
  340. package/Plugins/PolygonMask/Options/Classes/PolygonMask.js +42 -42
  341. package/Plugins/PolygonMask/Options/Classes/{Draw.d.ts → PolygonMaskDraw.d.ts} +7 -7
  342. package/Plugins/PolygonMask/Options/Classes/{Draw.js → PolygonMaskDraw.js} +15 -14
  343. package/Plugins/PolygonMask/Options/Classes/{DrawStroke.d.ts → PolygonMaskDrawStroke.d.ts} +5 -5
  344. package/Plugins/PolygonMask/Options/Classes/PolygonMaskDrawStroke.js +29 -0
  345. package/Plugins/PolygonMask/Options/Classes/PolygonMaskInline.d.ts +9 -0
  346. package/Plugins/PolygonMask/Options/Classes/PolygonMaskInline.js +17 -0
  347. package/Plugins/PolygonMask/Options/Classes/PolygonMaskLocalSvg.d.ts +11 -0
  348. package/Plugins/PolygonMask/Options/Classes/PolygonMaskLocalSvg.js +29 -0
  349. package/Plugins/PolygonMask/Options/Classes/PolygonMaskMove.d.ts +10 -0
  350. package/Plugins/PolygonMask/Options/Classes/PolygonMaskMove.js +21 -0
  351. package/Plugins/PolygonMask/Options/Interfaces/IPolygonMask.d.ts +12 -13
  352. package/Plugins/PolygonMask/Options/Interfaces/IPolygonMaskDraw.d.ts +8 -0
  353. package/Plugins/PolygonMask/Options/Interfaces/{ILocalSvg.js → IPolygonMaskDraw.js} +0 -0
  354. package/Plugins/PolygonMask/Options/Interfaces/IPolygonMaskDrawStroke.d.ts +6 -0
  355. package/Plugins/PolygonMask/Options/Interfaces/{IMove.js → IPolygonMaskDrawStroke.js} +0 -0
  356. package/Plugins/PolygonMask/Options/Interfaces/IPolygonMaskInline.d.ts +4 -0
  357. package/Plugins/PolygonMask/{types.js → Options/Interfaces/IPolygonMaskInline.js} +0 -0
  358. package/Plugins/PolygonMask/Options/Interfaces/{ILocalSvg.d.ts → IPolygonMaskLocalSvg.d.ts} +2 -2
  359. package/Plugins/PolygonMask/Options/Interfaces/IPolygonMaskLocalSvg.js +2 -0
  360. package/Plugins/PolygonMask/Options/Interfaces/IPolygonMaskMove.d.ts +5 -0
  361. package/Plugins/PolygonMask/Options/Interfaces/IPolygonMaskMove.js +2 -0
  362. package/Plugins/PolygonMask/PolygonMaskInstance.d.ts +4 -6
  363. package/Plugins/PolygonMask/PolygonMaskInstance.js +39 -36
  364. package/Plugins/PolygonMask/{types.d.ts → Types.d.ts} +1 -1
  365. package/Plugins/PolygonMask/Types.js +2 -0
  366. package/{esm/Plugins/PolygonMask/utils.d.ts → Plugins/PolygonMask/Utils.d.ts} +5 -5
  367. package/Plugins/PolygonMask/{utils.js → Utils.js} +15 -12
  368. package/Plugins/PolygonMask/index.d.ts +2 -0
  369. package/Plugins/PolygonMask/{plugin.js → index.js} +7 -8
  370. package/Plugins/PolygonMask/pathseg.js +54 -43
  371. package/README.md +161 -17
  372. package/Shapes/Circle/CircleDrawer.d.ts +1 -1
  373. package/Shapes/Circle/index.d.ts +2 -2
  374. package/Shapes/Circle/index.js +2 -2
  375. package/Shapes/Image/ImageDrawer.d.ts +3 -7
  376. package/Shapes/Image/ImageDrawer.js +29 -109
  377. package/Shapes/Image/Utils.d.ts +8 -5
  378. package/Shapes/Image/Utils.js +69 -38
  379. package/Shapes/Image/index.d.ts +2 -2
  380. package/Shapes/Image/index.js +3 -3
  381. package/Shapes/Line/LineDrawer.d.ts +1 -1
  382. package/Shapes/Line/index.d.ts +2 -2
  383. package/Shapes/Line/index.js +2 -2
  384. package/Shapes/Polygon/PolygonDrawer.d.ts +1 -1
  385. package/Shapes/Polygon/PolygonDrawerBase.d.ts +1 -1
  386. package/Shapes/Polygon/TriangleDrawer.d.ts +1 -1
  387. package/Shapes/Polygon/index.d.ts +4 -4
  388. package/Shapes/Polygon/index.js +7 -7
  389. package/Shapes/Square/SquareDrawer.d.ts +1 -1
  390. package/Shapes/Square/index.d.ts +2 -2
  391. package/Shapes/Square/index.js +3 -3
  392. package/Shapes/Star/StarDrawer.d.ts +1 -1
  393. package/Shapes/Star/index.d.ts +2 -2
  394. package/Shapes/Star/index.js +2 -2
  395. package/Shapes/Text/TextDrawer.d.ts +1 -2
  396. package/Shapes/Text/index.d.ts +2 -2
  397. package/Shapes/Text/index.js +2 -2
  398. package/Types/ShapeData.d.ts +1 -1
  399. package/Types/ShapeDrawerFunctions.d.ts +1 -1
  400. package/Updaters/Angle/AngleUpdater.d.ts +1 -3
  401. package/Updaters/Angle/AngleUpdater.js +8 -9
  402. package/Updaters/Angle/index.d.ts +2 -2
  403. package/Updaters/Angle/index.js +2 -2
  404. package/Updaters/Color/ColorUpdater.d.ts +1 -3
  405. package/Updaters/Color/ColorUpdater.js +3 -4
  406. package/Updaters/Color/index.d.ts +2 -2
  407. package/Updaters/Color/index.js +2 -2
  408. package/Updaters/Life/LifeUpdater.d.ts +1 -3
  409. package/Updaters/Life/index.d.ts +2 -2
  410. package/Updaters/Life/index.js +2 -2
  411. package/Updaters/Opacity/OpacityUpdater.d.ts +1 -3
  412. package/Updaters/Opacity/OpacityUpdater.js +13 -14
  413. package/Updaters/Opacity/index.d.ts +2 -2
  414. package/Updaters/Opacity/index.js +2 -2
  415. package/Updaters/OutModes/IBounceData.d.ts +1 -2
  416. package/Updaters/OutModes/OutOfCanvasUpdater.d.ts +1 -3
  417. package/Updaters/OutModes/OutOfCanvasUpdater.js +28 -29
  418. package/Updaters/OutModes/Utils.js +12 -13
  419. package/Updaters/OutModes/index.d.ts +2 -2
  420. package/Updaters/OutModes/index.js +2 -2
  421. package/Updaters/Roll/RollUpdater.d.ts +1 -2
  422. package/Updaters/Roll/RollUpdater.js +4 -5
  423. package/Updaters/Roll/index.d.ts +2 -2
  424. package/Updaters/Roll/index.js +2 -2
  425. package/Updaters/Size/SizeUpdater.d.ts +1 -2
  426. package/Updaters/Size/SizeUpdater.js +6 -7
  427. package/Updaters/Size/index.d.ts +2 -2
  428. package/Updaters/Size/index.js +2 -2
  429. package/Updaters/StrokeColor/StrokeColorUpdater.d.ts +1 -3
  430. package/Updaters/StrokeColor/StrokeColorUpdater.js +3 -4
  431. package/Updaters/StrokeColor/index.d.ts +2 -2
  432. package/Updaters/StrokeColor/index.js +2 -2
  433. package/Updaters/Tilt/TiltUpdater.d.ts +1 -3
  434. package/Updaters/Tilt/TiltUpdater.js +8 -9
  435. package/Updaters/Tilt/index.d.ts +2 -2
  436. package/Updaters/Tilt/index.js +2 -2
  437. package/Updaters/Wobble/WobbleUpdater.d.ts +1 -3
  438. package/Updaters/Wobble/index.d.ts +2 -2
  439. package/Updaters/Wobble/index.js +2 -2
  440. package/Utils/CanvasUtils.d.ts +3 -4
  441. package/Utils/CanvasUtils.js +5 -6
  442. package/Utils/ColorUtils.d.ts +1 -1
  443. package/Utils/ColorUtils.js +8 -9
  444. package/Utils/NumberUtils.d.ts +3 -3
  445. package/Utils/NumberUtils.js +20 -21
  446. package/Utils/Utils.d.ts +3 -3
  447. package/Utils/Utils.js +6 -7
  448. package/Utils/index.d.ts +0 -9
  449. package/Utils/index.js +0 -9
  450. package/browser/Core/Canvas.d.ts +1 -1
  451. package/browser/Core/Canvas.js +9 -9
  452. package/browser/Core/Container.d.ts +5 -6
  453. package/browser/Core/Container.js +6 -7
  454. package/browser/Core/Interfaces/Gradients.d.ts +2 -2
  455. package/browser/Core/Interfaces/ICircleBouncer.d.ts +1 -1
  456. package/browser/Core/Interfaces/IContainerPlugin.d.ts +4 -4
  457. package/browser/Core/Interfaces/IExternalInteractor.d.ts +1 -1
  458. package/browser/Core/Interfaces/IInteractor.d.ts +1 -1
  459. package/browser/Core/Interfaces/IMovePathGenerator.d.ts +1 -1
  460. package/browser/Core/Interfaces/IParticle.d.ts +8 -8
  461. package/browser/Core/Interfaces/IParticleGradientAnimation.d.ts +1 -1
  462. package/browser/Core/Interfaces/IParticleSpin.d.ts +1 -1
  463. package/browser/Core/Interfaces/IParticlesInteractor.d.ts +2 -2
  464. package/browser/Core/Interfaces/IPlugin.d.ts +1 -1
  465. package/browser/Core/Interfaces/index.d.ts +3 -1
  466. package/browser/Core/Interfaces/index.js +3 -1
  467. package/browser/Core/Loader.d.ts +1 -1
  468. package/browser/Core/Loader.js +2 -1
  469. package/browser/Core/Particle.d.ts +3 -6
  470. package/browser/Core/Particle.js +13 -15
  471. package/browser/Core/Particles.d.ts +3 -3
  472. package/browser/Core/Particles.js +8 -14
  473. package/browser/{Utils → Core/Utils}/Circle.d.ts +1 -1
  474. package/browser/{Utils → Core/Utils}/Circle.js +1 -1
  475. package/browser/{Utils → Core/Utils}/CircleWarp.d.ts +2 -3
  476. package/browser/{Utils → Core/Utils}/CircleWarp.js +1 -1
  477. package/browser/{Utils → Core/Utils}/Constants.d.ts +0 -0
  478. package/browser/{Utils → Core/Utils}/Constants.js +0 -0
  479. package/browser/{Utils → Core/Utils}/EventListeners.d.ts +1 -1
  480. package/browser/{Utils → Core/Utils}/EventListeners.js +10 -11
  481. package/{esm/Core → browser/Core/Utils}/ExternalInteractorBase.d.ts +4 -4
  482. package/{esm/Core → browser/Core/Utils}/ExternalInteractorBase.js +1 -2
  483. package/browser/Core/{FrameManager.d.ts → Utils/FrameManager.d.ts} +1 -1
  484. package/browser/Core/{FrameManager.js → Utils/FrameManager.js} +0 -0
  485. package/browser/Core/{InteractionManager.d.ts → Utils/InteractionManager.d.ts} +5 -5
  486. package/browser/Core/{InteractionManager.js → Utils/InteractionManager.js} +4 -3
  487. package/{Core → browser/Core/Utils}/ParticlesInteractorBase.d.ts +4 -4
  488. package/{esm/Core → browser/Core/Utils}/ParticlesInteractorBase.js +1 -2
  489. package/browser/Core/{Particle/Mover.d.ts → Utils/ParticlesMover.d.ts} +2 -2
  490. package/browser/Core/{Particle/Mover.js → Utils/ParticlesMover.js} +4 -5
  491. package/browser/{Utils → Core/Utils}/Plugins.d.ts +5 -5
  492. package/browser/{Utils → Core/Utils}/Plugins.js +0 -0
  493. package/browser/{Utils → Core/Utils}/Point.d.ts +2 -2
  494. package/browser/{Utils → Core/Utils}/Point.js +0 -0
  495. package/browser/{Utils → Core/Utils}/QuadTree.d.ts +4 -4
  496. package/browser/{Utils → Core/Utils}/QuadTree.js +2 -2
  497. package/browser/{Utils → Core/Utils}/Range.d.ts +1 -1
  498. package/browser/{Utils → Core/Utils}/Range.js +0 -0
  499. package/browser/{Utils → Core/Utils}/Rectangle.d.ts +1 -2
  500. package/browser/{Utils → Core/Utils}/Rectangle.js +0 -0
  501. package/browser/Core/{Particle → Utils}/Vector.d.ts +0 -0
  502. package/browser/Core/{Particle → Utils}/Vector.js +0 -0
  503. package/{Core/Particle → browser/Core/Utils}/Vector3d.d.ts +1 -1
  504. package/browser/Core/{Particle → Utils}/Vector3d.js +0 -0
  505. package/browser/Core/Utils/index.d.ts +16 -0
  506. package/browser/Core/Utils/index.js +16 -0
  507. package/browser/Core/index.d.ts +8 -0
  508. package/browser/Core/index.js +8 -0
  509. package/browser/Enums/AnimationStatus.d.ts +1 -1
  510. package/browser/Enums/AnimationStatus.js +1 -5
  511. package/browser/Enums/Directions/MoveDirection.d.ts +1 -1
  512. package/browser/Enums/Directions/MoveDirection.js +1 -15
  513. package/browser/Enums/Directions/OutModeDirection.d.ts +1 -1
  514. package/browser/Enums/Directions/OutModeDirection.js +1 -7
  515. package/browser/Enums/Directions/RotateDirection.d.ts +1 -1
  516. package/browser/Enums/Directions/RotateDirection.js +1 -9
  517. package/browser/Enums/Directions/TiltDirection.d.ts +1 -1
  518. package/browser/Enums/Directions/TiltDirection.js +1 -9
  519. package/browser/Enums/InteractivityDetect.d.ts +1 -1
  520. package/browser/Enums/InteractivityDetect.js +1 -9
  521. package/browser/Enums/Modes/ClickMode.d.ts +1 -1
  522. package/browser/Enums/Modes/ClickMode.js +1 -13
  523. package/browser/Enums/Modes/CollisionMode.d.ts +1 -1
  524. package/browser/Enums/Modes/CollisionMode.js +1 -9
  525. package/browser/Enums/Modes/DestroyMode.d.ts +1 -1
  526. package/browser/Enums/Modes/DestroyMode.js +1 -5
  527. package/browser/Enums/Modes/DivMode.d.ts +1 -1
  528. package/browser/Enums/Modes/DivMode.js +1 -9
  529. package/browser/Enums/Modes/HoverMode.d.ts +1 -1
  530. package/browser/Enums/Modes/HoverMode.js +1 -15
  531. package/browser/Enums/Modes/OutMode.d.ts +1 -1
  532. package/browser/Enums/Modes/OutMode.js +1 -13
  533. package/browser/Enums/Modes/ResponsiveMode.d.ts +1 -1
  534. package/browser/Enums/Modes/ResponsiveMode.js +1 -5
  535. package/browser/Enums/Modes/RollMode.d.ts +1 -1
  536. package/browser/Enums/Modes/RollMode.js +1 -6
  537. package/browser/Enums/Modes/SizeMode.d.ts +1 -1
  538. package/browser/Enums/Modes/SizeMode.js +1 -8
  539. package/browser/Enums/Modes/ThemeMode.d.ts +1 -1
  540. package/browser/Enums/Modes/ThemeMode.js +1 -6
  541. package/browser/Enums/Types/AlterType.d.ts +1 -1
  542. package/browser/Enums/Types/AlterType.js +1 -5
  543. package/browser/Enums/Types/DestroyType.d.ts +1 -1
  544. package/browser/Enums/Types/DestroyType.js +1 -9
  545. package/browser/Enums/Types/DivType.d.ts +1 -1
  546. package/browser/Enums/Types/DivType.js +1 -8
  547. package/browser/Enums/Types/EasingType.d.ts +1 -1
  548. package/browser/Enums/Types/EasingType.js +1 -11
  549. package/browser/Enums/Types/GradientType.d.ts +1 -1
  550. package/browser/Enums/Types/GradientType.js +1 -6
  551. package/browser/Enums/Types/InteractorType.d.ts +1 -1
  552. package/browser/Enums/Types/InteractorType.js +1 -5
  553. package/browser/Enums/Types/OrbitType.d.ts +1 -1
  554. package/browser/Enums/Types/OrbitType.js +1 -8
  555. package/browser/Enums/Types/ShapeType.d.ts +1 -1
  556. package/browser/Enums/Types/ShapeType.js +1 -17
  557. package/browser/Enums/Types/StartValueType.d.ts +1 -1
  558. package/browser/Enums/Types/StartValueType.js +1 -9
  559. package/browser/Interactions/External/Attract/Attractor.d.ts +2 -2
  560. package/browser/Interactions/External/Attract/Attractor.js +5 -7
  561. package/browser/Interactions/External/Attract/index.d.ts +2 -2
  562. package/browser/Interactions/External/Attract/index.js +2 -2
  563. package/browser/Interactions/External/Bounce/Bouncer.d.ts +2 -2
  564. package/browser/Interactions/External/Bounce/Bouncer.js +7 -9
  565. package/browser/Interactions/External/Bounce/index.d.ts +2 -2
  566. package/browser/Interactions/External/Bounce/index.js +2 -2
  567. package/browser/Interactions/External/Bubble/Bubbler.d.ts +3 -3
  568. package/browser/Interactions/External/Bubble/Bubbler.js +16 -18
  569. package/browser/Interactions/External/Bubble/ProcessBubbleType.d.ts +1 -1
  570. package/browser/Interactions/External/Bubble/ProcessBubbleType.js +1 -9
  571. package/browser/Interactions/External/Bubble/index.d.ts +2 -2
  572. package/browser/Interactions/External/Bubble/index.js +2 -2
  573. package/browser/Interactions/External/Connect/Connector.d.ts +2 -2
  574. package/browser/Interactions/External/Connect/Connector.js +2 -3
  575. package/browser/Interactions/External/Connect/index.d.ts +2 -2
  576. package/browser/Interactions/External/Connect/index.js +2 -2
  577. package/browser/Interactions/External/Grab/Grabber.d.ts +2 -2
  578. package/browser/Interactions/External/Grab/Grabber.js +3 -4
  579. package/browser/Interactions/External/Grab/index.d.ts +2 -2
  580. package/browser/Interactions/External/Grab/index.js +2 -2
  581. package/browser/Interactions/External/Repulse/Repulser.d.ts +2 -2
  582. package/browser/Interactions/External/Repulse/Repulser.js +8 -10
  583. package/browser/Interactions/External/Repulse/index.d.ts +2 -2
  584. package/browser/Interactions/External/Repulse/index.js +2 -2
  585. package/browser/Interactions/External/Trail/TrailMaker.d.ts +2 -3
  586. package/browser/Interactions/External/Trail/TrailMaker.js +3 -4
  587. package/browser/Interactions/External/Trail/index.d.ts +2 -2
  588. package/browser/Interactions/External/Trail/index.js +2 -2
  589. package/browser/Interactions/Particles/Attract/Attractor.d.ts +2 -4
  590. package/browser/Interactions/Particles/Attract/Attractor.js +1 -1
  591. package/browser/Interactions/Particles/Attract/index.d.ts +2 -2
  592. package/browser/Interactions/Particles/Attract/index.js +2 -2
  593. package/browser/Interactions/Particles/Collisions/Collider.d.ts +2 -3
  594. package/browser/Interactions/Particles/Collisions/Collider.js +4 -5
  595. package/browser/Interactions/Particles/Collisions/index.d.ts +2 -2
  596. package/browser/Interactions/Particles/Collisions/index.js +2 -2
  597. package/browser/Interactions/Particles/Links/LinkInstance.d.ts +1 -3
  598. package/browser/Interactions/Particles/Links/LinkParticle.d.ts +1 -1
  599. package/browser/Interactions/Particles/Links/Linker.d.ts +3 -4
  600. package/browser/Interactions/Particles/Links/Linker.js +2 -2
  601. package/browser/Interactions/Particles/Links/index.d.ts +2 -3
  602. package/browser/Interactions/Particles/Links/index.js +4 -7
  603. package/browser/Interactions/Particles/Links/interaction.d.ts +2 -0
  604. package/browser/Interactions/Particles/Links/interaction.js +4 -0
  605. package/browser/Interactions/Particles/Links/plugin.d.ts +2 -2
  606. package/browser/Interactions/Particles/Links/plugin.js +4 -4
  607. package/browser/Options/Classes/AnimatableColor.d.ts +3 -3
  608. package/browser/Options/Classes/AnimatableColor.js +1 -1
  609. package/browser/Options/Classes/AnimatableGradient.d.ts +6 -6
  610. package/browser/Options/Classes/AnimatableGradient.js +3 -4
  611. package/browser/Options/Classes/AnimationOptions.d.ts +2 -2
  612. package/browser/Options/Classes/Background/Background.d.ts +2 -2
  613. package/browser/Options/Classes/BackgroundMask/BackgroundMask.d.ts +2 -2
  614. package/browser/Options/Classes/BackgroundMask/BackgroundMaskCover.d.ts +2 -2
  615. package/browser/Options/Classes/ColorAnimation.d.ts +1 -1
  616. package/browser/Options/Classes/HslAnimation.d.ts +2 -2
  617. package/browser/Options/Classes/Interactivity/Events/ClickEvent.d.ts +2 -2
  618. package/browser/Options/Classes/Interactivity/Events/DivEvent.d.ts +1 -1
  619. package/browser/Options/Classes/Interactivity/Events/DivEvent.js +1 -2
  620. package/browser/Options/Classes/Interactivity/Events/Events.d.ts +2 -2
  621. package/browser/Options/Classes/Interactivity/Events/HoverEvent.d.ts +3 -3
  622. package/browser/Options/Classes/Interactivity/Events/Parallax.d.ts +1 -1
  623. package/browser/Options/Classes/Interactivity/Interactivity.d.ts +2 -2
  624. package/browser/Options/Classes/Interactivity/Interactivity.js +5 -6
  625. package/browser/Options/Classes/Interactivity/Modes/Attract.d.ts +2 -2
  626. package/browser/Options/Classes/Interactivity/Modes/Attract.js +1 -2
  627. package/browser/Options/Classes/Interactivity/Modes/Bubble.d.ts +2 -2
  628. package/browser/Options/Classes/Interactivity/Modes/Bubble.js +1 -1
  629. package/browser/Options/Classes/Interactivity/Modes/BubbleBase.d.ts +1 -1
  630. package/browser/Options/Classes/Interactivity/Modes/BubbleDiv.d.ts +1 -1
  631. package/browser/Options/Classes/Interactivity/Modes/Connect.d.ts +2 -2
  632. package/browser/Options/Classes/Interactivity/Modes/ConnectLinks.d.ts +1 -1
  633. package/browser/Options/Classes/Interactivity/Modes/Grab.d.ts +2 -2
  634. package/browser/Options/Classes/Interactivity/Modes/GrabLinks.d.ts +2 -2
  635. package/browser/Options/Classes/Interactivity/Modes/Light.d.ts +1 -1
  636. package/browser/Options/Classes/Interactivity/Modes/Modes.d.ts +7 -7
  637. package/browser/Options/Classes/Interactivity/Modes/Modes.js +4 -4
  638. package/browser/Options/Classes/Interactivity/Modes/Push.d.ts +1 -1
  639. package/browser/Options/Classes/Interactivity/Modes/Remove.d.ts +1 -1
  640. package/browser/Options/Classes/Interactivity/Modes/Repulse.d.ts +3 -3
  641. package/browser/Options/Classes/Interactivity/Modes/Repulse.js +1 -1
  642. package/browser/Options/Classes/Interactivity/Modes/RepulseBase.d.ts +2 -2
  643. package/browser/Options/Classes/Interactivity/Modes/RepulseBase.js +1 -2
  644. package/browser/Options/Classes/Interactivity/Modes/RepulseDiv.d.ts +1 -1
  645. package/browser/Options/Classes/Interactivity/Modes/Slow.d.ts +1 -1
  646. package/browser/Options/Classes/Interactivity/Modes/Trail.d.ts +2 -2
  647. package/browser/Options/Classes/ManualParticle.d.ts +2 -2
  648. package/browser/Options/Classes/Motion/Motion.d.ts +1 -1
  649. package/browser/Options/Classes/Options.d.ts +7 -7
  650. package/browser/Options/Classes/Options.js +13 -13
  651. package/browser/Options/Classes/OptionsColor.d.ts +2 -2
  652. package/browser/Options/Classes/Particles/Bounce/Bounce.d.ts +1 -1
  653. package/browser/Options/Classes/Particles/Collisions/Collisions.d.ts +4 -4
  654. package/browser/Options/Classes/Particles/Collisions/Collisions.js +1 -2
  655. package/browser/Options/Classes/Particles/Collisions/CollisionsOverlap.d.ts +2 -2
  656. package/browser/Options/Classes/Particles/Destroy/Destroy.d.ts +1 -1
  657. package/browser/Options/Classes/Particles/Destroy/Destroy.js +1 -2
  658. package/browser/Options/Classes/Particles/Destroy/Split.d.ts +3 -3
  659. package/browser/Options/Classes/Particles/Life/Life.d.ts +1 -1
  660. package/browser/Options/Classes/Particles/Links/Links.d.ts +2 -2
  661. package/browser/Options/Classes/Particles/Links/LinksShadow.d.ts +2 -2
  662. package/browser/Options/Classes/Particles/Links/LinksTriangle.d.ts +1 -1
  663. package/browser/Options/Classes/Particles/Move/Attract.d.ts +2 -2
  664. package/browser/Options/Classes/Particles/Move/Move.d.ts +5 -5
  665. package/browser/Options/Classes/Particles/Move/Move.js +4 -5
  666. package/browser/Options/Classes/Particles/Move/OutModes.d.ts +2 -2
  667. package/browser/Options/Classes/Particles/Move/OutModes.js +1 -2
  668. package/browser/Options/Classes/Particles/Move/Path/Path.d.ts +3 -3
  669. package/browser/Options/Classes/Particles/Move/Spin.d.ts +3 -3
  670. package/browser/Options/Classes/Particles/Move/Trail.d.ts +2 -2
  671. package/browser/Options/Classes/Particles/Number/Density.d.ts +1 -1
  672. package/browser/Options/Classes/Particles/Number/ParticlesNumber.d.ts +2 -2
  673. package/browser/Options/Classes/Particles/Opacity/Opacity.d.ts +1 -1
  674. package/browser/Options/Classes/Particles/Opacity/OpacityAnimation.d.ts +3 -3
  675. package/browser/Options/Classes/Particles/Opacity/OpacityAnimation.js +2 -3
  676. package/browser/Options/Classes/Particles/Orbit/Orbit.d.ts +5 -5
  677. package/browser/Options/Classes/Particles/Orbit/Orbit.js +2 -2
  678. package/browser/Options/Classes/Particles/Orbit/OrbitRotation.d.ts +1 -1
  679. package/browser/Options/Classes/Particles/ParticlesOptions.d.ts +16 -16
  680. package/browser/Options/Classes/Particles/ParticlesOptions.js +13 -13
  681. package/browser/Options/Classes/Particles/Repulse/Repulse.d.ts +1 -1
  682. package/browser/Options/Classes/Particles/Roll/Roll.d.ts +2 -2
  683. package/browser/Options/Classes/Particles/Roll/Roll.js +1 -2
  684. package/browser/Options/Classes/Particles/Roll/RollLight.d.ts +1 -1
  685. package/browser/Options/Classes/Particles/Rotate/Rotate.d.ts +3 -3
  686. package/browser/Options/Classes/Particles/Rotate/Rotate.js +1 -2
  687. package/browser/Options/Classes/Particles/Rotate/RotateAnimation.d.ts +1 -1
  688. package/browser/Options/Classes/Particles/Shadow.d.ts +3 -3
  689. package/browser/Options/Classes/Particles/Shape/Shape.d.ts +5 -5
  690. package/browser/Options/Classes/Particles/Shape/Shape.js +13 -14
  691. package/browser/Options/Classes/Particles/Size/Size.d.ts +2 -2
  692. package/browser/Options/Classes/Particles/Size/SizeAnimation.d.ts +3 -3
  693. package/browser/Options/Classes/Particles/Size/SizeAnimation.js +2 -3
  694. package/browser/Options/Classes/Particles/Stroke.d.ts +2 -2
  695. package/browser/Options/Classes/Particles/Tilt/Tilt.d.ts +3 -3
  696. package/browser/Options/Classes/Particles/Tilt/Tilt.js +1 -2
  697. package/browser/Options/Classes/Particles/Tilt/TiltAnimation.d.ts +1 -1
  698. package/browser/Options/Classes/Particles/Twinkle/Twinkle.d.ts +1 -1
  699. package/browser/Options/Classes/Particles/Twinkle/TwinkleValues.d.ts +2 -2
  700. package/browser/Options/Classes/Particles/Wobble/Wobble.d.ts +2 -2
  701. package/browser/Options/Classes/Particles/ZIndex/ZIndex.d.ts +1 -1
  702. package/browser/Options/Classes/Random.d.ts +1 -1
  703. package/browser/Options/Classes/Responsive.d.ts +2 -2
  704. package/browser/Options/Classes/Responsive.js +4 -5
  705. package/browser/Options/Classes/Theme/Theme.d.ts +2 -2
  706. package/browser/Options/Classes/Theme/Theme.js +1 -1
  707. package/browser/Options/Classes/Theme/ThemeDefault.d.ts +2 -2
  708. package/browser/Options/Classes/Theme/ThemeDefault.js +1 -2
  709. package/browser/Options/Classes/ValueWithRandom.d.ts +2 -2
  710. package/browser/Options/Interfaces/BackgroundMask/IBackgroundMask.d.ts +1 -1
  711. package/browser/Options/Interfaces/IAnimatableColor.d.ts +1 -1
  712. package/browser/Options/Interfaces/IAnimatableGradient.d.ts +1 -1
  713. package/browser/Options/Interfaces/IColorAnimation.d.ts +1 -1
  714. package/browser/Options/Interfaces/IColorAnimation.js +0 -4
  715. package/browser/Options/Interfaces/IManualParticle.d.ts +1 -1
  716. package/browser/Options/Interfaces/IOptions.d.ts +6 -6
  717. package/browser/Options/Interfaces/IOptionsGradient.d.ts +2 -2
  718. package/browser/Options/Interfaces/IResponsive.d.ts +2 -2
  719. package/browser/Options/Interfaces/IValueWithRandom.d.ts +1 -1
  720. package/browser/Options/Interfaces/Interactivity/Events/IEvents.d.ts +1 -1
  721. package/browser/Options/Interfaces/Interactivity/IInteractivity.d.ts +1 -1
  722. package/browser/Options/Interfaces/Interactivity/Modes/IBubble.d.ts +2 -2
  723. package/browser/Options/Interfaces/Interactivity/Modes/IBubbleBase.d.ts +1 -1
  724. package/browser/Options/Interfaces/Interactivity/Modes/IModes.d.ts +2 -2
  725. package/browser/Options/Interfaces/Interactivity/Modes/IRepulse.d.ts +2 -2
  726. package/browser/Options/Interfaces/Interactivity/Modes/IRepulseDiv.d.ts +1 -1
  727. package/browser/Options/Interfaces/Particles/Destroy/ISplit.d.ts +1 -1
  728. package/browser/Options/Interfaces/Particles/IParticles.d.ts +14 -14
  729. package/browser/Options/Interfaces/Particles/IShadow.d.ts +1 -1
  730. package/browser/Options/Interfaces/Particles/IStroke.d.ts +1 -1
  731. package/browser/Options/Interfaces/Particles/Links/ILinks.d.ts +1 -1
  732. package/browser/Options/Interfaces/Particles/Move/IMove.d.ts +5 -5
  733. package/browser/Options/Interfaces/Particles/Move/Path/{iPath.d.ts → IPath.d.ts} +0 -0
  734. package/browser/Options/Interfaces/Particles/Move/Path/{iPath.js → IPath.js} +0 -0
  735. package/browser/Options/Interfaces/Particles/Orbit/IOrbit.d.ts +3 -3
  736. package/browser/Options/Interfaces/Particles/Roll/IRoll.d.ts +1 -1
  737. package/browser/Options/Interfaces/Particles/Rotate/IRotate.d.ts +1 -1
  738. package/browser/Options/Interfaces/Particles/Shape/IShape.d.ts +3 -3
  739. package/browser/Options/Interfaces/Particles/Tilt/ITilt.d.ts +1 -1
  740. package/browser/Options/Interfaces/Theme/ITheme.d.ts +2 -2
  741. package/browser/Plugins/Absorbers/AbsorberContainer.d.ts +1 -1
  742. package/browser/Plugins/Absorbers/AbsorberInstance.d.ts +6 -7
  743. package/browser/Plugins/Absorbers/AbsorberInstance.js +22 -23
  744. package/browser/Plugins/Absorbers/Absorbers.d.ts +4 -7
  745. package/browser/Plugins/Absorbers/Absorbers.js +2 -3
  746. package/browser/Plugins/Absorbers/Enums/AbsorberClickMode.d.ts +1 -1
  747. package/browser/Plugins/Absorbers/Enums/AbsorberClickMode.js +1 -7
  748. package/browser/Plugins/Absorbers/Options/Classes/Absorber.d.ts +4 -4
  749. package/browser/Plugins/Absorbers/Options/Classes/AbsorberSize.d.ts +2 -2
  750. package/browser/Plugins/Absorbers/Options/Classes/AbsorberSize.js +1 -1
  751. package/browser/Plugins/Absorbers/Options/Classes/AbsorberSizeLimit.d.ts +2 -2
  752. package/browser/Plugins/Absorbers/Options/Interfaces/IAbsorber.d.ts +1 -2
  753. package/browser/Plugins/Absorbers/Options/Interfaces/IAbsorberOptions.d.ts +1 -1
  754. package/browser/Plugins/Absorbers/Options/Interfaces/IAbsorberSize.d.ts +1 -1
  755. package/browser/Plugins/Absorbers/index.d.ts +2 -0
  756. package/browser/Plugins/Absorbers/{plugin.js → index.js} +6 -7
  757. package/browser/Plugins/Emitters/EmitterContainer.d.ts +2 -1
  758. package/browser/Plugins/Emitters/EmitterInstance.d.ts +6 -5
  759. package/browser/Plugins/Emitters/EmitterInstance.js +37 -39
  760. package/browser/Plugins/Emitters/Emitters.d.ts +4 -5
  761. package/browser/Plugins/Emitters/Emitters.js +12 -5
  762. package/browser/Plugins/Emitters/EmittersMain.d.ts +2 -2
  763. package/browser/Plugins/Emitters/Enums/EmitterClickMode.d.ts +1 -1
  764. package/browser/Plugins/Emitters/Enums/EmitterClickMode.js +1 -7
  765. package/browser/Plugins/Emitters/Enums/EmitterShapeType.d.ts +1 -1
  766. package/browser/Plugins/Emitters/Enums/EmitterShapeType.js +1 -5
  767. package/browser/Plugins/Emitters/IEmitterShape.d.ts +1 -1
  768. package/browser/Plugins/Emitters/Options/Classes/Emitter.d.ts +7 -7
  769. package/browser/Plugins/Emitters/Options/Classes/Emitter.js +4 -5
  770. package/browser/Plugins/Emitters/Options/Classes/EmitterLife.d.ts +1 -1
  771. package/browser/Plugins/Emitters/Options/Classes/EmitterRate.d.ts +1 -1
  772. package/browser/Plugins/Emitters/Options/Classes/EmitterSize.d.ts +1 -1
  773. package/browser/Plugins/Emitters/Options/Classes/EmitterSize.js +1 -2
  774. package/browser/Plugins/Emitters/Options/Interfaces/IEmitter.d.ts +6 -6
  775. package/browser/Plugins/Emitters/Options/Interfaces/IEmitterOptions.d.ts +1 -1
  776. package/browser/Plugins/Emitters/Options/Interfaces/IEmitterSize.d.ts +1 -1
  777. package/browser/Plugins/Emitters/Shapes/Circle/CircleShape.d.ts +1 -1
  778. package/browser/Plugins/Emitters/Shapes/Square/SquareShape.d.ts +1 -1
  779. package/browser/Plugins/Emitters/index.d.ts +3 -0
  780. package/browser/Plugins/Emitters/{plugin.js → index.js} +10 -11
  781. package/browser/Plugins/PolygonMask/Enums/PolygonMaskInlineArrangement.d.ts +8 -0
  782. package/browser/Plugins/PolygonMask/{Options/Interfaces/IDraw.js → Enums/PolygonMaskInlineArrangement.js} +0 -0
  783. package/browser/Plugins/PolygonMask/Enums/PolygonMaskMoveType.d.ts +4 -0
  784. package/browser/Plugins/PolygonMask/{Options/Interfaces/IDrawStroke.js → Enums/PolygonMaskMoveType.js} +0 -0
  785. package/{Plugins/PolygonMask/Enums/Type.d.ts → browser/Plugins/PolygonMask/Enums/PolygonMaskType.d.ts} +1 -1
  786. package/browser/Plugins/PolygonMask/{Options/Interfaces/IInline.js → Enums/PolygonMaskType.js} +0 -0
  787. package/browser/Plugins/PolygonMask/Enums/index.d.ts +3 -3
  788. package/browser/Plugins/PolygonMask/Enums/index.js +3 -3
  789. package/browser/Plugins/PolygonMask/Options/Classes/PolygonMask.d.ts +14 -14
  790. package/browser/Plugins/PolygonMask/Options/Classes/PolygonMask.js +42 -42
  791. package/browser/Plugins/PolygonMask/Options/Classes/{Draw.d.ts → PolygonMaskDraw.d.ts} +7 -7
  792. package/browser/Plugins/PolygonMask/Options/Classes/{Draw.js → PolygonMaskDraw.js} +13 -12
  793. package/browser/Plugins/PolygonMask/Options/Classes/{DrawStroke.d.ts → PolygonMaskDrawStroke.d.ts} +5 -5
  794. package/browser/Plugins/PolygonMask/Options/Classes/PolygonMaskDrawStroke.js +28 -0
  795. package/browser/Plugins/PolygonMask/Options/Classes/PolygonMaskInline.d.ts +12 -0
  796. package/browser/Plugins/PolygonMask/Options/Classes/PolygonMaskInline.js +16 -0
  797. package/browser/Plugins/PolygonMask/Options/Classes/{LocalSvg.d.ts → PolygonMaskLocalSvg.d.ts} +6 -6
  798. package/browser/Plugins/PolygonMask/Options/Classes/PolygonMaskLocalSvg.js +28 -0
  799. package/browser/Plugins/PolygonMask/Options/Classes/PolygonMaskMove.d.ts +13 -0
  800. package/browser/Plugins/PolygonMask/Options/Classes/PolygonMaskMove.js +20 -0
  801. package/browser/Plugins/PolygonMask/Options/Interfaces/IPolygonMask.d.ts +12 -13
  802. package/browser/Plugins/PolygonMask/Options/Interfaces/{IDraw.d.ts → IPolygonMaskDraw.d.ts} +4 -4
  803. package/browser/Plugins/PolygonMask/Options/Interfaces/{ILocalSvg.js → IPolygonMaskDraw.js} +0 -0
  804. package/browser/Plugins/PolygonMask/Options/Interfaces/{IDrawStroke.d.ts → IPolygonMaskDrawStroke.d.ts} +2 -2
  805. package/browser/Plugins/PolygonMask/Options/Interfaces/{IMove.js → IPolygonMaskDrawStroke.js} +0 -0
  806. package/browser/Plugins/PolygonMask/Options/Interfaces/IPolygonMaskInline.d.ts +7 -0
  807. package/browser/Plugins/PolygonMask/{types.js → Options/Interfaces/IPolygonMaskInline.js} +0 -0
  808. package/browser/Plugins/PolygonMask/Options/Interfaces/{ILocalSvg.d.ts → IPolygonMaskLocalSvg.d.ts} +2 -2
  809. package/{esm/Options/Interfaces/Particles/Move/Path/iPath.js → browser/Plugins/PolygonMask/Options/Interfaces/IPolygonMaskLocalSvg.js} +0 -0
  810. package/browser/Plugins/PolygonMask/Options/Interfaces/IPolygonMaskMove.d.ts +8 -0
  811. package/{esm/Plugins/PolygonMask/Options/Interfaces/IDraw.js → browser/Plugins/PolygonMask/Options/Interfaces/IPolygonMaskMove.js} +0 -0
  812. package/browser/Plugins/PolygonMask/PolygonMaskInstance.d.ts +4 -6
  813. package/browser/Plugins/PolygonMask/PolygonMaskInstance.js +24 -21
  814. package/{esm/Plugins/PolygonMask/types.d.ts → browser/Plugins/PolygonMask/Types.d.ts} +1 -1
  815. package/{esm/Plugins/PolygonMask/Options/Interfaces/IDrawStroke.js → browser/Plugins/PolygonMask/Types.js} +0 -0
  816. package/{Plugins/PolygonMask/utils.d.ts → browser/Plugins/PolygonMask/Utils.d.ts} +5 -5
  817. package/browser/Plugins/PolygonMask/{utils.js → Utils.js} +15 -12
  818. package/browser/Plugins/PolygonMask/index.d.ts +2 -0
  819. package/browser/Plugins/PolygonMask/{plugin.js → index.js} +8 -9
  820. package/browser/Plugins/PolygonMask/pathseg.js +54 -44
  821. package/browser/Shapes/Circle/CircleDrawer.d.ts +1 -1
  822. package/browser/Shapes/Circle/index.d.ts +2 -2
  823. package/browser/Shapes/Circle/index.js +2 -2
  824. package/browser/Shapes/Image/ImageDrawer.d.ts +3 -7
  825. package/browser/Shapes/Image/ImageDrawer.js +28 -111
  826. package/browser/Shapes/Image/Utils.d.ts +8 -5
  827. package/browser/Shapes/Image/Utils.js +71 -37
  828. package/browser/Shapes/Image/index.d.ts +2 -2
  829. package/browser/Shapes/Image/index.js +3 -3
  830. package/browser/Shapes/Line/LineDrawer.d.ts +1 -1
  831. package/browser/Shapes/Line/index.d.ts +2 -2
  832. package/browser/Shapes/Line/index.js +2 -2
  833. package/browser/Shapes/Polygon/PolygonDrawer.d.ts +1 -1
  834. package/browser/Shapes/Polygon/PolygonDrawerBase.d.ts +1 -1
  835. package/browser/Shapes/Polygon/TriangleDrawer.d.ts +1 -1
  836. package/browser/Shapes/Polygon/index.d.ts +4 -4
  837. package/browser/Shapes/Polygon/index.js +7 -7
  838. package/browser/Shapes/Square/SquareDrawer.d.ts +1 -1
  839. package/browser/Shapes/Square/index.d.ts +2 -2
  840. package/browser/Shapes/Square/index.js +3 -3
  841. package/browser/Shapes/Star/StarDrawer.d.ts +1 -1
  842. package/browser/Shapes/Star/index.d.ts +2 -2
  843. package/browser/Shapes/Star/index.js +2 -2
  844. package/browser/Shapes/Text/TextDrawer.d.ts +1 -2
  845. package/browser/Shapes/Text/index.d.ts +2 -2
  846. package/browser/Shapes/Text/index.js +3 -3
  847. package/browser/Types/ShapeData.d.ts +1 -1
  848. package/browser/Types/ShapeDrawerFunctions.d.ts +1 -1
  849. package/browser/Updaters/Angle/AngleUpdater.d.ts +1 -3
  850. package/browser/Updaters/Angle/AngleUpdater.js +8 -9
  851. package/browser/Updaters/Angle/index.d.ts +2 -2
  852. package/browser/Updaters/Angle/index.js +2 -2
  853. package/browser/Updaters/Color/ColorUpdater.d.ts +1 -3
  854. package/browser/Updaters/Color/ColorUpdater.js +3 -4
  855. package/browser/Updaters/Color/index.d.ts +2 -2
  856. package/browser/Updaters/Color/index.js +2 -2
  857. package/browser/Updaters/Life/LifeUpdater.d.ts +1 -3
  858. package/browser/Updaters/Life/index.d.ts +2 -2
  859. package/browser/Updaters/Life/index.js +2 -2
  860. package/browser/Updaters/Opacity/OpacityUpdater.d.ts +1 -3
  861. package/browser/Updaters/Opacity/OpacityUpdater.js +13 -14
  862. package/browser/Updaters/Opacity/index.d.ts +2 -2
  863. package/browser/Updaters/Opacity/index.js +2 -2
  864. package/browser/Updaters/OutModes/IBounceData.d.ts +1 -2
  865. package/browser/Updaters/OutModes/OutOfCanvasUpdater.d.ts +1 -3
  866. package/browser/Updaters/OutModes/OutOfCanvasUpdater.js +20 -21
  867. package/browser/Updaters/OutModes/Utils.js +12 -13
  868. package/browser/Updaters/OutModes/index.d.ts +2 -2
  869. package/browser/Updaters/OutModes/index.js +2 -2
  870. package/browser/Updaters/Roll/RollUpdater.d.ts +1 -2
  871. package/browser/Updaters/Roll/RollUpdater.js +4 -5
  872. package/browser/Updaters/Roll/index.d.ts +2 -2
  873. package/browser/Updaters/Roll/index.js +2 -2
  874. package/browser/Updaters/Size/SizeUpdater.d.ts +1 -2
  875. package/browser/Updaters/Size/SizeUpdater.js +6 -7
  876. package/browser/Updaters/Size/index.d.ts +2 -2
  877. package/browser/Updaters/Size/index.js +2 -2
  878. package/browser/Updaters/StrokeColor/StrokeColorUpdater.d.ts +1 -3
  879. package/browser/Updaters/StrokeColor/StrokeColorUpdater.js +3 -4
  880. package/browser/Updaters/StrokeColor/index.d.ts +2 -2
  881. package/browser/Updaters/StrokeColor/index.js +2 -2
  882. package/browser/Updaters/Tilt/TiltUpdater.d.ts +1 -3
  883. package/browser/Updaters/Tilt/TiltUpdater.js +8 -9
  884. package/browser/Updaters/Tilt/index.d.ts +2 -2
  885. package/browser/Updaters/Tilt/index.js +2 -2
  886. package/browser/Updaters/Wobble/WobbleUpdater.d.ts +1 -3
  887. package/browser/Updaters/Wobble/index.d.ts +2 -2
  888. package/browser/Updaters/Wobble/index.js +2 -2
  889. package/browser/Utils/CanvasUtils.d.ts +3 -4
  890. package/browser/Utils/CanvasUtils.js +5 -6
  891. package/browser/Utils/ColorUtils.d.ts +1 -1
  892. package/browser/Utils/ColorUtils.js +3 -4
  893. package/browser/Utils/NumberUtils.d.ts +3 -3
  894. package/browser/Utils/NumberUtils.js +18 -19
  895. package/browser/Utils/Utils.d.ts +3 -3
  896. package/browser/Utils/Utils.js +6 -7
  897. package/browser/Utils/index.d.ts +0 -9
  898. package/browser/Utils/index.js +0 -9
  899. package/browser/{main.d.ts → engine.d.ts} +5 -7
  900. package/browser/{main.js → engine.js} +10 -11
  901. package/browser/full.d.ts +2 -2
  902. package/browser/full.js +14 -14
  903. package/browser/index.d.ts +7 -17
  904. package/browser/index.engine.d.ts +13 -0
  905. package/browser/index.engine.js +12 -0
  906. package/browser/index.js +5 -13
  907. package/browser/index.slim.d.ts +6 -16
  908. package/browser/index.slim.js +5 -13
  909. package/browser/pjs.d.ts +3 -3
  910. package/browser/pjs.js +6 -5
  911. package/browser/slim.d.ts +2 -2
  912. package/browser/slim.js +40 -40
  913. package/{esm/main.d.ts → engine.d.ts} +3 -5
  914. package/{main.js → engine.js} +24 -25
  915. package/esm/Core/Canvas.d.ts +1 -1
  916. package/esm/Core/Canvas.js +9 -9
  917. package/esm/Core/Container.d.ts +5 -6
  918. package/esm/Core/Container.js +6 -7
  919. package/esm/Core/Interfaces/Gradients.d.ts +2 -2
  920. package/esm/Core/Interfaces/ICircleBouncer.d.ts +1 -1
  921. package/esm/Core/Interfaces/IContainerPlugin.d.ts +4 -4
  922. package/esm/Core/Interfaces/IExternalInteractor.d.ts +1 -1
  923. package/esm/Core/Interfaces/IInteractor.d.ts +1 -1
  924. package/esm/Core/Interfaces/IMovePathGenerator.d.ts +1 -1
  925. package/esm/Core/Interfaces/IParticle.d.ts +8 -8
  926. package/esm/Core/Interfaces/IParticleGradientAnimation.d.ts +1 -1
  927. package/esm/Core/Interfaces/IParticleSpin.d.ts +1 -1
  928. package/esm/Core/Interfaces/IParticlesInteractor.d.ts +2 -2
  929. package/esm/Core/Interfaces/IPlugin.d.ts +1 -1
  930. package/esm/Core/Interfaces/index.d.ts +3 -1
  931. package/esm/Core/Interfaces/index.js +3 -1
  932. package/esm/Core/Loader.d.ts +1 -1
  933. package/esm/Core/Loader.js +2 -1
  934. package/esm/Core/Particle.d.ts +3 -6
  935. package/esm/Core/Particle.js +13 -15
  936. package/esm/Core/Particles.d.ts +3 -3
  937. package/esm/Core/Particles.js +8 -14
  938. package/esm/{Utils → Core/Utils}/Circle.d.ts +1 -1
  939. package/esm/{Utils → Core/Utils}/Circle.js +1 -1
  940. package/{Utils → esm/Core/Utils}/CircleWarp.d.ts +2 -3
  941. package/esm/{Utils → Core/Utils}/CircleWarp.js +1 -1
  942. package/esm/{Utils → Core/Utils}/Constants.d.ts +0 -0
  943. package/esm/{Utils → Core/Utils}/Constants.js +0 -0
  944. package/esm/{Utils → Core/Utils}/EventListeners.d.ts +1 -1
  945. package/esm/{Utils → Core/Utils}/EventListeners.js +10 -11
  946. package/{browser/Core → esm/Core/Utils}/ExternalInteractorBase.d.ts +4 -4
  947. package/{browser/Core → esm/Core/Utils}/ExternalInteractorBase.js +1 -2
  948. package/{Core → esm/Core/Utils}/FrameManager.d.ts +1 -1
  949. package/esm/Core/{FrameManager.js → Utils/FrameManager.js} +0 -0
  950. package/{Core → esm/Core/Utils}/InteractionManager.d.ts +5 -5
  951. package/esm/Core/{InteractionManager.js → Utils/InteractionManager.js} +4 -3
  952. package/{browser/Core → esm/Core/Utils}/ParticlesInteractorBase.d.ts +4 -4
  953. package/{browser/Core → esm/Core/Utils}/ParticlesInteractorBase.js +1 -2
  954. package/{Core/Particle/Mover.d.ts → esm/Core/Utils/ParticlesMover.d.ts} +2 -2
  955. package/esm/Core/{Particle/Mover.js → Utils/ParticlesMover.js} +4 -5
  956. package/{Utils → esm/Core/Utils}/Plugins.d.ts +5 -5
  957. package/esm/{Utils → Core/Utils}/Plugins.js +0 -0
  958. package/esm/{Utils → Core/Utils}/Point.d.ts +2 -2
  959. package/esm/{Utils → Core/Utils}/Point.js +0 -0
  960. package/esm/{Utils → Core/Utils}/QuadTree.d.ts +4 -4
  961. package/esm/{Utils → Core/Utils}/QuadTree.js +2 -2
  962. package/{Utils → esm/Core/Utils}/Range.d.ts +1 -1
  963. package/esm/{Utils → Core/Utils}/Range.js +0 -0
  964. package/{Utils → esm/Core/Utils}/Rectangle.d.ts +1 -2
  965. package/esm/{Utils → Core/Utils}/Rectangle.js +0 -0
  966. package/esm/Core/{Particle → Utils}/Vector.d.ts +0 -0
  967. package/esm/Core/{Particle → Utils}/Vector.js +0 -0
  968. package/{browser/Core/Particle → esm/Core/Utils}/Vector3d.d.ts +1 -1
  969. package/esm/Core/{Particle → Utils}/Vector3d.js +0 -0
  970. package/esm/Core/Utils/index.d.ts +16 -0
  971. package/esm/Core/Utils/index.js +16 -0
  972. package/esm/Core/index.d.ts +8 -0
  973. package/esm/Core/index.js +8 -0
  974. package/esm/Enums/AnimationStatus.d.ts +1 -1
  975. package/esm/Enums/AnimationStatus.js +1 -5
  976. package/esm/Enums/Directions/MoveDirection.d.ts +1 -1
  977. package/esm/Enums/Directions/MoveDirection.js +1 -12
  978. package/esm/Enums/Directions/OutModeDirection.d.ts +1 -1
  979. package/esm/Enums/Directions/OutModeDirection.js +1 -7
  980. package/esm/Enums/Directions/RotateDirection.d.ts +1 -1
  981. package/esm/Enums/Directions/RotateDirection.js +1 -6
  982. package/esm/Enums/Directions/TiltDirection.d.ts +1 -1
  983. package/esm/Enums/Directions/TiltDirection.js +1 -6
  984. package/esm/Enums/InteractivityDetect.d.ts +1 -1
  985. package/esm/Enums/InteractivityDetect.js +1 -6
  986. package/esm/Enums/Modes/ClickMode.d.ts +1 -1
  987. package/esm/Enums/Modes/ClickMode.js +1 -10
  988. package/esm/Enums/Modes/CollisionMode.d.ts +1 -1
  989. package/esm/Enums/Modes/CollisionMode.js +1 -6
  990. package/esm/Enums/Modes/DestroyMode.d.ts +1 -1
  991. package/esm/Enums/Modes/DestroyMode.js +1 -5
  992. package/esm/Enums/Modes/DivMode.d.ts +1 -1
  993. package/esm/Enums/Modes/DivMode.js +1 -6
  994. package/esm/Enums/Modes/HoverMode.d.ts +1 -1
  995. package/esm/Enums/Modes/HoverMode.js +1 -12
  996. package/esm/Enums/Modes/OutMode.d.ts +1 -1
  997. package/esm/Enums/Modes/OutMode.js +1 -10
  998. package/esm/Enums/Modes/ResponsiveMode.d.ts +1 -1
  999. package/esm/Enums/Modes/ResponsiveMode.js +1 -5
  1000. package/esm/Enums/Modes/RollMode.d.ts +1 -1
  1001. package/esm/Enums/Modes/RollMode.js +1 -6
  1002. package/esm/Enums/Modes/SizeMode.d.ts +1 -1
  1003. package/esm/Enums/Modes/SizeMode.js +1 -5
  1004. package/esm/Enums/Modes/ThemeMode.d.ts +1 -1
  1005. package/esm/Enums/Modes/ThemeMode.js +1 -6
  1006. package/esm/Enums/Types/AlterType.d.ts +1 -1
  1007. package/esm/Enums/Types/AlterType.js +1 -5
  1008. package/esm/Enums/Types/DestroyType.d.ts +1 -1
  1009. package/esm/Enums/Types/DestroyType.js +1 -6
  1010. package/esm/Enums/Types/DivType.d.ts +1 -1
  1011. package/esm/Enums/Types/DivType.js +1 -5
  1012. package/esm/Enums/Types/EasingType.d.ts +1 -1
  1013. package/esm/Enums/Types/EasingType.js +1 -11
  1014. package/esm/Enums/Types/GradientType.d.ts +1 -1
  1015. package/esm/Enums/Types/GradientType.js +1 -6
  1016. package/esm/Enums/Types/InteractorType.d.ts +1 -1
  1017. package/esm/Enums/Types/InteractorType.js +1 -5
  1018. package/esm/Enums/Types/OrbitType.d.ts +1 -1
  1019. package/esm/Enums/Types/OrbitType.js +1 -5
  1020. package/esm/Enums/Types/ShapeType.d.ts +1 -1
  1021. package/esm/Enums/Types/ShapeType.js +1 -14
  1022. package/esm/Enums/Types/StartValueType.d.ts +1 -1
  1023. package/esm/Enums/Types/StartValueType.js +1 -6
  1024. package/esm/Interactions/External/Attract/Attractor.d.ts +2 -2
  1025. package/esm/Interactions/External/Attract/Attractor.js +5 -7
  1026. package/esm/Interactions/External/Attract/index.d.ts +2 -2
  1027. package/esm/Interactions/External/Attract/index.js +2 -2
  1028. package/esm/Interactions/External/Bounce/Bouncer.d.ts +2 -2
  1029. package/esm/Interactions/External/Bounce/Bouncer.js +7 -9
  1030. package/esm/Interactions/External/Bounce/index.d.ts +2 -2
  1031. package/esm/Interactions/External/Bounce/index.js +2 -2
  1032. package/esm/Interactions/External/Bubble/Bubbler.d.ts +3 -3
  1033. package/esm/Interactions/External/Bubble/Bubbler.js +16 -18
  1034. package/esm/Interactions/External/Bubble/ProcessBubbleType.d.ts +1 -1
  1035. package/esm/Interactions/External/Bubble/ProcessBubbleType.js +1 -6
  1036. package/esm/Interactions/External/Bubble/index.d.ts +2 -2
  1037. package/esm/Interactions/External/Bubble/index.js +2 -2
  1038. package/esm/Interactions/External/Connect/Connector.d.ts +2 -2
  1039. package/esm/Interactions/External/Connect/Connector.js +2 -3
  1040. package/esm/Interactions/External/Connect/index.d.ts +2 -2
  1041. package/esm/Interactions/External/Connect/index.js +2 -2
  1042. package/esm/Interactions/External/Grab/Grabber.d.ts +2 -2
  1043. package/esm/Interactions/External/Grab/Grabber.js +3 -4
  1044. package/esm/Interactions/External/Grab/index.d.ts +2 -2
  1045. package/esm/Interactions/External/Grab/index.js +2 -2
  1046. package/esm/Interactions/External/Repulse/Repulser.d.ts +2 -2
  1047. package/esm/Interactions/External/Repulse/Repulser.js +8 -10
  1048. package/esm/Interactions/External/Repulse/index.d.ts +2 -2
  1049. package/esm/Interactions/External/Repulse/index.js +2 -2
  1050. package/esm/Interactions/External/Trail/TrailMaker.d.ts +2 -3
  1051. package/esm/Interactions/External/Trail/TrailMaker.js +3 -4
  1052. package/esm/Interactions/External/Trail/index.d.ts +2 -2
  1053. package/esm/Interactions/External/Trail/index.js +2 -2
  1054. package/esm/Interactions/Particles/Attract/Attractor.d.ts +2 -4
  1055. package/esm/Interactions/Particles/Attract/Attractor.js +1 -1
  1056. package/esm/Interactions/Particles/Attract/index.d.ts +2 -2
  1057. package/esm/Interactions/Particles/Attract/index.js +2 -2
  1058. package/esm/Interactions/Particles/Collisions/Collider.d.ts +2 -3
  1059. package/esm/Interactions/Particles/Collisions/Collider.js +4 -5
  1060. package/esm/Interactions/Particles/Collisions/index.d.ts +2 -2
  1061. package/esm/Interactions/Particles/Collisions/index.js +2 -2
  1062. package/esm/Interactions/Particles/Links/LinkInstance.d.ts +1 -3
  1063. package/esm/Interactions/Particles/Links/LinkParticle.d.ts +1 -1
  1064. package/esm/Interactions/Particles/Links/Linker.d.ts +3 -4
  1065. package/esm/Interactions/Particles/Links/Linker.js +2 -2
  1066. package/esm/Interactions/Particles/Links/index.d.ts +2 -3
  1067. package/esm/Interactions/Particles/Links/index.js +4 -7
  1068. package/esm/Interactions/Particles/Links/interaction.d.ts +2 -0
  1069. package/esm/Interactions/Particles/Links/interaction.js +4 -0
  1070. package/esm/Interactions/Particles/Links/plugin.d.ts +2 -2
  1071. package/esm/Interactions/Particles/Links/plugin.js +4 -4
  1072. package/esm/Options/Classes/AnimatableColor.d.ts +3 -3
  1073. package/esm/Options/Classes/AnimatableColor.js +1 -1
  1074. package/esm/Options/Classes/AnimatableGradient.d.ts +6 -6
  1075. package/esm/Options/Classes/AnimatableGradient.js +3 -4
  1076. package/esm/Options/Classes/AnimationOptions.d.ts +2 -2
  1077. package/esm/Options/Classes/Background/Background.d.ts +2 -2
  1078. package/esm/Options/Classes/BackgroundMask/BackgroundMask.d.ts +2 -2
  1079. package/esm/Options/Classes/BackgroundMask/BackgroundMaskCover.d.ts +2 -2
  1080. package/esm/Options/Classes/ColorAnimation.d.ts +1 -1
  1081. package/esm/Options/Classes/HslAnimation.d.ts +2 -2
  1082. package/esm/Options/Classes/Interactivity/Events/ClickEvent.d.ts +2 -2
  1083. package/esm/Options/Classes/Interactivity/Events/DivEvent.d.ts +1 -1
  1084. package/esm/Options/Classes/Interactivity/Events/DivEvent.js +1 -2
  1085. package/esm/Options/Classes/Interactivity/Events/Events.d.ts +2 -2
  1086. package/esm/Options/Classes/Interactivity/Events/HoverEvent.d.ts +3 -3
  1087. package/esm/Options/Classes/Interactivity/Events/Parallax.d.ts +1 -1
  1088. package/esm/Options/Classes/Interactivity/Interactivity.d.ts +2 -2
  1089. package/esm/Options/Classes/Interactivity/Interactivity.js +5 -6
  1090. package/esm/Options/Classes/Interactivity/Modes/Attract.d.ts +2 -2
  1091. package/esm/Options/Classes/Interactivity/Modes/Attract.js +1 -2
  1092. package/esm/Options/Classes/Interactivity/Modes/Bubble.d.ts +2 -2
  1093. package/esm/Options/Classes/Interactivity/Modes/Bubble.js +1 -1
  1094. package/esm/Options/Classes/Interactivity/Modes/BubbleBase.d.ts +1 -1
  1095. package/esm/Options/Classes/Interactivity/Modes/BubbleDiv.d.ts +1 -1
  1096. package/esm/Options/Classes/Interactivity/Modes/Connect.d.ts +2 -2
  1097. package/esm/Options/Classes/Interactivity/Modes/ConnectLinks.d.ts +1 -1
  1098. package/esm/Options/Classes/Interactivity/Modes/Grab.d.ts +2 -2
  1099. package/esm/Options/Classes/Interactivity/Modes/GrabLinks.d.ts +2 -2
  1100. package/esm/Options/Classes/Interactivity/Modes/Light.d.ts +1 -1
  1101. package/esm/Options/Classes/Interactivity/Modes/Modes.d.ts +7 -7
  1102. package/esm/Options/Classes/Interactivity/Modes/Modes.js +4 -4
  1103. package/esm/Options/Classes/Interactivity/Modes/Push.d.ts +1 -1
  1104. package/esm/Options/Classes/Interactivity/Modes/Remove.d.ts +1 -1
  1105. package/esm/Options/Classes/Interactivity/Modes/Repulse.d.ts +3 -3
  1106. package/esm/Options/Classes/Interactivity/Modes/Repulse.js +1 -1
  1107. package/esm/Options/Classes/Interactivity/Modes/RepulseBase.d.ts +2 -2
  1108. package/esm/Options/Classes/Interactivity/Modes/RepulseBase.js +1 -2
  1109. package/esm/Options/Classes/Interactivity/Modes/RepulseDiv.d.ts +1 -1
  1110. package/esm/Options/Classes/Interactivity/Modes/Slow.d.ts +1 -1
  1111. package/esm/Options/Classes/Interactivity/Modes/Trail.d.ts +2 -2
  1112. package/esm/Options/Classes/ManualParticle.d.ts +2 -2
  1113. package/esm/Options/Classes/Motion/Motion.d.ts +1 -1
  1114. package/esm/Options/Classes/Options.d.ts +7 -7
  1115. package/esm/Options/Classes/Options.js +13 -13
  1116. package/esm/Options/Classes/OptionsColor.d.ts +2 -2
  1117. package/esm/Options/Classes/Particles/Bounce/Bounce.d.ts +1 -1
  1118. package/esm/Options/Classes/Particles/Collisions/Collisions.d.ts +4 -4
  1119. package/esm/Options/Classes/Particles/Collisions/Collisions.js +1 -2
  1120. package/esm/Options/Classes/Particles/Collisions/CollisionsOverlap.d.ts +2 -2
  1121. package/esm/Options/Classes/Particles/Destroy/Destroy.d.ts +1 -1
  1122. package/esm/Options/Classes/Particles/Destroy/Destroy.js +1 -2
  1123. package/esm/Options/Classes/Particles/Destroy/Split.d.ts +3 -3
  1124. package/esm/Options/Classes/Particles/Life/Life.d.ts +1 -1
  1125. package/esm/Options/Classes/Particles/Links/Links.d.ts +2 -2
  1126. package/esm/Options/Classes/Particles/Links/LinksShadow.d.ts +2 -2
  1127. package/esm/Options/Classes/Particles/Links/LinksTriangle.d.ts +1 -1
  1128. package/esm/Options/Classes/Particles/Move/Attract.d.ts +2 -2
  1129. package/esm/Options/Classes/Particles/Move/Move.d.ts +5 -5
  1130. package/esm/Options/Classes/Particles/Move/Move.js +4 -5
  1131. package/esm/Options/Classes/Particles/Move/OutModes.d.ts +2 -2
  1132. package/esm/Options/Classes/Particles/Move/OutModes.js +1 -2
  1133. package/esm/Options/Classes/Particles/Move/Path/Path.d.ts +3 -3
  1134. package/esm/Options/Classes/Particles/Move/Spin.d.ts +3 -3
  1135. package/esm/Options/Classes/Particles/Move/Trail.d.ts +2 -2
  1136. package/esm/Options/Classes/Particles/Number/Density.d.ts +1 -1
  1137. package/esm/Options/Classes/Particles/Number/ParticlesNumber.d.ts +2 -2
  1138. package/esm/Options/Classes/Particles/Opacity/Opacity.d.ts +1 -1
  1139. package/esm/Options/Classes/Particles/Opacity/OpacityAnimation.d.ts +3 -3
  1140. package/esm/Options/Classes/Particles/Opacity/OpacityAnimation.js +2 -3
  1141. package/esm/Options/Classes/Particles/Orbit/Orbit.d.ts +5 -5
  1142. package/esm/Options/Classes/Particles/Orbit/Orbit.js +2 -2
  1143. package/esm/Options/Classes/Particles/Orbit/OrbitRotation.d.ts +1 -1
  1144. package/esm/Options/Classes/Particles/ParticlesOptions.d.ts +16 -16
  1145. package/esm/Options/Classes/Particles/ParticlesOptions.js +13 -13
  1146. package/esm/Options/Classes/Particles/Repulse/Repulse.d.ts +1 -1
  1147. package/esm/Options/Classes/Particles/Roll/Roll.d.ts +2 -2
  1148. package/esm/Options/Classes/Particles/Roll/Roll.js +1 -2
  1149. package/esm/Options/Classes/Particles/Roll/RollLight.d.ts +1 -1
  1150. package/esm/Options/Classes/Particles/Rotate/Rotate.d.ts +3 -3
  1151. package/esm/Options/Classes/Particles/Rotate/Rotate.js +1 -2
  1152. package/esm/Options/Classes/Particles/Rotate/RotateAnimation.d.ts +1 -1
  1153. package/esm/Options/Classes/Particles/Shadow.d.ts +3 -3
  1154. package/esm/Options/Classes/Particles/Shape/Shape.d.ts +5 -5
  1155. package/esm/Options/Classes/Particles/Shape/Shape.js +13 -14
  1156. package/esm/Options/Classes/Particles/Size/Size.d.ts +2 -2
  1157. package/esm/Options/Classes/Particles/Size/SizeAnimation.d.ts +3 -3
  1158. package/esm/Options/Classes/Particles/Size/SizeAnimation.js +2 -3
  1159. package/esm/Options/Classes/Particles/Stroke.d.ts +2 -2
  1160. package/esm/Options/Classes/Particles/Tilt/Tilt.d.ts +3 -3
  1161. package/esm/Options/Classes/Particles/Tilt/Tilt.js +1 -2
  1162. package/esm/Options/Classes/Particles/Tilt/TiltAnimation.d.ts +1 -1
  1163. package/esm/Options/Classes/Particles/Twinkle/Twinkle.d.ts +1 -1
  1164. package/esm/Options/Classes/Particles/Twinkle/TwinkleValues.d.ts +2 -2
  1165. package/esm/Options/Classes/Particles/Wobble/Wobble.d.ts +2 -2
  1166. package/esm/Options/Classes/Particles/ZIndex/ZIndex.d.ts +1 -1
  1167. package/esm/Options/Classes/Random.d.ts +1 -1
  1168. package/esm/Options/Classes/Responsive.d.ts +2 -2
  1169. package/esm/Options/Classes/Responsive.js +4 -5
  1170. package/esm/Options/Classes/Theme/Theme.d.ts +2 -2
  1171. package/esm/Options/Classes/Theme/Theme.js +1 -1
  1172. package/esm/Options/Classes/Theme/ThemeDefault.d.ts +2 -2
  1173. package/esm/Options/Classes/Theme/ThemeDefault.js +1 -2
  1174. package/esm/Options/Classes/ValueWithRandom.d.ts +2 -2
  1175. package/esm/Options/Interfaces/BackgroundMask/IBackgroundMask.d.ts +1 -1
  1176. package/esm/Options/Interfaces/IAnimatableColor.d.ts +1 -1
  1177. package/esm/Options/Interfaces/IAnimatableGradient.d.ts +1 -1
  1178. package/esm/Options/Interfaces/IColorAnimation.d.ts +1 -1
  1179. package/esm/Options/Interfaces/IManualParticle.d.ts +1 -1
  1180. package/esm/Options/Interfaces/IOptions.d.ts +6 -6
  1181. package/esm/Options/Interfaces/IOptionsGradient.d.ts +2 -2
  1182. package/esm/Options/Interfaces/IResponsive.d.ts +2 -2
  1183. package/esm/Options/Interfaces/IValueWithRandom.d.ts +1 -1
  1184. package/esm/Options/Interfaces/Interactivity/Events/IEvents.d.ts +1 -1
  1185. package/esm/Options/Interfaces/Interactivity/IInteractivity.d.ts +1 -1
  1186. package/esm/Options/Interfaces/Interactivity/Modes/IBubble.d.ts +2 -2
  1187. package/esm/Options/Interfaces/Interactivity/Modes/IBubbleBase.d.ts +1 -1
  1188. package/esm/Options/Interfaces/Interactivity/Modes/IModes.d.ts +2 -2
  1189. package/esm/Options/Interfaces/Interactivity/Modes/IRepulse.d.ts +2 -2
  1190. package/esm/Options/Interfaces/Interactivity/Modes/IRepulseDiv.d.ts +1 -1
  1191. package/esm/Options/Interfaces/Particles/Destroy/ISplit.d.ts +1 -1
  1192. package/esm/Options/Interfaces/Particles/IParticles.d.ts +14 -14
  1193. package/esm/Options/Interfaces/Particles/IShadow.d.ts +1 -1
  1194. package/esm/Options/Interfaces/Particles/IStroke.d.ts +1 -1
  1195. package/esm/Options/Interfaces/Particles/Links/ILinks.d.ts +1 -1
  1196. package/esm/Options/Interfaces/Particles/Move/IMove.d.ts +5 -5
  1197. package/esm/Options/Interfaces/Particles/Move/Path/{iPath.d.ts → IPath.d.ts} +0 -0
  1198. package/esm/{Plugins/PolygonMask/Options/Interfaces/IInline.js → Options/Interfaces/Particles/Move/Path/IPath.js} +0 -0
  1199. package/esm/Options/Interfaces/Particles/Orbit/IOrbit.d.ts +3 -3
  1200. package/esm/Options/Interfaces/Particles/Roll/IRoll.d.ts +1 -1
  1201. package/esm/Options/Interfaces/Particles/Rotate/IRotate.d.ts +1 -1
  1202. package/esm/Options/Interfaces/Particles/Shape/IShape.d.ts +3 -3
  1203. package/esm/Options/Interfaces/Particles/Tilt/ITilt.d.ts +1 -1
  1204. package/esm/Options/Interfaces/Theme/ITheme.d.ts +2 -2
  1205. package/esm/Plugins/Absorbers/AbsorberContainer.d.ts +1 -1
  1206. package/esm/Plugins/Absorbers/AbsorberInstance.d.ts +6 -7
  1207. package/esm/Plugins/Absorbers/AbsorberInstance.js +22 -23
  1208. package/esm/Plugins/Absorbers/Absorbers.d.ts +4 -7
  1209. package/esm/Plugins/Absorbers/Absorbers.js +2 -3
  1210. package/esm/Plugins/Absorbers/Enums/AbsorberClickMode.d.ts +1 -1
  1211. package/esm/Plugins/Absorbers/Enums/AbsorberClickMode.js +1 -4
  1212. package/esm/Plugins/Absorbers/Options/Classes/Absorber.d.ts +4 -4
  1213. package/esm/Plugins/Absorbers/Options/Classes/AbsorberSize.d.ts +2 -2
  1214. package/esm/Plugins/Absorbers/Options/Classes/AbsorberSize.js +1 -1
  1215. package/esm/Plugins/Absorbers/Options/Classes/AbsorberSizeLimit.d.ts +2 -2
  1216. package/esm/Plugins/Absorbers/Options/Interfaces/IAbsorber.d.ts +1 -2
  1217. package/esm/Plugins/Absorbers/Options/Interfaces/IAbsorberOptions.d.ts +1 -1
  1218. package/esm/Plugins/Absorbers/Options/Interfaces/IAbsorberSize.d.ts +1 -1
  1219. package/esm/Plugins/Absorbers/index.d.ts +2 -0
  1220. package/esm/Plugins/Absorbers/{plugin.js → index.js} +6 -7
  1221. package/esm/Plugins/Emitters/EmitterContainer.d.ts +2 -1
  1222. package/esm/Plugins/Emitters/EmitterInstance.d.ts +6 -5
  1223. package/esm/Plugins/Emitters/EmitterInstance.js +37 -39
  1224. package/esm/Plugins/Emitters/Emitters.d.ts +4 -5
  1225. package/esm/Plugins/Emitters/Emitters.js +12 -5
  1226. package/esm/Plugins/Emitters/EmittersMain.d.ts +2 -2
  1227. package/esm/Plugins/Emitters/Enums/EmitterClickMode.d.ts +1 -1
  1228. package/esm/Plugins/Emitters/Enums/EmitterClickMode.js +1 -4
  1229. package/esm/Plugins/Emitters/Enums/EmitterShapeType.d.ts +1 -1
  1230. package/esm/Plugins/Emitters/Enums/EmitterShapeType.js +1 -5
  1231. package/esm/Plugins/Emitters/IEmitterShape.d.ts +1 -1
  1232. package/esm/Plugins/Emitters/Options/Classes/Emitter.d.ts +7 -7
  1233. package/esm/Plugins/Emitters/Options/Classes/Emitter.js +4 -5
  1234. package/esm/Plugins/Emitters/Options/Classes/EmitterLife.d.ts +1 -1
  1235. package/esm/Plugins/Emitters/Options/Classes/EmitterRate.d.ts +1 -1
  1236. package/esm/Plugins/Emitters/Options/Classes/EmitterSize.d.ts +1 -1
  1237. package/esm/Plugins/Emitters/Options/Classes/EmitterSize.js +1 -2
  1238. package/esm/Plugins/Emitters/Options/Interfaces/IEmitter.d.ts +6 -6
  1239. package/esm/Plugins/Emitters/Options/Interfaces/IEmitterOptions.d.ts +1 -1
  1240. package/esm/Plugins/Emitters/Options/Interfaces/IEmitterSize.d.ts +1 -1
  1241. package/esm/Plugins/Emitters/Shapes/Circle/CircleShape.d.ts +1 -1
  1242. package/esm/Plugins/Emitters/Shapes/Square/SquareShape.d.ts +1 -1
  1243. package/esm/Plugins/Emitters/index.d.ts +3 -0
  1244. package/esm/Plugins/Emitters/{plugin.js → index.js} +10 -11
  1245. package/esm/Plugins/PolygonMask/Enums/PolygonMaskInlineArrangement.d.ts +8 -0
  1246. package/esm/Plugins/PolygonMask/{Options/Interfaces/ILocalSvg.js → Enums/PolygonMaskInlineArrangement.js} +0 -0
  1247. package/esm/Plugins/PolygonMask/Enums/PolygonMaskMoveType.d.ts +4 -0
  1248. package/esm/Plugins/PolygonMask/{Options/Interfaces/IMove.js → Enums/PolygonMaskMoveType.js} +0 -0
  1249. package/{browser/Plugins/PolygonMask/Enums/Type.d.ts → esm/Plugins/PolygonMask/Enums/PolygonMaskType.d.ts} +1 -1
  1250. package/esm/Plugins/PolygonMask/{types.js → Enums/PolygonMaskType.js} +0 -0
  1251. package/esm/Plugins/PolygonMask/Enums/index.d.ts +3 -3
  1252. package/esm/Plugins/PolygonMask/Enums/index.js +3 -3
  1253. package/esm/Plugins/PolygonMask/Options/Classes/PolygonMask.d.ts +14 -14
  1254. package/esm/Plugins/PolygonMask/Options/Classes/PolygonMask.js +42 -42
  1255. package/esm/Plugins/PolygonMask/Options/Classes/{Draw.d.ts → PolygonMaskDraw.d.ts} +7 -7
  1256. package/esm/Plugins/PolygonMask/Options/Classes/{Draw.js → PolygonMaskDraw.js} +13 -12
  1257. package/esm/Plugins/PolygonMask/Options/Classes/{DrawStroke.d.ts → PolygonMaskDrawStroke.d.ts} +5 -5
  1258. package/esm/Plugins/PolygonMask/Options/Classes/PolygonMaskDrawStroke.js +25 -0
  1259. package/esm/Plugins/PolygonMask/Options/Classes/PolygonMaskInline.d.ts +9 -0
  1260. package/esm/Plugins/PolygonMask/Options/Classes/PolygonMaskInline.js +13 -0
  1261. package/esm/Plugins/PolygonMask/Options/Classes/PolygonMaskLocalSvg.d.ts +11 -0
  1262. package/esm/Plugins/PolygonMask/Options/Classes/PolygonMaskLocalSvg.js +25 -0
  1263. package/esm/Plugins/PolygonMask/Options/Classes/PolygonMaskMove.d.ts +10 -0
  1264. package/esm/Plugins/PolygonMask/Options/Classes/PolygonMaskMove.js +17 -0
  1265. package/esm/Plugins/PolygonMask/Options/Interfaces/IPolygonMask.d.ts +12 -13
  1266. package/esm/Plugins/PolygonMask/Options/Interfaces/IPolygonMaskDraw.d.ts +8 -0
  1267. package/esm/Plugins/PolygonMask/Options/Interfaces/IPolygonMaskDraw.js +1 -0
  1268. package/esm/Plugins/PolygonMask/Options/Interfaces/IPolygonMaskDrawStroke.d.ts +6 -0
  1269. package/esm/Plugins/PolygonMask/Options/Interfaces/IPolygonMaskDrawStroke.js +1 -0
  1270. package/esm/Plugins/PolygonMask/Options/Interfaces/IPolygonMaskInline.d.ts +4 -0
  1271. package/esm/Plugins/PolygonMask/Options/Interfaces/IPolygonMaskInline.js +1 -0
  1272. package/esm/Plugins/PolygonMask/Options/Interfaces/{ILocalSvg.d.ts → IPolygonMaskLocalSvg.d.ts} +2 -2
  1273. package/esm/Plugins/PolygonMask/Options/Interfaces/IPolygonMaskLocalSvg.js +1 -0
  1274. package/esm/Plugins/PolygonMask/Options/Interfaces/IPolygonMaskMove.d.ts +5 -0
  1275. package/esm/Plugins/PolygonMask/Options/Interfaces/IPolygonMaskMove.js +1 -0
  1276. package/esm/Plugins/PolygonMask/PolygonMaskInstance.d.ts +4 -6
  1277. package/esm/Plugins/PolygonMask/PolygonMaskInstance.js +24 -21
  1278. package/{browser/Plugins/PolygonMask/types.d.ts → esm/Plugins/PolygonMask/Types.d.ts} +1 -1
  1279. package/esm/Plugins/PolygonMask/Types.js +1 -0
  1280. package/{browser/Plugins/PolygonMask/utils.d.ts → esm/Plugins/PolygonMask/Utils.d.ts} +5 -5
  1281. package/esm/Plugins/PolygonMask/{utils.js → Utils.js} +15 -12
  1282. package/esm/Plugins/PolygonMask/index.d.ts +2 -0
  1283. package/esm/Plugins/PolygonMask/{plugin.js → index.js} +7 -8
  1284. package/esm/Plugins/PolygonMask/pathseg.js +54 -43
  1285. package/esm/Shapes/Circle/CircleDrawer.d.ts +1 -1
  1286. package/esm/Shapes/Circle/index.d.ts +2 -2
  1287. package/esm/Shapes/Circle/index.js +2 -2
  1288. package/esm/Shapes/Image/ImageDrawer.d.ts +3 -7
  1289. package/esm/Shapes/Image/ImageDrawer.js +28 -108
  1290. package/esm/Shapes/Image/Utils.d.ts +8 -5
  1291. package/esm/Shapes/Image/Utils.js +67 -36
  1292. package/esm/Shapes/Image/index.d.ts +2 -2
  1293. package/esm/Shapes/Image/index.js +3 -3
  1294. package/esm/Shapes/Line/LineDrawer.d.ts +1 -1
  1295. package/esm/Shapes/Line/index.d.ts +2 -2
  1296. package/esm/Shapes/Line/index.js +2 -2
  1297. package/esm/Shapes/Polygon/PolygonDrawer.d.ts +1 -1
  1298. package/esm/Shapes/Polygon/PolygonDrawerBase.d.ts +1 -1
  1299. package/esm/Shapes/Polygon/TriangleDrawer.d.ts +1 -1
  1300. package/esm/Shapes/Polygon/index.d.ts +4 -4
  1301. package/esm/Shapes/Polygon/index.js +7 -7
  1302. package/esm/Shapes/Square/SquareDrawer.d.ts +1 -1
  1303. package/esm/Shapes/Square/index.d.ts +2 -2
  1304. package/esm/Shapes/Square/index.js +3 -3
  1305. package/esm/Shapes/Star/StarDrawer.d.ts +1 -1
  1306. package/esm/Shapes/Star/index.d.ts +2 -2
  1307. package/esm/Shapes/Star/index.js +2 -2
  1308. package/esm/Shapes/Text/TextDrawer.d.ts +1 -2
  1309. package/esm/Shapes/Text/index.d.ts +2 -2
  1310. package/esm/Shapes/Text/index.js +3 -3
  1311. package/esm/Types/ShapeData.d.ts +1 -1
  1312. package/esm/Types/ShapeDrawerFunctions.d.ts +1 -1
  1313. package/esm/Updaters/Angle/AngleUpdater.d.ts +1 -3
  1314. package/esm/Updaters/Angle/AngleUpdater.js +8 -9
  1315. package/esm/Updaters/Angle/index.d.ts +2 -2
  1316. package/esm/Updaters/Angle/index.js +2 -2
  1317. package/esm/Updaters/Color/ColorUpdater.d.ts +1 -3
  1318. package/esm/Updaters/Color/ColorUpdater.js +3 -4
  1319. package/esm/Updaters/Color/index.d.ts +2 -2
  1320. package/esm/Updaters/Color/index.js +2 -2
  1321. package/esm/Updaters/Life/LifeUpdater.d.ts +1 -3
  1322. package/esm/Updaters/Life/index.d.ts +2 -2
  1323. package/esm/Updaters/Life/index.js +2 -2
  1324. package/esm/Updaters/Opacity/OpacityUpdater.d.ts +1 -3
  1325. package/esm/Updaters/Opacity/OpacityUpdater.js +13 -14
  1326. package/esm/Updaters/Opacity/index.d.ts +2 -2
  1327. package/esm/Updaters/Opacity/index.js +2 -2
  1328. package/esm/Updaters/OutModes/IBounceData.d.ts +1 -2
  1329. package/esm/Updaters/OutModes/OutOfCanvasUpdater.d.ts +1 -3
  1330. package/esm/Updaters/OutModes/OutOfCanvasUpdater.js +20 -21
  1331. package/esm/Updaters/OutModes/Utils.js +12 -13
  1332. package/esm/Updaters/OutModes/index.d.ts +2 -2
  1333. package/esm/Updaters/OutModes/index.js +2 -2
  1334. package/esm/Updaters/Roll/RollUpdater.d.ts +1 -2
  1335. package/esm/Updaters/Roll/RollUpdater.js +4 -5
  1336. package/esm/Updaters/Roll/index.d.ts +2 -2
  1337. package/esm/Updaters/Roll/index.js +2 -2
  1338. package/esm/Updaters/Size/SizeUpdater.d.ts +1 -2
  1339. package/esm/Updaters/Size/SizeUpdater.js +6 -7
  1340. package/esm/Updaters/Size/index.d.ts +2 -2
  1341. package/esm/Updaters/Size/index.js +2 -2
  1342. package/esm/Updaters/StrokeColor/StrokeColorUpdater.d.ts +1 -3
  1343. package/esm/Updaters/StrokeColor/StrokeColorUpdater.js +3 -4
  1344. package/esm/Updaters/StrokeColor/index.d.ts +2 -2
  1345. package/esm/Updaters/StrokeColor/index.js +2 -2
  1346. package/esm/Updaters/Tilt/TiltUpdater.d.ts +1 -3
  1347. package/esm/Updaters/Tilt/TiltUpdater.js +8 -9
  1348. package/esm/Updaters/Tilt/index.d.ts +2 -2
  1349. package/esm/Updaters/Tilt/index.js +2 -2
  1350. package/esm/Updaters/Wobble/WobbleUpdater.d.ts +1 -3
  1351. package/esm/Updaters/Wobble/index.d.ts +2 -2
  1352. package/esm/Updaters/Wobble/index.js +2 -2
  1353. package/esm/Utils/CanvasUtils.d.ts +3 -4
  1354. package/esm/Utils/CanvasUtils.js +5 -6
  1355. package/esm/Utils/ColorUtils.d.ts +1 -1
  1356. package/esm/Utils/ColorUtils.js +3 -4
  1357. package/esm/Utils/NumberUtils.d.ts +3 -3
  1358. package/esm/Utils/NumberUtils.js +18 -19
  1359. package/esm/Utils/Utils.d.ts +3 -3
  1360. package/esm/Utils/Utils.js +6 -7
  1361. package/esm/Utils/index.d.ts +0 -9
  1362. package/esm/Utils/index.js +0 -9
  1363. package/{main.d.ts → esm/engine.d.ts} +3 -5
  1364. package/esm/{main.js → engine.js} +8 -9
  1365. package/esm/full.d.ts +2 -2
  1366. package/esm/full.js +14 -14
  1367. package/esm/index.d.ts +7 -17
  1368. package/esm/index.engine.d.ts +13 -0
  1369. package/esm/index.engine.js +11 -0
  1370. package/esm/index.js +5 -13
  1371. package/esm/index.slim.d.ts +6 -16
  1372. package/esm/index.slim.js +5 -13
  1373. package/esm/pjs.d.ts +3 -3
  1374. package/esm/pjs.js +6 -5
  1375. package/esm/slim.d.ts +2 -2
  1376. package/esm/slim.js +40 -40
  1377. package/full.d.ts +2 -2
  1378. package/full.js +14 -14
  1379. package/index.d.ts +7 -17
  1380. package/index.engine.d.ts +13 -0
  1381. package/index.engine.js +27 -0
  1382. package/index.js +7 -19
  1383. package/index.slim.d.ts +6 -16
  1384. package/index.slim.js +7 -19
  1385. package/package.json +11 -5
  1386. package/pjs.d.ts +3 -3
  1387. package/pjs.js +6 -5
  1388. package/report.html +2 -2
  1389. package/report.slim.html +2 -2
  1390. package/slim.d.ts +2 -2
  1391. package/slim.js +40 -40
  1392. package/tsparticles.engine.js +6748 -0
  1393. package/tsparticles.engine.min.js +2 -0
  1394. package/tsparticles.interaction.external.attract.js +4978 -0
  1395. package/tsparticles.interaction.external.attract.min.js +2 -0
  1396. package/tsparticles.interaction.external.bounce.js +4999 -0
  1397. package/tsparticles.interaction.external.bounce.min.js +2 -0
  1398. package/tsparticles.interaction.external.bubble.js +5085 -0
  1399. package/tsparticles.interaction.external.bubble.min.js +2 -0
  1400. package/tsparticles.interaction.external.connect.js +4847 -0
  1401. package/tsparticles.interaction.external.connect.min.js +2 -0
  1402. package/tsparticles.interaction.external.grab.js +4853 -0
  1403. package/tsparticles.interaction.external.grab.min.js +2 -0
  1404. package/tsparticles.interaction.external.repulse.js +5030 -0
  1405. package/tsparticles.interaction.external.repulse.min.js +2 -0
  1406. package/tsparticles.interaction.external.trail.js +4855 -0
  1407. package/tsparticles.interaction.external.trail.min.js +2 -0
  1408. package/tsparticles.interaction.particles.attract.js +4836 -0
  1409. package/tsparticles.interaction.particles.attract.min.js +2 -0
  1410. package/tsparticles.interaction.particles.collisions.js +5001 -0
  1411. package/tsparticles.interaction.particles.collisions.min.js +2 -0
  1412. package/tsparticles.interaction.particles.links.js +5073 -0
  1413. package/tsparticles.interaction.particles.links.min.js +2 -0
  1414. package/tsparticles.js +6693 -6994
  1415. package/tsparticles.min.js +2 -2
  1416. package/tsparticles.pathseg.min.js +2 -0
  1417. package/tsparticles.plugins.absorbers.js +5333 -0
  1418. package/tsparticles.plugins.absorbers.min.js +2 -0
  1419. package/tsparticles.plugins.emitters.js +5428 -0
  1420. package/tsparticles.plugins.emitters.min.js +2 -0
  1421. package/tsparticles.plugins.polygonMask.js +5864 -0
  1422. package/tsparticles.plugins.polygonMask.min.js +2 -0
  1423. package/tsparticles.shape.circle.js +59 -0
  1424. package/tsparticles.shape.circle.min.js +2 -0
  1425. package/tsparticles.shape.image.js +5023 -0
  1426. package/tsparticles.shape.image.min.js +2 -0
  1427. package/tsparticles.shape.line.js +60 -0
  1428. package/tsparticles.shape.line.min.js +2 -0
  1429. package/tsparticles.shape.polygon.js +131 -0
  1430. package/tsparticles.shape.polygon.min.js +2 -0
  1431. package/tsparticles.shape.square.js +62 -0
  1432. package/tsparticles.shape.square.min.js +2 -0
  1433. package/tsparticles.shape.star.js +71 -0
  1434. package/tsparticles.shape.star.min.js +2 -0
  1435. package/tsparticles.shape.text.js +4867 -0
  1436. package/tsparticles.shape.text.min.js +2 -0
  1437. package/tsparticles.slim.js +3960 -4220
  1438. package/tsparticles.slim.min.js +2 -2
  1439. package/tsparticles.updater.angle.js +4882 -0
  1440. package/tsparticles.updater.angle.min.js +2 -0
  1441. package/tsparticles.updater.color.js +4864 -0
  1442. package/tsparticles.updater.color.min.js +2 -0
  1443. package/tsparticles.updater.life.js +4866 -0
  1444. package/tsparticles.updater.life.min.js +2 -0
  1445. package/tsparticles.updater.opacity.js +4916 -0
  1446. package/tsparticles.updater.opacity.min.js +2 -0
  1447. package/tsparticles.updater.outModes.js +5000 -0
  1448. package/tsparticles.updater.outModes.min.js +2 -0
  1449. package/tsparticles.updater.roll.js +4864 -0
  1450. package/tsparticles.updater.roll.min.js +2 -0
  1451. package/tsparticles.updater.size.js +4872 -0
  1452. package/tsparticles.updater.size.min.js +2 -0
  1453. package/tsparticles.updater.strokeColor.js +4877 -0
  1454. package/tsparticles.updater.strokeColor.min.js +2 -0
  1455. package/tsparticles.updater.tilt.js +4883 -0
  1456. package/tsparticles.updater.tilt.min.js +2 -0
  1457. package/tsparticles.updater.wobble.js +4852 -0
  1458. package/tsparticles.updater.wobble.min.js +2 -0
  1459. package/Plugins/Absorbers/plugin.d.ts +0 -2
  1460. package/Plugins/Emitters/plugin.d.ts +0 -3
  1461. package/Plugins/PolygonMask/Enums/InlineArrangement.d.ts +0 -8
  1462. package/Plugins/PolygonMask/Enums/InlineArrangement.js +0 -11
  1463. package/Plugins/PolygonMask/Enums/MoveType.d.ts +0 -4
  1464. package/Plugins/PolygonMask/Enums/MoveType.js +0 -8
  1465. package/Plugins/PolygonMask/Enums/Type.js +0 -10
  1466. package/Plugins/PolygonMask/Options/Classes/DrawStroke.js +0 -28
  1467. package/Plugins/PolygonMask/Options/Classes/Inline.d.ts +0 -9
  1468. package/Plugins/PolygonMask/Options/Classes/Inline.js +0 -17
  1469. package/Plugins/PolygonMask/Options/Classes/LocalSvg.d.ts +0 -11
  1470. package/Plugins/PolygonMask/Options/Classes/LocalSvg.js +0 -28
  1471. package/Plugins/PolygonMask/Options/Classes/Move.d.ts +0 -10
  1472. package/Plugins/PolygonMask/Options/Classes/Move.js +0 -21
  1473. package/Plugins/PolygonMask/Options/Interfaces/IDraw.d.ts +0 -8
  1474. package/Plugins/PolygonMask/Options/Interfaces/IDrawStroke.d.ts +0 -6
  1475. package/Plugins/PolygonMask/Options/Interfaces/IInline.d.ts +0 -4
  1476. package/Plugins/PolygonMask/Options/Interfaces/IMove.d.ts +0 -5
  1477. package/Plugins/PolygonMask/plugin.d.ts +0 -2
  1478. package/browser/Plugins/Absorbers/plugin.d.ts +0 -2
  1479. package/browser/Plugins/Emitters/plugin.d.ts +0 -3
  1480. package/browser/Plugins/PolygonMask/Enums/InlineArrangement.d.ts +0 -8
  1481. package/browser/Plugins/PolygonMask/Enums/InlineArrangement.js +0 -8
  1482. package/browser/Plugins/PolygonMask/Enums/MoveType.d.ts +0 -4
  1483. package/browser/Plugins/PolygonMask/Enums/MoveType.js +0 -5
  1484. package/browser/Plugins/PolygonMask/Enums/Type.js +0 -7
  1485. package/browser/Plugins/PolygonMask/Options/Classes/DrawStroke.js +0 -27
  1486. package/browser/Plugins/PolygonMask/Options/Classes/Inline.d.ts +0 -12
  1487. package/browser/Plugins/PolygonMask/Options/Classes/Inline.js +0 -16
  1488. package/browser/Plugins/PolygonMask/Options/Classes/LocalSvg.js +0 -27
  1489. package/browser/Plugins/PolygonMask/Options/Classes/Move.d.ts +0 -13
  1490. package/browser/Plugins/PolygonMask/Options/Classes/Move.js +0 -20
  1491. package/browser/Plugins/PolygonMask/Options/Interfaces/IInline.d.ts +0 -7
  1492. package/browser/Plugins/PolygonMask/Options/Interfaces/IMove.d.ts +0 -8
  1493. package/browser/Plugins/PolygonMask/plugin.d.ts +0 -2
  1494. package/esm/Plugins/Absorbers/plugin.d.ts +0 -2
  1495. package/esm/Plugins/Emitters/plugin.d.ts +0 -3
  1496. package/esm/Plugins/PolygonMask/Enums/InlineArrangement.d.ts +0 -8
  1497. package/esm/Plugins/PolygonMask/Enums/InlineArrangement.js +0 -8
  1498. package/esm/Plugins/PolygonMask/Enums/MoveType.d.ts +0 -4
  1499. package/esm/Plugins/PolygonMask/Enums/MoveType.js +0 -5
  1500. package/esm/Plugins/PolygonMask/Enums/Type.js +0 -7
  1501. package/esm/Plugins/PolygonMask/Options/Classes/DrawStroke.js +0 -24
  1502. package/esm/Plugins/PolygonMask/Options/Classes/Inline.d.ts +0 -9
  1503. package/esm/Plugins/PolygonMask/Options/Classes/Inline.js +0 -13
  1504. package/esm/Plugins/PolygonMask/Options/Classes/LocalSvg.d.ts +0 -11
  1505. package/esm/Plugins/PolygonMask/Options/Classes/LocalSvg.js +0 -24
  1506. package/esm/Plugins/PolygonMask/Options/Classes/Move.d.ts +0 -10
  1507. package/esm/Plugins/PolygonMask/Options/Classes/Move.js +0 -17
  1508. package/esm/Plugins/PolygonMask/Options/Interfaces/IDraw.d.ts +0 -8
  1509. package/esm/Plugins/PolygonMask/Options/Interfaces/IDrawStroke.d.ts +0 -6
  1510. package/esm/Plugins/PolygonMask/Options/Interfaces/IInline.d.ts +0 -4
  1511. package/esm/Plugins/PolygonMask/Options/Interfaces/IMove.d.ts +0 -5
  1512. package/esm/Plugins/PolygonMask/plugin.d.ts +0 -2
  1513. package/tsparticles.pathseg.js +0 -1472
@@ -0,0 +1,4883 @@
1
+ (function webpackUniversalModuleDefinition(root, factory) {
2
+ if (typeof exports === "object" && typeof module === "object") module.exports = factory(); else if (typeof define === "function" && define.amd) define([], factory); else {
3
+ var a = factory();
4
+ for (var i in a) (typeof exports === "object" ? exports : root)[i] = a[i];
5
+ }
6
+ })(window, (function() {
7
+ return function() {
8
+ "use strict";
9
+ var __webpack_require__ = {};
10
+ !function() {
11
+ __webpack_require__.d = function(exports, definition) {
12
+ for (var key in definition) {
13
+ if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
14
+ Object.defineProperty(exports, key, {
15
+ enumerable: true,
16
+ get: definition[key]
17
+ });
18
+ }
19
+ }
20
+ };
21
+ }();
22
+ !function() {
23
+ __webpack_require__.o = function(obj, prop) {
24
+ return Object.prototype.hasOwnProperty.call(obj, prop);
25
+ };
26
+ }();
27
+ !function() {
28
+ __webpack_require__.r = function(exports) {
29
+ if (typeof Symbol !== "undefined" && Symbol.toStringTag) {
30
+ Object.defineProperty(exports, Symbol.toStringTag, {
31
+ value: "Module"
32
+ });
33
+ }
34
+ Object.defineProperty(exports, "__esModule", {
35
+ value: true
36
+ });
37
+ };
38
+ }();
39
+ var __webpack_exports__ = {};
40
+ __webpack_require__.r(__webpack_exports__);
41
+ __webpack_require__.d(__webpack_exports__, {
42
+ loadTiltUpdater: function() {
43
+ return loadTiltUpdater;
44
+ }
45
+ });
46
+ class Circle_Circle extends(null && Range){
47
+ constructor(x, y, radius) {
48
+ super(x, y);
49
+ this.radius = radius;
50
+ }
51
+ contains(point) {
52
+ return getDistance(point, this.position) <= this.radius;
53
+ }
54
+ intersects(range) {
55
+ const rect = range;
56
+ const circle = range;
57
+ const pos1 = this.position;
58
+ const pos2 = range.position;
59
+ const xDist = Math.abs(pos2.x - pos1.x);
60
+ const yDist = Math.abs(pos2.y - pos1.y);
61
+ const r = this.radius;
62
+ if (circle.radius !== undefined) {
63
+ const rSum = r + circle.radius;
64
+ const dist = Math.sqrt(xDist * xDist + yDist + yDist);
65
+ return rSum > dist;
66
+ } else if (rect.size !== undefined) {
67
+ const w = rect.size.width;
68
+ const h = rect.size.height;
69
+ const edges = Math.pow(xDist - w, 2) + Math.pow(yDist - h, 2);
70
+ if (xDist > r + w || yDist > r + h) {
71
+ return false;
72
+ }
73
+ if (xDist <= w || yDist <= h) {
74
+ return true;
75
+ }
76
+ return edges <= r * r;
77
+ }
78
+ return false;
79
+ }
80
+ }
81
+ class CircleWarp_CircleWarp extends(null && Circle){
82
+ constructor(x, y, radius, canvasSize) {
83
+ super(x, y, radius);
84
+ this.canvasSize = canvasSize;
85
+ this.canvasSize = {
86
+ height: canvasSize.height,
87
+ width: canvasSize.width
88
+ };
89
+ }
90
+ contains(point) {
91
+ if (super.contains(point)) {
92
+ return true;
93
+ }
94
+ const posNE = {
95
+ x: point.x - this.canvasSize.width,
96
+ y: point.y
97
+ };
98
+ if (super.contains(posNE)) {
99
+ return true;
100
+ }
101
+ const posSE = {
102
+ x: point.x - this.canvasSize.width,
103
+ y: point.y - this.canvasSize.height
104
+ };
105
+ if (super.contains(posSE)) {
106
+ return true;
107
+ }
108
+ const posSW = {
109
+ x: point.x,
110
+ y: point.y - this.canvasSize.height
111
+ };
112
+ return super.contains(posSW);
113
+ }
114
+ intersects(range) {
115
+ if (super.intersects(range)) {
116
+ return true;
117
+ }
118
+ const rect = range;
119
+ const circle = range;
120
+ const newPos = {
121
+ x: range.position.x - this.canvasSize.width,
122
+ y: range.position.y - this.canvasSize.height
123
+ };
124
+ if (circle.radius !== undefined) {
125
+ const biggerCircle = new Circle(newPos.x, newPos.y, circle.radius * 2);
126
+ return super.intersects(biggerCircle);
127
+ } else if (rect.size !== undefined) {
128
+ const rectSW = new Rectangle(newPos.x, newPos.y, rect.size.width * 2, rect.size.height * 2);
129
+ return super.intersects(rectSW);
130
+ }
131
+ return false;
132
+ }
133
+ }
134
+ class Constants_Constants {}
135
+ Constants_Constants.generatedAttribute = "generated";
136
+ Constants_Constants.randomColorValue = "random";
137
+ Constants_Constants.midColorValue = "mid";
138
+ Constants_Constants.touchEndEvent = "touchend";
139
+ Constants_Constants.mouseDownEvent = "mousedown";
140
+ Constants_Constants.mouseUpEvent = "mouseup";
141
+ Constants_Constants.mouseMoveEvent = "mousemove";
142
+ Constants_Constants.touchStartEvent = "touchstart";
143
+ Constants_Constants.touchMoveEvent = "touchmove";
144
+ Constants_Constants.mouseLeaveEvent = "mouseleave";
145
+ Constants_Constants.mouseOutEvent = "mouseout";
146
+ Constants_Constants.touchCancelEvent = "touchcancel";
147
+ Constants_Constants.resizeEvent = "resize";
148
+ Constants_Constants.visibilityChangeEvent = "visibilitychange";
149
+ Constants_Constants.noPolygonDataLoaded = "No polygon data loaded.";
150
+ Constants_Constants.noPolygonFound = "No polygon found, you need to specify SVG url in config.";
151
+ function manageListener(element, event, handler, add, options) {
152
+ if (add) {
153
+ let addOptions = {
154
+ passive: true
155
+ };
156
+ if (typeof options === "boolean") {
157
+ addOptions.capture = options;
158
+ } else if (options !== undefined) {
159
+ addOptions = options;
160
+ }
161
+ element.addEventListener(event, handler, addOptions);
162
+ } else {
163
+ const removeOptions = options;
164
+ element.removeEventListener(event, handler, removeOptions);
165
+ }
166
+ }
167
+ class EventListeners_EventListeners {
168
+ constructor(container) {
169
+ this.container = container;
170
+ this.canPush = true;
171
+ this.mouseMoveHandler = e => this.mouseTouchMove(e);
172
+ this.touchStartHandler = e => this.mouseTouchMove(e);
173
+ this.touchMoveHandler = e => this.mouseTouchMove(e);
174
+ this.touchEndHandler = () => this.mouseTouchFinish();
175
+ this.mouseLeaveHandler = () => this.mouseTouchFinish();
176
+ this.touchCancelHandler = () => this.mouseTouchFinish();
177
+ this.touchEndClickHandler = e => this.mouseTouchClick(e);
178
+ this.mouseUpHandler = e => this.mouseTouchClick(e);
179
+ this.mouseDownHandler = () => this.mouseDown();
180
+ this.visibilityChangeHandler = () => this.handleVisibilityChange();
181
+ this.themeChangeHandler = e => this.handleThemeChange(e);
182
+ this.oldThemeChangeHandler = e => this.handleThemeChange(e);
183
+ this.resizeHandler = () => this.handleWindowResize();
184
+ }
185
+ addListeners() {
186
+ this.manageListeners(true);
187
+ }
188
+ removeListeners() {
189
+ this.manageListeners(false);
190
+ }
191
+ manageListeners(add) {
192
+ var _a;
193
+ const container = this.container;
194
+ const options = container.actualOptions;
195
+ const detectType = options.interactivity.detectsOn;
196
+ let mouseLeaveEvent = Constants.mouseLeaveEvent;
197
+ if (detectType === "window") {
198
+ container.interactivity.element = window;
199
+ mouseLeaveEvent = Constants.mouseOutEvent;
200
+ } else if (detectType === "parent" && container.canvas.element) {
201
+ const canvasEl = container.canvas.element;
202
+ container.interactivity.element = (_a = canvasEl.parentElement) !== null && _a !== void 0 ? _a : canvasEl.parentNode;
203
+ } else {
204
+ container.interactivity.element = container.canvas.element;
205
+ }
206
+ const mediaMatch = !isSsr() && typeof matchMedia !== "undefined" && matchMedia("(prefers-color-scheme: dark)");
207
+ if (mediaMatch) {
208
+ if (mediaMatch.addEventListener !== undefined) {
209
+ manageListener(mediaMatch, "change", this.themeChangeHandler, add);
210
+ } else if (mediaMatch.addListener !== undefined) {
211
+ if (add) {
212
+ mediaMatch.addListener(this.oldThemeChangeHandler);
213
+ } else {
214
+ mediaMatch.removeListener(this.oldThemeChangeHandler);
215
+ }
216
+ }
217
+ }
218
+ const interactivityEl = container.interactivity.element;
219
+ if (!interactivityEl) {
220
+ return;
221
+ }
222
+ const html = interactivityEl;
223
+ if (options.interactivity.events.onHover.enable || options.interactivity.events.onClick.enable) {
224
+ manageListener(interactivityEl, Constants.mouseMoveEvent, this.mouseMoveHandler, add);
225
+ manageListener(interactivityEl, Constants.touchStartEvent, this.touchStartHandler, add);
226
+ manageListener(interactivityEl, Constants.touchMoveEvent, this.touchMoveHandler, add);
227
+ if (!options.interactivity.events.onClick.enable) {
228
+ manageListener(interactivityEl, Constants.touchEndEvent, this.touchEndHandler, add);
229
+ } else {
230
+ manageListener(interactivityEl, Constants.touchEndEvent, this.touchEndClickHandler, add);
231
+ manageListener(interactivityEl, Constants.mouseUpEvent, this.mouseUpHandler, add);
232
+ manageListener(interactivityEl, Constants.mouseDownEvent, this.mouseDownHandler, add);
233
+ }
234
+ manageListener(interactivityEl, mouseLeaveEvent, this.mouseLeaveHandler, add);
235
+ manageListener(interactivityEl, Constants.touchCancelEvent, this.touchCancelHandler, add);
236
+ }
237
+ if (container.canvas.element) {
238
+ container.canvas.element.style.pointerEvents = html === container.canvas.element ? "initial" : "none";
239
+ }
240
+ if (options.interactivity.events.resize) {
241
+ if (typeof ResizeObserver !== "undefined") {
242
+ if (this.resizeObserver && !add) {
243
+ if (container.canvas.element) {
244
+ this.resizeObserver.unobserve(container.canvas.element);
245
+ }
246
+ this.resizeObserver.disconnect();
247
+ delete this.resizeObserver;
248
+ } else if (!this.resizeObserver && add && container.canvas.element) {
249
+ this.resizeObserver = new ResizeObserver((entries => {
250
+ const entry = entries.find((e => e.target === container.canvas.element));
251
+ if (!entry) {
252
+ return;
253
+ }
254
+ this.handleWindowResize();
255
+ }));
256
+ this.resizeObserver.observe(container.canvas.element);
257
+ }
258
+ } else {
259
+ manageListener(window, Constants.resizeEvent, this.resizeHandler, add);
260
+ }
261
+ }
262
+ if (document) {
263
+ manageListener(document, Constants.visibilityChangeEvent, this.visibilityChangeHandler, add, false);
264
+ }
265
+ }
266
+ handleWindowResize() {
267
+ if (this.resizeTimeout) {
268
+ clearTimeout(this.resizeTimeout);
269
+ delete this.resizeTimeout;
270
+ }
271
+ this.resizeTimeout = setTimeout((async () => {
272
+ var _a;
273
+ return await ((_a = this.container.canvas) === null || _a === void 0 ? void 0 : _a.windowResize());
274
+ }), 500);
275
+ }
276
+ handleVisibilityChange() {
277
+ const container = this.container;
278
+ const options = container.actualOptions;
279
+ this.mouseTouchFinish();
280
+ if (!options.pauseOnBlur) {
281
+ return;
282
+ }
283
+ if (document === null || document === void 0 ? void 0 : document.hidden) {
284
+ container.pageHidden = true;
285
+ container.pause();
286
+ } else {
287
+ container.pageHidden = false;
288
+ if (container.getAnimationStatus()) {
289
+ container.play(true);
290
+ } else {
291
+ container.draw(true);
292
+ }
293
+ }
294
+ }
295
+ mouseDown() {
296
+ const interactivity = this.container.interactivity;
297
+ if (interactivity) {
298
+ const mouse = interactivity.mouse;
299
+ mouse.clicking = true;
300
+ mouse.downPosition = mouse.position;
301
+ }
302
+ }
303
+ mouseTouchMove(e) {
304
+ var _a, _b, _c, _d, _e, _f, _g;
305
+ const container = this.container;
306
+ const options = container.actualOptions;
307
+ if (((_a = container.interactivity) === null || _a === void 0 ? void 0 : _a.element) === undefined) {
308
+ return;
309
+ }
310
+ container.interactivity.mouse.inside = true;
311
+ let pos;
312
+ const canvas = container.canvas.element;
313
+ if (e.type.startsWith("mouse")) {
314
+ this.canPush = true;
315
+ const mouseEvent = e;
316
+ if (container.interactivity.element === window) {
317
+ if (canvas) {
318
+ const clientRect = canvas.getBoundingClientRect();
319
+ pos = {
320
+ x: mouseEvent.clientX - clientRect.left,
321
+ y: mouseEvent.clientY - clientRect.top
322
+ };
323
+ }
324
+ } else if (options.interactivity.detectsOn === "parent") {
325
+ const source = mouseEvent.target;
326
+ const target = mouseEvent.currentTarget;
327
+ const canvasEl = container.canvas.element;
328
+ if (source && target && canvasEl) {
329
+ const sourceRect = source.getBoundingClientRect();
330
+ const targetRect = target.getBoundingClientRect();
331
+ const canvasRect = canvasEl.getBoundingClientRect();
332
+ pos = {
333
+ x: mouseEvent.offsetX + 2 * sourceRect.left - (targetRect.left + canvasRect.left),
334
+ y: mouseEvent.offsetY + 2 * sourceRect.top - (targetRect.top + canvasRect.top)
335
+ };
336
+ } else {
337
+ pos = {
338
+ x: (_b = mouseEvent.offsetX) !== null && _b !== void 0 ? _b : mouseEvent.clientX,
339
+ y: (_c = mouseEvent.offsetY) !== null && _c !== void 0 ? _c : mouseEvent.clientY
340
+ };
341
+ }
342
+ } else {
343
+ if (mouseEvent.target === container.canvas.element) {
344
+ pos = {
345
+ x: (_d = mouseEvent.offsetX) !== null && _d !== void 0 ? _d : mouseEvent.clientX,
346
+ y: (_e = mouseEvent.offsetY) !== null && _e !== void 0 ? _e : mouseEvent.clientY
347
+ };
348
+ }
349
+ }
350
+ } else {
351
+ this.canPush = e.type !== "touchmove";
352
+ const touchEvent = e;
353
+ const lastTouch = touchEvent.touches[touchEvent.touches.length - 1];
354
+ const canvasRect = canvas === null || canvas === void 0 ? void 0 : canvas.getBoundingClientRect();
355
+ pos = {
356
+ x: lastTouch.clientX - ((_f = canvasRect === null || canvasRect === void 0 ? void 0 : canvasRect.left) !== null && _f !== void 0 ? _f : 0),
357
+ y: lastTouch.clientY - ((_g = canvasRect === null || canvasRect === void 0 ? void 0 : canvasRect.top) !== null && _g !== void 0 ? _g : 0)
358
+ };
359
+ }
360
+ const pxRatio = container.retina.pixelRatio;
361
+ if (pos) {
362
+ pos.x *= pxRatio;
363
+ pos.y *= pxRatio;
364
+ }
365
+ container.interactivity.mouse.position = pos;
366
+ container.interactivity.status = Constants.mouseMoveEvent;
367
+ }
368
+ mouseTouchFinish() {
369
+ const interactivity = this.container.interactivity;
370
+ if (interactivity === undefined) {
371
+ return;
372
+ }
373
+ const mouse = interactivity.mouse;
374
+ delete mouse.position;
375
+ delete mouse.clickPosition;
376
+ delete mouse.downPosition;
377
+ interactivity.status = Constants.mouseLeaveEvent;
378
+ mouse.inside = false;
379
+ mouse.clicking = false;
380
+ }
381
+ mouseTouchClick(e) {
382
+ const container = this.container;
383
+ const options = container.actualOptions;
384
+ const mouse = container.interactivity.mouse;
385
+ mouse.inside = true;
386
+ let handled = false;
387
+ const mousePosition = mouse.position;
388
+ if (mousePosition === undefined || !options.interactivity.events.onClick.enable) {
389
+ return;
390
+ }
391
+ for (const [, plugin] of container.plugins) {
392
+ if (plugin.clickPositionValid !== undefined) {
393
+ handled = plugin.clickPositionValid(mousePosition);
394
+ if (handled) {
395
+ break;
396
+ }
397
+ }
398
+ }
399
+ if (!handled) {
400
+ this.doMouseTouchClick(e);
401
+ }
402
+ mouse.clicking = false;
403
+ }
404
+ doMouseTouchClick(e) {
405
+ const container = this.container;
406
+ const options = container.actualOptions;
407
+ if (this.canPush) {
408
+ const mousePos = container.interactivity.mouse.position;
409
+ if (mousePos) {
410
+ container.interactivity.mouse.clickPosition = {
411
+ x: mousePos.x,
412
+ y: mousePos.y
413
+ };
414
+ } else {
415
+ return;
416
+ }
417
+ container.interactivity.mouse.clickTime = (new Date).getTime();
418
+ const onClick = options.interactivity.events.onClick;
419
+ if (onClick.mode instanceof Array) {
420
+ for (const mode of onClick.mode) {
421
+ this.handleClickMode(mode);
422
+ }
423
+ } else {
424
+ this.handleClickMode(onClick.mode);
425
+ }
426
+ }
427
+ if (e.type === "touchend") {
428
+ setTimeout((() => this.mouseTouchFinish()), 500);
429
+ }
430
+ }
431
+ handleThemeChange(e) {
432
+ const mediaEvent = e;
433
+ const themeName = mediaEvent.matches ? this.container.options.defaultDarkTheme : this.container.options.defaultLightTheme;
434
+ const theme = this.container.options.themes.find((theme => theme.name === themeName));
435
+ if (theme && theme.default.auto) {
436
+ this.container.loadTheme(themeName);
437
+ }
438
+ }
439
+ handleClickMode(mode) {
440
+ const container = this.container;
441
+ const options = container.actualOptions;
442
+ const pushNb = options.interactivity.modes.push.quantity;
443
+ const removeNb = options.interactivity.modes.remove.quantity;
444
+ switch (mode) {
445
+ case "push":
446
+ {
447
+ if (pushNb > 0) {
448
+ const pushOptions = options.interactivity.modes.push;
449
+ const group = itemFromArray([ undefined, ...pushOptions.groups ]);
450
+ const groupOptions = group !== undefined ? container.actualOptions.particles.groups[group] : undefined;
451
+ container.particles.push(pushNb, container.interactivity.mouse, groupOptions, group);
452
+ }
453
+ break;
454
+ }
455
+
456
+ case "remove":
457
+ container.particles.removeQuantity(removeNb);
458
+ break;
459
+
460
+ case "bubble":
461
+ container.bubble.clicking = true;
462
+ break;
463
+
464
+ case "repulse":
465
+ container.repulse.clicking = true;
466
+ container.repulse.count = 0;
467
+ for (const particle of container.repulse.particles) {
468
+ particle.velocity.setTo(particle.initialVelocity);
469
+ }
470
+ container.repulse.particles = [];
471
+ container.repulse.finish = false;
472
+ setTimeout((() => {
473
+ if (!container.destroyed) {
474
+ container.repulse.clicking = false;
475
+ }
476
+ }), options.interactivity.modes.repulse.duration * 1e3);
477
+ break;
478
+
479
+ case "attract":
480
+ container.attract.clicking = true;
481
+ container.attract.count = 0;
482
+ for (const particle of container.attract.particles) {
483
+ particle.velocity.setTo(particle.initialVelocity);
484
+ }
485
+ container.attract.particles = [];
486
+ container.attract.finish = false;
487
+ setTimeout((() => {
488
+ if (!container.destroyed) {
489
+ container.attract.clicking = false;
490
+ }
491
+ }), options.interactivity.modes.attract.duration * 1e3);
492
+ break;
493
+
494
+ case "pause":
495
+ if (container.getAnimationStatus()) {
496
+ container.pause();
497
+ } else {
498
+ container.play();
499
+ }
500
+ break;
501
+ }
502
+ for (const [, plugin] of container.plugins) {
503
+ if (plugin.handleClickMode) {
504
+ plugin.handleClickMode(mode);
505
+ }
506
+ }
507
+ }
508
+ }
509
+ class InteractionManager_InteractionManager {
510
+ constructor(container) {
511
+ this.container = container;
512
+ this.externalInteractors = [];
513
+ this.particleInteractors = [];
514
+ this.init();
515
+ }
516
+ init() {
517
+ const interactors = Plugins.getInteractors(this.container, true);
518
+ this.externalInteractors = [];
519
+ this.particleInteractors = [];
520
+ for (const interactor of interactors) {
521
+ switch (interactor.type) {
522
+ case 0:
523
+ this.externalInteractors.push(interactor);
524
+ break;
525
+
526
+ case 1:
527
+ this.particleInteractors.push(interactor);
528
+ break;
529
+ }
530
+ }
531
+ }
532
+ externalInteract(delta) {
533
+ for (const interactor of this.externalInteractors) {
534
+ if (interactor.isEnabled()) {
535
+ interactor.interact(delta);
536
+ }
537
+ }
538
+ }
539
+ particlesInteract(particle, delta) {
540
+ for (const interactor of this.externalInteractors) {
541
+ interactor.reset(particle);
542
+ }
543
+ for (const interactor of this.particleInteractors) {
544
+ if (interactor.isEnabled(particle)) {
545
+ interactor.interact(particle, delta);
546
+ }
547
+ }
548
+ }
549
+ }
550
+ function applyDistance(particle) {
551
+ const initialPosition = particle.initialPosition;
552
+ const {dx: dx, dy: dy} = getDistances(initialPosition, particle.position);
553
+ const dxFixed = Math.abs(dx), dyFixed = Math.abs(dy);
554
+ const hDistance = particle.retina.maxDistance.horizontal;
555
+ const vDistance = particle.retina.maxDistance.vertical;
556
+ if (!hDistance && !vDistance) {
557
+ return;
558
+ }
559
+ if ((hDistance && dxFixed >= hDistance || vDistance && dyFixed >= vDistance) && !particle.misplaced) {
560
+ particle.misplaced = !!hDistance && dxFixed > hDistance || !!vDistance && dyFixed > vDistance;
561
+ if (hDistance) {
562
+ particle.velocity.x = particle.velocity.y / 2 - particle.velocity.x;
563
+ }
564
+ if (vDistance) {
565
+ particle.velocity.y = particle.velocity.x / 2 - particle.velocity.y;
566
+ }
567
+ } else if ((!hDistance || dxFixed < hDistance) && (!vDistance || dyFixed < vDistance) && particle.misplaced) {
568
+ particle.misplaced = false;
569
+ } else if (particle.misplaced) {
570
+ const pos = particle.position, vel = particle.velocity;
571
+ if (hDistance && (pos.x < initialPosition.x && vel.x < 0 || pos.x > initialPosition.x && vel.x > 0)) {
572
+ vel.x *= -Math.random();
573
+ }
574
+ if (vDistance && (pos.y < initialPosition.y && vel.y < 0 || pos.y > initialPosition.y && vel.y > 0)) {
575
+ vel.y *= -Math.random();
576
+ }
577
+ }
578
+ }
579
+ class ParticlesMover_ParticlesMover {
580
+ constructor(container) {
581
+ this.container = container;
582
+ }
583
+ move(particle, delta) {
584
+ if (particle.destroyed) {
585
+ return;
586
+ }
587
+ this.moveParticle(particle, delta);
588
+ this.moveParallax(particle);
589
+ }
590
+ moveParticle(particle, delta) {
591
+ var _a, _b, _c;
592
+ var _d, _e;
593
+ const particleOptions = particle.options;
594
+ const moveOptions = particleOptions.move;
595
+ if (!moveOptions.enable) {
596
+ return;
597
+ }
598
+ const container = this.container, slowFactor = this.getProximitySpeedFactor(particle), baseSpeed = ((_a = (_d = particle.retina).moveSpeed) !== null && _a !== void 0 ? _a : _d.moveSpeed = getRangeValue(moveOptions.speed) * container.retina.pixelRatio) * container.retina.reduceFactor, moveDrift = (_b = (_e = particle.retina).moveDrift) !== null && _b !== void 0 ? _b : _e.moveDrift = getRangeValue(particle.options.move.drift) * container.retina.pixelRatio, maxSize = getRangeMax(particleOptions.size.value) * container.retina.pixelRatio, sizeFactor = moveOptions.size ? particle.getRadius() / maxSize : 1, diffFactor = 2, speedFactor = sizeFactor * slowFactor * (delta.factor || 1) / diffFactor, moveSpeed = baseSpeed * speedFactor;
599
+ this.applyPath(particle, delta);
600
+ const gravityOptions = moveOptions.gravity;
601
+ const gravityFactor = gravityOptions.enable && gravityOptions.inverse ? -1 : 1;
602
+ if (gravityOptions.enable && moveSpeed) {
603
+ particle.velocity.y += gravityFactor * (gravityOptions.acceleration * delta.factor) / (60 * moveSpeed);
604
+ }
605
+ if (moveDrift && moveSpeed) {
606
+ particle.velocity.x += moveDrift * delta.factor / (60 * moveSpeed);
607
+ }
608
+ const decay = particle.moveDecay;
609
+ if (decay != 1) {
610
+ particle.velocity.multTo(decay);
611
+ }
612
+ const velocity = particle.velocity.mult(moveSpeed);
613
+ const maxSpeed = (_c = particle.retina.maxSpeed) !== null && _c !== void 0 ? _c : container.retina.maxSpeed;
614
+ if (gravityOptions.enable && gravityOptions.maxSpeed > 0 && (!gravityOptions.inverse && velocity.y >= 0 && velocity.y >= maxSpeed || gravityOptions.inverse && velocity.y <= 0 && velocity.y <= -maxSpeed)) {
615
+ velocity.y = gravityFactor * maxSpeed;
616
+ if (moveSpeed) {
617
+ particle.velocity.y = velocity.y / moveSpeed;
618
+ }
619
+ }
620
+ const zIndexOptions = particle.options.zIndex, zVelocityFactor = (1 - particle.zIndexFactor) ** zIndexOptions.velocityRate;
621
+ if (moveOptions.spin.enable) {
622
+ this.spin(particle, moveSpeed);
623
+ } else {
624
+ if (zVelocityFactor != 1) {
625
+ velocity.multTo(zVelocityFactor);
626
+ }
627
+ particle.position.addTo(velocity);
628
+ if (moveOptions.vibrate) {
629
+ particle.position.x += Math.sin(particle.position.x * Math.cos(particle.position.y));
630
+ particle.position.y += Math.cos(particle.position.y * Math.sin(particle.position.x));
631
+ }
632
+ }
633
+ applyDistance(particle);
634
+ }
635
+ spin(particle, moveSpeed) {
636
+ const container = this.container;
637
+ if (!particle.spin) {
638
+ return;
639
+ }
640
+ const updateFunc = {
641
+ x: particle.spin.direction === "clockwise" ? Math.cos : Math.sin,
642
+ y: particle.spin.direction === "clockwise" ? Math.sin : Math.cos
643
+ };
644
+ particle.position.x = particle.spin.center.x + particle.spin.radius * updateFunc.x(particle.spin.angle);
645
+ particle.position.y = particle.spin.center.y + particle.spin.radius * updateFunc.y(particle.spin.angle);
646
+ particle.spin.radius += particle.spin.acceleration;
647
+ const maxCanvasSize = Math.max(container.canvas.size.width, container.canvas.size.height);
648
+ if (particle.spin.radius > maxCanvasSize / 2) {
649
+ particle.spin.radius = maxCanvasSize / 2;
650
+ particle.spin.acceleration *= -1;
651
+ } else if (particle.spin.radius < 0) {
652
+ particle.spin.radius = 0;
653
+ particle.spin.acceleration *= -1;
654
+ }
655
+ particle.spin.angle += moveSpeed / 100 * (1 - particle.spin.radius / maxCanvasSize);
656
+ }
657
+ applyPath(particle, delta) {
658
+ const particlesOptions = particle.options;
659
+ const pathOptions = particlesOptions.move.path;
660
+ const pathEnabled = pathOptions.enable;
661
+ if (!pathEnabled) {
662
+ return;
663
+ }
664
+ const container = this.container;
665
+ if (particle.lastPathTime <= particle.pathDelay) {
666
+ particle.lastPathTime += delta.value;
667
+ return;
668
+ }
669
+ const path = container.pathGenerator.generate(particle);
670
+ particle.velocity.addTo(path);
671
+ if (pathOptions.clamp) {
672
+ particle.velocity.x = clamp(particle.velocity.x, -1, 1);
673
+ particle.velocity.y = clamp(particle.velocity.y, -1, 1);
674
+ }
675
+ particle.lastPathTime -= particle.pathDelay;
676
+ }
677
+ moveParallax(particle) {
678
+ const container = this.container;
679
+ const options = container.actualOptions;
680
+ if (isSsr() || !options.interactivity.events.onHover.parallax.enable) {
681
+ return;
682
+ }
683
+ const parallaxForce = options.interactivity.events.onHover.parallax.force;
684
+ const mousePos = container.interactivity.mouse.position;
685
+ if (!mousePos) {
686
+ return;
687
+ }
688
+ const canvasCenter = {
689
+ x: container.canvas.size.width / 2,
690
+ y: container.canvas.size.height / 2
691
+ };
692
+ const parallaxSmooth = options.interactivity.events.onHover.parallax.smooth;
693
+ const factor = particle.getRadius() / parallaxForce;
694
+ const tmp = {
695
+ x: (mousePos.x - canvasCenter.x) * factor,
696
+ y: (mousePos.y - canvasCenter.y) * factor
697
+ };
698
+ particle.offset.x += (tmp.x - particle.offset.x) / parallaxSmooth;
699
+ particle.offset.y += (tmp.y - particle.offset.y) / parallaxSmooth;
700
+ }
701
+ getProximitySpeedFactor(particle) {
702
+ const container = this.container;
703
+ const options = container.actualOptions;
704
+ const active = isInArray("slow", options.interactivity.events.onHover.mode);
705
+ if (!active) {
706
+ return 1;
707
+ }
708
+ const mousePos = this.container.interactivity.mouse.position;
709
+ if (!mousePos) {
710
+ return 1;
711
+ }
712
+ const particlePos = particle.getPosition();
713
+ const dist = getDistance(mousePos, particlePos);
714
+ const radius = container.retina.slowModeRadius;
715
+ if (dist > radius) {
716
+ return 1;
717
+ }
718
+ const proximityFactor = dist / radius || 0;
719
+ const slowFactor = options.interactivity.modes.slow.factor;
720
+ return proximityFactor / slowFactor;
721
+ }
722
+ }
723
+ const plugins = null && [];
724
+ const interactorsInitializers = new Map;
725
+ const updatersInitializers = new Map;
726
+ const interactors = new Map;
727
+ const updaters = new Map;
728
+ const presets = new Map;
729
+ const drawers = new Map;
730
+ const pathGenerators = new Map;
731
+ class Plugins_Plugins {
732
+ static getPlugin(plugin) {
733
+ return plugins.find((t => t.id === plugin));
734
+ }
735
+ static addPlugin(plugin) {
736
+ if (!Plugins_Plugins.getPlugin(plugin.id)) {
737
+ plugins.push(plugin);
738
+ }
739
+ }
740
+ static getAvailablePlugins(container) {
741
+ const res = new Map;
742
+ for (const plugin of plugins) {
743
+ if (!plugin.needsPlugin(container.actualOptions)) {
744
+ continue;
745
+ }
746
+ res.set(plugin.id, plugin.getPlugin(container));
747
+ }
748
+ return res;
749
+ }
750
+ static loadOptions(options, sourceOptions) {
751
+ for (const plugin of plugins) {
752
+ plugin.loadOptions(options, sourceOptions);
753
+ }
754
+ }
755
+ static getPreset(preset) {
756
+ return presets.get(preset);
757
+ }
758
+ static addPreset(presetKey, options, override = false) {
759
+ if (override || !Plugins_Plugins.getPreset(presetKey)) {
760
+ presets.set(presetKey, options);
761
+ }
762
+ }
763
+ static addShapeDrawer(type, drawer) {
764
+ if (!Plugins_Plugins.getShapeDrawer(type)) {
765
+ drawers.set(type, drawer);
766
+ }
767
+ }
768
+ static getShapeDrawer(type) {
769
+ return drawers.get(type);
770
+ }
771
+ static getSupportedShapes() {
772
+ return drawers.keys();
773
+ }
774
+ static getPathGenerator(type) {
775
+ return pathGenerators.get(type);
776
+ }
777
+ static addPathGenerator(type, pathGenerator) {
778
+ if (!Plugins_Plugins.getPathGenerator(type)) {
779
+ pathGenerators.set(type, pathGenerator);
780
+ }
781
+ }
782
+ static getInteractors(container, force = false) {
783
+ let res = interactors.get(container);
784
+ if (!res || force) {
785
+ res = [ ...interactorsInitializers.values() ].map((t => t(container)));
786
+ interactors.set(container, res);
787
+ }
788
+ return res;
789
+ }
790
+ static addInteractor(name, initInteractor) {
791
+ interactorsInitializers.set(name, initInteractor);
792
+ }
793
+ static getUpdaters(container, force = false) {
794
+ let res = updaters.get(container);
795
+ if (!res || force) {
796
+ res = [ ...updatersInitializers.values() ].map((t => t(container)));
797
+ updaters.set(container, res);
798
+ }
799
+ return res;
800
+ }
801
+ static addParticleUpdater(name, initUpdater) {
802
+ updatersInitializers.set(name, initUpdater);
803
+ }
804
+ }
805
+ class QuadTree_QuadTree {
806
+ constructor(rectangle, capacity) {
807
+ this.rectangle = rectangle;
808
+ this.capacity = capacity;
809
+ this.points = [];
810
+ this.divided = false;
811
+ }
812
+ subdivide() {
813
+ const x = this.rectangle.position.x;
814
+ const y = this.rectangle.position.y;
815
+ const w = this.rectangle.size.width;
816
+ const h = this.rectangle.size.height;
817
+ const capacity = this.capacity;
818
+ this.northEast = new QuadTree_QuadTree(new Rectangle(x, y, w / 2, h / 2), capacity);
819
+ this.northWest = new QuadTree_QuadTree(new Rectangle(x + w / 2, y, w / 2, h / 2), capacity);
820
+ this.southEast = new QuadTree_QuadTree(new Rectangle(x, y + h / 2, w / 2, h / 2), capacity);
821
+ this.southWest = new QuadTree_QuadTree(new Rectangle(x + w / 2, y + h / 2, w / 2, h / 2), capacity);
822
+ this.divided = true;
823
+ }
824
+ insert(point) {
825
+ var _a, _b, _c, _d, _e;
826
+ if (!this.rectangle.contains(point.position)) {
827
+ return false;
828
+ }
829
+ if (this.points.length < this.capacity) {
830
+ this.points.push(point);
831
+ return true;
832
+ }
833
+ if (!this.divided) {
834
+ this.subdivide();
835
+ }
836
+ return (_e = ((_a = this.northEast) === null || _a === void 0 ? void 0 : _a.insert(point)) || ((_b = this.northWest) === null || _b === void 0 ? void 0 : _b.insert(point)) || ((_c = this.southEast) === null || _c === void 0 ? void 0 : _c.insert(point)) || ((_d = this.southWest) === null || _d === void 0 ? void 0 : _d.insert(point))) !== null && _e !== void 0 ? _e : false;
837
+ }
838
+ queryCircle(position, radius) {
839
+ return this.query(new Circle(position.x, position.y, radius));
840
+ }
841
+ queryCircleWarp(position, radius, containerOrSize) {
842
+ const container = containerOrSize;
843
+ const size = containerOrSize;
844
+ return this.query(new CircleWarp(position.x, position.y, radius, container.canvas !== undefined ? container.canvas.size : size));
845
+ }
846
+ queryRectangle(position, size) {
847
+ return this.query(new Rectangle(position.x, position.y, size.width, size.height));
848
+ }
849
+ query(range, found) {
850
+ var _a, _b, _c, _d;
851
+ const res = found !== null && found !== void 0 ? found : [];
852
+ if (!range.intersects(this.rectangle)) {
853
+ return [];
854
+ } else {
855
+ for (const p of this.points) {
856
+ if (!range.contains(p.position) && getDistance(range.position, p.position) > p.particle.getRadius()) {
857
+ continue;
858
+ }
859
+ res.push(p.particle);
860
+ }
861
+ if (this.divided) {
862
+ (_a = this.northEast) === null || _a === void 0 ? void 0 : _a.query(range, res);
863
+ (_b = this.northWest) === null || _b === void 0 ? void 0 : _b.query(range, res);
864
+ (_c = this.southEast) === null || _c === void 0 ? void 0 : _c.query(range, res);
865
+ (_d = this.southWest) === null || _d === void 0 ? void 0 : _d.query(range, res);
866
+ }
867
+ }
868
+ return res;
869
+ }
870
+ }
871
+ class Canvas_Canvas {
872
+ constructor(container) {
873
+ this.container = container;
874
+ this.size = {
875
+ height: 0,
876
+ width: 0
877
+ };
878
+ this.context = null;
879
+ this.generatedCanvas = false;
880
+ }
881
+ init() {
882
+ this.resize();
883
+ this.initStyle();
884
+ this.initCover();
885
+ this.initTrail();
886
+ this.initBackground();
887
+ this.paint();
888
+ }
889
+ loadCanvas(canvas) {
890
+ var _a;
891
+ if (this.generatedCanvas) {
892
+ (_a = this.element) === null || _a === void 0 ? void 0 : _a.remove();
893
+ }
894
+ this.generatedCanvas = canvas.dataset && Constants.generatedAttribute in canvas.dataset ? canvas.dataset[Constants.generatedAttribute] === "true" : this.generatedCanvas;
895
+ this.element = canvas;
896
+ this.originalStyle = deepExtend({}, this.element.style);
897
+ this.size.height = canvas.offsetHeight;
898
+ this.size.width = canvas.offsetWidth;
899
+ this.context = this.element.getContext("2d");
900
+ this.container.retina.init();
901
+ this.initBackground();
902
+ }
903
+ destroy() {
904
+ var _a;
905
+ if (this.generatedCanvas) {
906
+ (_a = this.element) === null || _a === void 0 ? void 0 : _a.remove();
907
+ }
908
+ this.draw((ctx => {
909
+ clear(ctx, this.size);
910
+ }));
911
+ }
912
+ paint() {
913
+ const options = this.container.actualOptions;
914
+ this.draw((ctx => {
915
+ if (options.backgroundMask.enable && options.backgroundMask.cover && this.coverColor) {
916
+ clear(ctx, this.size);
917
+ this.paintBase(getStyleFromRgb(this.coverColor, this.coverColor.a));
918
+ } else {
919
+ this.paintBase();
920
+ }
921
+ }));
922
+ }
923
+ clear() {
924
+ const options = this.container.actualOptions;
925
+ const trail = options.particles.move.trail;
926
+ if (options.backgroundMask.enable) {
927
+ this.paint();
928
+ } else if (trail.enable && trail.length > 0 && this.trailFillColor) {
929
+ this.paintBase(getStyleFromRgb(this.trailFillColor, 1 / trail.length));
930
+ } else {
931
+ this.draw((ctx => {
932
+ clear(ctx, this.size);
933
+ }));
934
+ }
935
+ }
936
+ async windowResize() {
937
+ if (!this.element) {
938
+ return;
939
+ }
940
+ const container = this.container;
941
+ this.resize();
942
+ const needsRefresh = container.updateActualOptions();
943
+ container.particles.setDensity();
944
+ for (const [, plugin] of container.plugins) {
945
+ if (plugin.resize !== undefined) {
946
+ plugin.resize();
947
+ }
948
+ }
949
+ if (needsRefresh) {
950
+ await container.refresh();
951
+ }
952
+ }
953
+ resize() {
954
+ if (!this.element) {
955
+ return;
956
+ }
957
+ const container = this.container;
958
+ const pxRatio = container.retina.pixelRatio;
959
+ const size = container.canvas.size;
960
+ const oldSize = {
961
+ width: size.width,
962
+ height: size.height
963
+ };
964
+ size.width = this.element.offsetWidth * pxRatio;
965
+ size.height = this.element.offsetHeight * pxRatio;
966
+ this.element.width = size.width;
967
+ this.element.height = size.height;
968
+ if (this.container.started) {
969
+ this.resizeFactor = {
970
+ width: size.width / oldSize.width,
971
+ height: size.height / oldSize.height
972
+ };
973
+ }
974
+ }
975
+ drawConnectLine(p1, p2) {
976
+ this.draw((ctx => {
977
+ var _a;
978
+ const lineStyle = this.lineStyle(p1, p2);
979
+ if (!lineStyle) {
980
+ return;
981
+ }
982
+ const pos1 = p1.getPosition();
983
+ const pos2 = p2.getPosition();
984
+ drawConnectLine(ctx, (_a = p1.retina.linksWidth) !== null && _a !== void 0 ? _a : this.container.retina.linksWidth, lineStyle, pos1, pos2);
985
+ }));
986
+ }
987
+ drawGrabLine(particle, lineColor, opacity, mousePos) {
988
+ const container = this.container;
989
+ this.draw((ctx => {
990
+ var _a;
991
+ const beginPos = particle.getPosition();
992
+ drawGrabLine(ctx, (_a = particle.retina.linksWidth) !== null && _a !== void 0 ? _a : container.retina.linksWidth, beginPos, mousePos, lineColor, opacity);
993
+ }));
994
+ }
995
+ drawParticle(particle, delta) {
996
+ var _a, _b, _c, _d, _e, _f;
997
+ if (particle.spawning || particle.destroyed) {
998
+ return;
999
+ }
1000
+ const pfColor = particle.getFillColor();
1001
+ const psColor = (_a = particle.getStrokeColor()) !== null && _a !== void 0 ? _a : pfColor;
1002
+ if (!pfColor && !psColor) {
1003
+ return;
1004
+ }
1005
+ let [fColor, sColor] = this.getPluginParticleColors(particle);
1006
+ const pOptions = particle.options;
1007
+ const twinkle = pOptions.twinkle.particles;
1008
+ const twinkling = twinkle.enable && Math.random() < twinkle.frequency;
1009
+ if (!fColor || !sColor) {
1010
+ const twinkleRgb = colorToHsl(twinkle.color);
1011
+ if (!fColor) {
1012
+ fColor = twinkling && twinkleRgb !== undefined ? twinkleRgb : pfColor ? pfColor : undefined;
1013
+ }
1014
+ if (!sColor) {
1015
+ sColor = twinkling && twinkleRgb !== undefined ? twinkleRgb : psColor ? psColor : undefined;
1016
+ }
1017
+ }
1018
+ const options = this.container.actualOptions;
1019
+ const zIndexOptions = particle.options.zIndex;
1020
+ const zOpacityFactor = (1 - particle.zIndexFactor) ** zIndexOptions.opacityRate;
1021
+ const radius = particle.getRadius();
1022
+ const opacity = twinkling ? twinkle.opacity : (_d = (_b = particle.bubble.opacity) !== null && _b !== void 0 ? _b : (_c = particle.opacity) === null || _c === void 0 ? void 0 : _c.value) !== null && _d !== void 0 ? _d : 1;
1023
+ const strokeOpacity = (_f = (_e = particle.stroke) === null || _e === void 0 ? void 0 : _e.opacity) !== null && _f !== void 0 ? _f : opacity;
1024
+ const zOpacity = opacity * zOpacityFactor;
1025
+ const fillColorValue = fColor ? getStyleFromHsl(fColor, zOpacity) : undefined;
1026
+ if (!fillColorValue && !sColor) {
1027
+ return;
1028
+ }
1029
+ this.draw((ctx => {
1030
+ const zSizeFactor = (1 - particle.zIndexFactor) ** zIndexOptions.sizeRate;
1031
+ const zStrokeOpacity = strokeOpacity * zOpacityFactor;
1032
+ const strokeColorValue = sColor ? getStyleFromHsl(sColor, zStrokeOpacity) : fillColorValue;
1033
+ if (radius <= 0) {
1034
+ return;
1035
+ }
1036
+ const container = this.container;
1037
+ for (const updater of container.particles.updaters) {
1038
+ if (updater.beforeDraw) {
1039
+ updater.beforeDraw(particle);
1040
+ }
1041
+ }
1042
+ drawParticle(this.container, ctx, particle, delta, fillColorValue, strokeColorValue, options.backgroundMask.enable, options.backgroundMask.composite, radius * zSizeFactor, zOpacity, particle.options.shadow, particle.gradient);
1043
+ for (const updater of container.particles.updaters) {
1044
+ if (updater.afterDraw) {
1045
+ updater.afterDraw(particle);
1046
+ }
1047
+ }
1048
+ }));
1049
+ }
1050
+ drawPlugin(plugin, delta) {
1051
+ this.draw((ctx => {
1052
+ drawPlugin(ctx, plugin, delta);
1053
+ }));
1054
+ }
1055
+ drawParticlePlugin(plugin, particle, delta) {
1056
+ this.draw((ctx => {
1057
+ drawParticlePlugin(ctx, plugin, particle, delta);
1058
+ }));
1059
+ }
1060
+ initBackground() {
1061
+ const options = this.container.actualOptions;
1062
+ const background = options.background;
1063
+ const element = this.element;
1064
+ const elementStyle = element === null || element === void 0 ? void 0 : element.style;
1065
+ if (!elementStyle) {
1066
+ return;
1067
+ }
1068
+ if (background.color) {
1069
+ const color = colorToRgb(background.color);
1070
+ elementStyle.backgroundColor = color ? getStyleFromRgb(color, background.opacity) : "";
1071
+ } else {
1072
+ elementStyle.backgroundColor = "";
1073
+ }
1074
+ elementStyle.backgroundImage = background.image || "";
1075
+ elementStyle.backgroundPosition = background.position || "";
1076
+ elementStyle.backgroundRepeat = background.repeat || "";
1077
+ elementStyle.backgroundSize = background.size || "";
1078
+ }
1079
+ draw(cb) {
1080
+ if (!this.context) {
1081
+ return;
1082
+ }
1083
+ return cb(this.context);
1084
+ }
1085
+ initCover() {
1086
+ const options = this.container.actualOptions;
1087
+ const cover = options.backgroundMask.cover;
1088
+ const color = cover.color;
1089
+ const coverRgb = colorToRgb(color);
1090
+ if (coverRgb) {
1091
+ this.coverColor = {
1092
+ r: coverRgb.r,
1093
+ g: coverRgb.g,
1094
+ b: coverRgb.b,
1095
+ a: cover.opacity
1096
+ };
1097
+ }
1098
+ }
1099
+ initTrail() {
1100
+ const options = this.container.actualOptions;
1101
+ const trail = options.particles.move.trail;
1102
+ const fillColor = colorToRgb(trail.fillColor);
1103
+ if (fillColor) {
1104
+ const trail = options.particles.move.trail;
1105
+ this.trailFillColor = {
1106
+ r: fillColor.r,
1107
+ g: fillColor.g,
1108
+ b: fillColor.b,
1109
+ a: 1 / trail.length
1110
+ };
1111
+ }
1112
+ }
1113
+ getPluginParticleColors(particle) {
1114
+ let fColor;
1115
+ let sColor;
1116
+ for (const [, plugin] of this.container.plugins) {
1117
+ if (!fColor && plugin.particleFillColor) {
1118
+ fColor = colorToHsl(plugin.particleFillColor(particle));
1119
+ }
1120
+ if (!sColor && plugin.particleStrokeColor) {
1121
+ sColor = colorToHsl(plugin.particleStrokeColor(particle));
1122
+ }
1123
+ if (fColor && sColor) {
1124
+ break;
1125
+ }
1126
+ }
1127
+ return [ fColor, sColor ];
1128
+ }
1129
+ initStyle() {
1130
+ const element = this.element, options = this.container.actualOptions;
1131
+ if (!element) {
1132
+ return;
1133
+ }
1134
+ const originalStyle = this.originalStyle;
1135
+ if (options.fullScreen.enable) {
1136
+ this.originalStyle = deepExtend({}, element.style);
1137
+ element.style.setProperty("position", "fixed", "important");
1138
+ element.style.setProperty("z-index", options.fullScreen.zIndex.toString(10), "important");
1139
+ element.style.setProperty("top", "0", "important");
1140
+ element.style.setProperty("left", "0", "important");
1141
+ element.style.setProperty("width", "100%", "important");
1142
+ element.style.setProperty("height", "100%", "important");
1143
+ } else if (originalStyle) {
1144
+ element.style.position = originalStyle.position;
1145
+ element.style.zIndex = originalStyle.zIndex;
1146
+ element.style.top = originalStyle.top;
1147
+ element.style.left = originalStyle.left;
1148
+ element.style.width = originalStyle.width;
1149
+ element.style.height = originalStyle.height;
1150
+ }
1151
+ for (const key in options.style) {
1152
+ if (!key || !options.style) {
1153
+ continue;
1154
+ }
1155
+ const value = options.style[key];
1156
+ if (!value) {
1157
+ continue;
1158
+ }
1159
+ element.style.setProperty(key, value, "important");
1160
+ }
1161
+ }
1162
+ paintBase(baseColor) {
1163
+ this.draw((ctx => {
1164
+ paintBase(ctx, this.size, baseColor);
1165
+ }));
1166
+ }
1167
+ lineStyle(p1, p2) {
1168
+ return this.draw((ctx => {
1169
+ const options = this.container.actualOptions;
1170
+ const connectOptions = options.interactivity.modes.connect;
1171
+ return gradient(ctx, p1, p2, connectOptions.links.opacity);
1172
+ }));
1173
+ }
1174
+ }
1175
+ class Trail_Trail {
1176
+ constructor() {
1177
+ this.delay = 1;
1178
+ this.pauseOnStop = false;
1179
+ this.quantity = 1;
1180
+ }
1181
+ load(data) {
1182
+ if (data === undefined) {
1183
+ return;
1184
+ }
1185
+ if (data.delay !== undefined) {
1186
+ this.delay = data.delay;
1187
+ }
1188
+ if (data.quantity !== undefined) {
1189
+ this.quantity = data.quantity;
1190
+ }
1191
+ if (data.particles !== undefined) {
1192
+ this.particles = deepExtend({}, data.particles);
1193
+ }
1194
+ if (data.pauseOnStop !== undefined) {
1195
+ this.pauseOnStop = data.pauseOnStop;
1196
+ }
1197
+ }
1198
+ }
1199
+ class Modes_Modes {
1200
+ constructor() {
1201
+ this.attract = new Attract;
1202
+ this.bounce = new Bounce;
1203
+ this.bubble = new Bubble;
1204
+ this.connect = new Connect;
1205
+ this.grab = new Grab;
1206
+ this.light = new Light;
1207
+ this.push = new Push;
1208
+ this.remove = new Remove;
1209
+ this.repulse = new Repulse;
1210
+ this.slow = new Slow;
1211
+ this.trail = new Trail;
1212
+ }
1213
+ load(data) {
1214
+ if (data === undefined) {
1215
+ return;
1216
+ }
1217
+ this.attract.load(data.attract);
1218
+ this.bubble.load(data.bubble);
1219
+ this.connect.load(data.connect);
1220
+ this.grab.load(data.grab);
1221
+ this.light.load(data.light);
1222
+ this.push.load(data.push);
1223
+ this.remove.load(data.remove);
1224
+ this.repulse.load(data.repulse);
1225
+ this.slow.load(data.slow);
1226
+ this.trail.load(data.trail);
1227
+ }
1228
+ }
1229
+ class Interactivity_Interactivity {
1230
+ constructor() {
1231
+ this.detectsOn = "window";
1232
+ this.events = new Events;
1233
+ this.modes = new Modes;
1234
+ }
1235
+ get detect_on() {
1236
+ return this.detectsOn;
1237
+ }
1238
+ set detect_on(value) {
1239
+ this.detectsOn = value;
1240
+ }
1241
+ load(data) {
1242
+ var _a, _b, _c;
1243
+ if (data === undefined) {
1244
+ return;
1245
+ }
1246
+ const detectsOn = (_a = data.detectsOn) !== null && _a !== void 0 ? _a : data.detect_on;
1247
+ if (detectsOn !== undefined) {
1248
+ this.detectsOn = detectsOn;
1249
+ }
1250
+ this.events.load(data.events);
1251
+ this.modes.load(data.modes);
1252
+ if (((_c = (_b = data.modes) === null || _b === void 0 ? void 0 : _b.slow) === null || _c === void 0 ? void 0 : _c.active) === true) {
1253
+ if (this.events.onHover.mode instanceof Array) {
1254
+ if (this.events.onHover.mode.indexOf("slow") < 0) {
1255
+ this.events.onHover.mode.push("slow");
1256
+ }
1257
+ } else if (this.events.onHover.mode !== "slow") {
1258
+ this.events.onHover.mode = [ this.events.onHover.mode, "slow" ];
1259
+ }
1260
+ }
1261
+ }
1262
+ }
1263
+ class ManualParticle_ManualParticle {
1264
+ load(data) {
1265
+ var _a, _b;
1266
+ if (!data) {
1267
+ return;
1268
+ }
1269
+ if (data.position !== undefined) {
1270
+ this.position = {
1271
+ x: (_a = data.position.x) !== null && _a !== void 0 ? _a : 50,
1272
+ y: (_b = data.position.y) !== null && _b !== void 0 ? _b : 50
1273
+ };
1274
+ }
1275
+ if (data.options !== undefined) {
1276
+ this.options = deepExtend({}, data.options);
1277
+ }
1278
+ }
1279
+ }
1280
+ class ColorAnimation_ColorAnimation {
1281
+ constructor() {
1282
+ this.count = 0;
1283
+ this.enable = false;
1284
+ this.offset = 0;
1285
+ this.speed = 1;
1286
+ this.sync = true;
1287
+ }
1288
+ load(data) {
1289
+ if (data === undefined) {
1290
+ return;
1291
+ }
1292
+ if (data.count !== undefined) {
1293
+ this.count = data.count;
1294
+ }
1295
+ if (data.enable !== undefined) {
1296
+ this.enable = data.enable;
1297
+ }
1298
+ if (data.offset !== undefined) {
1299
+ this.offset = setRangeValue(data.offset);
1300
+ }
1301
+ if (data.speed !== undefined) {
1302
+ this.speed = data.speed;
1303
+ }
1304
+ if (data.sync !== undefined) {
1305
+ this.sync = data.sync;
1306
+ }
1307
+ }
1308
+ }
1309
+ class HslAnimation_HslAnimation {
1310
+ constructor() {
1311
+ this.h = new ColorAnimation;
1312
+ this.s = new ColorAnimation;
1313
+ this.l = new ColorAnimation;
1314
+ }
1315
+ load(data) {
1316
+ if (!data) {
1317
+ return;
1318
+ }
1319
+ this.h.load(data.h);
1320
+ this.s.load(data.s);
1321
+ this.l.load(data.l);
1322
+ }
1323
+ }
1324
+ class AnimatableColor_AnimatableColor extends(null && OptionsColor){
1325
+ constructor() {
1326
+ super();
1327
+ this.animation = new HslAnimation;
1328
+ }
1329
+ static create(source, data) {
1330
+ const color = new AnimatableColor_AnimatableColor;
1331
+ color.load(source);
1332
+ if (data !== undefined) {
1333
+ if (typeof data === "string" || data instanceof Array) {
1334
+ color.load({
1335
+ value: data
1336
+ });
1337
+ } else {
1338
+ color.load(data);
1339
+ }
1340
+ }
1341
+ return color;
1342
+ }
1343
+ load(data) {
1344
+ super.load(data);
1345
+ if (!data) {
1346
+ return;
1347
+ }
1348
+ const colorAnimation = data.animation;
1349
+ if (colorAnimation !== undefined) {
1350
+ if (colorAnimation.enable !== undefined) {
1351
+ this.animation.h.load(colorAnimation);
1352
+ } else {
1353
+ this.animation.load(data.animation);
1354
+ }
1355
+ }
1356
+ }
1357
+ }
1358
+ class AnimatableGradient_AnimatableGradient {
1359
+ constructor() {
1360
+ this.angle = new GradientAngle;
1361
+ this.colors = [];
1362
+ this.type = "random";
1363
+ }
1364
+ load(data) {
1365
+ if (!data) {
1366
+ return;
1367
+ }
1368
+ this.angle.load(data.angle);
1369
+ if (data.colors !== undefined) {
1370
+ this.colors = data.colors.map((s => {
1371
+ const tmp = new AnimatableGradientColor;
1372
+ tmp.load(s);
1373
+ return tmp;
1374
+ }));
1375
+ }
1376
+ if (data.type !== undefined) {
1377
+ this.type = data.type;
1378
+ }
1379
+ }
1380
+ }
1381
+ class GradientAngle {
1382
+ constructor() {
1383
+ this.value = 0;
1384
+ this.animation = new GradientAngleAnimation;
1385
+ this.direction = "clockwise";
1386
+ }
1387
+ load(data) {
1388
+ if (!data) {
1389
+ return;
1390
+ }
1391
+ this.animation.load(data.animation);
1392
+ if (data.value !== undefined) {
1393
+ this.value = data.value;
1394
+ }
1395
+ if (data.direction !== undefined) {
1396
+ this.direction = data.direction;
1397
+ }
1398
+ }
1399
+ }
1400
+ class GradientColorOpacity {
1401
+ constructor() {
1402
+ this.value = 0;
1403
+ this.animation = new GradientColorOpacityAnimation;
1404
+ }
1405
+ load(data) {
1406
+ if (!data) {
1407
+ return;
1408
+ }
1409
+ this.animation.load(data.animation);
1410
+ if (data.value !== undefined) {
1411
+ this.value = setRangeValue(data.value);
1412
+ }
1413
+ }
1414
+ }
1415
+ class AnimatableGradientColor {
1416
+ constructor() {
1417
+ this.stop = 0;
1418
+ this.value = new AnimatableColor;
1419
+ }
1420
+ load(data) {
1421
+ if (!data) {
1422
+ return;
1423
+ }
1424
+ if (data.stop !== undefined) {
1425
+ this.stop = data.stop;
1426
+ }
1427
+ this.value = AnimatableColor.create(this.value, data.value);
1428
+ if (data.opacity !== undefined) {
1429
+ this.opacity = new GradientColorOpacity;
1430
+ if (typeof data.opacity === "number") {
1431
+ this.opacity.value = data.opacity;
1432
+ } else {
1433
+ this.opacity.load(data.opacity);
1434
+ }
1435
+ }
1436
+ }
1437
+ }
1438
+ class GradientAngleAnimation {
1439
+ constructor() {
1440
+ this.count = 0;
1441
+ this.enable = false;
1442
+ this.speed = 0;
1443
+ this.sync = false;
1444
+ }
1445
+ load(data) {
1446
+ if (!data) {
1447
+ return;
1448
+ }
1449
+ if (data.count !== undefined) {
1450
+ this.count = data.count;
1451
+ }
1452
+ if (data.enable !== undefined) {
1453
+ this.enable = data.enable;
1454
+ }
1455
+ if (data.speed !== undefined) {
1456
+ this.speed = data.speed;
1457
+ }
1458
+ if (data.sync !== undefined) {
1459
+ this.sync = data.sync;
1460
+ }
1461
+ }
1462
+ }
1463
+ class GradientColorOpacityAnimation {
1464
+ constructor() {
1465
+ this.count = 0;
1466
+ this.enable = false;
1467
+ this.speed = 0;
1468
+ this.sync = false;
1469
+ this.startValue = "random";
1470
+ }
1471
+ load(data) {
1472
+ if (!data) {
1473
+ return;
1474
+ }
1475
+ if (data.count !== undefined) {
1476
+ this.count = data.count;
1477
+ }
1478
+ if (data.enable !== undefined) {
1479
+ this.enable = data.enable;
1480
+ }
1481
+ if (data.speed !== undefined) {
1482
+ this.speed = data.speed;
1483
+ }
1484
+ if (data.sync !== undefined) {
1485
+ this.sync = data.sync;
1486
+ }
1487
+ if (data.startValue !== undefined) {
1488
+ this.startValue = data.startValue;
1489
+ }
1490
+ }
1491
+ }
1492
+ class ValueWithRandom_ValueWithRandom {
1493
+ constructor() {
1494
+ this.random = new Random;
1495
+ this.value = 0;
1496
+ }
1497
+ load(data) {
1498
+ if (!data) {
1499
+ return;
1500
+ }
1501
+ if (typeof data.random === "boolean") {
1502
+ this.random.enable = data.random;
1503
+ } else {
1504
+ this.random.load(data.random);
1505
+ }
1506
+ if (data.value !== undefined) {
1507
+ this.value = setRangeValue(data.value, this.random.enable ? this.random.minimumValue : undefined);
1508
+ }
1509
+ }
1510
+ }
1511
+ class BounceFactor_BounceFactor extends(null && ValueWithRandom){
1512
+ constructor() {
1513
+ super();
1514
+ this.random.minimumValue = .1;
1515
+ this.value = 1;
1516
+ }
1517
+ }
1518
+ class Bounce_Bounce {
1519
+ constructor() {
1520
+ this.horizontal = new BounceFactor;
1521
+ this.vertical = new BounceFactor;
1522
+ }
1523
+ load(data) {
1524
+ if (!data) {
1525
+ return;
1526
+ }
1527
+ this.horizontal.load(data.horizontal);
1528
+ this.vertical.load(data.vertical);
1529
+ }
1530
+ }
1531
+ class Collisions_Collisions {
1532
+ constructor() {
1533
+ this.bounce = new Bounce;
1534
+ this.enable = false;
1535
+ this.mode = "bounce";
1536
+ this.overlap = new CollisionsOverlap;
1537
+ }
1538
+ load(data) {
1539
+ if (data === undefined) {
1540
+ return;
1541
+ }
1542
+ this.bounce.load(data.bounce);
1543
+ if (data.enable !== undefined) {
1544
+ this.enable = data.enable;
1545
+ }
1546
+ if (data.mode !== undefined) {
1547
+ this.mode = data.mode;
1548
+ }
1549
+ this.overlap.load(data.overlap);
1550
+ }
1551
+ }
1552
+ class SplitFactor_SplitFactor extends(null && ValueWithRandom){
1553
+ constructor() {
1554
+ super();
1555
+ this.value = 3;
1556
+ }
1557
+ }
1558
+ class SplitRate_SplitRate extends(null && ValueWithRandom){
1559
+ constructor() {
1560
+ super();
1561
+ this.value = {
1562
+ min: 4,
1563
+ max: 9
1564
+ };
1565
+ }
1566
+ }
1567
+ class Split_Split {
1568
+ constructor() {
1569
+ this.count = 1;
1570
+ this.factor = new SplitFactor;
1571
+ this.rate = new SplitRate;
1572
+ this.sizeOffset = true;
1573
+ }
1574
+ load(data) {
1575
+ if (!data) {
1576
+ return;
1577
+ }
1578
+ if (data.count !== undefined) {
1579
+ this.count = data.count;
1580
+ }
1581
+ this.factor.load(data.factor);
1582
+ this.rate.load(data.rate);
1583
+ if (data.particles !== undefined) {
1584
+ this.particles = deepExtend({}, data.particles);
1585
+ }
1586
+ if (data.sizeOffset !== undefined) {
1587
+ this.sizeOffset = data.sizeOffset;
1588
+ }
1589
+ }
1590
+ }
1591
+ class Destroy_Destroy {
1592
+ constructor() {
1593
+ this.mode = "none";
1594
+ this.split = new Split;
1595
+ }
1596
+ load(data) {
1597
+ if (!data) {
1598
+ return;
1599
+ }
1600
+ if (data.mode !== undefined) {
1601
+ this.mode = data.mode;
1602
+ }
1603
+ this.split.load(data.split);
1604
+ }
1605
+ }
1606
+ class LifeDelay_LifeDelay extends(null && ValueWithRandom){
1607
+ constructor() {
1608
+ super();
1609
+ this.sync = false;
1610
+ }
1611
+ load(data) {
1612
+ if (!data) {
1613
+ return;
1614
+ }
1615
+ super.load(data);
1616
+ if (data.sync !== undefined) {
1617
+ this.sync = data.sync;
1618
+ }
1619
+ }
1620
+ }
1621
+ class LifeDuration_LifeDuration extends(null && ValueWithRandom){
1622
+ constructor() {
1623
+ super();
1624
+ this.random.minimumValue = 1e-4;
1625
+ this.sync = false;
1626
+ }
1627
+ load(data) {
1628
+ if (data === undefined) {
1629
+ return;
1630
+ }
1631
+ super.load(data);
1632
+ if (data.sync !== undefined) {
1633
+ this.sync = data.sync;
1634
+ }
1635
+ }
1636
+ }
1637
+ class Life_Life {
1638
+ constructor() {
1639
+ this.count = 0;
1640
+ this.delay = new LifeDelay;
1641
+ this.duration = new LifeDuration;
1642
+ }
1643
+ load(data) {
1644
+ if (data === undefined) {
1645
+ return;
1646
+ }
1647
+ if (data.count !== undefined) {
1648
+ this.count = data.count;
1649
+ }
1650
+ this.delay.load(data.delay);
1651
+ this.duration.load(data.duration);
1652
+ }
1653
+ }
1654
+ class PathDelay_PathDelay extends(null && ValueWithRandom){
1655
+ constructor() {
1656
+ super();
1657
+ }
1658
+ }
1659
+ class Path_Path {
1660
+ constructor() {
1661
+ this.clamp = true;
1662
+ this.delay = new PathDelay;
1663
+ this.enable = false;
1664
+ this.options = {};
1665
+ }
1666
+ load(data) {
1667
+ if (data === undefined) {
1668
+ return;
1669
+ }
1670
+ if (data.clamp !== undefined) {
1671
+ this.clamp = data.clamp;
1672
+ }
1673
+ this.delay.load(data.delay);
1674
+ if (data.enable !== undefined) {
1675
+ this.enable = data.enable;
1676
+ }
1677
+ this.generator = data.generator;
1678
+ if (data.options) {
1679
+ this.options = deepExtend(this.options, data.options);
1680
+ }
1681
+ }
1682
+ }
1683
+ class Spin_Spin {
1684
+ constructor() {
1685
+ this.acceleration = 0;
1686
+ this.enable = false;
1687
+ }
1688
+ load(data) {
1689
+ if (!data) {
1690
+ return;
1691
+ }
1692
+ if (data.acceleration !== undefined) {
1693
+ this.acceleration = setRangeValue(data.acceleration);
1694
+ }
1695
+ if (data.enable !== undefined) {
1696
+ this.enable = data.enable;
1697
+ }
1698
+ this.position = data.position ? deepExtend({}, data.position) : undefined;
1699
+ }
1700
+ }
1701
+ class Move_Move {
1702
+ constructor() {
1703
+ this.angle = new MoveAngle;
1704
+ this.attract = new Attract;
1705
+ this.decay = 0;
1706
+ this.distance = {};
1707
+ this.direction = "none";
1708
+ this.drift = 0;
1709
+ this.enable = false;
1710
+ this.gravity = new MoveGravity;
1711
+ this.path = new Path;
1712
+ this.outModes = new OutModes;
1713
+ this.random = false;
1714
+ this.size = false;
1715
+ this.speed = 2;
1716
+ this.spin = new Spin;
1717
+ this.straight = false;
1718
+ this.trail = new Trail;
1719
+ this.vibrate = false;
1720
+ this.warp = false;
1721
+ }
1722
+ get collisions() {
1723
+ return false;
1724
+ }
1725
+ set collisions(value) {}
1726
+ get bounce() {
1727
+ return this.collisions;
1728
+ }
1729
+ set bounce(value) {
1730
+ this.collisions = value;
1731
+ }
1732
+ get out_mode() {
1733
+ return this.outMode;
1734
+ }
1735
+ set out_mode(value) {
1736
+ this.outMode = value;
1737
+ }
1738
+ get outMode() {
1739
+ return this.outModes.default;
1740
+ }
1741
+ set outMode(value) {
1742
+ this.outModes.default = value;
1743
+ }
1744
+ get noise() {
1745
+ return this.path;
1746
+ }
1747
+ set noise(value) {
1748
+ this.path = value;
1749
+ }
1750
+ load(data) {
1751
+ var _a, _b, _c;
1752
+ if (data === undefined) {
1753
+ return;
1754
+ }
1755
+ if (data.angle !== undefined) {
1756
+ if (typeof data.angle === "number") {
1757
+ this.angle.value = data.angle;
1758
+ } else {
1759
+ this.angle.load(data.angle);
1760
+ }
1761
+ }
1762
+ this.attract.load(data.attract);
1763
+ if (data.decay !== undefined) {
1764
+ this.decay = data.decay;
1765
+ }
1766
+ if (data.direction !== undefined) {
1767
+ this.direction = data.direction;
1768
+ }
1769
+ if (data.distance !== undefined) {
1770
+ this.distance = typeof data.distance === "number" ? {
1771
+ horizontal: data.distance,
1772
+ vertical: data.distance
1773
+ } : deepExtend({}, data.distance);
1774
+ }
1775
+ if (data.drift !== undefined) {
1776
+ this.drift = setRangeValue(data.drift);
1777
+ }
1778
+ if (data.enable !== undefined) {
1779
+ this.enable = data.enable;
1780
+ }
1781
+ this.gravity.load(data.gravity);
1782
+ const outMode = (_a = data.outMode) !== null && _a !== void 0 ? _a : data.out_mode;
1783
+ if (data.outModes !== undefined || outMode !== undefined) {
1784
+ if (typeof data.outModes === "string" || data.outModes === undefined && outMode !== undefined) {
1785
+ this.outModes.load({
1786
+ default: (_b = data.outModes) !== null && _b !== void 0 ? _b : outMode
1787
+ });
1788
+ } else {
1789
+ this.outModes.load(data.outModes);
1790
+ }
1791
+ }
1792
+ this.path.load((_c = data.path) !== null && _c !== void 0 ? _c : data.noise);
1793
+ if (data.random !== undefined) {
1794
+ this.random = data.random;
1795
+ }
1796
+ if (data.size !== undefined) {
1797
+ this.size = data.size;
1798
+ }
1799
+ if (data.speed !== undefined) {
1800
+ this.speed = setRangeValue(data.speed);
1801
+ }
1802
+ this.spin.load(data.spin);
1803
+ if (data.straight !== undefined) {
1804
+ this.straight = data.straight;
1805
+ }
1806
+ this.trail.load(data.trail);
1807
+ if (data.vibrate !== undefined) {
1808
+ this.vibrate = data.vibrate;
1809
+ }
1810
+ if (data.warp !== undefined) {
1811
+ this.warp = data.warp;
1812
+ }
1813
+ }
1814
+ }
1815
+ class Opacity_Opacity extends(null && ValueWithRandom){
1816
+ constructor() {
1817
+ super();
1818
+ this.animation = new OpacityAnimation;
1819
+ this.random.minimumValue = .1;
1820
+ this.value = 1;
1821
+ }
1822
+ get anim() {
1823
+ return this.animation;
1824
+ }
1825
+ set anim(value) {
1826
+ this.animation = value;
1827
+ }
1828
+ load(data) {
1829
+ var _a;
1830
+ if (!data) {
1831
+ return;
1832
+ }
1833
+ super.load(data);
1834
+ const animation = (_a = data.animation) !== null && _a !== void 0 ? _a : data.anim;
1835
+ if (animation !== undefined) {
1836
+ this.animation.load(animation);
1837
+ this.value = setRangeValue(this.value, this.animation.enable ? this.animation.minimumValue : undefined);
1838
+ }
1839
+ }
1840
+ }
1841
+ class OrbitRotation_OrbitRotation extends(null && ValueWithRandom){
1842
+ constructor() {
1843
+ super();
1844
+ this.value = 45;
1845
+ this.random.enable = false;
1846
+ this.random.minimumValue = 0;
1847
+ }
1848
+ load(data) {
1849
+ if (data === undefined) {
1850
+ return;
1851
+ }
1852
+ super.load(data);
1853
+ }
1854
+ }
1855
+ class Orbit_Orbit {
1856
+ constructor() {
1857
+ this.animation = new AnimationOptions;
1858
+ this.enable = false;
1859
+ this.opacity = 1;
1860
+ this.rotation = new OrbitRotation;
1861
+ this.width = 1;
1862
+ }
1863
+ load(data) {
1864
+ if (data === undefined) {
1865
+ return;
1866
+ }
1867
+ this.animation.load(data.animation);
1868
+ this.rotation.load(data.rotation);
1869
+ if (data.enable !== undefined) {
1870
+ this.enable = data.enable;
1871
+ }
1872
+ if (data.opacity !== undefined) {
1873
+ this.opacity = data.opacity;
1874
+ }
1875
+ if (data.width !== undefined) {
1876
+ this.width = data.width;
1877
+ }
1878
+ if (data.radius !== undefined) {
1879
+ this.radius = data.radius;
1880
+ }
1881
+ if (data.color !== undefined) {
1882
+ this.color = OptionsColor.create(this.color, data.color);
1883
+ }
1884
+ }
1885
+ }
1886
+ class Repulse_Repulse extends(null && ValueWithRandom){
1887
+ constructor() {
1888
+ super();
1889
+ this.enabled = false;
1890
+ this.distance = 1;
1891
+ this.duration = 1;
1892
+ this.factor = 1;
1893
+ this.speed = 1;
1894
+ }
1895
+ load(data) {
1896
+ super.load(data);
1897
+ if (!data) {
1898
+ return;
1899
+ }
1900
+ if (data.enabled !== undefined) {
1901
+ this.enabled = data.enabled;
1902
+ }
1903
+ if (data.distance !== undefined) {
1904
+ this.distance = data.distance;
1905
+ }
1906
+ if (data.duration !== undefined) {
1907
+ this.duration = data.duration;
1908
+ }
1909
+ if (data.factor !== undefined) {
1910
+ this.factor = data.factor;
1911
+ }
1912
+ if (data.speed !== undefined) {
1913
+ this.speed = data.speed;
1914
+ }
1915
+ }
1916
+ }
1917
+ class Roll_Roll {
1918
+ constructor() {
1919
+ this.darken = new RollLight;
1920
+ this.enable = false;
1921
+ this.enlighten = new RollLight;
1922
+ this.mode = "vertical";
1923
+ this.speed = 25;
1924
+ }
1925
+ load(data) {
1926
+ if (!data) {
1927
+ return;
1928
+ }
1929
+ if (data.backColor !== undefined) {
1930
+ this.backColor = OptionsColor.create(this.backColor, data.backColor);
1931
+ }
1932
+ this.darken.load(data.darken);
1933
+ if (data.enable !== undefined) {
1934
+ this.enable = data.enable;
1935
+ }
1936
+ this.enlighten.load(data.enlighten);
1937
+ if (data.mode !== undefined) {
1938
+ this.mode = data.mode;
1939
+ }
1940
+ if (data.speed !== undefined) {
1941
+ this.speed = setRangeValue(data.speed);
1942
+ }
1943
+ }
1944
+ }
1945
+ class Rotate_Rotate extends(null && ValueWithRandom){
1946
+ constructor() {
1947
+ super();
1948
+ this.animation = new RotateAnimation;
1949
+ this.direction = "clockwise";
1950
+ this.path = false;
1951
+ this.value = 0;
1952
+ }
1953
+ load(data) {
1954
+ if (!data) {
1955
+ return;
1956
+ }
1957
+ super.load(data);
1958
+ if (data.direction !== undefined) {
1959
+ this.direction = data.direction;
1960
+ }
1961
+ this.animation.load(data.animation);
1962
+ if (data.path !== undefined) {
1963
+ this.path = data.path;
1964
+ }
1965
+ }
1966
+ }
1967
+ class Shape_Shape {
1968
+ constructor() {
1969
+ this.options = {};
1970
+ this.type = "circle";
1971
+ }
1972
+ get image() {
1973
+ var _a;
1974
+ return (_a = this.options["image"]) !== null && _a !== void 0 ? _a : this.options["images"];
1975
+ }
1976
+ set image(value) {
1977
+ this.options["image"] = value;
1978
+ this.options["images"] = value;
1979
+ }
1980
+ get custom() {
1981
+ return this.options;
1982
+ }
1983
+ set custom(value) {
1984
+ this.options = value;
1985
+ }
1986
+ get images() {
1987
+ return this.image;
1988
+ }
1989
+ set images(value) {
1990
+ this.image = value;
1991
+ }
1992
+ get stroke() {
1993
+ return [];
1994
+ }
1995
+ set stroke(_value) {}
1996
+ get character() {
1997
+ var _a;
1998
+ return (_a = this.options["character"]) !== null && _a !== void 0 ? _a : this.options["char"];
1999
+ }
2000
+ set character(value) {
2001
+ this.options["character"] = value;
2002
+ this.options["char"] = value;
2003
+ }
2004
+ get polygon() {
2005
+ var _a;
2006
+ return (_a = this.options["polygon"]) !== null && _a !== void 0 ? _a : this.options["star"];
2007
+ }
2008
+ set polygon(value) {
2009
+ this.options["polygon"] = value;
2010
+ this.options["star"] = value;
2011
+ }
2012
+ load(data) {
2013
+ var _a, _b, _c;
2014
+ if (data === undefined) {
2015
+ return;
2016
+ }
2017
+ const options = (_a = data.options) !== null && _a !== void 0 ? _a : data.custom;
2018
+ if (options !== undefined) {
2019
+ for (const shape in options) {
2020
+ const item = options[shape];
2021
+ if (item !== undefined) {
2022
+ this.options[shape] = deepExtend((_b = this.options[shape]) !== null && _b !== void 0 ? _b : {}, item);
2023
+ }
2024
+ }
2025
+ }
2026
+ this.loadShape(data.character, "character", "char", true);
2027
+ this.loadShape(data.polygon, "polygon", "star", false);
2028
+ this.loadShape((_c = data.image) !== null && _c !== void 0 ? _c : data.images, "image", "images", true);
2029
+ if (data.type !== undefined) {
2030
+ this.type = data.type;
2031
+ }
2032
+ }
2033
+ loadShape(item, mainKey, altKey, altOverride) {
2034
+ var _a, _b, _c, _d;
2035
+ if (item === undefined) {
2036
+ return;
2037
+ }
2038
+ if (item instanceof Array) {
2039
+ if (!(this.options[mainKey] instanceof Array)) {
2040
+ this.options[mainKey] = [];
2041
+ if (!this.options[altKey] || altOverride) {
2042
+ this.options[altKey] = [];
2043
+ }
2044
+ }
2045
+ this.options[mainKey] = deepExtend((_a = this.options[mainKey]) !== null && _a !== void 0 ? _a : [], item);
2046
+ if (!this.options[altKey] || altOverride) {
2047
+ this.options[altKey] = deepExtend((_b = this.options[altKey]) !== null && _b !== void 0 ? _b : [], item);
2048
+ }
2049
+ } else {
2050
+ if (this.options[mainKey] instanceof Array) {
2051
+ this.options[mainKey] = {};
2052
+ if (!this.options[altKey] || altOverride) {
2053
+ this.options[altKey] = {};
2054
+ }
2055
+ }
2056
+ this.options[mainKey] = deepExtend((_c = this.options[mainKey]) !== null && _c !== void 0 ? _c : {}, item);
2057
+ if (!this.options[altKey] || altOverride) {
2058
+ this.options[altKey] = deepExtend((_d = this.options[altKey]) !== null && _d !== void 0 ? _d : {}, item);
2059
+ }
2060
+ }
2061
+ }
2062
+ }
2063
+ class Size_Size extends(null && ValueWithRandom){
2064
+ constructor() {
2065
+ super();
2066
+ this.animation = new SizeAnimation;
2067
+ this.random.minimumValue = 1;
2068
+ this.value = 3;
2069
+ }
2070
+ get anim() {
2071
+ return this.animation;
2072
+ }
2073
+ set anim(value) {
2074
+ this.animation = value;
2075
+ }
2076
+ load(data) {
2077
+ var _a;
2078
+ if (!data) {
2079
+ return;
2080
+ }
2081
+ super.load(data);
2082
+ const animation = (_a = data.animation) !== null && _a !== void 0 ? _a : data.anim;
2083
+ if (animation !== undefined) {
2084
+ this.animation.load(animation);
2085
+ this.value = setRangeValue(this.value, this.animation.enable ? this.animation.minimumValue : undefined);
2086
+ }
2087
+ }
2088
+ }
2089
+ class Stroke_Stroke {
2090
+ constructor() {
2091
+ this.width = 0;
2092
+ }
2093
+ load(data) {
2094
+ if (data === undefined) {
2095
+ return;
2096
+ }
2097
+ if (data.color !== undefined) {
2098
+ this.color = AnimatableColor.create(this.color, data.color);
2099
+ }
2100
+ if (data.width !== undefined) {
2101
+ this.width = data.width;
2102
+ }
2103
+ if (data.opacity !== undefined) {
2104
+ this.opacity = data.opacity;
2105
+ }
2106
+ }
2107
+ }
2108
+ class Tilt_Tilt extends(null && ValueWithRandom){
2109
+ constructor() {
2110
+ super();
2111
+ this.animation = new TiltAnimation;
2112
+ this.direction = "clockwise";
2113
+ this.enable = false;
2114
+ this.value = 0;
2115
+ }
2116
+ load(data) {
2117
+ if (!data) {
2118
+ return;
2119
+ }
2120
+ super.load(data);
2121
+ this.animation.load(data.animation);
2122
+ if (data.direction !== undefined) {
2123
+ this.direction = data.direction;
2124
+ }
2125
+ if (data.enable !== undefined) {
2126
+ this.enable = data.enable;
2127
+ }
2128
+ }
2129
+ }
2130
+ class Wobble_Wobble {
2131
+ constructor() {
2132
+ this.distance = 5;
2133
+ this.enable = false;
2134
+ this.speed = 50;
2135
+ }
2136
+ load(data) {
2137
+ if (!data) {
2138
+ return;
2139
+ }
2140
+ if (data.distance !== undefined) {
2141
+ this.distance = setRangeValue(data.distance);
2142
+ }
2143
+ if (data.enable !== undefined) {
2144
+ this.enable = data.enable;
2145
+ }
2146
+ if (data.speed !== undefined) {
2147
+ this.speed = setRangeValue(data.speed);
2148
+ }
2149
+ }
2150
+ }
2151
+ class ZIndex_ZIndex extends(null && ValueWithRandom){
2152
+ constructor() {
2153
+ super();
2154
+ this.opacityRate = 1;
2155
+ this.sizeRate = 1;
2156
+ this.velocityRate = 1;
2157
+ }
2158
+ load(data) {
2159
+ super.load(data);
2160
+ if (!data) {
2161
+ return;
2162
+ }
2163
+ if (data.opacityRate !== undefined) {
2164
+ this.opacityRate = data.opacityRate;
2165
+ }
2166
+ if (data.sizeRate !== undefined) {
2167
+ this.sizeRate = data.sizeRate;
2168
+ }
2169
+ if (data.velocityRate !== undefined) {
2170
+ this.velocityRate = data.velocityRate;
2171
+ }
2172
+ }
2173
+ }
2174
+ class ParticlesOptions_ParticlesOptions {
2175
+ constructor() {
2176
+ this.bounce = new Bounce;
2177
+ this.collisions = new Collisions;
2178
+ this.color = new AnimatableColor;
2179
+ this.destroy = new Destroy;
2180
+ this.gradient = [];
2181
+ this.groups = {};
2182
+ this.life = new Life;
2183
+ this.links = new Links;
2184
+ this.move = new Move;
2185
+ this.number = new ParticlesNumber;
2186
+ this.opacity = new Opacity;
2187
+ this.orbit = new Orbit;
2188
+ this.reduceDuplicates = false;
2189
+ this.repulse = new Repulse;
2190
+ this.roll = new Roll;
2191
+ this.rotate = new Rotate;
2192
+ this.shadow = new Shadow;
2193
+ this.shape = new Shape;
2194
+ this.size = new Size;
2195
+ this.stroke = new Stroke;
2196
+ this.tilt = new Tilt;
2197
+ this.twinkle = new Twinkle;
2198
+ this.wobble = new Wobble;
2199
+ this.zIndex = new ZIndex;
2200
+ }
2201
+ get line_linked() {
2202
+ return this.links;
2203
+ }
2204
+ set line_linked(value) {
2205
+ this.links = value;
2206
+ }
2207
+ get lineLinked() {
2208
+ return this.links;
2209
+ }
2210
+ set lineLinked(value) {
2211
+ this.links = value;
2212
+ }
2213
+ load(data) {
2214
+ var _a, _b, _c, _d, _e, _f, _g, _h;
2215
+ if (data === undefined) {
2216
+ return;
2217
+ }
2218
+ this.bounce.load(data.bounce);
2219
+ this.color.load(AnimatableColor.create(this.color, data.color));
2220
+ this.destroy.load(data.destroy);
2221
+ this.life.load(data.life);
2222
+ const links = (_b = (_a = data.links) !== null && _a !== void 0 ? _a : data.lineLinked) !== null && _b !== void 0 ? _b : data.line_linked;
2223
+ if (links !== undefined) {
2224
+ this.links.load(links);
2225
+ }
2226
+ if (data.groups !== undefined) {
2227
+ for (const group in data.groups) {
2228
+ const item = data.groups[group];
2229
+ if (item !== undefined) {
2230
+ this.groups[group] = deepExtend((_c = this.groups[group]) !== null && _c !== void 0 ? _c : {}, item);
2231
+ }
2232
+ }
2233
+ }
2234
+ this.move.load(data.move);
2235
+ this.number.load(data.number);
2236
+ this.opacity.load(data.opacity);
2237
+ this.orbit.load(data.orbit);
2238
+ if (data.reduceDuplicates !== undefined) {
2239
+ this.reduceDuplicates = data.reduceDuplicates;
2240
+ }
2241
+ this.repulse.load(data.repulse);
2242
+ this.roll.load(data.roll);
2243
+ this.rotate.load(data.rotate);
2244
+ this.shape.load(data.shape);
2245
+ this.size.load(data.size);
2246
+ this.shadow.load(data.shadow);
2247
+ this.tilt.load(data.tilt);
2248
+ this.twinkle.load(data.twinkle);
2249
+ this.wobble.load(data.wobble);
2250
+ this.zIndex.load(data.zIndex);
2251
+ const collisions = (_e = (_d = data.move) === null || _d === void 0 ? void 0 : _d.collisions) !== null && _e !== void 0 ? _e : (_f = data.move) === null || _f === void 0 ? void 0 : _f.bounce;
2252
+ if (collisions !== undefined) {
2253
+ this.collisions.enable = collisions;
2254
+ }
2255
+ this.collisions.load(data.collisions);
2256
+ const strokeToLoad = (_g = data.stroke) !== null && _g !== void 0 ? _g : (_h = data.shape) === null || _h === void 0 ? void 0 : _h.stroke;
2257
+ if (strokeToLoad) {
2258
+ if (strokeToLoad instanceof Array) {
2259
+ this.stroke = strokeToLoad.map((s => {
2260
+ const tmp = new Stroke;
2261
+ tmp.load(s);
2262
+ return tmp;
2263
+ }));
2264
+ } else {
2265
+ if (this.stroke instanceof Array) {
2266
+ this.stroke = new Stroke;
2267
+ }
2268
+ this.stroke.load(strokeToLoad);
2269
+ }
2270
+ }
2271
+ const gradientToLoad = data.gradient;
2272
+ if (gradientToLoad) {
2273
+ if (gradientToLoad instanceof Array) {
2274
+ this.gradient = gradientToLoad.map((s => {
2275
+ const tmp = new AnimatableGradient;
2276
+ tmp.load(s);
2277
+ return tmp;
2278
+ }));
2279
+ } else {
2280
+ if (this.gradient instanceof Array) {
2281
+ this.gradient = new AnimatableGradient;
2282
+ }
2283
+ this.gradient.load(gradientToLoad);
2284
+ }
2285
+ }
2286
+ }
2287
+ }
2288
+ class Responsive_Responsive {
2289
+ constructor() {
2290
+ this.maxWidth = Infinity;
2291
+ this.options = {};
2292
+ this.mode = "canvas";
2293
+ }
2294
+ load(data) {
2295
+ if (!data) {
2296
+ return;
2297
+ }
2298
+ if (data.maxWidth !== undefined) {
2299
+ this.maxWidth = data.maxWidth;
2300
+ }
2301
+ if (data.mode !== undefined) {
2302
+ if (data.mode === "screen") {
2303
+ this.mode = "screen";
2304
+ } else {
2305
+ this.mode = "canvas";
2306
+ }
2307
+ }
2308
+ if (data.options !== undefined) {
2309
+ this.options = deepExtend({}, data.options);
2310
+ }
2311
+ }
2312
+ }
2313
+ class Theme_Theme {
2314
+ constructor() {
2315
+ this.name = "";
2316
+ this.default = new ThemeDefault;
2317
+ }
2318
+ load(data) {
2319
+ if (data === undefined) {
2320
+ return;
2321
+ }
2322
+ if (data.name !== undefined) {
2323
+ this.name = data.name;
2324
+ }
2325
+ this.default.load(data.default);
2326
+ if (data.options !== undefined) {
2327
+ this.options = deepExtend({}, data.options);
2328
+ }
2329
+ }
2330
+ }
2331
+ var __classPrivateFieldGet = undefined && undefined.__classPrivateFieldGet || function(receiver, state, kind, f) {
2332
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
2333
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
2334
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
2335
+ };
2336
+ var _Options_instances, _Options_findDefaultTheme;
2337
+ class Options_Options {
2338
+ constructor() {
2339
+ _Options_instances.add(this);
2340
+ this.autoPlay = true;
2341
+ this.background = new Background;
2342
+ this.backgroundMask = new BackgroundMask;
2343
+ this.fullScreen = new FullScreen;
2344
+ this.detectRetina = true;
2345
+ this.duration = 0;
2346
+ this.fpsLimit = 120;
2347
+ this.interactivity = new Interactivity;
2348
+ this.manualParticles = [];
2349
+ this.motion = new Motion;
2350
+ this.particles = new ParticlesOptions;
2351
+ this.pauseOnBlur = true;
2352
+ this.pauseOnOutsideViewport = true;
2353
+ this.responsive = [];
2354
+ this.style = {};
2355
+ this.themes = [];
2356
+ this.zLayers = 100;
2357
+ }
2358
+ get fps_limit() {
2359
+ return this.fpsLimit;
2360
+ }
2361
+ set fps_limit(value) {
2362
+ this.fpsLimit = value;
2363
+ }
2364
+ get retina_detect() {
2365
+ return this.detectRetina;
2366
+ }
2367
+ set retina_detect(value) {
2368
+ this.detectRetina = value;
2369
+ }
2370
+ get backgroundMode() {
2371
+ return this.fullScreen;
2372
+ }
2373
+ set backgroundMode(value) {
2374
+ this.fullScreen.load(value);
2375
+ }
2376
+ load(data) {
2377
+ var _a, _b, _c, _d, _e;
2378
+ if (data === undefined) {
2379
+ return;
2380
+ }
2381
+ if (data.preset !== undefined) {
2382
+ if (data.preset instanceof Array) {
2383
+ for (const preset of data.preset) {
2384
+ this.importPreset(preset);
2385
+ }
2386
+ } else {
2387
+ this.importPreset(data.preset);
2388
+ }
2389
+ }
2390
+ if (data.autoPlay !== undefined) {
2391
+ this.autoPlay = data.autoPlay;
2392
+ }
2393
+ const detectRetina = (_a = data.detectRetina) !== null && _a !== void 0 ? _a : data.retina_detect;
2394
+ if (detectRetina !== undefined) {
2395
+ this.detectRetina = detectRetina;
2396
+ }
2397
+ if (data.duration !== undefined) {
2398
+ this.duration = data.duration;
2399
+ }
2400
+ const fpsLimit = (_b = data.fpsLimit) !== null && _b !== void 0 ? _b : data.fps_limit;
2401
+ if (fpsLimit !== undefined) {
2402
+ this.fpsLimit = fpsLimit;
2403
+ }
2404
+ if (data.pauseOnBlur !== undefined) {
2405
+ this.pauseOnBlur = data.pauseOnBlur;
2406
+ }
2407
+ if (data.pauseOnOutsideViewport !== undefined) {
2408
+ this.pauseOnOutsideViewport = data.pauseOnOutsideViewport;
2409
+ }
2410
+ if (data.zLayers !== undefined) {
2411
+ this.zLayers = data.zLayers;
2412
+ }
2413
+ this.background.load(data.background);
2414
+ const fullScreen = (_c = data.fullScreen) !== null && _c !== void 0 ? _c : data.backgroundMode;
2415
+ if (typeof fullScreen === "boolean") {
2416
+ this.fullScreen.enable = fullScreen;
2417
+ } else {
2418
+ this.fullScreen.load(fullScreen);
2419
+ }
2420
+ this.backgroundMask.load(data.backgroundMask);
2421
+ this.interactivity.load(data.interactivity);
2422
+ if (data.manualParticles !== undefined) {
2423
+ this.manualParticles = data.manualParticles.map((t => {
2424
+ const tmp = new ManualParticle;
2425
+ tmp.load(t);
2426
+ return tmp;
2427
+ }));
2428
+ }
2429
+ this.motion.load(data.motion);
2430
+ this.particles.load(data.particles);
2431
+ this.style = deepExtend(this.style, data.style);
2432
+ Plugins.loadOptions(this, data);
2433
+ if (data.responsive !== undefined) {
2434
+ for (const responsive of data.responsive) {
2435
+ const optResponsive = new Responsive;
2436
+ optResponsive.load(responsive);
2437
+ this.responsive.push(optResponsive);
2438
+ }
2439
+ }
2440
+ this.responsive.sort(((a, b) => a.maxWidth - b.maxWidth));
2441
+ if (data.themes !== undefined) {
2442
+ for (const theme of data.themes) {
2443
+ const optTheme = new Theme;
2444
+ optTheme.load(theme);
2445
+ this.themes.push(optTheme);
2446
+ }
2447
+ }
2448
+ this.defaultDarkTheme = (_d = __classPrivateFieldGet(this, _Options_instances, "m", _Options_findDefaultTheme).call(this, "dark")) === null || _d === void 0 ? void 0 : _d.name;
2449
+ this.defaultLightTheme = (_e = __classPrivateFieldGet(this, _Options_instances, "m", _Options_findDefaultTheme).call(this, "light")) === null || _e === void 0 ? void 0 : _e.name;
2450
+ }
2451
+ setTheme(name) {
2452
+ if (name) {
2453
+ const chosenTheme = this.themes.find((theme => theme.name === name));
2454
+ if (chosenTheme) {
2455
+ this.load(chosenTheme.options);
2456
+ }
2457
+ } else {
2458
+ const mediaMatch = typeof matchMedia !== "undefined" && matchMedia("(prefers-color-scheme: dark)"), clientDarkMode = mediaMatch && mediaMatch.matches, defaultTheme = __classPrivateFieldGet(this, _Options_instances, "m", _Options_findDefaultTheme).call(this, clientDarkMode ? "dark" : "light");
2459
+ if (defaultTheme) {
2460
+ this.load(defaultTheme.options);
2461
+ }
2462
+ }
2463
+ }
2464
+ setResponsive(width, pxRatio, defaultOptions) {
2465
+ this.load(defaultOptions);
2466
+ const responsiveOptions = this.responsive.find((t => t.mode === "screen" && screen ? t.maxWidth * pxRatio > screen.availWidth : t.maxWidth * pxRatio > width));
2467
+ this.load(responsiveOptions === null || responsiveOptions === void 0 ? void 0 : responsiveOptions.options);
2468
+ return responsiveOptions === null || responsiveOptions === void 0 ? void 0 : responsiveOptions.maxWidth;
2469
+ }
2470
+ importPreset(preset) {
2471
+ this.load(Plugins.getPreset(preset));
2472
+ }
2473
+ }
2474
+ _Options_instances = new WeakSet, _Options_findDefaultTheme = function _Options_findDefaultTheme(mode) {
2475
+ var _a;
2476
+ return (_a = this.themes.find((theme => theme.default.value && theme.default.mode === mode))) !== null && _a !== void 0 ? _a : this.themes.find((theme => theme.default.value && theme.default.mode === "any"));
2477
+ };
2478
+ const fixOutMode = data => {
2479
+ if (isInArray(data.outMode, data.checkModes) || isInArray(data.outMode, data.checkModes)) {
2480
+ if (data.coord > data.maxCoord - data.radius * 2) {
2481
+ data.setCb(-data.radius);
2482
+ } else if (data.coord < data.radius * 2) {
2483
+ data.setCb(data.radius);
2484
+ }
2485
+ }
2486
+ };
2487
+ class Particle_Particle {
2488
+ constructor(id, container, position, overrideOptions, group) {
2489
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j;
2490
+ this.id = id;
2491
+ this.container = container;
2492
+ this.group = group;
2493
+ this.fill = true;
2494
+ this.close = true;
2495
+ this.lastPathTime = 0;
2496
+ this.destroyed = false;
2497
+ this.unbreakable = false;
2498
+ this.splitCount = 0;
2499
+ this.misplaced = false;
2500
+ this.retina = {
2501
+ maxDistance: {}
2502
+ };
2503
+ const pxRatio = container.retina.pixelRatio;
2504
+ const mainOptions = container.actualOptions;
2505
+ const particlesOptions = new ParticlesOptions;
2506
+ particlesOptions.load(mainOptions.particles);
2507
+ const shapeType = particlesOptions.shape.type;
2508
+ const reduceDuplicates = particlesOptions.reduceDuplicates;
2509
+ this.shape = shapeType instanceof Array ? itemFromArray(shapeType, this.id, reduceDuplicates) : shapeType;
2510
+ if (overrideOptions === null || overrideOptions === void 0 ? void 0 : overrideOptions.shape) {
2511
+ if (overrideOptions.shape.type) {
2512
+ const overrideShapeType = overrideOptions.shape.type;
2513
+ this.shape = overrideShapeType instanceof Array ? itemFromArray(overrideShapeType, this.id, reduceDuplicates) : overrideShapeType;
2514
+ }
2515
+ const shapeOptions = new Shape;
2516
+ shapeOptions.load(overrideOptions.shape);
2517
+ if (this.shape) {
2518
+ this.shapeData = this.loadShapeData(shapeOptions, reduceDuplicates);
2519
+ }
2520
+ } else {
2521
+ this.shapeData = this.loadShapeData(particlesOptions.shape, reduceDuplicates);
2522
+ }
2523
+ if (overrideOptions !== undefined) {
2524
+ particlesOptions.load(overrideOptions);
2525
+ }
2526
+ if (((_a = this.shapeData) === null || _a === void 0 ? void 0 : _a.particles) !== undefined) {
2527
+ particlesOptions.load((_b = this.shapeData) === null || _b === void 0 ? void 0 : _b.particles);
2528
+ }
2529
+ this.fill = (_d = (_c = this.shapeData) === null || _c === void 0 ? void 0 : _c.fill) !== null && _d !== void 0 ? _d : this.fill;
2530
+ this.close = (_f = (_e = this.shapeData) === null || _e === void 0 ? void 0 : _e.close) !== null && _f !== void 0 ? _f : this.close;
2531
+ this.options = particlesOptions;
2532
+ this.pathDelay = getValue(this.options.move.path.delay) * 1e3;
2533
+ const zIndexValue = getRangeValue(this.options.zIndex.value);
2534
+ container.retina.initParticle(this);
2535
+ const sizeOptions = this.options.size, sizeRange = sizeOptions.value;
2536
+ this.size = {
2537
+ enable: sizeOptions.animation.enable,
2538
+ value: getValue(sizeOptions) * container.retina.pixelRatio,
2539
+ max: getRangeMax(sizeRange) * pxRatio,
2540
+ min: getRangeMin(sizeRange) * pxRatio,
2541
+ loops: 0,
2542
+ maxLoops: sizeOptions.animation.count
2543
+ };
2544
+ const sizeAnimation = sizeOptions.animation;
2545
+ if (sizeAnimation.enable) {
2546
+ this.size.status = 0;
2547
+ switch (sizeAnimation.startValue) {
2548
+ case "min":
2549
+ this.size.value = this.size.min;
2550
+ this.size.status = 0;
2551
+ break;
2552
+
2553
+ case "random":
2554
+ this.size.value = randomInRange(this.size) * pxRatio;
2555
+ this.size.status = Math.random() >= .5 ? 0 : 1;
2556
+ break;
2557
+
2558
+ case "max":
2559
+ default:
2560
+ this.size.value = this.size.max;
2561
+ this.size.status = 1;
2562
+ break;
2563
+ }
2564
+ this.size.velocity = ((_g = this.retina.sizeAnimationSpeed) !== null && _g !== void 0 ? _g : container.retina.sizeAnimationSpeed) / 100 * container.retina.reduceFactor;
2565
+ if (!sizeAnimation.sync) {
2566
+ this.size.velocity *= Math.random();
2567
+ }
2568
+ }
2569
+ this.direction = getParticleDirectionAngle(this.options.move.direction);
2570
+ this.bubble = {
2571
+ inRange: false
2572
+ };
2573
+ this.initialVelocity = this.calculateVelocity();
2574
+ this.velocity = this.initialVelocity.copy();
2575
+ this.moveDecay = 1 - getRangeValue(this.options.move.decay);
2576
+ this.position = this.calcPosition(container, position, clamp(zIndexValue, 0, container.zLayers));
2577
+ this.initialPosition = this.position.copy();
2578
+ this.offset = Vector.origin;
2579
+ const particles = container.particles;
2580
+ particles.needsSort = particles.needsSort || particles.lastZIndex < this.position.z;
2581
+ particles.lastZIndex = this.position.z;
2582
+ this.zIndexFactor = this.position.z / container.zLayers;
2583
+ this.sides = 24;
2584
+ let drawer = container.drawers.get(this.shape);
2585
+ if (!drawer) {
2586
+ drawer = Plugins.getShapeDrawer(this.shape);
2587
+ if (drawer) {
2588
+ container.drawers.set(this.shape, drawer);
2589
+ }
2590
+ }
2591
+ if (drawer === null || drawer === void 0 ? void 0 : drawer.loadShape) {
2592
+ drawer === null || drawer === void 0 ? void 0 : drawer.loadShape(this);
2593
+ }
2594
+ const sideCountFunc = drawer === null || drawer === void 0 ? void 0 : drawer.getSidesCount;
2595
+ if (sideCountFunc) {
2596
+ this.sides = sideCountFunc(this);
2597
+ }
2598
+ this.life = this.loadLife();
2599
+ this.spawning = this.life.delay > 0;
2600
+ if (this.options.move.spin.enable) {
2601
+ const spinPos = (_h = this.options.move.spin.position) !== null && _h !== void 0 ? _h : {
2602
+ x: 50,
2603
+ y: 50
2604
+ };
2605
+ const spinCenter = {
2606
+ x: spinPos.x / 100 * container.canvas.size.width,
2607
+ y: spinPos.y / 100 * container.canvas.size.height
2608
+ };
2609
+ const pos = this.getPosition();
2610
+ const distance = getDistance(pos, spinCenter);
2611
+ this.spin = {
2612
+ center: spinCenter,
2613
+ direction: this.velocity.x >= 0 ? "clockwise" : "counter-clockwise",
2614
+ angle: this.velocity.angle,
2615
+ radius: distance,
2616
+ acceleration: (_j = this.retina.spinAcceleration) !== null && _j !== void 0 ? _j : getRangeValue(this.options.move.spin.acceleration)
2617
+ };
2618
+ }
2619
+ this.shadowColor = colorToRgb(this.options.shadow.color);
2620
+ for (const updater of container.particles.updaters) {
2621
+ if (updater.init) {
2622
+ updater.init(this);
2623
+ }
2624
+ }
2625
+ if (drawer && drawer.particleInit) {
2626
+ drawer.particleInit(container, this);
2627
+ }
2628
+ for (const [, plugin] of container.plugins) {
2629
+ if (plugin.particleCreated) {
2630
+ plugin.particleCreated(this);
2631
+ }
2632
+ }
2633
+ }
2634
+ isVisible() {
2635
+ return !this.destroyed && !this.spawning && this.isInsideCanvas();
2636
+ }
2637
+ isInsideCanvas() {
2638
+ const radius = this.getRadius();
2639
+ const canvasSize = this.container.canvas.size;
2640
+ return this.position.x >= -radius && this.position.y >= -radius && this.position.y <= canvasSize.height + radius && this.position.x <= canvasSize.width + radius;
2641
+ }
2642
+ draw(delta) {
2643
+ const container = this.container;
2644
+ for (const [, plugin] of container.plugins) {
2645
+ container.canvas.drawParticlePlugin(plugin, this, delta);
2646
+ }
2647
+ container.canvas.drawParticle(this, delta);
2648
+ }
2649
+ getPosition() {
2650
+ return {
2651
+ x: this.position.x + this.offset.x,
2652
+ y: this.position.y + this.offset.y,
2653
+ z: this.position.z
2654
+ };
2655
+ }
2656
+ getRadius() {
2657
+ var _a;
2658
+ return (_a = this.bubble.radius) !== null && _a !== void 0 ? _a : this.size.value;
2659
+ }
2660
+ getMass() {
2661
+ return this.getRadius() ** 2 * Math.PI / 2;
2662
+ }
2663
+ getFillColor() {
2664
+ var _a, _b, _c;
2665
+ const color = (_a = this.bubble.color) !== null && _a !== void 0 ? _a : getHslFromAnimation(this.color);
2666
+ if (color && this.roll && (this.backColor || this.roll.alter)) {
2667
+ const rolled = Math.floor(((_c = (_b = this.roll) === null || _b === void 0 ? void 0 : _b.angle) !== null && _c !== void 0 ? _c : 0) / (Math.PI / 2)) % 2;
2668
+ if (rolled) {
2669
+ if (this.backColor) {
2670
+ return this.backColor;
2671
+ }
2672
+ if (this.roll.alter) {
2673
+ return alterHsl(color, this.roll.alter.type, this.roll.alter.value);
2674
+ }
2675
+ }
2676
+ }
2677
+ return color;
2678
+ }
2679
+ getStrokeColor() {
2680
+ var _a, _b;
2681
+ return (_b = (_a = this.bubble.color) !== null && _a !== void 0 ? _a : getHslFromAnimation(this.strokeColor)) !== null && _b !== void 0 ? _b : this.getFillColor();
2682
+ }
2683
+ destroy(override) {
2684
+ this.destroyed = true;
2685
+ this.bubble.inRange = false;
2686
+ if (this.unbreakable) {
2687
+ return;
2688
+ }
2689
+ this.destroyed = true;
2690
+ this.bubble.inRange = false;
2691
+ for (const [, plugin] of this.container.plugins) {
2692
+ if (plugin.particleDestroyed) {
2693
+ plugin.particleDestroyed(this, override);
2694
+ }
2695
+ }
2696
+ if (override) {
2697
+ return;
2698
+ }
2699
+ const destroyOptions = this.options.destroy;
2700
+ if (destroyOptions.mode === "split") {
2701
+ this.split();
2702
+ }
2703
+ }
2704
+ reset() {
2705
+ if (this.opacity) {
2706
+ this.opacity.loops = 0;
2707
+ }
2708
+ this.size.loops = 0;
2709
+ }
2710
+ split() {
2711
+ const splitOptions = this.options.destroy.split;
2712
+ if (splitOptions.count >= 0 && this.splitCount++ > splitOptions.count) {
2713
+ return;
2714
+ }
2715
+ const rate = getRangeValue(splitOptions.rate.value);
2716
+ for (let i = 0; i < rate; i++) {
2717
+ this.container.particles.addSplitParticle(this);
2718
+ }
2719
+ }
2720
+ calcPosition(container, position, zIndex, tryCount = 0) {
2721
+ var _a, _b, _c, _d, _e, _f;
2722
+ for (const [, plugin] of container.plugins) {
2723
+ const pluginPos = plugin.particlePosition !== undefined ? plugin.particlePosition(position, this) : undefined;
2724
+ if (pluginPos !== undefined) {
2725
+ return Vector3d.create(pluginPos.x, pluginPos.y, zIndex);
2726
+ }
2727
+ }
2728
+ const canvasSize = container.canvas.size;
2729
+ const pos = Vector3d.create((_a = position === null || position === void 0 ? void 0 : position.x) !== null && _a !== void 0 ? _a : Math.random() * canvasSize.width, (_b = position === null || position === void 0 ? void 0 : position.y) !== null && _b !== void 0 ? _b : Math.random() * canvasSize.height, zIndex);
2730
+ const radius = this.getRadius();
2731
+ const outModes = this.options.move.outModes, fixHorizontal = outMode => {
2732
+ fixOutMode({
2733
+ outMode: outMode,
2734
+ checkModes: [ "bounce", "bounce-horizontal" ],
2735
+ coord: pos.x,
2736
+ maxCoord: container.canvas.size.width,
2737
+ setCb: value => pos.x += value,
2738
+ radius: radius
2739
+ });
2740
+ }, fixVertical = outMode => {
2741
+ fixOutMode({
2742
+ outMode: outMode,
2743
+ checkModes: [ "bounce", "bounce-vertical" ],
2744
+ coord: pos.y,
2745
+ maxCoord: container.canvas.size.height,
2746
+ setCb: value => pos.y += value,
2747
+ radius: radius
2748
+ });
2749
+ };
2750
+ fixHorizontal((_c = outModes.left) !== null && _c !== void 0 ? _c : outModes.default);
2751
+ fixHorizontal((_d = outModes.right) !== null && _d !== void 0 ? _d : outModes.default);
2752
+ fixVertical((_e = outModes.top) !== null && _e !== void 0 ? _e : outModes.default);
2753
+ fixVertical((_f = outModes.bottom) !== null && _f !== void 0 ? _f : outModes.default);
2754
+ if (this.checkOverlap(pos, tryCount)) {
2755
+ return this.calcPosition(container, undefined, zIndex, tryCount + 1);
2756
+ }
2757
+ return pos;
2758
+ }
2759
+ checkOverlap(pos, tryCount = 0) {
2760
+ const collisionsOptions = this.options.collisions;
2761
+ const radius = this.getRadius();
2762
+ if (!collisionsOptions.enable) {
2763
+ return false;
2764
+ }
2765
+ const overlapOptions = collisionsOptions.overlap;
2766
+ if (overlapOptions.enable) {
2767
+ return false;
2768
+ }
2769
+ const retries = overlapOptions.retries;
2770
+ if (retries >= 0 && tryCount > retries) {
2771
+ throw new Error("Particle is overlapping and can't be placed");
2772
+ }
2773
+ let overlaps = false;
2774
+ for (const particle of this.container.particles.array) {
2775
+ if (getDistance(pos, particle.position) < radius + particle.getRadius()) {
2776
+ overlaps = true;
2777
+ break;
2778
+ }
2779
+ }
2780
+ return overlaps;
2781
+ }
2782
+ calculateVelocity() {
2783
+ const baseVelocity = getParticleBaseVelocity(this.direction);
2784
+ const res = baseVelocity.copy();
2785
+ const moveOptions = this.options.move;
2786
+ const rad = Math.PI / 180 * moveOptions.angle.value;
2787
+ const radOffset = Math.PI / 180 * moveOptions.angle.offset;
2788
+ const range = {
2789
+ left: radOffset - rad / 2,
2790
+ right: radOffset + rad / 2
2791
+ };
2792
+ if (!moveOptions.straight) {
2793
+ res.angle += randomInRange(setRangeValue(range.left, range.right));
2794
+ }
2795
+ if (moveOptions.random && typeof moveOptions.speed === "number") {
2796
+ res.length *= Math.random();
2797
+ }
2798
+ return res;
2799
+ }
2800
+ loadShapeData(shapeOptions, reduceDuplicates) {
2801
+ const shapeData = shapeOptions.options[this.shape];
2802
+ if (shapeData) {
2803
+ return deepExtend({}, shapeData instanceof Array ? itemFromArray(shapeData, this.id, reduceDuplicates) : shapeData);
2804
+ }
2805
+ }
2806
+ loadLife() {
2807
+ const container = this.container;
2808
+ const particlesOptions = this.options;
2809
+ const lifeOptions = particlesOptions.life;
2810
+ const life = {
2811
+ delay: container.retina.reduceFactor ? getRangeValue(lifeOptions.delay.value) * (lifeOptions.delay.sync ? 1 : Math.random()) / container.retina.reduceFactor * 1e3 : 0,
2812
+ delayTime: 0,
2813
+ duration: container.retina.reduceFactor ? getRangeValue(lifeOptions.duration.value) * (lifeOptions.duration.sync ? 1 : Math.random()) / container.retina.reduceFactor * 1e3 : 0,
2814
+ time: 0,
2815
+ count: particlesOptions.life.count
2816
+ };
2817
+ if (life.duration <= 0) {
2818
+ life.duration = -1;
2819
+ }
2820
+ if (life.count <= 0) {
2821
+ life.count = -1;
2822
+ }
2823
+ return life;
2824
+ }
2825
+ }
2826
+ class Particles_Particles {
2827
+ constructor(container) {
2828
+ this.container = container;
2829
+ this.nextId = 0;
2830
+ this.array = [];
2831
+ this.zArray = [];
2832
+ this.mover = new ParticlesMover(container);
2833
+ this.limit = 0;
2834
+ this.needsSort = false;
2835
+ this.lastZIndex = 0;
2836
+ this.freqs = {
2837
+ links: new Map,
2838
+ triangles: new Map
2839
+ };
2840
+ this.interactionManager = new InteractionManager(container);
2841
+ const canvasSize = this.container.canvas.size;
2842
+ this.linksColors = new Map;
2843
+ this.quadTree = new QuadTree(new Rectangle(-canvasSize.width / 4, -canvasSize.height / 4, canvasSize.width * 3 / 2, canvasSize.height * 3 / 2), 4);
2844
+ this.updaters = Plugins.getUpdaters(container, true);
2845
+ }
2846
+ get count() {
2847
+ return this.array.length;
2848
+ }
2849
+ init() {
2850
+ var _a;
2851
+ const container = this.container;
2852
+ const options = container.actualOptions;
2853
+ this.lastZIndex = 0;
2854
+ this.needsSort = false;
2855
+ this.freqs.links = new Map;
2856
+ this.freqs.triangles = new Map;
2857
+ let handled = false;
2858
+ this.updaters = Plugins.getUpdaters(container, true);
2859
+ this.interactionManager.init();
2860
+ for (const [, plugin] of container.plugins) {
2861
+ if (plugin.particlesInitialization !== undefined) {
2862
+ handled = plugin.particlesInitialization();
2863
+ }
2864
+ if (handled) {
2865
+ break;
2866
+ }
2867
+ }
2868
+ this.addManualParticles();
2869
+ if (!handled) {
2870
+ for (const group in options.particles.groups) {
2871
+ const groupOptions = options.particles.groups[group];
2872
+ for (let i = this.count, j = 0; j < ((_a = groupOptions.number) === null || _a === void 0 ? void 0 : _a.value) && i < options.particles.number.value; i++,
2873
+ j++) {
2874
+ this.addParticle(undefined, groupOptions, group);
2875
+ }
2876
+ }
2877
+ for (let i = this.count; i < options.particles.number.value; i++) {
2878
+ this.addParticle();
2879
+ }
2880
+ }
2881
+ container.pathGenerator.init(container);
2882
+ }
2883
+ redraw() {
2884
+ this.clear();
2885
+ this.init();
2886
+ this.draw({
2887
+ value: 0,
2888
+ factor: 0
2889
+ });
2890
+ }
2891
+ removeAt(index, quantity = 1, group, override) {
2892
+ if (!(index >= 0 && index <= this.count)) {
2893
+ return;
2894
+ }
2895
+ let deleted = 0;
2896
+ for (let i = index; deleted < quantity && i < this.count; i++) {
2897
+ const particle = this.array[i];
2898
+ if (!particle || particle.group !== group) {
2899
+ continue;
2900
+ }
2901
+ particle.destroy(override);
2902
+ this.array.splice(i--, 1);
2903
+ const zIdx = this.zArray.indexOf(particle);
2904
+ this.zArray.splice(zIdx, 1);
2905
+ deleted++;
2906
+ }
2907
+ }
2908
+ remove(particle, group, override) {
2909
+ this.removeAt(this.array.indexOf(particle), undefined, group, override);
2910
+ }
2911
+ update(delta) {
2912
+ const container = this.container;
2913
+ const particlesToDelete = [];
2914
+ container.pathGenerator.update();
2915
+ for (const [, plugin] of container.plugins) {
2916
+ if (plugin.update !== undefined) {
2917
+ plugin.update(delta);
2918
+ }
2919
+ }
2920
+ for (const particle of this.array) {
2921
+ const resizeFactor = container.canvas.resizeFactor;
2922
+ if (resizeFactor) {
2923
+ particle.position.x *= resizeFactor.width;
2924
+ particle.position.y *= resizeFactor.height;
2925
+ }
2926
+ particle.bubble.inRange = false;
2927
+ for (const [, plugin] of this.container.plugins) {
2928
+ if (particle.destroyed) {
2929
+ break;
2930
+ }
2931
+ if (plugin.particleUpdate) {
2932
+ plugin.particleUpdate(particle, delta);
2933
+ }
2934
+ }
2935
+ this.mover.move(particle, delta);
2936
+ if (particle.destroyed) {
2937
+ particlesToDelete.push(particle);
2938
+ continue;
2939
+ }
2940
+ this.quadTree.insert(new Point(particle.getPosition(), particle));
2941
+ }
2942
+ for (const particle of particlesToDelete) {
2943
+ this.remove(particle);
2944
+ }
2945
+ this.interactionManager.externalInteract(delta);
2946
+ for (const particle of container.particles.array) {
2947
+ for (const updater of this.updaters) {
2948
+ updater.update(particle, delta);
2949
+ }
2950
+ if (!particle.destroyed && !particle.spawning) {
2951
+ this.interactionManager.particlesInteract(particle, delta);
2952
+ }
2953
+ }
2954
+ delete container.canvas.resizeFactor;
2955
+ }
2956
+ draw(delta) {
2957
+ const container = this.container;
2958
+ container.canvas.clear();
2959
+ const canvasSize = this.container.canvas.size;
2960
+ this.quadTree = new QuadTree(new Rectangle(-canvasSize.width / 4, -canvasSize.height / 4, canvasSize.width * 3 / 2, canvasSize.height * 3 / 2), 4);
2961
+ this.update(delta);
2962
+ if (this.needsSort) {
2963
+ this.zArray.sort(((a, b) => b.position.z - a.position.z || a.id - b.id));
2964
+ this.lastZIndex = this.zArray[this.zArray.length - 1].position.z;
2965
+ this.needsSort = false;
2966
+ }
2967
+ for (const [, plugin] of container.plugins) {
2968
+ container.canvas.drawPlugin(plugin, delta);
2969
+ }
2970
+ for (const p of this.zArray) {
2971
+ p.draw(delta);
2972
+ }
2973
+ }
2974
+ clear() {
2975
+ this.array = [];
2976
+ this.zArray = [];
2977
+ }
2978
+ push(nb, mouse, overrideOptions, group) {
2979
+ this.pushing = true;
2980
+ for (let i = 0; i < nb; i++) {
2981
+ this.addParticle(mouse === null || mouse === void 0 ? void 0 : mouse.position, overrideOptions, group);
2982
+ }
2983
+ this.pushing = false;
2984
+ }
2985
+ addParticle(position, overrideOptions, group) {
2986
+ const container = this.container, options = container.actualOptions, limit = options.particles.number.limit * container.density;
2987
+ if (limit > 0) {
2988
+ const countToRemove = this.count + 1 - limit;
2989
+ if (countToRemove > 0) {
2990
+ this.removeQuantity(countToRemove);
2991
+ }
2992
+ }
2993
+ return this.pushParticle(position, overrideOptions, group);
2994
+ }
2995
+ addSplitParticle(parent) {
2996
+ const splitOptions = parent.options.destroy.split, options = new ParticlesOptions;
2997
+ options.load(parent.options);
2998
+ const factor = getRangeValue(splitOptions.factor.value);
2999
+ options.color.load({
3000
+ value: {
3001
+ hsl: parent.getFillColor()
3002
+ }
3003
+ });
3004
+ if (typeof options.size.value === "number") {
3005
+ options.size.value /= factor;
3006
+ } else {
3007
+ options.size.value.min /= factor;
3008
+ options.size.value.max /= factor;
3009
+ }
3010
+ options.load(splitOptions.particles);
3011
+ const offset = splitOptions.sizeOffset ? setRangeValue(-parent.size.value, parent.size.value) : 0;
3012
+ const position = {
3013
+ x: parent.position.x + randomInRange(offset),
3014
+ y: parent.position.y + randomInRange(offset)
3015
+ };
3016
+ return this.pushParticle(position, options, parent.group, (particle => {
3017
+ if (particle.size.value < .5) {
3018
+ return false;
3019
+ }
3020
+ particle.velocity.length = randomInRange(setRangeValue(parent.velocity.length, particle.velocity.length));
3021
+ particle.splitCount = parent.splitCount + 1;
3022
+ particle.unbreakable = true;
3023
+ setTimeout((() => {
3024
+ particle.unbreakable = false;
3025
+ }), 500);
3026
+ return true;
3027
+ }));
3028
+ }
3029
+ removeQuantity(quantity, group) {
3030
+ this.removeAt(0, quantity, group);
3031
+ }
3032
+ getLinkFrequency(p1, p2) {
3033
+ const range = setRangeValue(p1.id, p2.id), key = `${getRangeMin(range)}_${getRangeMax(range)}`;
3034
+ let res = this.freqs.links.get(key);
3035
+ if (res === undefined) {
3036
+ res = Math.random();
3037
+ this.freqs.links.set(key, res);
3038
+ }
3039
+ return res;
3040
+ }
3041
+ getTriangleFrequency(p1, p2, p3) {
3042
+ let [id1, id2, id3] = [ p1.id, p2.id, p3.id ];
3043
+ if (id1 > id2) {
3044
+ [id2, id1] = [ id1, id2 ];
3045
+ }
3046
+ if (id2 > id3) {
3047
+ [id3, id2] = [ id2, id3 ];
3048
+ }
3049
+ if (id1 > id3) {
3050
+ [id3, id1] = [ id1, id3 ];
3051
+ }
3052
+ const key = `${id1}_${id2}_${id3}`;
3053
+ let res = this.freqs.triangles.get(key);
3054
+ if (res === undefined) {
3055
+ res = Math.random();
3056
+ this.freqs.triangles.set(key, res);
3057
+ }
3058
+ return res;
3059
+ }
3060
+ addManualParticles() {
3061
+ const container = this.container, options = container.actualOptions;
3062
+ for (const particle of options.manualParticles) {
3063
+ const pos = particle.position ? {
3064
+ x: particle.position.x * container.canvas.size.width / 100,
3065
+ y: particle.position.y * container.canvas.size.height / 100
3066
+ } : undefined;
3067
+ this.addParticle(pos, particle.options);
3068
+ }
3069
+ }
3070
+ setDensity() {
3071
+ const options = this.container.actualOptions;
3072
+ for (const group in options.particles.groups) {
3073
+ this.applyDensity(options.particles.groups[group], 0, group);
3074
+ }
3075
+ this.applyDensity(options.particles, options.manualParticles.length);
3076
+ }
3077
+ applyDensity(options, manualCount, group) {
3078
+ var _a;
3079
+ if (!((_a = options.number.density) === null || _a === void 0 ? void 0 : _a.enable)) {
3080
+ return;
3081
+ }
3082
+ const numberOptions = options.number;
3083
+ const densityFactor = this.initDensityFactor(numberOptions.density);
3084
+ const optParticlesNumber = numberOptions.value;
3085
+ const optParticlesLimit = numberOptions.limit > 0 ? numberOptions.limit : optParticlesNumber;
3086
+ const particlesNumber = Math.min(optParticlesNumber, optParticlesLimit) * densityFactor + manualCount;
3087
+ const particlesCount = Math.min(this.count, this.array.filter((t => t.group === group)).length);
3088
+ this.limit = numberOptions.limit * densityFactor;
3089
+ if (particlesCount < particlesNumber) {
3090
+ this.push(Math.abs(particlesNumber - particlesCount), undefined, options, group);
3091
+ } else if (particlesCount > particlesNumber) {
3092
+ this.removeQuantity(particlesCount - particlesNumber, group);
3093
+ }
3094
+ }
3095
+ initDensityFactor(densityOptions) {
3096
+ const container = this.container;
3097
+ if (!container.canvas.element || !densityOptions.enable) {
3098
+ return 1;
3099
+ }
3100
+ const canvas = container.canvas.element, pxRatio = container.retina.pixelRatio;
3101
+ return canvas.width * canvas.height / (densityOptions.factor * pxRatio ** 2 * densityOptions.area);
3102
+ }
3103
+ pushParticle(position, overrideOptions, group, initializer) {
3104
+ try {
3105
+ const particle = new Particle(this.nextId, this.container, position, overrideOptions, group);
3106
+ let canAdd = true;
3107
+ if (initializer) {
3108
+ canAdd = initializer(particle);
3109
+ }
3110
+ if (!canAdd) {
3111
+ return;
3112
+ }
3113
+ this.array.push(particle);
3114
+ this.zArray.push(particle);
3115
+ this.nextId++;
3116
+ return particle;
3117
+ } catch (e) {
3118
+ console.warn(`error adding particle: ${e}`);
3119
+ return;
3120
+ }
3121
+ }
3122
+ }
3123
+ class Retina_Retina {
3124
+ constructor(container) {
3125
+ this.container = container;
3126
+ }
3127
+ init() {
3128
+ const container = this.container;
3129
+ const options = container.actualOptions;
3130
+ this.pixelRatio = !options.detectRetina || isSsr() ? 1 : window.devicePixelRatio;
3131
+ const motionOptions = this.container.actualOptions.motion;
3132
+ if (motionOptions && (motionOptions.disable || motionOptions.reduce.value)) {
3133
+ if (isSsr() || typeof matchMedia === "undefined" || !matchMedia) {
3134
+ this.reduceFactor = 1;
3135
+ } else {
3136
+ const mediaQuery = matchMedia("(prefers-reduced-motion: reduce)");
3137
+ if (mediaQuery) {
3138
+ this.handleMotionChange(mediaQuery);
3139
+ const handleChange = () => {
3140
+ this.handleMotionChange(mediaQuery);
3141
+ container.refresh().catch((() => {}));
3142
+ };
3143
+ if (mediaQuery.addEventListener !== undefined) {
3144
+ mediaQuery.addEventListener("change", handleChange);
3145
+ } else if (mediaQuery.addListener !== undefined) {
3146
+ mediaQuery.addListener(handleChange);
3147
+ }
3148
+ }
3149
+ }
3150
+ } else {
3151
+ this.reduceFactor = 1;
3152
+ }
3153
+ const ratio = this.pixelRatio;
3154
+ if (container.canvas.element) {
3155
+ const element = container.canvas.element;
3156
+ container.canvas.size.width = element.offsetWidth * ratio;
3157
+ container.canvas.size.height = element.offsetHeight * ratio;
3158
+ }
3159
+ const particles = options.particles;
3160
+ this.attractDistance = particles.move.attract.distance * ratio;
3161
+ this.linksDistance = particles.links.distance * ratio;
3162
+ this.linksWidth = particles.links.width * ratio;
3163
+ this.sizeAnimationSpeed = particles.size.animation.speed * ratio;
3164
+ this.maxSpeed = particles.move.gravity.maxSpeed * ratio;
3165
+ if (particles.orbit.radius !== undefined) {
3166
+ this.orbitRadius = particles.orbit.radius * this.container.retina.pixelRatio;
3167
+ }
3168
+ const modes = options.interactivity.modes;
3169
+ this.connectModeDistance = modes.connect.distance * ratio;
3170
+ this.connectModeRadius = modes.connect.radius * ratio;
3171
+ this.grabModeDistance = modes.grab.distance * ratio;
3172
+ this.repulseModeDistance = modes.repulse.distance * ratio;
3173
+ this.bounceModeDistance = modes.bounce.distance * ratio;
3174
+ this.attractModeDistance = modes.attract.distance * ratio;
3175
+ this.slowModeRadius = modes.slow.radius * ratio;
3176
+ this.bubbleModeDistance = modes.bubble.distance * ratio;
3177
+ if (modes.bubble.size) {
3178
+ this.bubbleModeSize = modes.bubble.size * ratio;
3179
+ }
3180
+ }
3181
+ initParticle(particle) {
3182
+ const options = particle.options;
3183
+ const ratio = this.pixelRatio;
3184
+ const moveDistance = options.move.distance;
3185
+ const props = particle.retina;
3186
+ props.attractDistance = options.move.attract.distance * ratio;
3187
+ props.linksDistance = options.links.distance * ratio;
3188
+ props.linksWidth = options.links.width * ratio;
3189
+ props.moveDrift = getRangeValue(options.move.drift) * ratio;
3190
+ props.moveSpeed = getRangeValue(options.move.speed) * ratio;
3191
+ props.sizeAnimationSpeed = options.size.animation.speed * ratio;
3192
+ if (particle.spin) {
3193
+ props.spinAcceleration = getRangeValue(options.move.spin.acceleration) * ratio;
3194
+ }
3195
+ const maxDistance = props.maxDistance;
3196
+ maxDistance.horizontal = moveDistance.horizontal !== undefined ? moveDistance.horizontal * ratio : undefined;
3197
+ maxDistance.vertical = moveDistance.vertical !== undefined ? moveDistance.vertical * ratio : undefined;
3198
+ props.maxSpeed = options.move.gravity.maxSpeed * ratio;
3199
+ }
3200
+ handleMotionChange(mediaQuery) {
3201
+ const options = this.container.actualOptions;
3202
+ if (mediaQuery.matches) {
3203
+ const motion = options.motion;
3204
+ this.reduceFactor = motion.disable ? 0 : motion.reduce.value ? 1 / motion.reduce.factor : 1;
3205
+ } else {
3206
+ this.reduceFactor = 1;
3207
+ }
3208
+ }
3209
+ }
3210
+ class Container_Container {
3211
+ constructor(id, sourceOptions, ...presets) {
3212
+ this.id = id;
3213
+ this.fpsLimit = 120;
3214
+ this.duration = 0;
3215
+ this.lifeTime = 0;
3216
+ this.firstStart = true;
3217
+ this.started = false;
3218
+ this.destroyed = false;
3219
+ this.paused = true;
3220
+ this.lastFrameTime = 0;
3221
+ this.zLayers = 100;
3222
+ this.pageHidden = false;
3223
+ this._sourceOptions = sourceOptions;
3224
+ this._initialSourceOptions = sourceOptions;
3225
+ this.retina = new Retina(this);
3226
+ this.canvas = new Canvas(this);
3227
+ this.particles = new Particles(this);
3228
+ this.drawer = new FrameManager(this);
3229
+ this.presets = presets;
3230
+ this.pathGenerator = {
3231
+ generate: () => {
3232
+ const v = Vector.create(0, 0);
3233
+ v.length = Math.random();
3234
+ v.angle = Math.random() * Math.PI * 2;
3235
+ return v;
3236
+ },
3237
+ init: () => {},
3238
+ update: () => {}
3239
+ };
3240
+ this.interactivity = {
3241
+ mouse: {
3242
+ clicking: false,
3243
+ inside: false
3244
+ }
3245
+ };
3246
+ this.bubble = {};
3247
+ this.repulse = {
3248
+ particles: []
3249
+ };
3250
+ this.attract = {
3251
+ particles: []
3252
+ };
3253
+ this.plugins = new Map;
3254
+ this.drawers = new Map;
3255
+ this.density = 1;
3256
+ this._options = new Options;
3257
+ this.actualOptions = new Options;
3258
+ this.eventListeners = new EventListeners(this);
3259
+ if (typeof IntersectionObserver !== "undefined" && IntersectionObserver) {
3260
+ this.intersectionObserver = new IntersectionObserver((entries => this.intersectionManager(entries)));
3261
+ }
3262
+ }
3263
+ get options() {
3264
+ return this._options;
3265
+ }
3266
+ get sourceOptions() {
3267
+ return this._sourceOptions;
3268
+ }
3269
+ play(force) {
3270
+ const needsUpdate = this.paused || force;
3271
+ if (this.firstStart && !this.actualOptions.autoPlay) {
3272
+ this.firstStart = false;
3273
+ return;
3274
+ }
3275
+ if (this.paused) {
3276
+ this.paused = false;
3277
+ }
3278
+ if (needsUpdate) {
3279
+ for (const [, plugin] of this.plugins) {
3280
+ if (plugin.play) {
3281
+ plugin.play();
3282
+ }
3283
+ }
3284
+ }
3285
+ this.draw(needsUpdate || false);
3286
+ }
3287
+ pause() {
3288
+ if (this.drawAnimationFrame !== undefined) {
3289
+ cancelAnimation()(this.drawAnimationFrame);
3290
+ delete this.drawAnimationFrame;
3291
+ }
3292
+ if (this.paused) {
3293
+ return;
3294
+ }
3295
+ for (const [, plugin] of this.plugins) {
3296
+ if (plugin.pause) {
3297
+ plugin.pause();
3298
+ }
3299
+ }
3300
+ if (!this.pageHidden) {
3301
+ this.paused = true;
3302
+ }
3303
+ }
3304
+ draw(force) {
3305
+ let refreshTime = force;
3306
+ this.drawAnimationFrame = animate()((timestamp => {
3307
+ if (refreshTime) {
3308
+ this.lastFrameTime = undefined;
3309
+ refreshTime = false;
3310
+ }
3311
+ this.drawer.nextFrame(timestamp);
3312
+ }));
3313
+ }
3314
+ getAnimationStatus() {
3315
+ return !this.paused && !this.pageHidden;
3316
+ }
3317
+ setNoise(noiseOrGenerator, init, update) {
3318
+ this.setPath(noiseOrGenerator, init, update);
3319
+ }
3320
+ setPath(pathOrGenerator, init, update) {
3321
+ if (!pathOrGenerator) {
3322
+ return;
3323
+ }
3324
+ if (typeof pathOrGenerator === "function") {
3325
+ this.pathGenerator.generate = pathOrGenerator;
3326
+ if (init) {
3327
+ this.pathGenerator.init = init;
3328
+ }
3329
+ if (update) {
3330
+ this.pathGenerator.update = update;
3331
+ }
3332
+ } else {
3333
+ if (pathOrGenerator.generate) {
3334
+ this.pathGenerator.generate = pathOrGenerator.generate;
3335
+ }
3336
+ if (pathOrGenerator.init) {
3337
+ this.pathGenerator.init = pathOrGenerator.init;
3338
+ }
3339
+ if (pathOrGenerator.update) {
3340
+ this.pathGenerator.update = pathOrGenerator.update;
3341
+ }
3342
+ }
3343
+ }
3344
+ destroy() {
3345
+ this.stop();
3346
+ this.canvas.destroy();
3347
+ for (const [, drawer] of this.drawers) {
3348
+ if (drawer.destroy) {
3349
+ drawer.destroy(this);
3350
+ }
3351
+ }
3352
+ for (const key of this.drawers.keys()) {
3353
+ this.drawers.delete(key);
3354
+ }
3355
+ this.destroyed = true;
3356
+ }
3357
+ exportImg(callback) {
3358
+ this.exportImage(callback);
3359
+ }
3360
+ exportImage(callback, type, quality) {
3361
+ var _a;
3362
+ return (_a = this.canvas.element) === null || _a === void 0 ? void 0 : _a.toBlob(callback, type !== null && type !== void 0 ? type : "image/png", quality);
3363
+ }
3364
+ exportConfiguration() {
3365
+ return JSON.stringify(this.actualOptions, undefined, 2);
3366
+ }
3367
+ refresh() {
3368
+ this.stop();
3369
+ return this.start();
3370
+ }
3371
+ reset() {
3372
+ this._options = new Options;
3373
+ return this.refresh();
3374
+ }
3375
+ stop() {
3376
+ if (!this.started) {
3377
+ return;
3378
+ }
3379
+ this.firstStart = true;
3380
+ this.started = false;
3381
+ this.eventListeners.removeListeners();
3382
+ this.pause();
3383
+ this.particles.clear();
3384
+ this.canvas.clear();
3385
+ if (this.interactivity.element instanceof HTMLElement && this.intersectionObserver) {
3386
+ this.intersectionObserver.unobserve(this.interactivity.element);
3387
+ }
3388
+ for (const [, plugin] of this.plugins) {
3389
+ if (plugin.stop) {
3390
+ plugin.stop();
3391
+ }
3392
+ }
3393
+ for (const key of this.plugins.keys()) {
3394
+ this.plugins.delete(key);
3395
+ }
3396
+ this.particles.linksColors = new Map;
3397
+ delete this.particles.grabLineColor;
3398
+ delete this.particles.linksColor;
3399
+ this._sourceOptions = this._options;
3400
+ }
3401
+ async loadTheme(name) {
3402
+ this.currentTheme = name;
3403
+ await this.refresh();
3404
+ }
3405
+ async start() {
3406
+ if (this.started) {
3407
+ return;
3408
+ }
3409
+ await this.init();
3410
+ this.started = true;
3411
+ this.eventListeners.addListeners();
3412
+ if (this.interactivity.element instanceof HTMLElement && this.intersectionObserver) {
3413
+ this.intersectionObserver.observe(this.interactivity.element);
3414
+ }
3415
+ for (const [, plugin] of this.plugins) {
3416
+ if (plugin.startAsync !== undefined) {
3417
+ await plugin.startAsync();
3418
+ } else if (plugin.start !== undefined) {
3419
+ plugin.start();
3420
+ }
3421
+ }
3422
+ this.play();
3423
+ }
3424
+ addClickHandler(callback) {
3425
+ const el = this.interactivity.element;
3426
+ if (!el) {
3427
+ return;
3428
+ }
3429
+ const clickOrTouchHandler = (e, pos, radius) => {
3430
+ if (this.destroyed) {
3431
+ return;
3432
+ }
3433
+ const pxRatio = this.retina.pixelRatio, posRetina = {
3434
+ x: pos.x * pxRatio,
3435
+ y: pos.y * pxRatio
3436
+ }, particles = this.particles.quadTree.queryCircle(posRetina, radius * pxRatio);
3437
+ callback(e, particles);
3438
+ };
3439
+ const clickHandler = e => {
3440
+ if (this.destroyed) {
3441
+ return;
3442
+ }
3443
+ const mouseEvent = e;
3444
+ const pos = {
3445
+ x: mouseEvent.offsetX || mouseEvent.clientX,
3446
+ y: mouseEvent.offsetY || mouseEvent.clientY
3447
+ };
3448
+ clickOrTouchHandler(e, pos, 1);
3449
+ };
3450
+ const touchStartHandler = () => {
3451
+ if (this.destroyed) {
3452
+ return;
3453
+ }
3454
+ touched = true;
3455
+ touchMoved = false;
3456
+ };
3457
+ const touchMoveHandler = () => {
3458
+ if (this.destroyed) {
3459
+ return;
3460
+ }
3461
+ touchMoved = true;
3462
+ };
3463
+ const touchEndHandler = e => {
3464
+ var _a, _b, _c;
3465
+ if (this.destroyed) {
3466
+ return;
3467
+ }
3468
+ if (touched && !touchMoved) {
3469
+ const touchEvent = e;
3470
+ let lastTouch = touchEvent.touches[touchEvent.touches.length - 1];
3471
+ if (!lastTouch) {
3472
+ lastTouch = touchEvent.changedTouches[touchEvent.changedTouches.length - 1];
3473
+ if (!lastTouch) {
3474
+ return;
3475
+ }
3476
+ }
3477
+ const canvasRect = (_a = this.canvas.element) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
3478
+ const pos = {
3479
+ x: lastTouch.clientX - ((_b = canvasRect === null || canvasRect === void 0 ? void 0 : canvasRect.left) !== null && _b !== void 0 ? _b : 0),
3480
+ y: lastTouch.clientY - ((_c = canvasRect === null || canvasRect === void 0 ? void 0 : canvasRect.top) !== null && _c !== void 0 ? _c : 0)
3481
+ };
3482
+ clickOrTouchHandler(e, pos, Math.max(lastTouch.radiusX, lastTouch.radiusY));
3483
+ }
3484
+ touched = false;
3485
+ touchMoved = false;
3486
+ };
3487
+ const touchCancelHandler = () => {
3488
+ if (this.destroyed) {
3489
+ return;
3490
+ }
3491
+ touched = false;
3492
+ touchMoved = false;
3493
+ };
3494
+ let touched = false;
3495
+ let touchMoved = false;
3496
+ el.addEventListener("click", clickHandler);
3497
+ el.addEventListener("touchstart", touchStartHandler);
3498
+ el.addEventListener("touchmove", touchMoveHandler);
3499
+ el.addEventListener("touchend", touchEndHandler);
3500
+ el.addEventListener("touchcancel", touchCancelHandler);
3501
+ }
3502
+ updateActualOptions() {
3503
+ this.actualOptions.responsive = [];
3504
+ const newMaxWidth = this.actualOptions.setResponsive(this.canvas.size.width, this.retina.pixelRatio, this._options);
3505
+ this.actualOptions.setTheme(this.currentTheme);
3506
+ if (this.responsiveMaxWidth != newMaxWidth) {
3507
+ this.responsiveMaxWidth = newMaxWidth;
3508
+ return true;
3509
+ }
3510
+ return false;
3511
+ }
3512
+ async init() {
3513
+ this._options = new Options;
3514
+ for (const preset of this.presets) {
3515
+ this._options.load(Plugins.getPreset(preset));
3516
+ }
3517
+ const shapes = Plugins.getSupportedShapes();
3518
+ for (const type of shapes) {
3519
+ const drawer = Plugins.getShapeDrawer(type);
3520
+ if (drawer) {
3521
+ this.drawers.set(type, drawer);
3522
+ }
3523
+ }
3524
+ this._options.load(this._initialSourceOptions);
3525
+ this._options.load(this._sourceOptions);
3526
+ this.actualOptions = new Options;
3527
+ this.actualOptions.load(this._options);
3528
+ this.retina.init();
3529
+ this.canvas.init();
3530
+ this.updateActualOptions();
3531
+ this.canvas.initBackground();
3532
+ this.canvas.resize();
3533
+ this.zLayers = this.actualOptions.zLayers;
3534
+ this.duration = getRangeValue(this.actualOptions.duration);
3535
+ this.lifeTime = 0;
3536
+ this.fpsLimit = this.actualOptions.fpsLimit > 0 ? this.actualOptions.fpsLimit : 120;
3537
+ const availablePlugins = Plugins.getAvailablePlugins(this);
3538
+ for (const [id, plugin] of availablePlugins) {
3539
+ this.plugins.set(id, plugin);
3540
+ }
3541
+ for (const [, drawer] of this.drawers) {
3542
+ if (drawer.init) {
3543
+ await drawer.init(this);
3544
+ }
3545
+ }
3546
+ for (const [, plugin] of this.plugins) {
3547
+ if (plugin.init) {
3548
+ plugin.init(this.actualOptions);
3549
+ } else if (plugin.initAsync !== undefined) {
3550
+ await plugin.initAsync(this.actualOptions);
3551
+ }
3552
+ }
3553
+ const pathOptions = this.actualOptions.particles.move.path;
3554
+ if (pathOptions.generator) {
3555
+ const customGenerator = Plugins.getPathGenerator(pathOptions.generator);
3556
+ if (customGenerator) {
3557
+ if (customGenerator.init) {
3558
+ this.pathGenerator.init = customGenerator.init;
3559
+ }
3560
+ if (customGenerator.generate) {
3561
+ this.pathGenerator.generate = customGenerator.generate;
3562
+ }
3563
+ if (customGenerator.update) {
3564
+ this.pathGenerator.update = customGenerator.update;
3565
+ }
3566
+ }
3567
+ }
3568
+ this.particles.init();
3569
+ this.particles.setDensity();
3570
+ for (const [, plugin] of this.plugins) {
3571
+ if (plugin.particlesSetup !== undefined) {
3572
+ plugin.particlesSetup();
3573
+ }
3574
+ }
3575
+ }
3576
+ intersectionManager(entries) {
3577
+ if (!this.actualOptions.pauseOnOutsideViewport) {
3578
+ return;
3579
+ }
3580
+ for (const entry of entries) {
3581
+ if (entry.target !== this.interactivity.element) {
3582
+ continue;
3583
+ }
3584
+ if (entry.isIntersecting) {
3585
+ this.play();
3586
+ } else {
3587
+ this.pause();
3588
+ }
3589
+ }
3590
+ }
3591
+ }
3592
+ const tsParticlesDom = null && [];
3593
+ function fetchError(statusCode) {
3594
+ console.error(`Error tsParticles - fetch status: ${statusCode}`);
3595
+ console.error("Error tsParticles - File config not found");
3596
+ }
3597
+ class Loader {
3598
+ static dom() {
3599
+ return tsParticlesDom;
3600
+ }
3601
+ static domItem(index) {
3602
+ const dom = Loader.dom();
3603
+ const item = dom[index];
3604
+ if (item && !item.destroyed) {
3605
+ return item;
3606
+ }
3607
+ dom.splice(index, 1);
3608
+ }
3609
+ static async loadOptions(params) {
3610
+ var _a, _b, _c;
3611
+ const tagId = (_a = params.tagId) !== null && _a !== void 0 ? _a : `tsparticles${Math.floor(Math.random() * 1e4)}`;
3612
+ const {options: options, index: index} = params;
3613
+ let domContainer = (_b = params.element) !== null && _b !== void 0 ? _b : document.getElementById(tagId);
3614
+ if (!domContainer) {
3615
+ domContainer = document.createElement("div");
3616
+ domContainer.id = tagId;
3617
+ (_c = document.querySelector("body")) === null || _c === void 0 ? void 0 : _c.append(domContainer);
3618
+ }
3619
+ const currentOptions = options instanceof Array ? itemFromArray(options, index) : options;
3620
+ const dom = Loader.dom();
3621
+ const oldIndex = dom.findIndex((v => v.id === tagId));
3622
+ if (oldIndex >= 0) {
3623
+ const old = Loader.domItem(oldIndex);
3624
+ if (old && !old.destroyed) {
3625
+ old.destroy();
3626
+ dom.splice(oldIndex, 1);
3627
+ }
3628
+ }
3629
+ let canvasEl;
3630
+ if (domContainer.tagName.toLowerCase() === "canvas") {
3631
+ canvasEl = domContainer;
3632
+ canvasEl.dataset[Constants.generatedAttribute] = "false";
3633
+ } else {
3634
+ const existingCanvases = domContainer.getElementsByTagName("canvas");
3635
+ if (existingCanvases.length) {
3636
+ canvasEl = existingCanvases[0];
3637
+ canvasEl.dataset[Constants.generatedAttribute] = "false";
3638
+ } else {
3639
+ canvasEl = document.createElement("canvas");
3640
+ canvasEl.dataset[Constants.generatedAttribute] = "true";
3641
+ canvasEl.style.width = "100%";
3642
+ canvasEl.style.height = "100%";
3643
+ domContainer.appendChild(canvasEl);
3644
+ }
3645
+ }
3646
+ const newItem = new Container(tagId, currentOptions);
3647
+ if (oldIndex >= 0) {
3648
+ dom.splice(oldIndex, 0, newItem);
3649
+ } else {
3650
+ dom.push(newItem);
3651
+ }
3652
+ newItem.canvas.loadCanvas(canvasEl);
3653
+ await newItem.start();
3654
+ return newItem;
3655
+ }
3656
+ static async loadRemoteOptions(params) {
3657
+ const {url: jsonUrl, index: index} = params;
3658
+ const url = jsonUrl instanceof Array ? itemFromArray(jsonUrl, index) : jsonUrl;
3659
+ if (!url) {
3660
+ return;
3661
+ }
3662
+ const response = await fetch(url);
3663
+ if (!response.ok) {
3664
+ fetchError(response.status);
3665
+ return;
3666
+ }
3667
+ const data = await response.json();
3668
+ return await Loader.loadOptions({
3669
+ tagId: params.tagId,
3670
+ element: params.element,
3671
+ index: index,
3672
+ options: data
3673
+ });
3674
+ }
3675
+ static load(tagId, options, index) {
3676
+ const params = {
3677
+ index: index
3678
+ };
3679
+ if (typeof tagId === "string") {
3680
+ params.tagId = tagId;
3681
+ } else {
3682
+ params.options = tagId;
3683
+ }
3684
+ if (typeof options === "number") {
3685
+ params.index = options !== null && options !== void 0 ? options : params.index;
3686
+ } else {
3687
+ params.options = options !== null && options !== void 0 ? options : params.options;
3688
+ }
3689
+ return this.loadOptions(params);
3690
+ }
3691
+ static async set(id, domContainer, options, index) {
3692
+ const params = {
3693
+ index: index
3694
+ };
3695
+ if (typeof id === "string") {
3696
+ params.tagId = id;
3697
+ } else {
3698
+ params.element = id;
3699
+ }
3700
+ if (domContainer instanceof HTMLElement) {
3701
+ params.element = domContainer;
3702
+ } else {
3703
+ params.options = domContainer;
3704
+ }
3705
+ if (typeof options === "number") {
3706
+ params.index = options;
3707
+ } else {
3708
+ params.options = options !== null && options !== void 0 ? options : params.options;
3709
+ }
3710
+ return this.loadOptions(params);
3711
+ }
3712
+ static async loadJSON(tagId, jsonUrl, index) {
3713
+ let url, id;
3714
+ if (typeof jsonUrl === "number" || jsonUrl === undefined) {
3715
+ url = tagId;
3716
+ } else {
3717
+ id = tagId;
3718
+ url = jsonUrl;
3719
+ }
3720
+ return await Loader.loadRemoteOptions({
3721
+ tagId: id,
3722
+ url: url,
3723
+ index: index
3724
+ });
3725
+ }
3726
+ static async setJSON(id, domContainer, jsonUrl, index) {
3727
+ let url, newId, newIndex, element;
3728
+ if (id instanceof HTMLElement) {
3729
+ element = id;
3730
+ url = domContainer;
3731
+ newIndex = jsonUrl;
3732
+ } else {
3733
+ newId = id;
3734
+ element = domContainer;
3735
+ url = jsonUrl;
3736
+ newIndex = index;
3737
+ }
3738
+ return await Loader.loadRemoteOptions({
3739
+ tagId: newId,
3740
+ url: url,
3741
+ index: newIndex,
3742
+ element: element
3743
+ });
3744
+ }
3745
+ static setOnClickHandler(callback) {
3746
+ const dom = Loader.dom();
3747
+ if (dom.length === 0) {
3748
+ throw new Error("Can only set click handlers after calling tsParticles.load() or tsParticles.loadJSON()");
3749
+ }
3750
+ for (const domItem of dom) {
3751
+ domItem.addClickHandler(callback);
3752
+ }
3753
+ }
3754
+ }
3755
+ function NumberUtils_clamp(num, min, max) {
3756
+ return Math.min(Math.max(num, min), max);
3757
+ }
3758
+ function NumberUtils_mix(comp1, comp2, weight1, weight2) {
3759
+ return Math.floor((comp1 * weight1 + comp2 * weight2) / (weight1 + weight2));
3760
+ }
3761
+ function NumberUtils_randomInRange(r) {
3762
+ const max = NumberUtils_getRangeMax(r);
3763
+ let min = NumberUtils_getRangeMin(r);
3764
+ if (max === min) {
3765
+ min = 0;
3766
+ }
3767
+ return Math.random() * (max - min) + min;
3768
+ }
3769
+ function NumberUtils_getRangeValue(value) {
3770
+ return typeof value === "number" ? value : NumberUtils_randomInRange(value);
3771
+ }
3772
+ function NumberUtils_getRangeMin(value) {
3773
+ return typeof value === "number" ? value : value.min;
3774
+ }
3775
+ function NumberUtils_getRangeMax(value) {
3776
+ return typeof value === "number" ? value : value.max;
3777
+ }
3778
+ function NumberUtils_setRangeValue(source, value) {
3779
+ if (source === value || value === undefined && typeof source === "number") {
3780
+ return source;
3781
+ }
3782
+ const min = NumberUtils_getRangeMin(source), max = NumberUtils_getRangeMax(source);
3783
+ return value !== undefined ? {
3784
+ min: Math.min(min, value),
3785
+ max: Math.max(max, value)
3786
+ } : NumberUtils_setRangeValue(min, max);
3787
+ }
3788
+ function NumberUtils_getValue(options) {
3789
+ const random = options.random;
3790
+ const {enable: enable, minimumValue: minimumValue} = typeof random === "boolean" ? {
3791
+ enable: random,
3792
+ minimumValue: 0
3793
+ } : random;
3794
+ return enable ? NumberUtils_getRangeValue(NumberUtils_setRangeValue(options.value, minimumValue)) : NumberUtils_getRangeValue(options.value);
3795
+ }
3796
+ function NumberUtils_getDistances(pointA, pointB) {
3797
+ const dx = pointA.x - pointB.x;
3798
+ const dy = pointA.y - pointB.y;
3799
+ return {
3800
+ dx: dx,
3801
+ dy: dy,
3802
+ distance: Math.sqrt(dx * dx + dy * dy)
3803
+ };
3804
+ }
3805
+ function NumberUtils_getDistance(pointA, pointB) {
3806
+ return NumberUtils_getDistances(pointA, pointB).distance;
3807
+ }
3808
+ function NumberUtils_getParticleDirectionAngle(direction) {
3809
+ if (typeof direction === "number") {
3810
+ return direction * Math.PI / 180;
3811
+ } else {
3812
+ switch (direction) {
3813
+ case "top":
3814
+ return -Math.PI / 2;
3815
+
3816
+ case "top-right":
3817
+ return -Math.PI / 4;
3818
+
3819
+ case "right":
3820
+ return 0;
3821
+
3822
+ case "bottom-right":
3823
+ return Math.PI / 4;
3824
+
3825
+ case "bottom":
3826
+ return Math.PI / 2;
3827
+
3828
+ case "bottom-left":
3829
+ return 3 * Math.PI / 4;
3830
+
3831
+ case "left":
3832
+ return Math.PI;
3833
+
3834
+ case "top-left":
3835
+ return -3 * Math.PI / 4;
3836
+
3837
+ case "none":
3838
+ default:
3839
+ return Math.random() * Math.PI * 2;
3840
+ }
3841
+ }
3842
+ }
3843
+ function NumberUtils_getParticleBaseVelocity(direction) {
3844
+ const baseVelocity = Vector.origin;
3845
+ baseVelocity.length = 1;
3846
+ baseVelocity.angle = direction;
3847
+ return baseVelocity;
3848
+ }
3849
+ function NumberUtils_collisionVelocity(v1, v2, m1, m2) {
3850
+ return Vector.create(v1.x * (m1 - m2) / (m1 + m2) + v2.x * 2 * m2 / (m1 + m2), v1.y);
3851
+ }
3852
+ function calcEasing(value, type) {
3853
+ switch (type) {
3854
+ case "ease-out-quad":
3855
+ return 1 - (1 - value) ** 2;
3856
+
3857
+ case "ease-out-cubic":
3858
+ return 1 - (1 - value) ** 3;
3859
+
3860
+ case "ease-out-quart":
3861
+ return 1 - (1 - value) ** 4;
3862
+
3863
+ case "ease-out-quint":
3864
+ return 1 - (1 - value) ** 5;
3865
+
3866
+ case "ease-out-expo":
3867
+ return value === 1 ? 1 : 1 - Math.pow(2, -10 * value);
3868
+
3869
+ case "ease-out-sine":
3870
+ return Math.sin(value * Math.PI / 2);
3871
+
3872
+ case "ease-out-back":
3873
+ {
3874
+ const c1 = 1.70158;
3875
+ const c3 = c1 + 1;
3876
+ return 1 + c3 * Math.pow(value - 1, 3) + c1 * Math.pow(value - 1, 2);
3877
+ }
3878
+
3879
+ case "ease-out-circ":
3880
+ return Math.sqrt(1 - Math.pow(value - 1, 2));
3881
+
3882
+ default:
3883
+ return value;
3884
+ }
3885
+ }
3886
+ function rectSideBounce(pSide, pOtherSide, rectSide, rectOtherSide, velocity, factor) {
3887
+ const res = {
3888
+ bounced: false
3889
+ };
3890
+ if (pOtherSide.min >= rectOtherSide.min && pOtherSide.min <= rectOtherSide.max && pOtherSide.max >= rectOtherSide.min && pOtherSide.max <= rectOtherSide.max) {
3891
+ if (pSide.max >= rectSide.min && pSide.max <= (rectSide.max + rectSide.min) / 2 && velocity > 0 || pSide.min <= rectSide.max && pSide.min > (rectSide.max + rectSide.min) / 2 && velocity < 0) {
3892
+ res.velocity = velocity * -factor;
3893
+ res.bounced = true;
3894
+ }
3895
+ }
3896
+ return res;
3897
+ }
3898
+ function checkSelector(element, selectors) {
3899
+ if (selectors instanceof Array) {
3900
+ for (const selector of selectors) {
3901
+ if (element.matches(selector)) {
3902
+ return true;
3903
+ }
3904
+ }
3905
+ return false;
3906
+ } else {
3907
+ return element.matches(selectors);
3908
+ }
3909
+ }
3910
+ function Utils_isSsr() {
3911
+ return typeof window === "undefined" || !window || typeof window.document === "undefined" || !window.document;
3912
+ }
3913
+ function Utils_animate() {
3914
+ return Utils_isSsr() ? callback => setTimeout(callback) : callback => (window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || window.setTimeout)(callback);
3915
+ }
3916
+ function Utils_cancelAnimation() {
3917
+ return Utils_isSsr() ? handle => clearTimeout(handle) : handle => (window.cancelAnimationFrame || window.webkitCancelRequestAnimationFrame || window.mozCancelRequestAnimationFrame || window.oCancelRequestAnimationFrame || window.msCancelRequestAnimationFrame || window.clearTimeout)(handle);
3918
+ }
3919
+ function Utils_isInArray(value, array) {
3920
+ return value === array || array instanceof Array && array.indexOf(value) > -1;
3921
+ }
3922
+ async function loadFont(character) {
3923
+ var _a, _b;
3924
+ try {
3925
+ await document.fonts.load(`${(_a = character.weight) !== null && _a !== void 0 ? _a : "400"} 36px '${(_b = character.font) !== null && _b !== void 0 ? _b : "Verdana"}'`);
3926
+ } catch (_c) {}
3927
+ }
3928
+ function arrayRandomIndex(array) {
3929
+ return Math.floor(Math.random() * array.length);
3930
+ }
3931
+ function Utils_itemFromArray(array, index, useIndex = true) {
3932
+ const fixedIndex = index !== undefined && useIndex ? index % array.length : arrayRandomIndex(array);
3933
+ return array[fixedIndex];
3934
+ }
3935
+ function isPointInside(point, size, radius, direction) {
3936
+ return areBoundsInside(calculateBounds(point, radius !== null && radius !== void 0 ? radius : 0), size, direction);
3937
+ }
3938
+ function areBoundsInside(bounds, size, direction) {
3939
+ let inside = true;
3940
+ if (!direction || direction === "bottom") {
3941
+ inside = bounds.top < size.height;
3942
+ }
3943
+ if (inside && (!direction || direction === "left")) {
3944
+ inside = bounds.right > 0;
3945
+ }
3946
+ if (inside && (!direction || direction === "right")) {
3947
+ inside = bounds.left < size.width;
3948
+ }
3949
+ if (inside && (!direction || direction === "top")) {
3950
+ inside = bounds.bottom > 0;
3951
+ }
3952
+ return inside;
3953
+ }
3954
+ function calculateBounds(point, radius) {
3955
+ return {
3956
+ bottom: point.y + radius,
3957
+ left: point.x - radius,
3958
+ right: point.x + radius,
3959
+ top: point.y - radius
3960
+ };
3961
+ }
3962
+ function Utils_deepExtend(destination, ...sources) {
3963
+ for (const source of sources) {
3964
+ if (source === undefined || source === null) {
3965
+ continue;
3966
+ }
3967
+ if (typeof source !== "object") {
3968
+ destination = source;
3969
+ continue;
3970
+ }
3971
+ const sourceIsArray = Array.isArray(source);
3972
+ if (sourceIsArray && (typeof destination !== "object" || !destination || !Array.isArray(destination))) {
3973
+ destination = [];
3974
+ } else if (!sourceIsArray && (typeof destination !== "object" || !destination || Array.isArray(destination))) {
3975
+ destination = {};
3976
+ }
3977
+ for (const key in source) {
3978
+ if (key === "__proto__") {
3979
+ continue;
3980
+ }
3981
+ const sourceDict = source;
3982
+ const value = sourceDict[key];
3983
+ const isObject = typeof value === "object";
3984
+ const destDict = destination;
3985
+ destDict[key] = isObject && Array.isArray(value) ? value.map((v => Utils_deepExtend(destDict[key], v))) : Utils_deepExtend(destDict[key], value);
3986
+ }
3987
+ }
3988
+ return destination;
3989
+ }
3990
+ function isDivModeEnabled(mode, divs) {
3991
+ return divs instanceof Array ? !!divs.find((t => t.enable && Utils_isInArray(mode, t.mode))) : Utils_isInArray(mode, divs.mode);
3992
+ }
3993
+ function divModeExecute(mode, divs, callback) {
3994
+ if (divs instanceof Array) {
3995
+ for (const div of divs) {
3996
+ const divMode = div.mode;
3997
+ const divEnabled = div.enable;
3998
+ if (divEnabled && Utils_isInArray(mode, divMode)) {
3999
+ singleDivModeExecute(div, callback);
4000
+ }
4001
+ }
4002
+ } else {
4003
+ const divMode = divs.mode;
4004
+ const divEnabled = divs.enable;
4005
+ if (divEnabled && Utils_isInArray(mode, divMode)) {
4006
+ singleDivModeExecute(divs, callback);
4007
+ }
4008
+ }
4009
+ }
4010
+ function singleDivModeExecute(div, callback) {
4011
+ const selectors = div.selectors;
4012
+ if (selectors instanceof Array) {
4013
+ for (const selector of selectors) {
4014
+ callback(selector, div);
4015
+ }
4016
+ } else {
4017
+ callback(selectors, div);
4018
+ }
4019
+ }
4020
+ function divMode(divs, element) {
4021
+ if (!element || !divs) {
4022
+ return;
4023
+ }
4024
+ if (divs instanceof Array) {
4025
+ return divs.find((d => checkSelector(element, d.selectors)));
4026
+ } else if (checkSelector(element, divs.selectors)) {
4027
+ return divs;
4028
+ }
4029
+ }
4030
+ function circleBounceDataFromParticle(p) {
4031
+ return {
4032
+ position: p.getPosition(),
4033
+ radius: p.getRadius(),
4034
+ mass: p.getMass(),
4035
+ velocity: p.velocity,
4036
+ factor: Vector.create(getValue(p.options.bounce.horizontal), getValue(p.options.bounce.vertical))
4037
+ };
4038
+ }
4039
+ function circleBounce(p1, p2) {
4040
+ const {x: xVelocityDiff, y: yVelocityDiff} = p1.velocity.sub(p2.velocity);
4041
+ const [pos1, pos2] = [ p1.position, p2.position ];
4042
+ const {dx: xDist, dy: yDist} = getDistances(pos2, pos1);
4043
+ if (xVelocityDiff * xDist + yVelocityDiff * yDist >= 0) {
4044
+ const angle = -Math.atan2(yDist, xDist);
4045
+ const m1 = p1.mass;
4046
+ const m2 = p2.mass;
4047
+ const u1 = p1.velocity.rotate(angle);
4048
+ const u2 = p2.velocity.rotate(angle);
4049
+ const v1 = collisionVelocity(u1, u2, m1, m2);
4050
+ const v2 = collisionVelocity(u2, u1, m1, m2);
4051
+ const vFinal1 = v1.rotate(-angle);
4052
+ const vFinal2 = v2.rotate(-angle);
4053
+ p1.velocity.x = vFinal1.x * p1.factor.x;
4054
+ p1.velocity.y = vFinal1.y * p1.factor.y;
4055
+ p2.velocity.x = vFinal2.x * p2.factor.x;
4056
+ p2.velocity.y = vFinal2.y * p2.factor.y;
4057
+ }
4058
+ }
4059
+ function rectBounce(particle, divBounds) {
4060
+ const pPos = particle.getPosition();
4061
+ const size = particle.getRadius();
4062
+ const bounds = calculateBounds(pPos, size);
4063
+ const resH = rectSideBounce({
4064
+ min: bounds.left,
4065
+ max: bounds.right
4066
+ }, {
4067
+ min: bounds.top,
4068
+ max: bounds.bottom
4069
+ }, {
4070
+ min: divBounds.left,
4071
+ max: divBounds.right
4072
+ }, {
4073
+ min: divBounds.top,
4074
+ max: divBounds.bottom
4075
+ }, particle.velocity.x, getValue(particle.options.bounce.horizontal));
4076
+ if (resH.bounced) {
4077
+ if (resH.velocity !== undefined) {
4078
+ particle.velocity.x = resH.velocity;
4079
+ }
4080
+ if (resH.position !== undefined) {
4081
+ particle.position.x = resH.position;
4082
+ }
4083
+ }
4084
+ const resV = rectSideBounce({
4085
+ min: bounds.top,
4086
+ max: bounds.bottom
4087
+ }, {
4088
+ min: bounds.left,
4089
+ max: bounds.right
4090
+ }, {
4091
+ min: divBounds.top,
4092
+ max: divBounds.bottom
4093
+ }, {
4094
+ min: divBounds.left,
4095
+ max: divBounds.right
4096
+ }, particle.velocity.y, getValue(particle.options.bounce.vertical));
4097
+ if (resV.bounced) {
4098
+ if (resV.velocity !== undefined) {
4099
+ particle.velocity.y = resV.velocity;
4100
+ }
4101
+ if (resV.position !== undefined) {
4102
+ particle.position.y = resV.position;
4103
+ }
4104
+ }
4105
+ }
4106
+ function hue2rgb(p, q, t) {
4107
+ let tCalc = t;
4108
+ if (tCalc < 0) {
4109
+ tCalc += 1;
4110
+ }
4111
+ if (tCalc > 1) {
4112
+ tCalc -= 1;
4113
+ }
4114
+ if (tCalc < 1 / 6) {
4115
+ return p + (q - p) * 6 * tCalc;
4116
+ }
4117
+ if (tCalc < 1 / 2) {
4118
+ return q;
4119
+ }
4120
+ if (tCalc < 2 / 3) {
4121
+ return p + (q - p) * (2 / 3 - tCalc) * 6;
4122
+ }
4123
+ return p;
4124
+ }
4125
+ function stringToRgba(input) {
4126
+ if (input.startsWith("rgb")) {
4127
+ const regex = /rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([\d.]+)\s*)?\)/i;
4128
+ const result = regex.exec(input);
4129
+ return result ? {
4130
+ a: result.length > 4 ? parseFloat(result[5]) : 1,
4131
+ b: parseInt(result[3], 10),
4132
+ g: parseInt(result[2], 10),
4133
+ r: parseInt(result[1], 10)
4134
+ } : undefined;
4135
+ } else if (input.startsWith("hsl")) {
4136
+ const regex = /hsla?\(\s*(\d+)\s*,\s*(\d+)%\s*,\s*(\d+)%\s*(,\s*([\d.]+)\s*)?\)/i;
4137
+ const result = regex.exec(input);
4138
+ return result ? hslaToRgba({
4139
+ a: result.length > 4 ? parseFloat(result[5]) : 1,
4140
+ h: parseInt(result[1], 10),
4141
+ l: parseInt(result[3], 10),
4142
+ s: parseInt(result[2], 10)
4143
+ }) : undefined;
4144
+ } else if (input.startsWith("hsv")) {
4145
+ const regex = /hsva?\(\s*(\d+)°\s*,\s*(\d+)%\s*,\s*(\d+)%\s*(,\s*([\d.]+)\s*)?\)/i;
4146
+ const result = regex.exec(input);
4147
+ return result ? hsvaToRgba({
4148
+ a: result.length > 4 ? parseFloat(result[5]) : 1,
4149
+ h: parseInt(result[1], 10),
4150
+ s: parseInt(result[2], 10),
4151
+ v: parseInt(result[3], 10)
4152
+ }) : undefined;
4153
+ } else {
4154
+ const shorthandRegex = /^#?([a-f\d])([a-f\d])([a-f\d])([a-f\d])?$/i;
4155
+ const hexFixed = input.replace(shorthandRegex, ((_m, r, g, b, a) => r + r + g + g + b + b + (a !== undefined ? a + a : "")));
4156
+ const regex = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?$/i;
4157
+ const result = regex.exec(hexFixed);
4158
+ return result ? {
4159
+ a: result[4] !== undefined ? parseInt(result[4], 16) / 255 : 1,
4160
+ b: parseInt(result[3], 16),
4161
+ g: parseInt(result[2], 16),
4162
+ r: parseInt(result[1], 16)
4163
+ } : undefined;
4164
+ }
4165
+ }
4166
+ function ColorUtils_colorToRgb(input, index, useIndex = true) {
4167
+ var _a, _b, _c;
4168
+ if (input === undefined) {
4169
+ return;
4170
+ }
4171
+ const color = typeof input === "string" ? {
4172
+ value: input
4173
+ } : input;
4174
+ let res;
4175
+ if (typeof color.value === "string") {
4176
+ if (color.value === Constants.randomColorValue) {
4177
+ res = getRandomRgbColor();
4178
+ } else {
4179
+ res = stringToRgb(color.value);
4180
+ }
4181
+ } else {
4182
+ if (color.value instanceof Array) {
4183
+ const colorSelected = itemFromArray(color.value, index, useIndex);
4184
+ res = ColorUtils_colorToRgb({
4185
+ value: colorSelected
4186
+ });
4187
+ } else {
4188
+ const colorValue = color.value;
4189
+ const rgbColor = (_a = colorValue.rgb) !== null && _a !== void 0 ? _a : color.value;
4190
+ if (rgbColor.r !== undefined) {
4191
+ res = rgbColor;
4192
+ } else {
4193
+ const hslColor = (_b = colorValue.hsl) !== null && _b !== void 0 ? _b : color.value;
4194
+ if (hslColor.h !== undefined && hslColor.l !== undefined) {
4195
+ res = hslToRgb(hslColor);
4196
+ } else {
4197
+ const hsvColor = (_c = colorValue.hsv) !== null && _c !== void 0 ? _c : color.value;
4198
+ if (hsvColor.h !== undefined && hsvColor.v !== undefined) {
4199
+ res = hsvToRgb(hsvColor);
4200
+ }
4201
+ }
4202
+ }
4203
+ }
4204
+ }
4205
+ return res;
4206
+ }
4207
+ function ColorUtils_colorToHsl(color, index, useIndex = true) {
4208
+ const rgb = ColorUtils_colorToRgb(color, index, useIndex);
4209
+ return rgb !== undefined ? rgbToHsl(rgb) : undefined;
4210
+ }
4211
+ function rgbToHsl(color) {
4212
+ const r1 = color.r / 255;
4213
+ const g1 = color.g / 255;
4214
+ const b1 = color.b / 255;
4215
+ const max = Math.max(r1, g1, b1);
4216
+ const min = Math.min(r1, g1, b1);
4217
+ const res = {
4218
+ h: 0,
4219
+ l: (max + min) / 2,
4220
+ s: 0
4221
+ };
4222
+ if (max != min) {
4223
+ res.s = res.l < .5 ? (max - min) / (max + min) : (max - min) / (2 - max - min);
4224
+ res.h = r1 === max ? (g1 - b1) / (max - min) : res.h = g1 === max ? 2 + (b1 - r1) / (max - min) : 4 + (r1 - g1) / (max - min);
4225
+ }
4226
+ res.l *= 100;
4227
+ res.s *= 100;
4228
+ res.h *= 60;
4229
+ if (res.h < 0) {
4230
+ res.h += 360;
4231
+ }
4232
+ return res;
4233
+ }
4234
+ function stringToAlpha(input) {
4235
+ var _a;
4236
+ return (_a = stringToRgba(input)) === null || _a === void 0 ? void 0 : _a.a;
4237
+ }
4238
+ function stringToRgb(input) {
4239
+ return stringToRgba(input);
4240
+ }
4241
+ function hslToRgb(hsl) {
4242
+ const result = {
4243
+ b: 0,
4244
+ g: 0,
4245
+ r: 0
4246
+ };
4247
+ const hslPercent = {
4248
+ h: hsl.h / 360,
4249
+ l: hsl.l / 100,
4250
+ s: hsl.s / 100
4251
+ };
4252
+ if (hslPercent.s === 0) {
4253
+ result.b = hslPercent.l;
4254
+ result.g = hslPercent.l;
4255
+ result.r = hslPercent.l;
4256
+ } else {
4257
+ const q = hslPercent.l < .5 ? hslPercent.l * (1 + hslPercent.s) : hslPercent.l + hslPercent.s - hslPercent.l * hslPercent.s;
4258
+ const p = 2 * hslPercent.l - q;
4259
+ result.r = hue2rgb(p, q, hslPercent.h + 1 / 3);
4260
+ result.g = hue2rgb(p, q, hslPercent.h);
4261
+ result.b = hue2rgb(p, q, hslPercent.h - 1 / 3);
4262
+ }
4263
+ result.r = Math.floor(result.r * 255);
4264
+ result.g = Math.floor(result.g * 255);
4265
+ result.b = Math.floor(result.b * 255);
4266
+ return result;
4267
+ }
4268
+ function hslaToRgba(hsla) {
4269
+ const rgbResult = hslToRgb(hsla);
4270
+ return {
4271
+ a: hsla.a,
4272
+ b: rgbResult.b,
4273
+ g: rgbResult.g,
4274
+ r: rgbResult.r
4275
+ };
4276
+ }
4277
+ function hslToHsv(hsl) {
4278
+ const l = hsl.l / 100, sl = hsl.s / 100;
4279
+ const v = l + sl * Math.min(l, 1 - l), sv = !v ? 0 : 2 * (1 - l / v);
4280
+ return {
4281
+ h: hsl.h,
4282
+ s: sv * 100,
4283
+ v: v * 100
4284
+ };
4285
+ }
4286
+ function hslaToHsva(hsla) {
4287
+ const hsvResult = hslToHsv(hsla);
4288
+ return {
4289
+ a: hsla.a,
4290
+ h: hsvResult.h,
4291
+ s: hsvResult.s,
4292
+ v: hsvResult.v
4293
+ };
4294
+ }
4295
+ function hsvToHsl(hsv) {
4296
+ const v = hsv.v / 100, sv = hsv.s / 100;
4297
+ const l = v * (1 - sv / 2), sl = l === 0 || l === 1 ? 0 : (v - l) / Math.min(l, 1 - l);
4298
+ return {
4299
+ h: hsv.h,
4300
+ l: l * 100,
4301
+ s: sl * 100
4302
+ };
4303
+ }
4304
+ function hsvaToHsla(hsva) {
4305
+ const hslResult = hsvToHsl(hsva);
4306
+ return {
4307
+ a: hsva.a,
4308
+ h: hslResult.h,
4309
+ l: hslResult.l,
4310
+ s: hslResult.s
4311
+ };
4312
+ }
4313
+ function hsvToRgb(hsv) {
4314
+ const result = {
4315
+ b: 0,
4316
+ g: 0,
4317
+ r: 0
4318
+ };
4319
+ const hsvPercent = {
4320
+ h: hsv.h / 60,
4321
+ s: hsv.s / 100,
4322
+ v: hsv.v / 100
4323
+ };
4324
+ const c = hsvPercent.v * hsvPercent.s, x = c * (1 - Math.abs(hsvPercent.h % 2 - 1));
4325
+ let tempRgb;
4326
+ if (hsvPercent.h >= 0 && hsvPercent.h <= 1) {
4327
+ tempRgb = {
4328
+ r: c,
4329
+ g: x,
4330
+ b: 0
4331
+ };
4332
+ } else if (hsvPercent.h > 1 && hsvPercent.h <= 2) {
4333
+ tempRgb = {
4334
+ r: x,
4335
+ g: c,
4336
+ b: 0
4337
+ };
4338
+ } else if (hsvPercent.h > 2 && hsvPercent.h <= 3) {
4339
+ tempRgb = {
4340
+ r: 0,
4341
+ g: c,
4342
+ b: x
4343
+ };
4344
+ } else if (hsvPercent.h > 3 && hsvPercent.h <= 4) {
4345
+ tempRgb = {
4346
+ r: 0,
4347
+ g: x,
4348
+ b: c
4349
+ };
4350
+ } else if (hsvPercent.h > 4 && hsvPercent.h <= 5) {
4351
+ tempRgb = {
4352
+ r: x,
4353
+ g: 0,
4354
+ b: c
4355
+ };
4356
+ } else if (hsvPercent.h > 5 && hsvPercent.h <= 6) {
4357
+ tempRgb = {
4358
+ r: c,
4359
+ g: 0,
4360
+ b: x
4361
+ };
4362
+ }
4363
+ if (tempRgb) {
4364
+ const m = hsvPercent.v - c;
4365
+ result.r = Math.floor((tempRgb.r + m) * 255);
4366
+ result.g = Math.floor((tempRgb.g + m) * 255);
4367
+ result.b = Math.floor((tempRgb.b + m) * 255);
4368
+ }
4369
+ return result;
4370
+ }
4371
+ function hsvaToRgba(hsva) {
4372
+ const rgbResult = hsvToRgb(hsva);
4373
+ return {
4374
+ a: hsva.a,
4375
+ b: rgbResult.b,
4376
+ g: rgbResult.g,
4377
+ r: rgbResult.r
4378
+ };
4379
+ }
4380
+ function rgbToHsv(rgb) {
4381
+ const rgbPercent = {
4382
+ r: rgb.r / 255,
4383
+ g: rgb.g / 255,
4384
+ b: rgb.b / 255
4385
+ }, xMax = Math.max(rgbPercent.r, rgbPercent.g, rgbPercent.b), xMin = Math.min(rgbPercent.r, rgbPercent.g, rgbPercent.b), v = xMax, c = xMax - xMin;
4386
+ let h = 0;
4387
+ if (v === rgbPercent.r) {
4388
+ h = 60 * ((rgbPercent.g - rgbPercent.b) / c);
4389
+ } else if (v === rgbPercent.g) {
4390
+ h = 60 * (2 + (rgbPercent.b - rgbPercent.r) / c);
4391
+ } else if (v === rgbPercent.b) {
4392
+ h = 60 * (4 + (rgbPercent.r - rgbPercent.g) / c);
4393
+ }
4394
+ const s = !v ? 0 : c / v;
4395
+ return {
4396
+ h: h,
4397
+ s: s * 100,
4398
+ v: v * 100
4399
+ };
4400
+ }
4401
+ function rgbaToHsva(rgba) {
4402
+ const hsvResult = rgbToHsv(rgba);
4403
+ return {
4404
+ a: rgba.a,
4405
+ h: hsvResult.h,
4406
+ s: hsvResult.s,
4407
+ v: hsvResult.v
4408
+ };
4409
+ }
4410
+ function getRandomRgbColor(min) {
4411
+ const fixedMin = min !== null && min !== void 0 ? min : 0;
4412
+ return {
4413
+ b: Math.floor(randomInRange(setRangeValue(fixedMin, 256))),
4414
+ g: Math.floor(randomInRange(setRangeValue(fixedMin, 256))),
4415
+ r: Math.floor(randomInRange(setRangeValue(fixedMin, 256)))
4416
+ };
4417
+ }
4418
+ function ColorUtils_getStyleFromRgb(color, opacity) {
4419
+ return `rgba(${color.r}, ${color.g}, ${color.b}, ${opacity !== null && opacity !== void 0 ? opacity : 1})`;
4420
+ }
4421
+ function ColorUtils_getStyleFromHsl(color, opacity) {
4422
+ return `hsla(${color.h}, ${color.s}%, ${color.l}%, ${opacity !== null && opacity !== void 0 ? opacity : 1})`;
4423
+ }
4424
+ function getStyleFromHsv(color, opacity) {
4425
+ return ColorUtils_getStyleFromHsl(hsvToHsl(color), opacity);
4426
+ }
4427
+ function ColorUtils_colorMix(color1, color2, size1, size2) {
4428
+ let rgb1 = color1;
4429
+ let rgb2 = color2;
4430
+ if (rgb1.r === undefined) {
4431
+ rgb1 = hslToRgb(color1);
4432
+ }
4433
+ if (rgb2.r === undefined) {
4434
+ rgb2 = hslToRgb(color2);
4435
+ }
4436
+ return {
4437
+ b: mix(rgb1.b, rgb2.b, size1, size2),
4438
+ g: mix(rgb1.g, rgb2.g, size1, size2),
4439
+ r: mix(rgb1.r, rgb2.r, size1, size2)
4440
+ };
4441
+ }
4442
+ function getLinkColor(p1, p2, linkColor) {
4443
+ var _a, _b;
4444
+ if (linkColor === Constants.randomColorValue) {
4445
+ return getRandomRgbColor();
4446
+ } else if (linkColor === "mid") {
4447
+ const sourceColor = (_a = p1.getFillColor()) !== null && _a !== void 0 ? _a : p1.getStrokeColor();
4448
+ const destColor = (_b = p2 === null || p2 === void 0 ? void 0 : p2.getFillColor()) !== null && _b !== void 0 ? _b : p2 === null || p2 === void 0 ? void 0 : p2.getStrokeColor();
4449
+ if (sourceColor && destColor && p2) {
4450
+ return ColorUtils_colorMix(sourceColor, destColor, p1.getRadius(), p2.getRadius());
4451
+ } else {
4452
+ const hslColor = sourceColor !== null && sourceColor !== void 0 ? sourceColor : destColor;
4453
+ if (hslColor) {
4454
+ return hslToRgb(hslColor);
4455
+ }
4456
+ }
4457
+ } else {
4458
+ return linkColor;
4459
+ }
4460
+ }
4461
+ function getLinkRandomColor(optColor, blink, consent) {
4462
+ const color = typeof optColor === "string" ? optColor : optColor.value;
4463
+ if (color === Constants.randomColorValue) {
4464
+ if (consent) {
4465
+ return ColorUtils_colorToRgb({
4466
+ value: color
4467
+ });
4468
+ } else if (blink) {
4469
+ return Constants.randomColorValue;
4470
+ } else {
4471
+ return Constants.midColorValue;
4472
+ }
4473
+ } else {
4474
+ return ColorUtils_colorToRgb({
4475
+ value: color
4476
+ });
4477
+ }
4478
+ }
4479
+ function ColorUtils_getHslFromAnimation(animation) {
4480
+ return animation !== undefined ? {
4481
+ h: animation.h.value,
4482
+ s: animation.s.value,
4483
+ l: animation.l.value
4484
+ } : undefined;
4485
+ }
4486
+ function getHslAnimationFromHsl(hsl, animationOptions, reduceFactor) {
4487
+ const resColor = {
4488
+ h: {
4489
+ enable: false,
4490
+ value: hsl.h
4491
+ },
4492
+ s: {
4493
+ enable: false,
4494
+ value: hsl.s
4495
+ },
4496
+ l: {
4497
+ enable: false,
4498
+ value: hsl.l
4499
+ }
4500
+ };
4501
+ if (animationOptions) {
4502
+ setColorAnimation(resColor.h, animationOptions.h, reduceFactor);
4503
+ setColorAnimation(resColor.s, animationOptions.s, reduceFactor);
4504
+ setColorAnimation(resColor.l, animationOptions.l, reduceFactor);
4505
+ }
4506
+ return resColor;
4507
+ }
4508
+ function setColorAnimation(colorValue, colorAnimation, reduceFactor) {
4509
+ colorValue.enable = colorAnimation.enable;
4510
+ if (colorValue.enable) {
4511
+ colorValue.velocity = colorAnimation.speed / 100 * reduceFactor;
4512
+ if (colorAnimation.sync) {
4513
+ return;
4514
+ }
4515
+ colorValue.status = 0;
4516
+ colorValue.velocity *= Math.random();
4517
+ if (colorValue.value) {
4518
+ colorValue.value *= Math.random();
4519
+ }
4520
+ } else {
4521
+ colorValue.velocity = 0;
4522
+ }
4523
+ }
4524
+ function drawLine(context, begin, end) {
4525
+ context.beginPath();
4526
+ context.moveTo(begin.x, begin.y);
4527
+ context.lineTo(end.x, end.y);
4528
+ context.closePath();
4529
+ }
4530
+ function drawTriangle(context, p1, p2, p3) {
4531
+ context.beginPath();
4532
+ context.moveTo(p1.x, p1.y);
4533
+ context.lineTo(p2.x, p2.y);
4534
+ context.lineTo(p3.x, p3.y);
4535
+ context.closePath();
4536
+ }
4537
+ function CanvasUtils_paintBase(context, dimension, baseColor) {
4538
+ context.save();
4539
+ context.fillStyle = baseColor !== null && baseColor !== void 0 ? baseColor : "rgba(0,0,0,0)";
4540
+ context.fillRect(0, 0, dimension.width, dimension.height);
4541
+ context.restore();
4542
+ }
4543
+ function CanvasUtils_clear(context, dimension) {
4544
+ context.clearRect(0, 0, dimension.width, dimension.height);
4545
+ }
4546
+ function drawLinkLine(context, width, begin, end, maxDistance, canvasSize, warp, backgroundMask, composite, colorLine, opacity, shadow) {
4547
+ let drawn = false;
4548
+ if (getDistance(begin, end) <= maxDistance) {
4549
+ drawLine(context, begin, end);
4550
+ drawn = true;
4551
+ } else if (warp) {
4552
+ let pi1;
4553
+ let pi2;
4554
+ const endNE = {
4555
+ x: end.x - canvasSize.width,
4556
+ y: end.y
4557
+ };
4558
+ const d1 = getDistances(begin, endNE);
4559
+ if (d1.distance <= maxDistance) {
4560
+ const yi = begin.y - d1.dy / d1.dx * begin.x;
4561
+ pi1 = {
4562
+ x: 0,
4563
+ y: yi
4564
+ };
4565
+ pi2 = {
4566
+ x: canvasSize.width,
4567
+ y: yi
4568
+ };
4569
+ } else {
4570
+ const endSW = {
4571
+ x: end.x,
4572
+ y: end.y - canvasSize.height
4573
+ };
4574
+ const d2 = getDistances(begin, endSW);
4575
+ if (d2.distance <= maxDistance) {
4576
+ const yi = begin.y - d2.dy / d2.dx * begin.x;
4577
+ const xi = -yi / (d2.dy / d2.dx);
4578
+ pi1 = {
4579
+ x: xi,
4580
+ y: 0
4581
+ };
4582
+ pi2 = {
4583
+ x: xi,
4584
+ y: canvasSize.height
4585
+ };
4586
+ } else {
4587
+ const endSE = {
4588
+ x: end.x - canvasSize.width,
4589
+ y: end.y - canvasSize.height
4590
+ };
4591
+ const d3 = getDistances(begin, endSE);
4592
+ if (d3.distance <= maxDistance) {
4593
+ const yi = begin.y - d3.dy / d3.dx * begin.x;
4594
+ const xi = -yi / (d3.dy / d3.dx);
4595
+ pi1 = {
4596
+ x: xi,
4597
+ y: yi
4598
+ };
4599
+ pi2 = {
4600
+ x: pi1.x + canvasSize.width,
4601
+ y: pi1.y + canvasSize.height
4602
+ };
4603
+ }
4604
+ }
4605
+ }
4606
+ if (pi1 && pi2) {
4607
+ drawLine(context, begin, pi1);
4608
+ drawLine(context, end, pi2);
4609
+ drawn = true;
4610
+ }
4611
+ }
4612
+ if (!drawn) {
4613
+ return;
4614
+ }
4615
+ context.lineWidth = width;
4616
+ if (backgroundMask) {
4617
+ context.globalCompositeOperation = composite;
4618
+ }
4619
+ context.strokeStyle = getStyleFromRgb(colorLine, opacity);
4620
+ if (shadow.enable) {
4621
+ const shadowColor = colorToRgb(shadow.color);
4622
+ if (shadowColor) {
4623
+ context.shadowBlur = shadow.blur;
4624
+ context.shadowColor = getStyleFromRgb(shadowColor);
4625
+ }
4626
+ }
4627
+ context.stroke();
4628
+ }
4629
+ function drawLinkTriangle(context, pos1, pos2, pos3, backgroundMask, composite, colorTriangle, opacityTriangle) {
4630
+ drawTriangle(context, pos1, pos2, pos3);
4631
+ if (backgroundMask) {
4632
+ context.globalCompositeOperation = composite;
4633
+ }
4634
+ context.fillStyle = getStyleFromRgb(colorTriangle, opacityTriangle);
4635
+ context.fill();
4636
+ }
4637
+ function CanvasUtils_drawConnectLine(context, width, lineStyle, begin, end) {
4638
+ context.save();
4639
+ drawLine(context, begin, end);
4640
+ context.lineWidth = width;
4641
+ context.strokeStyle = lineStyle;
4642
+ context.stroke();
4643
+ context.restore();
4644
+ }
4645
+ function CanvasUtils_gradient(context, p1, p2, opacity) {
4646
+ const gradStop = Math.floor(p2.getRadius() / p1.getRadius());
4647
+ const color1 = p1.getFillColor();
4648
+ const color2 = p2.getFillColor();
4649
+ if (!color1 || !color2) {
4650
+ return;
4651
+ }
4652
+ const sourcePos = p1.getPosition();
4653
+ const destPos = p2.getPosition();
4654
+ const midRgb = colorMix(color1, color2, p1.getRadius(), p2.getRadius());
4655
+ const grad = context.createLinearGradient(sourcePos.x, sourcePos.y, destPos.x, destPos.y);
4656
+ grad.addColorStop(0, getStyleFromHsl(color1, opacity));
4657
+ grad.addColorStop(gradStop > 1 ? 1 : gradStop, getStyleFromRgb(midRgb, opacity));
4658
+ grad.addColorStop(1, getStyleFromHsl(color2, opacity));
4659
+ return grad;
4660
+ }
4661
+ function CanvasUtils_drawGrabLine(context, width, begin, end, colorLine, opacity) {
4662
+ context.save();
4663
+ drawLine(context, begin, end);
4664
+ context.strokeStyle = getStyleFromRgb(colorLine, opacity);
4665
+ context.lineWidth = width;
4666
+ context.stroke();
4667
+ context.restore();
4668
+ }
4669
+ function CanvasUtils_drawParticle(container, context, particle, delta, fillColorValue, strokeColorValue, backgroundMask, composite, radius, opacity, shadow, gradient) {
4670
+ var _a, _b, _c, _d, _e, _f;
4671
+ const pos = particle.getPosition();
4672
+ const tiltOptions = particle.options.tilt;
4673
+ const rollOptions = particle.options.roll;
4674
+ context.save();
4675
+ if (tiltOptions.enable || rollOptions.enable) {
4676
+ const roll = rollOptions.enable && particle.roll;
4677
+ const tilt = tiltOptions.enable && particle.tilt;
4678
+ const rollHorizontal = roll && (rollOptions.mode === "horizontal" || rollOptions.mode === "both");
4679
+ const rollVertical = roll && (rollOptions.mode === "vertical" || rollOptions.mode === "both");
4680
+ context.setTransform(rollHorizontal ? Math.cos(particle.roll.angle) : 1, tilt ? Math.cos(particle.tilt.value) * particle.tilt.cosDirection : 0, tilt ? Math.sin(particle.tilt.value) * particle.tilt.sinDirection : 0, rollVertical ? Math.sin(particle.roll.angle) : 1, pos.x, pos.y);
4681
+ } else {
4682
+ context.translate(pos.x, pos.y);
4683
+ }
4684
+ context.beginPath();
4685
+ const angle = ((_b = (_a = particle.rotate) === null || _a === void 0 ? void 0 : _a.value) !== null && _b !== void 0 ? _b : 0) + (particle.options.rotate.path ? particle.velocity.angle : 0);
4686
+ if (angle !== 0) {
4687
+ context.rotate(angle);
4688
+ }
4689
+ if (backgroundMask) {
4690
+ context.globalCompositeOperation = composite;
4691
+ }
4692
+ const shadowColor = particle.shadowColor;
4693
+ if (shadow.enable && shadowColor) {
4694
+ context.shadowBlur = shadow.blur;
4695
+ context.shadowColor = getStyleFromRgb(shadowColor);
4696
+ context.shadowOffsetX = shadow.offset.x;
4697
+ context.shadowOffsetY = shadow.offset.y;
4698
+ }
4699
+ if (gradient) {
4700
+ const gradientAngle = gradient.angle.value;
4701
+ const fillGradient = gradient.type === "radial" ? context.createRadialGradient(0, 0, 0, 0, 0, radius) : context.createLinearGradient(Math.cos(gradientAngle) * -radius, Math.sin(gradientAngle) * -radius, Math.cos(gradientAngle) * radius, Math.sin(gradientAngle) * radius);
4702
+ for (const color of gradient.colors) {
4703
+ fillGradient.addColorStop(color.stop, getStyleFromHsl({
4704
+ h: color.value.h.value,
4705
+ s: color.value.s.value,
4706
+ l: color.value.l.value
4707
+ }, (_d = (_c = color.opacity) === null || _c === void 0 ? void 0 : _c.value) !== null && _d !== void 0 ? _d : opacity));
4708
+ }
4709
+ context.fillStyle = fillGradient;
4710
+ } else {
4711
+ if (fillColorValue) {
4712
+ context.fillStyle = fillColorValue;
4713
+ }
4714
+ }
4715
+ const stroke = particle.stroke;
4716
+ context.lineWidth = (_e = particle.strokeWidth) !== null && _e !== void 0 ? _e : 0;
4717
+ if (strokeColorValue) {
4718
+ context.strokeStyle = strokeColorValue;
4719
+ }
4720
+ drawShape(container, context, particle, radius, opacity, delta);
4721
+ if (((_f = stroke === null || stroke === void 0 ? void 0 : stroke.width) !== null && _f !== void 0 ? _f : 0) > 0) {
4722
+ context.stroke();
4723
+ }
4724
+ if (particle.close) {
4725
+ context.closePath();
4726
+ }
4727
+ if (particle.fill) {
4728
+ context.fill();
4729
+ }
4730
+ context.restore();
4731
+ context.save();
4732
+ if (tiltOptions.enable && particle.tilt) {
4733
+ context.setTransform(1, Math.cos(particle.tilt.value) * particle.tilt.cosDirection, Math.sin(particle.tilt.value) * particle.tilt.sinDirection, 1, pos.x, pos.y);
4734
+ } else {
4735
+ context.translate(pos.x, pos.y);
4736
+ }
4737
+ if (angle !== 0) {
4738
+ context.rotate(angle);
4739
+ }
4740
+ if (backgroundMask) {
4741
+ context.globalCompositeOperation = composite;
4742
+ }
4743
+ drawShapeAfterEffect(container, context, particle, radius, opacity, delta);
4744
+ context.restore();
4745
+ }
4746
+ function drawShape(container, context, particle, radius, opacity, delta) {
4747
+ if (!particle.shape) {
4748
+ return;
4749
+ }
4750
+ const drawer = container.drawers.get(particle.shape);
4751
+ if (!drawer) {
4752
+ return;
4753
+ }
4754
+ drawer.draw(context, particle, radius, opacity, delta, container.retina.pixelRatio);
4755
+ }
4756
+ function drawShapeAfterEffect(container, context, particle, radius, opacity, delta) {
4757
+ if (!particle.shape) {
4758
+ return;
4759
+ }
4760
+ const drawer = container.drawers.get(particle.shape);
4761
+ if (!(drawer === null || drawer === void 0 ? void 0 : drawer.afterEffect)) {
4762
+ return;
4763
+ }
4764
+ drawer.afterEffect(context, particle, radius, opacity, delta, container.retina.pixelRatio);
4765
+ }
4766
+ function CanvasUtils_drawPlugin(context, plugin, delta) {
4767
+ if (!plugin.draw) {
4768
+ return;
4769
+ }
4770
+ context.save();
4771
+ plugin.draw(context, delta);
4772
+ context.restore();
4773
+ }
4774
+ function CanvasUtils_drawParticlePlugin(context, plugin, particle, delta) {
4775
+ if (plugin.drawParticle !== undefined) {
4776
+ context.save();
4777
+ plugin.drawParticle(context, particle, delta);
4778
+ context.restore();
4779
+ }
4780
+ }
4781
+ function drawEllipse(context, particle, fillColorValue, radius, opacity, width, rotation, start, end) {
4782
+ const pos = particle.getPosition();
4783
+ if (fillColorValue) {
4784
+ context.strokeStyle = getStyleFromHsl(fillColorValue, opacity);
4785
+ }
4786
+ if (width === 0) {
4787
+ return;
4788
+ }
4789
+ context.lineWidth = width;
4790
+ const rotationRadian = rotation * Math.PI / 180;
4791
+ context.beginPath();
4792
+ context.ellipse(pos.x, pos.y, radius / 2, radius * 2, rotationRadian, start, end);
4793
+ context.stroke();
4794
+ }
4795
+ function CanvasUtils_alterHsl(color, type, value) {
4796
+ return {
4797
+ h: color.h,
4798
+ s: color.s,
4799
+ l: color.l + (type === "darken" ? -1 : 1) * value
4800
+ };
4801
+ }
4802
+ function updateTilt(particle, delta) {
4803
+ var _a;
4804
+ if (!particle.tilt) {
4805
+ return;
4806
+ }
4807
+ const tilt = particle.options.tilt;
4808
+ const tiltAnimation = tilt.animation;
4809
+ const speed = ((_a = particle.tilt.velocity) !== null && _a !== void 0 ? _a : 0) * delta.factor;
4810
+ const max = 2 * Math.PI;
4811
+ if (!tiltAnimation.enable) {
4812
+ return;
4813
+ }
4814
+ switch (particle.tilt.status) {
4815
+ case 0:
4816
+ particle.tilt.value += speed;
4817
+ if (particle.tilt.value > max) {
4818
+ particle.tilt.value -= max;
4819
+ }
4820
+ break;
4821
+
4822
+ case 1:
4823
+ default:
4824
+ particle.tilt.value -= speed;
4825
+ if (particle.tilt.value < 0) {
4826
+ particle.tilt.value += max;
4827
+ }
4828
+ break;
4829
+ }
4830
+ }
4831
+ class TiltUpdater {
4832
+ constructor(container) {
4833
+ this.container = container;
4834
+ }
4835
+ init(particle) {
4836
+ const tiltOptions = particle.options.tilt;
4837
+ particle.tilt = {
4838
+ enable: tiltOptions.enable,
4839
+ value: NumberUtils_getRangeValue(tiltOptions.value) * Math.PI / 180,
4840
+ sinDirection: Math.random() >= .5 ? 1 : -1,
4841
+ cosDirection: Math.random() >= .5 ? 1 : -1
4842
+ };
4843
+ let tiltDirection = tiltOptions.direction;
4844
+ if (tiltDirection === "random") {
4845
+ const index = Math.floor(Math.random() * 2);
4846
+ tiltDirection = index > 0 ? "counter-clockwise" : "clockwise";
4847
+ }
4848
+ switch (tiltDirection) {
4849
+ case "counter-clockwise":
4850
+ case "counterClockwise":
4851
+ particle.tilt.status = 1;
4852
+ break;
4853
+
4854
+ case "clockwise":
4855
+ particle.tilt.status = 0;
4856
+ break;
4857
+ }
4858
+ const tiltAnimation = particle.options.tilt.animation;
4859
+ if (tiltAnimation.enable) {
4860
+ particle.tilt.velocity = tiltAnimation.speed / 360 * this.container.retina.reduceFactor;
4861
+ if (!tiltAnimation.sync) {
4862
+ particle.tilt.velocity *= Math.random();
4863
+ }
4864
+ }
4865
+ }
4866
+ isEnabled(particle) {
4867
+ const tilt = particle.options.tilt;
4868
+ const tiltAnimation = tilt.animation;
4869
+ return !particle.destroyed && !particle.spawning && tiltAnimation.enable;
4870
+ }
4871
+ update(particle, delta) {
4872
+ if (!this.isEnabled(particle)) {
4873
+ return;
4874
+ }
4875
+ updateTilt(particle, delta);
4876
+ }
4877
+ }
4878
+ async function loadTiltUpdater(engine) {
4879
+ await engine.addParticleUpdater("tilt", (container => new TiltUpdater(container)));
4880
+ }
4881
+ return __webpack_exports__;
4882
+ }();
4883
+ }));