/* All material copyright ESRI, All Rights Reserved, unless otherwise specified. See https://js.arcgis.com/4.24/esri/copyright.txt for details. */ import{_ as e}from"../chunks/tslib.es6.js";import t from"../Color.js";import{clone as o}from"../core/lang.js";import{aliasOf as r}from"../core/accessorSupport/decorators/aliasOf.js";import"../core/accessorSupport/ensureType.js";import{enumeration as i}from"../core/accessorSupport/decorators/enumeration.js";import{property as s}from"../core/accessorSupport/decorators/property.js";import{subclass as n}from"../core/accessorSupport/decorators/subclass.js";import{collectArcadeFieldNames as l}from"../layers/support/fieldUtils.js";import p from"./Renderer.js";import{VisualVariablesMixin as a}from"./mixins/VisualVariablesMixin.js";import u from"./support/AttributeColorInfo.js";import d from"./support/DotDensityLegendOptions.js";import c from"../symbols/SimpleFillSymbol.js";import h from"../symbols/SimpleLineSymbol.js";var m;let y=m=class extends(a(p)){constructor(e){super(e),this.attributes=null,this.backgroundColor=new t([0,0,0,0]),this.blendDots=!0,this.dotBlendingEnabled=!0,this.dotShape="square",this.dotSize=1,this.legendOptions=null,this.outline=new h,this.dotValue=null,this.referenceDotValue=null,this.referenceScale=null,this.seed=1,this.type="dot-density"}calculateDotValue(e){if(null==this.referenceScale)return this.dotValue;const t=e/this.referenceScale*this.dotValue;return t<1?1:t}getSymbol(){return new c({outline:this.outline})}async getSymbolAsync(){return this.getSymbol()}getSymbols(){return[this.getSymbol()]}getAttributeHash(){return this.attributes&&this.attributes.reduce(((e,t)=>e+t.getAttributeHash()),"")}getMeshHash(){return JSON.stringify(this.outline)}clone(){return new m({attributes:o(this.attributes),backgroundColor:o(this.backgroundColor),dotBlendingEnabled:o(this.dotBlendingEnabled),dotShape:o(this.dotShape),dotSize:o(this.dotSize),dotValue:o(this.dotValue),legendOptions:o(this.legendOptions),outline:o(this.outline),referenceScale:o(this.referenceScale),visualVariables:o(this.visualVariables),authoringInfo:this.authoringInfo&&this.authoringInfo.clone()})}getControllerHash(){return`${this.attributes.map((e=>e.field||e.valueExpression||""))}-${this.outline&&JSON.stringify(this.outline.toJSON())||""}`}async collectRequiredFields(e,t){await this.collectVVRequiredFields(e,t);for(const o of this.attributes)o.valueExpression&&await l(e,t,o.valueExpression),o.field&&e.add(o.field)}};e([s({type:[u],json:{write:!0}})],y.prototype,"attributes",void 0),e([s({type:t,json:{write:!0}})],y.prototype,"backgroundColor",void 0),e([s({type:Boolean}),r("dotBlendingEnabled")],y.prototype,"blendDots",void 0),e([s({type:Boolean,json:{write:!0}})],y.prototype,"dotBlendingEnabled",void 0),e([s({type:String,json:{write:!1}})],y.prototype,"dotShape",void 0),e([s({type:Number,json:{write:!0,origins:{"web-map":{write:!1},"web-scene":{write:!1}}}})],y.prototype,"dotSize",void 0),e([s({type:d,json:{write:!0}})],y.prototype,"legendOptions",void 0),e([s({type:h,json:{default:null,write:!0}})],y.prototype,"outline",void 0),e([s({type:Number,json:{write:!0}})],y.prototype,"dotValue",void 0),e([s({type:Number}),r("dotValue")],y.prototype,"referenceDotValue",void 0),e([s({type:Number,json:{write:!0}})],y.prototype,"referenceScale",void 0),e([s({type:Number,json:{write:!0}})],y.prototype,"seed",void 0),e([i({dotDensity:"dot-density"})],y.prototype,"type",void 0),y=m=e([n("esri.renderers.DotDensityRenderer")],y);const b=y;export{b as default};