/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
function s(t,r){if(!t.map)return;let{map:n}=t;n.layers.includes(r)||(n.add(r),n.reorder(r,n.layers.length-1))}function c(t){return t!=null&&typeof t=="object"&&"type"in t&&t.type==="feature"}function o(t){return c(t)&&t?.type==="feature"&&t.source?.type==="feature-layer"}function l(t){return t!=null&&typeof t=="object"&&"type"in t&&t.type==="graphics"}function a(t){return c(t)&&o(t)}function f(t,r){let n=r?.type==="subtype-sublayer"?r.parent:r;return t.allLayerViews.find(e=>{let u=e.layer;return u===n||"sublayers"in u&&u.sublayers!=null&&u.sublayers.includes(n)})}function i(t){let r=t?.type;return r==="binning"||r==="cluster"}function y(t,r){if(!a(t))return;let n=r?.graphic,e=t.featureReduction;if(n){if(n.isAggregate){let u=n.origin;return u&&"featureReductionProvider"in u&&e?i(e)?e:null:void 0}return t}return r?.checkFeatureReduction&&e?i(e)?e:null:t}export{s as a,l as b,f as c,y as d};
