/*
All material copyright Esri, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
*/
import e from"../../../renderers/visualVariables/SizeVariable.js";function l(l,i,s){const a=l.effectiveClusterRenderer;if(!a||!("visualVariables"in a)||!a.visualVariables)return null;const n=a.visualVariables.find(e=>"size"===e.type);if(!("stops"in n)||!n.stops)return null;const t=n.stops.find(e=>e.useMinValue),u=n.stops.find(e=>e.useMaxValue);if(null==t||null==u)return null;const r=s.featuresTilingScheme.getClosestInfoForScale(s.scale).level,f=n.field,o=i.getDisplayStatistics(r,f);return o?new e({field:n.field,minSize:l.clusterMinSize,minDataValue:o.minValue,maxSize:l.clusterMaxSize,maxDataValue:o.maxValue}):null}export{l as getEffectiveClusterSizeVariable};
