/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["exports","../../../core/maybe"],(function(e,l){"use strict";const n="overview",o=e=>l=>{var n;const o=e.toLowerCase();return null!=(n=l.sublayers.find((e=>{var l;return(null==(l=e.modelName)?void 0:l.toLowerCase())===o})))?n:null},t=o("fullmodel"),i=o(n);function u(e){const n=t(e);l.isSome(n)&&(n.visible=!0);const o=i(e);l.isSome(o)&&(o.visible=!1)}function r(e,n){const o=a(e,n);if(l.isNone(o))return null;const t=o.fieldName;if(l.isNone(t)||!t)return null;const i=s(e,t),u=new Map;for(const s of null!=(r=o.mostFrequentValues)?r:[]){var r;"number"==typeof s&&u.set(s,l.isSome(i)?i.getName(s):String(s))}return{fieldName:t,fieldValueMap:u}}function s(e,l){for(const n of e.allSublayers.items){const e="building-component"===n.type?n.getFieldDomain(l):null;if(e&&"coded-value"===e.type)return e}return null}function a(e,l){var n,o,t;const i=null!=(n=null==(o=e.summaryStatistics)?void 0:o.fields)?n:[],u=l.toLowerCase();return null!=(t=i.find((e=>{var l;return(null==(l=e.modelName)?void 0:l.toLowerCase())===u})))?t:null}e.findFieldCodedValueDomain=s,e.findFieldInfoByModelName=r,e.findFieldStatisticsByModelName=a,e.findFullModelSublayer=t,e.findOverviewSublayer=i,e.showFullModel=u,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
