@tsparticles/interaction-particles-links 4.5.0 → 4.5.2

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.
@@ -1,4 +1,4 @@
1
- import { Circle, Rectangle } from "@tsparticles/engine";
1
+ import { Circle, Rectangle, originPoint, } from "@tsparticles/engine";
2
2
  export class CircleWarp extends Circle {
3
3
  #canvasSize;
4
4
  constructor(x, y, radius, canvasSize) {
@@ -6,8 +6,9 @@ export class CircleWarp extends Circle {
6
6
  this.#canvasSize = canvasSize;
7
7
  }
8
8
  contains(point) {
9
- if (super.contains(point))
9
+ if (super.contains(point)) {
10
10
  return true;
11
+ }
11
12
  const { width, height } = this.#canvasSize, { x, y } = point;
12
13
  return (super.contains({ x: x - width, y }) ||
13
14
  super.contains({ x: x + width, y }) ||
@@ -19,8 +20,9 @@ export class CircleWarp extends Circle {
19
20
  super.contains({ x: x + width, y: y - height }));
20
21
  }
21
22
  intersects(range) {
22
- if (super.intersects(range))
23
+ if (super.intersects(range)) {
23
24
  return true;
25
+ }
24
26
  const { width, height } = this.#canvasSize, pos = range.position, shifts = [
25
27
  { x: -width, y: 0 },
26
28
  { x: width, y: 0 },
@@ -41,9 +43,38 @@ export class CircleWarp extends Circle {
41
43
  const rect = range;
42
44
  shiftedRange = new Rectangle(shiftedPos.x, shiftedPos.y, rect.size.width, rect.size.height);
43
45
  }
44
- if (super.intersects(shiftedRange))
46
+ if (super.intersects(shiftedRange)) {
45
47
  return true;
48
+ }
46
49
  }
47
50
  return false;
48
51
  }
52
+ query(grid) {
53
+ const { x, y } = this.position, { width, height } = this.#canvasSize, radius = this.radius, crossesLeft = x - radius <= originPoint.x, crossesRight = x + radius >= width, crossesTop = y - radius <= originPoint.y, crossesBottom = y + radius >= height;
54
+ if (!crossesLeft && !crossesRight && !crossesTop && !crossesBottom) {
55
+ return grid.query(this);
56
+ }
57
+ const xShifts = [originPoint.x], yShifts = [originPoint.y];
58
+ if (crossesLeft) {
59
+ xShifts.push(width);
60
+ }
61
+ if (crossesRight) {
62
+ xShifts.push(-width);
63
+ }
64
+ if (crossesTop) {
65
+ yShifts.push(height);
66
+ }
67
+ if (crossesBottom) {
68
+ yShifts.push(-height);
69
+ }
70
+ const particles = new Set();
71
+ for (const dx of xShifts) {
72
+ for (const dy of yShifts) {
73
+ for (const particle of grid.queryCircle({ x: x + dx, y: y + dy }, radius)) {
74
+ particles.add(particle);
75
+ }
76
+ }
77
+ }
78
+ return [...particles];
79
+ }
49
80
  }
package/browser/Linker.js CHANGED
@@ -1,4 +1,4 @@
1
- import { Circle, getDistances, getLinkColor, getLinkRandomColor, loadOptionProperty, originPoint, } from "@tsparticles/engine";
1
+ import { getDistances, getLinkColor, getLinkRandomColor, loadOptionProperty, originPoint, } from "@tsparticles/engine";
2
2
  import { CircleWarp } from "./CircleWarp.js";
3
3
  import { Links } from "./Options/Classes/Links.js";
4
4
  import { ParticlesInteractorBase } from "@tsparticles/plugin-interactivity";
@@ -39,7 +39,9 @@ export class Linker extends ParticlesInteractorBase {
39
39
  if (pos1.x < originPoint.x || pos1.y < originPoint.y || pos1.x > canvasSize.width || pos1.y > canvasSize.height) {
40
40
  return;
41
41
  }
42
- const linkOpt1 = p1.options.links, optOpacity = linkOpt1.opacity, optDistance = p1.retina.linksDistance ?? minDistance, warp = linkOpt1.warp, range = warp ? new CircleWarp(pos1.x, pos1.y, optDistance, canvasSize) : new Circle(pos1.x, pos1.y, optDistance), query = container.particles.grid.query(range);
42
+ const linkOpt1 = p1.options.links, optOpacity = linkOpt1.opacity, optDistance = p1.retina.linksDistance ?? minDistance, warp = linkOpt1.warp, query = (warp
43
+ ? new CircleWarp(pos1.x, pos1.y, optDistance, canvasSize).query(container.particles.grid)
44
+ : container.particles.grid.queryCircle(pos1, optDistance));
43
45
  for (const p2 of query) {
44
46
  const linkOpt2 = p2.options.links;
45
47
  if (p1 === p2 ||
package/browser/index.js CHANGED
@@ -2,7 +2,7 @@ import { ensureInteractivityPluginLoaded } from "@tsparticles/plugin-interactivi
2
2
  import { Linker } from "./Linker.js";
3
3
  import { LinksPlugin } from "./LinksPlugin.js";
4
4
  export async function loadParticlesLinksInteraction(engine) {
5
- engine.checkVersion("4.5.0");
5
+ engine.checkVersion("4.5.2");
6
6
  await engine.pluginManager.register((e) => {
7
7
  const pluginManager = e.pluginManager;
8
8
  ensureInteractivityPluginLoaded(e);
@@ -1,5 +1,5 @@
1
1
  export async function loadParticlesLinksInteraction(engine) {
2
- engine.checkVersion("4.5.0");
2
+ engine.checkVersion("4.5.2");
3
3
  await engine.pluginManager.register(async (e) => {
4
4
  const pluginManager = e.pluginManager, [{ ensureInteractivityPluginLoaded }, { LinksPlugin },] = await Promise.all([
5
5
  import("@tsparticles/plugin-interactivity/lazy"),
package/cjs/CircleWarp.js CHANGED
@@ -1,4 +1,4 @@
1
- import { Circle, Rectangle } from "@tsparticles/engine";
1
+ import { Circle, Rectangle, originPoint, } from "@tsparticles/engine";
2
2
  export class CircleWarp extends Circle {
3
3
  #canvasSize;
4
4
  constructor(x, y, radius, canvasSize) {
@@ -6,8 +6,9 @@ export class CircleWarp extends Circle {
6
6
  this.#canvasSize = canvasSize;
7
7
  }
8
8
  contains(point) {
9
- if (super.contains(point))
9
+ if (super.contains(point)) {
10
10
  return true;
11
+ }
11
12
  const { width, height } = this.#canvasSize, { x, y } = point;
12
13
  return (super.contains({ x: x - width, y }) ||
13
14
  super.contains({ x: x + width, y }) ||
@@ -19,8 +20,9 @@ export class CircleWarp extends Circle {
19
20
  super.contains({ x: x + width, y: y - height }));
20
21
  }
21
22
  intersects(range) {
22
- if (super.intersects(range))
23
+ if (super.intersects(range)) {
23
24
  return true;
25
+ }
24
26
  const { width, height } = this.#canvasSize, pos = range.position, shifts = [
25
27
  { x: -width, y: 0 },
26
28
  { x: width, y: 0 },
@@ -41,9 +43,38 @@ export class CircleWarp extends Circle {
41
43
  const rect = range;
42
44
  shiftedRange = new Rectangle(shiftedPos.x, shiftedPos.y, rect.size.width, rect.size.height);
43
45
  }
44
- if (super.intersects(shiftedRange))
46
+ if (super.intersects(shiftedRange)) {
45
47
  return true;
48
+ }
46
49
  }
47
50
  return false;
48
51
  }
52
+ query(grid) {
53
+ const { x, y } = this.position, { width, height } = this.#canvasSize, radius = this.radius, crossesLeft = x - radius <= originPoint.x, crossesRight = x + radius >= width, crossesTop = y - radius <= originPoint.y, crossesBottom = y + radius >= height;
54
+ if (!crossesLeft && !crossesRight && !crossesTop && !crossesBottom) {
55
+ return grid.query(this);
56
+ }
57
+ const xShifts = [originPoint.x], yShifts = [originPoint.y];
58
+ if (crossesLeft) {
59
+ xShifts.push(width);
60
+ }
61
+ if (crossesRight) {
62
+ xShifts.push(-width);
63
+ }
64
+ if (crossesTop) {
65
+ yShifts.push(height);
66
+ }
67
+ if (crossesBottom) {
68
+ yShifts.push(-height);
69
+ }
70
+ const particles = new Set();
71
+ for (const dx of xShifts) {
72
+ for (const dy of yShifts) {
73
+ for (const particle of grid.queryCircle({ x: x + dx, y: y + dy }, radius)) {
74
+ particles.add(particle);
75
+ }
76
+ }
77
+ }
78
+ return [...particles];
79
+ }
49
80
  }
package/cjs/Linker.js CHANGED
@@ -1,4 +1,4 @@
1
- import { Circle, getDistances, getLinkColor, getLinkRandomColor, loadOptionProperty, originPoint, } from "@tsparticles/engine";
1
+ import { getDistances, getLinkColor, getLinkRandomColor, loadOptionProperty, originPoint, } from "@tsparticles/engine";
2
2
  import { CircleWarp } from "./CircleWarp.js";
3
3
  import { Links } from "./Options/Classes/Links.js";
4
4
  import { ParticlesInteractorBase } from "@tsparticles/plugin-interactivity";
@@ -39,7 +39,9 @@ export class Linker extends ParticlesInteractorBase {
39
39
  if (pos1.x < originPoint.x || pos1.y < originPoint.y || pos1.x > canvasSize.width || pos1.y > canvasSize.height) {
40
40
  return;
41
41
  }
42
- const linkOpt1 = p1.options.links, optOpacity = linkOpt1.opacity, optDistance = p1.retina.linksDistance ?? minDistance, warp = linkOpt1.warp, range = warp ? new CircleWarp(pos1.x, pos1.y, optDistance, canvasSize) : new Circle(pos1.x, pos1.y, optDistance), query = container.particles.grid.query(range);
42
+ const linkOpt1 = p1.options.links, optOpacity = linkOpt1.opacity, optDistance = p1.retina.linksDistance ?? minDistance, warp = linkOpt1.warp, query = (warp
43
+ ? new CircleWarp(pos1.x, pos1.y, optDistance, canvasSize).query(container.particles.grid)
44
+ : container.particles.grid.queryCircle(pos1, optDistance));
43
45
  for (const p2 of query) {
44
46
  const linkOpt2 = p2.options.links;
45
47
  if (p1 === p2 ||
package/cjs/index.js CHANGED
@@ -2,7 +2,7 @@ import { ensureInteractivityPluginLoaded } from "@tsparticles/plugin-interactivi
2
2
  import { Linker } from "./Linker.js";
3
3
  import { LinksPlugin } from "./LinksPlugin.js";
4
4
  export async function loadParticlesLinksInteraction(engine) {
5
- engine.checkVersion("4.5.0");
5
+ engine.checkVersion("4.5.2");
6
6
  await engine.pluginManager.register((e) => {
7
7
  const pluginManager = e.pluginManager;
8
8
  ensureInteractivityPluginLoaded(e);
package/cjs/index.lazy.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export async function loadParticlesLinksInteraction(engine) {
2
- engine.checkVersion("4.5.0");
2
+ engine.checkVersion("4.5.2");
3
3
  await engine.pluginManager.register(async (e) => {
4
4
  const pluginManager = e.pluginManager, [{ ensureInteractivityPluginLoaded }, { LinksPlugin },] = await Promise.all([
5
5
  import("@tsparticles/plugin-interactivity/lazy"),
package/esm/CircleWarp.js CHANGED
@@ -1,4 +1,4 @@
1
- import { Circle, Rectangle } from "@tsparticles/engine";
1
+ import { Circle, Rectangle, originPoint, } from "@tsparticles/engine";
2
2
  export class CircleWarp extends Circle {
3
3
  #canvasSize;
4
4
  constructor(x, y, radius, canvasSize) {
@@ -6,8 +6,9 @@ export class CircleWarp extends Circle {
6
6
  this.#canvasSize = canvasSize;
7
7
  }
8
8
  contains(point) {
9
- if (super.contains(point))
9
+ if (super.contains(point)) {
10
10
  return true;
11
+ }
11
12
  const { width, height } = this.#canvasSize, { x, y } = point;
12
13
  return (super.contains({ x: x - width, y }) ||
13
14
  super.contains({ x: x + width, y }) ||
@@ -19,8 +20,9 @@ export class CircleWarp extends Circle {
19
20
  super.contains({ x: x + width, y: y - height }));
20
21
  }
21
22
  intersects(range) {
22
- if (super.intersects(range))
23
+ if (super.intersects(range)) {
23
24
  return true;
25
+ }
24
26
  const { width, height } = this.#canvasSize, pos = range.position, shifts = [
25
27
  { x: -width, y: 0 },
26
28
  { x: width, y: 0 },
@@ -41,9 +43,38 @@ export class CircleWarp extends Circle {
41
43
  const rect = range;
42
44
  shiftedRange = new Rectangle(shiftedPos.x, shiftedPos.y, rect.size.width, rect.size.height);
43
45
  }
44
- if (super.intersects(shiftedRange))
46
+ if (super.intersects(shiftedRange)) {
45
47
  return true;
48
+ }
46
49
  }
47
50
  return false;
48
51
  }
52
+ query(grid) {
53
+ const { x, y } = this.position, { width, height } = this.#canvasSize, radius = this.radius, crossesLeft = x - radius <= originPoint.x, crossesRight = x + radius >= width, crossesTop = y - radius <= originPoint.y, crossesBottom = y + radius >= height;
54
+ if (!crossesLeft && !crossesRight && !crossesTop && !crossesBottom) {
55
+ return grid.query(this);
56
+ }
57
+ const xShifts = [originPoint.x], yShifts = [originPoint.y];
58
+ if (crossesLeft) {
59
+ xShifts.push(width);
60
+ }
61
+ if (crossesRight) {
62
+ xShifts.push(-width);
63
+ }
64
+ if (crossesTop) {
65
+ yShifts.push(height);
66
+ }
67
+ if (crossesBottom) {
68
+ yShifts.push(-height);
69
+ }
70
+ const particles = new Set();
71
+ for (const dx of xShifts) {
72
+ for (const dy of yShifts) {
73
+ for (const particle of grid.queryCircle({ x: x + dx, y: y + dy }, radius)) {
74
+ particles.add(particle);
75
+ }
76
+ }
77
+ }
78
+ return [...particles];
79
+ }
49
80
  }
package/esm/Linker.js CHANGED
@@ -1,4 +1,4 @@
1
- import { Circle, getDistances, getLinkColor, getLinkRandomColor, loadOptionProperty, originPoint, } from "@tsparticles/engine";
1
+ import { getDistances, getLinkColor, getLinkRandomColor, loadOptionProperty, originPoint, } from "@tsparticles/engine";
2
2
  import { CircleWarp } from "./CircleWarp.js";
3
3
  import { Links } from "./Options/Classes/Links.js";
4
4
  import { ParticlesInteractorBase } from "@tsparticles/plugin-interactivity";
@@ -39,7 +39,9 @@ export class Linker extends ParticlesInteractorBase {
39
39
  if (pos1.x < originPoint.x || pos1.y < originPoint.y || pos1.x > canvasSize.width || pos1.y > canvasSize.height) {
40
40
  return;
41
41
  }
42
- const linkOpt1 = p1.options.links, optOpacity = linkOpt1.opacity, optDistance = p1.retina.linksDistance ?? minDistance, warp = linkOpt1.warp, range = warp ? new CircleWarp(pos1.x, pos1.y, optDistance, canvasSize) : new Circle(pos1.x, pos1.y, optDistance), query = container.particles.grid.query(range);
42
+ const linkOpt1 = p1.options.links, optOpacity = linkOpt1.opacity, optDistance = p1.retina.linksDistance ?? minDistance, warp = linkOpt1.warp, query = (warp
43
+ ? new CircleWarp(pos1.x, pos1.y, optDistance, canvasSize).query(container.particles.grid)
44
+ : container.particles.grid.queryCircle(pos1, optDistance));
43
45
  for (const p2 of query) {
44
46
  const linkOpt2 = p2.options.links;
45
47
  if (p1 === p2 ||
package/esm/index.js CHANGED
@@ -2,7 +2,7 @@ import { ensureInteractivityPluginLoaded } from "@tsparticles/plugin-interactivi
2
2
  import { Linker } from "./Linker.js";
3
3
  import { LinksPlugin } from "./LinksPlugin.js";
4
4
  export async function loadParticlesLinksInteraction(engine) {
5
- engine.checkVersion("4.5.0");
5
+ engine.checkVersion("4.5.2");
6
6
  await engine.pluginManager.register((e) => {
7
7
  const pluginManager = e.pluginManager;
8
8
  ensureInteractivityPluginLoaded(e);
package/esm/index.lazy.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export async function loadParticlesLinksInteraction(engine) {
2
- engine.checkVersion("4.5.0");
2
+ engine.checkVersion("4.5.2");
3
3
  await engine.pluginManager.register(async (e) => {
4
4
  const pluginManager = e.pluginManager, [{ ensureInteractivityPluginLoaded }, { LinksPlugin },] = await Promise.all([
5
5
  import("@tsparticles/plugin-interactivity/lazy"),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tsparticles/interaction-particles-links",
3
- "version": "4.5.0",
3
+ "version": "4.5.2",
4
4
  "description": "tsParticles links particles interaction",
5
5
  "homepage": "https://particles.js.org",
6
6
  "repository": {
@@ -97,10 +97,10 @@
97
97
  },
98
98
  "type": "module",
99
99
  "peerDependencies": {
100
- "@tsparticles/engine": "4.5.0",
101
- "@tsparticles/plugin-interactivity": "4.5.0"
100
+ "@tsparticles/engine": "4.5.2",
101
+ "@tsparticles/plugin-interactivity": "4.5.2"
102
102
  },
103
103
  "dependencies": {
104
- "@tsparticles/canvas-utils": "4.5.0"
104
+ "@tsparticles/canvas-utils": "4.5.2"
105
105
  }
106
106
  }
package/report.html CHANGED
@@ -5285,7 +5285,7 @@ var drawChart = (function (exports) {
5285
5285
  </script>
5286
5286
  <script>
5287
5287
  /*<!--*/
5288
- const data = {"version":2,"tree":{"name":"root","children":[{"name":"tsparticles.interaction.particles.links.js","children":[{"name":"dist/browser","children":[{"uid":"13273d74-1","name":"CircleWarp.js"},{"name":"Options/Classes","children":[{"uid":"13273d74-3","name":"LinksShadow.js"},{"uid":"13273d74-5","name":"LinksTriangle.js"},{"uid":"13273d74-7","name":"Links.js"}]},{"uid":"13273d74-9","name":"Linker.js"},{"uid":"13273d74-11","name":"LinksPlugin.js"},{"uid":"13273d74-13","name":"index.js"},{"uid":"13273d74-15","name":"browser.js"},{"uid":"13273d74-17","name":"Utils.js"},{"uid":"13273d74-19","name":"LinkInstance.js"}]}]}],"isRoot":true},"nodeParts":{"13273d74-1":{"renderedLength":2053,"gzipLength":0,"brotliLength":0,"metaUid":"13273d74-0"},"13273d74-3":{"renderedLength":492,"gzipLength":0,"brotliLength":0,"metaUid":"13273d74-2"},"13273d74-5":{"renderedLength":551,"gzipLength":0,"brotliLength":0,"metaUid":"13273d74-4"},"13273d74-7":{"renderedLength":1242,"gzipLength":0,"brotliLength":0,"metaUid":"13273d74-6"},"13273d74-9":{"renderedLength":4810,"gzipLength":0,"brotliLength":0,"metaUid":"13273d74-8"},"13273d74-11":{"renderedLength":487,"gzipLength":0,"brotliLength":0,"metaUid":"13273d74-10"},"13273d74-13":{"renderedLength":524,"gzipLength":0,"brotliLength":0,"metaUid":"13273d74-12"},"13273d74-15":{"renderedLength":201,"gzipLength":0,"brotliLength":0,"metaUid":"13273d74-14"},"13273d74-17":{"renderedLength":390,"gzipLength":0,"brotliLength":0,"metaUid":"13273d74-16"},"13273d74-19":{"renderedLength":7779,"gzipLength":0,"brotliLength":0,"metaUid":"13273d74-18"}},"nodeMetas":{"13273d74-0":{"id":"/dist/browser/CircleWarp.js","moduleParts":{"tsparticles.interaction.particles.links.js":"13273d74-1"},"imported":[{"uid":"13273d74-21"}],"importedBy":[{"uid":"13273d74-8"}]},"13273d74-2":{"id":"/dist/browser/Options/Classes/LinksShadow.js","moduleParts":{"tsparticles.interaction.particles.links.js":"13273d74-3"},"imported":[{"uid":"13273d74-21"}],"importedBy":[{"uid":"13273d74-12"},{"uid":"13273d74-6"}]},"13273d74-4":{"id":"/dist/browser/Options/Classes/LinksTriangle.js","moduleParts":{"tsparticles.interaction.particles.links.js":"13273d74-5"},"imported":[{"uid":"13273d74-21"}],"importedBy":[{"uid":"13273d74-12"},{"uid":"13273d74-6"}]},"13273d74-6":{"id":"/dist/browser/Options/Classes/Links.js","moduleParts":{"tsparticles.interaction.particles.links.js":"13273d74-7"},"imported":[{"uid":"13273d74-21"},{"uid":"13273d74-2"},{"uid":"13273d74-4"}],"importedBy":[{"uid":"13273d74-12"},{"uid":"13273d74-8"}]},"13273d74-8":{"id":"/dist/browser/Linker.js","moduleParts":{"tsparticles.interaction.particles.links.js":"13273d74-9"},"imported":[{"uid":"13273d74-21"},{"uid":"13273d74-0"},{"uid":"13273d74-6"},{"uid":"13273d74-20"}],"importedBy":[{"uid":"13273d74-12"}]},"13273d74-10":{"id":"/dist/browser/LinksPlugin.js","moduleParts":{"tsparticles.interaction.particles.links.js":"13273d74-11"},"imported":[{"uid":"13273d74-18","dynamic":true}],"importedBy":[{"uid":"13273d74-12"}]},"13273d74-12":{"id":"/dist/browser/index.js","moduleParts":{"tsparticles.interaction.particles.links.js":"13273d74-13"},"imported":[{"uid":"13273d74-20"},{"uid":"13273d74-8"},{"uid":"13273d74-10"},{"uid":"13273d74-6"},{"uid":"13273d74-2"},{"uid":"13273d74-4"}],"importedBy":[{"uid":"13273d74-14"}]},"13273d74-14":{"id":"/dist/browser/browser.js","moduleParts":{"tsparticles.interaction.particles.links.js":"13273d74-15"},"imported":[{"uid":"13273d74-12"}],"importedBy":[],"isEntry":true},"13273d74-16":{"id":"/dist/browser/Utils.js","moduleParts":{"tsparticles.interaction.particles.links.js":"13273d74-17"},"imported":[{"uid":"13273d74-21"}],"importedBy":[{"uid":"13273d74-18"}]},"13273d74-18":{"id":"/dist/browser/LinkInstance.js","moduleParts":{"tsparticles.interaction.particles.links.js":"13273d74-19"},"imported":[{"uid":"13273d74-21"},{"uid":"13273d74-16"}],"importedBy":[{"uid":"13273d74-10"}]},"13273d74-20":{"id":"@tsparticles/plugin-interactivity","moduleParts":{},"imported":[],"importedBy":[{"uid":"13273d74-12"},{"uid":"13273d74-8"}],"isExternal":true},"13273d74-21":{"id":"@tsparticles/engine","moduleParts":{},"imported":[],"importedBy":[{"uid":"13273d74-8"},{"uid":"13273d74-6"},{"uid":"13273d74-2"},{"uid":"13273d74-4"},{"uid":"13273d74-0"},{"uid":"13273d74-18"},{"uid":"13273d74-16"}],"isExternal":true}},"env":{"rollup":"4.63.1"},"options":{"gzip":false,"brotli":false,"sourcemap":false}};
5288
+ const data = {"version":2,"tree":{"name":"root","children":[{"name":"tsparticles.interaction.particles.links.js","children":[{"name":"dist/browser","children":[{"uid":"fdc5c6f8-1","name":"CircleWarp.js"},{"name":"Options/Classes","children":[{"uid":"fdc5c6f8-3","name":"LinksShadow.js"},{"uid":"fdc5c6f8-5","name":"LinksTriangle.js"},{"uid":"fdc5c6f8-7","name":"Links.js"}]},{"uid":"fdc5c6f8-9","name":"Linker.js"},{"uid":"fdc5c6f8-11","name":"LinksPlugin.js"},{"uid":"fdc5c6f8-13","name":"index.js"},{"uid":"fdc5c6f8-15","name":"browser.js"},{"uid":"fdc5c6f8-17","name":"Utils.js"},{"uid":"fdc5c6f8-19","name":"LinkInstance.js"}]}]}],"isRoot":true},"nodeParts":{"fdc5c6f8-1":{"renderedLength":3331,"gzipLength":0,"brotliLength":0,"metaUid":"fdc5c6f8-0"},"fdc5c6f8-3":{"renderedLength":492,"gzipLength":0,"brotliLength":0,"metaUid":"fdc5c6f8-2"},"fdc5c6f8-5":{"renderedLength":551,"gzipLength":0,"brotliLength":0,"metaUid":"fdc5c6f8-4"},"fdc5c6f8-7":{"renderedLength":1242,"gzipLength":0,"brotliLength":0,"metaUid":"fdc5c6f8-6"},"fdc5c6f8-9":{"renderedLength":4838,"gzipLength":0,"brotliLength":0,"metaUid":"fdc5c6f8-8"},"fdc5c6f8-11":{"renderedLength":487,"gzipLength":0,"brotliLength":0,"metaUid":"fdc5c6f8-10"},"fdc5c6f8-13":{"renderedLength":524,"gzipLength":0,"brotliLength":0,"metaUid":"fdc5c6f8-12"},"fdc5c6f8-15":{"renderedLength":201,"gzipLength":0,"brotliLength":0,"metaUid":"fdc5c6f8-14"},"fdc5c6f8-17":{"renderedLength":390,"gzipLength":0,"brotliLength":0,"metaUid":"fdc5c6f8-16"},"fdc5c6f8-19":{"renderedLength":7779,"gzipLength":0,"brotliLength":0,"metaUid":"fdc5c6f8-18"}},"nodeMetas":{"fdc5c6f8-0":{"id":"/dist/browser/CircleWarp.js","moduleParts":{"tsparticles.interaction.particles.links.js":"fdc5c6f8-1"},"imported":[{"uid":"fdc5c6f8-21"}],"importedBy":[{"uid":"fdc5c6f8-8"}]},"fdc5c6f8-2":{"id":"/dist/browser/Options/Classes/LinksShadow.js","moduleParts":{"tsparticles.interaction.particles.links.js":"fdc5c6f8-3"},"imported":[{"uid":"fdc5c6f8-21"}],"importedBy":[{"uid":"fdc5c6f8-12"},{"uid":"fdc5c6f8-6"}]},"fdc5c6f8-4":{"id":"/dist/browser/Options/Classes/LinksTriangle.js","moduleParts":{"tsparticles.interaction.particles.links.js":"fdc5c6f8-5"},"imported":[{"uid":"fdc5c6f8-21"}],"importedBy":[{"uid":"fdc5c6f8-12"},{"uid":"fdc5c6f8-6"}]},"fdc5c6f8-6":{"id":"/dist/browser/Options/Classes/Links.js","moduleParts":{"tsparticles.interaction.particles.links.js":"fdc5c6f8-7"},"imported":[{"uid":"fdc5c6f8-21"},{"uid":"fdc5c6f8-2"},{"uid":"fdc5c6f8-4"}],"importedBy":[{"uid":"fdc5c6f8-12"},{"uid":"fdc5c6f8-8"}]},"fdc5c6f8-8":{"id":"/dist/browser/Linker.js","moduleParts":{"tsparticles.interaction.particles.links.js":"fdc5c6f8-9"},"imported":[{"uid":"fdc5c6f8-21"},{"uid":"fdc5c6f8-0"},{"uid":"fdc5c6f8-6"},{"uid":"fdc5c6f8-20"}],"importedBy":[{"uid":"fdc5c6f8-12"}]},"fdc5c6f8-10":{"id":"/dist/browser/LinksPlugin.js","moduleParts":{"tsparticles.interaction.particles.links.js":"fdc5c6f8-11"},"imported":[{"uid":"fdc5c6f8-18","dynamic":true}],"importedBy":[{"uid":"fdc5c6f8-12"}]},"fdc5c6f8-12":{"id":"/dist/browser/index.js","moduleParts":{"tsparticles.interaction.particles.links.js":"fdc5c6f8-13"},"imported":[{"uid":"fdc5c6f8-20"},{"uid":"fdc5c6f8-8"},{"uid":"fdc5c6f8-10"},{"uid":"fdc5c6f8-6"},{"uid":"fdc5c6f8-2"},{"uid":"fdc5c6f8-4"}],"importedBy":[{"uid":"fdc5c6f8-14"}]},"fdc5c6f8-14":{"id":"/dist/browser/browser.js","moduleParts":{"tsparticles.interaction.particles.links.js":"fdc5c6f8-15"},"imported":[{"uid":"fdc5c6f8-12"}],"importedBy":[],"isEntry":true},"fdc5c6f8-16":{"id":"/dist/browser/Utils.js","moduleParts":{"tsparticles.interaction.particles.links.js":"fdc5c6f8-17"},"imported":[{"uid":"fdc5c6f8-21"}],"importedBy":[{"uid":"fdc5c6f8-18"}]},"fdc5c6f8-18":{"id":"/dist/browser/LinkInstance.js","moduleParts":{"tsparticles.interaction.particles.links.js":"fdc5c6f8-19"},"imported":[{"uid":"fdc5c6f8-21"},{"uid":"fdc5c6f8-16"}],"importedBy":[{"uid":"fdc5c6f8-10"}]},"fdc5c6f8-20":{"id":"@tsparticles/plugin-interactivity","moduleParts":{},"imported":[],"importedBy":[{"uid":"fdc5c6f8-12"},{"uid":"fdc5c6f8-8"}],"isExternal":true},"fdc5c6f8-21":{"id":"@tsparticles/engine","moduleParts":{},"imported":[],"importedBy":[{"uid":"fdc5c6f8-8"},{"uid":"fdc5c6f8-6"},{"uid":"fdc5c6f8-2"},{"uid":"fdc5c6f8-4"},{"uid":"fdc5c6f8-0"},{"uid":"fdc5c6f8-18"},{"uid":"fdc5c6f8-16"}],"isExternal":true}},"env":{"rollup":"4.67.4"},"options":{"gzip":false,"brotli":false,"sourcemap":false}};
5289
5289
 
5290
5290
  const run = () => {
5291
5291
  const width = window.innerWidth;
@@ -1,6 +1,6 @@
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);})(typeof globalThis!=="undefined"?globalThis:typeof window!=="undefined"?window:this);
2
2
  (function (g) {
3
- /* Particles Interaction v4.5.0 */
3
+ /* Particles Interaction v4.5.2 */
4
4
  g.__tsParticlesInternals = g.__tsParticlesInternals || {};
5
5
  g.__tsParticlesInternals.interactions = g.__tsParticlesInternals.interactions || {};
6
6
  (function (exports, pluginInteractivity, engine) {
@@ -13,8 +13,9 @@ g.__tsParticlesInternals.interactions = g.__tsParticlesInternals.interactions ||
13
13
  this.#canvasSize = canvasSize;
14
14
  }
15
15
  contains(point) {
16
- if (super.contains(point))
16
+ if (super.contains(point)) {
17
17
  return true;
18
+ }
18
19
  const { width, height } = this.#canvasSize, { x, y } = point;
19
20
  return (super.contains({ x: x - width, y }) ||
20
21
  super.contains({ x: x + width, y }) ||
@@ -26,8 +27,9 @@ g.__tsParticlesInternals.interactions = g.__tsParticlesInternals.interactions ||
26
27
  super.contains({ x: x + width, y: y - height }));
27
28
  }
28
29
  intersects(range) {
29
- if (super.intersects(range))
30
+ if (super.intersects(range)) {
30
31
  return true;
32
+ }
31
33
  const { width, height } = this.#canvasSize, pos = range.position, shifts = [
32
34
  { x: -width, y: 0 },
33
35
  { x: width, y: 0 },
@@ -48,11 +50,40 @@ g.__tsParticlesInternals.interactions = g.__tsParticlesInternals.interactions ||
48
50
  const rect = range;
49
51
  shiftedRange = new engine.Rectangle(shiftedPos.x, shiftedPos.y, rect.size.width, rect.size.height);
50
52
  }
51
- if (super.intersects(shiftedRange))
53
+ if (super.intersects(shiftedRange)) {
52
54
  return true;
55
+ }
53
56
  }
54
57
  return false;
55
58
  }
59
+ query(grid) {
60
+ const { x, y } = this.position, { width, height } = this.#canvasSize, radius = this.radius, crossesLeft = x - radius <= engine.originPoint.x, crossesRight = x + radius >= width, crossesTop = y - radius <= engine.originPoint.y, crossesBottom = y + radius >= height;
61
+ if (!crossesLeft && !crossesRight && !crossesTop && !crossesBottom) {
62
+ return grid.query(this);
63
+ }
64
+ const xShifts = [engine.originPoint.x], yShifts = [engine.originPoint.y];
65
+ if (crossesLeft) {
66
+ xShifts.push(width);
67
+ }
68
+ if (crossesRight) {
69
+ xShifts.push(-width);
70
+ }
71
+ if (crossesTop) {
72
+ yShifts.push(height);
73
+ }
74
+ if (crossesBottom) {
75
+ yShifts.push(-height);
76
+ }
77
+ const particles = new Set();
78
+ for (const dx of xShifts) {
79
+ for (const dy of yShifts) {
80
+ for (const particle of grid.queryCircle({ x: x + dx, y: y + dy }, radius)) {
81
+ particles.add(particle);
82
+ }
83
+ }
84
+ }
85
+ return [...particles];
86
+ }
56
87
  }
57
88
 
58
89
  class LinksShadow {
@@ -162,7 +193,9 @@ g.__tsParticlesInternals.interactions = g.__tsParticlesInternals.interactions ||
162
193
  if (pos1.x < engine.originPoint.x || pos1.y < engine.originPoint.y || pos1.x > canvasSize.width || pos1.y > canvasSize.height) {
163
194
  return;
164
195
  }
165
- const linkOpt1 = p1.options.links, optOpacity = linkOpt1.opacity, optDistance = p1.retina.linksDistance ?? minDistance$1, warp = linkOpt1.warp, range = warp ? new CircleWarp(pos1.x, pos1.y, optDistance, canvasSize) : new engine.Circle(pos1.x, pos1.y, optDistance), query = container.particles.grid.query(range);
196
+ const linkOpt1 = p1.options.links, optOpacity = linkOpt1.opacity, optDistance = p1.retina.linksDistance ?? minDistance$1, warp = linkOpt1.warp, query = (warp
197
+ ? new CircleWarp(pos1.x, pos1.y, optDistance, canvasSize).query(container.particles.grid)
198
+ : container.particles.grid.queryCircle(pos1, optDistance));
166
199
  for (const p2 of query) {
167
200
  const linkOpt2 = p2.options.links;
168
201
  if (p1 === p2 ||
@@ -250,7 +283,7 @@ g.__tsParticlesInternals.interactions = g.__tsParticlesInternals.interactions ||
250
283
  }
251
284
 
252
285
  async function loadParticlesLinksInteraction(engine) {
253
- engine.checkVersion("4.5.0");
286
+ engine.checkVersion("4.5.2");
254
287
  await engine.pluginManager.register((e) => {
255
288
  const pluginManager = e.pluginManager;
256
289
  pluginInteractivity.ensureInteractivityPluginLoaded(e);
@@ -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 s="undefined"!=typeof Proxy?function(t){return new Proxy(t,{get:function(t,s){return s in t||(t[s]={}),t[s]}})}:function(t){return t};t.__tsParticlesInternals.bundles=s(t.__tsParticlesInternals.bundles),t.__tsParticlesInternals.effects=s(t.__tsParticlesInternals.effects),t.__tsParticlesInternals.interactions=s(t.__tsParticlesInternals.interactions),t.__tsParticlesInternals.palettes=s(t.__tsParticlesInternals.palettes),t.__tsParticlesInternals.paths=s(t.__tsParticlesInternals.paths),t.__tsParticlesInternals.plugins=s(t.__tsParticlesInternals.plugins),t.__tsParticlesInternals.plugins.emittersShapes=s(t.__tsParticlesInternals.plugins.emittersShapes),t.__tsParticlesInternals.presets=s(t.__tsParticlesInternals.presets),t.__tsParticlesInternals.shapes=s(t.__tsParticlesInternals.shapes),t.__tsParticlesInternals.updaters=s(t.__tsParticlesInternals.updaters),t.__tsParticlesInternals.utils=s(t.__tsParticlesInternals.utils),t.__tsParticlesInternals.canvas=s(t.__tsParticlesInternals.canvas),t.__tsParticlesInternals.path=s(t.__tsParticlesInternals.path)}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:this),function(t){t.__tsParticlesInternals=t.__tsParticlesInternals||{},t.__tsParticlesInternals.interactions=t.__tsParticlesInternals.interactions||{},function(t,s,n){"use strict";class e extends n.Circle{#t;constructor(t,s,n,e){super(t,s,n),this.#t=e}contains(t){if(super.contains(t))return!0;const{width:s,height:n}=this.#t,{x:e,y:i}=t;return super.contains({x:e-s,y:i})||super.contains({x:e+s,y:i})||super.contains({x:e,y:i-n})||super.contains({x:e,y:i+n})||super.contains({x:e-s,y:i-n})||super.contains({x:e+s,y:i+n})||super.contains({x:e-s,y:i+n})||super.contains({x:e+s,y:i-n})}intersects(t){if(super.intersects(t))return!0;const{width:s,height:e}=this.#t,i=t.position,a=[{x:-s,y:0},{x:s,y:0},{x:0,y:-e},{x:0,y:e},{x:-s,y:-e},{x:s,y:e},{x:-s,y:e},{x:s,y:-e}];for(const s of a){const e={x:i.x+s.x,y:i.y+s.y};let a;if(t instanceof n.Circle)a=new n.Circle(e.x,e.y,t.radius);else{const s=t;a=new n.Rectangle(e.x,e.y,s.size.width,s.size.height)}if(super.intersects(a))return!0}return!1}}class i{blur=5;color=new n.OptionsColor;enable=!1;constructor(){this.color.value="#000"}load(t){n.isNull(t)||(n.loadProperty(this,"blur",t.blur),this.color=n.OptionsColor.create(this.color,t.color),n.loadProperty(this,"enable",t.enable))}}class a{color;enable=!1;frequency=1;opacity;load(t){n.isNull(t)||(void 0!==t.color&&(this.color=n.OptionsColor.create(this.color,t.color)),n.loadProperty(this,"enable",t.enable),n.loadProperty(this,"frequency",t.frequency),n.loadProperty(this,"opacity",t.opacity))}}class r{blink=!1;color=new n.OptionsColor;consent=!1;distance=100;enable=!1;frequency=1;id;opacity=1;shadow=new i;triangles=new a;warp=!1;width=1;constructor(){this.color.value="#fff"}load(t){n.isNull(t)||(n.loadProperty(this,"id",t.id),n.loadProperty(this,"blink",t.blink),this.color=n.OptionsColor.create(this.color,t.color),n.loadProperty(this,"consent",t.consent),n.loadProperty(this,"distance",t.distance),n.loadProperty(this,"enable",t.enable),n.loadProperty(this,"frequency",t.frequency),n.loadProperty(this,"opacity",t.opacity),this.shadow.load(t.shadow),this.triangles.load(t.triangles),n.loadProperty(this,"width",t.width),n.loadProperty(this,"warp",t.warp))}}function l(t,s,e){const{dx:i,dy:a}=n.getDistances(t,s),r={x:Math.abs(i),y:Math.abs(a)},l={x:Math.min(r.x,e.width-r.x),y:Math.min(r.y,e.height-r.y)};return Math.hypot(l.x,l.y)}class o extends s.ParticlesInteractorBase{#s;#n;constructor(t,s){super(s),this.#n=t,this.#s=0}get maxDistance(){return this.#s}clear(){}init(){this.container.particles.linksColor=void 0,this.container.particles.linksColors=new Map}interact(t){if(!t.options.links)return;t.links=[],t.linksDistance&&t.linksDistance>this.#s&&(this.#s=t.linksDistance);const s=t.getPosition(),i=this.container,a=i.canvas.size;if(s.x<n.originPoint.x||s.y<n.originPoint.y||s.x>a.width||s.y>a.height)return;const r=t.options.links,o=r.opacity,c=t.retina.linksDistance??0,h=r.warp,p=h?new e(s.x,s.y,c,a):new n.Circle(s.x,s.y,c),_=i.particles.grid.query(p);for(const e of _){const i=e.options.links;if(t===e||!i?.enable||r.id!==i.id||e.spawning||e.destroyed||!e.links||t.links.some(t=>t.destination===e)||e.links.some(s=>s.destination===t))continue;const p=e.getPosition();if(p.x<n.originPoint.x||p.y<n.originPoint.y||p.x>a.width||p.y>a.height)continue;const _=n.getDistances(s,p).distance,d=h&&i.warp?l(s,p,a):_,u=Math.min(_,d);if(u>c)continue;const g=(1-u/c)*o;this.#e(t),t.links.push({destination:e,opacity:g,color:this.#i(t,e),isWarped:d<_})}}isEnabled(t){return!!t.options.links?.enable}loadParticlesOptions(t,...s){n.loadOptionProperty(t,"links",r,...s)}reset(){}#i(t,s){const e=this.container,i=t.options.links;if(!i)return;const a=void 0!==i.id?e.particles.linksColors.get(i.id):e.particles.linksColor;return n.getLinkColor(t,s,a,e.hdr)}#e(t){if(!t.options.links)return;const s=this.container,e=t.options.links;let i=void 0===e.id?s.particles.linksColor:s.particles.linksColors.get(e.id);i||(i=n.getLinkRandomColor(this.#n,e.color,e.blink,e.consent),void 0===e.id?s.particles.linksColor=i:s.particles.linksColors.set(e.id,i))}}class c{id="links";#n;constructor(t){this.#n=t}async getPlugin(t){const{LinkInstance:s}=await Promise.resolve().then(function(){return d});return new s(this.#n,t)}loadOptions(){}needsPlugin(){return!0}}async function h(t){t.checkVersion("4.5.0"),await t.pluginManager.register(t=>{const n=t.pluginManager;s.ensureInteractivityPluginLoaded(t),n.addPlugin(new c(n)),n.addInteractor?.("particlesLinks",t=>Promise.resolve(new o(n,t)))})}const p=globalThis;function _(t,s){const e=(i=t.map(t=>t.id),[...i].sort((t,s)=>t-s).join("_"));var i;let a=s.get(e);return void 0===a&&(a=n.getRandom(),s.set(e,a)),a}p.__tsParticlesInternals=p.__tsParticlesInternals??{},p.loadParticlesLinksInteraction=h;var d=Object.freeze({__proto__:null,LinkInstance:class{#a=new Map;#r;#l;#n;constructor(t,s){this.#n=t,this.#r=s,this.#l={links:new Map,triangles:new Map}}drawParticle(t,s){const{links:e,options:i}=s;if(!e?.length||!i.links)return;const a=i.links,r=s.retina.linksWidth??0,l=s.getPosition(),o=s.options.twinkle?.links,c=a.triangles.enable,h=c?new Set(e.map(t=>t.destination.id)):null,p=t.globalAlpha;let _="",d=-1,u=-1,g=!1;const P=()=>{g&&(t.stroke(),g=!1)};for(const p of e){if(a.frequency<1&&this.#o(s,p.destination)>a.frequency)continue;const e=p.destination.getPosition();if(c&&!p.isWarped&&h&&(P(),this.#c(i,s,p,h,l,e,t)),p.opacity<=0||r<=0)continue;if(!a.enable)continue;let y=p.opacity,f=p.color;const I=o?.enable&&n.getRandom()<o.frequency?n.rangeColorToRgb(this.#n,o.color):void 0;if(o&&I&&(f=I,y=n.getRangeValue(o.opacity)),!f){const t=void 0!==a.id?this.#r.particles.linksColors.get(a.id):this.#r.particles.linksColor;f=n.getLinkColor(s,p.destination,t)}if(!f)continue;const k=this.#h(f);if(k===_&&r===d&&y===u||(P(),t.strokeStyle=k,t.lineWidth=r,t.globalAlpha=y,_=k,d=r,u=y,t.beginPath(),g=!0),p.isWarped){const s=this.#r.canvas.size,i=e.x-l.x,a=e.y-l.y;let r=n.originPoint.x,o=n.originPoint.y;Math.abs(i)>s.width*n.half&&(r=i>0?-s.width:s.width),Math.abs(a)>s.height*n.half&&(o=a>0?-s.height:s.height),t.moveTo(l.x,l.y),t.lineTo(e.x+r,e.y+o),t.moveTo(l.x-r,l.y-o),t.lineTo(e.x,e.y)}else t.moveTo(l.x,l.y),t.lineTo(e.x,e.y)}P(),t.globalAlpha=p}init(){return this.#l.links.clear(),this.#l.triangles.clear(),this.#a.clear(),Promise.resolve()}particleCreated(t){if(t.links=[],!t.options.links)return;t.linksDistance=t.options.links.distance,t.linksWidth=t.options.links.width;const s=this.#r.retina.pixelRatio;t.retina.linksDistance=t.linksDistance*s,t.retina.linksWidth=t.linksWidth*s}particleDestroyed(t){t.links=[]}#c(t,s,e,i,a,r,l){const o=e.destination,c=t.links?.triangles;if(!c?.enable||!o.options.links?.triangles.enable)return;const h=o.links;if(h?.length)for(const p of h){if(p.isWarped||this.#o(o,p.destination)>o.options.links.frequency||!i.has(p.destination.id))continue;const h=p.destination;if(this.#p(s,o,h)>(t.links?.triangles.frequency??0))continue;const _=c.opacity??(e.opacity+p.opacity)*n.half,d=n.rangeColorToRgb(this.#n,c.color)??e.color;if(!d||_<=0)continue;const u=h.getPosition();l.save(),l.fillStyle=this.#h(d),l.globalAlpha=_,l.beginPath(),l.moveTo(a.x,a.y),l.lineTo(r.x,r.y),l.lineTo(u.x,u.y),l.closePath(),l.fill(),l.restore()}}#h(t){const s=`${t.r},${t.g},${t.b}-${this.#r.hdr}-${this.#r.peakNits}-${this.#r.hdrMode}`;let e=this.#a.get(s);return e||(e=n.getStyleFromRgb(t,this.#r.hdr,void 0,this.#r.peakNits,this.#r.hdrMode),this.#a.set(s,e)),e}#o(t,s){return _([t,s],this.#l.links)}#p(t,s,n){return _([t,s,n],this.#l.triangles)}}});t.Links=r,t.LinksShadow=i,t.LinksTriangle=a,t.loadParticlesLinksInteraction=h}(t.__tsParticlesInternals.interactions.particlesLinks=t.__tsParticlesInternals.interactions.particlesLinks||{},t.__tsParticlesInternals.plugins.interactivity,t.__tsParticlesInternals.engine)}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:self),Object.assign(globalThis.window||globalThis,{loadParticlesLinksInteraction:(globalThis.__tsParticlesInternals.interactions.particlesLinks||{}).loadParticlesLinksInteraction});
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 s="undefined"!=typeof Proxy?function(t){return new Proxy(t,{get:function(t,s){return s in t||(t[s]={}),t[s]}})}:function(t){return t};t.__tsParticlesInternals.bundles=s(t.__tsParticlesInternals.bundles),t.__tsParticlesInternals.effects=s(t.__tsParticlesInternals.effects),t.__tsParticlesInternals.interactions=s(t.__tsParticlesInternals.interactions),t.__tsParticlesInternals.palettes=s(t.__tsParticlesInternals.palettes),t.__tsParticlesInternals.paths=s(t.__tsParticlesInternals.paths),t.__tsParticlesInternals.plugins=s(t.__tsParticlesInternals.plugins),t.__tsParticlesInternals.plugins.emittersShapes=s(t.__tsParticlesInternals.plugins.emittersShapes),t.__tsParticlesInternals.presets=s(t.__tsParticlesInternals.presets),t.__tsParticlesInternals.shapes=s(t.__tsParticlesInternals.shapes),t.__tsParticlesInternals.updaters=s(t.__tsParticlesInternals.updaters),t.__tsParticlesInternals.utils=s(t.__tsParticlesInternals.utils),t.__tsParticlesInternals.canvas=s(t.__tsParticlesInternals.canvas),t.__tsParticlesInternals.path=s(t.__tsParticlesInternals.path)}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:this),function(t){t.__tsParticlesInternals=t.__tsParticlesInternals||{},t.__tsParticlesInternals.interactions=t.__tsParticlesInternals.interactions||{},function(t,s,n){"use strict";class e extends n.Circle{#t;constructor(t,s,n,e){super(t,s,n),this.#t=e}contains(t){if(super.contains(t))return!0;const{width:s,height:n}=this.#t,{x:e,y:i}=t;return super.contains({x:e-s,y:i})||super.contains({x:e+s,y:i})||super.contains({x:e,y:i-n})||super.contains({x:e,y:i+n})||super.contains({x:e-s,y:i-n})||super.contains({x:e+s,y:i+n})||super.contains({x:e-s,y:i+n})||super.contains({x:e+s,y:i-n})}intersects(t){if(super.intersects(t))return!0;const{width:s,height:e}=this.#t,i=t.position,r=[{x:-s,y:0},{x:s,y:0},{x:0,y:-e},{x:0,y:e},{x:-s,y:-e},{x:s,y:e},{x:-s,y:e},{x:s,y:-e}];for(const s of r){const e={x:i.x+s.x,y:i.y+s.y};let r;if(t instanceof n.Circle)r=new n.Circle(e.x,e.y,t.radius);else{const s=t;r=new n.Rectangle(e.x,e.y,s.size.width,s.size.height)}if(super.intersects(r))return!0}return!1}query(t){const{x:s,y:e}=this.position,{width:i,height:r}=this.#t,a=this.radius,l=s-a<=n.originPoint.x,o=s+a>=i,c=e-a<=n.originPoint.y,h=e+a>=r;if(!(l||o||c||h))return t.query(this);const p=[n.originPoint.x],_=[n.originPoint.y];l&&p.push(i),o&&p.push(-i),c&&_.push(r),h&&_.push(-r);const u=new Set;for(const n of p)for(const i of _)for(const r of t.queryCircle({x:s+n,y:e+i},a))u.add(r);return[...u]}}class i{blur=5;color=new n.OptionsColor;enable=!1;constructor(){this.color.value="#000"}load(t){n.isNull(t)||(n.loadProperty(this,"blur",t.blur),this.color=n.OptionsColor.create(this.color,t.color),n.loadProperty(this,"enable",t.enable))}}class r{color;enable=!1;frequency=1;opacity;load(t){n.isNull(t)||(void 0!==t.color&&(this.color=n.OptionsColor.create(this.color,t.color)),n.loadProperty(this,"enable",t.enable),n.loadProperty(this,"frequency",t.frequency),n.loadProperty(this,"opacity",t.opacity))}}class a{blink=!1;color=new n.OptionsColor;consent=!1;distance=100;enable=!1;frequency=1;id;opacity=1;shadow=new i;triangles=new r;warp=!1;width=1;constructor(){this.color.value="#fff"}load(t){n.isNull(t)||(n.loadProperty(this,"id",t.id),n.loadProperty(this,"blink",t.blink),this.color=n.OptionsColor.create(this.color,t.color),n.loadProperty(this,"consent",t.consent),n.loadProperty(this,"distance",t.distance),n.loadProperty(this,"enable",t.enable),n.loadProperty(this,"frequency",t.frequency),n.loadProperty(this,"opacity",t.opacity),this.shadow.load(t.shadow),this.triangles.load(t.triangles),n.loadProperty(this,"width",t.width),n.loadProperty(this,"warp",t.warp))}}function l(t,s,e){const{dx:i,dy:r}=n.getDistances(t,s),a={x:Math.abs(i),y:Math.abs(r)},l={x:Math.min(a.x,e.width-a.x),y:Math.min(a.y,e.height-a.y)};return Math.hypot(l.x,l.y)}class o extends s.ParticlesInteractorBase{#s;#n;constructor(t,s){super(s),this.#n=t,this.#s=0}get maxDistance(){return this.#s}clear(){}init(){this.container.particles.linksColor=void 0,this.container.particles.linksColors=new Map}interact(t){if(!t.options.links)return;t.links=[],t.linksDistance&&t.linksDistance>this.#s&&(this.#s=t.linksDistance);const s=t.getPosition(),i=this.container,r=i.canvas.size;if(s.x<n.originPoint.x||s.y<n.originPoint.y||s.x>r.width||s.y>r.height)return;const a=t.options.links,o=a.opacity,c=t.retina.linksDistance??0,h=a.warp,p=h?new e(s.x,s.y,c,r).query(i.particles.grid):i.particles.grid.queryCircle(s,c);for(const e of p){const i=e.options.links;if(t===e||!i?.enable||a.id!==i.id||e.spawning||e.destroyed||!e.links||t.links.some(t=>t.destination===e)||e.links.some(s=>s.destination===t))continue;const p=e.getPosition();if(p.x<n.originPoint.x||p.y<n.originPoint.y||p.x>r.width||p.y>r.height)continue;const _=n.getDistances(s,p).distance,u=h&&i.warp?l(s,p,r):_,d=Math.min(_,u);if(d>c)continue;const g=(1-d/c)*o;this.#e(t),t.links.push({destination:e,opacity:g,color:this.#i(t,e),isWarped:u<_})}}isEnabled(t){return!!t.options.links?.enable}loadParticlesOptions(t,...s){n.loadOptionProperty(t,"links",a,...s)}reset(){}#i(t,s){const e=this.container,i=t.options.links;if(!i)return;const r=void 0!==i.id?e.particles.linksColors.get(i.id):e.particles.linksColor;return n.getLinkColor(t,s,r,e.hdr)}#e(t){if(!t.options.links)return;const s=this.container,e=t.options.links;let i=void 0===e.id?s.particles.linksColor:s.particles.linksColors.get(e.id);i||(i=n.getLinkRandomColor(this.#n,e.color,e.blink,e.consent),void 0===e.id?s.particles.linksColor=i:s.particles.linksColors.set(e.id,i))}}class c{id="links";#n;constructor(t){this.#n=t}async getPlugin(t){const{LinkInstance:s}=await Promise.resolve().then(function(){return u});return new s(this.#n,t)}loadOptions(){}needsPlugin(){return!0}}async function h(t){t.checkVersion("4.5.2"),await t.pluginManager.register(t=>{const n=t.pluginManager;s.ensureInteractivityPluginLoaded(t),n.addPlugin(new c(n)),n.addInteractor?.("particlesLinks",t=>Promise.resolve(new o(n,t)))})}const p=globalThis;function _(t,s){const e=(i=t.map(t=>t.id),[...i].sort((t,s)=>t-s).join("_"));var i;let r=s.get(e);return void 0===r&&(r=n.getRandom(),s.set(e,r)),r}p.__tsParticlesInternals=p.__tsParticlesInternals??{},p.loadParticlesLinksInteraction=h;var u=Object.freeze({__proto__:null,LinkInstance:class{#r=new Map;#a;#l;#n;constructor(t,s){this.#n=t,this.#a=s,this.#l={links:new Map,triangles:new Map}}drawParticle(t,s){const{links:e,options:i}=s;if(!e?.length||!i.links)return;const r=i.links,a=s.retina.linksWidth??0,l=s.getPosition(),o=s.options.twinkle?.links,c=r.triangles.enable,h=c?new Set(e.map(t=>t.destination.id)):null,p=t.globalAlpha;let _="",u=-1,d=-1,g=!1;const P=()=>{g&&(t.stroke(),g=!1)};for(const p of e){if(r.frequency<1&&this.#o(s,p.destination)>r.frequency)continue;const e=p.destination.getPosition();if(c&&!p.isWarped&&h&&(P(),this.#c(i,s,p,h,l,e,t)),p.opacity<=0||a<=0)continue;if(!r.enable)continue;let y=p.opacity,f=p.color;const I=o?.enable&&n.getRandom()<o.frequency?n.rangeColorToRgb(this.#n,o.color):void 0;if(o&&I&&(f=I,y=n.getRangeValue(o.opacity)),!f){const t=void 0!==r.id?this.#a.particles.linksColors.get(r.id):this.#a.particles.linksColor;f=n.getLinkColor(s,p.destination,t)}if(!f)continue;const k=this.#h(f);if(k===_&&a===u&&y===d||(P(),t.strokeStyle=k,t.lineWidth=a,t.globalAlpha=y,_=k,u=a,d=y,t.beginPath(),g=!0),p.isWarped){const s=this.#a.canvas.size,i=e.x-l.x,r=e.y-l.y;let a=n.originPoint.x,o=n.originPoint.y;Math.abs(i)>s.width*n.half&&(a=i>0?-s.width:s.width),Math.abs(r)>s.height*n.half&&(o=r>0?-s.height:s.height),t.moveTo(l.x,l.y),t.lineTo(e.x+a,e.y+o),t.moveTo(l.x-a,l.y-o),t.lineTo(e.x,e.y)}else t.moveTo(l.x,l.y),t.lineTo(e.x,e.y)}P(),t.globalAlpha=p}init(){return this.#l.links.clear(),this.#l.triangles.clear(),this.#r.clear(),Promise.resolve()}particleCreated(t){if(t.links=[],!t.options.links)return;t.linksDistance=t.options.links.distance,t.linksWidth=t.options.links.width;const s=this.#a.retina.pixelRatio;t.retina.linksDistance=t.linksDistance*s,t.retina.linksWidth=t.linksWidth*s}particleDestroyed(t){t.links=[]}#c(t,s,e,i,r,a,l){const o=e.destination,c=t.links?.triangles;if(!c?.enable||!o.options.links?.triangles.enable)return;const h=o.links;if(h?.length)for(const p of h){if(p.isWarped||this.#o(o,p.destination)>o.options.links.frequency||!i.has(p.destination.id))continue;const h=p.destination;if(this.#p(s,o,h)>(t.links?.triangles.frequency??0))continue;const _=c.opacity??(e.opacity+p.opacity)*n.half,u=n.rangeColorToRgb(this.#n,c.color)??e.color;if(!u||_<=0)continue;const d=h.getPosition();l.save(),l.fillStyle=this.#h(u),l.globalAlpha=_,l.beginPath(),l.moveTo(r.x,r.y),l.lineTo(a.x,a.y),l.lineTo(d.x,d.y),l.closePath(),l.fill(),l.restore()}}#h(t){const s=`${t.r},${t.g},${t.b}-${this.#a.hdr}-${this.#a.peakNits}-${this.#a.hdrMode}`;let e=this.#r.get(s);return e||(e=n.getStyleFromRgb(t,this.#a.hdr,void 0,this.#a.peakNits,this.#a.hdrMode),this.#r.set(s,e)),e}#o(t,s){return _([t,s],this.#l.links)}#p(t,s,n){return _([t,s,n],this.#l.triangles)}}});t.Links=a,t.LinksShadow=i,t.LinksTriangle=r,t.loadParticlesLinksInteraction=h}(t.__tsParticlesInternals.interactions.particlesLinks=t.__tsParticlesInternals.interactions.particlesLinks||{},t.__tsParticlesInternals.plugins.interactivity,t.__tsParticlesInternals.engine)}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:self),Object.assign(globalThis.window||globalThis,{loadParticlesLinksInteraction:(globalThis.__tsParticlesInternals.interactions.particlesLinks||{}).loadParticlesLinksInteraction});
@@ -1,7 +1,8 @@
1
- import { Circle, type ICoordinates, type IDimension, Rectangle } from "@tsparticles/engine";
1
+ import { Circle, type ICoordinates, type IDimension, type Particle, Rectangle, type SpatialHashGrid } from "@tsparticles/engine";
2
2
  export declare class CircleWarp extends Circle {
3
3
  #private;
4
4
  constructor(x: number, y: number, radius: number, canvasSize: IDimension);
5
5
  contains(point: ICoordinates): boolean;
6
6
  intersects(range: Rectangle | Circle): boolean;
7
+ query(grid: SpatialHashGrid): Particle[];
7
8
  }
@@ -1,4 +1,4 @@
1
- import { type IPlugin, type PluginManager } from "@tsparticles/engine";
1
+ import type { IPlugin, PluginManager } from "@tsparticles/engine";
2
2
  import type { LinkContainer } from "./Types.js";
3
3
  import type { LinkInstance } from "./LinkInstance.js";
4
4
  export declare class LinksPlugin implements IPlugin {