/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["../../chunks/_rollupPluginBabelHelpers","../../chunks/tslib.es6","../../core/jsonMap","../../core/JSONSupport","../../core/accessorSupport/decorators/property","../../core/arrayUtils","../../core/has","../../core/accessorSupport/ensureType","../../core/accessorSupport/decorators/enumeration","../../core/accessorSupport/decorators/reader","../../core/accessorSupport/decorators/subclass","./domains","./fieldType"],(function(e,r,t,o,a,n,i,p,l,s,c,d,u){"use strict";var y;const _=new t.JSONMap({binary:"binary",coordinate:"coordinate",countOrAmount:"count-or-amount",dateAndTime:"date-and-time",description:"description",locationOrPlaceName:"location-or-place-name",measurement:"measurement",nameOrTitle:"name-or-title",none:"none",orderedOrRanked:"ordered-or-ranked",percentageOrRatio:"percentage-or-ratio",typeOrCategory:"type-or-category",uniqueIdentifier:"unique-identifier"});let m=y=function(r){function t(e){var t;return(t=r.call(this,e)||this).alias=null,t.defaultValue=void 0,t.description=null,t.domain=null,t.editable=!0,t.length=-1,t.name=null,t.nullable=!0,t.type=null,t.valueType=null,t}e._inheritsLoose(t,r);var o=t.prototype;return o.readDescription=function(e,{description:r}){let t;try{t=JSON.parse(r)}catch(o){}return t?t.value:null},o.readValueType=function(e,{description:r}){let t;try{t=JSON.parse(r)}catch(o){}return t?_.fromJSON(t.fieldValueType):null},o.clone=function(){return new y({alias:this.alias,defaultValue:this.defaultValue,description:this.description,domain:this.domain&&this.domain.clone()||null,editable:this.editable,length:this.length,name:this.name,nullable:this.nullable,type:this.type,valueType:this.valueType})},t}(o.JSONSupport);r.__decorate([a.property({type:String,json:{write:!0}})],m.prototype,"alias",void 0),r.__decorate([a.property({type:[String,Number],json:{write:{allowNull:!0}}})],m.prototype,"defaultValue",void 0),r.__decorate([a.property()],m.prototype,"description",void 0),r.__decorate([s.reader("description")],m.prototype,"readDescription",null),r.__decorate([a.property({types:d.types,json:{read:{reader:d.fromJSON},write:!0}})],m.prototype,"domain",void 0),r.__decorate([a.property({type:Boolean,json:{write:!0}})],m.prototype,"editable",void 0),r.__decorate([a.property({type:p.Integer,json:{write:!0}})],m.prototype,"length",void 0),r.__decorate([a.property({type:String,json:{write:!0}})],m.prototype,"name",void 0),r.__decorate([a.property({type:Boolean,json:{write:!0}})],m.prototype,"nullable",void 0),r.__decorate([l.enumeration(u.kebabDict)],m.prototype,"type",void 0),r.__decorate([a.property()],m.prototype,"valueType",void 0),r.__decorate([s.reader("valueType",["description"])],m.prototype,"readValueType",null),m=y=r.__decorate([c.subclass("esri.layers.support.Field")],m);return m}));
