/* COPYRIGHT Esri - https://js.arcgis.com/5.1.0/LICENSE.txt */
import{estimateAttributesMemory as t}from"../../core/memoryEstimations.js";import{getCentroidOptimizedGeometry as e}from"./centroid.js";import i from"./OptimizedGeometry.js";class r{constructor(t,e,i,r,s=0,o=null,n=null){this.geometry=t,this.attributes=e,this.centroid=i,this.objectId=r,this.displayId=s,this.distance=o,this.vertexCount=n}static fromJSON(t){const e=t.geometry?i.fromJSON(t.geometry):null,s=t.centroid?i.fromJSON(t.centroid):null,o=t.objectId;return new r(e,t.attributes,s,o,void 0,t.distance,t.vertexCount)}weakClone(){return new r(this.geometry,this.attributes,this.centroid,this.objectId,this.displayId,this.distance,this.vertexCount)}clone(){return new r(this.geometry?.clone(),{...this.attributes},this.centroid?.clone(),this.objectId,this.displayId,this.distance,this.vertexCount)}ensureCentroid(t){return this.centroid??=e(this.geometry),this.centroid}get usedMemory(){return 128+t(this.attributes)+(this.geometry?.usedMemory??0)}}function s(t){return!!t.geometry?.coords?.length}class o extends r{}export{r as OptimizedFeature,o as OptimizedFeatureWithGeometry,s as hasGeometry};
