/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
import{__decorate as t}from"tslib";import{setDeepValue as e}from"../../core/object.js";import{property as r,subclass as o}from"../../core/accessorSupport/decorators.js";import{ensureType as a}from"../../core/accessorSupport/ensureType.js";import n from"./BinParametersBase.js";import s from"./DateBinTimeInterval.js";import{enumeration as p}from"../../core/accessorSupport/decorators/enumeration.js";function i(t,r,o){e(o,"string"==typeof t?t:t?.getTime(),r)}function l(t,e){const r=t.parameters[e];return r?"string"==typeof r?r:new Date(r):null}let m=class extends n{constructor(t){super(t),this.end=null,this.interval=null,this.offset=null,this.returnFullIntervalBin=!1,this.start=null,this.snapToData=null,this.type="date"}};t([r({cast:t=>null!=t?"string"==typeof t?t:new Date(t):null,json:{name:"parameters.end",read:{reader:(t,e)=>l(e,"end")},write:{writer:i}}})],m.prototype,"end",void 0),t([r({type:s,json:{name:"parameters",write:!0}})],m.prototype,"interval",void 0),t([r({type:s,json:{name:"parameters.offset",write:!0}})],m.prototype,"offset",void 0),t([r({type:Boolean,json:{name:"parameters.returnFullIntervalBin",write:!0}})],m.prototype,"returnFullIntervalBin",void 0),t([r({cast:t=>null!=t?"string"==typeof t?t:new Date(t):null,json:{name:"parameters.start",read:{reader:(t,e)=>l(e,"start")},write:{writer:i}}})],m.prototype,"start",void 0),t([r({type:String,json:{name:"parameters.snapToData",write:!0}})],m.prototype,"snapToData",void 0),t([p({dateBin:"date"},{readOnly:!0})],m.prototype,"type",void 0),m=t([o("esri.rest.support.DateBinParameters")],m),m.from=a(m);export{m as default};
