@tsparticles/interaction-external-bubble 3.9.1 → 4.0.0-alpha.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.
@@ -4,7 +4,7 @@
4
4
  * Demo / Generator : https://particles.js.org/
5
5
  * GitHub : https://www.github.com/matteobruni/tsparticles
6
6
  * How to use? : Check the GitHub README
7
- * v3.9.1
7
+ * v4.0.0-alpha.1
8
8
  */
9
9
  /*
10
10
  * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
@@ -28,85 +28,55 @@ return /******/ (() => { // webpackBootstrap
28
28
  /******/ "use strict";
29
29
  /******/ var __webpack_modules__ = ({
30
30
 
31
- /***/ "./dist/browser/Bubbler.js":
32
- /*!*********************************!*\
33
- !*** ./dist/browser/Bubbler.js ***!
34
- \*********************************/
35
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
36
-
37
- 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_1__ = __webpack_require__(/*! ./Options/Classes/Bubble.js */ \"./dist/browser/Options/Classes/Bubble.js\");\n/* harmony import */ var _Enums_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Enums.js */ \"./dist/browser/Enums.js\");\n/* harmony import */ var _Utils_js__WEBPACK_IMPORTED_MODULE_3__ = __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, engine) {\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_2__.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_2__.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)(this._engine, 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_3__.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_3__.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_2__.ProcessBubbleType.size) {\n delete particle.bubble.radius;\n }\n if (type === _Enums_js__WEBPACK_IMPORTED_MODULE_2__.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_2__.ProcessBubbleType.size) {\n particle.bubble.radius = value;\n }\n if (type === _Enums_js__WEBPACK_IMPORTED_MODULE_2__.ProcessBubbleType.opacity) {\n particle.bubble.opacity = value;\n }\n }\n } else {\n if (type === _Enums_js__WEBPACK_IMPORTED_MODULE_2__.ProcessBubbleType.size) {\n delete particle.bubble.radius;\n }\n if (type === _Enums_js__WEBPACK_IMPORTED_MODULE_2__.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 this._engine = engine;\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_1__.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?\n}");
38
-
39
- /***/ }),
40
-
41
- /***/ "./dist/browser/Enums.js":
42
- /*!*******************************!*\
43
- !*** ./dist/browser/Enums.js ***!
44
- \*******************************/
45
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
46
-
47
- 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?\n}");
48
-
49
- /***/ }),
50
-
51
- /***/ "./dist/browser/Options/Classes/Bubble.js":
31
+ /***/ "./dist/browser/Options/Classes/Bubble.js"
52
32
  /*!************************************************!*\
53
33
  !*** ./dist/browser/Options/Classes/Bubble.js ***!
54
34
  \************************************************/
55
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
35
+ (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
56
36
 
57
- eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Bubble: () => (/* binding */ Bubble)\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 _BubbleBase_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./BubbleBase.js */ \"./dist/browser/Options/Classes/BubbleBase.js\");\n/* harmony import */ var _BubbleDiv_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./BubbleDiv.js */ \"./dist/browser/Options/Classes/BubbleDiv.js\");\n\n\n\nclass Bubble extends _BubbleBase_js__WEBPACK_IMPORTED_MODULE_1__.BubbleBase {\n load(data) {\n super.load(data);\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isNull)(data)) {\n return;\n }\n this.divs = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.executeOnSingleOrMultiple)(data.divs, div => {\n const tmp = new _BubbleDiv_js__WEBPACK_IMPORTED_MODULE_2__.BubbleDiv();\n tmp.load(div);\n return tmp;\n });\n }\n}\n\n//# sourceURL=webpack://@tsparticles/interaction-external-bubble/./dist/browser/Options/Classes/Bubble.js?\n}");
37
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Bubble: () => (/* binding */ Bubble)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _BubbleBase_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./BubbleBase.js */ \"./dist/browser/Options/Classes/BubbleBase.js\");\n/* harmony import */ var _BubbleDiv_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./BubbleDiv.js */ \"./dist/browser/Options/Classes/BubbleDiv.js\");\n\n\n\nclass Bubble extends _BubbleBase_js__WEBPACK_IMPORTED_MODULE_1__.BubbleBase {\n load(data) {\n super.load(data);\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isNull)(data)) {\n return;\n }\n this.divs = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.executeOnSingleOrMultiple)(data.divs, div => {\n const tmp = new _BubbleDiv_js__WEBPACK_IMPORTED_MODULE_2__.BubbleDiv();\n tmp.load(div);\n return tmp;\n });\n }\n}\n\n//# sourceURL=webpack://@tsparticles/interaction-external-bubble/./dist/browser/Options/Classes/Bubble.js?\n}");
58
38
 
59
- /***/ }),
39
+ /***/ },
60
40
 
