1"use strict";(self.webpackChunkseascape_web=self.webpackChunkseascape_web||[]).push([[6709],{6709:function(t,e,n){n.d(e,{secp256k1:function(){return Dt}});var r={};n.r(r),n.d(r,{Fy:function(){return V},uw:function(){return b},gk:function(){return E},Dd:function(){return D},dQ:function(){return _},ci:function(){return v},bytesToNumberBE:function(){return H},ty:function(){return U},eV:function(){return P},n$:function(){return G},ql:function(){return C},hexToBytes:function(){return k},Z2:function(){return T},_t:function(){return m},H9:function(){return Y},tL:function(){return z},S5:function(){return F},uz:function(){return x},FF:function(){return W}});var o=n(12518),i=n(91220);function s(t,e,n){return t&e^t&n^e&n}class f extends i.kb{constructor(t,e,n,r){super(),this.blockLen=t,this.outputLen=e,this.padOffset=n,this.isLE=r,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(t),this.view=(0,i.GL)(this.buffer)}update(t){(0,o.$h)(this);const{view:e,buffer:n,blockLen:r}=this,s=(t=(0,i.O0)(t)).length;for(let o=0;o<s;){const f=Math.min(r-this.pos,s-o);if(f!==r)n.set(t.subarray(o,o+f),this.pos),this.pos+=f,o+=f,this.pos===r&&(this.process(e,0),this.pos=0);else{const e=(0,i.GL)(t);for(;r<=s-o;o+=r)this.process(e,o)}}return this.length+=t.length,this.roundClean(),this}digestInto(t){(0,o.$h)(this),(0,o.eB)(t,this),this.finished=!0;const{buffer:e,view:n,blockLen:r,isLE:s}=this;let{pos:f}=this;e[f++]=128,this.buffer.subarray(f).fill(0),this.padOffset>r-f&&(this.process(n,0),f=0);for(let t=f;t<r;t++)e[t]=0;!function(t,e,n,r){if("function"==typeof t.setBigUint64)return t.setBigUint64(e,n,r);const o=BigInt(32),i=BigInt(4294967295),s=Number(n>>o&i),f=Number(n&i),u=r?4:0,a=r?0:4;t.setUint32(e+u,s,r),t.setUint32(e+a,f,r)}(n,r-8,BigInt(8*this.length),s),this.process(n,0);const u=(0,i.GL)(t),a=this.outputLen;if(a%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const c=a/4,h=this.get();if(c>h.length)throw new Error("_sha2: outputLen bigger than state");for(let t=0;t<c;t++)u.setUint32(4*t,h[t],s)}digest(){const{buffer:t,outputLen:e}=this;this.digestInto(t);const n=t.slice(0,e);return this.destroy(),n}_cloneInto(t){t||(t=new this.constructor),t.set(...this.get());const{blockLen:e,buffer:n,length:r,finished:o,destroyed:i,pos:s}=this;return t.length=r,t.pos=s,t.finished=o,t.destroyed=i,r%e&&t.buffer.set(n),t}}const u=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),a=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),c=new Uint32Array(64);class h extends f{constructor(){super(64,32,8,!1),this.A=0|a[0],this.B=0|a[1],this.C=0|a[2],this.D=0|a[3],this.E=0|a[4],this.F=0|a[5],this.G=0|a[6],this.H=0|a[7]}get(){const{A:t,B:e,C:n,D:r,E:o,F:i,G:s,H:f}=this;return[t,e,n,r,o,i,s,f]}set(t,e,n,r,o,i,s,f){this.A=0|t,this.B=0|e,this.C=0|n,this.D=0|r,this.E=0|o,this.F=0|i,this.G=0|s,this.H=0|f}process(t,e){for(let n=0;n<16;n++,e+=4)c[n]=t.getUint32(e,!1);for(let t=16;t<64;t++){const e=c[t-15],n=c[t-2],r=(0,i.np)(e,7)^(0,i.np)(e,18)^e>>>3,o=(0,i.np)(n,17)^(0,i.np)(n,19)^n>>>10;c[t]=o+c[t-7]+r+c[t-16]|0}let{A:n,B:r,C:o,D:f,E:a,F:h,G:l,H:d}=this;for(let t=0;t<64;t++){const e=d+((0,i.np)(a,6)^(0,i.np)(a,11)^(0,i.np)(a,25))+((w=a)&h^~w&l)+u[t]+c[t]|0,g=((0,i.np)(n,2)^(0,i.np)(n,13)^(0,i.np)(n,22))+s(n,r,o)|0;d=l,l=h,h=a,a=f+e|0,f=o,o=r,r=n,n=e+g|0}var w;n=n+this.A|0,r=r+this.B|0,o=o+this.C|0,f=f+this.D|0,a=a+this.E|0,h=h+this.F|0,l=l+this.G|0,d=d+this.H|0,this.set(n,r,o,f,a,h,l,d)}roundClean(){c.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const l=(0,i.hE)((()=>new h));class d extends i.kb{constructor(t,e){super(),this.finished=!1,this.destroyed=!1,(0,o.z3)(t);const n=(0,i.O0)(e);if(this.iHash=t.create(),"function"!=typeof this.iHash.update)throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const r=this.blockLen,s=new Uint8Array(r);s.set(n.length>r?t.create().update(n).digest():n);for(let t=0;t<s.length;t++)s[t]^=54;this.iHash.update(s),this.oHash=t.create();for(let t=0;t<s.length;t++)s[t]^=106;this.oHash.update(s),s.fill(0)}update(t){return(0,o.$h)(this),this.iHash.update(t),this}digestInto(t){(0,o.$h)(this),(0,o.gk)(t,this.outputLen),this.finished=!0,this.iHash.digestInto(t),this.oHash.update(t),this.oHash.digestInto(t),this.destroy()}digest(){const t=new Uint8Array(this.oHash.outputLen);return this.digestInto(t),t}_cloneInto(t){t||(t=Object.create(Object.getPrototypeOf(this),{}));const{oHash:e,iHash:n,finished:r,destroyed:o,blockLen:i,outputLen:s}=this;return t.finished=r,t.destroyed=o,t.blockLen=i,t.outputLen=s,t.oHash=e._cloneInto(t.oHash),t.iHash=n._cloneInto(t.iHash),t}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const w=(t,e,n)=>new d(t,e).update(n).digest();w.create=(t,e)=>new d(t,e);const g=BigInt(0),p=BigInt(1),y=BigInt(2);function m(t){return t instanceof Uint8Array||ArrayBuffer.isView(t)&&"Uint8Array"===t.constructor.name}function E(t){if(!m(t))throw new Error("Uint8Array expected")}function b(t,e){if("boolean"!=typeof e)throw new Error(t+" boolean expected, got "+e)}const B=Array.from({length:256},((t,e)=>e.toString(16).padStart(2,"0")));function v(t){E(t);let e="";for(let n=0;n<t.length;n++)e+=B[t[n]];return e}function x(t){const e=t.toString(16);return 1&e.length?"0"+e:e}function S(t){if("string"!=typeof t)throw new Error("hex string expected, got "+typeof t);return""===t?g:BigInt("0x"+t)}const A=48,I=57,O=65,q=70,R=97,L=102;function N(t){return t>=A&&t<=I?t-A:t>=O&&t<=q?t-(O-10):t>=R&&t<=L?t-(R-10):void 0}function k(t){if("string"!=typeof t)throw new Error("hex string expected, got "+typeof t);const e=t.length,n=e/2;if(e%2)throw new Error("hex string expected, got unpadded hex of length "+e);
vendor: 6,001 bytes, line 1
1const r=new Uint8Array(n);for(let e=0,o=0;e<n;e++,o+=2){const n=N(t.charCodeAt(o)),i=N(t.charCodeAt(o+1));if(void 0===n||void 0===i){const e=t[o]+t[o+1];throw new Error('hex string expected, got non-hex character "'+e+'" at index '+o)}r[e]=16*n+i}return r}function H(t){return S(v(t))}function U(t){return E(t),S(v(Uint8Array.from(t).reverse()))}function z(t,e){return k(t.toString(16).padStart(2*e,"0"))}function F(t,e){return z(t,e).reverse()}function C(t,e,n){let r;if("string"==typeof e)try{r=k(e)}catch(e){throw new Error(t+" must be hex string or Uint8Array, cause: "+e)}else{if(!m(e))throw new Error(t+" must be hex string or Uint8Array");r=Uint8Array.from(e)}const o=r.length;if("number"==typeof n&&o!==n)throw new Error(t+" of length "+n+" expected, got "+o);return r}function P(...t){let e=0;for(let n=0;n<t.length;n++){const r=t[n];E(r),e+=r.length}const n=new Uint8Array(e);for(let e=0,r=0;e<t.length;e++){const o=t[e];n.set(o,r),r+=o.length}return n}const Z=t=>"bigint"==typeof t&&g<=t;function T(t,e,n){return Z(t)&&Z(e)&&Z(n)&&e<=t&&t<n}function V(t,e,n,r){if(!T(e,n,r))throw new Error("expected valid "+t+": "+n+" <= n < "+r+", got "+e)}function D(t){let e;for(e=0;t>g;t>>=p,e+=1);return e}const _=t=>(y<<BigInt(t-1))-p,j=t=>new Uint8Array(t),K=t=>Uint8Array.from(t);function G(t,e,n){if("number"!=typeof t||t<2)throw new Error("hashLen must be a number");if("number"!=typeof e||e<2)throw new Error("qByteLen must be a number");if("function"!=typeof n)throw new Error("hmacFn must be a function");let r=j(t),o=j(t),i=0;const s=()=>{r.fill(1),o.fill(0),i=0},f=(...t)=>n(o,r,...t),u=(t=j())=>{o=f(K([0]),t),r=f(),0!==t.length&&(o=f(K([1]),t),r=f())},a=()=>{if(i++>=1e3)throw new Error("drbg: tried 1000 values");let t=0;const n=[];for(;t<e;){r=f();const e=r.slice();n.push(e),t+=r.length}return P(...n)};return(t,e)=>{let n;for(s(),u(t);!(n=e(a()));)u();return s(),n}}const M={bigint:t=>"bigint"==typeof t,function:t=>"function"==typeof t,boolean:t=>"boolean"==typeof t,string:t=>"string"==typeof t,stringOrUint8Array:t=>"string"==typeof t||m(t),isSafeInteger:t=>Number.isSafeInteger(t),array:t=>Array.isArray(t),field:(t,e)=>e.Fp.isValid(t),hash:t=>"function"==typeof t&&Number.isSafeInteger(t.outputLen)};function W(t,e,n={}){const r=(e,n,r)=>{const o=M[n];if("function"!=typeof o)throw new Error("invalid validator function");const i=t[e];if(!(r&&void 0===i||o(i,t)))throw new Error("param "+String(e)+" is invalid. Expected "+n+", got "+i)};for(const[t,n]of Object.entries(e))r(t,n,!1);for(const[t,e]of Object.entries(n))r(t,e,!0);return t}function Y(t){const e=new WeakMap;return(n,...r)=>{const o=e.get(n);if(void 0!==o)return o;const i=t(n,...r);return e.set(n,i),i}}const $=BigInt(0),Q=BigInt(1),J=BigInt(2),X=BigInt(3),tt=BigInt(4),et=BigInt(5),nt=BigInt(8);function rt(t,e){const n=t%e;return n>=$?n:e+n}function ot(t,e,n){if(e<$)throw new Error("invalid exponent, negatives unsupported");if(n<=$)throw new Error("invalid modulus");if(n===Q)return $;let r=Q;for(;e>$;)e&Q&&(r=r*t%n),t=t*t%n,e>>=Q;return r}function it(t,e,n){let r=t;for(;e-- >$;)r*=r,r%=n;return r}function st(t,e){if(t===$)throw new Error("invert: expected non-zero number");if(e<=$)throw new Error("invert: expected positive modulus, got "+e);let n=rt(t,e),r=e,o=$,i=Q,s=Q,f=$;for(;n!==$;){const t=r/n,e=r%n,u=o-s*t,a=i-f*t;r=n,n=e,o=s,i=f,s=u,f=a}if(r!==Q)throw new Error("invert: does not exist");return rt(o,e)}function ft(t){if(t%tt===X){const e=(t+Q)/tt;return function(t,n){const r=t.pow(n,e);if(!t.eql(t.sqr(r),n))throw new Error("Cannot find square root");return r}}if(t%nt===et){const e=(t-et)/nt;return function(t,n){const r=t.mul(n,J),o=t.pow(r,e),i=t.mul(n,o),s=t.mul(t.mul(i,J),o),f=t.mul(i,t.sub(s,t.ONE));if(!t.eql(t.sqr(f),n))throw new Error("Cannot find square root");return f}}return function(t){const e=(t-Q)/J;let n,r,o;for(n=t-Q,r=0;n%J===$;n/=J,r++);for(o=J;o<t&&ot(o,e,t)!==t-Q;o++)if(o>1e3)throw new Error("Cannot find square root: likely non-prime P");if(1===r){const e=(t+Q)/tt;return function(t,n){const r=t.pow(n,e);if(!t.eql(t.sqr(r),n))throw new Error("Cannot find square root");return r}}const i=(n+Q)/J;return function(t,s){if(t.pow(s,e)===t.neg(t.ONE))throw new Error("Cannot find square root");let f=r,u=t.pow(t.mul(t.ONE,o),n),a=t.pow(s,i),c=t.pow(s,n);for(;!t.eql(c,t.ONE);){if(t.eql(c,t.ZERO))return t.ZERO;let e=1;for(let n=t.sqr(c);e<f&&!t.eql(n,t.ONE);e++)n=t.sqr(n);const n=t.pow(u,Q<<BigInt(f-e-1));u=t.sqr(n),a=t.mul(a,n),c=t.mul(c,u),f=e}return a}}(t)}const ut=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function at(t,e){const n=void 0!==e?e:t.toString(2).length;return{nBitLength:n,nByteLength:Math.ceil(n/8)}}function ct(t,e,n=!1,r={}){if(t<=$)throw new Error("invalid field: expected ORDER > 0, got "+t);const{nBitLength:o,nByteLength:i}=at(t,e);if(i>2048)throw new Error("invalid field: expected ORDER of <= 2048 bytes");let s;const f=Object.freeze({ORDER:t,isLE:n,BITS:o,BYTES:i,MASK:_(o),ZERO:$,ONE:Q,create:e=>rt(e,t),isValid:e=>{if("bigint"!=typeof e)throw new Error("invalid field element: expected bigint, got "+typeof e);return $<=e&&e<t},is0:t=>t===$,isOdd:t=>(t&Q)===Q,neg:e=>rt(-e,t),eql:(t,e)=>t===e,sqr:e=>rt(e*e,t),add:(e,n)=>rt(e+n,t),sub:(e,n)=>rt(e-n,t),mul:(e,n)=>rt(e*n,t),pow:(t,e)=>function(t,e,n){if(n<$)throw new Error("invalid exponent, negatives unsupported");if(n===$)return t.ONE;if(n===Q)return e;let r=t.ONE,o=e;for(;n>$;)n&Q&&(r=t.mul(r,o)),o=t.sqr(o),n>>=Q;return r}(f,t,e),div:(e,n)=>rt(e*st(n,t),t),sqrN:t=>t*t,addN:(t,e)=>t+e,subN:(t,e)=>t-e,mulN:(t,e)=>t*e,inv:e=>st(e,t),sqrt:r.sqrt||(e=>(s||(s=ft(t)),s(f,e))),invertBatch:t=>function(t,e){const n=new Array(e.length),r=e.reduce(((e,r,o)=>t.is0(r)?e:(n[o]=e,t.mul(e,r))),t.ONE),o=t.inv(r);return e.reduceRight(((e,r,o)=>t.is0(r)?e:(n[o]=t.mul(e,n[o]),t.mul(e,r))),o),n}(f,t),cmov:(t,e,n)=>n?e:t,toBytes:t=>n?F(t,i):z(t,i),fromBytes:t=>{if(t.length!==i)throw new Error("Field.fromBytes: expected "+i+" b
1ytes, got "+t.length);return n?U(t):H(t)}});return Object.freeze(f)}function ht(t){if("bigint"!=typeof t)throw new Error("field order must be bigint");const e=t.toString(2).length;return Math.ceil(e/8)}function lt(t){const e=ht(t);return e+Math.ceil(e/2)}const dt=BigInt(0),wt=BigInt(1);function gt(t,e){const n=e.negate();return t?n:e}function pt(t,e){if(!Number.isSafeInteger(t)||t<=0||t>e)throw new Error("invalid window size, expected [1.."+e+"], got W="+t)}function yt(t,e){pt(t,e);return{windows:Math.ceil(e/t)+1,windowSize:2**(t-1)}}function mt(t,e){if(!Array.isArray(t))throw new Error("array expected");t.forEach(((t,n)=>{if(!(t instanceof e))throw new Error("invalid point at index "+n)}))}function Et(t,e){if(!Array.isArray(t))throw new Error("array of scalars expected");t.forEach(((t,n)=>{if(!e.isValid(t))throw new Error("invalid scalar at index "+n)}))}const bt=new WeakMap,Bt=new WeakMap;function vt(t){return Bt.get(t)||1}function xt(t){return W(t.Fp,ut.reduce(((t,e)=>(t[e]="function",t)),{ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"})),W(t,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...at(t.n,t.nBitLength),...t,p:t.Fp.ORDER})}function St(t){void 0!==t.lowS&&b("lowS",t.lowS),void 0!==t.prehash&&b("prehash",t.prehash)}const{bytesToNumberBE:At,hexToBytes:It}=r;class Ot extends Error{constructor(t=""){super(t)}}const qt={Err:Ot,_tlv:{encode:(t,e)=>{const{Err:n}=qt;if(t<0||t>256)throw new n("tlv.encode: wrong tag");if(1&e.length)throw new n("tlv.encode: unpadded data");const r=e.length/2,o=x(r);if(o.length/2&128)throw new n("tlv.encode: long form length too big");const i=r>127?x(o.length/2|128):"";return x(t)+i+o+e},decode(t,e){const{Err:n}=qt;let r=0;if(t<0||t>256)throw new n("tlv.encode: wrong tag");if(e.length<2||e[r++]!==t)throw new n("tlv.decode: wrong tlv");const o=e[r++];let i=0;if(!!(128&o)){const t=127&o;if(!t)throw new n("tlv.decode(long): indefinite length not supported");if(t>4)throw new n("tlv.decode(long): byte length is too big");const s=e.subarray(r,r+t);if(s.length!==t)throw new n("tlv.decode: length bytes not complete");if(0===s[0])throw new n("tlv.decode(long): zero leftmost byte");for(const t of s)i=i<<8|t;if(r+=t,i<128)throw new n("tlv.decode(long): not minimal encoding")}else i=o;const s=e.subarray(r,r+i);if(s.length!==i)throw new n("tlv.decode: wrong value length");return{v:s,l:e.subarray(r+i)}}},_int:{encode(t){const{Err:e}=qt;if(t<Rt)throw new e("integer: negative integers are not allowed");let n=x(t);if(8&Number.parseInt(n[0],16)&&(n="00"+n),1&n.length)throw new e("unexpected DER parsing assertion: unpadded hex");return n},decode(t){const{Err:e}=qt;if(128&t[0])throw new e("invalid signature integer: negative");if(0===t[0]&&!(128&t[1]))throw new e("invalid signature integer: unnecessary leading zero");return At(t)}},toSig(t){const{Err:e,_int:n,_tlv:r}=qt,o="string"==typeof t?It(t):t;E(o);const{v:i,l:s}=r.decode(48,o);if(s.length)throw new e("invalid signature: left bytes after parsing");const{v:f,l:u}=r.decode(2,i),{v:a,l:c}=r.decode(2,u);if(c.length)throw new e("invalid signature: left bytes after parsing");return{r:n.decode(f),s:n.decode(a)}},hexFromSig(t){const{_tlv:e,_int:n}=qt,r=e.encode(2,n.encode(t.r))+e.encode(2,n.encode(t.s));return e.encode(48,r)}},Rt=BigInt(0),Lt=BigInt(1),Nt=(BigInt(2),BigInt(3));BigInt(4);function kt(t){const e=function(t){const e=xt(t);W(e,{a:"field",b:"field"},{allowedPrivateKeyLengths:"array",wrapPrivateKey:"boolean",isTorsionFree:"function",clearCofactor:"function",allowInfinityPoint:"boolean",fromBytes:"function",toBytes:"function"});const{endo:n,Fp:r,a:o}=e;if(n){if(!r.eql(o,r.ZERO))throw new Error("invalid endomorphism, can only be defined for Koblitz curves that have a=0");if("object"!=typeof n||"bigint"!=typeof n.beta||"function"!=typeof n.splitScalar)throw new Error("invalid endomorphism, expected beta: bigint and splitScalar: function")}return Object.freeze({...e})}(t),{Fp:n}=e,r=ct(e.n,e.nBitLength),o=e.toBytes||((t,e,r)=>{const o=e.toAffine();return P(Uint8Array.from([4]),n.toBytes(o.x),n.toBytes(o.y))}),i=e.fromBytes||(t=>{const e=t.subarray(1);return{x:n.fromBytes(e.subarray(0,n.BYTES)),y:n.fromBytes(e.subarray(n.BYTES,2*n.BYTES))}});function s(t){const{a:r,b:o}=e,i=n.sqr(t),s=n.mul(i,t);return n.add(n.add(s,n.mul(t,r)),o)}if(!n.eql(n.sqr(e.Gy),s(e.Gx)))throw new Error("bad generator point: equation left != right");function f(t){const{allowedPrivateKeyLengths:n,nByteLength:r,wrapPrivateKey:o,n:i}=e;if(n&&"bigint"!=typeof t){if(m(t)&&(t=v(t)),"string"!=typeof t||!n.includes(t.length))throw new Error("invalid private key");t=t.padStart(2*r,"0")}let s;try{s="bigint"==typeof t?t:H(C("private key",t,r))}catch(e){throw new Error("invalid private key, expected hex or "+r+" bytes, got "+typeof t)}return o&&(s=rt(s,i)),V("private key",s,Lt,i),s}function u(t){if(!(t instanceof h))throw new Error("ProjectivePoint expected")}const a=Y(((t,e)=>{const{px:r,py:o,pz:i}=t;if(n.eql(i,n.ONE))return{x:r,y:o};const s=t.is0();null==e&&(e=s?n.ONE:n.inv(i));const f=n.mul(r,e),u=n.mul(o,e),a=n.mul(i,e);if(s)return{x:n.ZERO,y:n.ZERO};
vendor: 13,216 bytes, line 1
1if(!n.eql(a,n.ONE))throw new Error("invZ was invalid");return{x:f,y:u}})),c=Y((t=>{if(t.is0()){if(e.allowInfinityPoint&&!n.is0(t.py))return;throw new Error("bad point: ZERO")}const{x:r,y:o}=t.toAffine();if(!n.isValid(r)||!n.isValid(o))throw new Error("bad point: x or y not FE");const i=n.sqr(o),f=s(r);if(!n.eql(i,f))throw new Error("bad point: equation left != right");if(!t.isTorsionFree())throw new Error("bad point: not in prime-order subgroup");return!0}));class h{constructor(t,e,r){if(this.px=t,this.py=e,this.pz=r,null==t||!n.isValid(t))throw new Error("x required");if(null==e||!n.isValid(e))throw new Error("y required");if(null==r||!n.isValid(r))throw new Error("z required");Object.freeze(this)}static fromAffine(t){const{x:e,y:r}=t||{};if(!t||!n.isValid(e)||!n.isValid(r))throw new Error("invalid affine point");if(t instanceof h)throw new Error("projective point not allowed");const o=t=>n.eql(t,n.ZERO);return o(e)&&o(r)?h.ZERO:new h(e,r,n.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(t){const e=n.invertBatch(t.map((t=>t.pz)));return t.map(((t,n)=>t.toAffine(e[n]))).map(h.fromAffine)}static fromHex(t){const e=h.fromAffine(i(C("pointHex",t)));return e.assertValidity(),e}static fromPrivateKey(t){return h.BASE.multiply(f(t))}static msm(t,e){return function(t,e,n,r){if(mt(n,t),Et(r,e),n.length!==r.length)throw new Error("arrays of points and scalars must have equal length");const o=t.ZERO,i=D(BigInt(n.length)),s=i>12?i-3:i>4?i-2:i?2:1,f=(1<<s)-1,u=new Array(f+1).fill(o);let a=o;for(let t=Math.floor((e.BITS-1)/s)*s;t>=0;t-=s){u.fill(o);for(let e=0;e<r.length;e++){const o=r[e],i=Number(o>>BigInt(t)&BigInt(f));u[i]=u[i].add(n[e])}let e=o;for(let t=u.length-1,n=o;t>0;t--)n=n.add(u[t]),e=e.add(n);if(a=a.add(e),0!==t)for(let t=0;t<s;t++)a=a.double()}return a}(h,r,t,e)}_setWindowSize(t){d.setWindowSize(this,t)}assertValidity(){c(this)}hasEvenY(){const{y:t}=this.toAffine();if(n.isOdd)return!n.isOdd(t);throw new Error("Field doesn't support isOdd")}equals(t){u(t);const{px:e,py:r,pz:o}=this,{px:i,py:s,pz:f}=t,a=n.eql(n.mul(e,f),n.mul(i,o)),c=n.eql(n.mul(r,f),n.mul(s,o));return a&&c}negate(){return new h(this.px,n.neg(this.py),this.pz)}double(){const{a:t,b:r}=e,o=n.mul(r,Nt),{px:i,py:s,pz:f}=this;let u=n.ZERO,a=n.ZERO,c=n.ZERO,l=n.mul(i,i),d=n.mul(s,s),w=n.mul(f,f),g=n.mul(i,s);return g=n.add(g,g),c=n.mul(i,f),c=n.add(c,c),u=n.mul(t,c),a=n.mul(o,w),a=n.add(u,a),u=n.sub(d,a),a=n.add(d,a),a=n.mul(u,a),u=n.mul(g,u),c=n.mul(o,c),w=n.mul(t,w),g=n.sub(l,w),g=n.mul(t,g),g=n.add(g,c),c=n.add(l,l),l=n.add(c,l),l=n.add(l,w),l=n.mul(l,g),a=n.add(a,l),w=n.mul(s,f),w=n.add(w,w),l=n.mul(w,g),u=n.sub(u,l),c=n.mul(w,d),c=n.add(c,c),c=n.add(c,c),new h(u,a,c)}add(t){u(t);const{px:r,py:o,pz:i}=this,{px:s,py:f,pz:a}=t;let c=n.ZERO,l=n.ZERO,d=n.ZERO;const w=e.a,g=n.mul(e.b,Nt);let p=n.mul(r,s),y=n.mul(o,f),m=n.mul(i,a),E=n.add(r,o),b=n.add(s,f);E=n.mul(E,b),b=n.add(p,y),E=n.sub(E,b),b=n.add(r,i);let B=n.add(s,a);return b=n.mul(b,B),B=n.add(p,m),b=n.sub(b,B),B=n.add(o,i),c=n.add(f,a),B=n.mul(B,c),c=n.add(y,m),B=n.sub(B,c),d=n.mul(w,b),c=n.mul(g,m),d=n.add(c,d),c=n.sub(y,d),d=n.add(y,d),l=n.mul(c,d),y=n.add(p,p),y=n.add(y,p),m=n.mul(w,m),b=n.mul(g,b),y=n.add(y,m),m=n.sub(p,m),m=n.mul(w,m),b=n.add(b,m),p=n.mul(y,b),l=n.add(l,p),p=n.mul(B,b),c=n.mul(E,c),c=n.sub(c,p),p=n.mul(E,y),d=n.mul(B,d),d=n.add(d,p),new h(c,l,d)}subtract(t){return this.add(t.negate())}is0(){return this.equals(h.ZERO)}wNAF(t){return d.wNAFCached(this,t,h.normalizeZ)}multiplyUnsafe(t){const{endo:r,n:o}=e;V("scalar",t,Rt,o);const i=h.ZERO;if(t===Rt)return i;if(this.is0()||t===Lt)return this;if(!r||d.hasPrecomputes(this))return d.wNAFCachedUnsafe(this,t,h.normalizeZ);let{k1neg:s,k1:f,k2neg:u,k2:a}=r.splitScalar(t),c=i,l=i,w=this;for(;f>Rt||a>Rt;)f&Lt&&(c=c.add(w)),a&Lt&&(l=l.add(w)),w=w.double(),f>>=Lt,a>>=Lt;return s&&(c=c.negate()),u&&(l=l.negate()),l=new h(n.mul(l.px,r.beta),l.py,l.pz),c.add(l)}multiply(t){const{endo:r,n:o}=e;let i,s;if(V("scalar",t,Lt,o),r){const{k1neg:e,k1:o,k2neg:f,k2:u}=r.splitScalar(t);let{p:a,f:c}=this.wNAF(o),{p:l,f:w}=this.wNAF(u);a=d.constTimeNegate(e,a),l=d.constTimeNegate(f,l),l=new h(n.mul(l.px,r.beta),l.py,l.pz),i=a.add(l),s=c.add(w)}else{const{p:e,f:n}=this.wNAF(t);i=e,s=n}return h.normalizeZ([i,s])[0]}multiplyAndAddUnsafe(t,e,n){const r=h.BASE,o=(t,e)=>e!==Rt&&e!==Lt&&t.equals(r)?t.multiply(e):t.multiplyUnsafe(e),i=o(this,e).add(o(t,n));return i.is0()?void 0:i}toAffine(t){return a(this,t)}isTorsionFree(){const{h:t,isTorsionFree:n}=e;if(t===Lt)return!0;if(n)return n(h,this);throw new Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){const{h:t,clearCofactor:n}=e;return t===Lt?this:n?n(h,this):this.multiplyUnsafe(e.h)}toRawBytes(t=!0){return b("isCompressed",t),this.assertValidity(),o(h,this,t)}toHex(t=!0){return b("isCompressed",t),v(this.toRawBytes(t))}}h.BASE=new h(e.Gx,e.Gy,n.ONE),h.ZERO=new h(n.ZERO,n.ONE,n.ZERO);const l=e.nBitLength,d=(w=h,g=e.endo?Math.ceil(l/2):l,{constTimeNegate:gt,hasPrecomputes(t){return 1!==vt(t)},unsafeLadder(t,e,n=w.ZERO){let r=t;for(;e>dt;)e&wt&&(n=n.add(r)),r=r.double(),e>>=wt;return n},precomputeWindow(t,e){const{windows:n,windowSize:r}=yt(e,g),o=[];let i=t,s=i;for(let t=0;t<n;t++){s=i,o.push(s);for(let t=1;t<r;t++)s=s.add(i),o.push(s);i=s.double()}return o},wNAF(t,e,n){const{windows:r,windowSize:o}=yt(t,g);let i=w.ZERO,s=w.BASE;const f=BigInt(2**t-1),u=2**t,a=BigInt(t);for(let t=0;t<r;t++){const r=t*o;let c=Number(n&f);n>>=a,c>o&&(c-=u,n+=wt);const h=r,l=r+Math.abs(c)-1,d=t%2!=0,w=c<0;0===c?s=s.add(gt(d,e[h])):i=i.add(gt(w,e[l]))}return{p:i,f:s}},wNAFUnsafe(t,e,n,r=w.ZERO){const{windows:o,windowSize:i}=yt(t,g),s=BigInt(2**t-1),f=2**t,u=BigInt(t);for(let t=0;t<o;t++){const o=t*i;if(n===dt)break;let a=Number(n&s);if(n>>=u,a>i&&(a-=f,n+=wt),0===a)continue;let c=e[o+Math.abs(a)-1];a<0&&(c=c.negate()),r=r.add(c)}return r},getPrecomputes(t,e,n){let r=bt.get(e);return r||(r=this.precomputeWindow(e,t),1!==t&&bt.set(e,n(r))),r},wNAFCached(t,e,n){const r=vt(t);return this.wNAF(r,this.getPrecomputes(r,t,n),e)},wNAFCachedUnsafe(t,e,n,r){const o=vt(t);return 1===o?this.unsafeLadder(t,e,r):this.wNAFUnsafe(o,this.getPrecomputes(o,t,n),e,r)},setWindowSize(t,e){pt(e,g),Bt.set(t,e),bt.delete(t)}});var w,g;return{CURVE:e,ProjectivePoint:h,normPrivateKeyToScalar:f,weierstrassEquation:s,isWithinCurveOrder:function(t){return T(t,Lt,e.n)}}}function Ht(t){const e=function(t){const e=xt(t);return W(e,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...e})}(t),{Fp:n,n:r}=e,o=n.BYTES+1,i=2*n.BYTES+1;function s(t){return rt(t,r)}function f(t){return st(t,r)}const{ProjectivePoint:u,normPrivateKeyToScalar:a,weierstrassEquation:c,isWithinCurveOrder:h}=kt({...e,toBytes(t,e,r){const o=e.toAffine(),i=n.toBytes(o.x),s=P;return b("isCompressed",r),r?s(Uint8Array.from([e.hasEvenY()?2:3]),i):s(Uint8Array.from([4]),i,n.toBytes(o.y))},fromBytes(t){const e=t.length,r=t[0],s=t.subarray(1);if(e!==o||2!==r&&3!==r){if(e===i&&4===r){return{x:n.fromBytes(s.subarray(0,n.BYTES)),y:n.fromBytes(s.subarray(n.BYTES,2*n.BYTES))}}throw new Error("invalid Point, expected length of "+o+", or uncompressed "+i+", got "+e)}{const t=H(s);if(!T(t,Lt,n.ORDER))throw new Error("Point is not on curve");const e=c(t);let o;try{o=n.sqrt(e)}catch(t){const e=t instanceof Error?": "+t.message:"";throw new Error("Point is not on curve"+e)}return 1==(1&r)!==((o&Lt)===Lt)&&(o=n.neg(o)),{x:t,y:o}}}}),l=t=>v(z(t,e.nByteLength));function d(t){return t>r>>Lt}const w=(t,e,n)=>H(t.slice(e,n));class g{constructor(t,e,n){this.r=t,this.s=e,this.recovery=n,this.assertValidity()}static fromCompact(t){const n=e.nByteLength;return t=C("compactSignature",t,2*n),new g(w(t,0,n),w(t,n,2*n))}static fromDER(t){const{r:e,s:n}=qt.toSig(C("DER",t));return new g(e,n)}assertValidity(){V("r",this.r,Lt,r),V("s",this.s,Lt,r)}addRecoveryBit(t){return new g(this.r,this.s,t)}recoverPublicKey(t){const{r:r,s:o,recovery:i}=this,a=B(C("msgHash",t));if(null==i||![0,1,2,3].includes(i))throw new Error("recovery id invalid");const c=2===i||3===i?r+e.n:r;if(c>=n.ORDER)throw new Error("recovery id 2 or 3 invalid");const h=0==(1&i)?"02":"03",d=u.fromHex(h+l(c)),w=f(c),g=s(-a*w),p=s(o*w),y=u.BASE.multiplyAndAddUnsafe(d,g,p);if(!y)throw new Error("point at infinify");return y.assertValidity(),y}hasHighS(){return d(this.s)}normalizeS(){return this.hasHighS()?new g(this.r,s(-this.s),this.recovery):this}toDERRawBytes(){return k(this.toDERHex())}toDERHex(){return qt.hexFromSig({r:this.r,s:this.s})}toCompactRawBytes(){return k(this.toCompactHex())}toCompactHex(){return l(this.r)+l(this.s)}}const p={isValidPrivateKey(t){try{return a(t),!0}catch(t){return!1}},normPrivateKeyToScalar:a,randomPrivateKey:()=>{const t=lt(e.n);return function(t,e,n=!1){const r=t.length,o=ht(e),i=lt(e);if(r<16||r<i||r>1024)throw new Error("expected "+i+"-1024 bytes of input, got "+r);const s=rt(n?U(t):H(t),e-Q)+Q;return n?F(s,o):z(s,o)}(e.randomBytes(t),e.n)},precompute(t=8,e=u.BASE){return e._setWindowSize(t),e.multiply(BigInt(3)),e}};function y(t){const e=m(t),n="string"==typeof t,r=(e||n)&&t.length;return e?r===o||r===i:n?r===2*o||r===2*i:t instanceof u}const E=e.bits2int||function(t){if(t.length>8192)throw new Error("input is too large");const n=H(t),r=8*t.length-e.nBitLength;return r>0?n>>BigInt(r):n},B=e.bits2int_modN||function(t){return s(E(t))},x=_(e.nBitLength);function S(t){return V("num < 2^"+e.nBitLength,t,Rt,x),z(t,e.nByteLength)}function A(t,r,o=I){if(["recovered","canonical"].some((t=>t in o)))throw new Error("sign() legacy options not supported");const{hash:i,randomBytes:c}=e;let{lowS:l,prehash:w,extraEntropy:p}=o;null==l&&(l=!0),t=C("msgHash",t),St(o),w&&(t=C("prehashed msgHash",i(t)));const y=B(t),m=a(r),b=[S(m),S(y)];if(null!=p&&!1!==p){const t=!0===p?c(n.BYTES):p;b.push(C("extraEntropy",t))}const v=P(...b),x=y;return{seed:v,k2sig:function(t){const e=E(t);if(!h(e))return;const n=f(e),r=u.BASE.multiply(e).toAffine(),o=s(r.x);if(o===Rt)return;const i=s(n*s(x+o*m));if(i===Rt)return;let a=(r.x===o?0:2)|Number(r.y&Lt),c=i;return l&&d(i)&&(c=function(t){return d(t)?s(-t):t}(i),a^=1),new g(o,c,a)}}}const I={lowS:e.lowS,prehash:!1},O={lowS:e.lowS,prehash:!1};return u.BASE._setWindowSize(8),{CURVE:e,getPublicKey:function(t,e=!0){return u.fromPrivateKey(t).toRawBytes(e)},getSharedSecret:function(t,e,n=!0){if(y(t))throw new Error("first arg must be private key");if(!y(e))throw new Error("second arg must be public key");return u.fromHex(e).multiply(a(t)).toRawBytes(n)},sign:function(t,n,r=I){const{seed:o,k2sig:i}=A(t,n,r),s=e;return G(s.hash.outputLen,s.nByteLength,s.hmac)(o,i)},verify:function(t,n,r,o=O){const i=t;n=C("msgHash",n),r=C("publicKey",r);const{lowS:a,prehash:c,format:h}=o;if(St(o),"strict"in o)throw new Error("options.strict was renamed to lowS");if(void 0!==h&&"compact"!==h&&"der"!==h)throw new Error("format must be compact or der");const l="string"==typeof i||m(i),d=!l&&!h&&"object"==typeof i&&null!==i&&"bigint"==typeof i.r&&"bigint"==typeof i.s;if(!l&&!d)throw new Error("invalid signature, expected Uint8Array, hex string or Signature instance");let w,p;try{if(d&&(w=new g(i.r,i.s)),l){try{"compact"!==h&&(w=g.fromDER(i))}catch(t){if(!(t instanceof qt.Err))throw t}w||"der"===h||(w=g.fromCompact(i))}p=u.fromHex(r)}catch(t){return!1}if(!w)return!1;if(a&&w.hasHighS())return!1;c&&(n=e.hash(n));const{r:y,s:E}=w,b=B(n),v=f(E),x=s(b*v),S=s(y*v),A=u.BASE.multiplyAndAddUnsafe(p,x,S)?.toAffine();return!!A&&s(A.x)===y},ProjectivePoint:u,Signature:g,utils:p}}function Ut(t){return{hash:t,hmac:(e,...n)=>w(t,e,(0,i.eV)(...n)),randomBytes:i.O6}}const zt=BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),Ft=BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),Ct=BigInt(1),Pt=BigInt(2),Zt=(t,e)=>(t+e/Pt)/e;function Tt(t){const e=zt,n=BigInt(3),r=BigInt(6),o=BigInt(11),i=BigInt(22),s=BigInt(23),f=BigInt(44),u=BigInt(88),a=t*t*t%e,c=a*a*t%e,h=it(c,n,e)*c%e,l=it(h,n,e)*c%e,d=it(l,Pt,e)*a%e,w=it(d,o,e)*d%e,g=it(w,i,e)*w%e,p=it(g,f,e)*g%e,y=it(p,u,e)*p%e,m=it(y,f,e)*g%e,E=it(m,n,e)*c%e,b=it(E,s,e)*w%e,B=it(b,r,e)*a%e,v=it(B,Pt,e);if(!Vt.eql(Vt.sqr(v),t))throw new Error("Cannot find square root");return v}const Vt=ct(zt,void 0,void 0,{sqrt:Tt}),Dt=function(t,e){const n=e=>Ht({...t,...Ut(e)});return{...n(e),create:n}}({a:BigInt(0),b:BigInt(7),Fp:Vt,n:Ft,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),h:BigInt(1),lowS:!0,endo:{beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee"),splitScalar:t=>{const e=Ft,n=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),r=-Ct*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),o=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),i=n,s=BigInt("0x100000000000000000000000000000000"),f=Zt(i*t,e),u=Zt(-r*t,e);let a=rt(t-f*n-u*o,e),c=rt(-f*r-u*i,e);const h=a>s,l=c>s;if(h&&(a=e-a),l&&(c=e-c),a>s||c>s)throw new Error("splitScalar: Endomorphism failed, k="+t);return{k1neg:h,k1:a,k2neg:l,k2:c}}}},l);BigInt(0);Dt.ProjectivePoint}}]);
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.