/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["exports","../../../../chunks/_rollupPluginBabelHelpers","../../../../core/maybe","./FeatureTileFetcher3D","./featureTileQuery3D"],(function(e,t,r,i,l){"use strict";let a=function(){function e(e){this._memoryCache=null,this._capabilities=null;const t=e.layerView.layer;this.layerView=e.layerView,this.objectIdField=t.objectIdField,this.globalIdField="globalIdField"in t?t.globalIdField:null,this.returnZ=e.returnZ,this.returnM=e.returnM;const r=this.layerView.view.resourceController;this.query=l.createFeatureTileQuery3D(t,(e=>r.schedule(e))),r&&this.memoryCacheEnabled&&(this._memoryCache=r.memoryController.newCache(t.uid))}var a=e.prototype;return a.destroy=function(){this._memoryCache=r.destroyMaybe(this._memoryCache),this.query.destroy()},a.createQuery=function(){const e=this.layerView.layer.createQuery();return e.outFields=this.layerView.availableFields,e.returnZ=this.returnZ,e.returnM=this.returnM,e.outSpatialReference=this.tilingScheme.spatialReference,e},a.logFetchError=function(e,t){e.error("#fetchTile()",this.layerView.layer,t&&t.message?t.message:t)},t._createClass(e,[{key:"memoryCacheEnabled",get:function(){switch(this.layerView.layer.source.type){case"feature-layer":case"ogc-feature":return!0;case"csv":case"geojson":case"memory":case"wfs":return!1}}},{key:"memoryCache",get:function(){return this._memoryCache}},{key:"viewingMode",get:function(){return this.layerView.view.state.viewingMode}},{key:"tilingScheme",get:function(){return this.layerView.view.featureTiles.tilingScheme}},{key:"scheduler",get:function(){const e=this.layerView.view.resourceController;return e?e.scheduler:null}},{key:"geometryType",get:function(){return this.layerView.layer.geometryType}},{key:"fullExtent",get:function(){return this.layerView.layer.fullExtent}},{key:"tileMaxRecordCount",get:function(){return this.layerView.layer.capabilities.query.tileMaxRecordCount}},{key:"maxRecordCount",get:function(){return this.layerView.layer.capabilities.query.maxRecordCount}},{key:"capabilities",get:function(){return r.isSome(this._capabilities)||(this._capabilities=i.contextCapabilitiesFromLayer(this.layerView.layer)),this._capabilities}}]),e}();e.FeatureTileFetcher3DLayerViewContext=a,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
