@tsparticles/updater-destroy 4.1.2 → 4.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (36) hide show
  1. package/browser/DestroyUpdater.js +2 -5
  2. package/browser/Options/Classes/Destroy.js +4 -10
  3. package/browser/Options/Classes/DestroyBounds.js +5 -13
  4. package/browser/Options/Classes/Explode.js +5 -13
  5. package/browser/Options/Classes/Split.js +7 -17
  6. package/browser/Options/Classes/SplitFactor.js +1 -4
  7. package/browser/Options/Classes/SplitRate.js +1 -4
  8. package/browser/index.js +1 -1
  9. package/browser/index.lazy.js +1 -1
  10. package/cjs/DestroyUpdater.js +2 -5
  11. package/cjs/Options/Classes/Destroy.js +4 -10
  12. package/cjs/Options/Classes/DestroyBounds.js +5 -13
  13. package/cjs/Options/Classes/Explode.js +5 -13
  14. package/cjs/Options/Classes/Split.js +7 -17
  15. package/cjs/Options/Classes/SplitFactor.js +1 -4
  16. package/cjs/Options/Classes/SplitRate.js +1 -4
  17. package/cjs/index.js +1 -1
  18. package/cjs/index.lazy.js +1 -1
  19. package/esm/DestroyUpdater.js +2 -5
  20. package/esm/Options/Classes/Destroy.js +4 -10
  21. package/esm/Options/Classes/DestroyBounds.js +5 -13
  22. package/esm/Options/Classes/Explode.js +5 -13
  23. package/esm/Options/Classes/Split.js +7 -17
  24. package/esm/Options/Classes/SplitFactor.js +1 -4
  25. package/esm/Options/Classes/SplitRate.js +1 -4
  26. package/esm/index.js +1 -1
  27. package/esm/index.lazy.js +1 -1
  28. package/package.json +2 -2
  29. package/report.html +1 -1
  30. package/tsparticles.updater.destroy.js +23 -64
  31. package/tsparticles.updater.destroy.min.js +1 -1
  32. package/types/Options/Classes/Destroy.d.ts +3 -4
  33. package/types/Options/Classes/Explode.d.ts +0 -1
  34. package/types/Options/Classes/Split.d.ts +2 -3
  35. package/types/Options/Classes/SplitFactor.d.ts +1 -1
  36. package/types/Options/Classes/SplitRate.d.ts +4 -1
@@ -1,4 +1,4 @@
1
- import { getRangeValue, percentDenominator, } from "@tsparticles/engine";
1
+ import { getRangeValue, loadOptionProperty, percentDenominator, } from "@tsparticles/engine";
2
2
  import { Destroy } from "./Options/Classes/Destroy.js";
3
3
  import { DestroyMode } from "./Enums/DestroyMode.js";
4
4
  import { split } from "./Utils.js";
@@ -38,10 +38,7 @@ export class DestroyUpdater {
38
38
  return !destroyParticle.destroyed || !!destroyParticle.exploding;
39
39
  }
40
40
  loadOptions(options, ...sources) {
41
- options.destroy ??= new Destroy();
42
- for (const source of sources) {
43
- options.destroy.load(source?.destroy);
44
- }
41
+ loadOptionProperty(options, "destroy", Destroy, ...sources);
45
42
  }
