/* COPYRIGHT Esri - https://js.arcgis.com/5.0.18/LICENSE.txt */
import{__decorate as t}from"tslib";import r from"../../core/Accessor.js";import{createObservableProxy as e}from"../../core/proxy.js";import{property as o,subclass as s}from"../../core/accessorSupport/decorators.js";import{valuesAreEquivalent as i}from"../support/forms/formUtils.js";let a=class extends r{constructor(t){super(t),this.userChangesHaveMadeInvalid=!1,this.original=t.source.clone();const r=t.source.attributes??{},o=e({...r});this.attributes=o;const s=t.source.cloneShallow();s.attributes=o,this.plainGraphic=s}get geometry(){return this.plainGraphic.geometry}set geometry(t){this.plainGraphic.geometry=t}get layer(){return this.source.sourceLayer??this.source.layer}attributeHasChanged(t){return!i(this.attributes[t],this.original.attributes?.[t])}getAttribute(t){return this.attributes[t]??null}setAttribute(t,r){this.attributes[t]=r}};t([o()],a.prototype,"attributes",void 0),t([o()],a.prototype,"geometry",null),t([o()],a.prototype,"plainGraphic",void 0),t([o()],a.prototype,"layer",null),t([o({constructOnly:!0})],a.prototype,"original",void 0),t([o({constructOnly:!0})],a.prototype,"source",void 0),t([o()],a.prototype,"userChangesHaveMadeInvalid",void 0),a=t([s("esri.widgets.BatchAttributeForm.ReactiveGraphic")],a);export{a as ReactiveGraphic};
