import{__decorate as e}from"tslib";import{TaskSettings as t}from"../data/TaskSettings.js";import{layerToJson as r}from"../json/LayerJson.js";import{serializable as i}from"../support/Serializable.js";import{notifyChange as n}from"../support/observableUtils.js";import{ReadOnlyCollection as s}from"../utilities/ReadOnlyCollection.js";import{isGeoJSONLayer as a}from"../utilities/_layers.js";import{LayerExtension as l,LayerExtensionSchema as o}from"./_LayerExtension.js";import{ArrayWrappedCollection as p}from"./support/ArrayWrappedCollection.js";import{PopupTemplateFeatureSettings as y}from"./support/PopupTemplateFeatureSettings.js";let d=class extends l{get renderer(){return this.layer?.renderer}get hasFeatures(){return!0}get layer(){return super.layer}get canChangeLabels(){return!0}get canChangeRenderer(){return!0}get canChangeDefinitionExpression(){return!0}get _layerView(){return this.layer&&this.mapExtension?._allLayerViews.find((e=>e.layer===this.layer))}_getProjectWebmapJSON(){const e=super._getProjectWebmapJSON();if(!e||this.dynamicallyAddedLayer)return e;const{layerDefinition:t}=r(this.layer),{definitionExpression:i,drawingInfo:n}=t??{};return i&&(e.layerDefinition={...e.layerDefinition,definitionExpression:i}),n&&(e.layerDefinition={...e.layerDefinition,drawingInfo:n}),e}_capabilities(){return{...super._capabilities(),supportsStandardizedQueries:!0}}async _onInitialize(){await super._onInitialize(),this.layer&&!this.layer.displayField&&(this.layer.displayField=this.layer.objectIdField)}_getSerializableProperties(){const e=super._getSerializableProperties();return{...e,layer:{...this._toPropertyDef(e.layer),default:{layerType:"GeoJSON"}}}}_isSupportedLayer(e){return a(e)}_createFeatureSettings(){return new y(this)}_createTaskSettings(){return new g(this)}_createSchema(){return new u(this)}};d=e([i],d);export{d as GeoJSONLayerExtension};let u=class extends o{_fieldsCollection;constructor(e){super(e),this._fieldsCollection=new s(new p({parent:e,targetProperty:"layer",arrayProperty:"fields"})),n(this,"_fields")}_getPropertyBindings(){return{primaryKeyField:"objectIdField",geometryType:"geometryType",spatialReference:"spatialReference",displayField:"displayField"}}get _fields(){return this._fieldsCollection}};u=e([i],u);let g=class extends t{_layerExtension;constructor(e,t){super(t),this._layerExtension=e}get enableEditing(){return this._getSetting("enableEditing",this._layerExtension.layer?.editingEnabled??!0)}set enableEditing(e){this._setSetting("enableEditing",e)}};g=e([i],g);