@tsparticles/interaction-light 4.0.0-beta.11 → 4.0.0-beta.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,397 +1,259 @@
1
- /*!
2
- * Author : Matteo Bruni
3
- * MIT license: https://opensource.org/licenses/MIT
4
- * Demo / Generator : https://particles.js.org/
5
- * GitHub : https://www.github.com/matteobruni/tsparticles
6
- * How to use? : Check the GitHub README
7
- * v4.0.0-beta.11
8
- */
9
- /*
10
- * ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
11
- * This devtool is neither made for production nor for readable output files.
12
- * It uses "eval()" calls to create a separate source file in the browser devtools.
13
- * If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
14
- * or disable the default devtool with "devtool: false".
15
- * If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
16
- */
17
- (function webpackUniversalModuleDefinition(root, factory) {
18
- if(typeof exports === 'object' && typeof module === 'object')
19
- module.exports = factory(require("@tsparticles/engine"), require("@tsparticles/plugin-interactivity"));
20
- else if(typeof define === 'function' && define.amd)
21
- define(["@tsparticles/engine", "@tsparticles/plugin-interactivity"], factory);
22
- else {
23
- var a = typeof exports === 'object' ? factory(require("@tsparticles/engine"), require("@tsparticles/plugin-interactivity")) : factory(root["window"], root["window"]);
24
- for(var i in a) (typeof exports === 'object' ? exports : root)[i] = a[i];
25
- }
26
- })(this, (__WEBPACK_EXTERNAL_MODULE__tsparticles_engine__, __WEBPACK_EXTERNAL_MODULE__tsparticles_plugin_interactivity__) => {
27
- return /******/ (() => { // webpackBootstrap
28
- /******/ "use strict";
29
- /******/ var __webpack_modules__ = ({
1
+ (function(g){g.__tsParticlesInternals=g.__tsParticlesInternals||{};g.__tsParticlesInternals.bundles=g.__tsParticlesInternals.bundles||{};g.__tsParticlesInternals.effects=g.__tsParticlesInternals.effects||{};g.__tsParticlesInternals.engine=g.__tsParticlesInternals.engine||{};g.__tsParticlesInternals.interactions=g.__tsParticlesInternals.interactions||{};g.__tsParticlesInternals.palettes=g.__tsParticlesInternals.palettes||{};g.__tsParticlesInternals.paths=g.__tsParticlesInternals.paths||{};g.__tsParticlesInternals.plugins=g.__tsParticlesInternals.plugins||{};g.__tsParticlesInternals.plugins=g.__tsParticlesInternals.plugins||{};g.__tsParticlesInternals.plugins.emittersShapes=g.__tsParticlesInternals.plugins.emittersShapes||{};g.__tsParticlesInternals.presets=g.__tsParticlesInternals.presets||{};g.__tsParticlesInternals.shapes=g.__tsParticlesInternals.shapes||{};g.__tsParticlesInternals.updaters=g.__tsParticlesInternals.updaters||{};g.__tsParticlesInternals.utils=g.__tsParticlesInternals.utils||{};g.__tsParticlesInternals.canvas=g.__tsParticlesInternals.canvas||{};g.__tsParticlesInternals.canvas=g.__tsParticlesInternals.canvas||{};g.__tsParticlesInternals.canvas.utils=g.__tsParticlesInternals.canvas.utils||{};g.__tsParticlesInternals.path=g.__tsParticlesInternals.path||{};g.__tsParticlesInternals.path=g.__tsParticlesInternals.path||{};g.__tsParticlesInternals.path.utils=g.__tsParticlesInternals.path.utils||{};var __tsProxyFactory=typeof Proxy!=="undefined"?function(obj){return new Proxy(obj,{get:function(target,key){if(!(key in target)){target[key]={};}return target[key];}});}:function(obj){return obj;};g.__tsParticlesInternals.bundles=__tsProxyFactory(g.__tsParticlesInternals.bundles);g.__tsParticlesInternals.effects=__tsProxyFactory(g.__tsParticlesInternals.effects);g.__tsParticlesInternals.interactions=__tsProxyFactory(g.__tsParticlesInternals.interactions);g.__tsParticlesInternals.palettes=__tsProxyFactory(g.__tsParticlesInternals.palettes);g.__tsParticlesInternals.paths=__tsProxyFactory(g.__tsParticlesInternals.paths);g.__tsParticlesInternals.plugins=__tsProxyFactory(g.__tsParticlesInternals.plugins);g.__tsParticlesInternals.plugins.emittersShapes=__tsProxyFactory(g.__tsParticlesInternals.plugins.emittersShapes);g.__tsParticlesInternals.presets=__tsProxyFactory(g.__tsParticlesInternals.presets);g.__tsParticlesInternals.shapes=__tsProxyFactory(g.__tsParticlesInternals.shapes);g.__tsParticlesInternals.updaters=__tsProxyFactory(g.__tsParticlesInternals.updaters);g.__tsParticlesInternals.utils=__tsProxyFactory(g.__tsParticlesInternals.utils);g.__tsParticlesInternals.canvas=__tsProxyFactory(g.__tsParticlesInternals.canvas);g.__tsParticlesInternals.path=__tsProxyFactory(g.__tsParticlesInternals.path);g.tsparticlesInternalExports=g.tsparticlesInternalExports||{};})(typeof globalThis!=="undefined"?globalThis:typeof window!=="undefined"?window:this);
2
+ /* Interaction v4.0.0-beta.15 */
3
+ (function (global, factory) {
4
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@tsparticles/plugin-interactivity'), require('@tsparticles/engine')) :
5
+ typeof define === 'function' && define.amd ? define(['exports', '@tsparticles/plugin-interactivity', '@tsparticles/engine'], factory) :
6
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.__tsParticlesInternals = global.__tsParticlesInternals || {}, global.__tsParticlesInternals.interactions = global.__tsParticlesInternals.interactions || {}, global.__tsParticlesInternals.interactions.light = global.__tsParticlesInternals.interactions.light || {}), global.__tsParticlesInternals.plugins.interactivity, global.__tsParticlesInternals.engine));
7
+ })(this, (function (exports, pluginInteractivity, engine) { 'use strict';
30
8
 
31
- /***/ "@tsparticles/engine"
32
- /*!*********************************************************************************************************************************!*\
33
- !*** external {"commonjs":"@tsparticles/engine","commonjs2":"@tsparticles/engine","amd":"@tsparticles/engine","root":"window"} ***!
34
- \*********************************************************************************************************************************/
35
- (module) {
9
+ const gradientPos = {
10
+ max: 1,
11
+ min: 0,
12
+ }, halfPI = Math.PI * engine.half, quarterPI = Math.PI * engine.quarter, arcStart = 0;
13
+ const lightMode = "light";
14
+ function drawLight(container, context, mousePos) {
15
+ const lightOptions = container.actualOptions.interactivity?.modes.light?.area;
16
+ if (!lightOptions) {
17
+ return;
18
+ }
19
+ context.beginPath();
20
+ context.arc(mousePos.x, mousePos.y, lightOptions.radius, arcStart, engine.doublePI);
21
+ const gradientAmbientLight = context.createRadialGradient(mousePos.x, mousePos.y, arcStart, mousePos.x, mousePos.y, lightOptions.radius), gradientRgb = container.canvas.mouseLight;
22
+ if (!gradientRgb?.start || !gradientRgb.stop) {
23
+ return;
24
+ }
25
+ gradientAmbientLight.addColorStop(gradientPos.min, engine.getStyleFromRgb(gradientRgb.start, container.hdr));
26
+ gradientAmbientLight.addColorStop(gradientPos.max, engine.getStyleFromRgb(gradientRgb.stop, container.hdr));
27
+ context.fillStyle = gradientAmbientLight;
28
+ context.fill();
29
+ }
30
+ function drawParticleShadow(container, context, particle, mousePos) {
31
+ const pos = particle.getPosition(), shadowOptions = container.actualOptions.interactivity?.modes.light?.shadow;
32
+ if (!shadowOptions) {
33
+ return;
34
+ }
35
+ const shadowRgb = particle.lightShadow;
36
+ if (!shadowRgb) {
37
+ return;
38
+ }
39
+ const radius = particle.getRadius(), sides = particle.sides, full = engine.doublePI / sides, angle = -particle.rotation + quarterPI, factor = 1, dots = [];
40
+ for (let i = 0; i < sides; i++) {
41
+ dots.push({
42
+ x: pos.x + radius * Math.sin(angle + full * i) * factor,
43
+ y: pos.y + radius * Math.cos(angle + full * i) * factor,
44
+ });
45
+ }
46
+ const points = [], shadowLength = shadowOptions.length;
47
+ for (const dot of dots) {
48
+ const dotAngle = Math.atan2(mousePos.y - dot.y, mousePos.x - dot.x), end = {
49
+ x: dot.x + shadowLength * Math.sin(-dotAngle - halfPI),
50
+ y: dot.y + shadowLength * Math.cos(-dotAngle - halfPI),
51
+ };
52
+ points.push({
53
+ end: end,
54
+ start: dot,
55
+ });
56
+ }
57
+ const shadowColor = engine.getStyleFromRgb(shadowRgb, container.hdr), lastOffset = 1, firstPos = 0, last = points.length - lastOffset;
58
+ for (let i = last, n = 0; i >= firstPos; n = i--) {
59
+ context.beginPath();
60
+ const iPoint = points[i], nPoint = points[n];
61
+ if (!iPoint || !nPoint) {
62
+ continue;
63
+ }
64
+ context.moveTo(iPoint.start.x, iPoint.start.y);
65
+ context.lineTo(nPoint.start.x, nPoint.start.y);
66
+ context.lineTo(nPoint.end.x, nPoint.end.y);
67
+ context.lineTo(iPoint.end.x, iPoint.end.y);
68
+ context.fillStyle = shadowColor;
69
+ context.fill();
70
+ }
71
+ }
36
72
 
37
- module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_engine__;
73
+ class LightGradient {
74
+ start;
75
+ stop;
76
+ constructor() {
77
+ this.start = new engine.OptionsColor();
78
+ this.stop = new engine.OptionsColor();
79
+ this.start.value = "#ffffff";
80
+ this.stop.value = "#000000";
81
+ }
82
+ load(data) {
83
+ if (engine.isNull(data)) {
84
+ return;
85
+ }
86
+ this.start = engine.OptionsColor.create(this.start, data.start);
87
+ this.stop = engine.OptionsColor.create(this.stop, data.stop);
88
+ }
89
+ }
38
90
 
39
- /***/ },
91
+ class LightArea {
92
+ gradient;
93
+ radius;
94
+ constructor() {
95
+ this.gradient = new LightGradient();
96
+ this.radius = 1000;
97
+ }
98
+ load(data) {
99
+ if (engine.isNull(data)) {
100
+ return;
101
+ }
102
+ this.gradient.load(data.gradient);
103
+ if (data.radius !== undefined) {
104
+ this.radius = data.radius;
105
+ }
106
+ }
107
+ }
40
108
 
41
- /***/ "@tsparticles/plugin-interactivity"
42
- /*!***************************************************************************************************************************************************************************!*\
43
- !*** external {"commonjs":"@tsparticles/plugin-interactivity","commonjs2":"@tsparticles/plugin-interactivity","amd":"@tsparticles/plugin-interactivity","root":"window"} ***!
44
- \***************************************************************************************************************************************************************************/
45
- (module) {
109
+ class LightShadow {
110
+ color;
111
+ length;
112
+ constructor() {
113
+ this.color = new engine.OptionsColor();
114
+ this.color.value = "#000000";
115
+ this.length = 2000;
116
+ }
117
+ load(data) {
118
+ if (engine.isNull(data)) {
119
+ return;
120
+ }
121
+ this.color = engine.OptionsColor.create(this.color, data.color);
122
+ if (data.length !== undefined) {
123
+ this.length = data.length;
124
+ }
125
+ }
126
+ }
46
127
 
47
- module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_plugin_interactivity__;
128
+ class Light {
129
+ area;
130
+ shadow;
131
+ constructor() {
132
+ this.area = new LightArea();
133
+ this.shadow = new LightShadow();
134
+ }
135
+ load(data) {
136
+ if (engine.isNull(data)) {
137
+ return;
138
+ }
139
+ this.area.load(data.area);
140
+ this.shadow.load(data.shadow);
141
+ }
142
+ }
48
143
 
49
- /***/ },
144
+ class ExternalLighter extends pluginInteractivity.ExternalInteractorBase {
145
+ maxDistance = 0;
146
+ _pluginManager;
147
+ constructor(pluginManager, container) {
148
+ super(container);
149
+ this._pluginManager = pluginManager;
150
+ }
151
+ clear() {
152
+ }
153
+ init() {
154
+ }
155
+ interact(interactivityData) {
156
+ const container = this.container, options = container.actualOptions, interactivity = interactivityData;
157
+ if (!options.interactivity?.events.onHover.enable || interactivity.status !== "pointermove") {
158
+ return;
159
+ }
160
+ const mousePos = interactivity.mouse.position;
161
+ if (!mousePos) {
162
+ return;
163
+ }
164
+ container.canvas.render.draw(ctx => {
165
+ drawLight(container, ctx, mousePos);
166
+ });
167
+ }
168
+ isEnabled(interactivityData, particle) {
169
+ const container = this.container, mouse = interactivityData.mouse, interactivity = particle?.interactivity ?? container.actualOptions.interactivity, events = interactivity?.events;
170
+ if (!(events?.onHover.enable && mouse.position)) {
171
+ return false;
172
+ }
173
+ const res = engine.isInArray(lightMode, events.onHover.mode);
174
+ if (res && interactivity?.modes.light) {
175
+ const lightGradient = interactivity.modes.light.area.gradient;
176
+ container.canvas.mouseLight = {
177
+ start: engine.rangeColorToRgb(this._pluginManager, lightGradient.start),
178
+ stop: engine.rangeColorToRgb(this._pluginManager, lightGradient.stop),
179
+ };
180
+ }
181
+ return res;
182
+ }
183
+ loadModeOptions(options, ...sources) {
184
+ options.light ??= new Light();
185
+ for (const source of sources) {
186
+ options.light.load(source?.light);
187
+ }
188
+ }
189
+ reset() {
190
+ }
191
+ }
50
192
 
51
- /***/ "./dist/browser/Options/Classes/Light.js"
52
- /*!***********************************************!*\
53
- !*** ./dist/browser/Options/Classes/Light.js ***!
54
- \***********************************************/
55
- (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
193
+ class ParticlesLighter extends pluginInteractivity.ParticlesInteractorBase {
194
+ maxDistance;
195
+ _pluginManager;
196
+ constructor(pluginManager, container) {
197
+ super(container);
198
+ this._pluginManager = pluginManager;
199
+ this.maxDistance = 0;
200
+ }
201
+ clear() {
202
+ }
203
+ init() {
204
+ }
205
+ interact(particle, interactivityData) {
206
+ const container = this.container, options = container.actualOptions;
207
+ if (!options.interactivity?.events.onHover.enable || interactivityData.status !== "pointermove") {
208
+ return;
209
+ }
210
+ const mousePos = interactivityData.mouse.position;
211
+ if (!mousePos) {
212
+ return;
213
+ }
214
+ container.canvas.render.draw(ctx => {
215
+ drawParticleShadow(container, ctx, particle, mousePos);
216
+ });
217
+ }
218
+ isEnabled(particle, interactivityData) {
219
+ const interactivity = particle.interactivity, mouse = interactivityData.mouse, events = interactivity.events;
220
+ if (!(events.onHover.enable && mouse.position)) {
221
+ return false;
222
+ }
223
+ const res = engine.isInArray(lightMode, events.onHover.mode);
224
+ if (res && interactivity.modes.light) {
225
+ const shadowOptions = interactivity.modes.light.shadow;
226
+ particle.lightShadow = engine.rangeColorToRgb(this._pluginManager, shadowOptions.color);
227
+ }
228
+ return res;
229
+ }
230
+ reset() {
231
+ }
232
+ }
56
233
 
57
- eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Light: () => (/* binding */ Light)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _LightArea_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./LightArea.js */ \"./dist/browser/Options/Classes/LightArea.js\");\n/* harmony import */ var _LightShadow_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./LightShadow.js */ \"./dist/browser/Options/Classes/LightShadow.js\");\n\n\n\nclass Light {\n area;\n shadow;\n constructor(){\n this.area = new _LightArea_js__WEBPACK_IMPORTED_MODULE_1__.LightArea();\n this.shadow = new _LightShadow_js__WEBPACK_IMPORTED_MODULE_2__.LightShadow();\n }\n load(data) {\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isNull)(data)) {\n return;\n }\n this.area.load(data.area);\n this.shadow.load(data.shadow);\n }\n}\n\n\n//# sourceURL=webpack://@tsparticles/interaction-light/./dist/browser/Options/Classes/Light.js?\n}");
234
+ async function loadLightInteraction(engine) {
235
+ engine.checkVersion("4.0.0-beta.15");
236
+ await engine.pluginManager.register((e) => {
237
+ pluginInteractivity.ensureInteractivityPluginLoaded(e);
238
+ e.pluginManager.addInteractor?.("externalLight", container => {
239
+ return Promise.resolve(new ExternalLighter(e.pluginManager, container));
240
+ });
241
+ e.pluginManager.addInteractor?.("particlesLight", container => {
242
+ return Promise.resolve(new ParticlesLighter(e.pluginManager, container));
243
+ });
244
+ });
245
+ }
58
246
 
59
- /***/ },
247
+ const globalObject = globalThis;
248
+ globalObject.__tsParticlesInternals = globalObject.__tsParticlesInternals ?? {};
249
+ globalObject.loadLightInteraction = loadLightInteraction;
60
250
 
61
- /***/ "./dist/browser/Options/Classes/LightArea.js"
62
- /*!***************************************************!*\
63
- !*** ./dist/browser/Options/Classes/LightArea.js ***!
64
- \***************************************************/
65
- (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
251
+ exports.Light = Light;
252
+ exports.LightArea = LightArea;
253
+ exports.LightGradient = LightGradient;
254
+ exports.LightShadow = LightShadow;
255
+ exports.loadLightInteraction = loadLightInteraction;
66
256
 
67
- eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ LightArea: () => (/* binding */ LightArea)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _LightGradient_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./LightGradient.js */ \"./dist/browser/Options/Classes/LightGradient.js\");\n\n\nclass LightArea {\n gradient;\n radius;\n constructor(){\n this.gradient = new _LightGradient_js__WEBPACK_IMPORTED_MODULE_1__.LightGradient();\n this.radius = 1000;\n }\n load(data) {\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isNull)(data)) {\n return;\n }\n this.gradient.load(data.gradient);\n if (data.radius !== undefined) {\n this.radius = data.radius;\n }\n }\n}\n\n\n//# sourceURL=webpack://@tsparticles/interaction-light/./dist/browser/Options/Classes/LightArea.js?\n}");
68
-
69
- /***/ },
70
-
71
- /***/ "./dist/browser/Options/Classes/LightGradient.js"
72
- /*!*******************************************************!*\
73
- !*** ./dist/browser/Options/Classes/LightGradient.js ***!
74
- \*******************************************************/
75
- (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
76
-
77
- eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ LightGradient: () => (/* binding */ LightGradient)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n\nclass LightGradient {\n start;\n stop;\n constructor(){\n this.start = new _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.OptionsColor();\n this.stop = new _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.OptionsColor();\n this.start.value = \"#ffffff\";\n this.stop.value = \"#000000\";\n }\n load(data) {\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isNull)(data)) {\n return;\n }\n this.start = _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.OptionsColor.create(this.start, data.start);\n this.stop = _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.OptionsColor.create(this.stop, data.stop);\n }\n}\n\n\n//# sourceURL=webpack://@tsparticles/interaction-light/./dist/browser/Options/Classes/LightGradient.js?\n}");
78
-
79
- /***/ },
80
-
81
- /***/ "./dist/browser/Options/Classes/LightShadow.js"
82
- /*!*****************************************************!*\
83
- !*** ./dist/browser/Options/Classes/LightShadow.js ***!
84
- \*****************************************************/
85
- (__unused_webpack___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 */ LightShadow: () => (/* binding */ LightShadow)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n\nclass LightShadow {\n color;\n length;\n constructor(){\n this.color = new _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.OptionsColor();\n this.color.value = \"#000000\";\n this.length = 2000;\n }\n load(data) {\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isNull)(data)) {\n return;\n }\n this.color = _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.OptionsColor.create(this.color, data.color);\n if (data.length !== undefined) {\n this.length = data.length;\n }\n }\n}\n\n\n//# sourceURL=webpack://@tsparticles/interaction-light/./dist/browser/Options/Classes/LightShadow.js?\n}");
88
-
89
- /***/ },
90
-
91
- /***/ "./dist/browser/index.js"
92
- /*!*******************************!*\
93
- !*** ./dist/browser/index.js ***!
94
- \*******************************/
95
- (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
96
-
97
- eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Light: () => (/* reexport safe */ _Options_Classes_Light_js__WEBPACK_IMPORTED_MODULE_0__.Light),\n/* harmony export */ LightArea: () => (/* reexport safe */ _Options_Classes_LightArea_js__WEBPACK_IMPORTED_MODULE_1__.LightArea),\n/* harmony export */ LightGradient: () => (/* reexport safe */ _Options_Classes_LightGradient_js__WEBPACK_IMPORTED_MODULE_2__.LightGradient),\n/* harmony export */ LightShadow: () => (/* reexport safe */ _Options_Classes_LightShadow_js__WEBPACK_IMPORTED_MODULE_3__.LightShadow),\n/* harmony export */ loadLightInteraction: () => (/* binding */ loadLightInteraction)\n/* harmony export */ });\n/* harmony import */ var _Options_Classes_Light_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Options/Classes/Light.js */ \"./dist/browser/Options/Classes/Light.js\");\n/* harmony import */ var _Options_Classes_LightArea_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Options/Classes/LightArea.js */ \"./dist/browser/Options/Classes/LightArea.js\");\n/* harmony import */ var _Options_Classes_LightGradient_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Options/Classes/LightGradient.js */ \"./dist/browser/Options/Classes/LightGradient.js\");\n/* harmony import */ var _Options_Classes_LightShadow_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Options/Classes/LightShadow.js */ \"./dist/browser/Options/Classes/LightShadow.js\");\nasync function loadLightInteraction(engine) {\n engine.checkVersion(\"4.0.0-beta.11\");\n await engine.pluginManager.register(async (e)=>{\n const { ensureInteractivityPluginLoaded } = await Promise.resolve(/*! import() */).then(__webpack_require__.t.bind(__webpack_require__, /*! @tsparticles/plugin-interactivity */ \"@tsparticles/plugin-interactivity\", 19));\n ensureInteractivityPluginLoaded(e);\n e.pluginManager.addInteractor?.(\"externalLight\", async (container)=>{\n const { ExternalLighter } = await __webpack_require__.e(/*! import() */ \"dist_browser_ExternalLighter_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./ExternalLighter.js */ \"./dist/browser/ExternalLighter.js\"));\n return new ExternalLighter(e.pluginManager, container);\n });\n e.pluginManager.addInteractor?.(\"particlesLight\", async (container)=>{\n const { ParticlesLighter } = await __webpack_require__.e(/*! import() */ \"dist_browser_ParticlesLighter_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./ParticlesLighter.js */ \"./dist/browser/ParticlesLighter.js\"));\n return new ParticlesLighter(e.pluginManager, container);\n });\n });\n}\n\n\n\n\n\n\n//# sourceURL=webpack://@tsparticles/interaction-light/./dist/browser/index.js?\n}");
98
-
99
- /***/ }
100
-
101
- /******/ });
102
- /************************************************************************/
103
- /******/ // The module cache
104
- /******/ var __webpack_module_cache__ = {};
105
- /******/
106
- /******/ // The require function
107
- /******/ function __webpack_require__(moduleId) {
108
- /******/ // Check if module is in cache
109
- /******/ var cachedModule = __webpack_module_cache__[moduleId];
110
- /******/ if (cachedModule !== undefined) {
111
- /******/ return cachedModule.exports;
112
- /******/ }
113
- /******/ // Create a new module (and put it into the cache)
114
- /******/ var module = __webpack_module_cache__[moduleId] = {
115
- /******/ // no module.id needed
116
- /******/ // no module.loaded needed
117
- /******/ exports: {}
118
- /******/ };
119
- /******/
120
- /******/ // Execute the module function
121
- /******/ if (!(moduleId in __webpack_modules__)) {
122
- /******/ delete __webpack_module_cache__[moduleId];
123
- /******/ var e = new Error("Cannot find module '" + moduleId + "'");
124
- /******/ e.code = 'MODULE_NOT_FOUND';
125
- /******/ throw e;
126
- /******/ }
127
- /******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
128
- /******/
129
- /******/ // Return the exports of the module
130
- /******/ return module.exports;
131
- /******/ }
132
- /******/
133
- /******/ // expose the modules object (__webpack_modules__)
134
- /******/ __webpack_require__.m = __webpack_modules__;
135
- /******/
136
- /************************************************************************/
137
- /******/ /* webpack/runtime/create fake namespace object */
138
- /******/ (() => {
139
- /******/ var getProto = Object.getPrototypeOf ? (obj) => (Object.getPrototypeOf(obj)) : (obj) => (obj.__proto__);
140
- /******/ var leafPrototypes;
141
- /******/ // create a fake namespace object
142
- /******/ // mode & 1: value is a module id, require it
143
- /******/ // mode & 2: merge all properties of value into the ns
144
- /******/ // mode & 4: return value when already ns object
145
- /******/ // mode & 16: return value when it's Promise-like
146
- /******/ // mode & 8|1: behave like require
147
- /******/ __webpack_require__.t = function(value, mode) {
148
- /******/ if(mode & 1) value = this(value);
149
- /******/ if(mode & 8) return value;
150
- /******/ if(typeof value === 'object' && value) {
151
- /******/ if((mode & 4) && value.__esModule) return value;
152
- /******/ if((mode & 16) && typeof value.then === 'function') return value;
153
- /******/ }
154
- /******/ var ns = Object.create(null);
155
- /******/ __webpack_require__.r(ns);
156
- /******/ var def = {};
157
- /******/ leafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)];
158
- /******/ for(var current = mode & 2 && value; (typeof current == 'object' || typeof current == 'function') && !~leafPrototypes.indexOf(current); current = getProto(current)) {
159
- /******/ Object.getOwnPropertyNames(current).forEach((key) => (def[key] = () => (value[key])));
160
- /******/ }
161
- /******/ def['default'] = () => (value);
162
- /******/ __webpack_require__.d(ns, def);
163
- /******/ return ns;
164
- /******/ };
165
- /******/ })();
166
- /******/
167
- /******/ /* webpack/runtime/define property getters */
168
- /******/ (() => {
169
- /******/ // define getter functions for harmony exports
170
- /******/ __webpack_require__.d = (exports, definition) => {
171
- /******/ for(var key in definition) {
172
- /******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
173
- /******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
174
- /******/ }
175
- /******/ }
176
- /******/ };
177
- /******/ })();
178
- /******/
179
- /******/ /* webpack/runtime/ensure chunk */
180
- /******/ (() => {
181
- /******/ __webpack_require__.f = {};
182
- /******/ // This file contains only the entry chunk.
183
- /******/ // The chunk loading function for additional chunks
184
- /******/ __webpack_require__.e = (chunkId) => {
185
- /******/ return Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {
186
- /******/ __webpack_require__.f[key](chunkId, promises);
187
- /******/ return promises;
188
- /******/ }, []));
189
- /******/ };
190
- /******/ })();
191
- /******/
192
- /******/ /* webpack/runtime/get javascript chunk filename */
193
- /******/ (() => {
194
- /******/ // This function allow to reference async chunks
195
- /******/ __webpack_require__.u = (chunkId) => {
196
- /******/ // return url for filenames based on template
197
- /******/ return "" + chunkId + ".js";
198
- /******/ };
199
- /******/ })();
200
- /******/
201
- /******/ /* webpack/runtime/global */
202
- /******/ (() => {
203
- /******/ __webpack_require__.g = (function() {
204
- /******/ if (typeof globalThis === 'object') return globalThis;
205
- /******/ try {
206
- /******/ return this || new Function('return this')();
207
- /******/ } catch (e) {
208
- /******/ if (typeof window === 'object') return window;
209
- /******/ }
210
- /******/ })();
211
- /******/ })();
212
- /******/
213
- /******/ /* webpack/runtime/hasOwnProperty shorthand */
214
- /******/ (() => {
215
- /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
216
- /******/ })();
217
- /******/
218
- /******/ /* webpack/runtime/load script */
219
- /******/ (() => {
220
- /******/ var inProgress = {};
221
- /******/ var dataWebpackPrefix = "@tsparticles/interaction-light:";
222
- /******/ // loadScript function to load a script via script tag
223
- /******/ __webpack_require__.l = (url, done, key, chunkId) => {
224
- /******/ if(inProgress[url]) { inProgress[url].push(done); return; }
225
- /******/ var script, needAttach;
226
- /******/ if(key !== undefined) {
227
- /******/ var scripts = document.getElementsByTagName("script");
228
- /******/ for(var i = 0; i < scripts.length; i++) {
229
- /******/ var s = scripts[i];
230
- /******/ if(s.getAttribute("src") == url || s.getAttribute("data-webpack") == dataWebpackPrefix + key) { script = s; break; }
231
- /******/ }
232
- /******/ }
233
- /******/ if(!script) {
234
- /******/ needAttach = true;
235
- /******/ script = document.createElement('script');
236
- /******/
237
- /******/ script.charset = 'utf-8';
238
- /******/ if (__webpack_require__.nc) {
239
- /******/ script.setAttribute("nonce", __webpack_require__.nc);
240
- /******/ }
241
- /******/ script.setAttribute("data-webpack", dataWebpackPrefix + key);
242
- /******/
243
- /******/ script.src = url;
244
- /******/ }
245
- /******/ inProgress[url] = [done];
246
- /******/ var onScriptComplete = (prev, event) => {
247
- /******/ // avoid mem leaks in IE.
248
- /******/ script.onerror = script.onload = null;
249
- /******/ clearTimeout(timeout);
250
- /******/ var doneFns = inProgress[url];
251
- /******/ delete inProgress[url];
252
- /******/ script.parentNode && script.parentNode.removeChild(script);
253
- /******/ doneFns && doneFns.forEach((fn) => (fn(event)));
254
- /******/ if(prev) return prev(event);
255
- /******/ }
256
- /******/ var timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);
257
- /******/ script.onerror = onScriptComplete.bind(null, script.onerror);
258
- /******/ script.onload = onScriptComplete.bind(null, script.onload);
259
- /******/ needAttach && document.head.appendChild(script);
260
- /******/ };
261
- /******/ })();
262
- /******/
263
- /******/ /* webpack/runtime/make namespace object */
264
- /******/ (() => {
265
- /******/ // define __esModule on exports
266
- /******/ __webpack_require__.r = (exports) => {
267
- /******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
268
- /******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
269
- /******/ }
270
- /******/ Object.defineProperty(exports, '__esModule', { value: true });
271
- /******/ };
272
- /******/ })();
273
- /******/
274
- /******/ /* webpack/runtime/publicPath */
275
- /******/ (() => {
276
- /******/ var scriptUrl;
277
- /******/ if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + "";
278
- /******/ var document = __webpack_require__.g.document;
279
- /******/ if (!scriptUrl && document) {
280
- /******/ if (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT')
281
- /******/ scriptUrl = document.currentScript.src;
282
- /******/ if (!scriptUrl) {
283
- /******/ var scripts = document.getElementsByTagName("script");
284
- /******/ if(scripts.length) {
285
- /******/ var i = scripts.length - 1;
286
- /******/ while (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src;
287
- /******/ }
288
- /******/ }
289
- /******/ }
290
- /******/ // When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration
291
- /******/ // or pass an empty string ("") and set the __webpack_public_path__ variable from your code to use your own logic.
292
- /******/ if (!scriptUrl) throw new Error("Automatic publicPath is not supported in this browser");
293
- /******/ scriptUrl = scriptUrl.replace(/^blob:/, "").replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/");
294
- /******/ __webpack_require__.p = scriptUrl;
295
- /******/ })();
296
- /******/
297
- /******/ /* webpack/runtime/jsonp chunk loading */
298
- /******/ (() => {
299
- /******/ // no baseURI
300
- /******/
301
- /******/ // object to store loaded and loading chunks
302
- /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
303
- /******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded
304
- /******/ var installedChunks = {
305
- /******/ "tsparticles.interaction.light": 0
306
- /******/ };
307
- /******/
308
- /******/ __webpack_require__.f.j = (chunkId, promises) => {
309
- /******/ // JSONP chunk loading for javascript
310
- /******/ var installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;
311
- /******/ if(installedChunkData !== 0) { // 0 means "already installed".
312
- /******/
313
- /******/ // a Promise means "currently loading".
314
- /******/ if(installedChunkData) {
315
- /******/ promises.push(installedChunkData[2]);
316
- /******/ } else {
317
- /******/ if(true) { // all chunks have JS
318
- /******/ // setup Promise in chunk cache
319
- /******/ var promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject]));
320
- /******/ promises.push(installedChunkData[2] = promise);
321
- /******/
322
- /******/ // start chunk loading
323
- /******/ var url = __webpack_require__.p + __webpack_require__.u(chunkId);
324
- /******/ // create error before stack unwound to get useful stacktrace later
325
- /******/ var error = new Error();
326
- /******/ var loadingEnded = (event) => {
327
- /******/ if(__webpack_require__.o(installedChunks, chunkId)) {
328
- /******/ installedChunkData = installedChunks[chunkId];
329
- /******/ if(installedChunkData !== 0) installedChunks[chunkId] = undefined;
330
- /******/ if(installedChunkData) {
331
- /******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type);
332
- /******/ var realSrc = event && event.target && event.target.src;
333
- /******/ error.message = 'Loading chunk ' + chunkId + ' failed.\n(' + errorType + ': ' + realSrc + ')';
334
- /******/ error.name = 'ChunkLoadError';
335
- /******/ error.type = errorType;
336
- /******/ error.request = realSrc;
337
- /******/ installedChunkData[1](error);
338
- /******/ }
339
- /******/ }
340
- /******/ };
341
- /******/ __webpack_require__.l(url, loadingEnded, "chunk-" + chunkId, chunkId);
342
- /******/ }
343
- /******/ }
344
- /******/ }
345
- /******/ };
346
- /******/
347
- /******/ // no prefetching
348
- /******/
349
- /******/ // no preloaded
350
- /******/
351
- /******/ // no HMR
352
- /******/
353
- /******/ // no HMR manifest
354
- /******/
355
- /******/ // no on chunks loaded
356
- /******/
357
- /******/ // install a JSONP callback for chunk loading
358
- /******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => {
359
- /******/ var [chunkIds, moreModules, runtime] = data;
360
- /******/ // add "moreModules" to the modules object,
361
- /******/ // then flag all "chunkIds" as loaded and fire callback
362
- /******/ var moduleId, chunkId, i = 0;
363
- /******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) {
364
- /******/ for(moduleId in moreModules) {
365
- /******/ if(__webpack_require__.o(moreModules, moduleId)) {
366
- /******/ __webpack_require__.m[moduleId] = moreModules[moduleId];
367
- /******/ }
368
- /******/ }
369
- /******/ if(runtime) var result = runtime(__webpack_require__);
370
- /******/ }
371
- /******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data);
372
- /******/ for(;i < chunkIds.length; i++) {
373
- /******/ chunkId = chunkIds[i];
374
- /******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
375
- /******/ installedChunks[chunkId][0]();
376
- /******/ }
377
- /******/ installedChunks[chunkId] = 0;
378
- /******/ }
379
- /******/
380
- /******/ }
381
- /******/
382
- /******/ var chunkLoadingGlobal = this["webpackChunk_tsparticles_interaction_light"] = this["webpackChunk_tsparticles_interaction_light"] || [];
383
- /******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));
384
- /******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));
385
- /******/ })();
386
- /******/
387
- /************************************************************************/
388
- /******/
389
- /******/ // startup
390
- /******/ // Load entry module and return exports
391
- /******/ // This entry module can't be inlined because the eval devtool is used.
392
- /******/ var __webpack_exports__ = __webpack_require__("./dist/browser/index.js");
393
- /******/
394
- /******/ return __webpack_exports__;
395
- /******/ })()
396
- ;
397
- });
257
+ }));
258
+ Object.assign(globalThis.window || globalThis, { loadLightInteraction: (globalThis.__tsParticlesInternals.interactions.light || {}).loadLightInteraction });
259
+ delete (globalThis.window || globalThis).tsparticlesInternalExports;