/* COPYRIGHT Esri - https://js.arcgis.com/5.0.18/LICENSE.txt */
import{__decorate as t}from"tslib";import{property as e,subclass as s}from"../../core/accessorSupport/decorators.js";import i from"./VisualVariable.js";import o from"./support/OpacityStop.js";var r;let a=r=class extends i{constructor(t){super(t),this.type="opacity",this.normalizationField=null}get cache(){return{ipData:this._interpolateData(),hasExpression:!!this.valueExpression,compiledFunc:null}}set stops(t){t&&Array.isArray(t)&&(t=t.filter(t=>!!t)).sort((t,e)=>t.value-e.value),this._set("stops",t)}clone(){return new r({field:this.field,normalizationField:this.normalizationField,valueExpression:this.valueExpression,valueExpressionTitle:this.valueExpressionTitle,stops:this.stops&&this.stops.map(t=>t.clone()),legendOptions:this.legendOptions?.clone()})}getAttributeHash(){return`${super.getAttributeHash()}-${this.normalizationField}`}_interpolateData(){return this.stops&&this.stops.map(t=>t.value||0)}};t([e({readOnly:!0})],a.prototype,"cache",null),t([e({type:["opacity"],json:{type:["transparencyInfo"]}})],a.prototype,"type",void 0),t([e({type:String,json:{write:!0}})],a.prototype,"normalizationField",void 0),t([e({type:[o],json:{write:!0}})],a.prototype,"stops",null),a=r=t([s("esri.renderers.visualVariables.OpacityVariable")],a);export{a as default};
