"use strict";(globalThis.webpackChunkwordpress_particles=globalThis.webpackChunkwordpress_particles||[]).push([[8087],{3151:(e,t,s)=>{s.d(t,{L:()=>i});class i{constructor(e){this.container=e,this.type="external"}}},8087:(e,t,s)=>{s.r(t),s.d(t,{Repulse:()=>u,RepulseBase:()=>p,RepulseDiv:()=>d,loadExternalRepulseInteraction:()=>f});var i=s(3151),o=s(9201),n=s(5302),c=s(2613),r=s(573),a=s(4684),l=s(8264);class p{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 d extends p{constructor(){super(),this.selectors=[]}get ids(){return(0,a.KH)(this.selectors,(e=>e.replace("#","")))}set ids(e){this.selectors=(0,a.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 u extends p{load(e){super.load(e),e&&(this.divs=(0,a.KH)(e.divs,(e=>{const t=new d;return t.load(e),t})))}}class h extends i.L{constructor(e,t){super(t),this._clickRepulse=()=>{const e=this.container,t=e.actualOptions.interactivity.modes.repulse;if(!t)return;const s=e.repulse||{particles:[]};if(s.finish||(s.count||(s.count=0),s.count++,s.count===e.particles.count&&(s.finish=!0)),s.clicking){const i=e.retina.repulseModeDistance;if(!i||i<0)return;const r=Math.pow(i/6,3),a=e.interactivity.mouse.clickPosition;if(void 0===a)return;const l=new o.C(a.x,a.y,r),p=e.particles.quadTree.query(l,(e=>this.isEnabled(e)));for(const e of p){const{dx:i,dy:o,distance:l}=(0,n.oW)(a,e.position),p=l**2,d=-r*t.speed/p;if(p<=r){s.particles.push(e);const t=c.O.create(i,o);t.length=d,e.velocity.setTo(t)}}}else if(!1===s.clicking){for(const e of s.particles)e.velocity.setTo(e.initialVelocity);s.particles=[]}},this._hoverRepulse=()=>{const e=this.container,t=e.interactivity.mouse.position,s=e.retina.repulseModeDistance;!s||s<0||!t||this._processRepulse(t,s,new o.C(t.x,t.y,s))},this._processRepulse=(e,t,s,i)=>{const o=this.container,r=o.particles.quadTree.query(s,(e=>this.isEnabled(e))),a=o.actualOptions.interactivity.modes.repulse;if(a)for(const s of r){const{dx:o,dy:r,distance:l}=(0,n.oW)(s.position,e),p=(i?.speed??a.speed)*a.factor,d=(0,n.uZ)((0,n._X)(a.easing)(1-l/t)*p,0,a.maxSpeed),u=c.O.create(0===l?p:o/l*d,0===l?p:r/l*d);s.position.addTo(u)}},this._singleSelectorRepulse=(e,t)=>{const s=this.container,i=s.actualOptions.interactivity.modes.repulse;if(!i)return;const n=document.querySelectorAll(e);n.length&&n.forEach((e=>{const n=e,c=s.retina.pixelRatio,l={x:(n.offsetLeft+n.offsetWidth/2)*c,y:(n.offsetTop+n.offsetHeight/2)*c},p=n.offsetWidth/2*c,d="circle"===t.type?new o.C(l.x,l.y,p):new r.A(n.offsetLeft*c,n.offsetTop*c,n.offsetWidth*c,n.offsetHeight*c),u=i.divs,h=(0,a.iC)(u,n);this._processRepulse(l,p,d,h)}))},this._engine=e,t.repulse||(t.repulse={particles:[]}),this.handleClickMode=e=>{const s=this.container.actualOptions.interactivity.modes.repulse;if(!s||"repulse"!==e)return;t.repulse||(t.repulse={particles:[]});const i=t.repulse;i.clicking=!0,i.count=0;for(const e of t.repulse.particles)this.isEnabled(e)&&e.velocity.setTo(e.initialVelocity);i.particles=[],i.finish=!1,setTimeout((()=>{t.destroyed||(i.clicking=!1)}),1e3*s.duration)}}clear(){}init(){const e=this.container,t=e.actualOptions.interactivity.modes.repulse;t&&(e.retina.repulseModeDistance=t.distance*e.retina.pixelRatio)}async interact(){const e=this.container,t=e.actualOptions,s=e.interactivity.status===l.Wt,i=t.interactivity.events,o=i.onHover,n=o.enable,c=o.mode,r=i.onClick,p=r.enable,d=r.mode,u=i.onDiv;s&&n&&(0,a.dB)("repulse",c)?this._hoverRepulse():p&&(0,a.dB)("repulse",d)?this._clickRepulse():(0,a.XD)("repulse",u,((e,t)=>this._singleSelectorRepulse(e,t)))}isEnabled(e){const t=this.container,s=t.actualOptions,i=t.interactivity.mouse,o=(e?.interactivity??s.interactivity).events,n=o.onDiv,c=o.onHover,r=o.onClick,l=(0,a.wm)("repulse",n);if(!(l||c.enable&&i.position||r.enable&&i.clickPosition))return!1;const p=c.mode,d=r.mode;return(0,a.dB)("repulse",p)||(0,a.dB)("repulse",d)||l}loadModeOptions(e,...t){e.repulse||(e.repulse=new u);for(const s of t)e.repulse.load(s?.repulse)}reset(){}}async function f(e,t=!0){await e.addInteractor("externalRepulse",(t=>new h(e,t)),t)}}}]);