/* COPYRIGHT Esri - https://js.arcgis.com/5.1.2/LICENSE.txt */
import{__decorate as e}from"tslib";import t from"../Color.js";import{isSome as o}from"../core/arrayUtils.js";import{ClonableMixin as r}from"../core/Clonable.js";import{toPt as i}from"../core/screenUtils.js";import{property as s,subclass as l}from"../core/accessorSupport/decorators.js";import{collectArcadeFieldNames as p}from"../layers/support/fieldUtils.js";import a from"./Renderer.js";import{VisualVariablesMixin as n}from"./mixins/VisualVariablesMixin.js";import m from"./support/AttributeColorInfo.js";import{rendererBackgroundFillSymbolProperty as u}from"./support/commonProperties.js";import y from"./support/OthersCategory.js";import d from"./support/RendererLegendOptions.js";import b from"./visualVariables/OpacityVariable.js";import c from"./visualVariables/SizeVariable.js";import f from"./visualVariables/VisualVariable.js";import h from"../symbols/SimpleLineSymbol.js";import j from"../symbols/SimpleMarkerSymbol.js";import{enumeration as g}from"../core/accessorSupport/decorators/enumeration.js";const v={base:f,key:"type",typeMap:{size:c,opacity:b}};let S=class extends(n(r(a))){constructor(e){super(e),this.attributes=null,this.backgroundFillSymbol=null,this.defaultColor=new t([0,0,0,0]),this.defaultLabel=null,this.holePercentage=0,this.othersCategory=new y,this.legendOptions=null,this.outline=null,this.type="pie-chart",this.visualVariables=null}get size(){return this._get("size")??12}set size(e){this._set("size",e)}getSymbol(){return new j({size:this.size?this.size/2+(this.outline?.width||0):0})}async getSymbolAsync(){return this.getSymbol()}get symbols(){return[this.getSymbol(),this.backgroundFillSymbol].filter(o)}async collectRequiredFields(e,t){await this.collectVVRequiredFields(e,t);for(const o of this.attributes)o.valueExpression&&await p(e,t,null,o.valueExpression),o.field&&e.add(o.field)}};e([s({type:[m],json:{write:!0}})],S.prototype,"attributes",void 0),e([s(u)],S.prototype,"backgroundFillSymbol",void 0),e([s({type:t,json:{write:!0}})],S.prototype,"defaultColor",void 0),e([s({type:String,json:{write:!0}})],S.prototype,"defaultLabel",void 0),e([s({type:Number,range:{min:0,max:1},json:{write:!0}})],S.prototype,"holePercentage",void 0),e([s({type:y,json:{write:!0}})],S.prototype,"othersCategory",void 0),e([s({type:d,json:{write:!0}})],S.prototype,"legendOptions",void 0),e([s({type:h,json:{default:null,write:!0}})],S.prototype,"outline",void 0),e([s({type:Number,cast:i,json:{write:!0}})],S.prototype,"size",null),e([g({pieChart:"pie-chart"})],S.prototype,"type",void 0),e([s({types:[v]})],S.prototype,"visualVariables",void 0),S=e([l("esri.renderers.PieChartRenderer")],S);export{S as default};
