Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@tsparticles/interaction-external-bubble

Package Overview
Dependencies
Maintainers
2
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tsparticles/interaction-external-bubble - npm Package Compare versions

Comparing version 3.3.0 to 3.4.0

29

browser/Bubbler.js

@@ -1,3 +0,4 @@

import { Circle, ExternalInteractorBase, Rectangle, colorMix, divMode, divModeExecute, getDistance, getRangeMax, isDivModeEnabled, isInArray, itemFromSingleOrMultiple, millisecondsToSeconds, mouseLeaveEvent, mouseMoveEvent, rangeColorToHsl, rgbToHsl, } from "@tsparticles/engine";
import { Circle, DivType, ExternalInteractorBase, Rectangle, colorMix, divMode, divModeExecute, getDistance, getRangeMax, isDivModeEnabled, isInArray, itemFromSingleOrMultiple, millisecondsToSeconds, mouseLeaveEvent, mouseMoveEvent, rangeColorToHsl, rgbToHsl, } from "@tsparticles/engine";
import { Bubble } from "./Options/Classes/Bubble.js";
import { ProcessBubbleType } from "./Enums.js";
import { calculateBubbleValue } from "./Utils.js";

@@ -20,3 +21,3 @@ const bubbleMode = "bubble", minDistance = 0, defaultClickTime = 0, double = 2, defaultOpacity = 1, ratioOffset = 1, defaultBubbleValue = 0, minRatio = 0, half = 0.5, defaultRatio = 1;

}
const query = container.particles.quadTree.queryCircle(mouseClickPos, distance, (p) => this.isEnabled(p)), { bubble } = container;
const query = container.particles.quadTree.queryCircle(mouseClickPos, distance, p => this.isEnabled(p)), { bubble } = container;
for (const particle of query) {

@@ -45,3 +46,3 @@ if (!bubble.clicking) {

},
type: "size",
type: ProcessBubbleType.size,
};

@@ -58,3 +59,3 @@ this._process(particle, distMouse, timeSpent, sizeData);

},
type: "opacity",
type: ProcessBubbleType.opacity,
};

