/* COPYRIGHT Esri - https://js.arcgis.com/5.1.2/LICENSE.txt */
import{__decorate as e}from"tslib";import{JSONMap as r}from"../../core/jsonMap.js";import{JSONSupport as o}from"../../core/JSONSupport.js";import t from"../../core/Logger.js";import{property as i,cast as s,subclass as n}from"../../core/accessorSupport/decorators.js";import{ensureString as p}from"../../core/accessorSupport/ensureType.js";import l from"./support/VisualVariableLegendOptions.js";const a=new r({colorInfo:"color",transparencyInfo:"opacity",rotationInfo:"rotation",sizeInfo:"size"});let u=class extends o{constructor(e){super(e),this.index=null,this.type=null,this.field=null,this.valueExpression=null,this.valueExpressionTitle=null,this.legendOptions=null}castField(e){return null==e?e:"function"==typeof e?(t.getLogger(this).error(".field: field must be a string value"),null):p(e)}get arcadeRequired(){return!!this.valueExpression}clone(){}};e([i()],u.prototype,"index",void 0),e([i({type:a.apiValues,readOnly:!0,json:{read:a.read,write:{writer:a.write,isRequired:!0}}})],u.prototype,"type",void 0),e([i({type:String,json:{write:!0}})],u.prototype,"field",void 0),e([s("field")],u.prototype,"castField",null),e([i({type:String,json:{write:!0}})],u.prototype,"valueExpression",void 0),e([i({type:String,json:{write:!0}})],u.prototype,"valueExpressionTitle",void 0),e([i({readOnly:!0})],u.prototype,"arcadeRequired",null),e([i({type:l,json:{write:!0}})],u.prototype,"legendOptions",void 0),u=e([n("esri.renderers.visualVariables.VisualVariable")],u);export{u as default};