61
- /***/ "./dist/browser/Options/Classes/BubbleBase.js":
41
+ /***/ "./dist/browser/Options/Classes/BubbleBase.js"
62
42
  /*!****************************************************!*\
63
43
  !*** ./dist/browser/Options/Classes/BubbleBase.js ***!
64
44
  \****************************************************/
65
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
45
+ (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
66
46
 
67
- eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ BubbleBase: () => (/* binding */ BubbleBase)\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\nclass BubbleBase {\n constructor() {\n this.distance = 200;\n this.duration = 0.4;\n this.mix = false;\n }\n load(data) {\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isNull)(data)) {\n return;\n }\n if (data.distance !== undefined) {\n this.distance = data.distance;\n }\n if (data.duration !== undefined) {\n this.duration = data.duration;\n }\n if (data.mix !== undefined) {\n this.mix = data.mix;\n }\n if (data.opacity !== undefined) {\n this.opacity = data.opacity;\n }\n if (data.color !== undefined) {\n const sourceColor = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isArray)(this.color) ? undefined : this.color;\n this.color = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.executeOnSingleOrMultiple)(data.color, color => {\n return _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.OptionsColor.create(sourceColor, color);\n });\n }\n if (data.size !== undefined) {\n this.size = data.size;\n }\n }\n}\n\n//# sourceURL=webpack://@tsparticles/interaction-external-bubble/./dist/browser/Options/Classes/BubbleBase.js?\n}");
47
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ BubbleBase: () => (/* binding */ BubbleBase)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n\nclass BubbleBase {\n constructor() {\n this.distance = 200;\n this.duration = 0.4;\n this.mix = false;\n }\n load(data) {\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isNull)(data)) {\n return;\n }\n if (data.distance !== undefined) {\n this.distance = data.distance;\n }\n if (data.duration !== undefined) {\n this.duration = data.duration;\n }\n if (data.mix !== undefined) {\n this.mix = data.mix;\n }\n if (data.opacity !== undefined) {\n this.opacity = data.opacity;\n }\n if (data.color !== undefined) {\n const sourceColor = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isArray)(this.color) ? undefined : this.color;\n this.color = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.executeOnSingleOrMultiple)(data.color, color => {\n return _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.OptionsColor.create(sourceColor, color);\n });\n }\n if (data.size !== undefined) {\n this.size = data.size;\n }\n }\n}\n\n//# sourceURL=webpack://@tsparticles/interaction-external-bubble/./dist/browser/Options/Classes/BubbleBase.js?\n}");
68
48
 
69
- /***/ }),
49
+ /***/ },
70
50
 
71
- /***/ "./dist/browser/Options/Classes/BubbleDiv.js":
51
+ /***/ "./dist/browser/Options/Classes/BubbleDiv.js"
72
52
  /*!***************************************************!*\
73
53
  !*** ./dist/browser/Options/Classes/BubbleDiv.js ***!
74
54
  \***************************************************/
75
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
55
+ (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
76
56
 
77
- eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ BubbleDiv: () => (/* binding */ BubbleDiv)\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 _BubbleBase_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./BubbleBase.js */ \"./dist/browser/Options/Classes/BubbleBase.js\");\n\n\nclass BubbleDiv extends _BubbleBase_js__WEBPACK_IMPORTED_MODULE_1__.BubbleBase {\n constructor() {\n super();\n this.selectors = [];\n }\n load(data) {\n super.load(data);\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isNull)(data)) {\n return;\n }\n if (data.selectors !== undefined) {\n this.selectors = data.selectors;\n }\n }\n}\n\n//# sourceURL=webpack://@tsparticles/interaction-external-bubble/./dist/browser/Options/Classes/BubbleDiv.js?\n}");
57
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ BubbleDiv: () => (/* binding */ BubbleDiv)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _BubbleBase_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./BubbleBase.js */ \"./dist/browser/Options/Classes/BubbleBase.js\");\n\n\nclass BubbleDiv extends _BubbleBase_js__WEBPACK_IMPORTED_MODULE_1__.BubbleBase {\n constructor() {\n super();\n this.selectors = [];\n }\n load(data) {\n super.load(data);\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isNull)(data)) {\n return;\n }\n if (data.selectors !== undefined) {\n this.selectors = data.selectors;\n }\n }\n}\n\n//# sourceURL=webpack://@tsparticles/interaction-external-bubble/./dist/browser/Options/Classes/BubbleDiv.js?\n}");
78
58
 
79
- /***/ }),
59
+ /***/ },
80
60
 
81
- /***/ "./dist/browser/Utils.js":
82
- /*!*******************************!*\
83
- !*** ./dist/browser/Utils.js ***!
84
- \*******************************/
85
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
86
-
87
- 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?\n}");
88
-
89
- /***/ }),
90
-
91
- /***/ "./dist/browser/index.js":
61
+ /***/ "./dist/browser/index.js"
92
62
  /*!*******************************!*\
93
63
  !*** ./dist/browser/index.js ***!
94
64
  \*******************************/
