LavaPack.loadBundle([[800,{},function(){with(this.scopeTerminator)with(this.globalThis)return function(){"use strict";return function(r,n,t){Object.defineProperty(t,"__esModule",{value:!0});var e=function(r,n,t){var e=Math.floor(t()*r.prob.length);return n[t()<r.prob[e]?e:r.alias[e]]};t.default=function(r,n,t){if(void 0===t&&(t=Math.random),!Array.isArray(r))throw new Error("Probabilities must be an array.");if(0===r.length)throw new Error("Probabilities array must not be empty.");var o=r.length,i=null!=n?n:Array.from({length:o},function(r,n){return n}),a=function(r,n){var t=r.reduce(function(n,t){if(t<0)throw new Error("Probability must be a positive: p["+r.indexOf(t)+"]="+t);return n+t},0);if(0===t)throw new Error("Probability sum must be greater than zero.");for(var e=r.map(function(r){return r*n/t}),o={prob:new Array(n),alias:new Array(n)},i=[],a=[],u=n-1;u>=0;u--)e[u]<1?i.push(u):a.push(u);for(;i.length>0&&a.length>0;){var s=i.pop(),l=a.pop();o.prob[s]=e[s],o.alias[s]=l,e[l]=e[l]+e[s]-1,e[l]<1?i.push(l):a.push(l)}for(;a.length>0;)o.prob[a.pop()]=1;for(;i.length>0;)o.prob[i.pop()]=1;return o}(r,o);return{next:function(r){return void 0===r&&(r=1),function(r,n,t,o){if(void 0===o&&(o=1),1===o)return e(r,n,t);for(var i=[],a=0;a<o;a++)i.push(e(r,n,t));return i}(a,i,t,r)}}}}}},{package:"@ngraveio/bc-ur>@keystonehq/alias-sampling",file:"node_modules/@keystonehq/alias-sampling/dist/cjs/index.js"}]],[],{});