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