"use strict";(globalThis.webpackChunkwordpress_particles=globalThis.webpackChunkwordpress_particles||[]).push([[1690],{1690:(t,e,a)=>{a.r(e),a.d(e,{loadAngleUpdater:()=>r});var o=a(1197);class i{constructor(){this.enable=!1,this.speed=0,this.decay=0,this.sync=!1}load(t){t&&(void 0!==t.enable&&(this.enable=t.enable),void 0!==t.speed&&(this.speed=(0,o.Cs)(t.speed)),void 0!==t.decay&&(this.decay=(0,o.Cs)(t.decay)),void 0!==t.sync&&(this.sync=t.sync))}}class n extends o.SW{constructor(){super(),this.animation=new i,this.direction="clockwise",this.path=!1,this.value=0}load(t){t&&(super.load(t),void 0!==t.direction&&(this.direction=t.direction),this.animation.load(t.animation),void 0!==t.path&&(this.path=t.path))}}class s{constructor(t){this.container=t}init(t){const e=t.options.rotate;if(!e)return;t.rotate={enable:e.animation.enable,value:(0,o.Gu)(e.value)*Math.PI/180},t.pathRotation=e.path;let a=e.direction;switch("random"===a&&(a=Math.floor(2*(0,o.sZ)())>0?"counter-clockwise":"clockwise"),a){case"counter-clockwise":case"counterClockwise":t.rotate.status="decreasing";break;case"clockwise":t.rotate.status="increasing"}const i=e.animation;i.enable&&(t.rotate.decay=1-(0,o.Gu)(i.decay),t.rotate.velocity=(0,o.Gu)(i.speed)/360*this.container.retina.reduceFactor,i.sync||(t.rotate.velocity*=(0,o.sZ)())),t.rotation=t.rotate.value}isEnabled(t){const e=t.options.rotate;return!!e&&!t.destroyed&&!t.spawning&&e.animation.enable&&!e.path}loadOptions(t){t.rotate||(t.rotate=new n);for(var e=arguments.length,a=new Array(e>1?e-1:0),o=1;o<e;o++)a[o-1]=arguments[o];for(const e of a)t.rotate.load(null==e?void 0:e.rotate)}update(t,e){var a,o;this.isEnabled(t)&&(function(t,e){var a,o;const i=t.rotate,n=t.options.rotate;if(!i||!n)return;const s=n.animation,r=(null!==(a=i.velocity)&&void 0!==a?a:0)*e.factor,c=2*Math.PI,l=null!==(o=i.decay)&&void 0!==o?o:1;s.enable&&("increasing"===i.status?(i.value+=r,i.value>c&&(i.value-=c)):(i.value-=r,i.value<0&&(i.value+=c)),i.velocity&&1!==l&&(i.velocity*=l))}(t,e),t.rotation=null!==(o=null===(a=t.rotate)||void 0===a?void 0:a.value)&&void 0!==o?o:0)}}async function r(t){await t.addParticleUpdater("rotate",(t=>new s(t)))}}}]);