"use strict";(globalThis.webpackChunk_tsparticles_wordpress=globalThis.webpackChunk_tsparticles_wordpress||[]).push([[6052],{6052:(s,t,i)=>{i.d(t,{loadSimplexNoisePath:()=>l});var e=i(9201),o=i(2658);const n={size:20,increment:.004,columns:0,rows:0,layers:0,width:0,height:0,offset:{x:4e4,y:4e4,z:4e4}};class h{constructor(){const s=new o.L;this._simplex=s.noise4d,this.field=[],this.noiseW=0,this.options=(0,e.ZB)({},n)}generate(s){const t=s.getPosition(),i=Math.max(Math.floor(t.x/this.options.size),0),o=Math.max(Math.floor(t.y/this.options.size),0),n=Math.max(Math.floor(t.z/this.options.size),0),h=e.OW.origin;if(!(this.field&&this.field[i]&&this.field[i][o]&&this.field[i][o][n]))return h;const r=this.field[i][o][n];return h.length=r[1],h.angle=r[0],h}init(s){this.container=s,this._setup()}reset(){}update(){this.container&&(this._calculateField(),this.noiseW+=this.options.increment)}_calculateField(){const s=this.options;for(let t=0;t<s.columns;t++)for(let i=0;i<s.rows;i++)for(let e=0;e<s.layers;e++)this.field[t][i][e][0]=this._simplex.noise(t/50,i/50,e/50,this.noiseW)*Math.PI*2,this.field[t][i][e][1]=this._simplex.noise(t/100+s.offset.x,i/100+s.offset.y,e/100+s.offset.z,this.noiseW)}_initField(){this.field=new Array(this.options.columns);for(let s=0;s<this.options.columns;s++){this.field[s]=new Array(this.options.rows);for(let t=0;t<this.options.rows;t++){this.field[s][t]=new Array(this.options.layers);for(let i=0;i<this.options.layers;i++)this.field[s][t][i]=[0,0]}}}_resetField(){const s=this.container;if(!s)return;const t=s.actualOptions.particles.move.path.options;this.options.size=t.size>0?t.size:n.size,this.options.increment=t.increment>0?t.increment:n.increment,this.options.width=s.canvas.size.width,this.options.height=s.canvas.size.height;const i=t.offset;this.options.offset.x=i?.x??n.offset.x,this.options.offset.y=i?.y??n.offset.y,this.options.offset.z=i?.z??n.offset.z,this.options.seed=t.seed??n.seed,this._simplex.seed(this.options.seed??(0,e.sZ)()),this.options.columns=Math.floor(this.options.width/this.options.size)+1,this.options.rows=Math.floor(this.options.height/this.options.size)+1,this.options.layers=Math.floor(s.zLayers/this.options.size)+1,this._initField()}_setup(){this.noiseW=0,this._resetField(),addEventListener("resize",(()=>this._resetField()))}}const r="simplexNoise";async function l(s,t=!0){await s.addPathGenerator(r,new h,t)}}}]);