"use strict";(globalThis.webpackChunk_tsparticles_wordpress=globalThis.webpackChunk_tsparticles_wordpress||[]).push([[2666],{2666:(t,s,i)=>{i.d(s,{loadLightInteraction:()=>d});var a=i(9201);const o="light";class e{constructor(){this.start=new a.Oz,this.stop=new a.Oz,this.start.value="#ffffff",this.stop.value="#000000"}load(t){t&&(this.start=a.Oz.create(this.start,t.start),this.stop=a.Oz.create(this.stop,t.stop))}}class n{constructor(){this.gradient=new e,this.radius=1e3}load(t){t&&(this.gradient.load(t.gradient),void 0!==t.radius&&(this.radius=t.radius))}}class r{constructor(){this.color=new a.Oz,this.color.value="#000000",this.length=2e3}load(t){t&&(this.color=a.Oz.create(this.color,t.color),void 0!==t.length&&(this.length=t.length))}}class c{constructor(){this.area=new n,this.shadow=new r}load(t){t&&(this.area.load(t.area),this.shadow.load(t.shadow))}}class l extends a.L8{constructor(t){super(t)}clear(){}init(){}async interact(){const t=this.container,s=t.actualOptions,i=t.interactivity;if(!s.interactivity.events.onHover.enable||"pointermove"!==i.status)return;const o=i.mouse.position;o&&t.canvas.draw((s=>{!function(t,s,i){const o=t.actualOptions.interactivity.modes.light?.area;if(!o)return;s.beginPath(),s.arc(i.x,i.y,o.radius,0,2*Math.PI);const e=s.createRadialGradient(i.x,i.y,0,i.x,i.y,o.radius),n=t.canvas.mouseLight;n&&n.start&&n.stop&&(e.addColorStop(0,(0,a.iz)(n.start)),e.addColorStop(1,(0,a.iz)(n.stop)),s.fillStyle=e,s.fill())}(t,s,o)}))}isEnabled(t){const s=this.container,i=s.interactivity.mouse,e=t?.interactivity??s.actualOptions.interactivity,n=e.events;if(!n.onHover.enable||!i.position)return!1;const r=(0,a.dB)(o,n.onHover.mode);if(r&&e.modes.light){const t=e.modes.light.area.gradient;s.canvas.mouseLight={start:(0,a.tX)(t.start),stop:(0,a.tX)(t.stop)}}return r}loadModeOptions(t,...s){t.light||(t.light=new c);for(const i of s)t.light.load(i?.light)}reset(){}}class h extends a.$S{constructor(t){super(t)}clear(){}init(){}async interact(t){const s=this.container,i=s.actualOptions,o=s.interactivity;if(!i.interactivity.events.onHover.enable||"pointermove"!==o.status)return;const e=o.mouse.position;e&&s.canvas.draw((i=>{!function(t,s,i,o){const e=i.getPosition(),n=t.actualOptions.interactivity.modes.light?.shadow;if(!n)return;const r=i.lightShadow;if(!r)return;const c=i.getRadius(),l=i.sides,h=2*Math.PI/l,d=-i.rotation+Math.PI/4,u=[];for(let t=0;t<l;t++)u.push({x:e.x+c*Math.sin(d+h*t)*1,y:e.y+c*Math.cos(d+h*t)*1});const p=[],v=n.length;for(const t of u){const s=Math.atan2(o.y-t.y,o.x-t.x),i={x:t.x+v*Math.sin(-s-Math.PI/2),y:t.y+v*Math.cos(-s-Math.PI/2)};p.push({end:i,start:t})}const g=(0,a.iz)(r);for(let t=p.length-1,i=0;t>=0;i=t--)s.beginPath(),s.moveTo(p[t].start.x,p[t].start.y),s.lineTo(p[i].start.x,p[i].start.y),s.lineTo(p[i].end.x,p[i].end.y),s.lineTo(p[t].end.x,p[t].end.y),s.fillStyle=g,s.fill()}(s,i,t,e)}))}isEnabled(t){const s=this.container,i=t.interactivity??s.actualOptions.interactivity,e=s.interactivity.mouse,n=i.events;if(!n.onHover.enable||!e.position)return!1;const r=(0,a.dB)(o,n.onHover.mode);if(r&&i.modes.light){const s=i.modes.light.shadow;t.lightShadow=(0,a.tX)(s.color)}return r}reset(){}}async function d(t,s=!0){await t.addInteractor("externalLight",(t=>new l(t)),s),await t.addInteractor("particlesLight",(t=>new h(t)),s)}}}]);