"use strict";(globalThis.webpackChunkwordpress_particles=globalThis.webpackChunkwordpress_particles||[]).push([[7217],{7217:(e,s,t)=>{t.r(s),t.d(s,{Repulse:()=>r,RepulseBase:()=>o,RepulseDiv:()=>n,loadExternalRepulseInteraction:()=>c});var i=t(3290);class o{constructor(){this.distance=200,this.duration=.4,this.factor=100,this.speed=1,this.maxSpeed=50,this.easing="ease-out-quad"}load(e){e&&(void 0!==e.distance&&(this.distance=e.distance),void 0!==e.duration&&(this.duration=e.duration),void 0!==e.easing&&(this.easing=e.easing),void 0!==e.factor&&(this.factor=e.factor),void 0!==e.speed&&(this.speed=e.speed),void 0!==e.maxSpeed&&(this.maxSpeed=e.maxSpeed))}}class n extends o{constructor(){super(),this.selectors=[]}get ids(){return(0,i.KH)(this.selectors,(e=>e.replace("#","")))}set ids(e){this.selectors=(0,i.KH)(e,(e=>`#${e}`))}load(e){super.load(e),e&&(void 0!==e.ids&&(this.ids=e.ids),void 0!==e.selectors&&(this.selectors=e.selectors))}}class r extends o{load(e){super.load(e),e&&(this.divs=(0,i.KH)(e.divs,(e=>{const s=new n;return s.load(e),s})))}}class l extends i.L8{constructor(e,s){super(s),this._engine=e,s.repulse||(s.repulse={particles:[]}),this.handleClickMode=e=>{const t=this.container.actualOptions.interactivity.modes.repulse;if(t&&"repulse"===e){s.repulse||(s.repulse={particles:[]}),s.repulse.clicking=!0,s.repulse.count=0;for(const e of s.repulse.particles)this.isEnabled(e)&&e.velocity.setTo(e.initialVelocity);s.repulse.particles=[],s.repulse.finish=!1,setTimeout((()=>{s.destroyed||(s.repulse||(s.repulse={particles:[]}),s.repulse.clicking=!1)}),1e3*t.duration)}}}clear(){}init(){const e=this.container,s=e.actualOptions.interactivity.modes.repulse;s&&(e.retina.repulseModeDistance=s.distance*e.retina.pixelRatio)}async interact(){const e=this.container,s=e.actualOptions,t=e.interactivity.status===i.Wt,o=s.interactivity.events,n=o.onHover.enable,r=o.onHover.mode,l=o.onClick.enable,c=o.onClick.mode,a=o.onDiv;t&&n&&(0,i.dB)("repulse",r)?this.hoverRepulse():l&&(0,i.dB)("repulse",c)?this.clickRepulse():(0,i.XD)("repulse",a,((e,s)=>this.singleSelectorRepulse(e,s)))}isEnabled(e){var s;const t=this.container,o=t.actualOptions,n=t.interactivity.mouse,r=(null!==(s=null==e?void 0:e.interactivity)&&void 0!==s?s:o.interactivity).events,l=r.onDiv,c=(0,i.wm)("repulse",l);if(!(c||r.onHover.enable&&n.position||r.onClick.enable&&n.clickPosition))return!1;const a=r.onHover.mode,p=r.onClick.mode;return(0,i.dB)("repulse",a)||(0,i.dB)("repulse",p)||c}loadModeOptions(e){e.repulse||(e.repulse=new r);for(var s=arguments.length,t=new Array(s>1?s-1:0),i=1;i<s;i++)t[i-1]=arguments[i];for(const s of t)e.repulse.load(null==s?void 0:s.repulse)}reset(){}clickRepulse(){const e=this.container,s=e.actualOptions.interactivity.modes.repulse;if(s)if(e.repulse||(e.repulse={particles:[]}),e.repulse.finish||(e.repulse.count||(e.repulse.count=0),e.repulse.count++,e.repulse.count===e.particles.count&&(e.repulse.finish=!0)),e.repulse.clicking){const t=e.retina.repulseModeDistance;if(!t||t<0)return;const o=Math.pow(t/6,3),n=e.interactivity.mouse.clickPosition;if(void 0===n)return;const r=new i.Cd(n.x,n.y,o),l=e.particles.quadTree.query(r,(e=>this.isEnabled(e)));for(const t of l){const{dx:r,dy:l,distance:c}=(0,i.oW)(n,t.position),a=c**2,p=-o*s.speed/a;if(a<=o){e.repulse.particles.push(t);const s=i.OW.create(r,l);s.length=p,t.velocity.setTo(s)}}}else if(!1===e.repulse.clicking){for(const s of e.repulse.particles)s.velocity.setTo(s.initialVelocity);e.repulse.particles=[]}}hoverRepulse(){const e=this.container,s=e.interactivity.mouse.position,t=e.retina.repulseModeDistance;!t||t<0||!s||this.processRepulse(s,t,new i.Cd(s.x,s.y,t))}processRepulse(e,s,t,o){var n;const r=this.container,l=r.particles.quadTree.query(t,(e=>this.isEnabled(e))),c=r.actualOptions.interactivity.modes.repulse;if(c)for(const t of l){const{dx:r,dy:l,distance:a}=(0,i.oW)(t.position,e),p=(null!==(n=null==o?void 0:o.speed)&&void 0!==n?n:c.speed)*c.factor,u=(0,i.uZ)((0,i._X)(c.easing)(1-a/s)*p,0,c.maxSpeed),d=i.OW.create(0===a?p:r/a*u,0===a?p:l/a*u);t.position.addTo(d)}}singleSelectorRepulse(e,s){const t=this.container,o=t.actualOptions.interactivity.modes.repulse;if(!o)return;const n=document.querySelectorAll(e);n.length&&n.forEach((e=>{const n=e,r=t.retina.pixelRatio,l={x:(n.offsetLeft+n.offsetWidth/2)*r,y:(n.offsetTop+n.offsetHeight/2)*r},c=n.offsetWidth/2*r,a="circle"===s.type?new i.Cd(l.x,l.y,c):new i.Ae(n.offsetLeft*r,n.offsetTop*r,n.offsetWidth*r,n.offsetHeight*r),p=o.divs,u=(0,i.iC)(p,n);this.processRepulse(l,c,a,u)}))}}async function c(e){await e.addInteractor("externalRepulse",(s=>new l(e,s)))}}}]);