/*
All material copyright Esri, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/5.0/esri/copyright.txt for details.
*/
import{__decorate as t}from"tslib";import{ClonableMixin as o}from"../core/Clonable.js";import{JSONMap as e}from"../core/jsonMap.js";import{JSONSupport as r}from"../core/JSONSupport.js";import{property as i,subclass as s}from"../core/accessorSupport/decorators.js";import{fieldInfoFormatFromFieldFormat as l,fieldFormatFromFieldInfoFormat as a,formatTypes as p}from"../layers/support/fieldFormatUtils.js";import n from"./support/FieldInfoFormat.js";import{reader as m}from"../core/accessorSupport/decorators/reader.js";import{enumeration as d}from"../core/accessorSupport/decorators/enumeration.js";let f=class extends(o(r)){constructor(t){super(t),this.fieldName=null,this.isEditable=!0,this.label=null,this.statisticType=null,this.stringFieldOption="text-box",this.tooltip=null,this.visible=!0}set fieldFormat(t){this._set("fieldFormat",t),this._set("format",t?l(t):null)}set format(t){this._set("format",t),this._set("fieldFormat",t?a(t):null)}readFormat(t,o){if(!o.fieldFormat)return t?n.fromJSON(t):null}clone(){const t=super.clone();return t._set("format",this.format?.clone()),t._set("fieldFormat",this.fieldFormat?.clone()),t}};t([i({value:null,clonable:!1,types:p,json:{write:{overridePolicy(t,o,e){const{fieldName:r}=this;return{enabled:!!r&&!r.startsWith("expression/")&&!r.startsWith("relationships/")&&!!e?.writeFieldFormat}}}}})],f.prototype,"fieldFormat",null),t([i({type:String,json:{write:!0}})],f.prototype,"fieldName",void 0),t([i({value:null,clonable:!1,type:n,json:{write:!0}})],f.prototype,"format",null),t([m("format")],f.prototype,"readFormat",null),t([i({type:Boolean,json:{write:{alwaysWriteDefaults:!0},default:!0}})],f.prototype,"isEditable",void 0),t([i({type:String,json:{write:!0}})],f.prototype,"label",void 0),t([i({type:["count","sum","min","max","avg","stddev","var"],json:{write:!0}})],f.prototype,"statisticType",void 0),t([d(new e({richtext:"rich-text",textarea:"text-area",textbox:"text-box"}),{default:"text-box"})],f.prototype,"stringFieldOption",void 0),t([i({type:String,json:{write:!0}})],f.prototype,"tooltip",void 0),t([i({type:Boolean,json:{write:!0}})],f.prototype,"visible",void 0),f=t([s("esri.popup.FieldInfo")],f);const u=f;export{u as default};
