"use strict";(globalThis.webpackChunk_tsparticles_wordpress=globalThis.webpackChunk_tsparticles_wordpress||[]).push([[2423],{2423(s,i,t){t.d(i,{PoissonDiscPluginInstance:()=>e});var n=t(3199);class e{poissonDisc;redrawTimeout;#s;#i;constructor(s){this.#s=s,this.#i=0}async init(){await this.#t()}particlePosition(s){const i=this.#s.actualOptions.poisson;if(this.poissonDisc&&i?.enable&&!(this.#i>=this.poissonDisc.points.length))return s??this.poissonDisc.points[this.#i++]?.position}resize(){const s=this.#s,i=s.actualOptions.poisson;i?.enable&&(this.redrawTimeout&&clearTimeout(this.redrawTimeout),this.redrawTimeout=setTimeout(()=>{(async()=>{this.#s.destroyed||(await this.#t(),await s.particles.redraw())})()},250))}stop(){delete this.poissonDisc}async#t(){const s=this.#s,i=s.actualOptions.poisson,e=s.actualOptions.particles,a=s.canvas.size,o=s.retina.pixelRatio;if(!i?.enable)return;this.#i=0;const{PoissonDisc:r}=await t.e(6487).then(t.bind(t,6487));this.poissonDisc=new r(a,i.radius?i.radius*o:Math.max((0,n.W9e)(e["size.value"]??1)*o,Math.sqrt(a.width*a.height/e.number.value)),i.retries,i.dimensions),i.steps>0?this.poissonDisc.steps(i.steps):await this.poissonDisc.run()}}}}]);