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