/* COPYRIGHT Esri - https://js.arcgis.com/5.1.0/LICENSE.txt */
import{substitute as e,formatNumber as n}from"../../../intl.js";import{stripHTML as r}from"../../../core/string.js";function o(e,n){return n}function t(e){const n=this;e.appendChild(n)}function i(n,t,i){if(!t)return;if("number"==typeof t)return t;if("string"==typeof t)return r(t);if("value"in t||"unit"in t)return e(n.dotValue,t);if("colorName"in t&&"bandName"in t)return n[t.colorName]+": "+(n[t.bandName]||t.bandName);if("showCount"in t)return t.showCount?n.clusterCountTitle:void 0;let a=null;return o(t,i)?a=t.ratioPercentTotal?"showRatioPercentTotal":t.ratioPercent?"showRatioPercent":t.ratio?"showRatio":t.normField?"showNormField":t.field?"showField":null:l(t,i)&&(a=t.normField?"showNormField":t.normByPct?"showNormPct":t.field?"showField":null),a?e("showField"===a?"{field}":n[a],{field:t.field,normField:t.normField}):void 0}function l(e,n){return!n}function a(e,n){return!!(n&&"Stretched"===n&&"version"in e&&"number"==typeof e.version&&e.version>=10.3&&"esri.layers.ImageryLayer"===e.declaredClass)}function u(e,r){return e.label?r[e.label]+": "+("string"==typeof e.value?e.value:n(e.value??0,{style:"decimal",notation:e.value?.toString().toLowerCase().includes("e")?"scientific":"standard"})):""}export{t as attachToNode,u as getStretchStopLabel,i as getTitle,a as isImageryStretchedLegend,l as isRendererTitle};
