"use strict";(self.webpackChunkwordpress_particles=self.webpackChunkwordpress_particles||[]).push([[1276],{1276:function(i,e,n){n.r(e),n.d(e,{loadBaseMover:function(){return a}});var t=n(3563);class o{init(i){var e;const n=i.container,o=i.options,a=o.move.gravity,s=o.move.spin;if(i.gravity={enable:a.enable,acceleration:(0,t.Gu)(a.acceleration),inverse:a.inverse},s.enable){const o=null!==(e=s.position)&&void 0!==e?e:{x:50,y:50},a={x:o.x/100*n.canvas.size.width,y:o.y/100*n.canvas.size.height},c=i.getPosition(),l=(0,t.Sp)(c,a),r=(0,t.Gu)(s.acceleration);i.retina.spinAcceleration=r*n.retina.pixelRatio,i.spin={center:a,direction:i.velocity.x>=0?"clockwise":"counter-clockwise",angle:i.velocity.angle,radius:l,acceleration:i.retina.spinAcceleration}}}isEnabled(i){return!i.destroyed&&i.options.move.enable}move(i,e){var n,o,a,s,c;const l=i.options,r=l.move;if(!r.enable)return;const p=i.container,v=function(i){return i.slow.inRange?i.slow.factor:1}(i),y=(null!==(n=(s=i.retina).moveSpeed)&&void 0!==n?n:s.moveSpeed=(0,t.Gu)(r.speed)*p.retina.pixelRatio)*p.retina.reduceFactor,d=null!==(o=(c=i.retina).moveDrift)&&void 0!==o?o:c.moveDrift=(0,t.Gu)(i.options.move.drift)*p.retina.pixelRatio,u=(0,t.KI)(l.size.value)*p.retina.pixelRatio,x=y*((r.size?i.getRadius()/u:1)*v*(e.factor||1))/2;if(r.spin.enable)!function(i,e){const n=i.container;if(!i.spin)return;const t={x:"clockwise"===i.spin.direction?Math.cos:Math.sin,y:"clockwise"===i.spin.direction?Math.sin:Math.cos};i.position.x=i.spin.center.x+i.spin.radius*t.x(i.spin.angle),i.position.y=i.spin.center.y+i.spin.radius*t.y(i.spin.angle),i.spin.radius+=i.spin.acceleration;const o=Math.max(n.canvas.size.width,n.canvas.size.height);i.spin.radius>o/2?(i.spin.radius=o/2,i.spin.acceleration*=-1):i.spin.radius<0&&(i.spin.radius=0,i.spin.acceleration*=-1),i.spin.angle+=e/100*(1-i.spin.radius/o)}(i,x);else{!function(i,e){var n;const o=i.options.move.path;if(!o.enable)return;if(i.lastPathTime<=i.pathDelay)return void(i.lastPathTime+=e.value);const a=null===(n=i.pathGenerator)||void 0===n?void 0:n.generate(i);a&&i.velocity.addTo(a),o.clamp&&(i.velocity.x=(0,t.uZ)(i.velocity.x,-1,1),i.velocity.y=(0,t.uZ)(i.velocity.y,-1,1)),i.lastPathTime-=i.pathDelay}(i,e);const n=i.gravity,o=(null==n?void 0:n.enable)&&n.inverse?-1:1;(null==n?void 0:n.enable)&&x&&(i.velocity.y+=o*(n.acceleration*e.factor)/(60*x)),d&&x&&(i.velocity.x+=d*e.factor/(60*x));const s=i.moveDecay;1!=s&&i.velocity.multTo(s);const c=i.velocity.mult(x),l=null!==(a=i.retina.maxSpeed)&&void 0!==a?a:p.retina.maxSpeed;(null==n?void 0:n.enable)&&l>0&&(!n.inverse&&c.y>=0&&c.y>=l||n.inverse&&c.y<=0&&c.y<=-l)&&(c.y=o*l,x&&(i.velocity.y=c.y/x));const v=i.options.zIndex,y=(1-i.zIndexFactor)**v.velocityRate;1!=y&&c.multTo(y),i.position.addTo(c),r.vibrate&&(i.position.x+=Math.sin(i.position.x*Math.cos(i.position.y)),i.position.y+=Math.cos(i.position.y*Math.sin(i.position.x)))}!function(i){const e=i.initialPosition,{dx:n,dy:o}=(0,t.oW)(e,i.position),a=Math.abs(n),s=Math.abs(o),c=i.retina.maxDistance.horizontal,l=i.retina.maxDistance.vertical;if(c||l)if((c&&a>=c||l&&s>=l)&&!i.misplaced)i.misplaced=!!c&&a>c||!!l&&s>l,c&&(i.velocity.x=i.velocity.y/2-i.velocity.x),l&&(i.velocity.y=i.velocity.x/2-i.velocity.y);else if((!c||a<c)&&(!l||s<l)&&i.misplaced)i.misplaced=!1;else if(i.misplaced){const n=i.position,o=i.velocity;c&&(n.x<e.x&&o.x<0||n.x>e.x&&o.x>0)&&(o.x*=-(0,t.sZ)()),l&&(n.y<e.y&&o.y<0||n.y>e.y&&o.y>0)&&(o.y*=-(0,t.sZ)())}}(i)}}async function a(i){i.addMover("base",(()=>new o))}}}]);