95
- /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
65
+ (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
96
66
 
97
- 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 engine.checkVersion(\"3.9.1\");\n await engine.addInteractor(\"externalBubble\", container => {\n return Promise.resolve(new _Bubbler_js__WEBPACK_IMPORTED_MODULE_0__.Bubbler(container, engine));\n }, refresh);\n}\n\n\n\n\n\n\n\n//# sourceURL=webpack://@tsparticles/interaction-external-bubble/./dist/browser/index.js?\n}");
67
+ 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\");\nfunction loadExternalBubbleInteraction(engine) {\n engine.checkVersion(\"4.0.0-alpha.1\");\n engine.register(e => {\n e.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(e, container);\n });\n });\n}\n\n\n\n\n//# sourceURL=webpack://@tsparticles/interaction-external-bubble/./dist/browser/index.js?\n}");
98
68
 
99
- /***/ }),
69
+ /***/ },
100
70
 
101
- /***/ "@tsparticles/engine":
71
+ /***/ "@tsparticles/engine"
102
72
  /*!*********************************************************************************************************************************!*\
103
73
  !*** external {"commonjs":"@tsparticles/engine","commonjs2":"@tsparticles/engine","amd":"@tsparticles/engine","root":"window"} ***!
104
74
  \*********************************************************************************************************************************/
105
- /***/ ((module) => {
75
+ (module) {
106
76
 
107
77
  module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_engine__;
108
78
 
109
- /***/ })
79
+ /***/ }
110
80
 
111
81
  /******/ });
112
82
  /************************************************************************/
@@ -120,6 +90,12 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_engine__;
120
90
  /******/ if (cachedModule !== undefined) {
121
91
  /******/ return cachedModule.exports;
122
92
  /******/ }
93
+ /******/ // Check if module exists (development only)
94
+ /******/ if (__webpack_modules__[moduleId] === undefined) {
95
+ /******/ var e = new Error("Cannot find module '" + moduleId + "'");
96
+ /******/ e.code = 'MODULE_NOT_FOUND';
97
+ /******/ throw e;
98
+ /******/ }
123
99
  /******/ // Create a new module (and put it into the cache)
124
100
  /******/ var module = __webpack_module_cache__[moduleId] = {
125
101
  /******/ // no module.id needed
@@ -134,19 +110,10 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_engine__;
134
110
  /******/ return module.exports;
135
111
  /******/ }
136
112
  /******/
137
- /************************************************************************/
138
- /******/ /* webpack/runtime/compat get default export */
139
- /******/ (() => {
140
- /******/ // getDefaultExport function for compatibility with non-harmony modules
141
- /******/ __webpack_require__.n = (module) => {
142
- /******/ var getter = module && module.__esModule ?
143
- /******/ () => (module['default']) :
144
- /******/ () => (module);
145
- /******/ __webpack_require__.d(getter, { a: getter });
146
- /******/ return getter;
147
- /******/ };
148
- /******/ })();
113
+ /******/ // expose the modules object (__webpack_modules__)
114
+ /******/ __webpack_require__.m = __webpack_modules__;
149
115
  /******/
116
+ /************************************************************************/
150
117
  /******/ /* webpack/runtime/define property getters */
151
118
  /******/ (() => {
152
119
  /******/ // define getter functions for harmony exports
@@ -159,11 +126,90 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_engine__;
159
126
  /******/ };
160
127
  /******/ })();
161
128
  /******/
129
+ /******/ /* webpack/runtime/ensure chunk */
130
+ /******/ (() => {
131
+ /******/ __webpack_require__.f = {};
132
+ /******/ // This file contains only the entry chunk.
133
+ /******/ // The chunk loading function for additional chunks
134
+ /******/ __webpack_require__.e = (chunkId) => {
135
+ /******/ return Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {
136
+ /******/ __webpack_require__.f[key](chunkId, promises);
137
+ /******/ return promises;
138
+ /******/ }, []));
139
+ /******/ };
140
+ /******/ })();
141
+ /******/
142
+ /******/ /* webpack/runtime/get javascript chunk filename */
143
+ /******/ (() => {
144
+ /******/ // This function allow to reference async chunks
145
+ /******/ __webpack_require__.u = (chunkId) => {
146
+ /******/ // return url for filenames based on template
147
+ /******/ return "" + chunkId + ".js";
148
+ /******/ };
149
+ /******/ })();
150
+ /******/
151
+ /******/ /* webpack/runtime/global */
152
+ /******/ (() => {
153
+ /******/ __webpack_require__.g = (function() {
154
+ /******/ if (typeof globalThis === 'object') return globalThis;
155
+ /******/ try {
156
+ /******/ return this || new Function('return this')();
157
+ /******/ } catch (e) {
158
+ /******/ if (typeof window === 'object') return window;
159
+ /******/ }
160
+ /******/ })();
161
+ /******/ })();
162
+ /******/
162
163
  /******/ /* webpack/runtime/hasOwnProperty shorthand */
