"use strict";(self.webpackChunkwordpress_particles=self.webpackChunkwordpress_particles||[]).push([[6023],{6023:function(e,i,t){t.r(i),t.d(i,{loadLifeUpdater:function(){return l}});var n=t(3563);class a extends n.SW{constructor(){super(),this.sync=!1}load(e){e&&(super.load(e),void 0!==e.sync&&(this.sync=e.sync))}}class s extends n.SW{constructor(){super(),this.random.minimumValue=1e-4,this.sync=!1}load(e){e&&(super.load(e),void 0!==e.sync&&(this.sync=e.sync))}}class o{constructor(){this.count=0,this.delay=new a,this.duration=new s}load(e){e&&(void 0!==e.count&&(this.count=e.count),this.delay.load(e.delay),this.duration.load(e.duration))}}class r{constructor(e){this.container=e}init(e){const i=this.container,t=e.options.life;t&&(e.life={delay:i.retina.reduceFactor?(0,n.Gu)(t.delay.value)*(t.delay.sync?1:(0,n.sZ)())/i.retina.reduceFactor*1e3:0,delayTime:0,duration:i.retina.reduceFactor?(0,n.Gu)(t.duration.value)*(t.duration.sync?1:(0,n.sZ)())/i.retina.reduceFactor*1e3:0,time:0,count:t.count},e.life.duration<=0&&(e.life.duration=-1),e.life.count<=0&&(e.life.count=-1),e.life&&(e.spawning=e.life.delay>0))}isEnabled(e){return!e.destroyed}loadOptions(e){e.life||(e.life=new o);for(var i=arguments.length,t=new Array(i>1?i-1:0),n=1;n<i;n++)t[n-1]=arguments[n];for(const i of t)e.life.load(null==i?void 0:i.life)}update(e,i){if(!this.isEnabled(e)||!e.life)return;const t=e.life;let a=!1;if(e.spawning){if(t.delayTime+=i.value,!(t.delayTime>=e.life.delay))return;a=!0,e.spawning=!1,t.delayTime=0,t.time=0}if(-1===t.duration)return;if(e.spawning)return;if(a?t.time=0:t.time+=i.value,t.time<t.duration)return;if(t.time=0,e.life.count>0&&e.life.count--,0===e.life.count)return void e.destroy();const s=this.container.canvas.size,o=(0,n.Cs)(0,s.width),r=(0,n.Cs)(0,s.width);e.position.x=(0,n.vd)(o),e.position.y=(0,n.vd)(r),e.spawning=!0,t.delayTime=0,t.time=0,e.reset();const l=e.options.life;l&&(t.delay=1e3*(0,n.Gu)(l.delay.value),t.duration=1e3*(0,n.Gu)(l.duration.value))}}async function l(e){await e.addParticleUpdater("life",(e=>new r(e)))}}}]);