/*
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","../../TimeExtent","../../core/jsonMap","../../core/JSONSupport","../../core/lang","../../core/maybe","../../core/accessorSupport/decorators/property","../../core/accessorSupport/ensureType","../../core/accessorSupport/decorators/subclass","../../rest/support/Query"],(function(e,t,r,i,o,s,n,a,l,p,c,u){"use strict";var d;const y=new o.JSONMap({esriSpatialRelIntersects:"intersects",esriSpatialRelContains:"contains",esriSpatialRelCrosses:"crosses",esriSpatialRelDisjoint:"disjoint",esriSpatialRelEnvelopeIntersects:"envelope-intersects",esriSpatialRelIndexIntersects:"index-intersects",esriSpatialRelOverlaps:"overlaps",esriSpatialRelTouches:"touches",esriSpatialRelWithin:"within",esriSpatialRelRelation:"relation"}),m=new o.JSONMap({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"});let S=d=function(t){function r(e){var r;return(r=t.call(this,e)||this).where=null,r.geometry=null,r.spatialRelationship="intersects",r.distance=void 0,r.objectIds=null,r.units=null,r.timeExtent=null,r}e._inheritsLoose(r,t);var i=r.prototype;return i.createQuery=function(e={}){const{where:t,geometry:r,spatialRelationship:i,timeExtent:o,objectIds:s,units:a,distance:l}=this;return new u({geometry:n.clone(r),objectIds:n.clone(s),spatialRelationship:i,timeExtent:n.clone(o),where:t,units:a,distance:l,...e})},i.clone=function(){const{where:e,geometry:t,spatialRelationship:r,timeExtent:i,objectIds:o,units:s,distance:a}=this;return new d({geometry:n.clone(t),objectIds:n.clone(o),spatialRelationship:r,timeExtent:n.clone(i),where:e,units:s,distance:a})},r}(s.JSONSupport);t.__decorate([l.property({type:String,json:{write:!0}})],S.prototype,"where",void 0),t.__decorate([l.property({types:r.geometryTypes,json:{write:!0}})],S.prototype,"geometry",void 0),t.__decorate([l.property({type:y.apiValues,json:{name:"spatialRel",read:{reader:y.read},write:{allowNull:!1,writer:y.write,overridePolicy(){return{enabled:a.isSome(this.geometry)}}}}})],S.prototype,"spatialRelationship",void 0),t.__decorate([l.property({type:Number,json:{write:{overridePolicy(e){return{enabled:null!=e&&null!=this.geometry}}}}})],S.prototype,"distance",void 0),t.__decorate([l.property({type:[Number],json:{write:!0}})],S.prototype,"objectIds",void 0),t.__decorate([l.property({type:m.apiValues,json:{read:m.read,write:{writer:m.write,overridePolicy(e){return{enabled:null!=e&&null!=this.geometry}}}}})],S.prototype,"units",void 0),t.__decorate([l.property({type:i,json:{write:!0}})],S.prototype,"timeExtent",void 0),S=d=t.__decorate([c.subclass("esri.layers.support.FeatureFilter")],S);return S}));
