/* COPYRIGHT Esri - https://js.arcgis.com/5.0.18/LICENSE.txt */
import{__decorate as t}from"tslib";import{property as e,subclass as o}from"../../core/accessorSupport/decorators.js";import{excludeTables as r}from"../../core/accessorSupport/layerContainerType.js";import{fixTimeInfoFields as i}from"../support/fieldUtils.js";import s from"../support/TimeInfo.js";import{timeUnitKebabDictionary as n}from"../../portal/timeUnitKebabDictionary.js";import m from"../../time/TimeExtent.js";import p from"../../time/TimeInterval.js";import{reader as f}from"../../core/accessorSupport/decorators/reader.js";const a={type:Boolean,json:{read:{source:"timeAnimation"},write:{target:"timeAnimation",layerContainerTypes:r}}},l=r=>{const l=r;let u=class extends l{constructor(){super(...arguments),this.timeExtent=null,this.timeOffset=null,this.useViewTime=!0}readOffset(t,e){const o=e.timeInfo.exportOptions;if(!o)return null;const r=o.timeOffset,i=n.fromJSON(o.timeOffsetUnits);return r&&i?new p({value:r,unit:i}):null}get timeInfo(){return this._get("timeInfo")}set timeInfo(t){i(t,this.fieldsIndex),this._set("timeInfo",t)}};return t([e({type:m,json:{write:!1}})],u.prototype,"timeExtent",void 0),t([e({type:p})],u.prototype,"timeOffset",void 0),t([f("service","timeOffset",["timeInfo.exportOptions"])],u.prototype,"readOffset",null),t([e({value:null,type:s,json:{write:!0,origins:{"web-document":{read:!1,write:!1},"portal-item":{read:!1,write:!1}}}})],u.prototype,"timeInfo",null),t([e(a)],u.prototype,"useViewTime",void 0),u=t([o("esri.layers.mixins.TemporalLayer")],u),u};export{l as TemporalLayer,a as useViewTimeProperty};
