varbigintCryptoUtils=function(exports){"use strict";const_ZERO=BigInt(0),_ONE=BigInt(1),_TWO=BigInt(2);functionabs(a){return(a=BigInt(a))>=_ZERO?a:-a}functionbitLength(a){if((a=BigInt(a))===_ONE)return1;letbits=1;do{bits++}while((a>>=_ONE)>_ONE);returnbits}functioneGcd(a,b){if(a=BigInt(a),b=BigInt(b),a<=_ZERO|b<=_ZERO)returnNaN;letx=_ZERO,y=_ONE,u=_ONE,v=_ZERO;for(;a!==_ZERO;){letq=b/a,r=b%a,m=x-u*q,n=y-v*q;b=a,a=r,x=u,y=v,u=m,v=n}return{b:b,x:x,y:y}}functiongcd(a,b){if(a=abs(a),b=abs(b),a===_ZERO)returnb;if(b===_ZERO)returna;letshift=_ZERO;for(;!((a|b)&_ONE);)a>>=_ONE,b>>=_ONE,shift++;for(;!(a&_ONE);)a>>=_ONE;do{for(;!(b&_ONE);)b>>=_ONE;if(a>b){letx=a;a=b,b=x}b-=a}while(b);returna<<shift}asyncfunctionisProbablyPrime(w,iterations=16){return"number"==typeofw&&(w=BigInt(w)),newPromise((resolve,reject)=>{constworker=newWorker(_isProbablyPrimeWorkerUrl());worker.onmessage=event=>{worker.terminate(),resolve(event.data.isPrime)},worker.onmessageerror=event=>{reject(event)},worker.postMessage({rnd:w,iterations:iterations,id:0})})}functionmodInv(a,n){if(a==_ZERO|n<=_ZERO)returnNaN;letegcd=eGcd(toZn(a,n),n);returnegcd.b!==_ONE?NaN:toZn(egcd.x,n)}functionmodPow(b,e,n){if((n=BigInt(n))===_ZERO)returnNaN;if(n===_ONE)return_ZERO;if(b=toZn(b,n),(e=BigInt(e))<_ZERO)returnmodInv(modPow(b,abs(e),n),n);letr=_ONE;for(;e>0;)e%_TWO===_ONE&&(r=r*b%n),e/=_TWO,b=b**_TWO%n;returnr}functionrandBetween(max,min=_ONE){if(max<=min)thrownewError("max must be > min");constinterval=max-min;letrnd,bitLen=bitLength(interval);do{rnd=fromBuffer(randBits(bitLen))}while(rnd>interval);returnrnd+min}functionrandBits(bitLength,forceLength=!1){if(bitLength<1)thrownewRangeError(`bitLength MUST be > 0 and it is ${bitLength}`);constrndBytes=randBytesSync(Math.ceil(bitLength/8),!1),bitLengthMod8=bitLength%8;if(bitLengthMod8&&(rndBytes[0]=rndBytes[0]&2**bitLengthMod8-1),forceLength){constmask=bitLengthMod8?2**(bitLengthMod8-1):128;rndBytes[0]=rndBytes[0]|mask}returnrndBytes}functionrandBytesSync(byteLength,forceLength=!1){if(byteLength<1)thrownewRangeError(`byteLength MUST be > 0 and it is ${byteLength}`);letbuf;returnbuf=newUint8Array(byteLength),self.crypto.getRandomValues(buf),forceLength&&(buf[0]=128|buf[0]),buf}functiontoZn(a,n){return(n=BigInt(n))<=0?NaN:(a=BigInt(a)%n)<0?a+n:a}functionfromBuffer(buf){letret=_ZERO;for(letiofbuf.values()){letbi=BigInt(i);ret=(ret<<BigInt(8))+bi}returnret}function_isProbablyPrimeWorkerUrl(){letworkerCode=`'use strict';const _ZERO = BigInt(0);const _ONE = BigInt(1);const _TWO = BigInt(2);const eGcd = ${eGcd.toString()};const modInv = ${modInv.toString()};const modPow = ${modPow.toString()};const toZn = ${toZn.toString()};const randBits = ${randBits.toString()};const randBytesSync = ${randBytesSync.toString()};const randBetween = ${randBetween.toString()};const isProbablyPrime = ${_isProbablyPrime.toString()};${bitLength.toString()}${fromBuffer.toString()}`;returnworkerCode+=`onmessage = ${asyncfunction(event){constisPrime=awaitisProbablyPrime(event.data.rnd,event.data.iterations);postMessage({isPrime:isPrime,value:event.data.rnd,id:event.data.id})}.toString()};`,function(workerCode){workerCode=`(() => {${workerCode}})()`;const_blob=newBlob([workerCode],{type:"text/javascript"});returnwindow.URL.createObjectURL(_blob)}(workerCode)}function_isProbablyPrime(w,iterations=16){if(w===_TWO)return!0;if((w&_ONE)===_ZERO||w===_ONE)return!1;constfirstPrimes=[3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,9