@tsparticles/interaction-external-trail 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,222 @@
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__ = ({
30
-
31
- /***/ "@tsparticles/engine"
32
- /*!*********************************************************************************************************************************!*\
33
- !*** external {"commonjs":"@tsparticles/engine","commonjs2":"@tsparticles/engine","amd":"@tsparticles/engine","root":"window"} ***!
34
- \*********************************************************************************************************************************/
35
- (module) {
36
-
37
- module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_engine__;
38
-
39
- /***/ },
40
-
41
- /***/ "@tsparticles/plugin-interactivity"
42
- /*!***************************************************************************************************************************************************************************!*\
43
- !*** external {"commonjs":"@tsparticles/plugin-interactivity","commonjs2":"@tsparticles/plugin-interactivity","amd":"@tsparticles/plugin-interactivity","root":"window"} ***!
44
- \***************************************************************************************************************************************************************************/
45
- (module) {
46
-
47
- module.exports = __WEBPACK_EXTERNAL_MODULE__tsparticles_plugin_interactivity__;
48
-
49
- /***/ },
50
-
51
- /***/ "./dist/browser/Options/Classes/Trail.js"
52
- /*!***********************************************!*\
53
- !*** ./dist/browser/Options/Classes/Trail.js ***!
54
- \***********************************************/
55
- (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
56
-
57
- eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Trail: () => (/* binding */ Trail)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _TrailColorCoords_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./TrailColorCoords.js */ \"./dist/browser/Options/Classes/TrailColorCoords.js\");\n\n\nclass Trail {\n colorCoords;\n delay;\n particles;\n pauseOnStop;\n quantity;\n constructor(){\n this.delay = 1;\n this.pauseOnStop = false;\n this.quantity = 1;\n this.colorCoords = new _TrailColorCoords_js__WEBPACK_IMPORTED_MODULE_1__.TrailColorCoords();\n }\n load(data) {\n if ((0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isNull)(data)) return;\n if (data.delay !== undefined) {\n this.delay = data.delay;\n }\n if (data.quantity !== undefined) {\n this.quantity = data.quantity;\n }\n if (data.pauseOnStop !== undefined) {\n this.pauseOnStop = data.pauseOnStop;\n }\n if (data.particles !== undefined) {\n this.particles = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.deepExtend)({}, data.particles);\n }\n if (data.colorCoords) {\n this.colorCoords ??= new _TrailColorCoords_js__WEBPACK_IMPORTED_MODULE_1__.TrailColorCoords();\n this.colorCoords.load(data.colorCoords);\n }\n }\n}\n\n\n//# sourceURL=webpack://@tsparticles/interaction-external-trail/./dist/browser/Options/Classes/Trail.js?\n}");
58
-
59
- /***/ },
60
-
61
- /***/ "./dist/browser/Options/Classes/TrailColorComponent.js"
62
- /*!*************************************************************!*\
63
- !*** ./dist/browser/Options/Classes/TrailColorComponent.js ***!
64
- \*************************************************************/
65
- (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
66
-
67
- eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ TrailColorComponent: () => (/* binding */ TrailColorComponent)\n/* harmony export */ });\n/* harmony import */ var _tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @tsparticles/engine */ \"@tsparticles/engine\");\n/* harmony import */ var _TrailColorWeight_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./TrailColorWeight.js */ \"./dist/browser/Options/Classes/TrailColorWeight.js\");\n\n\nclass TrailColorComponent {\n value;\n weights;\n constructor(){\n this.weights = new _TrailColorWeight_js__WEBPACK_IMPORTED_MODULE_1__.TrailColorWeight();\n }\n load(data) {\n if (!data) {\n return;\n }\n if (data.weights) {\n this.weights ??= new _TrailColorWeight_js__WEBPACK_IMPORTED_MODULE_1__.TrailColorWeight();\n this.weights.load(data.weights);\n }\n if (!(0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.isNull)(data.value)) {\n this.value = (0,_tsparticles_engine__WEBPACK_IMPORTED_MODULE_0__.setRangeValue)(data.value);\n }\n }\n}\n\n\n//# sourceURL=webpack://@tsparticles/interaction-external-trail/./dist/browser/Options/Classes/TrailColorComponent.js?\n}");
68
-
69
- /***/ },
70
-
71
- /***/ "./dist/browser/Options/Classes/TrailColorCoords.js"
72
- /*!**********************************************************!*\
73
- !*** ./dist/browser/Options/Classes/TrailColorCoords.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 */ TrailColorCoords: () => (/* binding */ TrailColorCoords)\n/* harmony export */ });\n/* harmony import */ var _TrailColorComponent_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./TrailColorComponent.js */ \"./dist/browser/Options/Classes/TrailColorComponent.js\");\n\nclass TrailColorCoords {\n h;\n l;\n s;\n constructor(){\n this.h = new _TrailColorComponent_js__WEBPACK_IMPORTED_MODULE_0__.TrailColorComponent();\n this.s = new _TrailColorComponent_js__WEBPACK_IMPORTED_MODULE_0__.TrailColorComponent();\n this.l = new _TrailColorComponent_js__WEBPACK_IMPORTED_MODULE_0__.TrailColorComponent();\n }\n load(data) {\n if (!data) {\n return;\n }\n if (data.h) {\n this.h ??= new _TrailColorComponent_js__WEBPACK_IMPORTED_MODULE_0__.TrailColorComponent();\n this.h.load(data.h);\n }\n if (data.s) {\n this.s ??= new _TrailColorComponent_js__WEBPACK_IMPORTED_MODULE_0__.TrailColorComponent();\n this.s.load(data.s);\n }\n if (data.l) {\n this.l ??= new _TrailColorComponent_js__WEBPACK_IMPORTED_MODULE_0__.TrailColorComponent();\n this.l.load(data.l);\n }\n }\n}\n\n\n//# sourceURL=webpack://@tsparticles/interaction-external-trail/./dist/browser/Options/Classes/TrailColorCoords.js?\n}");
78
-
79
- /***/ },
80
-
81
- /***/ "./dist/browser/Options/Classes/TrailColorWeight.js"
82
- /*!**********************************************************!*\
83
- !*** ./dist/browser/Options/Classes/TrailColorWeight.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 */ TrailColorWeight: () => (/* binding */ TrailColorWeight)\n/* harmony export */ });\nclass TrailColorWeight {\n x;\n y;\n constructor(){\n this.x = 0;\n this.y = 0;\n }\n load(data) {\n if (!data) {\n return;\n }\n if (data.x !== undefined) {\n this.x = data.x;\n }\n if (data.y !== undefined) {\n this.y = data.y;\n }\n }\n}\n\n\n//# sourceURL=webpack://@tsparticles/interaction-external-trail/./dist/browser/Options/Classes/TrailColorWeight.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 */ Trail: () => (/* reexport safe */ _Options_Classes_Trail_js__WEBPACK_IMPORTED_MODULE_0__.Trail),\n/* harmony export */ loadExternalTrailInteraction: () => (/* binding */ loadExternalTrailInteraction)\n/* harmony export */ });\n/* harmony import */ var _Options_Classes_Trail_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Options/Classes/Trail.js */ \"./dist/browser/Options/Classes/Trail.js\");\nasync function loadExternalTrailInteraction(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?.(\"externalTrail\", async (container)=>{\n const { TrailMaker } = await __webpack_require__.e(/*! import() */ \"dist_browser_TrailMaker_js\").then(__webpack_require__.bind(__webpack_require__, /*! ./TrailMaker.js */ \"./dist/browser/TrailMaker.js\"));\n return new TrailMaker(e.pluginManager, container);\n });\n });\n}\n\n\n\n//# sourceURL=webpack://@tsparticles/interaction-external-trail/./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-external-trail:";
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.external.trail": 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_external_trail"] = this["webpackChunk_tsparticles_interaction_external_trail"] || [];
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
- });
1
+ (function(g){g.__tsParticlesInternals=g.__tsParticlesInternals||{};g.__tsParticlesInternals.bundles=g.__tsParticlesInternals.bundles||{};g.__tsParticlesInternals.effects=g.__tsParticlesInternals.effects||{};g.__tsParticlesInternals.engine=g.__tsParticlesInternals.engine||{};g.__tsParticlesInternals.interactions=g.__tsParticlesInternals.interactions||{};g.__tsParticlesInternals.palettes=g.__tsParticlesInternals.palettes||{};g.__tsParticlesInternals.paths=g.__tsParticlesInternals.paths||{};g.__tsParticlesInternals.plugins=g.__tsParticlesInternals.plugins||{};g.__tsParticlesInternals.plugins=g.__tsParticlesInternals.plugins||{};g.__tsParticlesInternals.plugins.emittersShapes=g.__tsParticlesInternals.plugins.emittersShapes||{};g.__tsParticlesInternals.presets=g.__tsParticlesInternals.presets||{};g.__tsParticlesInternals.shapes=g.__tsParticlesInternals.shapes||{};g.__tsParticlesInternals.updaters=g.__tsParticlesInternals.updaters||{};g.__tsParticlesInternals.utils=g.__tsParticlesInternals.utils||{};g.__tsParticlesInternals.canvas=g.__tsParticlesInternals.canvas||{};g.__tsParticlesInternals.canvas=g.__tsParticlesInternals.canvas||{};g.__tsParticlesInternals.canvas.utils=g.__tsParticlesInternals.canvas.utils||{};g.__tsParticlesInternals.path=g.__tsParticlesInternals.path||{};g.__tsParticlesInternals.path=g.__tsParticlesInternals.path||{};g.__tsParticlesInternals.path.utils=g.__tsParticlesInternals.path.utils||{};var __tsProxyFactory=typeof Proxy!=="undefined"?function(obj){return new Proxy(obj,{get:function(target,key){if(!(key in target)){target[key]={};}return target[key];}});}:function(obj){return obj;};g.__tsParticlesInternals.bundles=__tsProxyFactory(g.__tsParticlesInternals.bundles);g.__tsParticlesInternals.effects=__tsProxyFactory(g.__tsParticlesInternals.effects);g.__tsParticlesInternals.interactions=__tsProxyFactory(g.__tsParticlesInternals.interactions);g.__tsParticlesInternals.palettes=__tsProxyFactory(g.__tsParticlesInternals.palettes);g.__tsParticlesInternals.paths=__tsProxyFactory(g.__tsParticlesInternals.paths);g.__tsParticlesInternals.plugins=__tsProxyFactory(g.__tsParticlesInternals.plugins);g.__tsParticlesInternals.plugins.emittersShapes=__tsProxyFactory(g.__tsParticlesInternals.plugins.emittersShapes);g.__tsParticlesInternals.presets=__tsProxyFactory(g.__tsParticlesInternals.presets);g.__tsParticlesInternals.shapes=__tsProxyFactory(g.__tsParticlesInternals.shapes);g.__tsParticlesInternals.updaters=__tsProxyFactory(g.__tsParticlesInternals.updaters);g.__tsParticlesInternals.utils=__tsProxyFactory(g.__tsParticlesInternals.utils);g.__tsParticlesInternals.canvas=__tsProxyFactory(g.__tsParticlesInternals.canvas);g.__tsParticlesInternals.path=__tsProxyFactory(g.__tsParticlesInternals.path);g.tsparticlesInternalExports=g.tsparticlesInternalExports||{};})(typeof globalThis!=="undefined"?globalThis:typeof window!=="undefined"?window:this);
2
+ /* External Interaction v4.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.externalTrail = global.__tsParticlesInternals.interactions.externalTrail || {}), global.__tsParticlesInternals.plugins.interactivity, global.__tsParticlesInternals.engine));
7
+ })(this, (function (exports, pluginInteractivity, engine) { 'use strict';
8
+
9
+ class TrailColorWeight {
10
+ x;
11
+ y;
12
+ constructor() {
13
+ this.x = 0;
14
+ this.y = 0;
15
+ }
16
+ load(data) {
17
+ if (!data) {
18
+ return;
19
+ }
20
+ if (data.x !== undefined) {
21
+ this.x = data.x;
22
+ }
23
+ if (data.y !== undefined) {
24
+ this.y = data.y;
25
+ }
26
+ }
27
+ }
28
+
29
+ class TrailColorComponent {
30
+ value;
31
+ weights;
32
+ constructor() {
33
+ this.weights = new TrailColorWeight();
34
+ }
35
+ load(data) {
36
+ if (!data) {
37
+ return;
38
+ }
39
+ if (data.weights) {
40
+ this.weights ??= new TrailColorWeight();
41
+ this.weights.load(data.weights);
42
+ }
43
+ if (!engine.isNull(data.value)) {
44
+ this.value = engine.setRangeValue(data.value);
45
+ }
46
+ }
47
+ }
48
+
49
+ class TrailColorCoords {
50
+ h;
51
+ l;
52
+ s;
53
+ constructor() {
54
+ this.h = new TrailColorComponent();
55
+ this.s = new TrailColorComponent();
56
+ this.l = new TrailColorComponent();
57
+ }
58
+ load(data) {
59
+ if (!data) {
60
+ return;
61
+ }
62
+ if (data.h) {
63
+ this.h ??= new TrailColorComponent();
64
+ this.h.load(data.h);
65
+ }
66
+ if (data.s) {
67
+ this.s ??= new TrailColorComponent();
68
+ this.s.load(data.s);
69
+ }
70
+ if (data.l) {
71
+ this.l ??= new TrailColorComponent();
72
+ this.l.load(data.l);
73
+ }
74
+ }
75
+ }
76
+
77
+ class Trail {
78
+ colorCoords;
79
+ delay;
80
+ particles;
81
+ pauseOnStop;
82
+ quantity;
83
+ constructor() {
84
+ this.delay = 1;
85
+ this.pauseOnStop = false;
86
+ this.quantity = 1;
87
+ this.colorCoords = new TrailColorCoords();
88
+ }
89
+ load(data) {
90
+ if (engine.isNull(data))
91
+ return;
92
+ if (data.delay !== undefined) {
93
+ this.delay = data.delay;
94
+ }
95
+ if (data.quantity !== undefined) {
96
+ this.quantity = data.quantity;
97
+ }
98
+ if (data.pauseOnStop !== undefined) {
99
+ this.pauseOnStop = data.pauseOnStop;
100
+ }
101
+ if (data.particles !== undefined) {
102
+ this.particles = engine.deepExtend({}, data.particles);
103
+ }
104
+ if (data.colorCoords) {
105
+ this.colorCoords ??= new TrailColorCoords();
106
+ this.colorCoords.load(data.colorCoords);
107
+ }
108
+ }
109
+ }
110
+
111
+ const trailMode = "trail", defaultMin = 0, defaultWeight = 0;
112
+ class TrailMaker extends pluginInteractivity.ExternalInteractorBase {
113
+ maxDistance = 0;
114
+ _delay;
115
+ _lastPosition;
116
+ _pluginManager;
117
+ constructor(pluginManager, container) {
118
+ super(container);
119
+ this._pluginManager = pluginManager;
120
+ this._delay = 0;
121
+ }
122
+ clear() {
123
+ }
124
+ init() {
125
+ }
126
+ interact(interactivityData, delta) {
127
+ const container = this.container;
128
+ if (!container.retina.reduceFactor)
129
+ return;
130
+ const options = container.actualOptions, trailOptions = options.interactivity?.modes.trail;
131
+ if (!trailOptions)
132
+ return;
133
+ const optDelay = (trailOptions.delay * engine.millisecondsToSeconds) / this.container.retina.reduceFactor;
134
+ if (this._delay < optDelay) {
135
+ this._delay += delta.value;
136
+ }
137
+ if (this._delay < optDelay)
138
+ return;
139
+ const mousePos = interactivityData.mouse.position, canEmit = !(trailOptions.pauseOnStop &&
140
+ (mousePos === this._lastPosition ||
141
+ (mousePos?.x === this._lastPosition?.x && mousePos?.y === this._lastPosition?.y)));
142
+ if (mousePos) {
143
+ this._lastPosition = { ...mousePos };
144
+ }
145
+ else {
146
+ delete this._lastPosition;
147
+ }
148
+ if (canEmit && mousePos) {
149
+ let particleOptions = trailOptions.particles;
150
+ const colorCoords = trailOptions.colorCoords;
151
+ if (colorCoords) {
152
+ const { width, height } = container.canvas.size, norm = {
153
+ x: mousePos.x / width,
154
+ y: mousePos.y / height,
155
+ }, hasWeights = (comp) => {
156
+ return !!(comp?.weights?.x ?? comp?.weights?.y);
157
+ }, calculateValue = (comp, originalValue, defaultMax) => {
158
+ if (!hasWeights(comp))
159
+ return undefined;
160
+ const w = comp?.weights, factor = norm.x * (w?.x ?? defaultWeight) + norm.y * (w?.y ?? defaultWeight), rangeSource = comp?.value ?? originalValue, min = engine.getRangeMin(rangeSource ?? defaultMin), max = engine.getRangeMax(rangeSource ?? defaultMax), result = min + factor * (max - min);
161
+ return Math.min(max, Math.max(min, result));
162
+ }, trailPaintOptions = trailOptions.particles?.paint
163
+ ? engine.itemFromSingleOrMultiple(trailOptions.particles.paint)
164
+ : undefined, fillData = trailPaintOptions?.fill, baseHsl = fillData
165
+ ? engine.rangeColorToHsl(this._pluginManager, engine.AnimatableColor.create(undefined, fillData.color))
166
+ : undefined, h = calculateValue(colorCoords.h, baseHsl?.h, engine.hMax), s = calculateValue(colorCoords.s, baseHsl?.s, engine.sMax), l = calculateValue(colorCoords.l, baseHsl?.l, engine.lMax);
167
+ if (h !== undefined || s !== undefined || l !== undefined) {
168
+ particleOptions = engine.deepExtend({}, trailOptions.particles, {
169
+ paint: {
170
+ fill: {
171
+ color: {
172
+ value: {
173
+ h: h ?? baseHsl?.h,
174
+ s: s ?? baseHsl?.s,
175
+ l: l ?? baseHsl?.l,
176
+ },
177
+ },
178
+ },
179
+ },
180
+ });
181
+ }
182
+ }
183
+ container.particles.push(trailOptions.quantity, mousePos, particleOptions);
184
+ }
185
+ this._delay -= optDelay;
186
+ }
187
+ isEnabled(interactivityData, particle) {
188
+ const container = this.container, options = container.actualOptions, mouse = interactivityData.mouse, events = (particle?.interactivity ?? options.interactivity)?.events;
189
+ return (!!events &&
190
+ ((mouse.clicking && mouse.inside && !!mouse.position && engine.isInArray(trailMode, events.onClick.mode)) ||
191
+ (mouse.inside && !!mouse.position && engine.isInArray(trailMode, events.onHover.mode))));
192
+ }
193
+ loadModeOptions(options, ...sources) {
194
+ options.trail ??= new Trail();
195
+ for (const source of sources) {
196
+ options.trail.load(source?.trail);
197
+ }
198
+ }
199
+ reset() {
200
+ }
201
+ }
202
+
203
+ async function loadExternalTrailInteraction(engine) {
204
+ engine.checkVersion("4.0.0-beta.15");
205
+ await engine.pluginManager.register((e) => {
206
+ pluginInteractivity.ensureInteractivityPluginLoaded(e);
207
+ e.pluginManager.addInteractor?.("externalTrail", container => {
208
+ return Promise.resolve(new TrailMaker(e.pluginManager, container));
209
+ });
210
+ });
211
+ }
212
+
213
+ const globalObject = globalThis;
214
+ globalObject.__tsParticlesInternals = globalObject.__tsParticlesInternals ?? {};
215
+ globalObject.loadExternalTrailInteraction = loadExternalTrailInteraction;
216
+
217
+ exports.Trail = Trail;
218
+ exports.loadExternalTrailInteraction = loadExternalTrailInteraction;
219
+
220
+ }));
221
+ Object.assign(globalThis.window || globalThis, { loadExternalTrailInteraction: (globalThis.__tsParticlesInternals.interactions.externalTrail || {}).loadExternalTrailInteraction });
222
+ delete (globalThis.window || globalThis).tsparticlesInternalExports;