/*
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/reactiveUtils","../../core/accessorSupport/decorators/aliasOf","../../core/arrayUtils","../../core/has","../../core/accessorSupport/ensureType","../../core/accessorSupport/decorators/property","../../core/accessorSupport/decorators/subclass","../Attachments","../Widget","./FeatureAttachments/FeatureAttachmentsViewModel","./support/FeatureElementInfo","../support/widgetUtils","../support/jsxFactory"],(function(e,t,i,r,o,s,a,n,l,c,d,p,u,h,v){"use strict";const f={base:"esri-feature-attachments"};let y=function(t){function r(e,i){var r;return(r=t.call(this,e,i)||this)._featureElementInfo=null,r.attachmentsWidget=new c,r.description=null,r.displayType=null,r.graphic=null,r.headingLevel=2,r.title=null,r.viewModel=new p,r}e._inheritsLoose(r,t);var o=r.prototype;return o.initialize=function(){this._featureElementInfo=new u,this.own([i.watch((()=>{var e,t;return[null==(e=this.viewModel)?void 0:e.description,null==(t=this.viewModel)?void 0:t.title,this.headingLevel]}),(()=>this._setupFeatureElementInfo()),i.initial),i.watch((()=>{var e;return null==(e=this.viewModel)?void 0:e.graphic}),(e=>this.attachmentsWidget.graphic=e),i.initial)])},o.destroy=function(){this.attachmentsWidget.destroy(),this._featureElementInfo.destroy()},o.render=function(){var e;const{attachmentsWidget:t}=this;return v.tsx("div",{class:f.base},null==(e=this._featureElementInfo)?void 0:e.render(),null==t?void 0:t.render())},o._setupFeatureElementInfo=function(){const{description:e,title:t,headingLevel:i}=this;this._featureElementInfo.set({description:e,title:t,headingLevel:i})},r}(d);t.__decorate([n.property({readOnly:!0})],y.prototype,"attachmentsWidget",void 0),t.__decorate([r.aliasOf("viewModel.description")],y.prototype,"description",void 0),t.__decorate([r.aliasOf("attachmentsWidget.displayType")],y.prototype,"displayType",void 0),t.__decorate([r.aliasOf("viewModel.graphic")],y.prototype,"graphic",void 0),t.__decorate([n.property()],y.prototype,"headingLevel",void 0),t.__decorate([r.aliasOf("viewModel.title")],y.prototype,"title",void 0),t.__decorate([n.property({type:p})],y.prototype,"viewModel",void 0),y=t.__decorate([l.subclass("esri.widgets.Feature.FeatureAttachments")],y);return y}));
