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