1;!function(){try { var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&((e._debugIds|| (e._debugIds={}))[n]="27267a57-8d3e-5b52-b099-b50974edbffa")}catch(e){}}(); 2(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,178120,e=>{"use strict";let t=BigInt(0),r=BigInt(1);function n(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function i(e){if(!n(e))throw Error("Uint8Array expected")}function o(e){if("string"!=typeof e)throw Error("hex string expected, got "+typeof e);return""===e?t:BigInt("0x"+e)}let f="function"==typeof Uint8Array.from([]).toHex&&"function"==typeof Uint8Array.fromHex,a=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function l(e){if(i(e),f)return e.toHex();let t="";for(let r=0;r<e.length;r++)t+=a[e[r]];return t}function s(e){return e>=48&&e<=57?e-48:e>=65&&e<=70?e-55:e>=97&&e<=102?e-87:void 0}function u(e){if("string"!=typeof e)throw Error("hex string expected, got "+typeof e);if(f)return Uint8Array.fromHex(e);let t=e.length,r=t/2;if(t%2)throw Error("hex string expected, got unpadded hex of length "+t);let n=new Uint8Array(r);for(let t=0,i=0;t<r;t++,i+=2){let r=s(e.charCodeAt(i)),o=s(e.charCodeAt(i+1));if(void 0===r||void 0===o)throw Error('hex string expected, got non-hex character "'+(e[i]+e[i+1])+'" at index '+i);n[t]=16*r+o}return n}function d(e,t){return u(e.toString(16).padStart(2*t,"0"))}function c(...e){let t=0;for(let r=0;r<e.length;r++){let n=e[r];i(n),t+=n.length}let r=new Uint8Array(t);for(let t=0,n=0;t<e.length;t++){let i=e[t];r.set(i,n),n+=i.length}return r}let h=e=>"bigint"==typeof e&&t<=e;function m(e,t,r){return h(e)&&h(t)&&h(r)&&t<=e&&e<r}let g=e=>new Uint8Array(e),y={bigint:e=>"bigint"==typeof e,function:e=>"function"==typeof e,boolean:e=>"boolean"==typeof e,string:e=>"string"==typeof e,stringOrUint8Array:e=>"string"==typeof e||n(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>"function"==typeof e&&Number.isSafeInteger(e.outputLen)};e.s(["aInRange",0,function(e,t,r,n){if(!m(t,r,n))throw Error("expected valid "+e+": "+r+" <= n < "+n+", got "+t)},"abool",0,function(e,t){if("boolean"!=typeof t)throw Error(e+" boolean expected, got "+t)},"abytes",0,i,"bitLen",0,function(e){let n;for(n=0;e>t;e>>=r,n+=1);return n},"bitMask",0,e=>(r<<BigInt(e))-r,"bytesToHex",0,l,"bytesToNumberBE",0,function(e){return o(l(e))},"bytesToNumberLE",0,function(e){return i(e),o(l(Uint8Array.from(e).reverse()))},"concatBytes",0,c,"createHmacDrbg",0,function(e,t,r){if("number"!=typeof e||e<2)throw Error("hashLen must be a number");if("number"!=typeof t||t<2)throw Error("qByteLen must be a number");if("function"!=typeof r)throw Error("hmacFn must be a function");let n=g(e),i=g(e),o=0,f=()=>{n.fill(1),i.fill(0),o=0},a=(...e)=>r(i,n,...e),l=(e=g(0))=>{let t;if(i=a((t=[0],Uint8Array.from(t)),e),n=a(),0!==e.length){let t;i=a((t=[1],Uint8Array.from(t)),e),n=a()}},s=()=>
2{if(o++>=1e3)throw Error("drbg: tried 1000 values");let e=0,r=[];for(;e<t;){let t=(n=a()).slice();r.push(t),e+=n.length}return c(...r)};return(e,t)=>{let r;for(f(),l(e);!(r=t(s()));)l();return f(),r}},"ensureBytes",0,function(e,t,r){let i;if("string"==typeof t)try{i=u(t)}catch(t){throw Error(e+" must be hex string or Uint8Array, cause: "+t)}else if(n(t))i=Uint8Array.from(t);else throw Error(e+" must be hex string or Uint8Array");let o=i.length;if("number"==typeof r&&o!==r)throw Error(e+" of length "+r+" expected, got "+o);return i},"equalBytes",0,function(e,t){if(e.length!==t.length)return!1;let r=0;for(let n=0;n<e.length;n++)r|=e[n]^t[n];return 0===r},"hexToBytes",0,u,"inRange",0,m,"isBytes",0,n,"memoized",0,function(e){let t=new WeakMap;return(r,...n)=>{let i=t.get(r);if(void 0!==i)return i;let o=e(r,...n);return t.set(r,o),o}},"numberToBytesBE",0,d,"numberToBytesLE",0,function(e,t){return d(e,t).reverse()},"numberToHexUnpadded",0,function(e){let t=e.toString(16);return 1&t.length?"0"+t:t},"utf8ToBytes",0,function(e){if("string"!=typeof e)throw Error("string expected");return new Uint8Array(new TextEncoder().encode(e))},"validateObject",0,function(e,t,r={}){let n=(t,r,n)=>{let i=y[r];if("function"!=typeof i)throw Error("invalid validator function");let o=e[t];if((!n||void 0!==o)&&!i(o,e))throw Error("param "+String(t)+" is invalid. Expected "+r+", got "+o)};for(let[e,r]of Object.entries(t))n(e,r,!1);for(let[e,t]of Object.entries(r))n(e,t,!0);return e}])},978629,698367,240718,554031,22815,e=>{"use strict";var t=e.i(44314),r=e.i(470525),n=e.i(140965),i=e.i(178120);let o=BigInt(0),f=BigInt(1),a=BigInt(2),l=BigInt(3),s=BigInt(4),u=BigInt(5),d=BigInt(8);function c(e,t){let r=e%t;return r>=o?r:t+r}function h(e,t,r){let n=e;for(;t-- >o;)n*=n,n%=r;return n}function m(e,t){if(e===o)throw Error("invert: expected non-zero number");if(t<=o)throw Error("invert: expected positive modulus, got "+t);let r=c(e,t),n=t,i=o,a=f,l=f,s=o;for(;r!==o;){let e=n/r,t=n%r,o=i-l*e,f=a-s*e;n=r,r=t,i=l,a=s,l=o,s=f}if(n!==f)throw Error("invert: does not exist");return c(i,t)}function g(e,t){let r=(e.ORDER+f)/s,n=e.pow(t,r);if(!e.eql(e.sqr(n),t))throw Error("Cannot find square root");return n}function y(e,t){let r=(e.ORDER-u)/d,n=e.mul(t,a),i=e.pow(n,r),o=e.mul(t,i),f=e.mul(e.mul(o,a),i),l=e.mul(o,e.sub(f,e.ONE));if(!e.eql(e.sqr(l),t))throw Error("Cannot find square root");return l}let p=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function b(e){let t=p.reduce((e,t)=>(e[t]="function",e),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"});return(0,i.validateObject)(e,t)}function w(e,t,r=!1){let n=Array(t.length).fill(r?e.ZERO:void 0),i=t.reduce((t,r,i)=>e.is0(r)?t:(n[i]=t,e.mul(t,r)),e.ONE),o=e.inv(i);return t.reduceRight((t,r,i)=>e.is0(r)?t:(n[i]=e.mul(t,n[i]),e.mul(t,r)),o),n}function E(e,t){let r=(e.ORDER-f)/a,n=e.pow(t,r),i=e.eql(n,e.ONE),o=e.eql(n,e.ZERO),l=e.eql(n,e.neg(e.ONE));if(!i&&!o&&!l)throw Error("invalid Legendre symbol result");return i?1:o?0:-1}function B(e,t){void 0!==t&&(0,r.anumber)(t);let n=void 0!==t?t:e.toString(2).length,i=Math.ceil(n/8);return{nBitLength:n,nByteLength:i}}function v(e,t,r=!1,n={}){let h;if(e<=o)throw Error("invalid field: expected ORDER > 0, got "+e);let{nBitLength:p,nByteLength:b}=B(e,t);if(b>2048)throw Error("invalid field: expected ORDER of <= 2048 bytes");let x=Object.freeze({ORDER:e,isLE:r,BITS:p,BYTES:b,MASK:(0,i.bitMask)(p),ZERO:o,ONE:f,create:t=>c(t,e),isValid:t=>{if("bigint"!=typeof t)throw Error("invalid field element: expected bigint, got "+typeof t);return o<=t&&t<e},is0:e=>e===o,isOdd:e=>(e&f)===f,neg:t=>c(-t,e),eql:(e,t)=>e===t,sqr:t=>c(t*t,e),add:(t,r)=>c(t+r,e),sub:(t,r)=>c(t-r,e),mul:(t,r)=>c(t*r,e),pow:(e,t)=>(function(e,t,r){if(r<o)throw Error("invalid exponent, negatives unsupported");if(r===o)return e.ONE;if(r===f)return t;let n=e.ONE,i=t;for(;r>o;)r&f&&(n=e.mul(n,i)),i=e.sqr(i),r>>=f;return n})(x,e,t),div:(t,r)=>c(t*m(r,e),e),sqrN:e=>e*e,addN:(e,t)=>e+t,subN:(e,t)=>e-t,mulN:(e,t)=>e*t,inv:t=>m(t,e),sqrt:n.sqrt||(t=>(h||(h=e%s===l?g:e%d===u?y:function(e){if(e<BigInt(3))throw Error("sqrt is not defined for small field");let t=e-f,r=0;for(;t%a===o;)t/=a,r++;let n=a,i=v(e);for(;1===E(i,n);)if(n++>1e3)throw Error("Cannot find square root: probably non-prime P");if(1===r)return g;let l=i.pow(n,t),s=(t+f)/a;return function(e,n){if(e.is0(n))return n;if(1!==E(e,n))throw Error("Cannot find square root");let i=r,o=e.mul(e.ONE,l),a=e.pow(n,t),u=e.pow(n,s);for(;!e.eql(a,e.ONE);){if(e.is0(a))return e.ZERO;let t=1,r=e.sqr(a);for(;!e.eql(r,e.ONE);)if(t++,r=e.sqr(r),t===i)throw Error("Cannot find square root");let n=f<<BigInt(i-t-1),l=e.pow(o,n);i=t,o=e.sqr(l),a=e.mul(a,o),u=e.mul(u,l)}return u}}(e)),h(x,t))),toBytes:e=>r?(0,i.numberToBytesLE)(e,b):(0,i.numberToBytesBE)(e,b),fromBytes:e=>{if(e.length!==b)throw Error("Field.fromBytes: expected "+b+" bytes, got "+e.length);return r?(0,i.bytesToNumberLE)(e):(0,i.bytesToNumberBE)(e)},invertBatch:e=>w(x,e),cmov:(e,t,r)=>r?t:e});return Object.freeze(x)}function x(e){if("bigint"!=typeof e)throw Error("field order must be bigint");return Math.ceil(e.toString(2).length/8)}function S(e){let t=x(e);return t+Math.ceil(t/2)}function A(e,t,r=!1){let n=e.length,o=x(t),a=S(t);if(n<16||n<a||n>1024)throw Error("expected "+a+"-1024 bytes of input, got "+n);let l=c(r?(0,i.bytesToNumberLE)(e):(0,i.bytesToNumberBE)(e),t-f)+f;return r?(0,i.numberToBytesLE)(l,o):(0,i.numberToBytesBE)(l,o)}e.s(["Field",0,v,"FpInvertBatch",0,w,"getMinHashLength",0,S,"invert",0,m,"mapHashToField",0,A,"mod",0,c,"nLength",0,B,"pow2",0,h,"validateField",0,b],698367);let O=BigInt(0),R=BigInt(1);function I(e,t){let r=t.negate();return e?r:t}function T(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw Error("invalid window size, expected [1.."+t+"], got W="+e)}function N(e,t){T(e,t);let r=Math.ceil(t/e)+1,n=2**(e-1),o=2**e;return{windows:r,windowSize:n,mask:(0,i.bitMask)(e),maxNumber:o,shiftBy:BigInt(e)}}function q(e,t,r){let{windowSize:n,mask:i,maxNumber:o,shiftBy:f}=r,a=Number(e&i),l=e>>f;a>n&&(a-=o,l+=R);let s=t*n,u=s+Math.abs(a)-1,d=0===a;return{nextN:l,offset:u,isZero:d,isNeg:a<0,isNegF:t%2!=0,offsetF:s}}let U=new WeakMap,Z=new WeakMap;function H(e){return Z.get(e)||1}function P(e){return b(e.Fp),(0,i.validateObject)(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...B(e.n,e.nBitLength),...e,...{p:e.Fp.ORDER}})}function z(e){void 0!==e.lowS&&(0,i.abool)("lowS",e.lowS),void 0!==e.prehash&&(0,i.abool)("prehash",e.prehash)}
2let C={Err:class extends Error{constructor(e=""){super(e)}},_tlv:{encode:(e,t)=>{let{Err:r}=C;if(e<0||e>256)throw new r("tlv.encode: wrong tag");if(1&t.length)throw new r("tlv.encode: unpadded data");let n=t.length/2,o=(0,i.numberToHexUnpadded)(n);if(o.length/2&128)throw new r("tlv.encode: long form length too big");let f=n>127?(0,i.numberToHexUnpadded)(o.length/2|128):"";return(0,i.numberToHexUnpadded)(e)+f+o+t},decode(e,t){let{Err:r}=C,n=0;if(e<0||e>256)throw new r("tlv.encode: wrong tag");if(t.length<2||t[n++]!==e)throw new r("tlv.decode: wrong tlv");let i=t[n++],o=0;if(128&i){let e=127&i;if(!e)throw new r("tlv.decode(long): indefinite length not supported");if(e>4)throw new r("tlv.decode(long): byte length is too big");let f=t.subarray(n,n+e);if(f.length!==e)throw new r("tlv.decode: length bytes not complete");if(0===f[0])throw new r("tlv.decode(long): zero leftmost byte");for(let e of f)o=o<<8|e;if(n+=e,o<128)throw new r("tlv.decode(long): not minimal encoding")}else o=i;let f=t.subarray(n,n+o);if(f.length!==o)throw new r("tlv.decode: wrong value length");return{v:f,l:t.subarray(n+o)}}},_int:{encode(e){let{Err:t}=C;if(e<F)throw new t("integer: negative integers are not allowed");let r=(0,i.numberToHexUnpadded)(e);if(8&Number.parseInt(r[0],16)&&(r="00"+r),1&r.length)throw new t("unexpected DER parsing assertion: unpadded hex");return r},decode(e){let{Err:t}=C;if(128&e[0])throw new t("invalid signature integer: negative");if(0===e[0]&&!(128&e[1]))throw new t("invalid signature integer: unnecessary leading zero");return(0,i.bytesToNumberBE)(e)}},toSig(e){let{Err:t,_int:r,_tlv:n}=C,o=(0,i.ensureBytes)("signature",e),{v:f,l:a}=n.decode(48,o);if(a.length)throw new t("invalid signature: left bytes after parsing");let{v:l,l:s}=n.decode(2,f),{v:u,l:d}=n.decode(2,s);if(d.length)throw new t("invalid signature: left bytes after parsing");return{r:r.decode(l),s:r.decode(u)}},hexFromSig(e){let{_tlv:t,_int:r}=C,n=t.encode(2,r.encode(e.r)),i=t.encode(2,r.encode(e.s));return t.encode(48,n+i)}};function D(e,t){return(0,i.bytesToHex)((0,i.numberToBytesBE)(e,t))}let F=BigInt(0),L=BigInt(1),V=BigInt(2),j=BigInt(3),k=BigInt(4);function _(e){let t,r=(t=P(e),(0,i.validateObject)(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})),{Fp:n,n:o,nByteLength:f,nBitLength:a}=r,l=n.BYTES+1,s=2*n.BYTES+1;function u(e){return c(e,o)}let{ProjectivePoint:d,normPrivateKeyToScalar:h,weierstrassEquation:g,isWithinCurveOrder:y}=function(e){var t;let r=function(e){let t=P(e);(0,i.validateObject)(t,{a:"field",b:"field"},{allowInfinityPoint:"boolean",allowedPrivateKeyLengths:"array",clearCofactor:"function",fromBytes:"function",isTorsionFree:"function",toBytes:"function",wrapPrivateKey:"boolean"});let{endo:r,Fp:n,a:o}=t;if(r){if(!n.eql(o,n.ZERO))throw Error("invalid endo: CURVE.a must be 0");if("object"!=typeof r||"bigint"!=typeof r.beta||"function"!=typeof r.splitScalar)throw Error('invalid endo: expected "beta": bigint and "splitScalar": function')}return Object.freeze({...t})}(e),{Fp:n}=r,o=v(r.n,r.nBitLength),f=r.toBytes||((e,t,r)=>{let o=t.toAffine();return(0,i.concatBytes)(Uint8Array.from([4]),n.toBytes(o.x),n.toBytes(o.y))}),a=r.fromBytes||(e=>{let t=e.subarray(1);return{x:n.fromBytes(t.subarray(0,n.BYTES)),y:n.fromBytes(t.subarray(n.BYTES,2*n.BYTES))}});function l(e){let{a:t,b:i}=r,o=n.sqr(e),f=n.mul(o,e);return n.add(n.add(f,n.mul(e,t)),i)}function s(e,t){let r=n.sqr(t),i=l(e);return n.eql(r,i)}if(!s(r.Gx,r.Gy))throw Error("bad curve params: generator point");let u=n.mul(n.pow(r.a,j),k),d=n.mul(n.sqr(r.b),BigInt(27));if(n.is0(n.add(u,d)))throw Error("bad curve params: a or b");function h(e){let t,{allowedPrivateKeyLengths:n,nByteLength:o,wrapPrivateKey:f,n:a}=r;if(n&&"bigint"!=typeof e){if((0,i.isBytes)(e)&&(e=(0,i.bytesToHex)(e)),"string"!=typeof e||!n.includes(e.length))throw Error("invalid private key");e=e.padStart(2*o,"0")}try{t="bigint"==typeof e?e:(0,i.bytesToNumberBE)((0,i.ensureBytes)("private key",e,o))}catch(t){throw Error("invalid private key, expected hex or "+o+" bytes, got "+typeof e)}return f&&(t=c(t,a)),(0,i.aInRange)("private key",t,L,a),t}function m(e){if(!(e instanceof p))throw Error("ProjectivePoint expected")}let g=(0,i.memoized)((e,t)=>{let{px:r,py:i,pz:o}=e;if(n.eql(o,n.ONE))return{x:r,y:i};let f=e.is0();null==t&&(t=f?n.ONE:n.inv(o));let a=n.mul(r,t),l=n.mul(i,t),s=n.mul(o,t);if(f)return{x:n.ZERO,y:n.ZERO};
vendor: 4,161 bytes, line 2
2if(!n.eql(s,n.ONE))throw Error("invZ was invalid");return{x:a,y:l}}),y=(0,i.memoized)(e=>{if(e.is0()){if(r.allowInfinityPoint&&!n.is0(e.py))return;throw Error("bad point: ZERO")}let{x:t,y:i}=e.toAffine();if(!n.isValid(t)||!n.isValid(i))throw Error("bad point: x or y not FE");if(!s(t,i))throw Error("bad point: equation left != right");if(!e.isTorsionFree())throw Error("bad point: not in prime-order subgroup");return!0});class p{constructor(e,t,r){if(null==e||!n.isValid(e))throw Error("x required");if(null==t||!n.isValid(t)||n.is0(t))throw Error("y required");if(null==r||!n.isValid(r))throw Error("z required");this.px=e,this.py=t,this.pz=r,Object.freeze(this)}static fromAffine(e){let{x:t,y:r}=e||{};if(!e||!n.isValid(t)||!n.isValid(r))throw Error("invalid affine point");if(e instanceof p)throw Error("projective point not allowed");let i=e=>n.eql(e,n.ZERO);return i(t)&&i(r)?p.ZERO:new p(t,r,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(e){let t=w(n,e.map(e=>e.pz));return e.map((e,r)=>e.toAffine(t[r])).map(p.fromAffine)}static fromHex(e){let t=p.fromAffine(a((0,i.ensureBytes)("pointHex",e)));return t.assertValidity(),t}static fromPrivateKey(e){return p.BASE.multiply(h(e))}static msm(e,t){return function(e,t,r,n){if(!Array.isArray(r))throw Error("array expected");r.forEach((t,r)=>{if(!(t instanceof e))throw Error("invalid point at index "+r)});if(!Array.isArray(n))throw Error("array of scalars expected");n.forEach((e,r)=>{if(!t.isValid(e))throw Error("invalid scalar at index "+r)});let o=r.length,f=n.length;if(o!==f)throw Error("arrays of points and scalars must have equal length");let a=e.ZERO,l=(0,i.bitLen)(BigInt(o)),s=1;l>12?s=l-3:l>4?s=l-2:l>0&&(s=2);let u=(0,i.bitMask)(s),d=Array(Number(u)+1).fill(a),c=Math.floor((t.BITS-1)/s)*s,h=a;for(let e=c;e>=0;e-=s){d.fill(a);for(let t=0;t<f;t++){let i=Number(n[t]>>BigInt(e)&u);d[i]=d[i].add(r[t])}let t=a;for(let e=d.length-1,r=a;e>0;e--)r=r.add(d[e]),t=t.add(r);if(h=h.add(t),0!==e)for(let e=0;e<s;e++)h=h.double()}return h}(p,o,e,t)}_setWindowSize(e){B.setWindowSize(this,e)}assertValidity(){y(this)}hasEvenY(){let{y:e}=this.toAffine();if(n.isOdd)return!n.isOdd(e);throw Error("Field doesn't support isOdd")}equals(e){m(e);let{px:t,py:r,pz:i}=this,{px:o,py:f,pz:a}=e,l=n.eql(n.mul(t,a),n.mul(o,i)),s=n.eql(n.mul(r,a),n.mul(f,i));return l&&s}negate(){return new p(this.px,n.neg(this.py),this.pz)}double(){let{a:e,b:t}=r,i=n.mul(t,j),{px:o,py:f,pz:a}=this,l=n.ZERO,s=n.ZERO,u=n.ZERO,d=n.mul(o,o),c=n.mul(f,f),h=n.mul(a,a),m=n.mul(o,f);return m=n.add(m,m),u=n.mul(o,a),u=n.add(u,u),l=n.mul(e,u),s=n.mul(i,h),s=n.add(l,s),l=n.sub(c,s),s=n.add(c,s),s=n.mul(l,s),l=n.mul(m,l),u=n.mul(i,u),h=n.mul(e,h),m=n.sub(d,h),m=n.mul(e,m),m=n.add(m,u),u=n.add(d,d),d=n.add(u,d),d=n.add(d,h),d=n.mul(d,m),s=n.add(s,d),h=n.mul(f,a),h=n.add(h,h),d=n.mul(h,m),l=n.sub(l,d),u=n.mul(h,c),u=n.add(u,u),new p(l,s,u=n.add(u,u))}add(e){m(e);let{px:t,py:i,pz:o}=this,{px:f,py:a,pz:l}=e,s=n.ZERO,u=n.ZERO,d=n.ZERO,c=r.a,h=n.mul(r.b,j),g=n.mul(t,f),y=n.mul(i,a),b=n.mul(o,l),w=n.add(t,i),E=n.add(f,a);w=n.mul(w,E),E=n.add(g,y),w=n.sub(w,E),E=n.add(t,o);let B=n.add(f,l);return E=n.mul(E,B),B=n.add(g,b),E=n.sub(E,B),B=n.add(i,o),s=n.add(a,l),B=n.mul(B,s),s=n.add(y,b),B=n.sub(B,s),d=n.mul(c,E),s=n.mul(h,b),d=n.add(s,d),s=n.sub(y,d),d=n.add(y,d),u=n.mul(s,d),y=n.add(g,g),y=n.add(y,g),b=n.mul(c,b),E=n.mul(h,E),y=n.add(y,b),b=n.sub(g,b),b=n.mul(c,b),E=n.add(E,b),g=n.mul(y,E),u=n.add(u,g),g=n.mul(B,E),s=n.mul(w,s),s=n.sub(s,g),g=n.mul(w,y),d=n.mul(B,d),new p(s,u,d=n.add(d,g))}subtract(e){return this.add(e.negate())}is0(){return this.equals(p.ZERO)}wNAF(e){return B.wNAFCached(this,e,p.normalizeZ)}multiplyUnsafe(e){let{endo:t,n:o}=r;(0,i.aInRange)("scalar",e,F,o);let f=p.ZERO;if(e===F)return f;if(this.is0()||e===L)return this;if(!t||B.hasPrecomputes(this))return B.wNAFCachedUnsafe(this,e,p.normalizeZ);let{k1neg:a,k1:l,k2neg:s,k2:u}=t.splitScalar(e),d=f,c=f,h=this;for(;l>F||u>F;)l&L&&(d=d.add(h)),u&L&&(c=c.add(h)),h=h.double(),l>>=L,u>>=L;return a&&(d=d.negate()),s&&(c=c.negate()),c=new p(n.mul(c.px,t.beta),c.py,c.pz),d.add(c)}multiply(e){let t,o,{endo:f,n:a}=r;
2if((0,i.aInRange)("scalar",e,L,a),f){let{k1neg:r,k1:i,k2neg:a,k2:l}=f.splitScalar(e),{p:s,f:u}=this.wNAF(i),{p:d,f:c}=this.wNAF(l);s=B.constTimeNegate(r,s),d=B.constTimeNegate(a,d),d=new p(n.mul(d.px,f.beta),d.py,d.pz),t=s.add(d),o=u.add(c)}else{let{p:r,f:n}=this.wNAF(e);t=r,o=n}return p.normalizeZ([t,o])[0]}multiplyAndAddUnsafe(e,t,r){let n=p.BASE,i=(e,t)=>t!==F&&t!==L&&e.equals(n)?e.multiply(t):e.multiplyUnsafe(t),o=i(this,t).add(i(e,r));return o.is0()?void 0:o}toAffine(e){return g(this,e)}isTorsionFree(){let{h:e,isTorsionFree:t}=r;if(e===L)return!0;if(t)return t(p,this);throw Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){let{h:e,clearCofactor:t}=r;return e===L?this:t?t(p,this):this.multiplyUnsafe(r.h)}toRawBytes(e=!0){return(0,i.abool)("isCompressed",e),this.assertValidity(),f(p,this,e)}toHex(e=!0){return(0,i.abool)("isCompressed",e),(0,i.bytesToHex)(this.toRawBytes(e))}}p.BASE=new p(r.Gx,r.Gy,n.ONE),p.ZERO=new p(n.ZERO,n.ONE,n.ZERO);let{endo:b,nBitLength:E}=r,B=(t=b?Math.ceil(E/2):E,{constTimeNegate:I,hasPrecomputes:e=>1!==H(e),unsafeLadder(e,t,r=p.ZERO){let n=e;for(;t>O;)t&R&&(r=r.add(n)),n=n.double(),t>>=R;return r},precomputeWindow(e,r){let{windows:n,windowSize:i}=N(r,t),o=[],f=e,a=f;for(let e=0;e<n;e++){a=f,o.push(a);for(let e=1;e<i;e++)a=a.add(f),o.push(a);f=a.double()}return o},wNAF(e,r,n){let i=p.ZERO,o=p.BASE,f=N(e,t);for(let e=0;e<f.windows;e++){let{nextN:t,offset:a,isZero:l,isNeg:s,isNegF:u,offsetF:d}=q(n,e,f);n=t,l?o=o.add(I(u,r[d])):i=i.add(I(s,r[a]))}return{p:i,f:o}},wNAFUnsafe(e,r,n,i=p.ZERO){let o=N(e,t);for(let e=0;e<o.windows&&n!==O;e++){let{nextN:t,offset:f,isZero:a,isNeg:l}=q(n,e,o);if(n=t,!a){let e=r[f];i=i.add(l?e.negate():e)}}return i},getPrecomputes(e,t,r){let n=U.get(t);return n||(n=this.precomputeWindow(t,e),1!==e&&U.set(t,r(n))),n},wNAFCached(e,t,r){let n=H(e);return this.wNAF(n,this.getPrecomputes(n,e,r),t)},wNAFCachedUnsafe(e,t,r,n){let i=H(e);return 1===i?this.unsafeLadder(e,t,n):this.wNAFUnsafe(i,this.getPrecomputes(i,e,r),t,n)},setWindowSize(e,r){T(r,t),Z.set(e,r),U.delete(e)}});return{CURVE:r,ProjectivePoint:p,normPrivateKeyToScalar:h,weierstrassEquation:l,isWithinCurveOrder:function(e){return(0,i.inRange)(e,L,r.n)}}}({...r,toBytes(e,t,r){let o=t.toAffine(),f=n.toBytes(o.x),a=i.concatBytes;return((0,i.abool)("isCompressed",r),r)?a(Uint8Array.from([t.hasEvenY()?2:3]),f):a(Uint8Array.from([4]),f,n.toBytes(o.y))},fromBytes(e){let t=e.length,r=e[0],o=e.subarray(1);if(t===l&&(2===r||3===r)){let e,t=(0,i.bytesToNumberBE)(o);if(!(0,i.inRange)(t,L,n.ORDER))throw Error("Point is not on curve");let f=g(t);try{e=n.sqrt(f)}catch(e){throw Error("Point is not on curve"+(e instanceof Error?": "+e.message:""))}return(1&r)==1!=((e&L)===L)&&(e=n.neg(e)),{x:t,y:e}}if(t===s&&4===r)return{x:n.fromBytes(o.subarray(0,n.BYTES)),y:n.fromBytes(o.subarray(n.BYTES,2*n.BYTES))};throw Error("invalid Point, expected length of "+l+", or uncompressed "+s+", got "+t)}}),p=(e,t,r)=>(0,i.bytesToNumberBE)(e.slice(t,r));class b{constructor(e,t,r){(0,i.aInRange)("r",e,L,o),(0,i.aInRange)("s",t,L,o),this.r=e,this.s=t,null!=r&&(this.recovery=r),Object.freeze(this)}static fromCompact(e){return new b(p(e=(0,i.ensureBytes)("compactSignature",e,2*f),0,f),p(e,f,2*f))}static fromDER(e){let{r:t,s:r}=C.toSig((0,i.ensureBytes)("DER",e));return new b(t,r)}assertValidity(){}addRecoveryBit(e){return new b(this.r,this.s,e)}recoverPublicKey(e){let{r:t,s:f,recovery:a}=this,l=x((0,i.ensureBytes)("msgHash",e));if(null==a||![0,1,2,3].includes(a))throw Error("recovery id invalid");let s=2===a||3===a?t+r.n:t;if(s>=n.ORDER)throw Error("recovery id 2 or 3 invalid");let c=(1&a)==0?"02":"03",h=d.fromHex(c+D(s,n.BYTES)),g=m(s,o),y=u(-l*g),p=u(f*g),b=d.BASE.multiplyAndAddUnsafe(h,y,p);if(!b)throw Error("point at infinify");return b.assertValidity(),b}hasHighS(){return this.s>o>>L}normalizeS(){return this.hasHighS()?new b(this.r,u(-this.s),this.recovery):this}toDERRawBytes(){return(0,i.hexToBytes)(this.toDERHex())}toDERHex(){return C.hexFromSig(this)}toCompactRawBytes(){return(0,i.hexToBytes)(this.toCompactHex())}toCompactHex(){return D(this.r,f)+D(this.s,f)}}function E(e){if("bigint"==typeof e)return!1;if(e instanceof d)return!0;let t=(0,i.ensureBytes)("key",e).length,o=n.BYTES,a=o+1;if(!r.allowedPrivateKeyLengths&&f!==a)return t===a||t===2*o+1}let B=r.bits2int||function(e){if(e.length>8192)throw Error("input is too large");let t=(0,i.bytesToNumberBE)(e),r=8*e.length-a;return r>0?t>>BigInt(r):t},x=r.bits2int_modN||function(e){return u(B(e))},V=(0,i.bitMask)(a);function _(e){return(0,i.aInRange)("num < 2^"+a,e,F,V),(0,i.numberToBytesBE)(e,f)}let M={lowS:r.lowS,prehash:!1},K={lowS:r.lowS,prehash:!1};return d.BASE._setWindowSize(8),{CURVE:r,getPublicKey:function(e,t=!0){return d.fromPrivateKey(e).toRawBytes(t)},getSharedSecret:function(e,t,r=!0){if(!0===E(e))throw Error("first arg must be private key");if(!1===E(t))throw Error("second arg must be public key");return d.fromHex(t).multiply(h(e)).toRawBytes(r)},sign:function(e,t,f=M){let{seed:a,k2sig:l}=function(e,t,f=M){if(["recovered","canonical"].some(e=>e in f))throw Error("sign() legacy options not supported");let{hash:a,randomBytes:l}=r,{lowS:s,prehash:c,extraEntropy:g}=f;null==s&&(s=!0),e=(0,i.ensureBytes)("msgHash",e),z(f),c&&(e=(0,i.ensureBytes)("prehashed msgHash",a(e)));let p=x(e),w=h(t),E=[_(w),_(p)];if(null!=g&&!1!==g){let e=!0===g?l(n.BYTES):g;E.push((0,i.ensureBytes)("extraEntropy",e))}return{seed:(0,i.concatBytes)(...E),k2sig:function(e){var t;let r=B(e);if(!y(r))return;let n=m(r,o),i=d.BASE.multiply(r).toAffine(),f=u(i.x);if(f===F)return;let a=u(n*u(p+f*w));if(a===F)return;let l=2*(i.x!==f)|Number(i.y&L),c=a;return s&&a>o>>L&&(c=(t=a)>o>>L?u(-t):t,l^=1),new b(f,c,l)}}}(e,t,f);return(0,i.createHmacDrbg)(r.hash.outputLen,r.nByteLength,r.hmac)(a,l)},verify:function(e,t,n,f=K){let a,l;t=(0,i.ensureBytes)("msgHash",t),n=(0,i.ensureBytes)("publicKey",n);let{lowS:s,prehash:c,format:h}=f;if(z(f),"strict"in f)throw Error("options.strict was renamed to lowS");if(void 0!==h&&"compact"!==h&&"der"!==h)throw Error("format must be compact or der");let g="string"==typeof e||(0,i.isBytes)(e),y=!g&&!h&&"object"==typeof e&&null!==e&&"bigint"==typeof e.r&&"bigint"==typeof e.s;if(!g&&!y)throw Error("invalid signature, expected Uint8Array, hex string or Signature instance");try{if(y&&(l=new b(e.r,e.s)),g){try{"compact"!==h&&(l=b.fromDER(e))}catch(e){if(!(e instanceof C.Err))throw e}l||"der"===h||(l=b.fromCompact(e))}a=d.fromHex(n)}catch(e){return!1}if(!l||s&&l.hasHighS())return!1;c&&(t=r.hash(t));let{r:p,s:w}=l,E=x(t),B=m(w,o),v=u(E*B),S=u(p*B),A=d.BASE.multiplyAndAddUnsafe(a,v,S)?.toAffine();return!!A&&u(A.x)===p},ProjectivePoint:d,Signature:b,utils:{isValidPrivateKey(e){try{return h(e),!0}catch(e){return!1}},normPrivateKeyToScalar:h,randomPrivateKey:()=>{let e=S(r.n);return A(r.randomBytes(e),r.n)},precompute:(e=8,t=d.BASE)=>(t._setWindowSize(e),t.multiply(BigInt(3)),t)}}}function M(e,t){if(b(e),!e.isValid(t.A)||!e.isValid(t.B)||!e.isValid(t.Z))throw Error("mapToCurveSimpleSWU: invali
2d opts");let r=function(e,t){let r=e.ORDER,n=F;for(let e=r-L;e%V===F;e/=V)n+=L;let i=n,o=V<<i-L-L,f=o*V,a=(r-L)/f,l=(a-L)/V,s=f-L,u=e.pow(t,a),d=e.pow(t,(a+L)/V),c=(t,r)=>{let n=u,f=e.pow(r,s),a=e.sqr(f);a=e.mul(a,r);let c=e.mul(t,a);c=e.pow(c,l),c=e.mul(c,f),f=e.mul(c,r),a=e.mul(c,t);let h=e.mul(a,f);c=e.pow(h,o);let m=e.eql(c,e.ONE);f=e.mul(a,d),c=e.mul(h,n),a=e.cmov(f,a,m),h=e.cmov(c,h,m);for(let t=i;t>L;t--){let r=t-V;r=V<<r-L;let i=e.pow(h,r),o=e.eql(i,e.ONE);f=e.mul(a,n),n=e.mul(n,n),i=e.mul(h,n),a=e.cmov(f,a,o),h=e.cmov(i,h,o)}return{isValid:m,value:a}};if(e.ORDER%k===j){let r=(e.ORDER-j)/k,n=e.sqrt(e.neg(t));c=(t,i)=>{let o=e.sqr(i),f=e.mul(t,i);o=e.mul(o,f);let a=e.pow(o,r);a=e.mul(a,f);let l=e.mul(a,n),s=e.mul(e.sqr(a),i),u=e.eql(s,t),d=e.cmov(l,a,u);return{isValid:u,value:d}}}return c}(e,t.Z);if(!e.isOdd)throw Error("Fp.isOdd is not implemented!");return n=>{let i,o,f,a,l,s,u,d;i=e.sqr(n),i=e.mul(i,t.Z),o=e.sqr(i),o=e.add(o,i),f=e.add(o,e.ONE),f=e.mul(f,t.B),a=e.cmov(t.Z,e.neg(o),!e.eql(o,e.ZERO)),a=e.mul(a,t.A),o=e.sqr(f),s=e.sqr(a),l=e.mul(s,t.A),o=e.add(o,l),o=e.mul(o,f),s=e.mul(s,a),l=e.mul(s,t.B),o=e.add(o,l),u=e.mul(i,f);let{isValid:c,value:h}=r(o,s);d=e.mul(i,n),d=e.mul(d,h),u=e.cmov(u,f,c),d=e.cmov(d,h,c);let m=e.isOdd(n)===e.isOdd(d);d=e.cmov(e.neg(d),d,m);let g=w(e,[a],!0)[0];return{x:u=e.mul(u,g),y:d}}}function K(e,t){let i=t=>_({...e,...{hash:t,hmac:(e,...i)=>(0,n.hmac)(t,e,(0,r.concatBytes)(...i)),randomBytes:r.randomBytes}});return{...i(t),create:i}}e.s(["mapToCurveSimpleSWU",0,M,"weierstrass",0,_],240718),e.s(["createCurve",0,K],554031);let W=i.bytesToNumberBE;function Y(e,t){if(G(e),G(t),e<0||e>=1<<8*t)throw Error("invalid I2OSP input: "+e);let r=Array.from({length:t}).fill(0);for(let n=t-1;n>=0;n--)r[n]=255&e,e>>>=8;return new Uint8Array(r)}function G(e){if(!Number.isSafeInteger(e))throw Error("number expected")}function X(e,t,r){let n;(0,i.validateObject)(r,{DST:"stringOrUint8Array",p:"bigint",m:"isSafeInteger",k:"isSafeInteger",hash:"hash"});let{p:o,k:f,m:a,hash:l,expand:s,DST:u}=r;(0,i.abytes)(e),G(t);let d="string"==typeof u?(0,i.utf8ToBytes)(u):u,h=Math.ceil((o.toString(2).length+f)/8),m=t*a*h;if("xmd"===s)n=function(e,t,r,n){(0,i.abytes)(e),(0,i.abytes)(t),G(r),t.length>255&&(t=n((0,i.concatBytes)((0,i.utf8ToBytes)("H2C-OVERSIZE-DST-"),t)));let{outputLen:o,blockLen:f}=n,a=Math.ceil(r/o);if(r>65535||a>255)throw Error("expand_message_xmd: invalid lenInBytes");let l=(0,i.concatBytes)(t,Y(t.length,1)),s=Y(0,f),u=Y(r,2),d=Array(a),c=n((0,i.concatBytes)(s,e,u,Y(0,1),l));d[0]=n((0,i.concatBytes)(c,Y(1,1),l));for(let e=1;e<=a;e++){let t=[function(e,t){let r=new Uint8Array(e.length);for(let n=0;n<e.length;n++)r[n]=e[n]^t[n];return r}(c,d[e-1]),Y(e+1,1),l];d[e]=n((0,i.concatBytes)(...t))}return(0,i.concatBytes)(...d).slice(0,r)}(e,d,m,l);else if("xof"===s)n=function(e,t,r,n,o){if((0,i.abytes)(e),(0,i.abytes)(t),G(r),t.length>255){let e=Math.ceil(2*n/8);t=o.create({dkLen:e}).update((0,i.utf8ToBytes)("H2C-OVERSIZE-DST-")).update(t).digest()}if(r>65535||t.length>255)throw Error("expand_message_xof: invalid lenInBytes");return o.create({dkLen:r}).update(e).update(Y(r,2)).update(t).update(Y(t.length,1)).digest()}(e,d,m,f,l);else if("_internal_pass"===s)n=e;else throw Error('expand must be "xmd" or "xof"');let g=Array(t);for(let e=0;e<t;e++){let t=Array(a);for(let r=0;r<a;r++){let i=h*(r+e*a),f=n.subarray(i,i+h);t[r]=c(W(f),o)}g[e]=t}return g}function J(e,t){let r=t.map(e=>Array.from(e).reverse());return(t,n)=>{let[i,o,f,a]=r.map(r=>r.reduce((r,n)=>e.add(e.mul(r,t),n))),[l,s]=w(e,[o,a],!0);return t=e.mul(i,l),n=e.mul(n,e.mul(f,s)),{x:t,y:n}}}function Q(e,t,r){if("function"!=typeof t)throw Error("mapToCurve() must be defined");function n(r){return e.fromAffine(t(r))}function i(t){let r=t.clearCofactor();return r.equals(e.ZERO)?e.ZERO:(r.assertValidity(),r)}return{defaults:r,hashToCurve(e,t){let o=X(e,2,{...r,DST:r.DST,...t}),f=n(o[0]),a=n(o[1]);return i(f.add(a))},encodeToCurve:(e,t)=>i(n(X(e,1,{...r,DST:r.encodeDST,...t})[0])),mapToCurve(e){if(!Array.isArray(e))throw Error("expected array of bigints");for(let t of e)if("bigint"!=typeof t)throw Error("expected array of bigints");return i(n(e))}}}e.s(["createHasher",0,Q,"isogenyMap",0,J],22815);let $=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),ee=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),et=BigInt(0),er=BigInt(1),en=BigInt(2),ei=(e,t)=>(e+t/en)/t,eo=v($,void 0,void 0,{sqrt:function(e){let t=BigInt(3),r=BigInt(6),n=BigInt(11),i=BigInt(22),o=BigInt(23),f=BigInt(44),a=BigInt(88),l=e*e*e%$,s=l*l*e%$,u=h(s,t,$)*s%$,d=h(u,t,$)*s%$,c=h(d,en,$)*l%$,m=h(c,n,$)*c%$,g=h(m,i,$)*m%$,y=h(g,f,$)*g%$,p=h(y,a,$)*y%$,b=h(p,f,$)*g%$,w=h(b,t,$)*s%$,E=h(w,o,$)*m%$,B=h(E,r,$)*l%$,v=h(B,en,$);
2if(!eo.eql(eo.sqr(v),e))throw Error("Cannot find square root");return v}}),ef=K({a:et,b:BigInt(7),Fp:eo,n:ee,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:e=>{let t=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-er*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),n=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),i=BigInt("0x100000000000000000000000000000000"),o=ei(t*e,ee),f=ei(-r*e,ee),a=c(e-o*t-f*n,ee),l=c(-o*r-f*t,ee),s=a>i,u=l>i;if(s&&(a=ee-a),u&&(l=ee-l),a>i||l>i)throw Error("splitScalar: Endomorphism failed, k="+e);return{k1neg:s,k1:a,k2neg:u,k2:l}}}},t.sha256);ef.ProjectivePoint;i.bytesToNumberBE;let ea=J(eo,[["0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa8c7","0x7d3d4c80bc321d5b9f315cea7fd44c5d595d2fc0bf63b92dfff1044f17c6581","0x534c328d23f234e6e2a413deca25caece4506144037c40314ecbd0b53d9dd262","0x8e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38e38daaaaa88c"],["0xd35771193d94918a9ca34ccbb7b640dd86cd409542f8487d9fe6b745781eb49b","0xedadc6f64383dc1df7c4b2d51b54225406d36b641f5e41bbc52a56612a8c6d14","0x0000000000000000000000000000000000000000000000000000000000000001"],["0x4bda12f684bda12f684bda12f684bda12f684bda12f684bda12f684b8e38e23c","0xc75e0c32d5cb7c0fa9d0a54b12a0a6d5647ab046d686da6fdffc90fc201d71a3","0x29a6194691f91a73715209ef6512e576722830a201be2018a765e85a9ecee931","0x2f684bda12f684bda12f684bda12f684bda12f684bda12f684bda12f38e38d84"],["0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffff93b","0x7a06534bb8bdb49fd5e9e6632722c2989467c1bfc8e8d978dfb425d2685c2573","0x6484aa716545ca2cf3a70c3fa8fe337e0a3d21162f0d6299a7bf8192bfd2a76f","0x0000000000000000000000000000000000000000000000000000000000000001"]].map(e=>e.map(e=>BigInt(e)))),el=M(eo,{A:BigInt("0x3f8731abdd661adca08a5558f0f5d272e953d363cb6f0e5d405447c01a444533"),B:BigInt("1771"),Z:eo.create(BigInt("-11"))});Q(ef.ProjectivePoint,e=>{let{x:t,y:r}=el(eo.create(e[0]));return ea(t,r)},{DST:"secp256k1_XMD:SHA-256_SSWU_RO_",encodeDST:"secp256k1_XMD:SHA-256_SSWU_NU_",p:eo.ORDER,m:1,k:128,expand:"xmd",hash:t.sha256}),e.s(["secp256k1",0,ef],978629)}]); 3 4//# debugId=27267a57-8d3e-5b52-b099-b50974edbffa
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.