/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["exports","../../../../chunks/_rollupPluginBabelHelpers","../../../../chunks/tslib.es6","../../../../core/Accessor","../../../../core/maybe","../../../../core/accessorSupport/decorators/property","../../../../core/arrayUtils","../../../../core/has","../../../../core/accessorSupport/ensureType","../../../../core/accessorSupport/decorators/subclass","./LengthDimensionVisualization"],(function(i,o,n,s,t,e,a,r,u,c,l){"use strict";i.DimensioningVisualization=function(i){function n(o){var n;return(n=i.call(this,o)||this)._dimensionVisualizations=new Map,n}o._inheritsLoose(n,i);var s=n.prototype;return s.initialize=function(){for(const i of this.computations)this._addComputation(i);this.own(this.computations.on("change",(({added:i,removed:o})=>{for(const n of o)this._removeComputation(n);for(const n of i)this._addComputation(n)})))},s.destroy=function(){this._dimensionVisualizations.forEach((i=>{i.destroy()})),this._dimensionVisualizations.clear()},s._addComputation=function(i){this._dimensionVisualizations.has(i)||this._dimensionVisualizations.set(i,new l.LengthDimensionVisualization({computation:i,view:this.view}))},s._removeComputation=function(i){const o=this._dimensionVisualizations.get(i);t.isNone(o)||(o.destroy(),this._dimensionVisualizations.delete(i))},o._createClass(n,[{key:"testInfo",get:function(){return{visualizations:Array.from(this._dimensionVisualizations.values())}}}]),n}(s),n.__decorate([e.property({constructOnly:!0,nonNullable:!0})],i.DimensioningVisualization.prototype,"view",void 0),n.__decorate([e.property({constructOnly:!0,nonNullable:!0})],i.DimensioningVisualization.prototype,"computations",void 0),i.DimensioningVisualization=n.__decorate([c.subclass("esri.views.3d.analysis.Dimensioning.DimensioningVisualization")],i.DimensioningVisualization),Object.defineProperties(i,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
