/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
export default $arcgis.t(([i])=>{async function J(o,y,a){let e=y?.layer;if(!o)return e?.effect?e.effect:e?.featureEffect?a==="includedEffect"?e.featureEffect.includedEffect:e.featureEffect.excludedEffect:null;let n=new i({includedEffect:o}).toJSON().includedEffect,u=n,s=e.effect,h=e.featureEffect,l=null;h?l=a==="includedEffect"?e.featureEffect?.includedEffect:e.featureEffect?.excludedEffect:l=s;let p=l?n:null;if(!p)return i.fromJSON({includedEffect:n}).includedEffect;let f=[...p];return u&&u.forEach(d=>{f.forEach(t=>{let{value:r}=t;if(r)r.forEach((E,c)=>{E.type===d.type?r[c]=d:!t.value.find(m=>m.type===u[0].type)&&(t.value=[...t.value,...u])});else{let E=!f.find(c=>c.type===t.type);!f.find(c=>c.type===d.type)&&(f=[...f,d]),E&&(f=[...f,t])}})}),i.fromJSON({includedEffect:f}).includedEffect}return J},"layers/support/FeatureEffect")