"use strict";(globalThis.webpackChunk_tsparticles_wordpress=globalThis.webpackChunk_tsparticles_wordpress||[]).push([[4257],{4257(t,e,r){r.d(e,{EmittersInstancesManager:()=>a});var i=r(3199),s=r(4628);class a{#t;#e;constructor(t){this.#t=new Map,this.#e=t}async addEmitter(t,e,i){const a=new s.v;a.load(e);const{EmitterInstance:n}=await r.e(3928).then(r.bind(r,3928)),o=new n(this.#e,t,e=>{this.removeEmitter(t,e)},a,i);return await o.init(),this.getArray(t).push(o),o}clear(t){this.initContainer(t),this.#t.set(t,[])}getArray(t){this.initContainer(t);let e=this.#t.get(t);return e||(e=[],this.#t.set(t,e)),e}initContainer(t){this.#t.has(t)||(this.#t.set(t,[]),t.getEmitter=e=>{const r=this.getArray(t);return void 0===e||(0,i.EtT)(e)?r[e??0]:r.find(t=>t.name===e)},t.addEmitter=async(e,r)=>this.addEmitter(t,e,r),t.removeEmitter=e=>{const r=t.getEmitter?.(e);r&&this.removeEmitter(t,r)},t.playEmitter=e=>{const r=t.getEmitter?.(e);r&&r.externalPlay()},t.pauseEmitter=e=>{const r=t.getEmitter?.(e);r&&r.externalPause()})}removeEmitter(t,e){const r=this.getArray(t).indexOf(e);r>=0&&this.getArray(t).splice(r,1)}}}}]);