extra-sorted-array.web
Version:
A sorted array is a collection of values, arranged in an order {web}.
1 lines • 71.4 kB
JavaScript
function getDefaultExportFromCjs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var _build$1={},extraFunction={};Object.defineProperty(extraFunction,"__esModule",{value:!0});var _build={};function NOOP(...e){}function FALSE(...e){return!1}function TRUE(...e){return!0}function IDENTITY(e){return e}function COMPARE(e,n){return e<n?-1:e>n?1:0}function ARGUMENTS(...e){return e}function name(e){return e.name}function length(e){return e.length}function bind(e,n,...r){return e.bind(n,...r)}function call(e,n=null,...r){return e.call(n,...r)}function apply(e,n=null,r){return e.apply(n,r)}function is(e){return"function"==typeof e}function isAsync(e){return e instanceof async function(){}.constructor}function isGenerator(e){return e instanceof function*(){}.constructor}function contextify(e){return function(...n){return e(this,...n)}}function decontextify(e){return(n=null,...r)=>e.call(n,...r)}function negate(e){return(...n)=>!e(...n)}function memoize(e,n=null,r=null){n=n||IDENTITY,r=r||new Map;return(...t)=>{var i=n(...t);if(r.has(i))return r.get(i);var u=e(...t);return r.set(i,u),u}}function reverse(e){return(...n)=>e(...n.reverse())}function spread(e){return(...n)=>e(n)}function unspread(e){return n=>e(...n)}function attach(e,...n){return(...r)=>e(...n,...r)}function attachRight(e,...n){return(...r)=>e(...r,...n)}function compose(...e){return composeRight(...e.reverse())}function composeRight(...e){return(...n)=>{if(0!==e.length){for(var r=e[0](...n),t=1,i=e.length;t<i;t++)r=e[t](r);return r}}}function curry(e,n=e.length){return(...r)=>r.length>=n?e(...r):curry(((...n)=>e(...r,...n)),n-r.length)}function curryRight(e,n=e.length){return curry(reverse(e),n)}function defer(e){return(...n)=>{var r=setImmediate(i);function t(){clearImmediate(r),r=null}function i(){e(...n),t()}return{clear:t,flush:i}}}function delay(e,n){return(...r)=>{var t=setTimeout(u,n);function i(){clearTimeout(t),t=null}function u(){e(...r),i()}return{clear:i,flush:u}}}function restrict(e,n,r=-1){var t=-1;return(...i)=>{if(++t<n!=(t<r||r<0))return e(...i)}}function restrictOnce(e){return restrict(e,0,1)}function restrictBefore(e,n){return restrict(e,0,n)}function restrictAfter(e,n){return restrict(e,n)}function debounce(e,n,r=-1){var t,i=null,u=null;function a(){clearTimeout(i),clearTimeout(u),i=u=null}function o(){e(...t),a()}return(...e)=>(t=e,r>=0&&(u=u||setTimeout(o,r)),(r<0||n<r)&&(clearTimeout(i),i=setTimeout(o,n)),{clear:a,flush:o})}function debounceEarly(e,n,r=-1){var t=null,i=null;function u(){t=i=null}function a(){u()}return(...o)=>(t||i||e(...o),r>=0&&(i=i||setTimeout(a,r)),(r<0||n<r)&&(clearTimeout(t),t=setTimeout(a,n)),{clear:u,flush:a})}function throttle(e,n){var r,t=null;function i(){t=null}function u(){e(...r),i()}return(...e)=>(r=e,t=t||setTimeout(u,n),{clear:i,flush:u})}function throttleEarly(e,n){var r=null;function t(){r=null}function i(){t()}return(...u)=>(r||e(...u),r=r||setTimeout(i,n),{clear:t,flush:i})}Object.defineProperty(_build,"__esModule",{value:!0}),extraFunction.throttleEarly=_build.throttleEarly=extraFunction.throttle=_build.throttle=extraFunction.debounceEarly=_build.debounceEarly=extraFunction.debounce=_build.debounce=extraFunction.after=_build.after=extraFunction.restrictAfter=_build.restrictAfter=extraFunction.before=_build.before=extraFunction.restrictBefore=_build.restrictBefore=extraFunction.once=_build.once=extraFunction.restrictOnce=_build.restrictOnce=extraFunction.restrict=_build.restrict=extraFunction.delay=_build.delay=extraFunction.defer=_build.defer=extraFunction.curryRight=_build.curryRight=extraFunction.curry=_build.curry=extraFunction.composeRight=_build.composeRight=extraFunction.compose=_build.compose=extraFunction.partialRight=_build.partialRight=extraFunction.attachRight=_build.attachRight=extraFunction.partial=_build.partial=extraFunction.attach=_build.attach=extraFunction.unspread=_build.unspread=extraFunction.spread=_build.spread=extraFunction.flip=_build.flip=extraFunction.reverse=_build.reverse=extraFunction.memoize=_build.memoize=extraFunction.negate=_build.negate=extraFunction.decontextify=_build.decontextify=extraFunction.contextify=_build.contextify=extraFunction.isGenerator=_build.isGenerator=extraFunction.isAsync=_build.isAsync=extraFunction.is=_build.is=extraFunction.apply=_build.apply=extraFunction.call=_build.call=extraFunction.bind=_build.bind=extraFunction.arity=_build.arity=extraFunction.length=_build.length=extraFunction.name=_build.name=extraFunction.ARGUMENTS=_build.ARGUMENTS=extraFunction.COMPARE=_build.COMPARE=extraFunction.IDENTITY=_build.IDENTITY=extraFunction.TRUE=_build.TRUE=extraFunction.FALSE=_build.FALSE=extraFunction.NOOP=_build.NOOP=void 0,extraFunction.NOOP=_build.NOOP=NOOP,extraFunction.FALSE=_build.FALSE=FALSE,extraFunction.TRUE=_build.TRUE=TRUE,extraFunction.IDENTITY=_build.IDENTITY=IDENTITY,extraFunction.COMPARE=_build.COMPARE=COMPARE,extraFunction.ARGUMENTS=_build.ARGUMENTS=ARGUMENTS,extraFunction.name=_build.name=name,extraFunction.length=_build.length=length,extraFunction.arity=_build.arity=length,extraFunction.bind=_build.bind=bind,extraFunction.call=_build.call=call,extraFunction.apply=_build.apply=apply,extraFunction.is=_build.is=is,extraFunction.isAsync=_build.isAsync=isAsync,extraFunction.isGenerator=_build.isGenerator=isGenerator,extraFunction.contextify=_build.contextify=contextify,extraFunction.decontextify=_build.decontextify=decontextify,extraFunction.negate=_build.negate=negate,extraFunction.memoize=_build.memoize=memoize,extraFunction.reverse=_build.reverse=reverse,extraFunction.flip=_build.flip=reverse,extraFunction.spread=_build.spread=spread,extraFunction.unspread=_build.unspread=unspread,extraFunction.attach=_build.attach=attach,extraFunction.partial=_build.partial=attach,extraFunction.attachRight=_build.attachRight=attachRight,extraFunction.partialRight=_build.partialRight=attachRight,extraFunction.compose=_build.compose=compose,extraFunction.composeRight=_build.composeRight=composeRight,extraFunction.curry=_build.curry=curry,extraFunction.curryRight=_build.curryRight=curryRight,extraFunction.defer=_build.defer=defer,extraFunction.delay=_build.delay=delay,extraFunction.restrict=_build.restrict=restrict,extraFunction.restrictOnce=_build.restrictOnce=restrictOnce,extraFunction.once=_build.once=restrictOnce,extraFunction.restrictBefore=_build.restrictBefore=restrictBefore,extraFunction.before=_build.before=restrictBefore,extraFunction.restrictAfter=_build.restrictAfter=restrictAfter,extraFunction.after=_build.after=restrictAfter,extraFunction.debounce=_build.debounce=debounce,extraFunction.debounceEarly=_build.debounceEarly=debounceEarly,extraFunction.throttle=_build.throttle=throttle,extraFunction.throttleEarly=_build.throttleEarly=throttleEarly,extraFunction.default=_build;var extraArray={};!function(e){Object.defineProperty(e,"__esModule",{value:!0});var n={},r={exports:{}};!function(e){var n={},r={};Object.defineProperty(r,"__esModule",{value:!0});var t={};function i(e,n,r){return Math.min(Math.max(e,n),r)}function u(e,n,r){return(e-n)/(r-n)}function a(e,n,r,t,i){return t+(e-n)/(r-n)*(i-t)}function o(e,n){return 1&n?Math.sign(e)*Math.pow(Math.abs(e),1/n):Math.pow(e,1/n)}function c(e,n=Math.E){return Math.log(e)/Math.log(n)}function l(e){e=Math.abs(e);for(var n=[],r=1;r<e;r++)e%r==0&&n.push(r);return n}function f(e){if((e=Math.abs(e))<=1)return 0;if(e<=3)return e;if(e%2==0)return 2;if(e%3==0)return 3;for(var n=6,r=Math.sqrt(e)+1;n<=r;n+=6){if(e%(n-1)==0)return n-1;if(e%(n+1)==0)return n+1}return e}function s(e){var n=0;if((e=Math.abs(e))<=1)return 0;if(e<=3)return e;for(;e%2==0;n=2)e/=2;for(;e%3==0;n=3)e/=3;for(var r=6,t=Math.sqrt(e)+1;e>1&&r<=t;r+=6){for(;e%(r-1)==0;n=r-1)e/=r-1;for(;e%(r+1)==0;n=r+1)e/=r+1}return e<=1?n:e}function h(e,n,r){if(n%r!=0)return n;do{n/=r}while(n%r==0);return e.push(r),n}function m(e,n,r){if(n%r!=0)return n;var t=0;do{n/=r,++t}while(n%r==0);return e.push([r,t]),n}function p(...e){for(var n=e[0]||1,r=1,t=e.length;r<t;r++)n=d(n,e[r]);return n}function d(e,n){for(;0!==n;){var r=n;n=e%n,e=r}return e}function g(...e){var n=0;for(var r of e)n+=r;return n}function b(...e){var n=1;for(var r of e)n*=r;return n}function v(...e){return 0===e.length?0:g(...e)/e.length}function y(...e){var n=e.length,r=0;for(var t of e)r+=t*t;return Math.sqrt(r/n)}Object.defineProperty(t,"__esModule",{value:!0}),r.mean=t.mean=r.arithmeticMean=t.arithmeticMean=r.variance=t.variance=r.range=t.range=r.modes=t.modes=r.median=t.median=r.product=t.product=r.sum=t.sum=r.radians=t.radians=r.degrees=t.degrees=r.multinomial=t.multinomial=r.binomial=t.binomial=r.factorial=t.factorial=r.lcm=t.lcm=r.hcf=t.hcf=r.gcd=t.gcd=r.isPrime=t.isPrime=r.primeExponentials=t.primeExponentials=r.primeFactors=t.primeFactors=r.greatestPrimeFactor=t.greatestPrimeFactor=r.maxPrimeFactor=t.maxPrimeFactor=r.leastPrimeFactor=t.leastPrimeFactor=r.minPrimeFactor=t.minPrimeFactor=r.aliquotSum=t.aliquotSum=r.aliquotParts=t.aliquotParts=r.properDivisors=t.properDivisors=r.log=t.log=r.root=t.root=r.nextPow=t.nextPow=r.prevPow=t.prevPow=r.isPow=t.isPow=r.lerp=t.lerp=r.map=t.map=r.remap=t.remap=r.norm=t.norm=r.normalize=t.normalize=r.clamp=t.clamp=r.constrain=t.constrain=r.modp=t.modp=r.mod=t.mod=r.rem=t.rem=r.roundDiv=t.roundDiv=r.ceilDiv=t.ceilDiv=r.floorDiv=t.floorDiv=r.round=t.round=r.ceil=t.ceil=r.floor=t.floor=r.compare=t.compare=r.significantDigits=t.significantDigits=r.is=t.is=void 0,r.toRoman=t.toRoman=r.toRomanNumerals=t.toRomanNumerals=r.fromRoman=t.fromRoman=r.fromRomanNumerals=t.fromRomanNumerals=r.cubicMean=t.cubicMean=r.rootMeanSquare=t.rootMeanSquare=r.quadriaticMean=t.quadriaticMean=r.harmonicMean=t.harmonicMean=r.geometricMean=t.geometricMean=void 0,r.is=t.is=function(e){return"number"==typeof e},r.significantDigits=t.significantDigits=function(e){return e.toExponential().replace(/e[\+\-0-9]*$/,"").replace(/^0\.?0*|\./,"").length},r.compare=t.compare=function(e,n){return e-n},r.floor=t.floor=function(e,n=1){return Math.floor(e/n)*n},r.ceil=t.ceil=function(e,n=1){return Math.ceil(e/n)*n},r.round=t.round=function(e,n=1){return Math.round(e/n)*n},r.floorDiv=t.floorDiv=function(e,n){return Math.floor(e/n)},r.ceilDiv=t.ceilDiv=function(e,n){return Math.ceil(e/n)},r.roundDiv=t.roundDiv=function(e,n){return Math.round(e/n)},r.rem=t.rem=function(e,n){return e%n},r.mod=t.mod=function(e,n){return e-n*Math.floor(e/n)},r.modp=t.modp=function(e,n){return e-Math.abs(n)*Math.floor(e/Math.abs(n))},r.constrain=t.constrain=i,r.clamp=t.clamp=i,r.normalize=t.normalize=u,r.norm=t.norm=u,r.remap=t.remap=a,r.map=t.map=a,r.lerp=t.lerp=function(e,n,r){return e+r*(n-e)},r.isPow=t.isPow=function(e,n){if(0===n)return 0===e;var r=c(Math.abs(e),Math.abs(n));return r===Math.floor(r)&&(e<0?n<0&&!(1&~r):n>0||!(1&r))},r.prevPow=t.prevPow=function(e,n){if(e<=1)return 0;var r=Math.floor(Math.log(e)/Math.log(n));return Math.pow(n,r)},r.nextPow=t.nextPow=function(e,n){if(e<=0)return 1;var r=Math.ceil(Math.log(e)/Math.log(n));return Math.pow(n,r)},r.root=t.root=o,r.log=t.log=c,r.properDivisors=t.properDivisors=l,r.aliquotParts=t.aliquotParts=l,r.aliquotSum=t.aliquotSum=function(e){e=Math.abs(e);for(var n=0,r=0;r<e;r++)e%r==0&&(n+=r);return n},r.minPrimeFactor=t.minPrimeFactor=f,r.leastPrimeFactor=t.leastPrimeFactor=f,r.maxPrimeFactor=t.maxPrimeFactor=s,r.greatestPrimeFactor=t.greatestPrimeFactor=s,r.primeFactors=t.primeFactors=function(e){var n=[];if((e=Math.abs(e))<=1)return[];if(e<=3)return[e];e=h(n,e,2),e=h(n,e,3);for(var r=6,t=Math.sqrt(e)+1;e>1&&r<=t;r+=6)e=h(n,e,r-1),e=h(n,e,r+1);return e>1&&n.push(e),n},r.primeExponentials=t.primeExponentials=function(e){var n=[];if((e=Math.abs(e))<=1)return[];if(e<=3)return[[e,1]];e=m(n,e,2),e=m(n,e,3);for(var r=6,t=Math.sqrt(e)+1;e>1&&r<=t;r+=6)e=m(n,e,r-1),e=m(n,e,r+1);return e>1&&n.push([e,1]),n},r.isPrime=t.isPrime=function(e){return 0!==e&&f(e)===Math.abs(e)},r.gcd=t.gcd=p,r.hcf=t.hcf=p,r.lcm=t.lcm=function(...e){for(var n=e[0]||1,r=1,t=e.length;r<t;r++)n=n*e[r]/d(n,e[r]);return n},r.factorial=t.factorial=function(e,n=0){if(e<0)return 0;for(var r=n+1,t=1;r<=e;r++)t*=r;return t},r.binomial=t.binomial=function e(n,r){if(r<0||r>Math.abs(n))return 0;if(n<0)return Math.pow(-1,r)*e(-n,r);r=r>n-r?n-r:r;for(var t=1,i=1;i<=r;i++,n--)t*=n/i;return t},r.multinomial=t.multinomial=function(...e){for(var n=g(...e),r=1,t=0,i=0,u=e.length;t<u;)i<=0?i=e[t++]:r*=n--/i--;return r},r.degrees=t.degrees=function(e){return e*(180/Math.PI)},r.radians=t.radians=function(e){return e*(Math.PI/180)},r.sum=t.sum=g,r.product=t.product=b,r.median=t.median=function(...e){if(0===e.length)return 0;e.sort(((e,n)=>e-n));var n=e.length>>1;return 1&~e.length?(e[n-1]+e[n])/2:e[n]},r.modes=t.modes=function(...e){e.sort(((e,n)=>e-n));var n=function(e){for(var n=Math.min(e.length,1),r=n,t=1,i=e.length;t<i;t++)e[t-1]===e[t]?n++:(r=Math.max(r,n),n=1);return Math.max(r,n)}(e);return function(e,n){var r=[];n--;for(var t=0,i=e.length-n;t<i;t++)e[t]===e[t+n]&&r.push(e[t+=n]);return r}(e,n)},r.range=t.range=function(...e){return[Math.min(...e),Math.max(...e)]},r.variance=t.variance=function(...e){if(0===e.length)return 0;var n=v(...e),r=0;for(var t of e)r+=(t-n)**2;return r/e.length},r.arithmeticMean=t.arithmeticMean=v,r.mean=t.mean=v,r.geometricMean=t.geometricMean=function(...e){var n=e.length;return o(b(...e),n)},r.harmonicMean=t.harmonicMean=function(...e){var n=e.length,r=b(...e),t=0;for(var i of e)t+=r/i;return n*r/t},r.quadriaticMean=t.quadriaticMean=y,r.rootMeanSquare=t.rootMeanSquare=y,r.cubicMean=t.cubicMean=function(...e){var n=e.length,r=0;for(var t of e)r+=t**3;return Math.cbrt(r/n)};const x=["I","IV","V","IX","X","XL","L","XC","C","CD","D","CM","M"],P=[1,4,5,9,10,40,50,90,100,400,500,900,1e3];function O(e){for(var n=x.length-1,r=e.search(/^\s*-/)>=0,t=0,i=0,u=(e=e.replace(/\W/g,"").toUpperCase()).length;i<u;i+=x[n].length){for(;n>=0&&e.substring(i,i+x[n].length)!==x[n];)--n;if(n<0)break;t+=P[n]}return r?-t:t}function M(e){for(var n=e<0?"-":"",r=(e=Math.abs(e),x.length-1);r>=0;--r)for(;e>=P[r];)e-=P[r],n+=x[r];return n}r.fromRomanNumerals=t.fromRomanNumerals=O,r.fromRoman=t.fromRoman=O,r.toRomanNumerals=t.toRomanNumerals=M,r.toRoman=t.toRoman=M,r.default=t,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.quadriaticMean=e.harmonicMean=e.geometricMean=e.mean=e.arithmeticMean=e.variance=e.range=e.modes=e.median=e.product=e.sum=e.radians=e.degrees=e.multinomial=e.binomial=e.factorial=e.lcm=e.hcf=e.gcd=e.isPrime=e.primeExponentials=e.primeFactors=e.greatestPrimeFactor=e.maxPrimeFactor=e.leastPrimeFactor=e.minPrimeFactor=e.aliquotSum=e.aliquotParts=e.properDivisors=e.log=e.root=e.nextPow=e.prevPow=e.isPow=e.map=e.remap=e.lerp=e.norm=e.normalize=e.clamp=e.constrain=e.modp=e.mod=e.rem=e.roundDiv=e.ceilDiv=e.floorDiv=e.round=e.ceil=e.floor=void 0,e.distance=e.magnitude=e.cubicMean=e.rootMeanSquare=void 0;var n=r;Object.defineProperty(e,"floor",{enumerable:!0,get:function(){return n.floor}}),Object.defineProperty(e,"ceil",{enumerable:!0,get:function(){return n.ceil}}),Object.defineProperty(e,"round",{enumerable:!0,get:function(){return n.round}}),Object.defineProperty(e,"floorDiv",{enumerable:!0,get:function(){return n.floorDiv}}),Object.defineProperty(e,"ceilDiv",{enumerable:!0,get:function(){return n.ceilDiv}}),Object.defineProperty(e,"roundDiv",{enumerable:!0,get:function(){return n.roundDiv}}),Object.defineProperty(e,"rem",{enumerable:!0,get:function(){return n.rem}}),Object.defineProperty(e,"mod",{enumerable:!0,get:function(){return n.mod}}),Object.defineProperty(e,"modp",{enumerable:!0,get:function(){return n.modp}}),Object.defineProperty(e,"constrain",{enumerable:!0,get:function(){return n.constrain}}),Object.defineProperty(e,"clamp",{enumerable:!0,get:function(){return n.constrain}}),Object.defineProperty(e,"normalize",{enumerable:!0,get:function(){return n.normalize}}),Object.defineProperty(e,"norm",{enumerable:!0,get:function(){return n.normalize}}),Object.defineProperty(e,"lerp",{enumerable:!0,get:function(){return n.lerp}}),Object.defineProperty(e,"remap",{enumerable:!0,get:function(){return n.remap}}),Object.defineProperty(e,"map",{enumerable:!0,get:function(){return n.remap}}),Object.defineProperty(e,"isPow",{enumerable:!0,get:function(){return n.isPow}}),Object.defineProperty(e,"prevPow",{enumerable:!0,get:function(){return n.prevPow}}),Object.defineProperty(e,"nextPow",{enumerable:!0,get:function(){return n.nextPow}}),Object.defineProperty(e,"root",{enumerable:!0,get:function(){return n.root}}),Object.defineProperty(e,"log",{enumerable:!0,get:function(){return n.log}}),Object.defineProperty(e,"properDivisors",{enumerable:!0,get:function(){return n.properDivisors}}),Object.defineProperty(e,"aliquotParts",{enumerable:!0,get:function(){return n.properDivisors}}),Object.defineProperty(e,"aliquotSum",{enumerable:!0,get:function(){return n.aliquotSum}}),Object.defineProperty(e,"minPrimeFactor",{enumerable:!0,get:function(){return n.minPrimeFactor}}),Object.defineProperty(e,"leastPrimeFactor",{enumerable:!0,get:function(){return n.minPrimeFactor}}),Object.defineProperty(e,"maxPrimeFactor",{enumerable:!0,get:function(){return n.maxPrimeFactor}}),Object.defineProperty(e,"greatestPrimeFactor",{enumerable:!0,get:function(){return n.maxPrimeFactor}}),Object.defineProperty(e,"primeFactors",{enumerable:!0,get:function(){return n.primeFactors}}),Object.defineProperty(e,"primeExponentials",{enumerable:!0,get:function(){return n.primeExponentials}}),Object.defineProperty(e,"isPrime",{enumerable:!0,get:function(){return n.isPrime}}),Object.defineProperty(e,"gcd",{enumerable:!0,get:function(){return n.gcd}}),Object.defineProperty(e,"hcf",{enumerable:!0,get:function(){return n.gcd}}),Object.defineProperty(e,"lcm",{enumerable:!0,get:function(){return n.lcm}}),Object.defineProperty(e,"factorial",{enumerable:!0,get:function(){return n.factorial}}),Object.defineProperty(e,"binomial",{enumerable:!0,get:function(){return n.binomial}}),Object.defineProperty(e,"multinomial",{enumerable:!0,get:function(){return n.multinomial}}),Object.defineProperty(e,"degrees",{enumerable:!0,get:function(){return n.degrees}}),Object.defineProperty(e,"radians",{enumerable:!0,get:function(){return n.radians}}),Object.defineProperty(e,"sum",{enumerable:!0,get:function(){return n.sum}}),Object.defineProperty(e,"product",{enumerable:!0,get:function(){return n.product}}),Object.defineProperty(e,"median",{enumerable:!0,get:function(){return n.median}}),Object.defineProperty(e,"modes",{enumerable:!0,get:function(){return n.modes}}),Object.defineProperty(e,"range",{enumerable:!0,get:function(){return n.range}}),Object.defineProperty(e,"variance",{enumerable:!0,get:function(){return n.variance}}),Object.defineProperty(e,"arithmeticMean",{enumerable:!0,get:function(){return n.arithmeticMean}}),Object.defineProperty(e,"mean",{enumerable:!0,get:function(){return n.arithmeticMean}}),Object.defineProperty(e,"geometricMean",{enumerable:!0,get:function(){return n.geometricMean}}),Object.defineProperty(e,"harmonicMean",{enumerable:!0,get:function(){return n.harmonicMean}}),Object.defineProperty(e,"quadriaticMean",{enumerable:!0,get:function(){return n.quadriaticMean}}),Object.defineProperty(e,"rootMeanSquare",{enumerable:!0,get:function(){return n.quadriaticMean}}),Object.defineProperty(e,"cubicMean",{enumerable:!0,get:function(){return n.cubicMean}}),e.magnitude=function(e){for(var n=0,r=0,t=e.length;r<t;r++)n+=e[r]**2;return Math.sqrt(n)},e.distance=function(e,n){for(var r=0,t=0,i=e.length;t<i;t++)r+=(e[t]-n[t])**2;return Math.sqrt(r)}}(n);var R,E=(R=n)&&R.__esModule&&Object.prototype.hasOwnProperty.call(R,"default")?R.default:R;e.exports=E}(r);var t,i=r.exports;(t=i)&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")&&t.default;var u={};Object.defineProperty(u,"__esModule",{value:!0});var a={};function o(e){return e}function c(e){return e.length}function l(e){return(...n)=>e(...n.reverse())}function f(e,...n){return(...r)=>e(...n,...r)}function s(e,...n){return(...r)=>e(...r,...n)}function h(...e){return(...n)=>{if(0!==e.length){for(var r=e[0](...n),t=1,i=e.length;t<i;t++)r=e[t](r);return r}}}function m(e,n=e.length){return(...r)=>r.length>=n?e(...r):m(((...n)=>e(...r,...n)),n-r.length)}function p(e,n,r=-1){var t=-1;return(...i)=>{if(++t<n!=(t<r||r<0))return e(...i)}}function d(e){return p(e,0,1)}function g(e,n){return p(e,0,n)}function b(e,n){return p(e,n)}Object.defineProperty(a,"__esModule",{value:!0}),u.throttleEarly=a.throttleEarly=u.throttle=a.throttle=u.debounceEarly=a.debounceEarly=u.debounce=a.debounce=u.after=a.after=u.restrictAfter=a.restrictAfter=u.before=a.before=u.restrictBefore=a.restrictBefore=u.once=a.once=u.restrictOnce=a.restrictOnce=u.restrict=a.restrict=u.delay=a.delay=u.defer=a.defer=u.curryRight=a.curryRight=u.curry=a.curry=u.composeRight=a.composeRight=u.compose=a.compose=u.partialRight=a.partialRight=u.attachRight=a.attachRight=u.partial=a.partial=u.attach=a.attach=u.unspread=a.unspread=u.spread=a.spread=u.flip=a.flip=u.reverse=a.reverse=u.memoize=a.memoize=u.negate=a.negate=u.decontextify=a.decontextify=u.contextify=a.contextify=u.isGenerator=a.isGenerator=u.isAsync=a.isAsync=u.is=a.is=u.apply=a.apply=u.call=a.call=u.bind=a.bind=u.arity=a.arity=u.length=a.length=u.name=a.name=u.ARGUMENTS=a.ARGUMENTS=u.COMPARE=a.COMPARE=u.IDENTITY=a.IDENTITY=u.TRUE=a.TRUE=u.FALSE=a.FALSE=u.NOOP=a.NOOP=void 0,u.NOOP=a.NOOP=function(...e){},u.FALSE=a.FALSE=function(...e){return!1},u.TRUE=a.TRUE=function(...e){return!0},u.IDENTITY=a.IDENTITY=o,u.COMPARE=a.COMPARE=function(e,n){return e<n?-1:e>n?1:0},u.ARGUMENTS=a.ARGUMENTS=function(...e){return e},u.name=a.name=function(e){return e.name},u.length=a.length=c,u.arity=a.arity=c,u.bind=a.bind=function(e,n,...r){return e.bind(n,...r)},u.call=a.call=function(e,n=null,...r){return e.call(n,...r)},u.apply=a.apply=function(e,n=null,r){return e.apply(n,r)},u.is=a.is=function(e){return"function"==typeof e},u.isAsync=a.isAsync=function(e){return e instanceof async function(){}.constructor},u.isGenerator=a.isGenerator=function(e){return e instanceof function*(){}.constructor},u.contextify=a.contextify=function(e){return function(...n){return e(this,...n)}},u.decontextify=a.decontextify=function(e){return(n=null,...r)=>e.call(n,...r)},u.negate=a.negate=function(e){return(...n)=>!e(...n)},u.memoize=a.memoize=function(e,n=null,r=null){return n=n||o,r=r||new Map,(...t)=>{var i=n(...t);if(r.has(i))return r.get(i);var u=e(...t);return r.set(i,u),u}},u.reverse=a.reverse=l,u.flip=a.flip=l,u.spread=a.spread=function(e){return(...n)=>e(n)},u.unspread=a.unspread=function(e){return n=>e(...n)},u.attach=a.attach=f,u.partial=a.partial=f,u.attachRight=a.attachRight=s,u.partialRight=a.partialRight=s,u.compose=a.compose=function(...e){return h(...e.reverse())},u.composeRight=a.composeRight=h,u.curry=a.curry=m,u.curryRight=a.curryRight=function(e,n=e.length){return m(l(e),n)},u.defer=a.defer=function(e){return(...n)=>{var r=setImmediate(i);function t(){clearImmediate(r),r=null}function i(){e(...n),t()}return{clear:t,flush:i}}},u.delay=a.delay=function(e,n){return(...r)=>{var t=setTimeout(u,n);function i(){clearTimeout(t),t=null}function u(){e(...r),i()}return{clear:i,flush:u}}},u.restrict=a.restrict=p,u.restrictOnce=a.restrictOnce=d,u.once=a.once=d,u.restrictBefore=a.restrictBefore=g,u.before=a.before=g,u.restrictAfter=a.restrictAfter=b,u.after=a.after=b,u.debounce=a.debounce=function(e,n,r=-1){var t,i=null,u=null;function a(){clearTimeout(i),clearTimeout(u),i=u=null}function o(){e(...t),a()}return(...e)=>(t=e,r>=0&&(u=u||setTimeout(o,r)),(r<0||n<r)&&(clearTimeout(i),i=setTimeout(o,n)),{clear:a,flush:o})},u.debounceEarly=a.debounceEarly=function(e,n,r=-1){var t=null,i=null;function u(){t=i=null}function a(){u()}return(...o)=>(t||i||e(...o),r>=0&&(i=i||setTimeout(a,r)),(r<0||n<r)&&(clearTimeout(t),t=setTimeout(a,n)),{clear:u,flush:a})},u.throttle=a.throttle=function(e,n){var r,t=null;function i(){t=null}function u(){e(...r),i()}return(...e)=>(r=e,t=t||setTimeout(u,n),{clear:i,flush:u})},u.throttleEarly=a.throttleEarly=function(e,n){var r=null;function t(){r=null}function i(){t()}return(...u)=>(r||e(...u),r=r||setTimeout(i,n),{clear:t,flush:i})},u.default=a,Object.defineProperty(n,"__esModule",{value:!0}),e.rangedSort$=n.rangedSort$=e.rangedSort=n.rangedSort=e.sort$=n.sort$=e.toSorted=n.toSorted=e.sort=n.sort=e.searchUnsortedValue=n.searchUnsortedValue=e.hasUnsortedValue=n.hasUnsortedValue=e.isSorted=n.isSorted=e.removePath$=n.removePath$=e.remove$=n.remove$=e.remove=n.remove=e.swapRanges$=n.swapRanges$=e.swapRanges=n.swapRanges=e.swap$=n.swap$=e.swap=n.swap=e.setPath$=n.setPath$=e.set$=n.set$=e.with=n.with=e.set=n.set=e.hasPath=n.hasPath=e.getPath=n.getPath=e.getAll=n.getAll=e.at=n.at=e.get=n.get=e.clear$=n.clear$=e.resize$=n.resize$=e.size=n.size=e.length=n.length=e.isEmpty=n.isEmpty=e.indexRange=n.indexRange=e.index=n.index=e.ientries=n.ientries=e.entries=n.entries=e.ivalues=n.ivalues=e.values=n.values=e.ikeys=n.ikeys=e.keys=n.keys=e.is=n.is=e.deepClone=n.deepClone=e.clone=n.clone=e.shallowClone=n.shallowClone=e.from$=n.from$=e.fromIterable$=n.fromIterable$=e.from=n.from=e.fromIterable=n.fromIterable=e.fromApply=n.fromApply=e.fromApplication=n.fromApplication=e.fromCall=n.fromCall=e.fromInvocation=n.fromInvocation=e.fromRange=n.fromRange=void 0,e.hasPermutation=n.hasPermutation=e.hasSubsequence=n.hasSubsequence=e.hasInfix=n.hasInfix=e.endsWith=n.endsWith=e.hasSuffix=n.hasSuffix=e.startsWith=n.startsWith=e.hasPrefix=n.hasPrefix=e.searchMismatch=n.searchMismatch=e.searchMismatchedValue=n.searchMismatchedValue=e.searchAdjacentDuplicate=n.searchAdjacentDuplicate=e.searchAdjacentDuplicateValue=n.searchAdjacentDuplicateValue=e.searchValueAll=n.searchValueAll=e.searchValueRight=n.searchValueRight=e.searchValue=n.searchValue=e.hasValue=n.hasValue=e.includes=n.includes=e.slice$=n.slice$=e.slice=n.slice=e.middle=n.middle=e.back=n.back=e.last=n.last=e.init=n.init=e.tail=n.tail=e.first=n.first=e.front=n.front=e.head=n.head=e.compare=n.compare=e.isEqual=n.isEqual=e.searchMaximumValues=n.searchMaximumValues=e.searchMinimumValues=n.searchMinimumValues=e.searchMaximumValue=n.searchMaximumValue=e.searchMinimumValue=n.searchMinimumValue=e.maximumEntries=n.maximumEntries=e.maximums=n.maximums=e.minimumEntries=n.minimumEntries=e.minimums=n.minimums=e.rangeEntries=n.rangeEntries=e.range=n.range=e.maxEntry=n.maxEntry=e.maximumEntry=n.maximumEntry=e.max=n.max=e.maximum=n.maximum=e.minEntry=n.minEntry=e.minimumEntry=n.minimumEntry=e.min=n.min=e.minimum=n.minimum=e.rangedPartialSort$=n.rangedPartialSort$=e.rangedPartialSort=n.rangedPartialSort=e.partialSort$=n.partialSort$=e.partialSort=n.partialSort=void 0,e.findIndex=n.findIndex=e.search=n.search=e.lastIndexOf=n.lastIndexOf=e.indexOf=n.indexOf=e.scanUntilRight=n.scanUntilRight=e.scanUntil=n.scanUntil=e.scanWhileRight=n.scanWhileRight=e.scanWhile=n.scanWhile=e.dropWhileRight=n.dropWhileRight=e.dropWhile=n.dropWhile=e.dropRight=n.dropRight=e.drop=n.drop=e.takeWhileRight=n.takeWhileRight=e.takeWhile=n.takeWhile=e.right=n.right=e.takeRight=n.takeRight=e.left=n.left=e.take=n.take=e.findRight=n.findRight=e.find=n.find=e.shuffle$=n.shuffle$=e.permute$=n.permute$=e.permutation$=n.permutation$=e.randomPermutation$=n.randomPermutation$=e.permutation=n.permutation=e.randomPermutation=n.randomPermutation=e.subsequence=n.subsequence=e.randomSubsequence=n.randomSubsequence=e.infix=n.infix=e.randomInfix=n.randomInfix=e.suffix=n.suffix=e.randomSuffix=n.randomSuffix=e.prefix=n.prefix=e.randomPrefix=n.randomPrefix=e.value=n.value=e.randomValue=n.randomValue=e.searchSubsequence=n.searchSubsequence=e.searchInfixAll=n.searchInfixAll=e.searchInfixRight=n.searchInfixRight=e.searchInfix=n.searchInfix=e.ipermutations=n.ipermutations=e.permutations=n.permutations=e.isubsequences=n.isubsequences=e.subsequences=n.subsequences=e.iinfixes=n.iinfixes=e.infixes=n.infixes=e.isuffixes=n.isuffixes=e.suffixes=n.suffixes=e.iprefixes=n.iprefixes=e.prefixes=n.prefixes=void 0,e.unshift=n.unshift=e.popFront$=n.popFront$=e.shift$=n.shift$=e.popFront=n.popFront=e.shift=n.shift=e.popBack$=n.popBack$=e.pop$=n.pop$=e.popBack=n.popBack=e.pop=n.pop=e.append$=n.append$=e.pushBack$=n.pushBack$=e.push$=n.push$=e.append=n.append=e.pushBack=n.pushBack=e.push=n.push=e.fill$=n.fill$=e.fill=n.fill=e.zip=n.zip=e.interleave=n.interleave=e.intermix=n.intermix=e.interpolate=n.interpolate=e.intersperse=n.intersperse=e.adjacentCombine$=n.adjacentCombine$=e.adjacentCombine=n.adjacentCombine=e.inclusiveScan$=n.inclusiveScan$=e.accumulate=n.accumulate=e.inclusiveScan=n.inclusiveScan=e.exclusiveScan$=n.exclusiveScan$=e.exclusiveScan=n.exclusiveScan=e.flatMap=n.flatMap=e.flat=n.flat=e.rejectAt=n.rejectAt=e.reject$=n.reject$=e.reject=n.reject=e.filterAt=n.filterAt=e.filter$=n.filter$=e.findAll=n.findAll=e.filter=n.filter=e.reduceRight=n.reduceRight=e.reduce=n.reduce=e.map$=n.map$=e.map=n.map=e.allOf=n.allOf=e.every=n.every=e.anyOf=n.anyOf=e.some=n.some=e.forEach=n.forEach=e.searchAll=n.searchAll=e.findLastIndex=n.findLastIndex=e.searchRight=n.searchRight=void 0,e.cartesianProduct=n.cartesianProduct=e.symmetricDifference=n.symmetricDifference=e.difference=n.difference=e.intersection=n.intersection=e.union$=n.union$=e.union=n.union=e.unique=n.unique=e.isDisjoint=n.isDisjoint=e.isUnique=n.isUnique=e.rotate$=n.rotate$=e.rotate=n.rotate=e.reverse$=n.reverse$=e.toReversed=n.toReversed=e.reverse=n.reverse=e.repeat=n.repeat=e.cycle=n.cycle=e.join=n.join=e.concat$=n.concat$=e.concat=n.concat=e.chunk=n.chunk=e.group=n.group=e.cutAtRight=n.cutAtRight=e.cutAt=n.cutAt=e.cutRight=n.cutRight=e.cut=n.cut=e.splitAt=n.splitAt=e.split=n.split=e.partitionAs=n.partitionAs=e.groupToMap=n.groupToMap=e.partitionEach=n.partitionEach=e.partition=n.partition=e.countAs=n.countAs=e.countEach=n.countEach=e.count=n.count=e.splice$=n.splice$=e.toSpliced=n.toSpliced=e.splice=n.splice=e.moveWithin$=n.moveWithin$=e.moveWithin=n.moveWithin=e.copyWithin$=n.copyWithin$=e.copyWithin=n.copyWithin=e.copy$=n.copy$=e.copy=n.copy=e.prepend$=n.prepend$=e.pushFront$=n.pushFront$=e.unshift$=n.unshift$=e.prepend=n.prepend=e.pushFront=n.pushFront=void 0;const v=i,y=u;function x(e,n=null){if(!n)return new Set(e);var r=new Set,t=-1;for(var i of e)r.add(n(i,++t,e));return r}function P(e,n,r=1){for(var t=(n-e)/r,i=[],u=0;u<t;++u,e+=r)i.push(e);return i}function O(e,n){for(var r=[],t=0;t<n;++t)r.push(e());return r}function M(e,n,r){var t=[];0!==r&&t.push(n);for(var i=1;i!==r;++i)t.push(n=e(n,i,null));return t}function R(e){return[...e]}function E(e){return Array.isArray(e)?e:[...e]}function j(e){return e.slice()}function A(e){return Array.isArray(e)}function I(e,n){var r=e.length;return n>=0?Math.min(n,r):Math.max(r+n,0)}function $(e,n=0,r=e.length){var t=e.length;n=n>=0?Math.min(n,t):Math.max(t+n,0),r=r>=0?Math.min(r,t):Math.max(t+r,0);return[n,Math.max(n,r)]}function T(e,n=0,r=e.length){var[n,r]=$(e,n,r);return r-n}function F(e,n){return e[I(e,n)]}function D(e,n){return n.map((n=>F(e,n)))}function S(e,n){for(var r of n)e=A(e)?F(e,r):void 0;return e}function _(e,n,r){return q(e.slice(),n,r)}function q(e,n,r){return e[I(e,n)]=r,e}function N(e,n,r){n=I(e,n),r=I(e,r);var t=e[n];return e[n]=e[r],e[r]=t,e}function C(e,n,r){var t=e[n];return e[n]=e[r],e[r]=t,e}function k(e,n=null,r=null){n=n||y.COMPARE,r=r||y.IDENTITY;var t=e.length;if(t<=1)return-1;for(var i=r(e[0],0,e),u=1;u<t;++u){var a=r(e[u],u,e);if(n(i,a)>0)return u;i=a}return-1}function V(e,n=null,r=null,t=null){return W(e.slice(),n,r,t)}function W(e,n=null,r=null,t=null){n=n||y.COMPARE;if(!r&&!t)return e.sort(n);var i=e.length;return z(e,0,i,i,n,r=r||y.IDENTITY,t=t||C)}function w(e,n,r,t=null,i=null,u=null){t=t||y.COMPARE,i=i||y.IDENTITY,u=u||C;var[n,r]=$(e,n,r);return z(e,n,r,r-n,t,i,u)}function Y(e,n,r=null,t=null,i=null){return U(e,0,e.length,n,r,t,i)}function U(e,n,r,t,i=null,u=null,a=null){i=i||y.COMPARE,u=u||y.IDENTITY,a=a||C;var[n,r]=$(e,n,r);return z(e,n,r,t,i,u,a)}function z(e,n,r,t,i,u,a){return B(e,n,r,Math.floor(2*Math.log2(r-n)),16,t,i,u,a)}function B(e,n,r,t,i,u,a,o,c){if(u<=0||r-n<=1)return e;if(r-n<=i)return function(e,n,r,t,i,u,a){return a===C?function(e,n,r,t,i,u){for(var a=n+1;a<r;++a){for(var o=e[a],c=u(o,a,e),l=a-1;l>=n&&i(u(e[l],l,e),c)>0;--l)e[l+1]=e[l];e[l+1]=o}return e}(e,n,r,0,i,u):function(e,n,r,t,i,u,a){for(var o=n+1;o<r;++o)for(var c=u(e[o],o,e),l=o-1;l>=n&&i(u(e[l],l,e),c)>0;--l)a(e,l,l+1);return e}(e,n,r,0,i,u,a)}(e,n,r,0,a,o,c);if(t<=0)return function(e,n,r,t,i,u,a){!function(e,n,r,t,i,u){for(var a=r-Math.floor((r-n)/2);a<r;++a)G(e,n,r,a,t,i,u)}(e,n,r,i,u,a);for(var o=r-1;t>0&&n<r;++n,--t)a(e,n,o),G(e,n+1,r,o,i,u,a);return e}(e,n,r,u,a,o,c);var l=function(e,n,r,t,i,u,a){var o=u(e[t],t,e),c=n-1;a(e,t,r-1);for(var l=n;l<r-1;++l){i(u(e[l],l,e),o)>0||a(e,++c,l)}return a(e,++c,r-1),c}(e,n,r,l=n+Math.floor((r-n)*Math.random()),a,o,c);return B(e,n,l,t,i,Math.min(l-n,u),a,o,c),B(e,l+1,r,t,i,Math.min(r-l-1,u),a,o,c),e}function G(e,n,r,t,i,u,a){var o=t,c=2*t-r,l=c-1;c>=n&&i(u(e[c],c,e),u(e[o],o,e))<0&&(o=c),l>=n&&i(u(e[l],l,e),u(e[o],o,e))<0&&(o=l),o!==t&&(a(e,o,t),G(e,n,r,o,i,u,a))}function L(e,n,r,t,i,u,a){var o=t,c=2*t-n+1,l=c+1;c<r&&i(u(e[c],c,e),u(e[o],o,e))>0&&(o=c),l<r&&i(u(e[l],l,e),u(e[o],o,e))>0&&(o=l),o!==t&&(a(e,o,t),L(e,n,r,o,i,u,a))}function X(e,n=null,r=null){return e[Z(e,n,r)]}function H(e,n=null,r=null){var t=Z(e,n,r);return[t,e[t]]}function J(e,n=null,r=null){return e[ee(e,n,r)]}function K(e,n=null,r=null){var t=ee(e,n,r);return[t,e[t]]}function Q(e,n=null,r=null){n=n||y.COMPARE,r=r||y.IDENTITY;var t=e.length;if(0===t)return[[-1,void 0],[-1,void 0]];for(var i=0,u=s=e[0],a=h=r(s,0,e),o=0,c=s,l=h,f=1;f<t;++f){var s,h;n(h=r(s=e[f],f,e),a)<0&&(i=f,u=s,a=h),n(h,l)>0&&(o=f,c=s,l=h)}return[[i,u],[o,c]]}function Z(e,n=null,r=null){n=n||y.COMPARE,r=r||y.IDENTITY;var t=e.length;if(0===t)return-1;for(var i=0,u=r(e[0],0,e),a=1;a<t;++a){var o=r(e[a],a,e);n(o,u)<0&&(i=a,u=o)}return i}function ee(e,n=null,r=null){n=n||y.COMPARE,r=r||y.IDENTITY;var t=e.length;if(0===t)return-1;for(var i=0,u=r(e[0],0,e),a=1;a<t;++a){var o=r(e[a],a,e);n(o,u)>0&&(i=a,u=o)}return i}function ne(e,n,r=null,t=null){r=r||y.COMPARE,t=t||y.IDENTITY;var i=e.length,u=Math.min(n,i),a=P(0,u);!function(e,n,r,t,i,u){for(var a=n+Math.floor((r-n)/2)-1;a>=n;--a)L(e,n,r,a,t,i,u)}(a,0,u,r,(n=>t(e[n],n,e)),C);for(var o=t(e[a[0]],a[0],e),c=n;c<i;++c){var l=t(e[c],c,e);if(!(r(l,o)>=0)){a[0]=c,L(a,0,u,0,r,(n=>t(e[n],n,e)),C);o=t(e[a[0]],a[0],e)}}return a.sort(((n,i)=>r(t(e[n],n,e),t(e[i],i,e)))),a}function re(e,n,r=null,t=null){r=r||y.COMPARE;return ne(e,n,((e,n)=>-r(e,n)),t)}function te(e,n,r=null,t=null){r=r||y.COMPARE,t=t||y.IDENTITY;for(var i=e.length,u=n.length,a=0,o=Math.min(i,u);a<o;++a){var c=r(t(e[a],a,e),t(n[a],a,n));if(0!==c)return c}return Math.sign(i-u)}function ie(e,n){return e.length>0?e[0]:n}function ue(e,n){return e.length>0?e[e.length-1]:n}function ae(e,n,r=null,t=null){r=r||y.COMPARE;var i=(t=t||y.IDENTITY)(n,0,null),u=-1;for(var a of e){if(0===r(t(a,++u,e),i))return u}return-1}function oe(e,n=null,r=null){n=n||y.COMPARE,r=r||y.IDENTITY;var t=e.length;if(t<=1)return-1;for(var i=r(e[0],0,e),u=1;u<t;++u){var a=r(e[u],u,e);if(0===n(i,a))return u;i=a}return-1}function ce(e,n,r=null,t=null){r=r||y.COMPARE,t=t||y.IDENTITY;for(var i=e.length,u=n.length,a=0,o=Math.min(i,u);a<o;++a){if(0!==r(t(e[a],a,e),t(n[a],a,n)))return a}return i===u?-1:o}function le(e,n,r=null,t=null){var i=n.length;return 0===i||0===te(e.slice(0,i),n,r,t)}function fe(e,n,r=null,t=null){var i=n.length;return 0===i||0===te(e.slice(-i),n,r,t)}function se(e,n,r=null,t=null){return xe(e,n,r,t)>=0}function*he(e,n=-1){var r=e.length;if(!(n>r))if(n>=0)yield e.slice(0,n);else for(var t=0;t<=r;++t)yield e.slice(0,t)}function*me(e,n=-1){var r=e.length;if(!(n>r))if(n>=0)yield e.slice(e.length-n);else for(var t=0;t<=r;++t)yield e.slice(t)}function pe(e,n=-1){return n>=0?function*(e,n){var r=e.length;if(n>r)return;if(0===n)return void(yield[]);for(var t=0,i=r-n+1;t<i;++t)yield e.slice(t,t+n)}(e,n):function*(e){var n=e.length;yield[];for(var r=0;r<n;++r)for(var t=r+1;t<=n;++t)yield e.slice(r,t)}(e)}function*de(e,n=-1){var r=e.length;if(!(n>r))if(n!==r)if(0!==n&&0!==r){var t=e.slice(0,-1);for(var i of(yield*de(t,n),de(t,n-1)))i.push(e[r-1]),yield i}else yield[];else yield e}function*ge(e,n=-1){var r=e.length;if(!(n>r))for(var t=n<0?0:n,i=n<0?r:n;t<=i;++t)yield*be(e,t)}function*be(e,n){var r=e.length;if(0!==r&&0!==n)for(var t=0;t<r;++t){var i=Xe(e,t,1);for(var u of be(i,n-1))yield[e[t],...u]}else yield[]}function ve(e,n,r=null,t=null){r=r||y.COMPARE,t=t||y.IDENTITY;for(var i=e.length,u=n.length,a=0;a<=i-u;++a)if(ye(e,n,a,r,t))return a;return-1}function ye(e,n,r,t,i){for(var u=n.length,a=0;a<u;++a){if(0!==t(i(e[r+a],r+a,e),i(n[a],a,n)))return!1}return!0}function xe(e,n,r=null,t=null){r=r||y.COMPARE,t=t||y.IDENTITY;var i=[...n].map(t),u=i.length,a=-1,o=-1,c=0;for(var l of e){if(0===r(t(l,++o,e),i[c])&&(a<0&&(a=o),++c>=u))return a}return-1}function Pe(e,n=Math.random){return e[Math.floor(n()*e.length)]}function Oe(e,n=-1,r=Math.random){var t=e.length;if(n>t)return null;n=n>=0?n:Math.floor((t+1)*r());return e.slice(0,n)}function Me(e,n=-1,r=Math.random){var t=e.length;if(n>t)return null;n=n>=0?n:Math.floor((t+1)*r());return e.slice(t-n)}function Re(e,n=-1,r=Math.random){var t=e.length;if(n>t)return null;n=n>=0?n:function(e,n){var r=.5*e*(e+1)+1,t=.5*Math.sqrt(1+8*n*r)-.5;return e+1-Math.floor(t+1)}(t,r());var i=Math.floor((t+1-n)*r());return e.slice(i,i+n)}function Ee(e,n=-1,r=Math.random){return n>e.length?null:n>=0?function(e,n,r){var t=P(0,e.length);return Ae(t,n,r).sort(),D(e,t)}(e,n,r):function(e,n){var r=[];for(var t of e)n()<.5&&r.push(t);return r}(e,r)}function je(e,n=-1,r=Math.random){return n>e.length?null:Ae(e.slice(),n,r)}function Ae(e,n=-1,r=Math.random){var t=e.length;if(n>t)return e;n=n>=0?n:Math.floor((t+1)*r());for(var i=0;i<n;++i){var u=i+Math.floor((t-i)*r()),a=e[i];e[i]=e[u],e[u]=a}return e.length=n,e}function Ie(e,n=1){n=Math.max(n,0);return e.slice(0,n)}function $e(e,n=1){var r=e.length;n=Math.min(Math.max(n,0),r);return e.slice(r-n)}function Te(e,n){var r=-1;for(var t of e)if(!n(t,++r,e))return r;return++r}function Fe(e,n){for(var r=e.length-1;r>=0&&n(e[r],r,e);--r);return++r}function De(e,n){return e.findIndex(n)}function Se(e,n){for(var r=e.length-1;r>=0;--r)if(n(e[r],r,e))return r;return-1}function _e(e,n=null){return n?e.some(n):function(e){for(var n=0,r=e.length;n<r;++n)if(e[n])return!0;return!1}(e)}function qe(e,n=null){return n?e.every(n):function(e){for(var n=0,r=e.length;n<r;++n)if(!e[n])return!1;return!0}(e)}function Ne(e,n){return e.filter(n)}function Ce(e,n,r,t,i){var u=-1;for(var a of n){var o=t(a,++u,n);0!==r&&i(o,u,n)?Ce(e,a,r-1,t,i):e.push(o)}return e}function ke(e,n,r){for(var t=arguments.length<=2,i=[],u=0,a=e.length;u<a;++u)r=t?e[u]:n(r,e[u],u,e),i.push(r),t=!1;return i}function Ve(e,...n){return e.concat(n)}function We(e,...n){return e.push(...n),e}function we(e){return e.slice(0,-1)}function Ye(e){return e.slice(1)}function Ue(e){return e.shift(),e}function ze(e,...n){return Ke(n,e)}function Be(e,...n){return e.unshift(...n),e}function Ge(e,n,r=0,t=0,i=n.length){r=I(e,r);for(var[t,i]=$(n,t,i);t<i;++t,++r)e[r]=n[t];return e}function Le(e,n,r,t){return e.slice(0,n).concat(e.slice(r,t),e.slice(n,r),e.slice(t))}function Xe(e,n,r=e.length,...t){n=I(e,n),r=Math.max(r,0);return Ke(e.slice(0,n),t,e.slice(n+r))}function He(e,n=null){n=n||y.IDENTITY;var r=-1,t=new Map;for(var i of e){var u=n(i,++r,e);t.set(u,(t.get(u)||0)+1)}return t}function Je(e,n=null){n=n||y.IDENTITY;var r=-1,t=new Map;for(var i of e){var u=n(i,++r,e);t.has(u)||t.set(u,[]),t.get(u).push(i)}return t}function Ke(e,...n){for(var r of n)e.push(...r);return e}function Qe(e){return e.slice().reverse()}function Ze(e,n,r=null,t=null){return r?function(e,n,r=null,t=null){r=r||y.COMPARE,t=t||y.IDENTITY;var i=e.map(t),u=-1;e:for(var a of n){var o=t(a,++u,n);for(var c of i)if(0===r(c,o))continue e;e.push(a)}return e}(e,n,r,t):function(e,n,r=null){r=r||y.IDENTITY;var t=x(e,r),i=-1;for(var u of n){var a=r(u,++i,n);t.has(a)||e.push(u)}return e}(e,n,t)}function en(e,n,r=null,t=null){return r?function(e,n,r=null,t=null){r=r||y.COMPARE,t=t||y.IDENTITY;var i=[...n].map(t),u=-1,a=[];e:for(var o of e){var c=t(o,++u,e);for(var l of i)if(0===r(c,l))continue e;a.push(o)}return a}(e,n,r,t):function(e,n,r=null){r=r||y.IDENTITY;var t=x(n,r),i=-1,u=[];for(var a of e){var o=r(a,++i,e);t.has(o)||u.push(a)}return u}(e,n,t)}e.fromRange=n.fromRange=P,e.fromInvocation=n.fromInvocation=O,e.fromCall=n.fromCall=O,e.fromApplication=n.fromApplication=M,e.fromApply=n.fromApply=M,e.fromIterable=n.fromIterable=R,e.from=n.from=R,e.fromIterable$=n.fromIterable$=E,e.from$=n.from$=E,e.shallowClone=n.shallowClone=j,e.clone=n.clone=j,e.deepClone=n.deepClone=function(e){return structuredClone(e)},e.is=n.is=A,e.keys=n.keys=function(e){return[...e.keys()]},e.ikeys=n.ikeys=function(e){return e.keys()},e.values=n.values=function(e){return e.slice()},e.ivalues=n.ivalues=function(e){return e.values()},e.entries=n.entries=function(e){return[...e.entries()]},e.ientries=n.ientries=function(e){return e.entries()},e.index=n.index=I,e.indexRange=n.indexRange=$,e.isEmpty=n.isEmpty=function(e){return 0===e.length},e.length=n.length=T,e.size=n.size=T,e.resize$=n.resize$=function(e,n,r){var t=e.length;return e.length=n,n>t&&e.fill(r,t),e},e.clear$=n.clear$=function(e){return e.length=0,e},e.get=n.get=F,e.at=n.at=F,e.getAll=n.getAll=D,e.getPath=n.getPath=S,e.hasPath=n.hasPath=function(e,n){for(var r of n){if(!A(e))return!1;e=F(e,r)}return!0},e.set=n.set=_,e.with=n.with=_,e.set$=n.set$=q,e.setPath$=n.setPath$=function(e,n,r){var t=S(e,n.slice(0,-1));return A(t)&&q(t,ue(n),r),e},e.swap=n.swap=function(e,n,r){return N(e.slice(),n,r)},e.swap$=n.swap$=N,e.swapRanges=n.swapRanges=function(e,n,r,t,i){var[n,r]=$(e,n,r),[t,i]=$(e,t,i);return t<n&&([n,r,t,i]=[t,i,n,r]),t<r?e.slice():e.slice(0,n).concat(e.slice(t,i),e.slice(n,t),e.slice(r))},e.swapRanges$=n.swapRanges$=function(e,n,r,t,i){var[n,r]=$(e,n,r),[t,i]=$(e,t,i);if(t<n&&([n,r,t,i]=[t,i,n,r]),t<r)return e;var u=e.slice(n,r);return e.splice(n,r-n,...e.slice(t,i)),e.splice(t,i-t,...u),e},e.remove=n.remove=function(e,n){return n=I(e,n),e.slice(0,n).concat(e.slice(n+1))},e.remove$=n.remove$=function(e,n){return e.splice(n,1),e},e.removePath$=n.removePath$=function(e,n){var r=S(e,n.slice(0,-1));return A(r)&&r.splice(ue(n),1),e},e.isSorted=n.isSorted=function(e,n=null,r=null){return-1===k(e,n,r)},e.hasUnsortedValue=n.hasUnsortedValue=function(e,n=null,r=null){return k(e,n,r)>=0},e.searchUnsortedValue=n.searchUnsortedValue=k,e.sort=n.sort=V,e.toSorted=n.toSorted=V,e.sort$=n.sort$=W,e.rangedSort=n.rangedSort=function(e,n,r,t=null,i=null,u=null){return w(e.slice(),n,r,t,i,u)},e.rangedSort$=n.rangedSort$=w,e.partialSort=n.partialSort=function(e,n,r=null,t=null,i=null){return Y(e.slice(),n,r,t,i)},e.partialSort$=n.partialSort$=Y,e.rangedPartialSort=n.rangedPartialSort=function(e,n,r,t,i=null,u=null,a=null){return U(e.slice(),n,r,t,i,u,a)},e.rangedPartialSort$=n.rangedPartialSort$=U,e.minimum=n.minimum=X,e.min=n.min=X,e.minimumEntry=n.minimumEntry=H,e.minEntry=n.minEntry=H,e.maximum=n.maximum=J,e.max=n.max=J,e.maximumEntry=n.maximumEntry=K,e.maxEntry=n.maxEntry=K,e.range=n.range=function(e,n=null,r=null){var[t,i]=Q(e,n,r);return[t[1],i[1]]},e.rangeEntries=n.rangeEntries=Q,e.minimums=n.minimums=function(e,n,r=null,t=null){return ne(e,n,r,t).map((n=>e[n]))},e.minimumEntries=n.minimumEntries=function(e,n,r=null,t=null){return ne(e,n,r,t).map((n=>[n,e[n]]))},e.maximums=n.maximums=function(e,n,r=null,t=null){return re(e,n,r,t).map((n=>e[n]))},e.maximumEntries=n.maximumEntries=function(e,n,r=null,t=null){return re(e,n,r,t).map((n=>[n,e[n]]))},e.searchMinimumValue=n.searchMinimumValue=Z,e.searchMaximumValue=n.searchMaximumValue=ee,e.searchMinimumValues=n.searchMinimumValues=ne,e.searchMaximumValues=n.searchMaximumValues=re,e.isEqual=n.isEqual=function(e,n,r=null,t=null){return e.length===n.length&&0===te(e,n,r,t)},e.compare=n.compare=te,e.head=n.head=ie,e.front=n.front=ie,e.first=n.first=ie,e.tail=n.tail=function(e){return e.slice(1)},e.init=n.init=function(e){return e.slice(0,-1)},e.last=n.last=ue,e.back=n.back=ue,e.middle=n.middle=function(e,n,r=1){return n=I(e,n),r=Math.max(r,0),e.slice(n,n+r)},e.slice=n.slice=function(e,n=0,r=e.length){return e.slice(n,r)},e.slice$=n.slice$=function(e,n=0,r=e.length){return e.copyWithin(0,n,r),e.length=T(e,n,r),e},e.includes=n.includes=function(e,n,r=0){return e.includes(n,r)},e.hasValue=n.hasValue=function(e,n,r=null,t=null){return ae(e,n,r,t)>=0},e.searchValue=n.searchValue=ae,e.searchValueRight=n.searchValueRight=function(e,n,r=null,t=null){r=r||y.COMPARE;for(var i=(t=t||y.IDENTITY)(n,0,null),u=e.length-1;u>=0;--u){if(0===r(t(e[u],u,e),i))return u}return-1},e.searchValueAll=n.searchValueAll=function(e,n,r=null,t=null){r=r||y.COMPARE;var i=(t=t||y.IDENTITY)(n,0,null),u=-1,a=[];for(var o of e){0===r(t(o,++u,e),i)&&a.push(u)}return a},e.searchAdjacentDuplicateValue=n.searchAdjacentDuplicateValue=oe,e.searchAdjacentDuplicate=n.searchAdjacentDuplicate=oe,e.searchMismatchedValue=n.searchMismatchedValue=ce,e.searchMismatch=n.searchMismatch=ce,e.hasPrefix=n.hasPrefix=le,e.startsWith=n.startsWith=le,e.hasSuffix=n.hasSuffix=fe,e.endsWith=n.endsWith=fe,e.hasInfix=n.hasInfix=function(e,n,r=null,t=null){return ve(e,n,r,t)>=0},e.hasSubsequence=n.hasSubsequence=se,e.hasPermutation=n.hasPermutation=function(e,n,r=null,t=null){var i=t?e.map(t):e.slice(),u=t?n.map(t):n.slice();return se(i.sort(),u.sort(),r,t)},e.prefixes=n.prefixes=function(e,n=-1){return[...he(e,n)]},e.iprefixes=n.iprefixes=he,e.suffixes=n.suffixes=function(e,n=-1){return[...me(e,n)]},e.isuffixes=n.isuffixes=me,e.infixes=n.infixes=function(e,n=-1){return[...pe(e,n)]},e.iinfixes=n.iinfixes=pe,e.subsequences=n.subsequences=function(e,n=-1){return[...de(e,n)]},e.isubsequences=n.isubsequences=de,e.permutations=n.permutations=function(e,n=-1){return[...ge(e,n)]},e.ipermutations=n.ipermutations=ge,e.searchInfix=n.searchInfix=ve,e.searchInfixRight=n.searchInfixRight=function(e,n,r=null,t=null){r=r||y.COMPARE,t=t||y.IDENTITY;for(var i=e.length-n.length;i>=0;--i)if(ye(e,n,i,r,t))return i;return-1},e.searchInfixAll=n.searchInfixAll=function(e,n,r=null,t=null){r=r||y.COMPARE,t=t||y.IDENTITY;for(var i=e.length,u=n.length,a=[],o=0;o<=i-u;++o)ye(e,n,o,r,t)&&a.push(o);return a},e.searchSubsequence=n.searchSubsequence=xe,e.randomValue=n.randomValue=Pe,e.value=n.value=Pe,e.randomPrefix=n.randomPrefix=Oe,e.prefix=n.prefix=Oe,e.randomSuffix=n.randomSuffix=Me,e.suffix=n.suffix=Me,e.randomInfix=n.randomInfix=Re,e.infix=n.infix=Re,e.randomSubsequence=n.randomSubsequence=Ee,e.subsequence=n.subsequence=Ee,e.randomPermutation=n.randomPermutation=je,e.permutation=n.permutation=je,e.randomPermutation$=n.randomPermutation$=Ae,e.permutation$=n.permutation$=Ae,e.permute$=n.permute$=Ae,e.shuffle$=n.shuffle$=Ae,e.find=n.find=function(e,n){return e.find(n)},e.findRight=n.findRight=function(e,n){for(var r=e.length-1;r>=0;--r)if(n(e[r],r,e))return e[r]},e.take=n.take=Ie,e.left=n.left=Ie,e.takeRight=n.takeRight=$e,e.right=n.right=$e,e.takeWhile=n.takeWhile=function(e,n){return e.slice(0,Te(e,n))},e.takeWhileRight=n.takeWhileRight=function(e,n){return e.slice(Fe(e,n))},e.drop=n.drop=function(e,n=1){return n=Math.max(n,0),e.slice(n)},e.dropRight=n.dropRight=function(e,n=1){var r=e.length;return n=Math.min(Math.max(n,0),r),e.slice(0,r-n)},e.dropWhile=n.dropWhile=function(e,n){return e.slice(Te(e,n))},e.dropWhileRight=n.dropWhileRight=function(e,n){return e.slice(0,Fe(e,n))},e.scanWhile=n.scanWhile=Te,e.scanWhileRight=n.scanWhileRight=Fe,e.scanUntil=n.scanUntil=function(e,n){var r=-1;for(var t of e)if(n(t,++r,e))return r;return++r},e.scanUntilRight=n.scanUntilRight=function(e,n){for(var r=e.length-1;r>=0&&!n(e[r],r,e);--r);return++r},e.indexOf=n.indexOf=function(e,n,r=0){return e.indexOf(n,r)},e.lastIndexOf=n.lastIndexOf=function(e,n,r=e.length-1){return e.lastIndexOf(n,r)},e.search=n.search=De,e.findIndex=n.findIndex=De,e.searchRight=n.searchRight=Se,e.findLastIndex=n.findLastIndex=Se,e.searchAll=n.searchAll=function(e,n){var r=-1,t=[];for(var i of e)n(i,++r,e)&&t.push(r);return t},e.forEach=n.forEach=function(e,n){e.forEach(n)},e.some=n.some=_e,e.anyOf=n.anyOf=_e,e.every=n.every=qe,e.allOf=n.allOf=qe,e.map=n.map=function(e,n){return e.map(n)},e.map$=n.map$=function(e,n){for(var r=0,t=e.length;r<t;++r)e[r]=n(e[r],r,e);return e},e.reduce=n.reduce=function(e,n,r){return arguments.length<=2?e.reduce(n):e.reduce(n,r)},e.reduceRight=n.reduceRight=function(e,n,r){for(var t=arguments.length<=2,i=e.length-1;i>=0;--i)t?(r=e[i],t=!1):r=n(r,e[i],i,e);return r},e.filter=n.filter=Ne,e.findAll=n.findAll=Ne,e.filter$=n.filter$=function(e,n){for(var r=0,t=0,i=e.length;r<i;++r)n(e[r],r,e)&&(e[t++]=e[r]);return e.length=t,e},e.filterAt=n.filterAt=function(e,n){var r=e.length,t=[];for(var i of n)i>=0&&i<r&&t.push(e[i]);return t},e.reject=n.reject=function(e,n){var r=-1,t=[];for(var i of e)n(i,++r,e)||t.push(i);return t},e.reject$=n.reject$=function(e,n){for(var r=0,t=0,i=e.length;r<i;++r)n(e[r],r,e)||(e[t++]=e[r]);return e.length=t,e},e.rejectAt=n.rejectAt=function(e,n){var r=-1,t=[];for(var i of e)n.includes(++r)||t.push(i);return t},e.flat=n.flat=function(e,n=-1,r=null,t=null){return Ce([],e,n,r=r||y.IDENTITY,t=t||A)},e.flatMap=n.flatMap=function(e,n=null,r=null){n=n||y.IDENTITY,r=r||A;var t=-1,i=[];for(var u of e){var a=n(u,++t,e);r(a,t,e)?Ke(i,a):i.push(a)}return i},e.exclusiveScan=n.exclusiveScan=function(e,n,r){for(var t=[],i=0,u=e.length;i<u;++i)t.push(r),r=n(r,e[i],i,e);return t},e.exclusiveScan$=n.exclusiveScan$=function(e,n,r){for(var t=0,i=e.length;t<i;++t){var u=e[t];e[t]=r,r=n(r,u,t,e)}return e},e.inclusiveScan=n.inclusiveScan=ke,e.accumulate=n.accumulate=ke,e.inclusiveScan$=n.inclusiveScan$=function(e,n,r){for(var t=0,i=e.length;t<i;++t)r=e[t]=n(r,e[t],t,e);return e},e.adjacentCombine=n.adjacentCombine=function(e,n,r){var t=[];e.length>0&&t.push(n