"use strict";(self.webpackChunkwordpress_particles=self.webpackChunkwordpress_particles||[]).push([[1424],{1424:function(a,o,t){t.r(o),t.d(o,{loadOpacityUpdater:function(){return p}});var i=t(3563);class c{constructor(a){this.container=a}init(a){const o=a.options.opacity;a.opacity={enable:o.animation.enable,max:(0,i.KI)(o.value),min:(0,i.Uv)(o.value),value:(0,i.Gu)(o.value),loops:0,maxLoops:(0,i.Gu)(o.animation.count)};const t=o.animation;if(t.enable){a.opacity.decay=1-(0,i.Gu)(t.decay),a.opacity.status=0;const c=o.value;switch(a.opacity.min=(0,i.Uv)(c),a.opacity.max=(0,i.KI)(c),t.startValue){case"min":a.opacity.value=a.opacity.min,a.opacity.status=0;break;case"random":a.opacity.value=(0,i.vd)(a.opacity),a.opacity.status=(0,i.sZ)()>=.5?0:1;break;default:a.opacity.value=a.opacity.max,a.opacity.status=1}a.opacity.velocity=(0,i.Gu)(t.speed)/100*this.container.retina.reduceFactor,t.sync||(a.opacity.velocity*=(0,i.sZ)())}}isEnabled(a){var o,t,i,c;return!a.destroyed&&!a.spawning&&!!a.opacity&&a.opacity.enable&&((null!==(o=a.opacity.maxLoops)&&void 0!==o?o:0)<=0||(null!==(t=a.opacity.maxLoops)&&void 0!==t?t:0)>0&&(null!==(i=a.opacity.loops)&&void 0!==i?i:0)<(null!==(c=a.opacity.maxLoops)&&void 0!==c?c:0))}reset(a){a.opacity&&(a.opacity.loops=0)}update(a,o){this.isEnabled(a)&&function(a,o){var t,c,p,e,s,y;if(!a.opacity)return;const l=a.opacity.min,n=a.opacity.max,u=null!==(t=a.opacity.decay)&&void 0!==t?t:1;if(!(a.destroyed||!a.opacity.enable||(null!==(c=a.opacity.maxLoops)&&void 0!==c?c:0)>0&&(null!==(p=a.opacity.loops)&&void 0!==p?p:0)>(null!==(e=a.opacity.maxLoops)&&void 0!==e?e:0))){switch(a.opacity.status){case 0:a.opacity.value>=n?(a.opacity.status=1,a.opacity.loops||(a.opacity.loops=0),a.opacity.loops++):a.opacity.value+=(null!==(s=a.opacity.velocity)&&void 0!==s?s:0)*o.factor;break;case 1:a.opacity.value<=l?(a.opacity.status=0,a.opacity.loops||(a.opacity.loops=0),a.opacity.loops++):a.opacity.value-=(null!==(y=a.opacity.velocity)&&void 0!==y?y:0)*o.factor}a.opacity.velocity&&1!==a.opacity.decay&&(a.opacity.velocity*=u),function(a,o,t,i){switch(a.options.opacity.animation.destroy){case"max":o>=i&&a.destroy();break;case"min":o<=t&&a.destroy()}}(a,a.opacity.value,l,n),a.destroyed||(a.opacity.value=(0,i.uZ)(a.opacity.value,l,n))}}(a,o)}}async function p(a){await a.addParticleUpdater("opacity",(a=>new c(a)))}}}]);