import e from"@arcgis/core/layers/support/CodedValueDomain";import{checkArg as o}from"../utilities/checkArg.js";import{deepClone as i}from"../utilities/object.js";export var CodedValueDomain;!function(s){function a(e,s){o("codedValueDomainJson",e).isNotMissing(),o("codedValueDomainJson.type",e.type).isNotMissing().satisfies((e=>"codedValue"===e)),o("codedValueDomain",s).isNotMissing(),o("codedValueDomain.type",s.type).isNotMissing().satisfies((e=>"coded-value"===e)),o("codedValueDomainJson.codedValues",e.codedValues).isNotMissing(),"name"in e&&(s.name=e.name),s.codedValues=i(e.codedValues)}s.toEsriApiCodedValueDomain=function(i){o("codedValueDomainJson",i).isNotMissing(),o("codedValueDomainJson.type",i.type).isNotMissing().satisfies((e=>"codedValue"===e)),o("codedValueDomainJson.codedValues",i.codedValues).isNotMissing();const s=new e;return a(i,s),s},s.applyToEsriApiCodedValueDomain=a,s.fromEsriApiCodedValueDomain=function(e){return o("codedValueDomain",e).isNotMissing(),o("codedValueDomain.type",e.type).isNotMissing().satisfies((e=>"coded-value"===e)),e.toJSON()}}(CodedValueDomain||(CodedValueDomain={}));