"use strict";(globalThis.webpackChunk_tsparticles_wordpress=globalThis.webpackChunk_tsparticles_wordpress||[]).push([[4839],{4839:(t,o,s)=>{s.d(o,{loadDestroyUpdater:()=>u});var e=s(9201);class i{load(t){t&&(void 0!==t.bottom&&(this.bottom=(0,e.Cs)(t.bottom)),void 0!==t.left&&(this.left=(0,e.Cs)(t.left)),void 0!==t.right&&(this.right=(0,e.Cs)(t.right)),void 0!==t.top&&(this.top=(0,e.Cs)(t.top)))}}class l extends e.SW{constructor(){super(),this.value=3}}class r extends e.SW{constructor(){super(),this.value={min:4,max:9}}}class n{constructor(){this.count=1,this.factor=new l,this.rate=new r,this.sizeOffset=!0}load(t){t&&(void 0!==t.color&&(this.color=e.Oz.create(this.color,t.color)),void 0!==t.count&&(this.count=t.count),this.factor.load(t.factor),this.rate.load(t.rate),this.particles=(0,e.KH)(t.particles,(t=>(0,e.ZB)({},t))),void 0!==t.sizeOffset&&(this.sizeOffset=t.sizeOffset),t.colorOffset&&(this.colorOffset=this.colorOffset??{},void 0!==t.colorOffset.h&&(this.colorOffset.h=t.colorOffset.h),void 0!==t.colorOffset.s&&(this.colorOffset.s=t.colorOffset.s),void 0!==t.colorOffset.l&&(this.colorOffset.l=t.colorOffset.l)))}}class c{constructor(){this.bounds=new i,this.mode="none",this.split=new n}load(t){t&&(t.mode&&(this.mode=t.mode),t.bounds&&this.bounds.load(t.bounds),this.split.load(t.split))}}function d(t,o,s,i){const l=s.options.destroy;if(!l)return;const r=l.split,n=(0,e.hT)(t,o,s.options),c=(0,e.Gu)(r.factor.value),d=s.getFillColor();r.color?n.color.load(r.color):r.colorOffset&&d?n.color.load({value:{hsl:{h:d.h+(0,e.Gu)(r.colorOffset.h??0),s:d.s+(0,e.Gu)(r.colorOffset.s??0),l:d.l+(0,e.Gu)(r.colorOffset.l??0)}}}):n.color.load({value:{hsl:s.getFillColor()}}),n.move.load({center:{x:s.position.x,y:s.position.y,mode:"precise"}}),(0,e.hj)(n.size.value)?n.size.value/=c:(n.size.value.min/=c,n.size.value.max/=c),n.load(i);const a=r.sizeOffset?(0,e.Cs)(-s.size.value,s.size.value):0,u={x:s.position.x+(0,e.vd)(a),y:s.position.y+(0,e.vd)(a)};return o.particles.addParticle(u,n,s.group,(t=>!(t.size.value<.5||(t.velocity.length=(0,e.vd)((0,e.Cs)(s.velocity.length,t.velocity.length)),t.splitCount=(s.splitCount??0)+1,t.unbreakable=!0,setTimeout((()=>{t.unbreakable=!1}),500),0))))}class a{constructor(t,o){this.engine=t,this.container=o}init(t){const o=this.container,s=t.options.destroy;if(!s)return;t.splitCount=0;const i=s.bounds;t.destroyBounds||(t.destroyBounds={});const{bottom:l,left:r,right:n,top:c}=i,{destroyBounds:d}=t,a=o.canvas.size;l&&(d.bottom=(0,e.Gu)(l)*a.height/100),r&&(d.left=(0,e.Gu)(r)*a.width/100),n&&(d.right=(0,e.Gu)(n)*a.width/100),c&&(d.top=(0,e.Gu)(c)*a.height/100)}isEnabled(t){return!t.destroyed}loadOptions(t,...o){t.destroy||(t.destroy=new c);for(const s of o)t.destroy.load(s?.destroy)}particleDestroyed(t,o){if(o)return;const s=t.options.destroy;s&&"split"===s.mode&&function(t,o,s){const i=s.options.destroy;if(!i)return;const l=i.split;if(l.count>=0&&(void 0===s.splitCount||s.splitCount++>l.count))return;const r=(0,e.Gu)(l.rate.value),n=(0,e.wA)(l.particles);for(let e=0;e<r;e++)d(t,o,s,n)}(this.engine,this.container,t)}update(t){if(!this.isEnabled(t))return;const o=t.getPosition(),s=t.destroyBounds;s&&(void 0!==s.bottom&&o.y>=s.bottom||void 0!==s.left&&o.x<=s.left||void 0!==s.right&&o.x>=s.right||void 0!==s.top&&o.y<=s.top)&&t.destroy()}}async function u(t,o=!0){await t.addParticleUpdater("destroy",(o=>new a(t,o)),o)}}}]);