var e;import{__decorate as i}from"tslib";import{InvalidOperationError as s}from"../InvalidOperationError.js";import{serializable as a,SerializableBase as r}from"../support/Serializable.js";import{ObservableMap as l}from"../utilities/ObservableMap.js";import{map as t}from"../utilities/iterable.js";let n=e=class extends r{definitionExpression;visible;opacity;expanded;minScale;maxScale;childrenIncludedInLayerList;includedInLayerList;sublayers;constructor(e){super(e),this.sublayers=new l}_getSerializableProperties(){const i=e=>null==e;return{definitionExpression:{serializeModes:["initial"],isDefault:i},visible:{serializeModes:["initial"],isDefault:i},opacity:{serializeModes:["initial"],isDefault:i},expanded:{serializeModes:["initial"],isDefault:i},minScale:{serializeModes:["initial"],isDefault:i},maxScale:{serializeModes:["initial"],isDefault:i},childrenIncludedInLayerList:{serializeModes:["initial"],isDefault:i},includedInLayerList:{serializeModes:["initial"],isDefault:i},sublayers:{serializeModes:["initial"],serialize:e=>Array.from(t(this.sublayers.entries(),(i=>{let s={sublayer:i[0]};return s={...s,...i[1].toJSON(e)},s}))),deserialize:(i=[])=>{this.sublayers.clear();for(const a of i){if(void 0===a.sublayer||null===a.sublayer)throw new s("Cannot define a LayerPresetSetting that does not have sublayer reference.");this.sublayers.set(a.sublayer,new e(a))}}}}}};n=e=i([a],n);export{n as LayerPresetSetting};