@tsparticles/interaction-external-bubble 4.3.0 → 4.3.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.
package/README.md CHANGED
@@ -39,9 +39,7 @@ Once the scripts are loaded you can set up `tsParticles` and the interaction plu
39
39
 
40
40
  await tsParticles.load({
41
41
  id: "tsparticles",
42
- options: {
43
- /* options */
44
- },
42
+ options: {/* options */},
45
43
  });
46
44
  })();
47
45
  ```
package/browser/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { ensureInteractivityPluginLoaded } from "@tsparticles/plugin-interactivity";
2
2
  import { Bubbler } from "./Bubbler.js";
3
3
  export async function loadExternalBubbleInteraction(engine) {
4
- engine.checkVersion("4.3.0");
4
+ engine.checkVersion("4.3.2");
5
5
  await engine.pluginManager.register((e) => {
6
6
  ensureInteractivityPluginLoaded(e);
7
7
  e.pluginManager.addInteractor?.("externalBubble", container => {
@@ -1,5 +1,5 @@
1
1
  export async function loadExternalBubbleInteraction(engine) {
2
- engine.checkVersion("4.3.0");
2
+ engine.checkVersion("4.3.2");
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 { Bubbler } from "./Bubbler.js";
3
3
  export async function loadExternalBubbleInteraction(engine) {
4
- engine.checkVersion("4.3.0");
4
+ engine.checkVersion("4.3.2");
5
5
  await engine.pluginManager.register((e) => {
6
6
  ensureInteractivityPluginLoaded(e);
7
7
  e.pluginManager.addInteractor?.("externalBubble", container => {
package/cjs/index.lazy.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export async function loadExternalBubbleInteraction(engine) {
2
- engine.checkVersion("4.3.0");
2
+ engine.checkVersion("4.3.2");
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 { Bubbler } from "./Bubbler.js";
3
3
  export async function loadExternalBubbleInteraction(engine) {
4
- engine.checkVersion("4.3.0");
4
+ engine.checkVersion("4.3.2");
5
5
  await engine.pluginManager.register((e) => {
6
6
  ensureInteractivityPluginLoaded(e);
7
7
  e.pluginManager.addInteractor?.("externalBubble", container => {
package/esm/index.lazy.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export async function loadExternalBubbleInteraction(engine) {
2
- engine.checkVersion("4.3.0");
2
+ engine.checkVersion("4.3.2");
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-bubble",
3
- "version": "4.3.0",
3
+ "version": "4.3.2",
4
4
  "description": "tsParticles bubble 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.3.0",
101
- "@tsparticles/plugin-interactivity": "4.3.0"
100
+ "@tsparticles/engine": "4.3.2",
101
+ "@tsparticles/plugin-interactivity": "4.3.2"
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.3.0 */
2
+ /* External Interaction v4.3.2 */
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) :
@@ -397,7 +397,7 @@
397
397
  }
398
398
 
399
399
  async function loadExternalBubbleInteraction(engine) {
400
- engine.checkVersion("4.3.0");
400
+ engine.checkVersion("4.3.2");
401
401
  await engine.pluginManager.register((e) => {
402
402
  pluginInteractivity.ensureInteractivityPluginLoaded(e);
403
403
  e.pluginManager.addInteractor?.("externalBubble", 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/plugin-interactivity"),require("@tsparticles/engine")):"function"==typeof define&&define.amd?define(["exports","@tsparticles/plugin-interactivity","@tsparticles/engine"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).__tsParticlesInternals=t.__tsParticlesInternals||{},t.__tsParticlesInternals.interactions=t.__tsParticlesInternals.interactions||{},t.__tsParticlesInternals.interactions.externalBubble=t.__tsParticlesInternals.interactions.externalBubble||{}),t.__tsParticlesInternals.plugins.interactivity,t.__tsParticlesInternals.engine)}(this,function(t,e,s){"use strict";class i{color;distance=200;duration=.4;mix=!1;opacity;size;load(t){if(!s.isNull(t)){if(s.loadProperty(this,"distance",t.distance),s.loadProperty(this,"duration",t.duration),s.loadProperty(this,"mix",t.mix),s.loadRangeProperty(this,"opacity",t.opacity),void 0!==t.color){const e=s.isArray(this.color)?void 0:this.color;this.color=s.executeOnSingleOrMultiple(t.color,t=>s.OptionsColor.create(e,t))}s.loadProperty(this,"size",t.size)}}}class n extends i{selectors=[];load(t){super.load(t),s.isNull(t)||s.loadProperty(this,"selectors",t.selectors)}}class a extends i{divs;load(t){super.load(t),s.isNull(t)||(this.divs=s.executeOnSingleOrMultiple(t.divs,t=>{const e=new n;return e.load(t),e}))}}class r{div;enabled=!1;fillColor;finalColor;id="bubble";inRange=!1;opacity;priority=100;radius;strokeColor}var l;function o(t,e,i,n){if(e>=i){const a=t+(e-i)*n;return s.clamp(a,t,e)}if(e<i){const a=t-(i-e)*n;return s.clamp(a,e,t)}}!function(t){t.color="color",t.opacity="opacity",t.size="size"}(l||(l={}));const c="bubble";class u extends e.ExternalInteractorBase{handleClickMode;#t;#e=new WeakMap;#s;constructor(t,e){super(e),this.#s=t,this.#t=0,e.bubble??={},this.handleClickMode=t=>{t===c&&(e.bubble??={},e.bubble.clicking=!0)}}get maxDistance(){return this.#t}clear(t,e,s){const i=this.#e.get(t);i?.inRange&&!s||(t.removeModifier(c),this.#e.delete(t))}getOrCreateModifier(t){let e=this.#e.get(t);return e||(e=new r,this.#e.set(t,e),t.addModifier(e)),e}init(){const t=this.container,e=t.actualOptions.interactivity?.modes.bubble;e&&(this.#t=e.distance,t.retina.bubbleModeDistance=e.distance*t.retina.pixelRatio,void 0!==e.size&&(t.retina.bubbleModeSize=e.size*t.retina.pixelRatio))}interact(t,i){const n=this.container.actualOptions,a=n.interactivity?.events;if(!a)return;const r=a.onHover,l=a.onClick,o=r.enable,u=r.mode,b=l.enable,d=l.mode,p=a.onDiv;o&&s.isInArray(c,u)?this.#i(t):b&&s.isInArray(c,d)?this.#n(t):e.divModeExecute(c,p,(e,s)=>{this.#a(t,i,e,s)})}isEnabled(t,i){const n=this.container.actualOptions,a=t.mouse,r=(i?.interactivity??n.interactivity)?.events;if(!r)return!1;const{onClick:l,onDiv:o,onHover:u}=r,b=e.isDivModeEnabled(c,o);return!!(b||u.enable&&a.position||l.enable&&a.clickPosition)&&(s.isInArray(c,u.mode)||s.isInArray(c,l.mode)||b)}loadModeOptions(t,...e){s.loadOptionProperty(t,"bubble",a,...e)}reset(t,e){const s=this.#e.get(e);s&&(s.enabled=!1,s.inRange=!1)}#n(t){const e=this.container,i=e.actualOptions,n=t.mouse.clickPosition,a=i.interactivity?.modes.bubble;if(!a||!n)return;e.bubble??={};const r=e.retina.bubbleModeDistance;if(!r||r<0)return;const o=e.particles.grid.queryCircle(n,r,e=>this.isEnabled(t,e)),{bubble:c}=e;for(const i of o){if(!c.clicking)continue;const o=this.getOrCreateModifier(i);o.enabled=!c.durationEnd,o.inRange=!c.durationEnd;const u=i.getPosition(),b=s.getDistance(u,n),d=(performance.now()-(t.mouse.clickTime??0))/s.millisecondsToSeconds;d>a.duration&&(c.durationEnd=!0),d>a.duration*s.double&&(c.clicking=!1,c.durationEnd=!1);const p={bubbleObj:{optValue:e.retina.bubbleModeSize,value:o.radius},particlesObj:{optValue:i.size.max,value:i.size.value},type:l.size};this.#r(i,b,d,p);const _={bubbleObj:{optValue:a.opacity,value:o.opacity},particlesObj:{optValue:i.opacity?.max??1,value:i.opacity?.value??1},type:l.opacity};this.#r(i,b,d,_),!c.durationEnd&&b<=r?this.#l(i,b):(o.fillColor=void 0,o.strokeColor=void 0)}}#i(t){const i=this.container,n=t.mouse.position,a=i.retina.bubbleModeDistance;if(!a||a<0||!n)return;const r=i.particles.grid.queryCircle(n,a,e=>this.isEnabled(t,e));for(const i of r){const r=this.getOrCreateModifier(i);r.enabled=!0,r.inRange=!0;const l=i.getPosition(),o=s.getDistance(l,n),c=1-o/a;o<=a?c>=0&&t.status===e.mouseMoveEvent&&(this.#o(i,c),this.#c(i,c),this.#l(i,c)):this.reset(t,i),t.status===e.mouseLeaveEvent&&this.reset(t,i)}}#l(t,e,i){const n=this.container.actualOptions,a=i??n.interactivity?.modes.bubble,r=this.getOrCreateModifier(t);if(a){if(!r.finalColor){const t=a.color;if(!t)return;const e=s.itemFromSingleOrMultiple(t);r.finalColor=s.rangeColorToHsl(this.#s,e)}if(r.finalColor)if(a.mix){r.fillColor=void 0,r.strokeColor=void 0;const i=t.getFillColor();if(i){const t=s.rgbToHsl(s.colorMix(i,r.finalColor,1-e,e));r.fillColor=t,r.strokeColor=t}else r.fillColor=r.finalColor,r.strokeColor=r.finalColor}else r.fillColor=r.finalColor,r.strokeColor=r.finalColor}}#c(t,e,s){const i=this.container.actualOptions,n=s?.opacity??i.interactivity?.modes.bubble?.opacity;if(!n)return;const a=o(t.opacity?.value??1,n,t.opacity?.max??1,e);if(void 0!==a){this.getOrCreateModifier(t).opacity=a}}#o(t,e,s){const i=this.container,n=s?.size?s.size*i.retina.pixelRatio:i.retina.bubbleModeSize;if(void 0===n)return;const a=o(t.size.value,n,t.size.max,e);if(void 0!==a){this.getOrCreateModifier(t).radius=a}}#r(t,e,s,i){const n=this.container,a=i.bubbleObj.optValue,r=n.actualOptions,o=r.interactivity?.modes.bubble;if(!o||void 0===a)return;const c=o.duration,u=n.retina.bubbleModeDistance,b=i.particlesObj.optValue,d=i.bubbleObj.value,p=i.particlesObj.value??0,_=i.type;if(!u||u<0||a===b)return;n.bubble??={};const f=this.getOrCreateModifier(t);if(n.bubble.durationEnd)d&&(_===l.size&&(f.radius=void 0),_===l.opacity&&(f.opacity=void 0));else if(e<=u){if((d??p)!==a){const t=p-s*(p-a)/c;_===l.size&&(f.radius=t),_===l.opacity&&(f.opacity=t)}}else _===l.size&&(f.radius=void 0),_===l.opacity&&(f.opacity=void 0)}#a(t,i,n,a){const r=this.container,l=s.safeDocument().querySelectorAll(n),o=r.actualOptions.interactivity?.modes.bubble;o&&l.length&&l.forEach(n=>{const l=n,c=r.retina.pixelRatio,u={x:(l.offsetLeft+l.offsetWidth*s.half)*c,y:(l.offsetTop+l.offsetHeight*s.half)*c},b=l.offsetWidth*s.half*c,d=a.type===e.DivType.circle?new s.Circle(u.x,u.y,b):new s.Rectangle(l.offsetLeft*c,l.offsetTop*c,l.offsetWidth*c,l.offsetHeight*c),p=r.particles.grid.query(d,e=>this.isEnabled(t,e));for(const t of p){if(!d.contains(t.getPosition()))continue;const s=this.getOrCreateModifier(t);s.enabled=!0,s.inRange=!0;const n=o.divs,a=e.divMode(n,l);s.div&&s.div===l||(this.clear(t,i,!0),s.div=l),this.#o(t,1,a),this.#c(t,1,a),this.#l(t,1,a)}})}}async function b(t){t.checkVersion("4.3.0"),await t.pluginManager.register(t=>{e.ensureInteractivityPluginLoaded(t),t.pluginManager.addInteractor?.("externalBubble",e=>Promise.resolve(new u(t.pluginManager,e)))})}const d=globalThis;d.__tsParticlesInternals=d.__tsParticlesInternals??{},d.loadExternalBubbleInteraction=b,t.Bubble=a,t.BubbleBase=i,t.BubbleDiv=n,t.BubbleModifier=r,t.loadExternalBubbleInteraction=b}),Object.assign(globalThis.window||globalThis,{loadExternalBubbleInteraction:(globalThis.__tsParticlesInternals.interactions.externalBubble||{}).loadExternalBubbleInteraction}),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/plugin-interactivity"),require("@tsparticles/engine")):"function"==typeof define&&define.amd?define(["exports","@tsparticles/plugin-interactivity","@tsparticles/engine"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).__tsParticlesInternals=t.__tsParticlesInternals||{},t.__tsParticlesInternals.interactions=t.__tsParticlesInternals.interactions||{},t.__tsParticlesInternals.interactions.externalBubble=t.__tsParticlesInternals.interactions.externalBubble||{}),t.__tsParticlesInternals.plugins.interactivity,t.__tsParticlesInternals.engine)}(this,function(t,e,s){"use strict";class i{color;distance=200;duration=.4;mix=!1;opacity;size;load(t){if(!s.isNull(t)){if(s.loadProperty(this,"distance",t.distance),s.loadProperty(this,"duration",t.duration),s.loadProperty(this,"mix",t.mix),s.loadRangeProperty(this,"opacity",t.opacity),void 0!==t.color){const e=s.isArray(this.color)?void 0:this.color;this.color=s.executeOnSingleOrMultiple(t.color,t=>s.OptionsColor.create(e,t))}s.loadProperty(this,"size",t.size)}}}class n extends i{selectors=[];load(t){super.load(t),s.isNull(t)||s.loadProperty(this,"selectors",t.selectors)}}class a extends i{divs;load(t){super.load(t),s.isNull(t)||(this.divs=s.executeOnSingleOrMultiple(t.divs,t=>{const e=new n;return e.load(t),e}))}}class r{div;enabled=!1;fillColor;finalColor;id="bubble";inRange=!1;opacity;priority=100;radius;strokeColor}var l;function o(t,e,i,n){if(e>=i){const a=t+(e-i)*n;return s.clamp(a,t,e)}if(e<i){const a=t-(i-e)*n;return s.clamp(a,e,t)}}!function(t){t.color="color",t.opacity="opacity",t.size="size"}(l||(l={}));const c="bubble";class u extends e.ExternalInteractorBase{handleClickMode;#t;#e=new WeakMap;#s;constructor(t,e){super(e),this.#s=t,this.#t=0,e.bubble??={},this.handleClickMode=t=>{t===c&&(e.bubble??={},e.bubble.clicking=!0)}}get maxDistance(){return this.#t}clear(t,e,s){const i=this.#e.get(t);i?.inRange&&!s||(t.removeModifier(c),this.#e.delete(t))}getOrCreateModifier(t){let e=this.#e.get(t);return e||(e=new r,this.#e.set(t,e),t.addModifier(e)),e}init(){const t=this.container,e=t.actualOptions.interactivity?.modes.bubble;e&&(this.#t=e.distance,t.retina.bubbleModeDistance=e.distance*t.retina.pixelRatio,void 0!==e.size&&(t.retina.bubbleModeSize=e.size*t.retina.pixelRatio))}interact(t,i){const n=this.container.actualOptions,a=n.interactivity?.events;if(!a)return;const r=a.onHover,l=a.onClick,o=r.enable,u=r.mode,b=l.enable,d=l.mode,p=a.onDiv;o&&s.isInArray(c,u)?this.#i(t):b&&s.isInArray(c,d)?this.#n(t):e.divModeExecute(c,p,(e,s)=>{this.#a(t,i,e,s)})}isEnabled(t,i){const n=this.container.actualOptions,a=t.mouse,r=(i?.interactivity??n.interactivity)?.events;if(!r)return!1;const{onClick:l,onDiv:o,onHover:u}=r,b=e.isDivModeEnabled(c,o);return!!(b||u.enable&&a.position||l.enable&&a.clickPosition)&&(s.isInArray(c,u.mode)||s.isInArray(c,l.mode)||b)}loadModeOptions(t,...e){s.loadOptionProperty(t,"bubble",a,...e)}reset(t,e){const s=this.#e.get(e);s&&(s.enabled=!1,s.inRange=!1)}#n(t){const e=this.container,i=e.actualOptions,n=t.mouse.clickPosition,a=i.interactivity?.modes.bubble;if(!a||!n)return;e.bubble??={};const r=e.retina.bubbleModeDistance;if(!r||r<0)return;const o=e.particles.grid.queryCircle(n,r,e=>this.isEnabled(t,e)),{bubble:c}=e;for(const i of o){if(!c.clicking)continue;const o=this.getOrCreateModifier(i);o.enabled=!c.durationEnd,o.inRange=!c.durationEnd;const u=i.getPosition(),b=s.getDistance(u,n),d=(performance.now()-(t.mouse.clickTime??0))/s.millisecondsToSeconds;d>a.duration&&(c.durationEnd=!0),d>a.duration*s.double&&(c.clicking=!1,c.durationEnd=!1);const p={bubbleObj:{optValue:e.retina.bubbleModeSize,value:o.radius},particlesObj:{optValue:i.size.max,value:i.size.value},type:l.size};this.#r(i,b,d,p);const _={bubbleObj:{optValue:a.opacity,value:o.opacity},particlesObj:{optValue:i.opacity?.max??1,value:i.opacity?.value??1},type:l.opacity};this.#r(i,b,d,_),!c.durationEnd&&b<=r?this.#l(i,b):(o.fillColor=void 0,o.strokeColor=void 0)}}#i(t){const i=this.container,n=t.mouse.position,a=i.retina.bubbleModeDistance;if(!a||a<0||!n)return;const r=i.particles.grid.queryCircle(n,a,e=>this.isEnabled(t,e));for(const i of r){const r=this.getOrCreateModifier(i);r.enabled=!0,r.inRange=!0;const l=i.getPosition(),o=s.getDistance(l,n),c=1-o/a;o<=a?c>=0&&t.status===e.mouseMoveEvent&&(this.#o(i,c),this.#c(i,c),this.#l(i,c)):this.reset(t,i),t.status===e.mouseLeaveEvent&&this.reset(t,i)}}#l(t,e,i){const n=this.container.actualOptions,a=i??n.interactivity?.modes.bubble,r=this.getOrCreateModifier(t);if(a){if(!r.finalColor){const t=a.color;if(!t)return;const e=s.itemFromSingleOrMultiple(t);r.finalColor=s.rangeColorToHsl(this.#s,e)}if(r.finalColor)if(a.mix){r.fillColor=void 0,r.strokeColor=void 0;const i=t.getFillColor();if(i){const t=s.rgbToHsl(s.colorMix(i,r.finalColor,1-e,e));r.fillColor=t,r.strokeColor=t}else r.fillColor=r.finalColor,r.strokeColor=r.finalColor}else r.fillColor=r.finalColor,r.strokeColor=r.finalColor}}#c(t,e,s){const i=this.container.actualOptions,n=s?.opacity??i.interactivity?.modes.bubble?.opacity;if(!n)return;const a=o(t.opacity?.value??1,n,t.opacity?.max??1,e);if(void 0!==a){this.getOrCreateModifier(t).opacity=a}}#o(t,e,s){const i=this.container,n=s?.size?s.size*i.retina.pixelRatio:i.retina.bubbleModeSize;if(void 0===n)return;const a=o(t.size.value,n,t.size.max,e);if(void 0!==a){this.getOrCreateModifier(t).radius=a}}#r(t,e,s,i){const n=this.container,a=i.bubbleObj.optValue,r=n.actualOptions,o=r.interactivity?.modes.bubble;if(!o||void 0===a)return;const c=o.duration,u=n.retina.bubbleModeDistance,b=i.particlesObj.optValue,d=i.bubbleObj.value,p=i.particlesObj.value??0,_=i.type;if(!u||u<0||a===b)return;n.bubble??={};const f=this.getOrCreateModifier(t);if(n.bubble.durationEnd)d&&(_===l.size&&(f.radius=void 0),_===l.opacity&&(f.opacity=void 0));else if(e<=u){if((d??p)!==a){const t=p-s*(p-a)/c;_===l.size&&(f.radius=t),_===l.opacity&&(f.opacity=t)}}else _===l.size&&(f.radius=void 0),_===l.opacity&&(f.opacity=void 0)}#a(t,i,n,a){const r=this.container,l=s.safeDocument().querySelectorAll(n),o=r.actualOptions.interactivity?.modes.bubble;o&&l.length&&l.forEach(n=>{const l=n,c=r.retina.pixelRatio,u={x:(l.offsetLeft+l.offsetWidth*s.half)*c,y:(l.offsetTop+l.offsetHeight*s.half)*c},b=l.offsetWidth*s.half*c,d=a.type===e.DivType.circle?new s.Circle(u.x,u.y,b):new s.Rectangle(l.offsetLeft*c,l.offsetTop*c,l.offsetWidth*c,l.offsetHeight*c),p=r.particles.grid.query(d,e=>this.isEnabled(t,e));for(const t of p){if(!d.contains(t.getPosition()))continue;const s=this.getOrCreateModifier(t);s.enabled=!0,s.inRange=!0;const n=o.divs,a=e.divMode(n,l);s.div&&s.div===l||(this.clear(t,i,!0),s.div=l),this.#o(t,1,a),this.#c(t,1,a),this.#l(t,1,a)}})}}async function b(t){t.checkVersion("4.3.2"),await t.pluginManager.register(t=>{e.ensureInteractivityPluginLoaded(t),t.pluginManager.addInteractor?.("externalBubble",e=>Promise.resolve(new u(t.pluginManager,e)))})}const d=globalThis;d.__tsParticlesInternals=d.__tsParticlesInternals??{},d.loadExternalBubbleInteraction=b,t.Bubble=a,t.BubbleBase=i,t.BubbleDiv=n,t.BubbleModifier=r,t.loadExternalBubbleInteraction=b}),Object.assign(globalThis.window||globalThis,{loadExternalBubbleInteraction:(globalThis.__tsParticlesInternals.interactions.externalBubble||{}).loadExternalBubbleInteraction}),delete(globalThis.window||globalThis).tsparticlesInternalExports;