"use strict";(globalThis.webpackChunk_tsparticles_wordpress=globalThis.webpackChunk_tsparticles_wordpress||[]).push([[1810],{1810:(t,n,i)=>{i.d(n,{loadExternalConnectInteraction:()=>r});var o=i(9201);class e{constructor(){this.opacity=.5}load(t){t&&void 0!==t.opacity&&(this.opacity=t.opacity)}}class s{constructor(){this.distance=80,this.links=new e,this.radius=60}load(t){t&&(void 0!==t.distance&&(this.distance=t.distance),this.links.load(t.links),void 0!==t.radius&&(this.radius=t.radius))}}function a(t,n,i){t.canvas.draw((e=>{const s=function(t,n,i,e){const s=t.actualOptions.interactivity.modes.connect;if(s)return function(t,n,i,e){const s=Math.floor(i.getRadius()/n.getRadius()),a=n.getFillColor(),c=i.getFillColor();if(!a||!c)return;const r=n.getPosition(),d=i.getPosition(),l=(0,o.oc)(a,c,n.getRadius(),i.getRadius()),u=t.createLinearGradient(r.x,r.y,d.x,d.y);return u.addColorStop(0,(0,o.vz)(a,e)),u.addColorStop(s>1?1:s,(0,o.iz)(l,e)),u.addColorStop(1,(0,o.vz)(c,e)),u}(n,i,e,s.links.opacity)}(t,e,n,i);if(!s)return;const a=n.getPosition(),c=i.getPosition();!function(t,n,i,e,s){(0,o.pS)(t,e,s),t.lineWidth=n,t.strokeStyle=i,t.stroke()}(e,n.retina.linksWidth??0,s,a,c)}))}class c extends o.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),o=t.particles.quadTree.queryCircle(n,i,(t=>this.isEnabled(t)));let e=0;for(const n of o){const i=n.getPosition();for(const s of o.slice(e+1)){const o=s.getPosition(),e=Math.abs(t.retina.connectModeDistance),c=Math.abs(i.x-o.x),r=Math.abs(i.y-o.y);c<e&&r<e&&a(t,n,s)}++e}}}isEnabled(t){const n=this.container,i=n.interactivity.mouse,e=(t?.interactivity??n.actualOptions.interactivity).events;return!(!e.onHover.enable||!i.position)&&(0,o.dB)("connect",e.onHover.mode)}loadModeOptions(t,...n){t.connect||(t.connect=new s);for(const i of n)t.connect.load(i?.connect)}reset(){}}async function r(t,n=!0){await t.addInteractor("externalConnect",(t=>new c(t)),n)}}}]);