/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["../chunks/_rollupPluginBabelHelpers","../chunks/tslib.es6","../core/lang","../core/maybe","../core/accessorSupport/decorators/property","../core/accessorSupport/ensureType","../core/accessorSupport/decorators/enumeration","../core/accessorSupport/decorators/subclass","../core/accessorSupport/decorators/writer","./Font","./Symbol3DLayer","./support/materialUtils","./support/Symbol3DHalo","./support/Symbol3DMaterial","./support/Symbol3DTextBackground","./support/textUtils"],(function(e,t,o,r,n,i,l,s,a,c,p,u,h,y,m,d){"use strict";var g;let _=g=function(t){function n(e){var o;return(o=t.call(this,e)||this)._userSize=void 0,o.halo=null,o.horizontalAlignment="center",o.lineHeight=1,o.material=null,o.background=null,o.text=null,o.type="text",o.verticalAlignment="baseline",o}e._inheritsLoose(n,t);var i=n.prototype;return i.writeFont=function(e,t,o,r){const n={...r,textSymbol3D:!0};t.font=e.write({},n),delete t.font.size},i.clone=function(){const e=new g({enabled:this.enabled,font:this.font&&o.clone(this.font),halo:this.halo&&o.clone(this.halo),horizontalAlignment:this.horizontalAlignment,lineHeight:this.lineHeight,material:r.isSome(this.material)?this.material.clone():null,text:this.text,verticalAlignment:this.verticalAlignment,background:o.clone(this.background)});return e._userSize=this._userSize,e},n.fromTextSymbol=function(e){return new g({font:r.isSome(e.font)?e.font.clone():new c,halo:S(e.haloColor,e.haloSize),horizontalAlignment:e.horizontalAlignment,lineHeight:e.lineHeight,material:e.color?new y.Symbol3DMaterial({color:e.color.clone()}):null,text:e.text,verticalAlignment:e.verticalAlignment,background:e.backgroundColor?new m.Symbol3DTextBackground({color:e.backgroundColor.clone()}):null})},e._createClass(n,[{key:"font",get:function(){return this._get("font")||null},set:function(e){r.isSome(e)&&r.isSome(this._userSize)&&(e.size=this._userSize),this._set("font",e)}},{key:"size",get:function(){return r.isSome(this._userSize)?this._userSize:r.isSome(this.font)&&null!=this.font.size?this.font.size:9},set:function(e){this._userSize=e,r.isSome(this.font)&&(this.font.size=this._userSize),this.notifyChange("size")}}]),n}(p);function S(e,t){return e&&t>0?new h.Symbol3DHalo({color:o.clone(e),size:t}):null}t.__decorate([n.property({type:c,json:{write:!0}})],_.prototype,"font",null),t.__decorate([a.writer("font")],_.prototype,"writeFont",null),t.__decorate([n.property({type:h.Symbol3DHalo,json:{write:!0}})],_.prototype,"halo",void 0),t.__decorate([n.property({...d.horizontalAlignmentProperty,json:{default:"center",write:!0}})],_.prototype,"horizontalAlignment",void 0),t.__decorate([n.property({...d.lineHeightProperty,json:{default:1,write:!0}})],_.prototype,"lineHeight",void 0),t.__decorate([n.property({type:y.Symbol3DMaterial,json:{write:!0}})],_.prototype,"material",void 0),t.__decorate([n.property({type:m.Symbol3DTextBackground,json:{write:!0}})],_.prototype,"background",void 0),t.__decorate([n.property(u.screenSizeProperty)],_.prototype,"size",null),t.__decorate([n.property({type:String,json:{write:!0}})],_.prototype,"text",void 0),t.__decorate([l.enumeration({Text:"text"},{readOnly:!0})],_.prototype,"type",void 0),t.__decorate([n.property({...d.verticalAlignmentProperty,json:{default:"baseline",write:!0}})],_.prototype,"verticalAlignment",void 0),_=g=t.__decorate([s.subclass("esri.symbols.TextSymbol3DLayer")],_);return _}));
