/** * Minified by jsDelivr using Terser v5.10.0. * Original file: /npm/tinyqueue@2.0.3/index.js * * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files */ export default class TinyQueue{constructor(t=[],h=defaultCompare){if(this.data=t,this.length=this.data.length,this.compare=h,this.length>0)for(let t=(this.length>>1)-1;t>=0;t--)this._down(t)}push(t){this.data.push(t),this.length++,this._up(this.length-1)}pop(){if(0===this.length)return;const t=this.data[0],h=this.data.pop();return this.length--,this.length>0&&(this.data[0]=h,this._down(0)),t}peek(){return this.data[0]}_up(t){const{data:h,compare:s}=this,e=h[t];for(;t>0;){const a=t-1>>1,i=h[a];if(s(e,i)>=0)break;h[t]=i,t=a}h[t]=e}_down(t){const{data:h,compare:s}=this,e=this.length>>1,a=h[t];for(;t=0)break;h[t]=i,t=e}h[t]=a}}function defaultCompare(t,h){return th?1:0} //# sourceMappingURL=/sm/d66cdc801e31ad5c6f6a7e415184d6559e4e641efd692cca125432b4ff9c4b6e.map