"use strict";(globalThis.webpackChunkwordpress_particles=globalThis.webpackChunkwordpress_particles||[]).push([[821],{821:(e,t,o)=>{o.r(t),o.d(t,{Bounce:()=>i,loadExternalBounceInteraction:()=>c});var n=o(1197);class i{constructor(){this.distance=200}load(e){e&&void 0!==e.distance&&(this.distance=e.distance)}}class s extends n.L8{constructor(e){super(e)}clear(){}init(){const e=this.container,t=e.actualOptions.interactivity.modes.bounce;t&&(e.retina.bounceModeDistance=t.distance*e.retina.pixelRatio)}async interact(){const e=this.container,t=e.actualOptions.interactivity.events,o=e.interactivity.status===n.Wt,i=t.onHover.enable,s=t.onHover.mode,c=t.onDiv;o&&i&&(0,n.dB)("bounce",s)?this.processMouseBounce():(0,n.XD)("bounce",c,((e,t)=>this.singleSelectorBounce(e,t)))}isEnabled(e){var t;const o=this.container,i=o.actualOptions,s=o.interactivity.mouse,c=(null!==(t=null==e?void 0:e.interactivity)&&void 0!==t?t:i.interactivity).events,a=c.onDiv;return s.position&&c.onHover.enable&&(0,n.dB)("bounce",c.onHover.mode)||(0,n.wm)("bounce",a)}loadModeOptions(e){e.bounce||(e.bounce=new i);for(var t=arguments.length,o=new Array(t>1?t-1:0),n=1;n<t;n++)o[n-1]=arguments[n];for(const t of o)e.bounce.load(null==t?void 0:t.bounce)}reset(){}processBounce(e,t,o){const i=this.container.particles.quadTree.query(o,(e=>this.isEnabled(e)));for(const s of i)o instanceof n.Cd?(0,n.kR)((0,n.gy)(s),{position:e,radius:t,mass:t**2*Math.PI/2,velocity:n.OW.origin,factor:n.OW.origin}):o instanceof n.Ae&&(0,n.dp)(s,(0,n.M_)(e,t))}processMouseBounce(){const e=this.container,t=10*e.retina.pixelRatio,o=e.interactivity.mouse.position,i=e.retina.bounceModeDistance;!i||i<0||!o||this.processBounce(o,i,new n.Cd(o.x,o.y,i+t))}singleSelectorBounce(e,t){const o=this.container,i=document.querySelectorAll(e);i.length&&i.forEach((e=>{const i=e,s=o.retina.pixelRatio,c={x:(i.offsetLeft+i.offsetWidth/2)*s,y:(i.offsetTop+i.offsetHeight/2)*s},a=i.offsetWidth/2*s,r=10*s,u="circle"===t.type?new n.Cd(c.x,c.y,a+r):new n.Ae(i.offsetLeft*s-r,i.offsetTop*s-r,i.offsetWidth*s+2*r,i.offsetHeight*s+2*r);this.processBounce(c,a,u)}))}}async function c(e){await e.addInteractor("externalBounce",(e=>new s(e)))}}}]);