"use strict";(globalThis.webpackChunk_tsparticles_wordpress=globalThis.webpackChunk_tsparticles_wordpress||[]).push([[418,1859],{418(t,e,s){s.d(e,{loadSVGPath:()=>r});var i,n=s(1859),a=s(3199);!function(t){t[t.normal=0]="normal",t[t.reverse=1]="reverse"}(i||(i={}));class h{#t;#e;#s;#i;#n;#a;#h;#r;constructor(t){this.#t=t,this.#s=[],this.#n=!1,this.#h={width:0,height:0},this.#a=1,this.#e={x:0,y:0,mode:a.qiC.percent},this.#r=0,this.#i=a.Miz.origin}generate(t,e){const s=this.#t.retina.pixelRatio;t.svgDirection??=(0,a.G0i)()>a.MXx?i.normal:i.reverse,t.svgPathIndex??=Math.floor((0,a.G0i)()*this.#s.length),t.svgSpeed??=t.velocity.mult(t.retina.moveSpeed*a.MXx).length,t.svgStep??=(0,a.vEz)({min:0,max:this.#s[t.svgPathIndex].length})*s,t.svgOffset??={width:(0,a.vEz)({min:-this.#r*a.MXx,max:this.#r*a.MXx})*s,height:(0,a.vEz)({min:-this.#r*a.MXx,max:this.#r*a.MXx})*s},t.svgInitialPosition??=t.position.copy(),t.velocity.x=0,t.velocity.y=0,t.svgDirection===i.normal?t.svgStep+=t.svgSpeed*e.factor:t.svgStep-=t.svgSpeed*e.factor;let n=this.#s[t.svgPathIndex];const h=n.length;t.svgStep>=h?(t.svgPathIndex=t.svgPathIndex+1,t.svgPathIndex>=this.#s.length&&(this.#n?(t.svgPathIndex=this.#s.length-1,t.svgDirection=i.reverse):(t.svgPathIndex=0,t.svgStep=0))):t.svgStep<=0&&(t.svgPathIndex=t.svgPathIndex-1,t.svgPathIndex<0&&(this.#n?(t.svgPathIndex=0,t.svgDirection=i.normal):(t.svgPathIndex=this.#s.length-1,n=this.#s[t.svgPathIndex],t.svgStep=n.length))),n=this.#s[t.svgPathIndex];const r=n.element.getPointAtLength(t.svgStep),o=this.#t.canvas.size,g=(0,a.E90)(this.#e,o),l=this.#a*s;return t.position.x=(r.x-this.#h.width*a.MXx)*l+t.svgInitialPosition.x+g.x+t.svgOffset.width,t.position.y=(r.y-this.#h.height*a.MXx)*l+t.svgInitialPosition.y+g.y+t.svgOffset.height,this.#i.x=0,this.#i.y=0,this.#i}init(){const t=this.#t.actualOptions.particles.move.path.options,e=t.position??this.#e;if(this.#n=t.reverse??this.#n,this.#a=t.scale??1,this.#e.x=e.x,this.#e.y=e.y,this.#e.mode=e.mode,this.#r=t.width??0,t.url&&!t.path){const e=t.url;(async()=>{const t=await fetch(e),s=await t.text(),{paths:i,size:n}=function(t){const e=(new DOMParser).parseFromString(t,"image/svg+xml").querySelector("svg");if(!e)return{paths:[],size:{width:0,height:0}};const s=e.querySelectorAll("path"),i=[];for(const t of s)t instanceof SVGPathElement&&i.push({element:t,length:t.getTotalLength()});return{paths:i,size:{width:Number.parseFloat(e.getAttribute("width")??"0"),height:Number.parseFloat(e.getAttribute("height")??"0")}}}(s);this.#s=i,this.#h.width=n.width,this.#h.height=n.height})()}else if(t.path){const e=t.path;this.#s=function(t){const e=(0,a.T5G)();return t.map(t=>{const s=e.createElementNS("http://www.w3.org/2000/svg","path");return s.setAttribute("d",t),{element:s,length:s.getTotalLength()}})}(t.path.data),this.#h.height=e.size.height,this.#h.width=e.size.width}}reset(){}update(){}}async function r(t){t.checkVersion("4.1.3"),await t.pluginManager.register(t=>{(0,n.g)(t),t.pluginManager.addPathGenerator?.("svgPathGenerator",t=>Promise.resolve(new h(t)))})}},1859(t,e,s){s.d(e,{g:()=>h,loadMovePlugin:()=>a});var i=s(3199);class n{id="move";#o;constructor(t){this.#o=t}async getPlugin(t){const{MovePluginInstance:e}=await s.e(5272).then(s.bind(s,5272));return new e(this.#o,t)}loadOptions(){}needsPlugin(){return!0}}async function a(t){t.checkVersion("4.1.3"),await t.pluginManager.register(t=>{const e=t.pluginManager;e.initializers.pathGenerators??=new Map,e.pathGenerators??=new Map,e.addPathGenerator=(t,s)=>{e.initializers.pathGenerators??=new Map,e.initializers.pathGenerators.set(t,s)},e.getPathGenerators=async(t,s=!1)=>(e.initializers.pathGenerators??=new Map,e.pathGenerators??=new Map,(0,i.OtU)(t,e.pathGenerators,e.initializers.pathGenerators,s)),t.pluginManager.addPlugin(new n(t.pluginManager))})}function h(t){if(!t.pluginManager.addPathGenerator)throw new Error("tsParticles Base Mover is not loaded")}}}]);