@tsparticles/updater-destroy 4.2.0 → 4.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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.2.0");
3
+ engine.checkVersion("4.2.1");
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.2.0");
2
+ engine.checkVersion("4.2.1");
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.2.0");
3
+ engine.checkVersion("4.2.1");
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.2.0");
2
+ engine.checkVersion("4.2.1");
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.2.0");
3
+ engine.checkVersion("4.2.1");
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.2.0");
2
+ engine.checkVersion("4.2.1");
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.2.0",
3
+ "version": "4.2.1",
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.2.0"
96
+ "@tsparticles/engine": "4.2.1"
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.2.0 */
2
+ /* Updater v4.2.1 */
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) :
@@ -320,7 +320,7 @@
320
320
  }
321
321
 
322
322
  async function loadDestroyUpdater(engine) {
323
- engine.checkVersion("4.2.0");
323
+ engine.checkVersion("4.2.1");
324
324
  await engine.pluginManager.register(e => {
325
325
  e.pluginManager.addParticleUpdater("destroy", container => {
326
326
  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)||(e.loadRangeProperty(this,"bottom",t.bottom),e.loadRangeProperty(this,"left",t.left),e.loadRangeProperty(this,"right",t.right),e.loadRangeProperty(this,"top",t.top))}}var l;!function(t){t.explode="explode",t.none="none",t.split="split"}(l||(l={}));class r{maxSizeFactor=3;speed=2;load(t){e.isNull(t)||(e.loadProperty(this,"maxSizeFactor",t.maxSizeFactor),e.loadProperty(this,"speed",t.speed))}}class a extends e.ValueWithRandom{value=3}class n extends e.ValueWithRandom{value={min:4,max:9}}class i{count=1;factor=new a;fillColor;fillColorOffset;particles;rate=new n;sizeOffset=!0;strokeColor;strokeColorOffset;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)),e.loadProperty(this,"count",t.count),this.factor.load(t.factor),this.rate.load(t.rate),this.particles=e.executeOnSingleOrMultiple(t.particles,t=>e.deepExtend({},t)),e.loadProperty(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=new s;explode=new r;mode=l.none;split=new i;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,r){return t&&r?function(t,s){const l=e.getRangeValue(s.h??0),r=e.getRangeValue(s.s??0),a=e.getRangeValue(s.l??0),n=(t.h+l)%360,i=Math.max(0,Math.min(100,t.s+r)),o=Math.max(0,Math.min(100,t.l+a));return e.AnimatableColor.create(void 0,{value:{hsl:{h:n<0?n+360:n,s:i,l:o}}})}(r,t):s?e.AnimatableColor.create(void 0,s):l?e.AnimatableColor.create(void 0,l):r?function(t){return e.AnimatableColor.create(void 0,{value:{hsl:t}})}(r):void 0}function p(t,s,l,r){const a=l.options.destroy;if(!a)return;const n=a.split,i=e.loadParticlesOptions(t,s,l.options),o=e.itemFromSingleOrMultiple(n.fillColor),p=e.itemFromSingleOrMultiple(n.strokeColor),d=l.getFillColor(),_=l.getStrokeColor();i.move.load({center:{x:l.position.x,y:l.position.y,mode:e.PixelMode.precise}});const f=e.identity/e.getRangeValue(n.factor.value),u=i.size;u&&(e.isNumber(u.value)?u.value*=f:(u.value.min*=f,u.value.max*=f)),i.load(r);const h=e.itemFromSingleOrMultiple(i.paint),g=h?.fill,P=h?.stroke,I=c(n.fillColorOffset,o,g?.color,d),y=c(n.strokeColorOffset,p,P?.color,_);I&&g&&(g.color=I),y&&P&&(P.color=y);const m=n.sizeOffset?e.setRangeValue(-l.size.value,l.size.value):0,O={x:l.position.x+e.randomInRangeValue(m),y:l.position.y+e.randomInRangeValue(m)};return s.particles.addParticle(O,i,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{#t;#e;constructor(t,e){this.#t=e,this.#e=t}init(t){const s=this.#t,l=t.options.destroy;if(!l)return;t.exploding=void 0,t.splitCount=0;const r=l.bounds;t.destroyBounds??={};const{bottom:a,left:n,right:i,top:o}=r,{destroyBounds:c}=t,p=s.canvas.size;a&&(c.bottom=e.getRangeValue(a)*p.height/e.percentDenominator),n&&(c.left=e.getRangeValue(n)*p.width/e.percentDenominator),i&&(c.right=e.getRangeValue(i)*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,...s){e.loadOptionProperty(t,"destroy",o,...s)}particleDestroyed(t,s){if(s)return;const r=t.options.destroy;switch(r?.mode){case l.split:!function(t,s,l){const r=l.options.destroy;if(!r)return;const a=r.split;if(a.count>=0){if(void 0===l.splitCount||l.splitCount>a.count)return;l.splitCount++}const n=e.getRangeValue(a.rate.value),i=e.itemFromSingleOrMultiple(a.particles);for(let e=0;e<n;e++)p(t,s,l,i)}(this.#e,this.#t,t);break;case l.explode:{if(t.exploding){t.destroyed=!1;break}const{explode:e}=r,s=t.size.value,l=s*e.maxSizeFactor,a=t.getOpacity();t.exploding={initialFillOpacity:a.fillOpacity,initialSize:s,initialStrokeOpacity:a.strokeOpacity,maxSize:l,progress:0,speed:Math.max(e.speed,.01)},t.fillOpacity=a.fillOpacity,t.strokeOpacity=a.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 r=s.progress;return t.size.value=s.initialSize+(s.maxSize-s.initialSize)*r,t.fillOpacity=s.initialFillOpacity*(1-r),t.strokeOpacity=s.initialStrokeOpacity*(1-r),void(r>=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.2.0"),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)||(e.loadRangeProperty(this,"bottom",t.bottom),e.loadRangeProperty(this,"left",t.left),e.loadRangeProperty(this,"right",t.right),e.loadRangeProperty(this,"top",t.top))}}var l;!function(t){t.explode="explode",t.none="none",t.split="split"}(l||(l={}));class r{maxSizeFactor=3;speed=2;load(t){e.isNull(t)||(e.loadProperty(this,"maxSizeFactor",t.maxSizeFactor),e.loadProperty(this,"speed",t.speed))}}class a extends e.ValueWithRandom{value=3}class n extends e.ValueWithRandom{value={min:4,max:9}}class i{count=1;factor=new a;fillColor;fillColorOffset;particles;rate=new n;sizeOffset=!0;strokeColor;strokeColorOffset;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)),e.loadProperty(this,"count",t.count),this.factor.load(t.factor),this.rate.load(t.rate),this.particles=e.executeOnSingleOrMultiple(t.particles,t=>e.deepExtend({},t)),e.loadProperty(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=new s;explode=new r;mode=l.none;split=new i;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,r){return t&&r?function(t,s){const l=e.getRangeValue(s.h??0),r=e.getRangeValue(s.s??0),a=e.getRangeValue(s.l??0),n=(t.h+l)%360,i=Math.max(0,Math.min(100,t.s+r)),o=Math.max(0,Math.min(100,t.l+a));return e.AnimatableColor.create(void 0,{value:{hsl:{h:n<0?n+360:n,s:i,l:o}}})}(r,t):s?e.AnimatableColor.create(void 0,s):l?e.AnimatableColor.create(void 0,l):r?function(t){return e.AnimatableColor.create(void 0,{value:{hsl:t}})}(r):void 0}function p(t,s,l,r){const a=l.options.destroy;if(!a)return;const n=a.split,i=e.loadParticlesOptions(t,s,l.options),o=e.itemFromSingleOrMultiple(n.fillColor),p=e.itemFromSingleOrMultiple(n.strokeColor),d=l.getFillColor(),_=l.getStrokeColor();i.move.load({center:{x:l.position.x,y:l.position.y,mode:e.PixelMode.precise}});const f=e.identity/e.getRangeValue(n.factor.value),u=i.size;u&&(e.isNumber(u.value)?u.value*=f:(u.value.min*=f,u.value.max*=f)),i.load(r);const h=e.itemFromSingleOrMultiple(i.paint),g=h?.fill,P=h?.stroke,I=c(n.fillColorOffset,o,g?.color,d),y=c(n.strokeColorOffset,p,P?.color,_);I&&g&&(g.color=I),y&&P&&(P.color=y);const m=n.sizeOffset?e.setRangeValue(-l.size.value,l.size.value):0,O={x:l.position.x+e.randomInRangeValue(m),y:l.position.y+e.randomInRangeValue(m)};return s.particles.addParticle(O,i,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{#t;#e;constructor(t,e){this.#t=e,this.#e=t}init(t){const s=this.#t,l=t.options.destroy;if(!l)return;t.exploding=void 0,t.splitCount=0;const r=l.bounds;t.destroyBounds??={};const{bottom:a,left:n,right:i,top:o}=r,{destroyBounds:c}=t,p=s.canvas.size;a&&(c.bottom=e.getRangeValue(a)*p.height/e.percentDenominator),n&&(c.left=e.getRangeValue(n)*p.width/e.percentDenominator),i&&(c.right=e.getRangeValue(i)*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,...s){e.loadOptionProperty(t,"destroy",o,...s)}particleDestroyed(t,s){if(s)return;const r=t.options.destroy;switch(r?.mode){case l.split:!function(t,s,l){const r=l.options.destroy;if(!r)return;const a=r.split;if(a.count>=0){if(void 0===l.splitCount||l.splitCount>a.count)return;l.splitCount++}const n=e.getRangeValue(a.rate.value),i=e.itemFromSingleOrMultiple(a.particles);for(let e=0;e<n;e++)p(t,s,l,i)}(this.#e,this.#t,t);break;case l.explode:{if(t.exploding){t.destroyed=!1;break}const{explode:e}=r,s=t.size.value,l=s*e.maxSizeFactor,a=t.getOpacity();t.exploding={initialFillOpacity:a.fillOpacity,initialSize:s,initialStrokeOpacity:a.strokeOpacity,maxSize:l,progress:0,speed:Math.max(e.speed,.01)},t.fillOpacity=a.fillOpacity,t.strokeOpacity=a.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 r=s.progress;return t.size.value=s.initialSize+(s.maxSize-s.initialSize)*r,t.fillOpacity=s.initialFillOpacity*(1-r),t.strokeOpacity=s.initialStrokeOpacity*(1-r),void(r>=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.2.1"),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;