/*
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 o}from"tslib";import t from"./CameraLayout.js";import{ClonableMixin as r}from"./core/Clonable.js";import{cyclicalDegrees as e}from"./core/Cyclical.js";import{JSONSupport as i}from"./core/JSONSupport.js";import{clamp as s}from"./core/mathUtils.js";import{property as n,cast as p,subclass as l}from"./core/accessorSupport/decorators.js";import{ensureNumber as a}from"./core/accessorSupport/ensureType.js";import u from"./geometry/Point.js";import{writer as m}from"./core/accessorSupport/decorators/writer.js";import{reader as c}from"./core/accessorSupport/decorators/reader.js";let y=class extends(r(i)){constructor(...o){super(...o),this.position=new u([0,0,0]),this.heading=0,this.tilt=0,this.fov=55,this.layout=new t}normalizeCtorArgs(o,t,r,e){if(o&&"object"==typeof o&&("x"in o||Array.isArray(o))){const i={position:o};return null!=t&&(i.heading=t),null!=r&&(i.tilt=r),null!=e&&(i.fov=e),i}return o}writePosition(o,t,r,e){const i=o.clone();i.x=a(o.x||0),i.y=a(o.y||0),i.z=o.hasZ?a(o.z||0):o.z,t[r]=i.write({},e)}readPosition(o,t){const r=new u;return r.read(o,t),r.x=a(r.x||0),r.y=a(r.y||0),r.z=r.hasZ?a(r.z||0):r.z,r}equals(o){return null!=o&&(this.tilt===o.tilt&&this.heading===o.heading&&this.fov===o.fov&&this.position.equals(o.position)&&this.layout.equals(o.layout))}};o([n({type:u,json:{write:{isRequired:!0}}})],y.prototype,"position",void 0),o([m("position")],y.prototype,"writePosition",null),o([c("position")],y.prototype,"readPosition",null),o([n({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),p(o=>e.normalize(a(o)))],y.prototype,"heading",void 0),o([n({type:Number,nonNullable:!0,json:{write:{isRequired:!0}}}),p(o=>s(a(o),-180,180))],y.prototype,"tilt",void 0),o([n({type:Number,nonNullable:!0,json:{default:55,write:!0}}),p(o=>s(a(o,55),1,170))],y.prototype,"fov",void 0),o([n({type:t,nonNullable:!0,json:{read:!1,write:!1}})],y.prototype,"layout",void 0),y=o([l("esri.Camera")],y);const d=y;export{d as default};
