"use strict";(globalThis.webpackChunkwordpress_particles=globalThis.webpackChunkwordpress_particles||[]).push([[909],{909:(t,n,i)=>{i.r(n),i.d(n,{Connect:()=>s,ConnectLinks:()=>o,loadExternalConnectInteraction:()=>r});var e=i(3290);class o{constructor(){this.opacity=.5}load(t){t&&void 0!==t.opacity&&(this.opacity=t.opacity)}}class s{constructor(){this.distance=80,this.links=new o,this.radius=60}get lineLinked(){return this.links}set lineLinked(t){this.links=t}get line_linked(){return this.links}set line_linked(t){this.links=t}load(t){var n,i;t&&(void 0!==t.distance&&(this.distance=t.distance),this.links.load(null!==(i=null!==(n=t.links)&&void 0!==n?n:t.lineLinked)&&void 0!==i?i:t.line_linked),void 0!==t.radius&&(this.radius=t.radius))}}function a(t,n,i){t.canvas.draw((o=>{var s;const a=function(t,n,i,o){const s=t.actualOptions.interactivity.modes.connect;if(s)return function(t,n,i,o){const s=Math.floor(i.getRadius()/n.getRadius()),a=n.getFillColor(),c=i.getFillColor();if(!a||!c)return;const r=n.getPosition(),l=i.getPosition(),d=(0,e.oc)(a,c,n.getRadius(),i.getRadius()),u=t.createLinearGradient(r.x,r.y,l.x,l.y);return u.addColorStop(0,(0,e.vz)(a,o)),u.addColorStop(s>1?1:s,(0,e.iz)(d,o)),u.addColorStop(1,(0,e.vz)(c,o)),u}(n,i,o,s.links.opacity)}(t,o,n,i);if(!a)return;const c=n.getPosition(),r=i.getPosition();!function(t,n,i,o,s){(0,e.pS)(t,o,s),t.lineWidth=n,t.strokeStyle=i,t.stroke()}(o,null!==(s=n.retina.linksWidth)&&void 0!==s?s:0,a,c,r)}))}class c extends e.L8{constructor(t){super(t)}clear(){}init(){const t=this.container,n=t.actualOptions.interactivity.modes.connect;n&&(t.retina.connectModeDistance=n.distance*t.retina.pixelRatio,t.retina.connectModeRadius=n.radius*t.retina.pixelRatio)}async interact(){const t=this.container;if(t.actualOptions.interactivity.events.onHover.enable&&"pointermove"===t.interactivity.status){const n=t.interactivity.mouse.position;if(!t.retina.connectModeDistance||t.retina.connectModeDistance<0||!t.retina.connectModeRadius||t.retina.connectModeRadius<0||!n)return;const i=Math.abs(t.retina.connectModeRadius),e=t.particles.quadTree.queryCircle(n,i,(t=>this.isEnabled(t)));let o=0;for(const n of e){const i=n.getPosition();for(const s of e.slice(o+1)){const e=s.getPosition(),o=Math.abs(t.retina.connectModeDistance),c=Math.abs(i.x-e.x),r=Math.abs(i.y-e.y);c<o&&r<o&&a(t,n,s)}++o}}}isEnabled(t){var n;const i=this.container,o=i.interactivity.mouse,s=(null!==(n=null==t?void 0:t.interactivity)&&void 0!==n?n:i.actualOptions.interactivity).events;return!(!s.onHover.enable||!o.position)&&(0,e.dB)("connect",s.onHover.mode)}loadModeOptions(t){t.connect||(t.connect=new s);for(var n=arguments.length,i=new Array(n>1?n-1:0),e=1;e<n;e++)i[e-1]=arguments[e];for(const n of i)t.connect.load(null==n?void 0:n.connect)}reset(){}}async function r(t){await t.addInteractor("externalConnect",(t=>new c(t)))}}}]);