163
164
  /******/ (() => {
164
165
  /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
165
166
  /******/ })();
166
167
  /******/
168
+ /******/ /* webpack/runtime/load script */
169
+ /******/ (() => {
170
+ /******/ var inProgress = {};
171
+ /******/ var dataWebpackPrefix = "@tsparticles/interaction-external-bubble:";
172
+ /******/ // loadScript function to load a script via script tag
173
+ /******/ __webpack_require__.l = (url, done, key, chunkId) => {
174
+ /******/ if(inProgress[url]) { inProgress[url].push(done); return; }
175
+ /******/ var script, needAttach;
176
+ /******/ if(key !== undefined) {
177
+ /******/ var scripts = document.getElementsByTagName("script");
178
+ /******/ for(var i = 0; i < scripts.length; i++) {
179
+ /******/ var s = scripts[i];
180
+ /******/ if(s.getAttribute("src") == url || s.getAttribute("data-webpack") == dataWebpackPrefix + key) { script = s; break; }
181
+ /******/ }
182
+ /******/ }
183
+ /******/ if(!script) {
184
+ /******/ needAttach = true;
185
+ /******/ script = document.createElement('script');
186
+ /******/
187
+ /******/ script.charset = 'utf-8';
188
+ /******/ if (__webpack_require__.nc) {
189
+ /******/ script.setAttribute("nonce", __webpack_require__.nc);
190
+ /******/ }
191
+ /******/ script.setAttribute("data-webpack", dataWebpackPrefix + key);
192
+ /******/
193
+ /******/ script.src = url;
194
+ /******/ }
195
+ /******/ inProgress[url] = [done];
196
+ /******/ var onScriptComplete = (prev, event) => {
197
+ /******/ // avoid mem leaks in IE.
198
+ /******/ script.onerror = script.onload = null;
199
+ /******/ clearTimeout(timeout);
200
+ /******/ var doneFns = inProgress[url];
201
+ /******/ delete inProgress[url];
202
+ /******/ script.parentNode && script.parentNode.removeChild(script);
203
+ /******/ doneFns && doneFns.forEach((fn) => (fn(event)));
204
+ /******/ if(prev) return prev(event);
205
+ /******/ }
206
+ /******/ var timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);
207
+ /******/ script.onerror = onScriptComplete.bind(null, script.onerror);
208
+ /******/ script.onload = onScriptComplete.bind(null, script.onload);
209
+ /******/ needAttach && document.head.appendChild(script);
210
+ /******/ };
211
+ /******/ })();
212
+ /******/
167
213
  /******/ /* webpack/runtime/make namespace object */
168
214
  /******/ (() => {
169
215
  /******/ // define __esModule on exports
@@ -175,6 +221,119 @@ module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_engine__;
175
221
  /******/ };
176
222
  /******/ })();
177
223
  /******/
