import{executeQuery as e,executeCount as r,concatenateWhereClauses as t}from"../../support/_query.js";import{isSceneLayer as a}from"../../utilities/_layers.js";import{QueryProviderBase as s}from"./QueryProviderBase.js";export class SceneLayerQueryProvider extends s{isSupported(e){const{layer:r}=e;return a(r)&&!!r.associatedLayer}_query(r,a,s){const{layer:i}=r,o=i.associatedLayer.createQuery();return o.where=t(a,i.definitionExpression),o.outFields=s.outFields,o.returnGeometry=s.returnGeometry,o.outSpatialReference=s.outSpatialReference,o.maxAllowableOffset=s.maxAllowableOffset,s.spatialFilter&&(o.spatialRelationship="intersects",o.geometry=s.spatialFilter),o.num=s.maxResults,o.returnZ=!0,e(o,r,i.associatedLayer,s.cancelToken)}async _count(e,t,a){const{layer:s}=e,i=s.associatedLayer.createQuery();return i.where=t,i.outFields=a.outFields,i.returnGeometry=a.returnGeometry,a.spatialFilter&&(i.spatialRelationship="intersects",i.geometry=a.spatialFilter),i.num=a.maxResults,r(i,e,s.associatedLayer,a.cancelToken)}}