/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
import{__decorate as e}from"tslib";import o from"../core/Collection.js";import{deprecated as r}from"../core/deprecate.js";import{clone as t}from"../core/lang.js";import s from"../core/Logger.js";import{on as l,sync as y}from"../core/reactiveUtils.js";import{property as m,subclass as a}from"../core/accessorSupport/decorators.js";import i from"./ExtrudeSymbol3DLayer.js";import n from"./FillSymbol3DLayer.js";import b from"./IconSymbol3DLayer.js";import p from"./LineSymbol3DLayer.js";import c from"./ObjectSymbol3DLayer.js";import L from"./Symbol3D.js";import f from"./TextSymbol3DLayer.js";import S from"./WaterSymbol3DLayer.js";import{enumeration as d}from"../core/accessorSupport/decorators/enumeration.js";var u;const g=o.ofType({base:null,key:"type",typeMap:{extrude:i,fill:n,icon:b,line:p,object:c,text:f,water:S}});let j=u=class extends L{constructor(e){super(e),this.symbolLayers=new g,this.type="polygon-3d"}initialize(){const e=e=>{"line"===e.type&&r(s.getLogger(this),"LineSymbol3DLayer can not be used as a SymbolLayer with a PolygonSymbol3D symbol anymore.",{replacement:"Use FillSymbol3DLayer.outline instead.",version:"4.28"}),"text"===e.type&&r(s.getLogger(this),"TextSymbol3DLayer can not be used as a SymbolLayer with a PolygonSymbol3D symbol anymore.",{replacement:"Use Labels instead.",version:"4.28"})};for(const o of this.symbolLayers)e(o);this.addHandles(l(()=>this.symbolLayers,"after-add",({item:o})=>e(o),y))}clone(){return new u({styleOrigin:t(this.styleOrigin),symbolLayers:t(this.symbolLayers),thumbnail:t(this.thumbnail)})}static fromJSON(e){const o=new u;if(o.read(e),2===o.symbolLayers.length&&"fill"===o.symbolLayers.at(0).type&&"line"===o.symbolLayers.at(1).type){const r=o.symbolLayers.at(0),t=o.symbolLayers.at(1);!t.enabled||e.symbolLayers?.[1]&&!1===e.symbolLayers[1].enable||(r.outline={size:t.size,color:null!=t.material?t.material.color:null}),o.symbolLayers.removeAt(1)}return o}static fromSimpleFillSymbol(e){return new u({symbolLayers:new o([n.fromSimpleFillSymbol(e)])})}};e([m({type:g,json:{write:!0}})],j.prototype,"symbolLayers",void 0),e([d({PolygonSymbol3D:"polygon-3d"},{readOnly:!0})],j.prototype,"type",void 0),j=u=e([a("esri.symbols.PolygonSymbol3D")],j);export{j as default};
