/* COPYRIGHT Esri - https://js.arcgis.com/5.1/LICENSE.txt */
import{a as y}from"./C5KDPY7R.js";import{a as r,c as s,d as c}from"./YM4U4HSN.js";var a={PREDOMINANCE:"predominance",CLASS_BREAKS_SIZE:"class-breaks-size",CLASS_BREAKS_COLOR:"class-breaks-color",RELATIONSHIP:"relationship",DOT_DENSITY:"dot-density"},I="feature";function Z(e,n,i){let o=p(e,n,i),t=y(e?.layer,o.field);return P(o,t)?!1:N(o)}function p(e,n,i){let o=e?.layer,t=e?.layerView,l=o?.renderer?.field,u=t?.layer?.renderer?.classBreakInfos,E=!!(t&&u&&u.length>1);return{activeLayerInfo:e,legendElement:n,legendElementIndex:i,field:l,authoringInfoType:t?.layer?.renderer?.authoringInfo?.type,isFeatureLayer:e?.layer?.type===I,isSizeRamp:n?.type===r.SIZE_RAMP,isColorRamp:n?.type===r.COLOR_RAMP,hasMoreThanOneClassBreak:E,classBreakInfos:u}}function m(e){let n=e.legendElementIndex;return!!(e.activeLayerInfo?.layer?.featureReduction&&n!==void 0&&e.activeLayerInfo?.legendElements?.[n]?.type===r.SIZE_RAMP)}function R(e){return!e?.legendElements.every(n=>n.type!==r.COLOR_RAMP)}function S(e){return!e?.legendElements.every(n=>n.type!==r.SIZE_RAMP)}function f(e){return e?.type===r.SYMBOL_TABLE}function d(e){return f(e.legendElement)&&e.legendElement?.infos?.length===1}function g(e){return!!(e.activeLayerInfo?.layerView?.layer?.renderer?.uniqueValueInfos&&e.field)}function L(e){return e.authoringInfoType===a.PREDOMINANCE}function A(e){return e.authoringInfoType===a.CLASS_BREAKS_SIZE&&!!e.field}function O(e){return e.authoringInfoType===a.CLASS_BREAKS_COLOR&&!!e.field}function _(e){return e.authoringInfoType===a.RELATIONSHIP&&e.legendElement?.type!==r.SIZE_RAMP&&!f(e.legendElement)}function h(e){return e.authoringInfoType===a.DOT_DENSITY}function C(e){let n=e.activeLayerInfo?.legendElements;return f(n?.[0])&&n?.[1]?.type===r.COLOR_RAMP}function T(e){return!!e.legendElement?.infos?.every(n=>typeof n.value=="number")}function v(e){return d(e)&&R(e.activeLayerInfo)}function B(e){return d(e)&&S(e.activeLayerInfo)}function M(e){return e.legendElement?.infos?.length===1&&!e.field&&e.field!==null}function P(e,n){return!e.isFeatureLayer||m(e)||c(e.legendElement)||s(e.legendElement)||v(e)||B(e)||T(e)||C(e)||h(e)||!n}function N(e){let{field:n,isColorRamp:i,isSizeRamp:o,hasMoreThanOneClassBreak:t,classBreakInfos:l}=e;return!!n&&!i&&!o&&(l?t:!t)||L(e)&&!e.isSizeRamp||O(e)||A(e)||M(e)||_(e)||g(e)}export{Z as a,f as b};
