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