224
+ /******/ /* webpack/runtime/publicPath */
225
+ /******/ (() => {
226
+ /******/ var scriptUrl;
227
+ /******/ if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + "";
228
+ /******/ var document = __webpack_require__.g.document;
229
+ /******/ if (!scriptUrl && document) {
230
+ /******/ if (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT')
231
+ /******/ scriptUrl = document.currentScript.src;
232
+ /******/ if (!scriptUrl) {
233
+ /******/ var scripts = document.getElementsByTagName("script");
234
+ /******/ if(scripts.length) {
235
+ /******/ var i = scripts.length - 1;
236
+ /******/ while (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src;
237
+ /******/ }
238
+ /******/ }
239
+ /******/ }
240
+ /******/ // When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration
241
+ /******/ // or pass an empty string ("") and set the __webpack_public_path__ variable from your code to use your own logic.
242
+ /******/ if (!scriptUrl) throw new Error("Automatic publicPath is not supported in this browser");
243
+ /******/ scriptUrl = scriptUrl.replace(/^blob:/, "").replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/");
244
+ /******/ __webpack_require__.p = scriptUrl;
245
+ /******/ })();
246
+ /******/
247
+ /******/ /* webpack/runtime/jsonp chunk loading */
248
+ /******/ (() => {
249
+ /******/ // no baseURI
250
+ /******/
251
+ /******/ // object to store loaded and loading chunks
252
+ /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
253
+ /******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded
254
+ /******/ var installedChunks = {
255
+ /******/ "tsparticles.interaction.external.bubble": 0
256
+ /******/ };
257
+ /******/
258
+ /******/ __webpack_require__.f.j = (chunkId, promises) => {
259
+ /******/ // JSONP chunk loading for javascript
260
+ /******/ var installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;
261
+ /******/ if(installedChunkData !== 0) { // 0 means "already installed".
262
+ /******/
263
+ /******/ // a Promise means "currently loading".
264
+ /******/ if(installedChunkData) {
265
+ /******/ promises.push(installedChunkData[2]);
266
+ /******/ } else {
267
+ /******/ if(true) { // all chunks have JS
268
+ /******/ // setup Promise in chunk cache
269
+ /******/ var promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject]));
270
+ /******/ promises.push(installedChunkData[2] = promise);
271
+ /******/
272
+ /******/ // start chunk loading
273
+ /******/ var url = __webpack_require__.p + __webpack_require__.u(chunkId);
274
+ /******/ // create error before stack unwound to get useful stacktrace later
275
+ /******/ var error = new Error();
276
+ /******/ var loadingEnded = (event) => {
277
+ /******/ if(__webpack_require__.o(installedChunks, chunkId)) {
278
+ /******/ installedChunkData = installedChunks[chunkId];
279
+ /******/ if(installedChunkData !== 0) installedChunks[chunkId] = undefined;
280
+ /******/ if(installedChunkData) {
281
+ /******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type);
282
+ /******/ var realSrc = event && event.target && event.target.src;
283
+ /******/ error.message = 'Loading chunk ' + chunkId + ' failed.\n(' + errorType + ': ' + realSrc + ')';
284
+ /******/ error.name = 'ChunkLoadError';
285
+ /******/ error.type = errorType;
286
+ /******/ error.request = realSrc;
287
+ /******/ installedChunkData[1](error);
288
+ /******/ }
289
+ /******/ }
290
+ /******/ };
291
+ /******/ __webpack_require__.l(url, loadingEnded, "chunk-" + chunkId, chunkId);
292
+ /******/ }
293
+ /******/ }
294
+ /******/ }
295
+ /******/ };
296
+ /******/
297
+ /******/ // no prefetching
298
+ /******/
299
+ /******/ // no preloaded
300
+ /******/
301
+ /******/ // no HMR
302
+ /******/
303
+ /******/ // no HMR manifest
304
+ /******/
305
+ /******/ // no on chunks loaded
306
+ /******/
307
+ /******/ // install a JSONP callback for chunk loading
308
+ /******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => {
309
+ /******/ var [chunkIds, moreModules, runtime] = data;
310
+ /******/ // add "moreModules" to the modules object,
311
+ /******/ // then flag all "chunkIds" as loaded and fire callback
312
+ /******/ var moduleId, chunkId, i = 0;
313
+ /******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) {
314
+ /******/ for(moduleId in moreModules) {
315
+ /******/ if(__webpack_require__.o(moreModules, moduleId)) {
316
+ /******/ __webpack_require__.m[moduleId] = moreModules[moduleId];
317
+ /******/ }
318
+ /******/ }
319
+ /******/ if(runtime) var result = runtime(__webpack_require__);
320
+ /******/ }
321
+ /******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data);
322
+ /******/ for(;i < chunkIds.length; i++) {
323
+ /******/ chunkId = chunkIds[i];
324
+ /******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
325
+ /******/ installedChunks[chunkId][0]();
326
+ /******/ }
327
+ /******/ installedChunks[chunkId] = 0;
328
+ /******/ }
329
+ /******/
330
+ /******/ }
331
+ /******/
332
+ /******/ var chunkLoadingGlobal = this["webpackChunk_tsparticles_interaction_external_bubble"] = this["webpackChunk_tsparticles_interaction_external_bubble"] || [];
333
+ /******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));
334
+ /******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));
335
+ /******/ })();
336
+ /******/
178
337
  /************************************************************************/
179
338
  /******/
