/* COPYRIGHT Esri - https://js.arcgis.com/5.1.0/LICENSE.txt */
import{__decorate as e}from"tslib";import{JSONMap as t}from"../../core/jsonMap.js";import{JSONSupport as i}from"../../core/JSONSupport.js";import{clone as r}from"../../core/lang.js";import{property as s,subclass as o}from"../../core/accessorSupport/decorators.js";import{geometryTypes as n}from"../../geometry/support/typeUtils.js";import l from"../../rest/support/Query.js";import a from"../../time/TimeExtent.js";var p;const c=new t({esriSpatialRelIntersects:"intersects",esriSpatialRelContains:"contains",esriSpatialRelCrosses:"crosses",esriSpatialRelDisjoint:"disjoint",esriSpatialRelEnvelopeIntersects:"envelope-intersects",esriSpatialRelIndexIntersects:"index-intersects",esriSpatialRelOverlaps:"overlaps",esriSpatialRelTouches:"touches",esriSpatialRelWithin:"within",esriSpatialRelRelation:"relation"}),u=new t({esriSRUnit_Meter:"meters",esriSRUnit_Kilometer:"kilometers",esriSRUnit_Foot:"feet",esriSRUnit_StatuteMile:"miles",esriSRUnit_NauticalMile:"nautical-miles",esriSRUnit_USNauticalMile:"us-nautical-miles"});let m=p=class extends i{constructor(e){super(e),this.where=null,this.geometry=null,this.spatialRelationship="intersects",this.distance=void 0,this.objectIds=null,this.units=null,this.timeExtent=null}createQuery(e={}){const{where:t,geometry:i,spatialRelationship:s,timeExtent:o,objectIds:n,units:a,distance:p}=this;return new l({geometry:r(i),objectIds:r(n),spatialRelationship:s,timeExtent:r(o),where:t,units:a,distance:p,...e})}clone(){const{where:e,geometry:t,spatialRelationship:i,timeExtent:s,objectIds:o,units:n,distance:l}=this;return new p({geometry:r(t),objectIds:r(o),spatialRelationship:i,timeExtent:r(s),where:e,units:n,distance:l})}};e([s({type:String,json:{write:!0}})],m.prototype,"where",void 0),e([s({types:n,json:{write:!0}})],m.prototype,"geometry",void 0),e([s({type:c.apiValues,json:{name:"spatialRel",read:{reader:c.read},write:{allowNull:!1,writer:c.write,overridePolicy(){return{enabled:null!=this.geometry}}}}})],m.prototype,"spatialRelationship",void 0),e([s({type:Number,json:{write:{overridePolicy(e){return{enabled:null!=e&&null!=this.geometry}}}}})],m.prototype,"distance",void 0),e([s({type:[Number],json:{write:!0}})],m.prototype,"objectIds",void 0),e([s({type:u.apiValues,json:{read:u.read,write:{writer:u.write,overridePolicy(e){return{enabled:null!=e&&null!=this.geometry}}}}})],m.prototype,"units",void 0),e([s({type:a,json:{write:!0}})],m.prototype,"timeExtent",void 0),m=p=e([o("esri.layers.support.FeatureFilter")],m);const d=m;export{d as default};