46
43
  particleDestroyed(particle, override) {
47
44
  if (override) {
@@ -4,16 +4,10 @@ import { DestroyMode } from "../../Enums/DestroyMode.js";
4
4
  import { Explode } from "./Explode.js";
5
5
  import { Split } from "./Split.js";
6
6
  export class Destroy {
7
- bounds;
8
- explode;
9
- mode;
10
- split;
11
- constructor() {
12
- this.bounds = new DestroyBounds();
13
- this.explode = new Explode();
14
- this.mode = DestroyMode.none;
15
- this.split = new Split();
16
- }
7
+ bounds = new DestroyBounds();
8
+ explode = new Explode();
9
+ mode = DestroyMode.none;
10
+ split = new Split();
17
11
  load(data) {
18
12
  if (isNull(data)) {
19
13
  return;
@@ -1,4 +1,4 @@
1
- import { isNull, setRangeValue } from "@tsparticles/engine";
1
+ import { isNull, loadRangeProperty, } from "@tsparticles/engine";
2
2
  export class DestroyBounds {
3
3
  bottom;
4
4
  left;
@@ -8,17 +8,9 @@ export class DestroyBounds {
8
8
  if (isNull(data)) {
9
9
  return;
10
10
  }
11
- if (data.bottom !== undefined) {
12
- this.bottom = setRangeValue(data.bottom);
13
- }
14
- if (data.left !== undefined) {
15
- this.left = setRangeValue(data.left);
16
- }
17
- if (data.right !== undefined) {
18
- this.right = setRangeValue(data.right);
19
- }
20
- if (data.top !== undefined) {
21
- this.top = setRangeValue(data.top);
22
- }
11
+ loadRangeProperty(this, "bottom", data.bottom);
12
+ loadRangeProperty(this, "left", data.left);
13
+ loadRangeProperty(this, "right", data.right);
14
+ loadRangeProperty(this, "top", data.top);
23
15
  }
24
16
  }
@@ -1,20 +1,12 @@
1
- import { isNull } from "@tsparticles/engine";
1
+ import { isNull, loadProperty } from "@tsparticles/engine";
2
2
  export class Explode {
3
- maxSizeFactor;
4
- speed;
5
- constructor() {
6
- this.maxSizeFactor = 3;
7
- this.speed = 2;
8
- }
3
+ maxSizeFactor = 3;
4
+ speed = 2;
9
5
  load(data) {
10
6
  if (isNull(data)) {
11
7
  return;
12
8
  }
13
- if (data.maxSizeFactor !== undefined) {
14
- this.maxSizeFactor = data.maxSizeFactor;
15
- }
16
- if (data.speed !== undefined) {
17
- this.speed = data.speed;
18
- }
9
+ loadProperty(this, "maxSizeFactor", data.maxSizeFactor);
10
+ loadProperty(this, "speed", data.speed);
19
11
  }
20
12
  }
@@ -1,22 +1,16 @@
1
- import { OptionsColor, deepExtend, executeOnSingleOrMultiple, isNull, } from "@tsparticles/engine";
1
+ import { OptionsColor, deepExtend, executeOnSingleOrMultiple, isNull, loadProperty, } from "@tsparticles/engine";
2
2
  import { SplitFactor } from "./SplitFactor.js";
3
3
  import { SplitRate } from "./SplitRate.js";
4
4
  export class Split {
5
- count;
6
- factor;
5
+ count = 1;
6
+ factor = new SplitFactor();
7
7
  fillColor;
8
8
  fillColorOffset;
9
9
  particles;
10
- rate;
11
- sizeOffset;
10
+ rate = new SplitRate();
11
+ sizeOffset = true;
12
12
  strokeColor;
13
13
  strokeColorOffset;
14
- constructor() {
15
- this.count = 1;
16
- this.factor = new SplitFactor();
17
- this.rate = new SplitRate();
18
- this.sizeOffset = true;
19
- }
20
14
  load(data) {
21
15
  if (isNull(data)) {
22
16
  return;
@@ -27,17 +21,13 @@ export class Split {
27
21
  if (data.strokeColor !== undefined) {
28
22
  this.strokeColor = OptionsColor.create(this.strokeColor, data.strokeColor);
29
23
  }
30
- if (data.count !== undefined) {
31
- this.count = data.count;
32
- }
24
+ loadProperty(this, "count", data.count);
33
25
  this.factor.load(data.factor);
34
26
  this.rate.load(data.rate);
35
27
  this.particles = executeOnSingleOrMultiple(data.particles, particles => {
36
28
  return deepExtend({}, particles);
37
29
  });
38
- if (data.sizeOffset !== undefined) {
39
- this.sizeOffset = data.sizeOffset;
40
- }
30
+ loadProperty(this, "sizeOffset", data.sizeOffset);
41
31
  if (data.fillColorOffset) {
42
32
  this.fillColorOffset = this.fillColorOffset ?? {};
43
33
  if (data.fillColorOffset.h !== undefined) {
@@ -1,7 +1,4 @@
1
1
  import { ValueWithRandom } from "@tsparticles/engine";
2
2
  export class SplitFactor extends ValueWithRandom {
3
- constructor() {
4
- super();
5
- this.value = 3;
6
- }
3
+ value = 3;
7
4
  }
@@ -1,7 +1,4 @@
1
1
  import { ValueWithRandom } from "@tsparticles/engine";
2
2
  export class SplitRate extends ValueWithRandom {
3
- constructor() {
4
- super();
5
- this.value = { min: 4, max: 9 };
6
- }
3
+ value = { min: 4, max: 9 };
7
4
  }
package/browser/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { DestroyUpdater } from "./DestroyUpdater.js";
2
2
  export async function loadDestroyUpdater(engine) {
3
- engine.checkVersion("4.1.2");
3
+ engine.checkVersion("4.2.0");
4
4
  await engine.pluginManager.register(e => {
5
5
  e.pluginManager.addParticleUpdater("destroy", container => {
6
6
  return Promise.resolve(new DestroyUpdater(e.pluginManager, container));
@@ -1,5 +1,5 @@
1
1
  export async function loadDestroyUpdater(engine) {
2
- engine.checkVersion("4.1.2");
2
+ engine.checkVersion("4.2.0");
3
3
  await engine.pluginManager.register(e => {
4
4
  e.pluginManager.addParticleUpdater("destroy", async (container) => {
5
5
  const { DestroyUpdater } = await import("./DestroyUpdater.js");
@@ -1,4 +1,4 @@
1
- import { getRangeValue, percentDenominator, } from "@tsparticles/engine";
1
+ import { getRangeValue, loadOptionProperty, percentDenominator, } from "@tsparticles/engine";
2
2
  import { Destroy } from "./Options/Classes/Destroy.js";
3
3
  import { DestroyMode } from "./Enums/DestroyMode.js";
4
4
  import { split } from "./Utils.js";
@@ -38,10 +38,7 @@ export class DestroyUpdater {
38
38
  return !destroyParticle.destroyed || !!destroyParticle.exploding;
39
39
  }
40
40
  loadOptions(options, ...sources) {
41
- options.destroy ??= new Destroy();
42
- for (const source of sources) {
43
- options.destroy.load(source?.destroy);
44
- }
41
+ loadOptionProperty(options, "destroy", Destroy, ...sources);
45
42
  }
46
43
  particleDestroyed(particle, override) {
47
44
  if (override) {
@@ -4,16 +4,10 @@ import { DestroyMode } from "../../Enums/DestroyMode.js";
4
4
  import { Explode } from "./Explode.js";
5
5
  import { Split } from "./Split.js";
6
6
  export class Destroy {
7
- bounds;
8
- explode;
9
- mode;
10
- split;
11
- constructor() {
12
- this.bounds = new DestroyBounds();
13
- this.explode = new Explode();
14
- this.mode = DestroyMode.none;
15
- this.split = new Split();
16
- }
7
+ bounds = new DestroyBounds();
8
+ explode = new Explode();
9
+ mode = DestroyMode.none;
10
+ split = new Split();
17
11
  load(data) {
18
12
  if (isNull(data)) {
19
13
  return;
@@ -1,4 +1,4 @@
1
- import { isNull, setRangeValue } from "@tsparticles/engine";
1
+ import { isNull, loadRangeProperty, } from "@tsparticles/engine";
2
2
  export class DestroyBounds {
3
3
  bottom;
4
4
  left;
@@ -8,17 +8,9 @@ export class DestroyBounds {
8
8
  if (isNull(data)) {
9
9
  return;
10
10
  }
11
- if (data.bottom !== undefined) {
12
- this.bottom = setRangeValue(data.bottom);
13
- }
14
- if (data.left !== undefined) {
15
- this.left = setRangeValue(data.left);
16
- }
17
- if (data.right !== undefined) {
18
- this.right = setRangeValue(data.right);
19
- }
20
- if (data.top !== undefined) {
21
- this.top = setRangeValue(data.top);
22
- }
11
+ loadRangeProperty(this, "bottom", data.bottom);
12
+ loadRangeProperty(this, "left", data.left);
13
+ loadRangeProperty(this, "right", data.right);
14
+ loadRangeProperty(this, "top", data.top);
23
15
  }
24
16
  }
@@ -1,20 +1,12 @@
1
- import { isNull } from "@tsparticles/engine";
1
+ import { isNull, loadProperty } from "@tsparticles/engine";
2
2
  export class Explode {
3
- maxSizeFactor;
4
- speed;
5
- constructor() {
6
- this.maxSizeFactor = 3;
7
- this.speed = 2;
8
- }
3
+ maxSizeFactor = 3;
4
+ speed = 2;
9
5
  load(data) {
10
6
  if (isNull(data)) {
11
7
  return;
12
8
  }
13
- if (data.maxSizeFactor !== undefined) {
14
- this.maxSizeFactor = data.maxSizeFactor;
15
- }
16
- if (data.speed !== undefined) {
17
- this.speed = data.speed;
18
- }
9
+ loadProperty(this, "maxSizeFactor", data.maxSizeFactor);
10
+ loadProperty(this, "speed", data.speed);
19
11
  }
20
12
  }
@@ -1,22 +1,16 @@
1
- import { OptionsColor, deepExtend, executeOnSingleOrMultiple, isNull, } from "@tsparticles/engine";
1
+ import { OptionsColor, deepExtend, executeOnSingleOrMultiple, isNull, loadProperty, } from "@tsparticles/engine";
2
2
  import { SplitFactor } from "./SplitFactor.js";
3
3
  import { SplitRate } from "./SplitRate.js";
4
4
  export class Split {
5
- count;
6
- factor;
5
+ count = 1;
6
+ factor = new SplitFactor();
7
7
  fillColor;
8
8
  fillColorOffset;
9
9
  particles;
10
- rate;
11
- sizeOffset;
10
+ rate = new SplitRate();
11
+ sizeOffset = true;
12
12
  strokeColor;
13
13
  strokeColorOffset;
14
- constructor() {
15
- this.count = 1;
16
- this.factor = new SplitFactor();
17
- this.rate = new SplitRate();
18
- this.sizeOffset = true;
19
- }
20
14
  load(data) {
21
15
  if (isNull(data)) {
22
16
  return;
@@ -27,17 +21,13 @@ export class Split {
27
21
  if (data.strokeColor !== undefined) {
28
22
  this.strokeColor = OptionsColor.create(this.strokeColor, data.strokeColor);
29
23
  }
30
- if (data.count !== undefined) {
31
- this.count = data.count;
32
- }
24
+ loadProperty(this, "count", data.count);
33
25
  this.factor.load(data.factor);
34
26
  this.rate.load(data.rate);
35
27
  this.particles = executeOnSingleOrMultiple(data.particles, particles => {
36
28
  return deepExtend({}, particles);
37
29
  });
38
- if (data.sizeOffset !== undefined) {
39
- this.sizeOffset = data.sizeOffset;
40
- }
30
+ loadProperty(this, "sizeOffset", data.sizeOffset);
41
31
  if (data.fillColorOffset) {
42
32
  this.fillColorOffset = this.fillColorOffset ?? {};
43
33
  if (data.fillColorOffset.h !== undefined) {
@@ -1,7 +1,4 @@
1
1
  import { ValueWithRandom } from "@tsparticles/engine";
2
2
  export class SplitFactor extends ValueWithRandom {
3
- constructor() {
4
- super();
5
- this.value = 3;
6
- }
3
+ value = 3;
7
4
  }
@@ -1,7 +1,4 @@
1
1
  import { ValueWithRandom } from "@tsparticles/engine";
2
2
  export class SplitRate extends ValueWithRandom {
3
- constructor() {
4
- super();
5
- this.value = { min: 4, max: 9 };
6
- }
3
+ value = { min: 4, max: 9 };
7
4
  }
package/cjs/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { DestroyUpdater } from "./DestroyUpdater.js";
2
2
  export async function loadDestroyUpdater(engine) {
3
- engine.checkVersion("4.1.2");
3
+ engine.checkVersion("4.2.0");
4
4
  await engine.pluginManager.register(e => {
5
5
  e.pluginManager.addParticleUpdater("destroy", container => {
6
6
  return Promise.resolve(new DestroyUpdater(e.pluginManager, container));
package/cjs/index.lazy.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export async function loadDestroyUpdater(engine) {
2
- engine.checkVersion("4.1.2");
2
+ engine.checkVersion("4.2.0");
3
3
  await engine.pluginManager.register(e => {
4
4
  e.pluginManager.addParticleUpdater("destroy", async (container) => {
5
5
  const { DestroyUpdater } = await import("./DestroyUpdater.js");
@@ -1,4 +1,4 @@
1
- import { getRangeValue, percentDenominator, } from "@tsparticles/engine";
1
+ import { getRangeValue, loadOptionProperty, percentDenominator, } from "@tsparticles/engine";
2
2
  import { Destroy } from "./Options/Classes/Destroy.js";
3
3
  import { DestroyMode } from "./Enums/DestroyMode.js";
4
4
  import { split } from "./Utils.js";
@@ -38,10 +38,7 @@ export class DestroyUpdater {
38
38
  return !destroyParticle.destroyed || !!destroyParticle.exploding;
39
39
  }
40
40
  loadOptions(options, ...sources) {
41
- options.destroy ??= new Destroy();
42
- for (const source of sources) {
43
- options.destroy.load(source?.destroy);
44
- }
41
+ loadOptionProperty(options, "destroy", Destroy, ...sources);
45
42
  }
46
43
  particleDestroyed(particle, override) {
47
44
  if (override) {
@@ -4,16 +4,10 @@ import { DestroyMode } from "../../Enums/DestroyMode.js";
4
4
  import { Explode } from "./Explode.js";
5
5
  import { Split } from "./Split.js";
6
6
  export class Destroy {
7
- bounds;
8
- explode;
9
- mode;
10
- split;
11
- constructor() {
12
- this.bounds = new DestroyBounds();
13
- this.explode = new Explode();
14
- this.mode = DestroyMode.none;
15
- this.split = new Split();
16
- }
7
+ bounds = new DestroyBounds();
8
+ explode = new Explode();
9
+ mode = DestroyMode.none;
10
+ split = new Split();
17
11
  load(data) {
18
12
  if (isNull(data)) {
19
13
  return;
@@ -1,4 +1,4 @@
1
- import { isNull, setRangeValue } from "@tsparticles/engine";
1
+ import { isNull, loadRangeProperty, } from "@tsparticles/engine";
2
2
  export class DestroyBounds {
3
3
  bottom;
4
4
  left;
@@ -8,17 +8,9 @@ export class DestroyBounds {
8
8
  if (isNull(data)) {
9
9
  return;
10
10
  }
11
- if (data.bottom !== undefined) {
12
- this.bottom = setRangeValue(data.bottom);
13
- }
14
- if (data.left !== undefined) {
15
- this.left = setRangeValue(data.left);
16
- }
17
- if (data.right !== undefined) {
18
- this.right = setRangeValue(data.right);
19
- }
20
- if (data.top !== undefined) {
21
- this.top = setRangeValue(data.top);
22
- }
11
+ loadRangeProperty(this, "bottom", data.bottom);
12
+ loadRangeProperty(this, "left", data.left);
13
+ loadRangeProperty(this, "right", data.right);
14
+ loadRangeProperty(this, "top", data.top);
23
15
  }
24
16
  }
@@ -1,20 +1,12 @@
1
- import { isNull } from "@tsparticles/engine";
1
+ import { isNull, loadProperty } from "@tsparticles/engine";
2
2
  export class Explode {
3
- maxSizeFactor;
4
- speed;
5
- constructor() {
6
- this.maxSizeFactor = 3;
7
- this.speed = 2;
8
- }
3
+ maxSizeFactor = 3;
4
+ speed = 2;
9
5
  load(data) {
10
6
  if (isNull(data)) {
11
7
  return;
12
8
  }
13
- if (data.maxSizeFactor !== undefined) {
14
- this.maxSizeFactor = data.maxSizeFactor;
15
- }
16
- if (data.speed !== undefined) {
17
- this.speed = data.speed;
18
- }
9
+ loadProperty(this, "maxSizeFactor", data.maxSizeFactor);
10
+ loadProperty(this, "speed", data.speed);
19
11
  }
20
12
  }
@@ -1,22 +1,16 @@
1
- import { OptionsColor, deepExtend, executeOnSingleOrMultiple, isNull, } from "@tsparticles/engine";
1
+ import { OptionsColor, deepExtend, executeOnSingleOrMultiple, isNull, loadProperty, } from "@tsparticles/engine";
2
2
  import { SplitFactor } from "./SplitFactor.js";
3
3
  import { SplitRate } from "./SplitRate.js";
4
4
  export class Split {
5
- count;
6
- factor;
5
+ count = 1;
6
+ factor = new SplitFactor();
7
7
  fillColor;
8
8
  fillColorOffset;
9
9
  particles;
10
- rate;
11
- sizeOffset;
10
+ rate = new SplitRate();
11
+ sizeOffset = true;
12
12
  strokeColor;
13
13
  strokeColorOffset;
14
- constructor() {
15
- this.count = 1;
16
- this.factor = new SplitFactor();
17
- this.rate = new SplitRate();
18
- this.sizeOffset = true;
19
- }
20
14
  load(data) {
21
15
  if (isNull(data)) {
22
16
  return;
@@ -27,17 +21,13 @@ export class Split {
27
21
  if (data.strokeColor !== undefined) {
28
22
  this.strokeColor = OptionsColor.create(this.strokeColor, data.strokeColor);
29
23
  }
30
- if (data.count !== undefined) {
31
- this.count = data.count;
32
- }
24
+ loadProperty(this, "count", data.count);
33
25
  this.factor.load(data.factor);
34
26
  this.rate.load(data.rate);
35
27
  this.particles = executeOnSingleOrMultiple(data.particles, particles => {
36
28
  return deepExtend({}, particles);
37
29
  });
38
- if (data.sizeOffset !== undefined) {
39
- this.sizeOffset = data.sizeOffset;
40
- }
30
+ loadProperty(this, "sizeOffset", data.sizeOffset);
41
31
  if (data.fillColorOffset) {
42
32
  this.fillColorOffset = this.fillColorOffset ?? {};
43
33
  if (data.fillColorOffset.h !== undefined) {
@@ -1,7 +1,4 @@
1
1
  import { ValueWithRandom } from "@tsparticles/engine";
2
2
  export class SplitFactor extends ValueWithRandom {
3
- constructor() {
4
- super();
5
- this.value = 3;
6
- }
3
+ value = 3;
7
4
  }
@@ -1,7 +1,4 @@
1
1
  import { ValueWithRandom } from "@tsparticles/engine";
2
2
  export class SplitRate extends ValueWithRandom {
3
- constructor() {
4
- super();
5
- this.value = { min: 4, max: 9 };
6
- }
3
+ value = { min: 4, max: 9 };
7
4
  }
package/esm/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { DestroyUpdater } from "./DestroyUpdater.js";
2
2
  export async function loadDestroyUpdater(engine) {
3
- engine.checkVersion("4.1.2");
3
+ engine.checkVersion("4.2.0");
4
4
  await engine.pluginManager.register(e => {
5
5
  e.pluginManager.addParticleUpdater("destroy", container => {
6
6
  return Promise.resolve(new DestroyUpdater(e.pluginManager, container));
package/esm/index.lazy.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export async function loadDestroyUpdater(engine) {
2
- engine.checkVersion("4.1.2");
2
+ engine.checkVersion("4.2.0");
3
3
  await engine.pluginManager.register(e => {
4
4
  e.pluginManager.addParticleUpdater("destroy", async (container) => {
5
5
  const { DestroyUpdater } = await import("./DestroyUpdater.js");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tsparticles/updater-destroy",
3
- "version": "4.1.2",
3
+ "version": "4.2.0",
4
4
  "description": "tsParticles particles destroy updater",
5
5
  "homepage": "https://particles.js.org",
6
6
  "repository": {
@@ -93,7 +93,7 @@
93
93
  "./package.json": "./package.json"
94
94
  },
95
95
  "peerDependencies": {
96
- "@tsparticles/engine": "4.1.2"
96
+ "@tsparticles/engine": "4.2.0"
97
97
  },
98
98
  "publishConfig": {
99
99
  "access": "public"
package/report.html CHANGED
@@ -4930,7 +4930,7 @@ var drawChart = (function (exports) {
4930
4930
  </script>
4931
4931
  <script>
4932
4932
  /*<!--*/
4933
- const data = {"version":2,"tree":{"name":"root","children":[{"name":"tsparticles.updater.destroy.js","children":[{"name":"dist/browser","children":[{"name":"Options/Classes","children":[{"uid":"11a6662b-1","name":"DestroyBounds.js"},{"uid":"11a6662b-5","name":"Explode.js"},{"uid":"11a6662b-7","name":"SplitFactor.js"},{"uid":"11a6662b-9","name":"SplitRate.js"},{"uid":"11a6662b-11","name":"Split.js"},{"uid":"11a6662b-13","name":"Destroy.js"}]},{"name":"Enums/DestroyMode.js","uid":"11a6662b-3"},{"uid":"11a6662b-15","name":"Utils.js"},{"uid":"11a6662b-17","name":"DestroyUpdater.js"},{"uid":"11a6662b-19","name":"index.js"},{"uid":"11a6662b-21","name":"browser.js"}]}]}],"isRoot":true},"nodeParts":{"11a6662b-1":{"renderedLength":675,"gzipLength":0,"brotliLength":0,"metaUid":"11a6662b-0"},"11a6662b-3":{"renderedLength":215,"gzipLength":0,"brotliLength":0,"metaUid":"11a6662b-2"},"11a6662b-5":{"renderedLength":491,"gzipLength":0,"brotliLength":0,"metaUid":"11a6662b-4"},"11a6662b-7":{"renderedLength":143,"gzipLength":0,"brotliLength":0,"metaUid":"11a6662b-6"},"11a6662b-9":{"renderedLength":158,"gzipLength":0,"brotliLength":0,"metaUid":"11a6662b-8"},"11a6662b-11":{"renderedLength":2418,"gzipLength":0,"brotliLength":0,"metaUid":"11a6662b-10"},"11a6662b-13":{"renderedLength":658,"gzipLength":0,"brotliLength":0,"metaUid":"11a6662b-12"},"11a6662b-15":{"renderedLength":5283,"gzipLength":0,"brotliLength":0,"metaUid":"11a6662b-14"},"11a6662b-17":{"renderedLength":4940,"gzipLength":0,"brotliLength":0,"metaUid":"11a6662b-16"},"11a6662b-19":{"renderedLength":331,"gzipLength":0,"brotliLength":0,"metaUid":"11a6662b-18"},"11a6662b-21":{"renderedLength":179,"gzipLength":0,"brotliLength":0,"metaUid":"11a6662b-20"}},"nodeMetas":{"11a6662b-0":{"id":"/dist/browser/Options/Classes/DestroyBounds.js","moduleParts":{"tsparticles.updater.destroy.js":"11a6662b-1"},"imported":[{"uid":"11a6662b-22"}],"importedBy":[{"uid":"11a6662b-12"}]},"11a6662b-2":{"id":"/dist/browser/Enums/DestroyMode.js","moduleParts":{"tsparticles.updater.destroy.js":"11a6662b-3"},"imported":[],"importedBy":[{"uid":"11a6662b-16"},{"uid":"11a6662b-12"}]},"11a6662b-4":{"id":"/dist/browser/Options/Classes/Explode.js","moduleParts":{"tsparticles.updater.destroy.js":"11a6662b-5"},"imported":[{"uid":"11a6662b-22"}],"importedBy":[{"uid":"11a6662b-12"}]},"11a6662b-6":{"id":"/dist/browser/Options/Classes/SplitFactor.js","moduleParts":{"tsparticles.updater.destroy.js":"11a6662b-7"},"imported":[{"uid":"11a6662b-22"}],"importedBy":[{"uid":"11a6662b-10"}]},"11a6662b-8":{"id":"/dist/browser/Options/Classes/SplitRate.js","moduleParts":{"tsparticles.updater.destroy.js":"11a6662b-9"},"imported":[{"uid":"11a6662b-22"}],"importedBy":[{"uid":"11a6662b-10"}]},"11a6662b-10":{"id":"/dist/browser/Options/Classes/Split.js","moduleParts":{"tsparticles.updater.destroy.js":"11a6662b-11"},"imported":[{"uid":"11a6662b-22"},{"uid":"11a6662b-6"},{"uid":"11a6662b-8"}],"importedBy":[{"uid":"11a6662b-12"}]},"11a6662b-12":{"id":"/dist/browser/Options/Classes/Destroy.js","moduleParts":{"tsparticles.updater.destroy.js":"11a6662b-13"},"imported":[{"uid":"11a6662b-22"},{"uid":"11a6662b-0"},{"uid":"11a6662b-2"},{"uid":"11a6662b-4"},{"uid":"11a6662b-10"}],"importedBy":[{"uid":"11a6662b-16"}]},"11a6662b-14":{"id":"/dist/browser/Utils.js","moduleParts":{"tsparticles.updater.destroy.js":"11a6662b-15"},"imported":[{"uid":"11a6662b-22"}],"importedBy":[{"uid":"11a6662b-16"}]},"11a6662b-16":{"id":"/dist/browser/DestroyUpdater.js","moduleParts":{"tsparticles.updater.destroy.js":"11a6662b-17"},"imported":[{"uid":"11a6662b-22"},{"uid":"11a6662b-12"},{"uid":"11a6662b-2"},{"uid":"11a6662b-14"}],"importedBy":[{"uid":"11a6662b-18"}]},"11a6662b-18":{"id":"/dist/browser/index.js","moduleParts":{"tsparticles.updater.destroy.js":"11a6662b-19"},"imported":[{"uid":"11a6662b-16"}],"importedBy":[{"uid":"11a6662b-20"}]},"11a6662b-20":{"id":"/dist/browser/browser.js","moduleParts":{"tsparticles.updater.destroy.js":"11a6662b-21"},"imported":[{"uid":"11a6662b-18"}],"importedBy":[],"isEntry":true},"11a6662b-22":{"id":"@tsparticles/engine","moduleParts":{},"imported":[],"importedBy":[{"uid":"11a6662b-16"},{"uid":"11a6662b-12"},{"uid":"11a6662b-14"},{"uid":"11a6662b-0"},{"uid":"11a6662b-4"},{"uid":"11a6662b-10"},{"uid":"11a6662b-6"},{"uid":"11a6662b-8"}],"isExternal":true}},"env":{"rollup":"4.60.4"},"options":{"gzip":false,"brotli":false,"sourcemap":false}};
4933
+ const data = {"version":2,"tree":{"name":"root","children":[{"name":"tsparticles.updater.destroy.js","children":[{"name":"dist/browser","children":[{"name":"Options/Classes","children":[{"uid":"7fdefec8-1","name":"DestroyBounds.js"},{"uid":"7fdefec8-5","name":"Explode.js"},{"uid":"7fdefec8-7","name":"SplitFactor.js"},{"uid":"7fdefec8-9","name":"SplitRate.js"},{"uid":"7fdefec8-11","name":"Split.js"},{"uid":"7fdefec8-13","name":"Destroy.js"}]},{"name":"Enums/DestroyMode.js","uid":"7fdefec8-3"},{"uid":"7fdefec8-15","name":"Utils.js"},{"uid":"7fdefec8-17","name":"DestroyUpdater.js"},{"uid":"7fdefec8-19","name":"index.js"},{"uid":"7fdefec8-21","name":"browser.js"}]}]}],"isRoot":true},"nodeParts":{"7fdefec8-1":{"renderedLength":453,"gzipLength":0,"brotliLength":0,"metaUid":"7fdefec8-0"},"7fdefec8-3":{"renderedLength":215,"gzipLength":0,"brotliLength":0,"metaUid":"7fdefec8-2"},"7fdefec8-5":{"renderedLength":315,"gzipLength":0,"brotliLength":0,"metaUid":"7fdefec8-4"},"7fdefec8-7":{"renderedLength":79,"gzipLength":0,"brotliLength":0,"metaUid":"7fdefec8-6"},"7fdefec8-9":{"renderedLength":94,"gzipLength":0,"brotliLength":0,"metaUid":"7fdefec8-8"},"7fdefec8-11":{"renderedLength":2200,"gzipLength":0,"brotliLength":0,"metaUid":"7fdefec8-10"},"7fdefec8-13":{"renderedLength":526,"gzipLength":0,"brotliLength":0,"metaUid":"7fdefec8-12"},"7fdefec8-15":{"renderedLength":5283,"gzipLength":0,"brotliLength":0,"metaUid":"7fdefec8-14"},"7fdefec8-17":{"renderedLength":4860,"gzipLength":0,"brotliLength":0,"metaUid":"7fdefec8-16"},"7fdefec8-19":{"renderedLength":331,"gzipLength":0,"brotliLength":0,"metaUid":"7fdefec8-18"},"7fdefec8-21":{"renderedLength":179,"gzipLength":0,"brotliLength":0,"metaUid":"7fdefec8-20"}},"nodeMetas":{"7fdefec8-0":{"id":"/dist/browser/Options/Classes/DestroyBounds.js","moduleParts":{"tsparticles.updater.destroy.js":"7fdefec8-1"},"imported":[{"uid":"7fdefec8-22"}],"importedBy":[{"uid":"7fdefec8-12"}]},"7fdefec8-2":{"id":"/dist/browser/Enums/DestroyMode.js","moduleParts":{"tsparticles.updater.destroy.js":"7fdefec8-3"},"imported":[],"importedBy":[{"uid":"7fdefec8-16"},{"uid":"7fdefec8-12"}]},"7fdefec8-4":{"id":"/dist/browser/Options/Classes/Explode.js","moduleParts":{"tsparticles.updater.destroy.js":"7fdefec8-5"},"imported":[{"uid":"7fdefec8-22"}],"importedBy":[{"uid":"7fdefec8-12"}]},"7fdefec8-6":{"id":"/dist/browser/Options/Classes/SplitFactor.js","moduleParts":{"tsparticles.updater.destroy.js":"7fdefec8-7"},"imported":[{"uid":"7fdefec8-22"}],"importedBy":[{"uid":"7fdefec8-10"}]},"7fdefec8-8":{"id":"/dist/browser/Options/Classes/SplitRate.js","moduleParts":{"tsparticles.updater.destroy.js":"7fdefec8-9"},"imported":[{"uid":"7fdefec8-22"}],"importedBy":[{"uid":"7fdefec8-10"}]},"7fdefec8-10":{"id":"/dist/browser/Options/Classes/Split.js","moduleParts":{"tsparticles.updater.destroy.js":"7fdefec8-11"},"imported":[{"uid":"7fdefec8-22"},{"uid":"7fdefec8-6"},{"uid":"7fdefec8-8"}],"importedBy":[{"uid":"7fdefec8-12"}]},"7fdefec8-12":{"id":"/dist/browser/Options/Classes/Destroy.js","moduleParts":{"tsparticles.updater.destroy.js":"7fdefec8-13"},"imported":[{"uid":"7fdefec8-22"},{"uid":"7fdefec8-0"},{"uid":"7fdefec8-2"},{"uid":"7fdefec8-4"},{"uid":"7fdefec8-10"}],"importedBy":[{"uid":"7fdefec8-16"}]},"7fdefec8-14":{"id":"/dist/browser/Utils.js","moduleParts":{"tsparticles.updater.destroy.js":"7fdefec8-15"},"imported":[{"uid":"7fdefec8-22"}],"importedBy":[{"uid":"7fdefec8-16"}]},"7fdefec8-16":{"id":"/dist/browser/DestroyUpdater.js","moduleParts":{"tsparticles.updater.destroy.js":"7fdefec8-17"},"imported":[{"uid":"7fdefec8-22"},{"uid":"7fdefec8-12"},{"uid":"7fdefec8-2"},{"uid":"7fdefec8-14"}],"importedBy":[{"uid":"7fdefec8-18"}]},"7fdefec8-18":{"id":"/dist/browser/index.js","moduleParts":{"tsparticles.updater.destroy.js":"7fdefec8-19"},"imported":[{"uid":"7fdefec8-16"}],"importedBy":[{"uid":"7fdefec8-20"}]},"7fdefec8-20":{"id":"/dist/browser/browser.js","moduleParts":{"tsparticles.updater.destroy.js":"7fdefec8-21"},"imported":[{"uid":"7fdefec8-18"}],"importedBy":[],"isEntry":true},"7fdefec8-22":{"id":"@tsparticles/engine","moduleParts":{},"imported":[],"importedBy":[{"uid":"7fdefec8-16"},{"uid":"7fdefec8-12"},{"uid":"7fdefec8-14"},{"uid":"7fdefec8-0"},{"uid":"7fdefec8-4"},{"uid":"7fdefec8-10"},{"uid":"7fdefec8-6"},{"uid":"7fdefec8-8"}],"isExternal":true}},"env":{"rollup":"4.62.0"},"options":{"gzip":false,"brotli":false,"sourcemap":false}};
4934
4934
 
4935
4935
  const run = () => {
4936
4936
  const width = window.innerWidth;
@@ -1,5 +1,5 @@
1
1
  (function(g){g.__tsParticlesInternals=g.__tsParticlesInternals||{};g.__tsParticlesInternals.bundles=g.__tsParticlesInternals.bundles||{};g.__tsParticlesInternals.effects=g.__tsParticlesInternals.effects||{};g.__tsParticlesInternals.engine=g.__tsParticlesInternals.engine||{};g.__tsParticlesInternals.interactions=g.__tsParticlesInternals.interactions||{};g.__tsParticlesInternals.palettes=g.__tsParticlesInternals.palettes||{};g.__tsParticlesInternals.paths=g.__tsParticlesInternals.paths||{};g.__tsParticlesInternals.plugins=g.__tsParticlesInternals.plugins||{};g.__tsParticlesInternals.plugins=g.__tsParticlesInternals.plugins||{};g.__tsParticlesInternals.plugins.emittersShapes=g.__tsParticlesInternals.plugins.emittersShapes||{};g.__tsParticlesInternals.presets=g.__tsParticlesInternals.presets||{};g.__tsParticlesInternals.shapes=g.__tsParticlesInternals.shapes||{};g.__tsParticlesInternals.updaters=g.__tsParticlesInternals.updaters||{};g.__tsParticlesInternals.utils=g.__tsParticlesInternals.utils||{};g.__tsParticlesInternals.canvas=g.__tsParticlesInternals.canvas||{};g.__tsParticlesInternals.canvas=g.__tsParticlesInternals.canvas||{};g.__tsParticlesInternals.canvas.utils=g.__tsParticlesInternals.canvas.utils||{};g.__tsParticlesInternals.path=g.__tsParticlesInternals.path||{};g.__tsParticlesInternals.path=g.__tsParticlesInternals.path||{};g.__tsParticlesInternals.path.utils=g.__tsParticlesInternals.path.utils||{};var __tsProxyFactory=typeof Proxy!=="undefined"?function(obj){return new Proxy(obj,{get:function(target,key){if(!(key in target)){target[key]={};}return target[key];}});}:function(obj){return obj;};g.__tsParticlesInternals.bundles=__tsProxyFactory(g.__tsParticlesInternals.bundles);g.__tsParticlesInternals.effects=__tsProxyFactory(g.__tsParticlesInternals.effects);g.__tsParticlesInternals.interactions=__tsProxyFactory(g.__tsParticlesInternals.interactions);g.__tsParticlesInternals.palettes=__tsProxyFactory(g.__tsParticlesInternals.palettes);g.__tsParticlesInternals.paths=__tsProxyFactory(g.__tsParticlesInternals.paths);g.__tsParticlesInternals.plugins=__tsProxyFactory(g.__tsParticlesInternals.plugins);g.__tsParticlesInternals.plugins.emittersShapes=__tsProxyFactory(g.__tsParticlesInternals.plugins.emittersShapes);g.__tsParticlesInternals.presets=__tsProxyFactory(g.__tsParticlesInternals.presets);g.__tsParticlesInternals.shapes=__tsProxyFactory(g.__tsParticlesInternals.shapes);g.__tsParticlesInternals.updaters=__tsProxyFactory(g.__tsParticlesInternals.updaters);g.__tsParticlesInternals.utils=__tsProxyFactory(g.__tsParticlesInternals.utils);g.__tsParticlesInternals.canvas=__tsProxyFactory(g.__tsParticlesInternals.canvas);g.__tsParticlesInternals.path=__tsProxyFactory(g.__tsParticlesInternals.path);g.tsparticlesInternalExports=g.tsparticlesInternalExports||{};})(typeof globalThis!=="undefined"?globalThis:typeof window!=="undefined"?window:this);
2
- /* Updater v4.1.2 */
2
+ /* Updater v4.2.0 */
3
3
  (function (global, factory) {
4
4
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@tsparticles/engine')) :
5
5
  typeof define === 'function' && define.amd ? define(['exports', '@tsparticles/engine'], factory) :
@@ -15,18 +15,10 @@
15
15
  if (engine.isNull(data)) {
16
16
  return;
17
17
  }
18
- if (data.bottom !== undefined) {
19
- this.bottom = engine.setRangeValue(data.bottom);
20
- }
21
- if (data.left !== undefined) {
22
- this.left = engine.setRangeValue(data.left);
23
- }
24
- if (data.right !== undefined) {
25
- this.right = engine.setRangeValue(data.right);
26
- }
27
- if (data.top !== undefined) {
28
- this.top = engine.setRangeValue(data.top);
29
- }
18
+ engine.loadRangeProperty(this, "bottom", data.bottom);
19
+ engine.loadRangeProperty(this, "left", data.left);
20
+ engine.loadRangeProperty(this, "right", data.right);
21
+ engine.loadRangeProperty(this, "top", data.top);
30
22
  }
31
23
  }
32
24
 
@@ -38,55 +30,35 @@
38
30
  })(DestroyMode || (DestroyMode = {}));
39
31
 
40
32
  class Explode {
41
- maxSizeFactor;
42
- speed;
43
- constructor() {
44
- this.maxSizeFactor = 3;
45
- this.speed = 2;
46
- }
33
+ maxSizeFactor = 3;
34
+ speed = 2;
47
35
  load(data) {
48
36
  if (engine.isNull(data)) {
49
37
  return;
50
38
  }
51
- if (data.maxSizeFactor !== undefined) {
52
- this.maxSizeFactor = data.maxSizeFactor;
53
- }
54
- if (data.speed !== undefined) {
55
- this.speed = data.speed;
56
- }
39
+ engine.loadProperty(this, "maxSizeFactor", data.maxSizeFactor);
40
+ engine.loadProperty(this, "speed", data.speed);
57
41
  }
58
42
  }
59
43
 
60
44
  class SplitFactor extends engine.ValueWithRandom {
61
- constructor() {
62
- super();
63
- this.value = 3;
64
- }
45
+ value = 3;
65
46
  }
66
47
 
67
48
  class SplitRate extends engine.ValueWithRandom {
68
- constructor() {
69
- super();
70
- this.value = { min: 4, max: 9 };
71
- }
49
+ value = { min: 4, max: 9 };
72
50
  }
73
51
 
74
52
  class Split {
75
- count;
76
- factor;
53
+ count = 1;
54
+ factor = new SplitFactor();
77
55
  fillColor;
78
56
  fillColorOffset;
79
57
  particles;
80
- rate;
81
- sizeOffset;
58
+ rate = new SplitRate();
59
+ sizeOffset = true;
82
60
  strokeColor;
83
61
  strokeColorOffset;
84
- constructor() {
85
- this.count = 1;
86
- this.factor = new SplitFactor();
87
- this.rate = new SplitRate();
88
- this.sizeOffset = true;
89
- }
90
62
  load(data) {
91
63
  if (engine.isNull(data)) {
92
64
  return;
@@ -97,17 +69,13 @@
97
69
  if (data.strokeColor !== undefined) {
98
70
  this.strokeColor = engine.OptionsColor.create(this.strokeColor, data.strokeColor);
99
71
  }
100
- if (data.count !== undefined) {
101
- this.count = data.count;
102
- }
72
+ engine.loadProperty(this, "count", data.count);
103
73
  this.factor.load(data.factor);
104
74
  this.rate.load(data.rate);
105
75
  this.particles = engine.executeOnSingleOrMultiple(data.particles, particles => {
106
76
  return engine.deepExtend({}, particles);
107
77
  });
108
- if (data.sizeOffset !== undefined) {
109
- this.sizeOffset = data.sizeOffset;
110
- }
78
+ engine.loadProperty(this, "sizeOffset", data.sizeOffset);
111
79
  if (data.fillColorOffset) {
112
80
  this.fillColorOffset = this.fillColorOffset ?? {};
113
81
  if (data.fillColorOffset.h !== undefined) {
@@ -136,16 +104,10 @@
136
104
  }
137
105
 
138
106
  class Destroy {
139
- bounds;
140
- explode;
141
- mode;
142
- split;
143
- constructor() {
144
- this.bounds = new DestroyBounds();
145
- this.explode = new Explode();
146
- this.mode = DestroyMode.none;
147
- this.split = new Split();
148
- }
107
+ bounds = new DestroyBounds();
108
+ explode = new Explode();
109
+ mode = DestroyMode.none;
110
+ split = new Split();
149
111
  load(data) {
150
112
  if (engine.isNull(data)) {
151
113
  return;
@@ -293,10 +255,7 @@
293
255
  return !destroyParticle.destroyed || !!destroyParticle.exploding;
294
256
  }
295
257
  loadOptions(options, ...sources) {
296
- options.destroy ??= new Destroy();
297
- for (const source of sources) {
298
- options.destroy.load(source?.destroy);
299
- }
258
+ engine.loadOptionProperty(options, "destroy", Destroy, ...sources);
300
259
  }
301
260
  particleDestroyed(particle, override) {
302
261
  if (override) {
@@ -361,7 +320,7 @@
361
320
  }
362
321
 
363
322
  async function loadDestroyUpdater(engine) {
364
- engine.checkVersion("4.1.2");
323
+ engine.checkVersion("4.2.0");
365
324
  await engine.pluginManager.register(e => {
366
325
  e.pluginManager.addParticleUpdater("destroy", container => {
367
326
  return Promise.resolve(new DestroyUpdater(e.pluginManager, container));
@@ -1 +1 @@
1
- !function(t){t.__tsParticlesInternals=t.__tsParticlesInternals||{},t.__tsParticlesInternals.bundles=t.__tsParticlesInternals.bundles||{},t.__tsParticlesInternals.effects=t.__tsParticlesInternals.effects||{},t.__tsParticlesInternals.engine=t.__tsParticlesInternals.engine||{},t.__tsParticlesInternals.interactions=t.__tsParticlesInternals.interactions||{},t.__tsParticlesInternals.palettes=t.__tsParticlesInternals.palettes||{},t.__tsParticlesInternals.paths=t.__tsParticlesInternals.paths||{},t.__tsParticlesInternals.plugins=t.__tsParticlesInternals.plugins||{},t.__tsParticlesInternals.plugins=t.__tsParticlesInternals.plugins||{},t.__tsParticlesInternals.plugins.emittersShapes=t.__tsParticlesInternals.plugins.emittersShapes||{},t.__tsParticlesInternals.presets=t.__tsParticlesInternals.presets||{},t.__tsParticlesInternals.shapes=t.__tsParticlesInternals.shapes||{},t.__tsParticlesInternals.updaters=t.__tsParticlesInternals.updaters||{},t.__tsParticlesInternals.utils=t.__tsParticlesInternals.utils||{},t.__tsParticlesInternals.canvas=t.__tsParticlesInternals.canvas||{},t.__tsParticlesInternals.canvas=t.__tsParticlesInternals.canvas||{},t.__tsParticlesInternals.canvas.utils=t.__tsParticlesInternals.canvas.utils||{},t.__tsParticlesInternals.path=t.__tsParticlesInternals.path||{},t.__tsParticlesInternals.path=t.__tsParticlesInternals.path||{},t.__tsParticlesInternals.path.utils=t.__tsParticlesInternals.path.utils||{};var e="undefined"!=typeof Proxy?function(t){return new Proxy(t,{get:function(t,e){return e in t||(t[e]={}),t[e]}})}:function(t){return t};t.__tsParticlesInternals.bundles=e(t.__tsParticlesInternals.bundles),t.__tsParticlesInternals.effects=e(t.__tsParticlesInternals.effects),t.__tsParticlesInternals.interactions=e(t.__tsParticlesInternals.interactions),t.__tsParticlesInternals.palettes=e(t.__tsParticlesInternals.palettes),t.__tsParticlesInternals.paths=e(t.__tsParticlesInternals.paths),t.__tsParticlesInternals.plugins=e(t.__tsParticlesInternals.plugins),t.__tsParticlesInternals.plugins.emittersShapes=e(t.__tsParticlesInternals.plugins.emittersShapes),t.__tsParticlesInternals.presets=e(t.__tsParticlesInternals.presets),t.__tsParticlesInternals.shapes=e(t.__tsParticlesInternals.shapes),t.__tsParticlesInternals.updaters=e(t.__tsParticlesInternals.updaters),t.__tsParticlesInternals.utils=e(t.__tsParticlesInternals.utils),t.__tsParticlesInternals.canvas=e(t.__tsParticlesInternals.canvas),t.__tsParticlesInternals.path=e(t.__tsParticlesInternals.path),t.tsparticlesInternalExports=t.tsparticlesInternalExports||{}}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:this),function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@tsparticles/engine")):"function"==typeof define&&define.amd?define(["exports","@tsparticles/engine"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).__tsParticlesInternals=t.__tsParticlesInternals||{},t.__tsParticlesInternals.updaters=t.__tsParticlesInternals.updaters||{},t.__tsParticlesInternals.updaters.destroy=t.__tsParticlesInternals.updaters.destroy||{}),t.__tsParticlesInternals.engine)}(this,function(t,e){"use strict";class s{bottom;left;right;top;load(t){e.isNull(t)||(void 0!==t.bottom&&(this.bottom=e.setRangeValue(t.bottom)),void 0!==t.left&&(this.left=e.setRangeValue(t.left)),void 0!==t.right&&(this.right=e.setRangeValue(t.right)),void 0!==t.top&&(this.top=e.setRangeValue(t.top)))}}var l;!function(t){t.explode="explode",t.none="none",t.split="split"}(l||(l={}));class i{maxSizeFactor;speed;constructor(){this.maxSizeFactor=3,this.speed=2}load(t){e.isNull(t)||(void 0!==t.maxSizeFactor&&(this.maxSizeFactor=t.maxSizeFactor),void 0!==t.speed&&(this.speed=t.speed))}}class n extends e.ValueWithRandom{constructor(){super(),this.value=3}}class r extends e.ValueWithRandom{constructor(){super(),this.value={min:4,max:9}}}class a{count;factor;fillColor;fillColorOffset;particles;rate;sizeOffset;strokeColor;strokeColorOffset;constructor(){this.count=1,this.factor=new n,this.rate=new r,this.sizeOffset=!0}load(t){e.isNull(t)||(void 0!==t.fillColor&&(this.fillColor=e.OptionsColor.create(this.fillColor,t.fillColor)),void 0!==t.strokeColor&&(this.strokeColor=e.OptionsColor.create(this.strokeColor,t.strokeColor)),void 0!==t.count&&(this.count=t.count),this.factor.load(t.factor),this.rate.load(t.rate),this.particles=e.executeOnSingleOrMultiple(t.particles,t=>e.deepExtend({},t)),void 0!==t.sizeOffset&&(this.sizeOffset=t.sizeOffset),t.fillColorOffset&&(this.fillColorOffset=this.fillColorOffset??{},void 0!==t.fillColorOffset.h&&(this.fillColorOffset.h=t.fillColorOffset.h),void 0!==t.fillColorOffset.s&&(this.fillColorOffset.s=t.fillColorOffset.s),void 0!==t.fillColorOffset.l&&(this.fillColorOffset.l=t.fillColorOffset.l)),t.strokeColorOffset&&(this.strokeColorOffset=this.strokeColorOffset??{},void 0!==t.strokeColorOffset.h&&(this.strokeColorOffset.h=t.strokeColorOffset.h),void 0!==t.strokeColorOffset.s&&(this.strokeColorOffset.s=t.strokeColorOffset.s),void 0!==t.strokeColorOffset.l&&(this.strokeColorOffset.l=t.strokeColorOffset.l)))}}class o{bounds;explode;mode;split;constructor(){this.bounds=new s,this.explode=new i,this.mode=l.none,this.split=new a}load(t){e.isNull(t)||(t.mode&&(this.mode=t.mode),t.bounds&&this.bounds.load(t.bounds),this.explode.load(t.explode),this.split.load(t.split))}}function c(t,s,l,i){return t&&i?function(t,s){const l=e.getRangeValue(s.h??0),i=e.getRangeValue(s.s??0),n=e.getRangeValue(s.l??0),r=(t.h+l)%360,a=Math.max(0,Math.min(100,t.s+i)),o=Math.max(0,Math.min(100,t.l+n));return e.AnimatableColor.create(void 0,{value:{hsl:{h:r<0?r+360:r,s:a,l:o}}})}(i,t):s?e.AnimatableColor.create(void 0,s):l?e.AnimatableColor.create(void 0,l):i?function(t){return e.AnimatableColor.create(void 0,{value:{hsl:t}})}(i):void 0}function p(t,s,l,i){const n=l.options.destroy;if(!n)return;const r=n.split,a=e.loadParticlesOptions(t,s,l.options),o=e.itemFromSingleOrMultiple(r.fillColor),p=e.itemFromSingleOrMultiple(r.strokeColor),d=l.getFillColor(),f=l.getStrokeColor();a.move.load({center:{x:l.position.x,y:l.position.y,mode:e.PixelMode.precise}});const u=e.identity/e.getRangeValue(r.factor.value),_=a.size;_&&(e.isNumber(_.value)?_.value*=u:(_.value.min*=u,_.value.max*=u)),a.load(i);const h=e.itemFromSingleOrMultiple(a.paint),g=h?.fill,P=h?.stroke,I=c(r.fillColorOffset,o,g?.color,d),m=c(r.strokeColorOffset,p,P?.color,f);I&&g&&(g.color=I),m&&P&&(P.color=m);const v=r.sizeOffset?e.setRangeValue(-l.size.value,l.size.value):0,O={x:l.position.x+e.randomInRangeValue(v),y:l.position.y+e.randomInRangeValue(v)};return s.particles.addParticle(O,a,l.group,t=>!(t.size.value<.5)&&(t.velocity.length=e.randomInRangeValue(e.setRangeValue(l.velocity.length,t.velocity.length)),t.splitCount=(l.splitCount??0)+1,t.unbreakable=!0,t.unbreakableUntil=performance.now()+500,!0))}class d{#t;#e;constructor(t,e){this.#t=e,this.#e=t}init(t){const s=this.#t,l=t.options.destroy;if(!l)return;t.exploding=void 0,t.splitCount=0;const i=l.bounds;t.destroyBounds??={};const{bottom:n,left:r,right:a,top:o}=i,{destroyBounds:c}=t,p=s.canvas.size;n&&(c.bottom=e.getRangeValue(n)*p.height/e.percentDenominator),r&&(c.left=e.getRangeValue(r)*p.width/e.percentDenominator),a&&(c.right=e.getRangeValue(a)*p.width/e.percentDenominator),o&&(c.top=e.getRangeValue(o)*p.height/e.percentDenominator)}isEnabled(t){const e=t;return!e.destroyed||!!e.exploding}loadOptions(t,...e){t.destroy??=new o;for(const s of e)t.destroy.load(s?.destroy)}particleDestroyed(t,s){if(s)return;const i=t.options.destroy;switch(i?.mode){case l.split:!function(t,s,l){const i=l.options.destroy;if(!i)return;const n=i.split;if(n.count>=0){if(void 0===l.splitCount||l.splitCount>n.count)return;l.splitCount++}const r=e.getRangeValue(n.rate.value),a=e.itemFromSingleOrMultiple(n.particles);for(let e=0;e<r;e++)p(t,s,l,a)}(this.#e,this.#t,t);break;case l.explode:{if(t.exploding){t.destroyed=!1;break}const{explode:e}=i,s=t.size.value,l=s*e.maxSizeFactor,n=t.getOpacity();t.exploding={initialFillOpacity:n.fillOpacity,initialSize:s,initialStrokeOpacity:n.strokeOpacity,maxSize:l,progress:0,speed:Math.max(e.speed,.01)},t.fillOpacity=n.fillOpacity,t.strokeOpacity=n.strokeOpacity,t.destroyed=!1;break}}}update(t,e){if(t.exploding){const s=t.exploding,l=e.factor||1;s.progress=Math.min(1,s.progress+s.speed*l/60);const i=s.progress;return t.size.value=s.initialSize+(s.maxSize-s.initialSize)*i,t.fillOpacity=s.initialFillOpacity*(1-i),t.strokeOpacity=s.initialStrokeOpacity*(1-i),void(i>=1&&(t.exploding=void 0,t.destroy(!0)))}void 0!==t.unbreakableUntil&&performance.now()>=t.unbreakableUntil&&(t.unbreakable=!1,t.unbreakableUntil=void 0);const s=t.getPosition(),l=t.destroyBounds;l&&(void 0!==l.bottom&&s.y>=l.bottom||void 0!==l.left&&s.x<=l.left||void 0!==l.right&&s.x>=l.right||void 0!==l.top&&s.y<=l.top)&&t.destroy()}}async function f(t){t.checkVersion("4.1.2"),await t.pluginManager.register(t=>{t.pluginManager.addParticleUpdater("destroy",e=>Promise.resolve(new d(t.pluginManager,e)))})}const u=globalThis;u.__tsParticlesInternals=u.__tsParticlesInternals??{},u.loadDestroyUpdater=f,t.loadDestroyUpdater=f}),Object.assign(globalThis.window||globalThis,{loadDestroyUpdater:(globalThis.__tsParticlesInternals.updaters.destroy||{}).loadDestroyUpdater}),delete(globalThis.window||globalThis).tsparticlesInternalExports;
1
+ !function(t){t.__tsParticlesInternals=t.__tsParticlesInternals||{},t.__tsParticlesInternals.bundles=t.__tsParticlesInternals.bundles||{},t.__tsParticlesInternals.effects=t.__tsParticlesInternals.effects||{},t.__tsParticlesInternals.engine=t.__tsParticlesInternals.engine||{},t.__tsParticlesInternals.interactions=t.__tsParticlesInternals.interactions||{},t.__tsParticlesInternals.palettes=t.__tsParticlesInternals.palettes||{},t.__tsParticlesInternals.paths=t.__tsParticlesInternals.paths||{},t.__tsParticlesInternals.plugins=t.__tsParticlesInternals.plugins||{},t.__tsParticlesInternals.plugins=t.__tsParticlesInternals.plugins||{},t.__tsParticlesInternals.plugins.emittersShapes=t.__tsParticlesInternals.plugins.emittersShapes||{},t.__tsParticlesInternals.presets=t.__tsParticlesInternals.presets||{},t.__tsParticlesInternals.shapes=t.__tsParticlesInternals.shapes||{},t.__tsParticlesInternals.updaters=t.__tsParticlesInternals.updaters||{},t.__tsParticlesInternals.utils=t.__tsParticlesInternals.utils||{},t.__tsParticlesInternals.canvas=t.__tsParticlesInternals.canvas||{},t.__tsParticlesInternals.canvas=t.__tsParticlesInternals.canvas||{},t.__tsParticlesInternals.canvas.utils=t.__tsParticlesInternals.canvas.utils||{},t.__tsParticlesInternals.path=t.__tsParticlesInternals.path||{},t.__tsParticlesInternals.path=t.__tsParticlesInternals.path||{},t.__tsParticlesInternals.path.utils=t.__tsParticlesInternals.path.utils||{};var e="undefined"!=typeof Proxy?function(t){return new Proxy(t,{get:function(t,e){return e in t||(t[e]={}),t[e]}})}:function(t){return t};t.__tsParticlesInternals.bundles=e(t.__tsParticlesInternals.bundles),t.__tsParticlesInternals.effects=e(t.__tsParticlesInternals.effects),t.__tsParticlesInternals.interactions=e(t.__tsParticlesInternals.interactions),t.__tsParticlesInternals.palettes=e(t.__tsParticlesInternals.palettes),t.__tsParticlesInternals.paths=e(t.__tsParticlesInternals.paths),t.__tsParticlesInternals.plugins=e(t.__tsParticlesInternals.plugins),t.__tsParticlesInternals.plugins.emittersShapes=e(t.__tsParticlesInternals.plugins.emittersShapes),t.__tsParticlesInternals.presets=e(t.__tsParticlesInternals.presets),t.__tsParticlesInternals.shapes=e(t.__tsParticlesInternals.shapes),t.__tsParticlesInternals.updaters=e(t.__tsParticlesInternals.updaters),t.__tsParticlesInternals.utils=e(t.__tsParticlesInternals.utils),t.__tsParticlesInternals.canvas=e(t.__tsParticlesInternals.canvas),t.__tsParticlesInternals.path=e(t.__tsParticlesInternals.path),t.tsparticlesInternalExports=t.tsparticlesInternalExports||{}}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:this),function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@tsparticles/engine")):"function"==typeof define&&define.amd?define(["exports","@tsparticles/engine"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).__tsParticlesInternals=t.__tsParticlesInternals||{},t.__tsParticlesInternals.updaters=t.__tsParticlesInternals.updaters||{},t.__tsParticlesInternals.updaters.destroy=t.__tsParticlesInternals.updaters.destroy||{}),t.__tsParticlesInternals.engine)}(this,function(t,e){"use strict";class s{bottom;left;right;top;load(t){e.isNull(t)||(e.loadRangeProperty(this,"bottom",t.bottom),e.loadRangeProperty(this,"left",t.left),e.loadRangeProperty(this,"right",t.right),e.loadRangeProperty(this,"top",t.top))}}var l;!function(t){t.explode="explode",t.none="none",t.split="split"}(l||(l={}));class r{maxSizeFactor=3;speed=2;load(t){e.isNull(t)||(e.loadProperty(this,"maxSizeFactor",t.maxSizeFactor),e.loadProperty(this,"speed",t.speed))}}class a extends e.ValueWithRandom{value=3}class n extends e.ValueWithRandom{value={min:4,max:9}}class i{count=1;factor=new a;fillColor;fillColorOffset;particles;rate=new n;sizeOffset=!0;strokeColor;strokeColorOffset;load(t){e.isNull(t)||(void 0!==t.fillColor&&(this.fillColor=e.OptionsColor.create(this.fillColor,t.fillColor)),void 0!==t.strokeColor&&(this.strokeColor=e.OptionsColor.create(this.strokeColor,t.strokeColor)),e.loadProperty(this,"count",t.count),this.factor.load(t.factor),this.rate.load(t.rate),this.particles=e.executeOnSingleOrMultiple(t.particles,t=>e.deepExtend({},t)),e.loadProperty(this,"sizeOffset",t.sizeOffset),t.fillColorOffset&&(this.fillColorOffset=this.fillColorOffset??{},void 0!==t.fillColorOffset.h&&(this.fillColorOffset.h=t.fillColorOffset.h),void 0!==t.fillColorOffset.s&&(this.fillColorOffset.s=t.fillColorOffset.s),void 0!==t.fillColorOffset.l&&(this.fillColorOffset.l=t.fillColorOffset.l)),t.strokeColorOffset&&(this.strokeColorOffset=this.strokeColorOffset??{},void 0!==t.strokeColorOffset.h&&(this.strokeColorOffset.h=t.strokeColorOffset.h),void 0!==t.strokeColorOffset.s&&(this.strokeColorOffset.s=t.strokeColorOffset.s),void 0!==t.strokeColorOffset.l&&(this.strokeColorOffset.l=t.strokeColorOffset.l)))}}class o{bounds=new s;explode=new r;mode=l.none;split=new i;load(t){e.isNull(t)||(t.mode&&(this.mode=t.mode),t.bounds&&this.bounds.load(t.bounds),this.explode.load(t.explode),this.split.load(t.split))}}function c(t,s,l,r){return t&&r?function(t,s){const l=e.getRangeValue(s.h??0),r=e.getRangeValue(s.s??0),a=e.getRangeValue(s.l??0),n=(t.h+l)%360,i=Math.max(0,Math.min(100,t.s+r)),o=Math.max(0,Math.min(100,t.l+a));return e.AnimatableColor.create(void 0,{value:{hsl:{h:n<0?n+360:n,s:i,l:o}}})}(r,t):s?e.AnimatableColor.create(void 0,s):l?e.AnimatableColor.create(void 0,l):r?function(t){return e.AnimatableColor.create(void 0,{value:{hsl:t}})}(r):void 0}function p(t,s,l,r){const a=l.options.destroy;if(!a)return;const n=a.split,i=e.loadParticlesOptions(t,s,l.options),o=e.itemFromSingleOrMultiple(n.fillColor),p=e.itemFromSingleOrMultiple(n.strokeColor),d=l.getFillColor(),_=l.getStrokeColor();i.move.load({center:{x:l.position.x,y:l.position.y,mode:e.PixelMode.precise}});const f=e.identity/e.getRangeValue(n.factor.value),u=i.size;u&&(e.isNumber(u.value)?u.value*=f:(u.value.min*=f,u.value.max*=f)),i.load(r);const h=e.itemFromSingleOrMultiple(i.paint),g=h?.fill,P=h?.stroke,I=c(n.fillColorOffset,o,g?.color,d),y=c(n.strokeColorOffset,p,P?.color,_);I&&g&&(g.color=I),y&&P&&(P.color=y);const m=n.sizeOffset?e.setRangeValue(-l.size.value,l.size.value):0,O={x:l.position.x+e.randomInRangeValue(m),y:l.position.y+e.randomInRangeValue(m)};return s.particles.addParticle(O,i,l.group,t=>!(t.size.value<.5)&&(t.velocity.length=e.randomInRangeValue(e.setRangeValue(l.velocity.length,t.velocity.length)),t.splitCount=(l.splitCount??0)+1,t.unbreakable=!0,t.unbreakableUntil=performance.now()+500,!0))}class d{#t;#e;constructor(t,e){this.#t=e,this.#e=t}init(t){const s=this.#t,l=t.options.destroy;if(!l)return;t.exploding=void 0,t.splitCount=0;const r=l.bounds;t.destroyBounds??={};const{bottom:a,left:n,right:i,top:o}=r,{destroyBounds:c}=t,p=s.canvas.size;a&&(c.bottom=e.getRangeValue(a)*p.height/e.percentDenominator),n&&(c.left=e.getRangeValue(n)*p.width/e.percentDenominator),i&&(c.right=e.getRangeValue(i)*p.width/e.percentDenominator),o&&(c.top=e.getRangeValue(o)*p.height/e.percentDenominator)}isEnabled(t){const e=t;return!e.destroyed||!!e.exploding}loadOptions(t,...s){e.loadOptionProperty(t,"destroy",o,...s)}particleDestroyed(t,s){if(s)return;const r=t.options.destroy;switch(r?.mode){case l.split:!function(t,s,l){const r=l.options.destroy;if(!r)return;const a=r.split;if(a.count>=0){if(void 0===l.splitCount||l.splitCount>a.count)return;l.splitCount++}const n=e.getRangeValue(a.rate.value),i=e.itemFromSingleOrMultiple(a.particles);for(let e=0;e<n;e++)p(t,s,l,i)}(this.#e,this.#t,t);break;case l.explode:{if(t.exploding){t.destroyed=!1;break}const{explode:e}=r,s=t.size.value,l=s*e.maxSizeFactor,a=t.getOpacity();t.exploding={initialFillOpacity:a.fillOpacity,initialSize:s,initialStrokeOpacity:a.strokeOpacity,maxSize:l,progress:0,speed:Math.max(e.speed,.01)},t.fillOpacity=a.fillOpacity,t.strokeOpacity=a.strokeOpacity,t.destroyed=!1;break}}}update(t,e){if(t.exploding){const s=t.exploding,l=e.factor||1;s.progress=Math.min(1,s.progress+s.speed*l/60);const r=s.progress;return t.size.value=s.initialSize+(s.maxSize-s.initialSize)*r,t.fillOpacity=s.initialFillOpacity*(1-r),t.strokeOpacity=s.initialStrokeOpacity*(1-r),void(r>=1&&(t.exploding=void 0,t.destroy(!0)))}void 0!==t.unbreakableUntil&&performance.now()>=t.unbreakableUntil&&(t.unbreakable=!1,t.unbreakableUntil=void 0);const s=t.getPosition(),l=t.destroyBounds;l&&(void 0!==l.bottom&&s.y>=l.bottom||void 0!==l.left&&s.x<=l.left||void 0!==l.right&&s.x>=l.right||void 0!==l.top&&s.y<=l.top)&&t.destroy()}}async function _(t){t.checkVersion("4.2.0"),await t.pluginManager.register(t=>{t.pluginManager.addParticleUpdater("destroy",e=>Promise.resolve(new d(t.pluginManager,e)))})}const f=globalThis;f.__tsParticlesInternals=f.__tsParticlesInternals??{},f.loadDestroyUpdater=_,t.loadDestroyUpdater=_}),Object.assign(globalThis.window||globalThis,{loadDestroyUpdater:(globalThis.__tsParticlesInternals.updaters.destroy||{}).loadDestroyUpdater}),delete(globalThis.window||globalThis).tsparticlesInternalExports;
@@ -5,10 +5,9 @@ import { Explode } from "./Explode.js";
5
5
  import type { IDestroy } from "../Interfaces/IDestroy.js";
6
6
  import { Split } from "./Split.js";
7
7
  export declare class Destroy implements IDestroy, IOptionLoader<IDestroy> {
8
- bounds: DestroyBounds;
9
- explode: Explode;
8
+ readonly bounds: DestroyBounds;
9
+ readonly explode: Explode;
10
10
  mode: DestroyMode | keyof typeof DestroyMode;
11
- split: Split;
12
- constructor();
11
+ readonly split: Split;
13
12
  load(data?: RecursivePartial<IDestroy>): void;
14
13
  }
@@ -3,6 +3,5 @@ import type { IExplode } from "../Interfaces/IExplode.js";
3
3
  export declare class Explode implements IExplode, IOptionLoader<IExplode> {
4
4
  maxSizeFactor: number;
5
5
  speed: number;
6
- constructor();
7
6
  load(data?: RecursivePartial<IExplode>): void;
8
7
  }
@@ -4,14 +4,13 @@ import { SplitFactor } from "./SplitFactor.js";
4
4
  import { SplitRate } from "./SplitRate.js";
5
5
  export declare class Split implements ISplit, IOptionLoader<ISplit> {
6
6
  count: number;
7
- factor: SplitFactor;
7
+ readonly factor: SplitFactor;
8
8
  fillColor?: OptionsColor;
9
9
  fillColorOffset?: Partial<IRangeHsl>;
10
10
  particles?: SingleOrMultiple<RecursivePartial<IParticlesOptions>>;
11
- rate: SplitRate;
11
+ readonly rate: SplitRate;
12
12
  sizeOffset: boolean;
13
13
  strokeColor?: OptionsColor;
14
14
  strokeColorOffset?: Partial<IRangeHsl>;
15
- constructor();
16
15
  load(data?: RecursivePartial<ISplit>): void;
17
16
  }
@@ -1,4 +1,4 @@
1
1
  import { ValueWithRandom } from "@tsparticles/engine";
2
2
  export declare class SplitFactor extends ValueWithRandom {
3
- constructor();
3
+ value: number;
4
4
  }
@@ -1,4 +1,7 @@
1
1
  import { ValueWithRandom } from "@tsparticles/engine";
2
2
  export declare class SplitRate extends ValueWithRandom {
3
- constructor();
3
+ value: {
4
+ min: number;
5
+ max: number;
6
+ };
4
7
  }