/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define((function(){"use strict";return function(){function t(){this.bitsPerWord=32,this.addressBitsPerWord=5,this._store=[]}var r=t.prototype;return r.clone=function(){const r=new t;return r._store=this._store.slice(),r},r.wordIndex=function(t){return t>>this.addressBitsPerWord},r.set=function(t){return this._store[this.wordIndex(t-1)]|=1<<t-1},r.clear=function(t){return this._store[this.wordIndex(t-1)]&=255^1<<t-1},r.clearAll=function(){for(let t=0;t<this._store.length;++t)this._store[t]=0},r.get=function(t){return 0!=(this._store[this.wordIndex(t-1)]&1<<t-1)},r.length=function(){return 0===this.wordLength()?0:this.bitsPerWord*(this.wordLength()-1)+(this._store[this.wordLength()-1].toString(2).length+1)},r.wordLength=function(){let t,r=this._store.length;for(let n=t=this._store.length-1;(t<=0?n<=0:n>=0)&&0===this._store[n];t<=0?n++:n--)r--;return r},r.store=function(){return this._store},r.cardinality=function(){let t=0;const r=this.length();for(let n=0;0<=r?n<=r:n>=r;0<=r?n++:n--)this.get(n)&&t++;return t},r.toString=function(){const t=[],r=this.length();for(let n=0;0<=r?n<=r:n>=r;0<=r?n++:n--)this.get(n)&&t.push(""+n);return"{"+t.join(",")+"}"},r.toBinaryString=function(){const t=this,r=(t,r,n)=>{for(;t.length<n;)t=r+t;return t};return this.wordLength()>0?this._store.map((n=>r(n.toString(2),"0",t.bitsPerWord))).join(""):r("","0",this.bitsPerWord)},r.or=function(t){if(this===t)return;const r=Math.min(this.wordLength(),t.wordLength()),n=r-1;for(let e=0;0<=n?e<=n:e>=n;0<=n?e++:e--)this._store[e]|=t.store[e];return r<t.wordLength()&&(this._store=this._store.concat(t._store.slice(r,t.wordLength()))),null},r.and=function(t){if(this===t)return;const r=this.wordLength(),n=t.wordLength();for(let o=r;r<=n?o<=n:o>=n;r<=n?o++:o--)this._store[o]=0;const e=this.wordLength();for(let o=0;0<=e?o<=e:o>=e;0<=e?o++:o--)this._store[o]&=t.store[o];return null},r.andNot=function(t){const r=Math.min(this.wordLength(),t.wordLength())-1;for(let n=0;0<=r?n<=r:n>=r;0<=r?n++:n--)this._store[n]&=~t.store[n];return null},r.xor=function(t){if(this===t)return;const r=this.wordLength();for(let n=0;0<=r?n<=r:n>=r;0<=r?n++:n--)this._store[n]^=t.store[n];return null},t}()}));
