import{executeQuery as e,executeCount as t}from"../../support/_query.js";import{isWFSLayerExtension as r}from"../../utilities/extensions.js";import{QueryProviderBase as s}from"./QueryProviderBase.js";export class WFSLayerQueryProvider extends s{isSupported(e){return r(e)&&e.capabilities.supportsQuery}_query(t,r,s){const{layer:o}=t,i=o.createQuery();i.where=r,i.outFields=s.outFields,i.returnGeometry=s.returnGeometry,i.outSpatialReference=s.outSpatialReference,i.maxAllowableOffset=s.maxAllowableOffset;const a=s.spatialFilter;return a&&(i.spatialRelationship="intersects",i.geometry=a),o.capabilities.query.supportsPagination&&(i.num=s.maxResults),e(i,t,o,s.cancelToken)}_count(e,r,s){const{layer:o}=e,i=o.createQuery();i.where=r,i.outFields=s.outFields,i.returnGeometry=s.returnGeometry;const a=s.spatialFilter;return a&&(i.spatialRelationship="intersects",i.geometry=a),i.num=s.maxResults,t(i,e,o,s.cancelToken)}}