@tsparticles/interaction-external-repulse 4.2.0 → 4.2.1

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.
package/browser/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { ensureInteractivityPluginLoaded } from "@tsparticles/plugin-interactivity";
2
2
  import { Repulser } from "./Repulser.js";
3
3
  export async function loadExternalRepulseInteraction(engine) {
4
- engine.checkVersion("4.2.0");
4
+ engine.checkVersion("4.2.1");
5
5
  await engine.pluginManager.register((e) => {
6
6
  ensureInteractivityPluginLoaded(e);
7
7
  const pluginManager = e.pluginManager;
@@ -1,5 +1,5 @@
1
1
  export async function loadExternalRepulseInteraction(engine) {
2
- engine.checkVersion("4.2.0");
2
+ engine.checkVersion("4.2.1");
3
3
  await engine.pluginManager.register(async (e) => {
4
4
  const { ensureInteractivityPluginLoaded } = await import("@tsparticles/plugin-interactivity/lazy");
5
5
  ensureInteractivityPluginLoaded(e);
package/cjs/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { ensureInteractivityPluginLoaded } from "@tsparticles/plugin-interactivity";
2
2
  import { Repulser } from "./Repulser.js";
3
3
  export async function loadExternalRepulseInteraction(engine) {
4
- engine.checkVersion("4.2.0");
4
+ engine.checkVersion("4.2.1");
5
5
  await engine.pluginManager.register((e) => {
6
6
  ensureInteractivityPluginLoaded(e);
7
7
  const pluginManager = e.pluginManager;
package/cjs/index.lazy.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export async function loadExternalRepulseInteraction(engine) {
2
- engine.checkVersion("4.2.0");
2
+ engine.checkVersion("4.2.1");
3
3
  await engine.pluginManager.register(async (e) => {
4
4
  const { ensureInteractivityPluginLoaded } = await import("@tsparticles/plugin-interactivity/lazy");
5
5
  ensureInteractivityPluginLoaded(e);
package/esm/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { ensureInteractivityPluginLoaded } from "@tsparticles/plugin-interactivity";
2
2
  import { Repulser } from "./Repulser.js";
3
3
  export async function loadExternalRepulseInteraction(engine) {
4
- engine.checkVersion("4.2.0");
4
+ engine.checkVersion("4.2.1");
5
5
  await engine.pluginManager.register((e) => {
6
6
  ensureInteractivityPluginLoaded(e);
7
7
  const pluginManager = e.pluginManager;
package/esm/index.lazy.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export async function loadExternalRepulseInteraction(engine) {
2
- engine.checkVersion("4.2.0");
2
+ engine.checkVersion("4.2.1");
3
3
  await engine.pluginManager.register(async (e) => {
4
4
  const { ensureInteractivityPluginLoaded } = await import("@tsparticles/plugin-interactivity/lazy");
5
5
  ensureInteractivityPluginLoaded(e);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tsparticles/interaction-external-repulse",
3
- "version": "4.2.0",
3
+ "version": "4.2.1",
4
4
  "description": "tsParticles repulse external interaction",
5
5
  "homepage": "https://particles.js.org",
6
6
  "repository": {
@@ -97,7 +97,7 @@
97
97
  },
98
98
  "type": "module",
99
99
  "peerDependencies": {
100
- "@tsparticles/engine": "4.2.0",
101
- "@tsparticles/plugin-interactivity": "4.2.0"
100
+ "@tsparticles/engine": "4.2.1",
101
+ "@tsparticles/plugin-interactivity": "4.2.1"
102
102
  }
103
103
  }
@@ -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
- /* External Interaction v4.2.0 */
2
+ /* External Interaction v4.2.1 */
3
3
  (function (global, factory) {
4
4
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@tsparticles/plugin-interactivity'), require('@tsparticles/engine')) :
5
5
  typeof define === 'function' && define.amd ? define(['exports', '@tsparticles/plugin-interactivity', '@tsparticles/engine'], factory) :
@@ -303,7 +303,7 @@
303
303
  }
304
304
 
305
305
  async function loadExternalRepulseInteraction(engine) {
306
- engine.checkVersion("4.2.0");
306
+ engine.checkVersion("4.2.1");
307
307
  await engine.pluginManager.register((e) => {
308
308
  pluginInteractivity.ensureInteractivityPluginLoaded(e);
309
309
  const pluginManager = e.pluginManager;
@@ -1 +1 @@
1
- !function(e){e.__tsParticlesInternals=e.__tsParticlesInternals||{},e.__tsParticlesInternals.bundles=e.__tsParticlesInternals.bundles||{},e.__tsParticlesInternals.effects=e.__tsParticlesInternals.effects||{},e.__tsParticlesInternals.engine=e.__tsParticlesInternals.engine||{},e.__tsParticlesInternals.interactions=e.__tsParticlesInternals.interactions||{},e.__tsParticlesInternals.palettes=e.__tsParticlesInternals.palettes||{},e.__tsParticlesInternals.paths=e.__tsParticlesInternals.paths||{},e.__tsParticlesInternals.plugins=e.__tsParticlesInternals.plugins||{},e.__tsParticlesInternals.plugins=e.__tsParticlesInternals.plugins||{},e.__tsParticlesInternals.plugins.emittersShapes=e.__tsParticlesInternals.plugins.emittersShapes||{},e.__tsParticlesInternals.presets=e.__tsParticlesInternals.presets||{},e.__tsParticlesInternals.shapes=e.__tsParticlesInternals.shapes||{},e.__tsParticlesInternals.updaters=e.__tsParticlesInternals.updaters||{},e.__tsParticlesInternals.utils=e.__tsParticlesInternals.utils||{},e.__tsParticlesInternals.canvas=e.__tsParticlesInternals.canvas||{},e.__tsParticlesInternals.canvas=e.__tsParticlesInternals.canvas||{},e.__tsParticlesInternals.canvas.utils=e.__tsParticlesInternals.canvas.utils||{},e.__tsParticlesInternals.path=e.__tsParticlesInternals.path||{},e.__tsParticlesInternals.path=e.__tsParticlesInternals.path||{},e.__tsParticlesInternals.path.utils=e.__tsParticlesInternals.path.utils||{};var t="undefined"!=typeof Proxy?function(e){return new Proxy(e,{get:function(e,t){return t in e||(e[t]={}),e[t]}})}:function(e){return e};e.__tsParticlesInternals.bundles=t(e.__tsParticlesInternals.bundles),e.__tsParticlesInternals.effects=t(e.__tsParticlesInternals.effects),e.__tsParticlesInternals.interactions=t(e.__tsParticlesInternals.interactions),e.__tsParticlesInternals.palettes=t(e.__tsParticlesInternals.palettes),e.__tsParticlesInternals.paths=t(e.__tsParticlesInternals.paths),e.__tsParticlesInternals.plugins=t(e.__tsParticlesInternals.plugins),e.__tsParticlesInternals.plugins.emittersShapes=t(e.__tsParticlesInternals.plugins.emittersShapes),e.__tsParticlesInternals.presets=t(e.__tsParticlesInternals.presets),e.__tsParticlesInternals.shapes=t(e.__tsParticlesInternals.shapes),e.__tsParticlesInternals.updaters=t(e.__tsParticlesInternals.updaters),e.__tsParticlesInternals.utils=t(e.__tsParticlesInternals.utils),e.__tsParticlesInternals.canvas=t(e.__tsParticlesInternals.canvas),e.__tsParticlesInternals.path=t(e.__tsParticlesInternals.path),e.tsparticlesInternalExports=e.tsparticlesInternalExports||{}}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:this),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@tsparticles/plugin-interactivity"),require("@tsparticles/engine")):"function"==typeof define&&define.amd?define(["exports","@tsparticles/plugin-interactivity","@tsparticles/engine"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).__tsParticlesInternals=e.__tsParticlesInternals||{},e.__tsParticlesInternals.interactions=e.__tsParticlesInternals.interactions||{},e.__tsParticlesInternals.interactions.externalRepulse=e.__tsParticlesInternals.interactions.externalRepulse||{}),e.__tsParticlesInternals.plugins.interactivity,e.__tsParticlesInternals.engine)}(this,function(e,t,s){"use strict";class n{distance=200;duration=.4;easing="ease-out-quad";factor=100;maxSpeed=50;restore;speed=1;constructor(){this.restore={enable:!1,delay:0,speed:.08,follow:!0}}load(e){s.isNull(e)||(s.loadProperty(this,"distance",e.distance),s.loadProperty(this,"duration",e.duration),s.loadProperty(this,"easing",e.easing),s.loadProperty(this,"factor",e.factor),s.loadProperty(this,"speed",e.speed),s.loadProperty(this,"maxSpeed",e.maxSpeed),void 0!==e.restore&&(this.restore.enable=e.restore.enable??this.restore.enable,this.restore.delay=e.restore.delay??this.restore.delay,this.restore.speed=e.restore.speed??this.restore.speed,this.restore.follow=e.restore.follow??this.restore.follow))}}class i extends n{selectors=[];load(e){super.load(e),s.isNull(e)||s.loadProperty(this,"selectors",e.selectors)}}class a extends n{divs;load(e){super.load(e),s.isNull(e)||(this.divs=s.executeOnSingleOrMultiple(e.divs,e=>{const t=new i;return t.load(e),t}))}}const r="repulse";class l extends t.ExternalInteractorBase{handleClickMode;#e;#t;#s;#n;#i;#a;constructor(e,t){super(t),this.#i=e,this.#s=0,this.#n=s.Vector.origin,this.#t=new Set,this.#e=s.Vector.origin,this.#a=new Map,t.repulse??={particles:[]},this.handleClickMode=(e,n)=>{const i=this.container.actualOptions,a=i.interactivity?.modes.repulse;if(!a||e!==r)return;t.repulse??={particles:[]};const l=t.repulse;l.clicking=!0,l.count=0;for(const e of t.repulse.particles)this.isEnabled(n,e)&&e.velocity.setTo(e.initialVelocity);l.particles=[],l.finish=!1,setTimeout(()=>{t.destroyed||(l.clicking=!1)},a.duration*s.millisecondsToSeconds)}}get maxDistance(){return this.#s}clear(){}init(){const e=this.container,t=e.actualOptions.interactivity?.modes.repulse;t&&(this.#s=t.distance,e.retina.repulseModeDistance=t.distance*e.retina.pixelRatio)}interact(e){this.#t.clear();const n=this.container.actualOptions,i=e.status===t.mouseMoveEvent,a=n.interactivity?.events;if(!a)return;const l=a.onHover,o=l.enable,c=l.mode,p=a.onClick,_=p.enable,d=p.mode,u=a.onDiv;i&&o&&s.isInArray(r,c)?this.#r(e):_&&s.isInArray(r,d)?this.#l(e):t.divModeExecute(r,u,(t,s)=>{this.#o(e,t,s)}),this.#c()}isEnabled(e,n){const i=this.container.actualOptions,a=e.mouse,l=(n?.interactivity??i.interactivity)?.events;if(!l)return!1;const o=l.onDiv,c=l.onHover,p=l.onClick,_=t.isDivModeEnabled(r,o);if(!(_||c.enable&&a.position||p.enable&&a.clickPosition))return!1;const d=c.mode,u=p.mode;return s.isInArray(r,d)||s.isInArray(r,u)||_}loadModeOptions(e,...t){s.loadOptionProperty(e,"repulse",a,...t)}reset(){}#l(e){const t=this.container,n=t.actualOptions.interactivity?.modes.repulse;if(!n)return;const i=t.repulse??{particles:[]};if(i.finish||(i.count??=0,i.count++,i.count===t.particles.count&&(i.finish=!0)),i.clicking){const a=t.retina.repulseModeDistance;if(!a||a<0)return;const r=Math.pow(a/6,3),l=e.mouse.clickPosition;if(void 0===l)return;const o=new s.Circle(l.x,l.y,r),c=t.particles.grid.query(o,t=>this.isEnabled(e,t));for(const e of c){const{dx:t,dy:a,distance:o}=s.getDistances(l,e.position),c=o**2,p=-r*n.speed/c;c<=r&&(this.#p(e),i.particles.push(e),this.#e.x=t,this.#e.y=a,this.#e.length=p,e.velocity.setTo(this.#e))}}else if(!1===i.clicking){for(const e of i.particles)e.velocity.setTo(e.initialVelocity);i.particles=[]}}#r(e){const t=this.container,n=e.mouse.position,i=t.retina.repulseModeDistance;!i||i<0||!n||this.#_(e,n,i,new s.Circle(n.x,n.y,i))}#_(e,t,n,i,a){const r=this.container,l=r.particles.grid.query(i,t=>this.isEnabled(e,t)),o=r.actualOptions.interactivity?.modes.repulse;if(!o)return;const{easing:c,speed:p,factor:_,maxSpeed:d}=o,u=this.#i.getEasing(c),h=(a?.speed??p)*_;for(const e of l){const{dx:i,dy:a,distance:r}=s.getDistances(e.position,t),l=s.clamp(u(1-r/n)*h,0,d);this.#n.x=r?i/r*l:h,this.#n.y=r?a/r*l:h,this.#p(e),e.position.addTo(this.#n)}}#c(){const e=this.container.actualOptions.interactivity?.modes.repulse?.restore;if(!e?.enable||!this.#a.size)return;const t=Date.now(),n=e.delay*s.millisecondsToSeconds,i=Math.max(.001,Math.min(1,e.speed));for(const[s,a]of this.#a){if(this.#t.has(s))continue;if(s.destroyed){this.#a.delete(s);continue}const r=a.target;if(t-a.lastInteractionTime<n)continue;e.follow&&s.options.move.enable&&(r.x+=s.velocity.x,r.y+=s.velocity.y,r.z+=s.velocity.z);const l=r.x-s.position.x,o=r.y-s.position.y,c=r.z-s.position.z;s.position.x+=l*i,s.position.y+=o*i,s.position.z+=c*i,Math.abs(l)<=.5&&Math.abs(o)<=.5&&(s.position.x=r.x,s.position.y=r.y,s.position.z=r.z,this.#a.delete(s))}}#o(e,n,i){const a=this.container,r=a.actualOptions.interactivity?.modes.repulse;if(!r)return;const l=s.safeDocument().querySelectorAll(n);l.length&&l.forEach(n=>{const l=n,o=a.retina.pixelRatio,c={x:(l.offsetLeft+l.offsetWidth*s.half)*o,y:(l.offsetTop+l.offsetHeight*s.half)*o},p=l.offsetWidth*s.half*o,_=i.type===t.DivType.circle?new s.Circle(c.x,c.y,p):new s.Rectangle(l.offsetLeft*o,l.offsetTop*o,l.offsetWidth*o,l.offsetHeight*o),d=r.divs,u=t.divMode(d,l);this.#_(e,c,p,_,u)})}#p(e){this.#t.add(e);const t=this.container.actualOptions.interactivity?.modes.repulse?.restore;if(!t?.enable)return;const s=Date.now();let n=this.#a.get(e);n||(n={target:e.position.copy(),lastInteractionTime:s},this.#a.set(e,n)),n.lastInteractionTime=s,t.follow&&e.options.move.enable&&(n.target.x+=e.velocity.x,n.target.y+=e.velocity.y,n.target.z+=e.velocity.z)}}async function o(e){e.checkVersion("4.2.0"),await e.pluginManager.register(e=>{t.ensureInteractivityPluginLoaded(e);const s=e.pluginManager;s.addInteractor?.("externalRepulse",e=>Promise.resolve(new l(s,e)))})}const c=globalThis;c.__tsParticlesInternals=c.__tsParticlesInternals??{},c.loadExternalRepulseInteraction=o,e.Repulse=a,e.RepulseBase=n,e.RepulseDiv=i,e.loadExternalRepulseInteraction=o}),Object.assign(globalThis.window||globalThis,{loadExternalRepulseInteraction:(globalThis.__tsParticlesInternals.interactions.externalRepulse||{}).loadExternalRepulseInteraction}),delete(globalThis.window||globalThis).tsparticlesInternalExports;
1
+ !function(e){e.__tsParticlesInternals=e.__tsParticlesInternals||{},e.__tsParticlesInternals.bundles=e.__tsParticlesInternals.bundles||{},e.__tsParticlesInternals.effects=e.__tsParticlesInternals.effects||{},e.__tsParticlesInternals.engine=e.__tsParticlesInternals.engine||{},e.__tsParticlesInternals.interactions=e.__tsParticlesInternals.interactions||{},e.__tsParticlesInternals.palettes=e.__tsParticlesInternals.palettes||{},e.__tsParticlesInternals.paths=e.__tsParticlesInternals.paths||{},e.__tsParticlesInternals.plugins=e.__tsParticlesInternals.plugins||{},e.__tsParticlesInternals.plugins=e.__tsParticlesInternals.plugins||{},e.__tsParticlesInternals.plugins.emittersShapes=e.__tsParticlesInternals.plugins.emittersShapes||{},e.__tsParticlesInternals.presets=e.__tsParticlesInternals.presets||{},e.__tsParticlesInternals.shapes=e.__tsParticlesInternals.shapes||{},e.__tsParticlesInternals.updaters=e.__tsParticlesInternals.updaters||{},e.__tsParticlesInternals.utils=e.__tsParticlesInternals.utils||{},e.__tsParticlesInternals.canvas=e.__tsParticlesInternals.canvas||{},e.__tsParticlesInternals.canvas=e.__tsParticlesInternals.canvas||{},e.__tsParticlesInternals.canvas.utils=e.__tsParticlesInternals.canvas.utils||{},e.__tsParticlesInternals.path=e.__tsParticlesInternals.path||{},e.__tsParticlesInternals.path=e.__tsParticlesInternals.path||{},e.__tsParticlesInternals.path.utils=e.__tsParticlesInternals.path.utils||{};var t="undefined"!=typeof Proxy?function(e){return new Proxy(e,{get:function(e,t){return t in e||(e[t]={}),e[t]}})}:function(e){return e};e.__tsParticlesInternals.bundles=t(e.__tsParticlesInternals.bundles),e.__tsParticlesInternals.effects=t(e.__tsParticlesInternals.effects),e.__tsParticlesInternals.interactions=t(e.__tsParticlesInternals.interactions),e.__tsParticlesInternals.palettes=t(e.__tsParticlesInternals.palettes),e.__tsParticlesInternals.paths=t(e.__tsParticlesInternals.paths),e.__tsParticlesInternals.plugins=t(e.__tsParticlesInternals.plugins),e.__tsParticlesInternals.plugins.emittersShapes=t(e.__tsParticlesInternals.plugins.emittersShapes),e.__tsParticlesInternals.presets=t(e.__tsParticlesInternals.presets),e.__tsParticlesInternals.shapes=t(e.__tsParticlesInternals.shapes),e.__tsParticlesInternals.updaters=t(e.__tsParticlesInternals.updaters),e.__tsParticlesInternals.utils=t(e.__tsParticlesInternals.utils),e.__tsParticlesInternals.canvas=t(e.__tsParticlesInternals.canvas),e.__tsParticlesInternals.path=t(e.__tsParticlesInternals.path),e.tsparticlesInternalExports=e.tsparticlesInternalExports||{}}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:this),function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@tsparticles/plugin-interactivity"),require("@tsparticles/engine")):"function"==typeof define&&define.amd?define(["exports","@tsparticles/plugin-interactivity","@tsparticles/engine"],t):t(((e="undefined"!=typeof globalThis?globalThis:e||self).__tsParticlesInternals=e.__tsParticlesInternals||{},e.__tsParticlesInternals.interactions=e.__tsParticlesInternals.interactions||{},e.__tsParticlesInternals.interactions.externalRepulse=e.__tsParticlesInternals.interactions.externalRepulse||{}),e.__tsParticlesInternals.plugins.interactivity,e.__tsParticlesInternals.engine)}(this,function(e,t,s){"use strict";class n{distance=200;duration=.4;easing="ease-out-quad";factor=100;maxSpeed=50;restore;speed=1;constructor(){this.restore={enable:!1,delay:0,speed:.08,follow:!0}}load(e){s.isNull(e)||(s.loadProperty(this,"distance",e.distance),s.loadProperty(this,"duration",e.duration),s.loadProperty(this,"easing",e.easing),s.loadProperty(this,"factor",e.factor),s.loadProperty(this,"speed",e.speed),s.loadProperty(this,"maxSpeed",e.maxSpeed),void 0!==e.restore&&(this.restore.enable=e.restore.enable??this.restore.enable,this.restore.delay=e.restore.delay??this.restore.delay,this.restore.speed=e.restore.speed??this.restore.speed,this.restore.follow=e.restore.follow??this.restore.follow))}}class i extends n{selectors=[];load(e){super.load(e),s.isNull(e)||s.loadProperty(this,"selectors",e.selectors)}}class a extends n{divs;load(e){super.load(e),s.isNull(e)||(this.divs=s.executeOnSingleOrMultiple(e.divs,e=>{const t=new i;return t.load(e),t}))}}const r="repulse";class l extends t.ExternalInteractorBase{handleClickMode;#e;#t;#s;#n;#i;#a;constructor(e,t){super(t),this.#i=e,this.#s=0,this.#n=s.Vector.origin,this.#t=new Set,this.#e=s.Vector.origin,this.#a=new Map,t.repulse??={particles:[]},this.handleClickMode=(e,n)=>{const i=this.container.actualOptions,a=i.interactivity?.modes.repulse;if(!a||e!==r)return;t.repulse??={particles:[]};const l=t.repulse;l.clicking=!0,l.count=0;for(const e of t.repulse.particles)this.isEnabled(n,e)&&e.velocity.setTo(e.initialVelocity);l.particles=[],l.finish=!1,setTimeout(()=>{t.destroyed||(l.clicking=!1)},a.duration*s.millisecondsToSeconds)}}get maxDistance(){return this.#s}clear(){}init(){const e=this.container,t=e.actualOptions.interactivity?.modes.repulse;t&&(this.#s=t.distance,e.retina.repulseModeDistance=t.distance*e.retina.pixelRatio)}interact(e){this.#t.clear();const n=this.container.actualOptions,i=e.status===t.mouseMoveEvent,a=n.interactivity?.events;if(!a)return;const l=a.onHover,o=l.enable,c=l.mode,p=a.onClick,_=p.enable,d=p.mode,u=a.onDiv;i&&o&&s.isInArray(r,c)?this.#r(e):_&&s.isInArray(r,d)?this.#l(e):t.divModeExecute(r,u,(t,s)=>{this.#o(e,t,s)}),this.#c()}isEnabled(e,n){const i=this.container.actualOptions,a=e.mouse,l=(n?.interactivity??i.interactivity)?.events;if(!l)return!1;const o=l.onDiv,c=l.onHover,p=l.onClick,_=t.isDivModeEnabled(r,o);if(!(_||c.enable&&a.position||p.enable&&a.clickPosition))return!1;const d=c.mode,u=p.mode;return s.isInArray(r,d)||s.isInArray(r,u)||_}loadModeOptions(e,...t){s.loadOptionProperty(e,"repulse",a,...t)}reset(){}#l(e){const t=this.container,n=t.actualOptions.interactivity?.modes.repulse;if(!n)return;const i=t.repulse??{particles:[]};if(i.finish||(i.count??=0,i.count++,i.count===t.particles.count&&(i.finish=!0)),i.clicking){const a=t.retina.repulseModeDistance;if(!a||a<0)return;const r=Math.pow(a/6,3),l=e.mouse.clickPosition;if(void 0===l)return;const o=new s.Circle(l.x,l.y,r),c=t.particles.grid.query(o,t=>this.isEnabled(e,t));for(const e of c){const{dx:t,dy:a,distance:o}=s.getDistances(l,e.position),c=o**2,p=-r*n.speed/c;c<=r&&(this.#p(e),i.particles.push(e),this.#e.x=t,this.#e.y=a,this.#e.length=p,e.velocity.setTo(this.#e))}}else if(!1===i.clicking){for(const e of i.particles)e.velocity.setTo(e.initialVelocity);i.particles=[]}}#r(e){const t=this.container,n=e.mouse.position,i=t.retina.repulseModeDistance;!i||i<0||!n||this.#_(e,n,i,new s.Circle(n.x,n.y,i))}#_(e,t,n,i,a){const r=this.container,l=r.particles.grid.query(i,t=>this.isEnabled(e,t)),o=r.actualOptions.interactivity?.modes.repulse;if(!o)return;const{easing:c,speed:p,factor:_,maxSpeed:d}=o,u=this.#i.getEasing(c),h=(a?.speed??p)*_;for(const e of l){const{dx:i,dy:a,distance:r}=s.getDistances(e.position,t),l=s.clamp(u(1-r/n)*h,0,d);this.#n.x=r?i/r*l:h,this.#n.y=r?a/r*l:h,this.#p(e),e.position.addTo(this.#n)}}#c(){const e=this.container.actualOptions.interactivity?.modes.repulse?.restore;if(!e?.enable||!this.#a.size)return;const t=Date.now(),n=e.delay*s.millisecondsToSeconds,i=Math.max(.001,Math.min(1,e.speed));for(const[s,a]of this.#a){if(this.#t.has(s))continue;if(s.destroyed){this.#a.delete(s);continue}const r=a.target;if(t-a.lastInteractionTime<n)continue;e.follow&&s.options.move.enable&&(r.x+=s.velocity.x,r.y+=s.velocity.y,r.z+=s.velocity.z);const l=r.x-s.position.x,o=r.y-s.position.y,c=r.z-s.position.z;s.position.x+=l*i,s.position.y+=o*i,s.position.z+=c*i,Math.abs(l)<=.5&&Math.abs(o)<=.5&&(s.position.x=r.x,s.position.y=r.y,s.position.z=r.z,this.#a.delete(s))}}#o(e,n,i){const a=this.container,r=a.actualOptions.interactivity?.modes.repulse;if(!r)return;const l=s.safeDocument().querySelectorAll(n);l.length&&l.forEach(n=>{const l=n,o=a.retina.pixelRatio,c={x:(l.offsetLeft+l.offsetWidth*s.half)*o,y:(l.offsetTop+l.offsetHeight*s.half)*o},p=l.offsetWidth*s.half*o,_=i.type===t.DivType.circle?new s.Circle(c.x,c.y,p):new s.Rectangle(l.offsetLeft*o,l.offsetTop*o,l.offsetWidth*o,l.offsetHeight*o),d=r.divs,u=t.divMode(d,l);this.#_(e,c,p,_,u)})}#p(e){this.#t.add(e);const t=this.container.actualOptions.interactivity?.modes.repulse?.restore;if(!t?.enable)return;const s=Date.now();let n=this.#a.get(e);n||(n={target:e.position.copy(),lastInteractionTime:s},this.#a.set(e,n)),n.lastInteractionTime=s,t.follow&&e.options.move.enable&&(n.target.x+=e.velocity.x,n.target.y+=e.velocity.y,n.target.z+=e.velocity.z)}}async function o(e){e.checkVersion("4.2.1"),await e.pluginManager.register(e=>{t.ensureInteractivityPluginLoaded(e);const s=e.pluginManager;s.addInteractor?.("externalRepulse",e=>Promise.resolve(new l(s,e)))})}const c=globalThis;c.__tsParticlesInternals=c.__tsParticlesInternals??{},c.loadExternalRepulseInteraction=o,e.Repulse=a,e.RepulseBase=n,e.RepulseDiv=i,e.loadExternalRepulseInteraction=o}),Object.assign(globalThis.window||globalThis,{loadExternalRepulseInteraction:(globalThis.__tsParticlesInternals.interactions.externalRepulse||{}).loadExternalRepulseInteraction}),delete(globalThis.window||globalThis).tsparticlesInternalExports;