/* COPYRIGHT Esri - https://js.arcgis.com/5.1.0/LICENSE.txt */
import{BloomTechnique as e}from"../../shaderGraph/techniques/bloom/BloomTechnique.js";import{BlurTechnique as o}from"../../shaderGraph/techniques/blur/BlurTechnique.js";import{ColorizeTechnique as t}from"../../shaderGraph/techniques/colorize/ColorizeTechnique.js";import{DropShadowTechnique as r}from"../../shaderGraph/techniques/drop-shadow/DropShadowTechnique.js";import{OpacityTechnique as s}from"../../shaderGraph/techniques/opacity/OpacityTechnique.js";function c(e){switch(e){case"bloom":case"blur":case"opacity":case"drop-shadow":return e;default:return"colorize"}}const h={colorize:()=>new t,blur:()=>new o,bloom:()=>new e,opacity:()=>new s,"drop-shadow":()=>new r};class i{constructor(){this._effectMap=new Map}dispose(){this._effectMap.forEach(e=>e.shutdown()),this._effectMap.clear()}getPostProcessingEffects(e){if(!e||0===e.length)return[];const o=[];for(const t of e){const e=c(t.type);let r=this._effectMap.get(e);r||(r=h[e](),this._effectMap.set(e,r)),o.push({postProcessingTechnique:r,effect:t})}return o}}export{i as EffectManager};
