/* COPYRIGHT Esri - https://js.arcgis.com/5.0.18/LICENSE.txt */
import{__decorate as e}from"tslib";import{removeUnordered as t}from"../core/arrayUtils.js";import{strict as r}from"../core/jsonMap.js";import{JSONSupport as i}from"../core/JSONSupport.js";import{unitFromRESTJSON as o,getVerticalUnitStringForSR as s}from"../core/units.js";import n from"../core/Warning.js";import{property as a,subclass as l}from"../core/accessorSupport/decorators.js";import{writer as h}from"../core/accessorSupport/decorators/writer.js";import{reader as d}from"../core/accessorSupport/decorators/reader.js";var c;const u=r()({orthometric:"gravity-related-height",gravity_related_height:"gravity-related-height",ellipsoidal:"ellipsoidal"}),p=u.jsonValues.slice();t(p,"orthometric");const g=r()({meter:"meters",foot:"feet","us-foot":"us-feet","clarke-foot":"clarke-feet","clarke-yard":"clarke-yards","clarke-link":"clarke-links","sears-yard":"sears-yards","sears-foot":"sears-feet","sears-chain":"sears-chains","benoit-1895-b-chain":"benoit-1895-b-chains","indian-yard":"indian-yards","indian-1937-yard":"indian-1937-yards","gold-coast-foot":"gold-coast-feet","sears-1922-truncated-chain":"sears-1922-truncated-chains","50-kilometers":"50-kilometers","150-kilometers":"150-kilometers"});let m=c=class extends i{constructor(e){super(e),this.heightModel="gravity-related-height",this.heightUnit="meters",this.vertCRS=null}writeHeightModel(e,t,r){return u.write(e,t,r)}readHeightModel(e,t,r){const i=u.read(e);return i||(r?.messages&&r.messages.push(f(e,{context:r})),null)}readHeightUnit(e,t,r){const i=g.read(e);return i||(r?.messages&&r.messages.push(y(e,{context:r})),null)}readHeightUnitService(e,t,r){const i=o(e)||g.read(e);return i||(r?.messages&&r.messages.push(y(e,{context:r})),null)}readVertCRS(e,t){return t.vertCRS||t.ellipsoid||t.geoid}clone(){return new c({heightModel:this.heightModel,heightUnit:this.heightUnit,vertCRS:this.vertCRS})}equals(e){return!!e&&(this===e||this.heightModel===e.heightModel&&this.heightUnit===e.heightUnit&&this.vertCRS===e.vertCRS)}static deriveUnitFromSR(e,t){const r=s(t);return new c({heightModel:e.heightModel,heightUnit:r??void 0,vertCRS:e.vertCRS})}write(e,t){return t={origin:"web-scene",...t},super.write(e,t)}static fromJSON(e){if(!e)return null;const t=new c;return t.read(e,{origin:"web-scene"}),t}};function y(e,t){return new n("height-unit:unsupported",`Height unit of value '${e}' is not supported`,t)}function f(e,t){return new n("height-model:unsupported",`Height model of value '${e}' is not supported`,t)}e([a({type:u.apiValues,constructOnly:!0,json:{origins:{"web-scene":{type:p,default:"ellipsoidal",write:{isRequired:!0}}}}})],m.prototype,"heightModel",void 0),e([h("web-scene","heightModel")],m.prototype,"writeHeightModel",null),e([d(["web-scene","service"],"heightModel")],m.prototype,"readHeightModel",null),e([a({type:g.apiValues,constructOnly:!0,json:{origins:{"web-scene":{type:g.jsonValues,write:{writer:g.write,isRequired:!0}}}}})],m.prototype,"heightUnit",void 0),e([d("web-scene","heightUnit")],m.prototype,"readHeightUnit",null),e([d("service","heightUnit")],m.prototype,"readHeightUnitService",null),e([a({type:String,constructOnly:!0,json:{origins:{"web-scene":{write:!0}}}})],m.prototype,"vertCRS",void 0),e([d("service","vertCRS",["vertCRS","ellipsoid","geoid"])],m.prototype,"readVertCRS",null),m=c=e([l("esri.geometry.HeightModelInfo")],m);export{m as default};