@@ -75,3 +76,3 @@ this._process(particle, distMouse, timeSpent, opacityData);

}
const query = container.particles.quadTree.queryCircle(mousePos, distance, (p) => this.isEnabled(p));
const query = container.particles.quadTree.queryCircle(mousePos, distance, p => this.isEnabled(p));
for (const particle of query) {

@@ -156,6 +157,6 @@ particle.bubble.inRange = true;

if (pObjBubble) {
if (type === "size") {
if (type === ProcessBubbleType.size) {
delete particle.bubble.radius;
}
if (type === "opacity") {
if (type === ProcessBubbleType.opacity) {
delete particle.bubble.opacity;

@@ -170,6 +171,6 @@ }

const value = pObj - (timeSpent * (pObj - bubbleParam)) / bubbleDuration;
if (type === "size") {
if (type === ProcessBubbleType.size) {
particle.bubble.radius = value;
}
if (type === "opacity") {
if (type === ProcessBubbleType.opacity) {
particle.bubble.opacity = value;

@@ -180,6 +181,6 @@ }

else {
if (type === "size") {
if (type === ProcessBubbleType.size) {
delete particle.bubble.radius;
}
if (type === "opacity") {
if (type === ProcessBubbleType.opacity) {
delete particle.bubble.opacity;

@@ -195,9 +196,9 @@ }

}
selectors.forEach((item) => {
selectors.forEach(item => {
const elem = item, pxRatio = container.retina.pixelRatio, pos = {
x: (elem.offsetLeft + elem.offsetWidth * half) * pxRatio,
y: (elem.offsetTop + elem.offsetHeight * half) * pxRatio,
}, repulseRadius = elem.offsetWidth * half * pxRatio, area = div.type === "circle"
}, repulseRadius = elem.offsetWidth * half * pxRatio, area = div.type === DivType.circle
? new Circle(pos.x, pos.y, repulseRadius)
: new Rectangle(elem.offsetLeft * pxRatio, elem.offsetTop * pxRatio, elem.offsetWidth * pxRatio, elem.offsetHeight * pxRatio), query = container.particles.quadTree.query(area, (p) => this.isEnabled(p));
: new Rectangle(elem.offsetLeft * pxRatio, elem.offsetTop * pxRatio, elem.offsetWidth * pxRatio, elem.offsetHeight * pxRatio), query = container.particles.quadTree.query(area, p => this.isEnabled(p));
for (const particle of query) {

@@ -204,0 +205,0 @@ if (!area.contains(particle.getPosition())) {

@@ -1,1 +0,6 @@

export {};
export var ProcessBubbleType;
(function (ProcessBubbleType) {
ProcessBubbleType["color"] = "color";
ProcessBubbleType["opacity"] = "opacity";
ProcessBubbleType["size"] = "size";
})(ProcessBubbleType || (ProcessBubbleType = {}));

@@ -0,5 +1,5 @@

import { Bubbler } from "./Bubbler.js";
export async function loadExternalBubbleInteraction(engine, refresh = true) {
await engine.addInteractor("externalBubble", async (container) => {
const { Bubbler } = await import("./Bubbler.js");
return new Bubbler(container);
await engine.addInteractor("externalBubble", container => {
return Promise.resolve(new Bubbler(container));
}, refresh);

@@ -6,0 +6,0 @@ }

@@ -10,3 +10,3 @@ import { executeOnSingleOrMultiple, } from "@tsparticles/engine";

}
this.divs = executeOnSingleOrMultiple(data.divs, (div) => {
this.divs = executeOnSingleOrMultiple(data.divs, div => {
const tmp = new BubbleDiv();

@@ -13,0 +13,0 @@ tmp.load(div);

@@ -26,3 +26,3 @@ import { OptionsColor, executeOnSingleOrMultiple, isArray, } from "@tsparticles/engine";

const sourceColor = isArray(this.color) ? undefined : this.color;
this.color = executeOnSingleOrMultiple(data.color, (color) => {
this.color = executeOnSingleOrMultiple(data.color, color => {
return OptionsColor.create(sourceColor, color);

@@ -29,0 +29,0 @@ });

@@ -6,2 +6,3 @@ "use strict";

const Bubble_js_1 = require("./Options/Classes/Bubble.js");
const Enums_js_1 = require("./Enums.js");
const Utils_js_1 = require("./Utils.js");

@@ -24,3 +25,3 @@ const bubbleMode = "bubble", minDistance = 0, defaultClickTime = 0, double = 2, defaultOpacity = 1, ratioOffset = 1, defaultBubbleValue = 0, minRatio = 0, half = 0.5, defaultRatio = 1;

}
const query = container.particles.quadTree.queryCircle(mouseClickPos, distance, (p) => this.isEnabled(p)), { bubble } = container;
const query = container.particles.quadTree.queryCircle(mouseClickPos, distance, p => this.isEnabled(p)), { bubble } = container;
for (const particle of query) {

@@ -49,3 +50,3 @@ if (!bubble.clicking) {

},
type: "size",
type: Enums_js_1.ProcessBubbleType.size,
};

@@ -62,3 +63,3 @@ this._process(particle, distMouse, timeSpent, sizeData);

},
type: "opacity",
type: Enums_js_1.ProcessBubbleType.opacity,
};

@@ -79,3 +80,3 @@ this._process(particle, distMouse, timeSpent, opacityData);

}
const query = container.particles.quadTree.queryCircle(mousePos, distance, (p) => this.isEnabled(p));
const query = container.particles.quadTree.queryCircle(mousePos, distance, p => this.isEnabled(p));
for (const particle of query) {

@@ -160,6 +161,6 @@ particle.bubble.inRange = true;

if (pObjBubble) {
if (type === "size") {
if (type === Enums_js_1.ProcessBubbleType.size) {
delete particle.bubble.radius;
}
if (type === "opacity") {
if (type === Enums_js_1.ProcessBubbleType.opacity) {
delete particle.bubble.opacity;

@@ -174,6 +175,6 @@ }

const value = pObj - (timeSpent * (pObj - bubbleParam)) / bubbleDuration;
if (type === "size") {
if (type === Enums_js_1.ProcessBubbleType.size) {
particle.bubble.radius = value;
}
if (type === "opacity") {
if (type === Enums_js_1.ProcessBubbleType.opacity) {
particle.bubble.opacity = value;

@@ -184,6 +185,6 @@ }

else {
if (type === "size") {
if (type === Enums_js_1.ProcessBubbleType.size) {
delete particle.bubble.radius;
}
if (type === "opacity") {
if (type === Enums_js_1.ProcessBubbleType.opacity) {
delete particle.bubble.opacity;

@@ -199,9 +200,9 @@ }

}
selectors.forEach((item) => {
selectors.forEach(item => {
const elem = item, pxRatio = container.retina.pixelRatio, pos = {
x: (elem.offsetLeft + elem.offsetWidth * half) * pxRatio,
y: (elem.offsetTop + elem.offsetHeight * half) * pxRatio,
}, repulseRadius = elem.offsetWidth * half * pxRatio, area = div.type === "circle"
}, repulseRadius = elem.offsetWidth * half * pxRatio, area = div.type === engine_1.DivType.circle
? new engine_1.Circle(pos.x, pos.y, repulseRadius)
: new engine_1.Rectangle(elem.offsetLeft * pxRatio, elem.offsetTop * pxRatio, elem.offsetWidth * pxRatio, elem.offsetHeight * pxRatio), query = container.particles.quadTree.query(area, (p) => this.isEnabled(p));
: new engine_1.Rectangle(elem.offsetLeft * pxRatio, elem.offsetTop * pxRatio, elem.offsetWidth * pxRatio, elem.offsetHeight * pxRatio), query = container.particles.quadTree.query(area, p => this.isEnabled(p));
for (const particle of query) {

@@ -208,0 +209,0 @@ if (!area.contains(particle.getPosition())) {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ProcessBubbleType = void 0;
var ProcessBubbleType;
(function (ProcessBubbleType) {
ProcessBubbleType["color"] = "color";
ProcessBubbleType["opacity"] = "opacity";
ProcessBubbleType["size"] = "size";
})(ProcessBubbleType || (exports.ProcessBubbleType = ProcessBubbleType = {}));

@@ -18,6 +18,6 @@ "use strict";

exports.loadExternalBubbleInteraction = void 0;
const Bubbler_js_1 = require("./Bubbler.js");
async function loadExternalBubbleInteraction(engine, refresh = true) {
await engine.addInteractor("externalBubble", async (container) => {
const { Bubbler } = await import("./Bubbler.js");
return new Bubbler(container);
await engine.addInteractor("externalBubble", container => {
return Promise.resolve(new Bubbler_js_1.Bubbler(container));
}, refresh);

@@ -24,0 +24,0 @@ }

@@ -13,3 +13,3 @@ "use strict";

}
this.divs = (0, engine_1.executeOnSingleOrMultiple)(data.divs, (div) => {
this.divs = (0, engine_1.executeOnSingleOrMultiple)(data.divs, div => {
const tmp = new BubbleDiv_js_1.BubbleDiv();

@@ -16,0 +16,0 @@ tmp.load(div);

@@ -29,3 +29,3 @@ "use strict";

const sourceColor = (0, engine_1.isArray)(this.color) ? undefined : this.color;
this.color = (0, engine_1.executeOnSingleOrMultiple)(data.color, (color) => {
this.color = (0, engine_1.executeOnSingleOrMultiple)(data.color, color => {
return engine_1.OptionsColor.create(sourceColor, color);

@@ -32,0 +32,0 @@ });

@@ -1,3 +0,4 @@

import { Circle, ExternalInteractorBase, Rectangle, colorMix, divMode, divModeExecute, getDistance, getRangeMax, isDivModeEnabled, isInArray, itemFromSingleOrMultiple, millisecondsToSeconds, mouseLeaveEvent, mouseMoveEvent, rangeColorToHsl, rgbToHsl, } from "@tsparticles/engine";
import { Circle, DivType, ExternalInteractorBase, Rectangle, colorMix, divMode, divModeExecute, getDistance, getRangeMax, isDivModeEnabled, isInArray, itemFromSingleOrMultiple, millisecondsToSeconds, mouseLeaveEvent, mouseMoveEvent, rangeColorToHsl, rgbToHsl, } from "@tsparticles/engine";
import { Bubble } from "./Options/Classes/Bubble.js";
import { ProcessBubbleType } from "./Enums.js";
import { calculateBubbleValue } from "./Utils.js";

@@ -20,3 +21,3 @@ const bubbleMode = "bubble", minDistance = 0, defaultClickTime = 0, double = 2, defaultOpacity = 1, ratioOffset = 1, defaultBubbleValue = 0, minRatio = 0, half = 0.5, defaultRatio = 1;

}
const query = container.particles.quadTree.queryCircle(mouseClickPos, distance, (p) => this.isEnabled(p)), { bubble } = container;
const query = container.particles.quadTree.queryCircle(mouseClickPos, distance, p => this.isEnabled(p)), { bubble } = container;
for (const particle of query) {

@@ -45,3 +46,3 @@ if (!bubble.clicking) {

},
type: "size",
type: ProcessBubbleType.size,
};

@@ -58,3 +59,3 @@ this._process(particle, distMouse, timeSpent, sizeData);

},
type: "opacity",
type: ProcessBubbleType.opacity,
};

@@ -75,3 +76,3 @@ this._process(particle, distMouse, timeSpent, opacityData);

}
const query = container.particles.quadTree.queryCircle(mousePos, distance, (p) => this.isEnabled(p));
const query = container.particles.quadTree.queryCircle(mousePos, distance, p => this.isEnabled(p));
for (const particle of query) {

@@ -156,6 +157,6 @@ particle.bubble.inRange = true;

if (pObjBubble) {
if (type === "size") {
if (type === ProcessBubbleType.size) {
delete particle.bubble.radius;
}
if (type === "opacity") {
if (type === ProcessBubbleType.opacity) {
delete particle.bubble.opacity;

@@ -170,6 +171,6 @@ }

const value = pObj - (timeSpent * (pObj - bubbleParam)) / bubbleDuration;
if (type === "size") {
if (type === ProcessBubbleType.size) {
particle.bubble.radius = value;
}
if (type === "opacity") {
if (type === ProcessBubbleType.opacity) {
particle.bubble.opacity = value;

@@ -180,6 +181,6 @@ }

else {
if (type === "size") {
if (type === ProcessBubbleType.size) {
delete particle.bubble.radius;
}
if (type === "opacity") {
if (type === ProcessBubbleType.opacity) {
delete particle.bubble.opacity;

@@ -195,9 +196,9 @@ }

}
selectors.forEach((item) => {
selectors.forEach(item => {
const elem = item, pxRatio = container.retina.pixelRatio, pos = {
x: (elem.offsetLeft + elem.offsetWidth * half) * pxRatio,
y: (elem.offsetTop + elem.offsetHeight * half) * pxRatio,
}, repulseRadius = elem.offsetWidth * half * pxRatio, area = div.type === "circle"
}, repulseRadius = elem.offsetWidth * half * pxRatio, area = div.type === DivType.circle
? new Circle(pos.x, pos.y, repulseRadius)
: new Rectangle(elem.offsetLeft * pxRatio, elem.offsetTop * pxRatio, elem.offsetWidth * pxRatio, elem.offsetHeight * pxRatio), query = container.particles.quadTree.query(area, (p) => this.isEnabled(p));
: new Rectangle(elem.offsetLeft * pxRatio, elem.offsetTop * pxRatio, elem.offsetWidth * pxRatio, elem.offsetHeight * pxRatio), query = container.particles.quadTree.query(area, p => this.isEnabled(p));
for (const particle of query) {

@@ -204,0 +205,0 @@ if (!area.contains(particle.getPosition())) {

@@ -1,1 +0,6 @@

export {};
export var ProcessBubbleType;
(function (ProcessBubbleType) {
ProcessBubbleType["color"] = "color";
ProcessBubbleType["opacity"] = "opacity";
ProcessBubbleType["size"] = "size";
})(ProcessBubbleType || (ProcessBubbleType = {}));

@@ -0,5 +1,5 @@

import { Bubbler } from "./Bubbler.js";
export async function loadExternalBubbleInteraction(engine, refresh = true) {
await engine.addInteractor("externalBubble", async (container) => {
const { Bubbler } = await import("./Bubbler.js");
return new Bubbler(container);
await engine.addInteractor("externalBubble", container => {
return Promise.resolve(new Bubbler(container));
}, refresh);

@@ -6,0 +6,0 @@ }

@@ -10,3 +10,3 @@ import { executeOnSingleOrMultiple, } from "@tsparticles/engine";

}
this.divs = executeOnSingleOrMultiple(data.divs, (div) => {
this.divs = executeOnSingleOrMultiple(data.divs, div => {
const tmp = new BubbleDiv();

@@ -13,0 +13,0 @@ tmp.load(div);

@@ -26,3 +26,3 @@ import { OptionsColor, executeOnSingleOrMultiple, isArray, } from "@tsparticles/engine";

const sourceColor = isArray(this.color) ? undefined : this.color;
this.color = executeOnSingleOrMultiple(data.color, (color) => {
this.color = executeOnSingleOrMultiple(data.color, color => {
return OptionsColor.create(sourceColor, color);

@@ -29,0 +29,0 @@ });

{
"name": "@tsparticles/interaction-external-bubble",
"version": "3.3.0",
"version": "3.4.0",
"description": "tsParticles bubble external interaction",

@@ -90,3 +90,3 @@ "homepage": "https://particles.js.org",

"dependencies": {
"@tsparticles/engine": "^3.3.0"
"@tsparticles/engine": "^3.4.0"
},

@@ -93,0 +93,0 @@ "publishConfig": {

@@ -7,3 +7,3 @@ /*!

* How to use? : Check the GitHub README
* v3.3.0
* v3.4.0
*/

@@ -32,2 +32,22 @@ /*

/***/ "./dist/browser/Bubbler.js":
/*!*********************************!*\
!*** ./dist/browser/Bubbler.js ***!
\*********************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Bubbler: () => (/* binding */ Bubbler)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _Options_Classes_Bubble_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Options/Classes/Bubble.js */ \"./dist/browser/Options/Classes/Bubble.js\");\n/* harmony import */ var _Enums_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Enums.js */ \"./dist/browser/Enums.js\");\n/* harmony import */ var _Utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Utils.js */ \"./dist/browser/Utils.js\");\n\n\n\n\nconst bubbleMode = \"bubble\",\n minDistance = 0,\n defaultClickTime = 0,\n double = 2,\n defaultOpacity = 1,\n ratioOffset = 1,\n defaultBubbleValue = 0,\n minRatio = 0,\n half = 0.5,\n defaultRatio = 1;\nclass Bubbler extends _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.ExternalInteractorBase {\n constructor(container) {\n super(container);\n this._clickBubble = () => {\n const container = this.container,\n options = container.actualOptions,\n mouseClickPos = container.interactivity.mouse.clickPosition,\n bubbleOptions = options.interactivity.modes.bubble;\n if (!bubbleOptions || !mouseClickPos) {\n return;\n }\n if (!container.bubble) {\n container.bubble = {};\n }\n const distance = container.retina.bubbleModeDistance;\n if (!distance || distance < minDistance) {\n return;\n }\n const query = container.particles.quadTree.queryCircle(mouseClickPos, distance, p => this.isEnabled(p)),\n {\n bubble\n } = container;\n for (const particle of query) {\n if (!bubble.clicking) {\n continue;\n }\n particle.bubble.inRange = !bubble.durationEnd;\n const pos = particle.getPosition(),\n distMouse = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getDistance)(pos, mouseClickPos),\n timeSpent = (new Date().getTime() - (container.interactivity.mouse.clickTime ?? defaultClickTime)) / _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.millisecondsToSeconds;\n if (timeSpent > bubbleOptions.duration) {\n bubble.durationEnd = true;\n }\n if (timeSpent > bubbleOptions.duration * double) {\n bubble.clicking = false;\n bubble.durationEnd = false;\n }\n const sizeData = {\n bubbleObj: {\n optValue: container.retina.bubbleModeSize,\n value: particle.bubble.radius\n },\n particlesObj: {\n optValue: (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeMax)(particle.options.size.value) * container.retina.pixelRatio,\n value: particle.size.value\n },\n type: _Enums_js__WEBPACK_IMPORTED_MODULE_1__.ProcessBubbleType.size\n };\n this._process(particle, distMouse, timeSpent, sizeData);\n const opacityData = {\n bubbleObj: {\n optValue: bubbleOptions.opacity,\n value: particle.bubble.opacity\n },\n particlesObj: {\n optValue: (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeMax)(particle.options.opacity.value),\n value: particle.opacity?.value ?? defaultOpacity\n },\n type: _Enums_js__WEBPACK_IMPORTED_MODULE_1__.ProcessBubbleType.opacity\n };\n this._process(particle, distMouse, timeSpent, opacityData);\n if (!bubble.durationEnd && distMouse <= distance) {\n this._hoverBubbleColor(particle, distMouse);\n } else {\n delete particle.bubble.color;\n }\n }\n };\n this._hoverBubble = () => {\n const container = this.container,\n mousePos = container.interactivity.mouse.position,\n distance = container.retina.bubbleModeDistance;\n if (!distance || distance < minDistance || !mousePos) {\n return;\n }\n const query = container.particles.quadTree.queryCircle(mousePos, distance, p => this.isEnabled(p));\n for (const particle of query) {\n particle.bubble.inRange = true;\n const pos = particle.getPosition(),\n pointDistance = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getDistance)(pos, mousePos),\n ratio = ratioOffset - pointDistance / distance;\n if (pointDistance <= distance) {\n if (ratio >= minRatio && container.interactivity.status === _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.mouseMoveEvent) {\n this._hoverBubbleSize(particle, ratio);\n this._hoverBubbleOpacity(particle, ratio);\n this._hoverBubbleColor(particle, ratio);\n }\n } else {\n this.reset(particle);\n }\n if (container.interactivity.status === _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.mouseLeaveEvent) {\n this.reset(particle);\n }\n }\n };\n this._hoverBubbleColor = (particle, ratio, divBubble) => {\n const options = this.container.actualOptions,\n bubbleOptions = divBubble ?? options.interactivity.modes.bubble;\n if (!bubbleOptions) {\n return;\n }\n if (!particle.bubble.finalColor) {\n const modeColor = bubbleOptions.color;\n if (!modeColor) {\n return;\n }\n const bubbleColor = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.itemFromSingleOrMultiple)(modeColor);\n particle.bubble.finalColor = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.rangeColorToHsl)(bubbleColor);\n }\n if (!particle.bubble.finalColor) {\n return;\n }\n if (bubbleOptions.mix) {\n particle.bubble.color = undefined;\n const pColor = particle.getFillColor();\n particle.bubble.color = pColor ? (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.rgbToHsl)((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.colorMix)(pColor, particle.bubble.finalColor, ratioOffset - ratio, ratio)) : particle.bubble.finalColor;\n } else {\n particle.bubble.color = particle.bubble.finalColor;\n }\n };\n this._hoverBubbleOpacity = (particle, ratio, divBubble) => {\n const container = this.container,\n options = container.actualOptions,\n modeOpacity = divBubble?.opacity ?? options.interactivity.modes.bubble?.opacity;\n if (!modeOpacity) {\n return;\n }\n const optOpacity = particle.options.opacity.value,\n pOpacity = particle.opacity?.value ?? defaultOpacity,\n opacity = (0,_Utils_js__WEBPACK_IMPORTED_MODULE_2__.calculateBubbleValue)(pOpacity, modeOpacity, (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeMax)(optOpacity), ratio);\n if (opacity !== undefined) {\n particle.bubble.opacity = opacity;\n }\n };\n this._hoverBubbleSize = (particle, ratio, divBubble) => {\n const container = this.container,\n modeSize = divBubble?.size ? divBubble.size * container.retina.pixelRatio : container.retina.bubbleModeSize;\n if (modeSize === undefined) {\n return;\n }\n const optSize = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.getRangeMax)(particle.options.size.value) * container.retina.pixelRatio,\n pSize = particle.size.value,\n size = (0,_Utils_js__WEBPACK_IMPORTED_MODULE_2__.calculateBubbleValue)(pSize, modeSize, optSize, ratio);\n if (size !== undefined) {\n particle.bubble.radius = size;\n }\n };\n this._process = (particle, distMouse, timeSpent, data) => {\n const container = this.container,\n bubbleParam = data.bubbleObj.optValue,\n options = container.actualOptions,\n bubbleOptions = options.interactivity.modes.bubble;\n if (!bubbleOptions || bubbleParam === undefined) {\n return;\n }\n const bubbleDuration = bubbleOptions.duration,\n bubbleDistance = container.retina.bubbleModeDistance,\n particlesParam = data.particlesObj.optValue,\n pObjBubble = data.bubbleObj.value,\n pObj = data.particlesObj.value ?? defaultBubbleValue,\n type = data.type;\n if (!bubbleDistance || bubbleDistance < minDistance || bubbleParam === particlesParam) {\n return;\n }\n if (!container.bubble) {\n container.bubble = {};\n }\n if (container.bubble.durationEnd) {\n if (pObjBubble) {\n if (type === _Enums_js__WEBPACK_IMPORTED_MODULE_1__.ProcessBubbleType.size) {\n delete particle.bubble.radius;\n }\n if (type === _Enums_js__WEBPACK_IMPORTED_MODULE_1__.ProcessBubbleType.opacity) {\n delete particle.bubble.opacity;\n }\n }\n } else {\n if (distMouse <= bubbleDistance) {\n const obj = pObjBubble ?? pObj;\n if (obj !== bubbleParam) {\n const value = pObj - timeSpent * (pObj - bubbleParam) / bubbleDuration;\n if (type === _Enums_js__WEBPACK_IMPORTED_MODULE_1__.ProcessBubbleType.size) {\n particle.bubble.radius = value;\n }\n if (type === _Enums_js__WEBPACK_IMPORTED_MODULE_1__.ProcessBubbleType.opacity) {\n particle.bubble.opacity = value;\n }\n }\n } else {\n if (type === _Enums_js__WEBPACK_IMPORTED_MODULE_1__.ProcessBubbleType.size) {\n delete particle.bubble.radius;\n }\n if (type === _Enums_js__WEBPACK_IMPORTED_MODULE_1__.ProcessBubbleType.opacity) {\n delete particle.bubble.opacity;\n }\n }\n }\n };\n this._singleSelectorHover = (delta, selector, div) => {\n const container = this.container,\n selectors = document.querySelectorAll(selector),\n bubble = container.actualOptions.interactivity.modes.bubble;\n if (!bubble || !selectors.length) {\n return;\n }\n selectors.forEach(item => {\n const elem = item,\n pxRatio = container.retina.pixelRatio,\n pos = {\n x: (elem.offsetLeft + elem.offsetWidth * half) * pxRatio,\n y: (elem.offsetTop + elem.offsetHeight * half) * pxRatio\n },\n repulseRadius = elem.offsetWidth * half * pxRatio,\n area = div.type === _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.DivType.circle ? new _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.Circle(pos.x, pos.y, repulseRadius) : new _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.Rectangle(elem.offsetLeft * pxRatio, elem.offsetTop * pxRatio, elem.offsetWidth * pxRatio, elem.offsetHeight * pxRatio),\n query = container.particles.quadTree.query(area, p => this.isEnabled(p));\n for (const particle of query) {\n if (!area.contains(particle.getPosition())) {\n continue;\n }\n particle.bubble.inRange = true;\n const divs = bubble.divs,\n divBubble = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.divMode)(divs, elem);\n if (!particle.bubble.div || particle.bubble.div !== elem) {\n this.clear(particle, delta, true);\n particle.bubble.div = elem;\n }\n this._hoverBubbleSize(particle, defaultRatio, divBubble);\n this._hoverBubbleOpacity(particle, defaultRatio, divBubble);\n this._hoverBubbleColor(particle, defaultRatio, divBubble);\n }\n });\n };\n if (!container.bubble) {\n container.bubble = {};\n }\n this.handleClickMode = mode => {\n if (mode !== bubbleMode) {\n return;\n }\n if (!container.bubble) {\n container.bubble = {};\n }\n container.bubble.clicking = true;\n };\n }\n clear(particle, delta, force) {\n if (particle.bubble.inRange && !force) {\n return;\n }\n delete particle.bubble.div;\n delete particle.bubble.opacity;\n delete particle.bubble.radius;\n delete particle.bubble.color;\n }\n init() {\n const container = this.container,\n bubble = container.actualOptions.interactivity.modes.bubble;\n if (!bubble) {\n return;\n }\n container.retina.bubbleModeDistance = bubble.distance * container.retina.pixelRatio;\n if (bubble.size !== undefined) {\n container.retina.bubbleModeSize = bubble.size * container.retina.pixelRatio;\n }\n }\n interact(delta) {\n const options = this.container.actualOptions,\n events = options.interactivity.events,\n onHover = events.onHover,\n onClick = events.onClick,\n hoverEnabled = onHover.enable,\n hoverMode = onHover.mode,\n clickEnabled = onClick.enable,\n clickMode = onClick.mode,\n divs = events.onDiv;\n if (hoverEnabled && (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isInArray)(bubbleMode, hoverMode)) {\n this._hoverBubble();\n } else if (clickEnabled && (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isInArray)(bubbleMode, clickMode)) {\n this._clickBubble();\n } else {\n (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.divModeExecute)(bubbleMode, divs, (selector, div) => this._singleSelectorHover(delta, selector, div));\n }\n }\n isEnabled(particle) {\n const container = this.container,\n options = container.actualOptions,\n mouse = container.interactivity.mouse,\n events = (particle?.interactivity ?? options.interactivity).events,\n {\n onClick,\n onDiv,\n onHover\n } = events,\n divBubble = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isDivModeEnabled)(bubbleMode, onDiv);\n if (!(divBubble || onHover.enable && !!mouse.position || onClick.enable && mouse.clickPosition)) {\n return false;\n }\n return (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isInArray)(bubbleMode, onHover.mode) || (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isInArray)(bubbleMode, onClick.mode) || divBubble;\n }\n loadModeOptions(options, ...sources) {\n if (!options.bubble) {\n options.bubble = new _Options_Classes_Bubble_js__WEBPACK_IMPORTED_MODULE_3__.Bubble();\n }\n for (const source of sources) {\n options.bubble.load(source?.bubble);\n }\n }\n reset(particle) {\n particle.bubble.inRange = false;\n }\n}\n\n//# sourceURL=webpack://@tsparticles/interaction-external-bubble/./dist/browser/Bubbler.js?");
/***/ }),
/***/ "./dist/browser/Enums.js":
/*!*******************************!*\
!*** ./dist/browser/Enums.js ***!
\*******************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ ProcessBubbleType: () => (/* binding */ ProcessBubbleType)\n/* harmony export */ });\nvar ProcessBubbleType;\n(function (ProcessBubbleType) {\n ProcessBubbleType[\"color\"] = \"color\";\n ProcessBubbleType[\"opacity\"] = \"opacity\";\n ProcessBubbleType[\"size\"] = \"size\";\n})(ProcessBubbleType || (ProcessBubbleType = {}));\n\n//# sourceURL=webpack://@tsparticles/interaction-external-bubble/./dist/browser/Enums.js?");
/***/ }),
/***/ "./dist/browser/Options/Classes/Bubble.js":

@@ -63,2 +83,12 @@ /*!************************************************!*\

/***/ "./dist/browser/Utils.js":
/*!*******************************!*\
!*** ./dist/browser/Utils.js ***!
\*******************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ calculateBubbleValue: () => (/* binding */ calculateBubbleValue)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__);\n\nfunction calculateBubbleValue(particleValue, modeValue, optionsValue, ratio) {\n if (modeValue >= optionsValue) {\n const value = particleValue + (modeValue - optionsValue) * ratio;\n return (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.clamp)(value, particleValue, modeValue);\n } else if (modeValue < optionsValue) {\n const value = particleValue - (optionsValue - modeValue) * ratio;\n return (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.clamp)(value, modeValue, particleValue);\n }\n}\n\n//# sourceURL=webpack://@tsparticles/interaction-external-bubble/./dist/browser/Utils.js?");
/***/ }),
/***/ "./dist/browser/index.js":

@@ -70,3 +100,3 @@ /*!*******************************!*\

eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Bubble: () => (/* reexport safe */ _Options_Classes_Bubble_js__WEBPACK_IMPORTED_MODULE_2__.Bubble),\n/* harmony export */ BubbleBase: () => (/* reexport safe */ _Options_Classes_BubbleBase_js__WEBPACK_IMPORTED_MODULE_0__.BubbleBase),\n/* harmony export */ BubbleDiv: () => (/* reexport safe */ _Options_Classes_BubbleDiv_js__WEBPACK_IMPORTED_MODULE_1__.BubbleDiv),\n/* harmony export */ loadExternalBubbleInteraction: () => (/* binding */ loadExternalBubbleInteraction)\n/* harmony export */ });\n/* harmony import */ var _Options_Classes_BubbleBase_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Options/Classes/BubbleBase.js */ \"./dist/browser/Options/Classes/BubbleBase.js\");\n/* harmony import */ var _Options_Classes_BubbleDiv_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Options/Classes/BubbleDiv.js */ \"./dist/browser/Options/Classes/BubbleDiv.js\");\n/* harmony import */ var _Options_Classes_Bubble_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Options/Classes/Bubble.js */ \"./dist/browser/Options/Classes/Bubble.js\");\nasync function loadExternalBubbleInteraction(engine, refresh = true) {\n await engine.addInteractor(\"externalBubble\", async container => {\n const {\n Bubbler\n } = await __webpack_require__.e(/*! import() */ \"dist_browser_Bubbler_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./Bubbler.js */ \"./dist/browser/Bubbler.js\"));\n return new Bubbler(container);\n }, refresh);\n}\n\n\n\n\n\n\n\n//# sourceURL=webpack://@tsparticles/interaction-external-bubble/./dist/browser/index.js?");
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Bubble: () => (/* reexport safe */ _Options_Classes_Bubble_js__WEBPACK_IMPORTED_MODULE_3__.Bubble),\n/* harmony export */ BubbleBase: () => (/* reexport safe */ _Options_Classes_BubbleBase_js__WEBPACK_IMPORTED_MODULE_1__.BubbleBase),\n/* harmony export */ BubbleDiv: () => (/* reexport safe */ _Options_Classes_BubbleDiv_js__WEBPACK_IMPORTED_MODULE_2__.BubbleDiv),\n/* harmony export */ loadExternalBubbleInteraction: () => (/* binding */ loadExternalBubbleInteraction)\n/* harmony export */ });\n/* harmony import */ var _Bubbler_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Bubbler.js */ \"./dist/browser/Bubbler.js\");\n/* harmony import */ var _Options_Classes_BubbleBase_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Options/Classes/BubbleBase.js */ \"./dist/browser/Options/Classes/BubbleBase.js\");\n/* harmony import */ var _Options_Classes_BubbleDiv_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Options/Classes/BubbleDiv.js */ \"./dist/browser/Options/Classes/BubbleDiv.js\");\n/* harmony import */ var _Options_Classes_Bubble_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Options/Classes/Bubble.js */ \"./dist/browser/Options/Classes/Bubble.js\");\n\nasync function loadExternalBubbleInteraction(engine, refresh = true) {\n await engine.addInteractor(\"externalBubble\", container => {\n return Promise.resolve(new _Bubbler_js__WEBPACK_IMPORTED_MODULE_0__.Bubbler(container));\n }, refresh);\n}\n\n\n\n\n\n\n\n//# sourceURL=webpack://@tsparticles/interaction-external-bubble/./dist/browser/index.js?");

@@ -111,5 +141,2 @@ /***/ }),

/******/
/******/ // expose the modules object (__webpack_modules__)
/******/ __webpack_require__.m = __webpack_modules__;
/******/
/************************************************************************/

@@ -140,36 +167,2 @@ /******/ /* webpack/runtime/compat get default export */

/******/
/******/ /* webpack/runtime/ensure chunk */
/******/ (() => {
/******/ __webpack_require__.f = {};
/******/ // This file contains only the entry chunk.
/******/ // The chunk loading function for additional chunks
/******/ __webpack_require__.e = (chunkId) => {
/******/ return Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {
/******/ __webpack_require__.f[key](chunkId, promises);
/******/ return promises;
/******/ }, []));
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/get javascript chunk filename */
/******/ (() => {
/******/ // This function allow to reference async chunks
/******/ __webpack_require__.u = (chunkId) => {
/******/ // return url for filenames based on template
/******/ return "" + chunkId + ".js";
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/global */
/******/ (() => {
/******/ __webpack_require__.g = (function() {
/******/ if (typeof globalThis === 'object') return globalThis;
/******/ try {
/******/ return this || new Function('return this')();
/******/ } catch (e) {
/******/ if (typeof window === 'object') return window;
/******/ }
/******/ })();
/******/ })();
/******/
/******/ /* webpack/runtime/hasOwnProperty shorthand */

@@ -180,48 +173,2 @@ /******/ (() => {

/******/
/******/ /* webpack/runtime/load script */
/******/ (() => {
/******/ var inProgress = {};
/******/ var dataWebpackPrefix = "@tsparticles/interaction-external-bubble:";
/******/ // loadScript function to load a script via script tag
/******/ __webpack_require__.l = (url, done, key, chunkId) => {
/******/ if(inProgress[url]) { inProgress[url].push(done); return; }
/******/ var script, needAttach;
/******/ if(key !== undefined) {
/******/ var scripts = document.getElementsByTagName("script");
/******/ for(var i = 0; i < scripts.length; i++) {
/******/ var s = scripts[i];
/******/ if(s.getAttribute("src") == url || s.getAttribute("data-webpack") == dataWebpackPrefix + key) { script = s; break; }
/******/ }
/******/ }
/******/ if(!script) {
/******/ needAttach = true;
/******/ script = document.createElement('script');
/******/
/******/ script.charset = 'utf-8';
/******/ script.timeout = 120;
/******/ if (__webpack_require__.nc) {
/******/ script.setAttribute("nonce", __webpack_require__.nc);
/******/ }
/******/ script.setAttribute("data-webpack", dataWebpackPrefix + key);
/******/
/******/ script.src = url;
/******/ }
/******/ inProgress[url] = [done];
/******/ var onScriptComplete = (prev, event) => {
/******/ // avoid mem leaks in IE.
/******/ script.onerror = script.onload = null;
/******/ clearTimeout(timeout);
/******/ var doneFns = inProgress[url];
/******/ delete inProgress[url];
/******/ script.parentNode && script.parentNode.removeChild(script);
/******/ doneFns && doneFns.forEach((fn) => (fn(event)));
/******/ if(prev) return prev(event);
/******/ }
/******/ var timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);
/******/ script.onerror = onScriptComplete.bind(null, script.onerror);
/******/ script.onload = onScriptComplete.bind(null, script.onload);
/******/ needAttach && document.head.appendChild(script);
/******/ };
/******/ })();
/******/
/******/ /* webpack/runtime/make namespace object */

@@ -238,117 +185,2 @@ /******/ (() => {

/******/
/******/ /* webpack/runtime/publicPath */
/******/ (() => {
/******/ var scriptUrl;
/******/ if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + "";
/******/ var document = __webpack_require__.g.document;
/******/ if (!scriptUrl && document) {
/******/ if (document.currentScript)
/******/ scriptUrl = document.currentScript.src;
/******/ if (!scriptUrl) {
/******/ var scripts = document.getElementsByTagName("script");
/******/ if(scripts.length) {
/******/ var i = scripts.length - 1;
/******/ while (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src;
/******/ }
/******/ }
/******/ }
/******/ // When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration
/******/ // or pass an empty string ("") and set the __webpack_public_path__ variable from your code to use your own logic.
/******/ if (!scriptUrl) throw new Error("Automatic publicPath is not supported in this browser");
/******/ scriptUrl = scriptUrl.replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/");
/******/ __webpack_require__.p = scriptUrl;
/******/ })();
/******/
/******/ /* webpack/runtime/jsonp chunk loading */
/******/ (() => {
/******/ // no baseURI
/******/
/******/ // object to store loaded and loading chunks
/******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
/******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded
/******/ var installedChunks = {
/******/ "tsparticles.interaction.external.bubble": 0
/******/ };
/******/
/******/ __webpack_require__.f.j = (chunkId, promises) => {
/******/ // JSONP chunk loading for javascript
/******/ var installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;
/******/ if(installedChunkData !== 0) { // 0 means "already installed".
/******/
/******/ // a Promise means "currently loading".
/******/ if(installedChunkData) {
/******/ promises.push(installedChunkData[2]);
/******/ } else {
/******/ if(true) { // all chunks have JS
/******/ // setup Promise in chunk cache
/******/ var promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject]));
/******/ promises.push(installedChunkData[2] = promise);
/******/
/******/ // start chunk loading
/******/ var url = __webpack_require__.p + __webpack_require__.u(chunkId);
/******/ // create error before stack unwound to get useful stacktrace later
/******/ var error = new Error();
/******/ var loadingEnded = (event) => {
/******/ if(__webpack_require__.o(installedChunks, chunkId)) {
/******/ installedChunkData = installedChunks[chunkId];
/******/ if(installedChunkData !== 0) installedChunks[chunkId] = undefined;
/******/ if(installedChunkData) {
/******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type);
/******/ var realSrc = event && event.target && event.target.src;
/******/ error.message = 'Loading chunk ' + chunkId + ' failed.\n(' + errorType + ': ' + realSrc + ')';
/******/ error.name = 'ChunkLoadError';
/******/ error.type = errorType;
/******/ error.request = realSrc;
/******/ installedChunkData[1](error);
/******/ }
/******/ }
/******/ };
/******/ __webpack_require__.l(url, loadingEnded, "chunk-" + chunkId, chunkId);
/******/ }
/******/ }
/******/ }
/******/ };
/******/
/******/ // no prefetching
/******/
/******/ // no preloaded
/******/
/******/ // no HMR
/******/
/******/ // no HMR manifest
/******/
/******/ // no on chunks loaded
/******/
/******/ // install a JSONP callback for chunk loading
/******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => {
/******/ var chunkIds = data[0];
/******/ var moreModules = data[1];
/******/ var runtime = data[2];
/******/ // add "moreModules" to the modules object,
/******/ // then flag all "chunkIds" as loaded and fire callback
/******/ var moduleId, chunkId, i = 0;
/******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) {
/******/ for(moduleId in moreModules) {
/******/ if(__webpack_require__.o(moreModules, moduleId)) {
/******/ __webpack_require__.m[moduleId] = moreModules[moduleId];
/******/ }
/******/ }
/******/ if(runtime) var result = runtime(__webpack_require__);
/******/ }
/******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data);
/******/ for(;i < chunkIds.length; i++) {
/******/ chunkId = chunkIds[i];
/******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
/******/ installedChunks[chunkId][0]();
/******/ }
/******/ installedChunks[chunkId] = 0;
/******/ }
/******/
/******/ }
/******/
/******/ var chunkLoadingGlobal = this["webpackChunk_tsparticles_interaction_external_bubble"] = this["webpackChunk_tsparticles_interaction_external_bubble"] || [];
/******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));
/******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));
/******/ })();
/******/
/************************************************************************/

@@ -355,0 +187,0 @@ /******/

/*! For license information please see tsparticles.interaction.external.bubble.min.js.LICENSE.txt */
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@tsparticles/engine"));else if("function"==typeof define&&define.amd)define(["@tsparticles/engine"],t);else{var r="object"==typeof exports?t(require("@tsparticles/engine")):t(e.window);for(var o in r)("object"==typeof exports?exports:e)[o]=r[o]}}(this,(e=>(()=>{var t,r,o={510:(e,t,r)=>{r.d(t,{Z:()=>a});var o=r(303),i=r(567),n=r(807);class a extends i.u{load(e){super.load(e),e&&(this.divs=(0,o.executeOnSingleOrMultiple)(e.divs,(e=>{const t=new n.C;return t.load(e),t})))}}},567:(e,t,r)=>{r.d(t,{u:()=>i});var o=r(303);class i{constructor(){this.distance=200,this.duration=.4,this.mix=!1}load(e){if(e){if(void 0!==e.distance&&(this.distance=e.distance),void 0!==e.duration&&(this.duration=e.duration),void 0!==e.mix&&(this.mix=e.mix),void 0!==e.opacity&&(this.opacity=e.opacity),void 0!==e.color){const t=(0,o.isArray)(this.color)?void 0:this.color;this.color=(0,o.executeOnSingleOrMultiple)(e.color,(e=>o.OptionsColor.create(t,e)))}void 0!==e.size&&(this.size=e.size)}}}},807:(e,t,r)=>{r.d(t,{C:()=>i});var o=r(567);class i extends o.u{constructor(){super(),this.selectors=[]}load(e){super.load(e),e&&void 0!==e.selectors&&(this.selectors=e.selectors)}}},303:t=>{t.exports=e}},i={};function n(e){var t=i[e];if(void 0!==t)return t.exports;var r=i[e]={exports:{}};return o[e](r,r.exports,n),r.exports}n.m=o,n.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce(((t,r)=>(n.f[r](e,t),t)),[])),n.u=e=>e+".min.js",n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),t={},r="@tsparticles/interaction-external-bubble:",n.l=(e,o,i,a)=>{if(t[e])t[e].push(o);else{var s,l;if(void 0!==i)for(var c=document.getElementsByTagName("script"),u=0;u<c.length;u++){var d=c[u];if(d.getAttribute("src")==e||d.getAttribute("data-webpack")==r+i){s=d;break}}s||(l=!0,(s=document.createElement("script")).charset="utf-8",s.timeout=120,n.nc&&s.setAttribute("nonce",n.nc),s.setAttribute("data-webpack",r+i),s.src=e),t[e]=[o];var p=(r,o)=>{s.onerror=s.onload=null,clearTimeout(b);var i=t[e];if(delete t[e],s.parentNode&&s.parentNode.removeChild(s),i&&i.forEach((e=>e(o))),r)return r(o)},b=setTimeout(p.bind(null,void 0,{type:"timeout",target:s}),12e4);s.onerror=p.bind(null,s.onerror),s.onload=p.bind(null,s.onload),l&&document.head.appendChild(s)}},n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{var e;n.g.importScripts&&(e=n.g.location+"");var t=n.g.document;if(!e&&t&&(t.currentScript&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");if(r.length)for(var o=r.length-1;o>-1&&(!e||!/^http(s?):/.test(e));)e=r[o--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=e})(),(()=>{var e={108:0};n.f.j=(t,r)=>{var o=n.o(e,t)?e[t]:void 0;if(0!==o)if(o)r.push(o[2]);else{var i=new Promise(((r,i)=>o=e[t]=[r,i]));r.push(o[2]=i);var a=n.p+n.u(t),s=new Error;n.l(a,(r=>{if(n.o(e,t)&&(0!==(o=e[t])&&(e[t]=void 0),o)){var i=r&&("load"===r.type?"missing":r.type),a=r&&r.target&&r.target.src;s.message="Loading chunk "+t+" failed.\n("+i+": "+a+")",s.name="ChunkLoadError",s.type=i,s.request=a,o[1](s)}}),"chunk-"+t,t)}};var t=(t,r)=>{var o,i,a=r[0],s=r[1],l=r[2],c=0;if(a.some((t=>0!==e[t]))){for(o in s)n.o(s,o)&&(n.m[o]=s[o]);if(l)l(n)}for(t&&t(r);c<a.length;c++)i=a[c],n.o(e,i)&&e[i]&&e[i][0](),e[i]=0},r=this.webpackChunk_tsparticles_interaction_external_bubble=this.webpackChunk_tsparticles_interaction_external_bubble||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))})();var a={};return(()=>{n.r(a),n.d(a,{Bubble:()=>r.Z,BubbleBase:()=>e.u,BubbleDiv:()=>t.C,loadExternalBubbleInteraction:()=>o});var e=n(567),t=n(807),r=n(510);async function o(e,t=!0){await e.addInteractor("externalBubble",(async e=>{const{Bubbler:t}=await n.e(201).then(n.bind(n,201));return new t(e)}),t)}})(),a})()));
!function(e,t){if("object"==typeof exports&&"object"==typeof module)module.exports=t(require("@tsparticles/engine"));else if("function"==typeof define&&define.amd)define(["@tsparticles/engine"],t);else{var i="object"==typeof exports?t(require("@tsparticles/engine")):t(e.window);for(var o in i)("object"==typeof exports?exports:e)[o]=i[o]}}(this,(e=>(()=>{var t={303:t=>{t.exports=e}},i={};function o(e){var n=i[e];if(void 0!==n)return n.exports;var b=i[e]={exports:{}};return t[e](b,b.exports,o),b.exports}o.d=(e,t)=>{for(var i in t)o.o(t,i)&&!o.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},o.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),o.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var n={};return(()=>{o.r(n),o.d(n,{Bubble:()=>l,BubbleBase:()=>i,BubbleDiv:()=>b,loadExternalBubbleInteraction:()=>c});var e,t=o(303);class i{constructor(){this.distance=200,this.duration=.4,this.mix=!1}load(e){if(e){if(void 0!==e.distance&&(this.distance=e.distance),void 0!==e.duration&&(this.duration=e.duration),void 0!==e.mix&&(this.mix=e.mix),void 0!==e.opacity&&(this.opacity=e.opacity),void 0!==e.color){const i=(0,t.isArray)(this.color)?void 0:this.color;this.color=(0,t.executeOnSingleOrMultiple)(e.color,(e=>t.OptionsColor.create(i,e)))}void 0!==e.size&&(this.size=e.size)}}}class b extends i{constructor(){super(),this.selectors=[]}load(e){super.load(e),e&&void 0!==e.selectors&&(this.selectors=e.selectors)}}class l extends i{load(e){super.load(e),e&&(this.divs=(0,t.executeOnSingleOrMultiple)(e.divs,(e=>{const t=new b;return t.load(e),t})))}}function s(e,i,o,n){if(i>=o){const b=e+(i-o)*n;return(0,t.clamp)(b,e,i)}if(i<o){const b=e-(o-i)*n;return(0,t.clamp)(b,i,e)}}!function(e){e.color="color",e.opacity="opacity",e.size="size"}(e||(e={}));const r="bubble";class a extends t.ExternalInteractorBase{constructor(i){super(i),this._clickBubble=()=>{const i=this.container,o=i.actualOptions,n=i.interactivity.mouse.clickPosition,b=o.interactivity.modes.bubble;if(!b||!n)return;i.bubble||(i.bubble={});const l=i.retina.bubbleModeDistance;if(!l||l<0)return;const s=i.particles.quadTree.queryCircle(n,l,(e=>this.isEnabled(e))),{bubble:r}=i;for(const o of s){if(!r.clicking)continue;o.bubble.inRange=!r.durationEnd;const s=o.getPosition(),a=(0,t.getDistance)(s,n),c=((new Date).getTime()-(i.interactivity.mouse.clickTime??0))/t.millisecondsToSeconds;c>b.duration&&(r.durationEnd=!0),c>2*b.duration&&(r.clicking=!1,r.durationEnd=!1);const u={bubbleObj:{optValue:i.retina.bubbleModeSize,value:o.bubble.radius},particlesObj:{optValue:(0,t.getRangeMax)(o.options.size.value)*i.retina.pixelRatio,value:o.size.value},type:e.size};this._process(o,a,c,u);const d={bubbleObj:{optValue:b.opacity,value:o.bubble.opacity},particlesObj:{optValue:(0,t.getRangeMax)(o.options.opacity.value),value:o.opacity?.value??1},type:e.opacity};this._process(o,a,c,d),!r.durationEnd&&a<=l?this._hoverBubbleColor(o,a):delete o.bubble.color}},this._hoverBubble=()=>{const e=this.container,i=e.interactivity.mouse.position,o=e.retina.bubbleModeDistance;if(!o||o<0||!i)return;const n=e.particles.quadTree.queryCircle(i,o,(e=>this.isEnabled(e)));for(const b of n){b.bubble.inRange=!0;const n=b.getPosition(),l=(0,t.getDistance)(n,i),s=1-l/o;l<=o?s>=0&&e.interactivity.status===t.mouseMoveEvent&&(this._hoverBubbleSize(b,s),this._hoverBubbleOpacity(b,s),this._hoverBubbleColor(b,s)):this.reset(b),e.interactivity.status===t.mouseLeaveEvent&&this.reset(b)}},this._hoverBubbleColor=(e,i,o)=>{const n=this.container.actualOptions,b=o??n.interactivity.modes.bubble;if(b){if(!e.bubble.finalColor){const i=b.color;if(!i)return;const o=(0,t.itemFromSingleOrMultiple)(i);e.bubble.finalColor=(0,t.rangeColorToHsl)(o)}if(e.bubble.finalColor)if(b.mix){e.bubble.color=void 0;const o=e.getFillColor();e.bubble.color=o?(0,t.rgbToHsl)((0,t.colorMix)(o,e.bubble.finalColor,1-i,i)):e.bubble.finalColor}else e.bubble.color=e.bubble.finalColor}},this._hoverBubbleOpacity=(e,i,o)=>{const n=this.container.actualOptions,b=o?.opacity??n.interactivity.modes.bubble?.opacity;if(!b)return;const l=e.options.opacity.value,r=s(e.opacity?.value??1,b,(0,t.getRangeMax)(l),i);void 0!==r&&(e.bubble.opacity=r)},this._hoverBubbleSize=(e,i,o)=>{const n=this.container,b=o?.size?o.size*n.retina.pixelRatio:n.retina.bubbleModeSize;if(void 0===b)return;const l=(0,t.getRangeMax)(e.options.size.value)*n.retina.pixelRatio,r=s(e.size.value,b,l,i);void 0!==r&&(e.bubble.radius=r)},this._process=(t,i,o,n)=>{const b=this.container,l=n.bubbleObj.optValue,s=b.actualOptions.interactivity.modes.bubble;if(!s||void 0===l)return;const r=s.duration,a=b.retina.bubbleModeDistance,c=n.particlesObj.optValue,u=n.bubbleObj.value,d=n.particlesObj.value??0,p=n.type;if(a&&!(a<0)&&l!==c)if(b.bubble||(b.bubble={}),b.bubble.durationEnd)u&&(p===e.size&&delete t.bubble.radius,p===e.opacity&&delete t.bubble.opacity);else if(i<=a){if((u??d)!==l){const i=d-o*(d-l)/r;p===e.size&&(t.bubble.radius=i),p===e.opacity&&(t.bubble.opacity=i)}}else p===e.size&&delete t.bubble.radius,p===e.opacity&&delete t.bubble.opacity},this._singleSelectorHover=(e,i,o)=>{const n=this.container,b=document.querySelectorAll(i),l=n.actualOptions.interactivity.modes.bubble;l&&b.length&&b.forEach((i=>{const b=i,s=n.retina.pixelRatio,r={x:(b.offsetLeft+.5*b.offsetWidth)*s,y:(b.offsetTop+.5*b.offsetHeight)*s},a=.5*b.offsetWidth*s,c=o.type===t.DivType.circle?new t.Circle(r.x,r.y,a):new t.Rectangle(b.offsetLeft*s,b.offsetTop*s,b.offsetWidth*s,b.offsetHeight*s),u=n.particles.quadTree.query(c,(e=>this.isEnabled(e)));for(const i of u){if(!c.contains(i.getPosition()))continue;i.bubble.inRange=!0;const o=l.divs,n=(0,t.divMode)(o,b);i.bubble.div&&i.bubble.div===b||(this.clear(i,e,!0),i.bubble.div=b),this._hoverBubbleSize(i,1,n),this._hoverBubbleOpacity(i,1,n),this._hoverBubbleColor(i,1,n)}}))},i.bubble||(i.bubble={}),this.handleClickMode=e=>{e===r&&(i.bubble||(i.bubble={}),i.bubble.clicking=!0)}}clear(e,t,i){e.bubble.inRange&&!i||(delete e.bubble.div,delete e.bubble.opacity,delete e.bubble.radius,delete e.bubble.color)}init(){const e=this.container,t=e.actualOptions.interactivity.modes.bubble;t&&(e.retina.bubbleModeDistance=t.distance*e.retina.pixelRatio,void 0!==t.size&&(e.retina.bubbleModeSize=t.size*e.retina.pixelRatio))}interact(e){const i=this.container.actualOptions.interactivity.events,o=i.onHover,n=i.onClick,b=o.enable,l=o.mode,s=n.enable,a=n.mode,c=i.onDiv;b&&(0,t.isInArray)(r,l)?this._hoverBubble():s&&(0,t.isInArray)(r,a)?this._clickBubble():(0,t.divModeExecute)(r,c,((t,i)=>this._singleSelectorHover(e,t,i)))}isEnabled(e){const i=this.container,o=i.actualOptions,n=i.interactivity.mouse,b=(e?.interactivity??o.interactivity).events,{onClick:l,onDiv:s,onHover:a}=b,c=(0,t.isDivModeEnabled)(r,s);return!!(c||a.enable&&n.position||l.enable&&n.clickPosition)&&((0,t.isInArray)(r,a.mode)||(0,t.isInArray)(r,l.mode)||c)}loadModeOptions(e,...t){e.bubble||(e.bubble=new l);for(const i of t)e.bubble.load(i?.bubble)}reset(e){e.bubble.inRange=!1}}async function c(e,t=!0){await e.addInteractor("externalBubble",(e=>Promise.resolve(new a(e))),t)}})(),n})()));

@@ -1,1 +0,1 @@

/*! tsParticles Bubble External Interaction v3.3.0 by Matteo Bruni */
/*! tsParticles Bubble External Interaction v3.4.0 by Matteo Bruni */

@@ -1,2 +0,2 @@

export declare const enum ProcessBubbleType {
export declare enum ProcessBubbleType {
color = "color",

@@ -3,0 +3,0 @@ opacity = "opacity",

@@ -7,3 +7,3 @@ (function (factory) {

else if (typeof define === "function" && define.amd) {
define(["require", "exports", "@tsparticles/engine", "./Options/Classes/Bubble.js", "./Utils.js"], factory);
define(["require", "exports", "@tsparticles/engine", "./Options/Classes/Bubble.js", "./Enums.js", "./Utils.js"], factory);
}

@@ -16,2 +16,3 @@ })(function (require, exports) {

const Bubble_js_1 = require("./Options/Classes/Bubble.js");
const Enums_js_1 = require("./Enums.js");
const Utils_js_1 = require("./Utils.js");

@@ -34,3 +35,3 @@ const bubbleMode = "bubble", minDistance = 0, defaultClickTime = 0, double = 2, defaultOpacity = 1, ratioOffset = 1, defaultBubbleValue = 0, minRatio = 0, half = 0.5, defaultRatio = 1;

}
const query = container.particles.quadTree.queryCircle(mouseClickPos, distance, (p) => this.isEnabled(p)), { bubble } = container;
const query = container.particles.quadTree.queryCircle(mouseClickPos, distance, p => this.isEnabled(p)), { bubble } = container;
for (const particle of query) {

@@ -59,3 +60,3 @@ if (!bubble.clicking) {

},
type: "size",
type: Enums_js_1.ProcessBubbleType.size,
};

@@ -72,3 +73,3 @@ this._process(particle, distMouse, timeSpent, sizeData);

},
type: "opacity",
type: Enums_js_1.ProcessBubbleType.opacity,
};

@@ -89,3 +90,3 @@ this._process(particle, distMouse, timeSpent, opacityData);

}
const query = container.particles.quadTree.queryCircle(mousePos, distance, (p) => this.isEnabled(p));
const query = container.particles.quadTree.queryCircle(mousePos, distance, p => this.isEnabled(p));
for (const particle of query) {

@@ -170,6 +171,6 @@ particle.bubble.inRange = true;

if (pObjBubble) {
if (type === "size") {
if (type === Enums_js_1.ProcessBubbleType.size) {
delete particle.bubble.radius;
}
if (type === "opacity") {
if (type === Enums_js_1.ProcessBubbleType.opacity) {
delete particle.bubble.opacity;

@@ -184,6 +185,6 @@ }

const value = pObj - (timeSpent * (pObj - bubbleParam)) / bubbleDuration;
if (type === "size") {
if (type === Enums_js_1.ProcessBubbleType.size) {
particle.bubble.radius = value;
}
if (type === "opacity") {
if (type === Enums_js_1.ProcessBubbleType.opacity) {
particle.bubble.opacity = value;

@@ -194,6 +195,6 @@ }

else {
if (type === "size") {
if (type === Enums_js_1.ProcessBubbleType.size) {
delete particle.bubble.radius;
}
if (type === "opacity") {
if (type === Enums_js_1.ProcessBubbleType.opacity) {
delete particle.bubble.opacity;

@@ -209,9 +210,9 @@ }

}
selectors.forEach((item) => {
selectors.forEach(item => {
const elem = item, pxRatio = container.retina.pixelRatio, pos = {
x: (elem.offsetLeft + elem.offsetWidth * half) * pxRatio,
y: (elem.offsetTop + elem.offsetHeight * half) * pxRatio,
}, repulseRadius = elem.offsetWidth * half * pxRatio, area = div.type === "circle"
}, repulseRadius = elem.offsetWidth * half * pxRatio, area = div.type === engine_1.DivType.circle
? new engine_1.Circle(pos.x, pos.y, repulseRadius)
: new engine_1.Rectangle(elem.offsetLeft * pxRatio, elem.offsetTop * pxRatio, elem.offsetWidth * pxRatio, elem.offsetHeight * pxRatio), query = container.particles.quadTree.query(area, (p) => this.isEnabled(p));
: new engine_1.Rectangle(elem.offsetLeft * pxRatio, elem.offsetTop * pxRatio, elem.offsetWidth * pxRatio, elem.offsetHeight * pxRatio), query = container.particles.quadTree.query(area, p => this.isEnabled(p));
for (const particle of query) {

@@ -218,0 +219,0 @@ if (!area.contains(particle.getPosition())) {

@@ -12,2 +12,9 @@ (function (factory) {

Object.defineProperty(exports, "__esModule", { value: true });
exports.ProcessBubbleType = void 0;
var ProcessBubbleType;
(function (ProcessBubbleType) {
ProcessBubbleType["color"] = "color";
ProcessBubbleType["opacity"] = "opacity";
ProcessBubbleType["size"] = "size";
})(ProcessBubbleType || (exports.ProcessBubbleType = ProcessBubbleType = {}));
});

@@ -12,14 +12,2 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {

}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
var __exportStar = (this && this.__exportStar) || function(m, exports) {

@@ -34,13 +22,12 @@ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);

else if (typeof define === "function" && define.amd) {
define(["require", "exports", "./Options/Classes/BubbleBase.js", "./Options/Classes/BubbleDiv.js", "./Options/Classes/Bubble.js", "./Options/Interfaces/IBubbleBase.js", "./Options/Interfaces/IBubbleDiv.js", "./Options/Interfaces/IBubble.js"], factory);
define(["require", "exports", "./Bubbler.js", "./Options/Classes/BubbleBase.js", "./Options/Classes/BubbleDiv.js", "./Options/Classes/Bubble.js", "./Options/Interfaces/IBubbleBase.js", "./Options/Interfaces/IBubbleDiv.js", "./Options/Interfaces/IBubble.js"], factory);
}
})(function (require, exports) {
"use strict";
var __syncRequire = typeof module === "object" && typeof module.exports === "object";
Object.defineProperty(exports, "__esModule", { value: true });
exports.loadExternalBubbleInteraction = void 0;
const Bubbler_js_1 = require("./Bubbler.js");
async function loadExternalBubbleInteraction(engine, refresh = true) {
await engine.addInteractor("externalBubble", async (container) => {
const { Bubbler } = await (__syncRequire ? Promise.resolve().then(() => __importStar(require("./Bubbler.js"))) : new Promise((resolve_1, reject_1) => { require(["./Bubbler.js"], resolve_1, reject_1); }).then(__importStar));
return new Bubbler(container);
await engine.addInteractor("externalBubble", container => {
return Promise.resolve(new Bubbler_js_1.Bubbler(container));
}, refresh);

@@ -47,0 +34,0 @@ }

@@ -22,3 +22,3 @@ (function (factory) {

}
this.divs = (0, engine_1.executeOnSingleOrMultiple)(data.divs, (div) => {
this.divs = (0, engine_1.executeOnSingleOrMultiple)(data.divs, div => {
const tmp = new BubbleDiv_js_1.BubbleDiv();

@@ -25,0 +25,0 @@ tmp.load(div);

@@ -38,3 +38,3 @@ (function (factory) {

const sourceColor = (0, engine_1.isArray)(this.color) ? undefined : this.color;
this.color = (0, engine_1.executeOnSingleOrMultiple)(data.color, (color) => {
this.color = (0, engine_1.executeOnSingleOrMultiple)(data.color, color => {
return engine_1.OptionsColor.create(sourceColor, color);

@@ -41,0 +41,0 @@ });

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc