/*
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","../../geometry","../../core/JSONSupport","../../core/lang","../../core/accessorSupport/decorators/property","../../core/accessorSupport/ensureType","../../core/accessorSupport/decorators/subclass","../../core/accessorSupport/decorators/writer","../../layers/support/source/DataLayerSource","../../geometry/SpatialReference"],(function(e,t,r,o,i,s,n,p,a,c,d){"use strict";var u;let y=u=function(t){function r(e){var r;return(r=t.call(this,e)||this).cacheHint=void 0,r.dynamicDataSource=void 0,r.gdbVersion=null,r.geometryPrecision=void 0,r.historicMoment=null,r.maxAllowableOffset=void 0,r.objectIds=null,r.orderByFields=null,r.outFields=null,r.outSpatialReference=null,r.relationshipId=void 0,r.start=void 0,r.num=void 0,r.returnGeometry=!1,r.returnM=void 0,r.returnZ=void 0,r.where=null,r}e._inheritsLoose(r,t);var o=r.prototype;return o._writeHistoricMoment=function(e,t){t.historicMoment=e&&e.getTime()},o.writeStart=function(e,t){t.resultOffset=this.start,t.resultRecordCount=this.num||10,this.start>0&&null==this.where&&(t.definitionExpression="1=1")},o.clone=function(){return new u(i.clone({cacheHint:this.cacheHint,dynamicDataSource:this.dynamicDataSource,gdbVersion:this.gdbVersion,geometryPrecision:this.geometryPrecision,historicMoment:this.historicMoment&&new Date(this.historicMoment.getTime()),maxAllowableOffset:this.maxAllowableOffset,objectIds:this.objectIds,orderByFields:this.orderByFields,outFields:this.outFields,outSpatialReference:this.outSpatialReference,relationshipId:this.relationshipId,start:this.start,num:this.num,returnGeometry:this.returnGeometry,where:this.where,returnZ:this.returnZ,returnM:this.returnM}))},r}(o.JSONSupport);t.__decorate([s.property({type:Boolean,json:{write:!0}})],y.prototype,"cacheHint",void 0),t.__decorate([s.property({type:c.DataLayerSource,json:{write:!0}})],y.prototype,"dynamicDataSource",void 0),t.__decorate([s.property({type:String,json:{write:!0}})],y.prototype,"gdbVersion",void 0),t.__decorate([s.property({type:Number,json:{write:!0}})],y.prototype,"geometryPrecision",void 0),t.__decorate([s.property({type:Date})],y.prototype,"historicMoment",void 0),t.__decorate([a.writer("historicMoment")],y.prototype,"_writeHistoricMoment",null),t.__decorate([s.property({type:Number,json:{write:!0}})],y.prototype,"maxAllowableOffset",void 0),t.__decorate([s.property({type:[Number],json:{write:!0}})],y.prototype,"objectIds",void 0),t.__decorate([s.property({type:[String],json:{write:!0}})],y.prototype,"orderByFields",void 0),t.__decorate([s.property({type:[String],json:{write:!0}})],y.prototype,"outFields",void 0),t.__decorate([s.property({type:d,json:{read:{source:"outSR"},write:{target:"outSR"}}})],y.prototype,"outSpatialReference",void 0),t.__decorate([s.property({json:{write:!0}})],y.prototype,"relationshipId",void 0),t.__decorate([s.property({type:Number,json:{read:{source:"resultOffset"}}})],y.prototype,"start",void 0),t.__decorate([a.writer("start"),a.writer("num")],y.prototype,"writeStart",null),t.__decorate([s.property({type:Number,json:{read:{source:"resultRecordCount"}}})],y.prototype,"num",void 0),t.__decorate([s.property({json:{write:!0}})],y.prototype,"returnGeometry",void 0),t.__decorate([s.property({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],y.prototype,"returnM",void 0),t.__decorate([s.property({type:Boolean,json:{write:{overridePolicy:e=>({enabled:e})}}})],y.prototype,"returnZ",void 0),t.__decorate([s.property({type:String,json:{read:{source:"definitionExpression"},write:{target:"definitionExpression"}}})],y.prototype,"where",void 0),y=u=t.__decorate([p.subclass("esri.rest.support.RelationshipQuery")],y),y.from=n.ensureType(y);return y}));
