minimal-slp-wallet
Version:
A minimalist Bitcoin Cash (BCH) wallet npm library, for use in a web apps.
4 lines • 5.13 MB
JavaScript
var SlpWallet=(()=>{var j8e=Object.create;var Dv=Object.defineProperty;var F8e=Object.getOwnPropertyDescriptor;var K8e=Object.getOwnPropertyNames;var V8e=Object.getPrototypeOf,W8e=Object.prototype.hasOwnProperty;var gD=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,o)=>(typeof require<"u"?require:e)[o]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var Zi=(t,e)=>()=>(t&&(e=t(t=0)),e);var yt=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),i0=(t,e)=>{for(var o in e)Dv(t,o,{get:e[o],enumerable:!0})},yD=(t,e,o,c)=>{if(e&&typeof e=="object"||typeof e=="function")for(let u of K8e(e))!W8e.call(t,u)&&u!==o&&Dv(t,u,{get:()=>e[u],enumerable:!(c=F8e(e,u))||c.enumerable});return t};var Pt=(t,e,o)=>(o=t!=null?j8e(V8e(t)):{},yD(e||!t||!t.__esModule?Dv(o,"default",{value:t,enumerable:!0}):o,t)),pn=t=>yD(Dv({},"__esModule",{value:!0}),t);var ge=Zi(()=>{});var process={};i0(process,{_debugEnd:()=>fU,_debugProcess:()=>uU,_events:()=>xU,_eventsCount:()=>AU,_exiting:()=>jD,_fatalExceptions:()=>nU,_getActiveHandles:()=>WD,_getActiveRequests:()=>VD,_kill:()=>ZD,_linkedBinding:()=>HD,_maxListeners:()=>EU,_preload_modules:()=>wU,_rawDebug:()=>UD,_startProfilerIdleNotifier:()=>hU,_stopProfilerIdleNotifier:()=>cU,_tickCallback:()=>sU,abort:()=>vU,addListener:()=>BU,allowedNodeEnvironmentFlags:()=>tU,arch:()=>xD,argv:()=>kD,argv0:()=>yU,assert:()=>rU,binding:()=>PD,browser:()=>DD,chdir:()=>ND,config:()=>FD,cpuUsage:()=>Hv,cwd:()=>CD,debugPort:()=>gU,default:()=>NU,dlopen:()=>KD,domain:()=>zD,emit:()=>RU,emitWarning:()=>RD,env:()=>BD,execArgv:()=>$D,execPath:()=>_U,exit:()=>QD,features:()=>iU,hasUncaughtExceptionCaptureCallback:()=>oU,hrtime:()=>qv,kill:()=>YD,listeners:()=>CU,memoryUsage:()=>XD,moduleLoadList:()=>qD,nextTick:()=>MD,off:()=>$U,on:()=>ef,once:()=>kU,openStdin:()=>eU,pid:()=>bU,platform:()=>AD,ppid:()=>mU,prependListener:()=>PU,prependOnceListener:()=>OU,reallyExit:()=>GD,release:()=>LD,removeAllListeners:()=>IU,removeListener:()=>TU,resourceUsage:()=>JD,setSourceMapsEnabled:()=>MU,setUncaughtExceptionCaptureCallback:()=>aU,stderr:()=>dU,stdin:()=>pU,stdout:()=>lU,title:()=>ED,umask:()=>OD,uptime:()=>SU,version:()=>TD,versions:()=>ID});function ky(t){throw new Error("Node.js process "+t+" is not supported by JSPM core outside of Node.js")}function G8e(){!xl||!$c||(xl=!1,$c.length?Q0=$c.concat(Q0):Uv=-1,Q0.length&&wD())}function wD(){if(!xl){var t=setTimeout(G8e,0);xl=!0;for(var e=Q0.length;e;){for($c=Q0,Q0=[];++Uv<e;)$c&&$c[Uv].run();Uv=-1,e=Q0.length}$c=null,xl=!1,clearTimeout(t)}}function MD(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var o=1;o<arguments.length;o++)e[o-1]=arguments[o];Q0.push(new SD(t,e)),Q0.length===1&&!xl&&setTimeout(wD,0)}function SD(t,e){this.fun=t,this.array=e}function Ua(){}function HD(t){ky("_linkedBinding")}function KD(t){ky("dlopen")}function VD(){return[]}function WD(){return[]}function rU(t,e){if(!t)throw new Error(e||"assertion error")}function oU(){return!1}function SU(){return Xf.now()/1e3}function qv(t){var e=Math.floor((Date.now()-Xf.now())*.001),o=Xf.now()*.001,c=Math.floor(o)+e,u=Math.floor(o%1*1e9);return t&&(c=c-t[0],u=u-t[1],u<0&&(c--,u+=By)),[c,u]}function ef(){return NU}function CU(t){return[]}var Q0,xl,$c,Uv,ED,xD,AD,BD,kD,$D,TD,ID,RD,PD,OD,CD,ND,LD,DD,UD,qD,zD,jD,FD,GD,ZD,Hv,JD,XD,YD,QD,eU,tU,iU,nU,aU,sU,uU,fU,hU,cU,lU,dU,pU,vU,bU,mU,_U,gU,yU,wU,MU,Xf,Ay,By,EU,xU,AU,BU,kU,$U,TU,IU,RU,PU,OU,NU,LU=Zi(()=>{ge();we();ye();Q0=[],xl=!1,Uv=-1;SD.prototype.run=function(){this.fun.apply(null,this.array)};ED="browser",xD="x64",AD="browser",BD={PATH:"/usr/bin",LANG:typeof navigator<"u"?navigator.language+".UTF-8":void 0,PWD:"/",HOME:"/home",TMP:"/tmp"},kD=["/usr/bin/node"],$D=[],TD="v16.8.0",ID={},RD=function(t,e){console.warn((e?e+": ":"")+t)},PD=function(t){ky("binding")},OD=function(t){return 0},CD=function(){return"/"},ND=function(t){},LD={name:"node",sourceUrl:"",headersUrl:"",libUrl:""};DD=!0,UD=Ua,qD=[];zD={},jD=!1,FD={};GD=Ua,ZD=Ua,Hv=function(){return{}},JD=Hv,XD=Hv,YD=Ua,QD=Ua,eU=Ua,tU={};iU={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},nU=Ua,aU=Ua;sU=Ua,uU=Ua,fU=Ua,hU=Ua,cU=Ua,lU=void 0,dU=void 0,pU=void 0,vU=Ua,bU=2,mU=1,_U="/bin/usr/node",gU=9229,yU="node",wU=[],MU=Ua,Xf={now:typeof performance<"u"?performance.now.bind(performance):void 0,timing:typeof performance<"u"?performance.timing:void 0};Xf.now===void 0&&(Ay=Date.now(),Xf.timing&&Xf.timing.navigationStart&&(Ay=Xf.timing.navigationStart),Xf.now=()=>Date.now()-Ay);By=1e9;qv.bigint=function(t){var e=qv(t);return typeof BigInt>"u"?e[0]*By+e[1]:BigInt(e[0]*By)+BigInt(e[1])};EU=10,xU={},AU=0;BU=ef,kU=ef,$U=ef,TU=ef,IU=ef,RU=Ua,PU=ef,OU=ef;NU={version:TD,versions:ID,arch:xD,platform:AD,browser:DD,release:LD,_rawDebug:UD,moduleLoadList:qD,binding:PD,_linkedBinding:HD,_events:xU,_eventsCount:AU,_maxListeners:EU,on:ef,addListener:BU,once:kU,off:$U,removeListener:TU,removeAllListeners:IU,emit:RU,prependListener:PU,prependOnceListener:OU,listeners:CU,domain:zD,_exiting:jD,config:FD,dlopen:KD,uptime:SU,_getActiveRequests:VD,_getActiveHandles:WD,reallyExit:GD,_kill:ZD,cpuUsage:Hv,resourceUsage:JD,memoryUsage:XD,kill:YD,exit:QD,openStdin:eU,allowedNodeEnvironmentFlags:tU,assert:rU,features:iU,_fatalExceptions:nU,setUncaughtExceptionCaptureCallback:aU,hasUncaughtExceptionCaptureCallback:oU,emitWarning:RD,nextTick:MD,_tickCallback:sU,_debugProcess:uU,_debugEnd:fU,_startProfilerIdleNotifier:hU,_stopProfilerIdleNotifier:cU,stdout:lU,stdin:pU,stderr:dU,abort:vU,umask:OD,chdir:ND,cwd:CD,env:BD,title:ED,argv:kD,execArgv:$D,pid:bU,ppid:mU,execPath:_U,debugPort:gU,hrtime:qv,argv0:yU,_preload_modules:wU,setSourceMapsEnabled:MU}});var ye=Zi(()=>{LU()});function Z8e(){if(DU)return Yp;DU=!0,Yp.byteLength=g,Yp.toByteArray=S,Yp.fromByteArray=$;for(var t=[],e=[],o=typeof Uint8Array<"u"?Uint8Array:Array,c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",u=0,b=c.length;u<b;++u)t[u]=c[u],e[c.charCodeAt(u)]=u;e[45]=62,e[95]=63;function m(P){var O=P.length;if(O%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var N=P.indexOf("=");N===-1&&(N=O);var U=N===O?0:4-N%4;return[N,U]}function g(P){var O=m(P),N=O[0],U=O[1];return(N+U)*3/4-U}function E(P,O,N){return(O+N)*3/4-N}function S(P){var O,N=m(P),U=N[0],H=N[1],j=new o(E(P,U,H)),F=0,te=H>0?U-4:U,ee;for(ee=0;ee<te;ee+=4)O=e[P.charCodeAt(ee)]<<18|e[P.charCodeAt(ee+1)]<<12|e[P.charCodeAt(ee+2)]<<6|e[P.charCodeAt(ee+3)],j[F++]=O>>16&255,j[F++]=O>>8&255,j[F++]=O&255;return H===2&&(O=e[P.charCodeAt(ee)]<<2|e[P.charCodeAt(ee+1)]>>4,j[F++]=O&255),H===1&&(O=e[P.charCodeAt(ee)]<<10|e[P.charCodeAt(ee+1)]<<4|e[P.charCodeAt(ee+2)]>>2,j[F++]=O>>8&255,j[F++]=O&255),j}function M(P){return t[P>>18&63]+t[P>>12&63]+t[P>>6&63]+t[P&63]}function k(P,O,N){for(var U,H=[],j=O;j<N;j+=3)U=(P[j]<<16&16711680)+(P[j+1]<<8&65280)+(P[j+2]&255),H.push(M(U));return H.join("")}function $(P){for(var O,N=P.length,U=N%3,H=[],j=16383,F=0,te=N-U;F<te;F+=j)H.push(k(P,F,F+j>te?te:F+j));return U===1?(O=P[N-1],H.push(t[O>>2]+t[O<<4&63]+"==")):U===2&&(O=(P[N-2]<<8)+P[N-1],H.push(t[O>>10]+t[O>>4&63]+t[O<<2&63]+"=")),H.join("")}return Yp}function J8e(){if(UU)return zv;UU=!0;return zv.read=function(t,e,o,c,u){var b,m,g=u*8-c-1,E=(1<<g)-1,S=E>>1,M=-7,k=o?u-1:0,$=o?-1:1,P=t[e+k];for(k+=$,b=P&(1<<-M)-1,P>>=-M,M+=g;M>0;b=b*256+t[e+k],k+=$,M-=8);for(m=b&(1<<-M)-1,b>>=-M,M+=c;M>0;m=m*256+t[e+k],k+=$,M-=8);if(b===0)b=1-S;else{if(b===E)return m?NaN:(P?-1:1)*(1/0);m=m+Math.pow(2,c),b=b-S}return(P?-1:1)*m*Math.pow(2,b-c)},zv.write=function(t,e,o,c,u,b){var m,g,E,S=b*8-u-1,M=(1<<S)-1,k=M>>1,$=u===23?Math.pow(2,-24)-Math.pow(2,-77):0,P=c?0:b-1,O=c?1:-1,N=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(g=isNaN(e)?1:0,m=M):(m=Math.floor(Math.log(e)/Math.LN2),e*(E=Math.pow(2,-m))<1&&(m--,E*=2),m+k>=1?e+=$/E:e+=$*Math.pow(2,1-k),e*E>=2&&(m++,E/=2),m+k>=M?(g=0,m=M):m+k>=1?(g=(e*E-1)*Math.pow(2,u),m=m+k):(g=e*Math.pow(2,k-1)*Math.pow(2,u),m=0));u>=8;t[o+P]=g&255,P+=O,g/=256,u-=8);for(m=m<<u|g,S+=u;S>0;t[o+P]=m&255,P+=O,m/=256,S-=8);t[o+P-O]|=N*128},zv}function vi(){if(qU)return Tc;qU=!0;let t=Z8e(),e=J8e(),o=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Tc.Buffer=m,Tc.SlowBuffer=H,Tc.INSPECT_MAX_BYTES=50;let c=2147483647;Tc.kMaxLength=c,m.TYPED_ARRAY_SUPPORT=u(),!m.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function u(){try{let ie=new Uint8Array(1),J={foo:function(){return 42}};return Object.setPrototypeOf(J,Uint8Array.prototype),Object.setPrototypeOf(ie,J),ie.foo()===42}catch{return!1}}Object.defineProperty(m.prototype,"parent",{enumerable:!0,get:function(){if(m.isBuffer(this))return this.buffer}}),Object.defineProperty(m.prototype,"offset",{enumerable:!0,get:function(){if(m.isBuffer(this))return this.byteOffset}});function b(ie){if(ie>c)throw new RangeError('The value "'+ie+'" is invalid for option "size"');let J=new Uint8Array(ie);return Object.setPrototypeOf(J,m.prototype),J}function m(ie,J,ae){if(typeof ie=="number"){if(typeof J=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return M(ie)}return g(ie,J,ae)}m.poolSize=8192;function g(ie,J,ae){if(typeof ie=="string")return k(ie,J);if(ArrayBuffer.isView(ie))return P(ie);if(ie==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof ie);if(ke(ie,ArrayBuffer)||ie&&ke(ie.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(ke(ie,SharedArrayBuffer)||ie&&ke(ie.buffer,SharedArrayBuffer)))return O(ie,J,ae);if(typeof ie=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let fe=ie.valueOf&&ie.valueOf();if(fe!=null&&fe!==ie)return m.from(fe,J,ae);let Me=N(ie);if(Me)return Me;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof ie[Symbol.toPrimitive]=="function")return m.from(ie[Symbol.toPrimitive]("string"),J,ae);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof ie)}m.from=function(ie,J,ae){return g(ie,J,ae)},Object.setPrototypeOf(m.prototype,Uint8Array.prototype),Object.setPrototypeOf(m,Uint8Array);function E(ie){if(typeof ie!="number")throw new TypeError('"size" argument must be of type number');if(ie<0)throw new RangeError('The value "'+ie+'" is invalid for option "size"')}function S(ie,J,ae){return E(ie),ie<=0?b(ie):J!==void 0?typeof ae=="string"?b(ie).fill(J,ae):b(ie).fill(J):b(ie)}m.alloc=function(ie,J,ae){return S(ie,J,ae)};function M(ie){return E(ie),b(ie<0?0:U(ie)|0)}m.allocUnsafe=function(ie){return M(ie)},m.allocUnsafeSlow=function(ie){return M(ie)};function k(ie,J){if((typeof J!="string"||J==="")&&(J="utf8"),!m.isEncoding(J))throw new TypeError("Unknown encoding: "+J);let ae=j(ie,J)|0,fe=b(ae),Me=fe.write(ie,J);return Me!==ae&&(fe=fe.slice(0,Me)),fe}function $(ie){let J=ie.length<0?0:U(ie.length)|0,ae=b(J);for(let fe=0;fe<J;fe+=1)ae[fe]=ie[fe]&255;return ae}function P(ie){if(ke(ie,Uint8Array)){let J=new Uint8Array(ie);return O(J.buffer,J.byteOffset,J.byteLength)}return $(ie)}function O(ie,J,ae){if(J<0||ie.byteLength<J)throw new RangeError('"offset" is outside of buffer bounds');if(ie.byteLength<J+(ae||0))throw new RangeError('"length" is outside of buffer bounds');let fe;return J===void 0&&ae===void 0?fe=new Uint8Array(ie):ae===void 0?fe=new Uint8Array(ie,J):fe=new Uint8Array(ie,J,ae),Object.setPrototypeOf(fe,m.prototype),fe}function N(ie){if(m.isBuffer(ie)){let J=U(ie.length)|0,ae=b(J);return ae.length===0||ie.copy(ae,0,0,J),ae}if(ie.length!==void 0)return typeof ie.length!="number"||xe(ie.length)?b(0):$(ie);if(ie.type==="Buffer"&&Array.isArray(ie.data))return $(ie.data)}function U(ie){if(ie>=c)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+c.toString(16)+" bytes");return ie|0}function H(ie){return+ie!=ie&&(ie=0),m.alloc(+ie)}m.isBuffer=function(J){return J!=null&&J._isBuffer===!0&&J!==m.prototype},m.compare=function(J,ae){if(ke(J,Uint8Array)&&(J=m.from(J,J.offset,J.byteLength)),ke(ae,Uint8Array)&&(ae=m.from(ae,ae.offset,ae.byteLength)),!m.isBuffer(J)||!m.isBuffer(ae))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(J===ae)return 0;let fe=J.length,Me=ae.length;for(let $e=0,Se=Math.min(fe,Me);$e<Se;++$e)if(J[$e]!==ae[$e]){fe=J[$e],Me=ae[$e];break}return fe<Me?-1:Me<fe?1:0},m.isEncoding=function(J){switch(String(J).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},m.concat=function(J,ae){if(!Array.isArray(J))throw new TypeError('"list" argument must be an Array of Buffers');if(J.length===0)return m.alloc(0);let fe;if(ae===void 0)for(ae=0,fe=0;fe<J.length;++fe)ae+=J[fe].length;let Me=m.allocUnsafe(ae),$e=0;for(fe=0;fe<J.length;++fe){let Se=J[fe];if(ke(Se,Uint8Array))$e+Se.length>Me.length?(m.isBuffer(Se)||(Se=m.from(Se)),Se.copy(Me,$e)):Uint8Array.prototype.set.call(Me,Se,$e);else if(m.isBuffer(Se))Se.copy(Me,$e);else throw new TypeError('"list" argument must be an Array of Buffers');$e+=Se.length}return Me};function j(ie,J){if(m.isBuffer(ie))return ie.length;if(ArrayBuffer.isView(ie)||ke(ie,ArrayBuffer))return ie.byteLength;if(typeof ie!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof ie);let ae=ie.length,fe=arguments.length>2&&arguments[2]===!0;if(!fe&&ae===0)return 0;let Me=!1;for(;;)switch(J){case"ascii":case"latin1":case"binary":return ae;case"utf8":case"utf-8":return ve(ie).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ae*2;case"hex":return ae>>>1;case"base64":return Be(ie).length;default:if(Me)return fe?-1:ve(ie).length;J=(""+J).toLowerCase(),Me=!0}}m.byteLength=j;function F(ie,J,ae){let fe=!1;if((J===void 0||J<0)&&(J=0),J>this.length||((ae===void 0||ae>this.length)&&(ae=this.length),ae<=0)||(ae>>>=0,J>>>=0,ae<=J))return"";for(ie||(ie="utf8");;)switch(ie){case"hex":return y(this,J,ae);case"utf8":case"utf-8":return d(this,J,ae);case"ascii":return A(this,J,ae);case"latin1":case"binary":return T(this,J,ae);case"base64":return h(this,J,ae);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return l(this,J,ae);default:if(fe)throw new TypeError("Unknown encoding: "+ie);ie=(ie+"").toLowerCase(),fe=!0}}m.prototype._isBuffer=!0;function te(ie,J,ae){let fe=ie[J];ie[J]=ie[ae],ie[ae]=fe}m.prototype.swap16=function(){let J=this.length;if(J%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let ae=0;ae<J;ae+=2)te(this,ae,ae+1);return this},m.prototype.swap32=function(){let J=this.length;if(J%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let ae=0;ae<J;ae+=4)te(this,ae,ae+3),te(this,ae+1,ae+2);return this},m.prototype.swap64=function(){let J=this.length;if(J%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let ae=0;ae<J;ae+=8)te(this,ae,ae+7),te(this,ae+1,ae+6),te(this,ae+2,ae+5),te(this,ae+3,ae+4);return this},m.prototype.toString=function(){let J=this.length;return J===0?"":arguments.length===0?d(this,0,J):F.apply(this,arguments)},m.prototype.toLocaleString=m.prototype.toString,m.prototype.equals=function(J){if(!m.isBuffer(J))throw new TypeError("Argument must be a Buffer");return this===J?!0:m.compare(this,J)===0},m.prototype.inspect=function(){let J="",ae=Tc.INSPECT_MAX_BYTES;return J=this.toString("hex",0,ae).replace(/(.{2})/g,"$1 ").trim(),this.length>ae&&(J+=" ... "),"<Buffer "+J+">"},o&&(m.prototype[o]=m.prototype.inspect),m.prototype.compare=function(J,ae,fe,Me,$e){if(ke(J,Uint8Array)&&(J=m.from(J,J.offset,J.byteLength)),!m.isBuffer(J))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof J);if(ae===void 0&&(ae=0),fe===void 0&&(fe=J?J.length:0),Me===void 0&&(Me=0),$e===void 0&&($e=this.length),ae<0||fe>J.length||Me<0||$e>this.length)throw new RangeError("out of range index");if(Me>=$e&&ae>=fe)return 0;if(Me>=$e)return-1;if(ae>=fe)return 1;if(ae>>>=0,fe>>>=0,Me>>>=0,$e>>>=0,this===J)return 0;let Se=$e-Me,Oe=fe-ae,ze=Math.min(Se,Oe),Te=this.slice(Me,$e),Ue=J.slice(ae,fe);for(let _t=0;_t<ze;++_t)if(Te[_t]!==Ue[_t]){Se=Te[_t],Oe=Ue[_t];break}return Se<Oe?-1:Oe<Se?1:0};function ee(ie,J,ae,fe,Me){if(ie.length===0)return-1;if(typeof ae=="string"?(fe=ae,ae=0):ae>2147483647?ae=2147483647:ae<-2147483648&&(ae=-2147483648),ae=+ae,xe(ae)&&(ae=Me?0:ie.length-1),ae<0&&(ae=ie.length+ae),ae>=ie.length){if(Me)return-1;ae=ie.length-1}else if(ae<0)if(Me)ae=0;else return-1;if(typeof J=="string"&&(J=m.from(J,fe)),m.isBuffer(J))return J.length===0?-1:se(ie,J,ae,fe,Me);if(typeof J=="number")return J=J&255,typeof Uint8Array.prototype.indexOf=="function"?Me?Uint8Array.prototype.indexOf.call(ie,J,ae):Uint8Array.prototype.lastIndexOf.call(ie,J,ae):se(ie,[J],ae,fe,Me);throw new TypeError("val must be string, number or Buffer")}function se(ie,J,ae,fe,Me){let $e=1,Se=ie.length,Oe=J.length;if(fe!==void 0&&(fe=String(fe).toLowerCase(),fe==="ucs2"||fe==="ucs-2"||fe==="utf16le"||fe==="utf-16le")){if(ie.length<2||J.length<2)return-1;$e=2,Se/=2,Oe/=2,ae/=2}function ze(Ue,_t){return $e===1?Ue[_t]:Ue.readUInt16BE(_t*$e)}let Te;if(Me){let Ue=-1;for(Te=ae;Te<Se;Te++)if(ze(ie,Te)===ze(J,Ue===-1?0:Te-Ue)){if(Ue===-1&&(Ue=Te),Te-Ue+1===Oe)return Ue*$e}else Ue!==-1&&(Te-=Te-Ue),Ue=-1}else for(ae+Oe>Se&&(ae=Se-Oe),Te=ae;Te>=0;Te--){let Ue=!0;for(let _t=0;_t<Oe;_t++)if(ze(ie,Te+_t)!==ze(J,_t)){Ue=!1;break}if(Ue)return Te}return-1}m.prototype.includes=function(J,ae,fe){return this.indexOf(J,ae,fe)!==-1},m.prototype.indexOf=function(J,ae,fe){return ee(this,J,ae,fe,!0)},m.prototype.lastIndexOf=function(J,ae,fe){return ee(this,J,ae,fe,!1)};function B(ie,J,ae,fe){ae=Number(ae)||0;let Me=ie.length-ae;fe?(fe=Number(fe),fe>Me&&(fe=Me)):fe=Me;let $e=J.length;fe>$e/2&&(fe=$e/2);let Se;for(Se=0;Se<fe;++Se){let Oe=parseInt(J.substr(Se*2,2),16);if(xe(Oe))return Se;ie[ae+Se]=Oe}return Se}function I(ie,J,ae,fe){return _e(ve(J,ie.length-ae),ie,ae,fe)}function C(ie,J,ae,fe){return _e(he(J),ie,ae,fe)}function p(ie,J,ae,fe){return _e(Be(J),ie,ae,fe)}function a(ie,J,ae,fe){return _e(be(J,ie.length-ae),ie,ae,fe)}m.prototype.write=function(J,ae,fe,Me){if(ae===void 0)Me="utf8",fe=this.length,ae=0;else if(fe===void 0&&typeof ae=="string")Me=ae,fe=this.length,ae=0;else if(isFinite(ae))ae=ae>>>0,isFinite(fe)?(fe=fe>>>0,Me===void 0&&(Me="utf8")):(Me=fe,fe=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let $e=this.length-ae;if((fe===void 0||fe>$e)&&(fe=$e),J.length>0&&(fe<0||ae<0)||ae>this.length)throw new RangeError("Attempt to write outside buffer bounds");Me||(Me="utf8");let Se=!1;for(;;)switch(Me){case"hex":return B(this,J,ae,fe);case"utf8":case"utf-8":return I(this,J,ae,fe);case"ascii":case"latin1":case"binary":return C(this,J,ae,fe);case"base64":return p(this,J,ae,fe);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return a(this,J,ae,fe);default:if(Se)throw new TypeError("Unknown encoding: "+Me);Me=(""+Me).toLowerCase(),Se=!0}},m.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function h(ie,J,ae){return J===0&&ae===ie.length?t.fromByteArray(ie):t.fromByteArray(ie.slice(J,ae))}function d(ie,J,ae){ae=Math.min(ie.length,ae);let fe=[],Me=J;for(;Me<ae;){let $e=ie[Me],Se=null,Oe=$e>239?4:$e>223?3:$e>191?2:1;if(Me+Oe<=ae){let ze,Te,Ue,_t;switch(Oe){case 1:$e<128&&(Se=$e);break;case 2:ze=ie[Me+1],(ze&192)===128&&(_t=($e&31)<<6|ze&63,_t>127&&(Se=_t));break;case 3:ze=ie[Me+1],Te=ie[Me+2],(ze&192)===128&&(Te&192)===128&&(_t=($e&15)<<12|(ze&63)<<6|Te&63,_t>2047&&(_t<55296||_t>57343)&&(Se=_t));break;case 4:ze=ie[Me+1],Te=ie[Me+2],Ue=ie[Me+3],(ze&192)===128&&(Te&192)===128&&(Ue&192)===128&&(_t=($e&15)<<18|(ze&63)<<12|(Te&63)<<6|Ue&63,_t>65535&&_t<1114112&&(Se=_t))}}Se===null?(Se=65533,Oe=1):Se>65535&&(Se-=65536,fe.push(Se>>>10&1023|55296),Se=56320|Se&1023),fe.push(Se),Me+=Oe}return _(fe)}let v=4096;function _(ie){let J=ie.length;if(J<=v)return String.fromCharCode.apply(String,ie);let ae="",fe=0;for(;fe<J;)ae+=String.fromCharCode.apply(String,ie.slice(fe,fe+=v));return ae}function A(ie,J,ae){let fe="";ae=Math.min(ie.length,ae);for(let Me=J;Me<ae;++Me)fe+=String.fromCharCode(ie[Me]&127);return fe}function T(ie,J,ae){let fe="";ae=Math.min(ie.length,ae);for(let Me=J;Me<ae;++Me)fe+=String.fromCharCode(ie[Me]);return fe}function y(ie,J,ae){let fe=ie.length;(!J||J<0)&&(J=0),(!ae||ae<0||ae>fe)&&(ae=fe);let Me="";for(let $e=J;$e<ae;++$e)Me+=me[ie[$e]];return Me}function l(ie,J,ae){let fe=ie.slice(J,ae),Me="";for(let $e=0;$e<fe.length-1;$e+=2)Me+=String.fromCharCode(fe[$e]+fe[$e+1]*256);return Me}m.prototype.slice=function(J,ae){let fe=this.length;J=~~J,ae=ae===void 0?fe:~~ae,J<0?(J+=fe,J<0&&(J=0)):J>fe&&(J=fe),ae<0?(ae+=fe,ae<0&&(ae=0)):ae>fe&&(ae=fe),ae<J&&(ae=J);let Me=this.subarray(J,ae);return Object.setPrototypeOf(Me,m.prototype),Me};function w(ie,J,ae){if(ie%1!==0||ie<0)throw new RangeError("offset is not uint");if(ie+J>ae)throw new RangeError("Trying to access beyond buffer length")}m.prototype.readUintLE=m.prototype.readUIntLE=function(J,ae,fe){J=J>>>0,ae=ae>>>0,fe||w(J,ae,this.length);let Me=this[J],$e=1,Se=0;for(;++Se<ae&&($e*=256);)Me+=this[J+Se]*$e;return Me},m.prototype.readUintBE=m.prototype.readUIntBE=function(J,ae,fe){J=J>>>0,ae=ae>>>0,fe||w(J,ae,this.length);let Me=this[J+--ae],$e=1;for(;ae>0&&($e*=256);)Me+=this[J+--ae]*$e;return Me},m.prototype.readUint8=m.prototype.readUInt8=function(J,ae){return J=J>>>0,ae||w(J,1,this.length),this[J]},m.prototype.readUint16LE=m.prototype.readUInt16LE=function(J,ae){return J=J>>>0,ae||w(J,2,this.length),this[J]|this[J+1]<<8},m.prototype.readUint16BE=m.prototype.readUInt16BE=function(J,ae){return J=J>>>0,ae||w(J,2,this.length),this[J]<<8|this[J+1]},m.prototype.readUint32LE=m.prototype.readUInt32LE=function(J,ae){return J=J>>>0,ae||w(J,4,this.length),(this[J]|this[J+1]<<8|this[J+2]<<16)+this[J+3]*16777216},m.prototype.readUint32BE=m.prototype.readUInt32BE=function(J,ae){return J=J>>>0,ae||w(J,4,this.length),this[J]*16777216+(this[J+1]<<16|this[J+2]<<8|this[J+3])},m.prototype.readBigUInt64LE=ce(function(J){J=J>>>0,Q(J,"offset");let ae=this[J],fe=this[J+7];(ae===void 0||fe===void 0)&&re(J,this.length-8);let Me=ae+this[++J]*2**8+this[++J]*2**16+this[++J]*2**24,$e=this[++J]+this[++J]*2**8+this[++J]*2**16+fe*2**24;return BigInt(Me)+(BigInt($e)<<BigInt(32))}),m.prototype.readBigUInt64BE=ce(function(J){J=J>>>0,Q(J,"offset");let ae=this[J],fe=this[J+7];(ae===void 0||fe===void 0)&&re(J,this.length-8);let Me=ae*2**24+this[++J]*2**16+this[++J]*2**8+this[++J],$e=this[++J]*2**24+this[++J]*2**16+this[++J]*2**8+fe;return(BigInt(Me)<<BigInt(32))+BigInt($e)}),m.prototype.readIntLE=function(J,ae,fe){J=J>>>0,ae=ae>>>0,fe||w(J,ae,this.length);let Me=this[J],$e=1,Se=0;for(;++Se<ae&&($e*=256);)Me+=this[J+Se]*$e;return $e*=128,Me>=$e&&(Me-=Math.pow(2,8*ae)),Me},m.prototype.readIntBE=function(J,ae,fe){J=J>>>0,ae=ae>>>0,fe||w(J,ae,this.length);let Me=ae,$e=1,Se=this[J+--Me];for(;Me>0&&($e*=256);)Se+=this[J+--Me]*$e;return $e*=128,Se>=$e&&(Se-=Math.pow(2,8*ae)),Se},m.prototype.readInt8=function(J,ae){return J=J>>>0,ae||w(J,1,this.length),this[J]&128?(255-this[J]+1)*-1:this[J]},m.prototype.readInt16LE=function(J,ae){J=J>>>0,ae||w(J,2,this.length);let fe=this[J]|this[J+1]<<8;return fe&32768?fe|4294901760:fe},m.prototype.readInt16BE=function(J,ae){J=J>>>0,ae||w(J,2,this.length);let fe=this[J+1]|this[J]<<8;return fe&32768?fe|4294901760:fe},m.prototype.readInt32LE=function(J,ae){return J=J>>>0,ae||w(J,4,this.length),this[J]|this[J+1]<<8|this[J+2]<<16|this[J+3]<<24},m.prototype.readInt32BE=function(J,ae){return J=J>>>0,ae||w(J,4,this.length),this[J]<<24|this[J+1]<<16|this[J+2]<<8|this[J+3]},m.prototype.readBigInt64LE=ce(function(J){J=J>>>0,Q(J,"offset");let ae=this[J],fe=this[J+7];(ae===void 0||fe===void 0)&&re(J,this.length-8);let Me=this[J+4]+this[J+5]*2**8+this[J+6]*2**16+(fe<<24);return(BigInt(Me)<<BigInt(32))+BigInt(ae+this[++J]*2**8+this[++J]*2**16+this[++J]*2**24)}),m.prototype.readBigInt64BE=ce(function(J){J=J>>>0,Q(J,"offset");let ae=this[J],fe=this[J+7];(ae===void 0||fe===void 0)&&re(J,this.length-8);let Me=(ae<<24)+this[++J]*2**16+this[++J]*2**8+this[++J];return(BigInt(Me)<<BigInt(32))+BigInt(this[++J]*2**24+this[++J]*2**16+this[++J]*2**8+fe)}),m.prototype.readFloatLE=function(J,ae){return J=J>>>0,ae||w(J,4,this.length),e.read(this,J,!0,23,4)},m.prototype.readFloatBE=function(J,ae){return J=J>>>0,ae||w(J,4,this.length),e.read(this,J,!1,23,4)},m.prototype.readDoubleLE=function(J,ae){return J=J>>>0,ae||w(J,8,this.length),e.read(this,J,!0,52,8)},m.prototype.readDoubleBE=function(J,ae){return J=J>>>0,ae||w(J,8,this.length),e.read(this,J,!1,52,8)};function L(ie,J,ae,fe,Me,$e){if(!m.isBuffer(ie))throw new TypeError('"buffer" argument must be a Buffer instance');if(J>Me||J<$e)throw new RangeError('"value" argument is out of bounds');if(ae+fe>ie.length)throw new RangeError("Index out of range")}m.prototype.writeUintLE=m.prototype.writeUIntLE=function(J,ae,fe,Me){if(J=+J,ae=ae>>>0,fe=fe>>>0,!Me){let Oe=Math.pow(2,8*fe)-1;L(this,J,ae,fe,Oe,0)}let $e=1,Se=0;for(this[ae]=J&255;++Se<fe&&($e*=256);)this[ae+Se]=J/$e&255;return ae+fe},m.prototype.writeUintBE=m.prototype.writeUIntBE=function(J,ae,fe,Me){if(J=+J,ae=ae>>>0,fe=fe>>>0,!Me){let Oe=Math.pow(2,8*fe)-1;L(this,J,ae,fe,Oe,0)}let $e=fe-1,Se=1;for(this[ae+$e]=J&255;--$e>=0&&(Se*=256);)this[ae+$e]=J/Se&255;return ae+fe},m.prototype.writeUint8=m.prototype.writeUInt8=function(J,ae,fe){return J=+J,ae=ae>>>0,fe||L(this,J,ae,1,255,0),this[ae]=J&255,ae+1},m.prototype.writeUint16LE=m.prototype.writeUInt16LE=function(J,ae,fe){return J=+J,ae=ae>>>0,fe||L(this,J,ae,2,65535,0),this[ae]=J&255,this[ae+1]=J>>>8,ae+2},m.prototype.writeUint16BE=m.prototype.writeUInt16BE=function(J,ae,fe){return J=+J,ae=ae>>>0,fe||L(this,J,ae,2,65535,0),this[ae]=J>>>8,this[ae+1]=J&255,ae+2},m.prototype.writeUint32LE=m.prototype.writeUInt32LE=function(J,ae,fe){return J=+J,ae=ae>>>0,fe||L(this,J,ae,4,4294967295,0),this[ae+3]=J>>>24,this[ae+2]=J>>>16,this[ae+1]=J>>>8,this[ae]=J&255,ae+4},m.prototype.writeUint32BE=m.prototype.writeUInt32BE=function(J,ae,fe){return J=+J,ae=ae>>>0,fe||L(this,J,ae,4,4294967295,0),this[ae]=J>>>24,this[ae+1]=J>>>16,this[ae+2]=J>>>8,this[ae+3]=J&255,ae+4};function D(ie,J,ae,fe,Me){Z(J,fe,Me,ie,ae,7);let $e=Number(J&BigInt(4294967295));ie[ae++]=$e,$e=$e>>8,ie[ae++]=$e,$e=$e>>8,ie[ae++]=$e,$e=$e>>8,ie[ae++]=$e;let Se=Number(J>>BigInt(32)&BigInt(4294967295));return ie[ae++]=Se,Se=Se>>8,ie[ae++]=Se,Se=Se>>8,ie[ae++]=Se,Se=Se>>8,ie[ae++]=Se,ae}function q(ie,J,ae,fe,Me){Z(J,fe,Me,ie,ae,7);let $e=Number(J&BigInt(4294967295));ie[ae+7]=$e,$e=$e>>8,ie[ae+6]=$e,$e=$e>>8,ie[ae+5]=$e,$e=$e>>8,ie[ae+4]=$e;let Se=Number(J>>BigInt(32)&BigInt(4294967295));return ie[ae+3]=Se,Se=Se>>8,ie[ae+2]=Se,Se=Se>>8,ie[ae+1]=Se,Se=Se>>8,ie[ae]=Se,ae+8}m.prototype.writeBigUInt64LE=ce(function(J,ae=0){return D(this,J,ae,BigInt(0),BigInt("0xffffffffffffffff"))}),m.prototype.writeBigUInt64BE=ce(function(J,ae=0){return q(this,J,ae,BigInt(0),BigInt("0xffffffffffffffff"))}),m.prototype.writeIntLE=function(J,ae,fe,Me){if(J=+J,ae=ae>>>0,!Me){let ze=Math.pow(2,8*fe-1);L(this,J,ae,fe,ze-1,-ze)}let $e=0,Se=1,Oe=0;for(this[ae]=J&255;++$e<fe&&(Se*=256);)J<0&&Oe===0&&this[ae+$e-1]!==0&&(Oe=1),this[ae+$e]=(J/Se>>0)-Oe&255;return ae+fe},m.prototype.writeIntBE=function(J,ae,fe,Me){if(J=+J,ae=ae>>>0,!Me){let ze=Math.pow(2,8*fe-1);L(this,J,ae,fe,ze-1,-ze)}let $e=fe-1,Se=1,Oe=0;for(this[ae+$e]=J&255;--$e>=0&&(Se*=256);)J<0&&Oe===0&&this[ae+$e+1]!==0&&(Oe=1),this[ae+$e]=(J/Se>>0)-Oe&255;return ae+fe},m.prototype.writeInt8=function(J,ae,fe){return J=+J,ae=ae>>>0,fe||L(this,J,ae,1,127,-128),J<0&&(J=255+J+1),this[ae]=J&255,ae+1},m.prototype.writeInt16LE=function(J,ae,fe){return J=+J,ae=ae>>>0,fe||L(this,J,ae,2,32767,-32768),this[ae]=J&255,this[ae+1]=J>>>8,ae+2},m.prototype.writeInt16BE=function(J,ae,fe){return J=+J,ae=ae>>>0,fe||L(this,J,ae,2,32767,-32768),this[ae]=J>>>8,this[ae+1]=J&255,ae+2},m.prototype.writeInt32LE=function(J,ae,fe){return J=+J,ae=ae>>>0,fe||L(this,J,ae,4,2147483647,-2147483648),this[ae]=J&255,this[ae+1]=J>>>8,this[ae+2]=J>>>16,this[ae+3]=J>>>24,ae+4},m.prototype.writeInt32BE=function(J,ae,fe){return J=+J,ae=ae>>>0,fe||L(this,J,ae,4,2147483647,-2147483648),J<0&&(J=4294967295+J+1),this[ae]=J>>>24,this[ae+1]=J>>>16,this[ae+2]=J>>>8,this[ae+3]=J&255,ae+4},m.prototype.writeBigInt64LE=ce(function(J,ae=0){return D(this,J,ae,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),m.prototype.writeBigInt64BE=ce(function(J,ae=0){return q(this,J,ae,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function V(ie,J,ae,fe,Me,$e){if(ae+fe>ie.length)throw new RangeError("Index out of range");if(ae<0)throw new RangeError("Index out of range")}function Y(ie,J,ae,fe,Me){return J=+J,ae=ae>>>0,Me||V(ie,J,ae,4),e.write(ie,J,ae,fe,23,4),ae+4}m.prototype.writeFloatLE=function(J,ae,fe){return Y(this,J,ae,!0,fe)},m.prototype.writeFloatBE=function(J,ae,fe){return Y(this,J,ae,!1,fe)};function pe(ie,J,ae,fe,Me){return J=+J,ae=ae>>>0,Me||V(ie,J,ae,8),e.write(ie,J,ae,fe,52,8),ae+8}m.prototype.writeDoubleLE=function(J,ae,fe){return pe(this,J,ae,!0,fe)},m.prototype.writeDoubleBE=function(J,ae,fe){return pe(this,J,ae,!1,fe)},m.prototype.copy=function(J,ae,fe,Me){if(!m.isBuffer(J))throw new TypeError("argument should be a Buffer");if(fe||(fe=0),!Me&&Me!==0&&(Me=this.length),ae>=J.length&&(ae=J.length),ae||(ae=0),Me>0&&Me<fe&&(Me=fe),Me===fe||J.length===0||this.length===0)return 0;if(ae<0)throw new RangeError("targetStart out of bounds");if(fe<0||fe>=this.length)throw new RangeError("Index out of range");if(Me<0)throw new RangeError("sourceEnd out of bounds");Me>this.length&&(Me=this.length),J.length-ae<Me-fe&&(Me=J.length-ae+fe);let $e=Me-fe;return this===J&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(ae,fe,Me):Uint8Array.prototype.set.call(J,this.subarray(fe,Me),ae),$e},m.prototype.fill=function(J,ae,fe,Me){if(typeof J=="string"){if(typeof ae=="string"?(Me=ae,ae=0,fe=this.length):typeof fe=="string"&&(Me=fe,fe=this.length),Me!==void 0&&typeof Me!="string")throw new TypeError("encoding must be a string");if(typeof Me=="string"&&!m.isEncoding(Me))throw new TypeError("Unknown encoding: "+Me);if(J.length===1){let Se=J.charCodeAt(0);(Me==="utf8"&&Se<128||Me==="latin1")&&(J=Se)}}else typeof J=="number"?J=J&255:typeof J=="boolean"&&(J=Number(J));if(ae<0||this.length<ae||this.length<fe)throw new RangeError("Out of range index");if(fe<=ae)return this;ae=ae>>>0,fe=fe===void 0?this.length:fe>>>0,J||(J=0);let $e;if(typeof J=="number")for($e=ae;$e<fe;++$e)this[$e]=J;else{let Se=m.isBuffer(J)?J:m.from(J,Me),Oe=Se.length;if(Oe===0)throw new TypeError('The value "'+J+'" is invalid for argument "value"');for($e=0;$e<fe-ae;++$e)this[$e+ae]=Se[$e%Oe]}return this};let de={};function X(ie,J,ae){de[ie]=class extends ae{constructor(){super(),Object.defineProperty(this,"message",{value:J.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${ie}]`,this.stack,delete this.name}get code(){return ie}set code(Me){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:Me,writable:!0})}toString(){return`${this.name} [${ie}]: ${this.message}`}}}X("ERR_BUFFER_OUT_OF_BOUNDS",function(ie){return ie?`${ie} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),X("ERR_INVALID_ARG_TYPE",function(ie,J){return`The "${ie}" argument must be of type number. Received type ${typeof J}`},TypeError),X("ERR_OUT_OF_RANGE",function(ie,J,ae){let fe=`The value of "${ie}" is out of range.`,Me=ae;return Number.isInteger(ae)&&Math.abs(ae)>2**32?Me=ue(String(ae)):typeof ae=="bigint"&&(Me=String(ae),(ae>BigInt(2)**BigInt(32)||ae<-(BigInt(2)**BigInt(32)))&&(Me=ue(Me)),Me+="n"),fe+=` It must be ${J}. Received ${Me}`,fe},RangeError);function ue(ie){let J="",ae=ie.length,fe=ie[0]==="-"?1:0;for(;ae>=fe+4;ae-=3)J=`_${ie.slice(ae-3,ae)}${J}`;return`${ie.slice(0,ae)}${J}`}function ne(ie,J,ae){Q(J,"offset"),(ie[J]===void 0||ie[J+ae]===void 0)&&re(J,ie.length-(ae+1))}function Z(ie,J,ae,fe,Me,$e){if(ie>ae||ie<J){let Se=typeof J=="bigint"?"n":"",Oe;throw J===0||J===BigInt(0)?Oe=`>= 0${Se} and < 2${Se} ** ${($e+1)*8}${Se}`:Oe=`>= -(2${Se} ** ${($e+1)*8-1}${Se}) and < 2 ** ${($e+1)*8-1}${Se}`,new de.ERR_OUT_OF_RANGE("value",Oe,ie)}ne(fe,Me,$e)}function Q(ie,J){if(typeof ie!="number")throw new de.ERR_INVALID_ARG_TYPE(J,"number",ie)}function re(ie,J,ae){throw Math.floor(ie)!==ie?(Q(ie,ae),new de.ERR_OUT_OF_RANGE("offset","an integer",ie)):J<0?new de.ERR_BUFFER_OUT_OF_BOUNDS:new de.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${J}`,ie)}let oe=/[^+/0-9A-Za-z-_]/g;function le(ie){if(ie=ie.split("=")[0],ie=ie.trim().replace(oe,""),ie.length<2)return"";for(;ie.length%4!==0;)ie=ie+"=";return ie}function ve(ie,J){J=J||1/0;let ae,fe=ie.length,Me=null,$e=[];for(let Se=0;Se<fe;++Se){if(ae=ie.charCodeAt(Se),ae>55295&&ae<57344){if(!Me){if(ae>56319){(J-=3)>-1&&$e.push(239,191,189);continue}else if(Se+1===fe){(J-=3)>-1&&$e.push(239,191,189);continue}Me=ae;continue}if(ae<56320){(J-=3)>-1&&$e.push(239,191,189),Me=ae;continue}ae=(Me-55296<<10|ae-56320)+65536}else Me&&(J-=3)>-1&&$e.push(239,191,189);if(Me=null,ae<128){if((J-=1)<0)break;$e.push(ae)}else if(ae<2048){if((J-=2)<0)break;$e.push(ae>>6|192,ae&63|128)}else if(ae<65536){if((J-=3)<0)break;$e.push(ae>>12|224,ae>>6&63|128,ae&63|128)}else if(ae<1114112){if((J-=4)<0)break;$e.push(ae>>18|240,ae>>12&63|128,ae>>6&63|128,ae&63|128)}else throw new Error("Invalid code point")}return $e}function he(ie){let J=[];for(let ae=0;ae<ie.length;++ae)J.push(ie.charCodeAt(ae)&255);return J}function be(ie,J){let ae,fe,Me,$e=[];for(let Se=0;Se<ie.length&&!((J-=2)<0);++Se)ae=ie.charCodeAt(Se),fe=ae>>8,Me=ae%256,$e.push(Me),$e.push(fe);return $e}function Be(ie){return t.toByteArray(le(ie))}function _e(ie,J,ae,fe){let Me;for(Me=0;Me<fe&&!(Me+ae>=J.length||Me>=ie.length);++Me)J[Me+ae]=ie[Me];return Me}function ke(ie,J){return ie instanceof J||ie!=null&&ie.constructor!=null&&ie.constructor.name!=null&&ie.constructor.name===J.name}function xe(ie){return ie!==ie}let me=function(){let ie="0123456789abcdef",J=new Array(256);for(let ae=0;ae<16;++ae){let fe=ae*16;for(let Me=0;Me<16;++Me)J[fe+Me]=ie[ae]+ie[Me]}return J}();function ce(ie){return typeof BigInt>"u"?Ee:ie}function Ee(){throw new Error("BigInt not supported")}return Tc}var Yp,DU,zv,UU,Tc,qU,Al=Zi(()=>{ge();we();ye();Yp={},DU=!1;zv={},UU=!1;Tc={},qU=!1});var Ic={};i0(Ic,{Buffer:()=>Buffer,INSPECT_MAX_BYTES:()=>X8e,default:()=>Yf,kMaxLength:()=>Y8e});var Yf,Buffer,X8e,Y8e,Qf=Zi(()=>{ge();we();ye();Al();Yf=vi();Yf.Buffer;Yf.SlowBuffer;Yf.INSPECT_MAX_BYTES;Yf.kMaxLength;Buffer=Yf.Buffer,X8e=Yf.INSPECT_MAX_BYTES,Y8e=Yf.kMaxLength});var we=Zi(()=>{Qf()});var xq=yt((exports,module)=>{ge();we();ye();(function(t){typeof exports=="object"&&typeof module<"u"?module.exports=t():typeof define=="function"&&define.amd?define([],t):(typeof window<"u"?window:typeof globalThis<"u"?globalThis:typeof self<"u"?self:this).SlpWallet=t()})(function(){for(var define,module,exports,createModuleFactory=function(t){var e;return function(o){return e||t(e={exports:{},parent:o},e.exports),e.exports}},_$defaults_355=createModuleFactory(function(t,e){(function(o){(function(){"use strict";var c={"Content-Type":"application/x-www-form-urlencoded"};function u(g,E){!_$utils_368.isUndefined(g)&&_$utils_368.isUndefined(g["Content-Type"])&&(g["Content-Type"]=E)}var b,m={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:((typeof XMLHttpRequest<"u"||o!==void 0&&Object.prototype.toString.call(o)==="[object process]")&&(b=_$xhr_341({})),b),transformRequest:[function(g,E){return _$normalizeHeaderName_364(E,"Accept"),_$normalizeHeaderName_364(E,"Content-Type"),_$utils_368.isFormData(g)||_$utils_368.isArrayBuffer(g)||_$utils_368.isBuffer(g)||_$utils_368.isStream(g)||_$utils_368.isFile(g)||_$utils_368.isBlob(g)?g:_$utils_368.isArrayBufferView(g)?g.buffer:_$utils_368.isURLSearchParams(g)?(u(E,"application/x-www-form-urlencoded;charset=utf-8"),g.toString()):_$utils_368.isObject(g)||E&&E["Content-Type"]==="application/json"?(u(E,"application/json"),function(S,M,k){if(_$utils_368.isString(S))try{return(0,JSON.parse)(S),_$utils_368.trim(S)}catch($){if($.name!=="SyntaxError")throw $}return(0,JSON.stringify)(S)}(g)):g}],transformResponse:[function(g){var E=this.transitional||m.transitional,S=E&&E.silentJSONParsing,M=E&&E.forcedJSONParsing,k=!S&&this.responseType==="json";if(k||M&&_$utils_368.isString(g)&&g.length)try{return JSON.parse(g)}catch($){if(k)throw $.name==="SyntaxError"?_$enhanceError_351($,this,"E_JSON_PARSE"):$}return g}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(g){return g>=200&&g<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};_$utils_368.forEach(["delete","get","head"],function(g){m.headers[g]={}}),_$utils_368.forEach(["post","put","patch"],function(g){m.headers[g]=_$utils_368.merge(c)}),t.exports=m}).call(this)}).call(this,_$browser_520)}),_$xhr_341=createModuleFactory(function(t,e){"use strict";var o=_$defaults_355({});t.exports=function(c){return new Promise(function(u,b){var m,g=c.data,E=c.headers,S=c.responseType;function M(){c.cancelToken&&c.cancelToken.unsubscribe(m),c.signal&&c.signal.removeEventListener("abort",m)}_$utils_368.isFormData(g)&&delete E["Content-Type"];var k=new XMLHttpRequest;if(c.auth){var $=c.auth.username||"",P=c.auth.password?unescape(encodeURIComponent(c.auth.password)):"";E.Authorization="Basic "+btoa($+":"+P)}var O=_$buildFullPath_348(c.baseURL,c.url);function N(){if(k){var H="getAllResponseHeaders"in k?_$parseHeaders_365(k.getAllResponseHeaders()):null,j={data:S&&S!=="text"&&S!=="json"?k.response:k.responseText,status:k.status,statusText:k.statusText,headers:H,config:c,request:k};_$settle_353(function(F){u(F),M()},function(F){b(F),M()},j),k=null}}if(k.open(c.method.toUpperCase(),_$buildURL_358(O,c.params,c.paramsSerializer),!0),k.timeout=c.timeout,"onloadend"in k?k.onloadend=N:k.onreadystatechange=function(){k&&k.readyState===4&&(k.status!==0||k.responseURL&&k.responseURL.indexOf("file:")===0)&&setTimeout(N)},k.onabort=function(){k&&(b(_$createError_349("Request aborted",c,"ECONNABORTED",k)),k=null)},k.onerror=function(){b(_$createError_349("Network Error",c,null,k)),k=null},k.ontimeout=function(){var H=c.timeout?"timeout of "+c.timeout+"ms exceeded":"timeout exceeded",j=c.transitional||o.transitional;c.timeoutErrorMessage&&(H=c.timeoutErrorMessage),b(_$createError_349(H,c,j.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",k)),k=null},_$utils_368.isStandardBrowserEnv()){var U=(c.withCredentials||_$isURLSameOrigin_363(O))&&c.xsrfCookieName?_$cookies_360.read(c.xsrfCookieName):void 0;U&&(E[c.xsrfHeaderName]=U)}"setRequestHeader"in k&&_$utils_368.forEach(E,function(H,j){g===void 0&&j.toLowerCase()==="content-type"?delete E[j]:k.setRequestHeader(j,H)}),_$utils_368.isUndefined(c.withCredentials)||(k.withCredentials=!!c.withCredentials),S&&S!=="json"&&(k.responseType=c.responseType),typeof c.onDownloadProgress=="function"&&k.addEventListener("progress",c.onDownloadProgress),typeof c.onUploadProgress=="function"&&k.upload&&k.upload.addEventListener("progress",c.onUploadProgress),(c.cancelToken||c.signal)&&(m=function(H){k&&(b(!H||H&&H.type?new _$Cancel_343("canceled"):H),k.abort(),k=null)},c.cancelToken&&c.cancelToken.subscribe(m),c.signal&&(c.signal.aborted?m():c.signal.addEventListener("abort",m))),g||(g=null),k.send(g)})}}),_$cryptoBrowserify_414=createModuleFactory(function(t,e){"use strict";e.randomBytes=e.rng=e.pseudoRandomBytes=e.prng=_$browser_415,e.createHash=e.Hash=_$browser_410,e.createHmac=e.Hmac=_$browser_412;var o=Object.keys(_$algos_396),c=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(o);e.getHashes=function(){return c},e.pbkdf2=_$browser_513.pbkdf2,e.pbkdf2Sync=_$browser_513.pbkdf2Sync,e.Cipher=_$browser_390.Cipher,e.createCipher=_$browser_390.createCipher,e.Cipheriv=_$browser_390.Cipheriv,e.createCipheriv=_$browser_390.createCipheriv,e.Decipher=_$browser_390.Decipher,e.createDecipher=_$browser_390.createDecipher,e.Decipheriv=_$browser_390.Decipheriv,e.createDecipheriv=_$browser_390.createDecipheriv,e.getCiphers=_$browser_390.getCiphers,e.listCiphers=_$browser_390.listCiphers,e.DiffieHellmanGroup=_$browser_456.DiffieHellmanGroup,e.createDiffieHellmanGroup=_$browser_456.createDiffieHellmanGroup,e.getDiffieHellman=_$browser_456.getDiffieHellman,e.createDiffieHellman=_$browser_456.createDiffieHellman,e.DiffieHellman=_$browser_456.DiffieHellman,e.createSign=_$browser_399.createSign,e.Sign=_$browser_399.Sign,e.createVerify=_$browser_399.createVerify,e.Verify=_$browser_399.Verify,e.createECDH=_$browser_408,e.publicEncrypt=_$browser_521.publicEncrypt,e.privateEncrypt=_$browser_521.privateEncrypt,e.publicDecrypt=_$browser_521.publicDecrypt,e.privateDecrypt=_$browser_521.privateDecrypt,e.randomFill=_$browser_529.randomFill,e.randomFillSync=_$browser_529.randomFillSync,e.createCredentials=function(){throw new Error(`sorry, createCredentials is not implemented yet
we accept pull requests
https://github.com/browserify/crypto-browserify`)},e.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6}}),_$asn1_320=createModuleFactory(function(t,e){var o=e;o.bignum=_$bn_334,o.define=_$api_321({}).define,o.base=_$base_323({}),o.constants=_$constants_327({}),o.decoders=_$decoders_329({}),o.encoders=_$encoders_332({})}),_$encoders_332=createModuleFactory(function(t,e){var o=e;o.der=_$der_331({}),o.pem=_$pem_333({})}),_$pem_333=createModuleFactory(function(t,e){var o=_$der_331({});function c(u){o.call(this,u),this.enc="pem"}_$inherits_browser_497(c,o),t.exports=c,c.prototype.encode=function(u,b){for(var m=o.prototype.encode.call(this,u).toString("base64"),g=["-----BEGIN "+b.label+"-----"],E=0;E<m.length;E+=64)g.push(m.slice(E,E+64));return g.push("-----END "+b.label+"-----"),g.join(`
`)}}),_$der_331=createModuleFactory(function(t,e){var o=_$buffer_404({}).Buffer,c=_$asn1_320({}),u=c.base,b=c.constants.der;function m(S){this.enc="der",this.name=S.name,this.entity=S,this.tree=new g,this.tree._init(S.body)}function g(S){u.Node.call(this,"der",S)}function E(S){return S<10?"0"+S:S}t.exports=m,m.prototype.encode=function(S,M){return this.tree._encode(S,M).join()},_$inherits_browser_497(g,u.Node),g.prototype._encodeComposite=function(S,M,k,$){var P,O=function(j,F,te,ee){var se;if(j==="seqof"?j="seq":j==="setof"&&(j="set"),b.tagByName.hasOwnProperty(j))se=b.tagByName[j];else{if(typeof j!="number"||(0|j)!==j)return ee.error("Unknown tag: "+j);se=j}return se>=31?ee.error("Multi-octet tag encoding unsupported"):(F||(se|=32),se|b.tagClassByName[te||"universal"]<<6)}(S,M,k,this.reporter);if($.length<128)return(P=new o(2))[0]=O,P[1]=$.length,this._createEncoderBuffer([P,$]);for(var N=1,U=$.length;U>=256;U>>=8)N++;(P=new o(2+N))[0]=O,P[1]=128|N,U=1+N;for(var H=$.length;H>0;U--,H>>=8)P[U]=255&H;return this._createEncoderBuffer([P,$])},g.prototype._encodeStr=function(S,M){if(M==="bitstr")return this._createEncoderBuffer([0|S.unused,S.data]);if(M==="bmpstr"){for(var k=new o(2*S.length),$=0;$<S.length;$++)k.writeUInt16BE(S.charCodeAt($),2*$);return this._createEncoderBuffer(k)}return M==="numstr"?this._isNumstr(S)?this._createEncoderBuffer(S):this.reporter.error("Encoding of string type: numstr supports only digits and space"):M==="printstr"?this._isPrintstr(S)?this._createEncoderBuffer(S):this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark"):/str$/.test(M)||M==="objDesc"?this._createEncoderBuffer(S):this.reporter.error("Encoding of string type: "+M+" unsupported")},g.prototype._encodeObjid=function(S,M,k){if(typeof S=="string"){if(!M)return this.reporter.error("string objid given, but no values map found");if(!M.hasOwnProperty(S))return this.reporter.error("objid not found in values map");S=M[S].split(/[\s\.]+/g);for(var $=0;$<S.length;$++)S[$]|=0}else if(Array.isArray(S))for(S=S.slice(),$=0;$<S.length;$++)S[$]|=0;if(!Array.isArray(S))return this.reporter.error("objid() should be either array or string, got: "+JSON.stringify(S));if(!k){if(S[1]>=40)return this.reporter.error("Second objid identifier OOB");S.splice(0,2,40*S[0]+S[1])}var P=0;for($=0;$<S.length;$++){var O=S[$];for(P++;O>=128;O>>=7)P++}var N=new o(P),U=N.length-1;for($=S.length-1;$>=0;$--)for(O=S[$],N[U--]=127&O;(O>>=7)>0;)N[U--]=128|127&O;return this._createEncoderBuffer(N)},g.prototype._encodeTime=function(S,M){var k,$=new Date(S);return M==="gentime"?k=[E($.getFullYear()),E($.getUTCMonth()+1),E($.getUTCDate()),E($.getUTCHours()),E($.getUTCMinutes()),E($.getUTCSeconds()),"Z"].join(""):M==="utctime"?k=[E($.getFullYear()%100),E($.getUTCMonth()+1),E($.getUTCDate()),E($.getUTCHours()),E($.getUTCMinutes()),E($.getUTCSeconds()),"Z"].join(""):this.reporter.error("Encoding "+M+" time is not supported yet"),this._encodeStr(k,"octstr")},g.prototype._encodeNull=function(){return this._createEncoderBuffer("")},g.prototype._encodeInt=function(S,M){if(typeof S=="string"){if(!M)return this.reporter.error("String int or enum given, but no values map");if(!M.hasOwnProperty(S))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(S));S=M[S]}if(typeof S!="number"&&!o.isBuffer(S)){var k=S.toArray();!S.sign&&128&k[0]&&k.unshift(0),S=new o(k)}if(o.isBuffer(S)){var $=S.length;S.length===0&&$++;var P=new o($);return S.copy(P),S.length===0&&(P[0]=0),this._createEncoderBuffer(P)}if(S<128)return this._createEncoderBuffer(S);if(S<256)return this._createEncoderBuffer([0,S]);$=1;for(var O=S;O>=256;O>>=8)$++;for(O=(P=new Array($)).length-1;O>=0;O--)P[O]=255&S,S>>=8;return 128&P[0]&&P.unshift(0),this._createEncoderBuffer(new o(P))},g.prototype._encodeBool=function(S){return this._createEncoderBuffer(S?255:0)},g.prototype._use=function(S,M){return typeof S=="function"&&(S=S(M)),S._getEncoder("der").tree},g.prototype._skipDefault=function(S,M,k){var $,P=this._baseState;if(P.default===null)return!1;var O=S.join();if(P.defaultBuffer===void 0&&(P.defaultBuffer=this._encodeValue(P.default,M,k).join()),O.length!==P.defaultBuffer.length)return!1;for($=0;$<O.length;$++)if(O[$]!==P.defaultBuffer[$])return!1;return!0}}),_$decoders_329=createModuleFactory(function(t,e){var o=e;o.der=_$der_328({}),o.pem=_$pem_330({})}),_$pem_330=createModuleFactory(function(t,e){var o=_$buffer_404({}).Buffer,c=_$der_328({});function u(b){c.call(this,b),this.enc="pem"}_$inherits_browser_497(u,c),t.exports=u,u.prototype.decode=function(b,m){for(var g=b.toString().split(/[\r\n]+/g),E=m.label.toUpperCase(),S=/^-----(BEGIN|END) ([^-]+)-----$/,M=-1,k=-1,$=0;$<g.length;$++){var P=g[$].match(S);if(P!==null&&P[2]===E){if(M!==-1){if(P[1]!=="END")break;k=$;break}if(P[1]!=="BEGIN")break;M=$}}if(M===-1||k===-1)throw new Error("PEM section not found for: "+E);var O=g.slice(M+1,k).join("");O.replace(/[^a-z0-9\+\/=]+/gi,"");var N=new o(O,"base64");return c.prototype.decode.call(this,N,m)}}),_$der_328=createModuleFactory(function(t,e){var o=_$asn1_320({}),c=o.base,u=o.bignum,b=o.constants.der;function m(M){this.enc="der",this.name=M.name,this.entity=M,this.tree=new g,this.tree._init(M.body)}function g(M){c.Node.call(this,"der",M)}function E(M,k){var $=M.readUInt8(k);if(M.isError($))return $;var P=b.tagClass[$>>6],O=(32&$)==0;if((31&$)==31){var N=$;for($=0;(128&N)==128;){if(N=M.readUInt8(k),M.isError(N))return N;$<<=7,$|=127&N}}else $&=31;return{cls:P,primitive:O,tag:$,tagStr:b.tag[$]}}function S(M,k,$){var P=M.readUInt8($);if(M.isError(P))return P;if(!k&&P===128)return null;if(!(128&P))return P;var O=127&P;if(O>4)return M.error("length octect is too long");P=0;for(var N=0;N<O;N++){P<<=8;var U=M.readUInt8($);if(M.isError(U))return U;P|=U}return P}t.exports=m,m.prototype.decode=function(M,k){return M instanceof c.DecoderBuffer||(M=new c.DecoderBuffer(M,k)),this.tree._decode(M,k)},_$inherits_browser_497(g,c.Node),g.prototype._peekTag=function(M,k,$){if(M.isEmpty())return!1;var P=M.save(),O=E(M,'Failed to peek tag: "'+k+'"');return M.isError(O)?O:(M.restore(P),O.tag===k||O.tagStr===k||O.tagStr+"of"===k||$)},g.prototype._decodeTag=function(M,k,$){var P=E(M,'Failed to decode tag of "'+k+'"');if(M.isError(P))return P;var O=S(M,P.primitive,'Failed to get length of "'+k+'"');if(M.isError(O))return O;if(!$&&P.tag!==k&&P.tagStr!==k&&P.tagStr+"of"!==k)return M.error('Failed to match tag: "'+k+'"');if(P.primitive||O!==null)return M.skip(O,'Failed to match body of: "'+k+'"');var N=M.save(),U=this._skipUntilEnd(M,'Failed to skip indefinite length body: "'+this.tag+'"');return M.isError(U)?U:(O=M.offset-N.offset,M.restore(N),M.skip(O,'Failed to match body of: "'+k+'"'))},g.prototype._skipUntilEnd=function(M,k){for(;;){var $=E(M,k);if(M.isError($))return $;var P,O=S(M,$.primitive,k);if(M.isError(O))return O;if(P=$.primitive||O!==null?M.skip(O):this._skipUntilEnd(M,k),M.isError(P))return P;if($.tagStr==="end")break}},g.prototype._decodeList=function(M,k,$,P){for(var O=[];!M.isEmpty();){var N=this._peekTag(M,"end");if(M.isError(N))return