@tsparticles/updater-destroy 4.0.3 → 4.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/browser/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { DestroyUpdater } from "./DestroyUpdater.js";
2
2
  export async function loadDestroyUpdater(engine) {
3
- engine.checkVersion("4.0.3");
3
+ engine.checkVersion("4.0.4");
4
4
  await engine.pluginManager.register(e => {
5
5
  e.pluginManager.addParticleUpdater("destroy", container => {
6
6
  return Promise.resolve(new DestroyUpdater(e.pluginManager, container));
@@ -1,5 +1,5 @@
1
1
  export async function loadDestroyUpdater(engine) {
2
- engine.checkVersion("4.0.3");
2
+ engine.checkVersion("4.0.4");
3
3
  await engine.pluginManager.register(e => {
4
4
  e.pluginManager.addParticleUpdater("destroy", async (container) => {
5
5
  const { DestroyUpdater } = await import("./DestroyUpdater.js");
package/cjs/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { DestroyUpdater } from "./DestroyUpdater.js";
2
2
  export async function loadDestroyUpdater(engine) {
3
- engine.checkVersion("4.0.3");
3
+ engine.checkVersion("4.0.4");
4
4
  await engine.pluginManager.register(e => {
5
5
  e.pluginManager.addParticleUpdater("destroy", container => {
6
6
  return Promise.resolve(new DestroyUpdater(e.pluginManager, container));
package/cjs/index.lazy.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export async function loadDestroyUpdater(engine) {
2
- engine.checkVersion("4.0.3");
2
+ engine.checkVersion("4.0.4");
3
3
  await engine.pluginManager.register(e => {
4
4
  e.pluginManager.addParticleUpdater("destroy", async (container) => {
5
5
  const { DestroyUpdater } = await import("./DestroyUpdater.js");
package/esm/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { DestroyUpdater } from "./DestroyUpdater.js";
2
2
  export async function loadDestroyUpdater(engine) {
3
- engine.checkVersion("4.0.3");
3
+ engine.checkVersion("4.0.4");
4
4
  await engine.pluginManager.register(e => {
5
5
  e.pluginManager.addParticleUpdater("destroy", container => {
6
6
  return Promise.resolve(new DestroyUpdater(e.pluginManager, container));
package/esm/index.lazy.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export async function loadDestroyUpdater(engine) {
2
- engine.checkVersion("4.0.3");
2
+ engine.checkVersion("4.0.4");
3
3
  await engine.pluginManager.register(e => {
4
4
  e.pluginManager.addParticleUpdater("destroy", async (container) => {
5
5
  const { DestroyUpdater } = await import("./DestroyUpdater.js");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tsparticles/updater-destroy",
3
- "version": "4.0.3",
3
+ "version": "4.0.4",
4
4
  "description": "tsParticles particles destroy updater",
5
5
  "homepage": "https://particles.js.org",
6
6
  "repository": {
@@ -93,7 +93,7 @@
93
93
  "./package.json": "./package.json"
94
94
  },
95
95
  "peerDependencies": {
96
- "@tsparticles/engine": "4.0.3"
96
+ "@tsparticles/engine": "4.0.4"
97
97
  },
98
98
  "publishConfig": {
99
99
  "access": "public"
@@ -1,5 +1,5 @@
1
1
  (function(g){g.__tsParticlesInternals=g.__tsParticlesInternals||{};g.__tsParticlesInternals.bundles=g.__tsParticlesInternals.bundles||{};g.__tsParticlesInternals.effects=g.__tsParticlesInternals.effects||{};g.__tsParticlesInternals.engine=g.__tsParticlesInternals.engine||{};g.__tsParticlesInternals.interactions=g.__tsParticlesInternals.interactions||{};g.__tsParticlesInternals.palettes=g.__tsParticlesInternals.palettes||{};g.__tsParticlesInternals.paths=g.__tsParticlesInternals.paths||{};g.__tsParticlesInternals.plugins=g.__tsParticlesInternals.plugins||{};g.__tsParticlesInternals.plugins=g.__tsParticlesInternals.plugins||{};g.__tsParticlesInternals.plugins.emittersShapes=g.__tsParticlesInternals.plugins.emittersShapes||{};g.__tsParticlesInternals.presets=g.__tsParticlesInternals.presets||{};g.__tsParticlesInternals.shapes=g.__tsParticlesInternals.shapes||{};g.__tsParticlesInternals.updaters=g.__tsParticlesInternals.updaters||{};g.__tsParticlesInternals.utils=g.__tsParticlesInternals.utils||{};g.__tsParticlesInternals.canvas=g.__tsParticlesInternals.canvas||{};g.__tsParticlesInternals.canvas=g.__tsParticlesInternals.canvas||{};g.__tsParticlesInternals.canvas.utils=g.__tsParticlesInternals.canvas.utils||{};g.__tsParticlesInternals.path=g.__tsParticlesInternals.path||{};g.__tsParticlesInternals.path=g.__tsParticlesInternals.path||{};g.__tsParticlesInternals.path.utils=g.__tsParticlesInternals.path.utils||{};var __tsProxyFactory=typeof Proxy!=="undefined"?function(obj){return new Proxy(obj,{get:function(target,key){if(!(key in target)){target[key]={};}return target[key];}});}:function(obj){return obj;};g.__tsParticlesInternals.bundles=__tsProxyFactory(g.__tsParticlesInternals.bundles);g.__tsParticlesInternals.effects=__tsProxyFactory(g.__tsParticlesInternals.effects);g.__tsParticlesInternals.interactions=__tsProxyFactory(g.__tsParticlesInternals.interactions);g.__tsParticlesInternals.palettes=__tsProxyFactory(g.__tsParticlesInternals.palettes);g.__tsParticlesInternals.paths=__tsProxyFactory(g.__tsParticlesInternals.paths);g.__tsParticlesInternals.plugins=__tsProxyFactory(g.__tsParticlesInternals.plugins);g.__tsParticlesInternals.plugins.emittersShapes=__tsProxyFactory(g.__tsParticlesInternals.plugins.emittersShapes);g.__tsParticlesInternals.presets=__tsProxyFactory(g.__tsParticlesInternals.presets);g.__tsParticlesInternals.shapes=__tsProxyFactory(g.__tsParticlesInternals.shapes);g.__tsParticlesInternals.updaters=__tsProxyFactory(g.__tsParticlesInternals.updaters);g.__tsParticlesInternals.utils=__tsProxyFactory(g.__tsParticlesInternals.utils);g.__tsParticlesInternals.canvas=__tsProxyFactory(g.__tsParticlesInternals.canvas);g.__tsParticlesInternals.path=__tsProxyFactory(g.__tsParticlesInternals.path);g.tsparticlesInternalExports=g.tsparticlesInternalExports||{};})(typeof globalThis!=="undefined"?globalThis:typeof window!=="undefined"?window:this);
2
- /* Updater v4.0.3 */
2
+ /* Updater v4.0.4 */
3
3
  (function (global, factory) {
4
4
  typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@tsparticles/engine')) :
5
5
  typeof define === 'function' && define.amd ? define(['exports', '@tsparticles/engine'], factory) :
@@ -359,7 +359,7 @@
359
359
  }
360
360
 
361
361
  async function loadDestroyUpdater(engine) {
362
- engine.checkVersion("4.0.3");
362
+ engine.checkVersion("4.0.4");
363
363
  await engine.pluginManager.register(e => {
364
364
  e.pluginManager.addParticleUpdater("destroy", container => {
365
365
  return Promise.resolve(new DestroyUpdater(e.pluginManager, container));
@@ -1 +1 @@
1
- !function(t){t.__tsParticlesInternals=t.__tsParticlesInternals||{},t.__tsParticlesInternals.bundles=t.__tsParticlesInternals.bundles||{},t.__tsParticlesInternals.effects=t.__tsParticlesInternals.effects||{},t.__tsParticlesInternals.engine=t.__tsParticlesInternals.engine||{},t.__tsParticlesInternals.interactions=t.__tsParticlesInternals.interactions||{},t.__tsParticlesInternals.palettes=t.__tsParticlesInternals.palettes||{},t.__tsParticlesInternals.paths=t.__tsParticlesInternals.paths||{},t.__tsParticlesInternals.plugins=t.__tsParticlesInternals.plugins||{},t.__tsParticlesInternals.plugins=t.__tsParticlesInternals.plugins||{},t.__tsParticlesInternals.plugins.emittersShapes=t.__tsParticlesInternals.plugins.emittersShapes||{},t.__tsParticlesInternals.presets=t.__tsParticlesInternals.presets||{},t.__tsParticlesInternals.shapes=t.__tsParticlesInternals.shapes||{},t.__tsParticlesInternals.updaters=t.__tsParticlesInternals.updaters||{},t.__tsParticlesInternals.utils=t.__tsParticlesInternals.utils||{},t.__tsParticlesInternals.canvas=t.__tsParticlesInternals.canvas||{},t.__tsParticlesInternals.canvas=t.__tsParticlesInternals.canvas||{},t.__tsParticlesInternals.canvas.utils=t.__tsParticlesInternals.canvas.utils||{},t.__tsParticlesInternals.path=t.__tsParticlesInternals.path||{},t.__tsParticlesInternals.path=t.__tsParticlesInternals.path||{},t.__tsParticlesInternals.path.utils=t.__tsParticlesInternals.path.utils||{};var e="undefined"!=typeof Proxy?function(t){return new Proxy(t,{get:function(t,e){return e in t||(t[e]={}),t[e]}})}:function(t){return t};t.__tsParticlesInternals.bundles=e(t.__tsParticlesInternals.bundles),t.__tsParticlesInternals.effects=e(t.__tsParticlesInternals.effects),t.__tsParticlesInternals.interactions=e(t.__tsParticlesInternals.interactions),t.__tsParticlesInternals.palettes=e(t.__tsParticlesInternals.palettes),t.__tsParticlesInternals.paths=e(t.__tsParticlesInternals.paths),t.__tsParticlesInternals.plugins=e(t.__tsParticlesInternals.plugins),t.__tsParticlesInternals.plugins.emittersShapes=e(t.__tsParticlesInternals.plugins.emittersShapes),t.__tsParticlesInternals.presets=e(t.__tsParticlesInternals.presets),t.__tsParticlesInternals.shapes=e(t.__tsParticlesInternals.shapes),t.__tsParticlesInternals.updaters=e(t.__tsParticlesInternals.updaters),t.__tsParticlesInternals.utils=e(t.__tsParticlesInternals.utils),t.__tsParticlesInternals.canvas=e(t.__tsParticlesInternals.canvas),t.__tsParticlesInternals.path=e(t.__tsParticlesInternals.path),t.tsparticlesInternalExports=t.tsparticlesInternalExports||{}}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:this),function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@tsparticles/engine")):"function"==typeof define&&define.amd?define(["exports","@tsparticles/engine"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).__tsParticlesInternals=t.__tsParticlesInternals||{},t.__tsParticlesInternals.updaters=t.__tsParticlesInternals.updaters||{},t.__tsParticlesInternals.updaters.destroy=t.__tsParticlesInternals.updaters.destroy||{}),t.__tsParticlesInternals.engine)}(this,function(t,e){"use strict";class s{bottom;left;right;top;load(t){e.isNull(t)||(void 0!==t.bottom&&(this.bottom=e.setRangeValue(t.bottom)),void 0!==t.left&&(this.left=e.setRangeValue(t.left)),void 0!==t.right&&(this.right=e.setRangeValue(t.right)),void 0!==t.top&&(this.top=e.setRangeValue(t.top)))}}var l;!function(t){t.explode="explode",t.none="none",t.split="split"}(l||(l={}));class i{maxSizeFactor;speed;constructor(){this.maxSizeFactor=3,this.speed=2}load(t){e.isNull(t)||(void 0!==t.maxSizeFactor&&(this.maxSizeFactor=t.maxSizeFactor),void 0!==t.speed&&(this.speed=t.speed))}}class n extends e.ValueWithRandom{constructor(){super(),this.value=3}}class r extends e.ValueWithRandom{constructor(){super(),this.value={min:4,max:9}}}class a{count;factor;fillColor;fillColorOffset;particles;rate;sizeOffset;strokeColor;strokeColorOffset;constructor(){this.count=1,this.factor=new n,this.rate=new r,this.sizeOffset=!0}load(t){e.isNull(t)||(void 0!==t.fillColor&&(this.fillColor=e.OptionsColor.create(this.fillColor,t.fillColor)),void 0!==t.strokeColor&&(this.strokeColor=e.OptionsColor.create(this.strokeColor,t.strokeColor)),void 0!==t.count&&(this.count=t.count),this.factor.load(t.factor),this.rate.load(t.rate),this.particles=e.executeOnSingleOrMultiple(t.particles,t=>e.deepExtend({},t)),void 0!==t.sizeOffset&&(this.sizeOffset=t.sizeOffset),t.fillColorOffset&&(this.fillColorOffset=this.fillColorOffset??{},void 0!==t.fillColorOffset.h&&(this.fillColorOffset.h=t.fillColorOffset.h),void 0!==t.fillColorOffset.s&&(this.fillColorOffset.s=t.fillColorOffset.s),void 0!==t.fillColorOffset.l&&(this.fillColorOffset.l=t.fillColorOffset.l)),t.strokeColorOffset&&(this.strokeColorOffset=this.strokeColorOffset??{},void 0!==t.strokeColorOffset.h&&(this.strokeColorOffset.h=t.strokeColorOffset.h),void 0!==t.strokeColorOffset.s&&(this.strokeColorOffset.s=t.strokeColorOffset.s),void 0!==t.strokeColorOffset.l&&(this.strokeColorOffset.l=t.strokeColorOffset.l)))}}class o{bounds;explode;mode;split;constructor(){this.bounds=new s,this.explode=new i,this.mode=l.none,this.split=new a}load(t){e.isNull(t)||(t.mode&&(this.mode=t.mode),t.bounds&&this.bounds.load(t.bounds),this.explode.load(t.explode),this.split.load(t.split))}}function c(t,s,l,i){return t&&i?function(t,s){const l=e.getRangeValue(s.h??0),i=e.getRangeValue(s.s??0),n=e.getRangeValue(s.l??0),r=(t.h+l)%360,a=Math.max(0,Math.min(100,t.s+i)),o=Math.max(0,Math.min(100,t.l+n));return e.AnimatableColor.create(void 0,{value:{hsl:{h:r<0?r+360:r,s:a,l:o}}})}(i,t):s?e.AnimatableColor.create(void 0,s):l?e.AnimatableColor.create(void 0,l):i?function(t){return e.AnimatableColor.create(void 0,{value:{hsl:t}})}(i):void 0}function p(t,s,l,i){const n=l.options.destroy;if(!n)return;const r=n.split,a=e.loadParticlesOptions(t,s,l.options),o=e.itemFromSingleOrMultiple(r.fillColor),p=e.itemFromSingleOrMultiple(r.strokeColor),d=l.getFillColor(),_=l.getStrokeColor();a.move.load({center:{x:l.position.x,y:l.position.y,mode:e.PixelMode.precise}});const f=e.identity/e.getRangeValue(r.factor.value);e.isNumber(a.size.value)?a.size.value*=f:(a.size.value.min*=f,a.size.value.max*=f),a.load(i);const u=e.itemFromSingleOrMultiple(a.paint),h=u?.fill,g=u?.stroke,P=c(r.fillColorOffset,o,h?.color,d),I=c(r.strokeColorOffset,p,g?.color,_);P&&h&&(h.color=P),I&&g&&(g.color=I);const m=r.sizeOffset?e.setRangeValue(-l.size.value,l.size.value):0,v={x:l.position.x+e.randomInRangeValue(m),y:l.position.y+e.randomInRangeValue(m)};return s.particles.addParticle(v,a,l.group,t=>!(t.size.value<.5)&&(t.velocity.length=e.randomInRangeValue(e.setRangeValue(l.velocity.length,t.velocity.length)),t.splitCount=(l.splitCount??0)+1,t.unbreakable=!0,t.unbreakableUntil=performance.now()+500,!0))}class d{_container;_pluginManager;constructor(t,e){this._container=e,this._pluginManager=t}init(t){const s=this._container,l=t.options.destroy;if(!l)return;t.exploding=void 0,t.splitCount=0;const i=l.bounds;t.destroyBounds??={};const{bottom:n,left:r,right:a,top:o}=i,{destroyBounds:c}=t,p=s.canvas.size;n&&(c.bottom=e.getRangeValue(n)*p.height/e.percentDenominator),r&&(c.left=e.getRangeValue(r)*p.width/e.percentDenominator),a&&(c.right=e.getRangeValue(a)*p.width/e.percentDenominator),o&&(c.top=e.getRangeValue(o)*p.height/e.percentDenominator)}isEnabled(t){const e=t;return!e.destroyed||!!e.exploding}loadOptions(t,...e){t.destroy??=new o;for(const s of e)t.destroy.load(s?.destroy)}particleDestroyed(t,s){if(s)return;const i=t.options.destroy;switch(i?.mode){case l.split:!function(t,s,l){const i=l.options.destroy;if(!i)return;const n=i.split;if(n.count>=0){if(void 0===l.splitCount||l.splitCount>n.count)return;l.splitCount++}const r=e.getRangeValue(n.rate.value),a=e.itemFromSingleOrMultiple(n.particles);for(let e=0;e<r;e++)p(t,s,l,a)}(this._pluginManager,this._container,t);break;case l.explode:{if(t.exploding){t.destroyed=!1;break}const{explode:e}=i,s=t.size.value,l=s*e.maxSizeFactor,n=t.getOpacity();t.exploding={initialFillOpacity:n.fillOpacity,initialSize:s,initialStrokeOpacity:n.strokeOpacity,maxSize:l,progress:0,speed:Math.max(e.speed,.01)},t.fillOpacity=n.fillOpacity,t.strokeOpacity=n.strokeOpacity,t.destroyed=!1;break}}}update(t,e){if(t.exploding){const s=t.exploding,l=e.factor||1;s.progress=Math.min(1,s.progress+s.speed*l/60);const i=s.progress;return t.size.value=s.initialSize+(s.maxSize-s.initialSize)*i,t.fillOpacity=s.initialFillOpacity*(1-i),t.strokeOpacity=s.initialStrokeOpacity*(1-i),void(i>=1&&(t.exploding=void 0,t.destroy(!0)))}void 0!==t.unbreakableUntil&&performance.now()>=t.unbreakableUntil&&(t.unbreakable=!1,t.unbreakableUntil=void 0);const s=t.getPosition(),l=t.destroyBounds;l&&(void 0!==l.bottom&&s.y>=l.bottom||void 0!==l.left&&s.x<=l.left||void 0!==l.right&&s.x>=l.right||void 0!==l.top&&s.y<=l.top)&&t.destroy()}}async function _(t){t.checkVersion("4.0.3"),await t.pluginManager.register(t=>{t.pluginManager.addParticleUpdater("destroy",e=>Promise.resolve(new d(t.pluginManager,e)))})}const f=globalThis;f.__tsParticlesInternals=f.__tsParticlesInternals??{},f.loadDestroyUpdater=_,t.loadDestroyUpdater=_}),Object.assign(globalThis.window||globalThis,{loadDestroyUpdater:(globalThis.__tsParticlesInternals.updaters.destroy||{}).loadDestroyUpdater}),delete(globalThis.window||globalThis).tsparticlesInternalExports;
1
+ !function(t){t.__tsParticlesInternals=t.__tsParticlesInternals||{},t.__tsParticlesInternals.bundles=t.__tsParticlesInternals.bundles||{},t.__tsParticlesInternals.effects=t.__tsParticlesInternals.effects||{},t.__tsParticlesInternals.engine=t.__tsParticlesInternals.engine||{},t.__tsParticlesInternals.interactions=t.__tsParticlesInternals.interactions||{},t.__tsParticlesInternals.palettes=t.__tsParticlesInternals.palettes||{},t.__tsParticlesInternals.paths=t.__tsParticlesInternals.paths||{},t.__tsParticlesInternals.plugins=t.__tsParticlesInternals.plugins||{},t.__tsParticlesInternals.plugins=t.__tsParticlesInternals.plugins||{},t.__tsParticlesInternals.plugins.emittersShapes=t.__tsParticlesInternals.plugins.emittersShapes||{},t.__tsParticlesInternals.presets=t.__tsParticlesInternals.presets||{},t.__tsParticlesInternals.shapes=t.__tsParticlesInternals.shapes||{},t.__tsParticlesInternals.updaters=t.__tsParticlesInternals.updaters||{},t.__tsParticlesInternals.utils=t.__tsParticlesInternals.utils||{},t.__tsParticlesInternals.canvas=t.__tsParticlesInternals.canvas||{},t.__tsParticlesInternals.canvas=t.__tsParticlesInternals.canvas||{},t.__tsParticlesInternals.canvas.utils=t.__tsParticlesInternals.canvas.utils||{},t.__tsParticlesInternals.path=t.__tsParticlesInternals.path||{},t.__tsParticlesInternals.path=t.__tsParticlesInternals.path||{},t.__tsParticlesInternals.path.utils=t.__tsParticlesInternals.path.utils||{};var e="undefined"!=typeof Proxy?function(t){return new Proxy(t,{get:function(t,e){return e in t||(t[e]={}),t[e]}})}:function(t){return t};t.__tsParticlesInternals.bundles=e(t.__tsParticlesInternals.bundles),t.__tsParticlesInternals.effects=e(t.__tsParticlesInternals.effects),t.__tsParticlesInternals.interactions=e(t.__tsParticlesInternals.interactions),t.__tsParticlesInternals.palettes=e(t.__tsParticlesInternals.palettes),t.__tsParticlesInternals.paths=e(t.__tsParticlesInternals.paths),t.__tsParticlesInternals.plugins=e(t.__tsParticlesInternals.plugins),t.__tsParticlesInternals.plugins.emittersShapes=e(t.__tsParticlesInternals.plugins.emittersShapes),t.__tsParticlesInternals.presets=e(t.__tsParticlesInternals.presets),t.__tsParticlesInternals.shapes=e(t.__tsParticlesInternals.shapes),t.__tsParticlesInternals.updaters=e(t.__tsParticlesInternals.updaters),t.__tsParticlesInternals.utils=e(t.__tsParticlesInternals.utils),t.__tsParticlesInternals.canvas=e(t.__tsParticlesInternals.canvas),t.__tsParticlesInternals.path=e(t.__tsParticlesInternals.path),t.tsparticlesInternalExports=t.tsparticlesInternalExports||{}}("undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:this),function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("@tsparticles/engine")):"function"==typeof define&&define.amd?define(["exports","@tsparticles/engine"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).__tsParticlesInternals=t.__tsParticlesInternals||{},t.__tsParticlesInternals.updaters=t.__tsParticlesInternals.updaters||{},t.__tsParticlesInternals.updaters.destroy=t.__tsParticlesInternals.updaters.destroy||{}),t.__tsParticlesInternals.engine)}(this,function(t,e){"use strict";class s{bottom;left;right;top;load(t){e.isNull(t)||(void 0!==t.bottom&&(this.bottom=e.setRangeValue(t.bottom)),void 0!==t.left&&(this.left=e.setRangeValue(t.left)),void 0!==t.right&&(this.right=e.setRangeValue(t.right)),void 0!==t.top&&(this.top=e.setRangeValue(t.top)))}}var l;!function(t){t.explode="explode",t.none="none",t.split="split"}(l||(l={}));class i{maxSizeFactor;speed;constructor(){this.maxSizeFactor=3,this.speed=2}load(t){e.isNull(t)||(void 0!==t.maxSizeFactor&&(this.maxSizeFactor=t.maxSizeFactor),void 0!==t.speed&&(this.speed=t.speed))}}class n extends e.ValueWithRandom{constructor(){super(),this.value=3}}class r extends e.ValueWithRandom{constructor(){super(),this.value={min:4,max:9}}}class a{count;factor;fillColor;fillColorOffset;particles;rate;sizeOffset;strokeColor;strokeColorOffset;constructor(){this.count=1,this.factor=new n,this.rate=new r,this.sizeOffset=!0}load(t){e.isNull(t)||(void 0!==t.fillColor&&(this.fillColor=e.OptionsColor.create(this.fillColor,t.fillColor)),void 0!==t.strokeColor&&(this.strokeColor=e.OptionsColor.create(this.strokeColor,t.strokeColor)),void 0!==t.count&&(this.count=t.count),this.factor.load(t.factor),this.rate.load(t.rate),this.particles=e.executeOnSingleOrMultiple(t.particles,t=>e.deepExtend({},t)),void 0!==t.sizeOffset&&(this.sizeOffset=t.sizeOffset),t.fillColorOffset&&(this.fillColorOffset=this.fillColorOffset??{},void 0!==t.fillColorOffset.h&&(this.fillColorOffset.h=t.fillColorOffset.h),void 0!==t.fillColorOffset.s&&(this.fillColorOffset.s=t.fillColorOffset.s),void 0!==t.fillColorOffset.l&&(this.fillColorOffset.l=t.fillColorOffset.l)),t.strokeColorOffset&&(this.strokeColorOffset=this.strokeColorOffset??{},void 0!==t.strokeColorOffset.h&&(this.strokeColorOffset.h=t.strokeColorOffset.h),void 0!==t.strokeColorOffset.s&&(this.strokeColorOffset.s=t.strokeColorOffset.s),void 0!==t.strokeColorOffset.l&&(this.strokeColorOffset.l=t.strokeColorOffset.l)))}}class o{bounds;explode;mode;split;constructor(){this.bounds=new s,this.explode=new i,this.mode=l.none,this.split=new a}load(t){e.isNull(t)||(t.mode&&(this.mode=t.mode),t.bounds&&this.bounds.load(t.bounds),this.explode.load(t.explode),this.split.load(t.split))}}function c(t,s,l,i){return t&&i?function(t,s){const l=e.getRangeValue(s.h??0),i=e.getRangeValue(s.s??0),n=e.getRangeValue(s.l??0),r=(t.h+l)%360,a=Math.max(0,Math.min(100,t.s+i)),o=Math.max(0,Math.min(100,t.l+n));return e.AnimatableColor.create(void 0,{value:{hsl:{h:r<0?r+360:r,s:a,l:o}}})}(i,t):s?e.AnimatableColor.create(void 0,s):l?e.AnimatableColor.create(void 0,l):i?function(t){return e.AnimatableColor.create(void 0,{value:{hsl:t}})}(i):void 0}function p(t,s,l,i){const n=l.options.destroy;if(!n)return;const r=n.split,a=e.loadParticlesOptions(t,s,l.options),o=e.itemFromSingleOrMultiple(r.fillColor),p=e.itemFromSingleOrMultiple(r.strokeColor),d=l.getFillColor(),_=l.getStrokeColor();a.move.load({center:{x:l.position.x,y:l.position.y,mode:e.PixelMode.precise}});const f=e.identity/e.getRangeValue(r.factor.value);e.isNumber(a.size.value)?a.size.value*=f:(a.size.value.min*=f,a.size.value.max*=f),a.load(i);const u=e.itemFromSingleOrMultiple(a.paint),h=u?.fill,g=u?.stroke,P=c(r.fillColorOffset,o,h?.color,d),I=c(r.strokeColorOffset,p,g?.color,_);P&&h&&(h.color=P),I&&g&&(g.color=I);const m=r.sizeOffset?e.setRangeValue(-l.size.value,l.size.value):0,v={x:l.position.x+e.randomInRangeValue(m),y:l.position.y+e.randomInRangeValue(m)};return s.particles.addParticle(v,a,l.group,t=>!(t.size.value<.5)&&(t.velocity.length=e.randomInRangeValue(e.setRangeValue(l.velocity.length,t.velocity.length)),t.splitCount=(l.splitCount??0)+1,t.unbreakable=!0,t.unbreakableUntil=performance.now()+500,!0))}class d{_container;_pluginManager;constructor(t,e){this._container=e,this._pluginManager=t}init(t){const s=this._container,l=t.options.destroy;if(!l)return;t.exploding=void 0,t.splitCount=0;const i=l.bounds;t.destroyBounds??={};const{bottom:n,left:r,right:a,top:o}=i,{destroyBounds:c}=t,p=s.canvas.size;n&&(c.bottom=e.getRangeValue(n)*p.height/e.percentDenominator),r&&(c.left=e.getRangeValue(r)*p.width/e.percentDenominator),a&&(c.right=e.getRangeValue(a)*p.width/e.percentDenominator),o&&(c.top=e.getRangeValue(o)*p.height/e.percentDenominator)}isEnabled(t){const e=t;return!e.destroyed||!!e.exploding}loadOptions(t,...e){t.destroy??=new o;for(const s of e)t.destroy.load(s?.destroy)}particleDestroyed(t,s){if(s)return;const i=t.options.destroy;switch(i?.mode){case l.split:!function(t,s,l){const i=l.options.destroy;if(!i)return;const n=i.split;if(n.count>=0){if(void 0===l.splitCount||l.splitCount>n.count)return;l.splitCount++}const r=e.getRangeValue(n.rate.value),a=e.itemFromSingleOrMultiple(n.particles);for(let e=0;e<r;e++)p(t,s,l,a)}(this._pluginManager,this._container,t);break;case l.explode:{if(t.exploding){t.destroyed=!1;break}const{explode:e}=i,s=t.size.value,l=s*e.maxSizeFactor,n=t.getOpacity();t.exploding={initialFillOpacity:n.fillOpacity,initialSize:s,initialStrokeOpacity:n.strokeOpacity,maxSize:l,progress:0,speed:Math.max(e.speed,.01)},t.fillOpacity=n.fillOpacity,t.strokeOpacity=n.strokeOpacity,t.destroyed=!1;break}}}update(t,e){if(t.exploding){const s=t.exploding,l=e.factor||1;s.progress=Math.min(1,s.progress+s.speed*l/60);const i=s.progress;return t.size.value=s.initialSize+(s.maxSize-s.initialSize)*i,t.fillOpacity=s.initialFillOpacity*(1-i),t.strokeOpacity=s.initialStrokeOpacity*(1-i),void(i>=1&&(t.exploding=void 0,t.destroy(!0)))}void 0!==t.unbreakableUntil&&performance.now()>=t.unbreakableUntil&&(t.unbreakable=!1,t.unbreakableUntil=void 0);const s=t.getPosition(),l=t.destroyBounds;l&&(void 0!==l.bottom&&s.y>=l.bottom||void 0!==l.left&&s.x<=l.left||void 0!==l.right&&s.x>=l.right||void 0!==l.top&&s.y<=l.top)&&t.destroy()}}async function _(t){t.checkVersion("4.0.4"),await t.pluginManager.register(t=>{t.pluginManager.addParticleUpdater("destroy",e=>Promise.resolve(new d(t.pluginManager,e)))})}const f=globalThis;f.__tsParticlesInternals=f.__tsParticlesInternals??{},f.loadDestroyUpdater=_,t.loadDestroyUpdater=_}),Object.assign(globalThis.window||globalThis,{loadDestroyUpdater:(globalThis.__tsParticlesInternals.updaters.destroy||{}).loadDestroyUpdater}),delete(globalThis.window||globalThis).tsparticlesInternalExports;