/* COPYRIGHT Esri - https://js.arcgis.com/5.1.2/LICENSE.txt */
import{__decorate as t}from"tslib";import{clone as e}from"../../core/lang.js";import{property as o,subclass as r}from"../../core/accessorSupport/decorators.js";import i from"./BarChartMediaInfo.js";import s from"./ColumnChartMediaInfo.js";import a from"./Content.js";import n from"./ImageMediaInfo.js";import p from"./LineChartMediaInfo.js";import d from"./PieChartMediaInfo.js";import{types as m}from"./support/mediaInfoTypes.js";import{reader as f}from"../../core/accessorSupport/decorators/reader.js";import{writer as c}from"../../core/accessorSupport/decorators/writer.js";var l;let I=l=class extends a{constructor(t){super(t),this.activeMediaInfoIndex=null,this.attributes=null,this.description=null,this.mediaInfos=null,this.title=null,this.type="media"}readMediaInfos(t){return t&&t.map(t=>"image"===t.type?n.fromJSON(t):"barchart"===t.type?i.fromJSON(t):"columnchart"===t.type?s.fromJSON(t):"linechart"===t.type?p.fromJSON(t):"piechart"===t.type?d.fromJSON(t):void 0).filter(Boolean)}writeMediaInfos(t,e){e.mediaInfos=t&&t.map(t=>t.toJSON())}clone(){return new l(e({activeMediaInfoIndex:this.activeMediaInfoIndex,attributes:this.attributes,description:this.description,mediaInfos:this.mediaInfos,title:this.title}))}};t([o()],I.prototype,"activeMediaInfoIndex",void 0),t([o({type:Object,json:{write:!0}})],I.prototype,"attributes",void 0),t([o({type:String,json:{write:!0}})],I.prototype,"description",void 0),t([o({types:[m]})],I.prototype,"mediaInfos",void 0),t([f("mediaInfos")],I.prototype,"readMediaInfos",null),t([c("mediaInfos")],I.prototype,"writeMediaInfos",null),t([o({type:String,json:{write:!0}})],I.prototype,"title",void 0),t([o({type:["media"],readOnly:!0,json:{read:!1,write:{isRequired:!0}}})],I.prototype,"type",void 0),I=l=t([r("esri.popup.content.MediaContent")],I);const u=I;export{u as default};