180
339
  /******/ // startup
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see tsparticles.interaction.external.bubble.min.js.LICENSE.txt */
2
- !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 l=i[e]={exports:{}};return t[e](l,l.exports,o),l.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={};o.r(n),o.d(n,{Bubble:()=>a,BubbleBase:()=>b,BubbleDiv:()=>r,loadExternalBubbleInteraction:()=>p});var l,s=o(303);class b{constructor(){this.distance=200,this.duration=.4,this.mix=!1}load(e){if(!(0,s.isNull)(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,s.isArray)(this.color)?void 0:this.color;this.color=(0,s.executeOnSingleOrMultiple)(e.color,(e=>s.OptionsColor.create(t,e)))}void 0!==e.size&&(this.size=e.size)}}}class r extends b{constructor(){super(),this.selectors=[]}load(e){super.load(e),(0,s.isNull)(e)||void 0!==e.selectors&&(this.selectors=e.selectors)}}class a extends b{load(e){super.load(e),(0,s.isNull)(e)||(this.divs=(0,s.executeOnSingleOrMultiple)(e.divs,(e=>{const t=new r;return t.load(e),t})))}}function c(e,t,i,o){if(t>=i){const n=e+(t-i)*o;return(0,s.clamp)(n,e,t)}if(t<i){const n=e-(i-t)*o;return(0,s.clamp)(n,t,e)}}!function(e){e.color="color",e.opacity="opacity",e.size="size"}(l||(l={}));const u="bubble";class d extends s.ExternalInteractorBase{constructor(e,t){super(e),this._clickBubble=()=>{const e=this.container,t=e.actualOptions,i=e.interactivity.mouse.clickPosition,o=t.interactivity.modes.bubble;if(!o||!i)return;e.bubble||(e.bubble={});const n=e.retina.bubbleModeDistance;if(!n||n<0)return;const b=e.particles.quadTree.queryCircle(i,n,(e=>this.isEnabled(e))),{bubble:r}=e;for(const t of b){if(!r.clicking)continue;t.bubble.inRange=!r.durationEnd;const b=t.getPosition(),a=(0,s.getDistance)(b,i),c=((new Date).getTime()-(e.interactivity.mouse.clickTime??0))/s.millisecondsToSeconds;c>o.duration&&(r.durationEnd=!0),c>2*o.duration&&(r.clicking=!1,r.durationEnd=!1);const u={bubbleObj:{optValue:e.retina.bubbleModeSize,value:t.bubble.radius},particlesObj:{optValue:(0,s.getRangeMax)(t.options.size.value)*e.retina.pixelRatio,value:t.size.value},type:l.size};this._process(t,a,c,u);const d={bubbleObj:{optValue:o.opacity,value:t.bubble.opacity},particlesObj:{optValue:(0,s.getRangeMax)(t.options.opacity.value),value:t.opacity?.value??1},type:l.opacity};this._process(t,a,c,d),!r.durationEnd&&a<=n?this._hoverBubbleColor(t,a):delete t.bubble.color}},this._hoverBubble=()=>{const e=this.container,t=e.interactivity.mouse.position,i=e.retina.bubbleModeDistance;if(!i||i<0||!t)return;const o=e.particles.quadTree.queryCircle(t,i,(e=>this.isEnabled(e)));for(const n of o){n.bubble.inRange=!0;const o=n.getPosition(),l=(0,s.getDistance)(o,t),b=1-l/i;l<=i?b>=0&&e.interactivity.status===s.mouseMoveEvent&&(this._hoverBubbleSize(n,b),this._hoverBubbleOpacity(n,b),this._hoverBubbleColor(n,b)):this.reset(n),e.interactivity.status===s.mouseLeaveEvent&&this.reset(n)}},this._hoverBubbleColor=(e,t,i)=>{const o=this.container.actualOptions,n=i??o.interactivity.modes.bubble;if(n){if(!e.bubble.finalColor){const t=n.color;if(!t)return;const i=(0,s.itemFromSingleOrMultiple)(t);e.bubble.finalColor=(0,s.rangeColorToHsl)(this._engine,i)}if(e.bubble.finalColor)if(n.mix){e.bubble.color=void 0;const i=e.getFillColor();e.bubble.color=i?(0,s.rgbToHsl)((0,s.colorMix)(i,e.bubble.finalColor,1-t,t)):e.bubble.finalColor}else e.bubble.color=e.bubble.finalColor}},this._hoverBubbleOpacity=(e,t,i)=>{const o=this.container.actualOptions,n=i?.opacity??o.interactivity.modes.bubble?.opacity;if(!n)return;const l=e.options.opacity.value,b=c(e.opacity?.value??1,n,(0,s.getRangeMax)(l),t);void 0!==b&&(e.bubble.opacity=b)},this._hoverBubbleSize=(e,t,i)=>{const o=this.container,n=i?.size?i.size*o.retina.pixelRatio:o.retina.bubbleModeSize;if(void 0===n)return;const l=(0,s.getRangeMax)(e.options.size.value)*o.retina.pixelRatio,b=c(e.size.value,n,l,t);void 0!==b&&(e.bubble.radius=b)},this._process=(e,t,i,o)=>{const n=this.container,s=o.bubbleObj.optValue,b=n.actualOptions.interactivity.modes.bubble;if(!b||void 0===s)return;const r=b.duration,a=n.retina.bubbleModeDistance,c=o.particlesObj.optValue,u=o.bubbleObj.value,d=o.particlesObj.value??0,p=o.type;if(a&&!(a<0)&&s!==c)if(n.bubble||(n.bubble={}),n.bubble.durationEnd)u&&(p===l.size&&delete e.bubble.radius,p===l.opacity&&delete e.bubble.opacity);else if(t<=a){if((u??d)!==s){const t=d-i*(d-s)/r;p===l.size&&(e.bubble.radius=t),p===l.opacity&&(e.bubble.opacity=t)}}else p===l.size&&delete e.bubble.radius,p===l.opacity&&delete e.bubble.opacity},this._singleSelectorHover=(e,t,i)=>{const o=this.container,n=document.querySelectorAll(t),l=o.actualOptions.interactivity.modes.bubble;l&&n.length&&n.forEach((t=>{const n=t,b=o.retina.pixelRatio,r={x:(n.offsetLeft+.5*n.offsetWidth)*b,y:(n.offsetTop+.5*n.offsetHeight)*b},a=.5*n.offsetWidth*b,c=i.type===s.DivType.circle?new s.Circle(r.x,r.y,a):new s.Rectangle(n.offsetLeft*b,n.offsetTop*b,n.offsetWidth*b,n.offsetHeight*b),u=o.particles.quadTree.query(c,(e=>this.isEnabled(e)));for(const t of u){if(!c.contains(t.getPosition()))continue;t.bubble.inRange=!0;const i=l.divs,o=(0,s.divMode)(i,n);t.bubble.div&&t.bubble.div===n||(this.clear(t,e,!0),t.bubble.div=n),this._hoverBubbleSize(t,1,o),this._hoverBubbleOpacity(t,1,o),this._hoverBubbleColor(t,1,o)}}))},this._engine=t,e.bubble||(e.bubble={}),this.handleClickMode=t=>{t===u&&(e.bubble||(e.bubble={}),e.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 t=this.container.actualOptions.interactivity.events,i=t.onHover,o=t.onClick,n=i.enable,l=i.mode,b=o.enable,r=o.mode,a=t.onDiv;n&&(0,s.isInArray)(u,l)?this._hoverBubble():b&&(0,s.isInArray)(u,r)?this._clickBubble():(0,s.divModeExecute)(u,a,((t,i)=>this._singleSelectorHover(e,t,i)))}isEnabled(e){const t=this.container,i=t.actualOptions,o=t.interactivity.mouse,n=(e?.interactivity??i.interactivity).events,{onClick:l,onDiv:b,onHover:r}=n,a=(0,s.isDivModeEnabled)(u,b);return!!(a||r.enable&&o.position||l.enable&&o.clickPosition)&&((0,s.isInArray)(u,r.mode)||(0,s.isInArray)(u,l.mode)||a)}loadModeOptions(e,...t){e.bubble||(e.bubble=new a);for(const i of t)e.bubble.load(i?.bubble)}reset(e){e.bubble.inRange=!1}}async function p(e,t=!0){e.checkVersion("3.9.1"),await e.addInteractor("externalBubble",(t=>Promise.resolve(new d(t,e))),t)}return n})()));
2
+ !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={105(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(!(0,o.isNull)(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)}}}},303(t){t.exports=e},729(e,t,r){r.d(t,{C:()=>n});var o=r(303),i=r(105);class n extends i.u{constructor(){super(),this.selectors=[]}load(e){super.load(e),(0,o.isNull)(e)||void 0!==e.selectors&&(this.selectors=e.selectors)}}},888(e,t,r){r.d(t,{Z:()=>a});var o=r(303),i=r(105),n=r(729);class a extends i.u{load(e){super.load(e),(0,o.isNull)(e)||(this.divs=(0,o.executeOnSingleOrMultiple)(e.divs,(e=>{const t=new n.C;return t.load(e),t})))}}}},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.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",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&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(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(/^blob:/,"").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,s,l]=r,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={};n.r(a),n.d(a,{Bubble:()=>c.Z,BubbleBase:()=>s.u,BubbleDiv:()=>l.C,loadExternalBubbleInteraction:()=>u});var s=n(105),l=n(729),c=n(888);function u(e){e.checkVersion("4.0.0-alpha.1"),e.register((e=>{e.addInteractor("externalBubble",(async t=>{const{Bubbler:r}=await n.e(809).then(n.bind(n,809));return new r(e,t)}))}))}return a})()));
@@ -1 +1 @@
1
- /*! tsParticles Bubble External Interaction v3.9.1 by Matteo Bruni */
1
+ /*! tsParticles Bubble External Interaction v4.0.0-alpha.1 by Matteo Bruni */
@@ -3,8 +3,8 @@ import { type Engine, ExternalInteractorBase, type IDelta, type IModes, type Mod
3
3
  export declare class Bubbler extends ExternalInteractorBase<BubbleContainer> {
4
4
  handleClickMode: (mode: string) => void;
5
5
  private readonly _engine;
6
- constructor(container: BubbleContainer, engine: Engine);
7
- clear(particle: Particle, delta: IDelta, force?: boolean): void;
6
+ constructor(engine: Engine, container: BubbleContainer);
7
+ clear(particle: Particle, _delta: IDelta, force?: boolean): void;
8
8
  init(): void;
9
9
  interact(delta: IDelta): void;
10
10
  isEnabled(particle?: Particle): boolean;
package/types/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
1
  import { type Engine } from "@tsparticles/engine";
2
- export declare function loadExternalBubbleInteraction(engine: Engine, refresh?: boolean): Promise<void>;
2
+ export declare function loadExternalBubbleInteraction(engine: Engine): void;
3
3
  export * from "./Options/Classes/BubbleBase.js";
4
4
  export * from "./Options/Classes/BubbleDiv.js";
5
5
  export * from "./Options/Classes/Bubble.js";
6
- export * from "./Options/Interfaces/IBubbleBase.js";
7
- export * from "./Options/Interfaces/IBubbleDiv.js";
8
- export * from "./Options/Interfaces/IBubble.js";
6
+ export type * from "./Options/Interfaces/IBubbleBase.js";
7
+ export type * from "./Options/Interfaces/IBubbleDiv.js";
8
+ export type * from "./Options/Interfaces/IBubble.js";
package/umd/Bubbler.js CHANGED
@@ -16,16 +16,14 @@
16
16
  const Utils_js_1 = require("./Utils.js");
17
17
  const bubbleMode = "bubble", minDistance = 0, defaultClickTime = 0, double = 2, defaultOpacity = 1, ratioOffset = 1, defaultBubbleValue = 0, minRatio = 0, half = 0.5, defaultRatio = 1;
18
18
  class Bubbler extends engine_1.ExternalInteractorBase {
19
- constructor(container, engine) {
19
+ constructor(engine, container) {
20
20
  super(container);
21
21
  this._clickBubble = () => {
22
22
  const container = this.container, options = container.actualOptions, mouseClickPos = container.interactivity.mouse.clickPosition, bubbleOptions = options.interactivity.modes.bubble;
23
23
  if (!bubbleOptions || !mouseClickPos) {
24
24
  return;
25
25
  }
26
- if (!container.bubble) {
27
- container.bubble = {};
28
- }
26
+ container.bubble ??= {};
29
27
  const distance = container.retina.bubbleModeDistance;
30
28
  if (!distance || distance < minDistance) {
31
29
  return;
@@ -157,9 +155,7 @@
157
155
  if (!bubbleDistance || bubbleDistance < minDistance || bubbleParam === particlesParam) {
158
156
  return;
159
157
  }
160
- if (!container.bubble) {
161
- container.bubble = {};
162
- }
158
+ container.bubble ??= {};
163
159
  if (container.bubble.durationEnd) {
164
160
  if (pObjBubble) {
165
161
  if (type === Enums_js_1.ProcessBubbleType.size) {
@@ -194,7 +190,7 @@
194
190
  }
195
191
  };
196
192
  this._singleSelectorHover = (delta, selector, div) => {
197
- const container = this.container, selectors = document.querySelectorAll(selector), bubble = container.actualOptions.interactivity.modes.bubble;
193
+ const container = this.container, selectors = (0, engine_1.safeDocument)().querySelectorAll(selector), bubble = container.actualOptions.interactivity.modes.bubble;
198
194
  if (!bubble || !selectors.length) {
199
195
  return;
200
196
  }
@@ -222,20 +218,16 @@
222
218
  });
223
219
  };
224
220
  this._engine = engine;
225
- if (!container.bubble) {
226
- container.bubble = {};
227
- }
221
+ container.bubble ??= {};
228
222
  this.handleClickMode = (mode) => {
229
223
  if (mode !== bubbleMode) {
230
224
  return;
231
225
  }
232
- if (!container.bubble) {
233
- container.bubble = {};
234
- }
226
+ container.bubble ??= {};
235
227
  container.bubble.clicking = true;
236
228
  };
237
229
  }
238
- clear(particle, delta, force) {
230
+ clear(particle, _delta, force) {
239
231
  if (particle.bubble.inRange && !force) {
240
232
  return;
241
233
  }
@@ -263,7 +255,9 @@
263
255
  this._clickBubble();
264
256
  }
265
257
  else {
266
- (0, engine_1.divModeExecute)(bubbleMode, divs, (selector, div) => this._singleSelectorHover(delta, selector, div));
258
+ (0, engine_1.divModeExecute)(bubbleMode, divs, (selector, div) => {
259
+ this._singleSelectorHover(delta, selector, div);
260
+ });
267
261
  }
268
262
  }
269
263
  isEnabled(particle) {
@@ -274,9 +268,7 @@
274
268
  return (0, engine_1.isInArray)(bubbleMode, onHover.mode) || (0, engine_1.isInArray)(bubbleMode, onClick.mode) || divBubble;
275
269
  }
276
270
  loadModeOptions(options, ...sources) {
277
- if (!options.bubble) {
278
- options.bubble = new Bubble_js_1.Bubble();
279
- }
271
+ options.bubble ??= new Bubble_js_1.Bubble();
280
272
  for (const source of sources) {
281
273
  options.bubble.load(source?.bubble);
282
274
  }
package/umd/Utils.js CHANGED
@@ -20,5 +20,6 @@
20
20
  const value = particleValue - (optionsValue - modeValue) * ratio;
21
21
  return (0, engine_1.clamp)(value, modeValue, particleValue);
22
22
  }
23
+ return undefined;
23
24
  }
24
25
  });