/*
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/Evented","../../../core/accessorSupport/decorators/property","../../../core/arrayUtils","../../../core/has","../../../core/accessorSupport/ensureType","../../../core/accessorSupport/decorators/subclass","../../../webscene/SunLighting"],(function(e,t,n,o,i,s,a,r,c){"use strict";var l;let u=l=function(t){function n(e){var n;(n=t.call(this,e)||this).cameraTrackingEnabled=!0,n.ambientOcclusionEnabled=!1,n.waterReflectionEnabled=!1,n.positionTimezoneInfo={hours:0,minutes:0,seconds:0,autoUpdated:!0};const o=(new Date).getFullYear(),i=new Date("March 15, "+o+" 12:00:00 UTC");return n._set("defaultDate",i),n._set("date",i),n}e._inheritsLoose(n,t),n.fromWebsceneLighting=function(e){return new l(e.cloneConstructProperties())};var o=n.prototype;return o.autoUpdate=function(e,t){const n=l.calculateTimezoneOffset(this.positionTimezoneInfo);this.positionTimezoneInfo.hours=t.hours,this.positionTimezoneInfo.minutes=t.minutes,this.positionTimezoneInfo.seconds=t.seconds;let o=null;null!=e&&(this.positionTimezoneInfo.autoUpdated=!0,o=this.date&&this.date.getTime(),this._set("date",new Date(e.getTime())));const i=l.calculateTimezoneOffset(this.positionTimezoneInfo);if(n!==i&&(d.target=this,d.timezoneOffset=i,this.emit("timezone-will-change",d)),null!=e)return o!==e.getTime()},o.clone=function(){const e=this._get("date")===this._get("defaultDate"),t=new l({...this.cloneConstructProperties(),defaultDate:this.defaultDate,cameraTrackingEnabled:this.cameraTrackingEnabled,ambientOcclusionEnabled:this.ambientOcclusionEnabled,waterReflectionEnabled:this.waterReflectionEnabled});return e&&t._set("date",t._get("defaultDate")),t.positionTimezoneInfo.autoUpdated=this.positionTimezoneInfo.autoUpdated,t.positionTimezoneInfo.hours=this.positionTimezoneInfo.hours,t.positionTimezoneInfo.minutes=this.positionTimezoneInfo.minutes,t.positionTimezoneInfo.seconds=this.positionTimezoneInfo.seconds,t},o.cloneWithWebsceneLighting=function(e){const t=this.clone();return null!=e.date&&(t.date=e.date),t.directShadowsEnabled=e.directShadowsEnabled,t.displayUTCOffset=e.displayUTCOffset,t},e._createClass(n,[{key:"defaultDate",get:function(){return new Date(this._get("defaultDate").getTime())},set:function(e){const t=this._get("date")===this._get("defaultDate");e=new Date(e.getTime()),this._set("defaultDate",e),t&&this._set("date",e)}},{key:"date",set:function(e){null!=e&&(this.positionTimezoneInfo.autoUpdated=!1,this._set("date",new Date(e.getTime())))}}]),n}(n.EventedMixin(c));t.__decorate([o.property({type:Boolean})],u.prototype,"cameraTrackingEnabled",void 0),t.__decorate([o.property({type:Boolean})],u.prototype,"ambientOcclusionEnabled",void 0),t.__decorate([o.property({type:Boolean})],u.prototype,"waterReflectionEnabled",void 0),t.__decorate([o.property({type:Date})],u.prototype,"defaultDate",null),t.__decorate([o.property({type:Date})],u.prototype,"date",null),u=l=t.__decorate([r.subclass("esri.views.3d.environment.SunLighting")],u),function(e){function t({hours:e,minutes:t,seconds:n}){return Math.round(e+t/60+n/3600)}e.calculateTimezoneOffset=t}(u||(u={}));const d={target:null,timezoneOffset:0};return u}));
