/*
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","../../../core/Evented","../../../core/ObservableChangesType","../../../core/SetUtils"],(function(e,t,s,n,i){"use strict";let r=function(e){function s(){var t;return(t=e.apply(this,arguments)||this)._set=new Set,t}t._inheritsLoose(s,e);var r=s.prototype;return r.clear=function(){if(this._set.size>0){const e=this.toArray();this._set.clear(),this.emit("after-changes",{type:n.ObservableChangesType.REMOVE}),this.emit("change",{added:[],removed:e})}},r.addMany=function(e){if(0!==e.length){for(const t of e)this._set.add(t);this.emit("after-changes",{type:n.ObservableChangesType.ADD}),this.emit("change",{added:e,removed:[]})}},r.remove=function(e){this._set.delete(e)&&(this.emit("after-changes",{type:n.ObservableChangesType.REMOVE}),this.emit("change",{added:[],removed:[e]}))},r.removeMany=function(e){const t=[];for(const s of e)this._set.delete(s)&&t.push(s);t.length>0&&(this.emit("after-changes",{type:n.ObservableChangesType.REMOVE}),this.emit("change",{added:[],removed:t}))},r.toArray=function(){return[...this._set]},r.find=function(e){let t;return i.someSet(this._set,(s=>!!e(s)&&(t=s,!0))),t},r.forEach=function(e){this._set.forEach((t=>e(t)))},t._createClass(s,[{key:"length",get:function(){return this._set.size}}]),s}(s);e.EventedSet=r,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
