@ar.io/sdk 3.1.0-alpha.9 → 3.2.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- var tue=Object.create;var kb=Object.defineProperty;var rue=Object.getOwnPropertyDescriptor;var iue=Object.getOwnPropertyNames;var nue=Object.getPrototypeOf,aue=Object.prototype.hasOwnProperty;var Si=(t,e)=>()=>(t&&(e=t(t=0)),e);var ht=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Ha=(t,e)=>{for(var r in e)kb(t,r,{get:e[r],enumerable:!0})},xP=(t,e,r,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of iue(e))!aue.call(t,i)&&i!==r&&kb(t,i,{get:()=>e[i],enumerable:!(a=rue(e,i))||a.enumerable});return t};var gi=(t,e,r)=>(r=t!=null?tue(nue(t)):{},xP(e||!t||!t.__esModule?kb(r,"default",{value:t,enumerable:!0}):r,t)),ei=t=>xP(kb({},"__esModule",{value:!0}),t);var ie=Si(()=>{"use strict"});var He={};Ha(He,{_debugEnd:()=>lO,_debugProcess:()=>hO,_events:()=>AO,_eventsCount:()=>RO,_exiting:()=>HP,_fatalExceptions:()=>oO,_getActiveHandles:()=>GP,_getActiveRequests:()=>VP,_kill:()=>JP,_linkedBinding:()=>zP,_maxListeners:()=>EO,_preload_modules:()=>xO,_rawDebug:()=>FP,_startProfilerIdleNotifier:()=>cO,_stopProfilerIdleNotifier:()=>dO,_tickCallback:()=>uO,abort:()=>gO,addListener:()=>TO,allowedNodeEnvironmentFlags:()=>iO,arch:()=>TP,argv:()=>BP,argv0:()=>MO,assert:()=>nO,binding:()=>LP,chdir:()=>qP,config:()=>KP,cpuUsage:()=>Pb,cwd:()=>$P,debugPort:()=>_O,default:()=>DO,dlopen:()=>WP,domain:()=>ZP,emit:()=>OO,emitWarning:()=>CP,env:()=>IP,execArgv:()=>PP,execPath:()=>wO,exit:()=>tO,features:()=>aO,hasUncaughtExceptionCaptureCallback:()=>fO,hrtime:()=>Bb,kill:()=>eO,listeners:()=>LO,memoryUsage:()=>QP,moduleLoadList:()=>jP,nextTick:()=>EP,off:()=>IO,on:()=>Yu,once:()=>kO,openStdin:()=>rO,pid:()=>bO,platform:()=>kP,ppid:()=>yO,prependListener:()=>NO,prependOnceListener:()=>CO,reallyExit:()=>YP,release:()=>UP,removeAllListeners:()=>PO,removeListener:()=>BO,resourceUsage:()=>XP,setSourceMapsEnabled:()=>SO,setUncaughtExceptionCaptureCallback:()=>sO,stderr:()=>vO,stdin:()=>mO,stdout:()=>pO,title:()=>RP,umask:()=>DP,uptime:()=>Wd,version:()=>OP,versions:()=>NP});function Yw(t){throw new Error("Node.js process "+t+" is not supported by JSPM core outside of Node.js")}function oue(){!Kd||!Oc||(Kd=!1,Oc.length?Gu=Oc.concat(Gu):Ib=-1,Gu.length&&SP())}function SP(){if(!Kd){var t=setTimeout(oue,0);Kd=!0;for(var e=Gu.length;e;){for(Oc=Gu,Gu=[];++Ib<e;)Oc&&Oc[Ib].run();Ib=-1,e=Gu.length}Oc=null,Kd=!1,clearTimeout(t)}}function EP(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];Gu.push(new AP(t,e)),Gu.length===1&&!Kd&&setTimeout(SP,0)}function AP(t,e){this.fun=t,this.array=e}function pa(){}function zP(t){Yw("_linkedBinding")}function WP(t){Yw("dlopen")}function VP(){return[]}function GP(){return[]}function nO(t,e){if(!t)throw new Error(e||"assertion error")}function fO(){return!1}function Wd(){return nl.now()/1e3}function Bb(t){var e=Math.floor((Date.now()-nl.now())*.001),r=nl.now()*.001,a=Math.floor(r)+e,i=Math.floor(r%1*1e9);return t&&(a=a-t[0],i=i-t[1],i<0&&(a--,i+=Gw)),[a,i]}function Yu(){return DO}function LO(t){return[]}var Gu,Kd,Oc,Ib,RP,TP,kP,IP,BP,PP,OP,NP,CP,LP,DP,$P,qP,UP,FP,jP,ZP,HP,KP,YP,JP,Pb,XP,QP,eO,tO,rO,iO,aO,oO,sO,uO,hO,lO,cO,dO,pO,vO,mO,gO,bO,yO,wO,_O,MO,xO,SO,nl,Vw,Gw,EO,AO,RO,TO,kO,IO,BO,PO,OO,NO,CO,DO,Ob=Si(()=>{"use strict";ie();ae();ne();Gu=[],Kd=!1,Ib=-1;AP.prototype.run=function(){this.fun.apply(null,this.array)};RP="browser",TP="x64",kP="browser",IP={PATH:"/usr/bin",LANG:navigator.language+".UTF-8",PWD:"/",HOME:"/home",TMP:"/tmp"},BP=["/usr/bin/node"],PP=[],OP="v16.8.0",NP={},CP=function(t,e){console.warn((e?e+": ":"")+t)},LP=function(t){Yw("binding")},DP=function(t){return 0},$P=function(){return"/"},qP=function(t){},UP={name:"node",sourceUrl:"",headersUrl:"",libUrl:""};FP=pa,jP=[];ZP={},HP=!1,KP={};YP=pa,JP=pa,Pb=function(){return{}},XP=Pb,QP=Pb,eO=pa,tO=pa,rO=pa,iO={};aO={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},oO=pa,sO=pa;uO=pa,hO=pa,lO=pa,cO=pa,dO=pa,pO=void 0,vO=void 0,mO=void 0,gO=pa,bO=2,yO=1,wO="/bin/usr/node",_O=9229,MO="node",xO=[],SO=pa,nl={now:typeof performance<"u"?performance.now.bind(performance):void 0,timing:typeof performance<"u"?performance.timing:void 0};nl.now===void 0&&(Vw=Date.now(),nl.timing&&nl.timing.navigationStart&&(Vw=nl.timing.navigationStart),nl.now=()=>Date.now()-Vw);Gw=1e9;Bb.bigint=function(t){var e=Bb(t);return typeof BigInt>"u"?e[0]*Gw+e[1]:BigInt(e[0]*Gw)+BigInt(e[1])};EO=10,AO={},RO=0;TO=Yu,kO=Yu,IO=Yu,BO=Yu,PO=Yu,OO=pa,NO=Yu,CO=Yu;DO={version:OP,versions:NP,arch:TP,platform:kP,release:UP,_rawDebug:FP,moduleLoadList:jP,binding:LP,_linkedBinding:zP,_events:AO,_eventsCount:RO,_maxListeners:EO,on:Yu,addListener:TO,once:kO,off:IO,removeListener:BO,removeAllListeners:PO,emit:OO,prependListener:NO,prependOnceListener:CO,listeners:LO,domain:ZP,_exiting:HP,config:KP,dlopen:WP,uptime:Wd,_getActiveRequests:VP,_getActiveHandles:GP,reallyExit:YP,_kill:JP,cpuUsage:Pb,resourceUsage:XP,memoryUsage:QP,kill:eO,exit:tO,openStdin:rO,allowedNodeEnvironmentFlags:iO,assert:nO,features:aO,_fatalExceptions:oO,setUncaughtExceptionCaptureCallback:sO,hasUncaughtExceptionCaptureCallback:fO,emitWarning:CP,nextTick:EP,_tickCallback:uO,_debugProcess:hO,_debugEnd:lO,_startProfilerIdleNotifier:cO,_stopProfilerIdleNotifier:dO,stdout:pO,stdin:mO,stderr:vO,abort:gO,umask:DP,chdir:qP,cwd:$P,env:IP,title:RP,argv:BP,execArgv:PP,pid:bO,ppid:yO,execPath:wO,debugPort:_O,hrtime:Bb,argv0:MO,_preload_modules:xO,setSourceMapsEnabled:SO}});var ne=Si(()=>{"use strict";Ob()});var Ju={};Ha(Ju,{Buffer:()=>Me,INSPECT_MAX_BYTES:()=>hue,default:()=>al,kMaxLength:()=>lue});function sue(){if($O)return gv;$O=!0,gv.byteLength=p,gv.toByteArray=g,gv.fromByteArray=x;for(var t=[],e=[],r=typeof Uint8Array<"u"?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,h=a.length;i<h;++i)t[i]=a[i],e[a.charCodeAt(i)]=i;e[45]=62,e[95]=63;function l(E){var A=E.length;if(A%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var k=E.indexOf("=");k===-1&&(k=A);var P=k===A?0:4-k%4;return[k,P]}function p(E){var A=l(E),k=A[0],P=A[1];return(k+P)*3/4-P}function b(E,A,k){return(A+k)*3/4-k}function g(E){var A,k=l(E),P=k[0],N=k[1],L=new r(b(E,P,N)),C=0,Y=N>0?P-4:P,G;for(G=0;G<Y;G+=4)A=e[E.charCodeAt(G)]<<18|e[E.charCodeAt(G+1)]<<12|e[E.charCodeAt(G+2)]<<6|e[E.charCodeAt(G+3)],L[C++]=A>>16&255,L[C++]=A>>8&255,L[C++]=A&255;return N===2&&(A=e[E.charCodeAt(G)]<<2|e[E.charCodeAt(G+1)]>>4,L[C++]=A&255),N===1&&(A=e[E.charCodeAt(G)]<<10|e[E.charCodeAt(G+1)]<<4|e[E.charCodeAt(G+2)]>>2,L[C++]=A>>8&255,L[C++]=A&255),L}function y(E){return t[E>>18&63]+t[E>>12&63]+t[E>>6&63]+t[E&63]}function M(E,A,k){for(var P,N=[],L=A;L<k;L+=3)P=(E[L]<<16&16711680)+(E[L+1]<<8&65280)+(E[L+2]&255),N.push(y(P));return N.join("")}function x(E){for(var A,k=E.length,P=k%3,N=[],L=16383,C=0,Y=k-P;C<Y;C+=L)N.push(M(E,C,C+L>Y?Y:C+L));return P===1?(A=E[k-1],N.push(t[A>>2]+t[A<<4&63]+"==")):P===2&&(A=(E[k-2]<<8)+E[k-1],N.push(t[A>>10]+t[A>>4&63]+t[A<<2&63]+"=")),N.join("")}return gv}function fue(){if(qO)return Nb;qO=!0;return Nb.read=function(t,e,r,a,i){var h,l,p=i*8-a-1,b=(1<<p)-1,g=b>>1,y=-7,M=r?i-1:0,x=r?-1:1,E=t[e+M];for(M+=x,h=E&(1<<-y)-1,E>>=-y,y+=p;y>0;h=h*256+t[e+M],M+=x,y-=8);for(l=h&(1<<-y)-1,h>>=-y,y+=a;y>0;l=l*256+t[e+M],M+=x,y-=8);if(h===0)h=1-g;else{if(h===b)return l?NaN:(E?-1:1)*(1/0);l=l+Math.pow(2,a),h=h-g}return(E?-1:1)*l*Math.pow(2,h-a)},Nb.write=function(t,e,r,a,i,h){var l,p,b,g=h*8-i-1,y=(1<<g)-1,M=y>>1,x=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,E=a?0:h-1,A=a?1:-1,k=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(p=isNaN(e)?1:0,l=y):(l=Math.floor(Math.log(e)/Math.LN2),e*(b=Math.pow(2,-l))<1&&(l--,b*=2),l+M>=1?e+=x/b:e+=x*Math.pow(2,1-M),e*b>=2&&(l++,b/=2),l+M>=y?(p=0,l=y):l+M>=1?(p=(e*b-1)*Math.pow(2,i),l=l+M):(p=e*Math.pow(2,M-1)*Math.pow(2,i),l=0));i>=8;t[r+E]=p&255,E+=A,p/=256,i-=8);for(l=l<<i|p,g+=i;g>0;t[r+E]=l&255,E+=A,l/=256,g-=8);t[r+E-A]|=k*128},Nb}function uue(){if(UO)return Nc;UO=!0;let t=sue(),e=fue(),r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Nc.Buffer=l,Nc.SlowBuffer=N,Nc.INSPECT_MAX_BYTES=50;let a=2147483647;Nc.kMaxLength=a,l.TYPED_ARRAY_SUPPORT=i(),!l.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 i(){try{let z=new Uint8Array(1),T={foo:function(){return 42}};return Object.setPrototypeOf(T,Uint8Array.prototype),Object.setPrototypeOf(z,T),z.foo()===42}catch{return!1}}Object.defineProperty(l.prototype,"parent",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.buffer}}),Object.defineProperty(l.prototype,"offset",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.byteOffset}});function h(z){if(z>a)throw new RangeError('The value "'+z+'" is invalid for option "size"');let T=new Uint8Array(z);return Object.setPrototypeOf(T,l.prototype),T}function l(z,T,I){if(typeof z=="number"){if(typeof T=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return y(z)}return p(z,T,I)}l.poolSize=8192;function p(z,T,I){if(typeof z=="string")return M(z,T);if(ArrayBuffer.isView(z))return E(z);if(z==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof z);if(Se(z,ArrayBuffer)||z&&Se(z.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Se(z,SharedArrayBuffer)||z&&Se(z.buffer,SharedArrayBuffer)))return A(z,T,I);if(typeof z=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let O=z.valueOf&&z.valueOf();if(O!=null&&O!==z)return l.from(O,T,I);let q=k(z);if(q)return q;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof z[Symbol.toPrimitive]=="function")return l.from(z[Symbol.toPrimitive]("string"),T,I);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof z)}l.from=function(z,T,I){return p(z,T,I)},Object.setPrototypeOf(l.prototype,Uint8Array.prototype),Object.setPrototypeOf(l,Uint8Array);function b(z){if(typeof z!="number")throw new TypeError('"size" argument must be of type number');if(z<0)throw new RangeError('The value "'+z+'" is invalid for option "size"')}function g(z,T,I){return b(z),z<=0?h(z):T!==void 0?typeof I=="string"?h(z).fill(T,I):h(z).fill(T):h(z)}l.alloc=function(z,T,I){return g(z,T,I)};function y(z){return b(z),h(z<0?0:P(z)|0)}l.allocUnsafe=function(z){return y(z)},l.allocUnsafeSlow=function(z){return y(z)};function M(z,T){if((typeof T!="string"||T==="")&&(T="utf8"),!l.isEncoding(T))throw new TypeError("Unknown encoding: "+T);let I=L(z,T)|0,O=h(I),q=O.write(z,T);return q!==I&&(O=O.slice(0,q)),O}function x(z){let T=z.length<0?0:P(z.length)|0,I=h(T);for(let O=0;O<T;O+=1)I[O]=z[O]&255;return I}function E(z){if(Se(z,Uint8Array)){let T=new Uint8Array(z);return A(T.buffer,T.byteOffset,T.byteLength)}return x(z)}function A(z,T,I){if(T<0||z.byteLength<T)throw new RangeError('"offset" is outside of buffer bounds');if(z.byteLength<T+(I||0))throw new RangeError('"length" is outside of buffer bounds');let O;return T===void 0&&I===void 0?O=new Uint8Array(z):I===void 0?O=new Uint8Array(z,T):O=new Uint8Array(z,T,I),Object.setPrototypeOf(O,l.prototype),O}function k(z){if(l.isBuffer(z)){let T=P(z.length)|0,I=h(T);return I.length===0||z.copy(I,0,0,T),I}if(z.length!==void 0)return typeof z.length!="number"||ut(z.length)?h(0):x(z);if(z.type==="Buffer"&&Array.isArray(z.data))return x(z.data)}function P(z){if(z>=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return z|0}function N(z){return+z!=z&&(z=0),l.alloc(+z)}l.isBuffer=function(T){return T!=null&&T._isBuffer===!0&&T!==l.prototype},l.compare=function(T,I){if(Se(T,Uint8Array)&&(T=l.from(T,T.offset,T.byteLength)),Se(I,Uint8Array)&&(I=l.from(I,I.offset,I.byteLength)),!l.isBuffer(T)||!l.isBuffer(I))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(T===I)return 0;let O=T.length,q=I.length;for(let H=0,W=Math.min(O,q);H<W;++H)if(T[H]!==I[H]){O=T[H],q=I[H];break}return O<q?-1:q<O?1:0},l.isEncoding=function(T){switch(String(T).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}},l.concat=function(T,I){if(!Array.isArray(T))throw new TypeError('"list" argument must be an Array of Buffers');if(T.length===0)return l.alloc(0);let O;if(I===void 0)for(I=0,O=0;O<T.length;++O)I+=T[O].length;let q=l.allocUnsafe(I),H=0;for(O=0;O<T.length;++O){let W=T[O];if(Se(W,Uint8Array))H+W.length>q.length?(l.isBuffer(W)||(W=l.from(W)),W.copy(q,H)):Uint8Array.prototype.set.call(q,W,H);else if(l.isBuffer(W))W.copy(q,H);else throw new TypeError('"list" argument must be an Array of Buffers');H+=W.length}return q};function L(z,T){if(l.isBuffer(z))return z.length;if(ArrayBuffer.isView(z)||Se(z,ArrayBuffer))return z.byteLength;if(typeof z!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof z);let I=z.length,O=arguments.length>2&&arguments[2]===!0;if(!O&&I===0)return 0;let q=!1;for(;;)switch(T){case"ascii":case"latin1":case"binary":return I;case"utf8":case"utf-8":return Te(z).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I*2;case"hex":return I>>>1;case"base64":return ot(z).length;default:if(q)return O?-1:Te(z).length;T=(""+T).toLowerCase(),q=!0}}l.byteLength=L;function C(z,T,I){let O=!1;if((T===void 0||T<0)&&(T=0),T>this.length||((I===void 0||I>this.length)&&(I=this.length),I<=0)||(I>>>=0,T>>>=0,I<=T))return"";for(z||(z="utf8");;)switch(z){case"hex":return d(this,T,I);case"utf8":case"utf-8":return f(this,T,I);case"ascii":return m(this,T,I);case"latin1":case"binary":return w(this,T,I);case"base64":return s(this,T,I);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return o(this,T,I);default:if(O)throw new TypeError("Unknown encoding: "+z);z=(z+"").toLowerCase(),O=!0}}l.prototype._isBuffer=!0;function Y(z,T,I){let O=z[T];z[T]=z[I],z[I]=O}l.prototype.swap16=function(){let T=this.length;if(T%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let I=0;I<T;I+=2)Y(this,I,I+1);return this},l.prototype.swap32=function(){let T=this.length;if(T%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let I=0;I<T;I+=4)Y(this,I,I+3),Y(this,I+1,I+2);return this},l.prototype.swap64=function(){let T=this.length;if(T%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let I=0;I<T;I+=8)Y(this,I,I+7),Y(this,I+1,I+6),Y(this,I+2,I+5),Y(this,I+3,I+4);return this},l.prototype.toString=function(){let T=this.length;return T===0?"":arguments.length===0?f(this,0,T):C.apply(this,arguments)},l.prototype.toLocaleString=l.prototype.toString,l.prototype.equals=function(T){if(!l.isBuffer(T))throw new TypeError("Argument must be a Buffer");return this===T?!0:l.compare(this,T)===0},l.prototype.inspect=function(){let T="",I=Nc.INSPECT_MAX_BYTES;return T=this.toString("hex",0,I).replace(/(.{2})/g,"$1 ").trim(),this.length>I&&(T+=" ... "),"<Buffer "+T+">"},r&&(l.prototype[r]=l.prototype.inspect),l.prototype.compare=function(T,I,O,q,H){if(Se(T,Uint8Array)&&(T=l.from(T,T.offset,T.byteLength)),!l.isBuffer(T))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof T);if(I===void 0&&(I=0),O===void 0&&(O=T?T.length:0),q===void 0&&(q=0),H===void 0&&(H=this.length),I<0||O>T.length||q<0||H>this.length)throw new RangeError("out of range index");if(q>=H&&I>=O)return 0;if(q>=H)return-1;if(I>=O)return 1;if(I>>>=0,O>>>=0,q>>>=0,H>>>=0,this===T)return 0;let W=H-q,fe=O-I,st=Math.min(W,fe),ue=this.slice(q,H),me=T.slice(I,O);for(let pe=0;pe<st;++pe)if(ue[pe]!==me[pe]){W=ue[pe],fe=me[pe];break}return W<fe?-1:fe<W?1:0};function G(z,T,I,O,q){if(z.length===0)return-1;if(typeof I=="string"?(O=I,I=0):I>2147483647?I=2147483647:I<-2147483648&&(I=-2147483648),I=+I,ut(I)&&(I=q?0:z.length-1),I<0&&(I=z.length+I),I>=z.length){if(q)return-1;I=z.length-1}else if(I<0)if(q)I=0;else return-1;if(typeof T=="string"&&(T=l.from(T,O)),l.isBuffer(T))return T.length===0?-1:ee(z,T,I,O,q);if(typeof T=="number")return T=T&255,typeof Uint8Array.prototype.indexOf=="function"?q?Uint8Array.prototype.indexOf.call(z,T,I):Uint8Array.prototype.lastIndexOf.call(z,T,I):ee(z,[T],I,O,q);throw new TypeError("val must be string, number or Buffer")}function ee(z,T,I,O,q){let H=1,W=z.length,fe=T.length;if(O!==void 0&&(O=String(O).toLowerCase(),O==="ucs2"||O==="ucs-2"||O==="utf16le"||O==="utf-16le")){if(z.length<2||T.length<2)return-1;H=2,W/=2,fe/=2,I/=2}function st(me,pe){return H===1?me[pe]:me.readUInt16BE(pe*H)}let ue;if(q){let me=-1;for(ue=I;ue<W;ue++)if(st(z,ue)===st(T,me===-1?0:ue-me)){if(me===-1&&(me=ue),ue-me+1===fe)return me*H}else me!==-1&&(ue-=ue-me),me=-1}else for(I+fe>W&&(I=W-fe),ue=I;ue>=0;ue--){let me=!0;for(let pe=0;pe<fe;pe++)if(st(z,ue+pe)!==st(T,pe)){me=!1;break}if(me)return ue}return-1}l.prototype.includes=function(T,I,O){return this.indexOf(T,I,O)!==-1},l.prototype.indexOf=function(T,I,O){return G(this,T,I,O,!0)},l.prototype.lastIndexOf=function(T,I,O){return G(this,T,I,O,!1)};function D(z,T,I,O){I=Number(I)||0;let q=z.length-I;O?(O=Number(O),O>q&&(O=q)):O=q;let H=T.length;O>H/2&&(O=H/2);let W;for(W=0;W<O;++W){let fe=parseInt(T.substr(W*2,2),16);if(ut(fe))return W;z[I+W]=fe}return W}function U(z,T,I,O){return ge(Te(T,z.length-I),z,I,O)}function V(z,T,I,O){return ge(oe(T),z,I,O)}function _(z,T,I,O){return ge(ot(T),z,I,O)}function n(z,T,I,O){return ge(ce(T,z.length-I),z,I,O)}l.prototype.write=function(T,I,O,q){if(I===void 0)q="utf8",O=this.length,I=0;else if(O===void 0&&typeof I=="string")q=I,O=this.length,I=0;else if(isFinite(I))I=I>>>0,isFinite(O)?(O=O>>>0,q===void 0&&(q="utf8")):(q=O,O=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let H=this.length-I;if((O===void 0||O>H)&&(O=H),T.length>0&&(O<0||I<0)||I>this.length)throw new RangeError("Attempt to write outside buffer bounds");q||(q="utf8");let W=!1;for(;;)switch(q){case"hex":return D(this,T,I,O);case"utf8":case"utf-8":return U(this,T,I,O);case"ascii":case"latin1":case"binary":return V(this,T,I,O);case"base64":return _(this,T,I,O);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return n(this,T,I,O);default:if(W)throw new TypeError("Unknown encoding: "+q);q=(""+q).toLowerCase(),W=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function s(z,T,I){return T===0&&I===z.length?t.fromByteArray(z):t.fromByteArray(z.slice(T,I))}function f(z,T,I){I=Math.min(z.length,I);let O=[],q=T;for(;q<I;){let H=z[q],W=null,fe=H>239?4:H>223?3:H>191?2:1;if(q+fe<=I){let st,ue,me,pe;switch(fe){case 1:H<128&&(W=H);break;case 2:st=z[q+1],(st&192)===128&&(pe=(H&31)<<6|st&63,pe>127&&(W=pe));break;case 3:st=z[q+1],ue=z[q+2],(st&192)===128&&(ue&192)===128&&(pe=(H&15)<<12|(st&63)<<6|ue&63,pe>2047&&(pe<55296||pe>57343)&&(W=pe));break;case 4:st=z[q+1],ue=z[q+2],me=z[q+3],(st&192)===128&&(ue&192)===128&&(me&192)===128&&(pe=(H&15)<<18|(st&63)<<12|(ue&63)<<6|me&63,pe>65535&&pe<1114112&&(W=pe))}}W===null?(W=65533,fe=1):W>65535&&(W-=65536,O.push(W>>>10&1023|55296),W=56320|W&1023),O.push(W),q+=fe}return c(O)}let u=4096;function c(z){let T=z.length;if(T<=u)return String.fromCharCode.apply(String,z);let I="",O=0;for(;O<T;)I+=String.fromCharCode.apply(String,z.slice(O,O+=u));return I}function m(z,T,I){let O="";I=Math.min(z.length,I);for(let q=T;q<I;++q)O+=String.fromCharCode(z[q]&127);return O}function w(z,T,I){let O="";I=Math.min(z.length,I);for(let q=T;q<I;++q)O+=String.fromCharCode(z[q]);return O}function d(z,T,I){let O=z.length;(!T||T<0)&&(T=0),(!I||I<0||I>O)&&(I=O);let q="";for(let H=T;H<I;++H)q+=Ze[z[H]];return q}function o(z,T,I){let O=z.slice(T,I),q="";for(let H=0;H<O.length-1;H+=2)q+=String.fromCharCode(O[H]+O[H+1]*256);return q}l.prototype.slice=function(T,I){let O=this.length;T=~~T,I=I===void 0?O:~~I,T<0?(T+=O,T<0&&(T=0)):T>O&&(T=O),I<0?(I+=O,I<0&&(I=0)):I>O&&(I=O),I<T&&(I=T);let q=this.subarray(T,I);return Object.setPrototypeOf(q,l.prototype),q};function v(z,T,I){if(z%1!==0||z<0)throw new RangeError("offset is not uint");if(z+T>I)throw new RangeError("Trying to access beyond buffer length")}l.prototype.readUintLE=l.prototype.readUIntLE=function(T,I,O){T=T>>>0,I=I>>>0,O||v(T,I,this.length);let q=this[T],H=1,W=0;for(;++W<I&&(H*=256);)q+=this[T+W]*H;return q},l.prototype.readUintBE=l.prototype.readUIntBE=function(T,I,O){T=T>>>0,I=I>>>0,O||v(T,I,this.length);let q=this[T+--I],H=1;for(;I>0&&(H*=256);)q+=this[T+--I]*H;return q},l.prototype.readUint8=l.prototype.readUInt8=function(T,I){return T=T>>>0,I||v(T,1,this.length),this[T]},l.prototype.readUint16LE=l.prototype.readUInt16LE=function(T,I){return T=T>>>0,I||v(T,2,this.length),this[T]|this[T+1]<<8},l.prototype.readUint16BE=l.prototype.readUInt16BE=function(T,I){return T=T>>>0,I||v(T,2,this.length),this[T]<<8|this[T+1]},l.prototype.readUint32LE=l.prototype.readUInt32LE=function(T,I){return T=T>>>0,I||v(T,4,this.length),(this[T]|this[T+1]<<8|this[T+2]<<16)+this[T+3]*16777216},l.prototype.readUint32BE=l.prototype.readUInt32BE=function(T,I){return T=T>>>0,I||v(T,4,this.length),this[T]*16777216+(this[T+1]<<16|this[T+2]<<8|this[T+3])},l.prototype.readBigUInt64LE=Ge(function(T){T=T>>>0,j(T,"offset");let I=this[T],O=this[T+7];(I===void 0||O===void 0)&&J(T,this.length-8);let q=I+this[++T]*2**8+this[++T]*2**16+this[++T]*2**24,H=this[++T]+this[++T]*2**8+this[++T]*2**16+O*2**24;return BigInt(q)+(BigInt(H)<<BigInt(32))}),l.prototype.readBigUInt64BE=Ge(function(T){T=T>>>0,j(T,"offset");let I=this[T],O=this[T+7];(I===void 0||O===void 0)&&J(T,this.length-8);let q=I*2**24+this[++T]*2**16+this[++T]*2**8+this[++T],H=this[++T]*2**24+this[++T]*2**16+this[++T]*2**8+O;return(BigInt(q)<<BigInt(32))+BigInt(H)}),l.prototype.readIntLE=function(T,I,O){T=T>>>0,I=I>>>0,O||v(T,I,this.length);let q=this[T],H=1,W=0;for(;++W<I&&(H*=256);)q+=this[T+W]*H;return H*=128,q>=H&&(q-=Math.pow(2,8*I)),q},l.prototype.readIntBE=function(T,I,O){T=T>>>0,I=I>>>0,O||v(T,I,this.length);let q=I,H=1,W=this[T+--q];for(;q>0&&(H*=256);)W+=this[T+--q]*H;return H*=128,W>=H&&(W-=Math.pow(2,8*I)),W},l.prototype.readInt8=function(T,I){return T=T>>>0,I||v(T,1,this.length),this[T]&128?(255-this[T]+1)*-1:this[T]},l.prototype.readInt16LE=function(T,I){T=T>>>0,I||v(T,2,this.length);let O=this[T]|this[T+1]<<8;return O&32768?O|4294901760:O},l.prototype.readInt16BE=function(T,I){T=T>>>0,I||v(T,2,this.length);let O=this[T+1]|this[T]<<8;return O&32768?O|4294901760:O},l.prototype.readInt32LE=function(T,I){return T=T>>>0,I||v(T,4,this.length),this[T]|this[T+1]<<8|this[T+2]<<16|this[T+3]<<24},l.prototype.readInt32BE=function(T,I){return T=T>>>0,I||v(T,4,this.length),this[T]<<24|this[T+1]<<16|this[T+2]<<8|this[T+3]},l.prototype.readBigInt64LE=Ge(function(T){T=T>>>0,j(T,"offset");let I=this[T],O=this[T+7];(I===void 0||O===void 0)&&J(T,this.length-8);let q=this[T+4]+this[T+5]*2**8+this[T+6]*2**16+(O<<24);return(BigInt(q)<<BigInt(32))+BigInt(I+this[++T]*2**8+this[++T]*2**16+this[++T]*2**24)}),l.prototype.readBigInt64BE=Ge(function(T){T=T>>>0,j(T,"offset");let I=this[T],O=this[T+7];(I===void 0||O===void 0)&&J(T,this.length-8);let q=(I<<24)+this[++T]*2**16+this[++T]*2**8+this[++T];return(BigInt(q)<<BigInt(32))+BigInt(this[++T]*2**24+this[++T]*2**16+this[++T]*2**8+O)}),l.prototype.readFloatLE=function(T,I){return T=T>>>0,I||v(T,4,this.length),e.read(this,T,!0,23,4)},l.prototype.readFloatBE=function(T,I){return T=T>>>0,I||v(T,4,this.length),e.read(this,T,!1,23,4)},l.prototype.readDoubleLE=function(T,I){return T=T>>>0,I||v(T,8,this.length),e.read(this,T,!0,52,8)},l.prototype.readDoubleBE=function(T,I){return T=T>>>0,I||v(T,8,this.length),e.read(this,T,!1,52,8)};function R(z,T,I,O,q,H){if(!l.isBuffer(z))throw new TypeError('"buffer" argument must be a Buffer instance');if(T>q||T<H)throw new RangeError('"value" argument is out of bounds');if(I+O>z.length)throw new RangeError("Index out of range")}l.prototype.writeUintLE=l.prototype.writeUIntLE=function(T,I,O,q){if(T=+T,I=I>>>0,O=O>>>0,!q){let fe=Math.pow(2,8*O)-1;R(this,T,I,O,fe,0)}let H=1,W=0;for(this[I]=T&255;++W<O&&(H*=256);)this[I+W]=T/H&255;return I+O},l.prototype.writeUintBE=l.prototype.writeUIntBE=function(T,I,O,q){if(T=+T,I=I>>>0,O=O>>>0,!q){let fe=Math.pow(2,8*O)-1;R(this,T,I,O,fe,0)}let H=O-1,W=1;for(this[I+H]=T&255;--H>=0&&(W*=256);)this[I+H]=T/W&255;return I+O},l.prototype.writeUint8=l.prototype.writeUInt8=function(T,I,O){return T=+T,I=I>>>0,O||R(this,T,I,1,255,0),this[I]=T&255,I+1},l.prototype.writeUint16LE=l.prototype.writeUInt16LE=function(T,I,O){return T=+T,I=I>>>0,O||R(this,T,I,2,65535,0),this[I]=T&255,this[I+1]=T>>>8,I+2},l.prototype.writeUint16BE=l.prototype.writeUInt16BE=function(T,I,O){return T=+T,I=I>>>0,O||R(this,T,I,2,65535,0),this[I]=T>>>8,this[I+1]=T&255,I+2},l.prototype.writeUint32LE=l.prototype.writeUInt32LE=function(T,I,O){return T=+T,I=I>>>0,O||R(this,T,I,4,4294967295,0),this[I+3]=T>>>24,this[I+2]=T>>>16,this[I+1]=T>>>8,this[I]=T&255,I+4},l.prototype.writeUint32BE=l.prototype.writeUInt32BE=function(T,I,O){return T=+T,I=I>>>0,O||R(this,T,I,4,4294967295,0),this[I]=T>>>24,this[I+1]=T>>>16,this[I+2]=T>>>8,this[I+3]=T&255,I+4};function S(z,T,I,O,q){te(T,O,q,z,I,7);let H=Number(T&BigInt(4294967295));z[I++]=H,H=H>>8,z[I++]=H,H=H>>8,z[I++]=H,H=H>>8,z[I++]=H;let W=Number(T>>BigInt(32)&BigInt(4294967295));return z[I++]=W,W=W>>8,z[I++]=W,W=W>>8,z[I++]=W,W=W>>8,z[I++]=W,I}function B(z,T,I,O,q){te(T,O,q,z,I,7);let H=Number(T&BigInt(4294967295));z[I+7]=H,H=H>>8,z[I+6]=H,H=H>>8,z[I+5]=H,H=H>>8,z[I+4]=H;let W=Number(T>>BigInt(32)&BigInt(4294967295));return z[I+3]=W,W=W>>8,z[I+2]=W,W=W>>8,z[I+1]=W,W=W>>8,z[I]=W,I+8}l.prototype.writeBigUInt64LE=Ge(function(T,I=0){return S(this,T,I,BigInt(0),BigInt("0xffffffffffffffff"))}),l.prototype.writeBigUInt64BE=Ge(function(T,I=0){return B(this,T,I,BigInt(0),BigInt("0xffffffffffffffff"))}),l.prototype.writeIntLE=function(T,I,O,q){if(T=+T,I=I>>>0,!q){let st=Math.pow(2,8*O-1);R(this,T,I,O,st-1,-st)}let H=0,W=1,fe=0;for(this[I]=T&255;++H<O&&(W*=256);)T<0&&fe===0&&this[I+H-1]!==0&&(fe=1),this[I+H]=(T/W>>0)-fe&255;return I+O},l.prototype.writeIntBE=function(T,I,O,q){if(T=+T,I=I>>>0,!q){let st=Math.pow(2,8*O-1);R(this,T,I,O,st-1,-st)}let H=O-1,W=1,fe=0;for(this[I+H]=T&255;--H>=0&&(W*=256);)T<0&&fe===0&&this[I+H+1]!==0&&(fe=1),this[I+H]=(T/W>>0)-fe&255;return I+O},l.prototype.writeInt8=function(T,I,O){return T=+T,I=I>>>0,O||R(this,T,I,1,127,-128),T<0&&(T=255+T+1),this[I]=T&255,I+1},l.prototype.writeInt16LE=function(T,I,O){return T=+T,I=I>>>0,O||R(this,T,I,2,32767,-32768),this[I]=T&255,this[I+1]=T>>>8,I+2},l.prototype.writeInt16BE=function(T,I,O){return T=+T,I=I>>>0,O||R(this,T,I,2,32767,-32768),this[I]=T>>>8,this[I+1]=T&255,I+2},l.prototype.writeInt32LE=function(T,I,O){return T=+T,I=I>>>0,O||R(this,T,I,4,2147483647,-2147483648),this[I]=T&255,this[I+1]=T>>>8,this[I+2]=T>>>16,this[I+3]=T>>>24,I+4},l.prototype.writeInt32BE=function(T,I,O){return T=+T,I=I>>>0,O||R(this,T,I,4,2147483647,-2147483648),T<0&&(T=4294967295+T+1),this[I]=T>>>24,this[I+1]=T>>>16,this[I+2]=T>>>8,this[I+3]=T&255,I+4},l.prototype.writeBigInt64LE=Ge(function(T,I=0){return S(this,T,I,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),l.prototype.writeBigInt64BE=Ge(function(T,I=0){return B(this,T,I,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function F(z,T,I,O,q,H){if(I+O>z.length)throw new RangeError("Index out of range");if(I<0)throw new RangeError("Index out of range")}function $(z,T,I,O,q){return T=+T,I=I>>>0,q||F(z,T,I,4),e.write(z,T,I,O,23,4),I+4}l.prototype.writeFloatLE=function(T,I,O){return $(this,T,I,!0,O)},l.prototype.writeFloatBE=function(T,I,O){return $(this,T,I,!1,O)};function re(z,T,I,O,q){return T=+T,I=I>>>0,q||F(z,T,I,8),e.write(z,T,I,O,52,8),I+8}l.prototype.writeDoubleLE=function(T,I,O){return re(this,T,I,!0,O)},l.prototype.writeDoubleBE=function(T,I,O){return re(this,T,I,!1,O)},l.prototype.copy=function(T,I,O,q){if(!l.isBuffer(T))throw new TypeError("argument should be a Buffer");if(O||(O=0),!q&&q!==0&&(q=this.length),I>=T.length&&(I=T.length),I||(I=0),q>0&&q<O&&(q=O),q===O||T.length===0||this.length===0)return 0;if(I<0)throw new RangeError("targetStart out of bounds");if(O<0||O>=this.length)throw new RangeError("Index out of range");if(q<0)throw new RangeError("sourceEnd out of bounds");q>this.length&&(q=this.length),T.length-I<q-O&&(q=T.length-I+O);let H=q-O;return this===T&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(I,O,q):Uint8Array.prototype.set.call(T,this.subarray(O,q),I),H},l.prototype.fill=function(T,I,O,q){if(typeof T=="string"){if(typeof I=="string"?(q=I,I=0,O=this.length):typeof O=="string"&&(q=O,O=this.length),q!==void 0&&typeof q!="string")throw new TypeError("encoding must be a string");if(typeof q=="string"&&!l.isEncoding(q))throw new TypeError("Unknown encoding: "+q);if(T.length===1){let W=T.charCodeAt(0);(q==="utf8"&&W<128||q==="latin1")&&(T=W)}}else typeof T=="number"?T=T&255:typeof T=="boolean"&&(T=Number(T));if(I<0||this.length<I||this.length<O)throw new RangeError("Out of range index");if(O<=I)return this;I=I>>>0,O=O===void 0?this.length:O>>>0,T||(T=0);let H;if(typeof T=="number")for(H=I;H<O;++H)this[H]=T;else{let W=l.isBuffer(T)?T:l.from(T,q),fe=W.length;if(fe===0)throw new TypeError('The value "'+T+'" is invalid for argument "value"');for(H=0;H<O-I;++H)this[H+I]=W[H%fe]}return this};let Q={};function Z(z,T,I){Q[z]=class extends I{constructor(){super(),Object.defineProperty(this,"message",{value:T.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${z}]`,this.stack,delete this.name}get code(){return z}set code(q){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:q,writable:!0})}toString(){return`${this.name} [${z}]: ${this.message}`}}}Z("ERR_BUFFER_OUT_OF_BOUNDS",function(z){return z?`${z} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),Z("ERR_INVALID_ARG_TYPE",function(z,T){return`The "${z}" argument must be of type number. Received type ${typeof T}`},TypeError),Z("ERR_OUT_OF_RANGE",function(z,T,I){let O=`The value of "${z}" is out of range.`,q=I;return Number.isInteger(I)&&Math.abs(I)>2**32?q=K(String(I)):typeof I=="bigint"&&(q=String(I),(I>BigInt(2)**BigInt(32)||I<-(BigInt(2)**BigInt(32)))&&(q=K(q)),q+="n"),O+=` It must be ${T}. Received ${q}`,O},RangeError);function K(z){let T="",I=z.length,O=z[0]==="-"?1:0;for(;I>=O+4;I-=3)T=`_${z.slice(I-3,I)}${T}`;return`${z.slice(0,I)}${T}`}function le(z,T,I){j(T,"offset"),(z[T]===void 0||z[T+I]===void 0)&&J(T,z.length-(I+1))}function te(z,T,I,O,q,H){if(z>I||z<T){let W=typeof T=="bigint"?"n":"",fe;throw H>3?T===0||T===BigInt(0)?fe=`>= 0${W} and < 2${W} ** ${(H+1)*8}${W}`:fe=`>= -(2${W} ** ${(H+1)*8-1}${W}) and < 2 ** ${(H+1)*8-1}${W}`:fe=`>= ${T}${W} and <= ${I}${W}`,new Q.ERR_OUT_OF_RANGE("value",fe,z)}le(O,q,H)}function j(z,T){if(typeof z!="number")throw new Q.ERR_INVALID_ARG_TYPE(T,"number",z)}function J(z,T,I){throw Math.floor(z)!==z?(j(z,I),new Q.ERR_OUT_OF_RANGE(I||"offset","an integer",z)):T<0?new Q.ERR_BUFFER_OUT_OF_BOUNDS:new Q.ERR_OUT_OF_RANGE(I||"offset",`>= ${I?1:0} and <= ${T}`,z)}let X=/[^+/0-9A-Za-z-_]/g;function he(z){if(z=z.split("=")[0],z=z.trim().replace(X,""),z.length<2)return"";for(;z.length%4!==0;)z=z+"=";return z}function Te(z,T){T=T||1/0;let I,O=z.length,q=null,H=[];for(let W=0;W<O;++W){if(I=z.charCodeAt(W),I>55295&&I<57344){if(!q){if(I>56319){(T-=3)>-1&&H.push(239,191,189);continue}else if(W+1===O){(T-=3)>-1&&H.push(239,191,189);continue}q=I;continue}if(I<56320){(T-=3)>-1&&H.push(239,191,189),q=I;continue}I=(q-55296<<10|I-56320)+65536}else q&&(T-=3)>-1&&H.push(239,191,189);if(q=null,I<128){if((T-=1)<0)break;H.push(I)}else if(I<2048){if((T-=2)<0)break;H.push(I>>6|192,I&63|128)}else if(I<65536){if((T-=3)<0)break;H.push(I>>12|224,I>>6&63|128,I&63|128)}else if(I<1114112){if((T-=4)<0)break;H.push(I>>18|240,I>>12&63|128,I>>6&63|128,I&63|128)}else throw new Error("Invalid code point")}return H}function oe(z){let T=[];for(let I=0;I<z.length;++I)T.push(z.charCodeAt(I)&255);return T}function ce(z,T){let I,O,q,H=[];for(let W=0;W<z.length&&!((T-=2)<0);++W)I=z.charCodeAt(W),O=I>>8,q=I%256,H.push(q),H.push(O);return H}function ot(z){return t.toByteArray(he(z))}function ge(z,T,I,O){let q;for(q=0;q<O&&!(q+I>=T.length||q>=z.length);++q)T[q+I]=z[q];return q}function Se(z,T){return z instanceof T||z!=null&&z.constructor!=null&&z.constructor.name!=null&&z.constructor.name===T.name}function ut(z){return z!==z}let Ze=function(){let z="0123456789abcdef",T=new Array(256);for(let I=0;I<16;++I){let O=I*16;for(let q=0;q<16;++q)T[O+q]=z[I]+z[q]}return T}();function Ge(z){return typeof BigInt>"u"?lt:z}function lt(){throw new Error("BigInt not supported")}return Nc}var gv,$O,Nb,qO,Nc,UO,al,Me,hue,lue,lo=Si(()=>{"use strict";ie();ae();ne();gv={},$O=!1;Nb={},qO=!1;Nc={},UO=!1;al=uue();al.Buffer;al.SlowBuffer;al.INSPECT_MAX_BYTES;al.kMaxLength;Me=al.Buffer,hue=al.INSPECT_MAX_BYTES,lue=al.kMaxLength});var ae=Si(()=>{"use strict";lo()});var FO=ht(Xw=>{"use strict";ie();ae();ne();Object.defineProperty(Xw,"__esModule",{value:!0});function cue(t){var e=4,r=t.length,a=r%e;if(!a)return t;var i=r,h=e-a,l=r+h,p=Me.alloc(l);for(p.write(t);h--;)p.write("=",i++);return p.toString()}Xw.default=cue});var zO=ht(t5=>{"use strict";ie();ae();ne();Object.defineProperty(t5,"__esModule",{value:!0});var due=FO();function jO(t,e){return e===void 0&&(e="utf8"),Me.isBuffer(t)?Qw(t.toString("base64")):Qw(Me.from(t,e).toString("base64"))}function pue(t,e){return e===void 0&&(e="utf8"),Me.from(e5(t),"base64").toString(e)}function e5(t){return t=t.toString(),due.default(t).replace(/\-/g,"+").replace(/_/g,"/")}function Qw(t){return t.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function vue(t){return Me.from(e5(t),"base64")}var Vd=jO;Vd.encode=jO;Vd.decode=pue;Vd.toBase64=e5;Vd.fromBase64=Qw;Vd.toBuffer=vue;t5.default=Vd});var qo=ht((BUe,Cb)=>{"use strict";ie();ae();ne();Cb.exports=zO().default;Cb.exports.default=Cb.exports});function Oi(){Oi.init.call(this)}function Lb(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function QO(t){return t._maxListeners===void 0?Oi.defaultMaxListeners:t._maxListeners}function WO(t,e,r,a){var i,h,l,p;if(Lb(r),(h=t._events)===void 0?(h=t._events=Object.create(null),t._eventsCount=0):(h.newListener!==void 0&&(t.emit("newListener",e,r.listener?r.listener:r),h=t._events),l=h[e]),l===void 0)l=h[e]=r,++t._eventsCount;else if(typeof l=="function"?l=h[e]=a?[r,l]:[l,r]:a?l.unshift(r):l.push(r),(i=QO(t))>0&&l.length>i&&!l.warned){l.warned=!0;var b=new Error("Possible EventEmitter memory leak detected. "+l.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");b.name="MaxListenersExceededWarning",b.emitter=t,b.type=e,b.count=l.length,p=b,console&&console.warn&&console.warn(p)}return t}function mue(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function VO(t,e,r){var a={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=mue.bind(a);return i.listener=r,a.wrapFn=i,i}function GO(t,e,r){var a=t._events;if(a===void 0)return[];var i=a[e];return i===void 0?[]:typeof i=="function"?r?[i.listener||i]:[i]:r?function(h){for(var l=new Array(h.length),p=0;p<l.length;++p)l[p]=h[p].listener||h[p];return l}(i):eN(i,i.length)}function YO(t){var e=this._events;if(e!==void 0){var r=e[t];if(typeof r=="function")return 1;if(r!==void 0)return r.length}return 0}function eN(t,e){for(var r=new Array(e),a=0;a<e;++a)r[a]=t[a];return r}var JO,XO,Gd,ZO,HO,KO,Ei,Ks=Si(()=>{"use strict";ie();ae();ne();Gd=typeof Reflect=="object"?Reflect:null,ZO=Gd&&typeof Gd.apply=="function"?Gd.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};XO=Gd&&typeof Gd.ownKeys=="function"?Gd.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};HO=Number.isNaN||function(t){return t!=t};JO=Oi,Oi.EventEmitter=Oi,Oi.prototype._events=void 0,Oi.prototype._eventsCount=0,Oi.prototype._maxListeners=void 0;KO=10;Object.defineProperty(Oi,"defaultMaxListeners",{enumerable:!0,get:function(){return KO},set:function(t){if(typeof t!="number"||t<0||HO(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");KO=t}}),Oi.init=function(){this._events!==void 0&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},Oi.prototype.setMaxListeners=function(t){if(typeof t!="number"||t<0||HO(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},Oi.prototype.getMaxListeners=function(){return QO(this)},Oi.prototype.emit=function(t){for(var e=[],r=1;r<arguments.length;r++)e.push(arguments[r]);var a=t==="error",i=this._events;if(i!==void 0)a=a&&i.error===void 0;else if(!a)return!1;if(a){var h;if(e.length>0&&(h=e[0]),h instanceof Error)throw h;var l=new Error("Unhandled error."+(h?" ("+h.message+")":""));throw l.context=h,l}var p=i[t];if(p===void 0)return!1;if(typeof p=="function")ZO(p,this,e);else{var b=p.length,g=eN(p,b);for(r=0;r<b;++r)ZO(g[r],this,e)}return!0},Oi.prototype.addListener=function(t,e){return WO(this,t,e,!1)},Oi.prototype.on=Oi.prototype.addListener,Oi.prototype.prependListener=function(t,e){return WO(this,t,e,!0)},Oi.prototype.once=function(t,e){return Lb(e),this.on(t,VO(this,t,e)),this},Oi.prototype.prependOnceListener=function(t,e){return Lb(e),this.prependListener(t,VO(this,t,e)),this},Oi.prototype.removeListener=function(t,e){var r,a,i,h,l;if(Lb(e),(a=this._events)===void 0)return this;if((r=a[t])===void 0)return this;if(r===e||r.listener===e)--this._eventsCount==0?this._events=Object.create(null):(delete a[t],a.removeListener&&this.emit("removeListener",t,r.listener||e));else if(typeof r!="function"){for(i=-1,h=r.length-1;h>=0;h--)if(r[h]===e||r[h].listener===e){l=r[h].listener,i=h;break}if(i<0)return this;i===0?r.shift():function(p,b){for(;b+1<p.length;b++)p[b]=p[b+1];p.pop()}(r,i),r.length===1&&(a[t]=r[0]),a.removeListener!==void 0&&this.emit("removeListener",t,l||e)}return this},Oi.prototype.off=Oi.prototype.removeListener,Oi.prototype.removeAllListeners=function(t){var e,r,a;if((r=this._events)===void 0)return this;if(r.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):r[t]!==void 0&&(--this._eventsCount==0?this._events=Object.create(null):delete r[t]),this;if(arguments.length===0){var i,h=Object.keys(r);for(a=0;a<h.length;++a)(i=h[a])!=="removeListener"&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(typeof(e=r[t])=="function")this.removeListener(t,e);else if(e!==void 0)for(a=e.length-1;a>=0;a--)this.removeListener(t,e[a]);return this},Oi.prototype.listeners=function(t){return GO(this,t,!0)},Oi.prototype.rawListeners=function(t){return GO(this,t,!1)},Oi.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):YO.call(t,e)},Oi.prototype.listenerCount=YO,Oi.prototype.eventNames=function(){return this._eventsCount>0?XO(this._events):[]};Ei=JO;Ei.EventEmitter;Ei.defaultMaxListeners;Ei.init;Ei.listenerCount;Ei.EventEmitter;Ei.defaultMaxListeners;Ei.init;Ei.listenerCount});function r5(){throw new Error("setTimeout has not been defined")}function i5(){throw new Error("clearTimeout has not been defined")}function iN(t){if(Qu===setTimeout)return setTimeout(t,0);if((Qu===r5||!Qu)&&setTimeout)return Qu=setTimeout,setTimeout(t,0);try{return Qu(t,0)}catch{try{return Qu.call(null,t,0)}catch{return Qu.call(this||Jd,t,0)}}}function gue(){Yd&&Cc&&(Yd=!1,Cc.length?th=Cc.concat(th):Db=-1,th.length&&nN())}function nN(){if(!Yd){var t=iN(gue);Yd=!0;for(var e=th.length;e;){for(Cc=th,th=[];++Db<e;)Cc&&Cc[Db].run();Db=-1,e=th.length}Cc=null,Yd=!1,function(r){if(eh===clearTimeout)return clearTimeout(r);if((eh===i5||!eh)&&clearTimeout)return eh=clearTimeout,clearTimeout(r);try{eh(r)}catch{try{return eh.call(null,r)}catch{return eh.call(this||Jd,r)}}}(t)}}function tN(t,e){(this||Jd).fun=t,(this||Jd).array=e}function Xu(){}var rN,Qu,eh,Jd,Mn,Cc,th,Yd,Db,fr,Uo=Si(()=>{"use strict";ie();ae();ne();Jd=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,Mn=rN={};(function(){try{Qu=typeof setTimeout=="function"?setTimeout:r5}catch{Qu=r5}try{eh=typeof clearTimeout=="function"?clearTimeout:i5}catch{eh=i5}})();th=[],Yd=!1,Db=-1;Mn.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];th.push(new tN(t,e)),th.length!==1||Yd||iN(nN)},tN.prototype.run=function(){(this||Jd).fun.apply(null,(this||Jd).array)},Mn.title="browser",Mn.browser=!0,Mn.env={},Mn.argv=[],Mn.version="",Mn.versions={},Mn.on=Xu,Mn.addListener=Xu,Mn.once=Xu,Mn.off=Xu,Mn.removeListener=Xu,Mn.removeAllListeners=Xu,Mn.emit=Xu,Mn.prependListener=Xu,Mn.prependOnceListener=Xu,Mn.listeners=function(t){return[]},Mn.binding=function(t){throw new Error("process.binding is not supported")},Mn.cwd=function(){return"/"},Mn.chdir=function(t){throw new Error("process.chdir is not supported")},Mn.umask=function(){return 0};fr=rN;fr.addListener;fr.argv;fr.binding;fr.browser;fr.chdir;fr.cwd;fr.emit;fr.env;fr.listeners;fr.nextTick;fr.off;fr.on;fr.once;fr.prependListener;fr.prependOnceListener;fr.removeAllListeners;fr.removeListener;fr.title;fr.umask;fr.version;fr.versions});function $c(t){return t.call.bind(t)}function _v(t,e){if(typeof t!="object")return!1;try{return e(t),!0}catch{return!1}}function oN(t){return Ka&&co?Fo(t)!==void 0:_N(t)||MN(t)||xN(t)||SN(t)||EN(t)||AN(t)||RN(t)||TN(t)||kN(t)||IN(t)||BN(t)}function _N(t){return Ka&&co?Fo(t)==="Uint8Array":tn(t)==="[object Uint8Array]"||Aue(t)&&t.buffer!==void 0}function MN(t){return Ka&&co?Fo(t)==="Uint8ClampedArray":tn(t)==="[object Uint8ClampedArray]"}function xN(t){return Ka&&co?Fo(t)==="Uint16Array":tn(t)==="[object Uint16Array]"}function SN(t){return Ka&&co?Fo(t)==="Uint32Array":tn(t)==="[object Uint32Array]"}function EN(t){return Ka&&co?Fo(t)==="Int8Array":tn(t)==="[object Int8Array]"}function AN(t){return Ka&&co?Fo(t)==="Int16Array":tn(t)==="[object Int16Array]"}function RN(t){return Ka&&co?Fo(t)==="Int32Array":tn(t)==="[object Int32Array]"}function TN(t){return Ka&&co?Fo(t)==="Float32Array":tn(t)==="[object Float32Array]"}function kN(t){return Ka&&co?Fo(t)==="Float64Array":tn(t)==="[object Float64Array]"}function IN(t){return Ka&&co?Fo(t)==="BigInt64Array":tn(t)==="[object BigInt64Array]"}function BN(t){return Ka&&co?Fo(t)==="BigUint64Array":tn(t)==="[object BigUint64Array]"}function $b(t){return tn(t)==="[object Map]"}function qb(t){return tn(t)==="[object Set]"}function Ub(t){return tn(t)==="[object WeakMap]"}function n5(t){return tn(t)==="[object WeakSet]"}function Zb(t){return tn(t)==="[object ArrayBuffer]"}function sN(t){return typeof ArrayBuffer<"u"&&(Zb.working?Zb(t):t instanceof ArrayBuffer)}function Hb(t){return tn(t)==="[object DataView]"}function fN(t){return typeof DataView<"u"&&(Hb.working?Hb(t):t instanceof DataView)}function Kb(t){return tn(t)==="[object SharedArrayBuffer]"}function uN(t){return typeof SharedArrayBuffer<"u"&&(Kb.working?Kb(t):t instanceof SharedArrayBuffer)}function hN(t){return _v(t,Bue)}function lN(t){return _v(t,Pue)}function cN(t){return _v(t,Oue)}function dN(t){return wN&&_v(t,Nue)}function pN(t){return u5&&_v(t,Cue)}function ol(t,e){var r={seen:[],stylize:$ue};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),h5(e)?r.showHidden=e:e&&gt._extend(r,e),Dc(r.showHidden)&&(r.showHidden=!1),Dc(r.depth)&&(r.depth=2),Dc(r.colors)&&(r.colors=!1),Dc(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=Due),Wb(r,t,r.depth)}function Due(t,e){var r=ol.styles[e];return r?"\x1B["+ol.colors[r][0]+"m"+t+"\x1B["+ol.colors[r][1]+"m":t}function $ue(t,e){return t}function Wb(t,e,r){if(t.customInspect&&e&&zb(e.inspect)&&e.inspect!==gt.inspect&&(!e.constructor||e.constructor.prototype!==e)){var a=e.inspect(r,t);return Vb(a)||(a=Wb(t,a,r)),a}var i=function(x,E){if(Dc(E))return x.stylize("undefined","undefined");if(Vb(E)){var A="'"+JSON.stringify(E).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return x.stylize(A,"string")}if(NN(E))return x.stylize(""+E,"number");if(h5(E))return x.stylize(""+E,"boolean");if(Jb(E))return x.stylize("null","null")}(t,e);if(i)return i;var h=Object.keys(e),l=function(x){var E={};return x.forEach(function(A,k){E[A]=!0}),E}(h);if(t.showHidden&&(h=Object.getOwnPropertyNames(e)),wv(e)&&(h.indexOf("message")>=0||h.indexOf("description")>=0))return a5(e);if(h.length===0){if(zb(e)){var p=e.name?": "+e.name:"";return t.stylize("[Function"+p+"]","special")}if(yv(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(Gb(e))return t.stylize(Date.prototype.toString.call(e),"date");if(wv(e))return a5(e)}var b,g="",y=!1,M=["{","}"];return ON(e)&&(y=!0,M=["[","]"]),zb(e)&&(g=" [Function"+(e.name?": "+e.name:"")+"]"),yv(e)&&(g=" "+RegExp.prototype.toString.call(e)),Gb(e)&&(g=" "+Date.prototype.toUTCString.call(e)),wv(e)&&(g=" "+a5(e)),h.length!==0||y&&e.length!=0?r<0?yv(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special"):(t.seen.push(e),b=y?function(x,E,A,k,P){for(var N=[],L=0,C=E.length;L<C;++L)CN(E,String(L))?N.push(o5(x,E,A,k,String(L),!0)):N.push("");return P.forEach(function(Y){Y.match(/^\d+$/)||N.push(o5(x,E,A,k,Y,!0))}),N}(t,e,r,l,h):h.map(function(x){return o5(t,e,r,l,x,y)}),t.seen.pop(),function(x,E,A){var k=0;return x.reduce(function(P,N){return k++,N.indexOf(`
1
+ var tue=Object.create;var kb=Object.defineProperty;var rue=Object.getOwnPropertyDescriptor;var iue=Object.getOwnPropertyNames;var nue=Object.getPrototypeOf,aue=Object.prototype.hasOwnProperty;var Si=(t,e)=>()=>(t&&(e=t(t=0)),e);var ht=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Ha=(t,e)=>{for(var r in e)kb(t,r,{get:e[r],enumerable:!0})},xP=(t,e,r,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of iue(e))!aue.call(t,i)&&i!==r&&kb(t,i,{get:()=>e[i],enumerable:!(a=rue(e,i))||a.enumerable});return t};var gi=(t,e,r)=>(r=t!=null?tue(nue(t)):{},xP(e||!t||!t.__esModule?kb(r,"default",{value:t,enumerable:!0}):r,t)),ei=t=>xP(kb({},"__esModule",{value:!0}),t);var ie=Si(()=>{"use strict"});var He={};Ha(He,{_debugEnd:()=>lO,_debugProcess:()=>hO,_events:()=>AO,_eventsCount:()=>RO,_exiting:()=>HP,_fatalExceptions:()=>oO,_getActiveHandles:()=>GP,_getActiveRequests:()=>VP,_kill:()=>JP,_linkedBinding:()=>zP,_maxListeners:()=>EO,_preload_modules:()=>xO,_rawDebug:()=>FP,_startProfilerIdleNotifier:()=>cO,_stopProfilerIdleNotifier:()=>dO,_tickCallback:()=>uO,abort:()=>gO,addListener:()=>TO,allowedNodeEnvironmentFlags:()=>iO,arch:()=>TP,argv:()=>BP,argv0:()=>MO,assert:()=>nO,binding:()=>LP,chdir:()=>qP,config:()=>KP,cpuUsage:()=>Pb,cwd:()=>$P,debugPort:()=>_O,default:()=>DO,dlopen:()=>WP,domain:()=>ZP,emit:()=>OO,emitWarning:()=>CP,env:()=>IP,execArgv:()=>PP,execPath:()=>wO,exit:()=>tO,features:()=>aO,hasUncaughtExceptionCaptureCallback:()=>fO,hrtime:()=>Bb,kill:()=>eO,listeners:()=>LO,memoryUsage:()=>QP,moduleLoadList:()=>jP,nextTick:()=>EP,off:()=>IO,on:()=>Yu,once:()=>kO,openStdin:()=>rO,pid:()=>bO,platform:()=>kP,ppid:()=>yO,prependListener:()=>NO,prependOnceListener:()=>CO,reallyExit:()=>YP,release:()=>UP,removeAllListeners:()=>PO,removeListener:()=>BO,resourceUsage:()=>XP,setSourceMapsEnabled:()=>SO,setUncaughtExceptionCaptureCallback:()=>sO,stderr:()=>vO,stdin:()=>mO,stdout:()=>pO,title:()=>RP,umask:()=>DP,uptime:()=>Wd,version:()=>OP,versions:()=>NP});function Yw(t){throw new Error("Node.js process "+t+" is not supported by JSPM core outside of Node.js")}function oue(){!Kd||!Oc||(Kd=!1,Oc.length?Gu=Oc.concat(Gu):Ib=-1,Gu.length&&SP())}function SP(){if(!Kd){var t=setTimeout(oue,0);Kd=!0;for(var e=Gu.length;e;){for(Oc=Gu,Gu=[];++Ib<e;)Oc&&Oc[Ib].run();Ib=-1,e=Gu.length}Oc=null,Kd=!1,clearTimeout(t)}}function EP(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];Gu.push(new AP(t,e)),Gu.length===1&&!Kd&&setTimeout(SP,0)}function AP(t,e){this.fun=t,this.array=e}function pa(){}function zP(t){Yw("_linkedBinding")}function WP(t){Yw("dlopen")}function VP(){return[]}function GP(){return[]}function nO(t,e){if(!t)throw new Error(e||"assertion error")}function fO(){return!1}function Wd(){return nl.now()/1e3}function Bb(t){var e=Math.floor((Date.now()-nl.now())*.001),r=nl.now()*.001,a=Math.floor(r)+e,i=Math.floor(r%1*1e9);return t&&(a=a-t[0],i=i-t[1],i<0&&(a--,i+=Gw)),[a,i]}function Yu(){return DO}function LO(t){return[]}var Gu,Kd,Oc,Ib,RP,TP,kP,IP,BP,PP,OP,NP,CP,LP,DP,$P,qP,UP,FP,jP,ZP,HP,KP,YP,JP,Pb,XP,QP,eO,tO,rO,iO,aO,oO,sO,uO,hO,lO,cO,dO,pO,vO,mO,gO,bO,yO,wO,_O,MO,xO,SO,nl,Vw,Gw,EO,AO,RO,TO,kO,IO,BO,PO,OO,NO,CO,DO,Ob=Si(()=>{"use strict";ie();ae();ne();Gu=[],Kd=!1,Ib=-1;AP.prototype.run=function(){this.fun.apply(null,this.array)};RP="browser",TP="x64",kP="browser",IP={PATH:"/usr/bin",LANG:navigator.language+".UTF-8",PWD:"/",HOME:"/home",TMP:"/tmp"},BP=["/usr/bin/node"],PP=[],OP="v16.8.0",NP={},CP=function(t,e){console.warn((e?e+": ":"")+t)},LP=function(t){Yw("binding")},DP=function(t){return 0},$P=function(){return"/"},qP=function(t){},UP={name:"node",sourceUrl:"",headersUrl:"",libUrl:""};FP=pa,jP=[];ZP={},HP=!1,KP={};YP=pa,JP=pa,Pb=function(){return{}},XP=Pb,QP=Pb,eO=pa,tO=pa,rO=pa,iO={};aO={inspector:!1,debug:!1,uv:!1,ipv6:!1,tls_alpn:!1,tls_sni:!1,tls_ocsp:!1,tls:!1,cached_builtins:!0},oO=pa,sO=pa;uO=pa,hO=pa,lO=pa,cO=pa,dO=pa,pO=void 0,vO=void 0,mO=void 0,gO=pa,bO=2,yO=1,wO="/bin/usr/node",_O=9229,MO="node",xO=[],SO=pa,nl={now:typeof performance<"u"?performance.now.bind(performance):void 0,timing:typeof performance<"u"?performance.timing:void 0};nl.now===void 0&&(Vw=Date.now(),nl.timing&&nl.timing.navigationStart&&(Vw=nl.timing.navigationStart),nl.now=()=>Date.now()-Vw);Gw=1e9;Bb.bigint=function(t){var e=Bb(t);return typeof BigInt>"u"?e[0]*Gw+e[1]:BigInt(e[0]*Gw)+BigInt(e[1])};EO=10,AO={},RO=0;TO=Yu,kO=Yu,IO=Yu,BO=Yu,PO=Yu,OO=pa,NO=Yu,CO=Yu;DO={version:OP,versions:NP,arch:TP,platform:kP,release:UP,_rawDebug:FP,moduleLoadList:jP,binding:LP,_linkedBinding:zP,_events:AO,_eventsCount:RO,_maxListeners:EO,on:Yu,addListener:TO,once:kO,off:IO,removeListener:BO,removeAllListeners:PO,emit:OO,prependListener:NO,prependOnceListener:CO,listeners:LO,domain:ZP,_exiting:HP,config:KP,dlopen:WP,uptime:Wd,_getActiveRequests:VP,_getActiveHandles:GP,reallyExit:YP,_kill:JP,cpuUsage:Pb,resourceUsage:XP,memoryUsage:QP,kill:eO,exit:tO,openStdin:rO,allowedNodeEnvironmentFlags:iO,assert:nO,features:aO,_fatalExceptions:oO,setUncaughtExceptionCaptureCallback:sO,hasUncaughtExceptionCaptureCallback:fO,emitWarning:CP,nextTick:EP,_tickCallback:uO,_debugProcess:hO,_debugEnd:lO,_startProfilerIdleNotifier:cO,_stopProfilerIdleNotifier:dO,stdout:pO,stdin:mO,stderr:vO,abort:gO,umask:DP,chdir:qP,cwd:$P,env:IP,title:RP,argv:BP,execArgv:PP,pid:bO,ppid:yO,execPath:wO,debugPort:_O,hrtime:Bb,argv0:MO,_preload_modules:xO,setSourceMapsEnabled:SO}});var ne=Si(()=>{"use strict";Ob()});var Ju={};Ha(Ju,{Buffer:()=>Me,INSPECT_MAX_BYTES:()=>hue,default:()=>al,kMaxLength:()=>lue});function sue(){if($O)return gv;$O=!0,gv.byteLength=p,gv.toByteArray=g,gv.fromByteArray=x;for(var t=[],e=[],r=typeof Uint8Array<"u"?Uint8Array:Array,a="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,h=a.length;i<h;++i)t[i]=a[i],e[a.charCodeAt(i)]=i;e[45]=62,e[95]=63;function l(E){var A=E.length;if(A%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var k=E.indexOf("=");k===-1&&(k=A);var P=k===A?0:4-k%4;return[k,P]}function p(E){var A=l(E),k=A[0],P=A[1];return(k+P)*3/4-P}function b(E,A,k){return(A+k)*3/4-k}function g(E){var A,k=l(E),P=k[0],N=k[1],L=new r(b(E,P,N)),C=0,Y=N>0?P-4:P,G;for(G=0;G<Y;G+=4)A=e[E.charCodeAt(G)]<<18|e[E.charCodeAt(G+1)]<<12|e[E.charCodeAt(G+2)]<<6|e[E.charCodeAt(G+3)],L[C++]=A>>16&255,L[C++]=A>>8&255,L[C++]=A&255;return N===2&&(A=e[E.charCodeAt(G)]<<2|e[E.charCodeAt(G+1)]>>4,L[C++]=A&255),N===1&&(A=e[E.charCodeAt(G)]<<10|e[E.charCodeAt(G+1)]<<4|e[E.charCodeAt(G+2)]>>2,L[C++]=A>>8&255,L[C++]=A&255),L}function y(E){return t[E>>18&63]+t[E>>12&63]+t[E>>6&63]+t[E&63]}function M(E,A,k){for(var P,N=[],L=A;L<k;L+=3)P=(E[L]<<16&16711680)+(E[L+1]<<8&65280)+(E[L+2]&255),N.push(y(P));return N.join("")}function x(E){for(var A,k=E.length,P=k%3,N=[],L=16383,C=0,Y=k-P;C<Y;C+=L)N.push(M(E,C,C+L>Y?Y:C+L));return P===1?(A=E[k-1],N.push(t[A>>2]+t[A<<4&63]+"==")):P===2&&(A=(E[k-2]<<8)+E[k-1],N.push(t[A>>10]+t[A>>4&63]+t[A<<2&63]+"=")),N.join("")}return gv}function fue(){if(qO)return Nb;qO=!0;return Nb.read=function(t,e,r,a,i){var h,l,p=i*8-a-1,b=(1<<p)-1,g=b>>1,y=-7,M=r?i-1:0,x=r?-1:1,E=t[e+M];for(M+=x,h=E&(1<<-y)-1,E>>=-y,y+=p;y>0;h=h*256+t[e+M],M+=x,y-=8);for(l=h&(1<<-y)-1,h>>=-y,y+=a;y>0;l=l*256+t[e+M],M+=x,y-=8);if(h===0)h=1-g;else{if(h===b)return l?NaN:(E?-1:1)*(1/0);l=l+Math.pow(2,a),h=h-g}return(E?-1:1)*l*Math.pow(2,h-a)},Nb.write=function(t,e,r,a,i,h){var l,p,b,g=h*8-i-1,y=(1<<g)-1,M=y>>1,x=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,E=a?0:h-1,A=a?1:-1,k=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(p=isNaN(e)?1:0,l=y):(l=Math.floor(Math.log(e)/Math.LN2),e*(b=Math.pow(2,-l))<1&&(l--,b*=2),l+M>=1?e+=x/b:e+=x*Math.pow(2,1-M),e*b>=2&&(l++,b/=2),l+M>=y?(p=0,l=y):l+M>=1?(p=(e*b-1)*Math.pow(2,i),l=l+M):(p=e*Math.pow(2,M-1)*Math.pow(2,i),l=0));i>=8;t[r+E]=p&255,E+=A,p/=256,i-=8);for(l=l<<i|p,g+=i;g>0;t[r+E]=l&255,E+=A,l/=256,g-=8);t[r+E-A]|=k*128},Nb}function uue(){if(UO)return Nc;UO=!0;let t=sue(),e=fue(),r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Nc.Buffer=l,Nc.SlowBuffer=N,Nc.INSPECT_MAX_BYTES=50;let a=2147483647;Nc.kMaxLength=a,l.TYPED_ARRAY_SUPPORT=i(),!l.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 i(){try{let z=new Uint8Array(1),T={foo:function(){return 42}};return Object.setPrototypeOf(T,Uint8Array.prototype),Object.setPrototypeOf(z,T),z.foo()===42}catch{return!1}}Object.defineProperty(l.prototype,"parent",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.buffer}}),Object.defineProperty(l.prototype,"offset",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.byteOffset}});function h(z){if(z>a)throw new RangeError('The value "'+z+'" is invalid for option "size"');let T=new Uint8Array(z);return Object.setPrototypeOf(T,l.prototype),T}function l(z,T,I){if(typeof z=="number"){if(typeof T=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return y(z)}return p(z,T,I)}l.poolSize=8192;function p(z,T,I){if(typeof z=="string")return M(z,T);if(ArrayBuffer.isView(z))return E(z);if(z==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof z);if(Se(z,ArrayBuffer)||z&&Se(z.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Se(z,SharedArrayBuffer)||z&&Se(z.buffer,SharedArrayBuffer)))return A(z,T,I);if(typeof z=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let O=z.valueOf&&z.valueOf();if(O!=null&&O!==z)return l.from(O,T,I);let q=k(z);if(q)return q;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof z[Symbol.toPrimitive]=="function")return l.from(z[Symbol.toPrimitive]("string"),T,I);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof z)}l.from=function(z,T,I){return p(z,T,I)},Object.setPrototypeOf(l.prototype,Uint8Array.prototype),Object.setPrototypeOf(l,Uint8Array);function b(z){if(typeof z!="number")throw new TypeError('"size" argument must be of type number');if(z<0)throw new RangeError('The value "'+z+'" is invalid for option "size"')}function g(z,T,I){return b(z),z<=0?h(z):T!==void 0?typeof I=="string"?h(z).fill(T,I):h(z).fill(T):h(z)}l.alloc=function(z,T,I){return g(z,T,I)};function y(z){return b(z),h(z<0?0:P(z)|0)}l.allocUnsafe=function(z){return y(z)},l.allocUnsafeSlow=function(z){return y(z)};function M(z,T){if((typeof T!="string"||T==="")&&(T="utf8"),!l.isEncoding(T))throw new TypeError("Unknown encoding: "+T);let I=L(z,T)|0,O=h(I),q=O.write(z,T);return q!==I&&(O=O.slice(0,q)),O}function x(z){let T=z.length<0?0:P(z.length)|0,I=h(T);for(let O=0;O<T;O+=1)I[O]=z[O]&255;return I}function E(z){if(Se(z,Uint8Array)){let T=new Uint8Array(z);return A(T.buffer,T.byteOffset,T.byteLength)}return x(z)}function A(z,T,I){if(T<0||z.byteLength<T)throw new RangeError('"offset" is outside of buffer bounds');if(z.byteLength<T+(I||0))throw new RangeError('"length" is outside of buffer bounds');let O;return T===void 0&&I===void 0?O=new Uint8Array(z):I===void 0?O=new Uint8Array(z,T):O=new Uint8Array(z,T,I),Object.setPrototypeOf(O,l.prototype),O}function k(z){if(l.isBuffer(z)){let T=P(z.length)|0,I=h(T);return I.length===0||z.copy(I,0,0,T),I}if(z.length!==void 0)return typeof z.length!="number"||ut(z.length)?h(0):x(z);if(z.type==="Buffer"&&Array.isArray(z.data))return x(z.data)}function P(z){if(z>=a)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+a.toString(16)+" bytes");return z|0}function N(z){return+z!=z&&(z=0),l.alloc(+z)}l.isBuffer=function(T){return T!=null&&T._isBuffer===!0&&T!==l.prototype},l.compare=function(T,I){if(Se(T,Uint8Array)&&(T=l.from(T,T.offset,T.byteLength)),Se(I,Uint8Array)&&(I=l.from(I,I.offset,I.byteLength)),!l.isBuffer(T)||!l.isBuffer(I))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(T===I)return 0;let O=T.length,q=I.length;for(let H=0,W=Math.min(O,q);H<W;++H)if(T[H]!==I[H]){O=T[H],q=I[H];break}return O<q?-1:q<O?1:0},l.isEncoding=function(T){switch(String(T).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}},l.concat=function(T,I){if(!Array.isArray(T))throw new TypeError('"list" argument must be an Array of Buffers');if(T.length===0)return l.alloc(0);let O;if(I===void 0)for(I=0,O=0;O<T.length;++O)I+=T[O].length;let q=l.allocUnsafe(I),H=0;for(O=0;O<T.length;++O){let W=T[O];if(Se(W,Uint8Array))H+W.length>q.length?(l.isBuffer(W)||(W=l.from(W)),W.copy(q,H)):Uint8Array.prototype.set.call(q,W,H);else if(l.isBuffer(W))W.copy(q,H);else throw new TypeError('"list" argument must be an Array of Buffers');H+=W.length}return q};function L(z,T){if(l.isBuffer(z))return z.length;if(ArrayBuffer.isView(z)||Se(z,ArrayBuffer))return z.byteLength;if(typeof z!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof z);let I=z.length,O=arguments.length>2&&arguments[2]===!0;if(!O&&I===0)return 0;let q=!1;for(;;)switch(T){case"ascii":case"latin1":case"binary":return I;case"utf8":case"utf-8":return Te(z).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I*2;case"hex":return I>>>1;case"base64":return ot(z).length;default:if(q)return O?-1:Te(z).length;T=(""+T).toLowerCase(),q=!0}}l.byteLength=L;function C(z,T,I){let O=!1;if((T===void 0||T<0)&&(T=0),T>this.length||((I===void 0||I>this.length)&&(I=this.length),I<=0)||(I>>>=0,T>>>=0,I<=T))return"";for(z||(z="utf8");;)switch(z){case"hex":return d(this,T,I);case"utf8":case"utf-8":return f(this,T,I);case"ascii":return m(this,T,I);case"latin1":case"binary":return w(this,T,I);case"base64":return s(this,T,I);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return o(this,T,I);default:if(O)throw new TypeError("Unknown encoding: "+z);z=(z+"").toLowerCase(),O=!0}}l.prototype._isBuffer=!0;function Y(z,T,I){let O=z[T];z[T]=z[I],z[I]=O}l.prototype.swap16=function(){let T=this.length;if(T%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let I=0;I<T;I+=2)Y(this,I,I+1);return this},l.prototype.swap32=function(){let T=this.length;if(T%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let I=0;I<T;I+=4)Y(this,I,I+3),Y(this,I+1,I+2);return this},l.prototype.swap64=function(){let T=this.length;if(T%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let I=0;I<T;I+=8)Y(this,I,I+7),Y(this,I+1,I+6),Y(this,I+2,I+5),Y(this,I+3,I+4);return this},l.prototype.toString=function(){let T=this.length;return T===0?"":arguments.length===0?f(this,0,T):C.apply(this,arguments)},l.prototype.toLocaleString=l.prototype.toString,l.prototype.equals=function(T){if(!l.isBuffer(T))throw new TypeError("Argument must be a Buffer");return this===T?!0:l.compare(this,T)===0},l.prototype.inspect=function(){let T="",I=Nc.INSPECT_MAX_BYTES;return T=this.toString("hex",0,I).replace(/(.{2})/g,"$1 ").trim(),this.length>I&&(T+=" ... "),"<Buffer "+T+">"},r&&(l.prototype[r]=l.prototype.inspect),l.prototype.compare=function(T,I,O,q,H){if(Se(T,Uint8Array)&&(T=l.from(T,T.offset,T.byteLength)),!l.isBuffer(T))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof T);if(I===void 0&&(I=0),O===void 0&&(O=T?T.length:0),q===void 0&&(q=0),H===void 0&&(H=this.length),I<0||O>T.length||q<0||H>this.length)throw new RangeError("out of range index");if(q>=H&&I>=O)return 0;if(q>=H)return-1;if(I>=O)return 1;if(I>>>=0,O>>>=0,q>>>=0,H>>>=0,this===T)return 0;let W=H-q,fe=O-I,st=Math.min(W,fe),ue=this.slice(q,H),me=T.slice(I,O);for(let pe=0;pe<st;++pe)if(ue[pe]!==me[pe]){W=ue[pe],fe=me[pe];break}return W<fe?-1:fe<W?1:0};function G(z,T,I,O,q){if(z.length===0)return-1;if(typeof I=="string"?(O=I,I=0):I>2147483647?I=2147483647:I<-2147483648&&(I=-2147483648),I=+I,ut(I)&&(I=q?0:z.length-1),I<0&&(I=z.length+I),I>=z.length){if(q)return-1;I=z.length-1}else if(I<0)if(q)I=0;else return-1;if(typeof T=="string"&&(T=l.from(T,O)),l.isBuffer(T))return T.length===0?-1:ee(z,T,I,O,q);if(typeof T=="number")return T=T&255,typeof Uint8Array.prototype.indexOf=="function"?q?Uint8Array.prototype.indexOf.call(z,T,I):Uint8Array.prototype.lastIndexOf.call(z,T,I):ee(z,[T],I,O,q);throw new TypeError("val must be string, number or Buffer")}function ee(z,T,I,O,q){let H=1,W=z.length,fe=T.length;if(O!==void 0&&(O=String(O).toLowerCase(),O==="ucs2"||O==="ucs-2"||O==="utf16le"||O==="utf-16le")){if(z.length<2||T.length<2)return-1;H=2,W/=2,fe/=2,I/=2}function st(me,pe){return H===1?me[pe]:me.readUInt16BE(pe*H)}let ue;if(q){let me=-1;for(ue=I;ue<W;ue++)if(st(z,ue)===st(T,me===-1?0:ue-me)){if(me===-1&&(me=ue),ue-me+1===fe)return me*H}else me!==-1&&(ue-=ue-me),me=-1}else for(I+fe>W&&(I=W-fe),ue=I;ue>=0;ue--){let me=!0;for(let pe=0;pe<fe;pe++)if(st(z,ue+pe)!==st(T,pe)){me=!1;break}if(me)return ue}return-1}l.prototype.includes=function(T,I,O){return this.indexOf(T,I,O)!==-1},l.prototype.indexOf=function(T,I,O){return G(this,T,I,O,!0)},l.prototype.lastIndexOf=function(T,I,O){return G(this,T,I,O,!1)};function D(z,T,I,O){I=Number(I)||0;let q=z.length-I;O?(O=Number(O),O>q&&(O=q)):O=q;let H=T.length;O>H/2&&(O=H/2);let W;for(W=0;W<O;++W){let fe=parseInt(T.substr(W*2,2),16);if(ut(fe))return W;z[I+W]=fe}return W}function U(z,T,I,O){return ge(Te(T,z.length-I),z,I,O)}function V(z,T,I,O){return ge(oe(T),z,I,O)}function _(z,T,I,O){return ge(ot(T),z,I,O)}function n(z,T,I,O){return ge(ce(T,z.length-I),z,I,O)}l.prototype.write=function(T,I,O,q){if(I===void 0)q="utf8",O=this.length,I=0;else if(O===void 0&&typeof I=="string")q=I,O=this.length,I=0;else if(isFinite(I))I=I>>>0,isFinite(O)?(O=O>>>0,q===void 0&&(q="utf8")):(q=O,O=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let H=this.length-I;if((O===void 0||O>H)&&(O=H),T.length>0&&(O<0||I<0)||I>this.length)throw new RangeError("Attempt to write outside buffer bounds");q||(q="utf8");let W=!1;for(;;)switch(q){case"hex":return D(this,T,I,O);case"utf8":case"utf-8":return U(this,T,I,O);case"ascii":case"latin1":case"binary":return V(this,T,I,O);case"base64":return _(this,T,I,O);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return n(this,T,I,O);default:if(W)throw new TypeError("Unknown encoding: "+q);q=(""+q).toLowerCase(),W=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function s(z,T,I){return T===0&&I===z.length?t.fromByteArray(z):t.fromByteArray(z.slice(T,I))}function f(z,T,I){I=Math.min(z.length,I);let O=[],q=T;for(;q<I;){let H=z[q],W=null,fe=H>239?4:H>223?3:H>191?2:1;if(q+fe<=I){let st,ue,me,pe;switch(fe){case 1:H<128&&(W=H);break;case 2:st=z[q+1],(st&192)===128&&(pe=(H&31)<<6|st&63,pe>127&&(W=pe));break;case 3:st=z[q+1],ue=z[q+2],(st&192)===128&&(ue&192)===128&&(pe=(H&15)<<12|(st&63)<<6|ue&63,pe>2047&&(pe<55296||pe>57343)&&(W=pe));break;case 4:st=z[q+1],ue=z[q+2],me=z[q+3],(st&192)===128&&(ue&192)===128&&(me&192)===128&&(pe=(H&15)<<18|(st&63)<<12|(ue&63)<<6|me&63,pe>65535&&pe<1114112&&(W=pe))}}W===null?(W=65533,fe=1):W>65535&&(W-=65536,O.push(W>>>10&1023|55296),W=56320|W&1023),O.push(W),q+=fe}return c(O)}let u=4096;function c(z){let T=z.length;if(T<=u)return String.fromCharCode.apply(String,z);let I="",O=0;for(;O<T;)I+=String.fromCharCode.apply(String,z.slice(O,O+=u));return I}function m(z,T,I){let O="";I=Math.min(z.length,I);for(let q=T;q<I;++q)O+=String.fromCharCode(z[q]&127);return O}function w(z,T,I){let O="";I=Math.min(z.length,I);for(let q=T;q<I;++q)O+=String.fromCharCode(z[q]);return O}function d(z,T,I){let O=z.length;(!T||T<0)&&(T=0),(!I||I<0||I>O)&&(I=O);let q="";for(let H=T;H<I;++H)q+=Ze[z[H]];return q}function o(z,T,I){let O=z.slice(T,I),q="";for(let H=0;H<O.length-1;H+=2)q+=String.fromCharCode(O[H]+O[H+1]*256);return q}l.prototype.slice=function(T,I){let O=this.length;T=~~T,I=I===void 0?O:~~I,T<0?(T+=O,T<0&&(T=0)):T>O&&(T=O),I<0?(I+=O,I<0&&(I=0)):I>O&&(I=O),I<T&&(I=T);let q=this.subarray(T,I);return Object.setPrototypeOf(q,l.prototype),q};function v(z,T,I){if(z%1!==0||z<0)throw new RangeError("offset is not uint");if(z+T>I)throw new RangeError("Trying to access beyond buffer length")}l.prototype.readUintLE=l.prototype.readUIntLE=function(T,I,O){T=T>>>0,I=I>>>0,O||v(T,I,this.length);let q=this[T],H=1,W=0;for(;++W<I&&(H*=256);)q+=this[T+W]*H;return q},l.prototype.readUintBE=l.prototype.readUIntBE=function(T,I,O){T=T>>>0,I=I>>>0,O||v(T,I,this.length);let q=this[T+--I],H=1;for(;I>0&&(H*=256);)q+=this[T+--I]*H;return q},l.prototype.readUint8=l.prototype.readUInt8=function(T,I){return T=T>>>0,I||v(T,1,this.length),this[T]},l.prototype.readUint16LE=l.prototype.readUInt16LE=function(T,I){return T=T>>>0,I||v(T,2,this.length),this[T]|this[T+1]<<8},l.prototype.readUint16BE=l.prototype.readUInt16BE=function(T,I){return T=T>>>0,I||v(T,2,this.length),this[T]<<8|this[T+1]},l.prototype.readUint32LE=l.prototype.readUInt32LE=function(T,I){return T=T>>>0,I||v(T,4,this.length),(this[T]|this[T+1]<<8|this[T+2]<<16)+this[T+3]*16777216},l.prototype.readUint32BE=l.prototype.readUInt32BE=function(T,I){return T=T>>>0,I||v(T,4,this.length),this[T]*16777216+(this[T+1]<<16|this[T+2]<<8|this[T+3])},l.prototype.readBigUInt64LE=Ge(function(T){T=T>>>0,j(T,"offset");let I=this[T],O=this[T+7];(I===void 0||O===void 0)&&J(T,this.length-8);let q=I+this[++T]*2**8+this[++T]*2**16+this[++T]*2**24,H=this[++T]+this[++T]*2**8+this[++T]*2**16+O*2**24;return BigInt(q)+(BigInt(H)<<BigInt(32))}),l.prototype.readBigUInt64BE=Ge(function(T){T=T>>>0,j(T,"offset");let I=this[T],O=this[T+7];(I===void 0||O===void 0)&&J(T,this.length-8);let q=I*2**24+this[++T]*2**16+this[++T]*2**8+this[++T],H=this[++T]*2**24+this[++T]*2**16+this[++T]*2**8+O;return(BigInt(q)<<BigInt(32))+BigInt(H)}),l.prototype.readIntLE=function(T,I,O){T=T>>>0,I=I>>>0,O||v(T,I,this.length);let q=this[T],H=1,W=0;for(;++W<I&&(H*=256);)q+=this[T+W]*H;return H*=128,q>=H&&(q-=Math.pow(2,8*I)),q},l.prototype.readIntBE=function(T,I,O){T=T>>>0,I=I>>>0,O||v(T,I,this.length);let q=I,H=1,W=this[T+--q];for(;q>0&&(H*=256);)W+=this[T+--q]*H;return H*=128,W>=H&&(W-=Math.pow(2,8*I)),W},l.prototype.readInt8=function(T,I){return T=T>>>0,I||v(T,1,this.length),this[T]&128?(255-this[T]+1)*-1:this[T]},l.prototype.readInt16LE=function(T,I){T=T>>>0,I||v(T,2,this.length);let O=this[T]|this[T+1]<<8;return O&32768?O|4294901760:O},l.prototype.readInt16BE=function(T,I){T=T>>>0,I||v(T,2,this.length);let O=this[T+1]|this[T]<<8;return O&32768?O|4294901760:O},l.prototype.readInt32LE=function(T,I){return T=T>>>0,I||v(T,4,this.length),this[T]|this[T+1]<<8|this[T+2]<<16|this[T+3]<<24},l.prototype.readInt32BE=function(T,I){return T=T>>>0,I||v(T,4,this.length),this[T]<<24|this[T+1]<<16|this[T+2]<<8|this[T+3]},l.prototype.readBigInt64LE=Ge(function(T){T=T>>>0,j(T,"offset");let I=this[T],O=this[T+7];(I===void 0||O===void 0)&&J(T,this.length-8);let q=this[T+4]+this[T+5]*2**8+this[T+6]*2**16+(O<<24);return(BigInt(q)<<BigInt(32))+BigInt(I+this[++T]*2**8+this[++T]*2**16+this[++T]*2**24)}),l.prototype.readBigInt64BE=Ge(function(T){T=T>>>0,j(T,"offset");let I=this[T],O=this[T+7];(I===void 0||O===void 0)&&J(T,this.length-8);let q=(I<<24)+this[++T]*2**16+this[++T]*2**8+this[++T];return(BigInt(q)<<BigInt(32))+BigInt(this[++T]*2**24+this[++T]*2**16+this[++T]*2**8+O)}),l.prototype.readFloatLE=function(T,I){return T=T>>>0,I||v(T,4,this.length),e.read(this,T,!0,23,4)},l.prototype.readFloatBE=function(T,I){return T=T>>>0,I||v(T,4,this.length),e.read(this,T,!1,23,4)},l.prototype.readDoubleLE=function(T,I){return T=T>>>0,I||v(T,8,this.length),e.read(this,T,!0,52,8)},l.prototype.readDoubleBE=function(T,I){return T=T>>>0,I||v(T,8,this.length),e.read(this,T,!1,52,8)};function R(z,T,I,O,q,H){if(!l.isBuffer(z))throw new TypeError('"buffer" argument must be a Buffer instance');if(T>q||T<H)throw new RangeError('"value" argument is out of bounds');if(I+O>z.length)throw new RangeError("Index out of range")}l.prototype.writeUintLE=l.prototype.writeUIntLE=function(T,I,O,q){if(T=+T,I=I>>>0,O=O>>>0,!q){let fe=Math.pow(2,8*O)-1;R(this,T,I,O,fe,0)}let H=1,W=0;for(this[I]=T&255;++W<O&&(H*=256);)this[I+W]=T/H&255;return I+O},l.prototype.writeUintBE=l.prototype.writeUIntBE=function(T,I,O,q){if(T=+T,I=I>>>0,O=O>>>0,!q){let fe=Math.pow(2,8*O)-1;R(this,T,I,O,fe,0)}let H=O-1,W=1;for(this[I+H]=T&255;--H>=0&&(W*=256);)this[I+H]=T/W&255;return I+O},l.prototype.writeUint8=l.prototype.writeUInt8=function(T,I,O){return T=+T,I=I>>>0,O||R(this,T,I,1,255,0),this[I]=T&255,I+1},l.prototype.writeUint16LE=l.prototype.writeUInt16LE=function(T,I,O){return T=+T,I=I>>>0,O||R(this,T,I,2,65535,0),this[I]=T&255,this[I+1]=T>>>8,I+2},l.prototype.writeUint16BE=l.prototype.writeUInt16BE=function(T,I,O){return T=+T,I=I>>>0,O||R(this,T,I,2,65535,0),this[I]=T>>>8,this[I+1]=T&255,I+2},l.prototype.writeUint32LE=l.prototype.writeUInt32LE=function(T,I,O){return T=+T,I=I>>>0,O||R(this,T,I,4,4294967295,0),this[I+3]=T>>>24,this[I+2]=T>>>16,this[I+1]=T>>>8,this[I]=T&255,I+4},l.prototype.writeUint32BE=l.prototype.writeUInt32BE=function(T,I,O){return T=+T,I=I>>>0,O||R(this,T,I,4,4294967295,0),this[I]=T>>>24,this[I+1]=T>>>16,this[I+2]=T>>>8,this[I+3]=T&255,I+4};function S(z,T,I,O,q){te(T,O,q,z,I,7);let H=Number(T&BigInt(4294967295));z[I++]=H,H=H>>8,z[I++]=H,H=H>>8,z[I++]=H,H=H>>8,z[I++]=H;let W=Number(T>>BigInt(32)&BigInt(4294967295));return z[I++]=W,W=W>>8,z[I++]=W,W=W>>8,z[I++]=W,W=W>>8,z[I++]=W,I}function B(z,T,I,O,q){te(T,O,q,z,I,7);let H=Number(T&BigInt(4294967295));z[I+7]=H,H=H>>8,z[I+6]=H,H=H>>8,z[I+5]=H,H=H>>8,z[I+4]=H;let W=Number(T>>BigInt(32)&BigInt(4294967295));return z[I+3]=W,W=W>>8,z[I+2]=W,W=W>>8,z[I+1]=W,W=W>>8,z[I]=W,I+8}l.prototype.writeBigUInt64LE=Ge(function(T,I=0){return S(this,T,I,BigInt(0),BigInt("0xffffffffffffffff"))}),l.prototype.writeBigUInt64BE=Ge(function(T,I=0){return B(this,T,I,BigInt(0),BigInt("0xffffffffffffffff"))}),l.prototype.writeIntLE=function(T,I,O,q){if(T=+T,I=I>>>0,!q){let st=Math.pow(2,8*O-1);R(this,T,I,O,st-1,-st)}let H=0,W=1,fe=0;for(this[I]=T&255;++H<O&&(W*=256);)T<0&&fe===0&&this[I+H-1]!==0&&(fe=1),this[I+H]=(T/W>>0)-fe&255;return I+O},l.prototype.writeIntBE=function(T,I,O,q){if(T=+T,I=I>>>0,!q){let st=Math.pow(2,8*O-1);R(this,T,I,O,st-1,-st)}let H=O-1,W=1,fe=0;for(this[I+H]=T&255;--H>=0&&(W*=256);)T<0&&fe===0&&this[I+H+1]!==0&&(fe=1),this[I+H]=(T/W>>0)-fe&255;return I+O},l.prototype.writeInt8=function(T,I,O){return T=+T,I=I>>>0,O||R(this,T,I,1,127,-128),T<0&&(T=255+T+1),this[I]=T&255,I+1},l.prototype.writeInt16LE=function(T,I,O){return T=+T,I=I>>>0,O||R(this,T,I,2,32767,-32768),this[I]=T&255,this[I+1]=T>>>8,I+2},l.prototype.writeInt16BE=function(T,I,O){return T=+T,I=I>>>0,O||R(this,T,I,2,32767,-32768),this[I]=T>>>8,this[I+1]=T&255,I+2},l.prototype.writeInt32LE=function(T,I,O){return T=+T,I=I>>>0,O||R(this,T,I,4,2147483647,-2147483648),this[I]=T&255,this[I+1]=T>>>8,this[I+2]=T>>>16,this[I+3]=T>>>24,I+4},l.prototype.writeInt32BE=function(T,I,O){return T=+T,I=I>>>0,O||R(this,T,I,4,2147483647,-2147483648),T<0&&(T=4294967295+T+1),this[I]=T>>>24,this[I+1]=T>>>16,this[I+2]=T>>>8,this[I+3]=T&255,I+4},l.prototype.writeBigInt64LE=Ge(function(T,I=0){return S(this,T,I,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),l.prototype.writeBigInt64BE=Ge(function(T,I=0){return B(this,T,I,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function F(z,T,I,O,q,H){if(I+O>z.length)throw new RangeError("Index out of range");if(I<0)throw new RangeError("Index out of range")}function $(z,T,I,O,q){return T=+T,I=I>>>0,q||F(z,T,I,4),e.write(z,T,I,O,23,4),I+4}l.prototype.writeFloatLE=function(T,I,O){return $(this,T,I,!0,O)},l.prototype.writeFloatBE=function(T,I,O){return $(this,T,I,!1,O)};function re(z,T,I,O,q){return T=+T,I=I>>>0,q||F(z,T,I,8),e.write(z,T,I,O,52,8),I+8}l.prototype.writeDoubleLE=function(T,I,O){return re(this,T,I,!0,O)},l.prototype.writeDoubleBE=function(T,I,O){return re(this,T,I,!1,O)},l.prototype.copy=function(T,I,O,q){if(!l.isBuffer(T))throw new TypeError("argument should be a Buffer");if(O||(O=0),!q&&q!==0&&(q=this.length),I>=T.length&&(I=T.length),I||(I=0),q>0&&q<O&&(q=O),q===O||T.length===0||this.length===0)return 0;if(I<0)throw new RangeError("targetStart out of bounds");if(O<0||O>=this.length)throw new RangeError("Index out of range");if(q<0)throw new RangeError("sourceEnd out of bounds");q>this.length&&(q=this.length),T.length-I<q-O&&(q=T.length-I+O);let H=q-O;return this===T&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(I,O,q):Uint8Array.prototype.set.call(T,this.subarray(O,q),I),H},l.prototype.fill=function(T,I,O,q){if(typeof T=="string"){if(typeof I=="string"?(q=I,I=0,O=this.length):typeof O=="string"&&(q=O,O=this.length),q!==void 0&&typeof q!="string")throw new TypeError("encoding must be a string");if(typeof q=="string"&&!l.isEncoding(q))throw new TypeError("Unknown encoding: "+q);if(T.length===1){let W=T.charCodeAt(0);(q==="utf8"&&W<128||q==="latin1")&&(T=W)}}else typeof T=="number"?T=T&255:typeof T=="boolean"&&(T=Number(T));if(I<0||this.length<I||this.length<O)throw new RangeError("Out of range index");if(O<=I)return this;I=I>>>0,O=O===void 0?this.length:O>>>0,T||(T=0);let H;if(typeof T=="number")for(H=I;H<O;++H)this[H]=T;else{let W=l.isBuffer(T)?T:l.from(T,q),fe=W.length;if(fe===0)throw new TypeError('The value "'+T+'" is invalid for argument "value"');for(H=0;H<O-I;++H)this[H+I]=W[H%fe]}return this};let Q={};function Z(z,T,I){Q[z]=class extends I{constructor(){super(),Object.defineProperty(this,"message",{value:T.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${z}]`,this.stack,delete this.name}get code(){return z}set code(q){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:q,writable:!0})}toString(){return`${this.name} [${z}]: ${this.message}`}}}Z("ERR_BUFFER_OUT_OF_BOUNDS",function(z){return z?`${z} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),Z("ERR_INVALID_ARG_TYPE",function(z,T){return`The "${z}" argument must be of type number. Received type ${typeof T}`},TypeError),Z("ERR_OUT_OF_RANGE",function(z,T,I){let O=`The value of "${z}" is out of range.`,q=I;return Number.isInteger(I)&&Math.abs(I)>2**32?q=K(String(I)):typeof I=="bigint"&&(q=String(I),(I>BigInt(2)**BigInt(32)||I<-(BigInt(2)**BigInt(32)))&&(q=K(q)),q+="n"),O+=` It must be ${T}. Received ${q}`,O},RangeError);function K(z){let T="",I=z.length,O=z[0]==="-"?1:0;for(;I>=O+4;I-=3)T=`_${z.slice(I-3,I)}${T}`;return`${z.slice(0,I)}${T}`}function le(z,T,I){j(T,"offset"),(z[T]===void 0||z[T+I]===void 0)&&J(T,z.length-(I+1))}function te(z,T,I,O,q,H){if(z>I||z<T){let W=typeof T=="bigint"?"n":"",fe;throw H>3?T===0||T===BigInt(0)?fe=`>= 0${W} and < 2${W} ** ${(H+1)*8}${W}`:fe=`>= -(2${W} ** ${(H+1)*8-1}${W}) and < 2 ** ${(H+1)*8-1}${W}`:fe=`>= ${T}${W} and <= ${I}${W}`,new Q.ERR_OUT_OF_RANGE("value",fe,z)}le(O,q,H)}function j(z,T){if(typeof z!="number")throw new Q.ERR_INVALID_ARG_TYPE(T,"number",z)}function J(z,T,I){throw Math.floor(z)!==z?(j(z,I),new Q.ERR_OUT_OF_RANGE(I||"offset","an integer",z)):T<0?new Q.ERR_BUFFER_OUT_OF_BOUNDS:new Q.ERR_OUT_OF_RANGE(I||"offset",`>= ${I?1:0} and <= ${T}`,z)}let X=/[^+/0-9A-Za-z-_]/g;function he(z){if(z=z.split("=")[0],z=z.trim().replace(X,""),z.length<2)return"";for(;z.length%4!==0;)z=z+"=";return z}function Te(z,T){T=T||1/0;let I,O=z.length,q=null,H=[];for(let W=0;W<O;++W){if(I=z.charCodeAt(W),I>55295&&I<57344){if(!q){if(I>56319){(T-=3)>-1&&H.push(239,191,189);continue}else if(W+1===O){(T-=3)>-1&&H.push(239,191,189);continue}q=I;continue}if(I<56320){(T-=3)>-1&&H.push(239,191,189),q=I;continue}I=(q-55296<<10|I-56320)+65536}else q&&(T-=3)>-1&&H.push(239,191,189);if(q=null,I<128){if((T-=1)<0)break;H.push(I)}else if(I<2048){if((T-=2)<0)break;H.push(I>>6|192,I&63|128)}else if(I<65536){if((T-=3)<0)break;H.push(I>>12|224,I>>6&63|128,I&63|128)}else if(I<1114112){if((T-=4)<0)break;H.push(I>>18|240,I>>12&63|128,I>>6&63|128,I&63|128)}else throw new Error("Invalid code point")}return H}function oe(z){let T=[];for(let I=0;I<z.length;++I)T.push(z.charCodeAt(I)&255);return T}function ce(z,T){let I,O,q,H=[];for(let W=0;W<z.length&&!((T-=2)<0);++W)I=z.charCodeAt(W),O=I>>8,q=I%256,H.push(q),H.push(O);return H}function ot(z){return t.toByteArray(he(z))}function ge(z,T,I,O){let q;for(q=0;q<O&&!(q+I>=T.length||q>=z.length);++q)T[q+I]=z[q];return q}function Se(z,T){return z instanceof T||z!=null&&z.constructor!=null&&z.constructor.name!=null&&z.constructor.name===T.name}function ut(z){return z!==z}let Ze=function(){let z="0123456789abcdef",T=new Array(256);for(let I=0;I<16;++I){let O=I*16;for(let q=0;q<16;++q)T[O+q]=z[I]+z[q]}return T}();function Ge(z){return typeof BigInt>"u"?lt:z}function lt(){throw new Error("BigInt not supported")}return Nc}var gv,$O,Nb,qO,Nc,UO,al,Me,hue,lue,lo=Si(()=>{"use strict";ie();ae();ne();gv={},$O=!1;Nb={},qO=!1;Nc={},UO=!1;al=uue();al.Buffer;al.SlowBuffer;al.INSPECT_MAX_BYTES;al.kMaxLength;Me=al.Buffer,hue=al.INSPECT_MAX_BYTES,lue=al.kMaxLength});var ae=Si(()=>{"use strict";lo()});var FO=ht(Xw=>{"use strict";ie();ae();ne();Object.defineProperty(Xw,"__esModule",{value:!0});function cue(t){var e=4,r=t.length,a=r%e;if(!a)return t;var i=r,h=e-a,l=r+h,p=Me.alloc(l);for(p.write(t);h--;)p.write("=",i++);return p.toString()}Xw.default=cue});var zO=ht(t5=>{"use strict";ie();ae();ne();Object.defineProperty(t5,"__esModule",{value:!0});var due=FO();function jO(t,e){return e===void 0&&(e="utf8"),Me.isBuffer(t)?Qw(t.toString("base64")):Qw(Me.from(t,e).toString("base64"))}function pue(t,e){return e===void 0&&(e="utf8"),Me.from(e5(t),"base64").toString(e)}function e5(t){return t=t.toString(),due.default(t).replace(/\-/g,"+").replace(/_/g,"/")}function Qw(t){return t.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function vue(t){return Me.from(e5(t),"base64")}var Vd=jO;Vd.encode=jO;Vd.decode=pue;Vd.toBase64=e5;Vd.fromBase64=Qw;Vd.toBuffer=vue;t5.default=Vd});var qo=ht((BUe,Cb)=>{"use strict";ie();ae();ne();Cb.exports=zO().default;Cb.exports.default=Cb.exports});function Oi(){Oi.init.call(this)}function Lb(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function QO(t){return t._maxListeners===void 0?Oi.defaultMaxListeners:t._maxListeners}function WO(t,e,r,a){var i,h,l,p;if(Lb(r),(h=t._events)===void 0?(h=t._events=Object.create(null),t._eventsCount=0):(h.newListener!==void 0&&(t.emit("newListener",e,r.listener?r.listener:r),h=t._events),l=h[e]),l===void 0)l=h[e]=r,++t._eventsCount;else if(typeof l=="function"?l=h[e]=a?[r,l]:[l,r]:a?l.unshift(r):l.push(r),(i=QO(t))>0&&l.length>i&&!l.warned){l.warned=!0;var b=new Error("Possible EventEmitter memory leak detected. "+l.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");b.name="MaxListenersExceededWarning",b.emitter=t,b.type=e,b.count=l.length,p=b,console&&console.warn&&console.warn(p)}return t}function mue(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function VO(t,e,r){var a={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=mue.bind(a);return i.listener=r,a.wrapFn=i,i}function GO(t,e,r){var a=t._events;if(a===void 0)return[];var i=a[e];return i===void 0?[]:typeof i=="function"?r?[i.listener||i]:[i]:r?function(h){for(var l=new Array(h.length),p=0;p<l.length;++p)l[p]=h[p].listener||h[p];return l}(i):eN(i,i.length)}function YO(t){var e=this._events;if(e!==void 0){var r=e[t];if(typeof r=="function")return 1;if(r!==void 0)return r.length}return 0}function eN(t,e){for(var r=new Array(e),a=0;a<e;++a)r[a]=t[a];return r}var JO,XO,Gd,ZO,HO,KO,Ei,Ks=Si(()=>{"use strict";ie();ae();ne();Gd=typeof Reflect=="object"?Reflect:null,ZO=Gd&&typeof Gd.apply=="function"?Gd.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};XO=Gd&&typeof Gd.ownKeys=="function"?Gd.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};HO=Number.isNaN||function(t){return t!=t};JO=Oi,Oi.EventEmitter=Oi,Oi.prototype._events=void 0,Oi.prototype._eventsCount=0,Oi.prototype._maxListeners=void 0;KO=10;Object.defineProperty(Oi,"defaultMaxListeners",{enumerable:!0,get:function(){return KO},set:function(t){if(typeof t!="number"||t<0||HO(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");KO=t}}),Oi.init=function(){this._events!==void 0&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},Oi.prototype.setMaxListeners=function(t){if(typeof t!="number"||t<0||HO(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},Oi.prototype.getMaxListeners=function(){return QO(this)},Oi.prototype.emit=function(t){for(var e=[],r=1;r<arguments.length;r++)e.push(arguments[r]);var a=t==="error",i=this._events;if(i!==void 0)a=a&&i.error===void 0;else if(!a)return!1;if(a){var h;if(e.length>0&&(h=e[0]),h instanceof Error)throw h;var l=new Error("Unhandled error."+(h?" ("+h.message+")":""));throw l.context=h,l}var p=i[t];if(p===void 0)return!1;if(typeof p=="function")ZO(p,this,e);else{var b=p.length,g=eN(p,b);for(r=0;r<b;++r)ZO(g[r],this,e)}return!0},Oi.prototype.addListener=function(t,e){return WO(this,t,e,!1)},Oi.prototype.on=Oi.prototype.addListener,Oi.prototype.prependListener=function(t,e){return WO(this,t,e,!0)},Oi.prototype.once=function(t,e){return Lb(e),this.on(t,VO(this,t,e)),this},Oi.prototype.prependOnceListener=function(t,e){return Lb(e),this.prependListener(t,VO(this,t,e)),this},Oi.prototype.removeListener=function(t,e){var r,a,i,h,l;if(Lb(e),(a=this._events)===void 0)return this;if((r=a[t])===void 0)return this;if(r===e||r.listener===e)--this._eventsCount==0?this._events=Object.create(null):(delete a[t],a.removeListener&&this.emit("removeListener",t,r.listener||e));else if(typeof r!="function"){for(i=-1,h=r.length-1;h>=0;h--)if(r[h]===e||r[h].listener===e){l=r[h].listener,i=h;break}if(i<0)return this;i===0?r.shift():function(p,b){for(;b+1<p.length;b++)p[b]=p[b+1];p.pop()}(r,i),r.length===1&&(a[t]=r[0]),a.removeListener!==void 0&&this.emit("removeListener",t,l||e)}return this},Oi.prototype.off=Oi.prototype.removeListener,Oi.prototype.removeAllListeners=function(t){var e,r,a;if((r=this._events)===void 0)return this;if(r.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):r[t]!==void 0&&(--this._eventsCount==0?this._events=Object.create(null):delete r[t]),this;if(arguments.length===0){var i,h=Object.keys(r);for(a=0;a<h.length;++a)(i=h[a])!=="removeListener"&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(typeof(e=r[t])=="function")this.removeListener(t,e);else if(e!==void 0)for(a=e.length-1;a>=0;a--)this.removeListener(t,e[a]);return this},Oi.prototype.listeners=function(t){return GO(this,t,!0)},Oi.prototype.rawListeners=function(t){return GO(this,t,!1)},Oi.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):YO.call(t,e)},Oi.prototype.listenerCount=YO,Oi.prototype.eventNames=function(){return this._eventsCount>0?XO(this._events):[]};Ei=JO;Ei.EventEmitter;Ei.defaultMaxListeners;Ei.init;Ei.listenerCount;Ei.EventEmitter;Ei.defaultMaxListeners;Ei.init;Ei.listenerCount});function r5(){throw new Error("setTimeout has not been defined")}function i5(){throw new Error("clearTimeout has not been defined")}function iN(t){if(Qu===setTimeout)return setTimeout(t,0);if((Qu===r5||!Qu)&&setTimeout)return Qu=setTimeout,setTimeout(t,0);try{return Qu(t,0)}catch{try{return Qu.call(null,t,0)}catch{return Qu.call(this||Jd,t,0)}}}function gue(){Yd&&Cc&&(Yd=!1,Cc.length?th=Cc.concat(th):Db=-1,th.length&&nN())}function nN(){if(!Yd){var t=iN(gue);Yd=!0;for(var e=th.length;e;){for(Cc=th,th=[];++Db<e;)Cc&&Cc[Db].run();Db=-1,e=th.length}Cc=null,Yd=!1,function(r){if(eh===clearTimeout)return clearTimeout(r);if((eh===i5||!eh)&&clearTimeout)return eh=clearTimeout,clearTimeout(r);try{eh(r)}catch{try{return eh.call(null,r)}catch{return eh.call(this||Jd,r)}}}(t)}}function tN(t,e){(this||Jd).fun=t,(this||Jd).array=e}function Xu(){}var rN,Qu,eh,Jd,_n,Cc,th,Yd,Db,fr,Uo=Si(()=>{"use strict";ie();ae();ne();Jd=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global,_n=rN={};(function(){try{Qu=typeof setTimeout=="function"?setTimeout:r5}catch{Qu=r5}try{eh=typeof clearTimeout=="function"?clearTimeout:i5}catch{eh=i5}})();th=[],Yd=!1,Db=-1;_n.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];th.push(new tN(t,e)),th.length!==1||Yd||iN(nN)},tN.prototype.run=function(){(this||Jd).fun.apply(null,(this||Jd).array)},_n.title="browser",_n.browser=!0,_n.env={},_n.argv=[],_n.version="",_n.versions={},_n.on=Xu,_n.addListener=Xu,_n.once=Xu,_n.off=Xu,_n.removeListener=Xu,_n.removeAllListeners=Xu,_n.emit=Xu,_n.prependListener=Xu,_n.prependOnceListener=Xu,_n.listeners=function(t){return[]},_n.binding=function(t){throw new Error("process.binding is not supported")},_n.cwd=function(){return"/"},_n.chdir=function(t){throw new Error("process.chdir is not supported")},_n.umask=function(){return 0};fr=rN;fr.addListener;fr.argv;fr.binding;fr.browser;fr.chdir;fr.cwd;fr.emit;fr.env;fr.listeners;fr.nextTick;fr.off;fr.on;fr.once;fr.prependListener;fr.prependOnceListener;fr.removeAllListeners;fr.removeListener;fr.title;fr.umask;fr.version;fr.versions});function $c(t){return t.call.bind(t)}function _v(t,e){if(typeof t!="object")return!1;try{return e(t),!0}catch{return!1}}function oN(t){return Ka&&co?Fo(t)!==void 0:_N(t)||MN(t)||xN(t)||SN(t)||EN(t)||AN(t)||RN(t)||TN(t)||kN(t)||IN(t)||BN(t)}function _N(t){return Ka&&co?Fo(t)==="Uint8Array":tn(t)==="[object Uint8Array]"||Aue(t)&&t.buffer!==void 0}function MN(t){return Ka&&co?Fo(t)==="Uint8ClampedArray":tn(t)==="[object Uint8ClampedArray]"}function xN(t){return Ka&&co?Fo(t)==="Uint16Array":tn(t)==="[object Uint16Array]"}function SN(t){return Ka&&co?Fo(t)==="Uint32Array":tn(t)==="[object Uint32Array]"}function EN(t){return Ka&&co?Fo(t)==="Int8Array":tn(t)==="[object Int8Array]"}function AN(t){return Ka&&co?Fo(t)==="Int16Array":tn(t)==="[object Int16Array]"}function RN(t){return Ka&&co?Fo(t)==="Int32Array":tn(t)==="[object Int32Array]"}function TN(t){return Ka&&co?Fo(t)==="Float32Array":tn(t)==="[object Float32Array]"}function kN(t){return Ka&&co?Fo(t)==="Float64Array":tn(t)==="[object Float64Array]"}function IN(t){return Ka&&co?Fo(t)==="BigInt64Array":tn(t)==="[object BigInt64Array]"}function BN(t){return Ka&&co?Fo(t)==="BigUint64Array":tn(t)==="[object BigUint64Array]"}function $b(t){return tn(t)==="[object Map]"}function qb(t){return tn(t)==="[object Set]"}function Ub(t){return tn(t)==="[object WeakMap]"}function n5(t){return tn(t)==="[object WeakSet]"}function Zb(t){return tn(t)==="[object ArrayBuffer]"}function sN(t){return typeof ArrayBuffer<"u"&&(Zb.working?Zb(t):t instanceof ArrayBuffer)}function Hb(t){return tn(t)==="[object DataView]"}function fN(t){return typeof DataView<"u"&&(Hb.working?Hb(t):t instanceof DataView)}function Kb(t){return tn(t)==="[object SharedArrayBuffer]"}function uN(t){return typeof SharedArrayBuffer<"u"&&(Kb.working?Kb(t):t instanceof SharedArrayBuffer)}function hN(t){return _v(t,Bue)}function lN(t){return _v(t,Pue)}function cN(t){return _v(t,Oue)}function dN(t){return wN&&_v(t,Nue)}function pN(t){return u5&&_v(t,Cue)}function ol(t,e){var r={seen:[],stylize:$ue};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),h5(e)?r.showHidden=e:e&&gt._extend(r,e),Dc(r.showHidden)&&(r.showHidden=!1),Dc(r.depth)&&(r.depth=2),Dc(r.colors)&&(r.colors=!1),Dc(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=Due),Wb(r,t,r.depth)}function Due(t,e){var r=ol.styles[e];return r?"\x1B["+ol.colors[r][0]+"m"+t+"\x1B["+ol.colors[r][1]+"m":t}function $ue(t,e){return t}function Wb(t,e,r){if(t.customInspect&&e&&zb(e.inspect)&&e.inspect!==gt.inspect&&(!e.constructor||e.constructor.prototype!==e)){var a=e.inspect(r,t);return Vb(a)||(a=Wb(t,a,r)),a}var i=function(x,E){if(Dc(E))return x.stylize("undefined","undefined");if(Vb(E)){var A="'"+JSON.stringify(E).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return x.stylize(A,"string")}if(NN(E))return x.stylize(""+E,"number");if(h5(E))return x.stylize(""+E,"boolean");if(Jb(E))return x.stylize("null","null")}(t,e);if(i)return i;var h=Object.keys(e),l=function(x){var E={};return x.forEach(function(A,k){E[A]=!0}),E}(h);if(t.showHidden&&(h=Object.getOwnPropertyNames(e)),wv(e)&&(h.indexOf("message")>=0||h.indexOf("description")>=0))return a5(e);if(h.length===0){if(zb(e)){var p=e.name?": "+e.name:"";return t.stylize("[Function"+p+"]","special")}if(yv(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(Gb(e))return t.stylize(Date.prototype.toString.call(e),"date");if(wv(e))return a5(e)}var b,g="",y=!1,M=["{","}"];return ON(e)&&(y=!0,M=["[","]"]),zb(e)&&(g=" [Function"+(e.name?": "+e.name:"")+"]"),yv(e)&&(g=" "+RegExp.prototype.toString.call(e)),Gb(e)&&(g=" "+Date.prototype.toUTCString.call(e)),wv(e)&&(g=" "+a5(e)),h.length!==0||y&&e.length!=0?r<0?yv(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special"):(t.seen.push(e),b=y?function(x,E,A,k,P){for(var N=[],L=0,C=E.length;L<C;++L)CN(E,String(L))?N.push(o5(x,E,A,k,String(L),!0)):N.push("");return P.forEach(function(Y){Y.match(/^\d+$/)||N.push(o5(x,E,A,k,Y,!0))}),N}(t,e,r,l,h):h.map(function(x){return o5(t,e,r,l,x,y)}),t.seen.pop(),function(x,E,A){var k=0;return x.reduce(function(P,N){return k++,N.indexOf(`
2
2
  `)>=0&&k++,P+N.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?A[0]+(E===""?"":E+`
3
3
  `)+" "+x.join(`,
4
4
  `)+" "+A[1]:A[0]+E+" "+x.join(", ")+" "+A[1]}(b,g,M)):M[0]+g+M[1]}function a5(t){return"["+Error.prototype.toString.call(t)+"]"}function o5(t,e,r,a,i,h){var l,p,b;if((b=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?p=b.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):b.set&&(p=t.stylize("[Setter]","special")),CN(a,i)||(l="["+i+"]"),p||(t.seen.indexOf(b.value)<0?(p=Jb(r)?Wb(t,b.value,null):Wb(t,b.value,r-1)).indexOf(`
@@ -110,7 +110,7 @@ should equal
110
110
  `))}throw v}},C.strict=k(m,C,{equal:C.strictEqual,deepEqual:C.deepStrictEqual,notEqual:C.notStrictEqual,notDeepEqual:C.notDeepStrictEqual}),C.strict.strict=C.strict,hk}var V_e,Yte,yte,Jte,Kg,ik,wte,nk,_te,Mte,Wg,Q8,xte,Ste,G_e,Y_e,J_e,Ete,i4,Ate,X_e,Q_e,e9e,t9e,r9e,lk,Xte,i9e,Qte,s4,n9e,Rte,a9e,o9e,s9e,ak,f9e,u9e,ere,Yg,Ad,ok,h9e,Sd,Ed,sk,fk,Tte,l9e,c9e,d9e,p9e,v9e,tre,kte,rre,m9e,g9e,b9e,ck,dk,Ite,y9e,w9e,_9e,M9e,x9e,ire,S9e,nre,are,mk,gk,E9e,A9e,R9e,T9e,k9e,ore,I9e,sre,B9e,uk,Bte,Pte,Ote,O9e,o4,Cte,Lte,n4,pk,Gg,a4,Dte,qa,N9e,C9e,$te,e4,qte,t4,L9e,D9e,Ute,Fte,jte,zte,$9e,q9e,U9e,Vte,hk,Gte,ar,t0t,r0t,i0t,n0t,a0t,o0t,s0t,f0t,u0t,h0t,l0t,c0t,d0t,p0t,v0t,m0t,g0t,yk=Si(()=>{"use strict";ie();ae();ne();jo();Uo();V_e={assign:bte,polyfill:function(){Object.assign||Object.defineProperty(Object,"assign",{enumerable:!1,configurable:!0,writable:!0,value:bte})}},yte=Object.prototype.toString,Jte=function(t){var e=yte.call(t),r=e==="[object Arguments]";return r||(r=e!=="[object Array]"&&t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&yte.call(t.callee)==="[object Function]"),r};Object.keys||(Kg=Object.prototype.hasOwnProperty,ik=Object.prototype.toString,wte=Jte,nk=Object.prototype.propertyIsEnumerable,_te=!nk.call({toString:null},"toString"),Mte=nk.call(function(){},"prototype"),Wg=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"],Q8=function(t){var e=t.constructor;return e&&e.prototype===t},xte={$applicationCache:!0,$console:!0,$external:!0,$frame:!0,$frameElement:!0,$frames:!0,$innerHeight:!0,$innerWidth:!0,$onmozfullscreenchange:!0,$onmozfullscreenerror:!0,$outerHeight:!0,$outerWidth:!0,$pageXOffset:!0,$pageYOffset:!0,$parent:!0,$scrollLeft:!0,$scrollTop:!0,$scrollX:!0,$scrollY:!0,$self:!0,$webkitIndexedDB:!0,$webkitStorageInfo:!0,$window:!0},Ste=function(){if(typeof window>"u")return!1;for(var t in window)try{if(!xte["$"+t]&&Kg.call(window,t)&&window[t]!==null&&typeof window[t]=="object")try{Q8(window[t])}catch{return!0}}catch{return!0}return!1}(),Yte=function(t){var e=t!==null&&typeof t=="object",r=ik.call(t)==="[object Function]",a=wte(t),i=e&&ik.call(t)==="[object String]",h=[];if(!e&&!r&&!a)throw new TypeError("Object.keys called on a non-object");var l=Mte&&r;if(i&&t.length>0&&!Kg.call(t,0))for(var p=0;p<t.length;++p)h.push(String(p));if(a&&t.length>0)for(var b=0;b<t.length;++b)h.push(String(b));else for(var g in t)l&&g==="prototype"||!Kg.call(t,g)||h.push(String(g));if(_te)for(var y=function(x){if(typeof window>"u"||!Ste)return Q8(x);try{return Q8(x)}catch{return!1}}(t),M=0;M<Wg.length;++M)y&&Wg[M]==="constructor"||!Kg.call(t,Wg[M])||h.push(Wg[M]);return h});G_e=Yte,Y_e=Array.prototype.slice,J_e=Jte,Ete=Object.keys,i4=Ete?function(t){return Ete(t)}:G_e,Ate=Object.keys;i4.shim=function(){return Object.keys?function(){var t=Object.keys(arguments);return t&&t.length===arguments.length}(1,2)||(Object.keys=function(t){return J_e(t)?Ate(Y_e.call(t)):Ate(t)}):Object.keys=i4,Object.keys||i4};X_e=i4,Q_e=X_e,e9e=typeof Symbol=="function"&&typeof Symbol("foo")=="symbol",t9e=Object.prototype.toString,r9e=Array.prototype.concat,lk=Object.defineProperty,Xte=lk&&function(){var t={};try{for(var e in lk(t,"x",{enumerable:!1,value:t}),t)return!1;return t.x===t}catch{return!1}}(),i9e=function(t,e,r,a){var i;(!(e in t)||typeof(i=a)=="function"&&t9e.call(i)==="[object Function]"&&a())&&(Xte?lk(t,e,{configurable:!0,enumerable:!1,value:r,writable:!0}):t[e]=r)},Qte=function(t,e){var r=arguments.length>2?arguments[2]:{},a=Q_e(e);e9e&&(a=r9e.call(a,Object.getOwnPropertySymbols(e)));for(var i=0;i<a.length;i+=1)i9e(t,a[i],e[a[i]],r[a[i]])};Qte.supportsDescriptors=!!Xte;s4=Qte,n9e=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var t={},e=Symbol("test"),r=Object(e);if(typeof e=="string"||Object.prototype.toString.call(e)!=="[object Symbol]"||Object.prototype.toString.call(r)!=="[object Symbol]")return!1;for(e in t[e]=42,t)return!1;if(typeof Object.keys=="function"&&Object.keys(t).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(t).length!==0)return!1;var a=Object.getOwnPropertySymbols(t);if(a.length!==1||a[0]!==e||!Object.prototype.propertyIsEnumerable.call(t,e))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var i=Object.getOwnPropertyDescriptor(t,e);if(i.value!==42||i.enumerable!==!0)return!1}return!0},Rte=(typeof globalThis<"u"?globalThis:typeof self<"u"?self:global).Symbol,a9e=n9e,o9e=function(){return typeof Rte=="function"&&typeof Symbol=="function"&&typeof Rte("foo")=="symbol"&&typeof Symbol("bar")=="symbol"&&a9e()},s9e="Function.prototype.bind called on incompatible ",ak=Array.prototype.slice,f9e=Object.prototype.toString,u9e=function(t){var e=this;if(typeof e!="function"||f9e.call(e)!=="[object Function]")throw new TypeError(s9e+e);for(var r,a=ak.call(arguments,1),i=function(){if(this instanceof r){var g=e.apply(this,a.concat(ak.call(arguments)));return Object(g)===g?g:this}return e.apply(t,a.concat(ak.call(arguments)))},h=Math.max(0,e.length-a.length),l=[],p=0;p<h;p++)l.push("$"+p);if(r=Function("binder","return function ("+l.join(",")+"){ return binder.apply(this,arguments); }")(i),e.prototype){var b=function(){};b.prototype=e.prototype,r.prototype=new b,b.prototype=null}return r},ere=Function.prototype.bind||u9e,Yg=TypeError,Ad=Object.getOwnPropertyDescriptor;if(Ad)try{Ad({},"")}catch{Ad=null}ok=function(){throw new Yg},h9e=Ad?function(){try{return arguments.callee,ok}catch{try{return Ad(arguments,"callee").get}catch{return ok}}}():ok,Sd=o9e(),Ed=Object.getPrototypeOf||function(t){return t.__proto__},sk=typeof Uint8Array>"u"?void 0:Ed(Uint8Array),fk={"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?void 0:ArrayBuffer,"%ArrayBufferPrototype%":typeof ArrayBuffer>"u"?void 0:ArrayBuffer.prototype,"%ArrayIteratorPrototype%":Sd?Ed([][Symbol.iterator]()):void 0,"%ArrayPrototype%":Array.prototype,"%ArrayProto_entries%":Array.prototype.entries,"%ArrayProto_forEach%":Array.prototype.forEach,"%ArrayProto_keys%":Array.prototype.keys,"%ArrayProto_values%":Array.prototype.values,"%AsyncFromSyncIteratorPrototype%":void 0,"%AsyncFunction%":void 0,"%AsyncFunctionPrototype%":void 0,"%AsyncGenerator%":void 0,"%AsyncGeneratorFunction%":void 0,"%AsyncGeneratorPrototype%":void 0,"%AsyncIteratorPrototype%":void 0,"%Atomics%":typeof Atomics>"u"?void 0:Atomics,"%Boolean%":Boolean,"%BooleanPrototype%":Boolean.prototype,"%DataView%":typeof DataView>"u"?void 0:DataView,"%DataViewPrototype%":typeof DataView>"u"?void 0:DataView.prototype,"%Date%":Date,"%DatePrototype%":Date.prototype,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":Error,"%ErrorPrototype%":Error.prototype,"%eval%":eval,"%EvalError%":EvalError,"%EvalErrorPrototype%":EvalError.prototype,"%Float32Array%":typeof Float32Array>"u"?void 0:Float32Array,"%Float32ArrayPrototype%":typeof Float32Array>"u"?void 0:Float32Array.prototype,"%Float64Array%":typeof Float64Array>"u"?void 0:Float64Array,"%Float64ArrayPrototype%":typeof Float64Array>"u"?void 0:Float64Array.prototype,"%Function%":Function,"%FunctionPrototype%":Function.prototype,"%Generator%":void 0,"%GeneratorFunction%":void 0,"%GeneratorPrototype%":void 0,"%Int8Array%":typeof Int8Array>"u"?void 0:Int8Array,"%Int8ArrayPrototype%":typeof Int8Array>"u"?void 0:Int8Array.prototype,"%Int16Array%":typeof Int16Array>"u"?void 0:Int16Array,"%Int16ArrayPrototype%":typeof Int16Array>"u"?void 0:Int8Array.prototype,"%Int32Array%":typeof Int32Array>"u"?void 0:Int32Array,"%Int32ArrayPrototype%":typeof Int32Array>"u"?void 0:Int32Array.prototype,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":Sd?Ed(Ed([][Symbol.iterator]())):void 0,"%JSON%":typeof JSON=="object"?JSON:void 0,"%JSONParse%":typeof JSON=="object"?JSON.parse:void 0,"%Map%":typeof Map>"u"?void 0:Map,"%MapIteratorPrototype%":typeof Map<"u"&&Sd?Ed(new Map()[Symbol.iterator]()):void 0,"%MapPrototype%":typeof Map>"u"?void 0:Map.prototype,"%Math%":Math,"%Number%":Number,"%NumberPrototype%":Number.prototype,"%Object%":Object,"%ObjectPrototype%":Object.prototype,"%ObjProto_toString%":Object.prototype.toString,"%ObjProto_valueOf%":Object.prototype.valueOf,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?void 0:Promise,"%PromisePrototype%":typeof Promise>"u"?void 0:Promise.prototype,"%PromiseProto_then%":typeof Promise>"u"?void 0:Promise.prototype.then,"%Promise_all%":typeof Promise>"u"?void 0:Promise.all,"%Promise_reject%":typeof Promise>"u"?void 0:Promise.reject,"%Promise_resolve%":typeof Promise>"u"?void 0:Promise.resolve,"%Proxy%":typeof Proxy>"u"?void 0:Proxy,"%RangeError%":RangeError,"%RangeErrorPrototype%":RangeError.prototype,"%ReferenceError%":ReferenceError,"%ReferenceErrorPrototype%":ReferenceError.prototype,"%Reflect%":typeof Reflect>"u"?void 0:Reflect,"%RegExp%":RegExp,"%RegExpPrototype%":RegExp.prototype,"%Set%":typeof Set>"u"?void 0:Set,"%SetIteratorPrototype%":typeof Set<"u"&&Sd?Ed(new Set()[Symbol.iterator]()):void 0,"%SetPrototype%":typeof Set>"u"?void 0:Set.prototype,"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?void 0:SharedArrayBuffer,"%SharedArrayBufferPrototype%":typeof SharedArrayBuffer>"u"?void 0:SharedArrayBuffer.prototype,"%String%":String,"%StringIteratorPrototype%":Sd?Ed(""[Symbol.iterator]()):void 0,"%StringPrototype%":String.prototype,"%Symbol%":Sd?Symbol:void 0,"%SymbolPrototype%":Sd?Symbol.prototype:void 0,"%SyntaxError%":SyntaxError,"%SyntaxErrorPrototype%":SyntaxError.prototype,"%ThrowTypeError%":h9e,"%TypedArray%":sk,"%TypedArrayPrototype%":sk?sk.prototype:void 0,"%TypeError%":Yg,"%TypeErrorPrototype%":Yg.prototype,"%Uint8Array%":typeof Uint8Array>"u"?void 0:Uint8Array,"%Uint8ArrayPrototype%":typeof Uint8Array>"u"?void 0:Uint8Array.prototype,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?void 0:Uint8ClampedArray,"%Uint8ClampedArrayPrototype%":typeof Uint8ClampedArray>"u"?void 0:Uint8ClampedArray.prototype,"%Uint16Array%":typeof Uint16Array>"u"?void 0:Uint16Array,"%Uint16ArrayPrototype%":typeof Uint16Array>"u"?void 0:Uint16Array.prototype,"%Uint32Array%":typeof Uint32Array>"u"?void 0:Uint32Array,"%Uint32ArrayPrototype%":typeof Uint32Array>"u"?void 0:Uint32Array.prototype,"%URIError%":URIError,"%URIErrorPrototype%":URIError.prototype,"%WeakMap%":typeof WeakMap>"u"?void 0:WeakMap,"%WeakMapPrototype%":typeof WeakMap>"u"?void 0:WeakMap.prototype,"%WeakSet%":typeof WeakSet>"u"?void 0:WeakSet,"%WeakSetPrototype%":typeof WeakSet>"u"?void 0:WeakSet.prototype},Tte=ere.call(Function.call,String.prototype.replace),l9e=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,c9e=/\\(\\)?/g,d9e=function(t){var e=[];return Tte(t,l9e,function(r,a,i,h){e[e.length]=i?Tte(h,c9e,"$1"):a||r}),e},p9e=function(t,e){if(!(t in fk))throw new SyntaxError("intrinsic "+t+" does not exist!");if(fk[t]===void 0&&!e)throw new Yg("intrinsic "+t+" exists, but is not available. Please file an issue!");return fk[t]},v9e=function(t,e){if(typeof t!="string"||t.length===0)throw new TypeError("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof e!="boolean")throw new TypeError('"allowMissing" argument must be a boolean');for(var r=d9e(t),a=p9e("%"+(r.length>0?r[0]:"")+"%",e),i=1;i<r.length;i+=1)if(a!=null)if(Ad&&i+1>=r.length){var h=Ad(a,r[i]);if(!e&&!(r[i]in a))throw new Yg("base intrinsic for "+t+" exists, but the property is not available.");a=h?h.get||h.value:a[r[i]]}else a=a[r[i]];return a},kte=ere,rre=v9e("%Function%"),m9e=rre.apply,g9e=rre.call;(tre=function(){return kte.apply(g9e,arguments)}).apply=function(){return kte.apply(m9e,arguments)};b9e=tre,Ite=function(t){return t!=t},y9e=(ck=function(t,e){return t===0&&e===0?1/t==1/e:t===e||!(!Ite(t)||!Ite(e))},ck),w9e=(dk=function(){return typeof Object.is=="function"?Object.is:y9e},dk),_9e=s4,M9e=s4,x9e=ck,ire=dk,S9e=function(){var t=w9e();return _9e(Object,{is:t},{is:function(){return Object.is!==t}}),t},nre=b9e(ire(),Object);M9e(nre,{getPolyfill:ire,implementation:x9e,shim:S9e});are=nre;mk=function(t){return t!=t};E9e=mk,A9e=(gk=function(){return Number.isNaN&&Number.isNaN(NaN)&&!Number.isNaN("a")?Number.isNaN:E9e},s4),R9e=gk,T9e=s4,k9e=mk,ore=gk,I9e=function(){var t=R9e();return A9e(Number,{isNaN:t},{isNaN:function(){return Number.isNaN!==t}}),t},sre=ore();T9e(sre,{getPolyfill:ore,implementation:k9e,shim:I9e});B9e=sre,uk={},Bte=!1;Pte={},Ote=!1;O9e=/a/g.flags!==void 0,o4=function(t){var e=[];return t.forEach(function(r){return e.push(r)}),e},Cte=function(t){var e=[];return t.forEach(function(r,a){return e.push([a,r])}),e},Lte=Object.is?Object.is:are,n4=Object.getOwnPropertySymbols?Object.getOwnPropertySymbols:function(){return[]},pk=Number.isNaN?Number.isNaN:B9e;Gg=bk(Object.prototype.hasOwnProperty),a4=bk(Object.prototype.propertyIsEnumerable),Dte=bk(Object.prototype.toString),qa=gt.types,N9e=qa.isAnyArrayBuffer,C9e=qa.isArrayBufferView,$te=qa.isDate,e4=qa.isMap,qte=qa.isRegExp,t4=qa.isSet,L9e=qa.isNativeError,D9e=qa.isBoxedPrimitive,Ute=qa.isNumberObject,Fte=qa.isStringObject,jte=qa.isBooleanObject,zte=qa.isBigIntObject,$9e=qa.isSymbolObject,q9e=qa.isFloat32Array,U9e=qa.isFloat64Array;Vte={isDeepEqual:function(t,e){return Os(t,e,!1)},isDeepStrictEqual:function(t,e){return Os(t,e,!0)}},hk={},Gte=!1;ar=vk();ar.AssertionError;ar.deepEqual;ar.deepStrictEqual;ar.doesNotReject;ar.doesNotThrow;ar.equal;ar.fail;ar.ifError;ar.notDeepEqual;ar.notDeepStrictEqual;ar.notEqual;ar.notStrictEqual;ar.ok;ar.rejects;ar.strict;ar.strictEqual;ar.throws;ar.AssertionError;ar.deepEqual;ar.deepStrictEqual;ar.doesNotReject;ar.doesNotThrow;ar.equal;ar.fail;ar.ifError;ar.notDeepEqual;ar.notDeepStrictEqual;ar.notEqual;ar.notStrictEqual;ar.ok;ar.rejects;ar.strict;ar.strictEqual;ar.throws;t0t=ar.AssertionError,r0t=ar.deepEqual,i0t=ar.deepStrictEqual,n0t=ar.doesNotReject,a0t=ar.doesNotThrow,o0t=ar.equal,s0t=ar.fail,f0t=ar.ifError,u0t=ar.notDeepEqual,h0t=ar.notDeepStrictEqual,l0t=ar.notEqual,c0t=ar.notStrictEqual,d0t=ar.ok,p0t=ar.rejects,v0t=ar.strict,m0t=ar.strictEqual,g0t=ar.throws});function H9e(){if(hre)return wk;hre=!0;var t=yr;function e(h){if(typeof h!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(h))}function r(h,l){for(var p="",b=0,g=-1,y=0,M,x=0;x<=h.length;++x){if(x<h.length)M=h.charCodeAt(x);else{if(M===47)break;M=47}if(M===47){if(!(g===x-1||y===1))if(g!==x-1&&y===2){if(p.length<2||b!==2||p.charCodeAt(p.length-1)!==46||p.charCodeAt(p.length-2)!==46){if(p.length>2){var E=p.lastIndexOf("/");if(E!==p.length-1){E===-1?(p="",b=0):(p=p.slice(0,E),b=p.length-1-p.lastIndexOf("/")),g=x,y=0;continue}}else if(p.length===2||p.length===1){p="",b=0,g=x,y=0;continue}}l&&(p.length>0?p+="/..":p="..",b=2)}else p.length>0?p+="/"+h.slice(g+1,x):p=h.slice(g+1,x),b=x-g-1;g=x,y=0}else M===46&&y!==-1?++y:y=-1}return p}function a(h,l){var p=l.dir||l.root,b=l.base||(l.name||"")+(l.ext||"");return p?p===l.root?p+b:p+h+b:b}var i={resolve:function(){for(var l="",p=!1,b,g=arguments.length-1;g>=-1&&!p;g--){var y;g>=0?y=arguments[g]:(b===void 0&&(b=t.cwd()),y=b),e(y),y.length!==0&&(l=y+"/"+l,p=y.charCodeAt(0)===47)}return l=r(l,!p),p?l.length>0?"/"+l:"/":l.length>0?l:"."},normalize:function(l){if(e(l),l.length===0)return".";var p=l.charCodeAt(0)===47,b=l.charCodeAt(l.length-1)===47;return l=r(l,!p),l.length===0&&!p&&(l="."),l.length>0&&b&&(l+="/"),p?"/"+l:l},isAbsolute:function(l){return e(l),l.length>0&&l.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var l,p=0;p<arguments.length;++p){var b=arguments[p];e(b),b.length>0&&(l===void 0?l=b:l+="/"+b)}return l===void 0?".":i.normalize(l)},relative:function(l,p){if(e(l),e(p),l===p||(l=i.resolve(l),p=i.resolve(p),l===p))return"";for(var b=1;b<l.length&&l.charCodeAt(b)===47;++b);for(var g=l.length,y=g-b,M=1;M<p.length&&p.charCodeAt(M)===47;++M);for(var x=p.length,E=x-M,A=y<E?y:E,k=-1,P=0;P<=A;++P){if(P===A){if(E>A){if(p.charCodeAt(M+P)===47)return p.slice(M+P+1);if(P===0)return p.slice(M+P)}else y>A&&(l.charCodeAt(b+P)===47?k=P:P===0&&(k=0));break}var N=l.charCodeAt(b+P),L=p.charCodeAt(M+P);if(N!==L)break;N===47&&(k=P)}var C="";for(P=b+k+1;P<=g;++P)(P===g||l.charCodeAt(P)===47)&&(C.length===0?C+="..":C+="/..");return C.length>0?C+p.slice(M+k):(M+=k,p.charCodeAt(M)===47&&++M,p.slice(M))},_makeLong:function(l){return l},dirname:function(l){if(e(l),l.length===0)return".";for(var p=l.charCodeAt(0),b=p===47,g=-1,y=!0,M=l.length-1;M>=1;--M)if(p=l.charCodeAt(M),p===47){if(!y){g=M;break}}else y=!1;return g===-1?b?"/":".":b&&g===1?"//":l.slice(0,g)},basename:function(l,p){if(p!==void 0&&typeof p!="string")throw new TypeError('"ext" argument must be a string');e(l);var b=0,g=-1,y=!0,M;if(p!==void 0&&p.length>0&&p.length<=l.length){if(p.length===l.length&&p===l)return"";var x=p.length-1,E=-1;for(M=l.length-1;M>=0;--M){var A=l.charCodeAt(M);if(A===47){if(!y){b=M+1;break}}else E===-1&&(y=!1,E=M+1),x>=0&&(A===p.charCodeAt(x)?--x===-1&&(g=M):(x=-1,g=E))}return b===g?g=E:g===-1&&(g=l.length),l.slice(b,g)}else{for(M=l.length-1;M>=0;--M)if(l.charCodeAt(M)===47){if(!y){b=M+1;break}}else g===-1&&(y=!1,g=M+1);return g===-1?"":l.slice(b,g)}},extname:function(l){e(l);for(var p=-1,b=0,g=-1,y=!0,M=0,x=l.length-1;x>=0;--x){var E=l.charCodeAt(x);if(E===47){if(!y){b=x+1;break}continue}g===-1&&(y=!1,g=x+1),E===46?p===-1?p=x:M!==1&&(M=1):p!==-1&&(M=-1)}return p===-1||g===-1||M===0||M===1&&p===g-1&&p===b+1?"":l.slice(p,g)},format:function(l){if(l===null||typeof l!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof l);return a("/",l)},parse:function(l){e(l);var p={root:"",dir:"",base:"",ext:"",name:""};if(l.length===0)return p;var b=l.charCodeAt(0),g=b===47,y;g?(p.root="/",y=1):y=0;for(var M=-1,x=0,E=-1,A=!0,k=l.length-1,P=0;k>=y;--k){if(b=l.charCodeAt(k),b===47){if(!A){x=k+1;break}continue}E===-1&&(A=!1,E=k+1),b===46?M===-1?M=k:P!==1&&(P=1):M!==-1&&(P=-1)}return M===-1||E===-1||P===0||P===1&&M===E-1&&M===x+1?E!==-1&&(x===0&&g?p.base=p.name=l.slice(1,E):p.base=p.name=l.slice(x,E)):(x===0&&g?(p.name=l.slice(1,M),p.base=l.slice(1,E)):(p.name=l.slice(x,M),p.base=l.slice(x,E)),p.ext=l.slice(M,E)),x>0?p.dir=l.slice(0,x-1):g&&(p.dir="/"),p},sep:"/",delimiter:":",win32:null,posix:null};return i.posix=i,wk=i,wk}var wk,hre,fn,Rd=Si(()=>{"use strict";ie();ae();ne();Ws();wk={},hre=!1;fn=H9e()});var lre={};Ha(lre,{_makeLong:()=>K9e,basename:()=>W9e,default:()=>fn,delimiter:()=>V9e,dirname:()=>G9e,extname:()=>Y9e,format:()=>J9e,isAbsolute:()=>X9e,join:()=>Q9e,normalize:()=>eMe,parse:()=>tMe,posix:()=>rMe,relative:()=>iMe,resolve:()=>nMe,sep:()=>aMe,win32:()=>oMe});var K9e,W9e,V9e,G9e,Y9e,J9e,X9e,Q9e,eMe,tMe,rMe,iMe,nMe,aMe,oMe,_k=Si(()=>{"use strict";ie();ae();ne();Rd();Rd();Ws();K9e=fn._makeLong,W9e=fn.basename,V9e=fn.delimiter,G9e=fn.dirname,Y9e=fn.extname,J9e=fn.format,X9e=fn.isAbsolute,Q9e=fn.join,eMe=fn.normalize,tMe=fn.parse,rMe=fn.posix,iMe=fn.relative,nMe=fn.resolve,aMe=fn.sep,oMe=fn.win32});function Td(t){throw new RangeError(hMe[t])}function cre(t,e){let r=t.split("@"),a="";r.length>1&&(a=r[0]+"@",t=r[1]);let i=function(h,l){let p=[],b=h.length;for(;b--;)p[b]=l(h[b]);return p}((t=t.replace(uMe,".")).split("."),e).join(".");return a+i}function mre(t){let e=[],r=0,a=t.length;for(;r<a;){let i=t.charCodeAt(r++);if(i>=55296&&i<=56319&&r<a){let h=t.charCodeAt(r++);(64512&h)==56320?e.push(((1023&i)<<10)+(1023&h)+65536):(e.push(i),r--)}else e.push(i)}return e}var sMe,fMe,uMe,hMe,Cu,Mk,dre,gre,pre,vre,mc,Jg=Si(()=>{"use strict";ie();ae();ne();sMe=/^xn--/,fMe=/[^\0-\x7E]/,uMe=/[\x2E\u3002\uFF0E\uFF61]/g,hMe={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},Cu=Math.floor,Mk=String.fromCharCode;dre=function(t,e){return t+22+75*(t<26)-((e!=0)<<5)},gre=function(t,e,r){let a=0;for(t=r?Cu(t/700):t>>1,t+=Cu(t/e);t>455;a+=36)t=Cu(t/35);return Cu(a+36*t/(t+38))},pre=function(t){let e=[],r=t.length,a=0,i=128,h=72,l=t.lastIndexOf("-");l<0&&(l=0);for(let b=0;b<l;++b)t.charCodeAt(b)>=128&&Td("not-basic"),e.push(t.charCodeAt(b));for(let b=l>0?l+1:0;b<r;){let g=a;for(let M=1,x=36;;x+=36){b>=r&&Td("invalid-input");let E=(p=t.charCodeAt(b++))-48<10?p-22:p-65<26?p-65:p-97<26?p-97:36;(E>=36||E>Cu((2147483647-a)/M))&&Td("overflow"),a+=E*M;let A=x<=h?1:x>=h+26?26:x-h;if(E<A)break;let k=36-A;M>Cu(2147483647/k)&&Td("overflow"),M*=k}let y=e.length+1;h=gre(a-g,y,g==0),Cu(a/y)>2147483647-i&&Td("overflow"),i+=Cu(a/y),a%=y,e.splice(a++,0,i)}var p;return String.fromCodePoint(...e)},vre=function(t){let e=[],r=(t=mre(t)).length,a=128,i=0,h=72;for(let b of t)b<128&&e.push(Mk(b));let l=e.length,p=l;for(l&&e.push("-");p<r;){let b=2147483647;for(let y of t)y>=a&&y<b&&(b=y);let g=p+1;b-a>Cu((2147483647-i)/g)&&Td("overflow"),i+=(b-a)*g,a=b;for(let y of t)if(y<a&&++i>2147483647&&Td("overflow"),y==a){let M=i;for(let x=36;;x+=36){let E=x<=h?1:x>=h+26?26:x-h;if(M<E)break;let A=M-E,k=36-E;e.push(Mk(dre(E+A%k,0))),M=Cu(A/k)}e.push(Mk(dre(M,0))),h=gre(i,g,p==l),i=0,++p}++i,++a}return e.join("")},mc={version:"2.1.0",ucs2:{decode:mre,encode:t=>String.fromCodePoint(...t)},decode:pre,encode:vre,toASCII:function(t){return cre(t,function(e){return fMe.test(e)?"xn--"+vre(e):e})},toUnicode:function(t){return cre(t,function(e){return sMe.test(e)?pre(e.slice(4).toLowerCase()):e})}};mc.decode;mc.encode;mc.toASCII;mc.toUnicode;mc.ucs2;mc.version});function lMe(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var cMe,Xg,dMe,Lu,Qg=Si(()=>{"use strict";ie();ae();ne();cMe=function(t,e,r,a){e=e||"&",r=r||"=";var i={};if(typeof t!="string"||t.length===0)return i;var h=/\+/g;t=t.split(e);var l=1e3;a&&typeof a.maxKeys=="number"&&(l=a.maxKeys);var p=t.length;l>0&&p>l&&(p=l);for(var b=0;b<p;++b){var g,y,M,x,E=t[b].replace(h,"%20"),A=E.indexOf(r);A>=0?(g=E.substr(0,A),y=E.substr(A+1)):(g=E,y=""),M=decodeURIComponent(g),x=decodeURIComponent(y),lMe(i,M)?Array.isArray(i[M])?i[M].push(x):i[M]=[i[M],x]:i[M]=x}return i},Xg=function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}},dMe=function(t,e,r,a){return e=e||"&",r=r||"=",t===null&&(t=void 0),typeof t=="object"?Object.keys(t).map(function(i){var h=encodeURIComponent(Xg(i))+r;return Array.isArray(t[i])?t[i].map(function(l){return h+encodeURIComponent(Xg(l))}).join(e):h+encodeURIComponent(Xg(t[i]))}).join(e):a?encodeURIComponent(Xg(a))+r+encodeURIComponent(Xg(t)):""},Lu={};Lu.decode=Lu.parse=cMe,Lu.encode=Lu.stringify=dMe;Lu.decode;Lu.encode;Lu.parse;Lu.stringify});function Ns(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}function e2(t,e,r){if(t&&Du.isObject(t)&&t instanceof Ns)return t;var a=new Ns;return a.parse(t,e,r),a}function _Me(){if(_re)return Ek;_re=!0;var t=fr;function e(h){if(typeof h!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(h))}function r(h,l){for(var p="",b=0,g=-1,y=0,M,x=0;x<=h.length;++x){if(x<h.length)M=h.charCodeAt(x);else{if(M===47)break;M=47}if(M===47){if(!(g===x-1||y===1))if(g!==x-1&&y===2){if(p.length<2||b!==2||p.charCodeAt(p.length-1)!==46||p.charCodeAt(p.length-2)!==46){if(p.length>2){var E=p.lastIndexOf("/");if(E!==p.length-1){E===-1?(p="",b=0):(p=p.slice(0,E),b=p.length-1-p.lastIndexOf("/")),g=x,y=0;continue}}else if(p.length===2||p.length===1){p="",b=0,g=x,y=0;continue}}l&&(p.length>0?p+="/..":p="..",b=2)}else p.length>0?p+="/"+h.slice(g+1,x):p=h.slice(g+1,x),b=x-g-1;g=x,y=0}else M===46&&y!==-1?++y:y=-1}return p}function a(h,l){var p=l.dir||l.root,b=l.base||(l.name||"")+(l.ext||"");return p?p===l.root?p+b:p+h+b:b}var i={resolve:function(){for(var l="",p=!1,b,g=arguments.length-1;g>=-1&&!p;g--){var y;g>=0?y=arguments[g]:(b===void 0&&(b=t.cwd()),y=b),e(y),y.length!==0&&(l=y+"/"+l,p=y.charCodeAt(0)===47)}return l=r(l,!p),p?l.length>0?"/"+l:"/":l.length>0?l:"."},normalize:function(l){if(e(l),l.length===0)return".";var p=l.charCodeAt(0)===47,b=l.charCodeAt(l.length-1)===47;return l=r(l,!p),l.length===0&&!p&&(l="."),l.length>0&&b&&(l+="/"),p?"/"+l:l},isAbsolute:function(l){return e(l),l.length>0&&l.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var l,p=0;p<arguments.length;++p){var b=arguments[p];e(b),b.length>0&&(l===void 0?l=b:l+="/"+b)}return l===void 0?".":i.normalize(l)},relative:function(l,p){if(e(l),e(p),l===p||(l=i.resolve(l),p=i.resolve(p),l===p))return"";for(var b=1;b<l.length&&l.charCodeAt(b)===47;++b);for(var g=l.length,y=g-b,M=1;M<p.length&&p.charCodeAt(M)===47;++M);for(var x=p.length,E=x-M,A=y<E?y:E,k=-1,P=0;P<=A;++P){if(P===A){if(E>A){if(p.charCodeAt(M+P)===47)return p.slice(M+P+1);if(P===0)return p.slice(M+P)}else y>A&&(l.charCodeAt(b+P)===47?k=P:P===0&&(k=0));break}var N=l.charCodeAt(b+P),L=p.charCodeAt(M+P);if(N!==L)break;N===47&&(k=P)}var C="";for(P=b+k+1;P<=g;++P)(P===g||l.charCodeAt(P)===47)&&(C.length===0?C+="..":C+="/..");return C.length>0?C+p.slice(M+k):(M+=k,p.charCodeAt(M)===47&&++M,p.slice(M))},_makeLong:function(l){return l},dirname:function(l){if(e(l),l.length===0)return".";for(var p=l.charCodeAt(0),b=p===47,g=-1,y=!0,M=l.length-1;M>=1;--M)if(p=l.charCodeAt(M),p===47){if(!y){g=M;break}}else y=!1;return g===-1?b?"/":".":b&&g===1?"//":l.slice(0,g)},basename:function(l,p){if(p!==void 0&&typeof p!="string")throw new TypeError('"ext" argument must be a string');e(l);var b=0,g=-1,y=!0,M;if(p!==void 0&&p.length>0&&p.length<=l.length){if(p.length===l.length&&p===l)return"";var x=p.length-1,E=-1;for(M=l.length-1;M>=0;--M){var A=l.charCodeAt(M);if(A===47){if(!y){b=M+1;break}}else E===-1&&(y=!1,E=M+1),x>=0&&(A===p.charCodeAt(x)?--x===-1&&(g=M):(x=-1,g=E))}return b===g?g=E:g===-1&&(g=l.length),l.slice(b,g)}else{for(M=l.length-1;M>=0;--M)if(l.charCodeAt(M)===47){if(!y){b=M+1;break}}else g===-1&&(y=!1,g=M+1);return g===-1?"":l.slice(b,g)}},extname:function(l){e(l);for(var p=-1,b=0,g=-1,y=!0,M=0,x=l.length-1;x>=0;--x){var E=l.charCodeAt(x);if(E===47){if(!y){b=x+1;break}continue}g===-1&&(y=!1,g=x+1),E===46?p===-1?p=x:M!==1&&(M=1):p!==-1&&(M=-1)}return p===-1||g===-1||M===0||M===1&&p===g-1&&p===b+1?"":l.slice(p,g)},format:function(l){if(l===null||typeof l!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof l);return a("/",l)},parse:function(l){e(l);var p={root:"",dir:"",base:"",ext:"",name:""};if(l.length===0)return p;var b=l.charCodeAt(0),g=b===47,y;g?(p.root="/",y=1):y=0;for(var M=-1,x=0,E=-1,A=!0,k=l.length-1,P=0;k>=y;--k){if(b=l.charCodeAt(k),b===47){if(!A){x=k+1;break}continue}E===-1&&(A=!1,E=k+1),b===46?M===-1?M=k:P!==1&&(P=1):M!==-1&&(P=-1)}return M===-1||E===-1||P===0||P===1&&M===E-1&&M===x+1?E!==-1&&(x===0&&g?p.base=p.name=l.slice(1,E):p.base=p.name=l.slice(x,E)):(x===0&&g?(p.name=l.slice(1,M),p.base=l.slice(1,E)):(p.name=l.slice(x,M),p.base=l.slice(x,E)),p.ext=l.slice(M,E)),x>0?p.dir=l.slice(0,x-1):g&&(p.dir="/"),p},sep:"/",delimiter:":",win32:null,posix:null};return i.posix=i,Ek=i,Ek}function OMe(t){if(typeof t=="string")t=new URL(t);else if(!(t instanceof URL))throw new Deno.errors.InvalidData("invalid argument path , must be a string or URL");if(t.protocol!=="file:")throw new Deno.errors.InvalidData("invalid url scheme");return Rk?NMe(t):CMe(t)}function NMe(t){let e=t.hostname,r=t.pathname;for(let a=0;a<r.length;a++)if(r[a]==="%"){let i=r.codePointAt(a+2)||32;if(r[a+1]==="2"&&i===102||r[a+1]==="5"&&i===99)throw new Deno.errors.InvalidData("must not include encoded \\ or / characters")}if(r=r.replace(RMe,"\\"),r=decodeURIComponent(r),e!=="")return`\\\\${e}${r}`;{let a=r.codePointAt(1)|32,i=r[2];if(a<EMe||a>AMe||i!==":")throw new Deno.errors.InvalidData("file url path must be absolute");return r.slice(1)}}function CMe(t){if(t.hostname!=="")throw new Deno.errors.InvalidData("invalid file url hostname");let e=t.pathname;for(let r=0;r<e.length;r++)if(e[r]==="%"){let a=e.codePointAt(r+2)||32;if(e[r+1]==="2"&&a===102)throw new Deno.errors.InvalidData("must not include encoded / characters")}return decodeURIComponent(e)}function LMe(t){let e=Mre.resolve(t),r=t.charCodeAt(t.length-1);(r===SMe||Rk&&r===xMe)&&e[e.length-1]!==Mre.sep&&(e+="/");let a=new URL("file://");return e.includes("%")&&(e=e.replace(TMe,"%25")),!Rk&&e.includes("\\")&&(e=e.replace(kMe,"%5C")),e.includes(`
111
111
  `)&&(e=e.replace(IMe,"%0A")),e.includes("\r")&&(e=e.replace(BMe,"%0D")),e.includes(" ")&&(e=e.replace(PMe,"%09")),a.pathname=e,a}function kk(t){if(typeof t=="string")t=new URL(t);else if(!(t instanceof URL))throw new Deno.errors.InvalidData("invalid argument path , must be a string or URL");if(t.protocol!=="file:")throw new Deno.errors.InvalidData("invalid url scheme");return Tk?VMe(t):GMe(t)}function VMe(t){let e=t.hostname,r=t.pathname;for(let a=0;a<r.length;a++)if(r[a]==="%"){let i=r.codePointAt(a+2)||32;if(r[a+1]==="2"&&i===102||r[a+1]==="5"&&i===99)throw new Deno.errors.InvalidData("must not include encoded \\ or / characters")}if(r=r.replace(jMe,"\\"),r=decodeURIComponent(r),e!=="")return`\\\\${e}${r}`;{let a=r.codePointAt(1)|32,i=r[2];if(a<UMe||a>FMe||i!==":")throw new Deno.errors.InvalidData("file url path must be absolute");return r.slice(1)}}function GMe(t){if(t.hostname!=="")throw new Deno.errors.InvalidData("invalid file url hostname");let e=t.pathname;for(let r=0;r<e.length;r++)if(e[r]==="%"){let a=e.codePointAt(r+2)||32;if(e[r+1]==="2"&&a===102)throw new Deno.errors.InvalidData("must not include encoded / characters")}return decodeURIComponent(e)}function YMe(t){let e=fn.resolve(t),r=t.charCodeAt(t.length-1);(r===qMe||Tk&&r===$Me)&&e[e.length-1]!==fn.sep&&(e+="/");let a=new URL("file://");return e.includes("%")&&(e=e.replace(zMe,"%25")),!Tk&&e.includes("\\")&&(e=e.replace(ZMe,"%5C")),e.includes(`
112
112
  `)&&(e=e.replace(HMe,"%0A")),e.includes("\r")&&(e=e.replace(KMe,"%0D")),e.includes(" ")&&(e=e.replace(WMe,"%09")),a.pathname=e,a}var vi,pMe,Du,vMe,mMe,gMe,bMe,Ak,bre,yre,wre,yMe,wMe,xk,L1,Sk,Ek,_re,Mre,MMe,xMe,SMe,EMe,AMe,Rk,RMe,TMe,kMe,IMe,BMe,PMe,DMe,K0t,W0t,V0t,G0t,Y0t,J0t,$Me,qMe,UMe,FMe,Tk,jMe,zMe,ZMe,HMe,KMe,WMe,f4=Si(()=>{"use strict";ie();ae();ne();Jg();Qg();Uo();Rd();Ws();vi={},pMe=mc,Du={isString:function(t){return typeof t=="string"},isObject:function(t){return typeof t=="object"&&t!==null},isNull:function(t){return t===null},isNullOrUndefined:function(t){return t==null}};vi.parse=e2,vi.resolve=function(t,e){return e2(t,!1,!0).resolve(e)},vi.resolveObject=function(t,e){return t?e2(t,!1,!0).resolveObject(e):e},vi.format=function(t){return Du.isString(t)&&(t=e2(t)),t instanceof Ns?t.format():Ns.prototype.format.call(t)},vi.Url=Ns;vMe=/^([a-z0-9.+-]+:)/i,mMe=/:[0-9]*$/,gMe=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,bMe=["{","}","|","\\","^","`"].concat(["<",">",'"',"`"," ","\r",`
113
- `," "]),Ak=["'"].concat(bMe),bre=["%","/","?",";","#"].concat(Ak),yre=["/","?","#"],wre=/^[+a-z0-9A-Z_-]{0,63}$/,yMe=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,wMe={javascript:!0,"javascript:":!0},xk={javascript:!0,"javascript:":!0},L1={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},Sk=Lu;Ns.prototype.parse=function(t,e,r){if(!Du.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var a=t.indexOf("?"),i=a!==-1&&a<t.indexOf("#")?"?":"#",h=t.split(i);h[0]=h[0].replace(/\\/g,"/");var l=t=h.join(i);if(l=l.trim(),!r&&t.split("#").length===1){var p=gMe.exec(l);if(p)return this.path=l,this.href=l,this.pathname=p[1],p[2]?(this.search=p[2],this.query=e?Sk.parse(this.search.substr(1)):this.search.substr(1)):e&&(this.search="",this.query={}),this}var b=vMe.exec(l);if(b){var g=(b=b[0]).toLowerCase();this.protocol=g,l=l.substr(b.length)}if(r||b||l.match(/^\/\/[^@\/]+@[^@\/]+/)){var y=l.substr(0,2)==="//";!y||b&&xk[b]||(l=l.substr(2),this.slashes=!0)}if(!xk[b]&&(y||b&&!L1[b])){for(var M,x,E=-1,A=0;A<yre.length;A++)(k=l.indexOf(yre[A]))!==-1&&(E===-1||k<E)&&(E=k);for((x=E===-1?l.lastIndexOf("@"):l.lastIndexOf("@",E))!==-1&&(M=l.slice(0,x),l=l.slice(x+1),this.auth=decodeURIComponent(M)),E=-1,A=0;A<bre.length;A++){var k;(k=l.indexOf(bre[A]))!==-1&&(E===-1||k<E)&&(E=k)}E===-1&&(E=l.length),this.host=l.slice(0,E),l=l.slice(E),this.parseHost(),this.hostname=this.hostname||"";var P=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!P)for(var N=this.hostname.split(/\./),L=(A=0,N.length);A<L;A++){var C=N[A];if(C&&!C.match(wre)){for(var Y="",G=0,ee=C.length;G<ee;G++)C.charCodeAt(G)>127?Y+="x":Y+=C[G];if(!Y.match(wre)){var D=N.slice(0,A),U=N.slice(A+1),V=C.match(yMe);V&&(D.push(V[1]),U.unshift(V[2])),U.length&&(l="/"+U.join(".")+l),this.hostname=D.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),P||(this.hostname=pMe.toASCII(this.hostname));var _=this.port?":"+this.port:"",n=this.hostname||"";this.host=n+_,this.href+=this.host,P&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),l[0]!=="/"&&(l="/"+l))}if(!wMe[g])for(A=0,L=Ak.length;A<L;A++){var s=Ak[A];if(l.indexOf(s)!==-1){var f=encodeURIComponent(s);f===s&&(f=escape(s)),l=l.split(s).join(f)}}var u=l.indexOf("#");u!==-1&&(this.hash=l.substr(u),l=l.slice(0,u));var c=l.indexOf("?");if(c!==-1?(this.search=l.substr(c),this.query=l.substr(c+1),e&&(this.query=Sk.parse(this.query)),l=l.slice(0,c)):e&&(this.search="",this.query={}),l&&(this.pathname=l),L1[g]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){_=this.pathname||"";var m=this.search||"";this.path=_+m}return this.href=this.format(),this},Ns.prototype.format=function(){var t=this.auth||"";t&&(t=(t=encodeURIComponent(t)).replace(/%3A/i,":"),t+="@");var e=this.protocol||"",r=this.pathname||"",a=this.hash||"",i=!1,h="";this.host?i=t+this.host:this.hostname&&(i=t+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(i+=":"+this.port)),this.query&&Du.isObject(this.query)&&Object.keys(this.query).length&&(h=Sk.stringify(this.query));var l=this.search||h&&"?"+h||"";return e&&e.substr(-1)!==":"&&(e+=":"),this.slashes||(!e||L1[e])&&i!==!1?(i="//"+(i||""),r&&r.charAt(0)!=="/"&&(r="/"+r)):i||(i=""),a&&a.charAt(0)!=="#"&&(a="#"+a),l&&l.charAt(0)!=="?"&&(l="?"+l),e+i+(r=r.replace(/[?#]/g,function(p){return encodeURIComponent(p)}))+(l=l.replace("#","%23"))+a},Ns.prototype.resolve=function(t){return this.resolveObject(e2(t,!1,!0)).format()},Ns.prototype.resolveObject=function(t){if(Du.isString(t)){var e=new Ns;e.parse(t,!1,!0),t=e}for(var r=new Ns,a=Object.keys(this),i=0;i<a.length;i++){var h=a[i];r[h]=this[h]}if(r.hash=t.hash,t.href==="")return r.href=r.format(),r;if(t.slashes&&!t.protocol){for(var l=Object.keys(t),p=0;p<l.length;p++){var b=l[p];b!=="protocol"&&(r[b]=t[b])}return L1[r.protocol]&&r.hostname&&!r.pathname&&(r.path=r.pathname="/"),r.href=r.format(),r}if(t.protocol&&t.protocol!==r.protocol){if(!L1[t.protocol]){for(var g=Object.keys(t),y=0;y<g.length;y++){var M=g[y];r[M]=t[M]}return r.href=r.format(),r}if(r.protocol=t.protocol,t.host||xk[t.protocol])r.pathname=t.pathname;else{for(var x=(t.pathname||"").split("/");x.length&&!(t.host=x.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),x[0]!==""&&x.unshift(""),x.length<2&&x.unshift(""),r.pathname=x.join("/")}if(r.search=t.search,r.query=t.query,r.host=t.host||"",r.auth=t.auth,r.hostname=t.hostname||t.host,r.port=t.port,r.pathname||r.search){var E=r.pathname||"",A=r.search||"";r.path=E+A}return r.slashes=r.slashes||t.slashes,r.href=r.format(),r}var k=r.pathname&&r.pathname.charAt(0)==="/",P=t.host||t.pathname&&t.pathname.charAt(0)==="/",N=P||k||r.host&&t.pathname,L=N,C=r.pathname&&r.pathname.split("/")||[],Y=(x=t.pathname&&t.pathname.split("/")||[],r.protocol&&!L1[r.protocol]);if(Y&&(r.hostname="",r.port=null,r.host&&(C[0]===""?C[0]=r.host:C.unshift(r.host)),r.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(x[0]===""?x[0]=t.host:x.unshift(t.host)),t.host=null),N=N&&(x[0]===""||C[0]==="")),P)r.host=t.host||t.host===""?t.host:r.host,r.hostname=t.hostname||t.hostname===""?t.hostname:r.hostname,r.search=t.search,r.query=t.query,C=x;else if(x.length)C||(C=[]),C.pop(),C=C.concat(x),r.search=t.search,r.query=t.query;else if(!Du.isNullOrUndefined(t.search))return Y&&(r.hostname=r.host=C.shift(),(V=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=V.shift(),r.host=r.hostname=V.shift())),r.search=t.search,r.query=t.query,Du.isNull(r.pathname)&&Du.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r;if(!C.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var G=C.slice(-1)[0],ee=(r.host||t.host||C.length>1)&&(G==="."||G==="..")||G==="",D=0,U=C.length;U>=0;U--)(G=C[U])==="."?C.splice(U,1):G===".."?(C.splice(U,1),D++):D&&(C.splice(U,1),D--);if(!N&&!L)for(;D--;D)C.unshift("..");!N||C[0]===""||C[0]&&C[0].charAt(0)==="/"||C.unshift(""),ee&&C.join("/").substr(-1)!=="/"&&C.push("");var V,_=C[0]===""||C[0]&&C[0].charAt(0)==="/";return Y&&(r.hostname=r.host=_?"":C.length?C.shift():"",(V=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=V.shift(),r.host=r.hostname=V.shift())),(N=N||r.host&&C.length)&&!_&&C.unshift(""),C.length?r.pathname=C.join("/"):(r.pathname=null,r.path=null),Du.isNull(r.pathname)&&Du.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},Ns.prototype.parseHost=function(){var t=this.host,e=mMe.exec(t);e&&((e=e[0])!==":"&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)};vi.Url;vi.format;vi.resolve;vi.resolveObject;Ek={},_re=!1;Mre=_Me(),MMe=typeof Deno<"u"?Deno.build.os==="windows"?"win32":Deno.build.os:void 0;vi.URL=typeof URL<"u"?URL:null;vi.pathToFileURL=LMe;vi.fileURLToPath=OMe;vi.Url;vi.format;vi.resolve;vi.resolveObject;vi.URL;xMe=92,SMe=47,EMe=97,AMe=122,Rk=MMe==="win32",RMe=/\//g,TMe=/%/g,kMe=/\\/g,IMe=/\n/g,BMe=/\r/g,PMe=/\t/g;DMe=typeof Deno<"u"?Deno.build.os==="windows"?"win32":Deno.build.os:void 0;vi.URL=typeof URL<"u"?URL:null;vi.pathToFileURL=YMe;vi.fileURLToPath=kk;K0t=vi.Url,W0t=vi.format,V0t=vi.resolve,G0t=vi.resolveObject,Y0t=vi.parse,J0t=vi.URL,$Me=92,qMe=47,UMe=97,FMe=122,Tk=DMe==="win32",jMe=/\//g,zMe=/%/g,ZMe=/\\/g,HMe=/\n/g,KMe=/\r/g,WMe=/\t/g});var Ok={};Ha(Ok,{Dir:()=>USe,Dirent:()=>FSe,F_OK:()=>VSe,FileReadStream:()=>HSe,FileWriteStream:()=>KSe,R_OK:()=>GSe,ReadStream:()=>zSe,Stats:()=>jSe,W_OK:()=>YSe,WriteStream:()=>ZSe,X_OK:()=>JSe,_toUnixTimestamp:()=>WSe,access:()=>dxe,accessSync:()=>pxe,appendFile:()=>lxe,appendFileSync:()=>cxe,chmod:()=>gxe,chmodSync:()=>bxe,chown:()=>vxe,chownSync:()=>mxe,close:()=>yxe,closeSync:()=>wxe,constants:()=>XSe,copyFile:()=>_xe,copyFileSync:()=>Mxe,cp:()=>xxe,cpSync:()=>Sxe,createReadStream:()=>Exe,createWriteStream:()=>Axe,default:()=>Gi,exists:()=>Rxe,existsSync:()=>Wre,fchmod:()=>Ixe,fchmodSync:()=>Bxe,fchown:()=>Txe,fchownSync:()=>kxe,fdatasync:()=>Pxe,fdatasyncSync:()=>Oxe,fstat:()=>Nxe,fstatSync:()=>Cxe,fsync:()=>Lxe,fsyncSync:()=>Dxe,ftruncate:()=>$xe,ftruncateSync:()=>qxe,futimes:()=>Uxe,futimesSync:()=>Fxe,lchmod:()=>Zxe,lchmodSync:()=>Hxe,lchown:()=>jxe,lchownSync:()=>zxe,link:()=>Kxe,linkSync:()=>Wxe,lstat:()=>Vxe,lstatSync:()=>Gxe,mkdir:()=>Yxe,mkdirSync:()=>Jxe,mkdtemp:()=>Xxe,mkdtempSync:()=>Qxe,open:()=>eSe,openSync:()=>tSe,opendir:()=>rSe,opendirSync:()=>iSe,promises:()=>QSe,read:()=>oSe,readFile:()=>hSe,readFileSync:()=>lSe,readSync:()=>sSe,readdir:()=>nSe,readdirSync:()=>aSe,readlink:()=>cSe,readlinkSync:()=>dSe,readv:()=>fSe,readvSync:()=>uSe,realpath:()=>pSe,realpathSync:()=>vSe,rename:()=>mSe,renameSync:()=>gSe,rm:()=>bSe,rmSync:()=>ySe,rmdir:()=>wSe,rmdirSync:()=>_Se,stat:()=>MSe,statSync:()=>xSe,symlink:()=>SSe,symlinkSync:()=>ESe,truncate:()=>ASe,truncateSync:()=>RSe,unlink:()=>kSe,unlinkSync:()=>ISe,unwatchFile:()=>TSe,utimes:()=>BSe,utimesSync:()=>PSe,watch:()=>OSe,watchFile:()=>NSe,write:()=>LSe,writeFile:()=>CSe,writeFileSync:()=>Vre,writeSync:()=>DSe,writev:()=>$Se,writevSync:()=>qSe});function i2(){return xre||(xre=!0,Object.defineProperty(t2,"__esModule",{value:!0}),t2.constants=void 0,t2.constants={O_RDONLY:0,O_WRONLY:1,O_RDWR:2,S_IFMT:61440,S_IFREG:32768,S_IFDIR:16384,S_IFCHR:8192,S_IFBLK:24576,S_IFIFO:4096,S_IFLNK:40960,S_IFSOCK:49152,O_CREAT:64,O_EXCL:128,O_NOCTTY:256,O_TRUNC:512,O_APPEND:1024,O_DIRECTORY:65536,O_NOATIME:262144,O_NOFOLLOW:131072,O_SYNC:1052672,O_DIRECT:16384,O_NONBLOCK:2048,S_IRWXU:448,S_IRUSR:256,S_IWUSR:128,S_IXUSR:64,S_IRWXG:56,S_IRGRP:32,S_IWGRP:16,S_IXGRP:8,S_IRWXO:7,S_IROTH:4,S_IWOTH:2,S_IXOTH:1,F_OK:0,R_OK:4,W_OK:2,X_OK:1,UV_FS_SYMLINK_DIR:1,UV_FS_SYMLINK_JUNCTION:2,UV_FS_COPYFILE_EXCL:1,UV_FS_COPYFILE_FICLONE:2,UV_FS_COPYFILE_FICLONE_FORCE:4,COPYFILE_EXCL:1,COPYFILE_FICLONE:2,COPYFILE_FICLONE_FORCE:4}),t2}function JMe(){return Sre||(Sre=!0,typeof BigInt=="function"?u4.default=BigInt:u4.default=function(){throw new Error("BigInt is not supported in this environment.")}),u4}function Ik(){if(Ere)return D1;Ere=!0,Object.defineProperty(D1,"__esModule",{value:!0}),D1.Stats=void 0;var t=i2(),e=JMe(),r=t.constants.S_IFMT,a=t.constants.S_IFDIR,i=t.constants.S_IFREG,h=t.constants.S_IFBLK,l=t.constants.S_IFCHR,p=t.constants.S_IFLNK,b=t.constants.S_IFIFO,g=t.constants.S_IFSOCK,y=function(){function M(){}return M.build=function(x,E){E===void 0&&(E=!1);var A=new M,k=x.uid,P=x.gid,N=x.atime,L=x.mtime,C=x.ctime,Y=E?e.default:function(ee){return ee};A.uid=Y(k),A.gid=Y(P),A.rdev=Y(0),A.blksize=Y(4096),A.ino=Y(x.ino),A.size=Y(x.getSize()),A.blocks=Y(1),A.atime=N,A.mtime=L,A.ctime=C,A.birthtime=C,A.atimeMs=Y(N.getTime()),A.mtimeMs=Y(L.getTime());var G=Y(C.getTime());return A.ctimeMs=G,A.birthtimeMs=G,A.dev=Y(0),A.mode=Y(x.mode),A.nlink=Y(x.nlink),A},M.prototype._checkModeProperty=function(x){return(Number(this.mode)&r)===x},M.prototype.isDirectory=function(){return this._checkModeProperty(a)},M.prototype.isFile=function(){return this._checkModeProperty(i)},M.prototype.isBlockDevice=function(){return this._checkModeProperty(h)},M.prototype.isCharacterDevice=function(){return this._checkModeProperty(l)},M.prototype.isSymbolicLink=function(){return this._checkModeProperty(p)},M.prototype.isFIFO=function(){return this._checkModeProperty(b)},M.prototype.isSocket=function(){return this._checkModeProperty(g)},M}();return D1.Stats=y,D1.default=y,D1}function Bk(){if(Are)return Pf;Are=!0;var t=Pf&&Pf.__spreadArray||function(h,l,p){if(p||arguments.length===2)for(var b=0,g=l.length,y;b<g;b++)(y||!(b in l))&&(y||(y=Array.prototype.slice.call(l,0,b)),y[b]=l[b]);return h.concat(y||Array.prototype.slice.call(l))};Object.defineProperty(Pf,"__esModule",{value:!0}),Pf.bufferFrom=Pf.bufferAllocUnsafe=Pf.Buffer=void 0;var e=ni;Object.defineProperty(Pf,"Buffer",{enumerable:!0,get:function(){return e.Buffer}});function r(h){for(var l=[],p=1;p<arguments.length;p++)l[p-1]=arguments[p];return new(e.Buffer.bind.apply(e.Buffer,t([void 0,h],l,!1)))}var a=e.Buffer.allocUnsafe||r;Pf.bufferAllocUnsafe=a;var i=e.Buffer.from||r;return Pf.bufferFrom=i,Pf}function Ure(){if(Rre)return Un;Rre=!0;var t=Un&&Un.__extends||function(){var A=function(k,P){return A=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(N,L){N.__proto__=L}||function(N,L){for(var C in L)Object.prototype.hasOwnProperty.call(L,C)&&(N[C]=L[C])},A(k,P)};return function(k,P){if(typeof P!="function"&&P!==null)throw new TypeError("Class extends value "+String(P)+" is not a constructor or null");A(k,P);function N(){this.constructor=k}k.prototype=P===null?Object.create(P):(N.prototype=P.prototype,new N)}}();Object.defineProperty(Un,"__esModule",{value:!0}),Un.E=Un.AssertionError=Un.message=Un.RangeError=Un.TypeError=Un.Error=void 0;var e=ar,r=gt,a=typeof Symbol>"u"?"_kCode":Symbol("code"),i={};function h(A){return function(k){t(P,k);function P(N){for(var L=[],C=1;C<arguments.length;C++)L[C-1]=arguments[C];var Y=k.call(this,b(N,L))||this;return Y.code=N,Y[a]=N,Y.name=k.prototype.name+" ["+Y[a]+"]",Y}return P}(A)}var l=typeof globalThis<"u"?globalThis:XMe,p=function(A){t(k,A);function k(P){var N=this;if(typeof P!="object"||P===null)throw new Un.TypeError("ERR_INVALID_ARG_TYPE","options","object");return P.message?N=A.call(this,P.message)||this:N=A.call(this,r.inspect(P.actual).slice(0,128)+" "+(P.operator+" "+r.inspect(P.expected).slice(0,128)))||this,N.generatedMessage=!P.message,N.name="AssertionError [ERR_ASSERTION]",N.code="ERR_ASSERTION",N.actual=P.actual,N.expected=P.expected,N.operator=P.operator,Un.Error.captureStackTrace(N,P.stackStartFunction),N}return k}(l.Error);Un.AssertionError=p;function b(A,k){e.strictEqual(typeof A,"string");var P=i[A];e(P,"An invalid error message key was used: "+A+".");var N;if(typeof P=="function")N=P;else{if(N=r.format,k===void 0||k.length===0)return P;k.unshift(P)}return String(N.apply(null,k))}Un.message=b;function g(A,k){i[A]=typeof k=="function"?k:String(k)}Un.E=g,Un.Error=h(l.Error),Un.TypeError=h(l.TypeError),Un.RangeError=h(l.RangeError),g("ERR_ARG_NOT_ITERABLE","%s must be iterable"),g("ERR_ASSERTION","%s"),g("ERR_BUFFER_OUT_OF_BOUNDS",E),g("ERR_CHILD_CLOSED_BEFORE_REPLY","Child closed before reply received"),g("ERR_CONSOLE_WRITABLE_STREAM","Console expects a writable stream instance for %s"),g("ERR_CPU_USAGE","Unable to obtain cpu usage %s"),g("ERR_DNS_SET_SERVERS_FAILED",function(A,k){return'c-ares failed to set servers: "'+A+'" ['+k+"]"}),g("ERR_FALSY_VALUE_REJECTION","Promise was rejected with falsy value"),g("ERR_ENCODING_NOT_SUPPORTED",function(A){return'The "'+A+'" encoding is not supported'}),g("ERR_ENCODING_INVALID_ENCODED_DATA",function(A){return"The encoded data was not valid for encoding "+A}),g("ERR_HTTP_HEADERS_SENT","Cannot render headers after they are sent to the client"),g("ERR_HTTP_INVALID_STATUS_CODE","Invalid status code: %s"),g("ERR_HTTP_TRAILER_INVALID","Trailers are invalid with this transfer encoding"),g("ERR_INDEX_OUT_OF_RANGE","Index out of range"),g("ERR_INVALID_ARG_TYPE",y),g("ERR_INVALID_ARRAY_LENGTH",function(A,k,P){return e.strictEqual(typeof P,"number"),'The array "'+A+'" (length '+P+") must be of length "+k+"."}),g("ERR_INVALID_BUFFER_SIZE","Buffer size must be a multiple of %s"),g("ERR_INVALID_CALLBACK","Callback must be a function"),g("ERR_INVALID_CHAR","Invalid character in %s"),g("ERR_INVALID_CURSOR_POS","Cannot set cursor row without setting its column"),g("ERR_INVALID_FD",'"fd" must be a positive integer: %s'),g("ERR_INVALID_FILE_URL_HOST",'File URL host must be "localhost" or empty on %s'),g("ERR_INVALID_FILE_URL_PATH","File URL path %s"),g("ERR_INVALID_HANDLE_TYPE","This handle type cannot be sent"),g("ERR_INVALID_IP_ADDRESS","Invalid IP address: %s"),g("ERR_INVALID_OPT_VALUE",function(A,k){return'The value "'+String(k)+'" is invalid for option "'+A+'"'}),g("ERR_INVALID_OPT_VALUE_ENCODING",function(A){return'The value "'+String(A)+'" is invalid for option "encoding"'}),g("ERR_INVALID_REPL_EVAL_CONFIG",'Cannot specify both "breakEvalOnSigint" and "eval" for REPL'),g("ERR_INVALID_SYNC_FORK_INPUT","Asynchronous forks do not support Buffer, Uint8Array or string input: %s"),g("ERR_INVALID_THIS",'Value of "this" must be of type %s'),g("ERR_INVALID_TUPLE","%s must be an iterable %s tuple"),g("ERR_INVALID_URL","Invalid URL: %s"),g("ERR_INVALID_URL_SCHEME",function(A){return"The URL must be "+x(A,"scheme")}),g("ERR_IPC_CHANNEL_CLOSED","Channel closed"),g("ERR_IPC_DISCONNECTED","IPC channel is already disconnected"),g("ERR_IPC_ONE_PIPE","Child process can have only one IPC pipe"),g("ERR_IPC_SYNC_FORK","IPC cannot be used with synchronous forks"),g("ERR_MISSING_ARGS",M),g("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),g("ERR_NAPI_CONS_FUNCTION","Constructor must be a function"),g("ERR_NAPI_CONS_PROTOTYPE_OBJECT","Constructor.prototype must be an object"),g("ERR_NO_CRYPTO","Node.js is not compiled with OpenSSL crypto support"),g("ERR_NO_LONGER_SUPPORTED","%s is no longer supported"),g("ERR_PARSE_HISTORY_DATA","Could not parse history data in %s"),g("ERR_SOCKET_ALREADY_BOUND","Socket is already bound"),g("ERR_SOCKET_BAD_PORT","Port should be > 0 and < 65536"),g("ERR_SOCKET_BAD_TYPE","Bad socket type specified. Valid types are: udp4, udp6"),g("ERR_SOCKET_CANNOT_SEND","Unable to send data"),g("ERR_SOCKET_CLOSED","Socket is closed"),g("ERR_SOCKET_DGRAM_NOT_RUNNING","Not running"),g("ERR_STDERR_CLOSE","process.stderr cannot be closed"),g("ERR_STDOUT_CLOSE","process.stdout cannot be closed"),g("ERR_STREAM_WRAP","Stream has StringDecoder set or is in objectMode"),g("ERR_TLS_CERT_ALTNAME_INVALID","Hostname/IP does not match certificate's altnames: %s"),g("ERR_TLS_DH_PARAM_SIZE",function(A){return"DH parameter size "+A+" is less than 2048"}),g("ERR_TLS_HANDSHAKE_TIMEOUT","TLS handshake timeout"),g("ERR_TLS_RENEGOTIATION_FAILED","Failed to renegotiate"),g("ERR_TLS_REQUIRED_SERVER_NAME",'"servername" is required parameter for Server.addContext'),g("ERR_TLS_SESSION_ATTACK","TSL session renegotiation attack detected"),g("ERR_TRANSFORM_ALREADY_TRANSFORMING","Calling transform done when still transforming"),g("ERR_TRANSFORM_WITH_LENGTH_0","Calling transform done when writableState.length != 0"),g("ERR_UNKNOWN_ENCODING","Unknown encoding: %s"),g("ERR_UNKNOWN_SIGNAL","Unknown signal: %s"),g("ERR_UNKNOWN_STDIN_TYPE","Unknown stdin file type"),g("ERR_UNKNOWN_STREAM_TYPE","Unknown stream file type"),g("ERR_V8BREAKITERATOR","Full ICU data not installed. See https://github.com/nodejs/node/wiki/Intl");function y(A,k,P){e(A,"name is required");var N;k.includes("not ")?(N="must not be",k=k.split("not ")[1]):N="must be";var L;if(Array.isArray(A)){var C=A.map(function(G){return'"'+G+'"'}).join(", ");L="The "+C+" arguments "+N+" "+x(k,"type")}else if(A.includes(" argument"))L="The "+A+" "+N+" "+x(k,"type");else{var Y=A.includes(".")?"property":"argument";L='The "'+A+'" '+Y+" "+N+" "+x(k,"type")}return arguments.length>=3&&(L+=". Received type "+(P!==null?typeof P:"null")),L}function M(){for(var A=[],k=0;k<arguments.length;k++)A[k]=arguments[k];e(A.length>0,"At least one arg needs to be specified");var P="The ",N=A.length;switch(A=A.map(function(L){return'"'+L+'"'}),N){case 1:P+=A[0]+" argument";break;case 2:P+=A[0]+" and "+A[1]+" arguments";break;default:P+=A.slice(0,N-1).join(", "),P+=", and "+A[N-1]+" arguments";break}return P+" must be specified"}function x(A,k){if(e(A,"expected is required"),e(typeof k=="string","thing is required"),Array.isArray(A)){var P=A.length;return e(P>0,"At least one expected value needs to be specified"),A=A.map(function(N){return String(N)}),P>2?"one of "+k+" "+A.slice(0,P-1).join(", ")+", or "+A[P-1]:P===2?"one of "+k+" "+A[0]+" or "+A[1]:"of "+k+" "+A[0]}else return"of "+k+" "+String(A)}function E(A,k){return k?"Attempt to write outside buffer bounds":'"'+A+'" is outside of buffer bounds'}return Un}function Fre(){if(Tre)return $u;Tre=!0,Object.defineProperty($u,"__esModule",{value:!0}),$u.strToEncoding=$u.assertEncoding=$u.ENCODING_UTF8=void 0;var t=Bk(),e=Ure();$u.ENCODING_UTF8="utf8";function r(i){if(i&&!t.Buffer.isEncoding(i))throw new e.TypeError("ERR_INVALID_OPT_VALUE_ENCODING",i)}$u.assertEncoding=r;function a(i,h){return!h||h===$u.ENCODING_UTF8?i:h==="buffer"?new t.Buffer(i):new t.Buffer(i).toString(h)}return $u.strToEncoding=a,$u}function jre(){if(kre)return $1;kre=!0,Object.defineProperty($1,"__esModule",{value:!0}),$1.Dirent=void 0;var t=i2(),e=Fre(),r=t.constants.S_IFMT,a=t.constants.S_IFDIR,i=t.constants.S_IFREG,h=t.constants.S_IFBLK,l=t.constants.S_IFCHR,p=t.constants.S_IFLNK,b=t.constants.S_IFIFO,g=t.constants.S_IFSOCK,y=function(){function M(){this.name="",this.mode=0}return M.build=function(x,E){var A=new M,k=x.getNode().mode;return A.name=(0,e.strToEncoding)(x.getName(),E),A.mode=k,A},M.prototype._checkModeProperty=function(x){return(this.mode&r)===x},M.prototype.isDirectory=function(){return this._checkModeProperty(a)},M.prototype.isFile=function(){return this._checkModeProperty(i)},M.prototype.isBlockDevice=function(){return this._checkModeProperty(h)},M.prototype.isCharacterDevice=function(){return this._checkModeProperty(l)},M.prototype.isSymbolicLink=function(){return this._checkModeProperty(p)},M.prototype.isFIFO=function(){return this._checkModeProperty(b)},M.prototype.isSocket=function(){return this._checkModeProperty(g)},M}();return $1.Dirent=y,$1.default=y,$1}function zre(){if(Ire)return h4;Ire=!0;var t=yr;Object.defineProperty(h4,"__esModule",{value:!0});var e;return typeof t.nextTick=="function"?e=t.nextTick.bind(typeof globalThis<"u"?globalThis:Bre):e=setTimeout.bind(typeof globalThis<"u"?globalThis:Bre),h4.default=e,h4}function Zre(){if(Pre)return q1;Pre=!0;var t=yr;Object.defineProperty(q1,"__esModule",{value:!0}),q1.createProcess=void 0;var e=function(){if(typeof t<"u")return t;try{return yr}catch{return}};function r(){var a=e()||{};return a.getuid||(a.getuid=function(){return 0}),a.getgid||(a.getgid=function(){return 0}),a.cwd||(a.cwd=function(){return"/"}),a.nextTick||(a.nextTick=zre().default),a.emitWarning||(a.emitWarning=function(i,h){console.warn(""+h+(h?": ":"")+i)}),a.env||(a.env={}),a}return q1.createProcess=r,q1.default=r(),q1}function QMe(){if(Ore)return so;Ore=!0;var t=so&&so.__extends||function(){var A=function(k,P){return A=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(N,L){N.__proto__=L}||function(N,L){for(var C in L)Object.prototype.hasOwnProperty.call(L,C)&&(N[C]=L[C])},A(k,P)};return function(k,P){if(typeof P!="function"&&P!==null)throw new TypeError("Class extends value "+String(P)+" is not a constructor or null");A(k,P);function N(){this.constructor=k}k.prototype=P===null?Object.create(P):(N.prototype=P.prototype,new N)}}();Object.defineProperty(so,"__esModule",{value:!0}),so.File=so.Link=so.Node=so.SEP=void 0;var e=Zre(),r=Bk(),a=i2(),i=Ei,h=Ik(),l=a.constants.S_IFMT,p=a.constants.S_IFDIR,b=a.constants.S_IFREG,g=a.constants.S_IFLNK,y=a.constants.O_APPEND;so.SEP="/";var M=function(A){t(k,A);function k(P,N){N===void 0&&(N=438);var L=A.call(this)||this;return L.uid=e.default.getuid(),L.gid=e.default.getgid(),L.atime=new Date,L.mtime=new Date,L.ctime=new Date,L.perm=438,L.mode=b,L.nlink=1,L.perm=N,L.mode|=N,L.ino=P,L}return k.prototype.getString=function(P){return P===void 0&&(P="utf8"),this.getBuffer().toString(P)},k.prototype.setString=function(P){this.buf=(0,r.bufferFrom)(P,"utf8"),this.touch()},k.prototype.getBuffer=function(){return this.buf||this.setBuffer((0,r.bufferAllocUnsafe)(0)),(0,r.bufferFrom)(this.buf)},k.prototype.setBuffer=function(P){this.buf=(0,r.bufferFrom)(P),this.touch()},k.prototype.getSize=function(){return this.buf?this.buf.length:0},k.prototype.setModeProperty=function(P){this.mode=this.mode&~l|P},k.prototype.setIsFile=function(){this.setModeProperty(b)},k.prototype.setIsDirectory=function(){this.setModeProperty(p)},k.prototype.setIsSymlink=function(){this.setModeProperty(g)},k.prototype.isFile=function(){return(this.mode&l)===b},k.prototype.isDirectory=function(){return(this.mode&l)===p},k.prototype.isSymlink=function(){return(this.mode&l)===g},k.prototype.makeSymlink=function(P){this.symlink=P,this.setIsSymlink()},k.prototype.write=function(P,N,L,C){if(N===void 0&&(N=0),L===void 0&&(L=P.length),C===void 0&&(C=0),this.buf||(this.buf=(0,r.bufferAllocUnsafe)(0)),C+L>this.buf.length){var Y=(0,r.bufferAllocUnsafe)(C+L);this.buf.copy(Y,0,0,this.buf.length),this.buf=Y}return P.copy(this.buf,C,N,N+L),this.touch(),L},k.prototype.read=function(P,N,L,C){N===void 0&&(N=0),L===void 0&&(L=P.byteLength),C===void 0&&(C=0),this.buf||(this.buf=(0,r.bufferAllocUnsafe)(0));var Y=L;return Y>P.byteLength&&(Y=P.byteLength),Y+C>this.buf.length&&(Y=this.buf.length-C),this.buf.copy(P,N,C,C+Y),Y},k.prototype.truncate=function(P){if(P===void 0&&(P=0),!P)this.buf=(0,r.bufferAllocUnsafe)(0);else if(this.buf||(this.buf=(0,r.bufferAllocUnsafe)(0)),P<=this.buf.length)this.buf=this.buf.slice(0,P);else{var N=(0,r.bufferAllocUnsafe)(0);this.buf.copy(N),N.fill(0,P)}this.touch()},k.prototype.chmod=function(P){this.perm=P,this.mode=this.mode&-512|P,this.touch()},k.prototype.chown=function(P,N){this.uid=P,this.gid=N,this.touch()},k.prototype.touch=function(){this.mtime=new Date,this.emit("change",this)},k.prototype.canRead=function(P,N){return P===void 0&&(P=e.default.getuid()),N===void 0&&(N=e.default.getgid()),!!(this.perm&4||N===this.gid&&this.perm&32||P===this.uid&&this.perm&256)},k.prototype.canWrite=function(P,N){return P===void 0&&(P=e.default.getuid()),N===void 0&&(N=e.default.getgid()),!!(this.perm&2||N===this.gid&&this.perm&16||P===this.uid&&this.perm&128)},k.prototype.del=function(){this.emit("delete",this)},k.prototype.toJSON=function(){return{ino:this.ino,uid:this.uid,gid:this.gid,atime:this.atime.getTime(),mtime:this.mtime.getTime(),ctime:this.ctime.getTime(),perm:this.perm,mode:this.mode,nlink:this.nlink,symlink:this.symlink,data:this.getString()}},k}(i.EventEmitter);so.Node=M;var x=function(A){t(k,A);function k(P,N,L){var C=A.call(this)||this;return C.children={},C.steps=[],C.ino=0,C.length=0,C.vol=P,C.parent=N,C.steps=N?N.steps.concat([L]):[L],C}return k.prototype.setNode=function(P){this.node=P,this.ino=P.ino},k.prototype.getNode=function(){return this.node},k.prototype.createChild=function(P,N){N===void 0&&(N=this.vol.createNode());var L=new k(this.vol,this,P);return L.setNode(N),N.isDirectory(),this.setChild(P,L),L},k.prototype.setChild=function(P,N){return N===void 0&&(N=new k(this.vol,this,P)),this.children[P]=N,N.parent=this,this.length++,this.emit("child:add",N,this),N},k.prototype.deleteChild=function(P){delete this.children[P.getName()],this.length--,this.emit("child:delete",P,this)},k.prototype.getChild=function(P){if(Object.hasOwnProperty.call(this.children,P))return this.children[P]},k.prototype.getPath=function(){return this.steps.join(so.SEP)},k.prototype.getName=function(){return this.steps[this.steps.length-1]},k.prototype.walk=function(P,N,L){if(N===void 0&&(N=P.length),L===void 0&&(L=0),L>=P.length)return this;if(L>=N)return this;var C=P[L],Y=this.getChild(C);return Y?Y.walk(P,N,L+1):null},k.prototype.toJSON=function(){return{steps:this.steps,ino:this.ino,children:Object.keys(this.children)}},k}(i.EventEmitter);so.Link=x;var E=function(){function A(k,P,N,L){this.position=0,this.link=k,this.node=P,this.flags=N,this.fd=L}return A.prototype.getString=function(k){return this.node.getString()},A.prototype.setString=function(k){this.node.setString(k)},A.prototype.getBuffer=function(){return this.node.getBuffer()},A.prototype.setBuffer=function(k){this.node.setBuffer(k)},A.prototype.getSize=function(){return this.node.getSize()},A.prototype.truncate=function(k){this.node.truncate(k)},A.prototype.seekTo=function(k){this.position=k},A.prototype.stats=function(){return h.default.build(this.node)},A.prototype.write=function(k,P,N,L){P===void 0&&(P=0),N===void 0&&(N=k.length),typeof L!="number"&&(L=this.position),this.flags&y&&(L=this.getSize());var C=this.node.write(k,P,N,L);return this.position=L+C,C},A.prototype.read=function(k,P,N,L){P===void 0&&(P=0),N===void 0&&(N=k.byteLength),typeof L!="number"&&(L=this.position);var C=this.node.read(k,P,N,L);return this.position=L+C,C},A.prototype.chmod=function(k){this.node.chmod(k)},A.prototype.chown=function(k,P){this.node.chown(k,P)},A}();return so.File=E,so}function txe(){if(Nre)return l4;Nre=!0,Object.defineProperty(l4,"__esModule",{value:!0});function t(e,r,a){var i=setTimeout.apply(typeof globalThis<"u"?globalThis:exe,arguments);return i&&typeof i=="object"&&typeof i.unref=="function"&&i.unref(),i}return l4.default=t,l4}function rxe(){if(Cre)return gc;Cre=!0;var t=gc&&gc.__spreadArray||function(i,h,l){if(l||arguments.length===2)for(var p=0,b=h.length,g;p<b;p++)(g||!(p in h))&&(g||(g=Array.prototype.slice.call(h,0,p)),g[p]=h[p]);return i.concat(g||Array.prototype.slice.call(h))};Object.defineProperty(gc,"__esModule",{value:!0}),gc.FileHandle=void 0;function e(i,h,l){return l===void 0&&(l=function(p){return p}),function(){for(var p=[],b=0;b<arguments.length;b++)p[b]=arguments[b];return new Promise(function(g,y){i[h].bind(i).apply(void 0,t(t([],p,!1),[function(M,x){return M?y(M):g(l(x))}],!1))})}}var r=function(){function i(h,l){this.vol=h,this.fd=l}return i.prototype.appendFile=function(h,l){return e(this.vol,"appendFile")(this.fd,h,l)},i.prototype.chmod=function(h){return e(this.vol,"fchmod")(this.fd,h)},i.prototype.chown=function(h,l){return e(this.vol,"fchown")(this.fd,h,l)},i.prototype.close=function(){return e(this.vol,"close")(this.fd)},i.prototype.datasync=function(){return e(this.vol,"fdatasync")(this.fd)},i.prototype.read=function(h,l,p,b){return e(this.vol,"read",function(g){return{bytesRead:g,buffer:h}})(this.fd,h,l,p,b)},i.prototype.readFile=function(h){return e(this.vol,"readFile")(this.fd,h)},i.prototype.stat=function(h){return e(this.vol,"fstat")(this.fd,h)},i.prototype.sync=function(){return e(this.vol,"fsync")(this.fd)},i.prototype.truncate=function(h){return e(this.vol,"ftruncate")(this.fd,h)},i.prototype.utimes=function(h,l){return e(this.vol,"futimes")(this.fd,h,l)},i.prototype.write=function(h,l,p,b){return e(this.vol,"write",function(g){return{bytesWritten:g,buffer:h}})(this.fd,h,l,p,b)},i.prototype.writeFile=function(h,l){return e(this.vol,"writeFile")(this.fd,h,l)},i}();gc.FileHandle=r;function a(i){return typeof Promise>"u"?null:{FileHandle:r,access:function(h,l){return e(i,"access")(h,l)},appendFile:function(h,l,p){return e(i,"appendFile")(h instanceof r?h.fd:h,l,p)},chmod:function(h,l){return e(i,"chmod")(h,l)},chown:function(h,l,p){return e(i,"chown")(h,l,p)},copyFile:function(h,l,p){return e(i,"copyFile")(h,l,p)},lchmod:function(h,l){return e(i,"lchmod")(h,l)},lchown:function(h,l,p){return e(i,"lchown")(h,l,p)},link:function(h,l){return e(i,"link")(h,l)},lstat:function(h,l){return e(i,"lstat")(h,l)},mkdir:function(h,l){return e(i,"mkdir")(h,l)},mkdtemp:function(h,l){return e(i,"mkdtemp")(h,l)},open:function(h,l,p){return e(i,"open",function(b){return new r(i,b)})(h,l,p)},readdir:function(h,l){return e(i,"readdir")(h,l)},readFile:function(h,l){return e(i,"readFile")(h instanceof r?h.fd:h,l)},readlink:function(h,l){return e(i,"readlink")(h,l)},realpath:function(h,l){return e(i,"realpath")(h,l)},rename:function(h,l){return e(i,"rename")(h,l)},rmdir:function(h){return e(i,"rmdir")(h)},stat:function(h,l){return e(i,"stat")(h,l)},symlink:function(h,l,p){return e(i,"symlink")(h,l,p)},truncate:function(h,l){return e(i,"truncate")(h,l)},unlink:function(h){return e(i,"unlink")(h)},utimes:function(h,l,p){return e(i,"utimes")(h,l,p)},writeFile:function(h,l,p){return e(i,"writeFile")(h instanceof r?h.fd:h,l,p)}}}return gc.default=a,gc}function ixe(){if(Lre)return r2;Lre=!0;var t=yr;Object.defineProperty(r2,"__esModule",{value:!0}),r2.unixify=h,r2.correctPath=l;var e=t.platform==="win32";function r(p){var b=p.length-1;if(b<2)return p;for(;a(p,b);)b--;return p.substr(0,b+1)}function a(p,b){var g=p[b];return b>0&&(g==="/"||e&&g==="\\")}function i(p,b){if(typeof p!="string")throw new TypeError("expected a string");return p=p.replace(/[\\\/]+/g,"/"),b!==!1&&(p=r(p)),p}function h(p){var b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return e?(p=i(p,b),p.replace(/^([a-zA-Z]+:|\.\/)/,"")):p}function l(p){return h(p.replace(/^\\\\\?\\.:\\/,"\\"))}return r2}function Hre(){if(Dre)return ui;Dre=!0;var t=ui&&ui.__extends||function(){var Ke=function(ve,we){return Ke=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(ze,rt){ze.__proto__=rt}||function(ze,rt){for(var ft in rt)Object.prototype.hasOwnProperty.call(rt,ft)&&(ze[ft]=rt[ft])},Ke(ve,we)};return function(ve,we){if(typeof we!="function"&&we!==null)throw new TypeError("Class extends value "+String(we)+" is not a constructor or null");Ke(ve,we);function ze(){this.constructor=ve}ve.prototype=we===null?Object.create(we):(ze.prototype=we.prototype,new ze)}}(),e=ui&&ui.__spreadArray||function(Ke,ve,we){if(we||arguments.length===2)for(var ze=0,rt=ve.length,ft;ze<rt;ze++)(ft||!(ze in ve))&&(ft||(ft=Array.prototype.slice.call(ve,0,ze)),ft[ze]=ve[ze]);return Ke.concat(ft||Array.prototype.slice.call(ve))};Object.defineProperty(ui,"__esModule",{value:!0}),ui.FSWatcher=ui.StatWatcher=ui.Volume=ui.toUnixTimestamp=ui.bufferToEncoding=ui.dataToBuffer=ui.dataToStr=ui.pathToSteps=ui.filenameToSteps=ui.pathToFilename=ui.flagsToNumber=ui.FLAGS=void 0;var r=fn,a=QMe(),i=Ik(),h=jre(),l=Bk(),p=zre(),b=Zre(),g=txe(),y=ka,M=i2(),x=Ei,E=Fre(),A=Ure(),k=gt,P=rxe(),N=r.resolve,L=M.constants.O_RDONLY,C=M.constants.O_WRONLY,Y=M.constants.O_RDWR,G=M.constants.O_CREAT,ee=M.constants.O_EXCL,D=M.constants.O_TRUNC,U=M.constants.O_APPEND,V=M.constants.O_SYNC,_=M.constants.O_DIRECTORY,n=M.constants.F_OK,s=M.constants.COPYFILE_EXCL,f=M.constants.COPYFILE_FICLONE_FORCE,u=r.posix?r.posix:r,c=u.sep,m=u.relative,w=u.join,d=u.dirname,o=b.default.platform==="win32",v=128,R={PATH_STR:"path must be a string or Buffer",FD:"fd must be a file descriptor",MODE_INT:"mode must be an int",CB:"callback must be a function",UID:"uid must be an unsigned int",GID:"gid must be an unsigned int",LEN:"len must be an integer",ATIME:"atime must be an integer",MTIME:"mtime must be an integer",PREFIX:"filename prefix is required",BUFFER:"buffer must be an instance of Buffer or StaticBuffer",OFFSET:"offset must be an integer",LENGTH:"length must be an integer",POSITION:"position must be an integer"},S=function(Ke){return"Expected options to be either an object or a string, but got "+Ke+" instead"},B="ENOENT",F="EBADF",$="EINVAL",re="EPERM",Q="EPROTO",Z="EEXIST",K="ENOTDIR",le="EMFILE",te="EACCES",j="EISDIR",J="ENOTEMPTY",X="ENOSYS";function he(Ke,ve,we,ze){ve===void 0&&(ve=""),we===void 0&&(we=""),ze===void 0&&(ze="");var rt="";switch(we&&(rt=" '"+we+"'"),ze&&(rt+=" -> '"+ze+"'"),Ke){case B:return"ENOENT: no such file or directory, "+ve+rt;case F:return"EBADF: bad file descriptor, "+ve+rt;case $:return"EINVAL: invalid argument, "+ve+rt;case re:return"EPERM: operation not permitted, "+ve+rt;case Q:return"EPROTO: protocol error, "+ve+rt;case Z:return"EEXIST: file already exists, "+ve+rt;case K:return"ENOTDIR: not a directory, "+ve+rt;case j:return"EISDIR: illegal operation on a directory, "+ve+rt;case te:return"EACCES: permission denied, "+ve+rt;case J:return"ENOTEMPTY: directory not empty, "+ve+rt;case le:return"EMFILE: too many open files, "+ve+rt;case X:return"ENOSYS: function not implemented, "+ve+rt;default:return Ke+": error occurred, "+ve+rt}}function Te(Ke,ve,we,ze,rt){ve===void 0&&(ve=""),we===void 0&&(we=""),ze===void 0&&(ze=""),rt===void 0&&(rt=Error);var ft=new rt(he(Ke,ve,we,ze));return ft.code=Ke,ft}var oe;(function(Ke){Ke[Ke.r=L]="r",Ke[Ke["r+"]=Y]="r+",Ke[Ke.rs=L|V]="rs",Ke[Ke.sr=Ke.rs]="sr",Ke[Ke["rs+"]=Y|V]="rs+",Ke[Ke["sr+"]=Ke["rs+"]]="sr+",Ke[Ke.w=C|G|D]="w",Ke[Ke.wx=C|G|D|ee]="wx",Ke[Ke.xw=Ke.wx]="xw",Ke[Ke["w+"]=Y|G|D]="w+",Ke[Ke["wx+"]=Y|G|D|ee]="wx+",Ke[Ke["xw+"]=Ke["wx+"]]="xw+",Ke[Ke.a=C|U|G]="a",Ke[Ke.ax=C|U|G|ee]="ax",Ke[Ke.xa=Ke.ax]="xa",Ke[Ke["a+"]=Y|U|G]="a+",Ke[Ke["ax+"]=Y|U|G|ee]="ax+",Ke[Ke["xa+"]=Ke["ax+"]]="xa+"})(oe=ui.FLAGS||(ui.FLAGS={}));function ce(Ke){if(typeof Ke=="number")return Ke;if(typeof Ke=="string"){var ve=oe[Ke];if(typeof ve<"u")return ve}throw new A.TypeError("ERR_INVALID_OPT_VALUE","flags",Ke)}ui.flagsToNumber=ce;function ot(Ke,ve){var we;if(ve){var ze=typeof ve;switch(ze){case"string":we=Object.assign({},Ke,{encoding:ve});break;case"object":we=Object.assign({},Ke,ve);break;default:throw TypeError(S(ze))}}else return Ke;return we.encoding!=="buffer"&&(0,E.assertEncoding)(we.encoding),we}function ge(Ke){return function(ve){return ot(Ke,ve)}}function Se(Ke){if(typeof Ke!="function")throw TypeError(R.CB);return Ke}function ut(Ke){return function(ve,we){return typeof ve=="function"?[Ke(),ve]:[Ke(ve),Se(we)]}}var Ze={encoding:"utf8"},Ge=ge(Ze),lt=ut(Ge),z={flag:"r"},T=ge(z),I={encoding:"utf8",mode:438,flag:oe[oe.w]},O=ge(I),q={encoding:"utf8",mode:438,flag:oe[oe.a]},H=ge(q),W=ut(H),fe=Ze,st=ge(fe),ue=ut(st),me={mode:511,recursive:!1},pe=function(Ke){return typeof Ke=="number"?Object.assign({},me,{mode:Ke}):Object.assign({},me,Ke)},be={recursive:!1},Qe=function(Ke){return Object.assign({},be,Ke)},se={encoding:"utf8",withFileTypes:!1},ye=ge(se),Ee=ut(ye),Fe={bigint:!1},de=function(Ke){return Ke===void 0&&(Ke={}),Object.assign({},Fe,Ke)},xe=function(Ke,ve){return typeof Ke=="function"?[de(),Ke]:[de(Ke),Se(ve)]};function ct(Ke){if(Ke.hostname!=="")throw new A.TypeError("ERR_INVALID_FILE_URL_HOST",b.default.platform);for(var ve=Ke.pathname,we=0;we<ve.length;we++)if(ve[we]==="%"){var ze=ve.codePointAt(we+2)|32;if(ve[we+1]==="2"&&ze===102)throw new A.TypeError("ERR_INVALID_FILE_URL_PATH","must not include encoded / characters")}return decodeURIComponent(ve)}function _e(Ke){if(typeof Ke!="string"&&!l.Buffer.isBuffer(Ke)){try{if(!(Ke instanceof vi.URL))throw new TypeError(R.PATH_STR)}catch{throw new TypeError(R.PATH_STR)}Ke=ct(Ke)}var ve=String(Ke);return Je(ve),ve}ui.pathToFilename=_e;var Ve=function(Ke,ve){return ve===void 0&&(ve=b.default.cwd()),N(ve,Ke)};if(o){var vt=Ve,Ye=ixe().unixify;Ve=function(Ke,ve){return Ye(vt(Ke,ve))}}function et(Ke,ve){var we=Ve(Ke,ve),ze=we.substr(1);return ze?ze.split(c):[]}ui.filenameToSteps=et;function mt(Ke){return et(_e(Ke))}ui.pathToSteps=mt;function We(Ke,ve){return ve===void 0&&(ve=E.ENCODING_UTF8),l.Buffer.isBuffer(Ke)?Ke.toString(ve):Ke instanceof Uint8Array?(0,l.bufferFrom)(Ke).toString(ve):String(Ke)}ui.dataToStr=We;function nt(Ke,ve){return ve===void 0&&(ve=E.ENCODING_UTF8),l.Buffer.isBuffer(Ke)?Ke:Ke instanceof Uint8Array?(0,l.bufferFrom)(Ke):(0,l.bufferFrom)(String(Ke),ve)}ui.dataToBuffer=nt;function bt(Ke,ve){return!ve||ve==="buffer"?Ke:Ke.toString(ve)}ui.bufferToEncoding=bt;function Je(Ke,ve){if((""+Ke).indexOf("\0")!==-1){var we=new Error("Path must be a string without null bytes");if(we.code=B,typeof ve!="function")throw we;return b.default.nextTick(ve,we),!1}return!0}function at(Ke,ve){if(typeof Ke=="number")return Ke;if(typeof Ke=="string")return parseInt(Ke,8);if(ve)return yt(ve)}function yt(Ke,ve){var we=at(Ke,ve);if(typeof we!="number"||isNaN(we))throw new TypeError(R.MODE_INT);return we}function Xe(Ke){return Ke>>>0===Ke}function it(Ke){if(!Xe(Ke))throw TypeError(R.FD)}function _t(Ke){if(typeof Ke=="string"&&+Ke==Ke)return+Ke;if(Ke instanceof Date)return Ke.getTime()/1e3;if(isFinite(Ke))return Ke<0?Date.now()/1e3:Ke;throw new Error("Cannot parse time: "+Ke)}ui.toUnixTimestamp=_t;function dt(Ke){if(typeof Ke!="number")throw TypeError(R.UID)}function Mt(Ke){if(typeof Ke!="number")throw TypeError(R.GID)}function qt(Ke){var ve={};function we(ze,rt){for(var ft in rt){var pt=rt[ft],xt=w(ze,ft);typeof pt=="string"?ve[xt]=pt:typeof pt=="object"&&pt!==null&&Object.keys(pt).length>0?we(xt,pt):ve[xt]=null}}return we("",Ke),ve}var Ut=function(){function Ke(ve){ve===void 0&&(ve={}),this.ino=0,this.inodes={},this.releasedInos=[],this.fds={},this.releasedFds=[],this.maxFiles=1e4,this.openFiles=0,this.promisesApi=(0,P.default)(this),this.statWatchers={},this.props=Object.assign({Node:a.Node,Link:a.Link,File:a.File},ve);var we=this.createLink();we.setNode(this.createNode(!0));var ze=this;this.StatWatcher=function(pt){t(xt,pt);function xt(){return pt.call(this,ze)||this}return xt}($t);var rt=Lt;this.ReadStream=function(pt){t(xt,pt);function xt(){for(var Kt=[],Qt=0;Qt<arguments.length;Qt++)Kt[Qt]=arguments[Qt];return pt.apply(this,e([ze],Kt,!1))||this}return xt}(rt);var ft=Nt;this.WriteStream=function(pt){t(xt,pt);function xt(){for(var Kt=[],Qt=0;Qt<arguments.length;Qt++)Kt[Qt]=arguments[Qt];return pt.apply(this,e([ze],Kt,!1))||this}return xt}(ft),this.FSWatcher=function(pt){t(xt,pt);function xt(){return pt.call(this,ze)||this}return xt}(zt),this.root=we}return Ke.fromJSON=function(ve,we){var ze=new Ke;return ze.fromJSON(ve,we),ze},Ke.fromNestedJSON=function(ve,we){var ze=new Ke;return ze.fromNestedJSON(ve,we),ze},Object.defineProperty(Ke.prototype,"promises",{get:function(){if(this.promisesApi===null)throw new Error("Promise is not supported in this environment.");return this.promisesApi},enumerable:!1,configurable:!0}),Ke.prototype.createLink=function(ve,we,ze,rt){if(ze===void 0&&(ze=!1),!ve)return new this.props.Link(this,null,"");if(!we)throw new Error("createLink: name cannot be empty");return ve.createChild(we,this.createNode(ze,rt))},Ke.prototype.deleteLink=function(ve){var we=ve.parent;return we?(we.deleteChild(ve),!0):!1},Ke.prototype.newInoNumber=function(){var ve=this.releasedInos.pop();return ve||(this.ino=(this.ino+1)%4294967295,this.ino)},Ke.prototype.newFdNumber=function(){var ve=this.releasedFds.pop();return typeof ve=="number"?ve:Ke.fd--},Ke.prototype.createNode=function(ve,we){ve===void 0&&(ve=!1);var ze=new this.props.Node(this.newInoNumber(),we);return ve&&ze.setIsDirectory(),this.inodes[ze.ino]=ze,ze},Ke.prototype.getNode=function(ve){return this.inodes[ve]},Ke.prototype.deleteNode=function(ve){ve.del(),delete this.inodes[ve.ino],this.releasedInos.push(ve.ino)},Ke.prototype.genRndStr=function(){var ve=(Math.random()+1).toString(36).substr(2,6);return ve.length===6?ve:this.genRndStr()},Ke.prototype.getLink=function(ve){return this.root.walk(ve)},Ke.prototype.getLinkOrThrow=function(ve,we){var ze=et(ve),rt=this.getLink(ze);if(!rt)throw Te(B,we,ve);return rt},Ke.prototype.getResolvedLink=function(ve){for(var we=typeof ve=="string"?et(ve):ve,ze=this.root,rt=0;rt<we.length;){var ft=we[rt];if(ze=ze.getChild(ft),!ze)return null;var pt=ze.getNode();if(pt.isSymlink()){we=pt.symlink.concat(we.slice(rt+1)),ze=this.root,rt=0;continue}rt++}return ze},Ke.prototype.getResolvedLinkOrThrow=function(ve,we){var ze=this.getResolvedLink(ve);if(!ze)throw Te(B,we,ve);return ze},Ke.prototype.resolveSymlinks=function(ve){return this.getResolvedLink(ve.steps.slice(1))},Ke.prototype.getLinkAsDirOrThrow=function(ve,we){var ze=this.getLinkOrThrow(ve,we);if(!ze.getNode().isDirectory())throw Te(K,we,ve);return ze},Ke.prototype.getLinkParent=function(ve){return this.root.walk(ve,ve.length-1)},Ke.prototype.getLinkParentAsDirOrThrow=function(ve,we){var ze=ve instanceof Array?ve:et(ve),rt=this.getLinkParent(ze);if(!rt)throw Te(B,we,c+ze.join(c));if(!rt.getNode().isDirectory())throw Te(K,we,c+ze.join(c));return rt},Ke.prototype.getFileByFd=function(ve){return this.fds[String(ve)]},Ke.prototype.getFileByFdOrThrow=function(ve,we){if(!Xe(ve))throw TypeError(R.FD);var ze=this.getFileByFd(ve);if(!ze)throw Te(F,we);return ze},Ke.prototype.getNodeByIdOrCreate=function(ve,we,ze){if(typeof ve=="number"){var rt=this.getFileByFd(ve);if(!rt)throw Error("File nto found");return rt.node}else{var ft=mt(ve),pt=this.getLink(ft);if(pt)return pt.getNode();if(we&G){var xt=this.getLinkParent(ft);if(xt){var Kt=ft[ft.length-1];return pt=this.createLink(xt,Kt,!1,ze),pt.getNode()}}throw Te(B,"getNodeByIdOrCreate",_e(ve))}},Ke.prototype.wrapAsync=function(ve,we,ze){var rt=this;Se(ze),(0,p.default)(function(){var ft;try{ft=ve.apply(rt,we)}catch(pt){ze(pt);return}ze(null,ft)})},Ke.prototype._toJSON=function(ve,we,ze){var rt;ve===void 0&&(ve=this.root),we===void 0&&(we={});var ft=!0,pt=ve.children;ve.getNode().isFile()&&(pt=(rt={},rt[ve.getName()]=ve.parent.getChild(ve.getName()),rt),ve=ve.parent);for(var xt in pt){ft=!1;var Kt=ve.getChild(xt);if(!Kt)throw new Error("_toJSON: unexpected undefined");var Qt=Kt.getNode();if(Qt.isFile()){var ci=Kt.getPath();ze&&(ci=m(ze,ci)),we[ci]=Qt.getString()}else Qt.isDirectory()&&this._toJSON(Kt,we,ze)}var _n=ve.getPath();return ze&&(_n=m(ze,_n)),_n&&ft&&(we[_n]=null),we},Ke.prototype.toJSON=function(ve,we,ze){we===void 0&&(we={}),ze===void 0&&(ze=!1);var rt=[];if(ve){ve instanceof Array||(ve=[ve]);for(var ft=0,pt=ve;ft<pt.length;ft++){var xt=pt[ft],Kt=_e(xt),Qt=this.getResolvedLink(Kt);Qt&&rt.push(Qt)}}else rt.push(this.root);if(!rt.length)return we;for(var ci=0,_n=rt;ci<_n.length;ci++){var Qt=_n[ci];this._toJSON(Qt,we,ze?Qt.getPath():"")}return we},Ke.prototype.fromJSON=function(ve,we){we===void 0&&(we=b.default.cwd());for(var ze in ve){var rt=ve[ze];if(ze=Ve(ze,we),typeof rt=="string"){var ft=d(ze);this.mkdirpBase(ft,511),this.writeFileSync(ze,rt)}else this.mkdirpBase(ze,511)}},Ke.prototype.fromNestedJSON=function(ve,we){this.fromJSON(qt(ve),we)},Ke.prototype.reset=function(){this.ino=0,this.inodes={},this.releasedInos=[],this.fds={},this.releasedFds=[],this.openFiles=0,this.root=this.createLink(),this.root.setNode(this.createNode(!0))},Ke.prototype.mountSync=function(ve,we){this.fromJSON(we,ve)},Ke.prototype.openLink=function(ve,we,ze){if(ze===void 0&&(ze=!0),this.openFiles>=this.maxFiles)throw Te(le,"open",ve.getPath());var rt=ve;if(ze&&(rt=this.resolveSymlinks(ve)),!rt)throw Te(B,"open",ve.getPath());var ft=rt.getNode();if(ft.isDirectory()){if((we&(L|Y|C))!==L)throw Te(j,"open",ve.getPath())}else if(we&_)throw Te(K,"open",ve.getPath());if(!(we&C)&&!ft.canRead())throw Te(te,"open",ve.getPath());var pt=new this.props.File(ve,ft,we,this.newFdNumber());return this.fds[pt.fd]=pt,this.openFiles++,we&D&&pt.truncate(),pt},Ke.prototype.openFile=function(ve,we,ze,rt){rt===void 0&&(rt=!0);var ft=et(ve),pt=rt?this.getResolvedLink(ft):this.getLink(ft);if(!pt&&we&G){var xt=this.getResolvedLink(ft.slice(0,ft.length-1));if(!xt)throw Te(B,"open",c+ft.join(c));we&G&&typeof ze=="number"&&(pt=this.createLink(xt,ft[ft.length-1],!1,ze))}if(pt)return this.openLink(pt,we,rt);throw Te(B,"open",ve)},Ke.prototype.openBase=function(ve,we,ze,rt){rt===void 0&&(rt=!0);var ft=this.openFile(ve,we,ze,rt);if(!ft)throw Te(B,"open",ve);return ft.fd},Ke.prototype.openSync=function(ve,we,ze){ze===void 0&&(ze=438);var rt=yt(ze),ft=_e(ve),pt=ce(we);return this.openBase(ft,pt,rt)},Ke.prototype.open=function(ve,we,ze,rt){var ft=ze,pt=rt;typeof ze=="function"&&(ft=438,pt=ze),ft=ft||438;var xt=yt(ft),Kt=_e(ve),Qt=ce(we);this.wrapAsync(this.openBase,[Kt,Qt,xt],pt)},Ke.prototype.closeFile=function(ve){this.fds[ve.fd]&&(this.openFiles--,delete this.fds[ve.fd],this.releasedFds.push(ve.fd))},Ke.prototype.closeSync=function(ve){it(ve);var we=this.getFileByFdOrThrow(ve,"close");this.closeFile(we)},Ke.prototype.close=function(ve,we){it(ve),this.wrapAsync(this.closeSync,[ve],we)},Ke.prototype.openFileOrGetById=function(ve,we,ze){if(typeof ve=="number"){var rt=this.fds[ve];if(!rt)throw Te(B);return rt}else return this.openFile(_e(ve),we,ze)},Ke.prototype.readBase=function(ve,we,ze,rt,ft){var pt=this.getFileByFdOrThrow(ve);return pt.read(we,Number(ze),Number(rt),ft)},Ke.prototype.readSync=function(ve,we,ze,rt,ft){return it(ve),this.readBase(ve,we,ze,rt,ft)},Ke.prototype.read=function(ve,we,ze,rt,ft,pt){var xt=this;if(Se(pt),rt===0)return b.default.nextTick(function(){pt&&pt(null,0,we)});(0,p.default)(function(){try{var Kt=xt.readBase(ve,we,ze,rt,ft);pt(null,Kt,we)}catch(Qt){pt(Qt)}})},Ke.prototype.readFileBase=function(ve,we,ze){var rt,ft=typeof ve=="number",pt=ft&&Xe(ve),xt;if(pt)xt=ve;else{var Kt=_e(ve),Qt=et(Kt),ci=this.getResolvedLink(Qt);if(ci){var _n=ci.getNode();if(_n.isDirectory())throw Te(j,"open",ci.getPath())}xt=this.openSync(ve,we)}try{rt=bt(this.getFileByFdOrThrow(xt).getBuffer(),ze)}finally{pt||this.closeSync(xt)}return rt},Ke.prototype.readFileSync=function(ve,we){var ze=T(we),rt=ce(ze.flag);return this.readFileBase(ve,rt,ze.encoding)},Ke.prototype.readFile=function(ve,we,ze){var rt=ut(T)(we,ze),ft=rt[0],pt=rt[1],xt=ce(ft.flag);this.wrapAsync(this.readFileBase,[ve,xt,ft.encoding],pt)},Ke.prototype.writeBase=function(ve,we,ze,rt,ft){var pt=this.getFileByFdOrThrow(ve,"write");return pt.write(we,ze,rt,ft)},Ke.prototype.writeSync=function(ve,we,ze,rt,ft){it(ve);var pt,xt,Kt,Qt,ci=typeof we!="string";ci?(xt=(ze||0)|0,Kt=rt,Qt=ft):(Qt=ze,pt=rt);var _n=nt(we,pt);return ci?typeof Kt>"u"&&(Kt=_n.length):(xt=0,Kt=_n.length),this.writeBase(ve,_n,xt,Kt,Qt)},Ke.prototype.write=function(ve,we,ze,rt,ft,pt){var xt=this;it(ve);var Kt,Qt,ci,_n,Hs,Kw=typeof we,yP=typeof ze,wP=typeof rt,_P=typeof ft;Kw!=="string"?yP==="function"?Hs=ze:wP==="function"?(Kt=ze|0,Hs=rt):_P==="function"?(Kt=ze|0,Qt=rt,Hs=ft):(Kt=ze|0,Qt=rt,ci=ft,Hs=pt):yP==="function"?Hs=ze:wP==="function"?(ci=ze,Hs=rt):_P==="function"&&(ci=ze,_n=rt,Hs=ft);var Tb=nt(we,_n);Kw!=="string"?typeof Qt>"u"&&(Qt=Tb.length):(Kt=0,Qt=Tb.length);var Ww=Se(Hs);(0,p.default)(function(){try{var MP=xt.writeBase(ve,Tb,Kt,Qt,ci);Kw!=="string"?Ww(null,MP,Tb):Ww(null,MP,we)}catch(eue){Ww(eue)}})},Ke.prototype.writeFileBase=function(ve,we,ze,rt){var ft=typeof ve=="number",pt;ft?pt=ve:pt=this.openBase(_e(ve),ze,rt);var xt=0,Kt=we.length,Qt=ze&U?void 0:0;try{for(;Kt>0;){var ci=this.writeSync(pt,we,xt,Kt,Qt);xt+=ci,Kt-=ci,Qt!==void 0&&(Qt+=ci)}}finally{ft||this.closeSync(pt)}},Ke.prototype.writeFileSync=function(ve,we,ze){var rt=O(ze),ft=ce(rt.flag),pt=yt(rt.mode),xt=nt(we,rt.encoding);this.writeFileBase(ve,xt,ft,pt)},Ke.prototype.writeFile=function(ve,we,ze,rt){var ft=ze,pt=rt;typeof ze=="function"&&(ft=I,pt=ze);var xt=Se(pt),Kt=O(ft),Qt=ce(Kt.flag),ci=yt(Kt.mode),_n=nt(we,Kt.encoding);this.wrapAsync(this.writeFileBase,[ve,_n,Qt,ci],xt)},Ke.prototype.linkBase=function(ve,we){var ze=et(ve),rt=this.getLink(ze);if(!rt)throw Te(B,"link",ve,we);var ft=et(we),pt=this.getLinkParent(ft);if(!pt)throw Te(B,"link",ve,we);var xt=ft[ft.length-1];if(pt.getChild(xt))throw Te(Z,"link",ve,we);var Kt=rt.getNode();Kt.nlink++,pt.createChild(xt,Kt)},Ke.prototype.copyFileBase=function(ve,we,ze){var rt=this.readFileSync(ve);if(ze&s&&this.existsSync(we))throw Te(Z,"copyFile",ve,we);if(ze&f)throw Te(X,"copyFile",ve,we);this.writeFileBase(we,rt,oe.w,438)},Ke.prototype.copyFileSync=function(ve,we,ze){var rt=_e(ve),ft=_e(we);return this.copyFileBase(rt,ft,(ze||0)|0)},Ke.prototype.copyFile=function(ve,we,ze,rt){var ft=_e(ve),pt=_e(we),xt,Kt;typeof ze=="function"?(xt=0,Kt=ze):(xt=ze,Kt=rt),Se(Kt),this.wrapAsync(this.copyFileBase,[ft,pt,xt],Kt)},Ke.prototype.linkSync=function(ve,we){var ze=_e(ve),rt=_e(we);this.linkBase(ze,rt)},Ke.prototype.link=function(ve,we,ze){var rt=_e(ve),ft=_e(we);this.wrapAsync(this.linkBase,[rt,ft],ze)},Ke.prototype.unlinkBase=function(ve){var we=et(ve),ze=this.getLink(we);if(!ze)throw Te(B,"unlink",ve);if(ze.length)throw Error("Dir not empty...");this.deleteLink(ze);var rt=ze.getNode();rt.nlink--,rt.nlink<=0&&this.deleteNode(rt)},Ke.prototype.unlinkSync=function(ve){var we=_e(ve);this.unlinkBase(we)},Ke.prototype.unlink=function(ve,we){var ze=_e(ve);this.wrapAsync(this.unlinkBase,[ze],we)},Ke.prototype.symlinkBase=function(ve,we){var ze=et(we),rt=this.getLinkParent(ze);if(!rt)throw Te(B,"symlink",ve,we);var ft=ze[ze.length-1];if(rt.getChild(ft))throw Te(Z,"symlink",ve,we);var pt=rt.createChild(ft);return pt.getNode().makeSymlink(et(ve)),pt},Ke.prototype.symlinkSync=function(ve,we,ze){var rt=_e(ve),ft=_e(we);this.symlinkBase(rt,ft)},Ke.prototype.symlink=function(ve,we,ze,rt){var ft=Se(typeof ze=="function"?ze:rt),pt=_e(ve),xt=_e(we);this.wrapAsync(this.symlinkBase,[pt,xt],ft)},Ke.prototype.realpathBase=function(ve,we){var ze=et(ve),rt=this.getResolvedLink(ze);if(!rt)throw Te(B,"realpath",ve);return(0,E.strToEncoding)(rt.getPath(),we)},Ke.prototype.realpathSync=function(ve,we){return this.realpathBase(_e(ve),st(we).encoding)},Ke.prototype.realpath=function(ve,we,ze){var rt=ue(we,ze),ft=rt[0],pt=rt[1],xt=_e(ve);this.wrapAsync(this.realpathBase,[xt,ft.encoding],pt)},Ke.prototype.lstatBase=function(ve,we){we===void 0&&(we=!1);var ze=this.getLink(et(ve));if(!ze)throw Te(B,"lstat",ve);return i.default.build(ze.getNode(),we)},Ke.prototype.lstatSync=function(ve,we){return this.lstatBase(_e(ve),de(we).bigint)},Ke.prototype.lstat=function(ve,we,ze){var rt=xe(we,ze),ft=rt[0],pt=rt[1];this.wrapAsync(this.lstatBase,[_e(ve),ft.bigint],pt)},Ke.prototype.statBase=function(ve,we){we===void 0&&(we=!1);var ze=this.getResolvedLink(et(ve));if(!ze)throw Te(B,"stat",ve);return i.default.build(ze.getNode(),we)},Ke.prototype.statSync=function(ve,we){return this.statBase(_e(ve),de(we).bigint)},Ke.prototype.stat=function(ve,we,ze){var rt=xe(we,ze),ft=rt[0],pt=rt[1];this.wrapAsync(this.statBase,[_e(ve),ft.bigint],pt)},Ke.prototype.fstatBase=function(ve,we){we===void 0&&(we=!1);var ze=this.getFileByFd(ve);if(!ze)throw Te(F,"fstat");return i.default.build(ze.node,we)},Ke.prototype.fstatSync=function(ve,we){return this.fstatBase(ve,de(we).bigint)},Ke.prototype.fstat=function(ve,we,ze){var rt=xe(we,ze),ft=rt[0],pt=rt[1];this.wrapAsync(this.fstatBase,[ve,ft.bigint],pt)},Ke.prototype.renameBase=function(ve,we){var ze=this.getLink(et(ve));if(!ze)throw Te(B,"rename",ve,we);var rt=et(we),ft=this.getLinkParent(rt);if(!ft)throw Te(B,"rename",ve,we);var pt=ze.parent;pt&&pt.deleteChild(ze);var xt=rt[rt.length-1];ze.steps=e(e([],ft.steps,!0),[xt],!1),ft.setChild(ze.getName(),ze)},Ke.prototype.renameSync=function(ve,we){var ze=_e(ve),rt=_e(we);this.renameBase(ze,rt)},Ke.prototype.rename=function(ve,we,ze){var rt=_e(ve),ft=_e(we);this.wrapAsync(this.renameBase,[rt,ft],ze)},Ke.prototype.existsBase=function(ve){return!!this.statBase(ve)},Ke.prototype.existsSync=function(ve){try{return this.existsBase(_e(ve))}catch{return!1}},Ke.prototype.exists=function(ve,we){var ze=this,rt=_e(ve);if(typeof we!="function")throw Error(R.CB);(0,p.default)(function(){try{we(ze.existsBase(rt))}catch{we(!1)}})},Ke.prototype.accessBase=function(ve,we){this.getLinkOrThrow(ve,"access")},Ke.prototype.accessSync=function(ve,we){we===void 0&&(we=n);var ze=_e(ve);we=we|0,this.accessBase(ze,we)},Ke.prototype.access=function(ve,we,ze){var rt=n,ft;typeof we!="function"?(rt=we|0,ft=Se(ze)):ft=we;var pt=_e(ve);this.wrapAsync(this.accessBase,[pt,rt],ft)},Ke.prototype.appendFileSync=function(ve,we,ze){ze===void 0&&(ze=q);var rt=H(ze);(!rt.flag||Xe(ve))&&(rt.flag="a"),this.writeFileSync(ve,we,rt)},Ke.prototype.appendFile=function(ve,we,ze,rt){var ft=W(ze,rt),pt=ft[0],xt=ft[1];(!pt.flag||Xe(ve))&&(pt.flag="a"),this.writeFile(ve,we,pt,xt)},Ke.prototype.readdirBase=function(ve,we){var ze=et(ve),rt=this.getResolvedLink(ze);if(!rt)throw Te(B,"readdir",ve);var ft=rt.getNode();if(!ft.isDirectory())throw Te(K,"scandir",ve);if(we.withFileTypes){var pt=[];for(var xt in rt.children){var Kt=rt.getChild(xt);Kt&&pt.push(h.default.build(Kt,we.encoding))}return!o&&we.encoding!=="buffer"&&pt.sort(function(_n,Hs){return _n.name<Hs.name?-1:_n.name>Hs.name?1:0}),pt}var Qt=[];for(var ci in rt.children)Qt.push((0,E.strToEncoding)(ci,we.encoding));return!o&&we.encoding!=="buffer"&&Qt.sort(),Qt},Ke.prototype.readdirSync=function(ve,we){var ze=ye(we),rt=_e(ve);return this.readdirBase(rt,ze)},Ke.prototype.readdir=function(ve,we,ze){var rt=Ee(we,ze),ft=rt[0],pt=rt[1],xt=_e(ve);this.wrapAsync(this.readdirBase,[xt,ft],pt)},Ke.prototype.readlinkBase=function(ve,we){var ze=this.getLinkOrThrow(ve,"readlink"),rt=ze.getNode();if(!rt.isSymlink())throw Te($,"readlink",ve);var ft=c+rt.symlink.join(c);return(0,E.strToEncoding)(ft,we)},Ke.prototype.readlinkSync=function(ve,we){var ze=Ge(we),rt=_e(ve);return this.readlinkBase(rt,ze.encoding)},Ke.prototype.readlink=function(ve,we,ze){var rt=lt(we,ze),ft=rt[0],pt=rt[1],xt=_e(ve);this.wrapAsync(this.readlinkBase,[xt,ft.encoding],pt)},Ke.prototype.fsyncBase=function(ve){this.getFileByFdOrThrow(ve,"fsync")},Ke.prototype.fsyncSync=function(ve){this.fsyncBase(ve)},Ke.prototype.fsync=function(ve,we){this.wrapAsync(this.fsyncBase,[ve],we)},Ke.prototype.fdatasyncBase=function(ve){this.getFileByFdOrThrow(ve,"fdatasync")},Ke.prototype.fdatasyncSync=function(ve){this.fdatasyncBase(ve)},Ke.prototype.fdatasync=function(ve,we){this.wrapAsync(this.fdatasyncBase,[ve],we)},Ke.prototype.ftruncateBase=function(ve,we){var ze=this.getFileByFdOrThrow(ve,"ftruncate");ze.truncate(we)},Ke.prototype.ftruncateSync=function(ve,we){this.ftruncateBase(ve,we)},Ke.prototype.ftruncate=function(ve,we,ze){var rt=typeof we=="number"?we:0,ft=Se(typeof we=="number"?ze:we);this.wrapAsync(this.ftruncateBase,[ve,rt],ft)},Ke.prototype.truncateBase=function(ve,we){var ze=this.openSync(ve,"r+");try{this.ftruncateSync(ze,we)}finally{this.closeSync(ze)}},Ke.prototype.truncateSync=function(ve,we){if(Xe(ve))return this.ftruncateSync(ve,we);this.truncateBase(ve,we)},Ke.prototype.truncate=function(ve,we,ze){var rt=typeof we=="number"?we:0,ft=Se(typeof we=="number"?ze:we);if(Xe(ve))return this.ftruncate(ve,rt,ft);this.wrapAsync(this.truncateBase,[ve,rt],ft)},Ke.prototype.futimesBase=function(ve,we,ze){var rt=this.getFileByFdOrThrow(ve,"futimes"),ft=rt.node;ft.atime=new Date(we*1e3),ft.mtime=new Date(ze*1e3)},Ke.prototype.futimesSync=function(ve,we,ze){this.futimesBase(ve,_t(we),_t(ze))},Ke.prototype.futimes=function(ve,we,ze,rt){this.wrapAsync(this.futimesBase,[ve,_t(we),_t(ze)],rt)},Ke.prototype.utimesBase=function(ve,we,ze){var rt=this.openSync(ve,"r+");try{this.futimesBase(rt,we,ze)}finally{this.closeSync(rt)}},Ke.prototype.utimesSync=function(ve,we,ze){this.utimesBase(_e(ve),_t(we),_t(ze))},Ke.prototype.utimes=function(ve,we,ze,rt){this.wrapAsync(this.utimesBase,[_e(ve),_t(we),_t(ze)],rt)},Ke.prototype.mkdirBase=function(ve,we){var ze=et(ve);if(!ze.length)throw Te(Z,"mkdir",ve);var rt=this.getLinkParentAsDirOrThrow(ve,"mkdir"),ft=ze[ze.length-1];if(rt.getChild(ft))throw Te(Z,"mkdir",ve);rt.createChild(ft,this.createNode(!0,we))},Ke.prototype.mkdirpBase=function(ve,we){for(var ze=et(ve),rt=this.root,ft=0;ft<ze.length;ft++){var pt=ze[ft];if(!rt.getNode().isDirectory())throw Te(K,"mkdir",rt.getPath());var xt=rt.getChild(pt);if(xt)if(xt.getNode().isDirectory())rt=xt;else throw Te(K,"mkdir",xt.getPath());else rt=rt.createChild(pt,this.createNode(!0,we))}},Ke.prototype.mkdirSync=function(ve,we){var ze=pe(we),rt=yt(ze.mode,511),ft=_e(ve);ze.recursive?this.mkdirpBase(ft,rt):this.mkdirBase(ft,rt)},Ke.prototype.mkdir=function(ve,we,ze){var rt=pe(we),ft=Se(typeof we=="function"?we:ze),pt=yt(rt.mode,511),xt=_e(ve);rt.recursive?this.wrapAsync(this.mkdirpBase,[xt,pt],ft):this.wrapAsync(this.mkdirBase,[xt,pt],ft)},Ke.prototype.mkdirpSync=function(ve,we){this.mkdirSync(ve,{mode:we,recursive:!0})},Ke.prototype.mkdirp=function(ve,we,ze){var rt=typeof we=="function"?void 0:we,ft=Se(typeof we=="function"?we:ze);this.mkdir(ve,{mode:rt,recursive:!0},ft)},Ke.prototype.mkdtempBase=function(ve,we,ze){ze===void 0&&(ze=5);var rt=ve+this.genRndStr();try{return this.mkdirBase(rt,511),(0,E.strToEncoding)(rt,we)}catch(ft){if(ft.code===Z){if(ze>1)return this.mkdtempBase(ve,we,ze-1);throw Error("Could not create temp dir.")}else throw ft}},Ke.prototype.mkdtempSync=function(ve,we){var ze=Ge(we).encoding;if(!ve||typeof ve!="string")throw new TypeError("filename prefix is required");return Je(ve),this.mkdtempBase(ve,ze)},Ke.prototype.mkdtemp=function(ve,we,ze){var rt=lt(we,ze),ft=rt[0].encoding,pt=rt[1];if(!ve||typeof ve!="string")throw new TypeError("filename prefix is required");Je(ve)&&this.wrapAsync(this.mkdtempBase,[ve,ft],pt)},Ke.prototype.rmdirBase=function(ve,we){var ze=Qe(we),rt=this.getLinkAsDirOrThrow(ve,"rmdir");if(rt.length&&!ze.recursive)throw Te(J,"rmdir",ve);this.deleteLink(rt)},Ke.prototype.rmdirSync=function(ve,we){this.rmdirBase(_e(ve),we)},Ke.prototype.rmdir=function(ve,we,ze){var rt=Qe(we),ft=Se(typeof we=="function"?we:ze);this.wrapAsync(this.rmdirBase,[_e(ve),rt],ft)},Ke.prototype.fchmodBase=function(ve,we){var ze=this.getFileByFdOrThrow(ve,"fchmod");ze.chmod(we)},Ke.prototype.fchmodSync=function(ve,we){this.fchmodBase(ve,yt(we))},Ke.prototype.fchmod=function(ve,we,ze){this.wrapAsync(this.fchmodBase,[ve,yt(we)],ze)},Ke.prototype.chmodBase=function(ve,we){var ze=this.openSync(ve,"r+");try{this.fchmodBase(ze,we)}finally{this.closeSync(ze)}},Ke.prototype.chmodSync=function(ve,we){var ze=yt(we),rt=_e(ve);this.chmodBase(rt,ze)},Ke.prototype.chmod=function(ve,we,ze){var rt=yt(we),ft=_e(ve);this.wrapAsync(this.chmodBase,[ft,rt],ze)},Ke.prototype.lchmodBase=function(ve,we){var ze=this.openBase(ve,Y,0,!1);try{this.fchmodBase(ze,we)}finally{this.closeSync(ze)}},Ke.prototype.lchmodSync=function(ve,we){var ze=yt(we),rt=_e(ve);this.lchmodBase(rt,ze)},Ke.prototype.lchmod=function(ve,we,ze){var rt=yt(we),ft=_e(ve);this.wrapAsync(this.lchmodBase,[ft,rt],ze)},Ke.prototype.fchownBase=function(ve,we,ze){this.getFileByFdOrThrow(ve,"fchown").chown(we,ze)},Ke.prototype.fchownSync=function(ve,we,ze){dt(we),Mt(ze),this.fchownBase(ve,we,ze)},Ke.prototype.fchown=function(ve,we,ze,rt){dt(we),Mt(ze),this.wrapAsync(this.fchownBase,[ve,we,ze],rt)},Ke.prototype.chownBase=function(ve,we,ze){var rt=this.getResolvedLinkOrThrow(ve,"chown"),ft=rt.getNode();ft.chown(we,ze)},Ke.prototype.chownSync=function(ve,we,ze){dt(we),Mt(ze),this.chownBase(_e(ve),we,ze)},Ke.prototype.chown=function(ve,we,ze,rt){dt(we),Mt(ze),this.wrapAsync(this.chownBase,[_e(ve),we,ze],rt)},Ke.prototype.lchownBase=function(ve,we,ze){this.getLinkOrThrow(ve,"lchown").getNode().chown(we,ze)},Ke.prototype.lchownSync=function(ve,we,ze){dt(we),Mt(ze),this.lchownBase(_e(ve),we,ze)},Ke.prototype.lchown=function(ve,we,ze,rt){dt(we),Mt(ze),this.wrapAsync(this.lchownBase,[_e(ve),we,ze],rt)},Ke.prototype.watchFile=function(ve,we,ze){var rt=_e(ve),ft=we,pt=ze;if(typeof ft=="function"&&(pt=we,ft=null),typeof pt!="function")throw Error('"watchFile()" requires a listener function');var xt=5007,Kt=!0;ft&&typeof ft=="object"&&(typeof ft.interval=="number"&&(xt=ft.interval),typeof ft.persistent=="boolean"&&(Kt=ft.persistent));var Qt=this.statWatchers[rt];return Qt||(Qt=new this.StatWatcher,Qt.start(rt,Kt,xt),this.statWatchers[rt]=Qt),Qt.addListener("change",pt),Qt},Ke.prototype.unwatchFile=function(ve,we){var ze=_e(ve),rt=this.statWatchers[ze];rt&&(typeof we=="function"?rt.removeListener("change",we):rt.removeAllListeners("change"),rt.listenerCount("change")===0&&(rt.stop(),delete this.statWatchers[ze]))},Ke.prototype.createReadStream=function(ve,we){return new this.ReadStream(ve,we)},Ke.prototype.createWriteStream=function(ve,we){return new this.WriteStream(ve,we)},Ke.prototype.watch=function(ve,we,ze){var rt=_e(ve),ft=we;typeof we=="function"&&(ze=we,ft=null);var pt=Ge(ft),xt=pt.persistent,Kt=pt.recursive,Qt=pt.encoding;xt===void 0&&(xt=!0),Kt===void 0&&(Kt=!1);var ci=new this.FSWatcher;return ci.start(rt,xt,Kt,Qt),ze&&ci.addListener("change",ze),ci},Ke.fd=2147483647,Ke}();ui.Volume=Ut;function Ft(Ke){Ke.emit("stop")}var $t=function(Ke){t(ve,Ke);function ve(we){var ze=Ke.call(this)||this;return ze.onInterval=function(){try{var rt=ze.vol.statSync(ze.filename);ze.hasChanged(rt)&&(ze.emit("change",rt,ze.prev),ze.prev=rt)}finally{ze.loop()}},ze.vol=we,ze}return ve.prototype.loop=function(){this.timeoutRef=this.setTimeout(this.onInterval,this.interval)},ve.prototype.hasChanged=function(we){return we.mtimeMs>this.prev.mtimeMs||we.nlink!==this.prev.nlink},ve.prototype.start=function(we,ze,rt){ze===void 0&&(ze=!0),rt===void 0&&(rt=5007),this.filename=_e(we),this.setTimeout=ze?setTimeout.bind(typeof globalThis<"u"?globalThis:nxe):g.default,this.interval=rt,this.prev=this.vol.statSync(this.filename),this.loop()},ve.prototype.stop=function(){clearTimeout(this.timeoutRef),b.default.nextTick(Ft,this)},ve}(x.EventEmitter);ui.StatWatcher=$t;var Tt;function Zt(Ke){Tt=(0,l.bufferAllocUnsafe)(Ke),Tt.used=0}k.inherits(Lt,y.Readable),ui.ReadStream=Lt;function Lt(Ke,ve,we){if(!(this instanceof Lt))return new Lt(Ke,ve,we);if(this._vol=Ke,we=Object.assign({},ot(we,{})),we.highWaterMark===void 0&&(we.highWaterMark=64*1024),y.Readable.call(this,we),this.path=_e(ve),this.fd=we.fd===void 0?null:we.fd,this.flags=we.flags===void 0?"r":we.flags,this.mode=we.mode===void 0?438:we.mode,this.start=we.start,this.end=we.end,this.autoClose=we.autoClose===void 0?!0:we.autoClose,this.pos=void 0,this.bytesRead=0,this.start!==void 0){if(typeof this.start!="number")throw new TypeError('"start" option must be a Number');if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw new TypeError('"end" option must be a Number');if(this.start>this.end)throw new Error('"start" option must be <= "end" option');this.pos=this.start}typeof this.fd!="number"&&this.open(),this.on("end",function(){this.autoClose&&this.destroy&&this.destroy()})}Lt.prototype.open=function(){var Ke=this;this._vol.open(this.path,this.flags,this.mode,function(ve,we){if(ve){Ke.autoClose&&Ke.destroy&&Ke.destroy(),Ke.emit("error",ve);return}Ke.fd=we,Ke.emit("open",we),Ke.read()})},Lt.prototype._read=function(Ke){if(typeof this.fd!="number")return this.once("open",function(){this._read(Ke)});if(this.destroyed)return;(!Tt||Tt.length-Tt.used<v)&&Zt(this._readableState.highWaterMark);var ve=Tt,we=Math.min(Tt.length-Tt.used,Ke),ze=Tt.used;if(this.pos!==void 0&&(we=Math.min(this.end-this.pos+1,we)),we<=0)return this.push(null);var rt=this;this._vol.read(this.fd,Tt,Tt.used,we,this.pos,ft),this.pos!==void 0&&(this.pos+=we),Tt.used+=we;function ft(pt,xt){if(pt)rt.autoClose&&rt.destroy&&rt.destroy(),rt.emit("error",pt);else{var Kt=null;xt>0&&(rt.bytesRead+=xt,Kt=ve.slice(ze,ze+xt)),rt.push(Kt)}}},Lt.prototype._destroy=function(Ke,ve){this.close(function(we){ve(Ke||we)})},Lt.prototype.close=function(Ke){var ve=this;if(Ke&&this.once("close",Ke),this.closed||typeof this.fd!="number"){if(typeof this.fd!="number"){this.once("open",Ht);return}return b.default.nextTick(function(){return ve.emit("close")})}this.closed=!0,this._vol.close(this.fd,function(we){we?ve.emit("error",we):ve.emit("close")}),this.fd=null};function Ht(Ke){this.close()}k.inherits(Nt,y.Writable),ui.WriteStream=Nt;function Nt(Ke,ve,we){if(!(this instanceof Nt))return new Nt(Ke,ve,we);if(this._vol=Ke,we=Object.assign({},ot(we,{})),y.Writable.call(this,we),this.path=_e(ve),this.fd=we.fd===void 0?null:we.fd,this.flags=we.flags===void 0?"w":we.flags,this.mode=we.mode===void 0?438:we.mode,this.start=we.start,this.autoClose=we.autoClose===void 0?!0:!!we.autoClose,this.pos=void 0,this.bytesWritten=0,this.start!==void 0){if(typeof this.start!="number")throw new TypeError('"start" option must be a Number');if(this.start<0)throw new Error('"start" must be >= zero');this.pos=this.start}we.encoding&&this.setDefaultEncoding(we.encoding),typeof this.fd!="number"&&this.open(),this.once("finish",function(){this.autoClose&&this.close()})}Nt.prototype.open=function(){this._vol.open(this.path,this.flags,this.mode,function(Ke,ve){if(Ke){this.autoClose&&this.destroy&&this.destroy(),this.emit("error",Ke);return}this.fd=ve,this.emit("open",ve)}.bind(this))},Nt.prototype._write=function(Ke,ve,we){if(!(Ke instanceof l.Buffer))return this.emit("error",new Error("Invalid data"));if(typeof this.fd!="number")return this.once("open",function(){this._write(Ke,ve,we)});var ze=this;this._vol.write(this.fd,Ke,0,Ke.length,this.pos,function(rt,ft){if(rt)return ze.autoClose&&ze.destroy&&ze.destroy(),we(rt);ze.bytesWritten+=ft,we()}),this.pos!==void 0&&(this.pos+=Ke.length)},Nt.prototype._writev=function(Ke,ve){if(typeof this.fd!="number")return this.once("open",function(){this._writev(Ke,ve)});for(var we=this,ze=Ke.length,rt=new Array(ze),ft=0,pt=0;pt<ze;pt++){var xt=Ke[pt].chunk;rt[pt]=xt,ft+=xt.length}var Kt=l.Buffer.concat(rt);this._vol.write(this.fd,Kt,0,Kt.length,this.pos,function(Qt,ci){if(Qt)return we.destroy&&we.destroy(),ve(Qt);we.bytesWritten+=ci,ve()}),this.pos!==void 0&&(this.pos+=ft)},Nt.prototype._destroy=Lt.prototype._destroy,Nt.prototype.close=Lt.prototype.close,Nt.prototype.destroySoon=Nt.prototype.end;var zt=function(Ke){t(ve,Ke);function ve(we){var ze=Ke.call(this)||this;return ze._filename="",ze._filenameEncoded="",ze._recursive=!1,ze._encoding=E.ENCODING_UTF8,ze._onNodeChange=function(){ze._emit("change")},ze._onParentChild=function(rt){rt.getName()===ze._getName()&&ze._emit("rename")},ze._emit=function(rt){ze.emit("change",rt,ze._filenameEncoded)},ze._persist=function(){ze._timer=setTimeout(ze._persist,1e6)},ze._vol=we,ze}return ve.prototype._getName=function(){return this._steps[this._steps.length-1]},ve.prototype.start=function(we,ze,rt,ft){ze===void 0&&(ze=!0),rt===void 0&&(rt=!1),ft===void 0&&(ft=E.ENCODING_UTF8),this._filename=_e(we),this._steps=et(this._filename),this._filenameEncoded=(0,E.strToEncoding)(this._filename),this._recursive=rt,this._encoding=ft;try{this._link=this._vol.getLinkOrThrow(this._filename,"FSWatcher")}catch(Kt){var pt=new Error("watch "+this._filename+" "+Kt.code);throw pt.code=Kt.code,pt.errno=Kt.code,pt}this._link.getNode().on("change",this._onNodeChange),this._link.on("child:add",this._onNodeChange),this._link.on("child:delete",this._onNodeChange);var xt=this._link.parent;xt&&(xt.setMaxListeners(xt.getMaxListeners()+1),xt.on("child:delete",this._onParentChild)),ze&&this._persist()},ve.prototype.close=function(){clearTimeout(this._timer),this._link.getNode().removeListener("change",this._onNodeChange);var we=this._link.parent;we&&we.removeListener("child:delete",this._onParentChild)},ve}(x.EventEmitter);return ui.FSWatcher=zt,ui}function axe(){if($re)return qh;$re=!0,Object.defineProperty(qh,"__esModule",{value:!0}),qh.fsAsyncMethods=qh.fsSyncMethods=qh.fsProps=void 0;var t=["constants","F_OK","R_OK","W_OK","X_OK","Stats"];qh.fsProps=t;var e=["renameSync","ftruncateSync","truncateSync","chownSync","fchownSync","lchownSync","chmodSync","fchmodSync","lchmodSync","statSync","lstatSync","fstatSync","linkSync","symlinkSync","readlinkSync","realpathSync","unlinkSync","rmdirSync","mkdirSync","mkdirpSync","readdirSync","closeSync","openSync","utimesSync","futimesSync","fsyncSync","writeSync","readSync","readFileSync","writeFileSync","appendFileSync","existsSync","accessSync","fdatasyncSync","mkdtempSync","copyFileSync","createReadStream","createWriteStream"];qh.fsSyncMethods=e;var r=["rename","ftruncate","truncate","chown","fchown","lchown","chmod","fchmod","lchmod","stat","lstat","fstat","link","symlink","readlink","realpath","unlink","rmdir","mkdir","mkdirp","readdir","close","open","utimes","futimes","fsync","write","read","readFile","writeFile","appendFile","exists","access","fdatasync","mkdtemp","copyFile","watchFile","unwatchFile","watch"];return qh.fsAsyncMethods=r,qh}function oxe(){if(qre)return ia;qre=!0;var t=ia&&ia.__assign||function(){return t=Object.assign||function(E){for(var A,k=1,P=arguments.length;k<P;k++){A=arguments[k];for(var N in A)Object.prototype.hasOwnProperty.call(A,N)&&(E[N]=A[N])}return E},t.apply(this,arguments)};Object.defineProperty(ia,"__esModule",{value:!0}),ia.fs=ia.createFsFromVolume=ia.vol=ia.Volume=void 0;var e=Ik(),r=jre(),a=Hre(),i=axe(),h=i.fsSyncMethods,l=i.fsAsyncMethods,p=i2(),b=p.constants.F_OK,g=p.constants.R_OK,y=p.constants.W_OK,M=p.constants.X_OK;ia.Volume=a.Volume,ia.vol=new a.Volume;function x(E){for(var A={F_OK:b,R_OK:g,W_OK:y,X_OK:M,constants:p.constants,Stats:e.default,Dirent:r.default},k=0,P=h;k<P.length;k++){var N=P[k];typeof E[N]=="function"&&(A[N]=E[N].bind(E))}for(var L=0,C=l;L<C.length;L++){var N=C[L];typeof E[N]=="function"&&(A[N]=E[N].bind(E))}return A.StatWatcher=E.StatWatcher,A.FSWatcher=E.FSWatcher,A.WriteStream=E.WriteStream,A.ReadStream=E.ReadStream,A.promises=E.promises,A._toUnixTimestamp=a.toUnixTimestamp,A}return ia.createFsFromVolume=x,ia.fs=x(ia.vol),ia=t(t({},ia),ia.fs),ia.semantic=!0,ia}function No(t){throw new Error(`Node.js fs ${t} is not supported by JSPM core in the browser`)}function Kre(t,e,r){let a=0,i=new TextDecoder;Uh.watch(t,"utf8",()=>{let{size:h}=Uh.fstatSync(e),l=Me.alloc(h-a);Uh.readSync(e,l,0,l.length,a),a=h,r(i.decode(l,{stream:!0}))})}function Pk(t,e){if(t.protocol==="file:")return kk(t);if(t.protocol==="https:"||t.protocol==="http:"){let r="\\\\url\\"+t.href.replaceAll(/\//g,"\\\\");if(Wre(r))return r;if(e)throw new Error(`Cannot sync request URL ${t} via FS. JSPM FS support for network URLs requires using async FS methods or priming the MemFS cache first with an async request before a sync request.`);return(async()=>{let a=await fetch(t);if(!a.ok)throw new Error(`Unable to fetch ${t.href}, ${a.status}`);let i=await a.arrayBuffer();return Vre(r,Me.from(i)),r})()}throw new Error("URL "+t+" not supported in JSPM FS implementation.")}function fxe(t){return function(e,...r){return e instanceof URL?t(Pk(e,!0),...r):t(e,...r)}}function uxe(t){return async function(e,...r){return e instanceof URL?t(await Pk(e),...r):t(e,...r)}}function hxe(t){return function(e,...r){let a=r[r.length-1];e instanceof URL&&typeof a=="function"?Pk(e).then(i=>{t(i,...r)},a):t(e,...r)}}var t2,xre,u4,Sre,D1,Ere,Pf,Are,Un,Rre,XMe,$u,Tre,$1,kre,h4,Ire,Bre,q1,Pre,so,Ore,l4,Nre,exe,gc,Cre,r2,Lre,ui,Dre,nxe,qh,$re,ia,qre,kd,Ua,Uh,sxe,Gi,lxe,cxe,dxe,pxe,vxe,mxe,gxe,bxe,yxe,wxe,_xe,Mxe,xxe,Sxe,Exe,Axe,Rxe,Wre,Txe,kxe,Ixe,Bxe,Pxe,Oxe,Nxe,Cxe,Lxe,Dxe,$xe,qxe,Uxe,Fxe,jxe,zxe,Zxe,Hxe,Kxe,Wxe,Vxe,Gxe,Yxe,Jxe,Xxe,Qxe,eSe,tSe,rSe,iSe,nSe,aSe,oSe,sSe,fSe,uSe,hSe,lSe,cSe,dSe,pSe,vSe,mSe,gSe,bSe,ySe,wSe,_Se,MSe,xSe,SSe,ESe,ASe,RSe,TSe,kSe,ISe,BSe,PSe,OSe,NSe,CSe,Vre,LSe,DSe,$Se,qSe,USe,FSe,jSe,zSe,ZSe,HSe,KSe,WSe,VSe,GSe,YSe,JSe,XSe,QSe,Nk=Si(()=>{"use strict";ie();ae();ne();oh();yk();no();jo();_k();Ws();Z0();Ks();I8();f4();Rd();Rg();lo();rh();Uo();Yf();Jg();Qg();t2={},xre=!1;u4={},Sre=!1;D1={},Ere=!1;Pf={},Are=!1;Un={},Rre=!1,XMe=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;$u={},Tre=!1;$1={},kre=!1;h4={},Ire=!1,Bre=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;q1={},Pre=!1;so={},Ore=!1;l4={},Nre=!1,exe=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;gc={},Cre=!1;r2={},Lre=!1;ui={},Dre=!1,nxe=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;qh={},$re=!1;ia={},qre=!1;kd=oxe();kd.__esModule;kd.fs;kd.createFsFromVolume;kd.vol;kd.Volume;kd.semantic;Ua=Hre();Ua.__esModule;Ua.FSWatcher;Ua.StatWatcher;Ua.Volume;Ua.toUnixTimestamp;Ua.bufferToEncoding;Ua.dataToBuffer;Ua.dataToStr;Ua.pathToSteps;Ua.filenameToSteps;Ua.pathToFilename;Ua.flagsToNumber;Ua.FLAGS;Ua.ReadStream;Ua.WriteStream;({vol:Uh,createFsFromVolume:sxe}=kd);Uh.fromNestedJSON({"/dev":{stdin:"",stdout:"",stderr:""},"/usr/bin":{},"/home":{},"/tmp":{}});Uh.releasedFds=[2,1,0];Uh.openSync("/dev/stdin","w");Uh.openSync("/dev/stdout","r");Uh.openSync("/dev/stderr","r");Kre("/dev/stdout",1,console.log);Kre("/dev/stderr",2,console.error);Gi=sxe(Uh);Gi.opendir=()=>No("opendir");Gi.opendirSync=()=>No("opendirSync");Gi.promises.opendir=()=>No("promises.opendir");Gi.cp=()=>No("cp");Gi.cpSync=()=>No("cpSync");Gi.promises.cp=()=>No("promises.cp");Gi.readv=()=>No("readv");Gi.readvSync=()=>No("readvSync");Gi.rm=()=>No("rm");Gi.rmSync=()=>No("rmSync");Gi.promises.rm=()=>No("promises.rm");Gi.Dir=()=>No("Dir");Gi.promises.watch=()=>No("promises.watch");Gi.FileReadStream=Gi.ReadStream;Gi.FileWriteStream=Gi.WriteStream;Gi.promises.readFile=uxe(Gi.promises.readFile);Gi.readFile=hxe(Gi.readFile);Gi.readFileSync=fxe(Gi.readFileSync);({appendFile:lxe,appendFileSync:cxe,access:dxe,accessSync:pxe,chown:vxe,chownSync:mxe,chmod:gxe,chmodSync:bxe,close:yxe,closeSync:wxe,copyFile:_xe,copyFileSync:Mxe,cp:xxe,cpSync:Sxe,createReadStream:Exe,createWriteStream:Axe,exists:Rxe,existsSync:Wre,fchown:Txe,fchownSync:kxe,fchmod:Ixe,fchmodSync:Bxe,fdatasync:Pxe,fdatasyncSync:Oxe,fstat:Nxe,fstatSync:Cxe,fsync:Lxe,fsyncSync:Dxe,ftruncate:$xe,ftruncateSync:qxe,futimes:Uxe,futimesSync:Fxe,lchown:jxe,lchownSync:zxe,lchmod:Zxe,lchmodSync:Hxe,link:Kxe,linkSync:Wxe,lstat:Vxe,lstatSync:Gxe,mkdir:Yxe,mkdirSync:Jxe,mkdtemp:Xxe,mkdtempSync:Qxe,open:eSe,openSync:tSe,opendir:rSe,opendirSync:iSe,readdir:nSe,readdirSync:aSe,read:oSe,readSync:sSe,readv:fSe,readvSync:uSe,readFile:hSe,readFileSync:lSe,readlink:cSe,readlinkSync:dSe,realpath:pSe,realpathSync:vSe,rename:mSe,renameSync:gSe,rm:bSe,rmSync:ySe,rmdir:wSe,rmdirSync:_Se,stat:MSe,statSync:xSe,symlink:SSe,symlinkSync:ESe,truncate:ASe,truncateSync:RSe,unwatchFile:TSe,unlink:kSe,unlinkSync:ISe,utimes:BSe,utimesSync:PSe,watch:OSe,watchFile:NSe,writeFile:CSe,writeFileSync:Vre,write:LSe,writeSync:DSe,writev:$Se,writevSync:qSe,Dir:USe,Dirent:FSe,Stats:jSe,ReadStream:zSe,WriteStream:ZSe,FileReadStream:HSe,FileWriteStream:KSe,_toUnixTimestamp:WSe,constants:{F_OK:VSe,R_OK:GSe,W_OK:YSe,X_OK:JSe},constants:XSe,promises:QSe}=Gi)});var d4=ht((c4,Gre)=>{"use strict";ie();ae();ne();Object.defineProperty(c4,"__esModule",{value:!0});c4.default=eEe;function eEe(t){return t&&typeof t.length=="number"&&t.length>=0&&t.length%1===0}Gre.exports=c4.default});var Jre=ht((p4,Yre)=>{"use strict";ie();ae();ne();Object.defineProperty(p4,"__esModule",{value:!0});p4.default=function(t){return function(...e){var r=e.pop();return t.call(this,e,r)}};Yre.exports=p4.default});var eie=ht(bc=>{"use strict";ie();ae();ne();Object.defineProperty(bc,"__esModule",{value:!0});bc.fallback=Xre;bc.wrap=Qre;var tEe=bc.hasQueueMicrotask=typeof queueMicrotask=="function"&&queueMicrotask,rEe=bc.hasSetImmediate=typeof setImmediate=="function"&&setImmediate,iEe=bc.hasNextTick=typeof He=="object"&&typeof He.nextTick=="function";function Xre(t){setTimeout(t,0)}function Qre(t){return(e,...r)=>t(()=>e(...r))}var n2;tEe?n2=queueMicrotask:rEe?n2=setImmediate:iEe?n2=He.nextTick:n2=Xre;bc.default=Qre(n2)});var aie=ht((v4,nie)=>{"use strict";ie();ae();ne();Object.defineProperty(v4,"__esModule",{value:!0});v4.default=uEe;var nEe=Jre(),aEe=iie(nEe),oEe=eie(),sEe=iie(oEe),fEe=Id();function iie(t){return t&&t.__esModule?t:{default:t}}function uEe(t){return(0,fEe.isAsync)(t)?function(...e){let r=e.pop(),a=t.apply(this,e);return tie(a,r)}:(0,aEe.default)(function(e,r){var a;try{a=t.apply(this,e)}catch(i){return r(i)}if(a&&typeof a.then=="function")return tie(a,r);r(null,a)})}function tie(t,e){return t.then(r=>{rie(e,null,r)},r=>{rie(e,r&&(r instanceof Error||r.message)?r:new Error(r))})}function rie(t,e,r){try{t(e,r)}catch(a){(0,sEe.default)(i=>{throw i},a)}}nie.exports=v4.default});var Id=ht(Fh=>{"use strict";ie();ae();ne();Object.defineProperty(Fh,"__esModule",{value:!0});Fh.isAsyncIterable=Fh.isAsyncGenerator=Fh.isAsync=void 0;var hEe=aie(),lEe=cEe(hEe);function cEe(t){return t&&t.__esModule?t:{default:t}}function oie(t){return t[Symbol.toStringTag]==="AsyncFunction"}function dEe(t){return t[Symbol.toStringTag]==="AsyncGenerator"}function pEe(t){return typeof t[Symbol.asyncIterator]=="function"}function vEe(t){if(typeof t!="function")throw new Error("expected a function");return oie(t)?(0,lEe.default)(t):t}Fh.default=vEe;Fh.isAsync=oie;Fh.isAsyncGenerator=dEe;Fh.isAsyncIterable=pEe});var U1=ht((m4,sie)=>{"use strict";ie();ae();ne();Object.defineProperty(m4,"__esModule",{value:!0});m4.default=mEe;function mEe(t,e){if(e||(e=t.length),!e)throw new Error("arity is undefined");function r(...a){return typeof a[e-1]=="function"?t.apply(this,a):new Promise((i,h)=>{a[e-1]=(l,...p)=>{if(l)return h(l);i(p.length>1?p:p[0])},t.apply(this,a)})}return r}sie.exports=m4.default});var uie=ht((g4,fie)=>{"use strict";ie();ae();ne();Object.defineProperty(g4,"__esModule",{value:!0});var gEe=d4(),bEe=Ck(gEe),yEe=Id(),wEe=Ck(yEe),_Ee=U1(),MEe=Ck(_Ee);function Ck(t){return t&&t.__esModule?t:{default:t}}g4.default=(0,MEe.default)((t,e,r)=>{var a=(0,bEe.default)(e)?[]:{};t(e,(i,h,l)=>{(0,wEe.default)(i)((p,...b)=>{b.length<2&&([b]=b),a[h]=b,l(p)})},i=>r(i,a))},3);fie.exports=g4.default});var Lk=ht((b4,hie)=>{"use strict";ie();ae();ne();Object.defineProperty(b4,"__esModule",{value:!0});b4.default=xEe;function xEe(t){function e(...r){if(t!==null){var a=t;t=null,a.apply(this,r)}}return Object.assign(e,t),e}hie.exports=b4.default});var cie=ht((y4,lie)=>{"use strict";ie();ae();ne();Object.defineProperty(y4,"__esModule",{value:!0});y4.default=function(t){return t[Symbol.iterator]&&t[Symbol.iterator]()};lie.exports=y4.default});var vie=ht((w4,pie)=>{"use strict";ie();ae();ne();Object.defineProperty(w4,"__esModule",{value:!0});w4.default=BEe;var SEe=d4(),EEe=die(SEe),AEe=cie(),REe=die(AEe);function die(t){return t&&t.__esModule?t:{default:t}}function TEe(t){var e=-1,r=t.length;return function(){return++e<r?{value:t[e],key:e}:null}}function kEe(t){var e=-1;return function(){var a=t.next();return a.done?null:(e++,{value:a.value,key:e})}}function IEe(t){var e=t?Object.keys(t):[],r=-1,a=e.length;return function i(){var h=e[++r];return h==="__proto__"?i():r<a?{value:t[h],key:h}:null}}function BEe(t){if((0,EEe.default)(t))return TEe(t);var e=(0,REe.default)(t);return e?kEe(e):IEe(t)}pie.exports=w4.default});var Dk=ht((_4,mie)=>{"use strict";ie();ae();ne();Object.defineProperty(_4,"__esModule",{value:!0});_4.default=PEe;function PEe(t){return function(...e){if(t===null)throw new Error("Callback was already called.");var r=t;t=null,r.apply(this,e)}}mie.exports=_4.default});var x4=ht((M4,gie)=>{"use strict";ie();ae();ne();Object.defineProperty(M4,"__esModule",{value:!0});var OEe={};M4.default=OEe;gie.exports=M4.default});var yie=ht((S4,bie)=>{"use strict";ie();ae();ne();Object.defineProperty(S4,"__esModule",{value:!0});S4.default=DEe;var NEe=x4(),CEe=LEe(NEe);function LEe(t){return t&&t.__esModule?t:{default:t}}function DEe(t,e,r,a){let i=!1,h=!1,l=!1,p=0,b=0;function g(){p>=e||l||i||(l=!0,t.next().then(({value:x,done:E})=>{if(!(h||i)){if(l=!1,E){i=!0,p<=0&&a(null);return}p++,r(x,b,y),b++,g()}}).catch(M))}function y(x,E){if(p-=1,!h){if(x)return M(x);if(x===!1){i=!0,h=!0;return}if(E===CEe.default||i&&p<=0)return i=!0,a(null);g()}}function M(x){h||(l=!1,i=!0,a(x))}g()}bie.exports=S4.default});var xie=ht((E4,Mie)=>{"use strict";ie();ae();ne();Object.defineProperty(E4,"__esModule",{value:!0});var $Ee=Lk(),qEe=a2($Ee),UEe=vie(),FEe=a2(UEe),jEe=Dk(),zEe=a2(jEe),wie=Id(),ZEe=yie(),_ie=a2(ZEe),HEe=x4(),KEe=a2(HEe);function a2(t){return t&&t.__esModule?t:{default:t}}E4.default=t=>(e,r,a)=>{if(a=(0,qEe.default)(a),t<=0)throw new RangeError("concurrency limit cannot be less than 1");if(!e)return a(null);if((0,wie.isAsyncGenerator)(e))return(0,_ie.default)(e,t,r,a);if((0,wie.isAsyncIterable)(e))return(0,_ie.default)(e[Symbol.asyncIterator](),t,r,a);var i=(0,FEe.default)(e),h=!1,l=!1,p=0,b=!1;function g(M,x){if(!l)if(p-=1,M)h=!0,a(M);else if(M===!1)h=!0,l=!0;else{if(x===KEe.default||h&&p<=0)return h=!0,a(null);b||y()}}function y(){for(b=!0;p<t&&!h;){var M=i();if(M===null){h=!0,p<=0&&a(null);return}p+=1,r(M.value,M.key,(0,zEe.default)(g))}b=!1}y()};Mie.exports=E4.default});var qk=ht((A4,Sie)=>{"use strict";ie();ae();ne();Object.defineProperty(A4,"__esModule",{value:!0});var WEe=xie(),VEe=$k(WEe),GEe=Id(),YEe=$k(GEe),JEe=U1(),XEe=$k(JEe);function $k(t){return t&&t.__esModule?t:{default:t}}function QEe(t,e,r,a){return(0,VEe.default)(e)(t,(0,YEe.default)(r),a)}A4.default=(0,XEe.default)(QEe,4);Sie.exports=A4.default});var Rie=ht((R4,Aie)=>{"use strict";ie();ae();ne();Object.defineProperty(R4,"__esModule",{value:!0});var eAe=qk(),tAe=Eie(eAe),rAe=U1(),iAe=Eie(rAe);function Eie(t){return t&&t.__esModule?t:{default:t}}function nAe(t,e,r){return(0,tAe.default)(t,1,e,r)}R4.default=(0,iAe.default)(nAe,3);Aie.exports=R4.default});var Iie=ht((T4,kie)=>{"use strict";ie();ae();ne();Object.defineProperty(T4,"__esModule",{value:!0});T4.default=uAe;var aAe=uie(),oAe=Tie(aAe),sAe=Rie(),fAe=Tie(sAe);function Tie(t){return t&&t.__esModule?t:{default:t}}function uAe(t,e){return(0,oAe.default)(fAe.default,t,e)}kie.exports=T4.default});var Kie={};Ha(Kie,{Deflate:()=>wAe,DeflateRaw:()=>_Ae,Gunzip:()=>MAe,Gzip:()=>xAe,Inflate:()=>SAe,InflateRaw:()=>EAe,Unzip:()=>AAe,Z_BEST_COMPRESSION:()=>RAe,Z_BEST_SPEED:()=>TAe,Z_BINARY:()=>kAe,Z_BLOCK:()=>IAe,Z_BUF_ERROR:()=>BAe,Z_DATA_ERROR:()=>PAe,Z_DEFAULT_CHUNK:()=>OAe,Z_DEFAULT_COMPRESSION:()=>NAe,Z_DEFAULT_LEVEL:()=>CAe,Z_DEFAULT_MEMLEVEL:()=>LAe,Z_DEFAULT_STRATEGY:()=>DAe,Z_DEFAULT_WINDOWBITS:()=>$Ae,Z_DEFLATED:()=>qAe,Z_ERRNO:()=>UAe,Z_FILTERED:()=>FAe,Z_FINISH:()=>jAe,Z_FIXED:()=>zAe,Z_FULL_FLUSH:()=>ZAe,Z_HUFFMAN_ONLY:()=>HAe,Z_MAX_CHUNK:()=>KAe,Z_MAX_LEVEL:()=>WAe,Z_MAX_MEMLEVEL:()=>VAe,Z_MAX_WINDOWBITS:()=>GAe,Z_MIN_CHUNK:()=>YAe,Z_MIN_LEVEL:()=>JAe,Z_MIN_MEMLEVEL:()=>XAe,Z_MIN_WINDOWBITS:()=>QAe,Z_NEED_DICT:()=>eRe,Z_NO_COMPRESSION:()=>tRe,Z_NO_FLUSH:()=>rRe,Z_OK:()=>iRe,Z_PARTIAL_FLUSH:()=>nRe,Z_RLE:()=>aRe,Z_STREAM_END:()=>oRe,Z_STREAM_ERROR:()=>sRe,Z_SYNC_FLUSH:()=>fRe,Z_TEXT:()=>uRe,Z_TREES:()=>hRe,Z_UNKNOWN:()=>lRe,Zlib:()=>cRe,codes:()=>dRe,createDeflate:()=>pRe,createDeflateRaw:()=>vRe,createGunzip:()=>mRe,createGzip:()=>gRe,createInflate:()=>bRe,createInflateRaw:()=>yRe,createUnzip:()=>wRe,default:()=>At,deflate:()=>_Re,deflateRaw:()=>MRe,deflateRawSync:()=>xRe,deflateSync:()=>SRe,gunzip:()=>ERe,gunzipSync:()=>ARe,gzip:()=>RRe,gzipSync:()=>TRe,inflate:()=>kRe,inflateRaw:()=>IRe,inflateRawSync:()=>BRe,inflateSync:()=>PRe,unzip:()=>ORe,unzipSync:()=>NRe});function hAe(){if(Bie)return Uk;Bie=!0;function t(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}return Uk=t,Uk}function k4(){if(Pie)return Ba;Pie=!0;var t=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function e(i,h){return Object.prototype.hasOwnProperty.call(i,h)}Ba.assign=function(i){for(var h=Array.prototype.slice.call(arguments,1);h.length;){var l=h.shift();if(l){if(typeof l!="object")throw new TypeError(l+"must be non-object");for(var p in l)e(l,p)&&(i[p]=l[p])}}return i},Ba.shrinkBuf=function(i,h){return i.length===h?i:i.subarray?i.subarray(0,h):(i.length=h,i)};var r={arraySet:function(i,h,l,p,b){if(h.subarray&&i.subarray){i.set(h.subarray(l,l+p),b);return}for(var g=0;g<p;g++)i[b+g]=h[l+g]},flattenChunks:function(i){var h,l,p,b,g,y;for(p=0,h=0,l=i.length;h<l;h++)p+=i[h].length;for(y=new Uint8Array(p),b=0,h=0,l=i.length;h<l;h++)g=i[h],y.set(g,b),b+=g.length;return y}},a={arraySet:function(i,h,l,p,b){for(var g=0;g<p;g++)i[b+g]=h[l+g]},flattenChunks:function(i){return[].concat.apply([],i)}};return Ba.setTyped=function(i){i?(Ba.Buf8=Uint8Array,Ba.Buf16=Uint16Array,Ba.Buf32=Int32Array,Ba.assign(Ba,r)):(Ba.Buf8=Array,Ba.Buf16=Array,Ba.Buf32=Array,Ba.assign(Ba,a))},Ba.setTyped(t),Ba}function lAe(){if(Oie)return Bd;Oie=!0;var t=k4(),e=4,r=0,a=1,i=2;function h(H){for(var W=H.length;--W>=0;)H[W]=0}var l=0,p=1,b=2,g=3,y=258,M=29,x=256,E=x+1+M,A=30,k=19,P=2*E+1,N=15,L=16,C=7,Y=256,G=16,ee=17,D=18,U=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],V=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],_=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],n=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],s=512,f=new Array((E+2)*2);h(f);var u=new Array(A*2);h(u);var c=new Array(s);h(c);var m=new Array(y-g+1);h(m);var w=new Array(M);h(w);var d=new Array(A);h(d);function o(H,W,fe,st,ue){this.static_tree=H,this.extra_bits=W,this.extra_base=fe,this.elems=st,this.max_length=ue,this.has_stree=H&&H.length}var v,R,S;function B(H,W){this.dyn_tree=H,this.max_code=0,this.stat_desc=W}function F(H){return H<256?c[H]:c[256+(H>>>7)]}function $(H,W){H.pending_buf[H.pending++]=W&255,H.pending_buf[H.pending++]=W>>>8&255}function re(H,W,fe){H.bi_valid>L-fe?(H.bi_buf|=W<<H.bi_valid&65535,$(H,H.bi_buf),H.bi_buf=W>>L-H.bi_valid,H.bi_valid+=fe-L):(H.bi_buf|=W<<H.bi_valid&65535,H.bi_valid+=fe)}function Q(H,W,fe){re(H,fe[W*2],fe[W*2+1])}function Z(H,W){var fe=0;do fe|=H&1,H>>>=1,fe<<=1;while(--W>0);return fe>>>1}function K(H){H.bi_valid===16?($(H,H.bi_buf),H.bi_buf=0,H.bi_valid=0):H.bi_valid>=8&&(H.pending_buf[H.pending++]=H.bi_buf&255,H.bi_buf>>=8,H.bi_valid-=8)}function le(H,W){var fe=W.dyn_tree,st=W.max_code,ue=W.stat_desc.static_tree,me=W.stat_desc.has_stree,pe=W.stat_desc.extra_bits,be=W.stat_desc.extra_base,Qe=W.stat_desc.max_length,se,ye,Ee,Fe,de,xe,ct=0;for(Fe=0;Fe<=N;Fe++)H.bl_count[Fe]=0;for(fe[H.heap[H.heap_max]*2+1]=0,se=H.heap_max+1;se<P;se++)ye=H.heap[se],Fe=fe[fe[ye*2+1]*2+1]+1,Fe>Qe&&(Fe=Qe,ct++),fe[ye*2+1]=Fe,!(ye>st)&&(H.bl_count[Fe]++,de=0,ye>=be&&(de=pe[ye-be]),xe=fe[ye*2],H.opt_len+=xe*(Fe+de),me&&(H.static_len+=xe*(ue[ye*2+1]+de)));if(ct!==0){do{for(Fe=Qe-1;H.bl_count[Fe]===0;)Fe--;H.bl_count[Fe]--,H.bl_count[Fe+1]+=2,H.bl_count[Qe]--,ct-=2}while(ct>0);for(Fe=Qe;Fe!==0;Fe--)for(ye=H.bl_count[Fe];ye!==0;)Ee=H.heap[--se],!(Ee>st)&&(fe[Ee*2+1]!==Fe&&(H.opt_len+=(Fe-fe[Ee*2+1])*fe[Ee*2],fe[Ee*2+1]=Fe),ye--)}}function te(H,W,fe){var st=new Array(N+1),ue=0,me,pe;for(me=1;me<=N;me++)st[me]=ue=ue+fe[me-1]<<1;for(pe=0;pe<=W;pe++){var be=H[pe*2+1];be!==0&&(H[pe*2]=Z(st[be]++,be))}}function j(){var H,W,fe,st,ue,me=new Array(N+1);for(fe=0,st=0;st<M-1;st++)for(w[st]=fe,H=0;H<1<<U[st];H++)m[fe++]=st;for(m[fe-1]=st,ue=0,st=0;st<16;st++)for(d[st]=ue,H=0;H<1<<V[st];H++)c[ue++]=st;for(ue>>=7;st<A;st++)for(d[st]=ue<<7,H=0;H<1<<V[st]-7;H++)c[256+ue++]=st;for(W=0;W<=N;W++)me[W]=0;for(H=0;H<=143;)f[H*2+1]=8,H++,me[8]++;for(;H<=255;)f[H*2+1]=9,H++,me[9]++;for(;H<=279;)f[H*2+1]=7,H++,me[7]++;for(;H<=287;)f[H*2+1]=8,H++,me[8]++;for(te(f,E+1,me),H=0;H<A;H++)u[H*2+1]=5,u[H*2]=Z(H,5);v=new o(f,U,x+1,E,N),R=new o(u,V,0,A,N),S=new o(new Array(0),_,0,k,C)}function J(H){var W;for(W=0;W<E;W++)H.dyn_ltree[W*2]=0;for(W=0;W<A;W++)H.dyn_dtree[W*2]=0;for(W=0;W<k;W++)H.bl_tree[W*2]=0;H.dyn_ltree[Y*2]=1,H.opt_len=H.static_len=0,H.last_lit=H.matches=0}function X(H){H.bi_valid>8?$(H,H.bi_buf):H.bi_valid>0&&(H.pending_buf[H.pending++]=H.bi_buf),H.bi_buf=0,H.bi_valid=0}function he(H,W,fe,st){X(H),st&&($(H,fe),$(H,~fe)),t.arraySet(H.pending_buf,H.window,W,fe,H.pending),H.pending+=fe}function Te(H,W,fe,st){var ue=W*2,me=fe*2;return H[ue]<H[me]||H[ue]===H[me]&&st[W]<=st[fe]}function oe(H,W,fe){for(var st=H.heap[fe],ue=fe<<1;ue<=H.heap_len&&(ue<H.heap_len&&Te(W,H.heap[ue+1],H.heap[ue],H.depth)&&ue++,!Te(W,st,H.heap[ue],H.depth));)H.heap[fe]=H.heap[ue],fe=ue,ue<<=1;H.heap[fe]=st}function ce(H,W,fe){var st,ue,me=0,pe,be;if(H.last_lit!==0)do st=H.pending_buf[H.d_buf+me*2]<<8|H.pending_buf[H.d_buf+me*2+1],ue=H.pending_buf[H.l_buf+me],me++,st===0?Q(H,ue,W):(pe=m[ue],Q(H,pe+x+1,W),be=U[pe],be!==0&&(ue-=w[pe],re(H,ue,be)),st--,pe=F(st),Q(H,pe,fe),be=V[pe],be!==0&&(st-=d[pe],re(H,st,be)));while(me<H.last_lit);Q(H,Y,W)}function ot(H,W){var fe=W.dyn_tree,st=W.stat_desc.static_tree,ue=W.stat_desc.has_stree,me=W.stat_desc.elems,pe,be,Qe=-1,se;for(H.heap_len=0,H.heap_max=P,pe=0;pe<me;pe++)fe[pe*2]!==0?(H.heap[++H.heap_len]=Qe=pe,H.depth[pe]=0):fe[pe*2+1]=0;for(;H.heap_len<2;)se=H.heap[++H.heap_len]=Qe<2?++Qe:0,fe[se*2]=1,H.depth[se]=0,H.opt_len--,ue&&(H.static_len-=st[se*2+1]);for(W.max_code=Qe,pe=H.heap_len>>1;pe>=1;pe--)oe(H,fe,pe);se=me;do pe=H.heap[1],H.heap[1]=H.heap[H.heap_len--],oe(H,fe,1),be=H.heap[1],H.heap[--H.heap_max]=pe,H.heap[--H.heap_max]=be,fe[se*2]=fe[pe*2]+fe[be*2],H.depth[se]=(H.depth[pe]>=H.depth[be]?H.depth[pe]:H.depth[be])+1,fe[pe*2+1]=fe[be*2+1]=se,H.heap[1]=se++,oe(H,fe,1);while(H.heap_len>=2);H.heap[--H.heap_max]=H.heap[1],le(H,W),te(fe,Qe,H.bl_count)}function ge(H,W,fe){var st,ue=-1,me,pe=W[0*2+1],be=0,Qe=7,se=4;for(pe===0&&(Qe=138,se=3),W[(fe+1)*2+1]=65535,st=0;st<=fe;st++)me=pe,pe=W[(st+1)*2+1],!(++be<Qe&&me===pe)&&(be<se?H.bl_tree[me*2]+=be:me!==0?(me!==ue&&H.bl_tree[me*2]++,H.bl_tree[G*2]++):be<=10?H.bl_tree[ee*2]++:H.bl_tree[D*2]++,be=0,ue=me,pe===0?(Qe=138,se=3):me===pe?(Qe=6,se=3):(Qe=7,se=4))}function Se(H,W,fe){var st,ue=-1,me,pe=W[0*2+1],be=0,Qe=7,se=4;for(pe===0&&(Qe=138,se=3),st=0;st<=fe;st++)if(me=pe,pe=W[(st+1)*2+1],!(++be<Qe&&me===pe)){if(be<se)do Q(H,me,H.bl_tree);while(--be!==0);else me!==0?(me!==ue&&(Q(H,me,H.bl_tree),be--),Q(H,G,H.bl_tree),re(H,be-3,2)):be<=10?(Q(H,ee,H.bl_tree),re(H,be-3,3)):(Q(H,D,H.bl_tree),re(H,be-11,7));be=0,ue=me,pe===0?(Qe=138,se=3):me===pe?(Qe=6,se=3):(Qe=7,se=4)}}function ut(H){var W;for(ge(H,H.dyn_ltree,H.l_desc.max_code),ge(H,H.dyn_dtree,H.d_desc.max_code),ot(H,H.bl_desc),W=k-1;W>=3&&H.bl_tree[n[W]*2+1]===0;W--);return H.opt_len+=3*(W+1)+5+5+4,W}function Ze(H,W,fe,st){var ue;for(re(H,W-257,5),re(H,fe-1,5),re(H,st-4,4),ue=0;ue<st;ue++)re(H,H.bl_tree[n[ue]*2+1],3);Se(H,H.dyn_ltree,W-1),Se(H,H.dyn_dtree,fe-1)}function Ge(H){var W=4093624447,fe;for(fe=0;fe<=31;fe++,W>>>=1)if(W&1&&H.dyn_ltree[fe*2]!==0)return r;if(H.dyn_ltree[9*2]!==0||H.dyn_ltree[10*2]!==0||H.dyn_ltree[13*2]!==0)return a;for(fe=32;fe<x;fe++)if(H.dyn_ltree[fe*2]!==0)return a;return r}var lt=!1;function z(H){lt||(j(),lt=!0),H.l_desc=new B(H.dyn_ltree,v),H.d_desc=new B(H.dyn_dtree,R),H.bl_desc=new B(H.bl_tree,S),H.bi_buf=0,H.bi_valid=0,J(H)}function T(H,W,fe,st){re(H,(l<<1)+(st?1:0),3),he(H,W,fe,!0)}function I(H){re(H,p<<1,3),Q(H,Y,f),K(H)}function O(H,W,fe,st){var ue,me,pe=0;H.level>0?(H.strm.data_type===i&&(H.strm.data_type=Ge(H)),ot(H,H.l_desc),ot(H,H.d_desc),pe=ut(H),ue=H.opt_len+3+7>>>3,me=H.static_len+3+7>>>3,me<=ue&&(ue=me)):ue=me=fe+5,fe+4<=ue&&W!==-1?T(H,W,fe,st):H.strategy===e||me===ue?(re(H,(p<<1)+(st?1:0),3),ce(H,f,u)):(re(H,(b<<1)+(st?1:0),3),Ze(H,H.l_desc.max_code+1,H.d_desc.max_code+1,pe+1),ce(H,H.dyn_ltree,H.dyn_dtree)),J(H),st&&X(H)}function q(H,W,fe){return H.pending_buf[H.d_buf+H.last_lit*2]=W>>>8&255,H.pending_buf[H.d_buf+H.last_lit*2+1]=W&255,H.pending_buf[H.l_buf+H.last_lit]=fe&255,H.last_lit++,W===0?H.dyn_ltree[fe*2]++:(H.matches++,W--,H.dyn_ltree[(m[fe]+x+1)*2]++,H.dyn_dtree[F(W)*2]++),H.last_lit===H.lit_bufsize-1}return Bd._tr_init=z,Bd._tr_stored_block=T,Bd._tr_flush_block=O,Bd._tr_tally=q,Bd._tr_align=I,Bd}function Zie(){if(Nie)return Fk;Nie=!0;function t(e,r,a,i){for(var h=e&65535|0,l=e>>>16&65535|0,p=0;a!==0;){p=a>2e3?2e3:a,a-=p;do h=h+r[i++]|0,l=l+h|0;while(--p);h%=65521,l%=65521}return h|l<<16|0}return Fk=t,Fk}function Hie(){if(Cie)return jk;Cie=!0;function t(){for(var a,i=[],h=0;h<256;h++){a=h;for(var l=0;l<8;l++)a=a&1?3988292384^a>>>1:a>>>1;i[h]=a}return i}var e=t();function r(a,i,h,l){var p=e,b=l+h;a^=-1;for(var g=l;g<b;g++)a=a>>>8^p[(a^i[g])&255];return a^-1}return jk=r,jk}function cAe(){return Lie||(Lie=!0,zk={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}),zk}function dAe(){if(Die)return Of;Die=!0;var t=k4(),e=lAe(),r=Zie(),a=Hie(),i=cAe(),h=0,l=1,p=3,b=4,g=5,y=0,M=1,x=-2,E=-3,A=-5,k=-1,P=1,N=2,L=3,C=4,Y=0,G=2,ee=8,D=9,U=15,V=8,_=29,n=256,s=n+1+_,f=30,u=19,c=2*s+1,m=15,w=3,d=258,o=d+w+1,v=32,R=42,S=69,B=73,F=91,$=103,re=113,Q=666,Z=1,K=2,le=3,te=4,j=3;function J(se,ye){return se.msg=i[ye],ye}function X(se){return(se<<1)-(se>4?9:0)}function he(se){for(var ye=se.length;--ye>=0;)se[ye]=0}function Te(se){var ye=se.state,Ee=ye.pending;Ee>se.avail_out&&(Ee=se.avail_out),Ee!==0&&(t.arraySet(se.output,ye.pending_buf,ye.pending_out,Ee,se.next_out),se.next_out+=Ee,ye.pending_out+=Ee,se.total_out+=Ee,se.avail_out-=Ee,ye.pending-=Ee,ye.pending===0&&(ye.pending_out=0))}function oe(se,ye){e._tr_flush_block(se,se.block_start>=0?se.block_start:-1,se.strstart-se.block_start,ye),se.block_start=se.strstart,Te(se.strm)}function ce(se,ye){se.pending_buf[se.pending++]=ye}function ot(se,ye){se.pending_buf[se.pending++]=ye>>>8&255,se.pending_buf[se.pending++]=ye&255}function ge(se,ye,Ee,Fe){var de=se.avail_in;return de>Fe&&(de=Fe),de===0?0:(se.avail_in-=de,t.arraySet(ye,se.input,se.next_in,de,Ee),se.state.wrap===1?se.adler=r(se.adler,ye,de,Ee):se.state.wrap===2&&(se.adler=a(se.adler,ye,de,Ee)),se.next_in+=de,se.total_in+=de,de)}function Se(se,ye){var Ee=se.max_chain_length,Fe=se.strstart,de,xe,ct=se.prev_length,_e=se.nice_match,Ve=se.strstart>se.w_size-o?se.strstart-(se.w_size-o):0,vt=se.window,Ye=se.w_mask,et=se.prev,mt=se.strstart+d,We=vt[Fe+ct-1],nt=vt[Fe+ct];se.prev_length>=se.good_match&&(Ee>>=2),_e>se.lookahead&&(_e=se.lookahead);do if(de=ye,!(vt[de+ct]!==nt||vt[de+ct-1]!==We||vt[de]!==vt[Fe]||vt[++de]!==vt[Fe+1])){Fe+=2,de++;do;while(vt[++Fe]===vt[++de]&&vt[++Fe]===vt[++de]&&vt[++Fe]===vt[++de]&&vt[++Fe]===vt[++de]&&vt[++Fe]===vt[++de]&&vt[++Fe]===vt[++de]&&vt[++Fe]===vt[++de]&&vt[++Fe]===vt[++de]&&Fe<mt);if(xe=d-(mt-Fe),Fe=mt-d,xe>ct){if(se.match_start=ye,ct=xe,xe>=_e)break;We=vt[Fe+ct-1],nt=vt[Fe+ct]}}while((ye=et[ye&Ye])>Ve&&--Ee!==0);return ct<=se.lookahead?ct:se.lookahead}function ut(se){var ye=se.w_size,Ee,Fe,de,xe,ct;do{if(xe=se.window_size-se.lookahead-se.strstart,se.strstart>=ye+(ye-o)){t.arraySet(se.window,se.window,ye,ye,0),se.match_start-=ye,se.strstart-=ye,se.block_start-=ye,Fe=se.hash_size,Ee=Fe;do de=se.head[--Ee],se.head[Ee]=de>=ye?de-ye:0;while(--Fe);Fe=ye,Ee=Fe;do de=se.prev[--Ee],se.prev[Ee]=de>=ye?de-ye:0;while(--Fe);xe+=ye}if(se.strm.avail_in===0)break;if(Fe=ge(se.strm,se.window,se.strstart+se.lookahead,xe),se.lookahead+=Fe,se.lookahead+se.insert>=w)for(ct=se.strstart-se.insert,se.ins_h=se.window[ct],se.ins_h=(se.ins_h<<se.hash_shift^se.window[ct+1])&se.hash_mask;se.insert&&(se.ins_h=(se.ins_h<<se.hash_shift^se.window[ct+w-1])&se.hash_mask,se.prev[ct&se.w_mask]=se.head[se.ins_h],se.head[se.ins_h]=ct,ct++,se.insert--,!(se.lookahead+se.insert<w)););}while(se.lookahead<o&&se.strm.avail_in!==0)}function Ze(se,ye){var Ee=65535;for(Ee>se.pending_buf_size-5&&(Ee=se.pending_buf_size-5);;){if(se.lookahead<=1){if(ut(se),se.lookahead===0&&ye===h)return Z;if(se.lookahead===0)break}se.strstart+=se.lookahead,se.lookahead=0;var Fe=se.block_start+Ee;if((se.strstart===0||se.strstart>=Fe)&&(se.lookahead=se.strstart-Fe,se.strstart=Fe,oe(se,!1),se.strm.avail_out===0)||se.strstart-se.block_start>=se.w_size-o&&(oe(se,!1),se.strm.avail_out===0))return Z}return se.insert=0,ye===b?(oe(se,!0),se.strm.avail_out===0?le:te):(se.strstart>se.block_start&&(oe(se,!1),se.strm.avail_out===0),Z)}function Ge(se,ye){for(var Ee,Fe;;){if(se.lookahead<o){if(ut(se),se.lookahead<o&&ye===h)return Z;if(se.lookahead===0)break}if(Ee=0,se.lookahead>=w&&(se.ins_h=(se.ins_h<<se.hash_shift^se.window[se.strstart+w-1])&se.hash_mask,Ee=se.prev[se.strstart&se.w_mask]=se.head[se.ins_h],se.head[se.ins_h]=se.strstart),Ee!==0&&se.strstart-Ee<=se.w_size-o&&(se.match_length=Se(se,Ee)),se.match_length>=w)if(Fe=e._tr_tally(se,se.strstart-se.match_start,se.match_length-w),se.lookahead-=se.match_length,se.match_length<=se.max_lazy_match&&se.lookahead>=w){se.match_length--;do se.strstart++,se.ins_h=(se.ins_h<<se.hash_shift^se.window[se.strstart+w-1])&se.hash_mask,Ee=se.prev[se.strstart&se.w_mask]=se.head[se.ins_h],se.head[se.ins_h]=se.strstart;while(--se.match_length!==0);se.strstart++}else se.strstart+=se.match_length,se.match_length=0,se.ins_h=se.window[se.strstart],se.ins_h=(se.ins_h<<se.hash_shift^se.window[se.strstart+1])&se.hash_mask;else Fe=e._tr_tally(se,0,se.window[se.strstart]),se.lookahead--,se.strstart++;if(Fe&&(oe(se,!1),se.strm.avail_out===0))return Z}return se.insert=se.strstart<w-1?se.strstart:w-1,ye===b?(oe(se,!0),se.strm.avail_out===0?le:te):se.last_lit&&(oe(se,!1),se.strm.avail_out===0)?Z:K}function lt(se,ye){for(var Ee,Fe,de;;){if(se.lookahead<o){if(ut(se),se.lookahead<o&&ye===h)return Z;if(se.lookahead===0)break}if(Ee=0,se.lookahead>=w&&(se.ins_h=(se.ins_h<<se.hash_shift^se.window[se.strstart+w-1])&se.hash_mask,Ee=se.prev[se.strstart&se.w_mask]=se.head[se.ins_h],se.head[se.ins_h]=se.strstart),se.prev_length=se.match_length,se.prev_match=se.match_start,se.match_length=w-1,Ee!==0&&se.prev_length<se.max_lazy_match&&se.strstart-Ee<=se.w_size-o&&(se.match_length=Se(se,Ee),se.match_length<=5&&(se.strategy===P||se.match_length===w&&se.strstart-se.match_start>4096)&&(se.match_length=w-1)),se.prev_length>=w&&se.match_length<=se.prev_length){de=se.strstart+se.lookahead-w,Fe=e._tr_tally(se,se.strstart-1-se.prev_match,se.prev_length-w),se.lookahead-=se.prev_length-1,se.prev_length-=2;do++se.strstart<=de&&(se.ins_h=(se.ins_h<<se.hash_shift^se.window[se.strstart+w-1])&se.hash_mask,Ee=se.prev[se.strstart&se.w_mask]=se.head[se.ins_h],se.head[se.ins_h]=se.strstart);while(--se.prev_length!==0);if(se.match_available=0,se.match_length=w-1,se.strstart++,Fe&&(oe(se,!1),se.strm.avail_out===0))return Z}else if(se.match_available){if(Fe=e._tr_tally(se,0,se.window[se.strstart-1]),Fe&&oe(se,!1),se.strstart++,se.lookahead--,se.strm.avail_out===0)return Z}else se.match_available=1,se.strstart++,se.lookahead--}return se.match_available&&(Fe=e._tr_tally(se,0,se.window[se.strstart-1]),se.match_available=0),se.insert=se.strstart<w-1?se.strstart:w-1,ye===b?(oe(se,!0),se.strm.avail_out===0?le:te):se.last_lit&&(oe(se,!1),se.strm.avail_out===0)?Z:K}function z(se,ye){for(var Ee,Fe,de,xe,ct=se.window;;){if(se.lookahead<=d){if(ut(se),se.lookahead<=d&&ye===h)return Z;if(se.lookahead===0)break}if(se.match_length=0,se.lookahead>=w&&se.strstart>0&&(de=se.strstart-1,Fe=ct[de],Fe===ct[++de]&&Fe===ct[++de]&&Fe===ct[++de])){xe=se.strstart+d;do;while(Fe===ct[++de]&&Fe===ct[++de]&&Fe===ct[++de]&&Fe===ct[++de]&&Fe===ct[++de]&&Fe===ct[++de]&&Fe===ct[++de]&&Fe===ct[++de]&&de<xe);se.match_length=d-(xe-de),se.match_length>se.lookahead&&(se.match_length=se.lookahead)}if(se.match_length>=w?(Ee=e._tr_tally(se,1,se.match_length-w),se.lookahead-=se.match_length,se.strstart+=se.match_length,se.match_length=0):(Ee=e._tr_tally(se,0,se.window[se.strstart]),se.lookahead--,se.strstart++),Ee&&(oe(se,!1),se.strm.avail_out===0))return Z}return se.insert=0,ye===b?(oe(se,!0),se.strm.avail_out===0?le:te):se.last_lit&&(oe(se,!1),se.strm.avail_out===0)?Z:K}function T(se,ye){for(var Ee;;){if(se.lookahead===0&&(ut(se),se.lookahead===0)){if(ye===h)return Z;break}if(se.match_length=0,Ee=e._tr_tally(se,0,se.window[se.strstart]),se.lookahead--,se.strstart++,Ee&&(oe(se,!1),se.strm.avail_out===0))return Z}return se.insert=0,ye===b?(oe(se,!0),se.strm.avail_out===0?le:te):se.last_lit&&(oe(se,!1),se.strm.avail_out===0)?Z:K}function I(se,ye,Ee,Fe,de){this.good_length=se,this.max_lazy=ye,this.nice_length=Ee,this.max_chain=Fe,this.func=de}var O;O=[new I(0,0,0,0,Ze),new I(4,4,8,4,Ge),new I(4,5,16,8,Ge),new I(4,6,32,32,Ge),new I(4,4,16,16,lt),new I(8,16,32,32,lt),new I(8,16,128,128,lt),new I(8,32,128,256,lt),new I(32,128,258,1024,lt),new I(32,258,258,4096,lt)];function q(se){se.window_size=2*se.w_size,he(se.head),se.max_lazy_match=O[se.level].max_lazy,se.good_match=O[se.level].good_length,se.nice_match=O[se.level].nice_length,se.max_chain_length=O[se.level].max_chain,se.strstart=0,se.block_start=0,se.lookahead=0,se.insert=0,se.match_length=se.prev_length=w-1,se.match_available=0,se.ins_h=0}function H(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=ee,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new t.Buf16(c*2),this.dyn_dtree=new t.Buf16((2*f+1)*2),this.bl_tree=new t.Buf16((2*u+1)*2),he(this.dyn_ltree),he(this.dyn_dtree),he(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new t.Buf16(m+1),this.heap=new t.Buf16(2*s+1),he(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new t.Buf16(2*s+1),he(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function W(se){var ye;return!se||!se.state?J(se,x):(se.total_in=se.total_out=0,se.data_type=G,ye=se.state,ye.pending=0,ye.pending_out=0,ye.wrap<0&&(ye.wrap=-ye.wrap),ye.status=ye.wrap?R:re,se.adler=ye.wrap===2?0:1,ye.last_flush=h,e._tr_init(ye),y)}function fe(se){var ye=W(se);return ye===y&&q(se.state),ye}function st(se,ye){return!se||!se.state||se.state.wrap!==2?x:(se.state.gzhead=ye,y)}function ue(se,ye,Ee,Fe,de,xe){if(!se)return x;var ct=1;if(ye===k&&(ye=6),Fe<0?(ct=0,Fe=-Fe):Fe>15&&(ct=2,Fe-=16),de<1||de>D||Ee!==ee||Fe<8||Fe>15||ye<0||ye>9||xe<0||xe>C)return J(se,x);Fe===8&&(Fe=9);var _e=new H;return se.state=_e,_e.strm=se,_e.wrap=ct,_e.gzhead=null,_e.w_bits=Fe,_e.w_size=1<<_e.w_bits,_e.w_mask=_e.w_size-1,_e.hash_bits=de+7,_e.hash_size=1<<_e.hash_bits,_e.hash_mask=_e.hash_size-1,_e.hash_shift=~~((_e.hash_bits+w-1)/w),_e.window=new t.Buf8(_e.w_size*2),_e.head=new t.Buf16(_e.hash_size),_e.prev=new t.Buf16(_e.w_size),_e.lit_bufsize=1<<de+6,_e.pending_buf_size=_e.lit_bufsize*4,_e.pending_buf=new t.Buf8(_e.pending_buf_size),_e.d_buf=1*_e.lit_bufsize,_e.l_buf=3*_e.lit_bufsize,_e.level=ye,_e.strategy=xe,_e.method=Ee,fe(se)}function me(se,ye){return ue(se,ye,ee,U,V,Y)}function pe(se,ye){var Ee,Fe,de,xe;if(!se||!se.state||ye>g||ye<0)return se?J(se,x):x;if(Fe=se.state,!se.output||!se.input&&se.avail_in!==0||Fe.status===Q&&ye!==b)return J(se,se.avail_out===0?A:x);if(Fe.strm=se,Ee=Fe.last_flush,Fe.last_flush=ye,Fe.status===R)if(Fe.wrap===2)se.adler=0,ce(Fe,31),ce(Fe,139),ce(Fe,8),Fe.gzhead?(ce(Fe,(Fe.gzhead.text?1:0)+(Fe.gzhead.hcrc?2:0)+(Fe.gzhead.extra?4:0)+(Fe.gzhead.name?8:0)+(Fe.gzhead.comment?16:0)),ce(Fe,Fe.gzhead.time&255),ce(Fe,Fe.gzhead.time>>8&255),ce(Fe,Fe.gzhead.time>>16&255),ce(Fe,Fe.gzhead.time>>24&255),ce(Fe,Fe.level===9?2:Fe.strategy>=N||Fe.level<2?4:0),ce(Fe,Fe.gzhead.os&255),Fe.gzhead.extra&&Fe.gzhead.extra.length&&(ce(Fe,Fe.gzhead.extra.length&255),ce(Fe,Fe.gzhead.extra.length>>8&255)),Fe.gzhead.hcrc&&(se.adler=a(se.adler,Fe.pending_buf,Fe.pending,0)),Fe.gzindex=0,Fe.status=S):(ce(Fe,0),ce(Fe,0),ce(Fe,0),ce(Fe,0),ce(Fe,0),ce(Fe,Fe.level===9?2:Fe.strategy>=N||Fe.level<2?4:0),ce(Fe,j),Fe.status=re);else{var ct=ee+(Fe.w_bits-8<<4)<<8,_e=-1;Fe.strategy>=N||Fe.level<2?_e=0:Fe.level<6?_e=1:Fe.level===6?_e=2:_e=3,ct|=_e<<6,Fe.strstart!==0&&(ct|=v),ct+=31-ct%31,Fe.status=re,ot(Fe,ct),Fe.strstart!==0&&(ot(Fe,se.adler>>>16),ot(Fe,se.adler&65535)),se.adler=1}if(Fe.status===S)if(Fe.gzhead.extra){for(de=Fe.pending;Fe.gzindex<(Fe.gzhead.extra.length&65535)&&!(Fe.pending===Fe.pending_buf_size&&(Fe.gzhead.hcrc&&Fe.pending>de&&(se.adler=a(se.adler,Fe.pending_buf,Fe.pending-de,de)),Te(se),de=Fe.pending,Fe.pending===Fe.pending_buf_size));)ce(Fe,Fe.gzhead.extra[Fe.gzindex]&255),Fe.gzindex++;Fe.gzhead.hcrc&&Fe.pending>de&&(se.adler=a(se.adler,Fe.pending_buf,Fe.pending-de,de)),Fe.gzindex===Fe.gzhead.extra.length&&(Fe.gzindex=0,Fe.status=B)}else Fe.status=B;if(Fe.status===B)if(Fe.gzhead.name){de=Fe.pending;do{if(Fe.pending===Fe.pending_buf_size&&(Fe.gzhead.hcrc&&Fe.pending>de&&(se.adler=a(se.adler,Fe.pending_buf,Fe.pending-de,de)),Te(se),de=Fe.pending,Fe.pending===Fe.pending_buf_size)){xe=1;break}Fe.gzindex<Fe.gzhead.name.length?xe=Fe.gzhead.name.charCodeAt(Fe.gzindex++)&255:xe=0,ce(Fe,xe)}while(xe!==0);Fe.gzhead.hcrc&&Fe.pending>de&&(se.adler=a(se.adler,Fe.pending_buf,Fe.pending-de,de)),xe===0&&(Fe.gzindex=0,Fe.status=F)}else Fe.status=F;if(Fe.status===F)if(Fe.gzhead.comment){de=Fe.pending;do{if(Fe.pending===Fe.pending_buf_size&&(Fe.gzhead.hcrc&&Fe.pending>de&&(se.adler=a(se.adler,Fe.pending_buf,Fe.pending-de,de)),Te(se),de=Fe.pending,Fe.pending===Fe.pending_buf_size)){xe=1;break}Fe.gzindex<Fe.gzhead.comment.length?xe=Fe.gzhead.comment.charCodeAt(Fe.gzindex++)&255:xe=0,ce(Fe,xe)}while(xe!==0);Fe.gzhead.hcrc&&Fe.pending>de&&(se.adler=a(se.adler,Fe.pending_buf,Fe.pending-de,de)),xe===0&&(Fe.status=$)}else Fe.status=$;if(Fe.status===$&&(Fe.gzhead.hcrc?(Fe.pending+2>Fe.pending_buf_size&&Te(se),Fe.pending+2<=Fe.pending_buf_size&&(ce(Fe,se.adler&255),ce(Fe,se.adler>>8&255),se.adler=0,Fe.status=re)):Fe.status=re),Fe.pending!==0){if(Te(se),se.avail_out===0)return Fe.last_flush=-1,y}else if(se.avail_in===0&&X(ye)<=X(Ee)&&ye!==b)return J(se,A);if(Fe.status===Q&&se.avail_in!==0)return J(se,A);if(se.avail_in!==0||Fe.lookahead!==0||ye!==h&&Fe.status!==Q){var Ve=Fe.strategy===N?T(Fe,ye):Fe.strategy===L?z(Fe,ye):O[Fe.level].func(Fe,ye);if((Ve===le||Ve===te)&&(Fe.status=Q),Ve===Z||Ve===le)return se.avail_out===0&&(Fe.last_flush=-1),y;if(Ve===K&&(ye===l?e._tr_align(Fe):ye!==g&&(e._tr_stored_block(Fe,0,0,!1),ye===p&&(he(Fe.head),Fe.lookahead===0&&(Fe.strstart=0,Fe.block_start=0,Fe.insert=0))),Te(se),se.avail_out===0))return Fe.last_flush=-1,y}return ye!==b?y:Fe.wrap<=0?M:(Fe.wrap===2?(ce(Fe,se.adler&255),ce(Fe,se.adler>>8&255),ce(Fe,se.adler>>16&255),ce(Fe,se.adler>>24&255),ce(Fe,se.total_in&255),ce(Fe,se.total_in>>8&255),ce(Fe,se.total_in>>16&255),ce(Fe,se.total_in>>24&255)):(ot(Fe,se.adler>>>16),ot(Fe,se.adler&65535)),Te(se),Fe.wrap>0&&(Fe.wrap=-Fe.wrap),Fe.pending!==0?y:M)}function be(se){var ye;return!se||!se.state?x:(ye=se.state.status,ye!==R&&ye!==S&&ye!==B&&ye!==F&&ye!==$&&ye!==re&&ye!==Q?J(se,x):(se.state=null,ye===re?J(se,E):y))}function Qe(se,ye){var Ee=ye.length,Fe,de,xe,ct,_e,Ve,vt,Ye;if(!se||!se.state||(Fe=se.state,ct=Fe.wrap,ct===2||ct===1&&Fe.status!==R||Fe.lookahead))return x;for(ct===1&&(se.adler=r(se.adler,ye,Ee,0)),Fe.wrap=0,Ee>=Fe.w_size&&(ct===0&&(he(Fe.head),Fe.strstart=0,Fe.block_start=0,Fe.insert=0),Ye=new t.Buf8(Fe.w_size),t.arraySet(Ye,ye,Ee-Fe.w_size,Fe.w_size,0),ye=Ye,Ee=Fe.w_size),_e=se.avail_in,Ve=se.next_in,vt=se.input,se.avail_in=Ee,se.next_in=0,se.input=ye,ut(Fe);Fe.lookahead>=w;){de=Fe.strstart,xe=Fe.lookahead-(w-1);do Fe.ins_h=(Fe.ins_h<<Fe.hash_shift^Fe.window[de+w-1])&Fe.hash_mask,Fe.prev[de&Fe.w_mask]=Fe.head[Fe.ins_h],Fe.head[Fe.ins_h]=de,de++;while(--xe);Fe.strstart=de,Fe.lookahead=w-1,ut(Fe)}return Fe.strstart+=Fe.lookahead,Fe.block_start=Fe.strstart,Fe.insert=Fe.lookahead,Fe.lookahead=0,Fe.match_length=Fe.prev_length=w-1,Fe.match_available=0,se.next_in=Ve,se.input=vt,se.avail_in=_e,Fe.wrap=ct,y}return Of.deflateInit=me,Of.deflateInit2=ue,Of.deflateReset=fe,Of.deflateResetKeep=W,Of.deflateSetHeader=st,Of.deflate=pe,Of.deflateEnd=be,Of.deflateSetDictionary=Qe,Of.deflateInfo="pako deflate (from Nodeca project)",Of}function pAe(){if($ie)return Zk;$ie=!0;var t=30,e=12;return Zk=function(a,i){var h,l,p,b,g,y,M,x,E,A,k,P,N,L,C,Y,G,ee,D,U,V,_,n,s,f;h=a.state,l=a.next_in,s=a.input,p=l+(a.avail_in-5),b=a.next_out,f=a.output,g=b-(i-a.avail_out),y=b+(a.avail_out-257),M=h.dmax,x=h.wsize,E=h.whave,A=h.wnext,k=h.window,P=h.hold,N=h.bits,L=h.lencode,C=h.distcode,Y=(1<<h.lenbits)-1,G=(1<<h.distbits)-1;e:do{N<15&&(P+=s[l++]<<N,N+=8,P+=s[l++]<<N,N+=8),ee=L[P&Y];t:for(;;){if(D=ee>>>24,P>>>=D,N-=D,D=ee>>>16&255,D===0)f[b++]=ee&65535;else if(D&16){U=ee&65535,D&=15,D&&(N<D&&(P+=s[l++]<<N,N+=8),U+=P&(1<<D)-1,P>>>=D,N-=D),N<15&&(P+=s[l++]<<N,N+=8,P+=s[l++]<<N,N+=8),ee=C[P&G];r:for(;;){if(D=ee>>>24,P>>>=D,N-=D,D=ee>>>16&255,D&16){if(V=ee&65535,D&=15,N<D&&(P+=s[l++]<<N,N+=8,N<D&&(P+=s[l++]<<N,N+=8)),V+=P&(1<<D)-1,V>M){a.msg="invalid distance too far back",h.mode=t;break e}if(P>>>=D,N-=D,D=b-g,V>D){if(D=V-D,D>E&&h.sane){a.msg="invalid distance too far back",h.mode=t;break e}if(_=0,n=k,A===0){if(_+=x-D,D<U){U-=D;do f[b++]=k[_++];while(--D);_=b-V,n=f}}else if(A<D){if(_+=x+A-D,D-=A,D<U){U-=D;do f[b++]=k[_++];while(--D);if(_=0,A<U){D=A,U-=D;do f[b++]=k[_++];while(--D);_=b-V,n=f}}}else if(_+=A-D,D<U){U-=D;do f[b++]=k[_++];while(--D);_=b-V,n=f}for(;U>2;)f[b++]=n[_++],f[b++]=n[_++],f[b++]=n[_++],U-=3;U&&(f[b++]=n[_++],U>1&&(f[b++]=n[_++]))}else{_=b-V;do f[b++]=f[_++],f[b++]=f[_++],f[b++]=f[_++],U-=3;while(U>2);U&&(f[b++]=f[_++],U>1&&(f[b++]=f[_++]))}}else if(D&64){a.msg="invalid distance code",h.mode=t;break e}else{ee=C[(ee&65535)+(P&(1<<D)-1)];continue r}break}}else if(D&64)if(D&32){h.mode=e;break e}else{a.msg="invalid literal/length code",h.mode=t;break e}else{ee=L[(ee&65535)+(P&(1<<D)-1)];continue t}break}}while(l<p&&b<y);U=N>>3,l-=U,N-=U<<3,P&=(1<<N)-1,a.next_in=l,a.next_out=b,a.avail_in=l<p?5+(p-l):5-(l-p),a.avail_out=b<y?257+(y-b):257-(b-y),h.hold=P,h.bits=N},Zk}function vAe(){if(qie)return Hk;qie=!0;var t=k4(),e=15,r=852,a=592,i=0,h=1,l=2,p=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],b=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],g=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],y=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];return Hk=function(x,E,A,k,P,N,L,C){var Y=C.bits,G=0,ee=0,D=0,U=0,V=0,_=0,n=0,s=0,f=0,u=0,c,m,w,d,o,v=null,R=0,S,B=new t.Buf16(e+1),F=new t.Buf16(e+1),$=null,re=0,Q,Z,K;for(G=0;G<=e;G++)B[G]=0;for(ee=0;ee<k;ee++)B[E[A+ee]]++;for(V=Y,U=e;U>=1&&B[U]===0;U--);if(V>U&&(V=U),U===0)return P[N++]=1<<24|64<<16|0,P[N++]=1<<24|64<<16|0,C.bits=1,0;for(D=1;D<U&&B[D]===0;D++);for(V<D&&(V=D),s=1,G=1;G<=e;G++)if(s<<=1,s-=B[G],s<0)return-1;if(s>0&&(x===i||U!==1))return-1;for(F[1]=0,G=1;G<e;G++)F[G+1]=F[G]+B[G];for(ee=0;ee<k;ee++)E[A+ee]!==0&&(L[F[E[A+ee]]++]=ee);if(x===i?(v=$=L,S=19):x===h?(v=p,R-=257,$=b,re-=257,S=256):(v=g,$=y,S=-1),u=0,ee=0,G=D,o=N,_=V,n=0,w=-1,f=1<<V,d=f-1,x===h&&f>r||x===l&&f>a)return 1;for(;;){Q=G-n,L[ee]<S?(Z=0,K=L[ee]):L[ee]>S?(Z=$[re+L[ee]],K=v[R+L[ee]]):(Z=96,K=0),c=1<<G-n,m=1<<_,D=m;do m-=c,P[o+(u>>n)+m]=Q<<24|Z<<16|K|0;while(m!==0);for(c=1<<G-1;u&c;)c>>=1;if(c!==0?(u&=c-1,u+=c):u=0,ee++,--B[G]===0){if(G===U)break;G=E[A+L[ee]]}if(G>V&&(u&d)!==w){for(n===0&&(n=V),o+=D,_=G-n,s=1<<_;_+n<U&&(s-=B[_+n],!(s<=0));)_++,s<<=1;if(f+=1<<_,x===h&&f>r||x===l&&f>a)return 1;w=u&d,P[w]=V<<24|_<<16|o-N|0}}return u!==0&&(P[o+u]=G-n<<24|64<<16|0),C.bits=V,0},Hk}function mAe(){if(Uie)return Cs;Uie=!0;var t=k4(),e=Zie(),r=Hie(),a=pAe(),i=vAe(),h=0,l=1,p=2,b=4,g=5,y=6,M=0,x=1,E=2,A=-2,k=-3,P=-4,N=-5,L=8,C=1,Y=2,G=3,ee=4,D=5,U=6,V=7,_=8,n=9,s=10,f=11,u=12,c=13,m=14,w=15,d=16,o=17,v=18,R=19,S=20,B=21,F=22,$=23,re=24,Q=25,Z=26,K=27,le=28,te=29,j=30,J=31,X=32,he=852,Te=592,oe=15,ce=oe;function ot(ue){return(ue>>>24&255)+(ue>>>8&65280)+((ue&65280)<<8)+((ue&255)<<24)}function ge(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new t.Buf16(320),this.work=new t.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function Se(ue){var me;return!ue||!ue.state?A:(me=ue.state,ue.total_in=ue.total_out=me.total=0,ue.msg="",me.wrap&&(ue.adler=me.wrap&1),me.mode=C,me.last=0,me.havedict=0,me.dmax=32768,me.head=null,me.hold=0,me.bits=0,me.lencode=me.lendyn=new t.Buf32(he),me.distcode=me.distdyn=new t.Buf32(Te),me.sane=1,me.back=-1,M)}function ut(ue){var me;return!ue||!ue.state?A:(me=ue.state,me.wsize=0,me.whave=0,me.wnext=0,Se(ue))}function Ze(ue,me){var pe,be;return!ue||!ue.state||(be=ue.state,me<0?(pe=0,me=-me):(pe=(me>>4)+1,me<48&&(me&=15)),me&&(me<8||me>15))?A:(be.window!==null&&be.wbits!==me&&(be.window=null),be.wrap=pe,be.wbits=me,ut(ue))}function Ge(ue,me){var pe,be;return ue?(be=new ge,ue.state=be,be.window=null,pe=Ze(ue,me),pe!==M&&(ue.state=null),pe):A}function lt(ue){return Ge(ue,ce)}var z=!0,T,I;function O(ue){if(z){var me;for(T=new t.Buf32(512),I=new t.Buf32(32),me=0;me<144;)ue.lens[me++]=8;for(;me<256;)ue.lens[me++]=9;for(;me<280;)ue.lens[me++]=7;for(;me<288;)ue.lens[me++]=8;for(i(l,ue.lens,0,288,T,0,ue.work,{bits:9}),me=0;me<32;)ue.lens[me++]=5;i(p,ue.lens,0,32,I,0,ue.work,{bits:5}),z=!1}ue.lencode=T,ue.lenbits=9,ue.distcode=I,ue.distbits=5}function q(ue,me,pe,be){var Qe,se=ue.state;return se.window===null&&(se.wsize=1<<se.wbits,se.wnext=0,se.whave=0,se.window=new t.Buf8(se.wsize)),be>=se.wsize?(t.arraySet(se.window,me,pe-se.wsize,se.wsize,0),se.wnext=0,se.whave=se.wsize):(Qe=se.wsize-se.wnext,Qe>be&&(Qe=be),t.arraySet(se.window,me,pe-be,Qe,se.wnext),be-=Qe,be?(t.arraySet(se.window,me,pe-be,be,0),se.wnext=be,se.whave=se.wsize):(se.wnext+=Qe,se.wnext===se.wsize&&(se.wnext=0),se.whave<se.wsize&&(se.whave+=Qe))),0}function H(ue,me){var pe,be,Qe,se,ye,Ee,Fe,de,xe,ct,_e,Ve,vt,Ye,et=0,mt,We,nt,bt,Je,at,yt,Xe,it=new t.Buf8(4),_t,dt,Mt=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!ue||!ue.state||!ue.output||!ue.input&&ue.avail_in!==0)return A;pe=ue.state,pe.mode===u&&(pe.mode=c),ye=ue.next_out,Qe=ue.output,Fe=ue.avail_out,se=ue.next_in,be=ue.input,Ee=ue.avail_in,de=pe.hold,xe=pe.bits,ct=Ee,_e=Fe,Xe=M;e:for(;;)switch(pe.mode){case C:if(pe.wrap===0){pe.mode=c;break}for(;xe<16;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}if(pe.wrap&2&&de===35615){pe.check=0,it[0]=de&255,it[1]=de>>>8&255,pe.check=r(pe.check,it,2,0),de=0,xe=0,pe.mode=Y;break}if(pe.flags=0,pe.head&&(pe.head.done=!1),!(pe.wrap&1)||(((de&255)<<8)+(de>>8))%31){ue.msg="incorrect header check",pe.mode=j;break}if((de&15)!==L){ue.msg="unknown compression method",pe.mode=j;break}if(de>>>=4,xe-=4,yt=(de&15)+8,pe.wbits===0)pe.wbits=yt;else if(yt>pe.wbits){ue.msg="invalid window size",pe.mode=j;break}pe.dmax=1<<yt,ue.adler=pe.check=1,pe.mode=de&512?s:u,de=0,xe=0;break;case Y:for(;xe<16;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}if(pe.flags=de,(pe.flags&255)!==L){ue.msg="unknown compression method",pe.mode=j;break}if(pe.flags&57344){ue.msg="unknown header flags set",pe.mode=j;break}pe.head&&(pe.head.text=de>>8&1),pe.flags&512&&(it[0]=de&255,it[1]=de>>>8&255,pe.check=r(pe.check,it,2,0)),de=0,xe=0,pe.mode=G;case G:for(;xe<32;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}pe.head&&(pe.head.time=de),pe.flags&512&&(it[0]=de&255,it[1]=de>>>8&255,it[2]=de>>>16&255,it[3]=de>>>24&255,pe.check=r(pe.check,it,4,0)),de=0,xe=0,pe.mode=ee;case ee:for(;xe<16;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}pe.head&&(pe.head.xflags=de&255,pe.head.os=de>>8),pe.flags&512&&(it[0]=de&255,it[1]=de>>>8&255,pe.check=r(pe.check,it,2,0)),de=0,xe=0,pe.mode=D;case D:if(pe.flags&1024){for(;xe<16;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}pe.length=de,pe.head&&(pe.head.extra_len=de),pe.flags&512&&(it[0]=de&255,it[1]=de>>>8&255,pe.check=r(pe.check,it,2,0)),de=0,xe=0}else pe.head&&(pe.head.extra=null);pe.mode=U;case U:if(pe.flags&1024&&(Ve=pe.length,Ve>Ee&&(Ve=Ee),Ve&&(pe.head&&(yt=pe.head.extra_len-pe.length,pe.head.extra||(pe.head.extra=new Array(pe.head.extra_len)),t.arraySet(pe.head.extra,be,se,Ve,yt)),pe.flags&512&&(pe.check=r(pe.check,be,Ve,se)),Ee-=Ve,se+=Ve,pe.length-=Ve),pe.length))break e;pe.length=0,pe.mode=V;case V:if(pe.flags&2048){if(Ee===0)break e;Ve=0;do yt=be[se+Ve++],pe.head&&yt&&pe.length<65536&&(pe.head.name+=String.fromCharCode(yt));while(yt&&Ve<Ee);if(pe.flags&512&&(pe.check=r(pe.check,be,Ve,se)),Ee-=Ve,se+=Ve,yt)break e}else pe.head&&(pe.head.name=null);pe.length=0,pe.mode=_;case _:if(pe.flags&4096){if(Ee===0)break e;Ve=0;do yt=be[se+Ve++],pe.head&&yt&&pe.length<65536&&(pe.head.comment+=String.fromCharCode(yt));while(yt&&Ve<Ee);if(pe.flags&512&&(pe.check=r(pe.check,be,Ve,se)),Ee-=Ve,se+=Ve,yt)break e}else pe.head&&(pe.head.comment=null);pe.mode=n;case n:if(pe.flags&512){for(;xe<16;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}if(de!==(pe.check&65535)){ue.msg="header crc mismatch",pe.mode=j;break}de=0,xe=0}pe.head&&(pe.head.hcrc=pe.flags>>9&1,pe.head.done=!0),ue.adler=pe.check=0,pe.mode=u;break;case s:for(;xe<32;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}ue.adler=pe.check=ot(de),de=0,xe=0,pe.mode=f;case f:if(pe.havedict===0)return ue.next_out=ye,ue.avail_out=Fe,ue.next_in=se,ue.avail_in=Ee,pe.hold=de,pe.bits=xe,E;ue.adler=pe.check=1,pe.mode=u;case u:if(me===g||me===y)break e;case c:if(pe.last){de>>>=xe&7,xe-=xe&7,pe.mode=K;break}for(;xe<3;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}switch(pe.last=de&1,de>>>=1,xe-=1,de&3){case 0:pe.mode=m;break;case 1:if(O(pe),pe.mode=S,me===y){de>>>=2,xe-=2;break e}break;case 2:pe.mode=o;break;case 3:ue.msg="invalid block type",pe.mode=j}de>>>=2,xe-=2;break;case m:for(de>>>=xe&7,xe-=xe&7;xe<32;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}if((de&65535)!==(de>>>16^65535)){ue.msg="invalid stored block lengths",pe.mode=j;break}if(pe.length=de&65535,de=0,xe=0,pe.mode=w,me===y)break e;case w:pe.mode=d;case d:if(Ve=pe.length,Ve){if(Ve>Ee&&(Ve=Ee),Ve>Fe&&(Ve=Fe),Ve===0)break e;t.arraySet(Qe,be,se,Ve,ye),Ee-=Ve,se+=Ve,Fe-=Ve,ye+=Ve,pe.length-=Ve;break}pe.mode=u;break;case o:for(;xe<14;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}if(pe.nlen=(de&31)+257,de>>>=5,xe-=5,pe.ndist=(de&31)+1,de>>>=5,xe-=5,pe.ncode=(de&15)+4,de>>>=4,xe-=4,pe.nlen>286||pe.ndist>30){ue.msg="too many length or distance symbols",pe.mode=j;break}pe.have=0,pe.mode=v;case v:for(;pe.have<pe.ncode;){for(;xe<3;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}pe.lens[Mt[pe.have++]]=de&7,de>>>=3,xe-=3}for(;pe.have<19;)pe.lens[Mt[pe.have++]]=0;if(pe.lencode=pe.lendyn,pe.lenbits=7,_t={bits:pe.lenbits},Xe=i(h,pe.lens,0,19,pe.lencode,0,pe.work,_t),pe.lenbits=_t.bits,Xe){ue.msg="invalid code lengths set",pe.mode=j;break}pe.have=0,pe.mode=R;case R:for(;pe.have<pe.nlen+pe.ndist;){for(;et=pe.lencode[de&(1<<pe.lenbits)-1],mt=et>>>24,We=et>>>16&255,nt=et&65535,!(mt<=xe);){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}if(nt<16)de>>>=mt,xe-=mt,pe.lens[pe.have++]=nt;else{if(nt===16){for(dt=mt+2;xe<dt;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}if(de>>>=mt,xe-=mt,pe.have===0){ue.msg="invalid bit length repeat",pe.mode=j;break}yt=pe.lens[pe.have-1],Ve=3+(de&3),de>>>=2,xe-=2}else if(nt===17){for(dt=mt+3;xe<dt;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}de>>>=mt,xe-=mt,yt=0,Ve=3+(de&7),de>>>=3,xe-=3}else{for(dt=mt+7;xe<dt;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}de>>>=mt,xe-=mt,yt=0,Ve=11+(de&127),de>>>=7,xe-=7}if(pe.have+Ve>pe.nlen+pe.ndist){ue.msg="invalid bit length repeat",pe.mode=j;break}for(;Ve--;)pe.lens[pe.have++]=yt}}if(pe.mode===j)break;if(pe.lens[256]===0){ue.msg="invalid code -- missing end-of-block",pe.mode=j;break}if(pe.lenbits=9,_t={bits:pe.lenbits},Xe=i(l,pe.lens,0,pe.nlen,pe.lencode,0,pe.work,_t),pe.lenbits=_t.bits,Xe){ue.msg="invalid literal/lengths set",pe.mode=j;break}if(pe.distbits=6,pe.distcode=pe.distdyn,_t={bits:pe.distbits},Xe=i(p,pe.lens,pe.nlen,pe.ndist,pe.distcode,0,pe.work,_t),pe.distbits=_t.bits,Xe){ue.msg="invalid distances set",pe.mode=j;break}if(pe.mode=S,me===y)break e;case S:pe.mode=B;case B:if(Ee>=6&&Fe>=258){ue.next_out=ye,ue.avail_out=Fe,ue.next_in=se,ue.avail_in=Ee,pe.hold=de,pe.bits=xe,a(ue,_e),ye=ue.next_out,Qe=ue.output,Fe=ue.avail_out,se=ue.next_in,be=ue.input,Ee=ue.avail_in,de=pe.hold,xe=pe.bits,pe.mode===u&&(pe.back=-1);break}for(pe.back=0;et=pe.lencode[de&(1<<pe.lenbits)-1],mt=et>>>24,We=et>>>16&255,nt=et&65535,!(mt<=xe);){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}if(We&&!(We&240)){for(bt=mt,Je=We,at=nt;et=pe.lencode[at+((de&(1<<bt+Je)-1)>>bt)],mt=et>>>24,We=et>>>16&255,nt=et&65535,!(bt+mt<=xe);){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}de>>>=bt,xe-=bt,pe.back+=bt}if(de>>>=mt,xe-=mt,pe.back+=mt,pe.length=nt,We===0){pe.mode=Z;break}if(We&32){pe.back=-1,pe.mode=u;break}if(We&64){ue.msg="invalid literal/length code",pe.mode=j;break}pe.extra=We&15,pe.mode=F;case F:if(pe.extra){for(dt=pe.extra;xe<dt;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}pe.length+=de&(1<<pe.extra)-1,de>>>=pe.extra,xe-=pe.extra,pe.back+=pe.extra}pe.was=pe.length,pe.mode=$;case $:for(;et=pe.distcode[de&(1<<pe.distbits)-1],mt=et>>>24,We=et>>>16&255,nt=et&65535,!(mt<=xe);){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}if(!(We&240)){for(bt=mt,Je=We,at=nt;et=pe.distcode[at+((de&(1<<bt+Je)-1)>>bt)],mt=et>>>24,We=et>>>16&255,nt=et&65535,!(bt+mt<=xe);){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}de>>>=bt,xe-=bt,pe.back+=bt}if(de>>>=mt,xe-=mt,pe.back+=mt,We&64){ue.msg="invalid distance code",pe.mode=j;break}pe.offset=nt,pe.extra=We&15,pe.mode=re;case re:if(pe.extra){for(dt=pe.extra;xe<dt;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}pe.offset+=de&(1<<pe.extra)-1,de>>>=pe.extra,xe-=pe.extra,pe.back+=pe.extra}if(pe.offset>pe.dmax){ue.msg="invalid distance too far back",pe.mode=j;break}pe.mode=Q;case Q:if(Fe===0)break e;if(Ve=_e-Fe,pe.offset>Ve){if(Ve=pe.offset-Ve,Ve>pe.whave&&pe.sane){ue.msg="invalid distance too far back",pe.mode=j;break}Ve>pe.wnext?(Ve-=pe.wnext,vt=pe.wsize-Ve):vt=pe.wnext-Ve,Ve>pe.length&&(Ve=pe.length),Ye=pe.window}else Ye=Qe,vt=ye-pe.offset,Ve=pe.length;Ve>Fe&&(Ve=Fe),Fe-=Ve,pe.length-=Ve;do Qe[ye++]=Ye[vt++];while(--Ve);pe.length===0&&(pe.mode=B);break;case Z:if(Fe===0)break e;Qe[ye++]=pe.length,Fe--,pe.mode=B;break;case K:if(pe.wrap){for(;xe<32;){if(Ee===0)break e;Ee--,de|=be[se++]<<xe,xe+=8}if(_e-=Fe,ue.total_out+=_e,pe.total+=_e,_e&&(ue.adler=pe.check=pe.flags?r(pe.check,Qe,_e,ye-_e):e(pe.check,Qe,_e,ye-_e)),_e=Fe,(pe.flags?de:ot(de))!==pe.check){ue.msg="incorrect data check",pe.mode=j;break}de=0,xe=0}pe.mode=le;case le:if(pe.wrap&&pe.flags){for(;xe<32;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}if(de!==(pe.total&4294967295)){ue.msg="incorrect length check",pe.mode=j;break}de=0,xe=0}pe.mode=te;case te:Xe=x;break e;case j:Xe=k;break e;case J:return P;case X:default:return A}return ue.next_out=ye,ue.avail_out=Fe,ue.next_in=se,ue.avail_in=Ee,pe.hold=de,pe.bits=xe,(pe.wsize||_e!==ue.avail_out&&pe.mode<j&&(pe.mode<K||me!==b))&&q(ue,ue.output,ue.next_out,_e-ue.avail_out),ct-=ue.avail_in,_e-=ue.avail_out,ue.total_in+=ct,ue.total_out+=_e,pe.total+=_e,pe.wrap&&_e&&(ue.adler=pe.check=pe.flags?r(pe.check,Qe,_e,ue.next_out-_e):e(pe.check,Qe,_e,ue.next_out-_e)),ue.data_type=pe.bits+(pe.last?64:0)+(pe.mode===u?128:0)+(pe.mode===S||pe.mode===w?256:0),(ct===0&&_e===0||me===b)&&Xe===M&&(Xe=N),Xe}function W(ue){if(!ue||!ue.state)return A;var me=ue.state;return me.window&&(me.window=null),ue.state=null,M}function fe(ue,me){var pe;return!ue||!ue.state||(pe=ue.state,!(pe.wrap&2))?A:(pe.head=me,me.done=!1,M)}function st(ue,me){var pe=me.length,be,Qe,se;return!ue||!ue.state||(be=ue.state,be.wrap!==0&&be.mode!==f)?A:be.mode===f&&(Qe=1,Qe=e(Qe,me,pe,0),Qe!==be.check)?k:(se=q(ue,me,pe,pe),se?(be.mode=J,P):(be.havedict=1,M))}return Cs.inflateReset=ut,Cs.inflateReset2=Ze,Cs.inflateResetKeep=Se,Cs.inflateInit=lt,Cs.inflateInit2=Ge,Cs.inflate=H,Cs.inflateEnd=W,Cs.inflateGetHeader=fe,Cs.inflateSetDictionary=st,Cs.inflateInfo="pako inflate (from Nodeca project)",Cs}function gAe(){return Fie||(Fie=!0,Kk={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}),Kk}function bAe(){if(jie)return Dt;jie=!0;var t=ni.Buffer,e=yr,r=ar,a=hAe(),i=dAe(),h=mAe(),l=gAe();for(var p in l)Dt[p]=l[p];Dt.NONE=0,Dt.DEFLATE=1,Dt.INFLATE=2,Dt.GZIP=3,Dt.GUNZIP=4,Dt.DEFLATERAW=5,Dt.INFLATERAW=6,Dt.UNZIP=7;var b=31,g=139;function y(M){if(typeof M!="number"||M<Dt.DEFLATE||M>Dt.UNZIP)throw new TypeError("Bad argument");this.dictionary=null,this.err=0,this.flush=0,this.init_done=!1,this.level=0,this.memLevel=0,this.mode=M,this.strategy=0,this.windowBits=0,this.write_in_progress=!1,this.pending_close=!1,this.gzip_id_bytes_read=0}return y.prototype.close=function(){if(this.write_in_progress){this.pending_close=!0;return}this.pending_close=!1,r(this.init_done,"close before init"),r(this.mode<=Dt.UNZIP),this.mode===Dt.DEFLATE||this.mode===Dt.GZIP||this.mode===Dt.DEFLATERAW?i.deflateEnd(this.strm):(this.mode===Dt.INFLATE||this.mode===Dt.GUNZIP||this.mode===Dt.INFLATERAW||this.mode===Dt.UNZIP)&&h.inflateEnd(this.strm),this.mode=Dt.NONE,this.dictionary=null},y.prototype.write=function(M,x,E,A,k,P,N){return this._write(!0,M,x,E,A,k,P,N)},y.prototype.writeSync=function(M,x,E,A,k,P,N){return this._write(!1,M,x,E,A,k,P,N)},y.prototype._write=function(M,x,E,A,k,P,N,L){if(r.equal(arguments.length,8),r(this.init_done,"write before init"),r(this.mode!==Dt.NONE,"already finalized"),r.equal(!1,this.write_in_progress,"write already in progress"),r.equal(!1,this.pending_close,"close is pending"),this.write_in_progress=!0,r.equal(!1,x===void 0,"must provide flush value"),this.write_in_progress=!0,x!==Dt.Z_NO_FLUSH&&x!==Dt.Z_PARTIAL_FLUSH&&x!==Dt.Z_SYNC_FLUSH&&x!==Dt.Z_FULL_FLUSH&&x!==Dt.Z_FINISH&&x!==Dt.Z_BLOCK)throw new Error("Invalid flush value");if(E==null&&(E=t.alloc(0),k=0,A=0),this.strm.avail_in=k,this.strm.input=E,this.strm.next_in=A,this.strm.avail_out=L,this.strm.output=P,this.strm.next_out=N,this.flush=x,!M)return this._process(),this._checkError()?this._afterSync():void 0;var C=this;return e.nextTick(function(){C._process(),C._after()}),this},y.prototype._afterSync=function(){var M=this.strm.avail_out,x=this.strm.avail_in;return this.write_in_progress=!1,[x,M]},y.prototype._process=function(){var M=null;switch(this.mode){case Dt.DEFLATE:case Dt.GZIP:case Dt.DEFLATERAW:this.err=i.deflate(this.strm,this.flush);break;case Dt.UNZIP:switch(this.strm.avail_in>0&&(M=this.strm.next_in),this.gzip_id_bytes_read){case 0:if(M===null)break;if(this.strm.input[M]===b){if(this.gzip_id_bytes_read=1,M++,this.strm.avail_in===1)break}else{this.mode=Dt.INFLATE;break}case 1:if(M===null)break;this.strm.input[M]===g?(this.gzip_id_bytes_read=2,this.mode=Dt.GUNZIP):this.mode=Dt.INFLATE;break;default:throw new Error("invalid number of gzip magic number bytes read")}case Dt.INFLATE:case Dt.GUNZIP:case Dt.INFLATERAW:for(this.err=h.inflate(this.strm,this.flush),this.err===Dt.Z_NEED_DICT&&this.dictionary&&(this.err=h.inflateSetDictionary(this.strm,this.dictionary),this.err===Dt.Z_OK?this.err=h.inflate(this.strm,this.flush):this.err===Dt.Z_DATA_ERROR&&(this.err=Dt.Z_NEED_DICT));this.strm.avail_in>0&&this.mode===Dt.GUNZIP&&this.err===Dt.Z_STREAM_END&&this.strm.next_in[0]!==0;)this.reset(),this.err=h.inflate(this.strm,this.flush);break;default:throw new Error("Unknown mode "+this.mode)}},y.prototype._checkError=function(){switch(this.err){case Dt.Z_OK:case Dt.Z_BUF_ERROR:if(this.strm.avail_out!==0&&this.flush===Dt.Z_FINISH)return this._error("unexpected end of file"),!1;break;case Dt.Z_STREAM_END:break;case Dt.Z_NEED_DICT:return this.dictionary==null?this._error("Missing dictionary"):this._error("Bad dictionary"),!1;default:return this._error("Zlib error"),!1}return!0},y.prototype._after=function(){if(this._checkError()){var M=this.strm.avail_out,x=this.strm.avail_in;this.write_in_progress=!1,this.callback(x,M),this.pending_close&&this.close()}},y.prototype._error=function(M){this.strm.msg&&(M=this.strm.msg),this.onerror(M,this.err),this.write_in_progress=!1,this.pending_close&&this.close()},y.prototype.init=function(M,x,E,A,k){r(arguments.length===4||arguments.length===5,"init(windowBits, level, memLevel, strategy, [dictionary])"),r(M>=8&&M<=15,"invalid windowBits"),r(x>=-1&&x<=9,"invalid compression level"),r(E>=1&&E<=9,"invalid memlevel"),r(A===Dt.Z_FILTERED||A===Dt.Z_HUFFMAN_ONLY||A===Dt.Z_RLE||A===Dt.Z_FIXED||A===Dt.Z_DEFAULT_STRATEGY,"invalid strategy"),this._init(x,M,E,A,k),this._setDictionary()},y.prototype.params=function(){throw new Error("deflateParams Not supported")},y.prototype.reset=function(){this._reset(),this._setDictionary()},y.prototype._init=function(M,x,E,A,k){switch(this.level=M,this.windowBits=x,this.memLevel=E,this.strategy=A,this.flush=Dt.Z_NO_FLUSH,this.err=Dt.Z_OK,(this.mode===Dt.GZIP||this.mode===Dt.GUNZIP)&&(this.windowBits+=16),this.mode===Dt.UNZIP&&(this.windowBits+=32),(this.mode===Dt.DEFLATERAW||this.mode===Dt.INFLATERAW)&&(this.windowBits=-1*this.windowBits),this.strm=new a,this.mode){case Dt.DEFLATE:case Dt.GZIP:case Dt.DEFLATERAW:this.err=i.deflateInit2(this.strm,this.level,Dt.Z_DEFLATED,this.windowBits,this.memLevel,this.strategy);break;case Dt.INFLATE:case Dt.GUNZIP:case Dt.INFLATERAW:case Dt.UNZIP:this.err=h.inflateInit2(this.strm,this.windowBits);break;default:throw new Error("Unknown mode "+this.mode)}this.err!==Dt.Z_OK&&this._error("Init error"),this.dictionary=k,this.write_in_progress=!1,this.init_done=!0},y.prototype._setDictionary=function(){if(this.dictionary!=null){switch(this.err=Dt.Z_OK,this.mode){case Dt.DEFLATE:case Dt.DEFLATERAW:this.err=i.deflateSetDictionary(this.strm,this.dictionary);break}this.err!==Dt.Z_OK&&this._error("Failed to set dictionary")}},y.prototype._reset=function(){switch(this.err=Dt.Z_OK,this.mode){case Dt.DEFLATE:case Dt.DEFLATERAW:case Dt.GZIP:this.err=i.deflateReset(this.strm);break;case Dt.INFLATE:case Dt.INFLATERAW:case Dt.GUNZIP:this.err=h.inflateReset(this.strm);break}this.err!==Dt.Z_OK&&this._error("Failed to reset stream")},Dt.Zlib=y,Dt}function yAe(){if(zie)return tr;zie=!0;var t=yr,e=ni.Buffer,r=ka.Transform,a=bAe(),i=gt,h=ar.ok,l=ni.kMaxLength,p="Cannot create final Buffer. It would be larger than 0x"+l.toString(16)+" bytes";a.Z_MIN_WINDOWBITS=8,a.Z_MAX_WINDOWBITS=15,a.Z_DEFAULT_WINDOWBITS=15,a.Z_MIN_CHUNK=64,a.Z_MAX_CHUNK=1/0,a.Z_DEFAULT_CHUNK=16*1024,a.Z_MIN_MEMLEVEL=1,a.Z_MAX_MEMLEVEL=9,a.Z_DEFAULT_MEMLEVEL=8,a.Z_MIN_LEVEL=-1,a.Z_MAX_LEVEL=9,a.Z_DEFAULT_LEVEL=a.Z_DEFAULT_COMPRESSION;for(var b=Object.keys(a),g=0;g<b.length;g++){var y=b[g];y.match(/^Z/)&&Object.defineProperty(tr,y,{enumerable:!0,value:a[y],writable:!1})}for(var M={Z_OK:a.Z_OK,Z_STREAM_END:a.Z_STREAM_END,Z_NEED_DICT:a.Z_NEED_DICT,Z_ERRNO:a.Z_ERRNO,Z_STREAM_ERROR:a.Z_STREAM_ERROR,Z_DATA_ERROR:a.Z_DATA_ERROR,Z_MEM_ERROR:a.Z_MEM_ERROR,Z_BUF_ERROR:a.Z_BUF_ERROR,Z_VERSION_ERROR:a.Z_VERSION_ERROR},x=Object.keys(M),E=0;E<x.length;E++){var A=x[E];M[M[A]]=A}Object.defineProperty(tr,"codes",{enumerable:!0,value:Object.freeze(M),writable:!1}),tr.Deflate=N,tr.Inflate=L,tr.Gzip=C,tr.Gunzip=Y,tr.DeflateRaw=G,tr.InflateRaw=ee,tr.Unzip=D,tr.createDeflate=function(s){return new N(s)},tr.createInflate=function(s){return new L(s)},tr.createDeflateRaw=function(s){return new G(s)},tr.createInflateRaw=function(s){return new ee(s)},tr.createGzip=function(s){return new C(s)},tr.createGunzip=function(s){return new Y(s)},tr.createUnzip=function(s){return new D(s)},tr.deflate=function(s,f,u){return typeof f=="function"&&(u=f,f={}),k(new N(f),s,u)},tr.deflateSync=function(s,f){return P(new N(f),s)},tr.gzip=function(s,f,u){return typeof f=="function"&&(u=f,f={}),k(new C(f),s,u)},tr.gzipSync=function(s,f){return P(new C(f),s)},tr.deflateRaw=function(s,f,u){return typeof f=="function"&&(u=f,f={}),k(new G(f),s,u)},tr.deflateRawSync=function(s,f){return P(new G(f),s)},tr.unzip=function(s,f,u){return typeof f=="function"&&(u=f,f={}),k(new D(f),s,u)},tr.unzipSync=function(s,f){return P(new D(f),s)},tr.inflate=function(s,f,u){return typeof f=="function"&&(u=f,f={}),k(new L(f),s,u)},tr.inflateSync=function(s,f){return P(new L(f),s)},tr.gunzip=function(s,f,u){return typeof f=="function"&&(u=f,f={}),k(new Y(f),s,u)},tr.gunzipSync=function(s,f){return P(new Y(f),s)},tr.inflateRaw=function(s,f,u){return typeof f=="function"&&(u=f,f={}),k(new ee(f),s,u)},tr.inflateRawSync=function(s,f){return P(new ee(f),s)};function k(s,f,u){var c=[],m=0;s.on("error",d),s.on("end",o),s.end(f),w();function w(){for(var v;(v=s.read())!==null;)c.push(v),m+=v.length;s.once("readable",w)}function d(v){s.removeListener("end",o),s.removeListener("readable",w),u(v)}function o(){var v,R=null;m>=l?R=new RangeError(p):v=e.concat(c,m),c=[],s.close(),u(R,v)}}function P(s,f){if(typeof f=="string"&&(f=e.from(f)),!e.isBuffer(f))throw new TypeError("Not a string or buffer");var u=s._finishFlushFlag;return s._processChunk(f,u)}function N(s){if(!(this instanceof N))return new N(s);V.call(this,s,a.DEFLATE)}function L(s){if(!(this instanceof L))return new L(s);V.call(this,s,a.INFLATE)}function C(s){if(!(this instanceof C))return new C(s);V.call(this,s,a.GZIP)}function Y(s){if(!(this instanceof Y))return new Y(s);V.call(this,s,a.GUNZIP)}function G(s){if(!(this instanceof G))return new G(s);V.call(this,s,a.DEFLATERAW)}function ee(s){if(!(this instanceof ee))return new ee(s);V.call(this,s,a.INFLATERAW)}function D(s){if(!(this instanceof D))return new D(s);V.call(this,s,a.UNZIP)}function U(s){return s===a.Z_NO_FLUSH||s===a.Z_PARTIAL_FLUSH||s===a.Z_SYNC_FLUSH||s===a.Z_FULL_FLUSH||s===a.Z_FINISH||s===a.Z_BLOCK}function V(s,f){var u=this;if(this._opts=s=s||{},this._chunkSize=s.chunkSize||tr.Z_DEFAULT_CHUNK,r.call(this,s),s.flush&&!U(s.flush))throw new Error("Invalid flush flag: "+s.flush);if(s.finishFlush&&!U(s.finishFlush))throw new Error("Invalid flush flag: "+s.finishFlush);if(this._flushFlag=s.flush||a.Z_NO_FLUSH,this._finishFlushFlag=typeof s.finishFlush<"u"?s.finishFlush:a.Z_FINISH,s.chunkSize&&(s.chunkSize<tr.Z_MIN_CHUNK||s.chunkSize>tr.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+s.chunkSize);if(s.windowBits&&(s.windowBits<tr.Z_MIN_WINDOWBITS||s.windowBits>tr.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+s.windowBits);if(s.level&&(s.level<tr.Z_MIN_LEVEL||s.level>tr.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+s.level);if(s.memLevel&&(s.memLevel<tr.Z_MIN_MEMLEVEL||s.memLevel>tr.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+s.memLevel);if(s.strategy&&s.strategy!=tr.Z_FILTERED&&s.strategy!=tr.Z_HUFFMAN_ONLY&&s.strategy!=tr.Z_RLE&&s.strategy!=tr.Z_FIXED&&s.strategy!=tr.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+s.strategy);if(s.dictionary&&!e.isBuffer(s.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._handle=new a.Zlib(f);var c=this;this._hadError=!1,this._handle.onerror=function(d,o){_(c),c._hadError=!0;var v=new Error(d);v.errno=o,v.code=tr.codes[o],c.emit("error",v)};var m=tr.Z_DEFAULT_COMPRESSION;typeof s.level=="number"&&(m=s.level);var w=tr.Z_DEFAULT_STRATEGY;typeof s.strategy=="number"&&(w=s.strategy),this._handle.init(s.windowBits||tr.Z_DEFAULT_WINDOWBITS,m,s.memLevel||tr.Z_DEFAULT_MEMLEVEL,w,s.dictionary),this._buffer=e.allocUnsafe(this._chunkSize),this._offset=0,this._level=m,this._strategy=w,this.once("end",this.close),Object.defineProperty(this,"_closed",{get:function(){return!u._handle},configurable:!0,enumerable:!0})}i.inherits(V,r),V.prototype.params=function(s,f,u){if(s<tr.Z_MIN_LEVEL||s>tr.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+s);if(f!=tr.Z_FILTERED&&f!=tr.Z_HUFFMAN_ONLY&&f!=tr.Z_RLE&&f!=tr.Z_FIXED&&f!=tr.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+f);if(this._level!==s||this._strategy!==f){var c=this;this.flush(a.Z_SYNC_FLUSH,function(){h(c._handle,"zlib binding closed"),c._handle.params(s,f),c._hadError||(c._level=s,c._strategy=f,u&&u())})}else t.nextTick(u)},V.prototype.reset=function(){return h(this._handle,"zlib binding closed"),this._handle.reset()},V.prototype._flush=function(s){this._transform(e.alloc(0),"",s)},V.prototype.flush=function(s,f){var u=this,c=this._writableState;(typeof s=="function"||s===void 0&&!f)&&(f=s,s=a.Z_FULL_FLUSH),c.ended?f&&t.nextTick(f):c.ending?f&&this.once("end",f):c.needDrain?f&&this.once("drain",function(){return u.flush(s,f)}):(this._flushFlag=s,this.write(e.alloc(0),"",f))},V.prototype.close=function(s){_(this,s),t.nextTick(n,this)};function _(s,f){f&&t.nextTick(f),s._handle&&(s._handle.close(),s._handle=null)}function n(s){s.emit("close")}return V.prototype._transform=function(s,f,u){var c,m=this._writableState,w=m.ending||m.ended,d=w&&(!s||m.length===s.length);if(s!==null&&!e.isBuffer(s))return u(new Error("invalid input"));if(!this._handle)return u(new Error("zlib binding closed"));d?c=this._finishFlushFlag:(c=this._flushFlag,s.length>=m.length&&(this._flushFlag=this._opts.flush||a.Z_NO_FLUSH)),this._processChunk(s,c,u)},V.prototype._processChunk=function(s,f,u){var c=s&&s.length,m=this._chunkSize-this._offset,w=0,d=this,o=typeof u=="function";if(!o){var v=[],R=0,S;this.on("error",function(Q){S=Q}),h(this._handle,"zlib binding closed");do var B=this._handle.writeSync(f,s,w,c,this._buffer,this._offset,m);while(!this._hadError&&re(B[0],B[1]));if(this._hadError)throw S;if(R>=l)throw _(this),new RangeError(p);var F=e.concat(v,R);return _(this),F}h(this._handle,"zlib binding closed");var $=this._handle.write(f,s,w,c,this._buffer,this._offset,m);$.buffer=s,$.callback=re;function re(Q,Z){if(this&&(this.buffer=null,this.callback=null),!d._hadError){var K=m-Z;if(h(K>=0,"have should not go down"),K>0){var le=d._buffer.slice(d._offset,d._offset+K);d._offset+=K,o?d.push(le):(v.push(le),R+=le.length)}if((Z===0||d._offset>=d._chunkSize)&&(m=d._chunkSize,d._offset=0,d._buffer=e.allocUnsafe(d._chunkSize)),Z===0){if(w+=c-Q,c=Q,!o)return!0;var te=d._handle.write(f,s,w,c,d._buffer,d._offset,d._chunkSize);te.callback=re,te.buffer=s;return}if(!o)return!1;u()}}},i.inherits(N,V),i.inherits(L,V),i.inherits(C,V),i.inherits(Y,V),i.inherits(G,V),i.inherits(ee,V),i.inherits(D,V),tr}var Uk,Bie,Ba,Pie,Bd,Oie,Fk,Nie,jk,Cie,zk,Lie,Of,Die,Zk,$ie,Hk,qie,Cs,Uie,Kk,Fie,Dt,jie,tr,zie,At,wAe,_Ae,MAe,xAe,SAe,EAe,AAe,RAe,TAe,kAe,IAe,BAe,PAe,OAe,NAe,CAe,LAe,DAe,$Ae,qAe,UAe,FAe,jAe,zAe,ZAe,HAe,KAe,WAe,VAe,GAe,YAe,JAe,XAe,QAe,eRe,tRe,rRe,iRe,nRe,aRe,oRe,sRe,fRe,uRe,hRe,lRe,cRe,dRe,pRe,vRe,mRe,gRe,bRe,yRe,wRe,_Re,MRe,xRe,SRe,ERe,ARe,RRe,TRe,kRe,IRe,BRe,PRe,ORe,NRe,Wie=Si(()=>{"use strict";ie();ae();ne();oh();I8();yk();Ws();no();Rg();jo();Ks();rh();Uo();Yf();Z0();Uk={},Bie=!1;Ba={},Pie=!1;Bd={},Oie=!1;Fk={},Nie=!1;jk={},Cie=!1;zk={},Lie=!1;Of={},Die=!1;Zk={},$ie=!1;Hk={},qie=!1;Cs={},Uie=!1;Kk={},Fie=!1;Dt={},jie=!1;tr={},zie=!1;At=yAe();At.codes;At.Deflate;At.Inflate;At.Gzip;At.Gunzip;At.DeflateRaw;At.InflateRaw;At.Unzip;At.createDeflate;At.createInflate;At.createDeflateRaw;At.createInflateRaw;At.createGzip;At.createGunzip;At.createUnzip;At.deflate;At.deflateSync;At.gzip;At.gzipSync;At.deflateRaw;At.deflateRawSync;At.unzip;At.unzipSync;At.inflate;At.inflateSync;At.gunzip;At.gunzipSync;At.inflateRaw;At.inflateRawSync;wAe=At.Deflate,_Ae=At.DeflateRaw,MAe=At.Gunzip,xAe=At.Gzip,SAe=At.Inflate,EAe=At.InflateRaw,AAe=At.Unzip,RAe=At.Z_BEST_COMPRESSION,TAe=At.Z_BEST_SPEED,kAe=At.Z_BINARY,IAe=At.Z_BLOCK,BAe=At.Z_BUF_ERROR,PAe=At.Z_DATA_ERROR,OAe=At.Z_DEFAULT_CHUNK,NAe=At.Z_DEFAULT_COMPRESSION,CAe=At.Z_DEFAULT_LEVEL,LAe=At.Z_DEFAULT_MEMLEVEL,DAe=At.Z_DEFAULT_STRATEGY,$Ae=At.Z_DEFAULT_WINDOWBITS,qAe=At.Z_DEFLATED,UAe=At.Z_ERRNO,FAe=At.Z_FILTERED,jAe=At.Z_FINISH,zAe=At.Z_FIXED,ZAe=At.Z_FULL_FLUSH,HAe=At.Z_HUFFMAN_ONLY,KAe=At.Z_MAX_CHUNK,WAe=At.Z_MAX_LEVEL,VAe=At.Z_MAX_MEMLEVEL,GAe=At.Z_MAX_WINDOWBITS,YAe=At.Z_MIN_CHUNK,JAe=At.Z_MIN_LEVEL,XAe=At.Z_MIN_MEMLEVEL,QAe=At.Z_MIN_WINDOWBITS,eRe=At.Z_NEED_DICT,tRe=At.Z_NO_COMPRESSION,rRe=At.Z_NO_FLUSH,iRe=At.Z_OK,nRe=At.Z_PARTIAL_FLUSH,aRe=At.Z_RLE,oRe=At.Z_STREAM_END,sRe=At.Z_STREAM_ERROR,fRe=At.Z_SYNC_FLUSH,uRe=At.Z_TEXT,hRe=At.Z_TREES,lRe=At.Z_UNKNOWN,cRe=At.Zlib,dRe=At.codes,pRe=At.createDeflate,vRe=At.createDeflateRaw,mRe=At.createGunzip,gRe=At.createGzip,bRe=At.createInflate,yRe=At.createInflateRaw,wRe=At.createUnzip,_Re=At.deflate,MRe=At.deflateRaw,xRe=At.deflateRawSync,SRe=At.deflateSync,ERe=At.gunzip,ARe=At.gunzipSync,RRe=At.gzip,TRe=At.gzipSync,kRe=At.inflate,IRe=At.inflateRaw,BRe=At.inflateRawSync,PRe=At.inflateSync,ORe=At.unzip,NRe=At.unzipSync});var Yie=ht((Dpt,Gie)=>{"use strict";ie();ae();ne();var F1=[],o2=[],Wk=function(){};function Gk(t){return~F1.indexOf(t)?!1:(F1.push(t),!0)}function Yk(t){Wk=t}function CRe(t){for(var e=[],r=0;r<F1.length;r++){if(F1[r].async){e.push(F1[r]);continue}if(F1[r](t))return!0}return e.length?new Promise(function(i){Promise.all(e.map(function(l){return l(t)})).then(function(l){i(l.some(Boolean))})}):!1}function Jk(t){return~o2.indexOf(t)?!1:(o2.push(t),!0)}function Vk(){Wk.apply(Wk,arguments)}function Vie(t){for(var e=0;e<o2.length;e++)t=o2[e].apply(o2[e],arguments);return t}function Xk(t,e){var r=Object.prototype.hasOwnProperty;for(var a in e)r.call(e,a)&&(t[a]=e[a]);return t}function LRe(t){return t.enabled=!1,t.modify=Jk,t.set=Yk,t.use=Gk,Xk(function(){return!1},t)}function DRe(t){function e(){var r=Array.prototype.slice.call(arguments,0);return Vk.call(Vk,t,Vie(r,t)),!0}return t.enabled=!0,t.modify=Jk,t.set=Yk,t.use=Gk,Xk(e,t)}Gie.exports=function(e){return e.introduce=Xk,e.enabled=CRe,e.process=Vie,e.modify=Jk,e.write=Vk,e.nope=LRe,e.yep=DRe,e.set=Yk,e.use=Gk,e}});var Xie=ht((Fpt,Jie)=>{"use strict";ie();ae();ne();var $Re=Yie(),qRe=$Re(function t(e,r){return r=r||{},r.namespace=e,r.prod=!0,r.dev=!1,r.force||t.force?t.yep(r):t.nope(r)});Jie.exports=qRe});var s2=ht((Hpt,Qie)=>{"use strict";ie();ae();ne();Qie.exports=Xie()});var ene={};Ha(ene,{StringDecoder:()=>URe,default:()=>An});var URe,tne=Si(()=>{"use strict";ie();ae();ne();Yf();Yf();URe=An.StringDecoder});var ine=ht((e1t,rne)=>{"use strict";ie();ae();ne();var Qk=(Nk(),ei(Ok)),FRe=(tne(),ei(ene)),jRe=FRe.StringDecoder,zRe=Oh(),ZRe=zRe.Stream;function HRe(){}rne.exports=function(t,e){var r=Me.alloc(65536),a=new jRe("utf8"),i=new ZRe,h="",l=0,p=0;return t.start===-1&&delete t.start,i.readable=!0,i.destroy=function(){i.destroyed=!0,i.emit("end"),i.emit("close")},Qk.open(t.file,"a+","0644",function(b,g){if(b){e?e(b):i.emit("error",b),i.destroy();return}(function y(){if(i.destroyed){Qk.close(g,HRe);return}return Qk.read(g,r,0,r.length,l,function(M,x){if(M){e?e(M):i.emit("error",M),i.destroy();return}if(!x)return h&&((t.start==null||p>t.start)&&(e?e(null,h):i.emit("line",h)),p++,h=""),setTimeout(y,1e3);var E=a.write(r.slice(0,x));e||i.emit("data",E),E=(h+E).split(/\n+/);for(var A=E.length-1,k=0;k<A;k++)(t.start==null||p>t.start)&&(e?e(null,E[k]):i.emit("line",E[k])),p++;return h=E[A],l+=x,y()})})()}),e?i.destroy:i}});var lne=ht((n1t,hne)=>{"use strict";ie();ae();ne();function jh(t){"@babel/helpers - typeof";return jh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},jh(t)}function KRe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function nne(t,e){for(var r=0;r<e.length;r++){var a=e[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,VRe(a.key),a)}}function WRe(t,e,r){return e&&nne(t.prototype,e),r&&nne(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function VRe(t){var e=GRe(t,"string");return jh(e)=="symbol"?e:String(e)}function GRe(t,e){if(jh(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e||"default");if(jh(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function YRe(t,e,r){return e=I4(e),JRe(t,sne()?Reflect.construct(e,r||[],I4(t).constructor):e.apply(t,r))}function JRe(t,e){if(e&&(jh(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return fne(t)}function sne(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(sne=function(){return!!t})()}function I4(t){return I4=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},I4(t)}function fne(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function XRe(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&eI(t,e)}function eI(t,e){return eI=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,i){return a.__proto__=i,a},eI(t,e)}var fo=(Nk(),ei(Ok)),na=(_k(),ei(lre)),ane=Iie(),QRe=(Wie(),ei(Kie)),eTe=sn(),tTe=eTe.MESSAGE,une=Oh(),rTe=une.Stream,one=une.PassThrough,iTe=O1(),Nf=s2()("winston:file"),nTe=(yd(),ei(bd)),aTe=ine();hne.exports=function(t){XRe(e,t);function e(){var r,a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};KRe(this,e),r=YRe(this,e,[a]),r.name=a.name||"file";function i(h){for(var l=arguments.length,p=new Array(l>1?l-1:0),b=1;b<l;b++)p[b-1]=arguments[b];p.slice(1).forEach(function(g){if(a[g])throw new Error("Cannot set ".concat(g," and ").concat(h," together"))})}if(r._stream=new one,r._stream.setMaxListeners(30),r._onError=r._onError.bind(fne(r)),a.filename||a.dirname)i("filename or dirname","stream"),r._basename=r.filename=a.filename?na.basename(a.filename):"winston.log",r.dirname=a.dirname||na.dirname(a.filename),r.options=a.options||{flags:"a"};else if(a.stream)console.warn("options.stream will be removed in winston@4. Use winston.transports.Stream"),i("stream","filename","maxsize"),r._dest=r._stream.pipe(r._setupStream(a.stream)),r.dirname=na.dirname(r._dest.path);else throw new Error("Cannot log to file without filename or stream.");return r.maxsize=a.maxsize||null,r.rotationFormat=a.rotationFormat||!1,r.zippedArchive=a.zippedArchive||!1,r.maxFiles=a.maxFiles||null,r.eol=typeof a.eol=="string"?a.eol:nTe.EOL,r.tailable=a.tailable||!1,r.lazy=a.lazy||!1,r._size=0,r._pendingSize=0,r._created=0,r._drain=!1,r._opening=!1,r._ending=!1,r._fileExist=!1,r.dirname&&r._createLogDirIfNotExist(r.dirname),r.lazy||r.open(),r}return WRe(e,[{key:"finishIfEnding",value:function(){var a=this;this._ending&&(this._opening?this.once("open",function(){a._stream.once("finish",function(){return a.emit("finish")}),setImmediate(function(){return a._stream.end()})}):(this._stream.once("finish",function(){return a.emit("finish")}),setImmediate(function(){return a._stream.end()})))}},{key:"log",value:function(a){var i=this,h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(){};if(this.silent)return h(),!0;if(this._drain){this._stream.once("drain",function(){i._drain=!1,i.log(a,h)});return}if(this._rotate){this._stream.once("rotate",function(){i._rotate=!1,i.log(a,h)});return}if(this.lazy){if(!this._fileExist){this._opening||this.open(),this.once("open",function(){i._fileExist=!0,i.log(a,h)});return}if(this._needsNewFile(this._pendingSize)){this._dest.once("close",function(){i._opening||i.open(),i.once("open",function(){i.log(a,h)})});return}}var l="".concat(a[tTe]).concat(this.eol),p=Me.byteLength(l);function b(){var y=this;if(this._size+=p,this._pendingSize-=p,Nf("logged %s %s",this._size,l),this.emit("logged",a),!this._rotate&&!this._opening&&this._needsNewFile()){if(this.lazy){this._endStream(function(){y.emit("fileclosed")});return}this._rotate=!0,this._endStream(function(){return y._rotateFile()})}}this._pendingSize+=p,this._opening&&!this.rotatedWhileOpening&&this._needsNewFile(this._size+this._pendingSize)&&(this.rotatedWhileOpening=!0);var g=this._stream.write(l,b.bind(this));return g?h():(this._drain=!0,this._stream.once("drain",function(){i._drain=!1,h()})),Nf("written",g,this._drain),this.finishIfEnding(),g}},{key:"query",value:function(a,i){typeof a=="function"&&(i=a,a={}),a=E(a);var h=na.join(this.dirname,this.filename),l="",p=[],b=0,g=fo.createReadStream(h,{encoding:"utf8"});g.on("error",function(A){if(g.readable&&g.destroy(),!!i)return A.code!=="ENOENT"?i(A):i(null,p)}),g.on("data",function(A){A=(l+A).split(/\n+/);for(var k=A.length-1,P=0;P<k;P++)(!a.start||b>=a.start)&&y(A[P]),b++;l=A[k]}),g.on("close",function(){l&&y(l,!0),a.order==="desc"&&(p=p.reverse()),i&&i(null,p)});function y(A,k){try{var P=JSON.parse(A);x(P)&&M(P)}catch(N){k||g.emit("error",N)}}function M(A){if(a.rows&&p.length>=a.rows&&a.order!=="desc"){g.readable&&g.destroy();return}a.fields&&(A=a.fields.reduce(function(k,P){return k[P]=A[P],k},{})),a.order==="desc"&&p.length>=a.rows&&p.shift(),p.push(A)}function x(A){if(A&&jh(A)==="object"){var k=new Date(A.timestamp);if(!(a.from&&k<a.from||a.until&&k>a.until||a.level&&a.level!==A.level))return!0}}function E(A){return A=A||{},A.rows=A.rows||A.limit||10,A.start=A.start||0,A.until=A.until||new Date,jh(A.until)!=="object"&&(A.until=new Date(A.until)),A.from=A.from||A.until-24*60*60*1e3,jh(A.from)!=="object"&&(A.from=new Date(A.from)),A.order=A.order||"desc",A}}},{key:"stream",value:function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=na.join(this.dirname,this.filename),h=new rTe,l={file:i,start:a.start};return h.destroy=aTe(l,function(p,b){if(p)return h.emit("error",p);try{h.emit("data",b),b=JSON.parse(b),h.emit("log",b)}catch(g){h.emit("error",g)}}),h}},{key:"open",value:function(){var a=this;this.filename&&(this._opening||(this._opening=!0,this.stat(function(i,h){if(i)return a.emit("error",i);Nf("stat done: %s { size: %s }",a.filename,h),a._size=h,a._dest=a._createStream(a._stream),a._opening=!1,a.once("open",function(){a._stream.eventNames().includes("rotate")?a._stream.emit("rotate"):a._rotate=!1})})))}},{key:"stat",value:function(a){var i=this,h=this._getFile(),l=na.join(this.dirname,h);fo.stat(l,function(p,b){if(p&&p.code==="ENOENT")return Nf("ENOENT\xA0ok",l),i.filename=h,a(null,0);if(p)return Nf("err ".concat(p.code," ").concat(l)),a(p);if(!b||i._needsNewFile(b.size))return i._incFile(function(){return i.stat(a)});i.filename=h,a(null,b.size)})}},{key:"close",value:function(a){var i=this;this._stream&&this._stream.end(function(){a&&a(),i.emit("flush"),i.emit("closed")})}},{key:"_needsNewFile",value:function(a){return a=a||this._size,this.maxsize&&a>=this.maxsize}},{key:"_onError",value:function(a){this.emit("error",a)}},{key:"_setupStream",value:function(a){return a.on("error",this._onError),a}},{key:"_cleanupStream",value:function(a){return a.removeListener("error",this._onError),a.destroy(),a}},{key:"_rotateFile",value:function(){var a=this;this._incFile(function(){return a.open()})}},{key:"_endStream",value:function(){var a=this,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(){};this._dest?(this._stream.unpipe(this._dest),this._dest.end(function(){a._cleanupStream(a._dest),i()})):i()}},{key:"_createStream",value:function(a){var i=this,h=na.join(this.dirname,this.filename);Nf("create stream start",h,this.options);var l=fo.createWriteStream(h,this.options).on("error",function(p){return Nf(p)}).on("close",function(){return Nf("close",l.path,l.bytesWritten)}).on("open",function(){Nf("file open ok",h),i.emit("open",h),a.pipe(l),i.rotatedWhileOpening&&(i._stream=new one,i._stream.setMaxListeners(30),i._rotateFile(),i.rotatedWhileOpening=!1,i._cleanupStream(l),a.end())});return Nf("create stream ok",h),l}},{key:"_incFile",value:function(a){Nf("_incFile",this.filename);var i=na.extname(this._basename),h=na.basename(this._basename,i),l=[];this.zippedArchive&&l.push(function(p){var b=this._created>0&&!this.tailable?this._created:"";this._compressFile(na.join(this.dirname,"".concat(h).concat(b).concat(i)),na.join(this.dirname,"".concat(h).concat(b).concat(i,".gz")),p)}.bind(this)),l.push(function(p){this.tailable?this._checkMaxFilesTailable(i,h,p):(this._created+=1,this._checkMaxFilesIncrementing(i,h,p))}.bind(this)),ane(l,a)}},{key:"_getFile",value:function(){var a=na.extname(this._basename),i=na.basename(this._basename,a),h=this.rotationFormat?this.rotationFormat():this._created;return!this.tailable&&this._created?"".concat(i).concat(h).concat(a):"".concat(i).concat(a)}},{key:"_checkMaxFilesIncrementing",value:function(a,i,h){if(!this.maxFiles||this._created<this.maxFiles)return setImmediate(h);var l=this._created-this.maxFiles,p=l!==0?l:"",b=this.zippedArchive?".gz":"",g="".concat(i).concat(p).concat(a).concat(b),y=na.join(this.dirname,g);fo.unlink(y,h)}},{key:"_checkMaxFilesTailable",value:function(a,i,h){var l=this,p=[];if(this.maxFiles){for(var b=this.zippedArchive?".gz":"",g=this.maxFiles-1;g>1;g--)p.push(function(y,M){var x=this,E="".concat(i).concat(y-1).concat(a).concat(b),A=na.join(this.dirname,E);fo.exists(A,function(k){if(!k)return M(null);E="".concat(i).concat(y).concat(a).concat(b),fo.rename(A,na.join(x.dirname,E),M)})}.bind(this,g));ane(p,function(){fo.rename(na.join(l.dirname,"".concat(i).concat(a).concat(b)),na.join(l.dirname,"".concat(i,"1").concat(a).concat(b)),h)})}}},{key:"_compressFile",value:function(a,i,h){fo.access(a,fo.F_OK,function(l){if(l)return h();var p=QRe.createGzip(),b=fo.createReadStream(a),g=fo.createWriteStream(i);g.on("finish",function(){fo.unlink(a,h)}),b.pipe(p).pipe(g)})}},{key:"_createLogDirIfNotExist",value:function(a){fo.existsSync(a)||fo.mkdirSync(a,{recursive:!0})}}]),e}(iTe)});var wne={};Ha(wne,{Agent:()=>lTe,ClientRequest:()=>cTe,IncomingMessage:()=>dTe,METHODS:()=>pTe,STATUS_CODES:()=>vTe,default:()=>Cf,get:()=>mTe,globalAgent:()=>gTe,request:()=>bTe});function bne(){if(cne)return Co;cne=!0,Co.fetch=a(Pd.fetch)&&a(Pd.ReadableStream),Co.writableStream=a(Pd.WritableStream),Co.abortController=a(Pd.AbortController);var t;function e(){if(t!==void 0)return t;if(Pd.XMLHttpRequest){t=new Pd.XMLHttpRequest;try{t.open("GET",Pd.XDomainRequest?"/":"https://example.com")}catch{t=null}}else t=null;return t}function r(i){var h=e();if(!h)return!1;try{return h.responseType=i,h.responseType===i}catch{}return!1}Co.arraybuffer=Co.fetch||r("arraybuffer"),Co.msstream=!Co.fetch&&r("ms-stream"),Co.mozchunkedarraybuffer=!Co.fetch&&r("moz-chunked-arraybuffer"),Co.overrideMimeType=Co.fetch||(e()?a(e().overrideMimeType):!1);function a(i){return typeof i=="function"}return t=null,Co}function yne(){if(dne)return B4;dne=!0;var t=ni.Buffer,e=yr,r=bne(),a=Mr(),i=ip(),h=B4.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},l=B4.IncomingMessage=function(p,b,g,y){var M=this||P4;if(i.Readable.call(M),M._mode=g,M.headers={},M.rawHeaders=[],M.trailers={},M.rawTrailers=[],M.on("end",function(){e.nextTick(function(){M.emit("close")})}),g==="fetch"){let L=function(){E.read().then(function(C){if(!M._destroyed){if(y(C.done),C.done){M.push(null);return}M.push(t.from(C.value)),L()}}).catch(function(C){y(!0),M._destroyed||M.emit("error",C)})};var N=L;if(M._fetchResponse=b,M.url=b.url,M.statusCode=b.status,M.statusMessage=b.statusText,b.headers.forEach(function(C,Y){M.headers[Y.toLowerCase()]=C,M.rawHeaders.push(Y,C)}),r.writableStream){var x=new WritableStream({write:function(C){return y(!1),new Promise(function(Y,G){M._destroyed?G():M.push(t.from(C))?Y():M._resumeFetch=Y})},close:function(){y(!0),M._destroyed||M.push(null)},abort:function(C){y(!0),M._destroyed||M.emit("error",C)}});try{b.body.pipeTo(x).catch(function(C){y(!0),M._destroyed||M.emit("error",C)});return}catch{}}var E=b.body.getReader();L()}else{M._xhr=p,M._pos=0,M.url=p.responseURL,M.statusCode=p.status,M.statusMessage=p.statusText;var A=p.getAllResponseHeaders().split(/\r?\n/);if(A.forEach(function(L){var C=L.match(/^([^:]+):\s*(.*)/);if(C){var Y=C[1].toLowerCase();Y==="set-cookie"?(M.headers[Y]===void 0&&(M.headers[Y]=[]),M.headers[Y].push(C[2])):M.headers[Y]!==void 0?M.headers[Y]+=", "+C[2]:M.headers[Y]=C[2],M.rawHeaders.push(C[1],C[2])}}),M._charset="x-user-defined",!r.overrideMimeType){var k=M.rawHeaders["mime-type"];if(k){var P=k.match(/;\s*charset=([^;])(;|$)/);P&&(M._charset=P[1].toLowerCase())}M._charset||(M._charset="utf-8")}}};return a(l,i.Readable),l.prototype._read=function(){var p=this||P4,b=p._resumeFetch;b&&(p._resumeFetch=null,b())},l.prototype._onXHRProgress=function(p){var b=this||P4,g=b._xhr,y=null;switch(b._mode){case"text":if(y=g.responseText,y.length>b._pos){var M=y.substr(b._pos);if(b._charset==="x-user-defined"){for(var x=t.alloc(M.length),E=0;E<M.length;E++)x[E]=M.charCodeAt(E)&255;b.push(x)}else b.push(M,b._charset);b._pos=y.length}break;case"arraybuffer":if(g.readyState!==h.DONE||!g.response)break;y=g.response,b.push(t.from(new Uint8Array(y)));break;case"moz-chunked-arraybuffer":if(y=g.response,g.readyState!==h.LOADING||!y)break;b.push(t.from(new Uint8Array(y)));break;case"ms-stream":if(y=g.response,g.readyState!==h.LOADING)break;var A=new P4.MSStreamReader;A.onprogress=function(){A.result.byteLength>b._pos&&(b.push(t.from(new Uint8Array(A.result.slice(b._pos)))),b._pos=A.result.byteLength)},A.onload=function(){p(!0),b.push(null)},A.readAsArrayBuffer(y);break}b._xhr.readyState===h.DONE&&b._mode!=="ms-stream"&&(p(!0),b.push(null))},B4}function oTe(){if(pne)return tI;pne=!0;var t=ni.Buffer,e=yr,r=bne(),a=Mr(),i=yne(),h=ip(),l=i.IncomingMessage,p=i.readyStates;function b(x,E){return r.fetch&&E?"fetch":r.mozchunkedarraybuffer?"moz-chunked-arraybuffer":r.msstream?"ms-stream":r.arraybuffer&&x?"arraybuffer":"text"}var g=tI=function(x){var E=this||aa;h.Writable.call(E),E._opts=x,E._body=[],E._headers={},x.auth&&E.setHeader("Authorization","Basic "+t.from(x.auth).toString("base64")),Object.keys(x.headers).forEach(function(P){E.setHeader(P,x.headers[P])});var A,k=!0;if(x.mode==="disable-fetch"||"requestTimeout"in x&&!r.abortController)k=!1,A=!0;else if(x.mode==="prefer-streaming")A=!1;else if(x.mode==="allow-wrong-content-type")A=!r.overrideMimeType;else if(!x.mode||x.mode==="default"||x.mode==="prefer-fast")A=!0;else throw new Error("Invalid value for opts.mode");E._mode=b(A,k),E._fetchTimer=null,E._socketTimeout=null,E._socketTimer=null,E.on("finish",function(){E._onFinish()})};a(g,h.Writable),g.prototype.setHeader=function(x,E){var A=this||aa,k=x.toLowerCase();M.indexOf(k)===-1&&(A._headers[k]={name:x,value:E})},g.prototype.getHeader=function(x){var E=(this||aa)._headers[x.toLowerCase()];return E?E.value:null},g.prototype.removeHeader=function(x){var E=this||aa;delete E._headers[x.toLowerCase()]},g.prototype._onFinish=function(){var x=this||aa;if(!x._destroyed){var E=x._opts;"timeout"in E&&E.timeout!==0&&x.setTimeout(E.timeout);var A=x._headers,k=null;E.method!=="GET"&&E.method!=="HEAD"&&(k=new Blob(x._body,{type:(A["content-type"]||{}).value||""}));var P=[];if(Object.keys(A).forEach(function(Y){var G=A[Y].name,ee=A[Y].value;Array.isArray(ee)?ee.forEach(function(D){P.push([G,D])}):P.push([G,ee])}),x._mode==="fetch"){var N=null;if(r.abortController){var L=new AbortController;N=L.signal,x._fetchAbortController=L,"requestTimeout"in E&&E.requestTimeout!==0&&(x._fetchTimer=aa.setTimeout(function(){x.emit("requestTimeout"),x._fetchAbortController&&x._fetchAbortController.abort()},E.requestTimeout))}aa.fetch(x._opts.url,{method:x._opts.method,headers:P,body:k||void 0,mode:"cors",credentials:E.withCredentials?"include":"same-origin",signal:N}).then(function(Y){x._fetchResponse=Y,x._resetTimers(!1),x._connect()},function(Y){x._resetTimers(!0),x._destroyed||x.emit("error",Y)})}else{var C=x._xhr=new aa.XMLHttpRequest;try{C.open(x._opts.method,x._opts.url,!0)}catch(Y){e.nextTick(function(){x.emit("error",Y)});return}"responseType"in C&&(C.responseType=x._mode),"withCredentials"in C&&(C.withCredentials=!!E.withCredentials),x._mode==="text"&&"overrideMimeType"in C&&C.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in E&&(C.timeout=E.requestTimeout,C.ontimeout=function(){x.emit("requestTimeout")}),P.forEach(function(Y){C.setRequestHeader(Y[0],Y[1])}),x._response=null,C.onreadystatechange=function(){switch(C.readyState){case p.LOADING:case p.DONE:x._onXHRProgress();break}},x._mode==="moz-chunked-arraybuffer"&&(C.onprogress=function(){x._onXHRProgress()}),C.onerror=function(){x._destroyed||(x._resetTimers(!0),x.emit("error",new Error("XHR error")))};try{C.send(k)}catch(Y){e.nextTick(function(){x.emit("error",Y)});return}}}};function y(x){try{var E=x.status;return E!==null&&E!==0}catch{return!1}}g.prototype._onXHRProgress=function(){var x=this||aa;x._resetTimers(!1),!(!y(x._xhr)||x._destroyed)&&(x._response||x._connect(),x._response._onXHRProgress(x._resetTimers.bind(x)))},g.prototype._connect=function(){var x=this||aa;x._destroyed||(x._response=new l(x._xhr,x._fetchResponse,x._mode,x._resetTimers.bind(x)),x._response.on("error",function(E){x.emit("error",E)}),x.emit("response",x._response))},g.prototype._write=function(x,E,A){var k=this||aa;k._body.push(x),A()},g.prototype._resetTimers=function(x){var E=this||aa;aa.clearTimeout(E._socketTimer),E._socketTimer=null,x?(aa.clearTimeout(E._fetchTimer),E._fetchTimer=null):E._socketTimeout&&(E._socketTimer=aa.setTimeout(function(){E.emit("timeout")},E._socketTimeout))},g.prototype.abort=g.prototype.destroy=function(x){var E=this||aa;E._destroyed=!0,E._resetTimers(!0),E._response&&(E._response._destroyed=!0),E._xhr?E._xhr.abort():E._fetchAbortController&&E._fetchAbortController.abort(),x&&E.emit("error",x)},g.prototype.end=function(x,E,A){var k=this||aa;typeof x=="function"&&(A=x,x=void 0),h.Writable.prototype.end.call(k,x,E,A)},g.prototype.setTimeout=function(x,E){var A=this||aa;E&&A.once("timeout",E),A._socketTimeout=x,A._resetTimers(!1)},g.prototype.flushHeaders=function(){},g.prototype.setNoDelay=function(){},g.prototype.setSocketKeepAlive=function(){};var M=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"];return tI}function sTe(){if(vne)return rI;vne=!0,rI=e;var t=Object.prototype.hasOwnProperty;function e(){for(var r={},a=0;a<arguments.length;a++){var i=arguments[a];for(var h in i)t.call(i,h)&&(r[h]=i[h])}return r}return rI}function fTe(){return mne||(mne=!0,iI={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}),iI}function hTe(){if(gne)return nI;gne=!0;var t=oTe(),e=yne(),r=sTe(),a=fTe(),i=vi,h=nI;return h.request=function(l,p){typeof l=="string"?l=i.parse(l):l=r(l);var b=uTe.location.protocol.search(/^https?:$/)===-1?"http:":"",g=l.protocol||b,y=l.hostname||l.host,M=l.port,x=l.path||"/";y&&y.indexOf(":")!==-1&&(y="["+y+"]"),l.url=(y?g+"//"+y:"")+(M?":"+M:"")+x,l.method=(l.method||"GET").toUpperCase(),l.headers=l.headers||{};var E=new t(l);return p&&E.on("response",p),E},h.get=function(p,b){var g=h.request(p,b);return g.end(),g},h.ClientRequest=t,h.IncomingMessage=e.IncomingMessage,h.Agent=function(){},h.Agent.defaultMaxSockets=4,h.globalAgent=new h.Agent,h.STATUS_CODES=a,h.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"],nI}var Co,cne,Pd,B4,dne,P4,tI,pne,aa,rI,vne,iI,mne,nI,gne,uTe,Cf,lTe,cTe,dTe,pTe,vTe,mTe,gTe,bTe,aI=Si(()=>{"use strict";ie();ae();ne();oh();oy();Ws();f4();Ks();rh();jo();Uo();Yf();Jg();Qg();Rd();Co={},cne=!1,Pd=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;B4={},dne=!1,P4=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;tI={},pne=!1,aa=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;rI={},vne=!1;iI={},mne=!1;nI={},gne=!1,uTe=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;Cf=hTe(),lTe=Cf.Agent,cTe=Cf.ClientRequest,dTe=Cf.IncomingMessage,pTe=Cf.METHODS,vTe=Cf.STATUS_CODES,mTe=Cf.get,gTe=Cf.globalAgent,bTe=Cf.request});var xne={};Ha(xne,{Agent:()=>wTe,ClientRequest:()=>_Te,IncomingMessage:()=>MTe,METHODS:()=>xTe,STATUS_CODES:()=>STe,default:()=>zh,get:()=>ETe,globalAgent:()=>ATe,request:()=>RTe});function yTe(){if(_ne)return oI;_ne=!0;var t=Cf,e=vi,r=oI;for(var a in t)t.hasOwnProperty(a)&&(r[a]=t[a]);r.request=function(h,l){return h=i(h),t.request.call(this||Mne,h,l)},r.get=function(h,l){return h=i(h),t.get.call(this||Mne,h,l)};function i(h){if(typeof h=="string"&&(h=e.parse(h)),h.protocol||(h.protocol="https:"),h.protocol!=="https:")throw new Error('Protocol "'+h.protocol+'" not supported. Expected "https:"');return h}return oI}var oI,_ne,Mne,zh,wTe,_Te,MTe,xTe,STe,ETe,ATe,RTe,Sne=Si(()=>{"use strict";ie();ae();ne();aI();f4();oh();Ks();rh();jo();Uo();Ws();Yf();oy();Jg();Qg();Rd();oI={},_ne=!1,Mne=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;zh=yTe(),wTe=zh.Agent,_Te=zh.ClientRequest,MTe=zh.IncomingMessage,xTe=zh.METHODS,STe=zh.STATUS_CODES,ETe=zh.get,ATe=zh.globalAgent,RTe=zh.request});var Ine=ht((q1t,kne)=>{"use strict";ie();ae();ne();function j1(t){"@babel/helpers - typeof";return j1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},j1(t)}function Ene(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,a)}return r}function sI(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Ene(Object(r),!0).forEach(function(a){TTe(t,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ene(Object(r)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(r,a))})}return t}function TTe(t,e,r){return e=Rne(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function kTe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ane(t,e){for(var r=0;r<e.length;r++){var a=e[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,Rne(a.key),a)}}function ITe(t,e,r){return e&&Ane(t.prototype,e),r&&Ane(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Rne(t){var e=BTe(t,"string");return j1(e)=="symbol"?e:String(e)}function BTe(t,e){if(j1(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e||"default");if(j1(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function PTe(t,e,r){return e=O4(e),OTe(t,Tne()?Reflect.construct(e,r||[],O4(t).constructor):e.apply(t,r))}function OTe(t,e){if(e&&(j1(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return NTe(t)}function NTe(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Tne(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Tne=function(){return!!t})()}function O4(t){return O4=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},O4(t)}function CTe(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&fI(t,e)}function fI(t,e){return fI=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,i){return a.__proto__=i,a},fI(t,e)}var LTe=(aI(),ei(wne)),DTe=(Sne(),ei(xne)),$Te=Oh(),qTe=$Te.Stream,UTe=O1(),FTe=k1(),jTe=FTe.configure;kne.exports=function(t){CTe(e,t);function e(){var r,a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return kTe(this,e),r=PTe(this,e,[a]),r.options=a,r.name=a.name||"http",r.ssl=!!a.ssl,r.host=a.host||"localhost",r.port=a.port,r.auth=a.auth,r.path=a.path||"",r.maximumDepth=a.maximumDepth,r.agent=a.agent,r.headers=a.headers||{},r.headers["content-type"]="application/json",r.batch=a.batch||!1,r.batchInterval=a.batchInterval||5e3,r.batchCount=a.batchCount||10,r.batchOptions=[],r.batchTimeoutID=-1,r.batchCallback={},r.port||(r.port=r.ssl?443:80),r}return ITe(e,[{key:"log",value:function(a,i){var h=this;this._request(a,null,null,function(l,p){p&&p.statusCode!==200&&(l=new Error("Invalid HTTP Status Code: ".concat(p.statusCode))),l?h.emit("warn",l):h.emit("logged",a)}),i&&setImmediate(i)}},{key:"query",value:function(a,i){typeof a=="function"&&(i=a,a={}),a={method:"query",params:this.normalizeQuery(a)};var h=a.params.auth||null;delete a.params.auth;var l=a.params.path||null;delete a.params.path,this._request(a,h,l,function(p,b,g){if(b&&b.statusCode!==200&&(p=new Error("Invalid HTTP Status Code: ".concat(b.statusCode))),p)return i(p);if(typeof g=="string")try{g=JSON.parse(g)}catch(y){return i(y)}i(null,g)})}},{key:"stream",value:function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=new qTe;a={method:"stream",params:a};var h=a.params.path||null;delete a.params.path;var l=a.params.auth||null;delete a.params.auth;var p="",b=this._request(a,l,h);return i.destroy=function(){return b.destroy()},b.on("data",function(g){g=(p+g).split(/\n+/);for(var y=g.length-1,M=0;M<y;M++)try{i.emit("log",JSON.parse(g[M]))}catch(x){i.emit("error",x)}p=g[y]}),b.on("error",function(g){return i.emit("error",g)}),i}},{key:"_request",value:function(a,i,h,l){a=a||{},i=i||this.auth,h=h||this.path||"",this.batch?this._doBatch(a,l,i,h):this._doRequest(a,l,i,h)}},{key:"_doBatch",value:function(a,i,h,l){if(this.batchOptions.push(a),this.batchOptions.length===1){var p=this;this.batchCallback=i,this.batchTimeoutID=setTimeout(function(){p.batchTimeoutID=-1,p._doBatchRequest(p.batchCallback,h,l)},this.batchInterval)}this.batchOptions.length===this.batchCount&&this._doBatchRequest(this.batchCallback,h,l)}},{key:"_doBatchRequest",value:function(a,i,h){this.batchTimeoutID>0&&(clearTimeout(this.batchTimeoutID),this.batchTimeoutID=-1);var l=this.batchOptions.slice();this.batchOptions=[],this._doRequest(l,a,i,h)}},{key:"_doRequest",value:function(a,i,h,l){var p=Object.assign({},this.headers);h&&h.bearer&&(p.Authorization="Bearer ".concat(h.bearer));var b=(this.ssl?DTe:LTe).request(sI(sI({},this.options),{},{method:"POST",host:this.host,port:this.port,path:"/".concat(l.replace(/^\//,"")),headers:p,auth:h&&h.username&&h.password?"".concat(h.username,":").concat(h.password):"",agent:this.agent}));b.on("error",i),b.on("response",function(y){return y.on("end",function(){return i(null,y)}).resume()});var g=jTe(sI({},this.maximumDepth&&{maximumDepth:this.maximumDepth}));b.end(Me.from(g(a,this.options.replacer),"utf8"))}}]),e}(UTe)});var uI=ht((z1t,Bne)=>{"use strict";ie();ae();ne();var qu=t=>t!==null&&typeof t=="object"&&typeof t.pipe=="function";qu.writable=t=>qu(t)&&t.writable!==!1&&typeof t._write=="function"&&typeof t._writableState=="object";qu.readable=t=>qu(t)&&t.readable!==!1&&typeof t._read=="function"&&typeof t._readableState=="object";qu.duplex=t=>qu.writable(t)&&qu.readable(t);qu.transform=t=>qu.duplex(t)&&typeof t._transform=="function";Bne.exports=qu});var Cne=ht((W1t,Nne)=>{"use strict";ie();ae();ne();function z1(t){"@babel/helpers - typeof";return z1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},z1(t)}function zTe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Pne(t,e){for(var r=0;r<e.length;r++){var a=e[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,HTe(a.key),a)}}function ZTe(t,e,r){return e&&Pne(t.prototype,e),r&&Pne(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function HTe(t){var e=KTe(t,"string");return z1(e)=="symbol"?e:String(e)}function KTe(t,e){if(z1(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e||"default");if(z1(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function WTe(t,e,r){return e=N4(e),VTe(t,One()?Reflect.construct(e,r||[],N4(t).constructor):e.apply(t,r))}function VTe(t,e){if(e&&(z1(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return GTe(t)}function GTe(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function One(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(One=function(){return!!t})()}function N4(t){return N4=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},N4(t)}function YTe(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&hI(t,e)}function hI(t,e){return hI=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,i){return a.__proto__=i,a},hI(t,e)}var JTe=uI(),XTe=sn(),QTe=XTe.MESSAGE,eke=(yd(),ei(bd)),tke=O1();Nne.exports=function(t){YTe(e,t);function e(){var r,a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(zTe(this,e),r=WTe(this,e,[a]),!a.stream||!JTe(a.stream))throw new Error("options.stream is required.");return r._stream=a.stream,r._stream.setMaxListeners(1/0),r.isObjectMode=a.stream._writableState.objectMode,r.eol=typeof a.eol=="string"?a.eol:eke.EOL,r}return ZTe(e,[{key:"log",value:function(a,i){var h=this;if(setImmediate(function(){return h.emit("logged",a)}),this.isObjectMode){this._stream.write(a),i&&i();return}this._stream.write("".concat(a[QTe]).concat(this.eol)),i&&i()}}]),e}(tke)});var Lne=ht(f2=>{"use strict";ie();ae();ne();Object.defineProperty(f2,"Console",{configurable:!0,enumerable:!0,get:function(){return gte()}});Object.defineProperty(f2,"File",{configurable:!0,enumerable:!0,get:function(){return lne()}});Object.defineProperty(f2,"Http",{configurable:!0,enumerable:!0,get:function(){return Ine()}});Object.defineProperty(f2,"Stream",{configurable:!0,enumerable:!0,get:function(){return Cne()}})});var L4=ht(u2=>{"use strict";ie();ae();ne();var C4=JT(),rke=sn(),lI=rke.configs;u2.cli=C4.levels(lI.cli);u2.npm=C4.levels(lI.npm);u2.syslog=C4.levels(lI.syslog);u2.addColors=C4.levels});var $ne=ht((D4,Dne)=>{"use strict";ie();ae();ne();Object.defineProperty(D4,"__esModule",{value:!0});var ike=d4(),nke=Od(ike),ake=x4(),oke=Od(ake),ske=qk(),fke=Od(ske),uke=Lk(),hke=Od(uke),lke=Dk(),cke=Od(lke),dke=Id(),pke=Od(dke),vke=U1(),mke=Od(vke);function Od(t){return t&&t.__esModule?t:{default:t}}function gke(t,e,r){r=(0,hke.default)(r);var a=0,i=0,{length:h}=t,l=!1;h===0&&r(null);function p(b,g){b===!1&&(l=!0),l!==!0&&(b?r(b):(++i===h||g===oke.default)&&r(null))}for(;a<h;a++)e(t[a],a,(0,cke.default)(p))}function bke(t,e,r){return(0,fke.default)(t,1/0,e,r)}function yke(t,e,r){var a=(0,nke.default)(t)?gke:bke;return a(t,(0,pke.default)(e),r)}D4.default=(0,mke.default)(yke,3);Dne.exports=D4.default});var Une=ht(($4,qne)=>{"use strict";ie();ae();ne();Object.defineProperty($4,"__esModule",{value:!0});$4.default=wke;function wke(t){return(e,r,a)=>t(e,a)}qne.exports=$4.default});var F4=ht((U4,Fne)=>{"use strict";ie();ae();ne();Object.defineProperty(U4,"__esModule",{value:!0});var _ke=$ne(),Mke=q4(_ke),xke=Une(),Ske=q4(xke),Eke=Id(),Ake=q4(Eke),Rke=U1(),Tke=q4(Rke);function q4(t){return t&&t.__esModule?t:{default:t}}function kke(t,e,r){return(0,Mke.default)(t,(0,Ske.default)((0,Ake.default)(e)),r)}U4.default=(0,Tke.default)(kke,3);Fne.exports=U4.default});var zne=ht((pvt,jne)=>{"use strict";ie();ae();ne();var Ike=Object.prototype.toString;jne.exports=function(e){if(typeof e.displayName=="string"&&e.constructor.name)return e.displayName;if(typeof e.name=="string"&&e.name)return e.name;if(typeof e=="object"&&e.constructor&&typeof e.constructor.name=="string")return e.constructor.name;var r=e.toString(),a=Ike.call(e).slice(8,-1);return a==="Function"?r=r.substring(r.indexOf("(")+1,r.indexOf(")")):r=a,r||"anonymous"}});var cI=ht((bvt,Zne)=>{"use strict";ie();ae();ne();var Bke=zne();Zne.exports=function(e){var r=0,a;function i(){return r||(r=1,a=e.apply(this,arguments),e=null),a}return i.displayName=Bke(e),i}});var dI=ht(l2=>{"use strict";ie();ae();ne();l2.get=function(t){var e=Error.stackTraceLimit;Error.stackTraceLimit=1/0;var r={},a=Error.prepareStackTrace;Error.prepareStackTrace=function(h,l){return l},Error.captureStackTrace(r,t||l2.get);var i=r.stack;return Error.prepareStackTrace=a,Error.stackTraceLimit=e,i};l2.parse=function(t){if(!t.stack)return[];var e=this,r=t.stack.split(`
113
+ `," "]),Ak=["'"].concat(bMe),bre=["%","/","?",";","#"].concat(Ak),yre=["/","?","#"],wre=/^[+a-z0-9A-Z_-]{0,63}$/,yMe=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,wMe={javascript:!0,"javascript:":!0},xk={javascript:!0,"javascript:":!0},L1={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},Sk=Lu;Ns.prototype.parse=function(t,e,r){if(!Du.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var a=t.indexOf("?"),i=a!==-1&&a<t.indexOf("#")?"?":"#",h=t.split(i);h[0]=h[0].replace(/\\/g,"/");var l=t=h.join(i);if(l=l.trim(),!r&&t.split("#").length===1){var p=gMe.exec(l);if(p)return this.path=l,this.href=l,this.pathname=p[1],p[2]?(this.search=p[2],this.query=e?Sk.parse(this.search.substr(1)):this.search.substr(1)):e&&(this.search="",this.query={}),this}var b=vMe.exec(l);if(b){var g=(b=b[0]).toLowerCase();this.protocol=g,l=l.substr(b.length)}if(r||b||l.match(/^\/\/[^@\/]+@[^@\/]+/)){var y=l.substr(0,2)==="//";!y||b&&xk[b]||(l=l.substr(2),this.slashes=!0)}if(!xk[b]&&(y||b&&!L1[b])){for(var M,x,E=-1,A=0;A<yre.length;A++)(k=l.indexOf(yre[A]))!==-1&&(E===-1||k<E)&&(E=k);for((x=E===-1?l.lastIndexOf("@"):l.lastIndexOf("@",E))!==-1&&(M=l.slice(0,x),l=l.slice(x+1),this.auth=decodeURIComponent(M)),E=-1,A=0;A<bre.length;A++){var k;(k=l.indexOf(bre[A]))!==-1&&(E===-1||k<E)&&(E=k)}E===-1&&(E=l.length),this.host=l.slice(0,E),l=l.slice(E),this.parseHost(),this.hostname=this.hostname||"";var P=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!P)for(var N=this.hostname.split(/\./),L=(A=0,N.length);A<L;A++){var C=N[A];if(C&&!C.match(wre)){for(var Y="",G=0,ee=C.length;G<ee;G++)C.charCodeAt(G)>127?Y+="x":Y+=C[G];if(!Y.match(wre)){var D=N.slice(0,A),U=N.slice(A+1),V=C.match(yMe);V&&(D.push(V[1]),U.unshift(V[2])),U.length&&(l="/"+U.join(".")+l),this.hostname=D.join(".");break}}}this.hostname.length>255?this.hostname="":this.hostname=this.hostname.toLowerCase(),P||(this.hostname=pMe.toASCII(this.hostname));var _=this.port?":"+this.port:"",n=this.hostname||"";this.host=n+_,this.href+=this.host,P&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),l[0]!=="/"&&(l="/"+l))}if(!wMe[g])for(A=0,L=Ak.length;A<L;A++){var s=Ak[A];if(l.indexOf(s)!==-1){var f=encodeURIComponent(s);f===s&&(f=escape(s)),l=l.split(s).join(f)}}var u=l.indexOf("#");u!==-1&&(this.hash=l.substr(u),l=l.slice(0,u));var c=l.indexOf("?");if(c!==-1?(this.search=l.substr(c),this.query=l.substr(c+1),e&&(this.query=Sk.parse(this.query)),l=l.slice(0,c)):e&&(this.search="",this.query={}),l&&(this.pathname=l),L1[g]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){_=this.pathname||"";var m=this.search||"";this.path=_+m}return this.href=this.format(),this},Ns.prototype.format=function(){var t=this.auth||"";t&&(t=(t=encodeURIComponent(t)).replace(/%3A/i,":"),t+="@");var e=this.protocol||"",r=this.pathname||"",a=this.hash||"",i=!1,h="";this.host?i=t+this.host:this.hostname&&(i=t+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(i+=":"+this.port)),this.query&&Du.isObject(this.query)&&Object.keys(this.query).length&&(h=Sk.stringify(this.query));var l=this.search||h&&"?"+h||"";return e&&e.substr(-1)!==":"&&(e+=":"),this.slashes||(!e||L1[e])&&i!==!1?(i="//"+(i||""),r&&r.charAt(0)!=="/"&&(r="/"+r)):i||(i=""),a&&a.charAt(0)!=="#"&&(a="#"+a),l&&l.charAt(0)!=="?"&&(l="?"+l),e+i+(r=r.replace(/[?#]/g,function(p){return encodeURIComponent(p)}))+(l=l.replace("#","%23"))+a},Ns.prototype.resolve=function(t){return this.resolveObject(e2(t,!1,!0)).format()},Ns.prototype.resolveObject=function(t){if(Du.isString(t)){var e=new Ns;e.parse(t,!1,!0),t=e}for(var r=new Ns,a=Object.keys(this),i=0;i<a.length;i++){var h=a[i];r[h]=this[h]}if(r.hash=t.hash,t.href==="")return r.href=r.format(),r;if(t.slashes&&!t.protocol){for(var l=Object.keys(t),p=0;p<l.length;p++){var b=l[p];b!=="protocol"&&(r[b]=t[b])}return L1[r.protocol]&&r.hostname&&!r.pathname&&(r.path=r.pathname="/"),r.href=r.format(),r}if(t.protocol&&t.protocol!==r.protocol){if(!L1[t.protocol]){for(var g=Object.keys(t),y=0;y<g.length;y++){var M=g[y];r[M]=t[M]}return r.href=r.format(),r}if(r.protocol=t.protocol,t.host||xk[t.protocol])r.pathname=t.pathname;else{for(var x=(t.pathname||"").split("/");x.length&&!(t.host=x.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),x[0]!==""&&x.unshift(""),x.length<2&&x.unshift(""),r.pathname=x.join("/")}if(r.search=t.search,r.query=t.query,r.host=t.host||"",r.auth=t.auth,r.hostname=t.hostname||t.host,r.port=t.port,r.pathname||r.search){var E=r.pathname||"",A=r.search||"";r.path=E+A}return r.slashes=r.slashes||t.slashes,r.href=r.format(),r}var k=r.pathname&&r.pathname.charAt(0)==="/",P=t.host||t.pathname&&t.pathname.charAt(0)==="/",N=P||k||r.host&&t.pathname,L=N,C=r.pathname&&r.pathname.split("/")||[],Y=(x=t.pathname&&t.pathname.split("/")||[],r.protocol&&!L1[r.protocol]);if(Y&&(r.hostname="",r.port=null,r.host&&(C[0]===""?C[0]=r.host:C.unshift(r.host)),r.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(x[0]===""?x[0]=t.host:x.unshift(t.host)),t.host=null),N=N&&(x[0]===""||C[0]==="")),P)r.host=t.host||t.host===""?t.host:r.host,r.hostname=t.hostname||t.hostname===""?t.hostname:r.hostname,r.search=t.search,r.query=t.query,C=x;else if(x.length)C||(C=[]),C.pop(),C=C.concat(x),r.search=t.search,r.query=t.query;else if(!Du.isNullOrUndefined(t.search))return Y&&(r.hostname=r.host=C.shift(),(V=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=V.shift(),r.host=r.hostname=V.shift())),r.search=t.search,r.query=t.query,Du.isNull(r.pathname)&&Du.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r;if(!C.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var G=C.slice(-1)[0],ee=(r.host||t.host||C.length>1)&&(G==="."||G==="..")||G==="",D=0,U=C.length;U>=0;U--)(G=C[U])==="."?C.splice(U,1):G===".."?(C.splice(U,1),D++):D&&(C.splice(U,1),D--);if(!N&&!L)for(;D--;D)C.unshift("..");!N||C[0]===""||C[0]&&C[0].charAt(0)==="/"||C.unshift(""),ee&&C.join("/").substr(-1)!=="/"&&C.push("");var V,_=C[0]===""||C[0]&&C[0].charAt(0)==="/";return Y&&(r.hostname=r.host=_?"":C.length?C.shift():"",(V=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@"))&&(r.auth=V.shift(),r.host=r.hostname=V.shift())),(N=N||r.host&&C.length)&&!_&&C.unshift(""),C.length?r.pathname=C.join("/"):(r.pathname=null,r.path=null),Du.isNull(r.pathname)&&Du.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},Ns.prototype.parseHost=function(){var t=this.host,e=mMe.exec(t);e&&((e=e[0])!==":"&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)};vi.Url;vi.format;vi.resolve;vi.resolveObject;Ek={},_re=!1;Mre=_Me(),MMe=typeof Deno<"u"?Deno.build.os==="windows"?"win32":Deno.build.os:void 0;vi.URL=typeof URL<"u"?URL:null;vi.pathToFileURL=LMe;vi.fileURLToPath=OMe;vi.Url;vi.format;vi.resolve;vi.resolveObject;vi.URL;xMe=92,SMe=47,EMe=97,AMe=122,Rk=MMe==="win32",RMe=/\//g,TMe=/%/g,kMe=/\\/g,IMe=/\n/g,BMe=/\r/g,PMe=/\t/g;DMe=typeof Deno<"u"?Deno.build.os==="windows"?"win32":Deno.build.os:void 0;vi.URL=typeof URL<"u"?URL:null;vi.pathToFileURL=YMe;vi.fileURLToPath=kk;K0t=vi.Url,W0t=vi.format,V0t=vi.resolve,G0t=vi.resolveObject,Y0t=vi.parse,J0t=vi.URL,$Me=92,qMe=47,UMe=97,FMe=122,Tk=DMe==="win32",jMe=/\//g,zMe=/%/g,ZMe=/\\/g,HMe=/\n/g,KMe=/\r/g,WMe=/\t/g});var Ok={};Ha(Ok,{Dir:()=>USe,Dirent:()=>FSe,F_OK:()=>VSe,FileReadStream:()=>HSe,FileWriteStream:()=>KSe,R_OK:()=>GSe,ReadStream:()=>zSe,Stats:()=>jSe,W_OK:()=>YSe,WriteStream:()=>ZSe,X_OK:()=>JSe,_toUnixTimestamp:()=>WSe,access:()=>dxe,accessSync:()=>pxe,appendFile:()=>lxe,appendFileSync:()=>cxe,chmod:()=>gxe,chmodSync:()=>bxe,chown:()=>vxe,chownSync:()=>mxe,close:()=>yxe,closeSync:()=>wxe,constants:()=>XSe,copyFile:()=>_xe,copyFileSync:()=>Mxe,cp:()=>xxe,cpSync:()=>Sxe,createReadStream:()=>Exe,createWriteStream:()=>Axe,default:()=>Gi,exists:()=>Rxe,existsSync:()=>Wre,fchmod:()=>Ixe,fchmodSync:()=>Bxe,fchown:()=>Txe,fchownSync:()=>kxe,fdatasync:()=>Pxe,fdatasyncSync:()=>Oxe,fstat:()=>Nxe,fstatSync:()=>Cxe,fsync:()=>Lxe,fsyncSync:()=>Dxe,ftruncate:()=>$xe,ftruncateSync:()=>qxe,futimes:()=>Uxe,futimesSync:()=>Fxe,lchmod:()=>Zxe,lchmodSync:()=>Hxe,lchown:()=>jxe,lchownSync:()=>zxe,link:()=>Kxe,linkSync:()=>Wxe,lstat:()=>Vxe,lstatSync:()=>Gxe,mkdir:()=>Yxe,mkdirSync:()=>Jxe,mkdtemp:()=>Xxe,mkdtempSync:()=>Qxe,open:()=>eSe,openSync:()=>tSe,opendir:()=>rSe,opendirSync:()=>iSe,promises:()=>QSe,read:()=>oSe,readFile:()=>hSe,readFileSync:()=>lSe,readSync:()=>sSe,readdir:()=>nSe,readdirSync:()=>aSe,readlink:()=>cSe,readlinkSync:()=>dSe,readv:()=>fSe,readvSync:()=>uSe,realpath:()=>pSe,realpathSync:()=>vSe,rename:()=>mSe,renameSync:()=>gSe,rm:()=>bSe,rmSync:()=>ySe,rmdir:()=>wSe,rmdirSync:()=>_Se,stat:()=>MSe,statSync:()=>xSe,symlink:()=>SSe,symlinkSync:()=>ESe,truncate:()=>ASe,truncateSync:()=>RSe,unlink:()=>kSe,unlinkSync:()=>ISe,unwatchFile:()=>TSe,utimes:()=>BSe,utimesSync:()=>PSe,watch:()=>OSe,watchFile:()=>NSe,write:()=>LSe,writeFile:()=>CSe,writeFileSync:()=>Vre,writeSync:()=>DSe,writev:()=>$Se,writevSync:()=>qSe});function i2(){return xre||(xre=!0,Object.defineProperty(t2,"__esModule",{value:!0}),t2.constants=void 0,t2.constants={O_RDONLY:0,O_WRONLY:1,O_RDWR:2,S_IFMT:61440,S_IFREG:32768,S_IFDIR:16384,S_IFCHR:8192,S_IFBLK:24576,S_IFIFO:4096,S_IFLNK:40960,S_IFSOCK:49152,O_CREAT:64,O_EXCL:128,O_NOCTTY:256,O_TRUNC:512,O_APPEND:1024,O_DIRECTORY:65536,O_NOATIME:262144,O_NOFOLLOW:131072,O_SYNC:1052672,O_DIRECT:16384,O_NONBLOCK:2048,S_IRWXU:448,S_IRUSR:256,S_IWUSR:128,S_IXUSR:64,S_IRWXG:56,S_IRGRP:32,S_IWGRP:16,S_IXGRP:8,S_IRWXO:7,S_IROTH:4,S_IWOTH:2,S_IXOTH:1,F_OK:0,R_OK:4,W_OK:2,X_OK:1,UV_FS_SYMLINK_DIR:1,UV_FS_SYMLINK_JUNCTION:2,UV_FS_COPYFILE_EXCL:1,UV_FS_COPYFILE_FICLONE:2,UV_FS_COPYFILE_FICLONE_FORCE:4,COPYFILE_EXCL:1,COPYFILE_FICLONE:2,COPYFILE_FICLONE_FORCE:4}),t2}function JMe(){return Sre||(Sre=!0,typeof BigInt=="function"?u4.default=BigInt:u4.default=function(){throw new Error("BigInt is not supported in this environment.")}),u4}function Ik(){if(Ere)return D1;Ere=!0,Object.defineProperty(D1,"__esModule",{value:!0}),D1.Stats=void 0;var t=i2(),e=JMe(),r=t.constants.S_IFMT,a=t.constants.S_IFDIR,i=t.constants.S_IFREG,h=t.constants.S_IFBLK,l=t.constants.S_IFCHR,p=t.constants.S_IFLNK,b=t.constants.S_IFIFO,g=t.constants.S_IFSOCK,y=function(){function M(){}return M.build=function(x,E){E===void 0&&(E=!1);var A=new M,k=x.uid,P=x.gid,N=x.atime,L=x.mtime,C=x.ctime,Y=E?e.default:function(ee){return ee};A.uid=Y(k),A.gid=Y(P),A.rdev=Y(0),A.blksize=Y(4096),A.ino=Y(x.ino),A.size=Y(x.getSize()),A.blocks=Y(1),A.atime=N,A.mtime=L,A.ctime=C,A.birthtime=C,A.atimeMs=Y(N.getTime()),A.mtimeMs=Y(L.getTime());var G=Y(C.getTime());return A.ctimeMs=G,A.birthtimeMs=G,A.dev=Y(0),A.mode=Y(x.mode),A.nlink=Y(x.nlink),A},M.prototype._checkModeProperty=function(x){return(Number(this.mode)&r)===x},M.prototype.isDirectory=function(){return this._checkModeProperty(a)},M.prototype.isFile=function(){return this._checkModeProperty(i)},M.prototype.isBlockDevice=function(){return this._checkModeProperty(h)},M.prototype.isCharacterDevice=function(){return this._checkModeProperty(l)},M.prototype.isSymbolicLink=function(){return this._checkModeProperty(p)},M.prototype.isFIFO=function(){return this._checkModeProperty(b)},M.prototype.isSocket=function(){return this._checkModeProperty(g)},M}();return D1.Stats=y,D1.default=y,D1}function Bk(){if(Are)return Pf;Are=!0;var t=Pf&&Pf.__spreadArray||function(h,l,p){if(p||arguments.length===2)for(var b=0,g=l.length,y;b<g;b++)(y||!(b in l))&&(y||(y=Array.prototype.slice.call(l,0,b)),y[b]=l[b]);return h.concat(y||Array.prototype.slice.call(l))};Object.defineProperty(Pf,"__esModule",{value:!0}),Pf.bufferFrom=Pf.bufferAllocUnsafe=Pf.Buffer=void 0;var e=ni;Object.defineProperty(Pf,"Buffer",{enumerable:!0,get:function(){return e.Buffer}});function r(h){for(var l=[],p=1;p<arguments.length;p++)l[p-1]=arguments[p];return new(e.Buffer.bind.apply(e.Buffer,t([void 0,h],l,!1)))}var a=e.Buffer.allocUnsafe||r;Pf.bufferAllocUnsafe=a;var i=e.Buffer.from||r;return Pf.bufferFrom=i,Pf}function Ure(){if(Rre)return Un;Rre=!0;var t=Un&&Un.__extends||function(){var A=function(k,P){return A=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(N,L){N.__proto__=L}||function(N,L){for(var C in L)Object.prototype.hasOwnProperty.call(L,C)&&(N[C]=L[C])},A(k,P)};return function(k,P){if(typeof P!="function"&&P!==null)throw new TypeError("Class extends value "+String(P)+" is not a constructor or null");A(k,P);function N(){this.constructor=k}k.prototype=P===null?Object.create(P):(N.prototype=P.prototype,new N)}}();Object.defineProperty(Un,"__esModule",{value:!0}),Un.E=Un.AssertionError=Un.message=Un.RangeError=Un.TypeError=Un.Error=void 0;var e=ar,r=gt,a=typeof Symbol>"u"?"_kCode":Symbol("code"),i={};function h(A){return function(k){t(P,k);function P(N){for(var L=[],C=1;C<arguments.length;C++)L[C-1]=arguments[C];var Y=k.call(this,b(N,L))||this;return Y.code=N,Y[a]=N,Y.name=k.prototype.name+" ["+Y[a]+"]",Y}return P}(A)}var l=typeof globalThis<"u"?globalThis:XMe,p=function(A){t(k,A);function k(P){var N=this;if(typeof P!="object"||P===null)throw new Un.TypeError("ERR_INVALID_ARG_TYPE","options","object");return P.message?N=A.call(this,P.message)||this:N=A.call(this,r.inspect(P.actual).slice(0,128)+" "+(P.operator+" "+r.inspect(P.expected).slice(0,128)))||this,N.generatedMessage=!P.message,N.name="AssertionError [ERR_ASSERTION]",N.code="ERR_ASSERTION",N.actual=P.actual,N.expected=P.expected,N.operator=P.operator,Un.Error.captureStackTrace(N,P.stackStartFunction),N}return k}(l.Error);Un.AssertionError=p;function b(A,k){e.strictEqual(typeof A,"string");var P=i[A];e(P,"An invalid error message key was used: "+A+".");var N;if(typeof P=="function")N=P;else{if(N=r.format,k===void 0||k.length===0)return P;k.unshift(P)}return String(N.apply(null,k))}Un.message=b;function g(A,k){i[A]=typeof k=="function"?k:String(k)}Un.E=g,Un.Error=h(l.Error),Un.TypeError=h(l.TypeError),Un.RangeError=h(l.RangeError),g("ERR_ARG_NOT_ITERABLE","%s must be iterable"),g("ERR_ASSERTION","%s"),g("ERR_BUFFER_OUT_OF_BOUNDS",E),g("ERR_CHILD_CLOSED_BEFORE_REPLY","Child closed before reply received"),g("ERR_CONSOLE_WRITABLE_STREAM","Console expects a writable stream instance for %s"),g("ERR_CPU_USAGE","Unable to obtain cpu usage %s"),g("ERR_DNS_SET_SERVERS_FAILED",function(A,k){return'c-ares failed to set servers: "'+A+'" ['+k+"]"}),g("ERR_FALSY_VALUE_REJECTION","Promise was rejected with falsy value"),g("ERR_ENCODING_NOT_SUPPORTED",function(A){return'The "'+A+'" encoding is not supported'}),g("ERR_ENCODING_INVALID_ENCODED_DATA",function(A){return"The encoded data was not valid for encoding "+A}),g("ERR_HTTP_HEADERS_SENT","Cannot render headers after they are sent to the client"),g("ERR_HTTP_INVALID_STATUS_CODE","Invalid status code: %s"),g("ERR_HTTP_TRAILER_INVALID","Trailers are invalid with this transfer encoding"),g("ERR_INDEX_OUT_OF_RANGE","Index out of range"),g("ERR_INVALID_ARG_TYPE",y),g("ERR_INVALID_ARRAY_LENGTH",function(A,k,P){return e.strictEqual(typeof P,"number"),'The array "'+A+'" (length '+P+") must be of length "+k+"."}),g("ERR_INVALID_BUFFER_SIZE","Buffer size must be a multiple of %s"),g("ERR_INVALID_CALLBACK","Callback must be a function"),g("ERR_INVALID_CHAR","Invalid character in %s"),g("ERR_INVALID_CURSOR_POS","Cannot set cursor row without setting its column"),g("ERR_INVALID_FD",'"fd" must be a positive integer: %s'),g("ERR_INVALID_FILE_URL_HOST",'File URL host must be "localhost" or empty on %s'),g("ERR_INVALID_FILE_URL_PATH","File URL path %s"),g("ERR_INVALID_HANDLE_TYPE","This handle type cannot be sent"),g("ERR_INVALID_IP_ADDRESS","Invalid IP address: %s"),g("ERR_INVALID_OPT_VALUE",function(A,k){return'The value "'+String(k)+'" is invalid for option "'+A+'"'}),g("ERR_INVALID_OPT_VALUE_ENCODING",function(A){return'The value "'+String(A)+'" is invalid for option "encoding"'}),g("ERR_INVALID_REPL_EVAL_CONFIG",'Cannot specify both "breakEvalOnSigint" and "eval" for REPL'),g("ERR_INVALID_SYNC_FORK_INPUT","Asynchronous forks do not support Buffer, Uint8Array or string input: %s"),g("ERR_INVALID_THIS",'Value of "this" must be of type %s'),g("ERR_INVALID_TUPLE","%s must be an iterable %s tuple"),g("ERR_INVALID_URL","Invalid URL: %s"),g("ERR_INVALID_URL_SCHEME",function(A){return"The URL must be "+x(A,"scheme")}),g("ERR_IPC_CHANNEL_CLOSED","Channel closed"),g("ERR_IPC_DISCONNECTED","IPC channel is already disconnected"),g("ERR_IPC_ONE_PIPE","Child process can have only one IPC pipe"),g("ERR_IPC_SYNC_FORK","IPC cannot be used with synchronous forks"),g("ERR_MISSING_ARGS",M),g("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),g("ERR_NAPI_CONS_FUNCTION","Constructor must be a function"),g("ERR_NAPI_CONS_PROTOTYPE_OBJECT","Constructor.prototype must be an object"),g("ERR_NO_CRYPTO","Node.js is not compiled with OpenSSL crypto support"),g("ERR_NO_LONGER_SUPPORTED","%s is no longer supported"),g("ERR_PARSE_HISTORY_DATA","Could not parse history data in %s"),g("ERR_SOCKET_ALREADY_BOUND","Socket is already bound"),g("ERR_SOCKET_BAD_PORT","Port should be > 0 and < 65536"),g("ERR_SOCKET_BAD_TYPE","Bad socket type specified. Valid types are: udp4, udp6"),g("ERR_SOCKET_CANNOT_SEND","Unable to send data"),g("ERR_SOCKET_CLOSED","Socket is closed"),g("ERR_SOCKET_DGRAM_NOT_RUNNING","Not running"),g("ERR_STDERR_CLOSE","process.stderr cannot be closed"),g("ERR_STDOUT_CLOSE","process.stdout cannot be closed"),g("ERR_STREAM_WRAP","Stream has StringDecoder set or is in objectMode"),g("ERR_TLS_CERT_ALTNAME_INVALID","Hostname/IP does not match certificate's altnames: %s"),g("ERR_TLS_DH_PARAM_SIZE",function(A){return"DH parameter size "+A+" is less than 2048"}),g("ERR_TLS_HANDSHAKE_TIMEOUT","TLS handshake timeout"),g("ERR_TLS_RENEGOTIATION_FAILED","Failed to renegotiate"),g("ERR_TLS_REQUIRED_SERVER_NAME",'"servername" is required parameter for Server.addContext'),g("ERR_TLS_SESSION_ATTACK","TSL session renegotiation attack detected"),g("ERR_TRANSFORM_ALREADY_TRANSFORMING","Calling transform done when still transforming"),g("ERR_TRANSFORM_WITH_LENGTH_0","Calling transform done when writableState.length != 0"),g("ERR_UNKNOWN_ENCODING","Unknown encoding: %s"),g("ERR_UNKNOWN_SIGNAL","Unknown signal: %s"),g("ERR_UNKNOWN_STDIN_TYPE","Unknown stdin file type"),g("ERR_UNKNOWN_STREAM_TYPE","Unknown stream file type"),g("ERR_V8BREAKITERATOR","Full ICU data not installed. See https://github.com/nodejs/node/wiki/Intl");function y(A,k,P){e(A,"name is required");var N;k.includes("not ")?(N="must not be",k=k.split("not ")[1]):N="must be";var L;if(Array.isArray(A)){var C=A.map(function(G){return'"'+G+'"'}).join(", ");L="The "+C+" arguments "+N+" "+x(k,"type")}else if(A.includes(" argument"))L="The "+A+" "+N+" "+x(k,"type");else{var Y=A.includes(".")?"property":"argument";L='The "'+A+'" '+Y+" "+N+" "+x(k,"type")}return arguments.length>=3&&(L+=". Received type "+(P!==null?typeof P:"null")),L}function M(){for(var A=[],k=0;k<arguments.length;k++)A[k]=arguments[k];e(A.length>0,"At least one arg needs to be specified");var P="The ",N=A.length;switch(A=A.map(function(L){return'"'+L+'"'}),N){case 1:P+=A[0]+" argument";break;case 2:P+=A[0]+" and "+A[1]+" arguments";break;default:P+=A.slice(0,N-1).join(", "),P+=", and "+A[N-1]+" arguments";break}return P+" must be specified"}function x(A,k){if(e(A,"expected is required"),e(typeof k=="string","thing is required"),Array.isArray(A)){var P=A.length;return e(P>0,"At least one expected value needs to be specified"),A=A.map(function(N){return String(N)}),P>2?"one of "+k+" "+A.slice(0,P-1).join(", ")+", or "+A[P-1]:P===2?"one of "+k+" "+A[0]+" or "+A[1]:"of "+k+" "+A[0]}else return"of "+k+" "+String(A)}function E(A,k){return k?"Attempt to write outside buffer bounds":'"'+A+'" is outside of buffer bounds'}return Un}function Fre(){if(Tre)return $u;Tre=!0,Object.defineProperty($u,"__esModule",{value:!0}),$u.strToEncoding=$u.assertEncoding=$u.ENCODING_UTF8=void 0;var t=Bk(),e=Ure();$u.ENCODING_UTF8="utf8";function r(i){if(i&&!t.Buffer.isEncoding(i))throw new e.TypeError("ERR_INVALID_OPT_VALUE_ENCODING",i)}$u.assertEncoding=r;function a(i,h){return!h||h===$u.ENCODING_UTF8?i:h==="buffer"?new t.Buffer(i):new t.Buffer(i).toString(h)}return $u.strToEncoding=a,$u}function jre(){if(kre)return $1;kre=!0,Object.defineProperty($1,"__esModule",{value:!0}),$1.Dirent=void 0;var t=i2(),e=Fre(),r=t.constants.S_IFMT,a=t.constants.S_IFDIR,i=t.constants.S_IFREG,h=t.constants.S_IFBLK,l=t.constants.S_IFCHR,p=t.constants.S_IFLNK,b=t.constants.S_IFIFO,g=t.constants.S_IFSOCK,y=function(){function M(){this.name="",this.mode=0}return M.build=function(x,E){var A=new M,k=x.getNode().mode;return A.name=(0,e.strToEncoding)(x.getName(),E),A.mode=k,A},M.prototype._checkModeProperty=function(x){return(this.mode&r)===x},M.prototype.isDirectory=function(){return this._checkModeProperty(a)},M.prototype.isFile=function(){return this._checkModeProperty(i)},M.prototype.isBlockDevice=function(){return this._checkModeProperty(h)},M.prototype.isCharacterDevice=function(){return this._checkModeProperty(l)},M.prototype.isSymbolicLink=function(){return this._checkModeProperty(p)},M.prototype.isFIFO=function(){return this._checkModeProperty(b)},M.prototype.isSocket=function(){return this._checkModeProperty(g)},M}();return $1.Dirent=y,$1.default=y,$1}function zre(){if(Ire)return h4;Ire=!0;var t=yr;Object.defineProperty(h4,"__esModule",{value:!0});var e;return typeof t.nextTick=="function"?e=t.nextTick.bind(typeof globalThis<"u"?globalThis:Bre):e=setTimeout.bind(typeof globalThis<"u"?globalThis:Bre),h4.default=e,h4}function Zre(){if(Pre)return q1;Pre=!0;var t=yr;Object.defineProperty(q1,"__esModule",{value:!0}),q1.createProcess=void 0;var e=function(){if(typeof t<"u")return t;try{return yr}catch{return}};function r(){var a=e()||{};return a.getuid||(a.getuid=function(){return 0}),a.getgid||(a.getgid=function(){return 0}),a.cwd||(a.cwd=function(){return"/"}),a.nextTick||(a.nextTick=zre().default),a.emitWarning||(a.emitWarning=function(i,h){console.warn(""+h+(h?": ":"")+i)}),a.env||(a.env={}),a}return q1.createProcess=r,q1.default=r(),q1}function QMe(){if(Ore)return so;Ore=!0;var t=so&&so.__extends||function(){var A=function(k,P){return A=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(N,L){N.__proto__=L}||function(N,L){for(var C in L)Object.prototype.hasOwnProperty.call(L,C)&&(N[C]=L[C])},A(k,P)};return function(k,P){if(typeof P!="function"&&P!==null)throw new TypeError("Class extends value "+String(P)+" is not a constructor or null");A(k,P);function N(){this.constructor=k}k.prototype=P===null?Object.create(P):(N.prototype=P.prototype,new N)}}();Object.defineProperty(so,"__esModule",{value:!0}),so.File=so.Link=so.Node=so.SEP=void 0;var e=Zre(),r=Bk(),a=i2(),i=Ei,h=Ik(),l=a.constants.S_IFMT,p=a.constants.S_IFDIR,b=a.constants.S_IFREG,g=a.constants.S_IFLNK,y=a.constants.O_APPEND;so.SEP="/";var M=function(A){t(k,A);function k(P,N){N===void 0&&(N=438);var L=A.call(this)||this;return L.uid=e.default.getuid(),L.gid=e.default.getgid(),L.atime=new Date,L.mtime=new Date,L.ctime=new Date,L.perm=438,L.mode=b,L.nlink=1,L.perm=N,L.mode|=N,L.ino=P,L}return k.prototype.getString=function(P){return P===void 0&&(P="utf8"),this.getBuffer().toString(P)},k.prototype.setString=function(P){this.buf=(0,r.bufferFrom)(P,"utf8"),this.touch()},k.prototype.getBuffer=function(){return this.buf||this.setBuffer((0,r.bufferAllocUnsafe)(0)),(0,r.bufferFrom)(this.buf)},k.prototype.setBuffer=function(P){this.buf=(0,r.bufferFrom)(P),this.touch()},k.prototype.getSize=function(){return this.buf?this.buf.length:0},k.prototype.setModeProperty=function(P){this.mode=this.mode&~l|P},k.prototype.setIsFile=function(){this.setModeProperty(b)},k.prototype.setIsDirectory=function(){this.setModeProperty(p)},k.prototype.setIsSymlink=function(){this.setModeProperty(g)},k.prototype.isFile=function(){return(this.mode&l)===b},k.prototype.isDirectory=function(){return(this.mode&l)===p},k.prototype.isSymlink=function(){return(this.mode&l)===g},k.prototype.makeSymlink=function(P){this.symlink=P,this.setIsSymlink()},k.prototype.write=function(P,N,L,C){if(N===void 0&&(N=0),L===void 0&&(L=P.length),C===void 0&&(C=0),this.buf||(this.buf=(0,r.bufferAllocUnsafe)(0)),C+L>this.buf.length){var Y=(0,r.bufferAllocUnsafe)(C+L);this.buf.copy(Y,0,0,this.buf.length),this.buf=Y}return P.copy(this.buf,C,N,N+L),this.touch(),L},k.prototype.read=function(P,N,L,C){N===void 0&&(N=0),L===void 0&&(L=P.byteLength),C===void 0&&(C=0),this.buf||(this.buf=(0,r.bufferAllocUnsafe)(0));var Y=L;return Y>P.byteLength&&(Y=P.byteLength),Y+C>this.buf.length&&(Y=this.buf.length-C),this.buf.copy(P,N,C,C+Y),Y},k.prototype.truncate=function(P){if(P===void 0&&(P=0),!P)this.buf=(0,r.bufferAllocUnsafe)(0);else if(this.buf||(this.buf=(0,r.bufferAllocUnsafe)(0)),P<=this.buf.length)this.buf=this.buf.slice(0,P);else{var N=(0,r.bufferAllocUnsafe)(0);this.buf.copy(N),N.fill(0,P)}this.touch()},k.prototype.chmod=function(P){this.perm=P,this.mode=this.mode&-512|P,this.touch()},k.prototype.chown=function(P,N){this.uid=P,this.gid=N,this.touch()},k.prototype.touch=function(){this.mtime=new Date,this.emit("change",this)},k.prototype.canRead=function(P,N){return P===void 0&&(P=e.default.getuid()),N===void 0&&(N=e.default.getgid()),!!(this.perm&4||N===this.gid&&this.perm&32||P===this.uid&&this.perm&256)},k.prototype.canWrite=function(P,N){return P===void 0&&(P=e.default.getuid()),N===void 0&&(N=e.default.getgid()),!!(this.perm&2||N===this.gid&&this.perm&16||P===this.uid&&this.perm&128)},k.prototype.del=function(){this.emit("delete",this)},k.prototype.toJSON=function(){return{ino:this.ino,uid:this.uid,gid:this.gid,atime:this.atime.getTime(),mtime:this.mtime.getTime(),ctime:this.ctime.getTime(),perm:this.perm,mode:this.mode,nlink:this.nlink,symlink:this.symlink,data:this.getString()}},k}(i.EventEmitter);so.Node=M;var x=function(A){t(k,A);function k(P,N,L){var C=A.call(this)||this;return C.children={},C.steps=[],C.ino=0,C.length=0,C.vol=P,C.parent=N,C.steps=N?N.steps.concat([L]):[L],C}return k.prototype.setNode=function(P){this.node=P,this.ino=P.ino},k.prototype.getNode=function(){return this.node},k.prototype.createChild=function(P,N){N===void 0&&(N=this.vol.createNode());var L=new k(this.vol,this,P);return L.setNode(N),N.isDirectory(),this.setChild(P,L),L},k.prototype.setChild=function(P,N){return N===void 0&&(N=new k(this.vol,this,P)),this.children[P]=N,N.parent=this,this.length++,this.emit("child:add",N,this),N},k.prototype.deleteChild=function(P){delete this.children[P.getName()],this.length--,this.emit("child:delete",P,this)},k.prototype.getChild=function(P){if(Object.hasOwnProperty.call(this.children,P))return this.children[P]},k.prototype.getPath=function(){return this.steps.join(so.SEP)},k.prototype.getName=function(){return this.steps[this.steps.length-1]},k.prototype.walk=function(P,N,L){if(N===void 0&&(N=P.length),L===void 0&&(L=0),L>=P.length)return this;if(L>=N)return this;var C=P[L],Y=this.getChild(C);return Y?Y.walk(P,N,L+1):null},k.prototype.toJSON=function(){return{steps:this.steps,ino:this.ino,children:Object.keys(this.children)}},k}(i.EventEmitter);so.Link=x;var E=function(){function A(k,P,N,L){this.position=0,this.link=k,this.node=P,this.flags=N,this.fd=L}return A.prototype.getString=function(k){return this.node.getString()},A.prototype.setString=function(k){this.node.setString(k)},A.prototype.getBuffer=function(){return this.node.getBuffer()},A.prototype.setBuffer=function(k){this.node.setBuffer(k)},A.prototype.getSize=function(){return this.node.getSize()},A.prototype.truncate=function(k){this.node.truncate(k)},A.prototype.seekTo=function(k){this.position=k},A.prototype.stats=function(){return h.default.build(this.node)},A.prototype.write=function(k,P,N,L){P===void 0&&(P=0),N===void 0&&(N=k.length),typeof L!="number"&&(L=this.position),this.flags&y&&(L=this.getSize());var C=this.node.write(k,P,N,L);return this.position=L+C,C},A.prototype.read=function(k,P,N,L){P===void 0&&(P=0),N===void 0&&(N=k.byteLength),typeof L!="number"&&(L=this.position);var C=this.node.read(k,P,N,L);return this.position=L+C,C},A.prototype.chmod=function(k){this.node.chmod(k)},A.prototype.chown=function(k,P){this.node.chown(k,P)},A}();return so.File=E,so}function txe(){if(Nre)return l4;Nre=!0,Object.defineProperty(l4,"__esModule",{value:!0});function t(e,r,a){var i=setTimeout.apply(typeof globalThis<"u"?globalThis:exe,arguments);return i&&typeof i=="object"&&typeof i.unref=="function"&&i.unref(),i}return l4.default=t,l4}function rxe(){if(Cre)return gc;Cre=!0;var t=gc&&gc.__spreadArray||function(i,h,l){if(l||arguments.length===2)for(var p=0,b=h.length,g;p<b;p++)(g||!(p in h))&&(g||(g=Array.prototype.slice.call(h,0,p)),g[p]=h[p]);return i.concat(g||Array.prototype.slice.call(h))};Object.defineProperty(gc,"__esModule",{value:!0}),gc.FileHandle=void 0;function e(i,h,l){return l===void 0&&(l=function(p){return p}),function(){for(var p=[],b=0;b<arguments.length;b++)p[b]=arguments[b];return new Promise(function(g,y){i[h].bind(i).apply(void 0,t(t([],p,!1),[function(M,x){return M?y(M):g(l(x))}],!1))})}}var r=function(){function i(h,l){this.vol=h,this.fd=l}return i.prototype.appendFile=function(h,l){return e(this.vol,"appendFile")(this.fd,h,l)},i.prototype.chmod=function(h){return e(this.vol,"fchmod")(this.fd,h)},i.prototype.chown=function(h,l){return e(this.vol,"fchown")(this.fd,h,l)},i.prototype.close=function(){return e(this.vol,"close")(this.fd)},i.prototype.datasync=function(){return e(this.vol,"fdatasync")(this.fd)},i.prototype.read=function(h,l,p,b){return e(this.vol,"read",function(g){return{bytesRead:g,buffer:h}})(this.fd,h,l,p,b)},i.prototype.readFile=function(h){return e(this.vol,"readFile")(this.fd,h)},i.prototype.stat=function(h){return e(this.vol,"fstat")(this.fd,h)},i.prototype.sync=function(){return e(this.vol,"fsync")(this.fd)},i.prototype.truncate=function(h){return e(this.vol,"ftruncate")(this.fd,h)},i.prototype.utimes=function(h,l){return e(this.vol,"futimes")(this.fd,h,l)},i.prototype.write=function(h,l,p,b){return e(this.vol,"write",function(g){return{bytesWritten:g,buffer:h}})(this.fd,h,l,p,b)},i.prototype.writeFile=function(h,l){return e(this.vol,"writeFile")(this.fd,h,l)},i}();gc.FileHandle=r;function a(i){return typeof Promise>"u"?null:{FileHandle:r,access:function(h,l){return e(i,"access")(h,l)},appendFile:function(h,l,p){return e(i,"appendFile")(h instanceof r?h.fd:h,l,p)},chmod:function(h,l){return e(i,"chmod")(h,l)},chown:function(h,l,p){return e(i,"chown")(h,l,p)},copyFile:function(h,l,p){return e(i,"copyFile")(h,l,p)},lchmod:function(h,l){return e(i,"lchmod")(h,l)},lchown:function(h,l,p){return e(i,"lchown")(h,l,p)},link:function(h,l){return e(i,"link")(h,l)},lstat:function(h,l){return e(i,"lstat")(h,l)},mkdir:function(h,l){return e(i,"mkdir")(h,l)},mkdtemp:function(h,l){return e(i,"mkdtemp")(h,l)},open:function(h,l,p){return e(i,"open",function(b){return new r(i,b)})(h,l,p)},readdir:function(h,l){return e(i,"readdir")(h,l)},readFile:function(h,l){return e(i,"readFile")(h instanceof r?h.fd:h,l)},readlink:function(h,l){return e(i,"readlink")(h,l)},realpath:function(h,l){return e(i,"realpath")(h,l)},rename:function(h,l){return e(i,"rename")(h,l)},rmdir:function(h){return e(i,"rmdir")(h)},stat:function(h,l){return e(i,"stat")(h,l)},symlink:function(h,l,p){return e(i,"symlink")(h,l,p)},truncate:function(h,l){return e(i,"truncate")(h,l)},unlink:function(h){return e(i,"unlink")(h)},utimes:function(h,l,p){return e(i,"utimes")(h,l,p)},writeFile:function(h,l,p){return e(i,"writeFile")(h instanceof r?h.fd:h,l,p)}}}return gc.default=a,gc}function ixe(){if(Lre)return r2;Lre=!0;var t=yr;Object.defineProperty(r2,"__esModule",{value:!0}),r2.unixify=h,r2.correctPath=l;var e=t.platform==="win32";function r(p){var b=p.length-1;if(b<2)return p;for(;a(p,b);)b--;return p.substr(0,b+1)}function a(p,b){var g=p[b];return b>0&&(g==="/"||e&&g==="\\")}function i(p,b){if(typeof p!="string")throw new TypeError("expected a string");return p=p.replace(/[\\\/]+/g,"/"),b!==!1&&(p=r(p)),p}function h(p){var b=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return e?(p=i(p,b),p.replace(/^([a-zA-Z]+:|\.\/)/,"")):p}function l(p){return h(p.replace(/^\\\\\?\\.:\\/,"\\"))}return r2}function Hre(){if(Dre)return ui;Dre=!0;var t=ui&&ui.__extends||function(){var Ke=function(ve,we){return Ke=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(ze,rt){ze.__proto__=rt}||function(ze,rt){for(var ft in rt)Object.prototype.hasOwnProperty.call(rt,ft)&&(ze[ft]=rt[ft])},Ke(ve,we)};return function(ve,we){if(typeof we!="function"&&we!==null)throw new TypeError("Class extends value "+String(we)+" is not a constructor or null");Ke(ve,we);function ze(){this.constructor=ve}ve.prototype=we===null?Object.create(we):(ze.prototype=we.prototype,new ze)}}(),e=ui&&ui.__spreadArray||function(Ke,ve,we){if(we||arguments.length===2)for(var ze=0,rt=ve.length,ft;ze<rt;ze++)(ft||!(ze in ve))&&(ft||(ft=Array.prototype.slice.call(ve,0,ze)),ft[ze]=ve[ze]);return Ke.concat(ft||Array.prototype.slice.call(ve))};Object.defineProperty(ui,"__esModule",{value:!0}),ui.FSWatcher=ui.StatWatcher=ui.Volume=ui.toUnixTimestamp=ui.bufferToEncoding=ui.dataToBuffer=ui.dataToStr=ui.pathToSteps=ui.filenameToSteps=ui.pathToFilename=ui.flagsToNumber=ui.FLAGS=void 0;var r=fn,a=QMe(),i=Ik(),h=jre(),l=Bk(),p=zre(),b=Zre(),g=txe(),y=ka,M=i2(),x=Ei,E=Fre(),A=Ure(),k=gt,P=rxe(),N=r.resolve,L=M.constants.O_RDONLY,C=M.constants.O_WRONLY,Y=M.constants.O_RDWR,G=M.constants.O_CREAT,ee=M.constants.O_EXCL,D=M.constants.O_TRUNC,U=M.constants.O_APPEND,V=M.constants.O_SYNC,_=M.constants.O_DIRECTORY,n=M.constants.F_OK,s=M.constants.COPYFILE_EXCL,f=M.constants.COPYFILE_FICLONE_FORCE,u=r.posix?r.posix:r,c=u.sep,m=u.relative,w=u.join,d=u.dirname,o=b.default.platform==="win32",v=128,R={PATH_STR:"path must be a string or Buffer",FD:"fd must be a file descriptor",MODE_INT:"mode must be an int",CB:"callback must be a function",UID:"uid must be an unsigned int",GID:"gid must be an unsigned int",LEN:"len must be an integer",ATIME:"atime must be an integer",MTIME:"mtime must be an integer",PREFIX:"filename prefix is required",BUFFER:"buffer must be an instance of Buffer or StaticBuffer",OFFSET:"offset must be an integer",LENGTH:"length must be an integer",POSITION:"position must be an integer"},S=function(Ke){return"Expected options to be either an object or a string, but got "+Ke+" instead"},B="ENOENT",F="EBADF",$="EINVAL",re="EPERM",Q="EPROTO",Z="EEXIST",K="ENOTDIR",le="EMFILE",te="EACCES",j="EISDIR",J="ENOTEMPTY",X="ENOSYS";function he(Ke,ve,we,ze){ve===void 0&&(ve=""),we===void 0&&(we=""),ze===void 0&&(ze="");var rt="";switch(we&&(rt=" '"+we+"'"),ze&&(rt+=" -> '"+ze+"'"),Ke){case B:return"ENOENT: no such file or directory, "+ve+rt;case F:return"EBADF: bad file descriptor, "+ve+rt;case $:return"EINVAL: invalid argument, "+ve+rt;case re:return"EPERM: operation not permitted, "+ve+rt;case Q:return"EPROTO: protocol error, "+ve+rt;case Z:return"EEXIST: file already exists, "+ve+rt;case K:return"ENOTDIR: not a directory, "+ve+rt;case j:return"EISDIR: illegal operation on a directory, "+ve+rt;case te:return"EACCES: permission denied, "+ve+rt;case J:return"ENOTEMPTY: directory not empty, "+ve+rt;case le:return"EMFILE: too many open files, "+ve+rt;case X:return"ENOSYS: function not implemented, "+ve+rt;default:return Ke+": error occurred, "+ve+rt}}function Te(Ke,ve,we,ze,rt){ve===void 0&&(ve=""),we===void 0&&(we=""),ze===void 0&&(ze=""),rt===void 0&&(rt=Error);var ft=new rt(he(Ke,ve,we,ze));return ft.code=Ke,ft}var oe;(function(Ke){Ke[Ke.r=L]="r",Ke[Ke["r+"]=Y]="r+",Ke[Ke.rs=L|V]="rs",Ke[Ke.sr=Ke.rs]="sr",Ke[Ke["rs+"]=Y|V]="rs+",Ke[Ke["sr+"]=Ke["rs+"]]="sr+",Ke[Ke.w=C|G|D]="w",Ke[Ke.wx=C|G|D|ee]="wx",Ke[Ke.xw=Ke.wx]="xw",Ke[Ke["w+"]=Y|G|D]="w+",Ke[Ke["wx+"]=Y|G|D|ee]="wx+",Ke[Ke["xw+"]=Ke["wx+"]]="xw+",Ke[Ke.a=C|U|G]="a",Ke[Ke.ax=C|U|G|ee]="ax",Ke[Ke.xa=Ke.ax]="xa",Ke[Ke["a+"]=Y|U|G]="a+",Ke[Ke["ax+"]=Y|U|G|ee]="ax+",Ke[Ke["xa+"]=Ke["ax+"]]="xa+"})(oe=ui.FLAGS||(ui.FLAGS={}));function ce(Ke){if(typeof Ke=="number")return Ke;if(typeof Ke=="string"){var ve=oe[Ke];if(typeof ve<"u")return ve}throw new A.TypeError("ERR_INVALID_OPT_VALUE","flags",Ke)}ui.flagsToNumber=ce;function ot(Ke,ve){var we;if(ve){var ze=typeof ve;switch(ze){case"string":we=Object.assign({},Ke,{encoding:ve});break;case"object":we=Object.assign({},Ke,ve);break;default:throw TypeError(S(ze))}}else return Ke;return we.encoding!=="buffer"&&(0,E.assertEncoding)(we.encoding),we}function ge(Ke){return function(ve){return ot(Ke,ve)}}function Se(Ke){if(typeof Ke!="function")throw TypeError(R.CB);return Ke}function ut(Ke){return function(ve,we){return typeof ve=="function"?[Ke(),ve]:[Ke(ve),Se(we)]}}var Ze={encoding:"utf8"},Ge=ge(Ze),lt=ut(Ge),z={flag:"r"},T=ge(z),I={encoding:"utf8",mode:438,flag:oe[oe.w]},O=ge(I),q={encoding:"utf8",mode:438,flag:oe[oe.a]},H=ge(q),W=ut(H),fe=Ze,st=ge(fe),ue=ut(st),me={mode:511,recursive:!1},pe=function(Ke){return typeof Ke=="number"?Object.assign({},me,{mode:Ke}):Object.assign({},me,Ke)},be={recursive:!1},Qe=function(Ke){return Object.assign({},be,Ke)},se={encoding:"utf8",withFileTypes:!1},ye=ge(se),Ee=ut(ye),Fe={bigint:!1},de=function(Ke){return Ke===void 0&&(Ke={}),Object.assign({},Fe,Ke)},xe=function(Ke,ve){return typeof Ke=="function"?[de(),Ke]:[de(Ke),Se(ve)]};function ct(Ke){if(Ke.hostname!=="")throw new A.TypeError("ERR_INVALID_FILE_URL_HOST",b.default.platform);for(var ve=Ke.pathname,we=0;we<ve.length;we++)if(ve[we]==="%"){var ze=ve.codePointAt(we+2)|32;if(ve[we+1]==="2"&&ze===102)throw new A.TypeError("ERR_INVALID_FILE_URL_PATH","must not include encoded / characters")}return decodeURIComponent(ve)}function _e(Ke){if(typeof Ke!="string"&&!l.Buffer.isBuffer(Ke)){try{if(!(Ke instanceof vi.URL))throw new TypeError(R.PATH_STR)}catch{throw new TypeError(R.PATH_STR)}Ke=ct(Ke)}var ve=String(Ke);return Je(ve),ve}ui.pathToFilename=_e;var Ve=function(Ke,ve){return ve===void 0&&(ve=b.default.cwd()),N(ve,Ke)};if(o){var vt=Ve,Ye=ixe().unixify;Ve=function(Ke,ve){return Ye(vt(Ke,ve))}}function et(Ke,ve){var we=Ve(Ke,ve),ze=we.substr(1);return ze?ze.split(c):[]}ui.filenameToSteps=et;function mt(Ke){return et(_e(Ke))}ui.pathToSteps=mt;function We(Ke,ve){return ve===void 0&&(ve=E.ENCODING_UTF8),l.Buffer.isBuffer(Ke)?Ke.toString(ve):Ke instanceof Uint8Array?(0,l.bufferFrom)(Ke).toString(ve):String(Ke)}ui.dataToStr=We;function nt(Ke,ve){return ve===void 0&&(ve=E.ENCODING_UTF8),l.Buffer.isBuffer(Ke)?Ke:Ke instanceof Uint8Array?(0,l.bufferFrom)(Ke):(0,l.bufferFrom)(String(Ke),ve)}ui.dataToBuffer=nt;function bt(Ke,ve){return!ve||ve==="buffer"?Ke:Ke.toString(ve)}ui.bufferToEncoding=bt;function Je(Ke,ve){if((""+Ke).indexOf("\0")!==-1){var we=new Error("Path must be a string without null bytes");if(we.code=B,typeof ve!="function")throw we;return b.default.nextTick(ve,we),!1}return!0}function at(Ke,ve){if(typeof Ke=="number")return Ke;if(typeof Ke=="string")return parseInt(Ke,8);if(ve)return yt(ve)}function yt(Ke,ve){var we=at(Ke,ve);if(typeof we!="number"||isNaN(we))throw new TypeError(R.MODE_INT);return we}function Xe(Ke){return Ke>>>0===Ke}function it(Ke){if(!Xe(Ke))throw TypeError(R.FD)}function _t(Ke){if(typeof Ke=="string"&&+Ke==Ke)return+Ke;if(Ke instanceof Date)return Ke.getTime()/1e3;if(isFinite(Ke))return Ke<0?Date.now()/1e3:Ke;throw new Error("Cannot parse time: "+Ke)}ui.toUnixTimestamp=_t;function dt(Ke){if(typeof Ke!="number")throw TypeError(R.UID)}function Mt(Ke){if(typeof Ke!="number")throw TypeError(R.GID)}function qt(Ke){var ve={};function we(ze,rt){for(var ft in rt){var pt=rt[ft],xt=w(ze,ft);typeof pt=="string"?ve[xt]=pt:typeof pt=="object"&&pt!==null&&Object.keys(pt).length>0?we(xt,pt):ve[xt]=null}}return we("",Ke),ve}var Ut=function(){function Ke(ve){ve===void 0&&(ve={}),this.ino=0,this.inodes={},this.releasedInos=[],this.fds={},this.releasedFds=[],this.maxFiles=1e4,this.openFiles=0,this.promisesApi=(0,P.default)(this),this.statWatchers={},this.props=Object.assign({Node:a.Node,Link:a.Link,File:a.File},ve);var we=this.createLink();we.setNode(this.createNode(!0));var ze=this;this.StatWatcher=function(pt){t(xt,pt);function xt(){return pt.call(this,ze)||this}return xt}($t);var rt=Lt;this.ReadStream=function(pt){t(xt,pt);function xt(){for(var Kt=[],Qt=0;Qt<arguments.length;Qt++)Kt[Qt]=arguments[Qt];return pt.apply(this,e([ze],Kt,!1))||this}return xt}(rt);var ft=Nt;this.WriteStream=function(pt){t(xt,pt);function xt(){for(var Kt=[],Qt=0;Qt<arguments.length;Qt++)Kt[Qt]=arguments[Qt];return pt.apply(this,e([ze],Kt,!1))||this}return xt}(ft),this.FSWatcher=function(pt){t(xt,pt);function xt(){return pt.call(this,ze)||this}return xt}(zt),this.root=we}return Ke.fromJSON=function(ve,we){var ze=new Ke;return ze.fromJSON(ve,we),ze},Ke.fromNestedJSON=function(ve,we){var ze=new Ke;return ze.fromNestedJSON(ve,we),ze},Object.defineProperty(Ke.prototype,"promises",{get:function(){if(this.promisesApi===null)throw new Error("Promise is not supported in this environment.");return this.promisesApi},enumerable:!1,configurable:!0}),Ke.prototype.createLink=function(ve,we,ze,rt){if(ze===void 0&&(ze=!1),!ve)return new this.props.Link(this,null,"");if(!we)throw new Error("createLink: name cannot be empty");return ve.createChild(we,this.createNode(ze,rt))},Ke.prototype.deleteLink=function(ve){var we=ve.parent;return we?(we.deleteChild(ve),!0):!1},Ke.prototype.newInoNumber=function(){var ve=this.releasedInos.pop();return ve||(this.ino=(this.ino+1)%4294967295,this.ino)},Ke.prototype.newFdNumber=function(){var ve=this.releasedFds.pop();return typeof ve=="number"?ve:Ke.fd--},Ke.prototype.createNode=function(ve,we){ve===void 0&&(ve=!1);var ze=new this.props.Node(this.newInoNumber(),we);return ve&&ze.setIsDirectory(),this.inodes[ze.ino]=ze,ze},Ke.prototype.getNode=function(ve){return this.inodes[ve]},Ke.prototype.deleteNode=function(ve){ve.del(),delete this.inodes[ve.ino],this.releasedInos.push(ve.ino)},Ke.prototype.genRndStr=function(){var ve=(Math.random()+1).toString(36).substr(2,6);return ve.length===6?ve:this.genRndStr()},Ke.prototype.getLink=function(ve){return this.root.walk(ve)},Ke.prototype.getLinkOrThrow=function(ve,we){var ze=et(ve),rt=this.getLink(ze);if(!rt)throw Te(B,we,ve);return rt},Ke.prototype.getResolvedLink=function(ve){for(var we=typeof ve=="string"?et(ve):ve,ze=this.root,rt=0;rt<we.length;){var ft=we[rt];if(ze=ze.getChild(ft),!ze)return null;var pt=ze.getNode();if(pt.isSymlink()){we=pt.symlink.concat(we.slice(rt+1)),ze=this.root,rt=0;continue}rt++}return ze},Ke.prototype.getResolvedLinkOrThrow=function(ve,we){var ze=this.getResolvedLink(ve);if(!ze)throw Te(B,we,ve);return ze},Ke.prototype.resolveSymlinks=function(ve){return this.getResolvedLink(ve.steps.slice(1))},Ke.prototype.getLinkAsDirOrThrow=function(ve,we){var ze=this.getLinkOrThrow(ve,we);if(!ze.getNode().isDirectory())throw Te(K,we,ve);return ze},Ke.prototype.getLinkParent=function(ve){return this.root.walk(ve,ve.length-1)},Ke.prototype.getLinkParentAsDirOrThrow=function(ve,we){var ze=ve instanceof Array?ve:et(ve),rt=this.getLinkParent(ze);if(!rt)throw Te(B,we,c+ze.join(c));if(!rt.getNode().isDirectory())throw Te(K,we,c+ze.join(c));return rt},Ke.prototype.getFileByFd=function(ve){return this.fds[String(ve)]},Ke.prototype.getFileByFdOrThrow=function(ve,we){if(!Xe(ve))throw TypeError(R.FD);var ze=this.getFileByFd(ve);if(!ze)throw Te(F,we);return ze},Ke.prototype.getNodeByIdOrCreate=function(ve,we,ze){if(typeof ve=="number"){var rt=this.getFileByFd(ve);if(!rt)throw Error("File nto found");return rt.node}else{var ft=mt(ve),pt=this.getLink(ft);if(pt)return pt.getNode();if(we&G){var xt=this.getLinkParent(ft);if(xt){var Kt=ft[ft.length-1];return pt=this.createLink(xt,Kt,!1,ze),pt.getNode()}}throw Te(B,"getNodeByIdOrCreate",_e(ve))}},Ke.prototype.wrapAsync=function(ve,we,ze){var rt=this;Se(ze),(0,p.default)(function(){var ft;try{ft=ve.apply(rt,we)}catch(pt){ze(pt);return}ze(null,ft)})},Ke.prototype._toJSON=function(ve,we,ze){var rt;ve===void 0&&(ve=this.root),we===void 0&&(we={});var ft=!0,pt=ve.children;ve.getNode().isFile()&&(pt=(rt={},rt[ve.getName()]=ve.parent.getChild(ve.getName()),rt),ve=ve.parent);for(var xt in pt){ft=!1;var Kt=ve.getChild(xt);if(!Kt)throw new Error("_toJSON: unexpected undefined");var Qt=Kt.getNode();if(Qt.isFile()){var ci=Kt.getPath();ze&&(ci=m(ze,ci)),we[ci]=Qt.getString()}else Qt.isDirectory()&&this._toJSON(Kt,we,ze)}var wn=ve.getPath();return ze&&(wn=m(ze,wn)),wn&&ft&&(we[wn]=null),we},Ke.prototype.toJSON=function(ve,we,ze){we===void 0&&(we={}),ze===void 0&&(ze=!1);var rt=[];if(ve){ve instanceof Array||(ve=[ve]);for(var ft=0,pt=ve;ft<pt.length;ft++){var xt=pt[ft],Kt=_e(xt),Qt=this.getResolvedLink(Kt);Qt&&rt.push(Qt)}}else rt.push(this.root);if(!rt.length)return we;for(var ci=0,wn=rt;ci<wn.length;ci++){var Qt=wn[ci];this._toJSON(Qt,we,ze?Qt.getPath():"")}return we},Ke.prototype.fromJSON=function(ve,we){we===void 0&&(we=b.default.cwd());for(var ze in ve){var rt=ve[ze];if(ze=Ve(ze,we),typeof rt=="string"){var ft=d(ze);this.mkdirpBase(ft,511),this.writeFileSync(ze,rt)}else this.mkdirpBase(ze,511)}},Ke.prototype.fromNestedJSON=function(ve,we){this.fromJSON(qt(ve),we)},Ke.prototype.reset=function(){this.ino=0,this.inodes={},this.releasedInos=[],this.fds={},this.releasedFds=[],this.openFiles=0,this.root=this.createLink(),this.root.setNode(this.createNode(!0))},Ke.prototype.mountSync=function(ve,we){this.fromJSON(we,ve)},Ke.prototype.openLink=function(ve,we,ze){if(ze===void 0&&(ze=!0),this.openFiles>=this.maxFiles)throw Te(le,"open",ve.getPath());var rt=ve;if(ze&&(rt=this.resolveSymlinks(ve)),!rt)throw Te(B,"open",ve.getPath());var ft=rt.getNode();if(ft.isDirectory()){if((we&(L|Y|C))!==L)throw Te(j,"open",ve.getPath())}else if(we&_)throw Te(K,"open",ve.getPath());if(!(we&C)&&!ft.canRead())throw Te(te,"open",ve.getPath());var pt=new this.props.File(ve,ft,we,this.newFdNumber());return this.fds[pt.fd]=pt,this.openFiles++,we&D&&pt.truncate(),pt},Ke.prototype.openFile=function(ve,we,ze,rt){rt===void 0&&(rt=!0);var ft=et(ve),pt=rt?this.getResolvedLink(ft):this.getLink(ft);if(!pt&&we&G){var xt=this.getResolvedLink(ft.slice(0,ft.length-1));if(!xt)throw Te(B,"open",c+ft.join(c));we&G&&typeof ze=="number"&&(pt=this.createLink(xt,ft[ft.length-1],!1,ze))}if(pt)return this.openLink(pt,we,rt);throw Te(B,"open",ve)},Ke.prototype.openBase=function(ve,we,ze,rt){rt===void 0&&(rt=!0);var ft=this.openFile(ve,we,ze,rt);if(!ft)throw Te(B,"open",ve);return ft.fd},Ke.prototype.openSync=function(ve,we,ze){ze===void 0&&(ze=438);var rt=yt(ze),ft=_e(ve),pt=ce(we);return this.openBase(ft,pt,rt)},Ke.prototype.open=function(ve,we,ze,rt){var ft=ze,pt=rt;typeof ze=="function"&&(ft=438,pt=ze),ft=ft||438;var xt=yt(ft),Kt=_e(ve),Qt=ce(we);this.wrapAsync(this.openBase,[Kt,Qt,xt],pt)},Ke.prototype.closeFile=function(ve){this.fds[ve.fd]&&(this.openFiles--,delete this.fds[ve.fd],this.releasedFds.push(ve.fd))},Ke.prototype.closeSync=function(ve){it(ve);var we=this.getFileByFdOrThrow(ve,"close");this.closeFile(we)},Ke.prototype.close=function(ve,we){it(ve),this.wrapAsync(this.closeSync,[ve],we)},Ke.prototype.openFileOrGetById=function(ve,we,ze){if(typeof ve=="number"){var rt=this.fds[ve];if(!rt)throw Te(B);return rt}else return this.openFile(_e(ve),we,ze)},Ke.prototype.readBase=function(ve,we,ze,rt,ft){var pt=this.getFileByFdOrThrow(ve);return pt.read(we,Number(ze),Number(rt),ft)},Ke.prototype.readSync=function(ve,we,ze,rt,ft){return it(ve),this.readBase(ve,we,ze,rt,ft)},Ke.prototype.read=function(ve,we,ze,rt,ft,pt){var xt=this;if(Se(pt),rt===0)return b.default.nextTick(function(){pt&&pt(null,0,we)});(0,p.default)(function(){try{var Kt=xt.readBase(ve,we,ze,rt,ft);pt(null,Kt,we)}catch(Qt){pt(Qt)}})},Ke.prototype.readFileBase=function(ve,we,ze){var rt,ft=typeof ve=="number",pt=ft&&Xe(ve),xt;if(pt)xt=ve;else{var Kt=_e(ve),Qt=et(Kt),ci=this.getResolvedLink(Qt);if(ci){var wn=ci.getNode();if(wn.isDirectory())throw Te(j,"open",ci.getPath())}xt=this.openSync(ve,we)}try{rt=bt(this.getFileByFdOrThrow(xt).getBuffer(),ze)}finally{pt||this.closeSync(xt)}return rt},Ke.prototype.readFileSync=function(ve,we){var ze=T(we),rt=ce(ze.flag);return this.readFileBase(ve,rt,ze.encoding)},Ke.prototype.readFile=function(ve,we,ze){var rt=ut(T)(we,ze),ft=rt[0],pt=rt[1],xt=ce(ft.flag);this.wrapAsync(this.readFileBase,[ve,xt,ft.encoding],pt)},Ke.prototype.writeBase=function(ve,we,ze,rt,ft){var pt=this.getFileByFdOrThrow(ve,"write");return pt.write(we,ze,rt,ft)},Ke.prototype.writeSync=function(ve,we,ze,rt,ft){it(ve);var pt,xt,Kt,Qt,ci=typeof we!="string";ci?(xt=(ze||0)|0,Kt=rt,Qt=ft):(Qt=ze,pt=rt);var wn=nt(we,pt);return ci?typeof Kt>"u"&&(Kt=wn.length):(xt=0,Kt=wn.length),this.writeBase(ve,wn,xt,Kt,Qt)},Ke.prototype.write=function(ve,we,ze,rt,ft,pt){var xt=this;it(ve);var Kt,Qt,ci,wn,Hs,Kw=typeof we,yP=typeof ze,wP=typeof rt,_P=typeof ft;Kw!=="string"?yP==="function"?Hs=ze:wP==="function"?(Kt=ze|0,Hs=rt):_P==="function"?(Kt=ze|0,Qt=rt,Hs=ft):(Kt=ze|0,Qt=rt,ci=ft,Hs=pt):yP==="function"?Hs=ze:wP==="function"?(ci=ze,Hs=rt):_P==="function"&&(ci=ze,wn=rt,Hs=ft);var Tb=nt(we,wn);Kw!=="string"?typeof Qt>"u"&&(Qt=Tb.length):(Kt=0,Qt=Tb.length);var Ww=Se(Hs);(0,p.default)(function(){try{var MP=xt.writeBase(ve,Tb,Kt,Qt,ci);Kw!=="string"?Ww(null,MP,Tb):Ww(null,MP,we)}catch(eue){Ww(eue)}})},Ke.prototype.writeFileBase=function(ve,we,ze,rt){var ft=typeof ve=="number",pt;ft?pt=ve:pt=this.openBase(_e(ve),ze,rt);var xt=0,Kt=we.length,Qt=ze&U?void 0:0;try{for(;Kt>0;){var ci=this.writeSync(pt,we,xt,Kt,Qt);xt+=ci,Kt-=ci,Qt!==void 0&&(Qt+=ci)}}finally{ft||this.closeSync(pt)}},Ke.prototype.writeFileSync=function(ve,we,ze){var rt=O(ze),ft=ce(rt.flag),pt=yt(rt.mode),xt=nt(we,rt.encoding);this.writeFileBase(ve,xt,ft,pt)},Ke.prototype.writeFile=function(ve,we,ze,rt){var ft=ze,pt=rt;typeof ze=="function"&&(ft=I,pt=ze);var xt=Se(pt),Kt=O(ft),Qt=ce(Kt.flag),ci=yt(Kt.mode),wn=nt(we,Kt.encoding);this.wrapAsync(this.writeFileBase,[ve,wn,Qt,ci],xt)},Ke.prototype.linkBase=function(ve,we){var ze=et(ve),rt=this.getLink(ze);if(!rt)throw Te(B,"link",ve,we);var ft=et(we),pt=this.getLinkParent(ft);if(!pt)throw Te(B,"link",ve,we);var xt=ft[ft.length-1];if(pt.getChild(xt))throw Te(Z,"link",ve,we);var Kt=rt.getNode();Kt.nlink++,pt.createChild(xt,Kt)},Ke.prototype.copyFileBase=function(ve,we,ze){var rt=this.readFileSync(ve);if(ze&s&&this.existsSync(we))throw Te(Z,"copyFile",ve,we);if(ze&f)throw Te(X,"copyFile",ve,we);this.writeFileBase(we,rt,oe.w,438)},Ke.prototype.copyFileSync=function(ve,we,ze){var rt=_e(ve),ft=_e(we);return this.copyFileBase(rt,ft,(ze||0)|0)},Ke.prototype.copyFile=function(ve,we,ze,rt){var ft=_e(ve),pt=_e(we),xt,Kt;typeof ze=="function"?(xt=0,Kt=ze):(xt=ze,Kt=rt),Se(Kt),this.wrapAsync(this.copyFileBase,[ft,pt,xt],Kt)},Ke.prototype.linkSync=function(ve,we){var ze=_e(ve),rt=_e(we);this.linkBase(ze,rt)},Ke.prototype.link=function(ve,we,ze){var rt=_e(ve),ft=_e(we);this.wrapAsync(this.linkBase,[rt,ft],ze)},Ke.prototype.unlinkBase=function(ve){var we=et(ve),ze=this.getLink(we);if(!ze)throw Te(B,"unlink",ve);if(ze.length)throw Error("Dir not empty...");this.deleteLink(ze);var rt=ze.getNode();rt.nlink--,rt.nlink<=0&&this.deleteNode(rt)},Ke.prototype.unlinkSync=function(ve){var we=_e(ve);this.unlinkBase(we)},Ke.prototype.unlink=function(ve,we){var ze=_e(ve);this.wrapAsync(this.unlinkBase,[ze],we)},Ke.prototype.symlinkBase=function(ve,we){var ze=et(we),rt=this.getLinkParent(ze);if(!rt)throw Te(B,"symlink",ve,we);var ft=ze[ze.length-1];if(rt.getChild(ft))throw Te(Z,"symlink",ve,we);var pt=rt.createChild(ft);return pt.getNode().makeSymlink(et(ve)),pt},Ke.prototype.symlinkSync=function(ve,we,ze){var rt=_e(ve),ft=_e(we);this.symlinkBase(rt,ft)},Ke.prototype.symlink=function(ve,we,ze,rt){var ft=Se(typeof ze=="function"?ze:rt),pt=_e(ve),xt=_e(we);this.wrapAsync(this.symlinkBase,[pt,xt],ft)},Ke.prototype.realpathBase=function(ve,we){var ze=et(ve),rt=this.getResolvedLink(ze);if(!rt)throw Te(B,"realpath",ve);return(0,E.strToEncoding)(rt.getPath(),we)},Ke.prototype.realpathSync=function(ve,we){return this.realpathBase(_e(ve),st(we).encoding)},Ke.prototype.realpath=function(ve,we,ze){var rt=ue(we,ze),ft=rt[0],pt=rt[1],xt=_e(ve);this.wrapAsync(this.realpathBase,[xt,ft.encoding],pt)},Ke.prototype.lstatBase=function(ve,we){we===void 0&&(we=!1);var ze=this.getLink(et(ve));if(!ze)throw Te(B,"lstat",ve);return i.default.build(ze.getNode(),we)},Ke.prototype.lstatSync=function(ve,we){return this.lstatBase(_e(ve),de(we).bigint)},Ke.prototype.lstat=function(ve,we,ze){var rt=xe(we,ze),ft=rt[0],pt=rt[1];this.wrapAsync(this.lstatBase,[_e(ve),ft.bigint],pt)},Ke.prototype.statBase=function(ve,we){we===void 0&&(we=!1);var ze=this.getResolvedLink(et(ve));if(!ze)throw Te(B,"stat",ve);return i.default.build(ze.getNode(),we)},Ke.prototype.statSync=function(ve,we){return this.statBase(_e(ve),de(we).bigint)},Ke.prototype.stat=function(ve,we,ze){var rt=xe(we,ze),ft=rt[0],pt=rt[1];this.wrapAsync(this.statBase,[_e(ve),ft.bigint],pt)},Ke.prototype.fstatBase=function(ve,we){we===void 0&&(we=!1);var ze=this.getFileByFd(ve);if(!ze)throw Te(F,"fstat");return i.default.build(ze.node,we)},Ke.prototype.fstatSync=function(ve,we){return this.fstatBase(ve,de(we).bigint)},Ke.prototype.fstat=function(ve,we,ze){var rt=xe(we,ze),ft=rt[0],pt=rt[1];this.wrapAsync(this.fstatBase,[ve,ft.bigint],pt)},Ke.prototype.renameBase=function(ve,we){var ze=this.getLink(et(ve));if(!ze)throw Te(B,"rename",ve,we);var rt=et(we),ft=this.getLinkParent(rt);if(!ft)throw Te(B,"rename",ve,we);var pt=ze.parent;pt&&pt.deleteChild(ze);var xt=rt[rt.length-1];ze.steps=e(e([],ft.steps,!0),[xt],!1),ft.setChild(ze.getName(),ze)},Ke.prototype.renameSync=function(ve,we){var ze=_e(ve),rt=_e(we);this.renameBase(ze,rt)},Ke.prototype.rename=function(ve,we,ze){var rt=_e(ve),ft=_e(we);this.wrapAsync(this.renameBase,[rt,ft],ze)},Ke.prototype.existsBase=function(ve){return!!this.statBase(ve)},Ke.prototype.existsSync=function(ve){try{return this.existsBase(_e(ve))}catch{return!1}},Ke.prototype.exists=function(ve,we){var ze=this,rt=_e(ve);if(typeof we!="function")throw Error(R.CB);(0,p.default)(function(){try{we(ze.existsBase(rt))}catch{we(!1)}})},Ke.prototype.accessBase=function(ve,we){this.getLinkOrThrow(ve,"access")},Ke.prototype.accessSync=function(ve,we){we===void 0&&(we=n);var ze=_e(ve);we=we|0,this.accessBase(ze,we)},Ke.prototype.access=function(ve,we,ze){var rt=n,ft;typeof we!="function"?(rt=we|0,ft=Se(ze)):ft=we;var pt=_e(ve);this.wrapAsync(this.accessBase,[pt,rt],ft)},Ke.prototype.appendFileSync=function(ve,we,ze){ze===void 0&&(ze=q);var rt=H(ze);(!rt.flag||Xe(ve))&&(rt.flag="a"),this.writeFileSync(ve,we,rt)},Ke.prototype.appendFile=function(ve,we,ze,rt){var ft=W(ze,rt),pt=ft[0],xt=ft[1];(!pt.flag||Xe(ve))&&(pt.flag="a"),this.writeFile(ve,we,pt,xt)},Ke.prototype.readdirBase=function(ve,we){var ze=et(ve),rt=this.getResolvedLink(ze);if(!rt)throw Te(B,"readdir",ve);var ft=rt.getNode();if(!ft.isDirectory())throw Te(K,"scandir",ve);if(we.withFileTypes){var pt=[];for(var xt in rt.children){var Kt=rt.getChild(xt);Kt&&pt.push(h.default.build(Kt,we.encoding))}return!o&&we.encoding!=="buffer"&&pt.sort(function(wn,Hs){return wn.name<Hs.name?-1:wn.name>Hs.name?1:0}),pt}var Qt=[];for(var ci in rt.children)Qt.push((0,E.strToEncoding)(ci,we.encoding));return!o&&we.encoding!=="buffer"&&Qt.sort(),Qt},Ke.prototype.readdirSync=function(ve,we){var ze=ye(we),rt=_e(ve);return this.readdirBase(rt,ze)},Ke.prototype.readdir=function(ve,we,ze){var rt=Ee(we,ze),ft=rt[0],pt=rt[1],xt=_e(ve);this.wrapAsync(this.readdirBase,[xt,ft],pt)},Ke.prototype.readlinkBase=function(ve,we){var ze=this.getLinkOrThrow(ve,"readlink"),rt=ze.getNode();if(!rt.isSymlink())throw Te($,"readlink",ve);var ft=c+rt.symlink.join(c);return(0,E.strToEncoding)(ft,we)},Ke.prototype.readlinkSync=function(ve,we){var ze=Ge(we),rt=_e(ve);return this.readlinkBase(rt,ze.encoding)},Ke.prototype.readlink=function(ve,we,ze){var rt=lt(we,ze),ft=rt[0],pt=rt[1],xt=_e(ve);this.wrapAsync(this.readlinkBase,[xt,ft.encoding],pt)},Ke.prototype.fsyncBase=function(ve){this.getFileByFdOrThrow(ve,"fsync")},Ke.prototype.fsyncSync=function(ve){this.fsyncBase(ve)},Ke.prototype.fsync=function(ve,we){this.wrapAsync(this.fsyncBase,[ve],we)},Ke.prototype.fdatasyncBase=function(ve){this.getFileByFdOrThrow(ve,"fdatasync")},Ke.prototype.fdatasyncSync=function(ve){this.fdatasyncBase(ve)},Ke.prototype.fdatasync=function(ve,we){this.wrapAsync(this.fdatasyncBase,[ve],we)},Ke.prototype.ftruncateBase=function(ve,we){var ze=this.getFileByFdOrThrow(ve,"ftruncate");ze.truncate(we)},Ke.prototype.ftruncateSync=function(ve,we){this.ftruncateBase(ve,we)},Ke.prototype.ftruncate=function(ve,we,ze){var rt=typeof we=="number"?we:0,ft=Se(typeof we=="number"?ze:we);this.wrapAsync(this.ftruncateBase,[ve,rt],ft)},Ke.prototype.truncateBase=function(ve,we){var ze=this.openSync(ve,"r+");try{this.ftruncateSync(ze,we)}finally{this.closeSync(ze)}},Ke.prototype.truncateSync=function(ve,we){if(Xe(ve))return this.ftruncateSync(ve,we);this.truncateBase(ve,we)},Ke.prototype.truncate=function(ve,we,ze){var rt=typeof we=="number"?we:0,ft=Se(typeof we=="number"?ze:we);if(Xe(ve))return this.ftruncate(ve,rt,ft);this.wrapAsync(this.truncateBase,[ve,rt],ft)},Ke.prototype.futimesBase=function(ve,we,ze){var rt=this.getFileByFdOrThrow(ve,"futimes"),ft=rt.node;ft.atime=new Date(we*1e3),ft.mtime=new Date(ze*1e3)},Ke.prototype.futimesSync=function(ve,we,ze){this.futimesBase(ve,_t(we),_t(ze))},Ke.prototype.futimes=function(ve,we,ze,rt){this.wrapAsync(this.futimesBase,[ve,_t(we),_t(ze)],rt)},Ke.prototype.utimesBase=function(ve,we,ze){var rt=this.openSync(ve,"r+");try{this.futimesBase(rt,we,ze)}finally{this.closeSync(rt)}},Ke.prototype.utimesSync=function(ve,we,ze){this.utimesBase(_e(ve),_t(we),_t(ze))},Ke.prototype.utimes=function(ve,we,ze,rt){this.wrapAsync(this.utimesBase,[_e(ve),_t(we),_t(ze)],rt)},Ke.prototype.mkdirBase=function(ve,we){var ze=et(ve);if(!ze.length)throw Te(Z,"mkdir",ve);var rt=this.getLinkParentAsDirOrThrow(ve,"mkdir"),ft=ze[ze.length-1];if(rt.getChild(ft))throw Te(Z,"mkdir",ve);rt.createChild(ft,this.createNode(!0,we))},Ke.prototype.mkdirpBase=function(ve,we){for(var ze=et(ve),rt=this.root,ft=0;ft<ze.length;ft++){var pt=ze[ft];if(!rt.getNode().isDirectory())throw Te(K,"mkdir",rt.getPath());var xt=rt.getChild(pt);if(xt)if(xt.getNode().isDirectory())rt=xt;else throw Te(K,"mkdir",xt.getPath());else rt=rt.createChild(pt,this.createNode(!0,we))}},Ke.prototype.mkdirSync=function(ve,we){var ze=pe(we),rt=yt(ze.mode,511),ft=_e(ve);ze.recursive?this.mkdirpBase(ft,rt):this.mkdirBase(ft,rt)},Ke.prototype.mkdir=function(ve,we,ze){var rt=pe(we),ft=Se(typeof we=="function"?we:ze),pt=yt(rt.mode,511),xt=_e(ve);rt.recursive?this.wrapAsync(this.mkdirpBase,[xt,pt],ft):this.wrapAsync(this.mkdirBase,[xt,pt],ft)},Ke.prototype.mkdirpSync=function(ve,we){this.mkdirSync(ve,{mode:we,recursive:!0})},Ke.prototype.mkdirp=function(ve,we,ze){var rt=typeof we=="function"?void 0:we,ft=Se(typeof we=="function"?we:ze);this.mkdir(ve,{mode:rt,recursive:!0},ft)},Ke.prototype.mkdtempBase=function(ve,we,ze){ze===void 0&&(ze=5);var rt=ve+this.genRndStr();try{return this.mkdirBase(rt,511),(0,E.strToEncoding)(rt,we)}catch(ft){if(ft.code===Z){if(ze>1)return this.mkdtempBase(ve,we,ze-1);throw Error("Could not create temp dir.")}else throw ft}},Ke.prototype.mkdtempSync=function(ve,we){var ze=Ge(we).encoding;if(!ve||typeof ve!="string")throw new TypeError("filename prefix is required");return Je(ve),this.mkdtempBase(ve,ze)},Ke.prototype.mkdtemp=function(ve,we,ze){var rt=lt(we,ze),ft=rt[0].encoding,pt=rt[1];if(!ve||typeof ve!="string")throw new TypeError("filename prefix is required");Je(ve)&&this.wrapAsync(this.mkdtempBase,[ve,ft],pt)},Ke.prototype.rmdirBase=function(ve,we){var ze=Qe(we),rt=this.getLinkAsDirOrThrow(ve,"rmdir");if(rt.length&&!ze.recursive)throw Te(J,"rmdir",ve);this.deleteLink(rt)},Ke.prototype.rmdirSync=function(ve,we){this.rmdirBase(_e(ve),we)},Ke.prototype.rmdir=function(ve,we,ze){var rt=Qe(we),ft=Se(typeof we=="function"?we:ze);this.wrapAsync(this.rmdirBase,[_e(ve),rt],ft)},Ke.prototype.fchmodBase=function(ve,we){var ze=this.getFileByFdOrThrow(ve,"fchmod");ze.chmod(we)},Ke.prototype.fchmodSync=function(ve,we){this.fchmodBase(ve,yt(we))},Ke.prototype.fchmod=function(ve,we,ze){this.wrapAsync(this.fchmodBase,[ve,yt(we)],ze)},Ke.prototype.chmodBase=function(ve,we){var ze=this.openSync(ve,"r+");try{this.fchmodBase(ze,we)}finally{this.closeSync(ze)}},Ke.prototype.chmodSync=function(ve,we){var ze=yt(we),rt=_e(ve);this.chmodBase(rt,ze)},Ke.prototype.chmod=function(ve,we,ze){var rt=yt(we),ft=_e(ve);this.wrapAsync(this.chmodBase,[ft,rt],ze)},Ke.prototype.lchmodBase=function(ve,we){var ze=this.openBase(ve,Y,0,!1);try{this.fchmodBase(ze,we)}finally{this.closeSync(ze)}},Ke.prototype.lchmodSync=function(ve,we){var ze=yt(we),rt=_e(ve);this.lchmodBase(rt,ze)},Ke.prototype.lchmod=function(ve,we,ze){var rt=yt(we),ft=_e(ve);this.wrapAsync(this.lchmodBase,[ft,rt],ze)},Ke.prototype.fchownBase=function(ve,we,ze){this.getFileByFdOrThrow(ve,"fchown").chown(we,ze)},Ke.prototype.fchownSync=function(ve,we,ze){dt(we),Mt(ze),this.fchownBase(ve,we,ze)},Ke.prototype.fchown=function(ve,we,ze,rt){dt(we),Mt(ze),this.wrapAsync(this.fchownBase,[ve,we,ze],rt)},Ke.prototype.chownBase=function(ve,we,ze){var rt=this.getResolvedLinkOrThrow(ve,"chown"),ft=rt.getNode();ft.chown(we,ze)},Ke.prototype.chownSync=function(ve,we,ze){dt(we),Mt(ze),this.chownBase(_e(ve),we,ze)},Ke.prototype.chown=function(ve,we,ze,rt){dt(we),Mt(ze),this.wrapAsync(this.chownBase,[_e(ve),we,ze],rt)},Ke.prototype.lchownBase=function(ve,we,ze){this.getLinkOrThrow(ve,"lchown").getNode().chown(we,ze)},Ke.prototype.lchownSync=function(ve,we,ze){dt(we),Mt(ze),this.lchownBase(_e(ve),we,ze)},Ke.prototype.lchown=function(ve,we,ze,rt){dt(we),Mt(ze),this.wrapAsync(this.lchownBase,[_e(ve),we,ze],rt)},Ke.prototype.watchFile=function(ve,we,ze){var rt=_e(ve),ft=we,pt=ze;if(typeof ft=="function"&&(pt=we,ft=null),typeof pt!="function")throw Error('"watchFile()" requires a listener function');var xt=5007,Kt=!0;ft&&typeof ft=="object"&&(typeof ft.interval=="number"&&(xt=ft.interval),typeof ft.persistent=="boolean"&&(Kt=ft.persistent));var Qt=this.statWatchers[rt];return Qt||(Qt=new this.StatWatcher,Qt.start(rt,Kt,xt),this.statWatchers[rt]=Qt),Qt.addListener("change",pt),Qt},Ke.prototype.unwatchFile=function(ve,we){var ze=_e(ve),rt=this.statWatchers[ze];rt&&(typeof we=="function"?rt.removeListener("change",we):rt.removeAllListeners("change"),rt.listenerCount("change")===0&&(rt.stop(),delete this.statWatchers[ze]))},Ke.prototype.createReadStream=function(ve,we){return new this.ReadStream(ve,we)},Ke.prototype.createWriteStream=function(ve,we){return new this.WriteStream(ve,we)},Ke.prototype.watch=function(ve,we,ze){var rt=_e(ve),ft=we;typeof we=="function"&&(ze=we,ft=null);var pt=Ge(ft),xt=pt.persistent,Kt=pt.recursive,Qt=pt.encoding;xt===void 0&&(xt=!0),Kt===void 0&&(Kt=!1);var ci=new this.FSWatcher;return ci.start(rt,xt,Kt,Qt),ze&&ci.addListener("change",ze),ci},Ke.fd=2147483647,Ke}();ui.Volume=Ut;function Ft(Ke){Ke.emit("stop")}var $t=function(Ke){t(ve,Ke);function ve(we){var ze=Ke.call(this)||this;return ze.onInterval=function(){try{var rt=ze.vol.statSync(ze.filename);ze.hasChanged(rt)&&(ze.emit("change",rt,ze.prev),ze.prev=rt)}finally{ze.loop()}},ze.vol=we,ze}return ve.prototype.loop=function(){this.timeoutRef=this.setTimeout(this.onInterval,this.interval)},ve.prototype.hasChanged=function(we){return we.mtimeMs>this.prev.mtimeMs||we.nlink!==this.prev.nlink},ve.prototype.start=function(we,ze,rt){ze===void 0&&(ze=!0),rt===void 0&&(rt=5007),this.filename=_e(we),this.setTimeout=ze?setTimeout.bind(typeof globalThis<"u"?globalThis:nxe):g.default,this.interval=rt,this.prev=this.vol.statSync(this.filename),this.loop()},ve.prototype.stop=function(){clearTimeout(this.timeoutRef),b.default.nextTick(Ft,this)},ve}(x.EventEmitter);ui.StatWatcher=$t;var Tt;function Zt(Ke){Tt=(0,l.bufferAllocUnsafe)(Ke),Tt.used=0}k.inherits(Lt,y.Readable),ui.ReadStream=Lt;function Lt(Ke,ve,we){if(!(this instanceof Lt))return new Lt(Ke,ve,we);if(this._vol=Ke,we=Object.assign({},ot(we,{})),we.highWaterMark===void 0&&(we.highWaterMark=64*1024),y.Readable.call(this,we),this.path=_e(ve),this.fd=we.fd===void 0?null:we.fd,this.flags=we.flags===void 0?"r":we.flags,this.mode=we.mode===void 0?438:we.mode,this.start=we.start,this.end=we.end,this.autoClose=we.autoClose===void 0?!0:we.autoClose,this.pos=void 0,this.bytesRead=0,this.start!==void 0){if(typeof this.start!="number")throw new TypeError('"start" option must be a Number');if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw new TypeError('"end" option must be a Number');if(this.start>this.end)throw new Error('"start" option must be <= "end" option');this.pos=this.start}typeof this.fd!="number"&&this.open(),this.on("end",function(){this.autoClose&&this.destroy&&this.destroy()})}Lt.prototype.open=function(){var Ke=this;this._vol.open(this.path,this.flags,this.mode,function(ve,we){if(ve){Ke.autoClose&&Ke.destroy&&Ke.destroy(),Ke.emit("error",ve);return}Ke.fd=we,Ke.emit("open",we),Ke.read()})},Lt.prototype._read=function(Ke){if(typeof this.fd!="number")return this.once("open",function(){this._read(Ke)});if(this.destroyed)return;(!Tt||Tt.length-Tt.used<v)&&Zt(this._readableState.highWaterMark);var ve=Tt,we=Math.min(Tt.length-Tt.used,Ke),ze=Tt.used;if(this.pos!==void 0&&(we=Math.min(this.end-this.pos+1,we)),we<=0)return this.push(null);var rt=this;this._vol.read(this.fd,Tt,Tt.used,we,this.pos,ft),this.pos!==void 0&&(this.pos+=we),Tt.used+=we;function ft(pt,xt){if(pt)rt.autoClose&&rt.destroy&&rt.destroy(),rt.emit("error",pt);else{var Kt=null;xt>0&&(rt.bytesRead+=xt,Kt=ve.slice(ze,ze+xt)),rt.push(Kt)}}},Lt.prototype._destroy=function(Ke,ve){this.close(function(we){ve(Ke||we)})},Lt.prototype.close=function(Ke){var ve=this;if(Ke&&this.once("close",Ke),this.closed||typeof this.fd!="number"){if(typeof this.fd!="number"){this.once("open",Ht);return}return b.default.nextTick(function(){return ve.emit("close")})}this.closed=!0,this._vol.close(this.fd,function(we){we?ve.emit("error",we):ve.emit("close")}),this.fd=null};function Ht(Ke){this.close()}k.inherits(Nt,y.Writable),ui.WriteStream=Nt;function Nt(Ke,ve,we){if(!(this instanceof Nt))return new Nt(Ke,ve,we);if(this._vol=Ke,we=Object.assign({},ot(we,{})),y.Writable.call(this,we),this.path=_e(ve),this.fd=we.fd===void 0?null:we.fd,this.flags=we.flags===void 0?"w":we.flags,this.mode=we.mode===void 0?438:we.mode,this.start=we.start,this.autoClose=we.autoClose===void 0?!0:!!we.autoClose,this.pos=void 0,this.bytesWritten=0,this.start!==void 0){if(typeof this.start!="number")throw new TypeError('"start" option must be a Number');if(this.start<0)throw new Error('"start" must be >= zero');this.pos=this.start}we.encoding&&this.setDefaultEncoding(we.encoding),typeof this.fd!="number"&&this.open(),this.once("finish",function(){this.autoClose&&this.close()})}Nt.prototype.open=function(){this._vol.open(this.path,this.flags,this.mode,function(Ke,ve){if(Ke){this.autoClose&&this.destroy&&this.destroy(),this.emit("error",Ke);return}this.fd=ve,this.emit("open",ve)}.bind(this))},Nt.prototype._write=function(Ke,ve,we){if(!(Ke instanceof l.Buffer))return this.emit("error",new Error("Invalid data"));if(typeof this.fd!="number")return this.once("open",function(){this._write(Ke,ve,we)});var ze=this;this._vol.write(this.fd,Ke,0,Ke.length,this.pos,function(rt,ft){if(rt)return ze.autoClose&&ze.destroy&&ze.destroy(),we(rt);ze.bytesWritten+=ft,we()}),this.pos!==void 0&&(this.pos+=Ke.length)},Nt.prototype._writev=function(Ke,ve){if(typeof this.fd!="number")return this.once("open",function(){this._writev(Ke,ve)});for(var we=this,ze=Ke.length,rt=new Array(ze),ft=0,pt=0;pt<ze;pt++){var xt=Ke[pt].chunk;rt[pt]=xt,ft+=xt.length}var Kt=l.Buffer.concat(rt);this._vol.write(this.fd,Kt,0,Kt.length,this.pos,function(Qt,ci){if(Qt)return we.destroy&&we.destroy(),ve(Qt);we.bytesWritten+=ci,ve()}),this.pos!==void 0&&(this.pos+=ft)},Nt.prototype._destroy=Lt.prototype._destroy,Nt.prototype.close=Lt.prototype.close,Nt.prototype.destroySoon=Nt.prototype.end;var zt=function(Ke){t(ve,Ke);function ve(we){var ze=Ke.call(this)||this;return ze._filename="",ze._filenameEncoded="",ze._recursive=!1,ze._encoding=E.ENCODING_UTF8,ze._onNodeChange=function(){ze._emit("change")},ze._onParentChild=function(rt){rt.getName()===ze._getName()&&ze._emit("rename")},ze._emit=function(rt){ze.emit("change",rt,ze._filenameEncoded)},ze._persist=function(){ze._timer=setTimeout(ze._persist,1e6)},ze._vol=we,ze}return ve.prototype._getName=function(){return this._steps[this._steps.length-1]},ve.prototype.start=function(we,ze,rt,ft){ze===void 0&&(ze=!0),rt===void 0&&(rt=!1),ft===void 0&&(ft=E.ENCODING_UTF8),this._filename=_e(we),this._steps=et(this._filename),this._filenameEncoded=(0,E.strToEncoding)(this._filename),this._recursive=rt,this._encoding=ft;try{this._link=this._vol.getLinkOrThrow(this._filename,"FSWatcher")}catch(Kt){var pt=new Error("watch "+this._filename+" "+Kt.code);throw pt.code=Kt.code,pt.errno=Kt.code,pt}this._link.getNode().on("change",this._onNodeChange),this._link.on("child:add",this._onNodeChange),this._link.on("child:delete",this._onNodeChange);var xt=this._link.parent;xt&&(xt.setMaxListeners(xt.getMaxListeners()+1),xt.on("child:delete",this._onParentChild)),ze&&this._persist()},ve.prototype.close=function(){clearTimeout(this._timer),this._link.getNode().removeListener("change",this._onNodeChange);var we=this._link.parent;we&&we.removeListener("child:delete",this._onParentChild)},ve}(x.EventEmitter);return ui.FSWatcher=zt,ui}function axe(){if($re)return qh;$re=!0,Object.defineProperty(qh,"__esModule",{value:!0}),qh.fsAsyncMethods=qh.fsSyncMethods=qh.fsProps=void 0;var t=["constants","F_OK","R_OK","W_OK","X_OK","Stats"];qh.fsProps=t;var e=["renameSync","ftruncateSync","truncateSync","chownSync","fchownSync","lchownSync","chmodSync","fchmodSync","lchmodSync","statSync","lstatSync","fstatSync","linkSync","symlinkSync","readlinkSync","realpathSync","unlinkSync","rmdirSync","mkdirSync","mkdirpSync","readdirSync","closeSync","openSync","utimesSync","futimesSync","fsyncSync","writeSync","readSync","readFileSync","writeFileSync","appendFileSync","existsSync","accessSync","fdatasyncSync","mkdtempSync","copyFileSync","createReadStream","createWriteStream"];qh.fsSyncMethods=e;var r=["rename","ftruncate","truncate","chown","fchown","lchown","chmod","fchmod","lchmod","stat","lstat","fstat","link","symlink","readlink","realpath","unlink","rmdir","mkdir","mkdirp","readdir","close","open","utimes","futimes","fsync","write","read","readFile","writeFile","appendFile","exists","access","fdatasync","mkdtemp","copyFile","watchFile","unwatchFile","watch"];return qh.fsAsyncMethods=r,qh}function oxe(){if(qre)return ia;qre=!0;var t=ia&&ia.__assign||function(){return t=Object.assign||function(E){for(var A,k=1,P=arguments.length;k<P;k++){A=arguments[k];for(var N in A)Object.prototype.hasOwnProperty.call(A,N)&&(E[N]=A[N])}return E},t.apply(this,arguments)};Object.defineProperty(ia,"__esModule",{value:!0}),ia.fs=ia.createFsFromVolume=ia.vol=ia.Volume=void 0;var e=Ik(),r=jre(),a=Hre(),i=axe(),h=i.fsSyncMethods,l=i.fsAsyncMethods,p=i2(),b=p.constants.F_OK,g=p.constants.R_OK,y=p.constants.W_OK,M=p.constants.X_OK;ia.Volume=a.Volume,ia.vol=new a.Volume;function x(E){for(var A={F_OK:b,R_OK:g,W_OK:y,X_OK:M,constants:p.constants,Stats:e.default,Dirent:r.default},k=0,P=h;k<P.length;k++){var N=P[k];typeof E[N]=="function"&&(A[N]=E[N].bind(E))}for(var L=0,C=l;L<C.length;L++){var N=C[L];typeof E[N]=="function"&&(A[N]=E[N].bind(E))}return A.StatWatcher=E.StatWatcher,A.FSWatcher=E.FSWatcher,A.WriteStream=E.WriteStream,A.ReadStream=E.ReadStream,A.promises=E.promises,A._toUnixTimestamp=a.toUnixTimestamp,A}return ia.createFsFromVolume=x,ia.fs=x(ia.vol),ia=t(t({},ia),ia.fs),ia.semantic=!0,ia}function No(t){throw new Error(`Node.js fs ${t} is not supported by JSPM core in the browser`)}function Kre(t,e,r){let a=0,i=new TextDecoder;Uh.watch(t,"utf8",()=>{let{size:h}=Uh.fstatSync(e),l=Me.alloc(h-a);Uh.readSync(e,l,0,l.length,a),a=h,r(i.decode(l,{stream:!0}))})}function Pk(t,e){if(t.protocol==="file:")return kk(t);if(t.protocol==="https:"||t.protocol==="http:"){let r="\\\\url\\"+t.href.replaceAll(/\//g,"\\\\");if(Wre(r))return r;if(e)throw new Error(`Cannot sync request URL ${t} via FS. JSPM FS support for network URLs requires using async FS methods or priming the MemFS cache first with an async request before a sync request.`);return(async()=>{let a=await fetch(t);if(!a.ok)throw new Error(`Unable to fetch ${t.href}, ${a.status}`);let i=await a.arrayBuffer();return Vre(r,Me.from(i)),r})()}throw new Error("URL "+t+" not supported in JSPM FS implementation.")}function fxe(t){return function(e,...r){return e instanceof URL?t(Pk(e,!0),...r):t(e,...r)}}function uxe(t){return async function(e,...r){return e instanceof URL?t(await Pk(e),...r):t(e,...r)}}function hxe(t){return function(e,...r){let a=r[r.length-1];e instanceof URL&&typeof a=="function"?Pk(e).then(i=>{t(i,...r)},a):t(e,...r)}}var t2,xre,u4,Sre,D1,Ere,Pf,Are,Un,Rre,XMe,$u,Tre,$1,kre,h4,Ire,Bre,q1,Pre,so,Ore,l4,Nre,exe,gc,Cre,r2,Lre,ui,Dre,nxe,qh,$re,ia,qre,kd,Ua,Uh,sxe,Gi,lxe,cxe,dxe,pxe,vxe,mxe,gxe,bxe,yxe,wxe,_xe,Mxe,xxe,Sxe,Exe,Axe,Rxe,Wre,Txe,kxe,Ixe,Bxe,Pxe,Oxe,Nxe,Cxe,Lxe,Dxe,$xe,qxe,Uxe,Fxe,jxe,zxe,Zxe,Hxe,Kxe,Wxe,Vxe,Gxe,Yxe,Jxe,Xxe,Qxe,eSe,tSe,rSe,iSe,nSe,aSe,oSe,sSe,fSe,uSe,hSe,lSe,cSe,dSe,pSe,vSe,mSe,gSe,bSe,ySe,wSe,_Se,MSe,xSe,SSe,ESe,ASe,RSe,TSe,kSe,ISe,BSe,PSe,OSe,NSe,CSe,Vre,LSe,DSe,$Se,qSe,USe,FSe,jSe,zSe,ZSe,HSe,KSe,WSe,VSe,GSe,YSe,JSe,XSe,QSe,Nk=Si(()=>{"use strict";ie();ae();ne();oh();yk();no();jo();_k();Ws();Z0();Ks();I8();f4();Rd();Rg();lo();rh();Uo();Yf();Jg();Qg();t2={},xre=!1;u4={},Sre=!1;D1={},Ere=!1;Pf={},Are=!1;Un={},Rre=!1,XMe=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;$u={},Tre=!1;$1={},kre=!1;h4={},Ire=!1,Bre=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;q1={},Pre=!1;so={},Ore=!1;l4={},Nre=!1,exe=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;gc={},Cre=!1;r2={},Lre=!1;ui={},Dre=!1,nxe=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;qh={},$re=!1;ia={},qre=!1;kd=oxe();kd.__esModule;kd.fs;kd.createFsFromVolume;kd.vol;kd.Volume;kd.semantic;Ua=Hre();Ua.__esModule;Ua.FSWatcher;Ua.StatWatcher;Ua.Volume;Ua.toUnixTimestamp;Ua.bufferToEncoding;Ua.dataToBuffer;Ua.dataToStr;Ua.pathToSteps;Ua.filenameToSteps;Ua.pathToFilename;Ua.flagsToNumber;Ua.FLAGS;Ua.ReadStream;Ua.WriteStream;({vol:Uh,createFsFromVolume:sxe}=kd);Uh.fromNestedJSON({"/dev":{stdin:"",stdout:"",stderr:""},"/usr/bin":{},"/home":{},"/tmp":{}});Uh.releasedFds=[2,1,0];Uh.openSync("/dev/stdin","w");Uh.openSync("/dev/stdout","r");Uh.openSync("/dev/stderr","r");Kre("/dev/stdout",1,console.log);Kre("/dev/stderr",2,console.error);Gi=sxe(Uh);Gi.opendir=()=>No("opendir");Gi.opendirSync=()=>No("opendirSync");Gi.promises.opendir=()=>No("promises.opendir");Gi.cp=()=>No("cp");Gi.cpSync=()=>No("cpSync");Gi.promises.cp=()=>No("promises.cp");Gi.readv=()=>No("readv");Gi.readvSync=()=>No("readvSync");Gi.rm=()=>No("rm");Gi.rmSync=()=>No("rmSync");Gi.promises.rm=()=>No("promises.rm");Gi.Dir=()=>No("Dir");Gi.promises.watch=()=>No("promises.watch");Gi.FileReadStream=Gi.ReadStream;Gi.FileWriteStream=Gi.WriteStream;Gi.promises.readFile=uxe(Gi.promises.readFile);Gi.readFile=hxe(Gi.readFile);Gi.readFileSync=fxe(Gi.readFileSync);({appendFile:lxe,appendFileSync:cxe,access:dxe,accessSync:pxe,chown:vxe,chownSync:mxe,chmod:gxe,chmodSync:bxe,close:yxe,closeSync:wxe,copyFile:_xe,copyFileSync:Mxe,cp:xxe,cpSync:Sxe,createReadStream:Exe,createWriteStream:Axe,exists:Rxe,existsSync:Wre,fchown:Txe,fchownSync:kxe,fchmod:Ixe,fchmodSync:Bxe,fdatasync:Pxe,fdatasyncSync:Oxe,fstat:Nxe,fstatSync:Cxe,fsync:Lxe,fsyncSync:Dxe,ftruncate:$xe,ftruncateSync:qxe,futimes:Uxe,futimesSync:Fxe,lchown:jxe,lchownSync:zxe,lchmod:Zxe,lchmodSync:Hxe,link:Kxe,linkSync:Wxe,lstat:Vxe,lstatSync:Gxe,mkdir:Yxe,mkdirSync:Jxe,mkdtemp:Xxe,mkdtempSync:Qxe,open:eSe,openSync:tSe,opendir:rSe,opendirSync:iSe,readdir:nSe,readdirSync:aSe,read:oSe,readSync:sSe,readv:fSe,readvSync:uSe,readFile:hSe,readFileSync:lSe,readlink:cSe,readlinkSync:dSe,realpath:pSe,realpathSync:vSe,rename:mSe,renameSync:gSe,rm:bSe,rmSync:ySe,rmdir:wSe,rmdirSync:_Se,stat:MSe,statSync:xSe,symlink:SSe,symlinkSync:ESe,truncate:ASe,truncateSync:RSe,unwatchFile:TSe,unlink:kSe,unlinkSync:ISe,utimes:BSe,utimesSync:PSe,watch:OSe,watchFile:NSe,writeFile:CSe,writeFileSync:Vre,write:LSe,writeSync:DSe,writev:$Se,writevSync:qSe,Dir:USe,Dirent:FSe,Stats:jSe,ReadStream:zSe,WriteStream:ZSe,FileReadStream:HSe,FileWriteStream:KSe,_toUnixTimestamp:WSe,constants:{F_OK:VSe,R_OK:GSe,W_OK:YSe,X_OK:JSe},constants:XSe,promises:QSe}=Gi)});var d4=ht((c4,Gre)=>{"use strict";ie();ae();ne();Object.defineProperty(c4,"__esModule",{value:!0});c4.default=eEe;function eEe(t){return t&&typeof t.length=="number"&&t.length>=0&&t.length%1===0}Gre.exports=c4.default});var Jre=ht((p4,Yre)=>{"use strict";ie();ae();ne();Object.defineProperty(p4,"__esModule",{value:!0});p4.default=function(t){return function(...e){var r=e.pop();return t.call(this,e,r)}};Yre.exports=p4.default});var eie=ht(bc=>{"use strict";ie();ae();ne();Object.defineProperty(bc,"__esModule",{value:!0});bc.fallback=Xre;bc.wrap=Qre;var tEe=bc.hasQueueMicrotask=typeof queueMicrotask=="function"&&queueMicrotask,rEe=bc.hasSetImmediate=typeof setImmediate=="function"&&setImmediate,iEe=bc.hasNextTick=typeof He=="object"&&typeof He.nextTick=="function";function Xre(t){setTimeout(t,0)}function Qre(t){return(e,...r)=>t(()=>e(...r))}var n2;tEe?n2=queueMicrotask:rEe?n2=setImmediate:iEe?n2=He.nextTick:n2=Xre;bc.default=Qre(n2)});var aie=ht((v4,nie)=>{"use strict";ie();ae();ne();Object.defineProperty(v4,"__esModule",{value:!0});v4.default=uEe;var nEe=Jre(),aEe=iie(nEe),oEe=eie(),sEe=iie(oEe),fEe=Id();function iie(t){return t&&t.__esModule?t:{default:t}}function uEe(t){return(0,fEe.isAsync)(t)?function(...e){let r=e.pop(),a=t.apply(this,e);return tie(a,r)}:(0,aEe.default)(function(e,r){var a;try{a=t.apply(this,e)}catch(i){return r(i)}if(a&&typeof a.then=="function")return tie(a,r);r(null,a)})}function tie(t,e){return t.then(r=>{rie(e,null,r)},r=>{rie(e,r&&(r instanceof Error||r.message)?r:new Error(r))})}function rie(t,e,r){try{t(e,r)}catch(a){(0,sEe.default)(i=>{throw i},a)}}nie.exports=v4.default});var Id=ht(Fh=>{"use strict";ie();ae();ne();Object.defineProperty(Fh,"__esModule",{value:!0});Fh.isAsyncIterable=Fh.isAsyncGenerator=Fh.isAsync=void 0;var hEe=aie(),lEe=cEe(hEe);function cEe(t){return t&&t.__esModule?t:{default:t}}function oie(t){return t[Symbol.toStringTag]==="AsyncFunction"}function dEe(t){return t[Symbol.toStringTag]==="AsyncGenerator"}function pEe(t){return typeof t[Symbol.asyncIterator]=="function"}function vEe(t){if(typeof t!="function")throw new Error("expected a function");return oie(t)?(0,lEe.default)(t):t}Fh.default=vEe;Fh.isAsync=oie;Fh.isAsyncGenerator=dEe;Fh.isAsyncIterable=pEe});var U1=ht((m4,sie)=>{"use strict";ie();ae();ne();Object.defineProperty(m4,"__esModule",{value:!0});m4.default=mEe;function mEe(t,e){if(e||(e=t.length),!e)throw new Error("arity is undefined");function r(...a){return typeof a[e-1]=="function"?t.apply(this,a):new Promise((i,h)=>{a[e-1]=(l,...p)=>{if(l)return h(l);i(p.length>1?p:p[0])},t.apply(this,a)})}return r}sie.exports=m4.default});var uie=ht((g4,fie)=>{"use strict";ie();ae();ne();Object.defineProperty(g4,"__esModule",{value:!0});var gEe=d4(),bEe=Ck(gEe),yEe=Id(),wEe=Ck(yEe),_Ee=U1(),MEe=Ck(_Ee);function Ck(t){return t&&t.__esModule?t:{default:t}}g4.default=(0,MEe.default)((t,e,r)=>{var a=(0,bEe.default)(e)?[]:{};t(e,(i,h,l)=>{(0,wEe.default)(i)((p,...b)=>{b.length<2&&([b]=b),a[h]=b,l(p)})},i=>r(i,a))},3);fie.exports=g4.default});var Lk=ht((b4,hie)=>{"use strict";ie();ae();ne();Object.defineProperty(b4,"__esModule",{value:!0});b4.default=xEe;function xEe(t){function e(...r){if(t!==null){var a=t;t=null,a.apply(this,r)}}return Object.assign(e,t),e}hie.exports=b4.default});var cie=ht((y4,lie)=>{"use strict";ie();ae();ne();Object.defineProperty(y4,"__esModule",{value:!0});y4.default=function(t){return t[Symbol.iterator]&&t[Symbol.iterator]()};lie.exports=y4.default});var vie=ht((w4,pie)=>{"use strict";ie();ae();ne();Object.defineProperty(w4,"__esModule",{value:!0});w4.default=BEe;var SEe=d4(),EEe=die(SEe),AEe=cie(),REe=die(AEe);function die(t){return t&&t.__esModule?t:{default:t}}function TEe(t){var e=-1,r=t.length;return function(){return++e<r?{value:t[e],key:e}:null}}function kEe(t){var e=-1;return function(){var a=t.next();return a.done?null:(e++,{value:a.value,key:e})}}function IEe(t){var e=t?Object.keys(t):[],r=-1,a=e.length;return function i(){var h=e[++r];return h==="__proto__"?i():r<a?{value:t[h],key:h}:null}}function BEe(t){if((0,EEe.default)(t))return TEe(t);var e=(0,REe.default)(t);return e?kEe(e):IEe(t)}pie.exports=w4.default});var Dk=ht((_4,mie)=>{"use strict";ie();ae();ne();Object.defineProperty(_4,"__esModule",{value:!0});_4.default=PEe;function PEe(t){return function(...e){if(t===null)throw new Error("Callback was already called.");var r=t;t=null,r.apply(this,e)}}mie.exports=_4.default});var x4=ht((M4,gie)=>{"use strict";ie();ae();ne();Object.defineProperty(M4,"__esModule",{value:!0});var OEe={};M4.default=OEe;gie.exports=M4.default});var yie=ht((S4,bie)=>{"use strict";ie();ae();ne();Object.defineProperty(S4,"__esModule",{value:!0});S4.default=DEe;var NEe=x4(),CEe=LEe(NEe);function LEe(t){return t&&t.__esModule?t:{default:t}}function DEe(t,e,r,a){let i=!1,h=!1,l=!1,p=0,b=0;function g(){p>=e||l||i||(l=!0,t.next().then(({value:x,done:E})=>{if(!(h||i)){if(l=!1,E){i=!0,p<=0&&a(null);return}p++,r(x,b,y),b++,g()}}).catch(M))}function y(x,E){if(p-=1,!h){if(x)return M(x);if(x===!1){i=!0,h=!0;return}if(E===CEe.default||i&&p<=0)return i=!0,a(null);g()}}function M(x){h||(l=!1,i=!0,a(x))}g()}bie.exports=S4.default});var xie=ht((E4,Mie)=>{"use strict";ie();ae();ne();Object.defineProperty(E4,"__esModule",{value:!0});var $Ee=Lk(),qEe=a2($Ee),UEe=vie(),FEe=a2(UEe),jEe=Dk(),zEe=a2(jEe),wie=Id(),ZEe=yie(),_ie=a2(ZEe),HEe=x4(),KEe=a2(HEe);function a2(t){return t&&t.__esModule?t:{default:t}}E4.default=t=>(e,r,a)=>{if(a=(0,qEe.default)(a),t<=0)throw new RangeError("concurrency limit cannot be less than 1");if(!e)return a(null);if((0,wie.isAsyncGenerator)(e))return(0,_ie.default)(e,t,r,a);if((0,wie.isAsyncIterable)(e))return(0,_ie.default)(e[Symbol.asyncIterator](),t,r,a);var i=(0,FEe.default)(e),h=!1,l=!1,p=0,b=!1;function g(M,x){if(!l)if(p-=1,M)h=!0,a(M);else if(M===!1)h=!0,l=!0;else{if(x===KEe.default||h&&p<=0)return h=!0,a(null);b||y()}}function y(){for(b=!0;p<t&&!h;){var M=i();if(M===null){h=!0,p<=0&&a(null);return}p+=1,r(M.value,M.key,(0,zEe.default)(g))}b=!1}y()};Mie.exports=E4.default});var qk=ht((A4,Sie)=>{"use strict";ie();ae();ne();Object.defineProperty(A4,"__esModule",{value:!0});var WEe=xie(),VEe=$k(WEe),GEe=Id(),YEe=$k(GEe),JEe=U1(),XEe=$k(JEe);function $k(t){return t&&t.__esModule?t:{default:t}}function QEe(t,e,r,a){return(0,VEe.default)(e)(t,(0,YEe.default)(r),a)}A4.default=(0,XEe.default)(QEe,4);Sie.exports=A4.default});var Rie=ht((R4,Aie)=>{"use strict";ie();ae();ne();Object.defineProperty(R4,"__esModule",{value:!0});var eAe=qk(),tAe=Eie(eAe),rAe=U1(),iAe=Eie(rAe);function Eie(t){return t&&t.__esModule?t:{default:t}}function nAe(t,e,r){return(0,tAe.default)(t,1,e,r)}R4.default=(0,iAe.default)(nAe,3);Aie.exports=R4.default});var Iie=ht((T4,kie)=>{"use strict";ie();ae();ne();Object.defineProperty(T4,"__esModule",{value:!0});T4.default=uAe;var aAe=uie(),oAe=Tie(aAe),sAe=Rie(),fAe=Tie(sAe);function Tie(t){return t&&t.__esModule?t:{default:t}}function uAe(t,e){return(0,oAe.default)(fAe.default,t,e)}kie.exports=T4.default});var Kie={};Ha(Kie,{Deflate:()=>wAe,DeflateRaw:()=>_Ae,Gunzip:()=>MAe,Gzip:()=>xAe,Inflate:()=>SAe,InflateRaw:()=>EAe,Unzip:()=>AAe,Z_BEST_COMPRESSION:()=>RAe,Z_BEST_SPEED:()=>TAe,Z_BINARY:()=>kAe,Z_BLOCK:()=>IAe,Z_BUF_ERROR:()=>BAe,Z_DATA_ERROR:()=>PAe,Z_DEFAULT_CHUNK:()=>OAe,Z_DEFAULT_COMPRESSION:()=>NAe,Z_DEFAULT_LEVEL:()=>CAe,Z_DEFAULT_MEMLEVEL:()=>LAe,Z_DEFAULT_STRATEGY:()=>DAe,Z_DEFAULT_WINDOWBITS:()=>$Ae,Z_DEFLATED:()=>qAe,Z_ERRNO:()=>UAe,Z_FILTERED:()=>FAe,Z_FINISH:()=>jAe,Z_FIXED:()=>zAe,Z_FULL_FLUSH:()=>ZAe,Z_HUFFMAN_ONLY:()=>HAe,Z_MAX_CHUNK:()=>KAe,Z_MAX_LEVEL:()=>WAe,Z_MAX_MEMLEVEL:()=>VAe,Z_MAX_WINDOWBITS:()=>GAe,Z_MIN_CHUNK:()=>YAe,Z_MIN_LEVEL:()=>JAe,Z_MIN_MEMLEVEL:()=>XAe,Z_MIN_WINDOWBITS:()=>QAe,Z_NEED_DICT:()=>eRe,Z_NO_COMPRESSION:()=>tRe,Z_NO_FLUSH:()=>rRe,Z_OK:()=>iRe,Z_PARTIAL_FLUSH:()=>nRe,Z_RLE:()=>aRe,Z_STREAM_END:()=>oRe,Z_STREAM_ERROR:()=>sRe,Z_SYNC_FLUSH:()=>fRe,Z_TEXT:()=>uRe,Z_TREES:()=>hRe,Z_UNKNOWN:()=>lRe,Zlib:()=>cRe,codes:()=>dRe,createDeflate:()=>pRe,createDeflateRaw:()=>vRe,createGunzip:()=>mRe,createGzip:()=>gRe,createInflate:()=>bRe,createInflateRaw:()=>yRe,createUnzip:()=>wRe,default:()=>At,deflate:()=>_Re,deflateRaw:()=>MRe,deflateRawSync:()=>xRe,deflateSync:()=>SRe,gunzip:()=>ERe,gunzipSync:()=>ARe,gzip:()=>RRe,gzipSync:()=>TRe,inflate:()=>kRe,inflateRaw:()=>IRe,inflateRawSync:()=>BRe,inflateSync:()=>PRe,unzip:()=>ORe,unzipSync:()=>NRe});function hAe(){if(Bie)return Uk;Bie=!0;function t(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}return Uk=t,Uk}function k4(){if(Pie)return Ba;Pie=!0;var t=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function e(i,h){return Object.prototype.hasOwnProperty.call(i,h)}Ba.assign=function(i){for(var h=Array.prototype.slice.call(arguments,1);h.length;){var l=h.shift();if(l){if(typeof l!="object")throw new TypeError(l+"must be non-object");for(var p in l)e(l,p)&&(i[p]=l[p])}}return i},Ba.shrinkBuf=function(i,h){return i.length===h?i:i.subarray?i.subarray(0,h):(i.length=h,i)};var r={arraySet:function(i,h,l,p,b){if(h.subarray&&i.subarray){i.set(h.subarray(l,l+p),b);return}for(var g=0;g<p;g++)i[b+g]=h[l+g]},flattenChunks:function(i){var h,l,p,b,g,y;for(p=0,h=0,l=i.length;h<l;h++)p+=i[h].length;for(y=new Uint8Array(p),b=0,h=0,l=i.length;h<l;h++)g=i[h],y.set(g,b),b+=g.length;return y}},a={arraySet:function(i,h,l,p,b){for(var g=0;g<p;g++)i[b+g]=h[l+g]},flattenChunks:function(i){return[].concat.apply([],i)}};return Ba.setTyped=function(i){i?(Ba.Buf8=Uint8Array,Ba.Buf16=Uint16Array,Ba.Buf32=Int32Array,Ba.assign(Ba,r)):(Ba.Buf8=Array,Ba.Buf16=Array,Ba.Buf32=Array,Ba.assign(Ba,a))},Ba.setTyped(t),Ba}function lAe(){if(Oie)return Bd;Oie=!0;var t=k4(),e=4,r=0,a=1,i=2;function h(H){for(var W=H.length;--W>=0;)H[W]=0}var l=0,p=1,b=2,g=3,y=258,M=29,x=256,E=x+1+M,A=30,k=19,P=2*E+1,N=15,L=16,C=7,Y=256,G=16,ee=17,D=18,U=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],V=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],_=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],n=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],s=512,f=new Array((E+2)*2);h(f);var u=new Array(A*2);h(u);var c=new Array(s);h(c);var m=new Array(y-g+1);h(m);var w=new Array(M);h(w);var d=new Array(A);h(d);function o(H,W,fe,st,ue){this.static_tree=H,this.extra_bits=W,this.extra_base=fe,this.elems=st,this.max_length=ue,this.has_stree=H&&H.length}var v,R,S;function B(H,W){this.dyn_tree=H,this.max_code=0,this.stat_desc=W}function F(H){return H<256?c[H]:c[256+(H>>>7)]}function $(H,W){H.pending_buf[H.pending++]=W&255,H.pending_buf[H.pending++]=W>>>8&255}function re(H,W,fe){H.bi_valid>L-fe?(H.bi_buf|=W<<H.bi_valid&65535,$(H,H.bi_buf),H.bi_buf=W>>L-H.bi_valid,H.bi_valid+=fe-L):(H.bi_buf|=W<<H.bi_valid&65535,H.bi_valid+=fe)}function Q(H,W,fe){re(H,fe[W*2],fe[W*2+1])}function Z(H,W){var fe=0;do fe|=H&1,H>>>=1,fe<<=1;while(--W>0);return fe>>>1}function K(H){H.bi_valid===16?($(H,H.bi_buf),H.bi_buf=0,H.bi_valid=0):H.bi_valid>=8&&(H.pending_buf[H.pending++]=H.bi_buf&255,H.bi_buf>>=8,H.bi_valid-=8)}function le(H,W){var fe=W.dyn_tree,st=W.max_code,ue=W.stat_desc.static_tree,me=W.stat_desc.has_stree,pe=W.stat_desc.extra_bits,be=W.stat_desc.extra_base,Qe=W.stat_desc.max_length,se,ye,Ee,Fe,de,xe,ct=0;for(Fe=0;Fe<=N;Fe++)H.bl_count[Fe]=0;for(fe[H.heap[H.heap_max]*2+1]=0,se=H.heap_max+1;se<P;se++)ye=H.heap[se],Fe=fe[fe[ye*2+1]*2+1]+1,Fe>Qe&&(Fe=Qe,ct++),fe[ye*2+1]=Fe,!(ye>st)&&(H.bl_count[Fe]++,de=0,ye>=be&&(de=pe[ye-be]),xe=fe[ye*2],H.opt_len+=xe*(Fe+de),me&&(H.static_len+=xe*(ue[ye*2+1]+de)));if(ct!==0){do{for(Fe=Qe-1;H.bl_count[Fe]===0;)Fe--;H.bl_count[Fe]--,H.bl_count[Fe+1]+=2,H.bl_count[Qe]--,ct-=2}while(ct>0);for(Fe=Qe;Fe!==0;Fe--)for(ye=H.bl_count[Fe];ye!==0;)Ee=H.heap[--se],!(Ee>st)&&(fe[Ee*2+1]!==Fe&&(H.opt_len+=(Fe-fe[Ee*2+1])*fe[Ee*2],fe[Ee*2+1]=Fe),ye--)}}function te(H,W,fe){var st=new Array(N+1),ue=0,me,pe;for(me=1;me<=N;me++)st[me]=ue=ue+fe[me-1]<<1;for(pe=0;pe<=W;pe++){var be=H[pe*2+1];be!==0&&(H[pe*2]=Z(st[be]++,be))}}function j(){var H,W,fe,st,ue,me=new Array(N+1);for(fe=0,st=0;st<M-1;st++)for(w[st]=fe,H=0;H<1<<U[st];H++)m[fe++]=st;for(m[fe-1]=st,ue=0,st=0;st<16;st++)for(d[st]=ue,H=0;H<1<<V[st];H++)c[ue++]=st;for(ue>>=7;st<A;st++)for(d[st]=ue<<7,H=0;H<1<<V[st]-7;H++)c[256+ue++]=st;for(W=0;W<=N;W++)me[W]=0;for(H=0;H<=143;)f[H*2+1]=8,H++,me[8]++;for(;H<=255;)f[H*2+1]=9,H++,me[9]++;for(;H<=279;)f[H*2+1]=7,H++,me[7]++;for(;H<=287;)f[H*2+1]=8,H++,me[8]++;for(te(f,E+1,me),H=0;H<A;H++)u[H*2+1]=5,u[H*2]=Z(H,5);v=new o(f,U,x+1,E,N),R=new o(u,V,0,A,N),S=new o(new Array(0),_,0,k,C)}function J(H){var W;for(W=0;W<E;W++)H.dyn_ltree[W*2]=0;for(W=0;W<A;W++)H.dyn_dtree[W*2]=0;for(W=0;W<k;W++)H.bl_tree[W*2]=0;H.dyn_ltree[Y*2]=1,H.opt_len=H.static_len=0,H.last_lit=H.matches=0}function X(H){H.bi_valid>8?$(H,H.bi_buf):H.bi_valid>0&&(H.pending_buf[H.pending++]=H.bi_buf),H.bi_buf=0,H.bi_valid=0}function he(H,W,fe,st){X(H),st&&($(H,fe),$(H,~fe)),t.arraySet(H.pending_buf,H.window,W,fe,H.pending),H.pending+=fe}function Te(H,W,fe,st){var ue=W*2,me=fe*2;return H[ue]<H[me]||H[ue]===H[me]&&st[W]<=st[fe]}function oe(H,W,fe){for(var st=H.heap[fe],ue=fe<<1;ue<=H.heap_len&&(ue<H.heap_len&&Te(W,H.heap[ue+1],H.heap[ue],H.depth)&&ue++,!Te(W,st,H.heap[ue],H.depth));)H.heap[fe]=H.heap[ue],fe=ue,ue<<=1;H.heap[fe]=st}function ce(H,W,fe){var st,ue,me=0,pe,be;if(H.last_lit!==0)do st=H.pending_buf[H.d_buf+me*2]<<8|H.pending_buf[H.d_buf+me*2+1],ue=H.pending_buf[H.l_buf+me],me++,st===0?Q(H,ue,W):(pe=m[ue],Q(H,pe+x+1,W),be=U[pe],be!==0&&(ue-=w[pe],re(H,ue,be)),st--,pe=F(st),Q(H,pe,fe),be=V[pe],be!==0&&(st-=d[pe],re(H,st,be)));while(me<H.last_lit);Q(H,Y,W)}function ot(H,W){var fe=W.dyn_tree,st=W.stat_desc.static_tree,ue=W.stat_desc.has_stree,me=W.stat_desc.elems,pe,be,Qe=-1,se;for(H.heap_len=0,H.heap_max=P,pe=0;pe<me;pe++)fe[pe*2]!==0?(H.heap[++H.heap_len]=Qe=pe,H.depth[pe]=0):fe[pe*2+1]=0;for(;H.heap_len<2;)se=H.heap[++H.heap_len]=Qe<2?++Qe:0,fe[se*2]=1,H.depth[se]=0,H.opt_len--,ue&&(H.static_len-=st[se*2+1]);for(W.max_code=Qe,pe=H.heap_len>>1;pe>=1;pe--)oe(H,fe,pe);se=me;do pe=H.heap[1],H.heap[1]=H.heap[H.heap_len--],oe(H,fe,1),be=H.heap[1],H.heap[--H.heap_max]=pe,H.heap[--H.heap_max]=be,fe[se*2]=fe[pe*2]+fe[be*2],H.depth[se]=(H.depth[pe]>=H.depth[be]?H.depth[pe]:H.depth[be])+1,fe[pe*2+1]=fe[be*2+1]=se,H.heap[1]=se++,oe(H,fe,1);while(H.heap_len>=2);H.heap[--H.heap_max]=H.heap[1],le(H,W),te(fe,Qe,H.bl_count)}function ge(H,W,fe){var st,ue=-1,me,pe=W[0*2+1],be=0,Qe=7,se=4;for(pe===0&&(Qe=138,se=3),W[(fe+1)*2+1]=65535,st=0;st<=fe;st++)me=pe,pe=W[(st+1)*2+1],!(++be<Qe&&me===pe)&&(be<se?H.bl_tree[me*2]+=be:me!==0?(me!==ue&&H.bl_tree[me*2]++,H.bl_tree[G*2]++):be<=10?H.bl_tree[ee*2]++:H.bl_tree[D*2]++,be=0,ue=me,pe===0?(Qe=138,se=3):me===pe?(Qe=6,se=3):(Qe=7,se=4))}function Se(H,W,fe){var st,ue=-1,me,pe=W[0*2+1],be=0,Qe=7,se=4;for(pe===0&&(Qe=138,se=3),st=0;st<=fe;st++)if(me=pe,pe=W[(st+1)*2+1],!(++be<Qe&&me===pe)){if(be<se)do Q(H,me,H.bl_tree);while(--be!==0);else me!==0?(me!==ue&&(Q(H,me,H.bl_tree),be--),Q(H,G,H.bl_tree),re(H,be-3,2)):be<=10?(Q(H,ee,H.bl_tree),re(H,be-3,3)):(Q(H,D,H.bl_tree),re(H,be-11,7));be=0,ue=me,pe===0?(Qe=138,se=3):me===pe?(Qe=6,se=3):(Qe=7,se=4)}}function ut(H){var W;for(ge(H,H.dyn_ltree,H.l_desc.max_code),ge(H,H.dyn_dtree,H.d_desc.max_code),ot(H,H.bl_desc),W=k-1;W>=3&&H.bl_tree[n[W]*2+1]===0;W--);return H.opt_len+=3*(W+1)+5+5+4,W}function Ze(H,W,fe,st){var ue;for(re(H,W-257,5),re(H,fe-1,5),re(H,st-4,4),ue=0;ue<st;ue++)re(H,H.bl_tree[n[ue]*2+1],3);Se(H,H.dyn_ltree,W-1),Se(H,H.dyn_dtree,fe-1)}function Ge(H){var W=4093624447,fe;for(fe=0;fe<=31;fe++,W>>>=1)if(W&1&&H.dyn_ltree[fe*2]!==0)return r;if(H.dyn_ltree[9*2]!==0||H.dyn_ltree[10*2]!==0||H.dyn_ltree[13*2]!==0)return a;for(fe=32;fe<x;fe++)if(H.dyn_ltree[fe*2]!==0)return a;return r}var lt=!1;function z(H){lt||(j(),lt=!0),H.l_desc=new B(H.dyn_ltree,v),H.d_desc=new B(H.dyn_dtree,R),H.bl_desc=new B(H.bl_tree,S),H.bi_buf=0,H.bi_valid=0,J(H)}function T(H,W,fe,st){re(H,(l<<1)+(st?1:0),3),he(H,W,fe,!0)}function I(H){re(H,p<<1,3),Q(H,Y,f),K(H)}function O(H,W,fe,st){var ue,me,pe=0;H.level>0?(H.strm.data_type===i&&(H.strm.data_type=Ge(H)),ot(H,H.l_desc),ot(H,H.d_desc),pe=ut(H),ue=H.opt_len+3+7>>>3,me=H.static_len+3+7>>>3,me<=ue&&(ue=me)):ue=me=fe+5,fe+4<=ue&&W!==-1?T(H,W,fe,st):H.strategy===e||me===ue?(re(H,(p<<1)+(st?1:0),3),ce(H,f,u)):(re(H,(b<<1)+(st?1:0),3),Ze(H,H.l_desc.max_code+1,H.d_desc.max_code+1,pe+1),ce(H,H.dyn_ltree,H.dyn_dtree)),J(H),st&&X(H)}function q(H,W,fe){return H.pending_buf[H.d_buf+H.last_lit*2]=W>>>8&255,H.pending_buf[H.d_buf+H.last_lit*2+1]=W&255,H.pending_buf[H.l_buf+H.last_lit]=fe&255,H.last_lit++,W===0?H.dyn_ltree[fe*2]++:(H.matches++,W--,H.dyn_ltree[(m[fe]+x+1)*2]++,H.dyn_dtree[F(W)*2]++),H.last_lit===H.lit_bufsize-1}return Bd._tr_init=z,Bd._tr_stored_block=T,Bd._tr_flush_block=O,Bd._tr_tally=q,Bd._tr_align=I,Bd}function Zie(){if(Nie)return Fk;Nie=!0;function t(e,r,a,i){for(var h=e&65535|0,l=e>>>16&65535|0,p=0;a!==0;){p=a>2e3?2e3:a,a-=p;do h=h+r[i++]|0,l=l+h|0;while(--p);h%=65521,l%=65521}return h|l<<16|0}return Fk=t,Fk}function Hie(){if(Cie)return jk;Cie=!0;function t(){for(var a,i=[],h=0;h<256;h++){a=h;for(var l=0;l<8;l++)a=a&1?3988292384^a>>>1:a>>>1;i[h]=a}return i}var e=t();function r(a,i,h,l){var p=e,b=l+h;a^=-1;for(var g=l;g<b;g++)a=a>>>8^p[(a^i[g])&255];return a^-1}return jk=r,jk}function cAe(){return Lie||(Lie=!0,zk={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}),zk}function dAe(){if(Die)return Of;Die=!0;var t=k4(),e=lAe(),r=Zie(),a=Hie(),i=cAe(),h=0,l=1,p=3,b=4,g=5,y=0,M=1,x=-2,E=-3,A=-5,k=-1,P=1,N=2,L=3,C=4,Y=0,G=2,ee=8,D=9,U=15,V=8,_=29,n=256,s=n+1+_,f=30,u=19,c=2*s+1,m=15,w=3,d=258,o=d+w+1,v=32,R=42,S=69,B=73,F=91,$=103,re=113,Q=666,Z=1,K=2,le=3,te=4,j=3;function J(se,ye){return se.msg=i[ye],ye}function X(se){return(se<<1)-(se>4?9:0)}function he(se){for(var ye=se.length;--ye>=0;)se[ye]=0}function Te(se){var ye=se.state,Ee=ye.pending;Ee>se.avail_out&&(Ee=se.avail_out),Ee!==0&&(t.arraySet(se.output,ye.pending_buf,ye.pending_out,Ee,se.next_out),se.next_out+=Ee,ye.pending_out+=Ee,se.total_out+=Ee,se.avail_out-=Ee,ye.pending-=Ee,ye.pending===0&&(ye.pending_out=0))}function oe(se,ye){e._tr_flush_block(se,se.block_start>=0?se.block_start:-1,se.strstart-se.block_start,ye),se.block_start=se.strstart,Te(se.strm)}function ce(se,ye){se.pending_buf[se.pending++]=ye}function ot(se,ye){se.pending_buf[se.pending++]=ye>>>8&255,se.pending_buf[se.pending++]=ye&255}function ge(se,ye,Ee,Fe){var de=se.avail_in;return de>Fe&&(de=Fe),de===0?0:(se.avail_in-=de,t.arraySet(ye,se.input,se.next_in,de,Ee),se.state.wrap===1?se.adler=r(se.adler,ye,de,Ee):se.state.wrap===2&&(se.adler=a(se.adler,ye,de,Ee)),se.next_in+=de,se.total_in+=de,de)}function Se(se,ye){var Ee=se.max_chain_length,Fe=se.strstart,de,xe,ct=se.prev_length,_e=se.nice_match,Ve=se.strstart>se.w_size-o?se.strstart-(se.w_size-o):0,vt=se.window,Ye=se.w_mask,et=se.prev,mt=se.strstart+d,We=vt[Fe+ct-1],nt=vt[Fe+ct];se.prev_length>=se.good_match&&(Ee>>=2),_e>se.lookahead&&(_e=se.lookahead);do if(de=ye,!(vt[de+ct]!==nt||vt[de+ct-1]!==We||vt[de]!==vt[Fe]||vt[++de]!==vt[Fe+1])){Fe+=2,de++;do;while(vt[++Fe]===vt[++de]&&vt[++Fe]===vt[++de]&&vt[++Fe]===vt[++de]&&vt[++Fe]===vt[++de]&&vt[++Fe]===vt[++de]&&vt[++Fe]===vt[++de]&&vt[++Fe]===vt[++de]&&vt[++Fe]===vt[++de]&&Fe<mt);if(xe=d-(mt-Fe),Fe=mt-d,xe>ct){if(se.match_start=ye,ct=xe,xe>=_e)break;We=vt[Fe+ct-1],nt=vt[Fe+ct]}}while((ye=et[ye&Ye])>Ve&&--Ee!==0);return ct<=se.lookahead?ct:se.lookahead}function ut(se){var ye=se.w_size,Ee,Fe,de,xe,ct;do{if(xe=se.window_size-se.lookahead-se.strstart,se.strstart>=ye+(ye-o)){t.arraySet(se.window,se.window,ye,ye,0),se.match_start-=ye,se.strstart-=ye,se.block_start-=ye,Fe=se.hash_size,Ee=Fe;do de=se.head[--Ee],se.head[Ee]=de>=ye?de-ye:0;while(--Fe);Fe=ye,Ee=Fe;do de=se.prev[--Ee],se.prev[Ee]=de>=ye?de-ye:0;while(--Fe);xe+=ye}if(se.strm.avail_in===0)break;if(Fe=ge(se.strm,se.window,se.strstart+se.lookahead,xe),se.lookahead+=Fe,se.lookahead+se.insert>=w)for(ct=se.strstart-se.insert,se.ins_h=se.window[ct],se.ins_h=(se.ins_h<<se.hash_shift^se.window[ct+1])&se.hash_mask;se.insert&&(se.ins_h=(se.ins_h<<se.hash_shift^se.window[ct+w-1])&se.hash_mask,se.prev[ct&se.w_mask]=se.head[se.ins_h],se.head[se.ins_h]=ct,ct++,se.insert--,!(se.lookahead+se.insert<w)););}while(se.lookahead<o&&se.strm.avail_in!==0)}function Ze(se,ye){var Ee=65535;for(Ee>se.pending_buf_size-5&&(Ee=se.pending_buf_size-5);;){if(se.lookahead<=1){if(ut(se),se.lookahead===0&&ye===h)return Z;if(se.lookahead===0)break}se.strstart+=se.lookahead,se.lookahead=0;var Fe=se.block_start+Ee;if((se.strstart===0||se.strstart>=Fe)&&(se.lookahead=se.strstart-Fe,se.strstart=Fe,oe(se,!1),se.strm.avail_out===0)||se.strstart-se.block_start>=se.w_size-o&&(oe(se,!1),se.strm.avail_out===0))return Z}return se.insert=0,ye===b?(oe(se,!0),se.strm.avail_out===0?le:te):(se.strstart>se.block_start&&(oe(se,!1),se.strm.avail_out===0),Z)}function Ge(se,ye){for(var Ee,Fe;;){if(se.lookahead<o){if(ut(se),se.lookahead<o&&ye===h)return Z;if(se.lookahead===0)break}if(Ee=0,se.lookahead>=w&&(se.ins_h=(se.ins_h<<se.hash_shift^se.window[se.strstart+w-1])&se.hash_mask,Ee=se.prev[se.strstart&se.w_mask]=se.head[se.ins_h],se.head[se.ins_h]=se.strstart),Ee!==0&&se.strstart-Ee<=se.w_size-o&&(se.match_length=Se(se,Ee)),se.match_length>=w)if(Fe=e._tr_tally(se,se.strstart-se.match_start,se.match_length-w),se.lookahead-=se.match_length,se.match_length<=se.max_lazy_match&&se.lookahead>=w){se.match_length--;do se.strstart++,se.ins_h=(se.ins_h<<se.hash_shift^se.window[se.strstart+w-1])&se.hash_mask,Ee=se.prev[se.strstart&se.w_mask]=se.head[se.ins_h],se.head[se.ins_h]=se.strstart;while(--se.match_length!==0);se.strstart++}else se.strstart+=se.match_length,se.match_length=0,se.ins_h=se.window[se.strstart],se.ins_h=(se.ins_h<<se.hash_shift^se.window[se.strstart+1])&se.hash_mask;else Fe=e._tr_tally(se,0,se.window[se.strstart]),se.lookahead--,se.strstart++;if(Fe&&(oe(se,!1),se.strm.avail_out===0))return Z}return se.insert=se.strstart<w-1?se.strstart:w-1,ye===b?(oe(se,!0),se.strm.avail_out===0?le:te):se.last_lit&&(oe(se,!1),se.strm.avail_out===0)?Z:K}function lt(se,ye){for(var Ee,Fe,de;;){if(se.lookahead<o){if(ut(se),se.lookahead<o&&ye===h)return Z;if(se.lookahead===0)break}if(Ee=0,se.lookahead>=w&&(se.ins_h=(se.ins_h<<se.hash_shift^se.window[se.strstart+w-1])&se.hash_mask,Ee=se.prev[se.strstart&se.w_mask]=se.head[se.ins_h],se.head[se.ins_h]=se.strstart),se.prev_length=se.match_length,se.prev_match=se.match_start,se.match_length=w-1,Ee!==0&&se.prev_length<se.max_lazy_match&&se.strstart-Ee<=se.w_size-o&&(se.match_length=Se(se,Ee),se.match_length<=5&&(se.strategy===P||se.match_length===w&&se.strstart-se.match_start>4096)&&(se.match_length=w-1)),se.prev_length>=w&&se.match_length<=se.prev_length){de=se.strstart+se.lookahead-w,Fe=e._tr_tally(se,se.strstart-1-se.prev_match,se.prev_length-w),se.lookahead-=se.prev_length-1,se.prev_length-=2;do++se.strstart<=de&&(se.ins_h=(se.ins_h<<se.hash_shift^se.window[se.strstart+w-1])&se.hash_mask,Ee=se.prev[se.strstart&se.w_mask]=se.head[se.ins_h],se.head[se.ins_h]=se.strstart);while(--se.prev_length!==0);if(se.match_available=0,se.match_length=w-1,se.strstart++,Fe&&(oe(se,!1),se.strm.avail_out===0))return Z}else if(se.match_available){if(Fe=e._tr_tally(se,0,se.window[se.strstart-1]),Fe&&oe(se,!1),se.strstart++,se.lookahead--,se.strm.avail_out===0)return Z}else se.match_available=1,se.strstart++,se.lookahead--}return se.match_available&&(Fe=e._tr_tally(se,0,se.window[se.strstart-1]),se.match_available=0),se.insert=se.strstart<w-1?se.strstart:w-1,ye===b?(oe(se,!0),se.strm.avail_out===0?le:te):se.last_lit&&(oe(se,!1),se.strm.avail_out===0)?Z:K}function z(se,ye){for(var Ee,Fe,de,xe,ct=se.window;;){if(se.lookahead<=d){if(ut(se),se.lookahead<=d&&ye===h)return Z;if(se.lookahead===0)break}if(se.match_length=0,se.lookahead>=w&&se.strstart>0&&(de=se.strstart-1,Fe=ct[de],Fe===ct[++de]&&Fe===ct[++de]&&Fe===ct[++de])){xe=se.strstart+d;do;while(Fe===ct[++de]&&Fe===ct[++de]&&Fe===ct[++de]&&Fe===ct[++de]&&Fe===ct[++de]&&Fe===ct[++de]&&Fe===ct[++de]&&Fe===ct[++de]&&de<xe);se.match_length=d-(xe-de),se.match_length>se.lookahead&&(se.match_length=se.lookahead)}if(se.match_length>=w?(Ee=e._tr_tally(se,1,se.match_length-w),se.lookahead-=se.match_length,se.strstart+=se.match_length,se.match_length=0):(Ee=e._tr_tally(se,0,se.window[se.strstart]),se.lookahead--,se.strstart++),Ee&&(oe(se,!1),se.strm.avail_out===0))return Z}return se.insert=0,ye===b?(oe(se,!0),se.strm.avail_out===0?le:te):se.last_lit&&(oe(se,!1),se.strm.avail_out===0)?Z:K}function T(se,ye){for(var Ee;;){if(se.lookahead===0&&(ut(se),se.lookahead===0)){if(ye===h)return Z;break}if(se.match_length=0,Ee=e._tr_tally(se,0,se.window[se.strstart]),se.lookahead--,se.strstart++,Ee&&(oe(se,!1),se.strm.avail_out===0))return Z}return se.insert=0,ye===b?(oe(se,!0),se.strm.avail_out===0?le:te):se.last_lit&&(oe(se,!1),se.strm.avail_out===0)?Z:K}function I(se,ye,Ee,Fe,de){this.good_length=se,this.max_lazy=ye,this.nice_length=Ee,this.max_chain=Fe,this.func=de}var O;O=[new I(0,0,0,0,Ze),new I(4,4,8,4,Ge),new I(4,5,16,8,Ge),new I(4,6,32,32,Ge),new I(4,4,16,16,lt),new I(8,16,32,32,lt),new I(8,16,128,128,lt),new I(8,32,128,256,lt),new I(32,128,258,1024,lt),new I(32,258,258,4096,lt)];function q(se){se.window_size=2*se.w_size,he(se.head),se.max_lazy_match=O[se.level].max_lazy,se.good_match=O[se.level].good_length,se.nice_match=O[se.level].nice_length,se.max_chain_length=O[se.level].max_chain,se.strstart=0,se.block_start=0,se.lookahead=0,se.insert=0,se.match_length=se.prev_length=w-1,se.match_available=0,se.ins_h=0}function H(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=ee,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new t.Buf16(c*2),this.dyn_dtree=new t.Buf16((2*f+1)*2),this.bl_tree=new t.Buf16((2*u+1)*2),he(this.dyn_ltree),he(this.dyn_dtree),he(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new t.Buf16(m+1),this.heap=new t.Buf16(2*s+1),he(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new t.Buf16(2*s+1),he(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function W(se){var ye;return!se||!se.state?J(se,x):(se.total_in=se.total_out=0,se.data_type=G,ye=se.state,ye.pending=0,ye.pending_out=0,ye.wrap<0&&(ye.wrap=-ye.wrap),ye.status=ye.wrap?R:re,se.adler=ye.wrap===2?0:1,ye.last_flush=h,e._tr_init(ye),y)}function fe(se){var ye=W(se);return ye===y&&q(se.state),ye}function st(se,ye){return!se||!se.state||se.state.wrap!==2?x:(se.state.gzhead=ye,y)}function ue(se,ye,Ee,Fe,de,xe){if(!se)return x;var ct=1;if(ye===k&&(ye=6),Fe<0?(ct=0,Fe=-Fe):Fe>15&&(ct=2,Fe-=16),de<1||de>D||Ee!==ee||Fe<8||Fe>15||ye<0||ye>9||xe<0||xe>C)return J(se,x);Fe===8&&(Fe=9);var _e=new H;return se.state=_e,_e.strm=se,_e.wrap=ct,_e.gzhead=null,_e.w_bits=Fe,_e.w_size=1<<_e.w_bits,_e.w_mask=_e.w_size-1,_e.hash_bits=de+7,_e.hash_size=1<<_e.hash_bits,_e.hash_mask=_e.hash_size-1,_e.hash_shift=~~((_e.hash_bits+w-1)/w),_e.window=new t.Buf8(_e.w_size*2),_e.head=new t.Buf16(_e.hash_size),_e.prev=new t.Buf16(_e.w_size),_e.lit_bufsize=1<<de+6,_e.pending_buf_size=_e.lit_bufsize*4,_e.pending_buf=new t.Buf8(_e.pending_buf_size),_e.d_buf=1*_e.lit_bufsize,_e.l_buf=3*_e.lit_bufsize,_e.level=ye,_e.strategy=xe,_e.method=Ee,fe(se)}function me(se,ye){return ue(se,ye,ee,U,V,Y)}function pe(se,ye){var Ee,Fe,de,xe;if(!se||!se.state||ye>g||ye<0)return se?J(se,x):x;if(Fe=se.state,!se.output||!se.input&&se.avail_in!==0||Fe.status===Q&&ye!==b)return J(se,se.avail_out===0?A:x);if(Fe.strm=se,Ee=Fe.last_flush,Fe.last_flush=ye,Fe.status===R)if(Fe.wrap===2)se.adler=0,ce(Fe,31),ce(Fe,139),ce(Fe,8),Fe.gzhead?(ce(Fe,(Fe.gzhead.text?1:0)+(Fe.gzhead.hcrc?2:0)+(Fe.gzhead.extra?4:0)+(Fe.gzhead.name?8:0)+(Fe.gzhead.comment?16:0)),ce(Fe,Fe.gzhead.time&255),ce(Fe,Fe.gzhead.time>>8&255),ce(Fe,Fe.gzhead.time>>16&255),ce(Fe,Fe.gzhead.time>>24&255),ce(Fe,Fe.level===9?2:Fe.strategy>=N||Fe.level<2?4:0),ce(Fe,Fe.gzhead.os&255),Fe.gzhead.extra&&Fe.gzhead.extra.length&&(ce(Fe,Fe.gzhead.extra.length&255),ce(Fe,Fe.gzhead.extra.length>>8&255)),Fe.gzhead.hcrc&&(se.adler=a(se.adler,Fe.pending_buf,Fe.pending,0)),Fe.gzindex=0,Fe.status=S):(ce(Fe,0),ce(Fe,0),ce(Fe,0),ce(Fe,0),ce(Fe,0),ce(Fe,Fe.level===9?2:Fe.strategy>=N||Fe.level<2?4:0),ce(Fe,j),Fe.status=re);else{var ct=ee+(Fe.w_bits-8<<4)<<8,_e=-1;Fe.strategy>=N||Fe.level<2?_e=0:Fe.level<6?_e=1:Fe.level===6?_e=2:_e=3,ct|=_e<<6,Fe.strstart!==0&&(ct|=v),ct+=31-ct%31,Fe.status=re,ot(Fe,ct),Fe.strstart!==0&&(ot(Fe,se.adler>>>16),ot(Fe,se.adler&65535)),se.adler=1}if(Fe.status===S)if(Fe.gzhead.extra){for(de=Fe.pending;Fe.gzindex<(Fe.gzhead.extra.length&65535)&&!(Fe.pending===Fe.pending_buf_size&&(Fe.gzhead.hcrc&&Fe.pending>de&&(se.adler=a(se.adler,Fe.pending_buf,Fe.pending-de,de)),Te(se),de=Fe.pending,Fe.pending===Fe.pending_buf_size));)ce(Fe,Fe.gzhead.extra[Fe.gzindex]&255),Fe.gzindex++;Fe.gzhead.hcrc&&Fe.pending>de&&(se.adler=a(se.adler,Fe.pending_buf,Fe.pending-de,de)),Fe.gzindex===Fe.gzhead.extra.length&&(Fe.gzindex=0,Fe.status=B)}else Fe.status=B;if(Fe.status===B)if(Fe.gzhead.name){de=Fe.pending;do{if(Fe.pending===Fe.pending_buf_size&&(Fe.gzhead.hcrc&&Fe.pending>de&&(se.adler=a(se.adler,Fe.pending_buf,Fe.pending-de,de)),Te(se),de=Fe.pending,Fe.pending===Fe.pending_buf_size)){xe=1;break}Fe.gzindex<Fe.gzhead.name.length?xe=Fe.gzhead.name.charCodeAt(Fe.gzindex++)&255:xe=0,ce(Fe,xe)}while(xe!==0);Fe.gzhead.hcrc&&Fe.pending>de&&(se.adler=a(se.adler,Fe.pending_buf,Fe.pending-de,de)),xe===0&&(Fe.gzindex=0,Fe.status=F)}else Fe.status=F;if(Fe.status===F)if(Fe.gzhead.comment){de=Fe.pending;do{if(Fe.pending===Fe.pending_buf_size&&(Fe.gzhead.hcrc&&Fe.pending>de&&(se.adler=a(se.adler,Fe.pending_buf,Fe.pending-de,de)),Te(se),de=Fe.pending,Fe.pending===Fe.pending_buf_size)){xe=1;break}Fe.gzindex<Fe.gzhead.comment.length?xe=Fe.gzhead.comment.charCodeAt(Fe.gzindex++)&255:xe=0,ce(Fe,xe)}while(xe!==0);Fe.gzhead.hcrc&&Fe.pending>de&&(se.adler=a(se.adler,Fe.pending_buf,Fe.pending-de,de)),xe===0&&(Fe.status=$)}else Fe.status=$;if(Fe.status===$&&(Fe.gzhead.hcrc?(Fe.pending+2>Fe.pending_buf_size&&Te(se),Fe.pending+2<=Fe.pending_buf_size&&(ce(Fe,se.adler&255),ce(Fe,se.adler>>8&255),se.adler=0,Fe.status=re)):Fe.status=re),Fe.pending!==0){if(Te(se),se.avail_out===0)return Fe.last_flush=-1,y}else if(se.avail_in===0&&X(ye)<=X(Ee)&&ye!==b)return J(se,A);if(Fe.status===Q&&se.avail_in!==0)return J(se,A);if(se.avail_in!==0||Fe.lookahead!==0||ye!==h&&Fe.status!==Q){var Ve=Fe.strategy===N?T(Fe,ye):Fe.strategy===L?z(Fe,ye):O[Fe.level].func(Fe,ye);if((Ve===le||Ve===te)&&(Fe.status=Q),Ve===Z||Ve===le)return se.avail_out===0&&(Fe.last_flush=-1),y;if(Ve===K&&(ye===l?e._tr_align(Fe):ye!==g&&(e._tr_stored_block(Fe,0,0,!1),ye===p&&(he(Fe.head),Fe.lookahead===0&&(Fe.strstart=0,Fe.block_start=0,Fe.insert=0))),Te(se),se.avail_out===0))return Fe.last_flush=-1,y}return ye!==b?y:Fe.wrap<=0?M:(Fe.wrap===2?(ce(Fe,se.adler&255),ce(Fe,se.adler>>8&255),ce(Fe,se.adler>>16&255),ce(Fe,se.adler>>24&255),ce(Fe,se.total_in&255),ce(Fe,se.total_in>>8&255),ce(Fe,se.total_in>>16&255),ce(Fe,se.total_in>>24&255)):(ot(Fe,se.adler>>>16),ot(Fe,se.adler&65535)),Te(se),Fe.wrap>0&&(Fe.wrap=-Fe.wrap),Fe.pending!==0?y:M)}function be(se){var ye;return!se||!se.state?x:(ye=se.state.status,ye!==R&&ye!==S&&ye!==B&&ye!==F&&ye!==$&&ye!==re&&ye!==Q?J(se,x):(se.state=null,ye===re?J(se,E):y))}function Qe(se,ye){var Ee=ye.length,Fe,de,xe,ct,_e,Ve,vt,Ye;if(!se||!se.state||(Fe=se.state,ct=Fe.wrap,ct===2||ct===1&&Fe.status!==R||Fe.lookahead))return x;for(ct===1&&(se.adler=r(se.adler,ye,Ee,0)),Fe.wrap=0,Ee>=Fe.w_size&&(ct===0&&(he(Fe.head),Fe.strstart=0,Fe.block_start=0,Fe.insert=0),Ye=new t.Buf8(Fe.w_size),t.arraySet(Ye,ye,Ee-Fe.w_size,Fe.w_size,0),ye=Ye,Ee=Fe.w_size),_e=se.avail_in,Ve=se.next_in,vt=se.input,se.avail_in=Ee,se.next_in=0,se.input=ye,ut(Fe);Fe.lookahead>=w;){de=Fe.strstart,xe=Fe.lookahead-(w-1);do Fe.ins_h=(Fe.ins_h<<Fe.hash_shift^Fe.window[de+w-1])&Fe.hash_mask,Fe.prev[de&Fe.w_mask]=Fe.head[Fe.ins_h],Fe.head[Fe.ins_h]=de,de++;while(--xe);Fe.strstart=de,Fe.lookahead=w-1,ut(Fe)}return Fe.strstart+=Fe.lookahead,Fe.block_start=Fe.strstart,Fe.insert=Fe.lookahead,Fe.lookahead=0,Fe.match_length=Fe.prev_length=w-1,Fe.match_available=0,se.next_in=Ve,se.input=vt,se.avail_in=_e,Fe.wrap=ct,y}return Of.deflateInit=me,Of.deflateInit2=ue,Of.deflateReset=fe,Of.deflateResetKeep=W,Of.deflateSetHeader=st,Of.deflate=pe,Of.deflateEnd=be,Of.deflateSetDictionary=Qe,Of.deflateInfo="pako deflate (from Nodeca project)",Of}function pAe(){if($ie)return Zk;$ie=!0;var t=30,e=12;return Zk=function(a,i){var h,l,p,b,g,y,M,x,E,A,k,P,N,L,C,Y,G,ee,D,U,V,_,n,s,f;h=a.state,l=a.next_in,s=a.input,p=l+(a.avail_in-5),b=a.next_out,f=a.output,g=b-(i-a.avail_out),y=b+(a.avail_out-257),M=h.dmax,x=h.wsize,E=h.whave,A=h.wnext,k=h.window,P=h.hold,N=h.bits,L=h.lencode,C=h.distcode,Y=(1<<h.lenbits)-1,G=(1<<h.distbits)-1;e:do{N<15&&(P+=s[l++]<<N,N+=8,P+=s[l++]<<N,N+=8),ee=L[P&Y];t:for(;;){if(D=ee>>>24,P>>>=D,N-=D,D=ee>>>16&255,D===0)f[b++]=ee&65535;else if(D&16){U=ee&65535,D&=15,D&&(N<D&&(P+=s[l++]<<N,N+=8),U+=P&(1<<D)-1,P>>>=D,N-=D),N<15&&(P+=s[l++]<<N,N+=8,P+=s[l++]<<N,N+=8),ee=C[P&G];r:for(;;){if(D=ee>>>24,P>>>=D,N-=D,D=ee>>>16&255,D&16){if(V=ee&65535,D&=15,N<D&&(P+=s[l++]<<N,N+=8,N<D&&(P+=s[l++]<<N,N+=8)),V+=P&(1<<D)-1,V>M){a.msg="invalid distance too far back",h.mode=t;break e}if(P>>>=D,N-=D,D=b-g,V>D){if(D=V-D,D>E&&h.sane){a.msg="invalid distance too far back",h.mode=t;break e}if(_=0,n=k,A===0){if(_+=x-D,D<U){U-=D;do f[b++]=k[_++];while(--D);_=b-V,n=f}}else if(A<D){if(_+=x+A-D,D-=A,D<U){U-=D;do f[b++]=k[_++];while(--D);if(_=0,A<U){D=A,U-=D;do f[b++]=k[_++];while(--D);_=b-V,n=f}}}else if(_+=A-D,D<U){U-=D;do f[b++]=k[_++];while(--D);_=b-V,n=f}for(;U>2;)f[b++]=n[_++],f[b++]=n[_++],f[b++]=n[_++],U-=3;U&&(f[b++]=n[_++],U>1&&(f[b++]=n[_++]))}else{_=b-V;do f[b++]=f[_++],f[b++]=f[_++],f[b++]=f[_++],U-=3;while(U>2);U&&(f[b++]=f[_++],U>1&&(f[b++]=f[_++]))}}else if(D&64){a.msg="invalid distance code",h.mode=t;break e}else{ee=C[(ee&65535)+(P&(1<<D)-1)];continue r}break}}else if(D&64)if(D&32){h.mode=e;break e}else{a.msg="invalid literal/length code",h.mode=t;break e}else{ee=L[(ee&65535)+(P&(1<<D)-1)];continue t}break}}while(l<p&&b<y);U=N>>3,l-=U,N-=U<<3,P&=(1<<N)-1,a.next_in=l,a.next_out=b,a.avail_in=l<p?5+(p-l):5-(l-p),a.avail_out=b<y?257+(y-b):257-(b-y),h.hold=P,h.bits=N},Zk}function vAe(){if(qie)return Hk;qie=!0;var t=k4(),e=15,r=852,a=592,i=0,h=1,l=2,p=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],b=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],g=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],y=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];return Hk=function(x,E,A,k,P,N,L,C){var Y=C.bits,G=0,ee=0,D=0,U=0,V=0,_=0,n=0,s=0,f=0,u=0,c,m,w,d,o,v=null,R=0,S,B=new t.Buf16(e+1),F=new t.Buf16(e+1),$=null,re=0,Q,Z,K;for(G=0;G<=e;G++)B[G]=0;for(ee=0;ee<k;ee++)B[E[A+ee]]++;for(V=Y,U=e;U>=1&&B[U]===0;U--);if(V>U&&(V=U),U===0)return P[N++]=1<<24|64<<16|0,P[N++]=1<<24|64<<16|0,C.bits=1,0;for(D=1;D<U&&B[D]===0;D++);for(V<D&&(V=D),s=1,G=1;G<=e;G++)if(s<<=1,s-=B[G],s<0)return-1;if(s>0&&(x===i||U!==1))return-1;for(F[1]=0,G=1;G<e;G++)F[G+1]=F[G]+B[G];for(ee=0;ee<k;ee++)E[A+ee]!==0&&(L[F[E[A+ee]]++]=ee);if(x===i?(v=$=L,S=19):x===h?(v=p,R-=257,$=b,re-=257,S=256):(v=g,$=y,S=-1),u=0,ee=0,G=D,o=N,_=V,n=0,w=-1,f=1<<V,d=f-1,x===h&&f>r||x===l&&f>a)return 1;for(;;){Q=G-n,L[ee]<S?(Z=0,K=L[ee]):L[ee]>S?(Z=$[re+L[ee]],K=v[R+L[ee]]):(Z=96,K=0),c=1<<G-n,m=1<<_,D=m;do m-=c,P[o+(u>>n)+m]=Q<<24|Z<<16|K|0;while(m!==0);for(c=1<<G-1;u&c;)c>>=1;if(c!==0?(u&=c-1,u+=c):u=0,ee++,--B[G]===0){if(G===U)break;G=E[A+L[ee]]}if(G>V&&(u&d)!==w){for(n===0&&(n=V),o+=D,_=G-n,s=1<<_;_+n<U&&(s-=B[_+n],!(s<=0));)_++,s<<=1;if(f+=1<<_,x===h&&f>r||x===l&&f>a)return 1;w=u&d,P[w]=V<<24|_<<16|o-N|0}}return u!==0&&(P[o+u]=G-n<<24|64<<16|0),C.bits=V,0},Hk}function mAe(){if(Uie)return Cs;Uie=!0;var t=k4(),e=Zie(),r=Hie(),a=pAe(),i=vAe(),h=0,l=1,p=2,b=4,g=5,y=6,M=0,x=1,E=2,A=-2,k=-3,P=-4,N=-5,L=8,C=1,Y=2,G=3,ee=4,D=5,U=6,V=7,_=8,n=9,s=10,f=11,u=12,c=13,m=14,w=15,d=16,o=17,v=18,R=19,S=20,B=21,F=22,$=23,re=24,Q=25,Z=26,K=27,le=28,te=29,j=30,J=31,X=32,he=852,Te=592,oe=15,ce=oe;function ot(ue){return(ue>>>24&255)+(ue>>>8&65280)+((ue&65280)<<8)+((ue&255)<<24)}function ge(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new t.Buf16(320),this.work=new t.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function Se(ue){var me;return!ue||!ue.state?A:(me=ue.state,ue.total_in=ue.total_out=me.total=0,ue.msg="",me.wrap&&(ue.adler=me.wrap&1),me.mode=C,me.last=0,me.havedict=0,me.dmax=32768,me.head=null,me.hold=0,me.bits=0,me.lencode=me.lendyn=new t.Buf32(he),me.distcode=me.distdyn=new t.Buf32(Te),me.sane=1,me.back=-1,M)}function ut(ue){var me;return!ue||!ue.state?A:(me=ue.state,me.wsize=0,me.whave=0,me.wnext=0,Se(ue))}function Ze(ue,me){var pe,be;return!ue||!ue.state||(be=ue.state,me<0?(pe=0,me=-me):(pe=(me>>4)+1,me<48&&(me&=15)),me&&(me<8||me>15))?A:(be.window!==null&&be.wbits!==me&&(be.window=null),be.wrap=pe,be.wbits=me,ut(ue))}function Ge(ue,me){var pe,be;return ue?(be=new ge,ue.state=be,be.window=null,pe=Ze(ue,me),pe!==M&&(ue.state=null),pe):A}function lt(ue){return Ge(ue,ce)}var z=!0,T,I;function O(ue){if(z){var me;for(T=new t.Buf32(512),I=new t.Buf32(32),me=0;me<144;)ue.lens[me++]=8;for(;me<256;)ue.lens[me++]=9;for(;me<280;)ue.lens[me++]=7;for(;me<288;)ue.lens[me++]=8;for(i(l,ue.lens,0,288,T,0,ue.work,{bits:9}),me=0;me<32;)ue.lens[me++]=5;i(p,ue.lens,0,32,I,0,ue.work,{bits:5}),z=!1}ue.lencode=T,ue.lenbits=9,ue.distcode=I,ue.distbits=5}function q(ue,me,pe,be){var Qe,se=ue.state;return se.window===null&&(se.wsize=1<<se.wbits,se.wnext=0,se.whave=0,se.window=new t.Buf8(se.wsize)),be>=se.wsize?(t.arraySet(se.window,me,pe-se.wsize,se.wsize,0),se.wnext=0,se.whave=se.wsize):(Qe=se.wsize-se.wnext,Qe>be&&(Qe=be),t.arraySet(se.window,me,pe-be,Qe,se.wnext),be-=Qe,be?(t.arraySet(se.window,me,pe-be,be,0),se.wnext=be,se.whave=se.wsize):(se.wnext+=Qe,se.wnext===se.wsize&&(se.wnext=0),se.whave<se.wsize&&(se.whave+=Qe))),0}function H(ue,me){var pe,be,Qe,se,ye,Ee,Fe,de,xe,ct,_e,Ve,vt,Ye,et=0,mt,We,nt,bt,Je,at,yt,Xe,it=new t.Buf8(4),_t,dt,Mt=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!ue||!ue.state||!ue.output||!ue.input&&ue.avail_in!==0)return A;pe=ue.state,pe.mode===u&&(pe.mode=c),ye=ue.next_out,Qe=ue.output,Fe=ue.avail_out,se=ue.next_in,be=ue.input,Ee=ue.avail_in,de=pe.hold,xe=pe.bits,ct=Ee,_e=Fe,Xe=M;e:for(;;)switch(pe.mode){case C:if(pe.wrap===0){pe.mode=c;break}for(;xe<16;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}if(pe.wrap&2&&de===35615){pe.check=0,it[0]=de&255,it[1]=de>>>8&255,pe.check=r(pe.check,it,2,0),de=0,xe=0,pe.mode=Y;break}if(pe.flags=0,pe.head&&(pe.head.done=!1),!(pe.wrap&1)||(((de&255)<<8)+(de>>8))%31){ue.msg="incorrect header check",pe.mode=j;break}if((de&15)!==L){ue.msg="unknown compression method",pe.mode=j;break}if(de>>>=4,xe-=4,yt=(de&15)+8,pe.wbits===0)pe.wbits=yt;else if(yt>pe.wbits){ue.msg="invalid window size",pe.mode=j;break}pe.dmax=1<<yt,ue.adler=pe.check=1,pe.mode=de&512?s:u,de=0,xe=0;break;case Y:for(;xe<16;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}if(pe.flags=de,(pe.flags&255)!==L){ue.msg="unknown compression method",pe.mode=j;break}if(pe.flags&57344){ue.msg="unknown header flags set",pe.mode=j;break}pe.head&&(pe.head.text=de>>8&1),pe.flags&512&&(it[0]=de&255,it[1]=de>>>8&255,pe.check=r(pe.check,it,2,0)),de=0,xe=0,pe.mode=G;case G:for(;xe<32;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}pe.head&&(pe.head.time=de),pe.flags&512&&(it[0]=de&255,it[1]=de>>>8&255,it[2]=de>>>16&255,it[3]=de>>>24&255,pe.check=r(pe.check,it,4,0)),de=0,xe=0,pe.mode=ee;case ee:for(;xe<16;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}pe.head&&(pe.head.xflags=de&255,pe.head.os=de>>8),pe.flags&512&&(it[0]=de&255,it[1]=de>>>8&255,pe.check=r(pe.check,it,2,0)),de=0,xe=0,pe.mode=D;case D:if(pe.flags&1024){for(;xe<16;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}pe.length=de,pe.head&&(pe.head.extra_len=de),pe.flags&512&&(it[0]=de&255,it[1]=de>>>8&255,pe.check=r(pe.check,it,2,0)),de=0,xe=0}else pe.head&&(pe.head.extra=null);pe.mode=U;case U:if(pe.flags&1024&&(Ve=pe.length,Ve>Ee&&(Ve=Ee),Ve&&(pe.head&&(yt=pe.head.extra_len-pe.length,pe.head.extra||(pe.head.extra=new Array(pe.head.extra_len)),t.arraySet(pe.head.extra,be,se,Ve,yt)),pe.flags&512&&(pe.check=r(pe.check,be,Ve,se)),Ee-=Ve,se+=Ve,pe.length-=Ve),pe.length))break e;pe.length=0,pe.mode=V;case V:if(pe.flags&2048){if(Ee===0)break e;Ve=0;do yt=be[se+Ve++],pe.head&&yt&&pe.length<65536&&(pe.head.name+=String.fromCharCode(yt));while(yt&&Ve<Ee);if(pe.flags&512&&(pe.check=r(pe.check,be,Ve,se)),Ee-=Ve,se+=Ve,yt)break e}else pe.head&&(pe.head.name=null);pe.length=0,pe.mode=_;case _:if(pe.flags&4096){if(Ee===0)break e;Ve=0;do yt=be[se+Ve++],pe.head&&yt&&pe.length<65536&&(pe.head.comment+=String.fromCharCode(yt));while(yt&&Ve<Ee);if(pe.flags&512&&(pe.check=r(pe.check,be,Ve,se)),Ee-=Ve,se+=Ve,yt)break e}else pe.head&&(pe.head.comment=null);pe.mode=n;case n:if(pe.flags&512){for(;xe<16;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}if(de!==(pe.check&65535)){ue.msg="header crc mismatch",pe.mode=j;break}de=0,xe=0}pe.head&&(pe.head.hcrc=pe.flags>>9&1,pe.head.done=!0),ue.adler=pe.check=0,pe.mode=u;break;case s:for(;xe<32;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}ue.adler=pe.check=ot(de),de=0,xe=0,pe.mode=f;case f:if(pe.havedict===0)return ue.next_out=ye,ue.avail_out=Fe,ue.next_in=se,ue.avail_in=Ee,pe.hold=de,pe.bits=xe,E;ue.adler=pe.check=1,pe.mode=u;case u:if(me===g||me===y)break e;case c:if(pe.last){de>>>=xe&7,xe-=xe&7,pe.mode=K;break}for(;xe<3;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}switch(pe.last=de&1,de>>>=1,xe-=1,de&3){case 0:pe.mode=m;break;case 1:if(O(pe),pe.mode=S,me===y){de>>>=2,xe-=2;break e}break;case 2:pe.mode=o;break;case 3:ue.msg="invalid block type",pe.mode=j}de>>>=2,xe-=2;break;case m:for(de>>>=xe&7,xe-=xe&7;xe<32;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}if((de&65535)!==(de>>>16^65535)){ue.msg="invalid stored block lengths",pe.mode=j;break}if(pe.length=de&65535,de=0,xe=0,pe.mode=w,me===y)break e;case w:pe.mode=d;case d:if(Ve=pe.length,Ve){if(Ve>Ee&&(Ve=Ee),Ve>Fe&&(Ve=Fe),Ve===0)break e;t.arraySet(Qe,be,se,Ve,ye),Ee-=Ve,se+=Ve,Fe-=Ve,ye+=Ve,pe.length-=Ve;break}pe.mode=u;break;case o:for(;xe<14;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}if(pe.nlen=(de&31)+257,de>>>=5,xe-=5,pe.ndist=(de&31)+1,de>>>=5,xe-=5,pe.ncode=(de&15)+4,de>>>=4,xe-=4,pe.nlen>286||pe.ndist>30){ue.msg="too many length or distance symbols",pe.mode=j;break}pe.have=0,pe.mode=v;case v:for(;pe.have<pe.ncode;){for(;xe<3;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}pe.lens[Mt[pe.have++]]=de&7,de>>>=3,xe-=3}for(;pe.have<19;)pe.lens[Mt[pe.have++]]=0;if(pe.lencode=pe.lendyn,pe.lenbits=7,_t={bits:pe.lenbits},Xe=i(h,pe.lens,0,19,pe.lencode,0,pe.work,_t),pe.lenbits=_t.bits,Xe){ue.msg="invalid code lengths set",pe.mode=j;break}pe.have=0,pe.mode=R;case R:for(;pe.have<pe.nlen+pe.ndist;){for(;et=pe.lencode[de&(1<<pe.lenbits)-1],mt=et>>>24,We=et>>>16&255,nt=et&65535,!(mt<=xe);){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}if(nt<16)de>>>=mt,xe-=mt,pe.lens[pe.have++]=nt;else{if(nt===16){for(dt=mt+2;xe<dt;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}if(de>>>=mt,xe-=mt,pe.have===0){ue.msg="invalid bit length repeat",pe.mode=j;break}yt=pe.lens[pe.have-1],Ve=3+(de&3),de>>>=2,xe-=2}else if(nt===17){for(dt=mt+3;xe<dt;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}de>>>=mt,xe-=mt,yt=0,Ve=3+(de&7),de>>>=3,xe-=3}else{for(dt=mt+7;xe<dt;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}de>>>=mt,xe-=mt,yt=0,Ve=11+(de&127),de>>>=7,xe-=7}if(pe.have+Ve>pe.nlen+pe.ndist){ue.msg="invalid bit length repeat",pe.mode=j;break}for(;Ve--;)pe.lens[pe.have++]=yt}}if(pe.mode===j)break;if(pe.lens[256]===0){ue.msg="invalid code -- missing end-of-block",pe.mode=j;break}if(pe.lenbits=9,_t={bits:pe.lenbits},Xe=i(l,pe.lens,0,pe.nlen,pe.lencode,0,pe.work,_t),pe.lenbits=_t.bits,Xe){ue.msg="invalid literal/lengths set",pe.mode=j;break}if(pe.distbits=6,pe.distcode=pe.distdyn,_t={bits:pe.distbits},Xe=i(p,pe.lens,pe.nlen,pe.ndist,pe.distcode,0,pe.work,_t),pe.distbits=_t.bits,Xe){ue.msg="invalid distances set",pe.mode=j;break}if(pe.mode=S,me===y)break e;case S:pe.mode=B;case B:if(Ee>=6&&Fe>=258){ue.next_out=ye,ue.avail_out=Fe,ue.next_in=se,ue.avail_in=Ee,pe.hold=de,pe.bits=xe,a(ue,_e),ye=ue.next_out,Qe=ue.output,Fe=ue.avail_out,se=ue.next_in,be=ue.input,Ee=ue.avail_in,de=pe.hold,xe=pe.bits,pe.mode===u&&(pe.back=-1);break}for(pe.back=0;et=pe.lencode[de&(1<<pe.lenbits)-1],mt=et>>>24,We=et>>>16&255,nt=et&65535,!(mt<=xe);){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}if(We&&!(We&240)){for(bt=mt,Je=We,at=nt;et=pe.lencode[at+((de&(1<<bt+Je)-1)>>bt)],mt=et>>>24,We=et>>>16&255,nt=et&65535,!(bt+mt<=xe);){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}de>>>=bt,xe-=bt,pe.back+=bt}if(de>>>=mt,xe-=mt,pe.back+=mt,pe.length=nt,We===0){pe.mode=Z;break}if(We&32){pe.back=-1,pe.mode=u;break}if(We&64){ue.msg="invalid literal/length code",pe.mode=j;break}pe.extra=We&15,pe.mode=F;case F:if(pe.extra){for(dt=pe.extra;xe<dt;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}pe.length+=de&(1<<pe.extra)-1,de>>>=pe.extra,xe-=pe.extra,pe.back+=pe.extra}pe.was=pe.length,pe.mode=$;case $:for(;et=pe.distcode[de&(1<<pe.distbits)-1],mt=et>>>24,We=et>>>16&255,nt=et&65535,!(mt<=xe);){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}if(!(We&240)){for(bt=mt,Je=We,at=nt;et=pe.distcode[at+((de&(1<<bt+Je)-1)>>bt)],mt=et>>>24,We=et>>>16&255,nt=et&65535,!(bt+mt<=xe);){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}de>>>=bt,xe-=bt,pe.back+=bt}if(de>>>=mt,xe-=mt,pe.back+=mt,We&64){ue.msg="invalid distance code",pe.mode=j;break}pe.offset=nt,pe.extra=We&15,pe.mode=re;case re:if(pe.extra){for(dt=pe.extra;xe<dt;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}pe.offset+=de&(1<<pe.extra)-1,de>>>=pe.extra,xe-=pe.extra,pe.back+=pe.extra}if(pe.offset>pe.dmax){ue.msg="invalid distance too far back",pe.mode=j;break}pe.mode=Q;case Q:if(Fe===0)break e;if(Ve=_e-Fe,pe.offset>Ve){if(Ve=pe.offset-Ve,Ve>pe.whave&&pe.sane){ue.msg="invalid distance too far back",pe.mode=j;break}Ve>pe.wnext?(Ve-=pe.wnext,vt=pe.wsize-Ve):vt=pe.wnext-Ve,Ve>pe.length&&(Ve=pe.length),Ye=pe.window}else Ye=Qe,vt=ye-pe.offset,Ve=pe.length;Ve>Fe&&(Ve=Fe),Fe-=Ve,pe.length-=Ve;do Qe[ye++]=Ye[vt++];while(--Ve);pe.length===0&&(pe.mode=B);break;case Z:if(Fe===0)break e;Qe[ye++]=pe.length,Fe--,pe.mode=B;break;case K:if(pe.wrap){for(;xe<32;){if(Ee===0)break e;Ee--,de|=be[se++]<<xe,xe+=8}if(_e-=Fe,ue.total_out+=_e,pe.total+=_e,_e&&(ue.adler=pe.check=pe.flags?r(pe.check,Qe,_e,ye-_e):e(pe.check,Qe,_e,ye-_e)),_e=Fe,(pe.flags?de:ot(de))!==pe.check){ue.msg="incorrect data check",pe.mode=j;break}de=0,xe=0}pe.mode=le;case le:if(pe.wrap&&pe.flags){for(;xe<32;){if(Ee===0)break e;Ee--,de+=be[se++]<<xe,xe+=8}if(de!==(pe.total&4294967295)){ue.msg="incorrect length check",pe.mode=j;break}de=0,xe=0}pe.mode=te;case te:Xe=x;break e;case j:Xe=k;break e;case J:return P;case X:default:return A}return ue.next_out=ye,ue.avail_out=Fe,ue.next_in=se,ue.avail_in=Ee,pe.hold=de,pe.bits=xe,(pe.wsize||_e!==ue.avail_out&&pe.mode<j&&(pe.mode<K||me!==b))&&q(ue,ue.output,ue.next_out,_e-ue.avail_out),ct-=ue.avail_in,_e-=ue.avail_out,ue.total_in+=ct,ue.total_out+=_e,pe.total+=_e,pe.wrap&&_e&&(ue.adler=pe.check=pe.flags?r(pe.check,Qe,_e,ue.next_out-_e):e(pe.check,Qe,_e,ue.next_out-_e)),ue.data_type=pe.bits+(pe.last?64:0)+(pe.mode===u?128:0)+(pe.mode===S||pe.mode===w?256:0),(ct===0&&_e===0||me===b)&&Xe===M&&(Xe=N),Xe}function W(ue){if(!ue||!ue.state)return A;var me=ue.state;return me.window&&(me.window=null),ue.state=null,M}function fe(ue,me){var pe;return!ue||!ue.state||(pe=ue.state,!(pe.wrap&2))?A:(pe.head=me,me.done=!1,M)}function st(ue,me){var pe=me.length,be,Qe,se;return!ue||!ue.state||(be=ue.state,be.wrap!==0&&be.mode!==f)?A:be.mode===f&&(Qe=1,Qe=e(Qe,me,pe,0),Qe!==be.check)?k:(se=q(ue,me,pe,pe),se?(be.mode=J,P):(be.havedict=1,M))}return Cs.inflateReset=ut,Cs.inflateReset2=Ze,Cs.inflateResetKeep=Se,Cs.inflateInit=lt,Cs.inflateInit2=Ge,Cs.inflate=H,Cs.inflateEnd=W,Cs.inflateGetHeader=fe,Cs.inflateSetDictionary=st,Cs.inflateInfo="pako inflate (from Nodeca project)",Cs}function gAe(){return Fie||(Fie=!0,Kk={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}),Kk}function bAe(){if(jie)return Dt;jie=!0;var t=ni.Buffer,e=yr,r=ar,a=hAe(),i=dAe(),h=mAe(),l=gAe();for(var p in l)Dt[p]=l[p];Dt.NONE=0,Dt.DEFLATE=1,Dt.INFLATE=2,Dt.GZIP=3,Dt.GUNZIP=4,Dt.DEFLATERAW=5,Dt.INFLATERAW=6,Dt.UNZIP=7;var b=31,g=139;function y(M){if(typeof M!="number"||M<Dt.DEFLATE||M>Dt.UNZIP)throw new TypeError("Bad argument");this.dictionary=null,this.err=0,this.flush=0,this.init_done=!1,this.level=0,this.memLevel=0,this.mode=M,this.strategy=0,this.windowBits=0,this.write_in_progress=!1,this.pending_close=!1,this.gzip_id_bytes_read=0}return y.prototype.close=function(){if(this.write_in_progress){this.pending_close=!0;return}this.pending_close=!1,r(this.init_done,"close before init"),r(this.mode<=Dt.UNZIP),this.mode===Dt.DEFLATE||this.mode===Dt.GZIP||this.mode===Dt.DEFLATERAW?i.deflateEnd(this.strm):(this.mode===Dt.INFLATE||this.mode===Dt.GUNZIP||this.mode===Dt.INFLATERAW||this.mode===Dt.UNZIP)&&h.inflateEnd(this.strm),this.mode=Dt.NONE,this.dictionary=null},y.prototype.write=function(M,x,E,A,k,P,N){return this._write(!0,M,x,E,A,k,P,N)},y.prototype.writeSync=function(M,x,E,A,k,P,N){return this._write(!1,M,x,E,A,k,P,N)},y.prototype._write=function(M,x,E,A,k,P,N,L){if(r.equal(arguments.length,8),r(this.init_done,"write before init"),r(this.mode!==Dt.NONE,"already finalized"),r.equal(!1,this.write_in_progress,"write already in progress"),r.equal(!1,this.pending_close,"close is pending"),this.write_in_progress=!0,r.equal(!1,x===void 0,"must provide flush value"),this.write_in_progress=!0,x!==Dt.Z_NO_FLUSH&&x!==Dt.Z_PARTIAL_FLUSH&&x!==Dt.Z_SYNC_FLUSH&&x!==Dt.Z_FULL_FLUSH&&x!==Dt.Z_FINISH&&x!==Dt.Z_BLOCK)throw new Error("Invalid flush value");if(E==null&&(E=t.alloc(0),k=0,A=0),this.strm.avail_in=k,this.strm.input=E,this.strm.next_in=A,this.strm.avail_out=L,this.strm.output=P,this.strm.next_out=N,this.flush=x,!M)return this._process(),this._checkError()?this._afterSync():void 0;var C=this;return e.nextTick(function(){C._process(),C._after()}),this},y.prototype._afterSync=function(){var M=this.strm.avail_out,x=this.strm.avail_in;return this.write_in_progress=!1,[x,M]},y.prototype._process=function(){var M=null;switch(this.mode){case Dt.DEFLATE:case Dt.GZIP:case Dt.DEFLATERAW:this.err=i.deflate(this.strm,this.flush);break;case Dt.UNZIP:switch(this.strm.avail_in>0&&(M=this.strm.next_in),this.gzip_id_bytes_read){case 0:if(M===null)break;if(this.strm.input[M]===b){if(this.gzip_id_bytes_read=1,M++,this.strm.avail_in===1)break}else{this.mode=Dt.INFLATE;break}case 1:if(M===null)break;this.strm.input[M]===g?(this.gzip_id_bytes_read=2,this.mode=Dt.GUNZIP):this.mode=Dt.INFLATE;break;default:throw new Error("invalid number of gzip magic number bytes read")}case Dt.INFLATE:case Dt.GUNZIP:case Dt.INFLATERAW:for(this.err=h.inflate(this.strm,this.flush),this.err===Dt.Z_NEED_DICT&&this.dictionary&&(this.err=h.inflateSetDictionary(this.strm,this.dictionary),this.err===Dt.Z_OK?this.err=h.inflate(this.strm,this.flush):this.err===Dt.Z_DATA_ERROR&&(this.err=Dt.Z_NEED_DICT));this.strm.avail_in>0&&this.mode===Dt.GUNZIP&&this.err===Dt.Z_STREAM_END&&this.strm.next_in[0]!==0;)this.reset(),this.err=h.inflate(this.strm,this.flush);break;default:throw new Error("Unknown mode "+this.mode)}},y.prototype._checkError=function(){switch(this.err){case Dt.Z_OK:case Dt.Z_BUF_ERROR:if(this.strm.avail_out!==0&&this.flush===Dt.Z_FINISH)return this._error("unexpected end of file"),!1;break;case Dt.Z_STREAM_END:break;case Dt.Z_NEED_DICT:return this.dictionary==null?this._error("Missing dictionary"):this._error("Bad dictionary"),!1;default:return this._error("Zlib error"),!1}return!0},y.prototype._after=function(){if(this._checkError()){var M=this.strm.avail_out,x=this.strm.avail_in;this.write_in_progress=!1,this.callback(x,M),this.pending_close&&this.close()}},y.prototype._error=function(M){this.strm.msg&&(M=this.strm.msg),this.onerror(M,this.err),this.write_in_progress=!1,this.pending_close&&this.close()},y.prototype.init=function(M,x,E,A,k){r(arguments.length===4||arguments.length===5,"init(windowBits, level, memLevel, strategy, [dictionary])"),r(M>=8&&M<=15,"invalid windowBits"),r(x>=-1&&x<=9,"invalid compression level"),r(E>=1&&E<=9,"invalid memlevel"),r(A===Dt.Z_FILTERED||A===Dt.Z_HUFFMAN_ONLY||A===Dt.Z_RLE||A===Dt.Z_FIXED||A===Dt.Z_DEFAULT_STRATEGY,"invalid strategy"),this._init(x,M,E,A,k),this._setDictionary()},y.prototype.params=function(){throw new Error("deflateParams Not supported")},y.prototype.reset=function(){this._reset(),this._setDictionary()},y.prototype._init=function(M,x,E,A,k){switch(this.level=M,this.windowBits=x,this.memLevel=E,this.strategy=A,this.flush=Dt.Z_NO_FLUSH,this.err=Dt.Z_OK,(this.mode===Dt.GZIP||this.mode===Dt.GUNZIP)&&(this.windowBits+=16),this.mode===Dt.UNZIP&&(this.windowBits+=32),(this.mode===Dt.DEFLATERAW||this.mode===Dt.INFLATERAW)&&(this.windowBits=-1*this.windowBits),this.strm=new a,this.mode){case Dt.DEFLATE:case Dt.GZIP:case Dt.DEFLATERAW:this.err=i.deflateInit2(this.strm,this.level,Dt.Z_DEFLATED,this.windowBits,this.memLevel,this.strategy);break;case Dt.INFLATE:case Dt.GUNZIP:case Dt.INFLATERAW:case Dt.UNZIP:this.err=h.inflateInit2(this.strm,this.windowBits);break;default:throw new Error("Unknown mode "+this.mode)}this.err!==Dt.Z_OK&&this._error("Init error"),this.dictionary=k,this.write_in_progress=!1,this.init_done=!0},y.prototype._setDictionary=function(){if(this.dictionary!=null){switch(this.err=Dt.Z_OK,this.mode){case Dt.DEFLATE:case Dt.DEFLATERAW:this.err=i.deflateSetDictionary(this.strm,this.dictionary);break}this.err!==Dt.Z_OK&&this._error("Failed to set dictionary")}},y.prototype._reset=function(){switch(this.err=Dt.Z_OK,this.mode){case Dt.DEFLATE:case Dt.DEFLATERAW:case Dt.GZIP:this.err=i.deflateReset(this.strm);break;case Dt.INFLATE:case Dt.INFLATERAW:case Dt.GUNZIP:this.err=h.inflateReset(this.strm);break}this.err!==Dt.Z_OK&&this._error("Failed to reset stream")},Dt.Zlib=y,Dt}function yAe(){if(zie)return tr;zie=!0;var t=yr,e=ni.Buffer,r=ka.Transform,a=bAe(),i=gt,h=ar.ok,l=ni.kMaxLength,p="Cannot create final Buffer. It would be larger than 0x"+l.toString(16)+" bytes";a.Z_MIN_WINDOWBITS=8,a.Z_MAX_WINDOWBITS=15,a.Z_DEFAULT_WINDOWBITS=15,a.Z_MIN_CHUNK=64,a.Z_MAX_CHUNK=1/0,a.Z_DEFAULT_CHUNK=16*1024,a.Z_MIN_MEMLEVEL=1,a.Z_MAX_MEMLEVEL=9,a.Z_DEFAULT_MEMLEVEL=8,a.Z_MIN_LEVEL=-1,a.Z_MAX_LEVEL=9,a.Z_DEFAULT_LEVEL=a.Z_DEFAULT_COMPRESSION;for(var b=Object.keys(a),g=0;g<b.length;g++){var y=b[g];y.match(/^Z/)&&Object.defineProperty(tr,y,{enumerable:!0,value:a[y],writable:!1})}for(var M={Z_OK:a.Z_OK,Z_STREAM_END:a.Z_STREAM_END,Z_NEED_DICT:a.Z_NEED_DICT,Z_ERRNO:a.Z_ERRNO,Z_STREAM_ERROR:a.Z_STREAM_ERROR,Z_DATA_ERROR:a.Z_DATA_ERROR,Z_MEM_ERROR:a.Z_MEM_ERROR,Z_BUF_ERROR:a.Z_BUF_ERROR,Z_VERSION_ERROR:a.Z_VERSION_ERROR},x=Object.keys(M),E=0;E<x.length;E++){var A=x[E];M[M[A]]=A}Object.defineProperty(tr,"codes",{enumerable:!0,value:Object.freeze(M),writable:!1}),tr.Deflate=N,tr.Inflate=L,tr.Gzip=C,tr.Gunzip=Y,tr.DeflateRaw=G,tr.InflateRaw=ee,tr.Unzip=D,tr.createDeflate=function(s){return new N(s)},tr.createInflate=function(s){return new L(s)},tr.createDeflateRaw=function(s){return new G(s)},tr.createInflateRaw=function(s){return new ee(s)},tr.createGzip=function(s){return new C(s)},tr.createGunzip=function(s){return new Y(s)},tr.createUnzip=function(s){return new D(s)},tr.deflate=function(s,f,u){return typeof f=="function"&&(u=f,f={}),k(new N(f),s,u)},tr.deflateSync=function(s,f){return P(new N(f),s)},tr.gzip=function(s,f,u){return typeof f=="function"&&(u=f,f={}),k(new C(f),s,u)},tr.gzipSync=function(s,f){return P(new C(f),s)},tr.deflateRaw=function(s,f,u){return typeof f=="function"&&(u=f,f={}),k(new G(f),s,u)},tr.deflateRawSync=function(s,f){return P(new G(f),s)},tr.unzip=function(s,f,u){return typeof f=="function"&&(u=f,f={}),k(new D(f),s,u)},tr.unzipSync=function(s,f){return P(new D(f),s)},tr.inflate=function(s,f,u){return typeof f=="function"&&(u=f,f={}),k(new L(f),s,u)},tr.inflateSync=function(s,f){return P(new L(f),s)},tr.gunzip=function(s,f,u){return typeof f=="function"&&(u=f,f={}),k(new Y(f),s,u)},tr.gunzipSync=function(s,f){return P(new Y(f),s)},tr.inflateRaw=function(s,f,u){return typeof f=="function"&&(u=f,f={}),k(new ee(f),s,u)},tr.inflateRawSync=function(s,f){return P(new ee(f),s)};function k(s,f,u){var c=[],m=0;s.on("error",d),s.on("end",o),s.end(f),w();function w(){for(var v;(v=s.read())!==null;)c.push(v),m+=v.length;s.once("readable",w)}function d(v){s.removeListener("end",o),s.removeListener("readable",w),u(v)}function o(){var v,R=null;m>=l?R=new RangeError(p):v=e.concat(c,m),c=[],s.close(),u(R,v)}}function P(s,f){if(typeof f=="string"&&(f=e.from(f)),!e.isBuffer(f))throw new TypeError("Not a string or buffer");var u=s._finishFlushFlag;return s._processChunk(f,u)}function N(s){if(!(this instanceof N))return new N(s);V.call(this,s,a.DEFLATE)}function L(s){if(!(this instanceof L))return new L(s);V.call(this,s,a.INFLATE)}function C(s){if(!(this instanceof C))return new C(s);V.call(this,s,a.GZIP)}function Y(s){if(!(this instanceof Y))return new Y(s);V.call(this,s,a.GUNZIP)}function G(s){if(!(this instanceof G))return new G(s);V.call(this,s,a.DEFLATERAW)}function ee(s){if(!(this instanceof ee))return new ee(s);V.call(this,s,a.INFLATERAW)}function D(s){if(!(this instanceof D))return new D(s);V.call(this,s,a.UNZIP)}function U(s){return s===a.Z_NO_FLUSH||s===a.Z_PARTIAL_FLUSH||s===a.Z_SYNC_FLUSH||s===a.Z_FULL_FLUSH||s===a.Z_FINISH||s===a.Z_BLOCK}function V(s,f){var u=this;if(this._opts=s=s||{},this._chunkSize=s.chunkSize||tr.Z_DEFAULT_CHUNK,r.call(this,s),s.flush&&!U(s.flush))throw new Error("Invalid flush flag: "+s.flush);if(s.finishFlush&&!U(s.finishFlush))throw new Error("Invalid flush flag: "+s.finishFlush);if(this._flushFlag=s.flush||a.Z_NO_FLUSH,this._finishFlushFlag=typeof s.finishFlush<"u"?s.finishFlush:a.Z_FINISH,s.chunkSize&&(s.chunkSize<tr.Z_MIN_CHUNK||s.chunkSize>tr.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+s.chunkSize);if(s.windowBits&&(s.windowBits<tr.Z_MIN_WINDOWBITS||s.windowBits>tr.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+s.windowBits);if(s.level&&(s.level<tr.Z_MIN_LEVEL||s.level>tr.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+s.level);if(s.memLevel&&(s.memLevel<tr.Z_MIN_MEMLEVEL||s.memLevel>tr.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+s.memLevel);if(s.strategy&&s.strategy!=tr.Z_FILTERED&&s.strategy!=tr.Z_HUFFMAN_ONLY&&s.strategy!=tr.Z_RLE&&s.strategy!=tr.Z_FIXED&&s.strategy!=tr.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+s.strategy);if(s.dictionary&&!e.isBuffer(s.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._handle=new a.Zlib(f);var c=this;this._hadError=!1,this._handle.onerror=function(d,o){_(c),c._hadError=!0;var v=new Error(d);v.errno=o,v.code=tr.codes[o],c.emit("error",v)};var m=tr.Z_DEFAULT_COMPRESSION;typeof s.level=="number"&&(m=s.level);var w=tr.Z_DEFAULT_STRATEGY;typeof s.strategy=="number"&&(w=s.strategy),this._handle.init(s.windowBits||tr.Z_DEFAULT_WINDOWBITS,m,s.memLevel||tr.Z_DEFAULT_MEMLEVEL,w,s.dictionary),this._buffer=e.allocUnsafe(this._chunkSize),this._offset=0,this._level=m,this._strategy=w,this.once("end",this.close),Object.defineProperty(this,"_closed",{get:function(){return!u._handle},configurable:!0,enumerable:!0})}i.inherits(V,r),V.prototype.params=function(s,f,u){if(s<tr.Z_MIN_LEVEL||s>tr.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+s);if(f!=tr.Z_FILTERED&&f!=tr.Z_HUFFMAN_ONLY&&f!=tr.Z_RLE&&f!=tr.Z_FIXED&&f!=tr.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+f);if(this._level!==s||this._strategy!==f){var c=this;this.flush(a.Z_SYNC_FLUSH,function(){h(c._handle,"zlib binding closed"),c._handle.params(s,f),c._hadError||(c._level=s,c._strategy=f,u&&u())})}else t.nextTick(u)},V.prototype.reset=function(){return h(this._handle,"zlib binding closed"),this._handle.reset()},V.prototype._flush=function(s){this._transform(e.alloc(0),"",s)},V.prototype.flush=function(s,f){var u=this,c=this._writableState;(typeof s=="function"||s===void 0&&!f)&&(f=s,s=a.Z_FULL_FLUSH),c.ended?f&&t.nextTick(f):c.ending?f&&this.once("end",f):c.needDrain?f&&this.once("drain",function(){return u.flush(s,f)}):(this._flushFlag=s,this.write(e.alloc(0),"",f))},V.prototype.close=function(s){_(this,s),t.nextTick(n,this)};function _(s,f){f&&t.nextTick(f),s._handle&&(s._handle.close(),s._handle=null)}function n(s){s.emit("close")}return V.prototype._transform=function(s,f,u){var c,m=this._writableState,w=m.ending||m.ended,d=w&&(!s||m.length===s.length);if(s!==null&&!e.isBuffer(s))return u(new Error("invalid input"));if(!this._handle)return u(new Error("zlib binding closed"));d?c=this._finishFlushFlag:(c=this._flushFlag,s.length>=m.length&&(this._flushFlag=this._opts.flush||a.Z_NO_FLUSH)),this._processChunk(s,c,u)},V.prototype._processChunk=function(s,f,u){var c=s&&s.length,m=this._chunkSize-this._offset,w=0,d=this,o=typeof u=="function";if(!o){var v=[],R=0,S;this.on("error",function(Q){S=Q}),h(this._handle,"zlib binding closed");do var B=this._handle.writeSync(f,s,w,c,this._buffer,this._offset,m);while(!this._hadError&&re(B[0],B[1]));if(this._hadError)throw S;if(R>=l)throw _(this),new RangeError(p);var F=e.concat(v,R);return _(this),F}h(this._handle,"zlib binding closed");var $=this._handle.write(f,s,w,c,this._buffer,this._offset,m);$.buffer=s,$.callback=re;function re(Q,Z){if(this&&(this.buffer=null,this.callback=null),!d._hadError){var K=m-Z;if(h(K>=0,"have should not go down"),K>0){var le=d._buffer.slice(d._offset,d._offset+K);d._offset+=K,o?d.push(le):(v.push(le),R+=le.length)}if((Z===0||d._offset>=d._chunkSize)&&(m=d._chunkSize,d._offset=0,d._buffer=e.allocUnsafe(d._chunkSize)),Z===0){if(w+=c-Q,c=Q,!o)return!0;var te=d._handle.write(f,s,w,c,d._buffer,d._offset,d._chunkSize);te.callback=re,te.buffer=s;return}if(!o)return!1;u()}}},i.inherits(N,V),i.inherits(L,V),i.inherits(C,V),i.inherits(Y,V),i.inherits(G,V),i.inherits(ee,V),i.inherits(D,V),tr}var Uk,Bie,Ba,Pie,Bd,Oie,Fk,Nie,jk,Cie,zk,Lie,Of,Die,Zk,$ie,Hk,qie,Cs,Uie,Kk,Fie,Dt,jie,tr,zie,At,wAe,_Ae,MAe,xAe,SAe,EAe,AAe,RAe,TAe,kAe,IAe,BAe,PAe,OAe,NAe,CAe,LAe,DAe,$Ae,qAe,UAe,FAe,jAe,zAe,ZAe,HAe,KAe,WAe,VAe,GAe,YAe,JAe,XAe,QAe,eRe,tRe,rRe,iRe,nRe,aRe,oRe,sRe,fRe,uRe,hRe,lRe,cRe,dRe,pRe,vRe,mRe,gRe,bRe,yRe,wRe,_Re,MRe,xRe,SRe,ERe,ARe,RRe,TRe,kRe,IRe,BRe,PRe,ORe,NRe,Wie=Si(()=>{"use strict";ie();ae();ne();oh();I8();yk();Ws();no();Rg();jo();Ks();rh();Uo();Yf();Z0();Uk={},Bie=!1;Ba={},Pie=!1;Bd={},Oie=!1;Fk={},Nie=!1;jk={},Cie=!1;zk={},Lie=!1;Of={},Die=!1;Zk={},$ie=!1;Hk={},qie=!1;Cs={},Uie=!1;Kk={},Fie=!1;Dt={},jie=!1;tr={},zie=!1;At=yAe();At.codes;At.Deflate;At.Inflate;At.Gzip;At.Gunzip;At.DeflateRaw;At.InflateRaw;At.Unzip;At.createDeflate;At.createInflate;At.createDeflateRaw;At.createInflateRaw;At.createGzip;At.createGunzip;At.createUnzip;At.deflate;At.deflateSync;At.gzip;At.gzipSync;At.deflateRaw;At.deflateRawSync;At.unzip;At.unzipSync;At.inflate;At.inflateSync;At.gunzip;At.gunzipSync;At.inflateRaw;At.inflateRawSync;wAe=At.Deflate,_Ae=At.DeflateRaw,MAe=At.Gunzip,xAe=At.Gzip,SAe=At.Inflate,EAe=At.InflateRaw,AAe=At.Unzip,RAe=At.Z_BEST_COMPRESSION,TAe=At.Z_BEST_SPEED,kAe=At.Z_BINARY,IAe=At.Z_BLOCK,BAe=At.Z_BUF_ERROR,PAe=At.Z_DATA_ERROR,OAe=At.Z_DEFAULT_CHUNK,NAe=At.Z_DEFAULT_COMPRESSION,CAe=At.Z_DEFAULT_LEVEL,LAe=At.Z_DEFAULT_MEMLEVEL,DAe=At.Z_DEFAULT_STRATEGY,$Ae=At.Z_DEFAULT_WINDOWBITS,qAe=At.Z_DEFLATED,UAe=At.Z_ERRNO,FAe=At.Z_FILTERED,jAe=At.Z_FINISH,zAe=At.Z_FIXED,ZAe=At.Z_FULL_FLUSH,HAe=At.Z_HUFFMAN_ONLY,KAe=At.Z_MAX_CHUNK,WAe=At.Z_MAX_LEVEL,VAe=At.Z_MAX_MEMLEVEL,GAe=At.Z_MAX_WINDOWBITS,YAe=At.Z_MIN_CHUNK,JAe=At.Z_MIN_LEVEL,XAe=At.Z_MIN_MEMLEVEL,QAe=At.Z_MIN_WINDOWBITS,eRe=At.Z_NEED_DICT,tRe=At.Z_NO_COMPRESSION,rRe=At.Z_NO_FLUSH,iRe=At.Z_OK,nRe=At.Z_PARTIAL_FLUSH,aRe=At.Z_RLE,oRe=At.Z_STREAM_END,sRe=At.Z_STREAM_ERROR,fRe=At.Z_SYNC_FLUSH,uRe=At.Z_TEXT,hRe=At.Z_TREES,lRe=At.Z_UNKNOWN,cRe=At.Zlib,dRe=At.codes,pRe=At.createDeflate,vRe=At.createDeflateRaw,mRe=At.createGunzip,gRe=At.createGzip,bRe=At.createInflate,yRe=At.createInflateRaw,wRe=At.createUnzip,_Re=At.deflate,MRe=At.deflateRaw,xRe=At.deflateRawSync,SRe=At.deflateSync,ERe=At.gunzip,ARe=At.gunzipSync,RRe=At.gzip,TRe=At.gzipSync,kRe=At.inflate,IRe=At.inflateRaw,BRe=At.inflateRawSync,PRe=At.inflateSync,ORe=At.unzip,NRe=At.unzipSync});var Yie=ht((Dpt,Gie)=>{"use strict";ie();ae();ne();var F1=[],o2=[],Wk=function(){};function Gk(t){return~F1.indexOf(t)?!1:(F1.push(t),!0)}function Yk(t){Wk=t}function CRe(t){for(var e=[],r=0;r<F1.length;r++){if(F1[r].async){e.push(F1[r]);continue}if(F1[r](t))return!0}return e.length?new Promise(function(i){Promise.all(e.map(function(l){return l(t)})).then(function(l){i(l.some(Boolean))})}):!1}function Jk(t){return~o2.indexOf(t)?!1:(o2.push(t),!0)}function Vk(){Wk.apply(Wk,arguments)}function Vie(t){for(var e=0;e<o2.length;e++)t=o2[e].apply(o2[e],arguments);return t}function Xk(t,e){var r=Object.prototype.hasOwnProperty;for(var a in e)r.call(e,a)&&(t[a]=e[a]);return t}function LRe(t){return t.enabled=!1,t.modify=Jk,t.set=Yk,t.use=Gk,Xk(function(){return!1},t)}function DRe(t){function e(){var r=Array.prototype.slice.call(arguments,0);return Vk.call(Vk,t,Vie(r,t)),!0}return t.enabled=!0,t.modify=Jk,t.set=Yk,t.use=Gk,Xk(e,t)}Gie.exports=function(e){return e.introduce=Xk,e.enabled=CRe,e.process=Vie,e.modify=Jk,e.write=Vk,e.nope=LRe,e.yep=DRe,e.set=Yk,e.use=Gk,e}});var Xie=ht((Fpt,Jie)=>{"use strict";ie();ae();ne();var $Re=Yie(),qRe=$Re(function t(e,r){return r=r||{},r.namespace=e,r.prod=!0,r.dev=!1,r.force||t.force?t.yep(r):t.nope(r)});Jie.exports=qRe});var s2=ht((Hpt,Qie)=>{"use strict";ie();ae();ne();Qie.exports=Xie()});var ene={};Ha(ene,{StringDecoder:()=>URe,default:()=>An});var URe,tne=Si(()=>{"use strict";ie();ae();ne();Yf();Yf();URe=An.StringDecoder});var ine=ht((e1t,rne)=>{"use strict";ie();ae();ne();var Qk=(Nk(),ei(Ok)),FRe=(tne(),ei(ene)),jRe=FRe.StringDecoder,zRe=Oh(),ZRe=zRe.Stream;function HRe(){}rne.exports=function(t,e){var r=Me.alloc(65536),a=new jRe("utf8"),i=new ZRe,h="",l=0,p=0;return t.start===-1&&delete t.start,i.readable=!0,i.destroy=function(){i.destroyed=!0,i.emit("end"),i.emit("close")},Qk.open(t.file,"a+","0644",function(b,g){if(b){e?e(b):i.emit("error",b),i.destroy();return}(function y(){if(i.destroyed){Qk.close(g,HRe);return}return Qk.read(g,r,0,r.length,l,function(M,x){if(M){e?e(M):i.emit("error",M),i.destroy();return}if(!x)return h&&((t.start==null||p>t.start)&&(e?e(null,h):i.emit("line",h)),p++,h=""),setTimeout(y,1e3);var E=a.write(r.slice(0,x));e||i.emit("data",E),E=(h+E).split(/\n+/);for(var A=E.length-1,k=0;k<A;k++)(t.start==null||p>t.start)&&(e?e(null,E[k]):i.emit("line",E[k])),p++;return h=E[A],l+=x,y()})})()}),e?i.destroy:i}});var lne=ht((n1t,hne)=>{"use strict";ie();ae();ne();function jh(t){"@babel/helpers - typeof";return jh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},jh(t)}function KRe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function nne(t,e){for(var r=0;r<e.length;r++){var a=e[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,VRe(a.key),a)}}function WRe(t,e,r){return e&&nne(t.prototype,e),r&&nne(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function VRe(t){var e=GRe(t,"string");return jh(e)=="symbol"?e:String(e)}function GRe(t,e){if(jh(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e||"default");if(jh(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function YRe(t,e,r){return e=I4(e),JRe(t,sne()?Reflect.construct(e,r||[],I4(t).constructor):e.apply(t,r))}function JRe(t,e){if(e&&(jh(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return fne(t)}function sne(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(sne=function(){return!!t})()}function I4(t){return I4=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},I4(t)}function fne(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function XRe(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&eI(t,e)}function eI(t,e){return eI=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,i){return a.__proto__=i,a},eI(t,e)}var fo=(Nk(),ei(Ok)),na=(_k(),ei(lre)),ane=Iie(),QRe=(Wie(),ei(Kie)),eTe=sn(),tTe=eTe.MESSAGE,une=Oh(),rTe=une.Stream,one=une.PassThrough,iTe=O1(),Nf=s2()("winston:file"),nTe=(yd(),ei(bd)),aTe=ine();hne.exports=function(t){XRe(e,t);function e(){var r,a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};KRe(this,e),r=YRe(this,e,[a]),r.name=a.name||"file";function i(h){for(var l=arguments.length,p=new Array(l>1?l-1:0),b=1;b<l;b++)p[b-1]=arguments[b];p.slice(1).forEach(function(g){if(a[g])throw new Error("Cannot set ".concat(g," and ").concat(h," together"))})}if(r._stream=new one,r._stream.setMaxListeners(30),r._onError=r._onError.bind(fne(r)),a.filename||a.dirname)i("filename or dirname","stream"),r._basename=r.filename=a.filename?na.basename(a.filename):"winston.log",r.dirname=a.dirname||na.dirname(a.filename),r.options=a.options||{flags:"a"};else if(a.stream)console.warn("options.stream will be removed in winston@4. Use winston.transports.Stream"),i("stream","filename","maxsize"),r._dest=r._stream.pipe(r._setupStream(a.stream)),r.dirname=na.dirname(r._dest.path);else throw new Error("Cannot log to file without filename or stream.");return r.maxsize=a.maxsize||null,r.rotationFormat=a.rotationFormat||!1,r.zippedArchive=a.zippedArchive||!1,r.maxFiles=a.maxFiles||null,r.eol=typeof a.eol=="string"?a.eol:nTe.EOL,r.tailable=a.tailable||!1,r.lazy=a.lazy||!1,r._size=0,r._pendingSize=0,r._created=0,r._drain=!1,r._opening=!1,r._ending=!1,r._fileExist=!1,r.dirname&&r._createLogDirIfNotExist(r.dirname),r.lazy||r.open(),r}return WRe(e,[{key:"finishIfEnding",value:function(){var a=this;this._ending&&(this._opening?this.once("open",function(){a._stream.once("finish",function(){return a.emit("finish")}),setImmediate(function(){return a._stream.end()})}):(this._stream.once("finish",function(){return a.emit("finish")}),setImmediate(function(){return a._stream.end()})))}},{key:"log",value:function(a){var i=this,h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:function(){};if(this.silent)return h(),!0;if(this._drain){this._stream.once("drain",function(){i._drain=!1,i.log(a,h)});return}if(this._rotate){this._stream.once("rotate",function(){i._rotate=!1,i.log(a,h)});return}if(this.lazy){if(!this._fileExist){this._opening||this.open(),this.once("open",function(){i._fileExist=!0,i.log(a,h)});return}if(this._needsNewFile(this._pendingSize)){this._dest.once("close",function(){i._opening||i.open(),i.once("open",function(){i.log(a,h)})});return}}var l="".concat(a[tTe]).concat(this.eol),p=Me.byteLength(l);function b(){var y=this;if(this._size+=p,this._pendingSize-=p,Nf("logged %s %s",this._size,l),this.emit("logged",a),!this._rotate&&!this._opening&&this._needsNewFile()){if(this.lazy){this._endStream(function(){y.emit("fileclosed")});return}this._rotate=!0,this._endStream(function(){return y._rotateFile()})}}this._pendingSize+=p,this._opening&&!this.rotatedWhileOpening&&this._needsNewFile(this._size+this._pendingSize)&&(this.rotatedWhileOpening=!0);var g=this._stream.write(l,b.bind(this));return g?h():(this._drain=!0,this._stream.once("drain",function(){i._drain=!1,h()})),Nf("written",g,this._drain),this.finishIfEnding(),g}},{key:"query",value:function(a,i){typeof a=="function"&&(i=a,a={}),a=E(a);var h=na.join(this.dirname,this.filename),l="",p=[],b=0,g=fo.createReadStream(h,{encoding:"utf8"});g.on("error",function(A){if(g.readable&&g.destroy(),!!i)return A.code!=="ENOENT"?i(A):i(null,p)}),g.on("data",function(A){A=(l+A).split(/\n+/);for(var k=A.length-1,P=0;P<k;P++)(!a.start||b>=a.start)&&y(A[P]),b++;l=A[k]}),g.on("close",function(){l&&y(l,!0),a.order==="desc"&&(p=p.reverse()),i&&i(null,p)});function y(A,k){try{var P=JSON.parse(A);x(P)&&M(P)}catch(N){k||g.emit("error",N)}}function M(A){if(a.rows&&p.length>=a.rows&&a.order!=="desc"){g.readable&&g.destroy();return}a.fields&&(A=a.fields.reduce(function(k,P){return k[P]=A[P],k},{})),a.order==="desc"&&p.length>=a.rows&&p.shift(),p.push(A)}function x(A){if(A&&jh(A)==="object"){var k=new Date(A.timestamp);if(!(a.from&&k<a.from||a.until&&k>a.until||a.level&&a.level!==A.level))return!0}}function E(A){return A=A||{},A.rows=A.rows||A.limit||10,A.start=A.start||0,A.until=A.until||new Date,jh(A.until)!=="object"&&(A.until=new Date(A.until)),A.from=A.from||A.until-24*60*60*1e3,jh(A.from)!=="object"&&(A.from=new Date(A.from)),A.order=A.order||"desc",A}}},{key:"stream",value:function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=na.join(this.dirname,this.filename),h=new rTe,l={file:i,start:a.start};return h.destroy=aTe(l,function(p,b){if(p)return h.emit("error",p);try{h.emit("data",b),b=JSON.parse(b),h.emit("log",b)}catch(g){h.emit("error",g)}}),h}},{key:"open",value:function(){var a=this;this.filename&&(this._opening||(this._opening=!0,this.stat(function(i,h){if(i)return a.emit("error",i);Nf("stat done: %s { size: %s }",a.filename,h),a._size=h,a._dest=a._createStream(a._stream),a._opening=!1,a.once("open",function(){a._stream.eventNames().includes("rotate")?a._stream.emit("rotate"):a._rotate=!1})})))}},{key:"stat",value:function(a){var i=this,h=this._getFile(),l=na.join(this.dirname,h);fo.stat(l,function(p,b){if(p&&p.code==="ENOENT")return Nf("ENOENT\xA0ok",l),i.filename=h,a(null,0);if(p)return Nf("err ".concat(p.code," ").concat(l)),a(p);if(!b||i._needsNewFile(b.size))return i._incFile(function(){return i.stat(a)});i.filename=h,a(null,b.size)})}},{key:"close",value:function(a){var i=this;this._stream&&this._stream.end(function(){a&&a(),i.emit("flush"),i.emit("closed")})}},{key:"_needsNewFile",value:function(a){return a=a||this._size,this.maxsize&&a>=this.maxsize}},{key:"_onError",value:function(a){this.emit("error",a)}},{key:"_setupStream",value:function(a){return a.on("error",this._onError),a}},{key:"_cleanupStream",value:function(a){return a.removeListener("error",this._onError),a.destroy(),a}},{key:"_rotateFile",value:function(){var a=this;this._incFile(function(){return a.open()})}},{key:"_endStream",value:function(){var a=this,i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:function(){};this._dest?(this._stream.unpipe(this._dest),this._dest.end(function(){a._cleanupStream(a._dest),i()})):i()}},{key:"_createStream",value:function(a){var i=this,h=na.join(this.dirname,this.filename);Nf("create stream start",h,this.options);var l=fo.createWriteStream(h,this.options).on("error",function(p){return Nf(p)}).on("close",function(){return Nf("close",l.path,l.bytesWritten)}).on("open",function(){Nf("file open ok",h),i.emit("open",h),a.pipe(l),i.rotatedWhileOpening&&(i._stream=new one,i._stream.setMaxListeners(30),i._rotateFile(),i.rotatedWhileOpening=!1,i._cleanupStream(l),a.end())});return Nf("create stream ok",h),l}},{key:"_incFile",value:function(a){Nf("_incFile",this.filename);var i=na.extname(this._basename),h=na.basename(this._basename,i),l=[];this.zippedArchive&&l.push(function(p){var b=this._created>0&&!this.tailable?this._created:"";this._compressFile(na.join(this.dirname,"".concat(h).concat(b).concat(i)),na.join(this.dirname,"".concat(h).concat(b).concat(i,".gz")),p)}.bind(this)),l.push(function(p){this.tailable?this._checkMaxFilesTailable(i,h,p):(this._created+=1,this._checkMaxFilesIncrementing(i,h,p))}.bind(this)),ane(l,a)}},{key:"_getFile",value:function(){var a=na.extname(this._basename),i=na.basename(this._basename,a),h=this.rotationFormat?this.rotationFormat():this._created;return!this.tailable&&this._created?"".concat(i).concat(h).concat(a):"".concat(i).concat(a)}},{key:"_checkMaxFilesIncrementing",value:function(a,i,h){if(!this.maxFiles||this._created<this.maxFiles)return setImmediate(h);var l=this._created-this.maxFiles,p=l!==0?l:"",b=this.zippedArchive?".gz":"",g="".concat(i).concat(p).concat(a).concat(b),y=na.join(this.dirname,g);fo.unlink(y,h)}},{key:"_checkMaxFilesTailable",value:function(a,i,h){var l=this,p=[];if(this.maxFiles){for(var b=this.zippedArchive?".gz":"",g=this.maxFiles-1;g>1;g--)p.push(function(y,M){var x=this,E="".concat(i).concat(y-1).concat(a).concat(b),A=na.join(this.dirname,E);fo.exists(A,function(k){if(!k)return M(null);E="".concat(i).concat(y).concat(a).concat(b),fo.rename(A,na.join(x.dirname,E),M)})}.bind(this,g));ane(p,function(){fo.rename(na.join(l.dirname,"".concat(i).concat(a).concat(b)),na.join(l.dirname,"".concat(i,"1").concat(a).concat(b)),h)})}}},{key:"_compressFile",value:function(a,i,h){fo.access(a,fo.F_OK,function(l){if(l)return h();var p=QRe.createGzip(),b=fo.createReadStream(a),g=fo.createWriteStream(i);g.on("finish",function(){fo.unlink(a,h)}),b.pipe(p).pipe(g)})}},{key:"_createLogDirIfNotExist",value:function(a){fo.existsSync(a)||fo.mkdirSync(a,{recursive:!0})}}]),e}(iTe)});var wne={};Ha(wne,{Agent:()=>lTe,ClientRequest:()=>cTe,IncomingMessage:()=>dTe,METHODS:()=>pTe,STATUS_CODES:()=>vTe,default:()=>Cf,get:()=>mTe,globalAgent:()=>gTe,request:()=>bTe});function bne(){if(cne)return Co;cne=!0,Co.fetch=a(Pd.fetch)&&a(Pd.ReadableStream),Co.writableStream=a(Pd.WritableStream),Co.abortController=a(Pd.AbortController);var t;function e(){if(t!==void 0)return t;if(Pd.XMLHttpRequest){t=new Pd.XMLHttpRequest;try{t.open("GET",Pd.XDomainRequest?"/":"https://example.com")}catch{t=null}}else t=null;return t}function r(i){var h=e();if(!h)return!1;try{return h.responseType=i,h.responseType===i}catch{}return!1}Co.arraybuffer=Co.fetch||r("arraybuffer"),Co.msstream=!Co.fetch&&r("ms-stream"),Co.mozchunkedarraybuffer=!Co.fetch&&r("moz-chunked-arraybuffer"),Co.overrideMimeType=Co.fetch||(e()?a(e().overrideMimeType):!1);function a(i){return typeof i=="function"}return t=null,Co}function yne(){if(dne)return B4;dne=!0;var t=ni.Buffer,e=yr,r=bne(),a=Mr(),i=ip(),h=B4.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},l=B4.IncomingMessage=function(p,b,g,y){var M=this||P4;if(i.Readable.call(M),M._mode=g,M.headers={},M.rawHeaders=[],M.trailers={},M.rawTrailers=[],M.on("end",function(){e.nextTick(function(){M.emit("close")})}),g==="fetch"){let L=function(){E.read().then(function(C){if(!M._destroyed){if(y(C.done),C.done){M.push(null);return}M.push(t.from(C.value)),L()}}).catch(function(C){y(!0),M._destroyed||M.emit("error",C)})};var N=L;if(M._fetchResponse=b,M.url=b.url,M.statusCode=b.status,M.statusMessage=b.statusText,b.headers.forEach(function(C,Y){M.headers[Y.toLowerCase()]=C,M.rawHeaders.push(Y,C)}),r.writableStream){var x=new WritableStream({write:function(C){return y(!1),new Promise(function(Y,G){M._destroyed?G():M.push(t.from(C))?Y():M._resumeFetch=Y})},close:function(){y(!0),M._destroyed||M.push(null)},abort:function(C){y(!0),M._destroyed||M.emit("error",C)}});try{b.body.pipeTo(x).catch(function(C){y(!0),M._destroyed||M.emit("error",C)});return}catch{}}var E=b.body.getReader();L()}else{M._xhr=p,M._pos=0,M.url=p.responseURL,M.statusCode=p.status,M.statusMessage=p.statusText;var A=p.getAllResponseHeaders().split(/\r?\n/);if(A.forEach(function(L){var C=L.match(/^([^:]+):\s*(.*)/);if(C){var Y=C[1].toLowerCase();Y==="set-cookie"?(M.headers[Y]===void 0&&(M.headers[Y]=[]),M.headers[Y].push(C[2])):M.headers[Y]!==void 0?M.headers[Y]+=", "+C[2]:M.headers[Y]=C[2],M.rawHeaders.push(C[1],C[2])}}),M._charset="x-user-defined",!r.overrideMimeType){var k=M.rawHeaders["mime-type"];if(k){var P=k.match(/;\s*charset=([^;])(;|$)/);P&&(M._charset=P[1].toLowerCase())}M._charset||(M._charset="utf-8")}}};return a(l,i.Readable),l.prototype._read=function(){var p=this||P4,b=p._resumeFetch;b&&(p._resumeFetch=null,b())},l.prototype._onXHRProgress=function(p){var b=this||P4,g=b._xhr,y=null;switch(b._mode){case"text":if(y=g.responseText,y.length>b._pos){var M=y.substr(b._pos);if(b._charset==="x-user-defined"){for(var x=t.alloc(M.length),E=0;E<M.length;E++)x[E]=M.charCodeAt(E)&255;b.push(x)}else b.push(M,b._charset);b._pos=y.length}break;case"arraybuffer":if(g.readyState!==h.DONE||!g.response)break;y=g.response,b.push(t.from(new Uint8Array(y)));break;case"moz-chunked-arraybuffer":if(y=g.response,g.readyState!==h.LOADING||!y)break;b.push(t.from(new Uint8Array(y)));break;case"ms-stream":if(y=g.response,g.readyState!==h.LOADING)break;var A=new P4.MSStreamReader;A.onprogress=function(){A.result.byteLength>b._pos&&(b.push(t.from(new Uint8Array(A.result.slice(b._pos)))),b._pos=A.result.byteLength)},A.onload=function(){p(!0),b.push(null)},A.readAsArrayBuffer(y);break}b._xhr.readyState===h.DONE&&b._mode!=="ms-stream"&&(p(!0),b.push(null))},B4}function oTe(){if(pne)return tI;pne=!0;var t=ni.Buffer,e=yr,r=bne(),a=Mr(),i=yne(),h=ip(),l=i.IncomingMessage,p=i.readyStates;function b(x,E){return r.fetch&&E?"fetch":r.mozchunkedarraybuffer?"moz-chunked-arraybuffer":r.msstream?"ms-stream":r.arraybuffer&&x?"arraybuffer":"text"}var g=tI=function(x){var E=this||aa;h.Writable.call(E),E._opts=x,E._body=[],E._headers={},x.auth&&E.setHeader("Authorization","Basic "+t.from(x.auth).toString("base64")),Object.keys(x.headers).forEach(function(P){E.setHeader(P,x.headers[P])});var A,k=!0;if(x.mode==="disable-fetch"||"requestTimeout"in x&&!r.abortController)k=!1,A=!0;else if(x.mode==="prefer-streaming")A=!1;else if(x.mode==="allow-wrong-content-type")A=!r.overrideMimeType;else if(!x.mode||x.mode==="default"||x.mode==="prefer-fast")A=!0;else throw new Error("Invalid value for opts.mode");E._mode=b(A,k),E._fetchTimer=null,E._socketTimeout=null,E._socketTimer=null,E.on("finish",function(){E._onFinish()})};a(g,h.Writable),g.prototype.setHeader=function(x,E){var A=this||aa,k=x.toLowerCase();M.indexOf(k)===-1&&(A._headers[k]={name:x,value:E})},g.prototype.getHeader=function(x){var E=(this||aa)._headers[x.toLowerCase()];return E?E.value:null},g.prototype.removeHeader=function(x){var E=this||aa;delete E._headers[x.toLowerCase()]},g.prototype._onFinish=function(){var x=this||aa;if(!x._destroyed){var E=x._opts;"timeout"in E&&E.timeout!==0&&x.setTimeout(E.timeout);var A=x._headers,k=null;E.method!=="GET"&&E.method!=="HEAD"&&(k=new Blob(x._body,{type:(A["content-type"]||{}).value||""}));var P=[];if(Object.keys(A).forEach(function(Y){var G=A[Y].name,ee=A[Y].value;Array.isArray(ee)?ee.forEach(function(D){P.push([G,D])}):P.push([G,ee])}),x._mode==="fetch"){var N=null;if(r.abortController){var L=new AbortController;N=L.signal,x._fetchAbortController=L,"requestTimeout"in E&&E.requestTimeout!==0&&(x._fetchTimer=aa.setTimeout(function(){x.emit("requestTimeout"),x._fetchAbortController&&x._fetchAbortController.abort()},E.requestTimeout))}aa.fetch(x._opts.url,{method:x._opts.method,headers:P,body:k||void 0,mode:"cors",credentials:E.withCredentials?"include":"same-origin",signal:N}).then(function(Y){x._fetchResponse=Y,x._resetTimers(!1),x._connect()},function(Y){x._resetTimers(!0),x._destroyed||x.emit("error",Y)})}else{var C=x._xhr=new aa.XMLHttpRequest;try{C.open(x._opts.method,x._opts.url,!0)}catch(Y){e.nextTick(function(){x.emit("error",Y)});return}"responseType"in C&&(C.responseType=x._mode),"withCredentials"in C&&(C.withCredentials=!!E.withCredentials),x._mode==="text"&&"overrideMimeType"in C&&C.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in E&&(C.timeout=E.requestTimeout,C.ontimeout=function(){x.emit("requestTimeout")}),P.forEach(function(Y){C.setRequestHeader(Y[0],Y[1])}),x._response=null,C.onreadystatechange=function(){switch(C.readyState){case p.LOADING:case p.DONE:x._onXHRProgress();break}},x._mode==="moz-chunked-arraybuffer"&&(C.onprogress=function(){x._onXHRProgress()}),C.onerror=function(){x._destroyed||(x._resetTimers(!0),x.emit("error",new Error("XHR error")))};try{C.send(k)}catch(Y){e.nextTick(function(){x.emit("error",Y)});return}}}};function y(x){try{var E=x.status;return E!==null&&E!==0}catch{return!1}}g.prototype._onXHRProgress=function(){var x=this||aa;x._resetTimers(!1),!(!y(x._xhr)||x._destroyed)&&(x._response||x._connect(),x._response._onXHRProgress(x._resetTimers.bind(x)))},g.prototype._connect=function(){var x=this||aa;x._destroyed||(x._response=new l(x._xhr,x._fetchResponse,x._mode,x._resetTimers.bind(x)),x._response.on("error",function(E){x.emit("error",E)}),x.emit("response",x._response))},g.prototype._write=function(x,E,A){var k=this||aa;k._body.push(x),A()},g.prototype._resetTimers=function(x){var E=this||aa;aa.clearTimeout(E._socketTimer),E._socketTimer=null,x?(aa.clearTimeout(E._fetchTimer),E._fetchTimer=null):E._socketTimeout&&(E._socketTimer=aa.setTimeout(function(){E.emit("timeout")},E._socketTimeout))},g.prototype.abort=g.prototype.destroy=function(x){var E=this||aa;E._destroyed=!0,E._resetTimers(!0),E._response&&(E._response._destroyed=!0),E._xhr?E._xhr.abort():E._fetchAbortController&&E._fetchAbortController.abort(),x&&E.emit("error",x)},g.prototype.end=function(x,E,A){var k=this||aa;typeof x=="function"&&(A=x,x=void 0),h.Writable.prototype.end.call(k,x,E,A)},g.prototype.setTimeout=function(x,E){var A=this||aa;E&&A.once("timeout",E),A._socketTimeout=x,A._resetTimers(!1)},g.prototype.flushHeaders=function(){},g.prototype.setNoDelay=function(){},g.prototype.setSocketKeepAlive=function(){};var M=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"];return tI}function sTe(){if(vne)return rI;vne=!0,rI=e;var t=Object.prototype.hasOwnProperty;function e(){for(var r={},a=0;a<arguments.length;a++){var i=arguments[a];for(var h in i)t.call(i,h)&&(r[h]=i[h])}return r}return rI}function fTe(){return mne||(mne=!0,iI={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}),iI}function hTe(){if(gne)return nI;gne=!0;var t=oTe(),e=yne(),r=sTe(),a=fTe(),i=vi,h=nI;return h.request=function(l,p){typeof l=="string"?l=i.parse(l):l=r(l);var b=uTe.location.protocol.search(/^https?:$/)===-1?"http:":"",g=l.protocol||b,y=l.hostname||l.host,M=l.port,x=l.path||"/";y&&y.indexOf(":")!==-1&&(y="["+y+"]"),l.url=(y?g+"//"+y:"")+(M?":"+M:"")+x,l.method=(l.method||"GET").toUpperCase(),l.headers=l.headers||{};var E=new t(l);return p&&E.on("response",p),E},h.get=function(p,b){var g=h.request(p,b);return g.end(),g},h.ClientRequest=t,h.IncomingMessage=e.IncomingMessage,h.Agent=function(){},h.Agent.defaultMaxSockets=4,h.globalAgent=new h.Agent,h.STATUS_CODES=a,h.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"],nI}var Co,cne,Pd,B4,dne,P4,tI,pne,aa,rI,vne,iI,mne,nI,gne,uTe,Cf,lTe,cTe,dTe,pTe,vTe,mTe,gTe,bTe,aI=Si(()=>{"use strict";ie();ae();ne();oh();oy();Ws();f4();Ks();rh();jo();Uo();Yf();Jg();Qg();Rd();Co={},cne=!1,Pd=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;B4={},dne=!1,P4=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;tI={},pne=!1,aa=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;rI={},vne=!1;iI={},mne=!1;nI={},gne=!1,uTe=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;Cf=hTe(),lTe=Cf.Agent,cTe=Cf.ClientRequest,dTe=Cf.IncomingMessage,pTe=Cf.METHODS,vTe=Cf.STATUS_CODES,mTe=Cf.get,gTe=Cf.globalAgent,bTe=Cf.request});var xne={};Ha(xne,{Agent:()=>wTe,ClientRequest:()=>_Te,IncomingMessage:()=>MTe,METHODS:()=>xTe,STATUS_CODES:()=>STe,default:()=>zh,get:()=>ETe,globalAgent:()=>ATe,request:()=>RTe});function yTe(){if(_ne)return oI;_ne=!0;var t=Cf,e=vi,r=oI;for(var a in t)t.hasOwnProperty(a)&&(r[a]=t[a]);r.request=function(h,l){return h=i(h),t.request.call(this||Mne,h,l)},r.get=function(h,l){return h=i(h),t.get.call(this||Mne,h,l)};function i(h){if(typeof h=="string"&&(h=e.parse(h)),h.protocol||(h.protocol="https:"),h.protocol!=="https:")throw new Error('Protocol "'+h.protocol+'" not supported. Expected "https:"');return h}return oI}var oI,_ne,Mne,zh,wTe,_Te,MTe,xTe,STe,ETe,ATe,RTe,Sne=Si(()=>{"use strict";ie();ae();ne();aI();f4();oh();Ks();rh();jo();Uo();Ws();Yf();oy();Jg();Qg();Rd();oI={},_ne=!1,Mne=typeof globalThis<"u"?globalThis:typeof self<"u"?self:global;zh=yTe(),wTe=zh.Agent,_Te=zh.ClientRequest,MTe=zh.IncomingMessage,xTe=zh.METHODS,STe=zh.STATUS_CODES,ETe=zh.get,ATe=zh.globalAgent,RTe=zh.request});var Ine=ht((q1t,kne)=>{"use strict";ie();ae();ne();function j1(t){"@babel/helpers - typeof";return j1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},j1(t)}function Ene(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(t);e&&(a=a.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,a)}return r}function sI(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Ene(Object(r),!0).forEach(function(a){TTe(t,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ene(Object(r)).forEach(function(a){Object.defineProperty(t,a,Object.getOwnPropertyDescriptor(r,a))})}return t}function TTe(t,e,r){return e=Rne(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function kTe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ane(t,e){for(var r=0;r<e.length;r++){var a=e[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,Rne(a.key),a)}}function ITe(t,e,r){return e&&Ane(t.prototype,e),r&&Ane(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Rne(t){var e=BTe(t,"string");return j1(e)=="symbol"?e:String(e)}function BTe(t,e){if(j1(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e||"default");if(j1(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function PTe(t,e,r){return e=O4(e),OTe(t,Tne()?Reflect.construct(e,r||[],O4(t).constructor):e.apply(t,r))}function OTe(t,e){if(e&&(j1(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return NTe(t)}function NTe(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Tne(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Tne=function(){return!!t})()}function O4(t){return O4=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},O4(t)}function CTe(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&fI(t,e)}function fI(t,e){return fI=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,i){return a.__proto__=i,a},fI(t,e)}var LTe=(aI(),ei(wne)),DTe=(Sne(),ei(xne)),$Te=Oh(),qTe=$Te.Stream,UTe=O1(),FTe=k1(),jTe=FTe.configure;kne.exports=function(t){CTe(e,t);function e(){var r,a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return kTe(this,e),r=PTe(this,e,[a]),r.options=a,r.name=a.name||"http",r.ssl=!!a.ssl,r.host=a.host||"localhost",r.port=a.port,r.auth=a.auth,r.path=a.path||"",r.maximumDepth=a.maximumDepth,r.agent=a.agent,r.headers=a.headers||{},r.headers["content-type"]="application/json",r.batch=a.batch||!1,r.batchInterval=a.batchInterval||5e3,r.batchCount=a.batchCount||10,r.batchOptions=[],r.batchTimeoutID=-1,r.batchCallback={},r.port||(r.port=r.ssl?443:80),r}return ITe(e,[{key:"log",value:function(a,i){var h=this;this._request(a,null,null,function(l,p){p&&p.statusCode!==200&&(l=new Error("Invalid HTTP Status Code: ".concat(p.statusCode))),l?h.emit("warn",l):h.emit("logged",a)}),i&&setImmediate(i)}},{key:"query",value:function(a,i){typeof a=="function"&&(i=a,a={}),a={method:"query",params:this.normalizeQuery(a)};var h=a.params.auth||null;delete a.params.auth;var l=a.params.path||null;delete a.params.path,this._request(a,h,l,function(p,b,g){if(b&&b.statusCode!==200&&(p=new Error("Invalid HTTP Status Code: ".concat(b.statusCode))),p)return i(p);if(typeof g=="string")try{g=JSON.parse(g)}catch(y){return i(y)}i(null,g)})}},{key:"stream",value:function(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},i=new qTe;a={method:"stream",params:a};var h=a.params.path||null;delete a.params.path;var l=a.params.auth||null;delete a.params.auth;var p="",b=this._request(a,l,h);return i.destroy=function(){return b.destroy()},b.on("data",function(g){g=(p+g).split(/\n+/);for(var y=g.length-1,M=0;M<y;M++)try{i.emit("log",JSON.parse(g[M]))}catch(x){i.emit("error",x)}p=g[y]}),b.on("error",function(g){return i.emit("error",g)}),i}},{key:"_request",value:function(a,i,h,l){a=a||{},i=i||this.auth,h=h||this.path||"",this.batch?this._doBatch(a,l,i,h):this._doRequest(a,l,i,h)}},{key:"_doBatch",value:function(a,i,h,l){if(this.batchOptions.push(a),this.batchOptions.length===1){var p=this;this.batchCallback=i,this.batchTimeoutID=setTimeout(function(){p.batchTimeoutID=-1,p._doBatchRequest(p.batchCallback,h,l)},this.batchInterval)}this.batchOptions.length===this.batchCount&&this._doBatchRequest(this.batchCallback,h,l)}},{key:"_doBatchRequest",value:function(a,i,h){this.batchTimeoutID>0&&(clearTimeout(this.batchTimeoutID),this.batchTimeoutID=-1);var l=this.batchOptions.slice();this.batchOptions=[],this._doRequest(l,a,i,h)}},{key:"_doRequest",value:function(a,i,h,l){var p=Object.assign({},this.headers);h&&h.bearer&&(p.Authorization="Bearer ".concat(h.bearer));var b=(this.ssl?DTe:LTe).request(sI(sI({},this.options),{},{method:"POST",host:this.host,port:this.port,path:"/".concat(l.replace(/^\//,"")),headers:p,auth:h&&h.username&&h.password?"".concat(h.username,":").concat(h.password):"",agent:this.agent}));b.on("error",i),b.on("response",function(y){return y.on("end",function(){return i(null,y)}).resume()});var g=jTe(sI({},this.maximumDepth&&{maximumDepth:this.maximumDepth}));b.end(Me.from(g(a,this.options.replacer),"utf8"))}}]),e}(UTe)});var uI=ht((z1t,Bne)=>{"use strict";ie();ae();ne();var qu=t=>t!==null&&typeof t=="object"&&typeof t.pipe=="function";qu.writable=t=>qu(t)&&t.writable!==!1&&typeof t._write=="function"&&typeof t._writableState=="object";qu.readable=t=>qu(t)&&t.readable!==!1&&typeof t._read=="function"&&typeof t._readableState=="object";qu.duplex=t=>qu.writable(t)&&qu.readable(t);qu.transform=t=>qu.duplex(t)&&typeof t._transform=="function";Bne.exports=qu});var Cne=ht((W1t,Nne)=>{"use strict";ie();ae();ne();function z1(t){"@babel/helpers - typeof";return z1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},z1(t)}function zTe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Pne(t,e){for(var r=0;r<e.length;r++){var a=e[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,HTe(a.key),a)}}function ZTe(t,e,r){return e&&Pne(t.prototype,e),r&&Pne(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function HTe(t){var e=KTe(t,"string");return z1(e)=="symbol"?e:String(e)}function KTe(t,e){if(z1(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e||"default");if(z1(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function WTe(t,e,r){return e=N4(e),VTe(t,One()?Reflect.construct(e,r||[],N4(t).constructor):e.apply(t,r))}function VTe(t,e){if(e&&(z1(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return GTe(t)}function GTe(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function One(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(One=function(){return!!t})()}function N4(t){return N4=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},N4(t)}function YTe(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&hI(t,e)}function hI(t,e){return hI=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,i){return a.__proto__=i,a},hI(t,e)}var JTe=uI(),XTe=sn(),QTe=XTe.MESSAGE,eke=(yd(),ei(bd)),tke=O1();Nne.exports=function(t){YTe(e,t);function e(){var r,a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(zTe(this,e),r=WTe(this,e,[a]),!a.stream||!JTe(a.stream))throw new Error("options.stream is required.");return r._stream=a.stream,r._stream.setMaxListeners(1/0),r.isObjectMode=a.stream._writableState.objectMode,r.eol=typeof a.eol=="string"?a.eol:eke.EOL,r}return ZTe(e,[{key:"log",value:function(a,i){var h=this;if(setImmediate(function(){return h.emit("logged",a)}),this.isObjectMode){this._stream.write(a),i&&i();return}this._stream.write("".concat(a[QTe]).concat(this.eol)),i&&i()}}]),e}(tke)});var Lne=ht(f2=>{"use strict";ie();ae();ne();Object.defineProperty(f2,"Console",{configurable:!0,enumerable:!0,get:function(){return gte()}});Object.defineProperty(f2,"File",{configurable:!0,enumerable:!0,get:function(){return lne()}});Object.defineProperty(f2,"Http",{configurable:!0,enumerable:!0,get:function(){return Ine()}});Object.defineProperty(f2,"Stream",{configurable:!0,enumerable:!0,get:function(){return Cne()}})});var L4=ht(u2=>{"use strict";ie();ae();ne();var C4=JT(),rke=sn(),lI=rke.configs;u2.cli=C4.levels(lI.cli);u2.npm=C4.levels(lI.npm);u2.syslog=C4.levels(lI.syslog);u2.addColors=C4.levels});var $ne=ht((D4,Dne)=>{"use strict";ie();ae();ne();Object.defineProperty(D4,"__esModule",{value:!0});var ike=d4(),nke=Od(ike),ake=x4(),oke=Od(ake),ske=qk(),fke=Od(ske),uke=Lk(),hke=Od(uke),lke=Dk(),cke=Od(lke),dke=Id(),pke=Od(dke),vke=U1(),mke=Od(vke);function Od(t){return t&&t.__esModule?t:{default:t}}function gke(t,e,r){r=(0,hke.default)(r);var a=0,i=0,{length:h}=t,l=!1;h===0&&r(null);function p(b,g){b===!1&&(l=!0),l!==!0&&(b?r(b):(++i===h||g===oke.default)&&r(null))}for(;a<h;a++)e(t[a],a,(0,cke.default)(p))}function bke(t,e,r){return(0,fke.default)(t,1/0,e,r)}function yke(t,e,r){var a=(0,nke.default)(t)?gke:bke;return a(t,(0,pke.default)(e),r)}D4.default=(0,mke.default)(yke,3);Dne.exports=D4.default});var Une=ht(($4,qne)=>{"use strict";ie();ae();ne();Object.defineProperty($4,"__esModule",{value:!0});$4.default=wke;function wke(t){return(e,r,a)=>t(e,a)}qne.exports=$4.default});var F4=ht((U4,Fne)=>{"use strict";ie();ae();ne();Object.defineProperty(U4,"__esModule",{value:!0});var _ke=$ne(),Mke=q4(_ke),xke=Une(),Ske=q4(xke),Eke=Id(),Ake=q4(Eke),Rke=U1(),Tke=q4(Rke);function q4(t){return t&&t.__esModule?t:{default:t}}function kke(t,e,r){return(0,Mke.default)(t,(0,Ske.default)((0,Ake.default)(e)),r)}U4.default=(0,Tke.default)(kke,3);Fne.exports=U4.default});var zne=ht((pvt,jne)=>{"use strict";ie();ae();ne();var Ike=Object.prototype.toString;jne.exports=function(e){if(typeof e.displayName=="string"&&e.constructor.name)return e.displayName;if(typeof e.name=="string"&&e.name)return e.name;if(typeof e=="object"&&e.constructor&&typeof e.constructor.name=="string")return e.constructor.name;var r=e.toString(),a=Ike.call(e).slice(8,-1);return a==="Function"?r=r.substring(r.indexOf("(")+1,r.indexOf(")")):r=a,r||"anonymous"}});var cI=ht((bvt,Zne)=>{"use strict";ie();ae();ne();var Bke=zne();Zne.exports=function(e){var r=0,a;function i(){return r||(r=1,a=e.apply(this,arguments),e=null),a}return i.displayName=Bke(e),i}});var dI=ht(l2=>{"use strict";ie();ae();ne();l2.get=function(t){var e=Error.stackTraceLimit;Error.stackTraceLimit=1/0;var r={},a=Error.prepareStackTrace;Error.prepareStackTrace=function(h,l){return l},Error.captureStackTrace(r,t||l2.get);var i=r.stack;return Error.prepareStackTrace=a,Error.stackTraceLimit=e,i};l2.parse=function(t){if(!t.stack)return[];var e=this,r=t.stack.split(`
114
114
  `).slice(1);return r.map(function(a){if(a.match(/^\s*[-]{4,}$/))return e._createParsedCallSite({fileName:a,lineNumber:null,functionName:null,typeName:null,methodName:null,columnNumber:null,native:null});var i=a.match(/at (?:(.+)\s+\()?(?:(.+?):(\d+)(?::(\d+))?|([^)]+))\)?/);if(i){var h=null,l=null,p=null,b=null,g=null,y=i[5]==="native";if(i[1]){p=i[1];var M=p.lastIndexOf(".");if(p[M-1]=="."&&M--,M>0){h=p.substr(0,M),l=p.substr(M+1);var x=h.indexOf(".Module");x>0&&(p=p.substr(x+1),h=h.substr(0,x))}b=null}l&&(b=h,g=l),l==="<anonymous>"&&(g=null,p=null);var E={fileName:i[2]||null,lineNumber:parseInt(i[3],10)||null,functionName:p,typeName:b,methodName:g,columnNumber:parseInt(i[4],10)||null,native:y};return e._createParsedCallSite(E)}}).filter(function(a){return!!a})};function h2(t){for(var e in t)this[e]=t[e]}var Pke=["this","typeName","functionName","methodName","fileName","lineNumber","columnNumber","function","evalOrigin"],Oke=["topLevel","eval","native","constructor"];Pke.forEach(function(t){h2.prototype[t]=null,h2.prototype["get"+t[0].toUpperCase()+t.substr(1)]=function(){return this[t]}});Oke.forEach(function(t){h2.prototype[t]=!1,h2.prototype["is"+t[0].toUpperCase()+t.substr(1)]=function(){return this[t]}});l2._createParsedCallSite=function(t){return new h2(t)}});var Vne=ht((Avt,Wne)=>{"use strict";ie();ae();ne();function Z1(t){"@babel/helpers - typeof";return Z1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Z1(t)}function Nke(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Hne(t,e){for(var r=0;r<e.length;r++){var a=e[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,Lke(a.key),a)}}function Cke(t,e,r){return e&&Hne(t.prototype,e),r&&Hne(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Lke(t){var e=Dke(t,"string");return Z1(e)=="symbol"?e:String(e)}function Dke(t,e){if(Z1(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e||"default");if(Z1(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function $ke(t,e,r){return e=j4(e),qke(t,Kne()?Reflect.construct(e,r||[],j4(t).constructor):e.apply(t,r))}function qke(t,e){if(e&&(Z1(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Uke(t)}function Uke(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Kne(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Kne=function(){return!!t})()}function j4(t){return j4=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},j4(t)}function Fke(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&pI(t,e)}function pI(t,e){return pI=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,i){return a.__proto__=i,a},pI(t,e)}var jke=Oh(),zke=jke.Writable;Wne.exports=function(t){Fke(e,t);function e(r){var a;if(Nke(this,e),a=$ke(this,e,[{objectMode:!0}]),!r)throw new Error("ExceptionStream requires a TransportStream instance.");return a.handleExceptions=!0,a.transport=r,a}return Cke(e,[{key:"_write",value:function(a,i,h){return a.exception?this.transport.log(a,h):(h(),!0)}}]),e}(zke)});var mI=ht((Ivt,Xne)=>{"use strict";ie();ae();ne();function c2(t){"@babel/helpers - typeof";return c2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},c2(t)}function Zke(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Gne(t,e){for(var r=0;r<e.length;r++){var a=e[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,Kke(a.key),a)}}function Hke(t,e,r){return e&&Gne(t.prototype,e),r&&Gne(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Kke(t){var e=Wke(t,"string");return c2(e)=="symbol"?e:String(e)}function Wke(t,e){if(c2(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e||"default");if(c2(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Yne=(yd(),ei(bd)),Vke=F4(),vI=s2()("winston:exception"),Gke=cI(),Jne=dI(),Yke=Vne();Xne.exports=function(){function t(e){if(Zke(this,t),!e)throw new Error("Logger is required to handle exceptions");this.logger=e,this.handlers=new Map}return Hke(t,[{key:"handle",value:function(){for(var r=this,a=arguments.length,i=new Array(a),h=0;h<a;h++)i[h]=arguments[h];i.forEach(function(l){if(Array.isArray(l))return l.forEach(function(p){return r._addHandler(p)});r._addHandler(l)}),this.catcher||(this.catcher=this._uncaughtException.bind(this),He.on("uncaughtException",this.catcher))}},{key:"unhandle",value:function(){var r=this;this.catcher&&(He.removeListener("uncaughtException",this.catcher),this.catcher=!1,Array.from(this.handlers.values()).forEach(function(a){return r.logger.unpipe(a)}))}},{key:"getAllInfo",value:function(r){var a=null;return r&&(a=typeof r=="string"?r:r.message),{error:r,level:"error",message:["uncaughtException: ".concat(a||"(no error message)"),r&&r.stack||" No stack trace"].join(`
115
115
  `),stack:r&&r.stack,exception:!0,date:new Date().toString(),process:this.getProcessInfo(),os:this.getOsInfo(),trace:this.getTrace(r)}}},{key:"getProcessInfo",value:function(){return{pid:He.pid,uid:He.getuid?He.getuid():null,gid:He.getgid?He.getgid():null,cwd:He.cwd(),execPath:He.execPath,version:He.version,argv:He.argv,memoryUsage:He.memoryUsage()}}},{key:"getOsInfo",value:function(){return{loadavg:Yne.loadavg(),uptime:Yne.uptime()}}},{key:"getTrace",value:function(r){var a=r?Jne.parse(r):Jne.get();return a.map(function(i){return{column:i.getColumnNumber(),file:i.getFileName(),function:i.getFunctionName(),line:i.getLineNumber(),method:i.getMethodName(),native:i.isNative()}})}},{key:"_addHandler",value:function(r){if(!this.handlers.has(r)){r.handleExceptions=!0;var a=new Yke(r);this.handlers.set(r,a),this.logger.pipe(a)}}},{key:"_uncaughtException",value:function(r){var a=this.getAllInfo(r),i=this._getExceptionHandlers(),h=typeof this.logger.exitOnError=="function"?this.logger.exitOnError(r):this.logger.exitOnError,l;!i.length&&h&&(console.warn("winston: exitOnError cannot be true with no exception handlers."),console.warn("winston: not exiting process."),h=!1);function p(){vI("doExit",h),vI("process._exiting",He._exiting),h&&!He._exiting&&(l&&clearTimeout(l),He.exit(1))}if(!i||i.length===0)return He.nextTick(p);Vke(i,function(b,g){var y=Gke(g),M=b.transport||b;function x(E){return function(){vI(E),y()}}M._ending=!0,M.once("finish",x("finished")),M.once("error",x("error"))},function(){return h&&p()}),this.logger.log(a),h&&(l=setTimeout(p,3e3))}},{key:"_getExceptionHandlers",value:function(){return this.logger.transports.filter(function(r){var a=r.transport||r;return a.handleExceptions})}}]),t}()});var rae=ht((Nvt,tae)=>{"use strict";ie();ae();ne();function H1(t){"@babel/helpers - typeof";return H1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},H1(t)}function Jke(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Qne(t,e){for(var r=0;r<e.length;r++){var a=e[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,Qke(a.key),a)}}function Xke(t,e,r){return e&&Qne(t.prototype,e),r&&Qne(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Qke(t){var e=eIe(t,"string");return H1(e)=="symbol"?e:String(e)}function eIe(t,e){if(H1(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e||"default");if(H1(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function tIe(t,e,r){return e=z4(e),rIe(t,eae()?Reflect.construct(e,r||[],z4(t).constructor):e.apply(t,r))}function rIe(t,e){if(e&&(H1(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return iIe(t)}function iIe(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function eae(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(eae=function(){return!!t})()}function z4(t){return z4=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},z4(t)}function nIe(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&gI(t,e)}function gI(t,e){return gI=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,i){return a.__proto__=i,a},gI(t,e)}var aIe=Oh(),oIe=aIe.Writable;tae.exports=function(t){nIe(e,t);function e(r){var a;if(Jke(this,e),a=tIe(this,e,[{objectMode:!0}]),!r)throw new Error("RejectionStream requires a TransportStream instance.");return a.handleRejections=!0,a.transport=r,a}return Xke(e,[{key:"_write",value:function(a,i,h){return a.rejection?this.transport.log(a,h):(h(),!0)}}]),e}(oIe)});var yI=ht(($vt,oae)=>{"use strict";ie();ae();ne();function d2(t){"@babel/helpers - typeof";return d2=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},d2(t)}function sIe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function iae(t,e){for(var r=0;r<e.length;r++){var a=e[r];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,uIe(a.key),a)}}function fIe(t,e,r){return e&&iae(t.prototype,e),r&&iae(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function uIe(t){var e=hIe(t,"string");return d2(e)=="symbol"?e:String(e)}function hIe(t,e){if(d2(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var a=r.call(t,e||"default");if(d2(a)!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var nae=(yd(),ei(bd)),lIe=F4(),bI=s2()("winston:rejection"),cIe=cI(),aae=dI(),dIe=rae();oae.exports=function(){function t(e){if(sIe(this,t),!e)throw new Error("Logger is required to handle rejections");this.logger=e,this.handlers=new Map}return fIe(t,[{key:"handle",value:function(){for(var r=this,a=arguments.length,i=new Array(a),h=0;h<a;h++)i[h]=arguments[h];i.forEach(function(l){if(Array.isArray(l))return l.forEach(function(p){return r._addHandler(p)});r._addHandler(l)}),this.catcher||(this.catcher=this._unhandledRejection.bind(this),He.on("unhandledRejection",this.catcher))}},{key:"unhandle",value:function(){var r=this;this.catcher&&(He.removeListener("unhandledRejection",this.catcher),this.catcher=!1,Array.from(this.handlers.values()).forEach(function(a){return r.logger.unpipe(a)}))}},{key:"getAllInfo",value:function(r){var a=null;return r&&(a=typeof r=="string"?r:r.message),{error:r,level:"error",message:["unhandledRejection: ".concat(a||"(no error message)"),r&&r.stack||" No stack trace"].join(`
116
116
  `),stack:r&&r.stack,rejection:!0,date:new Date().toString(),process:this.getProcessInfo(),os:this.getOsInfo(),trace:this.getTrace(r)}}},{key:"getProcessInfo",value:function(){return{pid:He.pid,uid:He.getuid?He.getuid():null,gid:He.getgid?He.getgid():null,cwd:He.cwd(),execPath:He.execPath,version:He.version,argv:He.argv,memoryUsage:He.memoryUsage()}}},{key:"getOsInfo",value:function(){return{loadavg:nae.loadavg(),uptime:nae.uptime()}}},{key:"getTrace",value:function(r){var a=r?aae.parse(r):aae.get();return a.map(function(i){return{column:i.getColumnNumber(),file:i.getFileName(),function:i.getFunctionName(),line:i.getLineNumber(),method:i.getMethodName(),native:i.isNative()}})}},{key:"_addHandler",value:function(r){if(!this.handlers.has(r)){r.handleRejections=!0;var a=new dIe(r);this.handlers.set(r,a),this.logger.pipe(a)}}},{key:"_unhandledRejection",value:function(r){var a=this.getAllInfo(r),i=this._getRejectionHandlers(),h=typeof this.logger.exitOnError=="function"?this.logger.exitOnError(r):this.logger.exitOnError,l;!i.length&&h&&(console.warn("winston: exitOnError cannot be true with no rejection handlers."),console.warn("winston: not exiting process."),h=!1);function p(){bI("doExit",h),bI("process._exiting",He._exiting),h&&!He._exiting&&(l&&clearTimeout(l),He.exit(1))}if(!i||i.length===0)return He.nextTick(p);lIe(i,function(b,g){var y=cIe(g),M=b.transport||b;function x(E){return function(){bI(E),y()}}M._ending=!0,M.once("finish",x("finished")),M.once("error",x("error"))},function(){return h&&p()}),this.logger.log(a),h&&(l=setTimeout(p,3e3))}},{key:"_getRejectionHandlers",value:function(){return this.logger.transports.filter(function(r){var a=r.transport||r;return a.handleRejections})}}]),t}()});var hae=ht((jvt,uae)=>{"use strict";ie();ae();ne();var pIe=(no(),ei(Rf)),sae=og(),{LEVEL:fae}=sn(),p2=uae.exports=function(e={}){sae.call(this,{objectMode:!0,highWaterMark:e.highWaterMark}),this.format=e.format,this.level=e.level,this.handleExceptions=e.handleExceptions,this.handleRejections=e.handleRejections,this.silent=e.silent,e.log&&(this.log=e.log),e.logv&&(this.logv=e.logv),e.close&&(this.close=e.close),this.once("pipe",r=>{this.levels=r.levels,this.parent=r}),this.once("unpipe",r=>{r===this.parent&&(this.parent=null,this.close&&this.close())})};pIe.inherits(p2,sae);p2.prototype._write=function(e,r,a){if(this.silent||e.exception===!0&&!this.handleExceptions)return a(null);let i=this.level||this.parent&&this.parent.level;if(!i||this.levels[i]>=this.levels[e[fae]]){if(e&&!this.format)return this.log(e,a);let h,l;try{l=this.format.transform(Object.assign({},e),this.format.options)}catch(p){h=p}if(h||!l){if(a(),h)throw h;return}return this.log(l,a)}return this._writableState.sync=!1,a(null)};p2.prototype._writev=function(e,r){if(this.logv){let a=e.filter(this._accept,this);return a.length?this.logv(a,r):r(null)}for(let a=0;a<e.length;a++){if(!this._accept(e[a]))continue;if(e[a].chunk&&!this.format){this.log(e[a].chunk,e[a].callback);continue}let i,h;try{h=this.format.transform(Object.assign({},e[a].chunk),this.format.options)}catch(l){i=l}if(i||!h){if(e[a].callback(),i)throw r(null),i}else this.log(h,e[a].callback)}return r(null)};p2.prototype._accept=function(e){let r=e.chunk;if(this.silent)return!1;let a=this.level||this.parent&&this.parent.level;return!!((r.exception===!0||!a||this.levels[a]>=this.levels[r[fae]])&&(this.handleExceptions||r.exception!==!0))};p2.prototype._nop=function(){}});var dae=ht((Kvt,cae)=>{"use strict";ie();ae();ne();var vIe=(no(),ei(Rf)),{LEVEL:wI}=sn(),lae=hae(),v2=cae.exports=function(e={}){if(lae.call(this,e),!e.transport||typeof e.transport.log!="function")throw new Error("Invalid transport, must be an object with a log method.");this.transport=e.transport,this.level=this.level||e.transport.level,this.handleExceptions=this.handleExceptions||e.transport.handleExceptions,this._deprecated();function r(a){this.emit("error",a,this.transport)}this.transport.__winstonError||(this.transport.__winstonError=r.bind(this),this.transport.on("error",this.transport.__winstonError))};vIe.inherits(v2,lae);v2.prototype._write=function(e,r,a){if(this.silent||e.exception===!0&&!this.handleExceptions)return a(null);(!this.level||this.levels[this.level]>=this.levels[e[wI]])&&this.transport.log(e[wI],e.message,e,this._nop),a(null)};v2.prototype._writev=function(e,r){for(let a=0;a<e.length;a++)this._accept(e[a])&&(this.transport.log(e[a].chunk[wI],e[a].chunk.message,e[a].chunk,this._nop),e[a].callback());return r(null)};v2.prototype._deprecated=function(){console.error([`${this.transport.name} is a legacy winston transport. Consider upgrading: `,"- Upgrade docs: https://github.com/winstonjs/winston/blob/master/UPGRADE-3.0.md"].join(`
@@ -124,12 +124,12 @@ Found: ${e.toString().split(`
124
124
  -----END RSA `+a+` KEY-----
125
125
  `,l=Me.alloc(0);r?(e.version="two-prime",l=efe.encode(e,"der")):l=Jse.encode(e,"der");var p=l.toString("base64").match(/.{1,64}/g).join(`
126
126
  `);return i+p+h}js.jwkTopem=V$e});var ofe=ht(Qh=>{"use strict";ie();ae();ne();var G$e=Qh&&Qh.__createBinding||(Object.create?function(t,e,r,a){a===void 0&&(a=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,a,i)}:function(t,e,r,a){a===void 0&&(a=r),t[a]=e[r]}),Y$e=Qh&&Qh.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),J$e=Qh&&Qh.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&G$e(e,t,r);return Y$e(e,t),e};Object.defineProperty(Qh,"__esModule",{value:!0});var afe=nfe(),zs=J$e((du(),ei(Mm))),FB=class{keyLength=4096;publicExponent=65537;hashAlgorithm="sha256";encryptionAlgorithm="aes-256-cbc";generateJWK(){if(typeof zs.generateKeyPair!="function")throw new Error("Keypair generation not supported in this version of Node, only supported in versions 10+");return new Promise((e,r)=>{zs.generateKeyPair("rsa",{modulusLength:this.keyLength,publicExponent:this.publicExponent,privateKeyEncoding:{type:"pkcs1",format:"pem"},publicKeyEncoding:{type:"pkcs1",format:"pem"}},(a,i,h)=>{a&&r(a),e(this.pemToJWK(h))})})}sign(e,r,{saltLength:a}={}){return new Promise((i,h)=>{i(zs.createSign(this.hashAlgorithm).update(r).sign({key:this.jwkToPem(e),padding:zs.constants.RSA_PKCS1_PSS_PADDING,saltLength:a}))})}verify(e,r,a){return new Promise((i,h)=>{let l={kty:"RSA",e:"AQAB",n:e},p=this.jwkToPem(l);i(zs.createVerify(this.hashAlgorithm).update(r).verify({key:p,padding:zs.constants.RSA_PKCS1_PSS_PADDING},a))})}hash(e,r="SHA-256"){if(typeof e=="string")throw new TypeError("Data must be a Uint8Array");return new Promise((a,i)=>{a(zs.createHash(this.parseHashAlgorithm(r)).update(e).digest())})}async encrypt(e,r,a){let i=zs.pbkdf2Sync(r,a=a||"salt",1e5,32,this.hashAlgorithm),h=zs.randomBytes(16),l=zs.createCipheriv(this.encryptionAlgorithm,i,h);return Me.concat([h,l.update(e),l.final()])}async decrypt(e,r,a){try{let i=zs.pbkdf2Sync(r,a=a||"salt",1e5,32,this.hashAlgorithm),h=e.slice(0,16),l=e.slice(16),p=zs.createDecipheriv(this.encryptionAlgorithm,i,h);return Me.concat([p.update(l),p.final()])}catch{throw new Error("Failed to decrypt")}}jwkToPem(e){return(0,afe.jwkTopem)(e)}pemToJWK(e){return(0,afe.pemTojwk)(e)}parseHashAlgorithm(e){switch(e){case"SHA-256":return"sha256";case"SHA-384":return"sha384";default:throw new Error(`Algorithm not supported: ${e}`)}}};Qh.default=FB});var sfe=ht(zB=>{"use strict";ie();ae();ne();Object.defineProperty(zB,"__esModule",{value:!0});var jB=class{api;constructor(e){this.api=e}getInfo(){return this.api.get("info").then(e=>e.data)}getPeers(){return this.api.get("peers").then(e=>e.data)}};zB.default=jB});var mb=ht(vb=>{"use strict";ie();ae();ne();Object.defineProperty(vb,"__esModule",{value:!0});vb.getError=void 0;var ZB=class extends Error{type;response;constructor(e,r={}){r.message?super(r.message):super(),this.type=e,this.response=r.response}getType(){return this.type}};vb.default=ZB;function X$e(t){let e=t.data;if(typeof t.data=="string")try{e=JSON.parse(t.data)}catch{}if(t.data instanceof ArrayBuffer||t.data instanceof Uint8Array)try{e=JSON.parse(e.toString())}catch{}return e?e.error||e:t.statusText||"unknown"}vb.getError=X$e});var el=ht($i=>{"use strict";ie();ae();ne();var Q$e=$i&&$i.__createBinding||(Object.create?function(t,e,r,a){a===void 0&&(a=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,a,i)}:function(t,e,r,a){a===void 0&&(a=r),t[a]=e[r]}),eqe=$i&&$i.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),tqe=$i&&$i.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&Q$e(e,t,r);return eqe(e,t),e};Object.defineProperty($i,"__esModule",{value:!0});$i.b64UrlDecode=$i.b64UrlEncode=$i.bufferTob64Url=$i.bufferTob64=$i.b64UrlToBuffer=$i.stringToB64Url=$i.stringToBuffer=$i.bufferToString=$i.b64UrlToString=$i.concatBuffers=void 0;var ffe=tqe(pE());function rqe(t){let e=0;for(let i=0;i<t.length;i++)e+=t[i].byteLength;let r=new Uint8Array(e),a=0;r.set(new Uint8Array(t[0]),a),a+=t[0].byteLength;for(let i=1;i<t.length;i++)r.set(new Uint8Array(t[i]),a),a+=t[i].byteLength;return r}$i.concatBuffers=rqe;function iqe(t){let e=lfe(t);return ufe(e)}$i.b64UrlToString=iqe;function ufe(t){return new TextDecoder("utf-8",{fatal:!0}).decode(t)}$i.bufferToString=ufe;function hfe(t){return new TextEncoder().encode(t)}$i.stringToBuffer=hfe;function nqe(t){return dfe(hfe(t))}$i.stringToB64Url=nqe;function lfe(t){return new Uint8Array(ffe.toByteArray(vfe(t)))}$i.b64UrlToBuffer=lfe;function cfe(t){return ffe.fromByteArray(new Uint8Array(t))}$i.bufferTob64=cfe;function dfe(t){return pfe(cfe(t))}$i.bufferTob64Url=dfe;function pfe(t){return t.replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")}$i.b64UrlEncode=pfe;function vfe(t){t=t.replace(/\-/g,"+").replace(/\_/g,"/");let e;return t.length%4==0?e=0:e=4-t.length%4,t.concat("=".repeat(e))}$i.b64UrlDecode=vfe});var bfe=ht(gb=>{"use strict";ie();ae();ne();var aqe=gb&&gb.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(gb,"__esModule",{value:!0});var Do=aqe(Nw());async function mfe(t){if(Array.isArray(t)){let a=Do.default.utils.concatBuffers([Do.default.utils.stringToBuffer("list"),Do.default.utils.stringToBuffer(t.length.toString())]);return await gfe(t,await Do.default.crypto.hash(a,"SHA-384"))}let e=Do.default.utils.concatBuffers([Do.default.utils.stringToBuffer("blob"),Do.default.utils.stringToBuffer(t.byteLength.toString())]),r=Do.default.utils.concatBuffers([await Do.default.crypto.hash(e,"SHA-384"),await Do.default.crypto.hash(t,"SHA-384")]);return await Do.default.crypto.hash(r,"SHA-384")}gb.default=mfe;async function gfe(t,e){if(t.length<1)return e;let r=Do.default.utils.concatBuffers([e,await mfe(t[0])]),a=await Do.default.crypto.hash(r,"SHA-384");return await gfe(t.slice(1),a)}});var YB=ht(Fr=>{"use strict";ie();ae();ne();var oqe=Fr&&Fr.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Fr,"__esModule",{value:!0});Fr.debug=Fr.validatePath=Fr.arrayCompare=Fr.bufferToInt=Fr.intToBuffer=Fr.arrayFlatten=Fr.generateProofs=Fr.buildLayers=Fr.generateTransactionChunks=Fr.generateTree=Fr.computeRootHash=Fr.generateLeaves=Fr.chunkData=Fr.MIN_CHUNK_SIZE=Fr.MAX_CHUNK_SIZE=void 0;var Cw=oqe(Nw()),yfe=el();Fr.MAX_CHUNK_SIZE=256*1024;Fr.MIN_CHUNK_SIZE=32*1024;var yb=32,mv=32;async function KB(t){let e=[],r=t,a=0;for(;r.byteLength>=Fr.MAX_CHUNK_SIZE;){let i=Fr.MAX_CHUNK_SIZE,h=r.byteLength-Fr.MAX_CHUNK_SIZE;h>0&&h<Fr.MIN_CHUNK_SIZE&&(i=Math.ceil(r.byteLength/2));let l=r.slice(0,i),p=await Cw.default.crypto.hash(l);a+=l.byteLength,e.push({dataHash:p,minByteRange:a-l.byteLength,maxByteRange:a}),r=r.slice(i)}return e.push({dataHash:await Cw.default.crypto.hash(r),minByteRange:a,maxByteRange:a+r.byteLength}),e}Fr.chunkData=KB;async function WB(t){return Promise.all(t.map(async({dataHash:e,minByteRange:r,maxByteRange:a})=>({type:"leaf",id:await oa(await Promise.all([oa(e),oa(wb(a))])),dataHash:e,minByteRange:r,maxByteRange:a})))}Fr.generateLeaves=WB;async function sqe(t){return(await wfe(t)).id}Fr.computeRootHash=sqe;async function wfe(t){return await Lw(await WB(await KB(t)))}Fr.generateTree=wfe;async function fqe(t){let e=await KB(t),r=await WB(e),a=await Lw(r),i=await _fe(a),h=e.slice(-1)[0];return h.maxByteRange-h.minByteRange===0&&(e.splice(e.length-1,1),i.splice(i.length-1,1)),{data_root:a.id,chunks:e,proofs:i}}Fr.generateTransactionChunks=fqe;async function Lw(t,e=0){if(t.length<2)return t[0];let r=[];for(let a=0;a<t.length;a+=2)r.push(await uqe(t[a],t[a+1]));return Lw(r,e+1)}Fr.buildLayers=Lw;function _fe(t){let e=HB(t);return Array.isArray(e)?VB(e):[e]}Fr.generateProofs=_fe;function HB(t,e=new Uint8Array,r=0){if(t.type=="leaf")return{offset:t.maxByteRange-1,proof:(0,yfe.concatBuffers)([e,t.dataHash,wb(t.maxByteRange)])};if(t.type=="branch"){let a=(0,yfe.concatBuffers)([e,t.leftChild.id,t.rightChild.id,wb(t.byteRange)]);return[HB(t.leftChild,a,r+1),HB(t.rightChild,a,r+1)]}throw new Error("Unexpected node type")}function VB(t){let e=[];return t.forEach(r=>{Array.isArray(r)?e.push(...VB(r)):e.push(r)}),e}Fr.arrayFlatten=VB;async function uqe(t,e){return e?{type:"branch",id:await oa([await oa(t.id),await oa(e.id),await oa(wb(t.maxByteRange))]),byteRange:t.maxByteRange,maxByteRange:e.maxByteRange,leftChild:t,rightChild:e}:t}async function oa(t){return Array.isArray(t)&&(t=Cw.default.utils.concatBuffers(t)),new Uint8Array(await Cw.default.crypto.hash(t))}function wb(t){let e=new Uint8Array(yb);for(var r=e.length-1;r>=0;r--){var a=t%256;e[r]=a,t=(t-a)/256}return e}Fr.intToBuffer=wb;function GB(t){let e=0;for(var r=0;r<t.length;r++)e*=256,e+=t[r];return e}Fr.bufferToInt=GB;var hqe=(t,e)=>t.every((r,a)=>e[a]===r);Fr.arrayCompare=hqe;async function bb(t,e,r,a,i){if(a<=0)return!1;if(e>=a)return bb(t,0,a-1,a,i);if(e<0)return bb(t,0,0,a,i);if(i.length==mv+yb){let M=i.slice(0,mv),x=i.slice(M.length,M.length+yb),E=await oa([await oa(M),await oa(x)]);return(0,Fr.arrayCompare)(t,E)?{offset:a-1,leftBound:r,rightBound:a,chunkSize:a-r}:!1}let h=i.slice(0,mv),l=i.slice(h.length,h.length+mv),p=i.slice(h.length+l.length,h.length+l.length+yb),b=GB(p),g=i.slice(h.length+l.length+p.length),y=await oa([await oa(h),await oa(l),await oa(p)]);return(0,Fr.arrayCompare)(t,y)?e<b?await bb(h,e,r,Math.min(a,b),g):await bb(l,e,Math.max(r,b),a,g):!1}Fr.validatePath=bb;async function Mfe(t,e=""){if(t.byteLength<1)return e;let r=t.slice(0,mv),a=t.slice(r.length,r.length+mv),i=t.slice(r.length+a.length,r.length+a.length+yb),h=GB(i),l=t.slice(r.length+a.length+i.length),p=await oa([await oa(r),await oa(a),await oa(i)]),b=`${e}
127
- ${JSON.stringify(Me.from(r))},${JSON.stringify(Me.from(a))},${h} => ${JSON.stringify(p)}`;return Mfe(l,b)}Fr.debug=Mfe});var $w=ht($o=>{"use strict";ie();ae();ne();var lqe=$o&&$o.__createBinding||(Object.create?function(t,e,r,a){a===void 0&&(a=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,a,i)}:function(t,e,r,a){a===void 0&&(a=r),t[a]=e[r]}),cqe=$o&&$o.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),dqe=$o&&$o.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&lqe(e,t,r);return cqe(e,t),e},pqe=$o&&$o.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty($o,"__esModule",{value:!0});$o.Tag=void 0;var jn=dqe(el()),vqe=pqe(bfe()),mqe=YB(),Dw=class{get(e,r){if(!Object.getOwnPropertyNames(this).includes(e))throw new Error(`Field "${e}" is not a property of the Arweave Transaction class.`);if(this[e]instanceof Uint8Array)return r&&r.decode&&r.string?jn.bufferToString(this[e]):r&&r.decode&&!r.string?this[e]:jn.bufferTob64Url(this[e]);if(this[e]instanceof Array){if(r?.decode!==void 0||r?.string!==void 0)throw e==="tags"&&console.warn(`Did you mean to use 'transaction["tags"]' ?`),new Error("Cannot decode or stringify an array.");return this[e]}return r&&r.decode==!0?r&&r.string?jn.b64UrlToString(this[e]):jn.b64UrlToBuffer(this[e]):this[e]}},_b=class extends Dw{name;value;constructor(e,r,a=!1){super(),this.name=e,this.value=r}};$o.Tag=_b;var JB=class extends Dw{format=2;id="";last_tx="";owner="";tags=[];target="";quantity="0";data_size="0";data=new Uint8Array;data_root="";reward="0";signature="";chunks;constructor(e={}){super(),Object.assign(this,e),typeof this.data=="string"&&(this.data=jn.b64UrlToBuffer(this.data)),e.tags&&(this.tags=e.tags.map(r=>new _b(r.name,r.value)))}addTag(e,r){this.tags.push(new _b(jn.stringToB64Url(e),jn.stringToB64Url(r)))}toJSON(){return{format:this.format,id:this.id,last_tx:this.last_tx,owner:this.owner,tags:this.tags,target:this.target,quantity:this.quantity,data:jn.bufferTob64Url(this.data),data_size:this.data_size,data_root:this.data_root,data_tree:this.data_tree,reward:this.reward,signature:this.signature}}setOwner(e){this.owner=e}setSignature({id:e,owner:r,reward:a,tags:i,signature:h}){this.id=e,this.owner=r,a&&(this.reward=a),i&&(this.tags=i),this.signature=h}async prepareChunks(e){!this.chunks&&e.byteLength>0&&(this.chunks=await(0,mqe.generateTransactionChunks)(e),this.data_root=jn.bufferTob64Url(this.chunks.data_root)),!this.chunks&&e.byteLength===0&&(this.chunks={chunks:[],data_root:new Uint8Array,proofs:[]},this.data_root="")}getChunk(e,r){if(!this.chunks)throw new Error("Chunks have not been prepared");let a=this.chunks.proofs[e],i=this.chunks.chunks[e];return{data_root:this.data_root,data_size:this.data_size,data_path:jn.bufferTob64Url(a.proof),offset:a.offset.toString(),chunk:jn.bufferTob64Url(r.slice(i.minByteRange,i.maxByteRange))}}async getSignatureData(){switch(this.format){case 1:let e=this.tags.reduce((a,i)=>jn.concatBuffers([a,i.get("name",{decode:!0,string:!1}),i.get("value",{decode:!0,string:!1})]),new Uint8Array);return jn.concatBuffers([this.get("owner",{decode:!0,string:!1}),this.get("target",{decode:!0,string:!1}),this.get("data",{decode:!0,string:!1}),jn.stringToBuffer(this.quantity),jn.stringToBuffer(this.reward),this.get("last_tx",{decode:!0,string:!1}),e]);case 2:this.data_root||await this.prepareChunks(this.data);let r=this.tags.map(a=>[a.get("name",{decode:!0,string:!1}),a.get("value",{decode:!0,string:!1})]);return await(0,vqe.default)([jn.stringToBuffer(this.format.toString()),this.get("owner",{decode:!0,string:!1}),this.get("target",{decode:!0,string:!1}),jn.stringToBuffer(this.quantity),jn.stringToBuffer(this.reward),this.get("last_tx",{decode:!0,string:!1}),r,jn.stringToBuffer(this.data_size),this.get("data_root",{decode:!0,string:!1})]);default:throw new Error(`Unexpected transaction format: ${this.format}`)}}};$o.default=JB});var Afe=ht(Zs=>{"use strict";ie();ae();ne();var gqe=Zs&&Zs.__createBinding||(Object.create?function(t,e,r,a){a===void 0&&(a=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,a,i)}:function(t,e,r,a){a===void 0&&(a=r),t[a]=e[r]}),bqe=Zs&&Zs.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),yqe=Zs&&Zs.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&gqe(e,t,r);return bqe(e,t),e},wqe=Zs&&Zs.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Zs,"__esModule",{value:!0});Zs.TransactionUploader=void 0;var xfe=wqe($w()),_qe=yqe(el()),XB=mb(),Mqe=YB(),Sfe=1,xqe=["invalid_json","chunk_too_big","data_path_too_big","offset_too_big","data_size_too_big","chunk_proof_ratio_not_attractive","invalid_proof"],Efe=1e3*40,QB=class t{api;chunkIndex=0;txPosted=!1;transaction;lastRequestTimeEnd=0;totalErrors=0;data;lastResponseStatus=0;lastResponseError="";get isComplete(){return this.txPosted&&this.chunkIndex===this.transaction.chunks.chunks.length}get totalChunks(){return this.transaction.chunks.chunks.length}get uploadedChunks(){return this.chunkIndex}get pctComplete(){return Math.trunc(this.uploadedChunks/this.totalChunks*100)}constructor(e,r){if(this.api=e,!r.id)throw new Error("Transaction is not signed");if(!r.chunks)throw new Error("Transaction chunks not prepared");this.data=r.data,this.transaction=new xfe.default(Object.assign({},r,{data:new Uint8Array(0)}))}async uploadChunk(e){if(this.isComplete)throw new Error("Upload is already complete");if(this.lastResponseError!==""?this.totalErrors++:this.totalErrors=0,this.totalErrors===100)throw new Error(`Unable to complete upload: ${this.lastResponseStatus}: ${this.lastResponseError}`);let r=this.lastResponseError===""?0:Math.max(this.lastRequestTimeEnd+Efe-Date.now(),Efe);if(r>0&&(r=r-r*Math.random()*.3,await new Promise(l=>setTimeout(l,r))),this.lastResponseError="",!this.txPosted){await this.postTransaction();return}e&&(this.chunkIndex=e);let a=this.transaction.getChunk(e||this.chunkIndex,this.data);if(!await(0,Mqe.validatePath)(this.transaction.chunks.data_root,parseInt(a.offset),0,parseInt(a.data_size),_qe.b64UrlToBuffer(a.data_path)))throw new Error(`Unable to validate chunk ${this.chunkIndex}`);let h=await this.api.post("chunk",this.transaction.getChunk(this.chunkIndex,this.data)).catch(l=>(console.error(l.message),{status:-1,data:{error:l.message}}));if(this.lastRequestTimeEnd=Date.now(),this.lastResponseStatus=h.status,this.lastResponseStatus==200)this.chunkIndex++;else if(this.lastResponseError=(0,XB.getError)(h),xqe.includes(this.lastResponseError))throw new Error(`Fatal error uploading chunk ${this.chunkIndex}: ${this.lastResponseError}`)}static async fromSerialized(e,r,a){if(!r||typeof r.chunkIndex!="number"||typeof r.transaction!="object")throw new Error("Serialized object does not match expected format.");var i=new xfe.default(r.transaction);i.chunks||await i.prepareChunks(a);let h=new t(e,i);if(h.chunkIndex=r.chunkIndex,h.lastRequestTimeEnd=r.lastRequestTimeEnd,h.lastResponseError=r.lastResponseError,h.lastResponseStatus=r.lastResponseStatus,h.txPosted=r.txPosted,h.data=a,h.transaction.data_root!==r.transaction.data_root)throw new Error("Data mismatch: Uploader doesn't match provided data.");return h}static async fromTransactionId(e,r){let a=await e.get(`tx/${r}`);if(a.status!==200)throw new Error(`Tx ${r} not found: ${a.status}`);let i=a.data;return i.data=new Uint8Array(0),{txPosted:!0,chunkIndex:0,lastResponseError:"",lastRequestTimeEnd:0,lastResponseStatus:0,transaction:i}}toJSON(){return{chunkIndex:this.chunkIndex,transaction:this.transaction,lastRequestTimeEnd:this.lastRequestTimeEnd,lastResponseStatus:this.lastResponseStatus,lastResponseError:this.lastResponseError,txPosted:this.txPosted}}async postTransaction(){if(this.totalChunks<=Sfe){this.transaction.data=this.data;let a=await this.api.post("tx",this.transaction).catch(i=>(console.error(i),{status:-1,data:{error:i.message}}));if(this.lastRequestTimeEnd=Date.now(),this.lastResponseStatus=a.status,this.transaction.data=new Uint8Array(0),a.status>=200&&a.status<300){this.txPosted=!0,this.chunkIndex=Sfe;return}throw this.lastResponseError=(0,XB.getError)(a),new Error(`Unable to upload transaction: ${a.status}, ${this.lastResponseError}`)}let r=await this.api.post("tx",this.transaction);if(this.lastRequestTimeEnd=Date.now(),this.lastResponseStatus=r.status,!(r.status>=200&&r.status<300))throw this.lastResponseError=(0,XB.getError)(r),new Error(`Unable to upload transaction: ${r.status}, ${this.lastResponseError}`);this.txPosted=!0}};Zs.TransactionUploader=QB});var qw=ht((X2t,Rfe)=>{"use strict";ie();ae();ne();Rfe.exports={}});var kfe=ht(Hf=>{"use strict";ie();ae();ne();var Sqe=Hf&&Hf.__createBinding||(Object.create?function(t,e,r,a){a===void 0&&(a=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,a,i)}:function(t,e,r,a){a===void 0&&(a=r),t[a]=e[r]}),Eqe=Hf&&Hf.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Aqe=Hf&&Hf.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&Sqe(e,t,r);return Eqe(e,t),e},Tfe=Hf&&Hf.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Hf,"__esModule",{value:!0});var eP=Tfe(mb()),tl=Tfe($w()),Mb=Aqe(el()),tP=Afe();qw();var rP=class{api;crypto;chunks;constructor(e,r,a){this.api=e,this.crypto=r,this.chunks=a}async getTransactionAnchor(){let e=await this.api.get("tx_anchor");if(!e.data.match(/^[a-z0-9_-]{43,}/i)||!e.ok)throw new Error(`Could not getTransactionAnchor. Received: ${e.data}. Status: ${e.status}, ${e.statusText}`);return e.data}async getPrice(e,r){let a=r?`price/${e}/${r}`:`price/${e}`,i=await this.api.get(a);if(!/^\d+$/.test(i.data)||!i.ok)throw new Error(`Could not getPrice. Received: ${i.data}. Status: ${i.status}, ${i.statusText}`);return i.data}async get(e){let r=await this.api.get(`tx/${e}`);if(r.status==200){let a=parseInt(r.data.data_size);if(r.data.format>=2&&a>0&&a<=1024*1024*12){let i=await this.getData(e);return new tl.default({...r.data,data:i})}return new tl.default({...r.data,format:r.data.format||1})}throw r.status==404?new eP.default("TX_NOT_FOUND"):r.status==410?new eP.default("TX_FAILED"):new eP.default("TX_INVALID")}fromRaw(e){return new tl.default(e)}async search(e,r){return this.api.post("arql",{op:"equals",expr1:e,expr2:r}).then(a=>a.data?a.data:[])}getStatus(e){return this.api.get(`tx/${e}/status`).then(r=>r.status==200?{status:200,confirmed:r.data}:{status:r.status,confirmed:null})}async getData(e,r){let a;try{a=await this.chunks.downloadChunkedData(e)}catch(i){console.error(`Error while trying to download chunked data for ${e}`),console.error(i)}if(!a){console.warn(`Falling back to gateway cache for ${e}`);try{let{data:i,ok:h,status:l,statusText:p}=await this.api.get(`/${e}`,{responseType:"arraybuffer"});if(!h)throw new Error("Bad http status code",{cause:{status:l,statusText:p}});a=i}catch(i){console.error(`Error while trying to download contiguous data from gateway cache for ${e}`),console.error(i)}}if(!a)throw new Error(`${e} data was not found!`);return r&&r.decode&&!r.string?a:r&&r.decode&&r.string?Mb.bufferToString(a):Mb.bufferTob64Url(a)}async sign(e,r,a){let h=typeof r=="object"&&(p=>{let b=!0;return["n","e","d","p","q","dp","dq","qi"].map(g=>!(g in p)&&(b=!1)),b})(r),l=typeof arweaveWallet=="object";if(!h&&!l)throw new Error("No valid JWK or external wallet found to sign transaction.");if(h){e.setOwner(r.n);let p=await e.getSignatureData(),b=await this.crypto.sign(r,p,a),g=await this.crypto.hash(b);e.setSignature({id:Mb.bufferTob64Url(g),owner:r.n,signature:Mb.bufferTob64Url(b)})}else if(l){try{(await arweaveWallet.getPermissions()).includes("SIGN_TRANSACTION")||await arweaveWallet.connect(["SIGN_TRANSACTION"])}catch{}let p=await arweaveWallet.sign(e,a);e.setSignature({id:p.id,owner:p.owner,reward:p.reward,tags:p.tags,signature:p.signature})}else throw new Error("An error occurred while signing. Check wallet is valid")}async verify(e){let r=await e.getSignatureData(),a=e.get("signature",{decode:!0,string:!1}),i=Mb.bufferTob64Url(await this.crypto.hash(a));if(e.id!==i)throw new Error("Invalid transaction signature or ID! The transaction ID doesn't match the expected SHA-256 hash of the signature.");return this.crypto.verify(e.owner,r,a)}async post(e){if(typeof e=="string"?e=new tl.default(JSON.parse(e)):typeof e.readInt32BE=="function"?e=new tl.default(JSON.parse(e.toString())):typeof e=="object"&&!(e instanceof tl.default)&&(e=new tl.default(e)),!(e instanceof tl.default))throw new Error("Must be Transaction object");e.chunks||await e.prepareChunks(e.data);let r=await this.getUploader(e,e.data);try{for(;!r.isComplete;)await r.uploadChunk()}catch(a){if(r.lastResponseStatus>0)return{status:r.lastResponseStatus,statusText:r.lastResponseError,data:{error:r.lastResponseError}};throw a}return{status:200,statusText:"OK",data:{}}}async getUploader(e,r){let a;if(r instanceof ArrayBuffer&&(r=new Uint8Array(r)),e instanceof tl.default){if(r||(r=e.data),!(r instanceof Uint8Array))throw new Error("Data format is invalid");e.chunks||await e.prepareChunks(r),a=new tP.TransactionUploader(this.api,e),(!a.data||a.data.length===0)&&(a.data=r)}else{if(typeof e=="string"&&(e=await tP.TransactionUploader.fromTransactionId(this.api,e)),!r||!(r instanceof Uint8Array))throw new Error("Must provide data when resuming upload");a=await tP.TransactionUploader.fromSerialized(this.api,e,r)}return a}async*upload(e,r){let a=await this.getUploader(e,r);for(;!a.isComplete;)await a.uploadChunk(),yield a;return a}};Hf.default=rP});var Bfe=ht(rl=>{"use strict";ie();ae();ne();var Rqe=rl&&rl.__createBinding||(Object.create?function(t,e,r,a){a===void 0&&(a=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,a,i)}:function(t,e,r,a){a===void 0&&(a=r),t[a]=e[r]}),Tqe=rl&&rl.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),kqe=rl&&rl.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&Rqe(e,t,r);return Tqe(e,t),e};Object.defineProperty(rl,"__esModule",{value:!0});var Ife=kqe(el());qw();var iP=class{api;crypto;constructor(e,r){this.api=e,this.crypto=r}getBalance(e){return this.api.get(`wallet/${e}/balance`).then(r=>r.data)}getLastTransactionID(e){return this.api.get(`wallet/${e}/last_tx`).then(r=>r.data)}generate(){return this.crypto.generateJWK()}async jwkToAddress(e){return!e||e==="use_wallet"?this.getAddress():this.getAddress(e)}async getAddress(e){if(!e||e==="use_wallet"){try{await arweaveWallet.connect(["ACCESS_ADDRESS"])}catch{}return arweaveWallet.getActiveAddress()}else return this.ownerToAddress(e.n)}async ownerToAddress(e){return Ife.bufferTob64Url(await this.crypto.hash(Ife.b64UrlToBuffer(e)))}};rl.default=iP});var Ofe=ht(Kf=>{"use strict";ie();ae();ne();var Iqe=Kf&&Kf.__createBinding||(Object.create?function(t,e,r,a){a===void 0&&(a=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,a,i)}:function(t,e,r,a){a===void 0&&(a=r),t[a]=e[r]}),Bqe=Kf&&Kf.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Pqe=Kf&&Kf.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&Iqe(e,t,r);return Bqe(e,t),e};Object.defineProperty(Kf,"__esModule",{value:!0});Kf.SiloResource=void 0;var Pfe=Pqe(el()),nP=class{api;crypto;transactions;constructor(e,r,a){this.api=e,this.crypto=r,this.transactions=a}async get(e){if(!e)throw new Error("No Silo URI specified");let r=await this.parseUri(e),a=await this.transactions.search("Silo-Name",r.getAccessKey());if(a.length==0)throw new Error(`No data could be found for the Silo URI: ${e}`);let i=await this.transactions.get(a[0]);if(!i)throw new Error(`No data could be found for the Silo URI: ${e}`);let h=i.get("data",{decode:!0,string:!1});return this.crypto.decrypt(h,r.getEncryptionKey())}async readTransactionData(e,r){if(!r)throw new Error("No Silo URI specified");let a=await this.parseUri(r),i=e.get("data",{decode:!0,string:!1});return this.crypto.decrypt(i,a.getEncryptionKey())}async parseUri(e){let r=e.match(/^([a-z0-9-_]+)\.([0-9]+)/i);if(!r)throw new Error("Invalid Silo name, must be a name in the format of [a-z0-9]+.[0-9]+, e.g. 'bubble.7'");let a=r[1],i=Math.pow(2,parseInt(r[2])),h=await this.hash(Pfe.stringToBuffer(a),i),l=Pfe.bufferTob64(h.slice(0,15)),p=await this.hash(h.slice(16,31),1);return new Uw(e,l,p)}async hash(e,r){let a=await this.crypto.hash(e);for(let i=0;i<r-1;i++)a=await this.crypto.hash(a);return a}};Kf.default=nP;var Uw=class{uri;accessKey;encryptionKey;constructor(e,r,a){this.uri=e,this.accessKey=r,this.encryptionKey=a}getUri(){return this.uri}getAccessKey(){return this.accessKey}getEncryptionKey(){return this.encryptionKey}};Kf.SiloResource=Uw});var Cfe=ht(il=>{"use strict";ie();ae();ne();var Oqe=il&&il.__createBinding||(Object.create?function(t,e,r,a){a===void 0&&(a=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,a,i)}:function(t,e,r,a){a===void 0&&(a=r),t[a]=e[r]}),Nqe=il&&il.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Cqe=il&&il.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&Oqe(e,t,r);return Nqe(e,t),e};Object.defineProperty(il,"__esModule",{value:!0});var Nfe=mb(),Lqe=Cqe(el()),aP=class{api;constructor(e){this.api=e}async getTransactionOffset(e){let r=await this.api.get(`tx/${e}/offset`);if(r.status===200)return r.data;throw new Error(`Unable to get transaction offset: ${(0,Nfe.getError)(r)}`)}async getChunk(e){let r=await this.api.get(`chunk/${e}`);if(r.status===200)return r.data;throw new Error(`Unable to get chunk: ${(0,Nfe.getError)(r)}`)}async getChunkData(e){let r=await this.getChunk(e);return Lqe.b64UrlToBuffer(r.chunk)}firstChunkOffset(e){return parseInt(e.offset)-parseInt(e.size)+1}async downloadChunkedData(e){let r=await this.getTransactionOffset(e),a=parseInt(r.size),h=parseInt(r.offset)-a+1,l=new Uint8Array(a),p=0;for(;p<a;){this.api.config.logging&&console.log(`[chunk] ${p}/${a}`);let b;try{b=await this.getChunkData(h+p)}catch{console.error(`[chunk] Failed to fetch chunk at offset ${h+p}`),console.error("[chunk] This could indicate that the chunk wasn't uploaded or hasn't yet seeded properly to a particular gateway/node")}if(b)l.set(b,p),p+=b.length;else throw new Error(`Couldn't complete data download at ${p}/${a}`)}return l}};il.default=aP});var Dfe=ht(xb=>{"use strict";ie();ae();ne();var Dqe=xb&&xb.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(xb,"__esModule",{value:!0});var Lfe=Dqe(mb());qw();var oP=class t{api;network;static HASH_ENDPOINT="block/hash/";static HEIGHT_ENDPOINT="block/height/";constructor(e,r){this.api=e,this.network=r}async get(e){let r=await this.api.get(`${t.HASH_ENDPOINT}${e}`);if(r.status===200)return r.data;throw r.status===404?new Lfe.default("BLOCK_NOT_FOUND"):new Error(`Error while loading block data: ${r}`)}async getByHeight(e){let r=await this.api.get(`${t.HEIGHT_ENDPOINT}${e}`);if(r.status===200)return r.data;throw r.status===404?new Lfe.default("BLOCK_NOT_FOUND"):new Error(`Error while loading block data: ${r}`)}async getCurrent(){let{current:e}=await this.network.getInfo();return await this.get(e)}};xb.default=oP});var Nw=ht(Wf=>{"use strict";ie();ae();ne();var $qe=Wf&&Wf.__createBinding||(Object.create?function(t,e,r,a){a===void 0&&(a=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,a,i)}:function(t,e,r,a){a===void 0&&(a=r),t[a]=e[r]}),qqe=Wf&&Wf.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Uqe=Wf&&Wf.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&$qe(e,t,r);return qqe(e,t),e},Vu=Wf&&Wf.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Wf,"__esModule",{value:!0});var Fqe=Vu(Gse()),jqe=Vu(Yse()),zqe=Vu(ofe()),Zqe=Vu(sfe()),Hqe=Vu(kfe()),Kqe=Vu(Bfe()),$fe=Vu($w()),Sb=Uqe(el()),Wqe=Vu(Ofe()),Vqe=Vu(Cfe()),Gqe=Vu(Dfe()),sP=class t{api;wallets;transactions;network;blocks;ar;silo;chunks;static init;static crypto=new zqe.default;static utils=Sb;constructor(e){this.api=new jqe.default(e),this.wallets=new Kqe.default(this.api,t.crypto),this.chunks=new Vqe.default(this.api),this.transactions=new Hqe.default(this.api,t.crypto,this.chunks),this.silo=new Wqe.default(this.api,this.crypto,this.transactions),this.network=new Zqe.default(this.api),this.blocks=new Gqe.default(this.api,this.network),this.ar=new Fqe.default}get crypto(){return t.crypto}get utils(){return t.utils}getConfig(){return{api:this.api.getConfig(),crypto:null}}async createTransaction(e,r){let a={};if(Object.assign(a,e),!e.data&&!(e.target&&e.quantity))throw new Error("A new Arweave transaction must have a 'data' value, or 'target' and 'quantity' values.");if(e.owner==null&&r&&r!=="use_wallet"&&(a.owner=r.n),e.last_tx==null&&(a.last_tx=await this.transactions.getTransactionAnchor()),typeof e.data=="string"&&(e.data=Sb.stringToBuffer(e.data)),e.data instanceof ArrayBuffer&&(e.data=new Uint8Array(e.data)),e.data&&!(e.data instanceof Uint8Array))throw new Error("Expected data to be a string, Uint8Array or ArrayBuffer");if(e.reward==null){let h=e.data?e.data.byteLength:0;a.reward=await this.transactions.getPrice(h,a.target)}a.data_root="",a.data_size=e.data?e.data.byteLength.toString():"0",a.data=e.data||new Uint8Array(0);let i=new $fe.default(a);return await i.getSignatureData(),i}async createSiloTransaction(e,r,a){let i={};if(Object.assign(i,e),!e.data)throw new Error("Silo transactions must have a 'data' value");if(!a)throw new Error("No Silo URI specified.");if(e.target||e.quantity)throw new Error("Silo transactions can only be used for storing data, sending AR to other wallets isn't supported.");if(e.owner==null){if(!r||!r.n)throw new Error("A new Arweave transaction must either have an 'owner' attribute, or you must provide the jwk parameter.");i.owner=r.n}e.last_tx==null&&(i.last_tx=await this.transactions.getTransactionAnchor());let h=await this.silo.parseUri(a);if(typeof e.data=="string"){let p=await this.crypto.encrypt(Sb.stringToBuffer(e.data),h.getEncryptionKey());i.reward=await this.transactions.getPrice(p.byteLength),i.data=Sb.bufferTob64Url(p)}if(e.data instanceof Uint8Array){let p=await this.crypto.encrypt(e.data,h.getEncryptionKey());i.reward=await this.transactions.getPrice(p.byteLength),i.data=Sb.bufferTob64Url(p)}let l=new $fe.default(i);return l.addTag("Silo-Name",h.getAccessKey()),l.addTag("Silo-Version","0.1.0"),l}arql(e){return this.api.post("/arql",e).then(r=>r.data||[])}};Wf.default=sP});var Ufe=ht((uP,qfe)=>{"use strict";ie();ae();ne();var Yqe=uP&&uP.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},fP=Yqe(Nw());fP.default.init=function(t={}){return new fP.default(t)};qfe.exports=fP.default});var Yfe=ht((H6t,vP)=>{"use strict";ie();ae();ne();var rUe=Object.prototype.hasOwnProperty,Za="~";function Ab(){}Object.create&&(Ab.prototype=Object.create(null),new Ab().__proto__||(Za=!1));function iUe(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function Gfe(t,e,r,a,i){if(typeof r!="function")throw new TypeError("The listener must be a function");var h=new iUe(r,a||t,i),l=Za?Za+e:e;return t._events[l]?t._events[l].fn?t._events[l]=[t._events[l],h]:t._events[l].push(h):(t._events[l]=h,t._eventsCount++),t}function Hw(t,e){--t._eventsCount===0?t._events=new Ab:delete t._events[e]}function Oa(){this._events=new Ab,this._eventsCount=0}Oa.prototype.eventNames=function(){var e=[],r,a;if(this._eventsCount===0)return e;for(a in r=this._events)rUe.call(r,a)&&e.push(Za?a.slice(1):a);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(r)):e};Oa.prototype.listeners=function(e){var r=Za?Za+e:e,a=this._events[r];if(!a)return[];if(a.fn)return[a.fn];for(var i=0,h=a.length,l=new Array(h);i<h;i++)l[i]=a[i].fn;return l};Oa.prototype.listenerCount=function(e){var r=Za?Za+e:e,a=this._events[r];return a?a.fn?1:a.length:0};Oa.prototype.emit=function(e,r,a,i,h,l){var p=Za?Za+e:e;if(!this._events[p])return!1;var b=this._events[p],g=arguments.length,y,M;if(b.fn){switch(b.once&&this.removeListener(e,b.fn,void 0,!0),g){case 1:return b.fn.call(b.context),!0;case 2:return b.fn.call(b.context,r),!0;case 3:return b.fn.call(b.context,r,a),!0;case 4:return b.fn.call(b.context,r,a,i),!0;case 5:return b.fn.call(b.context,r,a,i,h),!0;case 6:return b.fn.call(b.context,r,a,i,h,l),!0}for(M=1,y=new Array(g-1);M<g;M++)y[M-1]=arguments[M];b.fn.apply(b.context,y)}else{var x=b.length,E;for(M=0;M<x;M++)switch(b[M].once&&this.removeListener(e,b[M].fn,void 0,!0),g){case 1:b[M].fn.call(b[M].context);break;case 2:b[M].fn.call(b[M].context,r);break;case 3:b[M].fn.call(b[M].context,r,a);break;case 4:b[M].fn.call(b[M].context,r,a,i);break;default:if(!y)for(E=1,y=new Array(g-1);E<g;E++)y[E-1]=arguments[E];b[M].fn.apply(b[M].context,y)}}return!0};Oa.prototype.on=function(e,r,a){return Gfe(this,e,r,a,!1)};Oa.prototype.once=function(e,r,a){return Gfe(this,e,r,a,!0)};Oa.prototype.removeListener=function(e,r,a,i){var h=Za?Za+e:e;if(!this._events[h])return this;if(!r)return Hw(this,h),this;var l=this._events[h];if(l.fn)l.fn===r&&(!i||l.once)&&(!a||l.context===a)&&Hw(this,h);else{for(var p=0,b=[],g=l.length;p<g;p++)(l[p].fn!==r||i&&!l[p].once||a&&l[p].context!==a)&&b.push(l[p]);b.length?this._events[h]=b.length===1?b[0]:b:Hw(this,h)}return this};Oa.prototype.removeAllListeners=function(e){var r;return e?(r=Za?Za+e:e,this._events[r]&&Hw(this,r)):(this._events=new Ab,this._eventsCount=0),this};Oa.prototype.off=Oa.prototype.removeListener;Oa.prototype.addListener=Oa.prototype.on;Oa.prefixed=Za;Oa.EventEmitter=Oa;typeof vP<"u"&&(vP.exports=Oa)});ie();ae();ne();ie();ae();ne();var sT={};Ha(sT,{AVSCTap:()=>Sg,AlgorandSigner:()=>vg,AptosSigner:()=>gg,ArconnectSigner:()=>v1,Arweave:()=>MW.default,ArweaveSigner:()=>Hl,Bundle:()=>k8,BundleItem:()=>oT,CryptoDriver:()=>p3,Curve25519:()=>xo,DataItem:()=>A8,EthereumSigner:()=>Io,HexInjectedSolanaSigner:()=>J0,HexSolanaSigner:()=>mg,InjectedAptosSigner:()=>X0,InjectedEthereumSigner:()=>oR,InjectedSolanaSigner:()=>A0,InjectedTypedEthereumSigner:()=>rT,KyveSigner:()=>wg,MAX_TAG_BYTES:()=>E8,MIN_BINARY_SIZE:()=>R8,MultiSignatureAptosSigner:()=>Q0,NearSigner:()=>pg,PolygonSigner:()=>dg,Rsa4096:()=>S0,SIG_CONFIG:()=>Wr,SignatureConfig:()=>wr,Signer:()=>Jw,SolanaSigner:()=>Ih,Transaction:()=>_W.default,TypedEthereumSigner:()=>ed,bundleAndSignData:()=>V4e,byteArrayToLong:()=>yn,concatBuffers:()=>Pi.concatBuffers,createData:()=>Ag,deepHash:()=>Ul,deserializeTags:()=>m1,exportForTesting:()=>Z4e,getCryptoDriver:()=>Sn,getSignatureAndId:()=>qX,indexToType:()=>_g,keccak256:()=>QR,longTo16ByteArray:()=>K4e,longTo32ByteArray:()=>S8,longTo8ByteArray:()=>x8,longToNByteArray:()=>xg,secp256k1:()=>Y0,serializeTags:()=>nT,shortTo2ByteArray:()=>iT,sign:()=>T8,stringToBuffer:()=>Pi.stringToBuffer,unbundleData:()=>W4e});ie();ae();ne();ie();ae();ne();ie();ae();ne();var Jw=class{publicKey;signatureType;signatureLength;ownerLength;pem;static verify(e,r,a,i){throw new Error("You must implement verify method on child")}};ie();ae();ne();ie();ae();ne();var CK=gi(qo(),1);ie();ae();ne();var wr;(function(t){t[t.ARWEAVE=1]="ARWEAVE",t[t.ED25519=2]="ED25519",t[t.ETHEREUM=3]="ETHEREUM",t[t.SOLANA=4]="SOLANA",t[t.INJECTEDAPTOS=5]="INJECTEDAPTOS",t[t.MULTIAPTOS=6]="MULTIAPTOS",t[t.TYPEDETHEREUM=7]="TYPEDETHEREUM",t[t.KYVE=101]="KYVE"})(wr||(wr={}));var Wr={[wr.ARWEAVE]:{sigLength:512,pubLength:512,sigName:"arweave"},[wr.ED25519]:{sigLength:64,pubLength:32,sigName:"ed25519"},[wr.ETHEREUM]:{sigLength:65,pubLength:65,sigName:"ethereum"},[wr.SOLANA]:{sigLength:64,pubLength:32,sigName:"solana"},[wr.INJECTEDAPTOS]:{sigLength:64,pubLength:32,sigName:"injectedAptos"},[wr.MULTIAPTOS]:{sigLength:64*32+4,pubLength:32*32+1,sigName:"multiAptos"},[wr.TYPEDETHEREUM]:{sigLength:65,pubLength:42,sigName:"typedEthereum"},[wr.KYVE]:{sigLength:65,pubLength:65,sigName:"kyve"}};ie();ae();ne();du();var Jn=BigInt(0),oi=BigInt(1),Dl=BigInt(2),xge=BigInt(8),RK=BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),Vi=Object.freeze({a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),P:BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),l:RK,n:RK,h:BigInt(8),Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960")});var PK=BigInt("0x10000000000000000000000000000000000000000000000000000000000000000"),xm=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752"),hje=BigInt("6853475219497561581579357271197624642482790079785650197046958215289687604742"),Sge=BigInt("25063068953384623474111414158702152701244531502492656460079210482610430750235"),Ege=BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578"),Age=BigInt("1159843021668779879193775521855586647937357759715417654439879720876111806838"),Rge=BigInt("40440834346308536858101042469323190826248399146238708352240133220865137265952"),Ln=class t{constructor(e,r,a,i){this.x=e,this.y=r,this.z=a,this.t=i}static fromAffine(e){if(!(e instanceof xn))throw new TypeError("ExtendedPoint#fromAffine: expected Point");return e.equals(xn.ZERO)?t.ZERO:new t(e.x,e.y,oi,Et(e.x*e.y))}static toAffineBatch(e){let r=Ige(e.map(a=>a.z));return e.map((a,i)=>a.toAffine(r[i]))}static normalizeZ(e){return this.toAffineBatch(e).map(this.fromAffine)}equals(e){kK(e);let{x:r,y:a,z:i}=this,{x:h,y:l,z:p}=e,b=Et(r*p),g=Et(h*i),y=Et(a*p),M=Et(l*i);return b===g&&y===M}negate(){return new t(Et(-this.x),this.y,this.z,Et(-this.t))}double(){let{x:e,y:r,z:a}=this,{a:i}=Vi,h=Et(e*e),l=Et(r*r),p=Et(Dl*Et(a*a)),b=Et(i*h),g=e+r,y=Et(Et(g*g)-h-l),M=b+l,x=M-p,E=b-l,A=Et(y*x),k=Et(M*E),P=Et(y*E),N=Et(x*M);return new t(A,k,N,P)}add(e){kK(e);let{x:r,y:a,z:i,t:h}=this,{x:l,y:p,z:b,t:g}=e,y=Et((a-r)*(p+l)),M=Et((a+r)*(p-l)),x=Et(M-y);if(x===Jn)return this.double();let E=Et(i*Dl*g),A=Et(h*Dl*b),k=A+E,P=M+y,N=A-E,L=Et(k*x),C=Et(P*N),Y=Et(k*N),G=Et(x*P);return new t(L,C,G,Y)}subtract(e){return this.add(e.negate())}precomputeWindow(e){let r=1+256/e,a=[],i=this,h=i;for(let l=0;l<r;l++){h=i,a.push(h);for(let p=1;p<2**(e-1);p++)h=h.add(i),a.push(h);i=h.double()}return a}wNAF(e,r){!r&&this.equals(t.BASE)&&(r=xn.BASE);let a=r&&r._WINDOW_SIZE||1;if(256%a)throw new Error("Point#wNAF: Invalid precomputation window, must be power of 2");let i=r&&uE.get(r);i||(i=this.precomputeWindow(a),r&&a!==1&&(i=t.normalizeZ(i),uE.set(r,i)));let h=t.ZERO,l=t.BASE,p=1+256/a,b=2**(a-1),g=BigInt(2**a-1),y=2**a,M=BigInt(a);for(let x=0;x<p;x++){let E=x*b,A=Number(e&g);e>>=M,A>b&&(A-=y,e+=oi);let k=E,P=E+Math.abs(A)-1,N=x%2!==0,L=A<0;A===0?l=l.add(TK(N,i[k])):h=h.add(TK(L,i[P]))}return t.normalizeZ([h,l])[0]}multiply(e,r){return this.wNAF(r3(e,Vi.l),r)}multiplyUnsafe(e){let r=r3(e,Vi.l,!1),a=t.BASE,i=t.ZERO;if(r===Jn)return i;if(this.equals(i)||r===oi)return this;if(this.equals(a))return this.wNAF(r);let h=i,l=this;for(;r>Jn;)r&oi&&(h=h.add(l)),l=l.double(),r>>=oi;return h}isSmallOrder(){return this.multiplyUnsafe(Vi.h).equals(t.ZERO)}isTorsionFree(){let e=this.multiplyUnsafe(Vi.l/Dl).double();return Vi.l%Dl&&(e=e.add(this)),e.equals(t.ZERO)}toAffine(e){let{x:r,y:a,z:i}=this,h=this.equals(t.ZERO);e==null&&(e=h?xge:i3(i));let l=Et(r*e),p=Et(a*e),b=Et(i*e);if(h)return xn.ZERO;if(b!==oi)throw new Error("invZ was invalid");return new xn(l,p)}fromRistrettoBytes(){oE()}toRistrettoBytes(){oE()}fromRistrettoHash(){oE()}};Ln.BASE=new Ln(Vi.Gx,Vi.Gy,oi,Et(Vi.Gx*Vi.Gy));Ln.ZERO=new Ln(Jn,oi,oi,Jn);function TK(t,e){let r=e.negate();return t?r:e}function kK(t){if(!(t instanceof Ln))throw new TypeError("ExtendedPoint expected")}function aE(t){if(!(t instanceof M0))throw new TypeError("RistrettoPoint expected")}function oE(){throw new Error("Legacy method: switch to RistrettoPoint")}var M0=class t{constructor(e){this.ep=e}static calcElligatorRistrettoMap(e){let{d:r}=Vi,a=Et(xm*e*e),i=Et((a+oi)*Age),h=BigInt(-1),l=Et((h-r*a)*Et(a+r)),{isValid:p,value:b}=lE(i,l),g=Et(b*e);Ll(g)||(g=Et(-g)),p||(b=g),p||(h=a);let y=Et(h*(a-oi)*Rge-l),M=b*b,x=Et((b+b)*l),E=Et(y*Sge),A=Et(oi-M),k=Et(oi+M);return new Ln(Et(x*k),Et(A*E),Et(E*k),Et(x*A))}static hashToCurve(e){e=$l(e,64);let r=sE(e.slice(0,32)),a=this.calcElligatorRistrettoMap(r),i=sE(e.slice(32,64)),h=this.calcElligatorRistrettoMap(i);return new t(a.add(h))}static fromHex(e){e=$l(e,32);let{a:r,d:a}=Vi,i="RistrettoPoint.fromHex: the hex is not valid encoding of RistrettoPoint",h=sE(e);if(!Pge(Em(h),e)||Ll(h))throw new Error(i);let l=Et(h*h),p=Et(oi+r*l),b=Et(oi-r*l),g=Et(p*p),y=Et(b*b),M=Et(r*a*g-y),{isValid:x,value:E}=BK(Et(M*y)),A=Et(E*b),k=Et(E*A*M),P=Et((h+h)*A);Ll(P)&&(P=Et(-P));let N=Et(p*k),L=Et(P*N);if(!x||Ll(L)||N===Jn)throw new Error(i);return new t(new Ln(P,N,oi,L))}toRawBytes(){let{x:e,y:r,z:a,t:i}=this.ep,h=Et(Et(a+r)*Et(a-r)),l=Et(e*r),p=Et(l*l),{value:b}=BK(Et(h*p)),g=Et(b*h),y=Et(b*l),M=Et(g*y*i),x;if(Ll(i*M)){let A=Et(r*xm),k=Et(e*xm);e=A,r=k,x=Et(g*Ege)}else x=y;Ll(e*M)&&(r=Et(-r));let E=Et((a-r)*x);return Ll(E)&&(E=Et(-E)),Em(E)}toHex(){return Am(this.toRawBytes())}toString(){return this.toHex()}equals(e){aE(e);let r=this.ep,a=e.ep,i=Et(r.x*a.y)===Et(r.y*a.x),h=Et(r.y*a.y)===Et(r.x*a.x);return i||h}add(e){return aE(e),new t(this.ep.add(e.ep))}subtract(e){return aE(e),new t(this.ep.subtract(e.ep))}multiply(e){return new t(this.ep.multiply(e))}multiplyUnsafe(e){return new t(this.ep.multiplyUnsafe(e))}};M0.BASE=new M0(Ln.BASE);M0.ZERO=new M0(Ln.ZERO);var uE=new WeakMap,xn=class t{constructor(e,r){this.x=e,this.y=r}_setWindowSize(e){this._WINDOW_SIZE=e,uE.delete(this)}static fromHex(e,r=!0){let{d:a,P:i}=Vi;e=$l(e,32);let h=e.slice();h[31]=e[31]&-129;let l=Rm(h);if(r&&l>=i)throw new Error("Expected 0 < hex < P");if(!r&&l>=PK)throw new Error("Expected 0 < hex < 2**256");let p=Et(l*l),b=Et(p-oi),g=Et(a*p+oi),{isValid:y,value:M}=lE(b,g);if(!y)throw new Error("Point.fromHex: invalid y coordinate");let x=(M&oi)===oi;return(e[31]&128)!==0!==x&&(M=Et(-M)),new t(M,l)}static async fromPrivateKey(e){return(await cE(e)).point}toRawBytes(){let e=Em(this.y);return e[31]|=this.x&oi?128:0,e}toHex(){return Am(this.toRawBytes())}toX25519(){let{y:e}=this,r=Et((oi+e)*i3(oi-e));return Em(r)}isTorsionFree(){return Ln.fromAffine(this).isTorsionFree()}equals(e){return this.x===e.x&&this.y===e.y}negate(){return new t(Et(-this.x),this.y)}add(e){return Ln.fromAffine(this).add(Ln.fromAffine(e)).toAffine()}subtract(e){return this.add(e.negate())}multiply(e){return Ln.fromAffine(this).multiply(e,this).toAffine()}};xn.BASE=new xn(Vi.Gx,Vi.Gy);xn.ZERO=new xn(Jn,oi);var Sm=class t{constructor(e,r){this.r=e,this.s=r,this.assertValidity()}static fromHex(e){let r=$l(e,64),a=xn.fromHex(r.slice(0,32),!1),i=Rm(r.slice(32,64));return new t(a,i)}assertValidity(){let{r:e,s:r}=this;if(!(e instanceof xn))throw new Error("Expected Point instance");return r3(r,Vi.l,!1),this}toRawBytes(){let e=new Uint8Array(64);return e.set(this.r.toRawBytes()),e.set(Em(this.s),32),e}toHex(){return Am(this.toRawBytes())}};function IK(...t){if(!t.every(a=>a instanceof Uint8Array))throw new Error("Expected Uint8Array list");if(t.length===1)return t[0];let e=t.reduce((a,i)=>a+i.length,0),r=new Uint8Array(e);for(let a=0,i=0;a<t.length;a++){let h=t[a];r.set(h,i),i+=h.length}return r}var Tge=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function Am(t){if(!(t instanceof Uint8Array))throw new Error("Uint8Array expected");let e="";for(let r=0;r<t.length;r++)e+=Tge[t[r]];return e}function hE(t){if(typeof t!="string")throw new TypeError("hexToBytes: expected string, got "+typeof t);if(t.length%2)throw new Error("hexToBytes: received invalid unpadded hex");let e=new Uint8Array(t.length/2);for(let r=0;r<e.length;r++){let a=r*2,i=t.slice(a,a+2),h=Number.parseInt(i,16);if(Number.isNaN(h)||h<0)throw new Error("Invalid byte sequence");e[r]=h}return e}function OK(t){let r=t.toString(16).padStart(64,"0");return hE(r)}function Em(t){return OK(t).reverse()}function Ll(t){return(Et(t)&oi)===oi}function Rm(t){if(!(t instanceof Uint8Array))throw new Error("Expected Uint8Array");return BigInt("0x"+Am(Uint8Array.from(t).reverse()))}var kge=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function sE(t){return Et(Rm(t)&kge)}function Et(t,e=Vi.P){let r=t%e;return r>=Jn?r:e+r}function i3(t,e=Vi.P){if(t===Jn||e<=Jn)throw new Error(`invert: expected positive integers, got n=${t} mod=${e}`);let r=Et(t,e),a=e,i=Jn,h=oi,l=oi,p=Jn;for(;r!==Jn;){let g=a/r,y=a%r,M=i-l*g,x=h-p*g;a=r,r=y,i=l,h=p,l=M,p=x}if(a!==oi)throw new Error("invert: does not exist");return Et(i,e)}function Ige(t,e=Vi.P){let r=new Array(t.length),a=t.reduce((h,l,p)=>l===Jn?h:(r[p]=h,Et(h*l,e)),oi),i=i3(a,e);return t.reduceRight((h,l,p)=>l===Jn?h:(r[p]=Et(h*r[p],e),Et(h*l,e)),i),r}function pu(t,e){let{P:r}=Vi,a=t;for(;e-- >Jn;)a*=a,a%=r;return a}function Bge(t){let{P:e}=Vi,r=BigInt(5),a=BigInt(10),i=BigInt(20),h=BigInt(40),l=BigInt(80),b=t*t%e*t%e,g=pu(b,Dl)*b%e,y=pu(g,oi)*t%e,M=pu(y,r)*y%e,x=pu(M,a)*M%e,E=pu(x,i)*x%e,A=pu(E,h)*E%e,k=pu(A,l)*A%e,P=pu(k,l)*A%e,N=pu(P,a)*M%e;return{pow_p_5_8:pu(N,Dl)*t%e,b2:b}}function lE(t,e){let r=Et(e*e*e),a=Et(r*r*e),i=Bge(t*a).pow_p_5_8,h=Et(t*r*i),l=Et(e*h*h),p=h,b=Et(h*xm),g=l===t,y=l===Et(-t),M=l===Et(-t*xm);return g&&(h=p),(y||M)&&(h=b),Ll(h)&&(h=Et(-h)),{isValid:g||y,value:h}}function BK(t){return lE(oi,t)}function t3(t){return Et(Rm(t),Vi.l)}function Pge(t,e){if(t.length!==e.length)return!1;for(let r=0;r<t.length;r++)if(t[r]!==e[r])return!1;return!0}function $l(t,e){let r=t instanceof Uint8Array?Uint8Array.from(t):hE(t);if(typeof e=="number"&&r.length!==e)throw new Error(`Expected ${e} bytes`);return r}function r3(t,e,r=!0){if(!e)throw new TypeError("Specify max value");if(typeof t=="number"&&Number.isSafeInteger(t)&&(t=BigInt(t)),typeof t=="bigint"&&t<e){if(r){if(Jn<t)return t}else if(Jn<=t)return t}throw new TypeError("Expected valid scalar: 0 < scalar < max")}function Oge(t){return t[0]&=248,t[31]&=127,t[31]|=64,t}function Nge(t){if(t=typeof t=="bigint"||typeof t=="number"?OK(r3(t,PK)):$l(t),t.length!==32)throw new Error("Expected 32 bytes");return t}function Cge(t){let e=Oge(t.slice(0,32)),r=t.slice(32,64),a=t3(e),i=xn.BASE.multiply(a),h=i.toRawBytes();return{head:e,prefix:r,scalar:a,point:i,pointBytes:h}}var fE;async function cE(t){return Cge(await Bp.sha512(Nge(t)))}async function NK(t,e){t=$l(t);let{prefix:r,scalar:a,pointBytes:i}=await cE(e),h=t3(await Bp.sha512(r,t)),l=xn.BASE.multiply(h),p=t3(await Bp.sha512(l.toRawBytes(),i,t)),b=Et(h+p*a,Vi.l);return new Sm(l,b).toRawBytes()}function Lge(t,e,r){e=$l(e),r instanceof xn||(r=xn.fromHex(r,!1));let{r:a,s:i}=t instanceof Sm?t.assertValidity():Sm.fromHex(t),h=Ln.BASE.multiplyUnsafe(i);return{r:a,s:i,SB:h,pub:r,msg:e}}function Dge(t,e,r,a){let i=t3(a),h=Ln.fromAffine(t).multiplyUnsafe(i);return Ln.fromAffine(e).add(h).subtract(r).multiplyUnsafe(Vi.h).equals(Ln.ZERO)}async function ql(t,e,r){let{r:a,SB:i,msg:h,pub:l}=Lge(t,e,r),p=await Bp.sha512(a.toRawBytes(),l.toRawBytes(),h);return Dge(l,a,i,p)}xn.BASE._setWindowSize(8);var Cl={node:Mm,web:typeof self=="object"&&"crypto"in self?self.crypto:void 0},Bp={bytesToHex:Am,hexToBytes:hE,concatBytes:IK,getExtendedPublicKey:cE,mod:Et,invert:i3,TORSION_SUBGROUP:["0100000000000000000000000000000000000000000000000000000000000000","c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac037a","0000000000000000000000000000000000000000000000000000000000000080","26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc05","ecffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f","26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc85","0000000000000000000000000000000000000000000000000000000000000000","c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac03fa"],hashToPrivateScalar:t=>{if(t=$l(t),t.length<40||t.length>1024)throw new Error("Expected 40-1024 bytes of private key as per FIPS 186");return Et(Rm(t),Vi.l-oi)+oi},randomBytes:(t=32)=>{if(Cl.web)return Cl.web.getRandomValues(new Uint8Array(t));if(Cl.node){let{randomBytes:e}=Cl.node;return new Uint8Array(e(t).buffer)}else throw new Error("The environment doesn't have randomBytes function")},randomPrivateKey:()=>Bp.randomBytes(32),sha512:async(...t)=>{let e=IK(...t);if(Cl.web){let r=await Cl.web.subtle.digest("SHA-512",e.buffer);return new Uint8Array(r)}else{if(Cl.node)return Uint8Array.from(Cl.node.createHash("sha512").update(e).digest());throw new Error("The environment doesn't have sha512 function")}},precompute(t=8,e=xn.BASE){let r=e.equals(xn.BASE)?e:new xn(e.x,e.y);return r._setWindowSize(t),r.multiply(Dl),r},sha512Sync:void 0};Object.defineProperties(Bp,{sha512Sync:{configurable:!1,get(){return fE},set(t){fE||(fE=t)}}});var xo=class{_key;pk;ownerLength=Wr[2].pubLength;signatureLength=Wr[2].sigLength;_publicKey;get publicKey(){return this._publicKey}signatureType=2;constructor(e,r){this._key=e,this.pk=r}get key(){throw new Error("You must implement `key`")}sign(e){return NK(Me.from(e),Me.from(this.key))}static async verify(e,r,a){let i=e;return typeof e=="string"&&(i=CK.default.toBuffer(e)),ql(Me.from(a),Me.from(r),Me.from(i))}};ie();ae();ne();ie();ae();ne();ie();ae();ne();ie();ae();ne();var Pi=gi(vf(),1);ie();ae();ne();du();async function Ul(t){if(typeof t[Symbol.asyncIterator]=="function"){let i=t,h=pf("sha384"),l=0;for await(let g of i)l+=g.byteLength,h.update(g);let p=(0,Pi.concatBuffers)([(0,Pi.stringToBuffer)("blob"),(0,Pi.stringToBuffer)(l.toString())]),b=(0,Pi.concatBuffers)([await Sn().hash(p,"SHA-384"),h.digest()]);return await Sn().hash(b,"SHA-384")}else if(Array.isArray(t)){let i=(0,Pi.concatBuffers)([(0,Pi.stringToBuffer)("list"),(0,Pi.stringToBuffer)(t.length.toString())]);return await KK(t,await Sn().hash(i,"SHA-384"))}let e=t,r=(0,Pi.concatBuffers)([(0,Pi.stringToBuffer)("blob"),(0,Pi.stringToBuffer)(e.byteLength.toString())]),a=(0,Pi.concatBuffers)([await Sn().hash(r,"SHA-384"),await Sn().hash(e,"SHA-384")]);return await Sn().hash(a,"SHA-384")}async function KK(t,e){if(t.length<1)return e;let r=(0,Pi.concatBuffers)([e,await Ul(t[0])]),a=await Sn().hash(r,"SHA-384");return await KK(t.slice(1),a)}var d3=gi(gE(),1),_W=gi(Nm(),1),MW=gi(wW(),1),x2e=d3.default.default?d3.default.default:d3.default,p3=class extends x2e{getPublicKey(e){throw new Error("Unimplemented")}},S2e;function Sn(){return S2e??=new p3}var xW=gi(qo(),1);du();var S0=class{_key;pk;signatureType=1;ownerLength=Wr[1].pubLength;signatureLength=Wr[1].sigLength;_publicKey;get publicKey(){return this._publicKey}constructor(e,r){this._key=e,this.pk=r,r||(this.pk=Sn().getPublicKey(JSON.parse(e)))}sign(e){return iE("sha256").update(e).sign({key:this._key,padding:rE.RSA_PKCS1_PSS_PADDING})}static async verify(e,r,a){return await Sn().verify(Me.isBuffer(e)?xW.default.encode(e):e,r,a)}};var lV=gi(hV(),1),cV=gi(qo(),1);var Hl=class extends S0{jwk;constructor(e){super((0,lV.jwkTopem)(e),e.n),this.jwk=e}get publicKey(){if(!this.pk)throw new Error("ArweaveSigner - pk is undefined");return cV.default.toBuffer(this.pk)}sign(e){return Sn().sign(this.jwk,e)}static async verify(e,r,a){return await Sn().verify(e,r,a)}};ie();ae();ne();var dV=gi(qo(),1);var A0=class{_publicKey;ownerLength=Wr[2].pubLength;signatureLength=Wr[2].sigLength;signatureType=2;pem;provider;constructor(e){if(this.provider=e,!this.provider.publicKey)throw new Error("InjectedSolanaSigner - provider.publicKey is undefined");this._publicKey=this.provider.publicKey.toBuffer()}get publicKey(){return this._publicKey}async sign(e){if(!this.provider.signMessage)throw new Error("Selected Wallet does not support message signing");return await this.provider.signMessage(e)}static async verify(e,r,a){let i=e;return typeof e=="string"&&(i=dV.default.toBuffer(e)),ql(Me.from(a),Me.from(r),Me.from(i))}};ie();ae();ne();ie();ae();ne();ie();ae();ne();ie();ae();ne();var SV=gi(pV());ie();ae();ne();ie();ae();ne();ie();ae();ne();var vV="logger/5.7.0";var mV=!1,gV=!1,x3={debug:1,default:2,info:2,warning:3,error:4,off:5},bV=x3.default,lA=null;function nbe(){try{let t=[];if(["NFD","NFC","NFKD","NFKC"].forEach(e=>{try{if("test".normalize(e)!=="test")throw new Error("bad normalize")}catch{t.push(e)}}),t.length)throw new Error("missing "+t.join(", "));if("\xE9".normalize("NFD")!=="e\u0301")throw new Error("broken implementation")}catch(t){return t.message}return null}var yV=nbe(),cA;(function(t){t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR",t.OFF="OFF"})(cA||(cA={}));var gf;(function(t){t.UNKNOWN_ERROR="UNKNOWN_ERROR",t.NOT_IMPLEMENTED="NOT_IMPLEMENTED",t.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",t.NETWORK_ERROR="NETWORK_ERROR",t.SERVER_ERROR="SERVER_ERROR",t.TIMEOUT="TIMEOUT",t.BUFFER_OVERRUN="BUFFER_OVERRUN",t.NUMERIC_FAULT="NUMERIC_FAULT",t.MISSING_NEW="MISSING_NEW",t.INVALID_ARGUMENT="INVALID_ARGUMENT",t.MISSING_ARGUMENT="MISSING_ARGUMENT",t.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",t.CALL_EXCEPTION="CALL_EXCEPTION",t.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",t.NONCE_EXPIRED="NONCE_EXPIRED",t.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",t.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",t.TRANSACTION_REPLACED="TRANSACTION_REPLACED",t.ACTION_REJECTED="ACTION_REJECTED"})(gf||(gf={}));var wV="0123456789abcdef",er=class t{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,r){let a=e.toLowerCase();x3[a]==null&&this.throwArgumentError("invalid log level name","logLevel",e),!(bV>x3[a])&&console.log.apply(console,r)}debug(...e){this._log(t.levels.DEBUG,e)}info(...e){this._log(t.levels.INFO,e)}warn(...e){this._log(t.levels.WARNING,e)}makeError(e,r,a){if(gV)return this.makeError("censored error",r,{});r||(r=t.errors.UNKNOWN_ERROR),a||(a={});let i=[];Object.keys(a).forEach(b=>{let g=a[b];try{if(g instanceof Uint8Array){let y="";for(let M=0;M<g.length;M++)y+=wV[g[M]>>4],y+=wV[g[M]&15];i.push(b+"=Uint8Array(0x"+y+")")}else i.push(b+"="+JSON.stringify(g))}catch{i.push(b+"="+JSON.stringify(a[b].toString()))}}),i.push(`code=${r}`),i.push(`version=${this.version}`);let h=e,l="";switch(r){case gf.NUMERIC_FAULT:{l="NUMERIC_FAULT";let b=e;switch(b){case"overflow":case"underflow":case"division-by-zero":l+="-"+b;break;case"negative-power":case"negative-width":l+="-unsupported";break;case"unbound-bitwise-result":l+="-unbound-result";break}break}case gf.CALL_EXCEPTION:case gf.INSUFFICIENT_FUNDS:case gf.MISSING_NEW:case gf.NONCE_EXPIRED:case gf.REPLACEMENT_UNDERPRICED:case gf.TRANSACTION_REPLACED:case gf.UNPREDICTABLE_GAS_LIMIT:l=r;break}l&&(e+=" [ See: https://links.ethers.org/v5-errors-"+l+" ]"),i.length&&(e+=" ("+i.join(", ")+")");let p=new Error(e);return p.reason=h,p.code=r,Object.keys(a).forEach(function(b){p[b]=a[b]}),p}throwError(e,r,a){throw this.makeError(e,r,a)}throwArgumentError(e,r,a){return this.throwError(e,t.errors.INVALID_ARGUMENT,{argument:r,value:a})}assert(e,r,a,i){e||this.throwError(r,a,i)}assertArgument(e,r,a,i){e||this.throwArgumentError(r,a,i)}checkNormalize(e){e==null&&(e="platform missing String.prototype.normalize"),yV&&this.throwError("platform missing String.prototype.normalize",t.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:yV})}checkSafeUint53(e,r){typeof e=="number"&&(r==null&&(r="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(r,t.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(r,t.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,r,a){a?a=": "+a:a="",e<r&&this.throwError("missing argument"+a,t.errors.MISSING_ARGUMENT,{count:e,expectedCount:r}),e>r&&this.throwError("too many arguments"+a,t.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:r})}checkNew(e,r){(e===Object||e==null)&&this.throwError("missing new",t.errors.MISSING_NEW,{name:r.name})}checkAbstract(e,r){e===r?this.throwError("cannot instantiate abstract class "+JSON.stringify(r.name)+" directly; use a sub-class",t.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):(e===Object||e==null)&&this.throwError("missing new",t.errors.MISSING_NEW,{name:r.name})}static globalLogger(){return lA||(lA=new t(vV)),lA}static setCensorship(e,r){if(!e&&r&&this.globalLogger().throwError("cannot permanently disable censorship",t.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),mV){if(!e)return;this.globalLogger().throwError("error censorship permanent",t.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}gV=!!e,mV=!!r}static setLogLevel(e){let r=x3[e.toLowerCase()];if(r==null){t.globalLogger().warn("invalid log level - "+e);return}bV=r}static from(e){return new t(e)}};er.errors=gf;er.levels=cA;ie();ae();ne();var _V="bytes/5.7.0";var En=new er(_V);function xV(t){return!!t.toHexString}function jp(t){return t.slice||(t.slice=function(){let e=Array.prototype.slice.call(arguments);return jp(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}function Um(t){return $n(t)&&!(t.length%2)||Fm(t)}function MV(t){return typeof t=="number"&&t==t&&t%1===0}function Fm(t){if(t==null)return!1;if(t.constructor===Uint8Array)return!0;if(typeof t=="string"||!MV(t.length)||t.length<0)return!1;for(let e=0;e<t.length;e++){let r=t[e];if(!MV(r)||r<0||r>=256)return!1}return!0}function Ct(t,e){if(e||(e={}),typeof t=="number"){En.checkSafeUint53(t,"invalid arrayify value");let r=[];for(;t;)r.unshift(t&255),t=parseInt(String(t/256));return r.length===0&&r.push(0),jp(new Uint8Array(r))}if(e.allowMissingPrefix&&typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),xV(t)&&(t=t.toHexString()),$n(t)){let r=t.substring(2);r.length%2&&(e.hexPad==="left"?r="0"+r:e.hexPad==="right"?r+="0":En.throwArgumentError("hex data is odd-length","value",t));let a=[];for(let i=0;i<r.length;i+=2)a.push(parseInt(r.substring(i,i+2),16));return jp(new Uint8Array(a))}return Fm(t)?jp(new Uint8Array(t)):En.throwArgumentError("invalid arrayify value","value",t)}function Ao(t){let e=t.map(i=>Ct(i)),r=e.reduce((i,h)=>i+h.length,0),a=new Uint8Array(r);return e.reduce((i,h)=>(a.set(h,i),i+h.length),0),jp(a)}function mu(t){let e=Ct(t);if(e.length===0)return e;let r=0;for(;r<e.length&&e[r]===0;)r++;return r&&(e=e.slice(r)),e}function abe(t,e){t=Ct(t),t.length>e&&En.throwArgumentError("value out of range","value",arguments[0]);let r=new Uint8Array(e);return r.set(t,e-t.length),jp(r)}function $n(t,e){return!(typeof t!="string"||!t.match(/^0x[0-9A-Fa-f]*$/)||e&&t.length!==2+2*e)}var dA="0123456789abcdef";function sr(t,e){if(e||(e={}),typeof t=="number"){En.checkSafeUint53(t,"invalid hexlify value");let r="";for(;t;)r=dA[t&15]+r,t=Math.floor(t/16);return r.length?(r.length%2&&(r="0"+r),"0x"+r):"0x00"}if(typeof t=="bigint")return t=t.toString(16),t.length%2?"0x0"+t:"0x"+t;if(e.allowMissingPrefix&&typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),xV(t))return t.toHexString();if($n(t))return t.length%2&&(e.hexPad==="left"?t="0x0"+t.substring(2):e.hexPad==="right"?t+="0":En.throwArgumentError("hex data is odd-length","value",t)),t.toLowerCase();if(Fm(t)){let r="0x";for(let a=0;a<t.length;a++){let i=t[a];r+=dA[(i&240)>>4]+dA[i&15]}return r}return En.throwArgumentError("invalid hexlify value","value",t)}function jm(t){if(typeof t!="string")t=sr(t);else if(!$n(t)||t.length%2)return null;return(t.length-2)/2}function Mh(t,e,r){return typeof t!="string"?t=sr(t):(!$n(t)||t.length%2)&&En.throwArgumentError("invalid hexData","value",t),e=2+2*e,r!=null?"0x"+t.substring(e,2+2*r):"0x"+t.substring(e)}function Kl(t){let e="0x";return t.forEach(r=>{e+=sr(r).substring(2)}),e}function Ea(t,e){for(typeof t!="string"?t=sr(t):$n(t)||En.throwArgumentError("invalid hex string","value",t),t.length>2*e+2&&En.throwArgumentError("value out of range","value",arguments[1]);t.length<2*e+2;)t="0x0"+t.substring(2);return t}function Wl(t){let e={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(Um(t)){let r=Ct(t);r.length===64?(e.v=27+(r[32]>>7),r[32]&=127,e.r=sr(r.slice(0,32)),e.s=sr(r.slice(32,64))):r.length===65?(e.r=sr(r.slice(0,32)),e.s=sr(r.slice(32,64)),e.v=r[64]):En.throwArgumentError("invalid signature string","signature",t),e.v<27&&(e.v===0||e.v===1?e.v+=27:En.throwArgumentError("signature invalid v byte","signature",t)),e.recoveryParam=1-e.v%2,e.recoveryParam&&(r[32]|=128),e._vs=sr(r.slice(32,64))}else{if(e.r=t.r,e.s=t.s,e.v=t.v,e.recoveryParam=t.recoveryParam,e._vs=t._vs,e._vs!=null){let i=abe(Ct(e._vs),32);e._vs=sr(i);let h=i[0]>=128?1:0;e.recoveryParam==null?e.recoveryParam=h:e.recoveryParam!==h&&En.throwArgumentError("signature recoveryParam mismatch _vs","signature",t),i[0]&=127;let l=sr(i);e.s==null?e.s=l:e.s!==l&&En.throwArgumentError("signature v mismatch _vs","signature",t)}if(e.recoveryParam==null)e.v==null?En.throwArgumentError("signature missing v and recoveryParam","signature",t):e.v===0||e.v===1?e.recoveryParam=e.v:e.recoveryParam=1-e.v%2;else if(e.v==null)e.v=27+e.recoveryParam;else{let i=e.v===0||e.v===1?e.v:1-e.v%2;e.recoveryParam!==i&&En.throwArgumentError("signature recoveryParam mismatch v","signature",t)}e.r==null||!$n(e.r)?En.throwArgumentError("signature missing or invalid r","signature",t):e.r=Ea(e.r,32),e.s==null||!$n(e.s)?En.throwArgumentError("signature missing or invalid s","signature",t):e.s=Ea(e.s,32);let r=Ct(e.s);r[0]>=128&&En.throwArgumentError("signature s out of range","signature",t),e.recoveryParam&&(r[0]|=128);let a=sr(r);e._vs&&($n(e._vs)||En.throwArgumentError("signature invalid _vs","signature",t),e._vs=Ea(e._vs,32)),e._vs==null?e._vs=a:e._vs!==a&&En.throwArgumentError("signature _vs mismatch v and s","signature",t)}return e.yParityAndS=e._vs,e.compact=e.r+e.yParityAndS.substring(2),e}function pA(t){return t=Wl(t),sr(Ao([t.r,t.s,t.recoveryParam?"0x1c":"0x1b"]))}function rn(t){return"0x"+SV.default.keccak_256(Ct(t))}ie();ae();ne();ie();ae();ne();ie();ae();ne();var IV=gi(AV());ie();ae();ne();var RV="bignumber/5.7.0";var S3=IV.default.BN,xh=new er(RV),mA={},TV=9007199254740991;var kV=!1,nn=class t{constructor(e,r){e!==mA&&xh.throwError("cannot call constructor directly; use BigNumber.from",er.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=r,this._isBigNumber=!0,Object.freeze(this)}fromTwos(e){return to(Xr(this).fromTwos(e))}toTwos(e){return to(Xr(this).toTwos(e))}abs(){return this._hex[0]==="-"?t.from(this._hex.substring(1)):this}add(e){return to(Xr(this).add(Xr(e)))}sub(e){return to(Xr(this).sub(Xr(e)))}div(e){return t.from(e).isZero()&&ys("division-by-zero","div"),to(Xr(this).div(Xr(e)))}mul(e){return to(Xr(this).mul(Xr(e)))}mod(e){let r=Xr(e);return r.isNeg()&&ys("division-by-zero","mod"),to(Xr(this).umod(r))}pow(e){let r=Xr(e);return r.isNeg()&&ys("negative-power","pow"),to(Xr(this).pow(r))}and(e){let r=Xr(e);return(this.isNegative()||r.isNeg())&&ys("unbound-bitwise-result","and"),to(Xr(this).and(r))}or(e){let r=Xr(e);return(this.isNegative()||r.isNeg())&&ys("unbound-bitwise-result","or"),to(Xr(this).or(r))}xor(e){let r=Xr(e);return(this.isNegative()||r.isNeg())&&ys("unbound-bitwise-result","xor"),to(Xr(this).xor(r))}mask(e){return(this.isNegative()||e<0)&&ys("negative-width","mask"),to(Xr(this).maskn(e))}shl(e){return(this.isNegative()||e<0)&&ys("negative-width","shl"),to(Xr(this).shln(e))}shr(e){return(this.isNegative()||e<0)&&ys("negative-width","shr"),to(Xr(this).shrn(e))}eq(e){return Xr(this).eq(Xr(e))}lt(e){return Xr(this).lt(Xr(e))}lte(e){return Xr(this).lte(Xr(e))}gt(e){return Xr(this).gt(Xr(e))}gte(e){return Xr(this).gte(Xr(e))}isNegative(){return this._hex[0]==="-"}isZero(){return Xr(this).isZero()}toNumber(){try{return Xr(this).toNumber()}catch{ys("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch{}return xh.throwError("this platform does not support BigInt",er.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(arguments[0]===10?kV||(kV=!0,xh.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):arguments[0]===16?xh.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",er.errors.UNEXPECTED_ARGUMENT,{}):xh.throwError("BigNumber.toString does not accept parameters",er.errors.UNEXPECTED_ARGUMENT,{})),Xr(this).toString(10)}toHexString(){return this._hex}toJSON(e){return{type:"BigNumber",hex:this.toHexString()}}static from(e){if(e instanceof t)return e;if(typeof e=="string")return e.match(/^-?0x[0-9a-f]+$/i)?new t(mA,zm(e)):e.match(/^-?[0-9]+$/)?new t(mA,zm(new S3(e))):xh.throwArgumentError("invalid BigNumber string","value",e);if(typeof e=="number")return e%1&&ys("underflow","BigNumber.from",e),(e>=TV||e<=-TV)&&ys("overflow","BigNumber.from",e),t.from(String(e));let r=e;if(typeof r=="bigint")return t.from(r.toString());if(Fm(r))return t.from(sr(r));if(r)if(r.toHexString){let a=r.toHexString();if(typeof a=="string")return t.from(a)}else{let a=r._hex;if(a==null&&r.type==="BigNumber"&&(a=r.hex),typeof a=="string"&&($n(a)||a[0]==="-"&&$n(a.substring(1))))return t.from(a)}return xh.throwArgumentError("invalid BigNumber value","value",e)}static isBigNumber(e){return!!(e&&e._isBigNumber)}};function zm(t){if(typeof t!="string")return zm(t.toString(16));if(t[0]==="-")return t=t.substring(1),t[0]==="-"&&xh.throwArgumentError("invalid hex","value",t),t=zm(t),t==="0x00"?t:"-"+t;if(t.substring(0,2)!=="0x"&&(t="0x"+t),t==="0x")return"0x00";for(t.length%2&&(t="0x0"+t.substring(2));t.length>4&&t.substring(0,4)==="0x00";)t="0x"+t.substring(4);return t}function to(t){return nn.from(zm(t))}function Xr(t){let e=nn.from(t).toHexString();return e[0]==="-"?new S3("-"+e.substring(3),16):new S3(e.substring(2),16)}function ys(t,e,r){let a={fault:t,operation:e};return r!=null&&(a.value=r),xh.throwError(t,er.errors.NUMERIC_FAULT,a)}function gA(t){return new S3(t,36).toString(16)}ie();ae();ne();ie();ae();ne();var BV="strings/5.7.0";var PV=new er(BV),gu;(function(t){t.current="",t.NFC="NFC",t.NFD="NFD",t.NFKC="NFKC",t.NFKD="NFKD"})(gu||(gu={}));var R0;(function(t){t.UNEXPECTED_CONTINUE="unexpected continuation byte",t.BAD_PREFIX="bad codepoint prefix",t.OVERRUN="string overrun",t.MISSING_CONTINUE="missing continuation byte",t.OUT_OF_RANGE="out of UTF-8 range",t.UTF16_SURROGATE="UTF-16 surrogate",t.OVERLONG="overlong representation"})(R0||(R0={}));function sbe(t,e,r,a,i){return PV.throwArgumentError(`invalid codepoint at offset ${e}; ${t}`,"bytes",r)}function OV(t,e,r,a,i){if(t===R0.BAD_PREFIX||t===R0.UNEXPECTED_CONTINUE){let h=0;for(let l=e+1;l<r.length&&r[l]>>6===2;l++)h++;return h}return t===R0.OVERRUN?r.length-e-1:0}function fbe(t,e,r,a,i){return t===R0.OVERLONG?(a.push(i),0):(a.push(65533),OV(t,e,r,a,i))}var ube=Object.freeze({error:sbe,ignore:OV,replace:fbe});function Ca(t,e=gu.current){e!=gu.current&&(PV.checkNormalize(),t=t.normalize(e));let r=[];for(let a=0;a<t.length;a++){let i=t.charCodeAt(a);if(i<128)r.push(i);else if(i<2048)r.push(i>>6|192),r.push(i&63|128);else if((i&64512)==55296){a++;let h=t.charCodeAt(a);if(a>=t.length||(h&64512)!==56320)throw new Error("invalid utf-8 string");let l=65536+((i&1023)<<10)+(h&1023);r.push(l>>18|240),r.push(l>>12&63|128),r.push(l>>6&63|128),r.push(l&63|128)}else r.push(i>>12|224),r.push(i>>6&63|128),r.push(i&63|128)}return Ct(r)}function zp(t){return rn(Ca(t))}ie();ae();ne();var NV="hash/5.7.0";ie();ae();ne();var CV=`Ethereum Signed Message:
127
+ ${JSON.stringify(Me.from(r))},${JSON.stringify(Me.from(a))},${h} => ${JSON.stringify(p)}`;return Mfe(l,b)}Fr.debug=Mfe});var $w=ht($o=>{"use strict";ie();ae();ne();var lqe=$o&&$o.__createBinding||(Object.create?function(t,e,r,a){a===void 0&&(a=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,a,i)}:function(t,e,r,a){a===void 0&&(a=r),t[a]=e[r]}),cqe=$o&&$o.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),dqe=$o&&$o.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&lqe(e,t,r);return cqe(e,t),e},pqe=$o&&$o.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty($o,"__esModule",{value:!0});$o.Tag=void 0;var jn=dqe(el()),vqe=pqe(bfe()),mqe=YB(),Dw=class{get(e,r){if(!Object.getOwnPropertyNames(this).includes(e))throw new Error(`Field "${e}" is not a property of the Arweave Transaction class.`);if(this[e]instanceof Uint8Array)return r&&r.decode&&r.string?jn.bufferToString(this[e]):r&&r.decode&&!r.string?this[e]:jn.bufferTob64Url(this[e]);if(this[e]instanceof Array){if(r?.decode!==void 0||r?.string!==void 0)throw e==="tags"&&console.warn(`Did you mean to use 'transaction["tags"]' ?`),new Error("Cannot decode or stringify an array.");return this[e]}return r&&r.decode==!0?r&&r.string?jn.b64UrlToString(this[e]):jn.b64UrlToBuffer(this[e]):this[e]}},_b=class extends Dw{name;value;constructor(e,r,a=!1){super(),this.name=e,this.value=r}};$o.Tag=_b;var JB=class extends Dw{format=2;id="";last_tx="";owner="";tags=[];target="";quantity="0";data_size="0";data=new Uint8Array;data_root="";reward="0";signature="";chunks;constructor(e={}){super(),Object.assign(this,e),typeof this.data=="string"&&(this.data=jn.b64UrlToBuffer(this.data)),e.tags&&(this.tags=e.tags.map(r=>new _b(r.name,r.value)))}addTag(e,r){this.tags.push(new _b(jn.stringToB64Url(e),jn.stringToB64Url(r)))}toJSON(){return{format:this.format,id:this.id,last_tx:this.last_tx,owner:this.owner,tags:this.tags,target:this.target,quantity:this.quantity,data:jn.bufferTob64Url(this.data),data_size:this.data_size,data_root:this.data_root,data_tree:this.data_tree,reward:this.reward,signature:this.signature}}setOwner(e){this.owner=e}setSignature({id:e,owner:r,reward:a,tags:i,signature:h}){this.id=e,this.owner=r,a&&(this.reward=a),i&&(this.tags=i),this.signature=h}async prepareChunks(e){!this.chunks&&e.byteLength>0&&(this.chunks=await(0,mqe.generateTransactionChunks)(e),this.data_root=jn.bufferTob64Url(this.chunks.data_root)),!this.chunks&&e.byteLength===0&&(this.chunks={chunks:[],data_root:new Uint8Array,proofs:[]},this.data_root="")}getChunk(e,r){if(!this.chunks)throw new Error("Chunks have not been prepared");let a=this.chunks.proofs[e],i=this.chunks.chunks[e];return{data_root:this.data_root,data_size:this.data_size,data_path:jn.bufferTob64Url(a.proof),offset:a.offset.toString(),chunk:jn.bufferTob64Url(r.slice(i.minByteRange,i.maxByteRange))}}async getSignatureData(){switch(this.format){case 1:let e=this.tags.reduce((a,i)=>jn.concatBuffers([a,i.get("name",{decode:!0,string:!1}),i.get("value",{decode:!0,string:!1})]),new Uint8Array);return jn.concatBuffers([this.get("owner",{decode:!0,string:!1}),this.get("target",{decode:!0,string:!1}),this.get("data",{decode:!0,string:!1}),jn.stringToBuffer(this.quantity),jn.stringToBuffer(this.reward),this.get("last_tx",{decode:!0,string:!1}),e]);case 2:this.data_root||await this.prepareChunks(this.data);let r=this.tags.map(a=>[a.get("name",{decode:!0,string:!1}),a.get("value",{decode:!0,string:!1})]);return await(0,vqe.default)([jn.stringToBuffer(this.format.toString()),this.get("owner",{decode:!0,string:!1}),this.get("target",{decode:!0,string:!1}),jn.stringToBuffer(this.quantity),jn.stringToBuffer(this.reward),this.get("last_tx",{decode:!0,string:!1}),r,jn.stringToBuffer(this.data_size),this.get("data_root",{decode:!0,string:!1})]);default:throw new Error(`Unexpected transaction format: ${this.format}`)}}};$o.default=JB});var Afe=ht(Zs=>{"use strict";ie();ae();ne();var gqe=Zs&&Zs.__createBinding||(Object.create?function(t,e,r,a){a===void 0&&(a=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,a,i)}:function(t,e,r,a){a===void 0&&(a=r),t[a]=e[r]}),bqe=Zs&&Zs.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),yqe=Zs&&Zs.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&gqe(e,t,r);return bqe(e,t),e},wqe=Zs&&Zs.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Zs,"__esModule",{value:!0});Zs.TransactionUploader=void 0;var xfe=wqe($w()),_qe=yqe(el()),XB=mb(),Mqe=YB(),Sfe=1,xqe=["invalid_json","chunk_too_big","data_path_too_big","offset_too_big","data_size_too_big","chunk_proof_ratio_not_attractive","invalid_proof"],Efe=1e3*40,QB=class t{api;chunkIndex=0;txPosted=!1;transaction;lastRequestTimeEnd=0;totalErrors=0;data;lastResponseStatus=0;lastResponseError="";get isComplete(){return this.txPosted&&this.chunkIndex===this.transaction.chunks.chunks.length}get totalChunks(){return this.transaction.chunks.chunks.length}get uploadedChunks(){return this.chunkIndex}get pctComplete(){return Math.trunc(this.uploadedChunks/this.totalChunks*100)}constructor(e,r){if(this.api=e,!r.id)throw new Error("Transaction is not signed");if(!r.chunks)throw new Error("Transaction chunks not prepared");this.data=r.data,this.transaction=new xfe.default(Object.assign({},r,{data:new Uint8Array(0)}))}async uploadChunk(e){if(this.isComplete)throw new Error("Upload is already complete");if(this.lastResponseError!==""?this.totalErrors++:this.totalErrors=0,this.totalErrors===100)throw new Error(`Unable to complete upload: ${this.lastResponseStatus}: ${this.lastResponseError}`);let r=this.lastResponseError===""?0:Math.max(this.lastRequestTimeEnd+Efe-Date.now(),Efe);if(r>0&&(r=r-r*Math.random()*.3,await new Promise(l=>setTimeout(l,r))),this.lastResponseError="",!this.txPosted){await this.postTransaction();return}e&&(this.chunkIndex=e);let a=this.transaction.getChunk(e||this.chunkIndex,this.data);if(!await(0,Mqe.validatePath)(this.transaction.chunks.data_root,parseInt(a.offset),0,parseInt(a.data_size),_qe.b64UrlToBuffer(a.data_path)))throw new Error(`Unable to validate chunk ${this.chunkIndex}`);let h=await this.api.post("chunk",this.transaction.getChunk(this.chunkIndex,this.data)).catch(l=>(console.error(l.message),{status:-1,data:{error:l.message}}));if(this.lastRequestTimeEnd=Date.now(),this.lastResponseStatus=h.status,this.lastResponseStatus==200)this.chunkIndex++;else if(this.lastResponseError=(0,XB.getError)(h),xqe.includes(this.lastResponseError))throw new Error(`Fatal error uploading chunk ${this.chunkIndex}: ${this.lastResponseError}`)}static async fromSerialized(e,r,a){if(!r||typeof r.chunkIndex!="number"||typeof r.transaction!="object")throw new Error("Serialized object does not match expected format.");var i=new xfe.default(r.transaction);i.chunks||await i.prepareChunks(a);let h=new t(e,i);if(h.chunkIndex=r.chunkIndex,h.lastRequestTimeEnd=r.lastRequestTimeEnd,h.lastResponseError=r.lastResponseError,h.lastResponseStatus=r.lastResponseStatus,h.txPosted=r.txPosted,h.data=a,h.transaction.data_root!==r.transaction.data_root)throw new Error("Data mismatch: Uploader doesn't match provided data.");return h}static async fromTransactionId(e,r){let a=await e.get(`tx/${r}`);if(a.status!==200)throw new Error(`Tx ${r} not found: ${a.status}`);let i=a.data;return i.data=new Uint8Array(0),{txPosted:!0,chunkIndex:0,lastResponseError:"",lastRequestTimeEnd:0,lastResponseStatus:0,transaction:i}}toJSON(){return{chunkIndex:this.chunkIndex,transaction:this.transaction,lastRequestTimeEnd:this.lastRequestTimeEnd,lastResponseStatus:this.lastResponseStatus,lastResponseError:this.lastResponseError,txPosted:this.txPosted}}async postTransaction(){if(this.totalChunks<=Sfe){this.transaction.data=this.data;let a=await this.api.post("tx",this.transaction).catch(i=>(console.error(i),{status:-1,data:{error:i.message}}));if(this.lastRequestTimeEnd=Date.now(),this.lastResponseStatus=a.status,this.transaction.data=new Uint8Array(0),a.status>=200&&a.status<300){this.txPosted=!0,this.chunkIndex=Sfe;return}throw this.lastResponseError=(0,XB.getError)(a),new Error(`Unable to upload transaction: ${a.status}, ${this.lastResponseError}`)}let r=await this.api.post("tx",this.transaction);if(this.lastRequestTimeEnd=Date.now(),this.lastResponseStatus=r.status,!(r.status>=200&&r.status<300))throw this.lastResponseError=(0,XB.getError)(r),new Error(`Unable to upload transaction: ${r.status}, ${this.lastResponseError}`);this.txPosted=!0}};Zs.TransactionUploader=QB});var qw=ht((X2t,Rfe)=>{"use strict";ie();ae();ne();Rfe.exports={}});var kfe=ht(Hf=>{"use strict";ie();ae();ne();var Sqe=Hf&&Hf.__createBinding||(Object.create?function(t,e,r,a){a===void 0&&(a=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,a,i)}:function(t,e,r,a){a===void 0&&(a=r),t[a]=e[r]}),Eqe=Hf&&Hf.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Aqe=Hf&&Hf.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&Sqe(e,t,r);return Eqe(e,t),e},Tfe=Hf&&Hf.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Hf,"__esModule",{value:!0});var eP=Tfe(mb()),tl=Tfe($w()),Mb=Aqe(el()),tP=Afe();qw();var rP=class{api;crypto;chunks;constructor(e,r,a){this.api=e,this.crypto=r,this.chunks=a}async getTransactionAnchor(){let e=await this.api.get("tx_anchor");if(!e.data.match(/^[a-z0-9_-]{43,}/i)||!e.ok)throw new Error(`Could not getTransactionAnchor. Received: ${e.data}. Status: ${e.status}, ${e.statusText}`);return e.data}async getPrice(e,r){let a=r?`price/${e}/${r}`:`price/${e}`,i=await this.api.get(a);if(!/^\d+$/.test(i.data)||!i.ok)throw new Error(`Could not getPrice. Received: ${i.data}. Status: ${i.status}, ${i.statusText}`);return i.data}async get(e){let r=await this.api.get(`tx/${e}`);if(r.status==200){let a=parseInt(r.data.data_size);if(r.data.format>=2&&a>0&&a<=1024*1024*12){let i=await this.getData(e);return new tl.default({...r.data,data:i})}return new tl.default({...r.data,format:r.data.format||1})}throw r.status==404?new eP.default("TX_NOT_FOUND"):r.status==410?new eP.default("TX_FAILED"):new eP.default("TX_INVALID")}fromRaw(e){return new tl.default(e)}async search(e,r){return this.api.post("arql",{op:"equals",expr1:e,expr2:r}).then(a=>a.data?a.data:[])}getStatus(e){return this.api.get(`tx/${e}/status`).then(r=>r.status==200?{status:200,confirmed:r.data}:{status:r.status,confirmed:null})}async getData(e,r){let a;try{a=await this.chunks.downloadChunkedData(e)}catch(i){console.error(`Error while trying to download chunked data for ${e}`),console.error(i)}if(!a){console.warn(`Falling back to gateway cache for ${e}`);try{let{data:i,ok:h,status:l,statusText:p}=await this.api.get(`/${e}`,{responseType:"arraybuffer"});if(!h)throw new Error("Bad http status code",{cause:{status:l,statusText:p}});a=i}catch(i){console.error(`Error while trying to download contiguous data from gateway cache for ${e}`),console.error(i)}}if(!a)throw new Error(`${e} data was not found!`);return r&&r.decode&&!r.string?a:r&&r.decode&&r.string?Mb.bufferToString(a):Mb.bufferTob64Url(a)}async sign(e,r,a){let h=typeof r=="object"&&(p=>{let b=!0;return["n","e","d","p","q","dp","dq","qi"].map(g=>!(g in p)&&(b=!1)),b})(r),l=typeof arweaveWallet=="object";if(!h&&!l)throw new Error("No valid JWK or external wallet found to sign transaction.");if(h){e.setOwner(r.n);let p=await e.getSignatureData(),b=await this.crypto.sign(r,p,a),g=await this.crypto.hash(b);e.setSignature({id:Mb.bufferTob64Url(g),owner:r.n,signature:Mb.bufferTob64Url(b)})}else if(l){try{(await arweaveWallet.getPermissions()).includes("SIGN_TRANSACTION")||await arweaveWallet.connect(["SIGN_TRANSACTION"])}catch{}let p=await arweaveWallet.sign(e,a);e.setSignature({id:p.id,owner:p.owner,reward:p.reward,tags:p.tags,signature:p.signature})}else throw new Error("An error occurred while signing. Check wallet is valid")}async verify(e){let r=await e.getSignatureData(),a=e.get("signature",{decode:!0,string:!1}),i=Mb.bufferTob64Url(await this.crypto.hash(a));if(e.id!==i)throw new Error("Invalid transaction signature or ID! The transaction ID doesn't match the expected SHA-256 hash of the signature.");return this.crypto.verify(e.owner,r,a)}async post(e){if(typeof e=="string"?e=new tl.default(JSON.parse(e)):typeof e.readInt32BE=="function"?e=new tl.default(JSON.parse(e.toString())):typeof e=="object"&&!(e instanceof tl.default)&&(e=new tl.default(e)),!(e instanceof tl.default))throw new Error("Must be Transaction object");e.chunks||await e.prepareChunks(e.data);let r=await this.getUploader(e,e.data);try{for(;!r.isComplete;)await r.uploadChunk()}catch(a){if(r.lastResponseStatus>0)return{status:r.lastResponseStatus,statusText:r.lastResponseError,data:{error:r.lastResponseError}};throw a}return{status:200,statusText:"OK",data:{}}}async getUploader(e,r){let a;if(r instanceof ArrayBuffer&&(r=new Uint8Array(r)),e instanceof tl.default){if(r||(r=e.data),!(r instanceof Uint8Array))throw new Error("Data format is invalid");e.chunks||await e.prepareChunks(r),a=new tP.TransactionUploader(this.api,e),(!a.data||a.data.length===0)&&(a.data=r)}else{if(typeof e=="string"&&(e=await tP.TransactionUploader.fromTransactionId(this.api,e)),!r||!(r instanceof Uint8Array))throw new Error("Must provide data when resuming upload");a=await tP.TransactionUploader.fromSerialized(this.api,e,r)}return a}async*upload(e,r){let a=await this.getUploader(e,r);for(;!a.isComplete;)await a.uploadChunk(),yield a;return a}};Hf.default=rP});var Bfe=ht(rl=>{"use strict";ie();ae();ne();var Rqe=rl&&rl.__createBinding||(Object.create?function(t,e,r,a){a===void 0&&(a=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,a,i)}:function(t,e,r,a){a===void 0&&(a=r),t[a]=e[r]}),Tqe=rl&&rl.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),kqe=rl&&rl.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&Rqe(e,t,r);return Tqe(e,t),e};Object.defineProperty(rl,"__esModule",{value:!0});var Ife=kqe(el());qw();var iP=class{api;crypto;constructor(e,r){this.api=e,this.crypto=r}getBalance(e){return this.api.get(`wallet/${e}/balance`).then(r=>r.data)}getLastTransactionID(e){return this.api.get(`wallet/${e}/last_tx`).then(r=>r.data)}generate(){return this.crypto.generateJWK()}async jwkToAddress(e){return!e||e==="use_wallet"?this.getAddress():this.getAddress(e)}async getAddress(e){if(!e||e==="use_wallet"){try{await arweaveWallet.connect(["ACCESS_ADDRESS"])}catch{}return arweaveWallet.getActiveAddress()}else return this.ownerToAddress(e.n)}async ownerToAddress(e){return Ife.bufferTob64Url(await this.crypto.hash(Ife.b64UrlToBuffer(e)))}};rl.default=iP});var Ofe=ht(Kf=>{"use strict";ie();ae();ne();var Iqe=Kf&&Kf.__createBinding||(Object.create?function(t,e,r,a){a===void 0&&(a=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,a,i)}:function(t,e,r,a){a===void 0&&(a=r),t[a]=e[r]}),Bqe=Kf&&Kf.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Pqe=Kf&&Kf.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&Iqe(e,t,r);return Bqe(e,t),e};Object.defineProperty(Kf,"__esModule",{value:!0});Kf.SiloResource=void 0;var Pfe=Pqe(el()),nP=class{api;crypto;transactions;constructor(e,r,a){this.api=e,this.crypto=r,this.transactions=a}async get(e){if(!e)throw new Error("No Silo URI specified");let r=await this.parseUri(e),a=await this.transactions.search("Silo-Name",r.getAccessKey());if(a.length==0)throw new Error(`No data could be found for the Silo URI: ${e}`);let i=await this.transactions.get(a[0]);if(!i)throw new Error(`No data could be found for the Silo URI: ${e}`);let h=i.get("data",{decode:!0,string:!1});return this.crypto.decrypt(h,r.getEncryptionKey())}async readTransactionData(e,r){if(!r)throw new Error("No Silo URI specified");let a=await this.parseUri(r),i=e.get("data",{decode:!0,string:!1});return this.crypto.decrypt(i,a.getEncryptionKey())}async parseUri(e){let r=e.match(/^([a-z0-9-_]+)\.([0-9]+)/i);if(!r)throw new Error("Invalid Silo name, must be a name in the format of [a-z0-9]+.[0-9]+, e.g. 'bubble.7'");let a=r[1],i=Math.pow(2,parseInt(r[2])),h=await this.hash(Pfe.stringToBuffer(a),i),l=Pfe.bufferTob64(h.slice(0,15)),p=await this.hash(h.slice(16,31),1);return new Uw(e,l,p)}async hash(e,r){let a=await this.crypto.hash(e);for(let i=0;i<r-1;i++)a=await this.crypto.hash(a);return a}};Kf.default=nP;var Uw=class{uri;accessKey;encryptionKey;constructor(e,r,a){this.uri=e,this.accessKey=r,this.encryptionKey=a}getUri(){return this.uri}getAccessKey(){return this.accessKey}getEncryptionKey(){return this.encryptionKey}};Kf.SiloResource=Uw});var Cfe=ht(il=>{"use strict";ie();ae();ne();var Oqe=il&&il.__createBinding||(Object.create?function(t,e,r,a){a===void 0&&(a=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,a,i)}:function(t,e,r,a){a===void 0&&(a=r),t[a]=e[r]}),Nqe=il&&il.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Cqe=il&&il.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&Oqe(e,t,r);return Nqe(e,t),e};Object.defineProperty(il,"__esModule",{value:!0});var Nfe=mb(),Lqe=Cqe(el()),aP=class{api;constructor(e){this.api=e}async getTransactionOffset(e){let r=await this.api.get(`tx/${e}/offset`);if(r.status===200)return r.data;throw new Error(`Unable to get transaction offset: ${(0,Nfe.getError)(r)}`)}async getChunk(e){let r=await this.api.get(`chunk/${e}`);if(r.status===200)return r.data;throw new Error(`Unable to get chunk: ${(0,Nfe.getError)(r)}`)}async getChunkData(e){let r=await this.getChunk(e);return Lqe.b64UrlToBuffer(r.chunk)}firstChunkOffset(e){return parseInt(e.offset)-parseInt(e.size)+1}async downloadChunkedData(e){let r=await this.getTransactionOffset(e),a=parseInt(r.size),h=parseInt(r.offset)-a+1,l=new Uint8Array(a),p=0;for(;p<a;){this.api.config.logging&&console.log(`[chunk] ${p}/${a}`);let b;try{b=await this.getChunkData(h+p)}catch{console.error(`[chunk] Failed to fetch chunk at offset ${h+p}`),console.error("[chunk] This could indicate that the chunk wasn't uploaded or hasn't yet seeded properly to a particular gateway/node")}if(b)l.set(b,p),p+=b.length;else throw new Error(`Couldn't complete data download at ${p}/${a}`)}return l}};il.default=aP});var Dfe=ht(xb=>{"use strict";ie();ae();ne();var Dqe=xb&&xb.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(xb,"__esModule",{value:!0});var Lfe=Dqe(mb());qw();var oP=class t{api;network;static HASH_ENDPOINT="block/hash/";static HEIGHT_ENDPOINT="block/height/";constructor(e,r){this.api=e,this.network=r}async get(e){let r=await this.api.get(`${t.HASH_ENDPOINT}${e}`);if(r.status===200)return r.data;throw r.status===404?new Lfe.default("BLOCK_NOT_FOUND"):new Error(`Error while loading block data: ${r}`)}async getByHeight(e){let r=await this.api.get(`${t.HEIGHT_ENDPOINT}${e}`);if(r.status===200)return r.data;throw r.status===404?new Lfe.default("BLOCK_NOT_FOUND"):new Error(`Error while loading block data: ${r}`)}async getCurrent(){let{current:e}=await this.network.getInfo();return await this.get(e)}};xb.default=oP});var Nw=ht(Wf=>{"use strict";ie();ae();ne();var $qe=Wf&&Wf.__createBinding||(Object.create?function(t,e,r,a){a===void 0&&(a=r);var i=Object.getOwnPropertyDescriptor(e,r);(!i||("get"in i?!e.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,a,i)}:function(t,e,r,a){a===void 0&&(a=r),t[a]=e[r]}),qqe=Wf&&Wf.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Uqe=Wf&&Wf.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&$qe(e,t,r);return qqe(e,t),e},Vu=Wf&&Wf.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(Wf,"__esModule",{value:!0});var Fqe=Vu(Gse()),jqe=Vu(Yse()),zqe=Vu(ofe()),Zqe=Vu(sfe()),Hqe=Vu(kfe()),Kqe=Vu(Bfe()),$fe=Vu($w()),Sb=Uqe(el()),Wqe=Vu(Ofe()),Vqe=Vu(Cfe()),Gqe=Vu(Dfe()),sP=class t{api;wallets;transactions;network;blocks;ar;silo;chunks;static init;static crypto=new zqe.default;static utils=Sb;constructor(e){this.api=new jqe.default(e),this.wallets=new Kqe.default(this.api,t.crypto),this.chunks=new Vqe.default(this.api),this.transactions=new Hqe.default(this.api,t.crypto,this.chunks),this.silo=new Wqe.default(this.api,this.crypto,this.transactions),this.network=new Zqe.default(this.api),this.blocks=new Gqe.default(this.api,this.network),this.ar=new Fqe.default}get crypto(){return t.crypto}get utils(){return t.utils}getConfig(){return{api:this.api.getConfig(),crypto:null}}async createTransaction(e,r){let a={};if(Object.assign(a,e),!e.data&&!(e.target&&e.quantity))throw new Error("A new Arweave transaction must have a 'data' value, or 'target' and 'quantity' values.");if(e.owner==null&&r&&r!=="use_wallet"&&(a.owner=r.n),e.last_tx==null&&(a.last_tx=await this.transactions.getTransactionAnchor()),typeof e.data=="string"&&(e.data=Sb.stringToBuffer(e.data)),e.data instanceof ArrayBuffer&&(e.data=new Uint8Array(e.data)),e.data&&!(e.data instanceof Uint8Array))throw new Error("Expected data to be a string, Uint8Array or ArrayBuffer");if(e.reward==null){let h=e.data?e.data.byteLength:0;a.reward=await this.transactions.getPrice(h,a.target)}a.data_root="",a.data_size=e.data?e.data.byteLength.toString():"0",a.data=e.data||new Uint8Array(0);let i=new $fe.default(a);return await i.getSignatureData(),i}async createSiloTransaction(e,r,a){let i={};if(Object.assign(i,e),!e.data)throw new Error("Silo transactions must have a 'data' value");if(!a)throw new Error("No Silo URI specified.");if(e.target||e.quantity)throw new Error("Silo transactions can only be used for storing data, sending AR to other wallets isn't supported.");if(e.owner==null){if(!r||!r.n)throw new Error("A new Arweave transaction must either have an 'owner' attribute, or you must provide the jwk parameter.");i.owner=r.n}e.last_tx==null&&(i.last_tx=await this.transactions.getTransactionAnchor());let h=await this.silo.parseUri(a);if(typeof e.data=="string"){let p=await this.crypto.encrypt(Sb.stringToBuffer(e.data),h.getEncryptionKey());i.reward=await this.transactions.getPrice(p.byteLength),i.data=Sb.bufferTob64Url(p)}if(e.data instanceof Uint8Array){let p=await this.crypto.encrypt(e.data,h.getEncryptionKey());i.reward=await this.transactions.getPrice(p.byteLength),i.data=Sb.bufferTob64Url(p)}let l=new $fe.default(i);return l.addTag("Silo-Name",h.getAccessKey()),l.addTag("Silo-Version","0.1.0"),l}arql(e){return this.api.post("/arql",e).then(r=>r.data||[])}};Wf.default=sP});var Ufe=ht((uP,qfe)=>{"use strict";ie();ae();ne();var Yqe=uP&&uP.__importDefault||function(t){return t&&t.__esModule?t:{default:t}},fP=Yqe(Nw());fP.default.init=function(t={}){return new fP.default(t)};qfe.exports=fP.default});var Yfe=ht((H6t,vP)=>{"use strict";ie();ae();ne();var rUe=Object.prototype.hasOwnProperty,Za="~";function Ab(){}Object.create&&(Ab.prototype=Object.create(null),new Ab().__proto__||(Za=!1));function iUe(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function Gfe(t,e,r,a,i){if(typeof r!="function")throw new TypeError("The listener must be a function");var h=new iUe(r,a||t,i),l=Za?Za+e:e;return t._events[l]?t._events[l].fn?t._events[l]=[t._events[l],h]:t._events[l].push(h):(t._events[l]=h,t._eventsCount++),t}function Hw(t,e){--t._eventsCount===0?t._events=new Ab:delete t._events[e]}function Oa(){this._events=new Ab,this._eventsCount=0}Oa.prototype.eventNames=function(){var e=[],r,a;if(this._eventsCount===0)return e;for(a in r=this._events)rUe.call(r,a)&&e.push(Za?a.slice(1):a);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(r)):e};Oa.prototype.listeners=function(e){var r=Za?Za+e:e,a=this._events[r];if(!a)return[];if(a.fn)return[a.fn];for(var i=0,h=a.length,l=new Array(h);i<h;i++)l[i]=a[i].fn;return l};Oa.prototype.listenerCount=function(e){var r=Za?Za+e:e,a=this._events[r];return a?a.fn?1:a.length:0};Oa.prototype.emit=function(e,r,a,i,h,l){var p=Za?Za+e:e;if(!this._events[p])return!1;var b=this._events[p],g=arguments.length,y,M;if(b.fn){switch(b.once&&this.removeListener(e,b.fn,void 0,!0),g){case 1:return b.fn.call(b.context),!0;case 2:return b.fn.call(b.context,r),!0;case 3:return b.fn.call(b.context,r,a),!0;case 4:return b.fn.call(b.context,r,a,i),!0;case 5:return b.fn.call(b.context,r,a,i,h),!0;case 6:return b.fn.call(b.context,r,a,i,h,l),!0}for(M=1,y=new Array(g-1);M<g;M++)y[M-1]=arguments[M];b.fn.apply(b.context,y)}else{var x=b.length,E;for(M=0;M<x;M++)switch(b[M].once&&this.removeListener(e,b[M].fn,void 0,!0),g){case 1:b[M].fn.call(b[M].context);break;case 2:b[M].fn.call(b[M].context,r);break;case 3:b[M].fn.call(b[M].context,r,a);break;case 4:b[M].fn.call(b[M].context,r,a,i);break;default:if(!y)for(E=1,y=new Array(g-1);E<g;E++)y[E-1]=arguments[E];b[M].fn.apply(b[M].context,y)}}return!0};Oa.prototype.on=function(e,r,a){return Gfe(this,e,r,a,!1)};Oa.prototype.once=function(e,r,a){return Gfe(this,e,r,a,!0)};Oa.prototype.removeListener=function(e,r,a,i){var h=Za?Za+e:e;if(!this._events[h])return this;if(!r)return Hw(this,h),this;var l=this._events[h];if(l.fn)l.fn===r&&(!i||l.once)&&(!a||l.context===a)&&Hw(this,h);else{for(var p=0,b=[],g=l.length;p<g;p++)(l[p].fn!==r||i&&!l[p].once||a&&l[p].context!==a)&&b.push(l[p]);b.length?this._events[h]=b.length===1?b[0]:b:Hw(this,h)}return this};Oa.prototype.removeAllListeners=function(e){var r;return e?(r=Za?Za+e:e,this._events[r]&&Hw(this,r)):(this._events=new Ab,this._eventsCount=0),this};Oa.prototype.off=Oa.prototype.removeListener;Oa.prototype.addListener=Oa.prototype.on;Oa.prefixed=Za;Oa.EventEmitter=Oa;typeof vP<"u"&&(vP.exports=Oa)});ie();ae();ne();ie();ae();ne();var sT={};Ha(sT,{AVSCTap:()=>Sg,AlgorandSigner:()=>vg,AptosSigner:()=>gg,ArconnectSigner:()=>v1,Arweave:()=>MW.default,ArweaveSigner:()=>Hl,Bundle:()=>k8,BundleItem:()=>oT,CryptoDriver:()=>p3,Curve25519:()=>xo,DataItem:()=>A8,EthereumSigner:()=>Io,HexInjectedSolanaSigner:()=>J0,HexSolanaSigner:()=>mg,InjectedAptosSigner:()=>X0,InjectedEthereumSigner:()=>oR,InjectedSolanaSigner:()=>A0,InjectedTypedEthereumSigner:()=>rT,KyveSigner:()=>wg,MAX_TAG_BYTES:()=>E8,MIN_BINARY_SIZE:()=>R8,MultiSignatureAptosSigner:()=>Q0,NearSigner:()=>pg,PolygonSigner:()=>dg,Rsa4096:()=>S0,SIG_CONFIG:()=>Wr,SignatureConfig:()=>wr,Signer:()=>Jw,SolanaSigner:()=>Ih,Transaction:()=>_W.default,TypedEthereumSigner:()=>ed,bundleAndSignData:()=>V4e,byteArrayToLong:()=>yn,concatBuffers:()=>Pi.concatBuffers,createData:()=>Ag,deepHash:()=>Ul,deserializeTags:()=>m1,exportForTesting:()=>Z4e,getCryptoDriver:()=>xn,getSignatureAndId:()=>qX,indexToType:()=>_g,keccak256:()=>QR,longTo16ByteArray:()=>K4e,longTo32ByteArray:()=>S8,longTo8ByteArray:()=>x8,longToNByteArray:()=>xg,secp256k1:()=>Y0,serializeTags:()=>nT,shortTo2ByteArray:()=>iT,sign:()=>T8,stringToBuffer:()=>Pi.stringToBuffer,unbundleData:()=>W4e});ie();ae();ne();ie();ae();ne();ie();ae();ne();var Jw=class{publicKey;signatureType;signatureLength;ownerLength;pem;static verify(e,r,a,i){throw new Error("You must implement verify method on child")}};ie();ae();ne();ie();ae();ne();var CK=gi(qo(),1);ie();ae();ne();var wr;(function(t){t[t.ARWEAVE=1]="ARWEAVE",t[t.ED25519=2]="ED25519",t[t.ETHEREUM=3]="ETHEREUM",t[t.SOLANA=4]="SOLANA",t[t.INJECTEDAPTOS=5]="INJECTEDAPTOS",t[t.MULTIAPTOS=6]="MULTIAPTOS",t[t.TYPEDETHEREUM=7]="TYPEDETHEREUM",t[t.KYVE=101]="KYVE"})(wr||(wr={}));var Wr={[wr.ARWEAVE]:{sigLength:512,pubLength:512,sigName:"arweave"},[wr.ED25519]:{sigLength:64,pubLength:32,sigName:"ed25519"},[wr.ETHEREUM]:{sigLength:65,pubLength:65,sigName:"ethereum"},[wr.SOLANA]:{sigLength:64,pubLength:32,sigName:"solana"},[wr.INJECTEDAPTOS]:{sigLength:64,pubLength:32,sigName:"injectedAptos"},[wr.MULTIAPTOS]:{sigLength:64*32+4,pubLength:32*32+1,sigName:"multiAptos"},[wr.TYPEDETHEREUM]:{sigLength:65,pubLength:42,sigName:"typedEthereum"},[wr.KYVE]:{sigLength:65,pubLength:65,sigName:"kyve"}};ie();ae();ne();du();var Jn=BigInt(0),oi=BigInt(1),Dl=BigInt(2),xge=BigInt(8),RK=BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),Vi=Object.freeze({a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),P:BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),l:RK,n:RK,h:BigInt(8),Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960")});var PK=BigInt("0x10000000000000000000000000000000000000000000000000000000000000000"),xm=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752"),hje=BigInt("6853475219497561581579357271197624642482790079785650197046958215289687604742"),Sge=BigInt("25063068953384623474111414158702152701244531502492656460079210482610430750235"),Ege=BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578"),Age=BigInt("1159843021668779879193775521855586647937357759715417654439879720876111806838"),Rge=BigInt("40440834346308536858101042469323190826248399146238708352240133220865137265952"),Ln=class t{constructor(e,r,a,i){this.x=e,this.y=r,this.z=a,this.t=i}static fromAffine(e){if(!(e instanceof Mn))throw new TypeError("ExtendedPoint#fromAffine: expected Point");return e.equals(Mn.ZERO)?t.ZERO:new t(e.x,e.y,oi,Et(e.x*e.y))}static toAffineBatch(e){let r=Ige(e.map(a=>a.z));return e.map((a,i)=>a.toAffine(r[i]))}static normalizeZ(e){return this.toAffineBatch(e).map(this.fromAffine)}equals(e){kK(e);let{x:r,y:a,z:i}=this,{x:h,y:l,z:p}=e,b=Et(r*p),g=Et(h*i),y=Et(a*p),M=Et(l*i);return b===g&&y===M}negate(){return new t(Et(-this.x),this.y,this.z,Et(-this.t))}double(){let{x:e,y:r,z:a}=this,{a:i}=Vi,h=Et(e*e),l=Et(r*r),p=Et(Dl*Et(a*a)),b=Et(i*h),g=e+r,y=Et(Et(g*g)-h-l),M=b+l,x=M-p,E=b-l,A=Et(y*x),k=Et(M*E),P=Et(y*E),N=Et(x*M);return new t(A,k,N,P)}add(e){kK(e);let{x:r,y:a,z:i,t:h}=this,{x:l,y:p,z:b,t:g}=e,y=Et((a-r)*(p+l)),M=Et((a+r)*(p-l)),x=Et(M-y);if(x===Jn)return this.double();let E=Et(i*Dl*g),A=Et(h*Dl*b),k=A+E,P=M+y,N=A-E,L=Et(k*x),C=Et(P*N),Y=Et(k*N),G=Et(x*P);return new t(L,C,G,Y)}subtract(e){return this.add(e.negate())}precomputeWindow(e){let r=1+256/e,a=[],i=this,h=i;for(let l=0;l<r;l++){h=i,a.push(h);for(let p=1;p<2**(e-1);p++)h=h.add(i),a.push(h);i=h.double()}return a}wNAF(e,r){!r&&this.equals(t.BASE)&&(r=Mn.BASE);let a=r&&r._WINDOW_SIZE||1;if(256%a)throw new Error("Point#wNAF: Invalid precomputation window, must be power of 2");let i=r&&uE.get(r);i||(i=this.precomputeWindow(a),r&&a!==1&&(i=t.normalizeZ(i),uE.set(r,i)));let h=t.ZERO,l=t.BASE,p=1+256/a,b=2**(a-1),g=BigInt(2**a-1),y=2**a,M=BigInt(a);for(let x=0;x<p;x++){let E=x*b,A=Number(e&g);e>>=M,A>b&&(A-=y,e+=oi);let k=E,P=E+Math.abs(A)-1,N=x%2!==0,L=A<0;A===0?l=l.add(TK(N,i[k])):h=h.add(TK(L,i[P]))}return t.normalizeZ([h,l])[0]}multiply(e,r){return this.wNAF(r3(e,Vi.l),r)}multiplyUnsafe(e){let r=r3(e,Vi.l,!1),a=t.BASE,i=t.ZERO;if(r===Jn)return i;if(this.equals(i)||r===oi)return this;if(this.equals(a))return this.wNAF(r);let h=i,l=this;for(;r>Jn;)r&oi&&(h=h.add(l)),l=l.double(),r>>=oi;return h}isSmallOrder(){return this.multiplyUnsafe(Vi.h).equals(t.ZERO)}isTorsionFree(){let e=this.multiplyUnsafe(Vi.l/Dl).double();return Vi.l%Dl&&(e=e.add(this)),e.equals(t.ZERO)}toAffine(e){let{x:r,y:a,z:i}=this,h=this.equals(t.ZERO);e==null&&(e=h?xge:i3(i));let l=Et(r*e),p=Et(a*e),b=Et(i*e);if(h)return Mn.ZERO;if(b!==oi)throw new Error("invZ was invalid");return new Mn(l,p)}fromRistrettoBytes(){oE()}toRistrettoBytes(){oE()}fromRistrettoHash(){oE()}};Ln.BASE=new Ln(Vi.Gx,Vi.Gy,oi,Et(Vi.Gx*Vi.Gy));Ln.ZERO=new Ln(Jn,oi,oi,Jn);function TK(t,e){let r=e.negate();return t?r:e}function kK(t){if(!(t instanceof Ln))throw new TypeError("ExtendedPoint expected")}function aE(t){if(!(t instanceof M0))throw new TypeError("RistrettoPoint expected")}function oE(){throw new Error("Legacy method: switch to RistrettoPoint")}var M0=class t{constructor(e){this.ep=e}static calcElligatorRistrettoMap(e){let{d:r}=Vi,a=Et(xm*e*e),i=Et((a+oi)*Age),h=BigInt(-1),l=Et((h-r*a)*Et(a+r)),{isValid:p,value:b}=lE(i,l),g=Et(b*e);Ll(g)||(g=Et(-g)),p||(b=g),p||(h=a);let y=Et(h*(a-oi)*Rge-l),M=b*b,x=Et((b+b)*l),E=Et(y*Sge),A=Et(oi-M),k=Et(oi+M);return new Ln(Et(x*k),Et(A*E),Et(E*k),Et(x*A))}static hashToCurve(e){e=$l(e,64);let r=sE(e.slice(0,32)),a=this.calcElligatorRistrettoMap(r),i=sE(e.slice(32,64)),h=this.calcElligatorRistrettoMap(i);return new t(a.add(h))}static fromHex(e){e=$l(e,32);let{a:r,d:a}=Vi,i="RistrettoPoint.fromHex: the hex is not valid encoding of RistrettoPoint",h=sE(e);if(!Pge(Em(h),e)||Ll(h))throw new Error(i);let l=Et(h*h),p=Et(oi+r*l),b=Et(oi-r*l),g=Et(p*p),y=Et(b*b),M=Et(r*a*g-y),{isValid:x,value:E}=BK(Et(M*y)),A=Et(E*b),k=Et(E*A*M),P=Et((h+h)*A);Ll(P)&&(P=Et(-P));let N=Et(p*k),L=Et(P*N);if(!x||Ll(L)||N===Jn)throw new Error(i);return new t(new Ln(P,N,oi,L))}toRawBytes(){let{x:e,y:r,z:a,t:i}=this.ep,h=Et(Et(a+r)*Et(a-r)),l=Et(e*r),p=Et(l*l),{value:b}=BK(Et(h*p)),g=Et(b*h),y=Et(b*l),M=Et(g*y*i),x;if(Ll(i*M)){let A=Et(r*xm),k=Et(e*xm);e=A,r=k,x=Et(g*Ege)}else x=y;Ll(e*M)&&(r=Et(-r));let E=Et((a-r)*x);return Ll(E)&&(E=Et(-E)),Em(E)}toHex(){return Am(this.toRawBytes())}toString(){return this.toHex()}equals(e){aE(e);let r=this.ep,a=e.ep,i=Et(r.x*a.y)===Et(r.y*a.x),h=Et(r.y*a.y)===Et(r.x*a.x);return i||h}add(e){return aE(e),new t(this.ep.add(e.ep))}subtract(e){return aE(e),new t(this.ep.subtract(e.ep))}multiply(e){return new t(this.ep.multiply(e))}multiplyUnsafe(e){return new t(this.ep.multiplyUnsafe(e))}};M0.BASE=new M0(Ln.BASE);M0.ZERO=new M0(Ln.ZERO);var uE=new WeakMap,Mn=class t{constructor(e,r){this.x=e,this.y=r}_setWindowSize(e){this._WINDOW_SIZE=e,uE.delete(this)}static fromHex(e,r=!0){let{d:a,P:i}=Vi;e=$l(e,32);let h=e.slice();h[31]=e[31]&-129;let l=Rm(h);if(r&&l>=i)throw new Error("Expected 0 < hex < P");if(!r&&l>=PK)throw new Error("Expected 0 < hex < 2**256");let p=Et(l*l),b=Et(p-oi),g=Et(a*p+oi),{isValid:y,value:M}=lE(b,g);if(!y)throw new Error("Point.fromHex: invalid y coordinate");let x=(M&oi)===oi;return(e[31]&128)!==0!==x&&(M=Et(-M)),new t(M,l)}static async fromPrivateKey(e){return(await cE(e)).point}toRawBytes(){let e=Em(this.y);return e[31]|=this.x&oi?128:0,e}toHex(){return Am(this.toRawBytes())}toX25519(){let{y:e}=this,r=Et((oi+e)*i3(oi-e));return Em(r)}isTorsionFree(){return Ln.fromAffine(this).isTorsionFree()}equals(e){return this.x===e.x&&this.y===e.y}negate(){return new t(Et(-this.x),this.y)}add(e){return Ln.fromAffine(this).add(Ln.fromAffine(e)).toAffine()}subtract(e){return this.add(e.negate())}multiply(e){return Ln.fromAffine(this).multiply(e,this).toAffine()}};Mn.BASE=new Mn(Vi.Gx,Vi.Gy);Mn.ZERO=new Mn(Jn,oi);var Sm=class t{constructor(e,r){this.r=e,this.s=r,this.assertValidity()}static fromHex(e){let r=$l(e,64),a=Mn.fromHex(r.slice(0,32),!1),i=Rm(r.slice(32,64));return new t(a,i)}assertValidity(){let{r:e,s:r}=this;if(!(e instanceof Mn))throw new Error("Expected Point instance");return r3(r,Vi.l,!1),this}toRawBytes(){let e=new Uint8Array(64);return e.set(this.r.toRawBytes()),e.set(Em(this.s),32),e}toHex(){return Am(this.toRawBytes())}};function IK(...t){if(!t.every(a=>a instanceof Uint8Array))throw new Error("Expected Uint8Array list");if(t.length===1)return t[0];let e=t.reduce((a,i)=>a+i.length,0),r=new Uint8Array(e);for(let a=0,i=0;a<t.length;a++){let h=t[a];r.set(h,i),i+=h.length}return r}var Tge=Array.from({length:256},(t,e)=>e.toString(16).padStart(2,"0"));function Am(t){if(!(t instanceof Uint8Array))throw new Error("Uint8Array expected");let e="";for(let r=0;r<t.length;r++)e+=Tge[t[r]];return e}function hE(t){if(typeof t!="string")throw new TypeError("hexToBytes: expected string, got "+typeof t);if(t.length%2)throw new Error("hexToBytes: received invalid unpadded hex");let e=new Uint8Array(t.length/2);for(let r=0;r<e.length;r++){let a=r*2,i=t.slice(a,a+2),h=Number.parseInt(i,16);if(Number.isNaN(h)||h<0)throw new Error("Invalid byte sequence");e[r]=h}return e}function OK(t){let r=t.toString(16).padStart(64,"0");return hE(r)}function Em(t){return OK(t).reverse()}function Ll(t){return(Et(t)&oi)===oi}function Rm(t){if(!(t instanceof Uint8Array))throw new Error("Expected Uint8Array");return BigInt("0x"+Am(Uint8Array.from(t).reverse()))}var kge=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function sE(t){return Et(Rm(t)&kge)}function Et(t,e=Vi.P){let r=t%e;return r>=Jn?r:e+r}function i3(t,e=Vi.P){if(t===Jn||e<=Jn)throw new Error(`invert: expected positive integers, got n=${t} mod=${e}`);let r=Et(t,e),a=e,i=Jn,h=oi,l=oi,p=Jn;for(;r!==Jn;){let g=a/r,y=a%r,M=i-l*g,x=h-p*g;a=r,r=y,i=l,h=p,l=M,p=x}if(a!==oi)throw new Error("invert: does not exist");return Et(i,e)}function Ige(t,e=Vi.P){let r=new Array(t.length),a=t.reduce((h,l,p)=>l===Jn?h:(r[p]=h,Et(h*l,e)),oi),i=i3(a,e);return t.reduceRight((h,l,p)=>l===Jn?h:(r[p]=Et(h*r[p],e),Et(h*l,e)),i),r}function pu(t,e){let{P:r}=Vi,a=t;for(;e-- >Jn;)a*=a,a%=r;return a}function Bge(t){let{P:e}=Vi,r=BigInt(5),a=BigInt(10),i=BigInt(20),h=BigInt(40),l=BigInt(80),b=t*t%e*t%e,g=pu(b,Dl)*b%e,y=pu(g,oi)*t%e,M=pu(y,r)*y%e,x=pu(M,a)*M%e,E=pu(x,i)*x%e,A=pu(E,h)*E%e,k=pu(A,l)*A%e,P=pu(k,l)*A%e,N=pu(P,a)*M%e;return{pow_p_5_8:pu(N,Dl)*t%e,b2:b}}function lE(t,e){let r=Et(e*e*e),a=Et(r*r*e),i=Bge(t*a).pow_p_5_8,h=Et(t*r*i),l=Et(e*h*h),p=h,b=Et(h*xm),g=l===t,y=l===Et(-t),M=l===Et(-t*xm);return g&&(h=p),(y||M)&&(h=b),Ll(h)&&(h=Et(-h)),{isValid:g||y,value:h}}function BK(t){return lE(oi,t)}function t3(t){return Et(Rm(t),Vi.l)}function Pge(t,e){if(t.length!==e.length)return!1;for(let r=0;r<t.length;r++)if(t[r]!==e[r])return!1;return!0}function $l(t,e){let r=t instanceof Uint8Array?Uint8Array.from(t):hE(t);if(typeof e=="number"&&r.length!==e)throw new Error(`Expected ${e} bytes`);return r}function r3(t,e,r=!0){if(!e)throw new TypeError("Specify max value");if(typeof t=="number"&&Number.isSafeInteger(t)&&(t=BigInt(t)),typeof t=="bigint"&&t<e){if(r){if(Jn<t)return t}else if(Jn<=t)return t}throw new TypeError("Expected valid scalar: 0 < scalar < max")}function Oge(t){return t[0]&=248,t[31]&=127,t[31]|=64,t}function Nge(t){if(t=typeof t=="bigint"||typeof t=="number"?OK(r3(t,PK)):$l(t),t.length!==32)throw new Error("Expected 32 bytes");return t}function Cge(t){let e=Oge(t.slice(0,32)),r=t.slice(32,64),a=t3(e),i=Mn.BASE.multiply(a),h=i.toRawBytes();return{head:e,prefix:r,scalar:a,point:i,pointBytes:h}}var fE;async function cE(t){return Cge(await Bp.sha512(Nge(t)))}async function NK(t,e){t=$l(t);let{prefix:r,scalar:a,pointBytes:i}=await cE(e),h=t3(await Bp.sha512(r,t)),l=Mn.BASE.multiply(h),p=t3(await Bp.sha512(l.toRawBytes(),i,t)),b=Et(h+p*a,Vi.l);return new Sm(l,b).toRawBytes()}function Lge(t,e,r){e=$l(e),r instanceof Mn||(r=Mn.fromHex(r,!1));let{r:a,s:i}=t instanceof Sm?t.assertValidity():Sm.fromHex(t),h=Ln.BASE.multiplyUnsafe(i);return{r:a,s:i,SB:h,pub:r,msg:e}}function Dge(t,e,r,a){let i=t3(a),h=Ln.fromAffine(t).multiplyUnsafe(i);return Ln.fromAffine(e).add(h).subtract(r).multiplyUnsafe(Vi.h).equals(Ln.ZERO)}async function ql(t,e,r){let{r:a,SB:i,msg:h,pub:l}=Lge(t,e,r),p=await Bp.sha512(a.toRawBytes(),l.toRawBytes(),h);return Dge(l,a,i,p)}Mn.BASE._setWindowSize(8);var Cl={node:Mm,web:typeof self=="object"&&"crypto"in self?self.crypto:void 0},Bp={bytesToHex:Am,hexToBytes:hE,concatBytes:IK,getExtendedPublicKey:cE,mod:Et,invert:i3,TORSION_SUBGROUP:["0100000000000000000000000000000000000000000000000000000000000000","c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac037a","0000000000000000000000000000000000000000000000000000000000000080","26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc05","ecffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f","26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc85","0000000000000000000000000000000000000000000000000000000000000000","c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac03fa"],hashToPrivateScalar:t=>{if(t=$l(t),t.length<40||t.length>1024)throw new Error("Expected 40-1024 bytes of private key as per FIPS 186");return Et(Rm(t),Vi.l-oi)+oi},randomBytes:(t=32)=>{if(Cl.web)return Cl.web.getRandomValues(new Uint8Array(t));if(Cl.node){let{randomBytes:e}=Cl.node;return new Uint8Array(e(t).buffer)}else throw new Error("The environment doesn't have randomBytes function")},randomPrivateKey:()=>Bp.randomBytes(32),sha512:async(...t)=>{let e=IK(...t);if(Cl.web){let r=await Cl.web.subtle.digest("SHA-512",e.buffer);return new Uint8Array(r)}else{if(Cl.node)return Uint8Array.from(Cl.node.createHash("sha512").update(e).digest());throw new Error("The environment doesn't have sha512 function")}},precompute(t=8,e=Mn.BASE){let r=e.equals(Mn.BASE)?e:new Mn(e.x,e.y);return r._setWindowSize(t),r.multiply(Dl),r},sha512Sync:void 0};Object.defineProperties(Bp,{sha512Sync:{configurable:!1,get(){return fE},set(t){fE||(fE=t)}}});var xo=class{_key;pk;ownerLength=Wr[2].pubLength;signatureLength=Wr[2].sigLength;_publicKey;get publicKey(){return this._publicKey}signatureType=2;constructor(e,r){this._key=e,this.pk=r}get key(){throw new Error("You must implement `key`")}sign(e){return NK(Me.from(e),Me.from(this.key))}static async verify(e,r,a){let i=e;return typeof e=="string"&&(i=CK.default.toBuffer(e)),ql(Me.from(a),Me.from(r),Me.from(i))}};ie();ae();ne();ie();ae();ne();ie();ae();ne();ie();ae();ne();var Pi=gi(vf(),1);ie();ae();ne();du();async function Ul(t){if(typeof t[Symbol.asyncIterator]=="function"){let i=t,h=pf("sha384"),l=0;for await(let g of i)l+=g.byteLength,h.update(g);let p=(0,Pi.concatBuffers)([(0,Pi.stringToBuffer)("blob"),(0,Pi.stringToBuffer)(l.toString())]),b=(0,Pi.concatBuffers)([await xn().hash(p,"SHA-384"),h.digest()]);return await xn().hash(b,"SHA-384")}else if(Array.isArray(t)){let i=(0,Pi.concatBuffers)([(0,Pi.stringToBuffer)("list"),(0,Pi.stringToBuffer)(t.length.toString())]);return await KK(t,await xn().hash(i,"SHA-384"))}let e=t,r=(0,Pi.concatBuffers)([(0,Pi.stringToBuffer)("blob"),(0,Pi.stringToBuffer)(e.byteLength.toString())]),a=(0,Pi.concatBuffers)([await xn().hash(r,"SHA-384"),await xn().hash(e,"SHA-384")]);return await xn().hash(a,"SHA-384")}async function KK(t,e){if(t.length<1)return e;let r=(0,Pi.concatBuffers)([e,await Ul(t[0])]),a=await xn().hash(r,"SHA-384");return await KK(t.slice(1),a)}var d3=gi(gE(),1),_W=gi(Nm(),1),MW=gi(wW(),1),x2e=d3.default.default?d3.default.default:d3.default,p3=class extends x2e{getPublicKey(e){throw new Error("Unimplemented")}},S2e;function xn(){return S2e??=new p3}var xW=gi(qo(),1);du();var S0=class{_key;pk;signatureType=1;ownerLength=Wr[1].pubLength;signatureLength=Wr[1].sigLength;_publicKey;get publicKey(){return this._publicKey}constructor(e,r){this._key=e,this.pk=r,r||(this.pk=xn().getPublicKey(JSON.parse(e)))}sign(e){return iE("sha256").update(e).sign({key:this._key,padding:rE.RSA_PKCS1_PSS_PADDING})}static async verify(e,r,a){return await xn().verify(Me.isBuffer(e)?xW.default.encode(e):e,r,a)}};var lV=gi(hV(),1),cV=gi(qo(),1);var Hl=class extends S0{jwk;constructor(e){super((0,lV.jwkTopem)(e),e.n),this.jwk=e}get publicKey(){if(!this.pk)throw new Error("ArweaveSigner - pk is undefined");return cV.default.toBuffer(this.pk)}sign(e){return xn().sign(this.jwk,e)}static async verify(e,r,a){return await xn().verify(e,r,a)}};ie();ae();ne();var dV=gi(qo(),1);var A0=class{_publicKey;ownerLength=Wr[2].pubLength;signatureLength=Wr[2].sigLength;signatureType=2;pem;provider;constructor(e){if(this.provider=e,!this.provider.publicKey)throw new Error("InjectedSolanaSigner - provider.publicKey is undefined");this._publicKey=this.provider.publicKey.toBuffer()}get publicKey(){return this._publicKey}async sign(e){if(!this.provider.signMessage)throw new Error("Selected Wallet does not support message signing");return await this.provider.signMessage(e)}static async verify(e,r,a){let i=e;return typeof e=="string"&&(i=dV.default.toBuffer(e)),ql(Me.from(a),Me.from(r),Me.from(i))}};ie();ae();ne();ie();ae();ne();ie();ae();ne();ie();ae();ne();var SV=gi(pV());ie();ae();ne();ie();ae();ne();ie();ae();ne();var vV="logger/5.7.0";var mV=!1,gV=!1,x3={debug:1,default:2,info:2,warning:3,error:4,off:5},bV=x3.default,lA=null;function nbe(){try{let t=[];if(["NFD","NFC","NFKD","NFKC"].forEach(e=>{try{if("test".normalize(e)!=="test")throw new Error("bad normalize")}catch{t.push(e)}}),t.length)throw new Error("missing "+t.join(", "));if("\xE9".normalize("NFD")!=="e\u0301")throw new Error("broken implementation")}catch(t){return t.message}return null}var yV=nbe(),cA;(function(t){t.DEBUG="DEBUG",t.INFO="INFO",t.WARNING="WARNING",t.ERROR="ERROR",t.OFF="OFF"})(cA||(cA={}));var gf;(function(t){t.UNKNOWN_ERROR="UNKNOWN_ERROR",t.NOT_IMPLEMENTED="NOT_IMPLEMENTED",t.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",t.NETWORK_ERROR="NETWORK_ERROR",t.SERVER_ERROR="SERVER_ERROR",t.TIMEOUT="TIMEOUT",t.BUFFER_OVERRUN="BUFFER_OVERRUN",t.NUMERIC_FAULT="NUMERIC_FAULT",t.MISSING_NEW="MISSING_NEW",t.INVALID_ARGUMENT="INVALID_ARGUMENT",t.MISSING_ARGUMENT="MISSING_ARGUMENT",t.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",t.CALL_EXCEPTION="CALL_EXCEPTION",t.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",t.NONCE_EXPIRED="NONCE_EXPIRED",t.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",t.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",t.TRANSACTION_REPLACED="TRANSACTION_REPLACED",t.ACTION_REJECTED="ACTION_REJECTED"})(gf||(gf={}));var wV="0123456789abcdef",er=class t{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,r){let a=e.toLowerCase();x3[a]==null&&this.throwArgumentError("invalid log level name","logLevel",e),!(bV>x3[a])&&console.log.apply(console,r)}debug(...e){this._log(t.levels.DEBUG,e)}info(...e){this._log(t.levels.INFO,e)}warn(...e){this._log(t.levels.WARNING,e)}makeError(e,r,a){if(gV)return this.makeError("censored error",r,{});r||(r=t.errors.UNKNOWN_ERROR),a||(a={});let i=[];Object.keys(a).forEach(b=>{let g=a[b];try{if(g instanceof Uint8Array){let y="";for(let M=0;M<g.length;M++)y+=wV[g[M]>>4],y+=wV[g[M]&15];i.push(b+"=Uint8Array(0x"+y+")")}else i.push(b+"="+JSON.stringify(g))}catch{i.push(b+"="+JSON.stringify(a[b].toString()))}}),i.push(`code=${r}`),i.push(`version=${this.version}`);let h=e,l="";switch(r){case gf.NUMERIC_FAULT:{l="NUMERIC_FAULT";let b=e;switch(b){case"overflow":case"underflow":case"division-by-zero":l+="-"+b;break;case"negative-power":case"negative-width":l+="-unsupported";break;case"unbound-bitwise-result":l+="-unbound-result";break}break}case gf.CALL_EXCEPTION:case gf.INSUFFICIENT_FUNDS:case gf.MISSING_NEW:case gf.NONCE_EXPIRED:case gf.REPLACEMENT_UNDERPRICED:case gf.TRANSACTION_REPLACED:case gf.UNPREDICTABLE_GAS_LIMIT:l=r;break}l&&(e+=" [ See: https://links.ethers.org/v5-errors-"+l+" ]"),i.length&&(e+=" ("+i.join(", ")+")");let p=new Error(e);return p.reason=h,p.code=r,Object.keys(a).forEach(function(b){p[b]=a[b]}),p}throwError(e,r,a){throw this.makeError(e,r,a)}throwArgumentError(e,r,a){return this.throwError(e,t.errors.INVALID_ARGUMENT,{argument:r,value:a})}assert(e,r,a,i){e||this.throwError(r,a,i)}assertArgument(e,r,a,i){e||this.throwArgumentError(r,a,i)}checkNormalize(e){e==null&&(e="platform missing String.prototype.normalize"),yV&&this.throwError("platform missing String.prototype.normalize",t.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:yV})}checkSafeUint53(e,r){typeof e=="number"&&(r==null&&(r="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(r,t.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(r,t.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,r,a){a?a=": "+a:a="",e<r&&this.throwError("missing argument"+a,t.errors.MISSING_ARGUMENT,{count:e,expectedCount:r}),e>r&&this.throwError("too many arguments"+a,t.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:r})}checkNew(e,r){(e===Object||e==null)&&this.throwError("missing new",t.errors.MISSING_NEW,{name:r.name})}checkAbstract(e,r){e===r?this.throwError("cannot instantiate abstract class "+JSON.stringify(r.name)+" directly; use a sub-class",t.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):(e===Object||e==null)&&this.throwError("missing new",t.errors.MISSING_NEW,{name:r.name})}static globalLogger(){return lA||(lA=new t(vV)),lA}static setCensorship(e,r){if(!e&&r&&this.globalLogger().throwError("cannot permanently disable censorship",t.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),mV){if(!e)return;this.globalLogger().throwError("error censorship permanent",t.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}gV=!!e,mV=!!r}static setLogLevel(e){let r=x3[e.toLowerCase()];if(r==null){t.globalLogger().warn("invalid log level - "+e);return}bV=r}static from(e){return new t(e)}};er.errors=gf;er.levels=cA;ie();ae();ne();var _V="bytes/5.7.0";var Sn=new er(_V);function xV(t){return!!t.toHexString}function jp(t){return t.slice||(t.slice=function(){let e=Array.prototype.slice.call(arguments);return jp(new Uint8Array(Array.prototype.slice.apply(t,e)))}),t}function Um(t){return $n(t)&&!(t.length%2)||Fm(t)}function MV(t){return typeof t=="number"&&t==t&&t%1===0}function Fm(t){if(t==null)return!1;if(t.constructor===Uint8Array)return!0;if(typeof t=="string"||!MV(t.length)||t.length<0)return!1;for(let e=0;e<t.length;e++){let r=t[e];if(!MV(r)||r<0||r>=256)return!1}return!0}function Ct(t,e){if(e||(e={}),typeof t=="number"){Sn.checkSafeUint53(t,"invalid arrayify value");let r=[];for(;t;)r.unshift(t&255),t=parseInt(String(t/256));return r.length===0&&r.push(0),jp(new Uint8Array(r))}if(e.allowMissingPrefix&&typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),xV(t)&&(t=t.toHexString()),$n(t)){let r=t.substring(2);r.length%2&&(e.hexPad==="left"?r="0"+r:e.hexPad==="right"?r+="0":Sn.throwArgumentError("hex data is odd-length","value",t));let a=[];for(let i=0;i<r.length;i+=2)a.push(parseInt(r.substring(i,i+2),16));return jp(new Uint8Array(a))}return Fm(t)?jp(new Uint8Array(t)):Sn.throwArgumentError("invalid arrayify value","value",t)}function Ao(t){let e=t.map(i=>Ct(i)),r=e.reduce((i,h)=>i+h.length,0),a=new Uint8Array(r);return e.reduce((i,h)=>(a.set(h,i),i+h.length),0),jp(a)}function mu(t){let e=Ct(t);if(e.length===0)return e;let r=0;for(;r<e.length&&e[r]===0;)r++;return r&&(e=e.slice(r)),e}function abe(t,e){t=Ct(t),t.length>e&&Sn.throwArgumentError("value out of range","value",arguments[0]);let r=new Uint8Array(e);return r.set(t,e-t.length),jp(r)}function $n(t,e){return!(typeof t!="string"||!t.match(/^0x[0-9A-Fa-f]*$/)||e&&t.length!==2+2*e)}var dA="0123456789abcdef";function sr(t,e){if(e||(e={}),typeof t=="number"){Sn.checkSafeUint53(t,"invalid hexlify value");let r="";for(;t;)r=dA[t&15]+r,t=Math.floor(t/16);return r.length?(r.length%2&&(r="0"+r),"0x"+r):"0x00"}if(typeof t=="bigint")return t=t.toString(16),t.length%2?"0x0"+t:"0x"+t;if(e.allowMissingPrefix&&typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),xV(t))return t.toHexString();if($n(t))return t.length%2&&(e.hexPad==="left"?t="0x0"+t.substring(2):e.hexPad==="right"?t+="0":Sn.throwArgumentError("hex data is odd-length","value",t)),t.toLowerCase();if(Fm(t)){let r="0x";for(let a=0;a<t.length;a++){let i=t[a];r+=dA[(i&240)>>4]+dA[i&15]}return r}return Sn.throwArgumentError("invalid hexlify value","value",t)}function jm(t){if(typeof t!="string")t=sr(t);else if(!$n(t)||t.length%2)return null;return(t.length-2)/2}function Mh(t,e,r){return typeof t!="string"?t=sr(t):(!$n(t)||t.length%2)&&Sn.throwArgumentError("invalid hexData","value",t),e=2+2*e,r!=null?"0x"+t.substring(e,2+2*r):"0x"+t.substring(e)}function Kl(t){let e="0x";return t.forEach(r=>{e+=sr(r).substring(2)}),e}function Ea(t,e){for(typeof t!="string"?t=sr(t):$n(t)||Sn.throwArgumentError("invalid hex string","value",t),t.length>2*e+2&&Sn.throwArgumentError("value out of range","value",arguments[1]);t.length<2*e+2;)t="0x0"+t.substring(2);return t}function Wl(t){let e={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(Um(t)){let r=Ct(t);r.length===64?(e.v=27+(r[32]>>7),r[32]&=127,e.r=sr(r.slice(0,32)),e.s=sr(r.slice(32,64))):r.length===65?(e.r=sr(r.slice(0,32)),e.s=sr(r.slice(32,64)),e.v=r[64]):Sn.throwArgumentError("invalid signature string","signature",t),e.v<27&&(e.v===0||e.v===1?e.v+=27:Sn.throwArgumentError("signature invalid v byte","signature",t)),e.recoveryParam=1-e.v%2,e.recoveryParam&&(r[32]|=128),e._vs=sr(r.slice(32,64))}else{if(e.r=t.r,e.s=t.s,e.v=t.v,e.recoveryParam=t.recoveryParam,e._vs=t._vs,e._vs!=null){let i=abe(Ct(e._vs),32);e._vs=sr(i);let h=i[0]>=128?1:0;e.recoveryParam==null?e.recoveryParam=h:e.recoveryParam!==h&&Sn.throwArgumentError("signature recoveryParam mismatch _vs","signature",t),i[0]&=127;let l=sr(i);e.s==null?e.s=l:e.s!==l&&Sn.throwArgumentError("signature v mismatch _vs","signature",t)}if(e.recoveryParam==null)e.v==null?Sn.throwArgumentError("signature missing v and recoveryParam","signature",t):e.v===0||e.v===1?e.recoveryParam=e.v:e.recoveryParam=1-e.v%2;else if(e.v==null)e.v=27+e.recoveryParam;else{let i=e.v===0||e.v===1?e.v:1-e.v%2;e.recoveryParam!==i&&Sn.throwArgumentError("signature recoveryParam mismatch v","signature",t)}e.r==null||!$n(e.r)?Sn.throwArgumentError("signature missing or invalid r","signature",t):e.r=Ea(e.r,32),e.s==null||!$n(e.s)?Sn.throwArgumentError("signature missing or invalid s","signature",t):e.s=Ea(e.s,32);let r=Ct(e.s);r[0]>=128&&Sn.throwArgumentError("signature s out of range","signature",t),e.recoveryParam&&(r[0]|=128);let a=sr(r);e._vs&&($n(e._vs)||Sn.throwArgumentError("signature invalid _vs","signature",t),e._vs=Ea(e._vs,32)),e._vs==null?e._vs=a:e._vs!==a&&Sn.throwArgumentError("signature _vs mismatch v and s","signature",t)}return e.yParityAndS=e._vs,e.compact=e.r+e.yParityAndS.substring(2),e}function pA(t){return t=Wl(t),sr(Ao([t.r,t.s,t.recoveryParam?"0x1c":"0x1b"]))}function rn(t){return"0x"+SV.default.keccak_256(Ct(t))}ie();ae();ne();ie();ae();ne();ie();ae();ne();var IV=gi(AV());ie();ae();ne();var RV="bignumber/5.7.0";var S3=IV.default.BN,xh=new er(RV),mA={},TV=9007199254740991;var kV=!1,nn=class t{constructor(e,r){e!==mA&&xh.throwError("cannot call constructor directly; use BigNumber.from",er.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=r,this._isBigNumber=!0,Object.freeze(this)}fromTwos(e){return to(Xr(this).fromTwos(e))}toTwos(e){return to(Xr(this).toTwos(e))}abs(){return this._hex[0]==="-"?t.from(this._hex.substring(1)):this}add(e){return to(Xr(this).add(Xr(e)))}sub(e){return to(Xr(this).sub(Xr(e)))}div(e){return t.from(e).isZero()&&ys("division-by-zero","div"),to(Xr(this).div(Xr(e)))}mul(e){return to(Xr(this).mul(Xr(e)))}mod(e){let r=Xr(e);return r.isNeg()&&ys("division-by-zero","mod"),to(Xr(this).umod(r))}pow(e){let r=Xr(e);return r.isNeg()&&ys("negative-power","pow"),to(Xr(this).pow(r))}and(e){let r=Xr(e);return(this.isNegative()||r.isNeg())&&ys("unbound-bitwise-result","and"),to(Xr(this).and(r))}or(e){let r=Xr(e);return(this.isNegative()||r.isNeg())&&ys("unbound-bitwise-result","or"),to(Xr(this).or(r))}xor(e){let r=Xr(e);return(this.isNegative()||r.isNeg())&&ys("unbound-bitwise-result","xor"),to(Xr(this).xor(r))}mask(e){return(this.isNegative()||e<0)&&ys("negative-width","mask"),to(Xr(this).maskn(e))}shl(e){return(this.isNegative()||e<0)&&ys("negative-width","shl"),to(Xr(this).shln(e))}shr(e){return(this.isNegative()||e<0)&&ys("negative-width","shr"),to(Xr(this).shrn(e))}eq(e){return Xr(this).eq(Xr(e))}lt(e){return Xr(this).lt(Xr(e))}lte(e){return Xr(this).lte(Xr(e))}gt(e){return Xr(this).gt(Xr(e))}gte(e){return Xr(this).gte(Xr(e))}isNegative(){return this._hex[0]==="-"}isZero(){return Xr(this).isZero()}toNumber(){try{return Xr(this).toNumber()}catch{ys("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch{}return xh.throwError("this platform does not support BigInt",er.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(arguments[0]===10?kV||(kV=!0,xh.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):arguments[0]===16?xh.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",er.errors.UNEXPECTED_ARGUMENT,{}):xh.throwError("BigNumber.toString does not accept parameters",er.errors.UNEXPECTED_ARGUMENT,{})),Xr(this).toString(10)}toHexString(){return this._hex}toJSON(e){return{type:"BigNumber",hex:this.toHexString()}}static from(e){if(e instanceof t)return e;if(typeof e=="string")return e.match(/^-?0x[0-9a-f]+$/i)?new t(mA,zm(e)):e.match(/^-?[0-9]+$/)?new t(mA,zm(new S3(e))):xh.throwArgumentError("invalid BigNumber string","value",e);if(typeof e=="number")return e%1&&ys("underflow","BigNumber.from",e),(e>=TV||e<=-TV)&&ys("overflow","BigNumber.from",e),t.from(String(e));let r=e;if(typeof r=="bigint")return t.from(r.toString());if(Fm(r))return t.from(sr(r));if(r)if(r.toHexString){let a=r.toHexString();if(typeof a=="string")return t.from(a)}else{let a=r._hex;if(a==null&&r.type==="BigNumber"&&(a=r.hex),typeof a=="string"&&($n(a)||a[0]==="-"&&$n(a.substring(1))))return t.from(a)}return xh.throwArgumentError("invalid BigNumber value","value",e)}static isBigNumber(e){return!!(e&&e._isBigNumber)}};function zm(t){if(typeof t!="string")return zm(t.toString(16));if(t[0]==="-")return t=t.substring(1),t[0]==="-"&&xh.throwArgumentError("invalid hex","value",t),t=zm(t),t==="0x00"?t:"-"+t;if(t.substring(0,2)!=="0x"&&(t="0x"+t),t==="0x")return"0x00";for(t.length%2&&(t="0x0"+t.substring(2));t.length>4&&t.substring(0,4)==="0x00";)t="0x"+t.substring(4);return t}function to(t){return nn.from(zm(t))}function Xr(t){let e=nn.from(t).toHexString();return e[0]==="-"?new S3("-"+e.substring(3),16):new S3(e.substring(2),16)}function ys(t,e,r){let a={fault:t,operation:e};return r!=null&&(a.value=r),xh.throwError(t,er.errors.NUMERIC_FAULT,a)}function gA(t){return new S3(t,36).toString(16)}ie();ae();ne();ie();ae();ne();var BV="strings/5.7.0";var PV=new er(BV),gu;(function(t){t.current="",t.NFC="NFC",t.NFD="NFD",t.NFKC="NFKC",t.NFKD="NFKD"})(gu||(gu={}));var R0;(function(t){t.UNEXPECTED_CONTINUE="unexpected continuation byte",t.BAD_PREFIX="bad codepoint prefix",t.OVERRUN="string overrun",t.MISSING_CONTINUE="missing continuation byte",t.OUT_OF_RANGE="out of UTF-8 range",t.UTF16_SURROGATE="UTF-16 surrogate",t.OVERLONG="overlong representation"})(R0||(R0={}));function sbe(t,e,r,a,i){return PV.throwArgumentError(`invalid codepoint at offset ${e}; ${t}`,"bytes",r)}function OV(t,e,r,a,i){if(t===R0.BAD_PREFIX||t===R0.UNEXPECTED_CONTINUE){let h=0;for(let l=e+1;l<r.length&&r[l]>>6===2;l++)h++;return h}return t===R0.OVERRUN?r.length-e-1:0}function fbe(t,e,r,a,i){return t===R0.OVERLONG?(a.push(i),0):(a.push(65533),OV(t,e,r,a,i))}var ube=Object.freeze({error:sbe,ignore:OV,replace:fbe});function Ca(t,e=gu.current){e!=gu.current&&(PV.checkNormalize(),t=t.normalize(e));let r=[];for(let a=0;a<t.length;a++){let i=t.charCodeAt(a);if(i<128)r.push(i);else if(i<2048)r.push(i>>6|192),r.push(i&63|128);else if((i&64512)==55296){a++;let h=t.charCodeAt(a);if(a>=t.length||(h&64512)!==56320)throw new Error("invalid utf-8 string");let l=65536+((i&1023)<<10)+(h&1023);r.push(l>>18|240),r.push(l>>12&63|128),r.push(l>>6&63|128),r.push(l&63|128)}else r.push(i>>12|224),r.push(i>>6&63|128),r.push(i&63|128)}return Ct(r)}function zp(t){return rn(Ca(t))}ie();ae();ne();var NV="hash/5.7.0";ie();ae();ne();var CV=`Ethereum Signed Message:
128
128
  `;function Vl(t){return typeof t=="string"&&(t=Ca(t)),rn(Ao([Ca(CV),Ca(String(t.length)),t]))}ie();ae();ne();ie();ae();ne();ie();ae();ne();ie();ae();ne();var LV="rlp/5.7.0";var hbe=new er(LV);function DV(t){let e=[];for(;t;)e.unshift(t&255),t>>=8;return e}function $V(t){if(Array.isArray(t)){let a=[];if(t.forEach(function(h){a=a.concat($V(h))}),a.length<=55)return a.unshift(192+a.length),a;let i=DV(a.length);return i.unshift(247+i.length),i.concat(a)}Um(t)||hbe.throwArgumentError("RLP object must be BytesLike","object",t);let e=Array.prototype.slice.call(Ct(t));if(e.length===1&&e[0]<=127)return e;if(e.length<=55)return e.unshift(128+e.length),e;let r=DV(e.length);return r.unshift(183+r.length),r.concat(e)}function Zm(t){return sr($V(t))}ie();ae();ne();var qV="address/5.7.0";var Hm=new er(qV);function UV(t){$n(t,20)||Hm.throwArgumentError("invalid address","address",t),t=t.toLowerCase();let e=t.substring(2).split(""),r=new Uint8Array(40);for(let i=0;i<40;i++)r[i]=e[i].charCodeAt(0);let a=Ct(rn(r));for(let i=0;i<40;i+=2)a[i>>1]>>4>=8&&(e[i]=e[i].toUpperCase()),(a[i>>1]&15)>=8&&(e[i+1]=e[i+1].toUpperCase());return"0x"+e.join("")}var cbe=9007199254740991;function dbe(t){return Math.log10?Math.log10(t):Math.log(t)/Math.LN10}var bA={};for(let t=0;t<10;t++)bA[String(t)]=String(t);for(let t=0;t<26;t++)bA[String.fromCharCode(65+t)]=String(10+t);var FV=Math.floor(dbe(cbe));function pbe(t){t=t.toUpperCase(),t=t.substring(4)+t.substring(0,2)+"00";let e=t.split("").map(a=>bA[a]).join("");for(;e.length>=FV;){let a=e.substring(0,FV);e=parseInt(a,10)%97+e.substring(a.length)}let r=String(98-parseInt(e,10)%97);for(;r.length<2;)r="0"+r;return r}function Aa(t){let e=null;if(typeof t!="string"&&Hm.throwArgumentError("invalid address","address",t),t.match(/^(0x)?[0-9a-fA-F]{40}$/))t.substring(0,2)!=="0x"&&(t="0x"+t),e=UV(t),t.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&e!==t&&Hm.throwArgumentError("bad address checksum","address",t);else if(t.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(t.substring(2,4)!==pbe(t)&&Hm.throwArgumentError("bad icap checksum","address",t),e=gA(t.substring(4));e.length<40;)e="0"+e;e=UV("0x"+e)}else Hm.throwArgumentError("invalid address","address",t);return e}ie();ae();ne();ie();ae();ne();var jV="properties/5.7.0";var vbe=function(t,e,r,a){function i(h){return h instanceof r?h:new r(function(l){l(h)})}return new(r||(r=Promise))(function(h,l){function p(y){try{g(a.next(y))}catch(M){l(M)}}function b(y){try{g(a.throw(y))}catch(M){l(M)}}function g(y){y.done?h(y.value):i(y.value).then(p,b)}g((a=a.apply(t,e||[])).next())})},E3=new er(jV);function ur(t,e,r){Object.defineProperty(t,e,{enumerable:!0,value:r,writable:!1})}function Sh(t){return vbe(this,void 0,void 0,function*(){let e=Object.keys(t).map(a=>{let i=t[a];return Promise.resolve(i).then(h=>({key:a,value:h}))});return(yield Promise.all(e)).reduce((a,i)=>(a[i.key]=i.value,a),{})})}function zV(t,e){(!t||typeof t!="object")&&E3.throwArgumentError("invalid object","object",t),Object.keys(t).forEach(r=>{e[r]||E3.throwArgumentError("invalid object key - "+r,"transaction:"+r,t)})}function Wm(t){let e={};for(let r in t)e[r]=t[r];return e}var mbe={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function ZV(t){if(t==null||mbe[typeof t])return!0;if(Array.isArray(t)||typeof t=="object"){if(!Object.isFrozen(t))return!1;let e=Object.keys(t);for(let r=0;r<e.length;r++){let a=null;try{a=t[e[r]]}catch{continue}if(!ZV(a))return!1}return!0}return E3.throwArgumentError(`Cannot deepCopy ${typeof t}`,"object",t)}function gbe(t){if(ZV(t))return t;if(Array.isArray(t))return Object.freeze(t.map(e=>Km(e)));if(typeof t=="object"){let e={};for(let r in t){let a=t[r];a!==void 0&&ur(e,r,Km(a))}return e}return E3.throwArgumentError(`Cannot deepCopy ${typeof t}`,"object",t)}function Km(t){return gbe(t)}var T0=class{constructor(e){for(let r in e)this[r]=Km(e[r])}};var bbe=function(t,e,r,a){function i(h){return h instanceof r?h:new r(function(l){l(h)})}return new(r||(r=Promise))(function(h,l){function p(y){try{g(a.next(y))}catch(M){l(M)}}function b(y){try{g(a.throw(y))}catch(M){l(M)}}function g(y){y.done?h(y.value):i(y.value).then(p,b)}g((a=a.apply(t,e||[])).next())})},an=new er(NV),VV=new Uint8Array(32);VV.fill(0);var ybe=nn.from(-1),GV=nn.from(0),YV=nn.from(1),wbe=nn.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function _be(t){let e=Ct(t),r=e.length%32;return r?Kl([e,VV.slice(r)]):sr(e)}var Mbe=Ea(YV.toHexString(),32),xbe=Ea(GV.toHexString(),32),HV={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},yA=["name","version","chainId","verifyingContract","salt"];function KV(t){return function(e){return typeof e!="string"&&an.throwArgumentError(`invalid domain value for ${JSON.stringify(t)}`,`domain.${t}`,e),e}}var Sbe={name:KV("name"),version:KV("version"),chainId:function(t){try{return nn.from(t).toString()}catch{}return an.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",t)},verifyingContract:function(t){try{return Aa(t).toLowerCase()}catch{}return an.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",t)},salt:function(t){try{let e=Ct(t);if(e.length!==32)throw new Error("bad length");return sr(e)}catch{}return an.throwArgumentError('invalid domain value "salt"',"domain.salt",t)}};function wA(t){{let e=t.match(/^(u?)int(\d*)$/);if(e){let r=e[1]==="",a=parseInt(e[2]||"256");(a%8!==0||a>256||e[2]&&e[2]!==String(a))&&an.throwArgumentError("invalid numeric width","type",t);let i=wbe.mask(r?a-1:a),h=r?i.add(YV).mul(ybe):GV;return function(l){let p=nn.from(l);return(p.lt(h)||p.gt(i))&&an.throwArgumentError(`value out-of-bounds for ${t}`,"value",l),Ea(p.toTwos(256).toHexString(),32)}}}{let e=t.match(/^bytes(\d+)$/);if(e){let r=parseInt(e[1]);return(r===0||r>32||e[1]!==String(r))&&an.throwArgumentError("invalid bytes width","type",t),function(a){return Ct(a).length!==r&&an.throwArgumentError(`invalid length for ${t}`,"value",a),_be(a)}}}switch(t){case"address":return function(e){return Ea(Aa(e),32)};case"bool":return function(e){return e?Mbe:xbe};case"bytes":return function(e){return rn(e)};case"string":return function(e){return zp(e)}}return null}function WV(t,e){return`${t}(${e.map(({name:r,type:a})=>a+" "+r).join(",")})`}var k0=class t{constructor(e){ur(this,"types",Object.freeze(Km(e))),ur(this,"_encoderCache",{}),ur(this,"_types",{});let r={},a={},i={};Object.keys(e).forEach(p=>{r[p]={},a[p]=[],i[p]={}});for(let p in e){let b={};e[p].forEach(g=>{b[g.name]&&an.throwArgumentError(`duplicate variable name ${JSON.stringify(g.name)} in ${JSON.stringify(p)}`,"types",e),b[g.name]=!0;let y=g.type.match(/^([^\x5b]*)(\x5b|$)/)[1];y===p&&an.throwArgumentError(`circular type reference to ${JSON.stringify(y)}`,"types",e),!wA(y)&&(a[y]||an.throwArgumentError(`unknown type ${JSON.stringify(y)}`,"types",e),a[y].push(p),r[p][y]=!0)})}let h=Object.keys(a).filter(p=>a[p].length===0);h.length===0?an.throwArgumentError("missing primary type","types",e):h.length>1&&an.throwArgumentError(`ambiguous primary types or unused types: ${h.map(p=>JSON.stringify(p)).join(", ")}`,"types",e),ur(this,"primaryType",h[0]);function l(p,b){b[p]&&an.throwArgumentError(`circular type reference to ${JSON.stringify(p)}`,"types",e),b[p]=!0,Object.keys(r[p]).forEach(g=>{a[g]&&(l(g,b),Object.keys(b).forEach(y=>{i[y][g]=!0}))}),delete b[p]}l(this.primaryType,{});for(let p in i){let b=Object.keys(i[p]);b.sort(),this._types[p]=WV(p,e[p])+b.map(g=>WV(g,e[g])).join("")}}getEncoder(e){let r=this._encoderCache[e];return r||(r=this._encoderCache[e]=this._getEncoder(e)),r}_getEncoder(e){{let i=wA(e);if(i)return i}let r=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(r){let i=r[1],h=this.getEncoder(i),l=parseInt(r[3]);return p=>{l>=0&&p.length!==l&&an.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",p);let b=p.map(h);return this._types[i]&&(b=b.map(rn)),rn(Kl(b))}}let a=this.types[e];if(a){let i=zp(this._types[e]);return h=>{let l=a.map(({name:p,type:b})=>{let g=this.getEncoder(b)(h[p]);return this._types[b]?rn(g):g});return l.unshift(i),Kl(l)}}return an.throwArgumentError(`unknown type: ${e}`,"type",e)}encodeType(e){let r=this._types[e];return r||an.throwArgumentError(`unknown type: ${JSON.stringify(e)}`,"name",e),r}encodeData(e,r){return this.getEncoder(e)(r)}hashStruct(e,r){return rn(this.encodeData(e,r))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,r,a){if(wA(e))return a(e,r);let i=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(i){let l=i[1],p=parseInt(i[3]);return p>=0&&r.length!==p&&an.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",r),r.map(b=>this._visit(l,b,a))}let h=this.types[e];return h?h.reduce((l,{name:p,type:b})=>(l[p]=this._visit(b,r[p],a),l),{}):an.throwArgumentError(`unknown type: ${e}`,"type",e)}visit(e,r){return this._visit(this.primaryType,e,r)}static from(e){return new t(e)}static getPrimaryType(e){return t.from(e).primaryType}static hashStruct(e,r,a){return t.from(r).hashStruct(e,a)}static hashDomain(e){let r=[];for(let a in e){let i=HV[a];i||an.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(a)}`,"domain",e),r.push({name:a,type:i})}return r.sort((a,i)=>yA.indexOf(a.name)-yA.indexOf(i.name)),t.hashStruct("EIP712Domain",{EIP712Domain:r},e)}static encode(e,r,a){return Kl(["0x1901",t.hashDomain(e),t.from(r).hash(a)])}static hash(e,r,a){return rn(t.encode(e,r,a))}static resolveNames(e,r,a,i){return bbe(this,void 0,void 0,function*(){e=Wm(e);let h={};e.verifyingContract&&!$n(e.verifyingContract,20)&&(h[e.verifyingContract]="0x");let l=t.from(r);l.visit(a,(p,b)=>(p==="address"&&!$n(b,20)&&(h[b]="0x"),b));for(let p in h)h[p]=yield i(p);return e.verifyingContract&&h[e.verifyingContract]&&(e.verifyingContract=h[e.verifyingContract]),a=l.visit(a,(p,b)=>p==="address"&&h[b]?h[b]:b),{domain:e,value:a}})}static getPayload(e,r,a){t.hashDomain(e);let i={},h=[];yA.forEach(b=>{let g=e[b];g!=null&&(i[b]=Sbe[b](g),h.push({name:b,type:HV[b]}))});let l=t.from(r),p=Wm(r);return p.EIP712Domain?an.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",r):p.EIP712Domain=h,l.encode(a),{types:p,domain:i,primaryType:l.primaryType,message:l.visit(a,(b,g)=>{if(b.match(/^bytes(\d*)/))return sr(Ct(g));if(b.match(/^u?int/))return nn.from(g).toString();switch(b){case"address":return g.toLowerCase();case"bool":return!!g;case"string":return typeof g!="string"&&an.throwArgumentError("invalid string","value",g),g}return an.throwArgumentError("unsupported type","type",b)})}}};ie();ae();ne();ie();ae();ne();var Ir=gi(XV()),Su=gi(Yp());function Jp(t,e,r){return r={path:e,exports:{},require:function(a,i){return Wye(a,i??r.path)}},t(r,r.exports),r.exports}function Wye(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}var OA=OG;function OG(t,e){if(!t)throw new Error(e||"Assertion failed")}OG.equal=function(e,r,a){if(e!=r)throw new Error(a||"Assertion failed: "+e+" != "+r)};var _f=Jp(function(t,e){"use strict";var r=e;function a(l,p){if(Array.isArray(l))return l.slice();if(!l)return[];var b=[];if(typeof l!="string"){for(var g=0;g<l.length;g++)b[g]=l[g]|0;return b}if(p==="hex"){l=l.replace(/[^a-z0-9]+/ig,""),l.length%2!==0&&(l="0"+l);for(var g=0;g<l.length;g+=2)b.push(parseInt(l[g]+l[g+1],16))}else for(var g=0;g<l.length;g++){var y=l.charCodeAt(g),M=y>>8,x=y&255;M?b.push(M,x):b.push(x)}return b}r.toArray=a;function i(l){return l.length===1?"0"+l:l}r.zero2=i;function h(l){for(var p="",b=0;b<l.length;b++)p+=i(l[b].toString(16));return p}r.toHex=h,r.encode=function(p,b){return b==="hex"?h(p):p}}),Ro=Jp(function(t,e){"use strict";var r=e;r.assert=OA,r.toArray=_f.toArray,r.zero2=_f.zero2,r.toHex=_f.toHex,r.encode=_f.encode;function a(b,g,y){var M=new Array(Math.max(b.bitLength(),y)+1);M.fill(0);for(var x=1<<g+1,E=b.clone(),A=0;A<M.length;A++){var k,P=E.andln(x-1);E.isOdd()?(P>(x>>1)-1?k=(x>>1)-P:k=P,E.isubn(k)):k=0,M[A]=k,E.iushrn(1)}return M}r.getNAF=a;function i(b,g){var y=[[],[]];b=b.clone(),g=g.clone();for(var M=0,x=0,E;b.cmpn(-M)>0||g.cmpn(-x)>0;){var A=b.andln(3)+M&3,k=g.andln(3)+x&3;A===3&&(A=-1),k===3&&(k=-1);var P;A&1?(E=b.andln(7)+M&7,(E===3||E===5)&&k===2?P=-A:P=A):P=0,y[0].push(P);var N;k&1?(E=g.andln(7)+x&7,(E===3||E===5)&&A===2?N=-k:N=k):N=0,y[1].push(N),2*M===P+1&&(M=1-M),2*x===N+1&&(x=1-x),b.iushrn(1),g.iushrn(1)}return y}r.getJSF=i;function h(b,g,y){var M="_"+g;b.prototype[g]=function(){return this[M]!==void 0?this[M]:this[M]=y.call(this)}}r.cachedProperty=h;function l(b){return typeof b=="string"?r.toArray(b,"hex"):b}r.parseBytes=l;function p(b){return new Ir.default(b,"hex","le")}r.intFromLE=p}),I3=Ro.getNAF,Vye=Ro.getJSF,B3=Ro.assert;function Jl(t,e){this.type=t,this.p=new Ir.default(e.p,16),this.red=e.prime?Ir.default.red(e.prime):Ir.default.mont(this.p),this.zero=new Ir.default(0).toRed(this.red),this.one=new Ir.default(1).toRed(this.red),this.two=new Ir.default(2).toRed(this.red),this.n=e.n&&new Ir.default(e.n,16),this.g=e.g&&this.pointFromJSON(e.g,e.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var B0=Jl;Jl.prototype.point=function(){throw new Error("Not implemented")};Jl.prototype.validate=function(){throw new Error("Not implemented")};Jl.prototype._fixedNafMul=function(e,r){B3(e.precomputed);var a=e._getDoubles(),i=I3(r,1,this._bitLength),h=(1<<a.step+1)-(a.step%2===0?2:1);h/=3;var l=[],p,b;for(p=0;p<i.length;p+=a.step){b=0;for(var g=p+a.step-1;g>=p;g--)b=(b<<1)+i[g];l.push(b)}for(var y=this.jpoint(null,null,null),M=this.jpoint(null,null,null),x=h;x>0;x--){for(p=0;p<l.length;p++)b=l[p],b===x?M=M.mixedAdd(a.points[p]):b===-x&&(M=M.mixedAdd(a.points[p].neg()));y=y.add(M)}return y.toP()};Jl.prototype._wnafMul=function(e,r){var a=4,i=e._getNAFPoints(a);a=i.wnd;for(var h=i.points,l=I3(r,a,this._bitLength),p=this.jpoint(null,null,null),b=l.length-1;b>=0;b--){for(var g=0;b>=0&&l[b]===0;b--)g++;if(b>=0&&g++,p=p.dblp(g),b<0)break;var y=l[b];B3(y!==0),e.type==="affine"?y>0?p=p.mixedAdd(h[y-1>>1]):p=p.mixedAdd(h[-y-1>>1].neg()):y>0?p=p.add(h[y-1>>1]):p=p.add(h[-y-1>>1].neg())}return e.type==="affine"?p.toP():p};Jl.prototype._wnafMulAdd=function(e,r,a,i,h){var l=this._wnafT1,p=this._wnafT2,b=this._wnafT3,g=0,y,M,x;for(y=0;y<i;y++){x=r[y];var E=x._getNAFPoints(e);l[y]=E.wnd,p[y]=E.points}for(y=i-1;y>=1;y-=2){var A=y-1,k=y;if(l[A]!==1||l[k]!==1){b[A]=I3(a[A],l[A],this._bitLength),b[k]=I3(a[k],l[k],this._bitLength),g=Math.max(b[A].length,g),g=Math.max(b[k].length,g);continue}var P=[r[A],null,null,r[k]];r[A].y.cmp(r[k].y)===0?(P[1]=r[A].add(r[k]),P[2]=r[A].toJ().mixedAdd(r[k].neg())):r[A].y.cmp(r[k].y.redNeg())===0?(P[1]=r[A].toJ().mixedAdd(r[k]),P[2]=r[A].add(r[k].neg())):(P[1]=r[A].toJ().mixedAdd(r[k]),P[2]=r[A].toJ().mixedAdd(r[k].neg()));var N=[-3,-1,-5,-7,0,7,5,1,3],L=Vye(a[A],a[k]);for(g=Math.max(L[0].length,g),b[A]=new Array(g),b[k]=new Array(g),M=0;M<g;M++){var C=L[0][M]|0,Y=L[1][M]|0;b[A][M]=N[(C+1)*3+(Y+1)],b[k][M]=0,p[A]=P}}var G=this.jpoint(null,null,null),ee=this._wnafT4;for(y=g;y>=0;y--){for(var D=0;y>=0;){var U=!0;for(M=0;M<i;M++)ee[M]=b[M][y]|0,ee[M]!==0&&(U=!1);if(!U)break;D++,y--}if(y>=0&&D++,G=G.dblp(D),y<0)break;for(M=0;M<i;M++){var V=ee[M];V!==0&&(V>0?x=p[M][V-1>>1]:V<0&&(x=p[M][-V-1>>1].neg()),x.type==="affine"?G=G.mixedAdd(x):G=G.add(x))}}for(y=0;y<i;y++)p[y]=null;return h?G:G.toP()};function _s(t,e){this.curve=t,this.type=e,this.precomputed=null}Jl.BasePoint=_s;_s.prototype.eq=function(){throw new Error("Not implemented")};_s.prototype.validate=function(){return this.curve.validate(this)};Jl.prototype.decodePoint=function(e,r){e=Ro.toArray(e,r);var a=this.p.byteLength();if((e[0]===4||e[0]===6||e[0]===7)&&e.length-1===2*a){e[0]===6?B3(e[e.length-1]%2===0):e[0]===7&&B3(e[e.length-1]%2===1);var i=this.point(e.slice(1,1+a),e.slice(1+a,1+2*a));return i}else if((e[0]===2||e[0]===3)&&e.length-1===a)return this.pointFromX(e.slice(1,1+a),e[0]===3);throw new Error("Unknown point format")};_s.prototype.encodeCompressed=function(e){return this.encode(e,!0)};_s.prototype._encode=function(e){var r=this.curve.p.byteLength(),a=this.getX().toArray("be",r);return e?[this.getY().isEven()?2:3].concat(a):[4].concat(a,this.getY().toArray("be",r))};_s.prototype.encode=function(e,r){return Ro.encode(this._encode(r),e)};_s.prototype.precompute=function(e){if(this.precomputed)return this;var r={doubles:null,naf:null,beta:null};return r.naf=this._getNAFPoints(8),r.doubles=this._getDoubles(4,e),r.beta=this._getBeta(),this.precomputed=r,this};_s.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var r=this.precomputed.doubles;return r?r.points.length>=Math.ceil((e.bitLength()+1)/r.step):!1};_s.prototype._getDoubles=function(e,r){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var a=[this],i=this,h=0;h<r;h+=e){for(var l=0;l<e;l++)i=i.dbl();a.push(i)}return{step:e,points:a}};_s.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var r=[this],a=(1<<e)-1,i=a===1?null:this.dbl(),h=1;h<a;h++)r[h]=r[h-1].add(i);return{wnd:e,points:r}};_s.prototype._getBeta=function(){return null};_s.prototype.dblp=function(e){for(var r=this,a=0;a<e;a++)r=r.dbl();return r};var NA=Jp(function(t){typeof Object.create=="function"?t.exports=function(r,a){a&&(r.super_=a,r.prototype=Object.create(a.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(r,a){if(a){r.super_=a;var i=function(){};i.prototype=a.prototype,r.prototype=new i,r.prototype.constructor=r}}}),Gye=Ro.assert;function Ms(t){B0.call(this,"short",t),this.a=new Ir.default(t.a,16).toRed(this.red),this.b=new Ir.default(t.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=this.a.fromRed().cmpn(0)===0,this.threeA=this.a.fromRed().sub(this.p).cmpn(-3)===0,this.endo=this._getEndomorphism(t),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}NA(Ms,B0);var Yye=Ms;Ms.prototype._getEndomorphism=function(e){if(!(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)){var r,a;if(e.beta)r=new Ir.default(e.beta,16).toRed(this.red);else{var i=this._getEndoRoots(this.p);r=i[0].cmp(i[1])<0?i[0]:i[1],r=r.toRed(this.red)}if(e.lambda)a=new Ir.default(e.lambda,16);else{var h=this._getEndoRoots(this.n);this.g.mul(h[0]).x.cmp(this.g.x.redMul(r))===0?a=h[0]:(a=h[1],Gye(this.g.mul(a).x.cmp(this.g.x.redMul(r))===0))}var l;return e.basis?l=e.basis.map(function(p){return{a:new Ir.default(p.a,16),b:new Ir.default(p.b,16)}}):l=this._getEndoBasis(a),{beta:r,lambda:a,basis:l}}};Ms.prototype._getEndoRoots=function(e){var r=e===this.p?this.red:Ir.default.mont(e),a=new Ir.default(2).toRed(r).redInvm(),i=a.redNeg(),h=new Ir.default(3).toRed(r).redNeg().redSqrt().redMul(a),l=i.redAdd(h).fromRed(),p=i.redSub(h).fromRed();return[l,p]};Ms.prototype._getEndoBasis=function(e){for(var r=this.n.ushrn(Math.floor(this.n.bitLength()/2)),a=e,i=this.n.clone(),h=new Ir.default(1),l=new Ir.default(0),p=new Ir.default(0),b=new Ir.default(1),g,y,M,x,E,A,k,P=0,N,L;a.cmpn(0)!==0;){var C=i.div(a);N=i.sub(C.mul(a)),L=p.sub(C.mul(h));var Y=b.sub(C.mul(l));if(!M&&N.cmp(r)<0)g=k.neg(),y=h,M=N.neg(),x=L;else if(M&&++P===2)break;k=N,i=a,a=N,p=h,h=L,b=l,l=Y}E=N.neg(),A=L;var G=M.sqr().add(x.sqr()),ee=E.sqr().add(A.sqr());return ee.cmp(G)>=0&&(E=g,A=y),M.negative&&(M=M.neg(),x=x.neg()),E.negative&&(E=E.neg(),A=A.neg()),[{a:M,b:x},{a:E,b:A}]};Ms.prototype._endoSplit=function(e){var r=this.endo.basis,a=r[0],i=r[1],h=i.b.mul(e).divRound(this.n),l=a.b.neg().mul(e).divRound(this.n),p=h.mul(a.a),b=l.mul(i.a),g=h.mul(a.b),y=l.mul(i.b),M=e.sub(p).sub(b),x=g.add(y).neg();return{k1:M,k2:x}};Ms.prototype.pointFromX=function(e,r){e=new Ir.default(e,16),e.red||(e=e.toRed(this.red));var a=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),i=a.redSqrt();if(i.redSqr().redSub(a).cmp(this.zero)!==0)throw new Error("invalid point");var h=i.fromRed().isOdd();return(r&&!h||!r&&h)&&(i=i.redNeg()),this.point(e,i)};Ms.prototype.validate=function(e){if(e.inf)return!0;var r=e.x,a=e.y,i=this.a.redMul(r),h=r.redSqr().redMul(r).redIAdd(i).redIAdd(this.b);return a.redSqr().redISub(h).cmpn(0)===0};Ms.prototype._endoWnafMulAdd=function(e,r,a){for(var i=this._endoWnafT1,h=this._endoWnafT2,l=0;l<e.length;l++){var p=this._endoSplit(r[l]),b=e[l],g=b._getBeta();p.k1.negative&&(p.k1.ineg(),b=b.neg(!0)),p.k2.negative&&(p.k2.ineg(),g=g.neg(!0)),i[l*2]=b,i[l*2+1]=g,h[l*2]=p.k1,h[l*2+1]=p.k2}for(var y=this._wnafMulAdd(1,i,h,l*2,a),M=0;M<l*2;M++)i[M]=null,h[M]=null;return y};function Qn(t,e,r,a){B0.BasePoint.call(this,t,"affine"),e===null&&r===null?(this.x=null,this.y=null,this.inf=!0):(this.x=new Ir.default(e,16),this.y=new Ir.default(r,16),a&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}NA(Qn,B0.BasePoint);Ms.prototype.point=function(e,r,a){return new Qn(this,e,r,a)};Ms.prototype.pointFromJSON=function(e,r){return Qn.fromJSON(this,e,r)};Qn.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var r=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var a=this.curve,i=function(h){return a.point(h.x.redMul(a.endo.beta),h.y)};e.beta=r,r.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(i)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(i)}}}return r}};Qn.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]};Qn.fromJSON=function(e,r,a){typeof r=="string"&&(r=JSON.parse(r));var i=e.point(r[0],r[1],a);if(!r[2])return i;function h(p){return e.point(p[0],p[1],a)}var l=r[2];return i.precomputed={beta:null,doubles:l.doubles&&{step:l.doubles.step,points:[i].concat(l.doubles.points.map(h))},naf:l.naf&&{wnd:l.naf.wnd,points:[i].concat(l.naf.points.map(h))}},i};Qn.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"};Qn.prototype.isInfinity=function(){return this.inf};Qn.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(this.x.cmp(e.x)===0)return this.curve.point(null,null);var r=this.y.redSub(e.y);r.cmpn(0)!==0&&(r=r.redMul(this.x.redSub(e.x).redInvm()));var a=r.redSqr().redISub(this.x).redISub(e.x),i=r.redMul(this.x.redSub(a)).redISub(this.y);return this.curve.point(a,i)};Qn.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(e.cmpn(0)===0)return this.curve.point(null,null);var r=this.curve.a,a=this.x.redSqr(),i=e.redInvm(),h=a.redAdd(a).redIAdd(a).redIAdd(r).redMul(i),l=h.redSqr().redISub(this.x.redAdd(this.x)),p=h.redMul(this.x.redSub(l)).redISub(this.y);return this.curve.point(l,p)};Qn.prototype.getX=function(){return this.x.fromRed()};Qn.prototype.getY=function(){return this.y.fromRed()};Qn.prototype.mul=function(e){return e=new Ir.default(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)};Qn.prototype.mulAdd=function(e,r,a){var i=[this,r],h=[e,a];return this.curve.endo?this.curve._endoWnafMulAdd(i,h):this.curve._wnafMulAdd(1,i,h,2)};Qn.prototype.jmulAdd=function(e,r,a){var i=[this,r],h=[e,a];return this.curve.endo?this.curve._endoWnafMulAdd(i,h,!0):this.curve._wnafMulAdd(1,i,h,2,!0)};Qn.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||this.x.cmp(e.x)===0&&this.y.cmp(e.y)===0)};Qn.prototype.neg=function(e){if(this.inf)return this;var r=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var a=this.precomputed,i=function(h){return h.neg()};r.precomputed={naf:a.naf&&{wnd:a.naf.wnd,points:a.naf.points.map(i)},doubles:a.doubles&&{step:a.doubles.step,points:a.doubles.points.map(i)}}}return r};Qn.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var e=this.curve.jpoint(this.x,this.y,this.curve.one);return e};function la(t,e,r,a){B0.BasePoint.call(this,t,"jacobian"),e===null&&r===null&&a===null?(this.x=this.curve.one,this.y=this.curve.one,this.z=new Ir.default(0)):(this.x=new Ir.default(e,16),this.y=new Ir.default(r,16),this.z=new Ir.default(a,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}NA(la,B0.BasePoint);Ms.prototype.jpoint=function(e,r,a){return new la(this,e,r,a)};la.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),r=e.redSqr(),a=this.x.redMul(r),i=this.y.redMul(r).redMul(e);return this.curve.point(a,i)};la.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)};la.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var r=e.z.redSqr(),a=this.z.redSqr(),i=this.x.redMul(r),h=e.x.redMul(a),l=this.y.redMul(r.redMul(e.z)),p=e.y.redMul(a.redMul(this.z)),b=i.redSub(h),g=l.redSub(p);if(b.cmpn(0)===0)return g.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var y=b.redSqr(),M=y.redMul(b),x=i.redMul(y),E=g.redSqr().redIAdd(M).redISub(x).redISub(x),A=g.redMul(x.redISub(E)).redISub(l.redMul(M)),k=this.z.redMul(e.z).redMul(b);return this.curve.jpoint(E,A,k)};la.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var r=this.z.redSqr(),a=this.x,i=e.x.redMul(r),h=this.y,l=e.y.redMul(r).redMul(this.z),p=a.redSub(i),b=h.redSub(l);if(p.cmpn(0)===0)return b.cmpn(0)!==0?this.curve.jpoint(null,null,null):this.dbl();var g=p.redSqr(),y=g.redMul(p),M=a.redMul(g),x=b.redSqr().redIAdd(y).redISub(M).redISub(M),E=b.redMul(M.redISub(x)).redISub(h.redMul(y)),A=this.z.redMul(p);return this.curve.jpoint(x,E,A)};la.prototype.dblp=function(e){if(e===0)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var r;if(this.curve.zeroA||this.curve.threeA){var a=this;for(r=0;r<e;r++)a=a.dbl();return a}var i=this.curve.a,h=this.curve.tinv,l=this.x,p=this.y,b=this.z,g=b.redSqr().redSqr(),y=p.redAdd(p);for(r=0;r<e;r++){var M=l.redSqr(),x=y.redSqr(),E=x.redSqr(),A=M.redAdd(M).redIAdd(M).redIAdd(i.redMul(g)),k=l.redMul(x),P=A.redSqr().redISub(k.redAdd(k)),N=k.redISub(P),L=A.redMul(N);L=L.redIAdd(L).redISub(E);var C=y.redMul(b);r+1<e&&(g=g.redMul(E)),l=P,b=C,y=L}return this.curve.jpoint(l,y.redMul(h),b)};la.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()};la.prototype._zeroDbl=function(){var e,r,a;if(this.zOne){var i=this.x.redSqr(),h=this.y.redSqr(),l=h.redSqr(),p=this.x.redAdd(h).redSqr().redISub(i).redISub(l);p=p.redIAdd(p);var b=i.redAdd(i).redIAdd(i),g=b.redSqr().redISub(p).redISub(p),y=l.redIAdd(l);y=y.redIAdd(y),y=y.redIAdd(y),e=g,r=b.redMul(p.redISub(g)).redISub(y),a=this.y.redAdd(this.y)}else{var M=this.x.redSqr(),x=this.y.redSqr(),E=x.redSqr(),A=this.x.redAdd(x).redSqr().redISub(M).redISub(E);A=A.redIAdd(A);var k=M.redAdd(M).redIAdd(M),P=k.redSqr(),N=E.redIAdd(E);N=N.redIAdd(N),N=N.redIAdd(N),e=P.redISub(A).redISub(A),r=k.redMul(A.redISub(e)).redISub(N),a=this.y.redMul(this.z),a=a.redIAdd(a)}return this.curve.jpoint(e,r,a)};la.prototype._threeDbl=function(){var e,r,a;if(this.zOne){var i=this.x.redSqr(),h=this.y.redSqr(),l=h.redSqr(),p=this.x.redAdd(h).redSqr().redISub(i).redISub(l);p=p.redIAdd(p);var b=i.redAdd(i).redIAdd(i).redIAdd(this.curve.a),g=b.redSqr().redISub(p).redISub(p);e=g;var y=l.redIAdd(l);y=y.redIAdd(y),y=y.redIAdd(y),r=b.redMul(p.redISub(g)).redISub(y),a=this.y.redAdd(this.y)}else{var M=this.z.redSqr(),x=this.y.redSqr(),E=this.x.redMul(x),A=this.x.redSub(M).redMul(this.x.redAdd(M));A=A.redAdd(A).redIAdd(A);var k=E.redIAdd(E);k=k.redIAdd(k);var P=k.redAdd(k);e=A.redSqr().redISub(P),a=this.y.redAdd(this.z).redSqr().redISub(x).redISub(M);var N=x.redSqr();N=N.redIAdd(N),N=N.redIAdd(N),N=N.redIAdd(N),r=A.redMul(k.redISub(e)).redISub(N)}return this.curve.jpoint(e,r,a)};la.prototype._dbl=function(){var e=this.curve.a,r=this.x,a=this.y,i=this.z,h=i.redSqr().redSqr(),l=r.redSqr(),p=a.redSqr(),b=l.redAdd(l).redIAdd(l).redIAdd(e.redMul(h)),g=r.redAdd(r);g=g.redIAdd(g);var y=g.redMul(p),M=b.redSqr().redISub(y.redAdd(y)),x=y.redISub(M),E=p.redSqr();E=E.redIAdd(E),E=E.redIAdd(E),E=E.redIAdd(E);var A=b.redMul(x).redISub(E),k=a.redAdd(a).redMul(i);return this.curve.jpoint(M,A,k)};la.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),r=this.y.redSqr(),a=this.z.redSqr(),i=r.redSqr(),h=e.redAdd(e).redIAdd(e),l=h.redSqr(),p=this.x.redAdd(r).redSqr().redISub(e).redISub(i);p=p.redIAdd(p),p=p.redAdd(p).redIAdd(p),p=p.redISub(l);var b=p.redSqr(),g=i.redIAdd(i);g=g.redIAdd(g),g=g.redIAdd(g),g=g.redIAdd(g);var y=h.redIAdd(p).redSqr().redISub(l).redISub(b).redISub(g),M=r.redMul(y);M=M.redIAdd(M),M=M.redIAdd(M);var x=this.x.redMul(b).redISub(M);x=x.redIAdd(x),x=x.redIAdd(x);var E=this.y.redMul(y.redMul(g.redISub(y)).redISub(p.redMul(b)));E=E.redIAdd(E),E=E.redIAdd(E),E=E.redIAdd(E);var A=this.z.redAdd(p).redSqr().redISub(a).redISub(b);return this.curve.jpoint(x,E,A)};la.prototype.mul=function(e,r){return e=new Ir.default(e,r),this.curve._wnafMul(this,e)};la.prototype.eq=function(e){if(e.type==="affine")return this.eq(e.toJ());if(this===e)return!0;var r=this.z.redSqr(),a=e.z.redSqr();if(this.x.redMul(a).redISub(e.x.redMul(r)).cmpn(0)!==0)return!1;var i=r.redMul(this.z),h=a.redMul(e.z);return this.y.redMul(h).redISub(e.y.redMul(i)).cmpn(0)===0};la.prototype.eqXToP=function(e){var r=this.z.redSqr(),a=e.toRed(this.curve.red).redMul(r);if(this.x.cmp(a)===0)return!0;for(var i=e.clone(),h=this.curve.redN.redMul(r);;){if(i.iadd(this.curve.n),i.cmp(this.curve.p)>=0)return!1;if(a.redIAdd(h),this.x.cmp(a)===0)return!0}};la.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"};la.prototype.isInfinity=function(){return this.z.cmpn(0)===0};var T3=Jp(function(t,e){"use strict";var r=e;r.base=B0,r.short=Yye,r.mont=null,r.edwards=null}),k3=Jp(function(t,e){"use strict";var r=e,a=Ro.assert;function i(p){p.type==="short"?this.curve=new T3.short(p):p.type==="edwards"?this.curve=new T3.edwards(p):this.curve=new T3.mont(p),this.g=this.curve.g,this.n=this.curve.n,this.hash=p.hash,a(this.g.validate(),"Invalid curve"),a(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}r.PresetCurve=i;function h(p,b){Object.defineProperty(r,p,{configurable:!0,enumerable:!0,get:function(){var g=new i(b);return Object.defineProperty(r,p,{configurable:!0,enumerable:!0,value:g}),g}})}h("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:Su.default.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),h("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:Su.default.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),h("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:Su.default.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),h("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:Su.default.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),h("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:Su.default.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),h("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Su.default.sha256,gRed:!1,g:["9"]}),h("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Su.default.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var l;try{l=null.crash()}catch{l=void 0}h("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:Su.default.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",l]})});function Yl(t){if(!(this instanceof Yl))return new Yl(t);this.hash=t.hash,this.predResist=!!t.predResist,this.outLen=this.hash.outSize,this.minEntropy=t.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var e=_f.toArray(t.entropy,t.entropyEnc||"hex"),r=_f.toArray(t.nonce,t.nonceEnc||"hex"),a=_f.toArray(t.pers,t.persEnc||"hex");OA(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(e,r,a)}var NG=Yl;Yl.prototype._init=function(e,r,a){var i=e.concat(r).concat(a);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var h=0;h<this.V.length;h++)this.K[h]=0,this.V[h]=1;this._update(i),this._reseed=1,this.reseedInterval=281474976710656};Yl.prototype._hmac=function(){return new Su.default.hmac(this.hash,this.K)};Yl.prototype._update=function(e){var r=this._hmac().update(this.V).update([0]);e&&(r=r.update(e)),this.K=r.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())};Yl.prototype.reseed=function(e,r,a,i){typeof r!="string"&&(i=a,a=r,r=null),e=_f.toArray(e,r),a=_f.toArray(a,i),OA(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(a||[])),this._reseed=1};Yl.prototype.generate=function(e,r,a,i){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");typeof r!="string"&&(i=a,a=r,r=null),a&&(a=_f.toArray(a,i||"hex"),this._update(a));for(var h=[];h.length<e;)this.V=this._hmac().update(this.V).digest(),h=h.concat(this.V);var l=h.slice(0,e);return this._update(a),this._reseed++,_f.encode(l,r)};var PA=Ro.assert;function Ra(t,e){this.ec=t,this.priv=null,this.pub=null,e.priv&&this._importPrivate(e.priv,e.privEnc),e.pub&&this._importPublic(e.pub,e.pubEnc)}var CA=Ra;Ra.fromPublic=function(e,r,a){return r instanceof Ra?r:new Ra(e,{pub:r,pubEnc:a})};Ra.fromPrivate=function(e,r,a){return r instanceof Ra?r:new Ra(e,{priv:r,privEnc:a})};Ra.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}};Ra.prototype.getPublic=function(e,r){return typeof e=="string"&&(r=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),r?this.pub.encode(r,e):this.pub};Ra.prototype.getPrivate=function(e){return e==="hex"?this.priv.toString(16,2):this.priv};Ra.prototype._importPrivate=function(e,r){this.priv=new Ir.default(e,r||16),this.priv=this.priv.umod(this.ec.curve.n)};Ra.prototype._importPublic=function(e,r){if(e.x||e.y){this.ec.curve.type==="mont"?PA(e.x,"Need x coordinate"):(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")&&PA(e.x&&e.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(e.x,e.y);return}this.pub=this.ec.curve.decodePoint(e,r)};Ra.prototype.derive=function(e){return e.validate()||PA(e.validate(),"public point not validated"),e.mul(this.priv).getX()};Ra.prototype.sign=function(e,r,a){return this.ec.sign(e,this,r,a)};Ra.prototype.verify=function(e,r){return this.ec.verify(e,r,this)};Ra.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var Jye=Ro.assert;function P3(t,e){if(t instanceof P3)return t;this._importDER(t,e)||(Jye(t.r&&t.s,"Signature without r or s"),this.r=new Ir.default(t.r,16),this.s=new Ir.default(t.s,16),t.recoveryParam===void 0?this.recoveryParam=null:this.recoveryParam=t.recoveryParam)}var O3=P3;function Xye(){this.place=0}function IA(t,e){var r=t[e.place++];if(!(r&128))return r;var a=r&15;if(a===0||a>4)return!1;for(var i=0,h=0,l=e.place;h<a;h++,l++)i<<=8,i|=t[l],i>>>=0;return i<=127?!1:(e.place=l,i)}function PG(t){for(var e=0,r=t.length-1;!t[e]&&!(t[e+1]&128)&&e<r;)e++;return e===0?t:t.slice(e)}P3.prototype._importDER=function(e,r){e=Ro.toArray(e,r);var a=new Xye;if(e[a.place++]!==48)return!1;var i=IA(e,a);if(i===!1||i+a.place!==e.length||e[a.place++]!==2)return!1;var h=IA(e,a);if(h===!1)return!1;var l=e.slice(a.place,h+a.place);if(a.place+=h,e[a.place++]!==2)return!1;var p=IA(e,a);if(p===!1||e.length!==p+a.place)return!1;var b=e.slice(a.place,p+a.place);if(l[0]===0)if(l[1]&128)l=l.slice(1);else return!1;if(b[0]===0)if(b[1]&128)b=b.slice(1);else return!1;return this.r=new Ir.default(l),this.s=new Ir.default(b),this.recoveryParam=null,!0};function BA(t,e){if(e<128){t.push(e);return}var r=1+(Math.log(e)/Math.LN2>>>3);for(t.push(r|128);--r;)t.push(e>>>(r<<3)&255);t.push(e)}P3.prototype.toDER=function(e){var r=this.r.toArray(),a=this.s.toArray();for(r[0]&128&&(r=[0].concat(r)),a[0]&128&&(a=[0].concat(a)),r=PG(r),a=PG(a);!a[0]&&!(a[1]&128);)a=a.slice(1);var i=[2];BA(i,r.length),i=i.concat(r),i.push(2),BA(i,a.length);var h=i.concat(a),l=[48];return BA(l,h.length),l=l.concat(h),Ro.encode(l,e)};var Qye=function(){throw new Error("unsupported")},CG=Ro.assert;function ws(t){if(!(this instanceof ws))return new ws(t);typeof t=="string"&&(CG(Object.prototype.hasOwnProperty.call(k3,t),"Unknown curve "+t),t=k3[t]),t instanceof k3.PresetCurve&&(t={curve:t}),this.curve=t.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=t.curve.g,this.g.precompute(t.curve.n.bitLength()+1),this.hash=t.hash||t.curve.hash}var e6e=ws;ws.prototype.keyPair=function(e){return new CA(this,e)};ws.prototype.keyFromPrivate=function(e,r){return CA.fromPrivate(this,e,r)};ws.prototype.keyFromPublic=function(e,r){return CA.fromPublic(this,e,r)};ws.prototype.genKeyPair=function(e){e||(e={});for(var r=new NG({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||Qye(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),a=this.n.byteLength(),i=this.n.sub(new Ir.default(2));;){var h=new Ir.default(r.generate(a));if(!(h.cmp(i)>0))return h.iaddn(1),this.keyFromPrivate(h)}};ws.prototype._truncateToN=function(e,r){var a=e.byteLength()*8-this.n.bitLength();return a>0&&(e=e.ushrn(a)),!r&&e.cmp(this.n)>=0?e.sub(this.n):e};ws.prototype.sign=function(e,r,a,i){typeof a=="object"&&(i=a,a=null),i||(i={}),r=this.keyFromPrivate(r,a),e=this._truncateToN(new Ir.default(e,16));for(var h=this.n.byteLength(),l=r.getPrivate().toArray("be",h),p=e.toArray("be",h),b=new NG({hash:this.hash,entropy:l,nonce:p,pers:i.pers,persEnc:i.persEnc||"utf8"}),g=this.n.sub(new Ir.default(1)),y=0;;y++){var M=i.k?i.k(y):new Ir.default(b.generate(this.n.byteLength()));if(M=this._truncateToN(M,!0),!(M.cmpn(1)<=0||M.cmp(g)>=0)){var x=this.g.mul(M);if(!x.isInfinity()){var E=x.getX(),A=E.umod(this.n);if(A.cmpn(0)!==0){var k=M.invm(this.n).mul(A.mul(r.getPrivate()).iadd(e));if(k=k.umod(this.n),k.cmpn(0)!==0){var P=(x.getY().isOdd()?1:0)|(E.cmp(A)!==0?2:0);return i.canonical&&k.cmp(this.nh)>0&&(k=this.n.sub(k),P^=1),new O3({r:A,s:k,recoveryParam:P})}}}}}};ws.prototype.verify=function(e,r,a,i){e=this._truncateToN(new Ir.default(e,16)),a=this.keyFromPublic(a,i),r=new O3(r,"hex");var h=r.r,l=r.s;if(h.cmpn(1)<0||h.cmp(this.n)>=0||l.cmpn(1)<0||l.cmp(this.n)>=0)return!1;var p=l.invm(this.n),b=p.mul(e).umod(this.n),g=p.mul(h).umod(this.n),y;return this.curve._maxwellTrick?(y=this.g.jmulAdd(b,a.getPublic(),g),y.isInfinity()?!1:y.eqXToP(h)):(y=this.g.mulAdd(b,a.getPublic(),g),y.isInfinity()?!1:y.getX().umod(this.n).cmp(h)===0)};ws.prototype.recoverPubKey=function(t,e,r,a){CG((3&r)===r,"The recovery param is more than two bits"),e=new O3(e,a);var i=this.n,h=new Ir.default(t),l=e.r,p=e.s,b=r&1,g=r>>1;if(l.cmp(this.curve.p.umod(this.curve.n))>=0&&g)throw new Error("Unable to find sencond key candinate");g?l=this.curve.pointFromX(l.add(this.curve.n),b):l=this.curve.pointFromX(l,b);var y=e.r.invm(i),M=i.sub(h).mul(y).umod(i),x=p.mul(y).umod(i);return this.g.mulAdd(M,l,x)};ws.prototype.getKeyRecoveryParam=function(t,e,r,a){if(e=new O3(e,a),e.recoveryParam!==null)return e.recoveryParam;for(var i=0;i<4;i++){var h;try{h=this.recoverPubKey(t,e,i)}catch{continue}if(h.eq(r))return i}throw new Error("Unable to find valid recovery factor")};var t6e=Jp(function(t,e){"use strict";var r=e;r.version="6.5.4",r.utils=Ro,r.rand=function(){throw new Error("unsupported")},r.curve=T3,r.curves=k3,r.ec=e6e,r.eddsa=null}),LG=t6e.ec;ie();ae();ne();var DG="signing-key/5.7.0";var DA=new er(DG),LA=null;function Eu(){return LA||(LA=new LG("secp256k1")),LA}var Au=class{constructor(e){ur(this,"curve","secp256k1"),ur(this,"privateKey",sr(e)),jm(this.privateKey)!==32&&DA.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");let r=Eu().keyFromPrivate(Ct(this.privateKey));ur(this,"publicKey","0x"+r.getPublic(!1,"hex")),ur(this,"compressedPublicKey","0x"+r.getPublic(!0,"hex")),ur(this,"_isSigningKey",!0)}_addPoint(e){let r=Eu().keyFromPublic(Ct(this.publicKey)),a=Eu().keyFromPublic(Ct(e));return"0x"+r.pub.add(a.pub).encodeCompressed("hex")}signDigest(e){let r=Eu().keyFromPrivate(Ct(this.privateKey)),a=Ct(e);a.length!==32&&DA.throwArgumentError("bad digest length","digest",e);let i=r.sign(a,{canonical:!0});return Wl({recoveryParam:i.recoveryParam,r:Ea("0x"+i.r.toString(16),32),s:Ea("0x"+i.s.toString(16),32)})}computeSharedSecret(e){let r=Eu().keyFromPrivate(Ct(this.privateKey)),a=Eu().keyFromPublic(Ct($A(e)));return Ea("0x"+r.derive(a.getPublic()).toString(16),32)}static isSigningKey(e){return!!(e&&e._isSigningKey)}};function N3(t,e){let r=Wl(e),a={r:Ct(r.r),s:Ct(r.s)};return"0x"+Eu().recoverPubKey(Ct(t),a,r.recoveryParam).encode("hex",!1)}function $A(t,e){let r=Ct(t);if(r.length===32){let a=new Au(r);return e?"0x"+Eu().keyFromPrivate(r).getPublic(!0,"hex"):a.publicKey}else{if(r.length===33)return e?sr(r):"0x"+Eu().keyFromPublic(r).getPublic(!1,"hex");if(r.length===65)return e?"0x"+Eu().keyFromPublic(r).getPublic(!0,"hex"):sr(r)}return DA.throwArgumentError("invalid public or private key","key","[REDACTED]")}ie();ae();ne();ie();ae();ne();var $G="transactions/5.7.0";var Mf=new er($G),qG;(function(t){t[t.legacy=0]="legacy",t[t.eip2930=1]="eip2930",t[t.eip1559=2]="eip1559"})(qG||(qG={}));var r6e=[{name:"nonce",maxLength:32,numeric:!0},{name:"gasPrice",maxLength:32,numeric:!0},{name:"gasLimit",maxLength:32,numeric:!0},{name:"to",length:20},{name:"value",maxLength:32,numeric:!0},{name:"data"}],i6e={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,type:!0,value:!0};function xs(t){let e=$A(t);return Aa(Mh(rn(Mh(e,1)),12))}function UA(t,e){return xs(N3(Ct(t),e))}function To(t,e){let r=mu(nn.from(t).toHexString());return r.length>32&&Mf.throwArgumentError("invalid length for "+e,"transaction:"+e,t),r}function qA(t,e){return{address:Aa(t),storageKeys:(e||[]).map((r,a)=>(jm(r)!==32&&Mf.throwArgumentError("invalid access list storageKey",`accessList[${t}:${a}]`,r),r.toLowerCase()))}}function n6e(t){if(Array.isArray(t))return t.map((r,a)=>Array.isArray(r)?(r.length>2&&Mf.throwArgumentError("access list expected to be [ address, storageKeys[] ]",`value[${a}]`,r),qA(r[0],r[1])):qA(r.address,r.storageKeys));let e=Object.keys(t).map(r=>{let a=t[r].reduce((i,h)=>(i[h]=!0,i),{});return qA(r,Object.keys(a).sort())});return e.sort((r,a)=>r.address.localeCompare(a.address)),e}function UG(t){return n6e(t).map(e=>[e.address,e.storageKeys])}function a6e(t,e){if(t.gasPrice!=null){let a=nn.from(t.gasPrice),i=nn.from(t.maxFeePerGas||0);a.eq(i)||Mf.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:a,maxFeePerGas:i})}let r=[To(t.chainId||0,"chainId"),To(t.nonce||0,"nonce"),To(t.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),To(t.maxFeePerGas||0,"maxFeePerGas"),To(t.gasLimit||0,"gasLimit"),t.to!=null?Aa(t.to):"0x",To(t.value||0,"value"),t.data||"0x",UG(t.accessList||[])];if(e){let a=Wl(e);r.push(To(a.recoveryParam,"recoveryParam")),r.push(mu(a.r)),r.push(mu(a.s))}return Kl(["0x02",Zm(r)])}function o6e(t,e){let r=[To(t.chainId||0,"chainId"),To(t.nonce||0,"nonce"),To(t.gasPrice||0,"gasPrice"),To(t.gasLimit||0,"gasLimit"),t.to!=null?Aa(t.to):"0x",To(t.value||0,"value"),t.data||"0x",UG(t.accessList||[])];if(e){let a=Wl(e);r.push(To(a.recoveryParam,"recoveryParam")),r.push(mu(a.r)),r.push(mu(a.s))}return Kl(["0x01",Zm(r)])}function s6e(t,e){zV(t,i6e);let r=[];r6e.forEach(function(l){let p=t[l.name]||[],b={};l.numeric&&(b.hexPad="left"),p=Ct(sr(p,b)),l.length&&p.length!==l.length&&p.length>0&&Mf.throwArgumentError("invalid length for "+l.name,"transaction:"+l.name,p),l.maxLength&&(p=mu(p),p.length>l.maxLength&&Mf.throwArgumentError("invalid length for "+l.name,"transaction:"+l.name,p)),r.push(sr(p))});let a=0;if(t.chainId!=null?(a=t.chainId,typeof a!="number"&&Mf.throwArgumentError("invalid transaction.chainId","transaction",t)):e&&!Um(e)&&e.v>28&&(a=Math.floor((e.v-35)/2)),a!==0&&(r.push(sr(a)),r.push("0x"),r.push("0x")),!e)return Zm(r);let i=Wl(e),h=27+i.recoveryParam;return a!==0?(r.pop(),r.pop(),r.pop(),h+=a*2+8,i.v>28&&i.v!==h&&Mf.throwArgumentError("transaction.chainId/signature.v mismatch","signature",e)):i.v!==h&&Mf.throwArgumentError("transaction.chainId/signature.v mismatch","signature",e),r.push(sr(h)),r.push(mu(Ct(i.r))),r.push(mu(Ct(i.s))),Zm(r)}function FA(t,e){if(t.type==null||t.type===0)return t.accessList!=null&&Mf.throwArgumentError("untyped transactions do not support accessList; include type: 1","transaction",t),s6e(t,e);switch(t.type){case 1:return o6e(t,e);case 2:return a6e(t,e);default:break}return Mf.throwError(`unsupported transaction type: ${t.type}`,er.errors.UNSUPPORTED_OPERATION,{operation:"serializeTransaction",transactionType:t.type})}ie();ae();ne();ie();ae();ne();ie();ae();ne();var FG="abstract-provider/5.7.0";var f6e=function(t,e,r,a){function i(h){return h instanceof r?h:new r(function(l){l(h)})}return new(r||(r=Promise))(function(h,l){function p(y){try{g(a.next(y))}catch(M){l(M)}}function b(y){try{g(a.throw(y))}catch(M){l(M)}}function g(y){y.done?h(y.value):i(y.value).then(p,b)}g((a=a.apply(t,e||[])).next())})},u6e=new er(FG);var C3=class t{constructor(){u6e.checkAbstract(new.target,t),ur(this,"_isProvider",!0)}getFeeData(){return f6e(this,void 0,void 0,function*(){let{block:e,gasPrice:r}=yield Sh({block:this.getBlock("latest"),gasPrice:this.getGasPrice().catch(l=>null)}),a=null,i=null,h=null;return e&&e.baseFeePerGas&&(a=e.baseFeePerGas,h=nn.from("1500000000"),i=e.baseFeePerGas.mul(2).add(h)),{lastBaseFeePerGas:a,maxFeePerGas:i,maxPriorityFeePerGas:h,gasPrice:r}})}addListener(e,r){return this.on(e,r)}removeListener(e,r){return this.off(e,r)}static isProvider(e){return!!(e&&e._isProvider)}};ie();ae();ne();ie();ae();ne();var jG="abstract-signer/5.7.0";var xf=function(t,e,r,a){function i(h){return h instanceof r?h:new r(function(l){l(h)})}return new(r||(r=Promise))(function(h,l){function p(y){try{g(a.next(y))}catch(M){l(M)}}function b(y){try{g(a.throw(y))}catch(M){l(M)}}function g(y){y.done?h(y.value):i(y.value).then(p,b)}g((a=a.apply(t,e||[])).next())})},Sf=new er(jG),h6e=["accessList","ccipReadEnabled","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],l6e=[er.errors.INSUFFICIENT_FUNDS,er.errors.NONCE_EXPIRED,er.errors.REPLACEMENT_UNDERPRICED],L3=class t{constructor(){Sf.checkAbstract(new.target,t),ur(this,"_isSigner",!0)}getBalance(e){return xf(this,void 0,void 0,function*(){return this._checkProvider("getBalance"),yield this.provider.getBalance(this.getAddress(),e)})}getTransactionCount(e){return xf(this,void 0,void 0,function*(){return this._checkProvider("getTransactionCount"),yield this.provider.getTransactionCount(this.getAddress(),e)})}estimateGas(e){return xf(this,void 0,void 0,function*(){this._checkProvider("estimateGas");let r=yield Sh(this.checkTransaction(e));return yield this.provider.estimateGas(r)})}call(e,r){return xf(this,void 0,void 0,function*(){this._checkProvider("call");let a=yield Sh(this.checkTransaction(e));return yield this.provider.call(a,r)})}sendTransaction(e){return xf(this,void 0,void 0,function*(){this._checkProvider("sendTransaction");let r=yield this.populateTransaction(e),a=yield this.signTransaction(r);return yield this.provider.sendTransaction(a)})}getChainId(){return xf(this,void 0,void 0,function*(){return this._checkProvider("getChainId"),(yield this.provider.getNetwork()).chainId})}getGasPrice(){return xf(this,void 0,void 0,function*(){return this._checkProvider("getGasPrice"),yield this.provider.getGasPrice()})}getFeeData(){return xf(this,void 0,void 0,function*(){return this._checkProvider("getFeeData"),yield this.provider.getFeeData()})}resolveName(e){return xf(this,void 0,void 0,function*(){return this._checkProvider("resolveName"),yield this.provider.resolveName(e)})}checkTransaction(e){for(let a in e)h6e.indexOf(a)===-1&&Sf.throwArgumentError("invalid transaction key: "+a,"transaction",e);let r=Wm(e);return r.from==null?r.from=this.getAddress():r.from=Promise.all([Promise.resolve(r.from),this.getAddress()]).then(a=>(a[0].toLowerCase()!==a[1].toLowerCase()&&Sf.throwArgumentError("from address mismatch","transaction",e),a[0])),r}populateTransaction(e){return xf(this,void 0,void 0,function*(){let r=yield Sh(this.checkTransaction(e));r.to!=null&&(r.to=Promise.resolve(r.to).then(i=>xf(this,void 0,void 0,function*(){if(i==null)return null;let h=yield this.resolveName(i);return h==null&&Sf.throwArgumentError("provided ENS name resolves to null","tx.to",i),h})),r.to.catch(i=>{}));let a=r.maxFeePerGas!=null||r.maxPriorityFeePerGas!=null;if(r.gasPrice!=null&&(r.type===2||a)?Sf.throwArgumentError("eip-1559 transaction do not support gasPrice","transaction",e):(r.type===0||r.type===1)&&a&&Sf.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",e),(r.type===2||r.type==null)&&r.maxFeePerGas!=null&&r.maxPriorityFeePerGas!=null)r.type=2;else if(r.type===0||r.type===1)r.gasPrice==null&&(r.gasPrice=this.getGasPrice());else{let i=yield this.getFeeData();if(r.type==null)if(i.maxFeePerGas!=null&&i.maxPriorityFeePerGas!=null)if(r.type=2,r.gasPrice!=null){let h=r.gasPrice;delete r.gasPrice,r.maxFeePerGas=h,r.maxPriorityFeePerGas=h}else r.maxFeePerGas==null&&(r.maxFeePerGas=i.maxFeePerGas),r.maxPriorityFeePerGas==null&&(r.maxPriorityFeePerGas=i.maxPriorityFeePerGas);else i.gasPrice!=null?(a&&Sf.throwError("network does not support EIP-1559",er.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),r.gasPrice==null&&(r.gasPrice=i.gasPrice),r.type=0):Sf.throwError("failed to get consistent fee data",er.errors.UNSUPPORTED_OPERATION,{operation:"signer.getFeeData"});else r.type===2&&(r.maxFeePerGas==null&&(r.maxFeePerGas=i.maxFeePerGas),r.maxPriorityFeePerGas==null&&(r.maxPriorityFeePerGas=i.maxPriorityFeePerGas))}return r.nonce==null&&(r.nonce=this.getTransactionCount("pending")),r.gasLimit==null&&(r.gasLimit=this.estimateGas(r).catch(i=>{if(l6e.indexOf(i.code)>=0)throw i;return Sf.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",er.errors.UNPREDICTABLE_GAS_LIMIT,{error:i,tx:r})})),r.chainId==null?r.chainId=this.getChainId():r.chainId=Promise.all([Promise.resolve(r.chainId),this.getChainId()]).then(i=>(i[1]!==0&&i[0]!==i[1]&&Sf.throwArgumentError("chainId address mismatch","transaction",e),i[0])),yield Sh(r)})}_checkProvider(e){this.provider||Sf.throwError("missing provider",er.errors.UNSUPPORTED_OPERATION,{operation:e||"_checkProvider"})}static isSigner(e){return!!(e&&e._isSigner)}};ie();ae();ne();ie();ae();ne();var D3=class{constructor(e){ur(this,"alphabet",e),ur(this,"base",e.length),ur(this,"_alphabetMap",{}),ur(this,"_leader",e.charAt(0));for(let r=0;r<e.length;r++)this._alphabetMap[e.charAt(r)]=r}encode(e){let r=Ct(e);if(r.length===0)return"";let a=[0];for(let h=0;h<r.length;++h){let l=r[h];for(let p=0;p<a.length;++p)l+=a[p]<<8,a[p]=l%this.base,l=l/this.base|0;for(;l>0;)a.push(l%this.base),l=l/this.base|0}let i="";for(let h=0;r[h]===0&&h<r.length-1;++h)i+=this._leader;for(let h=a.length-1;h>=0;--h)i+=this.alphabet[a[h]];return i}decode(e){if(typeof e!="string")throw new TypeError("Expected String");let r=[];if(e.length===0)return new Uint8Array(r);r.push(0);for(let a=0;a<e.length;a++){let i=this._alphabetMap[e[a]];if(i===void 0)throw new Error("Non-base"+this.base+" character");let h=i;for(let l=0;l<r.length;++l)h+=r[l]*this.base,r[l]=h&255,h>>=8;for(;h>0;)r.push(h&255),h>>=8}for(let a=0;e[a]===this._leader&&a<e.length-1;++a)r.push(0);return Ct(new Uint8Array(r.reverse()))}},xYe=new D3("abcdefghijklmnopqrstuvwxyz234567"),jA=new D3("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");ie();ae();ne();ie();ae();ne();ie();ae();ne();ie();ae();ne();var Ym=gi(Yp());ie();ae();ne();var Xl;(function(t){t.sha256="sha256",t.sha512="sha512"})(Xl||(Xl={}));ie();ae();ne();var zG="sha2/5.7.0";var c6e=new er(zG);function zA(t){return"0x"+Ym.default.ripemd160().update(Ct(t)).digest("hex")}function P0(t){return"0x"+Ym.default.sha256().update(Ct(t)).digest("hex")}function O0(t,e,r){return Xl[t]||c6e.throwError("unsupported algorithm "+t,er.errors.UNSUPPORTED_OPERATION,{operation:"hmac",algorithm:t}),"0x"+Ym.default.hmac(Ym.default[t],Ct(e)).update(Ct(r)).digest("hex")}function N0(t,e,r,a,i){t=Ct(t),e=Ct(e);let h,l=1,p=new Uint8Array(a),b=new Uint8Array(e.length+4);b.set(e);let g,y;for(let M=1;M<=l;M++){b[e.length]=M>>24&255,b[e.length+1]=M>>16&255,b[e.length+2]=M>>8&255,b[e.length+3]=M&255;let x=Ct(O0(i,t,b));h||(h=x.length,y=new Uint8Array(h),l=Math.ceil(a/h),g=a-(l-1)*h),y.set(x);for(let k=1;k<r;k++){x=Ct(O0(i,t,x));for(let P=0;P<h;P++)y[P]^=x[P]}let E=(M-1)*h,A=M===l?g:h;p.set(Ct(y).slice(0,A),E)}return sr(p)}ie();ae();ne();ie();ae();ne();ie();ae();ne();var ZG="wordlists/5.7.0";var d6e=!1,p6e=new er(ZG),Xp=class t{constructor(e){p6e.checkAbstract(new.target,t),ur(this,"locale",e)}split(e){return e.toLowerCase().split(/ +/g)}join(e){return e.join(" ")}static check(e){let r=[];for(let a=0;a<2048;a++){let i=e.getWord(a);if(a!==e.getWordIndex(i))return"0x";r.push(i)}return zp(r.join(`
129
129
  `)+`
130
130
  `)}static register(e,r){if(r||(r=e.locale),d6e)try{let a=window;a._ethers&&a._ethers.wordlists&&(a._ethers.wordlists[r]||ur(a._ethers.wordlists,r,e))}catch{}}};ie();ae();ne();ie();ae();ne();var v6e="AbandonAbilityAbleAboutAboveAbsentAbsorbAbstractAbsurdAbuseAccessAccidentAccountAccuseAchieveAcidAcousticAcquireAcrossActActionActorActressActualAdaptAddAddictAddressAdjustAdmitAdultAdvanceAdviceAerobicAffairAffordAfraidAgainAgeAgentAgreeAheadAimAirAirportAisleAlarmAlbumAlcoholAlertAlienAllAlleyAllowAlmostAloneAlphaAlreadyAlsoAlterAlwaysAmateurAmazingAmongAmountAmusedAnalystAnchorAncientAngerAngleAngryAnimalAnkleAnnounceAnnualAnotherAnswerAntennaAntiqueAnxietyAnyApartApologyAppearAppleApproveAprilArchArcticAreaArenaArgueArmArmedArmorArmyAroundArrangeArrestArriveArrowArtArtefactArtistArtworkAskAspectAssaultAssetAssistAssumeAsthmaAthleteAtomAttackAttendAttitudeAttractAuctionAuditAugustAuntAuthorAutoAutumnAverageAvocadoAvoidAwakeAwareAwayAwesomeAwfulAwkwardAxisBabyBachelorBaconBadgeBagBalanceBalconyBallBambooBananaBannerBarBarelyBargainBarrelBaseBasicBasketBattleBeachBeanBeautyBecauseBecomeBeefBeforeBeginBehaveBehindBelieveBelowBeltBenchBenefitBestBetrayBetterBetweenBeyondBicycleBidBikeBindBiologyBirdBirthBitterBlackBladeBlameBlanketBlastBleakBlessBlindBloodBlossomBlouseBlueBlurBlushBoardBoatBodyBoilBombBoneBonusBookBoostBorderBoringBorrowBossBottomBounceBoxBoyBracketBrainBrandBrassBraveBreadBreezeBrickBridgeBriefBrightBringBriskBroccoliBrokenBronzeBroomBrotherBrownBrushBubbleBuddyBudgetBuffaloBuildBulbBulkBulletBundleBunkerBurdenBurgerBurstBusBusinessBusyButterBuyerBuzzCabbageCabinCableCactusCageCakeCallCalmCameraCampCanCanalCancelCandyCannonCanoeCanvasCanyonCapableCapitalCaptainCarCarbonCardCargoCarpetCarryCartCaseCashCasinoCastleCasualCatCatalogCatchCategoryCattleCaughtCauseCautionCaveCeilingCeleryCementCensusCenturyCerealCertainChairChalkChampionChangeChaosChapterChargeChaseChatCheapCheckCheeseChefCherryChestChickenChiefChildChimneyChoiceChooseChronicChuckleChunkChurnCigarCinnamonCircleCitizenCityCivilClaimClapClarifyClawClayCleanClerkCleverClickClientCliffClimbClinicClipClockClogCloseClothCloudClownClubClumpClusterClutchCoachCoastCoconutCodeCoffeeCoilCoinCollectColorColumnCombineComeComfortComicCommonCompanyConcertConductConfirmCongressConnectConsiderControlConvinceCookCoolCopperCopyCoralCoreCornCorrectCostCottonCouchCountryCoupleCourseCousinCoverCoyoteCrackCradleCraftCramCraneCrashCraterCrawlCrazyCreamCreditCreekCrewCricketCrimeCrispCriticCropCrossCrouchCrowdCrucialCruelCruiseCrumbleCrunchCrushCryCrystalCubeCultureCupCupboardCuriousCurrentCurtainCurveCushionCustomCuteCycleDadDamageDampDanceDangerDaringDashDaughterDawnDayDealDebateDebrisDecadeDecemberDecideDeclineDecorateDecreaseDeerDefenseDefineDefyDegreeDelayDeliverDemandDemiseDenialDentistDenyDepartDependDepositDepthDeputyDeriveDescribeDesertDesignDeskDespairDestroyDetailDetectDevelopDeviceDevoteDiagramDialDiamondDiaryDiceDieselDietDifferDigitalDignityDilemmaDinnerDinosaurDirectDirtDisagreeDiscoverDiseaseDishDismissDisorderDisplayDistanceDivertDivideDivorceDizzyDoctorDocumentDogDollDolphinDomainDonateDonkeyDonorDoorDoseDoubleDoveDraftDragonDramaDrasticDrawDreamDressDriftDrillDrinkDripDriveDropDrumDryDuckDumbDuneDuringDustDutchDutyDwarfDynamicEagerEagleEarlyEarnEarthEasilyEastEasyEchoEcologyEconomyEdgeEditEducateEffortEggEightEitherElbowElderElectricElegantElementElephantElevatorEliteElseEmbarkEmbodyEmbraceEmergeEmotionEmployEmpowerEmptyEnableEnactEndEndlessEndorseEnemyEnergyEnforceEngageEngineEnhanceEnjoyEnlistEnoughEnrichEnrollEnsureEnterEntireEntryEnvelopeEpisodeEqualEquipEraEraseErodeErosionErrorEruptEscapeEssayEssenceEstateEternalEthicsEvidenceEvilEvokeEvolveExactExampleExcessExchangeExciteExcludeExcuseExecuteExerciseExhaustExhibitExileExistExitExoticExpandExpectExpireExplainExposeExpressExtendExtraEyeEyebrowFabricFaceFacultyFadeFaintFaithFallFalseFameFamilyFamousFanFancyFantasyFarmFashionFatFatalFatherFatigueFaultFavoriteFeatureFebruaryFederalFeeFeedFeelFemaleFenceFestivalFetchFeverFewFiberFictionFieldFigureFileFilmFilterFinalFindFineFingerFinishFireFirmFirstFiscalFishFitFitnessFixFlagFlameFlashFlatFlavorFleeFlightFlipFloatFlockFloorFlowerFluidFlushFlyFoamFocusFogFoilFoldFollowFoodFootForceForestForgetForkFortuneForumForwardFossilFosterFoundFoxFragileFrameFrequentFreshFriendFringeFrogFrontFrostFrownFrozenFruitFuelFunFunnyFurnaceFuryFutureGadgetGainGalaxyGalleryGameGapGarageGarbageGardenGarlicGarmentGasGaspGateGatherGaugeGazeGeneralGeniusGenreGentleGenuineGestureGhostGiantGiftGiggleGingerGiraffeGirlGiveGladGlanceGlareGlassGlideGlimpseGlobeGloomGloryGloveGlowGlueGoatGoddessGoldGoodGooseGorillaGospelGossipGovernGownGrabGraceGrainGrantGrapeGrassGravityGreatGreenGridGriefGritGroceryGroupGrowGruntGuardGuessGuideGuiltGuitarGunGymHabitHairHalfHammerHamsterHandHappyHarborHardHarshHarvestHatHaveHawkHazardHeadHealthHeartHeavyHedgehogHeightHelloHelmetHelpHenHeroHiddenHighHillHintHipHireHistoryHobbyHockeyHoldHoleHolidayHollowHomeHoneyHoodHopeHornHorrorHorseHospitalHostHotelHourHoverHubHugeHumanHumbleHumorHundredHungryHuntHurdleHurryHurtHusbandHybridIceIconIdeaIdentifyIdleIgnoreIllIllegalIllnessImageImitateImmenseImmuneImpactImposeImproveImpulseInchIncludeIncomeIncreaseIndexIndicateIndoorIndustryInfantInflictInformInhaleInheritInitialInjectInjuryInmateInnerInnocentInputInquiryInsaneInsectInsideInspireInstallIntactInterestIntoInvestInviteInvolveIronIslandIsolateIssueItemIvoryJacketJaguarJarJazzJealousJeansJellyJewelJobJoinJokeJourneyJoyJudgeJuiceJumpJungleJuniorJunkJustKangarooKeenKeepKetchupKeyKickKidKidneyKindKingdomKissKitKitchenKiteKittenKiwiKneeKnifeKnockKnowLabLabelLaborLadderLadyLakeLampLanguageLaptopLargeLaterLatinLaughLaundryLavaLawLawnLawsuitLayerLazyLeaderLeafLearnLeaveLectureLeftLegLegalLegendLeisureLemonLendLengthLensLeopardLessonLetterLevelLiarLibertyLibraryLicenseLifeLiftLightLikeLimbLimitLinkLionLiquidListLittleLiveLizardLoadLoanLobsterLocalLockLogicLonelyLongLoopLotteryLoudLoungeLoveLoyalLuckyLuggageLumberLunarLunchLuxuryLyricsMachineMadMagicMagnetMaidMailMainMajorMakeMammalManManageMandateMangoMansionManualMapleMarbleMarchMarginMarineMarketMarriageMaskMassMasterMatchMaterialMathMatrixMatterMaximumMazeMeadowMeanMeasureMeatMechanicMedalMediaMelodyMeltMemberMemoryMentionMenuMercyMergeMeritMerryMeshMessageMetalMethodMiddleMidnightMilkMillionMimicMindMinimumMinorMinuteMiracleMirrorMiseryMissMistakeMixMixedMixtureMobileModelModifyMomMomentMonitorMonkeyMonsterMonthMoonMoralMoreMorningMosquitoMotherMotionMotorMountainMouseMoveMovieMuchMuffinMuleMultiplyMuscleMuseumMushroomMusicMustMutualMyselfMysteryMythNaiveNameNapkinNarrowNastyNationNatureNearNeckNeedNegativeNeglectNeitherNephewNerveNestNetNetworkNeutralNeverNewsNextNiceNightNobleNoiseNomineeNoodleNormalNorthNoseNotableNoteNothingNoticeNovelNowNuclearNumberNurseNutOakObeyObjectObligeObscureObserveObtainObviousOccurOceanOctoberOdorOffOfferOfficeOftenOilOkayOldOliveOlympicOmitOnceOneOnionOnlineOnlyOpenOperaOpinionOpposeOptionOrangeOrbitOrchardOrderOrdinaryOrganOrientOriginalOrphanOstrichOtherOutdoorOuterOutputOutsideOvalOvenOverOwnOwnerOxygenOysterOzonePactPaddlePagePairPalacePalmPandaPanelPanicPantherPaperParadeParentParkParrotPartyPassPatchPathPatientPatrolPatternPausePavePaymentPeacePeanutPearPeasantPelicanPenPenaltyPencilPeoplePepperPerfectPermitPersonPetPhonePhotoPhrasePhysicalPianoPicnicPicturePiecePigPigeonPillPilotPinkPioneerPipePistolPitchPizzaPlacePlanetPlasticPlatePlayPleasePledgePluckPlugPlungePoemPoetPointPolarPolePolicePondPonyPoolPopularPortionPositionPossiblePostPotatoPotteryPovertyPowderPowerPracticePraisePredictPreferPreparePresentPrettyPreventPricePridePrimaryPrintPriorityPrisonPrivatePrizeProblemProcessProduceProfitProgramProjectPromoteProofPropertyProsperProtectProudProvidePublicPuddingPullPulpPulsePumpkinPunchPupilPuppyPurchasePurityPurposePursePushPutPuzzlePyramidQualityQuantumQuarterQuestionQuickQuitQuizQuoteRabbitRaccoonRaceRackRadarRadioRailRainRaiseRallyRampRanchRandomRangeRapidRareRateRatherRavenRawRazorReadyRealReasonRebelRebuildRecallReceiveRecipeRecordRecycleReduceReflectReformRefuseRegionRegretRegularRejectRelaxReleaseReliefRelyRemainRememberRemindRemoveRenderRenewRentReopenRepairRepeatReplaceReportRequireRescueResembleResistResourceResponseResultRetireRetreatReturnReunionRevealReviewRewardRhythmRibRibbonRiceRichRideRidgeRifleRightRigidRingRiotRippleRiskRitualRivalRiverRoadRoastRobotRobustRocketRomanceRoofRookieRoomRoseRotateRoughRoundRouteRoyalRubberRudeRugRuleRunRunwayRuralSadSaddleSadnessSafeSailSaladSalmonSalonSaltSaluteSameSampleSandSatisfySatoshiSauceSausageSaveSayScaleScanScareScatterSceneSchemeSchoolScienceScissorsScorpionScoutScrapScreenScriptScrubSeaSearchSeasonSeatSecondSecretSectionSecuritySeedSeekSegmentSelectSellSeminarSeniorSenseSentenceSeriesServiceSessionSettleSetupSevenShadowShaftShallowShareShedShellSheriffShieldShiftShineShipShiverShockShoeShootShopShortShoulderShoveShrimpShrugShuffleShySiblingSickSideSiegeSightSignSilentSilkSillySilverSimilarSimpleSinceSingSirenSisterSituateSixSizeSkateSketchSkiSkillSkinSkirtSkullSlabSlamSleepSlenderSliceSlideSlightSlimSloganSlotSlowSlushSmallSmartSmileSmokeSmoothSnackSnakeSnapSniffSnowSoapSoccerSocialSockSodaSoftSolarSoldierSolidSolutionSolveSomeoneSongSoonSorrySortSoulSoundSoupSourceSouthSpaceSpareSpatialSpawnSpeakSpecialSpeedSpellSpendSphereSpiceSpiderSpikeSpinSpiritSplitSpoilSponsorSpoonSportSpotSpraySpreadSpringSpySquareSqueezeSquirrelStableStadiumStaffStageStairsStampStandStartStateStaySteakSteelStemStepStereoStickStillStingStockStomachStoneStoolStoryStoveStrategyStreetStrikeStrongStruggleStudentStuffStumbleStyleSubjectSubmitSubwaySuccessSuchSuddenSufferSugarSuggestSuitSummerSunSunnySunsetSuperSupplySupremeSureSurfaceSurgeSurpriseSurroundSurveySuspectSustainSwallowSwampSwapSwarmSwearSweetSwiftSwimSwingSwitchSwordSymbolSymptomSyrupSystemTableTackleTagTailTalentTalkTankTapeTargetTaskTasteTattooTaxiTeachTeamTellTenTenantTennisTentTermTestTextThankThatThemeThenTheoryThereTheyThingThisThoughtThreeThriveThrowThumbThunderTicketTideTigerTiltTimberTimeTinyTipTiredTissueTitleToastTobaccoTodayToddlerToeTogetherToiletTokenTomatoTomorrowToneTongueTonightToolToothTopTopicToppleTorchTornadoTortoiseTossTotalTouristTowardTowerTownToyTrackTradeTrafficTragicTrainTransferTrapTrashTravelTrayTreatTreeTrendTrialTribeTrickTriggerTrimTripTrophyTroubleTruckTrueTrulyTrumpetTrustTruthTryTubeTuitionTumbleTunaTunnelTurkeyTurnTurtleTwelveTwentyTwiceTwinTwistTwoTypeTypicalUglyUmbrellaUnableUnawareUncleUncoverUnderUndoUnfairUnfoldUnhappyUniformUniqueUnitUniverseUnknownUnlockUntilUnusualUnveilUpdateUpgradeUpholdUponUpperUpsetUrbanUrgeUsageUseUsedUsefulUselessUsualUtilityVacantVacuumVagueValidValleyValveVanVanishVaporVariousVastVaultVehicleVelvetVendorVentureVenueVerbVerifyVersionVeryVesselVeteranViableVibrantViciousVictoryVideoViewVillageVintageViolinVirtualVirusVisaVisitVisualVitalVividVocalVoiceVoidVolcanoVolumeVoteVoyageWageWagonWaitWalkWallWalnutWantWarfareWarmWarriorWashWaspWasteWaterWaveWayWealthWeaponWearWeaselWeatherWebWeddingWeekendWeirdWelcomeWestWetWhaleWhatWheatWheelWhenWhereWhipWhisperWideWidthWifeWildWillWinWindowWineWingWinkWinnerWinterWireWisdomWiseWishWitnessWolfWomanWonderWoodWoolWordWorkWorldWorryWorthWrapWreckWrestleWristWriteWrongYardYearYellowYouYoungYouthZebraZeroZoneZoo",Jm=null;function HG(t){if(Jm==null&&(Jm=v6e.replace(/([A-Z])/g," $1").toLowerCase().substring(1).split(" "),Xp.check(t)!=="0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60"))throw Jm=null,new Error("BIP39 Wordlist for en (English) FAILED")}var ZA=class extends Xp{constructor(){super("en")}getWord(e){return HG(this),Jm[e]}getWordIndex(e){return HG(this),Jm.indexOf(e)}},HA=new ZA;Xp.register(HA);var $3={en:HA};ie();ae();ne();var KG="hdnode/5.7.0";var U3=new er(KG),m6e=nn.from("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),g6e=Ca("Bitcoin seed"),Xm=2147483648;function VG(t){return(1<<t)-1<<8-t}function b6e(t){return(1<<t)-1}function q3(t){return Ea(sr(t),32)}function WG(t){return jA.encode(Ao([t,Mh(P0(P0(t)),0,4)]))}function KA(t){if(t==null)return $3.en;if(typeof t=="string"){let e=$3[t];return e==null&&U3.throwArgumentError("unknown locale","wordlist",t),e}return t}var Qp={},C0="m/44'/60'/0'/0/0",Ql=class t{constructor(e,r,a,i,h,l,p,b){if(e!==Qp)throw new Error("HDNode constructor cannot be called directly");if(r){let g=new Au(r);ur(this,"privateKey",g.privateKey),ur(this,"publicKey",g.compressedPublicKey)}else ur(this,"privateKey",null),ur(this,"publicKey",sr(a));ur(this,"parentFingerprint",i),ur(this,"fingerprint",Mh(zA(P0(this.publicKey)),0,4)),ur(this,"address",xs(this.publicKey)),ur(this,"chainCode",h),ur(this,"index",l),ur(this,"depth",p),b==null?(ur(this,"mnemonic",null),ur(this,"path",null)):typeof b=="string"?(ur(this,"mnemonic",null),ur(this,"path",b)):(ur(this,"mnemonic",b),ur(this,"path",b.path))}get extendedKey(){if(this.depth>=256)throw new Error("Depth too large!");return WG(Ao([this.privateKey!=null?"0x0488ADE4":"0x0488B21E",sr(this.depth),this.parentFingerprint,Ea(sr(this.index),4),this.chainCode,this.privateKey!=null?Ao(["0x00",this.privateKey]):this.publicKey]))}neuter(){return new t(Qp,null,this.publicKey,this.parentFingerprint,this.chainCode,this.index,this.depth,this.path)}_derive(e){if(e>4294967295)throw new Error("invalid index - "+String(e));let r=this.path;r&&(r+="/"+(e&~Xm));let a=new Uint8Array(37);if(e&Xm){if(!this.privateKey)throw new Error("cannot derive child of neutered node");a.set(Ct(this.privateKey),1),r&&(r+="'")}else a.set(Ct(this.publicKey));for(let M=24;M>=0;M-=8)a[33+(M>>3)]=e>>24-M&255;let i=Ct(O0(Xl.sha512,this.chainCode,a)),h=i.slice(0,32),l=i.slice(32),p=null,b=null;this.privateKey?p=q3(nn.from(h).add(this.privateKey).mod(m6e)):b=new Au(sr(h))._addPoint(this.publicKey);let g=r,y=this.mnemonic;return y&&(g=Object.freeze({phrase:y.phrase,path:r,locale:y.locale||"en"})),new t(Qp,p,b,this.fingerprint,q3(l),e,this.depth+1,g)}derivePath(e){let r=e.split("/");if(r.length===0||r[0]==="m"&&this.depth!==0)throw new Error("invalid path - "+e);r[0]==="m"&&r.shift();let a=this;for(let i=0;i<r.length;i++){let h=r[i];if(h.match(/^[0-9]+'$/)){let l=parseInt(h.substring(0,h.length-1));if(l>=Xm)throw new Error("invalid path index - "+h);a=a._derive(Xm+l)}else if(h.match(/^[0-9]+$/)){let l=parseInt(h);if(l>=Xm)throw new Error("invalid path index - "+h);a=a._derive(l)}else throw new Error("invalid path component - "+h)}return a}static _fromSeed(e,r){let a=Ct(e);if(a.length<16||a.length>64)throw new Error("invalid seed");let i=Ct(O0(Xl.sha512,g6e,a));return new t(Qp,q3(i.slice(0,32)),null,"0x00000000",q3(i.slice(32)),0,0,r)}static fromMnemonic(e,r,a){return a=KA(a),e=Qm(WA(e,a),a),t._fromSeed(y6e(e,r),{phrase:e,path:"m",locale:a.locale})}static fromSeed(e){return t._fromSeed(e,null)}static fromExtendedKey(e){let r=jA.decode(e);(r.length!==82||WG(r.slice(0,78))!==e)&&U3.throwArgumentError("invalid extended key","extendedKey","[REDACTED]");let a=r[4],i=sr(r.slice(5,9)),h=parseInt(sr(r.slice(9,13)).substring(2),16),l=sr(r.slice(13,45)),p=r.slice(45,78);switch(sr(r.slice(0,4))){case"0x0488b21e":case"0x043587cf":return new t(Qp,null,sr(p),i,l,h,a,null);case"0x0488ade4":case"0x04358394 ":if(p[0]!==0)break;return new t(Qp,sr(p.slice(1)),null,i,l,h,a,null)}return U3.throwArgumentError("invalid extended key","extendedKey","[REDACTED]")}};function y6e(t,e){e||(e="");let r=Ca("mnemonic"+e,gu.NFKD);return N0(Ca(t,gu.NFKD),r,2048,64,"sha512")}function WA(t,e){e=KA(e),U3.checkNormalize();let r=e.split(t);if(r.length%3!==0)throw new Error("invalid mnemonic");let a=Ct(new Uint8Array(Math.ceil(11*r.length/8))),i=0;for(let g=0;g<r.length;g++){let y=e.getWordIndex(r[g].normalize("NFKD"));if(y===-1)throw new Error("invalid mnemonic");for(let M=0;M<11;M++)y&1<<10-M&&(a[i>>3]|=1<<7-i%8),i++}let h=32*r.length/3,l=r.length/3,p=VG(l);if((Ct(P0(a.slice(0,h/8)))[0]&p)!==(a[a.length-1]&p))throw new Error("invalid checksum");return sr(a.slice(0,h/8))}function Qm(t,e){if(e=KA(e),t=Ct(t),t.length%4!==0||t.length<16||t.length>32)throw new Error("invalid entropy");let r=[0],a=11;for(let l=0;l<t.length;l++)a>8?(r[r.length-1]<<=8,r[r.length-1]|=t[l],a-=8):(r[r.length-1]<<=a,r[r.length-1]|=t[l]>>8-a,r.push(t[l]&b6e(8-a)),a+=3);let i=t.length/4,h=Ct(P0(t))[0]&VG(i);return r[r.length-1]<<=i,r[r.length-1]|=h>>8-i,e.join(r.map(l=>e.getWord(l)))}ie();ae();ne();ie();ae();ne();ie();ae();ne();var GG="random/5.7.0";var VA=new er(GG);function w6e(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("unable to locate global object")}var YG=w6e(),F3=YG.crypto||YG.msCrypto;(!F3||!F3.getRandomValues)&&(VA.warn("WARNING: Missing strong random number source"),F3={getRandomValues:function(t){return VA.throwError("no secure random source avaialble",er.errors.UNSUPPORTED_OPERATION,{operation:"crypto.getRandomValues"})}});function ec(t){(t<=0||t>1024||t%1||t!=t)&&VA.throwArgumentError("invalid length","length",t);let e=new Uint8Array(t);return F3.getRandomValues(e),Ct(e)}ie();ae();ne();ie();ae();ne();var JA=gi(YA());ie();ae();ne();var j3="json-wallets/5.7.0";ie();ae();ne();function Th(t){return typeof t=="string"&&t.substring(0,2)!=="0x"&&(t="0x"+t),Ct(t)}function e1(t,e){for(t=String(t);t.length<e;)t="0"+t;return t}function eg(t){return typeof t=="string"?Ca(t,gu.NFKC):Ct(t)}function on(t,e){let r=t,a=e.toLowerCase().split("/");for(let i=0;i<a.length;i++){let h=null;for(let l in r)if(l.toLowerCase()===a[i]){h=r[l];break}if(h===null)return null;r=h}return r}function XG(t){let e=Ct(t);e[6]=e[6]&15|64,e[8]=e[8]&63|128;let r=sr(e);return[r.substring(2,10),r.substring(10,14),r.substring(14,18),r.substring(18,22),r.substring(22,34)].join("-")}var _6e=new er(j3),XA=class extends T0{isCrowdsaleAccount(e){return!!(e&&e._isCrowdsaleAccount)}};function QA(t,e){let r=JSON.parse(t);e=eg(e);let a=Aa(on(r,"ethaddr")),i=Th(on(r,"encseed"));(!i||i.length%16!==0)&&_6e.throwArgumentError("invalid encseed","json",t);let h=Ct(N0(e,e,2e3,32,"sha256")).slice(0,16),l=i.slice(0,16),p=i.slice(16),b=new JA.default.ModeOfOperation.cbc(h,l),g=JA.default.padding.pkcs7.strip(Ct(b.decrypt(p))),y="";for(let E=0;E<g.length;E++)y+=String.fromCharCode(g[E]);let M=Ca(y),x=rn(M);return new XA({_isCrowdsaleAccount:!0,address:a,privateKey:x})}ie();ae();ne();function eR(t){let e=null;try{e=JSON.parse(t)}catch{return!1}return e.encseed&&e.ethaddr}function tR(t){let e=null;try{e=JSON.parse(t)}catch{return!1}return!(!e.version||parseInt(e.version)!==e.version||parseInt(e.version)!==3)}ie();ae();ne();var kh=gi(YA()),z3=gi(eY());var M6e=function(t,e,r,a){function i(h){return h instanceof r?h:new r(function(l){l(h)})}return new(r||(r=Promise))(function(h,l){function p(y){try{g(a.next(y))}catch(M){l(M)}}function b(y){try{g(a.throw(y))}catch(M){l(M)}}function g(y){y.done?h(y.value):i(y.value).then(p,b)}g((a=a.apply(t,e||[])).next())})},iR=new er(j3);function tY(t){return t!=null&&t.mnemonic&&t.mnemonic.phrase}var nR=class extends T0{isKeystoreAccount(e){return!!(e&&e._isKeystoreAccount)}};function x6e(t,e,r){if(on(t,"crypto/cipher")==="aes-128-ctr"){let i=Th(on(t,"crypto/cipherparams/iv")),h=new kh.default.Counter(i),l=new kh.default.ModeOfOperation.ctr(e,h);return Ct(l.decrypt(r))}return null}function rY(t,e){let r=Th(on(t,"crypto/ciphertext"));if(sr(rn(Ao([e.slice(16,32),r]))).substring(2)!==on(t,"crypto/mac").toLowerCase())throw new Error("invalid password");let i=x6e(t,e.slice(0,16),r);i||iR.throwError("unsupported cipher",er.errors.UNSUPPORTED_OPERATION,{operation:"decrypt"});let h=e.slice(32,64),l=xs(i);if(t.address){let b=t.address.toLowerCase();if(b.substring(0,2)!=="0x"&&(b="0x"+b),Aa(b)!==l)throw new Error("address mismatch")}let p={_isKeystoreAccount:!0,address:l,privateKey:sr(i)};if(on(t,"x-ethers/version")==="0.1"){let b=Th(on(t,"x-ethers/mnemonicCiphertext")),g=Th(on(t,"x-ethers/mnemonicCounter")),y=new kh.default.Counter(g),M=new kh.default.ModeOfOperation.ctr(h,y),x=on(t,"x-ethers/path")||C0,E=on(t,"x-ethers/locale")||"en",A=Ct(M.decrypt(b));try{let k=Qm(A,E),P=Ql.fromMnemonic(k,null,E).derivePath(x);if(P.privateKey!=p.privateKey)throw new Error("mnemonic mismatch");p.mnemonic=P.mnemonic}catch(k){if(k.code!==er.errors.INVALID_ARGUMENT||k.argument!=="wordlist")throw k}}return new nR(p)}function iY(t,e,r,a,i){return Ct(N0(t,e,r,a,i))}function S6e(t,e,r,a,i){return Promise.resolve(iY(t,e,r,a,i))}function nY(t,e,r,a,i){let h=eg(e),l=on(t,"crypto/kdf");if(l&&typeof l=="string"){let p=function(b,g){return iR.throwArgumentError("invalid key-derivation function parameters",b,g)};if(l.toLowerCase()==="scrypt"){let b=Th(on(t,"crypto/kdfparams/salt")),g=parseInt(on(t,"crypto/kdfparams/n")),y=parseInt(on(t,"crypto/kdfparams/r")),M=parseInt(on(t,"crypto/kdfparams/p"));(!g||!y||!M)&&p("kdf",l),g&g-1&&p("N",g);let x=parseInt(on(t,"crypto/kdfparams/dklen"));return x!==32&&p("dklen",x),a(h,b,g,y,M,64,i)}else if(l.toLowerCase()==="pbkdf2"){let b=Th(on(t,"crypto/kdfparams/salt")),g=null,y=on(t,"crypto/kdfparams/prf");y==="hmac-sha256"?g="sha256":y==="hmac-sha512"?g="sha512":p("prf",y);let M=parseInt(on(t,"crypto/kdfparams/c")),x=parseInt(on(t,"crypto/kdfparams/dklen"));return x!==32&&p("dklen",x),r(h,b,M,x,g)}}return iR.throwArgumentError("unsupported key-derivation function","kdf",l)}function aY(t,e){let r=JSON.parse(t),a=nY(r,e,iY,z3.default.syncScrypt);return rY(r,a)}function oY(t,e,r){return M6e(this,void 0,void 0,function*(){let a=JSON.parse(t),i=yield nY(a,e,S6e,z3.default.scrypt,r);return rY(a,i)})}function aR(t,e,r,a){try{if(Aa(t.address)!==xs(t.privateKey))throw new Error("address/privateKey mismatch");if(tY(t)){let P=t.mnemonic;if(Ql.fromMnemonic(P.phrase,null,P.locale).derivePath(P.path||C0).privateKey!=t.privateKey)throw new Error("mnemonic mismatch")}}catch(P){return Promise.reject(P)}typeof r=="function"&&!a&&(a=r,r={}),r||(r={});let i=Ct(t.privateKey),h=eg(e),l=null,p=null,b=null;if(tY(t)){let P=t.mnemonic;l=Ct(WA(P.phrase,P.locale||"en")),p=P.path||C0,b=P.locale||"en"}let g=r.client;g||(g="ethers.js");let y=null;r.salt?y=Ct(r.salt):y=ec(32);let M=null;if(r.iv){if(M=Ct(r.iv),M.length!==16)throw new Error("invalid iv")}else M=ec(16);let x=null;if(r.uuid){if(x=Ct(r.uuid),x.length!==16)throw new Error("invalid uuid")}else x=ec(16);let E=1<<17,A=8,k=1;return r.scrypt&&(r.scrypt.N&&(E=r.scrypt.N),r.scrypt.r&&(A=r.scrypt.r),r.scrypt.p&&(k=r.scrypt.p)),z3.default.scrypt(h,y,E,A,k,64,a).then(P=>{P=Ct(P);let N=P.slice(0,16),L=P.slice(16,32),C=P.slice(32,64),Y=new kh.default.Counter(M),G=new kh.default.ModeOfOperation.ctr(N,Y),ee=Ct(G.encrypt(i)),D=rn(Ao([L,ee])),U={address:t.address.substring(2).toLowerCase(),id:XG(x),version:3,crypto:{cipher:"aes-128-ctr",cipherparams:{iv:sr(M).substring(2)},ciphertext:sr(ee).substring(2),kdf:"scrypt",kdfparams:{salt:sr(y).substring(2),n:E,dklen:32,p:k,r:A},mac:D.substring(2)}};if(l){let V=ec(16),_=new kh.default.Counter(V),n=new kh.default.ModeOfOperation.ctr(C,_),s=Ct(n.encrypt(l)),f=new Date,u=f.getUTCFullYear()+"-"+e1(f.getUTCMonth()+1,2)+"-"+e1(f.getUTCDate(),2)+"T"+e1(f.getUTCHours(),2)+"-"+e1(f.getUTCMinutes(),2)+"-"+e1(f.getUTCSeconds(),2)+".0Z";U["x-ethers"]={client:g,gethFilename:"UTC--"+u+"--"+U.address,mnemonicCounter:sr(V).substring(2),mnemonicCiphertext:sr(s).substring(2),path:p,locale:b,version:"0.1"}}return JSON.stringify(U)})}function sY(t,e,r){if(eR(t)){r&&r(0);let a=QA(t,e);return r&&r(1),Promise.resolve(a)}return tR(t)?oY(t,e,r):Promise.reject(new Error("invalid JSON wallet"))}function fY(t,e){if(eR(t))return QA(t,e);if(tR(t))return aY(t,e);throw new Error("invalid JSON wallet")}ie();ae();ne();var uY="wallet/5.7.0";var hY=function(t,e,r,a){function i(h){return h instanceof r?h:new r(function(l){l(h)})}return new(r||(r=Promise))(function(h,l){function p(y){try{g(a.next(y))}catch(M){l(M)}}function b(y){try{g(a.throw(y))}catch(M){l(M)}}function g(y){y.done?h(y.value):i(y.value).then(p,b)}g((a=a.apply(t,e||[])).next())})},t1=new er(uY);function E6e(t){return t!=null&&$n(t.privateKey,32)&&t.address!=null}function A6e(t){let e=t.mnemonic;return e&&e.phrase}var r1=class t extends L3{constructor(e,r){if(super(),E6e(e)){let a=new Au(e.privateKey);if(ur(this,"_signingKey",()=>a),ur(this,"address",xs(this.publicKey)),this.address!==Aa(e.address)&&t1.throwArgumentError("privateKey/address mismatch","privateKey","[REDACTED]"),A6e(e)){let i=e.mnemonic;ur(this,"_mnemonic",()=>({phrase:i.phrase,path:i.path||C0,locale:i.locale||"en"}));let h=this.mnemonic,l=Ql.fromMnemonic(h.phrase,null,h.locale).derivePath(h.path);xs(l.privateKey)!==this.address&&t1.throwArgumentError("mnemonic/address mismatch","privateKey","[REDACTED]")}else ur(this,"_mnemonic",()=>null)}else{if(Au.isSigningKey(e))e.curve!=="secp256k1"&&t1.throwArgumentError("unsupported curve; must be secp256k1","privateKey","[REDACTED]"),ur(this,"_signingKey",()=>e);else{typeof e=="string"&&e.match(/^[0-9a-f]*$/i)&&e.length===64&&(e="0x"+e);let a=new Au(e);ur(this,"_signingKey",()=>a)}ur(this,"_mnemonic",()=>null),ur(this,"address",xs(this.publicKey))}r&&!C3.isProvider(r)&&t1.throwArgumentError("invalid provider","provider",r),ur(this,"provider",r||null)}get mnemonic(){return this._mnemonic()}get privateKey(){return this._signingKey().privateKey}get publicKey(){return this._signingKey().publicKey}getAddress(){return Promise.resolve(this.address)}connect(e){return new t(this,e)}signTransaction(e){return Sh(e).then(r=>{r.from!=null&&(Aa(r.from)!==this.address&&t1.throwArgumentError("transaction from address mismatch","transaction.from",e.from),delete r.from);let a=this._signingKey().signDigest(rn(FA(r)));return FA(r,a)})}signMessage(e){return hY(this,void 0,void 0,function*(){return pA(this._signingKey().signDigest(Vl(e)))})}_signTypedData(e,r,a){return hY(this,void 0,void 0,function*(){let i=yield k0.resolveNames(e,r,a,h=>(this.provider==null&&t1.throwError("cannot resolve ENS names without a provider",er.errors.UNSUPPORTED_OPERATION,{operation:"resolveName",value:h}),this.provider.resolveName(h)));return pA(this._signingKey().signDigest(k0.hash(i.domain,r,i.value)))})}encrypt(e,r,a){if(typeof r=="function"&&!a&&(a=r,r={}),a&&typeof a!="function")throw new Error("invalid callback");return r||(r={}),aR(this,e,r,a)}static createRandom(e){let r=ec(16);e||(e={}),e.extraEntropy&&(r=Ct(Mh(rn(Ao([r,e.extraEntropy])),0,16)));let a=Qm(r,e.locale);return t.fromMnemonic(a,e.path,e.locale)}static fromEncryptedJson(e,r,a){return sY(e,r,a).then(i=>new t(i))}static fromEncryptedJsonSync(e,r){return new t(fY(e,r))}static fromMnemonic(e,r,a){return r||(r=C0),new t(Ql.fromMnemonic(e,null,a).derivePath(r))}};function lY(t,e){return UA(Vl(t),e)}function Z3(t,e,r,a){return UA(k0.hash(t,e,r),a)}var oR=class{signer;publicKey;ownerLength=Wr[wr.ETHEREUM].pubLength;signatureLength=Wr[wr.ETHEREUM].sigLength;signatureType=wr.ETHEREUM;constructor(e){this.signer=e.getSigner()}async setPublicKey(){let e="sign this message to connect to Bundlr.Network",r=await this.signer.signMessage(e),a=await Vl(e),i=N3(Ct(a),r);this.publicKey=Me.from(Ct(i))}async sign(e){this.publicKey||await this.setPublicKey();let r=await this.signer.signMessage(e);return Me.from(r.slice(2),"hex")}static verify(e,r,a){let i=xs(e);return lY(r,a)===i}};ie();ae();ne();var i1=gi(gY(),1),Ih=class extends xo{get publicKey(){return i1.default.decode(this.pk)}get key(){return i1.default.decode(this._key)}constructor(e){let r=i1.default.decode(e);super(i1.default.encode(r.subarray(0,32)),i1.default.encode(r.subarray(32,64)))}};ie();ae();ne();ie();ae();ne();ie();ae();ne();var LX=gi(qo(),1),eT=gi(ER(),1);ie();ae();ne();lo();var kX=gi(TX(),1);function QR(t){return t=IX(t),(0,kX.default)("keccak256").update(t).digest()}function IX(t){if(!Me.isBuffer(t))if(Array.isArray(t))t=Me.from(t);else if(typeof t=="string")BX(t)?t=Me.from(M8(PX(t)),"hex"):t=Me.from(t);else if(typeof t=="number")t=NX(t);else if(typeof t=="bigint")t=z4e(t);else if(t==null)t=Me.allocUnsafe(0);else throw new Error("invalid type");return t}function BX(t,e){return!(typeof t!="string"||!t.match(/^0x[0-9A-Fa-f]*$/)||e&&t.length!==2+2*e)}function M8(t){if(typeof t!="string")throw new Error(`while padding to even, value must be string, is currently ${typeof t}, while padToEven.`);return t.length%2&&(t=`0${t}`),t}function PX(t){return typeof t!="string"?t:OX(t)?t.slice(2):t}function OX(t){if(typeof t!="string")throw new Error("value must be type 'string', is currently type "+typeof t+", while checking isHexPrefixed.");return t.startsWith("0x")}function NX(t){let e=CX(t);return Me.from(M8(e.slice(2)),"hex")}function CX(t){return`0x${t.toString(16)}`}function z4e(t){let e=t.toString(16);return Me.from(M8(e),"hex")}typeof window<"u"&&(window.keccak256=QR);var cg=QR,Z4e={intToBuffer:NX,intToHex:CX,isHexPrefixed:OX,stripHexPrefix:PX,padToEven:M8,isHexString:BX,toBuffer:IX};var Y0=class{_key;ownerLength=Wr[wr.ETHEREUM].pubLength;signatureLength=Wr[wr.ETHEREUM].sigLength;signatureType=wr.ETHEREUM;pk;constructor(e,r){this._key=e,this.pk=r.toString("hex")}get publicKey(){throw new Error("You must implement `publicKey`")}get key(){return Me.from(this._key,"hex")}static async verify(e,r,a){let i=e;typeof e=="string"&&(i=LX.default.toBuffer(e));let h=!1;try{h=eT.default.ecdsaVerify(a,cg(Me.from(r)),i)}catch{}return h}async sign(e){return eT.default.ecdsaSign(cg(Me.from(e)),Me.from(this.key)).signature}};var tT=gi(ER(),1),DX=gi(qo(),1);var Io=class extends Y0{get publicKey(){return Me.from(this.pk,"hex")}constructor(e){e.startsWith("0x")&&(e=e.slice(2));let r=Me.from(e,"hex"),a=tT.default.publicKeyCreate(r,!1);super(e,Me.from(a))}async sign(e){return new r1(this._key).signMessage(e).then(a=>Me.from(a.slice(2),"hex"))}static async verify(e,r,a){return tT.default.ecdsaVerify(a.length===65?a.slice(0,-1):a,Ct(Vl(r)),typeof e=="string"?DX.default.toBuffer(e):e)}};var dg=class extends Io{};ie();ae();ne();var pg=class extends Ih{constructor(e){super(e.replace("ed25519:",""))}};ie();ae();ne();var vg=class extends xo{get publicKey(){return Me.from(this.pk)}get key(){return Me.from(this._key)}constructor(e,r){super(e.subarray(0,32),r)}};ie();ae();ne();var J0=class extends A0{signatureType=4;constructor(e){super(e)}async sign(e){return super.sign(Me.from(Me.from(e).toString("hex")))}static async verify(e,r,a){return super.verify(e,Me.from(Me.from(r).toString("hex")),a)}};ie();ae();ne();var mg=class extends Ih{signatureType=4;constructor(e){super(e)}async sign(e){return super.sign(Me.from(Me.from(e).toString("hex")))}static async verify(e,r,a){return super.verify(e,Me.from(Me.from(r).toString("hex")),a)}};ie();ae();ne();var gg=class extends xo{constructor(e,r){super(e,r)}get publicKey(){return Me.from(this.pk.slice(2),"hex")}get key(){return Me.from(this._key.slice(2),"hex")}};ie();ae();ne();var X0=class{_publicKey;ownerLength=Wr[wr.INJECTEDAPTOS].pubLength;signatureLength=Wr[wr.INJECTEDAPTOS].sigLength;signatureType=wr.INJECTEDAPTOS;pem;provider;constructor(e,r){this.provider=e,this._publicKey=r}get publicKey(){return this._publicKey}async sign(e){if(!this.provider.signMessage)throw new Error("Selected Wallet does not support message signing");let a=(await this.provider.signMessage({message:Me.from(e).toString("hex"),nonce:"bundlr"})).signature;return typeof a=="string"?Me.from(a,"hex"):a.data.toUint8Array()}static async verify(e,r,a){let i=e;return ql(Me.from(a),Me.from(`APTOS
131
131
  message: ${Me.from(r).toString("hex")}
132
- nonce: bundlr`),Me.from(i))}};ie();ae();ne();var Q0=class{_publicKey;ownerLength=Wr[wr.MULTIAPTOS].pubLength;signatureLength=Wr[wr.MULTIAPTOS].sigLength;signatureType=wr.MULTIAPTOS;collectSignatures;provider;constructor(e,r){this._publicKey=e,this.collectSignatures=r}get publicKey(){return this._publicKey}async sign(e){let{signatures:r,bitmap:a}=await this.collectSignatures(e),i=128,h=new Uint8Array([0,0,0,0]),l=new Set;a.forEach(g=>{if(g>=32)throw new Error(`Invalid bit value ${g}.`);if(l.has(g))throw new Error("Duplicated bits detected.");l.add(g);let y=Math.floor(g/8),M=h[y];M|=i>>g%8,h[y]=M});let p=Me.alloc(this.signatureLength),b=0;for(let g=0;g<32;g++)a.includes(g)&&p.set(r[b++],g*64);return p.set(h,this.signatureLength-4),p}static async verify(e,r,a){let h=Wr[wr.MULTIAPTOS].sigLength-4,l=a.slice(0,h),p=a.slice(h),b=!1;for(let g=0;g<32;g++){let y=Math.floor(g/8),M=g-y*8;if((p[y]&128>>M)!==0){let E=l.slice(g*64,(g+1)*64),A=e.slice(g*32,(g+1)*32);await ql(Me.from(E),Me.from(r),Me.from(A))||(b=!0)}}return!b}};ie();ae();ne();var ed=class extends Io{ownerLength=Wr[wr.TYPEDETHEREUM].pubLength;signatureLength=Wr[wr.TYPEDETHEREUM].sigLength;signatureType=wr.TYPEDETHEREUM;address;signer;constructor(e){super(e),this.address="0x"+cg(super.publicKey.slice(1)).slice(-20).toString("hex"),this.signer=new r1(e)}get publicKey(){return Me.from(this.address)}async sign(e){let r=await this.signer._signTypedData(bg,yg,{address:this.address,"Transaction hash":e});return Me.from(r.slice(2),"hex")}static async verify(e,r,a){let i=e.toString(),h=Z3(bg,yg,{address:i,"Transaction hash":r},a);return i.toLowerCase()===h.toLowerCase()}},bg={name:"Bundlr",version:"1"},yg={Bundlr:[{name:"Transaction hash",type:"bytes"},{name:"address",type:"address"}]};ie();ae();ne();var rT=class{ownerLength=Wr[wr.TYPEDETHEREUM].pubLength;signatureLength=Wr[wr.TYPEDETHEREUM].sigLength;signatureType=wr.TYPEDETHEREUM;address;signer;publicKey;constructor(e){this.signer=e.getSigner()}async ready(){this.address=(await this.signer.getAddress()).toString().toLowerCase(),this.publicKey=Me.from(this.address)}async sign(e){let r=await this.signer._signTypedData(bg,yg,{address:this.address,"Transaction hash":e});return Me.from(r.slice(2),"hex")}static verify(e,r,a){let i=e.toString(),h=Z3(bg,yg,{address:i,"Transaction hash":r},a);return i.toLowerCase()===h.toLowerCase()}};ie();ae();ne();var $X=gi(qo(),1);var v1=class{signer;publicKey;ownerLength=Wr[wr.ARWEAVE].pubLength;signatureLength=Wr[wr.ARWEAVE].sigLength;signatureType=wr.ARWEAVE;constructor(e){this.signer=e}async setPublicKey(){let e=await this.signer.getActivePublicKey();this.publicKey=$X.default.toBuffer(e)}async sign(e){this.publicKey||await this.setPublicKey();let r={name:"RSA-PSS",saltLength:32},a=await this.signer.signature(e,r);return new Uint8Array(Object.values(a).map(h=>+h))}static async verify(e,r,a){return await Sn().verify(e,r,a)}};ie();ae();ne();var wg=class extends Io{signatureType=wr.KYVE};var _g={1:Hl,2:xo,3:Io,4:J0,5:X0,6:Q0,7:ed};ie();ae();ne();ie();ae();ne();async function H4e(t){return Ul([(0,Pi.stringToBuffer)("dataitem"),(0,Pi.stringToBuffer)("1"),(0,Pi.stringToBuffer)(t.signatureType.toString()),t.rawOwner,t.rawTarget,t.rawAnchor,t.rawTags,t.rawData])}var Mg=H4e;ie();ae();ne();ie();ae();ne();function xg(t,e){let r=new Uint8Array(t);if(e<0)throw new Error("Array is unsigned, cannot represent -ve numbers");if(e>2**(t*8)-1)throw new Error(`Number ${e} is too large for an array of ${t} bytes`);for(let a=0;a<r.length;a++){let i=e&255;r[a]=i,e=(e-i)/256}return r}function x8(t){return xg(8,t)}function iT(t){return xg(2,t)}function K4e(t){return xg(16,t)}function S8(t){return xg(32,t)}function yn(t){let e=0;for(let r=t.length-1;r>=0;r--)e=e*256+t[r];return e}ie();ae();ne();var Eg=gi(qo(),1);ie();ae();ne();var Is=gi(qo(),1);lo();ie();ae();ne();var Sg=class{buf;pos;constructor(e=Me.alloc(E8),r=0){this.buf=e,this.pos=r}writeTags(e){if(!Array.isArray(e))throw new Error("input must be array");let r=e.length,a;if(r)for(this.writeLong(r),a=0;a<r;a++){let i=e[a];if(typeof i?.name!="string"||typeof i?.value!="string")throw new Error(`Invalid tag format for ${i}, expected {name:string, value: string}`);this.writeString(i.name),this.writeString(i.value)}this.writeLong(0)}toBuffer(){let e=Me.alloc(this.pos);if(this.pos>this.buf.length)throw new Error(`Too many tag bytes (${this.pos} > ${this.buf.length})`);return this.buf.copy(e,0,0,this.pos),e}writeLong(e){let r=this.buf,a,i;if(e>=-1073741824&&e<1073741824){i=e>=0?e<<1:~e<<1|1;do r[this.pos]=i&127,i>>=7;while(i&&(r[this.pos++]|=128))}else{a=e>=0?e*2:-e*2-1;do r[this.pos]=a&127,a/=128;while(a>=1&&(r[this.pos++]|=128))}this.pos++,this.buf=r}writeString(e){let r=Me.byteLength(e),a=this.buf;this.writeLong(r);let i=this.pos;if(this.pos+=r,!(this.pos>a.length)){if(r>64)this.buf.write(e,this.pos-r,r,"utf8");else{let h,l,p,b;for(h=0,l=r;h<l;h++)p=e.charCodeAt(h),p<128?a[i++]=p:p<2048?(a[i++]=p>>6|192,a[i++]=p&63|128):(p&64512)===55296&&((b=e.charCodeAt(h+1))&64512)===56320?(p=65536+((p&1023)<<10)+(b&1023),h++,a[i++]=p>>18|240,a[i++]=p>>12&63|128,a[i++]=p>>6&63|128,a[i++]=p&63|128):(a[i++]=p>>12|224,a[i++]=p>>6&63|128,a[i++]=p&63|128)}this.buf=a}}readLong(){let e=0,r=0,a=this.buf,i,h,l,p;do i=a[this.pos++],h=i&128,e|=(i&127)<<r,r+=7;while(h&&r<28);if(h){l=e,p=268435456;do i=a[this.pos++],l+=(i&127)*p,p*=128;while(i&128);return(l%2?-(l+1):l)/2}return e>>1^-(e&1)}skipLong(){let e=this.buf;for(;e[this.pos++]&128;);}readTags(){let e=[],r;for(;r=this.readLong();)for(r<0&&(r=-r,this.skipLong());r--;){let a=this.readString(),i=this.readString();e.push({name:a,value:i})}return e}readString(){let e=this.readLong(),r=this.pos,a=this.buf;if(this.pos+=e,this.pos>a.length)throw new Error("TAP Position out of range");return this.buf.slice(r,r+e).toString()}};function nT(t){if(t?.length===0)return Me.allocUnsafe(0);let e=new Sg;return e.writeTags(t),e.toBuffer()}function m1(t){return new Sg(t).readTags()}du();var R8=80,E8=4096,A8=class t{binary;_id;constructor(e){this.binary=e}static isDataItem(e){return e.binary!==void 0}get signatureType(){let e=yn(this.binary.subarray(0,2));if(wr?.[e]!==void 0)return e;throw new Error("Unknown signature type: "+e)}async isValid(){return t.verify(this.binary)}get id(){return Is.default.encode(this.rawId)}set id(e){this._id=Is.default.toBuffer(e)}get rawId(){return pf("sha256").update(this.rawSignature).digest()}set rawId(e){this._id=e}get rawSignature(){return this.binary.subarray(2,2+this.signatureLength)}get signature(){return Is.default.encode(this.rawSignature)}set rawOwner(e){if(e.byteLength!=this.ownerLength)throw new Error(`Expected raw owner (pubkey) to be ${this.ownerLength} bytes, got ${e.byteLength} bytes.`);this.binary.set(e,2+this.signatureLength)}get rawOwner(){return this.binary.subarray(2+this.signatureLength,2+this.signatureLength+this.ownerLength)}get signatureLength(){return Wr[this.signatureType].sigLength}get owner(){return Is.default.encode(this.rawOwner)}get ownerLength(){return Wr[this.signatureType].pubLength}get rawTarget(){let e=this.getTargetStart();return this.binary[e]==1?this.binary.subarray(e+1,e+33):Me.alloc(0)}get target(){return Is.default.encode(this.rawTarget)}get rawAnchor(){let e=this.getAnchorStart();return this.binary[e]==1?this.binary.subarray(e+1,e+33):Me.alloc(0)}get anchor(){return Is.default.encode(this.rawAnchor)}get rawTags(){let e=this.getTagsStart(),r=yn(this.binary.subarray(e+8,e+16));return this.binary.subarray(e+16,e+16+r)}get tags(){let e=this.getTagsStart();if(yn(this.binary.subarray(e,e+8))==0)return[];let a=yn(this.binary.subarray(e+8,e+16));return m1(Me.from(this.binary.subarray(e+16,e+16+a)))}get tagsB64Url(){return this.tags.map(r=>({name:Is.default.encode(r.name),value:Is.default.encode(r.value)}))}getStartOfData(){let e=this.getTagsStart(),r=this.binary.subarray(e+8,e+16),a=yn(r);return e+16+a}get rawData(){let e=this.getTagsStart(),r=this.binary.subarray(e+8,e+16),a=yn(r),i=e+16+a;return this.binary.subarray(i,this.binary.length)}get data(){return Is.default.encode(this.rawData)}getRaw(){return this.binary}async sign(e){return this._id=await T8(this,e),this.rawId}async setSignature(e){this.binary.set(e,2),this._id=Me.from(await Sn().hash(e))}isSigned(){return(this._id?.length??0)>0}toJSON(){return{signature:this.signature,owner:this.owner,target:this.target,tags:this.tags.map(e=>({name:Is.default.encode(e.name),value:Is.default.encode(e.value)})),data:this.data}}static async verify(e){if(e.byteLength<R8)return!1;let r=new t(e),a=r.signatureType,i=r.getTagsStart(),h=yn(e.subarray(i,i+8)),l=e.subarray(i+8,i+16),p=yn(l);if(p>E8)return!1;if(h>0)try{if(m1(Me.from(e.subarray(i+16,i+16+p))).length!==h)return!1}catch{return!1}let b=_g[a],g=await Mg(r);return await b.verify(r.rawOwner,g,r.rawSignature)}async getSignatureData(){return Mg(this)}getTagsStart(){let e=this.getTargetStart(),r=this.binary[e]==1,a=e+(r?33:1),i=this.binary[a]==1;return a+=i?33:1,a}getTargetStart(){return 2+this.signatureLength+this.ownerLength}getAnchorStart(){let e=this.getTargetStart()+1,r=this.binary[this.getTargetStart()]==1;return e+=r?32:0,e}},g1=A8;du();var Bu=32,k8=class{length;items;binary;constructor(e){this.binary=e,this.length=this.getDataItemCount(),this.items=this.getItems()}getRaw(){return this.binary}get(e){if(typeof e=="number"){if(e>=this.length)throw new RangeError("Index out of range");return this.getByIndex(e)}else return this.getById(e)}getSizes(){let e=[];for(let r=Bu;r<Bu+64*this.length;r+=64)e.push(yn(this.binary.subarray(r,r+32)));return e}getIds(){let e=[];for(let r=Bu;r<Bu+64*this.length;r+=64){let a=this.binary.subarray(r+32,r+64);if(a.length===0)throw new Error("Invalid bundle, id specified in headers doesn't exist");e.push(Eg.default.encode(a))}return e}getIdBy(e){if(e>this.length-1)throw new RangeError("Index of bundle out of range");let r=64+64*e;return Eg.default.encode(this.binary.subarray(r,r+32))}async toTransaction(e,r,a){let i=await r.createTransaction({data:this.binary,...e},a);return i.addTag("Bundle-Format","binary"),i.addTag("Bundle-Version","2.0.0"),i}async verify(){for(let e of this.items){let r=await e.isValid(),a=(0,Eg.default)(pf("sha256").update(e.rawSignature).digest());if(!(r&&e.id===a))return!1}return!0}getOffset(e){let r=0;for(let a=Bu;a<Bu+64*this.length;a+=64){let i=yn(this.binary.subarray(a,a+32));r+=i;let h=this.binary.subarray(a+32,a+64);if(Me.compare(h,e)===0)return{startOffset:r,size:i}}return{startOffset:-1,size:-1}}getByIndex(e){let r=0,a=this.getBundleStart(),i=0,h,l;for(let y=Bu;y<Bu+64*this.length;y+=64){if(h=yn(this.binary.subarray(y,y+32)),i++===e){l=this.binary.subarray(y+32,y+64);break}r+=h}let p=a+r,b=this.binary.subarray(p,p+h),g=new g1(b);return g.rawId=l,g}getById(e){let r=Eg.default.toBuffer(e),a=this.getOffset(r);if(a.startOffset===-1)throw new Error("Transaction not found");let h=this.getBundleStart()+a.startOffset;return new g1(this.binary.subarray(h,h+a.size))}getDataItemCount(){return yn(this.binary.subarray(0,32))}getBundleStart(){return 32+64*this.length}getItems(){let e=new Array(this.length),r=0,a=this.getBundleStart(),i=0;for(let h=Bu;h<Bu+64*this.length;h+=64){let l=yn(this.binary.subarray(h,h+32)),p=this.binary.subarray(h+32,h+64);if(p.length===0)throw new Error("Invalid bundle, id specified in headers doesn't exist");let b=a+r,g=this.binary.subarray(b,b+l);r+=l;let y=new g1(g);y.rawId=p,e[i]=y,i++}return e}},aT=k8;function W4e(t){return new aT(t)}async function V4e(t,e){let r=new Uint8Array(64*t.length),a=await Promise.all(t.map(async(h,l)=>{let p=h.isSigned()?h.rawId:await T8(h,e),b=new Uint8Array(64);return b.set(S8(h.getRaw().byteLength),0),b.set(p,32),r.set(b,64*l),h.getRaw()})).then(h=>Me.concat(h)),i=Me.concat([Me.from(S8(t.length)),Me.from(r),a]);return new aT(i)}async function qX(t,e){let r=await Mg(t),a=await e.sign(r),i=await Sn().hash(a);return{signature:Me.from(a),id:Me.from(i)}}async function T8(t,e){let{signature:r,id:a}=await qX(t,e);return t.getRaw().set(r,2),a}ie();ae();ne();var UX=gi(qo(),1);function Ag(t,e,r){let a=e.publicKey,i=r?.target?UX.default.toBuffer(r.target):null,h=1+(i?.byteLength??0),l=r?.anchor?Me.from(r.anchor):null,p=1+(l?.byteLength??0),b=(r?.tags?.length??0)>0?nT(r?.tags):null,g=16+(b?b.byteLength:0),y=typeof t=="string"?Me.from(t):Me.from(t),M=y.byteLength,x=2+e.signatureLength+e.ownerLength+h+p+g+M,E=Me.alloc(x);if(E.set(iT(e.signatureType),0),E.set(new Uint8Array(e.signatureLength).fill(0),2),a.byteLength!==e.ownerLength)throw new Error(`Owner must be ${e.ownerLength} bytes, but was incorrectly ${a.byteLength}`);E.set(a,2+e.signatureLength);let A=2+e.signatureLength+e.ownerLength;if(E[A]=i?1:0,i){if(i.byteLength!==32)throw new Error(`Target must be 32 bytes but was incorrectly ${i.byteLength}`);E.set(i,A+1)}let k=A+h,P=k+1;if(E[k]=l?1:0,l){if(P+=l.byteLength,l.byteLength!==32)throw new Error("Anchor must be 32 bytes");E.set(l,k+1)}E.set(x8(r?.tags?.length??0),P);let N=x8(b?.byteLength??0);E.set(N,P+8),b&&E.set(b,P+16);let L=P+g;return E.set(y,L),new g1(E)}ie();ae();ne();ie();ae();ne();var oT=class{signatureType;rawSignature;signature;signatureLength;rawOwner;owner;ownerLength;rawTarget;target;rawAnchor;anchor;rawTags;tags;rawData;data;static async verify(...e){throw new Error("You must implement `verify`")}};ie();ae();ne();ie();ae();ne();var hT={};Ha(hT,{default:()=>J4e,processStream:()=>HX,streamExportForTesting:()=>X4e,streamSigner:()=>Y4e});ie();ae();ne();I8();var td=gi(qo(),1);du();async function HX(t){let e=KX(t),r=(await e.next()).value;r=await La(e,r,32);let a=yn(r.subarray(0,32));r=r.subarray(32);let i=64*a;r=await La(e,r,i);let h=new Array(a);for(let b=0;b<i;b+=64)h[b/64]=[yn(r.subarray(b,b+32)),(0,td.default)(Me.from(r.subarray(b+32,b+64)))];r=r.subarray(i);let l=32+i,p=[];for(let[b,g]of h){r=await La(e,r,R8),r=await La(e,r,2);let y=yn(r.subarray(0,2));r=r.subarray(2);let{sigLength:M,pubLength:x,sigName:E}=Wr[y];r=await La(e,r,M);let A=r.subarray(0,M);r=r.subarray(M),r=await La(e,r,x);let k=r.subarray(0,x);r=r.subarray(x),r=await La(e,r,1);let P=r[0]===1;P&&(r=await La(e,r,33));let N=P?r.subarray(1,33):Me.allocUnsafe(0);r=r.subarray(P?33:1),r=await La(e,r,1);let L=r[0]===1;L&&(r=await La(e,r,33));let C=L?r.subarray(1,33):Me.allocUnsafe(0);r=r.subarray(L?33:1),r=await La(e,r,8);let Y=yn(r.subarray(0,8));r=r.subarray(8),r=await La(e,r,8);let G=yn(r.subarray(0,8));r=r.subarray(8),r=await La(e,r,G);let ee=r.subarray(0,G),D=Y!==0&&G!==0?m1(Me.from(ee)):[];if(D.length!==Y)throw new Error("Tags lengths don't match");r=r.subarray(G);let U=new zX;U._transform=function(f,u,c){this.push(f),c()};let V=Ul([(0,Pi.stringToBuffer)("dataitem"),(0,Pi.stringToBuffer)("1"),(0,Pi.stringToBuffer)(y.toString()),k,N,C,ee,U]),_=2+M+x+(P?33:1)+(L?33:1)+16+G,n=b-_;if(r.byteLength>n)U.write(r.subarray(0,n)),r=r.subarray(n);else{let f=r.byteLength;for(U.write(r);n>f;){if(r=(await e.next()).value,!r)throw new Error(`Not enough data bytes expected: ${n} received: ${f}`);f+=r.byteLength,f>n?U.write(r.subarray(0,r.byteLength-(f-n))):U.write(r)}r=r.subarray(r.byteLength-(f-n))}if(U.end(),g!==(0,td.default)(pf("sha256").update(A).digest()))throw new Error("ID doesn't match signature");if(!await _g[y].verify(k,await V,A))throw new Error("Invalid signature");p.push({id:g,sigName:E,signature:(0,td.default)(Me.from(A)),target:(0,td.default)(Me.from(N)),anchor:(0,td.default)(Me.from(C)),owner:(0,td.default)(Me.from(k)),tags:D,dataOffset:l+_,dataSize:n}),l+=_+n}return p}async function Y4e(t,e,r,a){let i=Ag("",r,a),h=new ZX,l=[(0,Pi.stringToBuffer)("dataitem"),(0,Pi.stringToBuffer)("1"),(0,Pi.stringToBuffer)(i.signatureType.toString()),i.rawOwner,i.rawTarget,i.rawAnchor,i.rawTags,t],p=await Ul(l),b=Me.from(await r.sign(p));return i.setSignature(b),h.write(i.getRaw()),e.pipe(h)}async function La(t,e,r){if(e.byteLength>=r)return e;let{done:a,value:i}=await t.next();if(a&&!i)throw new Error("Invalid buffer");return La(t,Me.concat([Me.from(e),Me.from(i)]),r)}async function*KX(t){for await(let e of t)yield e}var J4e=HX,X4e={readBytes:La,getReader:KX};var Q4e={...sT,stream:hT};globalThis.arbundles??=Q4e;ie();ae();ne();ie();ae();ne();ie();ae();ne();ie();ae();ne();var fi;(function(t){t.assertEqual=i=>i;function e(i){}t.assertIs=e;function r(i){throw new Error}t.assertNever=r,t.arrayToEnum=i=>{let h={};for(let l of i)h[l]=l;return h},t.getValidEnumValues=i=>{let h=t.objectKeys(i).filter(p=>typeof i[i[p]]!="number"),l={};for(let p of h)l[p]=i[p];return t.objectValues(l)},t.objectValues=i=>t.objectKeys(i).map(function(h){return i[h]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let h=[];for(let l in i)Object.prototype.hasOwnProperty.call(i,l)&&h.push(l);return h},t.find=(i,h)=>{for(let l of i)if(h(l))return l},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function a(i,h=" | "){return i.map(l=>typeof l=="string"?`'${l}'`:l).join(h)}t.joinValues=a,t.jsonStringifyReplacer=(i,h)=>typeof h=="bigint"?h.toString():h})(fi||(fi={}));var cT;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(cT||(cT={}));var Yt=fi.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),lc=t=>{switch(typeof t){case"undefined":return Yt.undefined;case"string":return Yt.string;case"number":return isNaN(t)?Yt.nan:Yt.number;case"boolean":return Yt.boolean;case"function":return Yt.function;case"bigint":return Yt.bigint;case"symbol":return Yt.symbol;case"object":return Array.isArray(t)?Yt.array:t===null?Yt.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?Yt.promise:typeof Map<"u"&&t instanceof Map?Yt.map:typeof Set<"u"&&t instanceof Set?Yt.set:typeof Date<"u"&&t instanceof Date?Yt.date:Yt.object;default:return Yt.unknown}},Pt=fi.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),ewe=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),Bo=class t extends Error{constructor(e){super(),this.issues=[],this.addIssue=a=>{this.issues=[...this.issues,a]},this.addIssues=(a=[])=>{this.issues=[...this.issues,...a]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){let r=e||function(h){return h.message},a={_errors:[]},i=h=>{for(let l of h.issues)if(l.code==="invalid_union")l.unionErrors.map(i);else if(l.code==="invalid_return_type")i(l.returnTypeError);else if(l.code==="invalid_arguments")i(l.argumentsError);else if(l.path.length===0)a._errors.push(r(l));else{let p=a,b=0;for(;b<l.path.length;){let g=l.path[b];b===l.path.length-1?(p[g]=p[g]||{_errors:[]},p[g]._errors.push(r(l))):p[g]=p[g]||{_errors:[]},p=p[g],b++}}};return i(this),a}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,fi.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r={},a=[];for(let i of this.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(e(i))):a.push(e(i));return{formErrors:a,fieldErrors:r}}get formErrors(){return this.flatten()}};Bo.create=t=>new Bo(t);var w1=(t,e)=>{let r;switch(t.code){case Pt.invalid_type:t.received===Yt.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case Pt.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,fi.jsonStringifyReplacer)}`;break;case Pt.unrecognized_keys:r=`Unrecognized key(s) in object: ${fi.joinValues(t.keys,", ")}`;break;case Pt.invalid_union:r="Invalid input";break;case Pt.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${fi.joinValues(t.options)}`;break;case Pt.invalid_enum_value:r=`Invalid enum value. Expected ${fi.joinValues(t.options)}, received '${t.received}'`;break;case Pt.invalid_arguments:r="Invalid function arguments";break;case Pt.invalid_return_type:r="Invalid function return type";break;case Pt.invalid_date:r="Invalid date";break;case Pt.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:fi.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case Pt.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case Pt.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case Pt.custom:r="Invalid input";break;case Pt.invalid_intersection_types:r="Intersection results could not be merged";break;case Pt.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case Pt.not_finite:r="Number must be finite";break;default:r=e.defaultError,fi.assertNever(t)}return{message:r}},GX=w1;function twe(t){GX=t}function B8(){return GX}var P8=t=>{let{data:e,path:r,errorMaps:a,issueData:i}=t,h=[...r,...i.path||[]],l={...i,path:h};if(i.message!==void 0)return{...i,path:h,message:i.message};let p="",b=a.filter(g=>!!g).slice().reverse();for(let g of b)p=g(l,{data:e,defaultError:p}).message;return{...i,path:h,message:p}},rwe=[];function Wt(t,e){let r=B8(),a=P8({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===w1?void 0:w1].filter(i=>!!i)});t.common.issues.push(a)}var Ia=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let a=[];for(let i of r){if(i.status==="aborted")return pr;i.status==="dirty"&&e.dirty(),a.push(i.value)}return{status:e.value,value:a}}static async mergeObjectAsync(e,r){let a=[];for(let i of r){let h=await i.key,l=await i.value;a.push({key:h,value:l})}return t.mergeObjectSync(e,a)}static mergeObjectSync(e,r){let a={};for(let i of r){let{key:h,value:l}=i;if(h.status==="aborted"||l.status==="aborted")return pr;h.status==="dirty"&&e.dirty(),l.status==="dirty"&&e.dirty(),h.value!=="__proto__"&&(typeof l.value<"u"||i.alwaysSet)&&(a[h.value]=l.value)}return{status:e.value,value:a}}},pr=Object.freeze({status:"aborted"}),y1=t=>({status:"dirty",value:t}),Da=t=>({status:"valid",value:t}),dT=t=>t.status==="aborted",pT=t=>t.status==="dirty",Ig=t=>t.status==="valid",Bg=t=>typeof Promise<"u"&&t instanceof Promise;function O8(t,e,r,a){if(r==="a"&&!a)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!a:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?a:r==="a"?a.call(t):a?a.value:e.get(t)}function YX(t,e,r,a,i){if(a==="m")throw new TypeError("Private method is not writable");if(a==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return a==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r}var rr;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(rr||(rr={}));var Tg,kg,Ps=class{constructor(e,r,a,i){this._cachedPath=[],this.parent=e,this.data=r,this._path=a,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},WX=(t,e)=>{if(Ig(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new Bo(t.common.issues);return this._error=r,this._error}}};function Br(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:a,description:i}=t;if(e&&(r||a))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(l,p)=>{var b,g;let{message:y}=t;return l.code==="invalid_enum_value"?{message:y??p.defaultError}:typeof p.data>"u"?{message:(b=y??a)!==null&&b!==void 0?b:p.defaultError}:l.code!=="invalid_type"?{message:p.defaultError}:{message:(g=y??r)!==null&&g!==void 0?g:p.defaultError}},description:i}}var Pr=class{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return lc(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:lc(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Ia,ctx:{common:e.parent.common,data:e.data,parsedType:lc(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(Bg(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let a=this.safeParse(e,r);if(a.success)return a.data;throw a.error}safeParse(e,r){var a;let i={common:{issues:[],async:(a=r?.async)!==null&&a!==void 0?a:!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:lc(e)},h=this._parseSync({data:e,path:i.path,parent:i});return WX(i,h)}async parseAsync(e,r){let a=await this.safeParseAsync(e,r);if(a.success)return a.data;throw a.error}async safeParseAsync(e,r){let a={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:lc(e)},i=this._parse({data:e,path:a.path,parent:a}),h=await(Bg(i)?i:Promise.resolve(i));return WX(a,h)}refine(e,r){let a=i=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(i):r;return this._refinement((i,h)=>{let l=e(i),p=()=>h.addIssue({code:Pt.custom,...a(i)});return typeof Promise<"u"&&l instanceof Promise?l.then(b=>b?!0:(p(),!1)):l?!0:(p(),!1)})}refinement(e,r){return this._refinement((a,i)=>e(a)?!0:(i.addIssue(typeof r=="function"?r(a,i):r),!1))}_refinement(e){return new Po({schema:this,typeName:lr.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Bs.create(this,this._def)}nullable(){return Ou.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Lh.create(this,this._def)}promise(){return pc.create(this,this._def)}or(e){return fd.create([this,e],this._def)}and(e){return ud.create(this,e,this._def)}transform(e){return new Po({...Br(this._def),schema:this,typeName:lr.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new pd({...Br(this._def),innerType:this,defaultValue:r,typeName:lr.ZodDefault})}brand(){return new Pg({typeName:lr.ZodBranded,type:this,...Br(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new vd({...Br(this._def),innerType:this,catchValue:r,typeName:lr.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return Og.create(this,e)}readonly(){return md.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},iwe=/^c[^\s-]{8,}$/i,nwe=/^[0-9a-z]+$/,awe=/^[0-9A-HJKMNP-TV-Z]{26}$/,owe=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,swe=/^[a-z0-9_-]{21}$/i,fwe=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,uwe=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,hwe="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",lT,lwe=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,cwe=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,dwe=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,JX="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",pwe=new RegExp(`^${JX}$`);function XX(t){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`),e}function vwe(t){return new RegExp(`^${XX(t)}$`)}function QX(t){let e=`${JX}T${XX(t)}`,r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function mwe(t,e){return!!((e==="v4"||!e)&&lwe.test(t)||(e==="v6"||!e)&&cwe.test(t))}var cc=class t extends Pr{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==Yt.string){let h=this._getOrReturnCtx(e);return Wt(h,{code:Pt.invalid_type,expected:Yt.string,received:h.parsedType}),pr}let a=new Ia,i;for(let h of this._def.checks)if(h.kind==="min")e.data.length<h.value&&(i=this._getOrReturnCtx(e,i),Wt(i,{code:Pt.too_small,minimum:h.value,type:"string",inclusive:!0,exact:!1,message:h.message}),a.dirty());else if(h.kind==="max")e.data.length>h.value&&(i=this._getOrReturnCtx(e,i),Wt(i,{code:Pt.too_big,maximum:h.value,type:"string",inclusive:!0,exact:!1,message:h.message}),a.dirty());else if(h.kind==="length"){let l=e.data.length>h.value,p=e.data.length<h.value;(l||p)&&(i=this._getOrReturnCtx(e,i),l?Wt(i,{code:Pt.too_big,maximum:h.value,type:"string",inclusive:!0,exact:!0,message:h.message}):p&&Wt(i,{code:Pt.too_small,minimum:h.value,type:"string",inclusive:!0,exact:!0,message:h.message}),a.dirty())}else if(h.kind==="email")uwe.test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{validation:"email",code:Pt.invalid_string,message:h.message}),a.dirty());else if(h.kind==="emoji")lT||(lT=new RegExp(hwe,"u")),lT.test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{validation:"emoji",code:Pt.invalid_string,message:h.message}),a.dirty());else if(h.kind==="uuid")owe.test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{validation:"uuid",code:Pt.invalid_string,message:h.message}),a.dirty());else if(h.kind==="nanoid")swe.test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{validation:"nanoid",code:Pt.invalid_string,message:h.message}),a.dirty());else if(h.kind==="cuid")iwe.test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{validation:"cuid",code:Pt.invalid_string,message:h.message}),a.dirty());else if(h.kind==="cuid2")nwe.test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{validation:"cuid2",code:Pt.invalid_string,message:h.message}),a.dirty());else if(h.kind==="ulid")awe.test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{validation:"ulid",code:Pt.invalid_string,message:h.message}),a.dirty());else if(h.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),Wt(i,{validation:"url",code:Pt.invalid_string,message:h.message}),a.dirty()}else h.kind==="regex"?(h.regex.lastIndex=0,h.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{validation:"regex",code:Pt.invalid_string,message:h.message}),a.dirty())):h.kind==="trim"?e.data=e.data.trim():h.kind==="includes"?e.data.includes(h.value,h.position)||(i=this._getOrReturnCtx(e,i),Wt(i,{code:Pt.invalid_string,validation:{includes:h.value,position:h.position},message:h.message}),a.dirty()):h.kind==="toLowerCase"?e.data=e.data.toLowerCase():h.kind==="toUpperCase"?e.data=e.data.toUpperCase():h.kind==="startsWith"?e.data.startsWith(h.value)||(i=this._getOrReturnCtx(e,i),Wt(i,{code:Pt.invalid_string,validation:{startsWith:h.value},message:h.message}),a.dirty()):h.kind==="endsWith"?e.data.endsWith(h.value)||(i=this._getOrReturnCtx(e,i),Wt(i,{code:Pt.invalid_string,validation:{endsWith:h.value},message:h.message}),a.dirty()):h.kind==="datetime"?QX(h).test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{code:Pt.invalid_string,validation:"datetime",message:h.message}),a.dirty()):h.kind==="date"?pwe.test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{code:Pt.invalid_string,validation:"date",message:h.message}),a.dirty()):h.kind==="time"?vwe(h).test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{code:Pt.invalid_string,validation:"time",message:h.message}),a.dirty()):h.kind==="duration"?fwe.test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{validation:"duration",code:Pt.invalid_string,message:h.message}),a.dirty()):h.kind==="ip"?mwe(e.data,h.version)||(i=this._getOrReturnCtx(e,i),Wt(i,{validation:"ip",code:Pt.invalid_string,message:h.message}),a.dirty()):h.kind==="base64"?dwe.test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{validation:"base64",code:Pt.invalid_string,message:h.message}),a.dirty()):fi.assertNever(h);return{status:a.value,value:e.data}}_regex(e,r,a){return this.refinement(i=>e.test(i),{validation:r,code:Pt.invalid_string,...rr.errToObj(a)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...rr.errToObj(e)})}url(e){return this._addCheck({kind:"url",...rr.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...rr.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...rr.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...rr.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...rr.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...rr.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...rr.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...rr.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...rr.errToObj(e)})}datetime(e){var r,a;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:(r=e?.offset)!==null&&r!==void 0?r:!1,local:(a=e?.local)!==null&&a!==void 0?a:!1,...rr.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...rr.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...rr.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...rr.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...rr.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...rr.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...rr.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...rr.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...rr.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...rr.errToObj(r)})}nonempty(e){return this.min(1,rr.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};cc.create=t=>{var e;return new cc({checks:[],typeName:lr.ZodString,coerce:(e=t?.coerce)!==null&&e!==void 0?e:!1,...Br(t)})};function gwe(t,e){let r=(t.toString().split(".")[1]||"").length,a=(e.toString().split(".")[1]||"").length,i=r>a?r:a,h=parseInt(t.toFixed(i).replace(".","")),l=parseInt(e.toFixed(i).replace(".",""));return h%l/Math.pow(10,i)}var rd=class t extends Pr{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==Yt.number){let h=this._getOrReturnCtx(e);return Wt(h,{code:Pt.invalid_type,expected:Yt.number,received:h.parsedType}),pr}let a,i=new Ia;for(let h of this._def.checks)h.kind==="int"?fi.isInteger(e.data)||(a=this._getOrReturnCtx(e,a),Wt(a,{code:Pt.invalid_type,expected:"integer",received:"float",message:h.message}),i.dirty()):h.kind==="min"?(h.inclusive?e.data<h.value:e.data<=h.value)&&(a=this._getOrReturnCtx(e,a),Wt(a,{code:Pt.too_small,minimum:h.value,type:"number",inclusive:h.inclusive,exact:!1,message:h.message}),i.dirty()):h.kind==="max"?(h.inclusive?e.data>h.value:e.data>=h.value)&&(a=this._getOrReturnCtx(e,a),Wt(a,{code:Pt.too_big,maximum:h.value,type:"number",inclusive:h.inclusive,exact:!1,message:h.message}),i.dirty()):h.kind==="multipleOf"?gwe(e.data,h.value)!==0&&(a=this._getOrReturnCtx(e,a),Wt(a,{code:Pt.not_multiple_of,multipleOf:h.value,message:h.message}),i.dirty()):h.kind==="finite"?Number.isFinite(e.data)||(a=this._getOrReturnCtx(e,a),Wt(a,{code:Pt.not_finite,message:h.message}),i.dirty()):fi.assertNever(h);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,rr.toString(r))}gt(e,r){return this.setLimit("min",e,!1,rr.toString(r))}lte(e,r){return this.setLimit("max",e,!0,rr.toString(r))}lt(e,r){return this.setLimit("max",e,!1,rr.toString(r))}setLimit(e,r,a,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:a,message:rr.toString(i)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:rr.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:rr.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:rr.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:rr.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:rr.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:rr.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:rr.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:rr.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:rr.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&fi.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let a of this._def.checks){if(a.kind==="finite"||a.kind==="int"||a.kind==="multipleOf")return!0;a.kind==="min"?(r===null||a.value>r)&&(r=a.value):a.kind==="max"&&(e===null||a.value<e)&&(e=a.value)}return Number.isFinite(r)&&Number.isFinite(e)}};rd.create=t=>new rd({checks:[],typeName:lr.ZodNumber,coerce:t?.coerce||!1,...Br(t)});var id=class t extends Pr{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==Yt.bigint){let h=this._getOrReturnCtx(e);return Wt(h,{code:Pt.invalid_type,expected:Yt.bigint,received:h.parsedType}),pr}let a,i=new Ia;for(let h of this._def.checks)h.kind==="min"?(h.inclusive?e.data<h.value:e.data<=h.value)&&(a=this._getOrReturnCtx(e,a),Wt(a,{code:Pt.too_small,type:"bigint",minimum:h.value,inclusive:h.inclusive,message:h.message}),i.dirty()):h.kind==="max"?(h.inclusive?e.data>h.value:e.data>=h.value)&&(a=this._getOrReturnCtx(e,a),Wt(a,{code:Pt.too_big,type:"bigint",maximum:h.value,inclusive:h.inclusive,message:h.message}),i.dirty()):h.kind==="multipleOf"?e.data%h.value!==BigInt(0)&&(a=this._getOrReturnCtx(e,a),Wt(a,{code:Pt.not_multiple_of,multipleOf:h.value,message:h.message}),i.dirty()):fi.assertNever(h);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,rr.toString(r))}gt(e,r){return this.setLimit("min",e,!1,rr.toString(r))}lte(e,r){return this.setLimit("max",e,!0,rr.toString(r))}lt(e,r){return this.setLimit("max",e,!1,rr.toString(r))}setLimit(e,r,a,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:a,message:rr.toString(i)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:rr.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:rr.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:rr.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:rr.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:rr.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};id.create=t=>{var e;return new id({checks:[],typeName:lr.ZodBigInt,coerce:(e=t?.coerce)!==null&&e!==void 0?e:!1,...Br(t)})};var nd=class extends Pr{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==Yt.boolean){let a=this._getOrReturnCtx(e);return Wt(a,{code:Pt.invalid_type,expected:Yt.boolean,received:a.parsedType}),pr}return Da(e.data)}};nd.create=t=>new nd({typeName:lr.ZodBoolean,coerce:t?.coerce||!1,...Br(t)});var ad=class t extends Pr{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==Yt.date){let h=this._getOrReturnCtx(e);return Wt(h,{code:Pt.invalid_type,expected:Yt.date,received:h.parsedType}),pr}if(isNaN(e.data.getTime())){let h=this._getOrReturnCtx(e);return Wt(h,{code:Pt.invalid_date}),pr}let a=new Ia,i;for(let h of this._def.checks)h.kind==="min"?e.data.getTime()<h.value&&(i=this._getOrReturnCtx(e,i),Wt(i,{code:Pt.too_small,message:h.message,inclusive:!0,exact:!1,minimum:h.value,type:"date"}),a.dirty()):h.kind==="max"?e.data.getTime()>h.value&&(i=this._getOrReturnCtx(e,i),Wt(i,{code:Pt.too_big,message:h.message,inclusive:!0,exact:!1,maximum:h.value,type:"date"}),a.dirty()):fi.assertNever(h);return{status:a.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:rr.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:rr.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}};ad.create=t=>new ad({checks:[],coerce:t?.coerce||!1,typeName:lr.ZodDate,...Br(t)});var _1=class extends Pr{_parse(e){if(this._getType(e)!==Yt.symbol){let a=this._getOrReturnCtx(e);return Wt(a,{code:Pt.invalid_type,expected:Yt.symbol,received:a.parsedType}),pr}return Da(e.data)}};_1.create=t=>new _1({typeName:lr.ZodSymbol,...Br(t)});var od=class extends Pr{_parse(e){if(this._getType(e)!==Yt.undefined){let a=this._getOrReturnCtx(e);return Wt(a,{code:Pt.invalid_type,expected:Yt.undefined,received:a.parsedType}),pr}return Da(e.data)}};od.create=t=>new od({typeName:lr.ZodUndefined,...Br(t)});var sd=class extends Pr{_parse(e){if(this._getType(e)!==Yt.null){let a=this._getOrReturnCtx(e);return Wt(a,{code:Pt.invalid_type,expected:Yt.null,received:a.parsedType}),pr}return Da(e.data)}};sd.create=t=>new sd({typeName:lr.ZodNull,...Br(t)});var dc=class extends Pr{constructor(){super(...arguments),this._any=!0}_parse(e){return Da(e.data)}};dc.create=t=>new dc({typeName:lr.ZodAny,...Br(t)});var Ch=class extends Pr{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Da(e.data)}};Ch.create=t=>new Ch({typeName:lr.ZodUnknown,...Br(t)});var Tf=class extends Pr{_parse(e){let r=this._getOrReturnCtx(e);return Wt(r,{code:Pt.invalid_type,expected:Yt.never,received:r.parsedType}),pr}};Tf.create=t=>new Tf({typeName:lr.ZodNever,...Br(t)});var M1=class extends Pr{_parse(e){if(this._getType(e)!==Yt.undefined){let a=this._getOrReturnCtx(e);return Wt(a,{code:Pt.invalid_type,expected:Yt.void,received:a.parsedType}),pr}return Da(e.data)}};M1.create=t=>new M1({typeName:lr.ZodVoid,...Br(t)});var Lh=class t extends Pr{_parse(e){let{ctx:r,status:a}=this._processInputParams(e),i=this._def;if(r.parsedType!==Yt.array)return Wt(r,{code:Pt.invalid_type,expected:Yt.array,received:r.parsedType}),pr;if(i.exactLength!==null){let l=r.data.length>i.exactLength.value,p=r.data.length<i.exactLength.value;(l||p)&&(Wt(r,{code:l?Pt.too_big:Pt.too_small,minimum:p?i.exactLength.value:void 0,maximum:l?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),a.dirty())}if(i.minLength!==null&&r.data.length<i.minLength.value&&(Wt(r,{code:Pt.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),a.dirty()),i.maxLength!==null&&r.data.length>i.maxLength.value&&(Wt(r,{code:Pt.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),a.dirty()),r.common.async)return Promise.all([...r.data].map((l,p)=>i.type._parseAsync(new Ps(r,l,r.path,p)))).then(l=>Ia.mergeArray(a,l));let h=[...r.data].map((l,p)=>i.type._parseSync(new Ps(r,l,r.path,p)));return Ia.mergeArray(a,h)}get element(){return this._def.type}min(e,r){return new t({...this._def,minLength:{value:e,message:rr.toString(r)}})}max(e,r){return new t({...this._def,maxLength:{value:e,message:rr.toString(r)}})}length(e,r){return new t({...this._def,exactLength:{value:e,message:rr.toString(r)}})}nonempty(e){return this.min(1,e)}};Lh.create=(t,e)=>new Lh({type:t,minLength:null,maxLength:null,exactLength:null,typeName:lr.ZodArray,...Br(e)});function b1(t){if(t instanceof ao){let e={};for(let r in t.shape){let a=t.shape[r];e[r]=Bs.create(b1(a))}return new ao({...t._def,shape:()=>e})}else return t instanceof Lh?new Lh({...t._def,type:b1(t.element)}):t instanceof Bs?Bs.create(b1(t.unwrap())):t instanceof Ou?Ou.create(b1(t.unwrap())):t instanceof Pu?Pu.create(t.items.map(e=>b1(e))):t}var ao=class t extends Pr{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),r=fi.objectKeys(e);return this._cached={shape:e,keys:r}}_parse(e){if(this._getType(e)!==Yt.object){let g=this._getOrReturnCtx(e);return Wt(g,{code:Pt.invalid_type,expected:Yt.object,received:g.parsedType}),pr}let{status:a,ctx:i}=this._processInputParams(e),{shape:h,keys:l}=this._getCached(),p=[];if(!(this._def.catchall instanceof Tf&&this._def.unknownKeys==="strip"))for(let g in i.data)l.includes(g)||p.push(g);let b=[];for(let g of l){let y=h[g],M=i.data[g];b.push({key:{status:"valid",value:g},value:y._parse(new Ps(i,M,i.path,g)),alwaysSet:g in i.data})}if(this._def.catchall instanceof Tf){let g=this._def.unknownKeys;if(g==="passthrough")for(let y of p)b.push({key:{status:"valid",value:y},value:{status:"valid",value:i.data[y]}});else if(g==="strict")p.length>0&&(Wt(i,{code:Pt.unrecognized_keys,keys:p}),a.dirty());else if(g!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let g=this._def.catchall;for(let y of p){let M=i.data[y];b.push({key:{status:"valid",value:y},value:g._parse(new Ps(i,M,i.path,y)),alwaysSet:y in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let g=[];for(let y of b){let M=await y.key,x=await y.value;g.push({key:M,value:x,alwaysSet:y.alwaysSet})}return g}).then(g=>Ia.mergeObjectSync(a,g)):Ia.mergeObjectSync(a,b)}get shape(){return this._def.shape()}strict(e){return rr.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,a)=>{var i,h,l,p;let b=(l=(h=(i=this._def).errorMap)===null||h===void 0?void 0:h.call(i,r,a).message)!==null&&l!==void 0?l:a.defaultError;return r.code==="unrecognized_keys"?{message:(p=rr.errToObj(e).message)!==null&&p!==void 0?p:b}:{message:b}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:lr.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let r={};return fi.objectKeys(e).forEach(a=>{e[a]&&this.shape[a]&&(r[a]=this.shape[a])}),new t({...this._def,shape:()=>r})}omit(e){let r={};return fi.objectKeys(this.shape).forEach(a=>{e[a]||(r[a]=this.shape[a])}),new t({...this._def,shape:()=>r})}deepPartial(){return b1(this)}partial(e){let r={};return fi.objectKeys(this.shape).forEach(a=>{let i=this.shape[a];e&&!e[a]?r[a]=i:r[a]=i.optional()}),new t({...this._def,shape:()=>r})}required(e){let r={};return fi.objectKeys(this.shape).forEach(a=>{if(e&&!e[a])r[a]=this.shape[a];else{let h=this.shape[a];for(;h instanceof Bs;)h=h._def.innerType;r[a]=h}}),new t({...this._def,shape:()=>r})}keyof(){return eQ(fi.objectKeys(this.shape))}};ao.create=(t,e)=>new ao({shape:()=>t,unknownKeys:"strip",catchall:Tf.create(),typeName:lr.ZodObject,...Br(e)});ao.strictCreate=(t,e)=>new ao({shape:()=>t,unknownKeys:"strict",catchall:Tf.create(),typeName:lr.ZodObject,...Br(e)});ao.lazycreate=(t,e)=>new ao({shape:t,unknownKeys:"strip",catchall:Tf.create(),typeName:lr.ZodObject,...Br(e)});var fd=class extends Pr{_parse(e){let{ctx:r}=this._processInputParams(e),a=this._def.options;function i(h){for(let p of h)if(p.result.status==="valid")return p.result;for(let p of h)if(p.result.status==="dirty")return r.common.issues.push(...p.ctx.common.issues),p.result;let l=h.map(p=>new Bo(p.ctx.common.issues));return Wt(r,{code:Pt.invalid_union,unionErrors:l}),pr}if(r.common.async)return Promise.all(a.map(async h=>{let l={...r,common:{...r.common,issues:[]},parent:null};return{result:await h._parseAsync({data:r.data,path:r.path,parent:l}),ctx:l}})).then(i);{let h,l=[];for(let b of a){let g={...r,common:{...r.common,issues:[]},parent:null},y=b._parseSync({data:r.data,path:r.path,parent:g});if(y.status==="valid")return y;y.status==="dirty"&&!h&&(h={result:y,ctx:g}),g.common.issues.length&&l.push(g.common.issues)}if(h)return r.common.issues.push(...h.ctx.common.issues),h.result;let p=l.map(b=>new Bo(b));return Wt(r,{code:Pt.invalid_union,unionErrors:p}),pr}}get options(){return this._def.options}};fd.create=(t,e)=>new fd({options:t,typeName:lr.ZodUnion,...Br(e)});var Nh=t=>t instanceof hd?Nh(t.schema):t instanceof Po?Nh(t.innerType()):t instanceof ld?[t.value]:t instanceof cd?t.options:t instanceof dd?fi.objectValues(t.enum):t instanceof pd?Nh(t._def.innerType):t instanceof od?[void 0]:t instanceof sd?[null]:t instanceof Bs?[void 0,...Nh(t.unwrap())]:t instanceof Ou?[null,...Nh(t.unwrap())]:t instanceof Pg||t instanceof md?Nh(t.unwrap()):t instanceof vd?Nh(t._def.innerType):[],N8=class t extends Pr{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==Yt.object)return Wt(r,{code:Pt.invalid_type,expected:Yt.object,received:r.parsedType}),pr;let a=this.discriminator,i=r.data[a],h=this.optionsMap.get(i);return h?r.common.async?h._parseAsync({data:r.data,path:r.path,parent:r}):h._parseSync({data:r.data,path:r.path,parent:r}):(Wt(r,{code:Pt.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[a]}),pr)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,a){let i=new Map;for(let h of r){let l=Nh(h.shape[e]);if(!l.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let p of l){if(i.has(p))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(p)}`);i.set(p,h)}}return new t({typeName:lr.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:i,...Br(a)})}};function vT(t,e){let r=lc(t),a=lc(e);if(t===e)return{valid:!0,data:t};if(r===Yt.object&&a===Yt.object){let i=fi.objectKeys(e),h=fi.objectKeys(t).filter(p=>i.indexOf(p)!==-1),l={...t,...e};for(let p of h){let b=vT(t[p],e[p]);if(!b.valid)return{valid:!1};l[p]=b.data}return{valid:!0,data:l}}else if(r===Yt.array&&a===Yt.array){if(t.length!==e.length)return{valid:!1};let i=[];for(let h=0;h<t.length;h++){let l=t[h],p=e[h],b=vT(l,p);if(!b.valid)return{valid:!1};i.push(b.data)}return{valid:!0,data:i}}else return r===Yt.date&&a===Yt.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var ud=class extends Pr{_parse(e){let{status:r,ctx:a}=this._processInputParams(e),i=(h,l)=>{if(dT(h)||dT(l))return pr;let p=vT(h.value,l.value);return p.valid?((pT(h)||pT(l))&&r.dirty(),{status:r.value,value:p.data}):(Wt(a,{code:Pt.invalid_intersection_types}),pr)};return a.common.async?Promise.all([this._def.left._parseAsync({data:a.data,path:a.path,parent:a}),this._def.right._parseAsync({data:a.data,path:a.path,parent:a})]).then(([h,l])=>i(h,l)):i(this._def.left._parseSync({data:a.data,path:a.path,parent:a}),this._def.right._parseSync({data:a.data,path:a.path,parent:a}))}};ud.create=(t,e,r)=>new ud({left:t,right:e,typeName:lr.ZodIntersection,...Br(r)});var Pu=class t extends Pr{_parse(e){let{status:r,ctx:a}=this._processInputParams(e);if(a.parsedType!==Yt.array)return Wt(a,{code:Pt.invalid_type,expected:Yt.array,received:a.parsedType}),pr;if(a.data.length<this._def.items.length)return Wt(a,{code:Pt.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),pr;!this._def.rest&&a.data.length>this._def.items.length&&(Wt(a,{code:Pt.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let h=[...a.data].map((l,p)=>{let b=this._def.items[p]||this._def.rest;return b?b._parse(new Ps(a,l,a.path,p)):null}).filter(l=>!!l);return a.common.async?Promise.all(h).then(l=>Ia.mergeArray(r,l)):Ia.mergeArray(r,h)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};Pu.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Pu({items:t,typeName:lr.ZodTuple,rest:null,...Br(e)})};var C8=class t extends Pr{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:a}=this._processInputParams(e);if(a.parsedType!==Yt.object)return Wt(a,{code:Pt.invalid_type,expected:Yt.object,received:a.parsedType}),pr;let i=[],h=this._def.keyType,l=this._def.valueType;for(let p in a.data)i.push({key:h._parse(new Ps(a,p,a.path,p)),value:l._parse(new Ps(a,a.data[p],a.path,p)),alwaysSet:p in a.data});return a.common.async?Ia.mergeObjectAsync(r,i):Ia.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(e,r,a){return r instanceof Pr?new t({keyType:e,valueType:r,typeName:lr.ZodRecord,...Br(a)}):new t({keyType:cc.create(),valueType:e,typeName:lr.ZodRecord,...Br(r)})}},x1=class extends Pr{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:a}=this._processInputParams(e);if(a.parsedType!==Yt.map)return Wt(a,{code:Pt.invalid_type,expected:Yt.map,received:a.parsedType}),pr;let i=this._def.keyType,h=this._def.valueType,l=[...a.data.entries()].map(([p,b],g)=>({key:i._parse(new Ps(a,p,a.path,[g,"key"])),value:h._parse(new Ps(a,b,a.path,[g,"value"]))}));if(a.common.async){let p=new Map;return Promise.resolve().then(async()=>{for(let b of l){let g=await b.key,y=await b.value;if(g.status==="aborted"||y.status==="aborted")return pr;(g.status==="dirty"||y.status==="dirty")&&r.dirty(),p.set(g.value,y.value)}return{status:r.value,value:p}})}else{let p=new Map;for(let b of l){let g=b.key,y=b.value;if(g.status==="aborted"||y.status==="aborted")return pr;(g.status==="dirty"||y.status==="dirty")&&r.dirty(),p.set(g.value,y.value)}return{status:r.value,value:p}}}};x1.create=(t,e,r)=>new x1({valueType:e,keyType:t,typeName:lr.ZodMap,...Br(r)});var S1=class t extends Pr{_parse(e){let{status:r,ctx:a}=this._processInputParams(e);if(a.parsedType!==Yt.set)return Wt(a,{code:Pt.invalid_type,expected:Yt.set,received:a.parsedType}),pr;let i=this._def;i.minSize!==null&&a.data.size<i.minSize.value&&(Wt(a,{code:Pt.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),r.dirty()),i.maxSize!==null&&a.data.size>i.maxSize.value&&(Wt(a,{code:Pt.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());let h=this._def.valueType;function l(b){let g=new Set;for(let y of b){if(y.status==="aborted")return pr;y.status==="dirty"&&r.dirty(),g.add(y.value)}return{status:r.value,value:g}}let p=[...a.data.values()].map((b,g)=>h._parse(new Ps(a,b,a.path,g)));return a.common.async?Promise.all(p).then(b=>l(b)):l(p)}min(e,r){return new t({...this._def,minSize:{value:e,message:rr.toString(r)}})}max(e,r){return new t({...this._def,maxSize:{value:e,message:rr.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};S1.create=(t,e)=>new S1({valueType:t,minSize:null,maxSize:null,typeName:lr.ZodSet,...Br(e)});var L8=class t extends Pr{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==Yt.function)return Wt(r,{code:Pt.invalid_type,expected:Yt.function,received:r.parsedType}),pr;function a(p,b){return P8({data:p,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,B8(),w1].filter(g=>!!g),issueData:{code:Pt.invalid_arguments,argumentsError:b}})}function i(p,b){return P8({data:p,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,B8(),w1].filter(g=>!!g),issueData:{code:Pt.invalid_return_type,returnTypeError:b}})}let h={errorMap:r.common.contextualErrorMap},l=r.data;if(this._def.returns instanceof pc){let p=this;return Da(async function(...b){let g=new Bo([]),y=await p._def.args.parseAsync(b,h).catch(E=>{throw g.addIssue(a(b,E)),g}),M=await Reflect.apply(l,this,y);return await p._def.returns._def.type.parseAsync(M,h).catch(E=>{throw g.addIssue(i(M,E)),g})})}else{let p=this;return Da(function(...b){let g=p._def.args.safeParse(b,h);if(!g.success)throw new Bo([a(b,g.error)]);let y=Reflect.apply(l,this,g.data),M=p._def.returns.safeParse(y,h);if(!M.success)throw new Bo([i(y,M.error)]);return M.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:Pu.create(e).rest(Ch.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,a){return new t({args:e||Pu.create([]).rest(Ch.create()),returns:r||Ch.create(),typeName:lr.ZodFunction,...Br(a)})}},hd=class extends Pr{get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};hd.create=(t,e)=>new hd({getter:t,typeName:lr.ZodLazy,...Br(e)});var ld=class extends Pr{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return Wt(r,{received:r.data,code:Pt.invalid_literal,expected:this._def.value}),pr}return{status:"valid",value:e.data}}get value(){return this._def.value}};ld.create=(t,e)=>new ld({value:t,typeName:lr.ZodLiteral,...Br(e)});function eQ(t,e){return new cd({values:t,typeName:lr.ZodEnum,...Br(e)})}var cd=class t extends Pr{constructor(){super(...arguments),Tg.set(this,void 0)}_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),a=this._def.values;return Wt(r,{expected:fi.joinValues(a),received:r.parsedType,code:Pt.invalid_type}),pr}if(O8(this,Tg,"f")||YX(this,Tg,new Set(this._def.values),"f"),!O8(this,Tg,"f").has(e.data)){let r=this._getOrReturnCtx(e),a=this._def.values;return Wt(r,{received:r.data,code:Pt.invalid_enum_value,options:a}),pr}return Da(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return t.create(e,{...this._def,...r})}exclude(e,r=this._def){return t.create(this.options.filter(a=>!e.includes(a)),{...this._def,...r})}};Tg=new WeakMap;cd.create=eQ;var dd=class extends Pr{constructor(){super(...arguments),kg.set(this,void 0)}_parse(e){let r=fi.getValidEnumValues(this._def.values),a=this._getOrReturnCtx(e);if(a.parsedType!==Yt.string&&a.parsedType!==Yt.number){let i=fi.objectValues(r);return Wt(a,{expected:fi.joinValues(i),received:a.parsedType,code:Pt.invalid_type}),pr}if(O8(this,kg,"f")||YX(this,kg,new Set(fi.getValidEnumValues(this._def.values)),"f"),!O8(this,kg,"f").has(e.data)){let i=fi.objectValues(r);return Wt(a,{received:a.data,code:Pt.invalid_enum_value,options:i}),pr}return Da(e.data)}get enum(){return this._def.values}};kg=new WeakMap;dd.create=(t,e)=>new dd({values:t,typeName:lr.ZodNativeEnum,...Br(e)});var pc=class extends Pr{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==Yt.promise&&r.common.async===!1)return Wt(r,{code:Pt.invalid_type,expected:Yt.promise,received:r.parsedType}),pr;let a=r.parsedType===Yt.promise?r.data:Promise.resolve(r.data);return Da(a.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}};pc.create=(t,e)=>new pc({type:t,typeName:lr.ZodPromise,...Br(e)});var Po=class extends Pr{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===lr.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:a}=this._processInputParams(e),i=this._def.effect||null,h={addIssue:l=>{Wt(a,l),l.fatal?r.abort():r.dirty()},get path(){return a.path}};if(h.addIssue=h.addIssue.bind(h),i.type==="preprocess"){let l=i.transform(a.data,h);if(a.common.async)return Promise.resolve(l).then(async p=>{if(r.value==="aborted")return pr;let b=await this._def.schema._parseAsync({data:p,path:a.path,parent:a});return b.status==="aborted"?pr:b.status==="dirty"||r.value==="dirty"?y1(b.value):b});{if(r.value==="aborted")return pr;let p=this._def.schema._parseSync({data:l,path:a.path,parent:a});return p.status==="aborted"?pr:p.status==="dirty"||r.value==="dirty"?y1(p.value):p}}if(i.type==="refinement"){let l=p=>{let b=i.refinement(p,h);if(a.common.async)return Promise.resolve(b);if(b instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return p};if(a.common.async===!1){let p=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});return p.status==="aborted"?pr:(p.status==="dirty"&&r.dirty(),l(p.value),{status:r.value,value:p.value})}else return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(p=>p.status==="aborted"?pr:(p.status==="dirty"&&r.dirty(),l(p.value).then(()=>({status:r.value,value:p.value}))))}if(i.type==="transform")if(a.common.async===!1){let l=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});if(!Ig(l))return l;let p=i.transform(l.value,h);if(p instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:p}}else return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(l=>Ig(l)?Promise.resolve(i.transform(l.value,h)).then(p=>({status:r.value,value:p})):l);fi.assertNever(i)}};Po.create=(t,e,r)=>new Po({schema:t,typeName:lr.ZodEffects,effect:e,...Br(r)});Po.createWithPreprocess=(t,e,r)=>new Po({schema:e,effect:{type:"preprocess",transform:t},typeName:lr.ZodEffects,...Br(r)});var Bs=class extends Pr{_parse(e){return this._getType(e)===Yt.undefined?Da(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Bs.create=(t,e)=>new Bs({innerType:t,typeName:lr.ZodOptional,...Br(e)});var Ou=class extends Pr{_parse(e){return this._getType(e)===Yt.null?Da(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Ou.create=(t,e)=>new Ou({innerType:t,typeName:lr.ZodNullable,...Br(e)});var pd=class extends Pr{_parse(e){let{ctx:r}=this._processInputParams(e),a=r.data;return r.parsedType===Yt.undefined&&(a=this._def.defaultValue()),this._def.innerType._parse({data:a,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};pd.create=(t,e)=>new pd({innerType:t,typeName:lr.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Br(e)});var vd=class extends Pr{_parse(e){let{ctx:r}=this._processInputParams(e),a={...r,common:{...r.common,issues:[]}},i=this._def.innerType._parse({data:a.data,path:a.path,parent:{...a}});return Bg(i)?i.then(h=>({status:"valid",value:h.status==="valid"?h.value:this._def.catchValue({get error(){return new Bo(a.common.issues)},input:a.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Bo(a.common.issues)},input:a.data})}}removeCatch(){return this._def.innerType}};vd.create=(t,e)=>new vd({innerType:t,typeName:lr.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Br(e)});var E1=class extends Pr{_parse(e){if(this._getType(e)!==Yt.nan){let a=this._getOrReturnCtx(e);return Wt(a,{code:Pt.invalid_type,expected:Yt.nan,received:a.parsedType}),pr}return{status:"valid",value:e.data}}};E1.create=t=>new E1({typeName:lr.ZodNaN,...Br(t)});var bwe=Symbol("zod_brand"),Pg=class extends Pr{_parse(e){let{ctx:r}=this._processInputParams(e),a=r.data;return this._def.type._parse({data:a,path:r.path,parent:r})}unwrap(){return this._def.type}},Og=class t extends Pr{_parse(e){let{status:r,ctx:a}=this._processInputParams(e);if(a.common.async)return(async()=>{let h=await this._def.in._parseAsync({data:a.data,path:a.path,parent:a});return h.status==="aborted"?pr:h.status==="dirty"?(r.dirty(),y1(h.value)):this._def.out._parseAsync({data:h.value,path:a.path,parent:a})})();{let i=this._def.in._parseSync({data:a.data,path:a.path,parent:a});return i.status==="aborted"?pr:i.status==="dirty"?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:a.path,parent:a})}}static create(e,r){return new t({in:e,out:r,typeName:lr.ZodPipeline})}},md=class extends Pr{_parse(e){let r=this._def.innerType._parse(e),a=i=>(Ig(i)&&(i.value=Object.freeze(i.value)),i);return Bg(r)?r.then(i=>a(i)):a(r)}unwrap(){return this._def.innerType}};md.create=(t,e)=>new md({innerType:t,typeName:lr.ZodReadonly,...Br(e)});function tQ(t,e={},r){return t?dc.create().superRefine((a,i)=>{var h,l;if(!t(a)){let p=typeof e=="function"?e(a):typeof e=="string"?{message:e}:e,b=(l=(h=p.fatal)!==null&&h!==void 0?h:r)!==null&&l!==void 0?l:!0,g=typeof p=="string"?{message:p}:p;i.addIssue({code:"custom",...g,fatal:b})}}):dc.create()}var ywe={object:ao.lazycreate},lr;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(lr||(lr={}));var wwe=(t,e={message:`Input not instance of ${t.name}`})=>tQ(r=>r instanceof t,e),rQ=cc.create,iQ=rd.create,_we=E1.create,Mwe=id.create,nQ=nd.create,xwe=ad.create,Swe=_1.create,Ewe=od.create,Awe=sd.create,Rwe=dc.create,Twe=Ch.create,kwe=Tf.create,Iwe=M1.create,Bwe=Lh.create,Pwe=ao.create,Owe=ao.strictCreate,Nwe=fd.create,Cwe=N8.create,Lwe=ud.create,Dwe=Pu.create,$we=C8.create,qwe=x1.create,Uwe=S1.create,Fwe=L8.create,jwe=hd.create,zwe=ld.create,Zwe=cd.create,Hwe=dd.create,Kwe=pc.create,VX=Po.create,Wwe=Bs.create,Vwe=Ou.create,Gwe=Po.createWithPreprocess,Ywe=Og.create,Jwe=()=>rQ().optional(),Xwe=()=>iQ().optional(),Qwe=()=>nQ().optional(),e5e={string:t=>cc.create({...t,coerce:!0}),number:t=>rd.create({...t,coerce:!0}),boolean:t=>nd.create({...t,coerce:!0}),bigint:t=>id.create({...t,coerce:!0}),date:t=>ad.create({...t,coerce:!0})},t5e=pr,vr=Object.freeze({__proto__:null,defaultErrorMap:w1,setErrorMap:twe,getErrorMap:B8,makeIssue:P8,EMPTY_PATH:rwe,addIssueToContext:Wt,ParseStatus:Ia,INVALID:pr,DIRTY:y1,OK:Da,isAborted:dT,isDirty:pT,isValid:Ig,isAsync:Bg,get util(){return fi},get objectUtil(){return cT},ZodParsedType:Yt,getParsedType:lc,ZodType:Pr,datetimeRegex:QX,ZodString:cc,ZodNumber:rd,ZodBigInt:id,ZodBoolean:nd,ZodDate:ad,ZodSymbol:_1,ZodUndefined:od,ZodNull:sd,ZodAny:dc,ZodUnknown:Ch,ZodNever:Tf,ZodVoid:M1,ZodArray:Lh,ZodObject:ao,ZodUnion:fd,ZodDiscriminatedUnion:N8,ZodIntersection:ud,ZodTuple:Pu,ZodRecord:C8,ZodMap:x1,ZodSet:S1,ZodFunction:L8,ZodLazy:hd,ZodLiteral:ld,ZodEnum:cd,ZodNativeEnum:dd,ZodPromise:pc,ZodEffects:Po,ZodTransformer:Po,ZodOptional:Bs,ZodNullable:Ou,ZodDefault:pd,ZodCatch:vd,ZodNaN:E1,BRAND:bwe,ZodBranded:Pg,ZodPipeline:Og,ZodReadonly:md,custom:tQ,Schema:Pr,ZodSchema:Pr,late:ywe,get ZodFirstPartyTypeKind(){return lr},coerce:e5e,any:Rwe,array:Bwe,bigint:Mwe,boolean:nQ,date:xwe,discriminatedUnion:Cwe,effect:VX,enum:Zwe,function:Fwe,instanceof:wwe,intersection:Lwe,lazy:jwe,literal:zwe,map:qwe,nan:_we,nativeEnum:Hwe,never:kwe,null:Awe,nullable:Vwe,number:iQ,object:Pwe,oboolean:Qwe,onumber:Xwe,optional:Wwe,ostring:Jwe,pipeline:Ywe,preprocess:Gwe,promise:Kwe,record:$we,set:Uwe,strictObject:Owe,string:rQ,symbol:Swe,transformer:VX,tuple:Dwe,undefined:Ewe,union:Nwe,unknown:Twe,void:Iwe,NEVER:t5e,ZodIssueCode:Pt,quotelessJson:ewe,ZodError:Bo});ie();ae();ne();var D8=new RegExp("^[a-zA-Z0-9_-]{43}$"),Lft=new RegExp("^(?:(?!-)[A-Za-z0-9-]{1,63}(?<!-)\\.)+[A-Za-z]{1,63}$"),Dft=new RegExp("^[0-9]{12},[0-9]{13},[a-fA-F0-9]{64}$"),$ft=He.env.ARNS_REGISTRY_TX??"bLAgYxAdX2Ry-nt6aH2ixgvJXbpsEYm28NgJgyqfs-U",qft="_NctcA2sRy1-J4OmIQZbYFPM17piNcbdBPH2ncX2RL8",r5e="GaQrvEMKBpkjofgnBi_B3IgIDmY_XYelVLB6GcRGrHc",Uft=r5e,A1="agYcCFJtrMG6cqMuZfskIkFTGvUPddICmtQSBIoPdiA",$8="i_le_yKKPVstLTDSmkHRqf-wYphMnwB9OhleiTgMkWc",mT=1e6,aQ="cbn0KKrBZH7hdNkNokuXLtGryrWM--PjSTBqIzw9Kkk",gT="16_FyX-V2QU0RPSh1GIaEETSaUjNb0oVjCFpVbAfQq4",oQ="_GQ33BkPtZrqxA84vM8Zk-N2aO0toNNu_C-l-rawrBA";var gd=vr.string({description:"Arweave Transaction ID"}).refine(t=>D8.test(t),{message:"Must be an Arweave Transaction ID"}),sQ=vr.string({description:"Integer String"}).refine(t=>{let e=parseInt(t);return Number.isInteger(e)&&e>=0},{message:"Must be a non negative integer string"}),i5e=vr.string(),uQ=vr.array(vr.string()),q8=vr.object({transactionId:gd.describe("The Target ID of the undername"),ttlSeconds:vr.number()}),bT=vr.record(vr.string(),q8),yT=vr.array(gd.describe("Controller address")),wT=vr.record(gd.describe("Holder address"),vr.number()),_T=vr.object({Name:vr.string().describe("The name of the ANT."),Ticker:vr.string().describe("The ticker symbol for the ANT."),Description:vr.string().describe("The description for the ANT."),Keywords:uQ.describe("The keywords for the ANT."),Denomination:vr.number().describe("The number of decimal places to use for the ANT. Defaults to 0 if not set representing whole numbers.").min(0,{message:"Denomination must be a non-negative number"}),Owner:gd.describe("The Owners address."),Controllers:yT.describe("Controllers of the ANT who have administrative privileges."),Records:bT.describe("Records associated with the ANT."),Balances:wT.describe("Balance details for each address holding the ANT."),Logo:gd.describe("Transaction ID of the ANT logo."),TotalSupply:vr.number().describe("Total supply of the ANT in circulation.").min(0,{message:"Total supply must be a non-negative number"}),Initialized:vr.boolean().describe("Flag indicating whether the ANT has been initialized.")}),n5e=["balance","balances","totalSupply","info","controllers","record","records","state"],a5e=["_eval","_default","transfer","addController","removeController","setRecord","removeRecord","setName","setTicker","setDescription","setKeywords","setLogo","initializeState","releaseName","reassignName","approvePrimaryName","removePrimaryNames"],o5e=[...n5e,...a5e],fQ=vr.array(vr.string({description:"Handler Name"})).refine(t=>o5e.every(e=>t.includes(e)),{message:"ANT is missing required handlers"}),hQ=vr.object({Name:vr.string().describe("The name of the ANT."),Owner:gd.describe("The Owners address."),Ticker:vr.string().describe("The ticker symbol for the ANT."),"Total-Supply":sQ.describe("Total supply of the ANT in circulation."),Description:i5e.describe("The description for the ANT."),Keywords:uQ.describe("The keywords for the ANT."),Logo:gd.describe("Transaction ID of the ANT logo."),Denomination:sQ.describe("The number of decimal places to use for the ANT. Defaults to 0 if not set representing whole numbers."),Handlers:fQ.optional().describe("List of handlers for the ANT."),HandlerNames:fQ.optional().describe('Deprecated: List of handlers for the ANT. Use "Handlers" instead.')});function Wft(t){return _T.safeParse(t).success}ie();ae();ne();ie();ae();ne();ie();ae();ne();var lQ=t=>D8.test(t);function rut(t){return t!==void 0&&!isNaN(parseInt(t.toString()))}var wn=t=>t.filter(e=>e.value!==void 0&&e.value!==""),Oo=t=>{let e=[{name:"Cursor",value:t?.cursor?.toString()},{name:"Limit",value:t?.limit?.toString()},{name:"Sort-By",value:t?.sortBy?.toString()},{name:"Sort-Order",value:t?.sortOrder?.toString()}];return wn(e)};var s5e=["Buy-Record","Extend-Lease","Increase-Undername-Limit","Upgrade-Name","Primary-Name-Request"],fut=["Buy-Record","Extend-Lease"],uut=t=>s5e.indexOf(t)!==-1,f5e=["balance","stakes","any"],hut=t=>f5e.indexOf(t)!==-1;function Dh(t){return"process"in t}function $h(t){return"processId"in t&&typeof t.processId=="string"&&lQ(t.processId)===!0}function lut(t){return t.type==="lease"}ie();ae();ne();var MT=class t{constructor(e){this.positiveFiniteInteger=e;if(!Number.isFinite(this.positiveFiniteInteger)||!Number.isInteger(this.positiveFiniteInteger)||this.positiveFiniteInteger<0)throw new Error(`Number must be a non-negative integer value! ${e}`)}[Symbol.toPrimitive](e){return e==="string"&&this.toString(),this.positiveFiniteInteger}plus(e){return new t(this.positiveFiniteInteger+e.positiveFiniteInteger)}minus(e){return new t(this.positiveFiniteInteger-e.positiveFiniteInteger)}isGreaterThan(e){return this.positiveFiniteInteger>e.positiveFiniteInteger}isGreaterThanOrEqualTo(e){return this.positiveFiniteInteger>=e.positiveFiniteInteger}isLessThan(e){return this.positiveFiniteInteger<e.positiveFiniteInteger}isLessThanOrEqualTo(e){return this.positiveFiniteInteger<=e.positiveFiniteInteger}toString(){return`${this.positiveFiniteInteger}`}valueOf(){return this.positiveFiniteInteger}toJSON(){return this.positiveFiniteInteger}equals(e){return this.positiveFiniteInteger===e.positiveFiniteInteger}},xT=class{value;constructor(e){if(!Number.isFinite(e)||e<0)throw new Error("ARIOToken must be a non-negative finite number");this.value=+e.toFixed(6)}valueOf(){return this.value}toMARIO(){return new ST(Math.floor(this.value*mT))}toString(){return`${this.value}`}},ST=class t extends MT{constructor(e){super(e)}multiply(e){let r=Math.floor(this.valueOf()*e.valueOf());return new t(r)}divide(e){if(e.valueOf()===0)throw new Error("Cannot divide by zero");let r=Math.floor(this.valueOf()/e.valueOf());return new t(r)}plus(e){let r=super.plus(e);return new t(r.valueOf())}minus(e){let r=super.minus(e);return new t(r.valueOf())}toARIO(){return new xT(this.valueOf()/mT)}};ie();ae();ne();ie();ae();ne();var kf=class extends Error{constructor(e){super(e),this.name=this.constructor.name}},cQ=class extends kf{},dQ=class extends kf{},pQ=class extends kf{constructor(e,r){super(`Failed request: ${e}: ${r}`)}},vQ=class extends kf{},U8=class extends kf{},mQ=class extends kf{constructor(){super("Invalid signer. Please provide a valid signer to interact with the contract.")}},Nu=class extends kf{constructor(){super("Invalid contract configuration")}},gQ=class extends kf{constructor(){super("Invalid process configuration")}},bQ=class extends kf{};ie();ae();ne();var $f=gi($ae(),1);ie();ae();ne();var W4="3.1.0-alpha.8";var Fu=class t{logger;silent=!1;static default=new t;constructor({level:e="info"}={}){e==="none"&&(this.silent=!0),typeof window<"u"?this.logger=console:this.logger=(0,$f.createLogger)({level:e,silent:this.silent,defaultMeta:{name:"ar-io-sdk",version:W4},format:$f.format.combine($f.format.timestamp(),$f.format.json()),transports:[new $f.transports.Console({format:$f.format.combine($f.format.timestamp(),$f.format.json())})]})}info(e,...r){this.silent||this.logger.info(e,...r)}warn(e,...r){this.silent||this.logger.warn(e,...r)}error(e,...r){this.silent||this.logger.error(e,...r)}debug(e,...r){this.silent||this.logger.debug(e,...r)}setLogLevel(e){this.silent=e==="none","silent"in this.logger&&(this.logger.silent=e==="none"),"level"in this.logger&&(this.logger.level=e)}};ie();ae();ne();ie();ae();ne();ie();ae();ne();var fBe=Object.create,oB=Object.defineProperty,uBe=Object.getOwnPropertyDescriptor,hoe=Object.getOwnPropertyNames,hBe=Object.getPrototypeOf,lBe=Object.prototype.hasOwnProperty,Lo=(t,e)=>function(){return e||(0,t[hoe(t)[0]])((e={exports:{}}).exports,e),e.exports},loe=(t,e)=>{for(var r in e)oB(t,r,{get:e[r],enumerable:!0})},cBe=(t,e,r,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of hoe(e))!lBe.call(t,i)&&i!==r&&oB(t,i,{get:()=>e[i],enumerable:!(a=uBe(e,i))||a.enumerable});return t},sB=(t,e,r)=>(r=t!=null?fBe(hBe(t)):{},cBe(e||!t||!t.__esModule?oB(r,"default",{value:t,enumerable:!0}):r,t)),dBe=Lo({"node_modules/obliterator/iterator.js"(t,e){function r(a){if(typeof a!="function")throw new Error("obliterator/iterator: expecting a function!");this.next=a}typeof Symbol<"u"&&(r.prototype[Symbol.iterator]=function(){return this}),r.of=function(){var a=arguments,i=a.length,h=0;return new r(function(){return h>=i?{done:!0}:{done:!1,value:a[h++]}})},r.empty=function(){var a=new r(function(){return{done:!0}});return a},r.fromSequence=function(a){var i=0,h=a.length;return new r(function(){return i>=h?{done:!0}:{done:!1,value:a[i++]}})},r.is=function(a){return a instanceof r?!0:typeof a=="object"&&a!==null&&typeof a.next=="function"},e.exports=r}}),pBe=Lo({"node_modules/obliterator/support.js"(t){t.ARRAY_BUFFER_SUPPORT=typeof ArrayBuffer<"u",t.SYMBOL_SUPPORT=typeof Symbol<"u"}}),fB=Lo({"node_modules/obliterator/foreach.js"(t,e){var r=pBe(),a=r.ARRAY_BUFFER_SUPPORT,i=r.SYMBOL_SUPPORT;e.exports=function(l,p){var b,g,y,M,x;if(!l)throw new Error("obliterator/forEach: invalid iterable.");if(typeof p!="function")throw new Error("obliterator/forEach: expecting a callback.");if(Array.isArray(l)||a&&ArrayBuffer.isView(l)||typeof l=="string"||l.toString()==="[object Arguments]"){for(y=0,M=l.length;y<M;y++)p(l[y],y);return}if(typeof l.forEach=="function"){l.forEach(p);return}if(i&&Symbol.iterator in l&&typeof l.next!="function"&&(l=l[Symbol.iterator]()),typeof l.next=="function"){for(b=l,y=0;x=b.next(),x.done!==!0;)p(x.value,y),y++;return}for(g in l)l.hasOwnProperty(g)&&p(l[g],g)}}}),uB=Lo({"node_modules/mnemonist/utils/typed-arrays.js"(t){var e=Math.pow(2,8)-1,r=Math.pow(2,16)-1,a=Math.pow(2,32)-1,i=Math.pow(2,7)-1,h=Math.pow(2,15)-1,l=Math.pow(2,31)-1;t.getPointerArray=function(b){var g=b-1;if(g<=e)return Uint8Array;if(g<=r)return Uint16Array;if(g<=a)return Uint32Array;throw new Error("mnemonist: Pointer Array of size > 4294967295 is not supported.")},t.getSignedPointerArray=function(b){var g=b-1;return g<=i?Int8Array:g<=h?Int16Array:g<=l?Int32Array:Float64Array},t.getNumberType=function(b){return b===(b|0)?Math.sign(b)===-1?b<=127&&b>=-128?Int8Array:b<=32767&&b>=-32768?Int16Array:Int32Array:b<=255?Uint8Array:b<=65535?Uint16Array:Uint32Array:Float64Array};var p={Uint8Array:1,Int8Array:2,Uint16Array:3,Int16Array:4,Uint32Array:5,Int32Array:6,Float32Array:7,Float64Array:8};t.getMinimalRepresentation=function(b,g){var y=null,M=0,x,E,A,k,P;for(k=0,P=b.length;k<P;k++)A=g?g(b[k]):b[k],E=t.getNumberType(A),x=p[E.name],x>M&&(M=x,y=E);return y},t.isTypedArray=function(b){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView(b)},t.concat=function(){var b=0,g,y,M;for(g=0,M=arguments.length;g<M;g++)b+=arguments[g].length;var x=new arguments[0].constructor(b);for(g=0,y=0;g<M;g++)x.set(arguments[g],y),y+=arguments[g].length;return x},t.indices=function(b){for(var g=t.getPointerArray(b),y=new g(b),M=0;M<b;M++)y[M]=M;return y}}}),coe=Lo({"node_modules/mnemonist/utils/iterables.js"(t){var e=fB(),r=uB();function a(p){return Array.isArray(p)||r.isTypedArray(p)}function i(p){if(typeof p.length=="number")return p.length;if(typeof p.size=="number")return p.size}function h(p){var b=i(p),g=typeof b=="number"?new Array(b):[],y=0;return e(p,function(M){g[y++]=M}),g}function l(p){var b=i(p),g=typeof b=="number"?r.getPointerArray(b):Array,y=typeof b=="number"?new Array(b):[],M=typeof b=="number"?new g(b):[],x=0;return e(p,function(E){y[x]=E,M[x]=x++}),[y,M]}t.isArrayLike=a,t.guessLength=i,t.toArray=h,t.toArrayWithIndices=l}}),vBe=Lo({"node_modules/mnemonist/lru-cache.js"(t,e){var r=dBe(),a=fB(),i=uB(),h=coe();function l(p,b,g){if(arguments.length<2&&(g=p,p=null,b=null),this.capacity=g,typeof this.capacity!="number"||this.capacity<=0)throw new Error("mnemonist/lru-cache: capacity should be positive number.");if(!isFinite(this.capacity)||Math.floor(this.capacity)!==this.capacity)throw new Error("mnemonist/lru-cache: capacity should be a finite positive integer.");var y=i.getPointerArray(g);this.forward=new y(g),this.backward=new y(g),this.K=typeof p=="function"?new p(g):new Array(g),this.V=typeof b=="function"?new b(g):new Array(g),this.size=0,this.head=0,this.tail=0,this.items={}}l.prototype.clear=function(){this.size=0,this.head=0,this.tail=0,this.items={}},l.prototype.splayOnTop=function(p){var b=this.head;if(this.head===p)return this;var g=this.backward[p],y=this.forward[p];return this.tail===p?this.tail=g:this.backward[y]=g,this.forward[g]=y,this.backward[b]=p,this.head=p,this.forward[p]=b,this},l.prototype.set=function(p,b){var g=this.items[p];if(typeof g<"u"){this.splayOnTop(g),this.V[g]=b;return}this.size<this.capacity?g=this.size++:(g=this.tail,this.tail=this.backward[g],delete this.items[this.K[g]]),this.items[p]=g,this.K[g]=p,this.V[g]=b,this.forward[g]=this.head,this.backward[this.head]=g,this.head=g},l.prototype.setpop=function(p,b){var g=null,y=null,M=this.items[p];return typeof M<"u"?(this.splayOnTop(M),g=this.V[M],this.V[M]=b,{evicted:!1,key:p,value:g}):(this.size<this.capacity?M=this.size++:(M=this.tail,this.tail=this.backward[M],g=this.V[M],y=this.K[M],delete this.items[y]),this.items[p]=M,this.K[M]=p,this.V[M]=b,this.forward[M]=this.head,this.backward[this.head]=M,this.head=M,y?{evicted:!0,key:y,value:g}:null)},l.prototype.has=function(p){return p in this.items},l.prototype.get=function(p){var b=this.items[p];if(!(typeof b>"u"))return this.splayOnTop(b),this.V[b]},l.prototype.peek=function(p){var b=this.items[p];if(!(typeof b>"u"))return this.V[b]},l.prototype.forEach=function(p,b){b=arguments.length>1?b:this;for(var g=0,y=this.size,M=this.head,x=this.K,E=this.V,A=this.forward;g<y;)p.call(b,E[M],x[M],this),M=A[M],g++},l.prototype.keys=function(){var p=0,b=this.size,g=this.head,y=this.K,M=this.forward;return new r(function(){if(p>=b)return{done:!0};var x=y[g];return p++,p<b&&(g=M[g]),{done:!1,value:x}})},l.prototype.values=function(){var p=0,b=this.size,g=this.head,y=this.V,M=this.forward;return new r(function(){if(p>=b)return{done:!0};var x=y[g];return p++,p<b&&(g=M[g]),{done:!1,value:x}})},l.prototype.entries=function(){var p=0,b=this.size,g=this.head,y=this.K,M=this.V,x=this.forward;return new r(function(){if(p>=b)return{done:!0};var E=y[g],A=M[g];return p++,p<b&&(g=x[g]),{done:!1,value:[E,A]}})},typeof Symbol<"u"&&(l.prototype[Symbol.iterator]=l.prototype.entries),l.prototype.inspect=function(){for(var p=new Map,b=this.entries(),g;g=b.next(),!g.done;)p.set(g.value[0],g.value[1]);return Object.defineProperty(p,"constructor",{value:l,enumerable:!1}),p},typeof Symbol<"u"&&(l.prototype[Symbol.for("nodejs.util.inspect.custom")]=l.prototype.inspect),l.from=function(p,b,g,y){if(arguments.length<2){if(y=h.guessLength(p),typeof y!="number")throw new Error("mnemonist/lru-cache.from: could not guess iterable length. Please provide desired capacity as last argument.")}else arguments.length===2&&(y=b,b=null,g=null);var M=new l(b,g,y);return a(p,function(x,E){M.set(E,x)}),M},e.exports=l}}),mBe=Lo({"node_modules/mnemonist/lru-map.js"(t,e){var r=vBe(),a=fB(),i=uB(),h=coe();function l(p,b,g){if(arguments.length<2&&(g=p,p=null,b=null),this.capacity=g,typeof this.capacity!="number"||this.capacity<=0)throw new Error("mnemonist/lru-map: capacity should be positive number.");if(!isFinite(this.capacity)||Math.floor(this.capacity)!==this.capacity)throw new Error("mnemonist/lru-map: capacity should be a finite positive integer.");var y=i.getPointerArray(g);this.forward=new y(g),this.backward=new y(g),this.K=typeof p=="function"?new p(g):new Array(g),this.V=typeof b=="function"?new b(g):new Array(g),this.size=0,this.head=0,this.tail=0,this.items=new Map}l.prototype.clear=function(){this.size=0,this.head=0,this.tail=0,this.items.clear()},l.prototype.set=function(p,b){var g=this.items.get(p);if(typeof g<"u"){this.splayOnTop(g),this.V[g]=b;return}this.size<this.capacity?g=this.size++:(g=this.tail,this.tail=this.backward[g],this.items.delete(this.K[g])),this.items.set(p,g),this.K[g]=p,this.V[g]=b,this.forward[g]=this.head,this.backward[this.head]=g,this.head=g},l.prototype.setpop=function(p,b){var g=null,y=null,M=this.items.get(p);return typeof M<"u"?(this.splayOnTop(M),g=this.V[M],this.V[M]=b,{evicted:!1,key:p,value:g}):(this.size<this.capacity?M=this.size++:(M=this.tail,this.tail=this.backward[M],g=this.V[M],y=this.K[M],this.items.delete(y)),this.items.set(p,M),this.K[M]=p,this.V[M]=b,this.forward[M]=this.head,this.backward[this.head]=M,this.head=M,y?{evicted:!0,key:y,value:g}:null)},l.prototype.has=function(p){return this.items.has(p)},l.prototype.get=function(p){var b=this.items.get(p);if(!(typeof b>"u"))return this.splayOnTop(b),this.V[b]},l.prototype.peek=function(p){var b=this.items.get(p);if(!(typeof b>"u"))return this.V[b]},l.prototype.splayOnTop=r.prototype.splayOnTop,l.prototype.forEach=r.prototype.forEach,l.prototype.keys=r.prototype.keys,l.prototype.values=r.prototype.values,l.prototype.entries=r.prototype.entries,typeof Symbol<"u"&&(l.prototype[Symbol.iterator]=l.prototype.entries),l.prototype.inspect=r.prototype.inspect,l.from=function(p,b,g,y){if(arguments.length<2){if(y=h.guessLength(p),typeof y!="number")throw new Error("mnemonist/lru-cache.from: could not guess iterable length. Please provide desired capacity as last argument.")}else arguments.length===2&&(y=b,b=null,g=null);var M=new l(b,g,y);return a(p,function(x,E){M.set(E,x)}),M},e.exports=l}}),gBe=Lo({"node_modules/ms/index.js"(t,e){var r=1e3,a=r*60,i=a*60,h=i*24,l=h*7,p=h*365.25;e.exports=function(x,E){E=E||{};var A=typeof x;if(A==="string"&&x.length>0)return b(x);if(A==="number"&&isFinite(x))return E.long?y(x):g(x);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(x))};function b(x){if(x=String(x),!(x.length>100)){var E=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(x);if(E){var A=parseFloat(E[1]),k=(E[2]||"ms").toLowerCase();switch(k){case"years":case"year":case"yrs":case"yr":case"y":return A*p;case"weeks":case"week":case"w":return A*l;case"days":case"day":case"d":return A*h;case"hours":case"hour":case"hrs":case"hr":case"h":return A*i;case"minutes":case"minute":case"mins":case"min":case"m":return A*a;case"seconds":case"second":case"secs":case"sec":case"s":return A*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return A;default:return}}}}function g(x){var E=Math.abs(x);return E>=h?Math.round(x/h)+"d":E>=i?Math.round(x/i)+"h":E>=a?Math.round(x/a)+"m":E>=r?Math.round(x/r)+"s":x+"ms"}function y(x){var E=Math.abs(x);return E>=h?M(x,E,h,"day"):E>=i?M(x,E,i,"hour"):E>=a?M(x,E,a,"minute"):E>=r?M(x,E,r,"second"):x+" ms"}function M(x,E,A,k){var P=E>=A*1.5;return Math.round(x/A)+" "+k+(P?"s":"")}}}),bBe=Lo({"node_modules/debug/src/common.js"(t,e){function r(a){h.debug=h,h.default=h,h.coerce=M,h.disable=b,h.enable=p,h.enabled=g,h.humanize=gBe(),h.destroy=x,Object.keys(a).forEach(E=>{h[E]=a[E]}),h.names=[],h.skips=[],h.formatters={};function i(E){let A=0;for(let k=0;k<E.length;k++)A=(A<<5)-A+E.charCodeAt(k),A|=0;return h.colors[Math.abs(A)%h.colors.length]}h.selectColor=i;function h(E){let A,k=null,P,N;function L(...C){if(!L.enabled)return;let Y=L,G=Number(new Date),ee=G-(A||G);Y.diff=ee,Y.prev=A,Y.curr=G,A=G,C[0]=h.coerce(C[0]),typeof C[0]!="string"&&C.unshift("%O");let D=0;C[0]=C[0].replace(/%([a-zA-Z%])/g,(V,_)=>{if(V==="%%")return"%";D++;let n=h.formatters[_];if(typeof n=="function"){let s=C[D];V=n.call(Y,s),C.splice(D,1),D--}return V}),h.formatArgs.call(Y,C),(Y.log||h.log).apply(Y,C)}return L.namespace=E,L.useColors=h.useColors(),L.color=h.selectColor(E),L.extend=l,L.destroy=h.destroy,Object.defineProperty(L,"enabled",{enumerable:!0,configurable:!1,get:()=>k!==null?k:(P!==h.namespaces&&(P=h.namespaces,N=h.enabled(E)),N),set:C=>{k=C}}),typeof h.init=="function"&&h.init(L),L}function l(E,A){let k=h(this.namespace+(typeof A>"u"?":":A)+E);return k.log=this.log,k}function p(E){h.save(E),h.namespaces=E,h.names=[],h.skips=[];let A,k=(typeof E=="string"?E:"").split(/[\s,]+/),P=k.length;for(A=0;A<P;A++)k[A]&&(E=k[A].replace(/\*/g,".*?"),E[0]==="-"?h.skips.push(new RegExp("^"+E.slice(1)+"$")):h.names.push(new RegExp("^"+E+"$")))}function b(){let E=[...h.names.map(y),...h.skips.map(y).map(A=>"-"+A)].join(",");return h.enable(""),E}function g(E){if(E[E.length-1]==="*")return!0;let A,k;for(A=0,k=h.skips.length;A<k;A++)if(h.skips[A].test(E))return!1;for(A=0,k=h.names.length;A<k;A++)if(h.names[A].test(E))return!0;return!1}function y(E){return E.toString().substring(2,E.toString().length-2).replace(/\.\*\?$/,"*")}function M(E){return E instanceof Error?E.stack||E.message:E}function x(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return h.enable(h.load()),h}e.exports=r}}),yBe=Lo({"node_modules/debug/src/browser.js"(t,e){t.formatArgs=a,t.save=i,t.load=h,t.useColors=r,t.storage=l(),t.destroy=(()=>{let b=!1;return()=>{b||(b=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function r(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function a(b){if(b[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+b[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;let g="color: "+this.color;b.splice(1,0,g,"color: inherit");let y=0,M=0;b[0].replace(/%[a-zA-Z%]/g,x=>{x!=="%%"&&(y++,x==="%c"&&(M=y))}),b.splice(M,0,g)}t.log=console.debug||console.log||(()=>{});function i(b){try{b?t.storage.setItem("debug",b):t.storage.removeItem("debug")}catch{}}function h(){let b;try{b=t.storage.getItem("debug")}catch{}return!b&&typeof He<"u"&&"env"in He&&(b=He.env.DEBUG),b}function l(){try{return localStorage}catch{}}e.exports=bBe()(t);var{formatters:p}=e.exports;p.j=function(b){try{return JSON.stringify(b)}catch(g){return"[UnexpectedJSONParseError]: "+g.message}}}}),wBe=Lo({"node_modules/base64-js/index.js"(t){"use strict";t.byteLength=b,t.toByteArray=y,t.fromByteArray=E;var e=[],r=[],a=typeof Uint8Array<"u"?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(h=0,l=i.length;h<l;++h)e[h]=i[h],r[i.charCodeAt(h)]=h;var h,l;r[45]=62,r[95]=63;function p(A){var k=A.length;if(k%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var P=A.indexOf("=");P===-1&&(P=k);var N=P===k?0:4-P%4;return[P,N]}function b(A){var k=p(A),P=k[0],N=k[1];return(P+N)*3/4-N}function g(A,k,P){return(k+P)*3/4-P}function y(A){var k,P=p(A),N=P[0],L=P[1],C=new a(g(A,N,L)),Y=0,G=L>0?N-4:N,ee;for(ee=0;ee<G;ee+=4)k=r[A.charCodeAt(ee)]<<18|r[A.charCodeAt(ee+1)]<<12|r[A.charCodeAt(ee+2)]<<6|r[A.charCodeAt(ee+3)],C[Y++]=k>>16&255,C[Y++]=k>>8&255,C[Y++]=k&255;return L===2&&(k=r[A.charCodeAt(ee)]<<2|r[A.charCodeAt(ee+1)]>>4,C[Y++]=k&255),L===1&&(k=r[A.charCodeAt(ee)]<<10|r[A.charCodeAt(ee+1)]<<4|r[A.charCodeAt(ee+2)]>>2,C[Y++]=k>>8&255,C[Y++]=k&255),C}function M(A){return e[A>>18&63]+e[A>>12&63]+e[A>>6&63]+e[A&63]}function x(A,k,P){for(var N,L=[],C=k;C<P;C+=3)N=(A[C]<<16&16711680)+(A[C+1]<<8&65280)+(A[C+2]&255),L.push(M(N));return L.join("")}function E(A){for(var k,P=A.length,N=P%3,L=[],C=16383,Y=0,G=P-N;Y<G;Y+=C)L.push(x(A,Y,Y+C>G?G:Y+C));return N===1?(k=A[P-1],L.push(e[k>>2]+e[k<<4&63]+"==")):N===2&&(k=(A[P-2]<<8)+A[P-1],L.push(e[k>>10]+e[k>>4&63]+e[k<<2&63]+"=")),L.join("")}}}),_Be=Lo({"node_modules/ieee754/index.js"(t){t.read=function(e,r,a,i,h){var l,p,b=h*8-i-1,g=(1<<b)-1,y=g>>1,M=-7,x=a?h-1:0,E=a?-1:1,A=e[r+x];for(x+=E,l=A&(1<<-M)-1,A>>=-M,M+=b;M>0;l=l*256+e[r+x],x+=E,M-=8);for(p=l&(1<<-M)-1,l>>=-M,M+=i;M>0;p=p*256+e[r+x],x+=E,M-=8);if(l===0)l=1-y;else{if(l===g)return p?NaN:(A?-1:1)*(1/0);p=p+Math.pow(2,i),l=l-y}return(A?-1:1)*p*Math.pow(2,l-i)},t.write=function(e,r,a,i,h,l){var p,b,g,y=l*8-h-1,M=(1<<y)-1,x=M>>1,E=h===23?Math.pow(2,-24)-Math.pow(2,-77):0,A=i?0:l-1,k=i?1:-1,P=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(b=isNaN(r)?1:0,p=M):(p=Math.floor(Math.log(r)/Math.LN2),r*(g=Math.pow(2,-p))<1&&(p--,g*=2),p+x>=1?r+=E/g:r+=E*Math.pow(2,1-x),r*g>=2&&(p++,g/=2),p+x>=M?(b=0,p=M):p+x>=1?(b=(r*g-1)*Math.pow(2,h),p=p+x):(b=r*Math.pow(2,x-1)*Math.pow(2,h),p=0));h>=8;e[a+A]=b&255,A+=k,b/=256,h-=8);for(p=p<<h|b,y+=h;y>0;e[a+A]=p&255,A+=k,p/=256,y-=8);e[a+A-k]|=P*128}}}),MBe=Lo({"node_modules/buffer/index.js"(t){"use strict";var e=wBe(),r=_Be(),a=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=p,t.SlowBuffer=L,t.INSPECT_MAX_BYTES=50;var i=2147483647;t.kMaxLength=i,p.TYPED_ARRAY_SUPPORT=h(),!p.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 h(){try{let T=new Uint8Array(1),I={foo:function(){return 42}};return Object.setPrototypeOf(I,Uint8Array.prototype),Object.setPrototypeOf(T,I),T.foo()===42}catch{return!1}}Object.defineProperty(p.prototype,"parent",{enumerable:!0,get:function(){if(p.isBuffer(this))return this.buffer}}),Object.defineProperty(p.prototype,"offset",{enumerable:!0,get:function(){if(p.isBuffer(this))return this.byteOffset}});function l(T){if(T>i)throw new RangeError('The value "'+T+'" is invalid for option "size"');let I=new Uint8Array(T);return Object.setPrototypeOf(I,p.prototype),I}function p(T,I,O){if(typeof T=="number"){if(typeof I=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return M(T)}return b(T,I,O)}p.poolSize=8192;function b(T,I,O){if(typeof T=="string")return x(T,I);if(ArrayBuffer.isView(T))return A(T);if(T==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof T);if(ut(T,ArrayBuffer)||T&&ut(T.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(ut(T,SharedArrayBuffer)||T&&ut(T.buffer,SharedArrayBuffer)))return k(T,I,O);if(typeof T=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let q=T.valueOf&&T.valueOf();if(q!=null&&q!==T)return p.from(q,I,O);let H=P(T);if(H)return H;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof T[Symbol.toPrimitive]=="function")return p.from(T[Symbol.toPrimitive]("string"),I,O);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof T)}p.from=function(T,I,O){return b(T,I,O)},Object.setPrototypeOf(p.prototype,Uint8Array.prototype),Object.setPrototypeOf(p,Uint8Array);function g(T){if(typeof T!="number")throw new TypeError('"size" argument must be of type number');if(T<0)throw new RangeError('The value "'+T+'" is invalid for option "size"')}function y(T,I,O){return g(T),T<=0?l(T):I!==void 0?typeof O=="string"?l(T).fill(I,O):l(T).fill(I):l(T)}p.alloc=function(T,I,O){return y(T,I,O)};function M(T){return g(T),l(T<0?0:N(T)|0)}p.allocUnsafe=function(T){return M(T)},p.allocUnsafeSlow=function(T){return M(T)};function x(T,I){if((typeof I!="string"||I==="")&&(I="utf8"),!p.isEncoding(I))throw new TypeError("Unknown encoding: "+I);let O=C(T,I)|0,q=l(O),H=q.write(T,I);return H!==O&&(q=q.slice(0,H)),q}function E(T){let I=T.length<0?0:N(T.length)|0,O=l(I);for(let q=0;q<I;q+=1)O[q]=T[q]&255;return O}function A(T){if(ut(T,Uint8Array)){let I=new Uint8Array(T);return k(I.buffer,I.byteOffset,I.byteLength)}return E(T)}function k(T,I,O){if(I<0||T.byteLength<I)throw new RangeError('"offset" is outside of buffer bounds');if(T.byteLength<I+(O||0))throw new RangeError('"length" is outside of buffer bounds');let q;return I===void 0&&O===void 0?q=new Uint8Array(T):O===void 0?q=new Uint8Array(T,I):q=new Uint8Array(T,I,O),Object.setPrototypeOf(q,p.prototype),q}function P(T){if(p.isBuffer(T)){let I=N(T.length)|0,O=l(I);return O.length===0||T.copy(O,0,0,I),O}if(T.length!==void 0)return typeof T.length!="number"||Ze(T.length)?l(0):E(T);if(T.type==="Buffer"&&Array.isArray(T.data))return E(T.data)}function N(T){if(T>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return T|0}function L(T){return+T!=T&&(T=0),p.alloc(+T)}p.isBuffer=function(I){return I!=null&&I._isBuffer===!0&&I!==p.prototype},p.compare=function(I,O){if(ut(I,Uint8Array)&&(I=p.from(I,I.offset,I.byteLength)),ut(O,Uint8Array)&&(O=p.from(O,O.offset,O.byteLength)),!p.isBuffer(I)||!p.isBuffer(O))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(I===O)return 0;let q=I.length,H=O.length;for(let W=0,fe=Math.min(q,H);W<fe;++W)if(I[W]!==O[W]){q=I[W],H=O[W];break}return q<H?-1:H<q?1:0},p.isEncoding=function(I){switch(String(I).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}},p.concat=function(I,O){if(!Array.isArray(I))throw new TypeError('"list" argument must be an Array of Buffers');if(I.length===0)return p.alloc(0);let q;if(O===void 0)for(O=0,q=0;q<I.length;++q)O+=I[q].length;let H=p.allocUnsafe(O),W=0;for(q=0;q<I.length;++q){let fe=I[q];if(ut(fe,Uint8Array))W+fe.length>H.length?(p.isBuffer(fe)||(fe=p.from(fe)),fe.copy(H,W)):Uint8Array.prototype.set.call(H,fe,W);else if(p.isBuffer(fe))fe.copy(H,W);else throw new TypeError('"list" argument must be an Array of Buffers');W+=fe.length}return H};function C(T,I){if(p.isBuffer(T))return T.length;if(ArrayBuffer.isView(T)||ut(T,ArrayBuffer))return T.byteLength;if(typeof T!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof T);let O=T.length,q=arguments.length>2&&arguments[2]===!0;if(!q&&O===0)return 0;let H=!1;for(;;)switch(I){case"ascii":case"latin1":case"binary":return O;case"utf8":case"utf-8":return oe(T).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O*2;case"hex":return O>>>1;case"base64":return ge(T).length;default:if(H)return q?-1:oe(T).length;I=(""+I).toLowerCase(),H=!0}}p.byteLength=C;function Y(T,I,O){let q=!1;if((I===void 0||I<0)&&(I=0),I>this.length||((O===void 0||O>this.length)&&(O=this.length),O<=0)||(O>>>=0,I>>>=0,O<=I))return"";for(T||(T="utf8");;)switch(T){case"hex":return o(this,I,O);case"utf8":case"utf-8":return u(this,I,O);case"ascii":return w(this,I,O);case"latin1":case"binary":return d(this,I,O);case"base64":return f(this,I,O);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return v(this,I,O);default:if(q)throw new TypeError("Unknown encoding: "+T);T=(T+"").toLowerCase(),q=!0}}p.prototype._isBuffer=!0;function G(T,I,O){let q=T[I];T[I]=T[O],T[O]=q}p.prototype.swap16=function(){let I=this.length;if(I%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let O=0;O<I;O+=2)G(this,O,O+1);return this},p.prototype.swap32=function(){let I=this.length;if(I%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let O=0;O<I;O+=4)G(this,O,O+3),G(this,O+1,O+2);return this},p.prototype.swap64=function(){let I=this.length;if(I%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let O=0;O<I;O+=8)G(this,O,O+7),G(this,O+1,O+6),G(this,O+2,O+5),G(this,O+3,O+4);return this},p.prototype.toString=function(){let I=this.length;return I===0?"":arguments.length===0?u(this,0,I):Y.apply(this,arguments)},p.prototype.toLocaleString=p.prototype.toString,p.prototype.equals=function(I){if(!p.isBuffer(I))throw new TypeError("Argument must be a Buffer");return this===I?!0:p.compare(this,I)===0},p.prototype.inspect=function(){let I="",O=t.INSPECT_MAX_BYTES;return I=this.toString("hex",0,O).replace(/(.{2})/g,"$1 ").trim(),this.length>O&&(I+=" ... "),"<Buffer "+I+">"},a&&(p.prototype[a]=p.prototype.inspect),p.prototype.compare=function(I,O,q,H,W){if(ut(I,Uint8Array)&&(I=p.from(I,I.offset,I.byteLength)),!p.isBuffer(I))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof I);if(O===void 0&&(O=0),q===void 0&&(q=I?I.length:0),H===void 0&&(H=0),W===void 0&&(W=this.length),O<0||q>I.length||H<0||W>this.length)throw new RangeError("out of range index");if(H>=W&&O>=q)return 0;if(H>=W)return-1;if(O>=q)return 1;if(O>>>=0,q>>>=0,H>>>=0,W>>>=0,this===I)return 0;let fe=W-H,st=q-O,ue=Math.min(fe,st),me=this.slice(H,W),pe=I.slice(O,q);for(let be=0;be<ue;++be)if(me[be]!==pe[be]){fe=me[be],st=pe[be];break}return fe<st?-1:st<fe?1:0};function ee(T,I,O,q,H){if(T.length===0)return-1;if(typeof O=="string"?(q=O,O=0):O>2147483647?O=2147483647:O<-2147483648&&(O=-2147483648),O=+O,Ze(O)&&(O=H?0:T.length-1),O<0&&(O=T.length+O),O>=T.length){if(H)return-1;O=T.length-1}else if(O<0)if(H)O=0;else return-1;if(typeof I=="string"&&(I=p.from(I,q)),p.isBuffer(I))return I.length===0?-1:D(T,I,O,q,H);if(typeof I=="number")return I=I&255,typeof Uint8Array.prototype.indexOf=="function"?H?Uint8Array.prototype.indexOf.call(T,I,O):Uint8Array.prototype.lastIndexOf.call(T,I,O):D(T,[I],O,q,H);throw new TypeError("val must be string, number or Buffer")}function D(T,I,O,q,H){let W=1,fe=T.length,st=I.length;if(q!==void 0&&(q=String(q).toLowerCase(),q==="ucs2"||q==="ucs-2"||q==="utf16le"||q==="utf-16le")){if(T.length<2||I.length<2)return-1;W=2,fe/=2,st/=2,O/=2}function ue(pe,be){return W===1?pe[be]:pe.readUInt16BE(be*W)}let me;if(H){let pe=-1;for(me=O;me<fe;me++)if(ue(T,me)===ue(I,pe===-1?0:me-pe)){if(pe===-1&&(pe=me),me-pe+1===st)return pe*W}else pe!==-1&&(me-=me-pe),pe=-1}else for(O+st>fe&&(O=fe-st),me=O;me>=0;me--){let pe=!0;for(let be=0;be<st;be++)if(ue(T,me+be)!==ue(I,be)){pe=!1;break}if(pe)return me}return-1}p.prototype.includes=function(I,O,q){return this.indexOf(I,O,q)!==-1},p.prototype.indexOf=function(I,O,q){return ee(this,I,O,q,!0)},p.prototype.lastIndexOf=function(I,O,q){return ee(this,I,O,q,!1)};function U(T,I,O,q){O=Number(O)||0;let H=T.length-O;q?(q=Number(q),q>H&&(q=H)):q=H;let W=I.length;q>W/2&&(q=W/2);let fe;for(fe=0;fe<q;++fe){let st=parseInt(I.substr(fe*2,2),16);if(Ze(st))return fe;T[O+fe]=st}return fe}function V(T,I,O,q){return Se(oe(I,T.length-O),T,O,q)}function _(T,I,O,q){return Se(ce(I),T,O,q)}function n(T,I,O,q){return Se(ge(I),T,O,q)}function s(T,I,O,q){return Se(ot(I,T.length-O),T,O,q)}p.prototype.write=function(I,O,q,H){if(O===void 0)H="utf8",q=this.length,O=0;else if(q===void 0&&typeof O=="string")H=O,q=this.length,O=0;else if(isFinite(O))O=O>>>0,isFinite(q)?(q=q>>>0,H===void 0&&(H="utf8")):(H=q,q=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let W=this.length-O;if((q===void 0||q>W)&&(q=W),I.length>0&&(q<0||O<0)||O>this.length)throw new RangeError("Attempt to write outside buffer bounds");H||(H="utf8");let fe=!1;for(;;)switch(H){case"hex":return U(this,I,O,q);case"utf8":case"utf-8":return V(this,I,O,q);case"ascii":case"latin1":case"binary":return _(this,I,O,q);case"base64":return n(this,I,O,q);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return s(this,I,O,q);default:if(fe)throw new TypeError("Unknown encoding: "+H);H=(""+H).toLowerCase(),fe=!0}},p.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function f(T,I,O){return I===0&&O===T.length?e.fromByteArray(T):e.fromByteArray(T.slice(I,O))}function u(T,I,O){O=Math.min(T.length,O);let q=[],H=I;for(;H<O;){let W=T[H],fe=null,st=W>239?4:W>223?3:W>191?2:1;if(H+st<=O){let ue,me,pe,be;switch(st){case 1:W<128&&(fe=W);break;case 2:ue=T[H+1],(ue&192)===128&&(be=(W&31)<<6|ue&63,be>127&&(fe=be));break;case 3:ue=T[H+1],me=T[H+2],(ue&192)===128&&(me&192)===128&&(be=(W&15)<<12|(ue&63)<<6|me&63,be>2047&&(be<55296||be>57343)&&(fe=be));break;case 4:ue=T[H+1],me=T[H+2],pe=T[H+3],(ue&192)===128&&(me&192)===128&&(pe&192)===128&&(be=(W&15)<<18|(ue&63)<<12|(me&63)<<6|pe&63,be>65535&&be<1114112&&(fe=be))}}fe===null?(fe=65533,st=1):fe>65535&&(fe-=65536,q.push(fe>>>10&1023|55296),fe=56320|fe&1023),q.push(fe),H+=st}return m(q)}var c=4096;function m(T){let I=T.length;if(I<=c)return String.fromCharCode.apply(String,T);let O="",q=0;for(;q<I;)O+=String.fromCharCode.apply(String,T.slice(q,q+=c));return O}function w(T,I,O){let q="";O=Math.min(T.length,O);for(let H=I;H<O;++H)q+=String.fromCharCode(T[H]&127);return q}function d(T,I,O){let q="";O=Math.min(T.length,O);for(let H=I;H<O;++H)q+=String.fromCharCode(T[H]);return q}function o(T,I,O){let q=T.length;(!I||I<0)&&(I=0),(!O||O<0||O>q)&&(O=q);let H="";for(let W=I;W<O;++W)H+=Ge[T[W]];return H}function v(T,I,O){let q=T.slice(I,O),H="";for(let W=0;W<q.length-1;W+=2)H+=String.fromCharCode(q[W]+q[W+1]*256);return H}p.prototype.slice=function(I,O){let q=this.length;I=~~I,O=O===void 0?q:~~O,I<0?(I+=q,I<0&&(I=0)):I>q&&(I=q),O<0?(O+=q,O<0&&(O=0)):O>q&&(O=q),O<I&&(O=I);let H=this.subarray(I,O);return Object.setPrototypeOf(H,p.prototype),H};function R(T,I,O){if(T%1!==0||T<0)throw new RangeError("offset is not uint");if(T+I>O)throw new RangeError("Trying to access beyond buffer length")}p.prototype.readUintLE=p.prototype.readUIntLE=function(I,O,q){I=I>>>0,O=O>>>0,q||R(I,O,this.length);let H=this[I],W=1,fe=0;for(;++fe<O&&(W*=256);)H+=this[I+fe]*W;return H},p.prototype.readUintBE=p.prototype.readUIntBE=function(I,O,q){I=I>>>0,O=O>>>0,q||R(I,O,this.length);let H=this[I+--O],W=1;for(;O>0&&(W*=256);)H+=this[I+--O]*W;return H},p.prototype.readUint8=p.prototype.readUInt8=function(I,O){return I=I>>>0,O||R(I,1,this.length),this[I]},p.prototype.readUint16LE=p.prototype.readUInt16LE=function(I,O){return I=I>>>0,O||R(I,2,this.length),this[I]|this[I+1]<<8},p.prototype.readUint16BE=p.prototype.readUInt16BE=function(I,O){return I=I>>>0,O||R(I,2,this.length),this[I]<<8|this[I+1]},p.prototype.readUint32LE=p.prototype.readUInt32LE=function(I,O){return I=I>>>0,O||R(I,4,this.length),(this[I]|this[I+1]<<8|this[I+2]<<16)+this[I+3]*16777216},p.prototype.readUint32BE=p.prototype.readUInt32BE=function(I,O){return I=I>>>0,O||R(I,4,this.length),this[I]*16777216+(this[I+1]<<16|this[I+2]<<8|this[I+3])},p.prototype.readBigUInt64LE=lt(function(I){I=I>>>0,J(I,"offset");let O=this[I],q=this[I+7];(O===void 0||q===void 0)&&X(I,this.length-8);let H=O+this[++I]*2**8+this[++I]*2**16+this[++I]*2**24,W=this[++I]+this[++I]*2**8+this[++I]*2**16+q*2**24;return BigInt(H)+(BigInt(W)<<BigInt(32))}),p.prototype.readBigUInt64BE=lt(function(I){I=I>>>0,J(I,"offset");let O=this[I],q=this[I+7];(O===void 0||q===void 0)&&X(I,this.length-8);let H=O*2**24+this[++I]*2**16+this[++I]*2**8+this[++I],W=this[++I]*2**24+this[++I]*2**16+this[++I]*2**8+q;return(BigInt(H)<<BigInt(32))+BigInt(W)}),p.prototype.readIntLE=function(I,O,q){I=I>>>0,O=O>>>0,q||R(I,O,this.length);let H=this[I],W=1,fe=0;for(;++fe<O&&(W*=256);)H+=this[I+fe]*W;return W*=128,H>=W&&(H-=Math.pow(2,8*O)),H},p.prototype.readIntBE=function(I,O,q){I=I>>>0,O=O>>>0,q||R(I,O,this.length);let H=O,W=1,fe=this[I+--H];for(;H>0&&(W*=256);)fe+=this[I+--H]*W;return W*=128,fe>=W&&(fe-=Math.pow(2,8*O)),fe},p.prototype.readInt8=function(I,O){return I=I>>>0,O||R(I,1,this.length),this[I]&128?(255-this[I]+1)*-1:this[I]},p.prototype.readInt16LE=function(I,O){I=I>>>0,O||R(I,2,this.length);let q=this[I]|this[I+1]<<8;return q&32768?q|4294901760:q},p.prototype.readInt16BE=function(I,O){I=I>>>0,O||R(I,2,this.length);let q=this[I+1]|this[I]<<8;return q&32768?q|4294901760:q},p.prototype.readInt32LE=function(I,O){return I=I>>>0,O||R(I,4,this.length),this[I]|this[I+1]<<8|this[I+2]<<16|this[I+3]<<24},p.prototype.readInt32BE=function(I,O){return I=I>>>0,O||R(I,4,this.length),this[I]<<24|this[I+1]<<16|this[I+2]<<8|this[I+3]},p.prototype.readBigInt64LE=lt(function(I){I=I>>>0,J(I,"offset");let O=this[I],q=this[I+7];(O===void 0||q===void 0)&&X(I,this.length-8);let H=this[I+4]+this[I+5]*2**8+this[I+6]*2**16+(q<<24);return(BigInt(H)<<BigInt(32))+BigInt(O+this[++I]*2**8+this[++I]*2**16+this[++I]*2**24)}),p.prototype.readBigInt64BE=lt(function(I){I=I>>>0,J(I,"offset");let O=this[I],q=this[I+7];(O===void 0||q===void 0)&&X(I,this.length-8);let H=(O<<24)+this[++I]*2**16+this[++I]*2**8+this[++I];return(BigInt(H)<<BigInt(32))+BigInt(this[++I]*2**24+this[++I]*2**16+this[++I]*2**8+q)}),p.prototype.readFloatLE=function(I,O){return I=I>>>0,O||R(I,4,this.length),r.read(this,I,!0,23,4)},p.prototype.readFloatBE=function(I,O){return I=I>>>0,O||R(I,4,this.length),r.read(this,I,!1,23,4)},p.prototype.readDoubleLE=function(I,O){return I=I>>>0,O||R(I,8,this.length),r.read(this,I,!0,52,8)},p.prototype.readDoubleBE=function(I,O){return I=I>>>0,O||R(I,8,this.length),r.read(this,I,!1,52,8)};function S(T,I,O,q,H,W){if(!p.isBuffer(T))throw new TypeError('"buffer" argument must be a Buffer instance');if(I>H||I<W)throw new RangeError('"value" argument is out of bounds');if(O+q>T.length)throw new RangeError("Index out of range")}p.prototype.writeUintLE=p.prototype.writeUIntLE=function(I,O,q,H){if(I=+I,O=O>>>0,q=q>>>0,!H){let st=Math.pow(2,8*q)-1;S(this,I,O,q,st,0)}let W=1,fe=0;for(this[O]=I&255;++fe<q&&(W*=256);)this[O+fe]=I/W&255;return O+q},p.prototype.writeUintBE=p.prototype.writeUIntBE=function(I,O,q,H){if(I=+I,O=O>>>0,q=q>>>0,!H){let st=Math.pow(2,8*q)-1;S(this,I,O,q,st,0)}let W=q-1,fe=1;for(this[O+W]=I&255;--W>=0&&(fe*=256);)this[O+W]=I/fe&255;return O+q},p.prototype.writeUint8=p.prototype.writeUInt8=function(I,O,q){return I=+I,O=O>>>0,q||S(this,I,O,1,255,0),this[O]=I&255,O+1},p.prototype.writeUint16LE=p.prototype.writeUInt16LE=function(I,O,q){return I=+I,O=O>>>0,q||S(this,I,O,2,65535,0),this[O]=I&255,this[O+1]=I>>>8,O+2},p.prototype.writeUint16BE=p.prototype.writeUInt16BE=function(I,O,q){return I=+I,O=O>>>0,q||S(this,I,O,2,65535,0),this[O]=I>>>8,this[O+1]=I&255,O+2},p.prototype.writeUint32LE=p.prototype.writeUInt32LE=function(I,O,q){return I=+I,O=O>>>0,q||S(this,I,O,4,4294967295,0),this[O+3]=I>>>24,this[O+2]=I>>>16,this[O+1]=I>>>8,this[O]=I&255,O+4},p.prototype.writeUint32BE=p.prototype.writeUInt32BE=function(I,O,q){return I=+I,O=O>>>0,q||S(this,I,O,4,4294967295,0),this[O]=I>>>24,this[O+1]=I>>>16,this[O+2]=I>>>8,this[O+3]=I&255,O+4};function B(T,I,O,q,H){j(I,q,H,T,O,7);let W=Number(I&BigInt(4294967295));T[O++]=W,W=W>>8,T[O++]=W,W=W>>8,T[O++]=W,W=W>>8,T[O++]=W;let fe=Number(I>>BigInt(32)&BigInt(4294967295));return T[O++]=fe,fe=fe>>8,T[O++]=fe,fe=fe>>8,T[O++]=fe,fe=fe>>8,T[O++]=fe,O}function F(T,I,O,q,H){j(I,q,H,T,O,7);let W=Number(I&BigInt(4294967295));T[O+7]=W,W=W>>8,T[O+6]=W,W=W>>8,T[O+5]=W,W=W>>8,T[O+4]=W;let fe=Number(I>>BigInt(32)&BigInt(4294967295));return T[O+3]=fe,fe=fe>>8,T[O+2]=fe,fe=fe>>8,T[O+1]=fe,fe=fe>>8,T[O]=fe,O+8}p.prototype.writeBigUInt64LE=lt(function(I,O=0){return B(this,I,O,BigInt(0),BigInt("0xffffffffffffffff"))}),p.prototype.writeBigUInt64BE=lt(function(I,O=0){return F(this,I,O,BigInt(0),BigInt("0xffffffffffffffff"))}),p.prototype.writeIntLE=function(I,O,q,H){if(I=+I,O=O>>>0,!H){let ue=Math.pow(2,8*q-1);S(this,I,O,q,ue-1,-ue)}let W=0,fe=1,st=0;for(this[O]=I&255;++W<q&&(fe*=256);)I<0&&st===0&&this[O+W-1]!==0&&(st=1),this[O+W]=(I/fe>>0)-st&255;return O+q},p.prototype.writeIntBE=function(I,O,q,H){if(I=+I,O=O>>>0,!H){let ue=Math.pow(2,8*q-1);S(this,I,O,q,ue-1,-ue)}let W=q-1,fe=1,st=0;for(this[O+W]=I&255;--W>=0&&(fe*=256);)I<0&&st===0&&this[O+W+1]!==0&&(st=1),this[O+W]=(I/fe>>0)-st&255;return O+q},p.prototype.writeInt8=function(I,O,q){return I=+I,O=O>>>0,q||S(this,I,O,1,127,-128),I<0&&(I=255+I+1),this[O]=I&255,O+1},p.prototype.writeInt16LE=function(I,O,q){return I=+I,O=O>>>0,q||S(this,I,O,2,32767,-32768),this[O]=I&255,this[O+1]=I>>>8,O+2},p.prototype.writeInt16BE=function(I,O,q){return I=+I,O=O>>>0,q||S(this,I,O,2,32767,-32768),this[O]=I>>>8,this[O+1]=I&255,O+2},p.prototype.writeInt32LE=function(I,O,q){return I=+I,O=O>>>0,q||S(this,I,O,4,2147483647,-2147483648),this[O]=I&255,this[O+1]=I>>>8,this[O+2]=I>>>16,this[O+3]=I>>>24,O+4},p.prototype.writeInt32BE=function(I,O,q){return I=+I,O=O>>>0,q||S(this,I,O,4,2147483647,-2147483648),I<0&&(I=4294967295+I+1),this[O]=I>>>24,this[O+1]=I>>>16,this[O+2]=I>>>8,this[O+3]=I&255,O+4},p.prototype.writeBigInt64LE=lt(function(I,O=0){return B(this,I,O,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),p.prototype.writeBigInt64BE=lt(function(I,O=0){return F(this,I,O,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function $(T,I,O,q,H,W){if(O+q>T.length)throw new RangeError("Index out of range");if(O<0)throw new RangeError("Index out of range")}function re(T,I,O,q,H){return I=+I,O=O>>>0,H||$(T,I,O,4,34028234663852886e22,-34028234663852886e22),r.write(T,I,O,q,23,4),O+4}p.prototype.writeFloatLE=function(I,O,q){return re(this,I,O,!0,q)},p.prototype.writeFloatBE=function(I,O,q){return re(this,I,O,!1,q)};function Q(T,I,O,q,H){return I=+I,O=O>>>0,H||$(T,I,O,8,17976931348623157e292,-17976931348623157e292),r.write(T,I,O,q,52,8),O+8}p.prototype.writeDoubleLE=function(I,O,q){return Q(this,I,O,!0,q)},p.prototype.writeDoubleBE=function(I,O,q){return Q(this,I,O,!1,q)},p.prototype.copy=function(I,O,q,H){if(!p.isBuffer(I))throw new TypeError("argument should be a Buffer");if(q||(q=0),!H&&H!==0&&(H=this.length),O>=I.length&&(O=I.length),O||(O=0),H>0&&H<q&&(H=q),H===q||I.length===0||this.length===0)return 0;if(O<0)throw new RangeError("targetStart out of bounds");if(q<0||q>=this.length)throw new RangeError("Index out of range");if(H<0)throw new RangeError("sourceEnd out of bounds");H>this.length&&(H=this.length),I.length-O<H-q&&(H=I.length-O+q);let W=H-q;return this===I&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(O,q,H):Uint8Array.prototype.set.call(I,this.subarray(q,H),O),W},p.prototype.fill=function(I,O,q,H){if(typeof I=="string"){if(typeof O=="string"?(H=O,O=0,q=this.length):typeof q=="string"&&(H=q,q=this.length),H!==void 0&&typeof H!="string")throw new TypeError("encoding must be a string");if(typeof H=="string"&&!p.isEncoding(H))throw new TypeError("Unknown encoding: "+H);if(I.length===1){let fe=I.charCodeAt(0);(H==="utf8"&&fe<128||H==="latin1")&&(I=fe)}}else typeof I=="number"?I=I&255:typeof I=="boolean"&&(I=Number(I));if(O<0||this.length<O||this.length<q)throw new RangeError("Out of range index");if(q<=O)return this;O=O>>>0,q=q===void 0?this.length:q>>>0,I||(I=0);let W;if(typeof I=="number")for(W=O;W<q;++W)this[W]=I;else{let fe=p.isBuffer(I)?I:p.from(I,H),st=fe.length;if(st===0)throw new TypeError('The value "'+I+'" is invalid for argument "value"');for(W=0;W<q-O;++W)this[W+O]=fe[W%st]}return this};var Z={};function K(T,I,O){Z[T]=class extends O{constructor(){super(),Object.defineProperty(this,"message",{value:I.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${T}]`,this.stack,delete this.name}get code(){return T}set code(H){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:H,writable:!0})}toString(){return`${this.name} [${T}]: ${this.message}`}}}K("ERR_BUFFER_OUT_OF_BOUNDS",function(T){return T?`${T} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),K("ERR_INVALID_ARG_TYPE",function(T,I){return`The "${T}" argument must be of type number. Received type ${typeof I}`},TypeError),K("ERR_OUT_OF_RANGE",function(T,I,O){let q=`The value of "${T}" is out of range.`,H=O;return Number.isInteger(O)&&Math.abs(O)>2**32?H=le(String(O)):typeof O=="bigint"&&(H=String(O),(O>BigInt(2)**BigInt(32)||O<-(BigInt(2)**BigInt(32)))&&(H=le(H)),H+="n"),q+=` It must be ${I}. Received ${H}`,q},RangeError);function le(T){let I="",O=T.length,q=T[0]==="-"?1:0;for(;O>=q+4;O-=3)I=`_${T.slice(O-3,O)}${I}`;return`${T.slice(0,O)}${I}`}function te(T,I,O){J(I,"offset"),(T[I]===void 0||T[I+O]===void 0)&&X(I,T.length-(O+1))}function j(T,I,O,q,H,W){if(T>O||T<I){let fe=typeof I=="bigint"?"n":"",st;throw W>3?I===0||I===BigInt(0)?st=`>= 0${fe} and < 2${fe} ** ${(W+1)*8}${fe}`:st=`>= -(2${fe} ** ${(W+1)*8-1}${fe}) and < 2 ** ${(W+1)*8-1}${fe}`:st=`>= ${I}${fe} and <= ${O}${fe}`,new Z.ERR_OUT_OF_RANGE("value",st,T)}te(q,H,W)}function J(T,I){if(typeof T!="number")throw new Z.ERR_INVALID_ARG_TYPE(I,"number",T)}function X(T,I,O){throw Math.floor(T)!==T?(J(T,O),new Z.ERR_OUT_OF_RANGE(O||"offset","an integer",T)):I<0?new Z.ERR_BUFFER_OUT_OF_BOUNDS:new Z.ERR_OUT_OF_RANGE(O||"offset",`>= ${O?1:0} and <= ${I}`,T)}var he=/[^+/0-9A-Za-z-_]/g;function Te(T){if(T=T.split("=")[0],T=T.trim().replace(he,""),T.length<2)return"";for(;T.length%4!==0;)T=T+"=";return T}function oe(T,I){I=I||1/0;let O,q=T.length,H=null,W=[];for(let fe=0;fe<q;++fe){if(O=T.charCodeAt(fe),O>55295&&O<57344){if(!H){if(O>56319){(I-=3)>-1&&W.push(239,191,189);continue}else if(fe+1===q){(I-=3)>-1&&W.push(239,191,189);continue}H=O;continue}if(O<56320){(I-=3)>-1&&W.push(239,191,189),H=O;continue}O=(H-55296<<10|O-56320)+65536}else H&&(I-=3)>-1&&W.push(239,191,189);if(H=null,O<128){if((I-=1)<0)break;W.push(O)}else if(O<2048){if((I-=2)<0)break;W.push(O>>6|192,O&63|128)}else if(O<65536){if((I-=3)<0)break;W.push(O>>12|224,O>>6&63|128,O&63|128)}else if(O<1114112){if((I-=4)<0)break;W.push(O>>18|240,O>>12&63|128,O>>6&63|128,O&63|128)}else throw new Error("Invalid code point")}return W}function ce(T){let I=[];for(let O=0;O<T.length;++O)I.push(T.charCodeAt(O)&255);return I}function ot(T,I){let O,q,H,W=[];for(let fe=0;fe<T.length&&!((I-=2)<0);++fe)O=T.charCodeAt(fe),q=O>>8,H=O%256,W.push(H),W.push(q);return W}function ge(T){return e.toByteArray(Te(T))}function Se(T,I,O,q){let H;for(H=0;H<q&&!(H+O>=I.length||H>=T.length);++H)I[H+O]=T[H];return H}function ut(T,I){return T instanceof I||T!=null&&T.constructor!=null&&T.constructor.name!=null&&T.constructor.name===I.name}function Ze(T){return T!==T}var Ge=function(){let T="0123456789abcdef",I=new Array(256);for(let O=0;O<16;++O){let q=O*16;for(let H=0;H<16;++H)I[q+H]=T[O]+T[H]}return I}();function lt(T){return typeof BigInt>"u"?z:T}function z(){throw new Error("BigInt not supported")}}}),xBe={"@@functional/placeholder":!0};function Yi(t){return t===xBe}function Fa(t){return function e(r){return arguments.length===0||Yi(r)?e:t.apply(this,arguments)}}function Fn(t){return function e(r,a){switch(arguments.length){case 0:return e;case 1:return Yi(r)?e:Fa(function(i){return t(r,i)});default:return Yi(r)&&Yi(a)?e:Yi(r)?Fa(function(i){return t(i,a)}):Yi(a)?Fa(function(i){return t(r,i)}):t(r,a)}}}function Sw(t,e){switch(t){case 0:return function(){return e.apply(this,arguments)};case 1:return function(r){return e.apply(this,arguments)};case 2:return function(r,a){return e.apply(this,arguments)};case 3:return function(r,a,i){return e.apply(this,arguments)};case 4:return function(r,a,i,h){return e.apply(this,arguments)};case 5:return function(r,a,i,h,l){return e.apply(this,arguments)};case 6:return function(r,a,i,h,l,p){return e.apply(this,arguments)};case 7:return function(r,a,i,h,l,p,b){return e.apply(this,arguments)};case 8:return function(r,a,i,h,l,p,b,g){return e.apply(this,arguments)};case 9:return function(r,a,i,h,l,p,b,g,y){return e.apply(this,arguments)};case 10:return function(r,a,i,h,l,p,b,g,y,M){return e.apply(this,arguments)};default:throw new Error("First argument to _arity must be a non-negative integer no greater than ten")}}function doe(t,e,r){return function(){for(var a=[],i=0,h=t,l=0,p=!1;l<e.length||i<arguments.length;){var b;l<e.length&&(!Yi(e[l])||i>=arguments.length)?b=e[l]:(b=arguments[i],i+=1),a[l]=b,Yi(b)?p=!0:h-=1,l+=1}return!p&&h<=0?r.apply(this,a):Sw(Math.max(0,h),doe(t,a,r))}}var SBe=Fn(function(t,e){return t===1?Fa(e):Sw(t,doe(t,[],e))}),poe=SBe;function hB(t){return function e(r,a,i){switch(arguments.length){case 0:return e;case 1:return Yi(r)?e:Fn(function(h,l){return t(r,h,l)});case 2:return Yi(r)&&Yi(a)?e:Yi(r)?Fn(function(h,l){return t(h,a,l)}):Yi(a)?Fn(function(h,l){return t(r,h,l)}):Fa(function(h){return t(r,a,h)});default:return Yi(r)&&Yi(a)&&Yi(i)?e:Yi(r)&&Yi(a)?Fn(function(h,l){return t(h,l,i)}):Yi(r)&&Yi(i)?Fn(function(h,l){return t(h,a,l)}):Yi(a)&&Yi(i)?Fn(function(h,l){return t(r,h,l)}):Yi(r)?Fa(function(h){return t(h,a,i)}):Yi(a)?Fa(function(h){return t(r,h,i)}):Yi(i)?Fa(function(h){return t(r,a,h)}):t(r,a,i)}}}var lB=Array.isArray||function(t){return t!=null&&t.length>=0&&Object.prototype.toString.call(t)==="[object Array]"};function EBe(t){return t!=null&&typeof t["@@transducer/step"]=="function"}function cB(t,e,r){return function(){if(arguments.length===0)return r();var a=arguments[arguments.length-1];if(!lB(a)){for(var i=0;i<t.length;){if(typeof a[t[i]]=="function")return a[t[i]].apply(a,Array.prototype.slice.call(arguments,0,-1));i+=1}if(EBe(a)){var h=e.apply(null,Array.prototype.slice.call(arguments,0,-1));return h(a)}}return r.apply(this,arguments)}}function ABe(t){return t&&t["@@transducer/reduced"]?t:{"@@transducer/value":t,"@@transducer/reduced":!0}}var B2={init:function(){return this.xf["@@transducer/init"]()},result:function(t){return this.xf["@@transducer/result"](t)}};function qae(t){for(var e=[],r;!(r=t.next()).done;)e.push(r.value);return e}function Uae(t,e,r){for(var a=0,i=r.length;a<i;){if(t(e,r[a]))return!0;a+=1}return!1}function RBe(t){var e=String(t).match(/^function (\w*)/);return e==null?"":e[1]}function ew(t,e){return Object.prototype.hasOwnProperty.call(e,t)}function TBe(t,e){return t===e?t!==0||1/t===1/e:t!==t&&e!==e}var AI=typeof Object.is=="function"?Object.is:TBe,Fae=Object.prototype.toString,kBe=function(){return Fae.call(arguments)==="[object Arguments]"?function(t){return Fae.call(t)==="[object Arguments]"}:function(t){return ew("callee",t)}}(),IBe=kBe,BBe=!{toString:null}.propertyIsEnumerable("toString"),jae=["constructor","valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],zae=function(){"use strict";return arguments.propertyIsEnumerable("length")}(),PBe=function(t,e){for(var r=0;r<t.length;){if(t[r]===e)return!0;r+=1}return!1},OBe=Fa(typeof Object.keys=="function"&&!zae?function(t){return Object(t)!==t?[]:Object.keys(t)}:function(t){if(Object(t)!==t)return[];var e,r,a=[],i=zae&&IBe(t);for(e in t)ew(e,t)&&(!i||e!=="length")&&(a[a.length]=e);if(BBe)for(r=jae.length-1;r>=0;)e=jae[r],ew(e,t)&&!PBe(a,e)&&(a[a.length]=e),r-=1;return a}),ev=OBe,NBe=Fa(function(t){return t===null?"Null":t===void 0?"Undefined":Object.prototype.toString.call(t).slice(8,-1)}),Zae=NBe;function Hae(t,e,r,a){var i=qae(t),h=qae(e);function l(p,b){return dB(p,b,r.slice(),a.slice())}return!Uae(function(p,b){return!Uae(l,b,p)},h,i)}function dB(t,e,r,a){if(AI(t,e))return!0;var i=Zae(t);if(i!==Zae(e))return!1;if(typeof t["fantasy-land/equals"]=="function"||typeof e["fantasy-land/equals"]=="function")return typeof t["fantasy-land/equals"]=="function"&&t["fantasy-land/equals"](e)&&typeof e["fantasy-land/equals"]=="function"&&e["fantasy-land/equals"](t);if(typeof t.equals=="function"||typeof e.equals=="function")return typeof t.equals=="function"&&t.equals(e)&&typeof e.equals=="function"&&e.equals(t);switch(i){case"Arguments":case"Array":case"Object":if(typeof t.constructor=="function"&&RBe(t.constructor)==="Promise")return t===e;break;case"Boolean":case"Number":case"String":if(!(typeof t==typeof e&&AI(t.valueOf(),e.valueOf())))return!1;break;case"Date":if(!AI(t.valueOf(),e.valueOf()))return!1;break;case"Error":return t.name===e.name&&t.message===e.message;case"RegExp":if(!(t.source===e.source&&t.global===e.global&&t.ignoreCase===e.ignoreCase&&t.multiline===e.multiline&&t.sticky===e.sticky&&t.unicode===e.unicode))return!1;break}for(var h=r.length-1;h>=0;){if(r[h]===t)return a[h]===e;h-=1}switch(i){case"Map":return t.size!==e.size?!1:Hae(t.entries(),e.entries(),r.concat([t]),a.concat([e]));case"Set":return t.size!==e.size?!1:Hae(t.values(),e.values(),r.concat([t]),a.concat([e]));case"Arguments":case"Array":case"Object":case"Boolean":case"Number":case"String":case"Date":case"Error":case"RegExp":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"ArrayBuffer":break;default:return!1}var l=ev(t);if(l.length!==ev(e).length)return!1;var p=r.concat([t]),b=a.concat([e]);for(h=l.length-1;h>=0;){var g=l[h];if(!(ew(g,e)&&dB(e[g],t[g],p,b)))return!1;h-=1}return!0}var CBe=Fn(function(t,e){return dB(t,e,[],[])}),voe=CBe;function LBe(t,e,r){var a,i;if(typeof t.indexOf=="function")switch(typeof e){case"number":if(e===0){for(a=1/e;r<t.length;){if(i=t[r],i===0&&1/i===a)return r;r+=1}return-1}else if(e!==e){for(;r<t.length;){if(i=t[r],typeof i=="number"&&i!==i)return r;r+=1}return-1}return t.indexOf(e,r);case"string":case"boolean":case"function":case"undefined":return t.indexOf(e,r);case"object":if(e===null)return t.indexOf(e,r)}for(;r<t.length;){if(voe(t[r],e))return r;r+=1}return-1}function DBe(t,e){return LBe(e,t,0)>=0}function k2(t,e){for(var r=0,a=e.length,i=Array(a);r<a;)i[r]=t(e[r]),r+=1;return i}function RI(t){var e=t.replace(/\\/g,"\\\\").replace(/[\b]/g,"\\b").replace(/\f/g,"\\f").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/\v/g,"\\v").replace(/\0/g,"\\0");return'"'+e.replace(/"/g,'\\"')+'"'}var b2=function(t){return(t<10?"0":"")+t},$Be=typeof Date.prototype.toISOString=="function"?function(t){return t.toISOString()}:function(t){return t.getUTCFullYear()+"-"+b2(t.getUTCMonth()+1)+"-"+b2(t.getUTCDate())+"T"+b2(t.getUTCHours())+":"+b2(t.getUTCMinutes())+":"+b2(t.getUTCSeconds())+"."+(t.getUTCMilliseconds()/1e3).toFixed(3).slice(2,5)+"Z"},qBe=$Be;function UBe(t){return function(){return!t.apply(this,arguments)}}function moe(t,e,r){for(var a=0,i=r.length;a<i;)e=t(e,r[a]),a+=1;return e}function FBe(t,e){for(var r=0,a=e.length,i=[];r<a;)t(e[r])&&(i[i.length]=e[r]),r+=1;return i}function jBe(t){return Object.prototype.toString.call(t)==="[object Object]"}var zBe=function(){function t(e,r){this.xf=r,this.f=e}return t.prototype["@@transducer/init"]=B2.init,t.prototype["@@transducer/result"]=B2.result,t.prototype["@@transducer/step"]=function(e,r){return this.f(r)?this.xf["@@transducer/step"](e,r):e},t}();function ZBe(t){return function(e){return new zBe(t,e)}}var HBe=Fn(cB(["fantasy-land/filter","filter"],ZBe,function(t,e){return jBe(e)?moe(function(r,a){return t(e[a])&&(r[a]=e[a]),r},{},ev(e)):FBe(t,e)})),KBe=HBe,WBe=Fn(function(t,e){return KBe(UBe(t),e)}),VBe=WBe;function goe(t,e){var r=function(h){var l=e.concat([t]);return DBe(h,l)?"<Circular>":goe(h,l)},a=function(h,l){return k2(function(p){return RI(p)+": "+r(h[p])},l.slice().sort())};switch(Object.prototype.toString.call(t)){case"[object Arguments]":return"(function() { return arguments; }("+k2(r,t).join(", ")+"))";case"[object Array]":return"["+k2(r,t).concat(a(t,VBe(function(h){return/^\d+$/.test(h)},ev(t)))).join(", ")+"]";case"[object Boolean]":return typeof t=="object"?"new Boolean("+r(t.valueOf())+")":t.toString();case"[object Date]":return"new Date("+(isNaN(t.valueOf())?r(NaN):RI(qBe(t)))+")";case"[object Map]":return"new Map("+r(Array.from(t))+")";case"[object Null]":return"null";case"[object Number]":return typeof t=="object"?"new Number("+r(t.valueOf())+")":1/t===-1/0?"-0":t.toString(10);case"[object Set]":return"new Set("+r(Array.from(t).sort())+")";case"[object String]":return typeof t=="object"?"new String("+r(t.valueOf())+")":RI(t);case"[object Undefined]":return"undefined";default:if(typeof t.toString=="function"){var i=t.toString();if(i!=="[object Object]")return i}return"{"+a(t,ev(t)).join(", ")+"}"}}var GBe=Fa(function(t){return goe(t,[])}),Kae=GBe,YBe=Fn(function(t,e){if(t===e)return e;function r(p,b){if(p>b!=b>p)return b>p?b:p}var a=r(t,e);if(a!==void 0)return a;var i=r(typeof t,typeof e);if(i!==void 0)return i===typeof t?t:e;var h=Kae(t),l=r(h,Kae(e));return l!==void 0&&l===h?t:e}),JBe=YBe,XBe=function(){function t(e,r){this.xf=r,this.f=e}return t.prototype["@@transducer/init"]=B2.init,t.prototype["@@transducer/result"]=B2.result,t.prototype["@@transducer/step"]=function(e,r){return this.xf["@@transducer/step"](e,this.f(r))},t}(),QBe=function(t){return function(e){return new XBe(t,e)}},ePe=QBe,tPe=Fn(cB(["fantasy-land/map","map"],ePe,function(t,e){switch(Object.prototype.toString.call(e)){case"[object Function]":return poe(e.length,function(){return t.call(this,e.apply(this,arguments))});case"[object Object]":return moe(function(r,a){return r[a]=t(e[a]),r},{},ev(e));default:return k2(t,e)}})),rPe=tPe,boe=Number.isInteger||function(t){return t<<0===t};function yoe(t){return Object.prototype.toString.call(t)==="[object String]"}function woe(t,e){var r=t<0?e.length+t:t;return yoe(e)?e.charAt(r):e[r]}var iPe=Fn(function(t,e){if(e!=null)return boe(t)?woe(t,e):e[t]}),Ew=iPe,nPe=Fn(function(t,e){return rPe(Ew(t),e)}),aPe=nPe,oPe=Fa(function(t){return lB(t)?!0:!t||typeof t!="object"||yoe(t)?!1:t.length===0?!0:t.length>0?t.hasOwnProperty(0)&&t.hasOwnProperty(t.length-1):!1}),sPe=oPe,Wae=typeof Symbol<"u"?Symbol.iterator:"@@iterator";function fPe(t,e,r){return function(a,i,h){if(sPe(h))return t(a,i,h);if(h==null)return i;if(typeof h["fantasy-land/reduce"]=="function")return e(a,i,h,"fantasy-land/reduce");if(h[Wae]!=null)return r(a,i,h[Wae]());if(typeof h.next=="function")return r(a,i,h);if(typeof h.reduce=="function")return e(a,i,h,"reduce");throw new TypeError("reduce: list must be array or iterable")}}function uPe(t,e,r){for(var a=0,i=r.length;a<i;){if(e=t["@@transducer/step"](e,r[a]),e&&e["@@transducer/reduced"]){e=e["@@transducer/value"];break}a+=1}return t["@@transducer/result"](e)}var hPe=Fn(function(t,e){return Sw(t.length,function(){return t.apply(e,arguments)})}),lPe=hPe;function cPe(t,e,r){for(var a=r.next();!a.done;){if(e=t["@@transducer/step"](e,a.value),e&&e["@@transducer/reduced"]){e=e["@@transducer/value"];break}a=r.next()}return t["@@transducer/result"](e)}function dPe(t,e,r,a){return t["@@transducer/result"](r[a](lPe(t["@@transducer/step"],t),e))}var pPe=fPe(uPe,dPe,cPe),vPe=pPe,mPe=function(){function t(e){this.f=e}return t.prototype["@@transducer/init"]=function(){throw new Error("init not implemented on XWrap")},t.prototype["@@transducer/result"]=function(e){return e},t.prototype["@@transducer/step"]=function(e,r){return this.f(e,r)},t}();function gPe(t){return new mPe(t)}var bPe=hB(function(t,e,r){return vPe(typeof t=="function"?gPe(t):t,e,r)}),_oe=bPe;function yPe(t,e){return function(){return e.call(this,t.apply(this,arguments))}}function Moe(t,e){return function(){var r=arguments.length;if(r===0)return e();var a=arguments[r-1];return lB(a)||typeof a[t]!="function"?e.apply(this,arguments):a[t].apply(a,Array.prototype.slice.call(arguments,0,r-1))}}var wPe=hB(Moe("slice",function(t,e,r){return Array.prototype.slice.call(r,t,e)})),_Pe=wPe,MPe=Fa(Moe("tail",_Pe(1,1/0))),xPe=MPe;function xoe(){if(arguments.length===0)throw new Error("pipe requires at least one argument");return Sw(arguments[0].length,_oe(yPe,arguments[0],xPe(arguments)))}var SPe=Fn(function(t,e){return poe(_oe(JBe,0,aPe("length",e)),function(){var r=arguments,a=this;return t.apply(a,k2(function(i){return i.apply(a,r)},e))})}),EPe=SPe,APe=Fn(function(t,e){return e==null||e!==e?t:e}),CI=APe,RPe=function(){function t(e,r){this.xf=r,this.f=e,this.found=!1}return t.prototype["@@transducer/init"]=B2.init,t.prototype["@@transducer/result"]=function(e){return this.found||(e=this.xf["@@transducer/step"](e,void 0)),this.xf["@@transducer/result"](e)},t.prototype["@@transducer/step"]=function(e,r){return this.f(r)&&(this.found=!0,e=ABe(this.xf["@@transducer/step"](e,r))),e},t}();function TPe(t){return function(e){return new RPe(t,e)}}var kPe=Fn(cB(["find"],TPe,function(t,e){for(var r=0,a=e.length;r<a;){if(t(e[r]))return e[r];r+=1}})),IPe=kPe,BPe=Fa(function(t){return EPe(function(){return Array.prototype.slice.call(arguments,0)},t)}),PPe=BPe;function OPe(t,e){for(var r=e,a=0;a<t.length;a+=1){if(r==null)return;var i=t[a];boe(i)?r=woe(i,r):r=r[i]}return r}var NPe=Fn(OPe),Soe=NPe,CPe=hB(function(t,e,r){return voe(t,Ew(e,r))}),LPe=CPe,tw=class extends Error{name="InvalidSchedulerLocation"},DPe=class extends Error{name="SchedulerTagNotFound"},$Pe=class extends Error{name="TransactionNotFound"},qPe="Url",UPe="Time-To-Live",FPe="Scheduler",LI=t=>xoe(CI([]),IPe(LPe(t,"name")),CI({}),Ew("value")),Eoe=t=>xoe(e=>{if(!e)throw new $Pe(t);return e},Ew("tags"),CI([]));function Aoe({fetch:t,GRAPHQL_URL:e}){return async({query:r,variables:a})=>t(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:r,variables:a})}).then(i=>i.json())}function jPe({fetch:t,GRAPHQL_URL:e}){let r=Aoe({fetch:t,GRAPHQL_URL:e}),a=Roe({fetch:t,GRAPHQL_URL:e}),i=`
132
+ nonce: bundlr`),Me.from(i))}};ie();ae();ne();var Q0=class{_publicKey;ownerLength=Wr[wr.MULTIAPTOS].pubLength;signatureLength=Wr[wr.MULTIAPTOS].sigLength;signatureType=wr.MULTIAPTOS;collectSignatures;provider;constructor(e,r){this._publicKey=e,this.collectSignatures=r}get publicKey(){return this._publicKey}async sign(e){let{signatures:r,bitmap:a}=await this.collectSignatures(e),i=128,h=new Uint8Array([0,0,0,0]),l=new Set;a.forEach(g=>{if(g>=32)throw new Error(`Invalid bit value ${g}.`);if(l.has(g))throw new Error("Duplicated bits detected.");l.add(g);let y=Math.floor(g/8),M=h[y];M|=i>>g%8,h[y]=M});let p=Me.alloc(this.signatureLength),b=0;for(let g=0;g<32;g++)a.includes(g)&&p.set(r[b++],g*64);return p.set(h,this.signatureLength-4),p}static async verify(e,r,a){let h=Wr[wr.MULTIAPTOS].sigLength-4,l=a.slice(0,h),p=a.slice(h),b=!1;for(let g=0;g<32;g++){let y=Math.floor(g/8),M=g-y*8;if((p[y]&128>>M)!==0){let E=l.slice(g*64,(g+1)*64),A=e.slice(g*32,(g+1)*32);await ql(Me.from(E),Me.from(r),Me.from(A))||(b=!0)}}return!b}};ie();ae();ne();var ed=class extends Io{ownerLength=Wr[wr.TYPEDETHEREUM].pubLength;signatureLength=Wr[wr.TYPEDETHEREUM].sigLength;signatureType=wr.TYPEDETHEREUM;address;signer;constructor(e){super(e),this.address="0x"+cg(super.publicKey.slice(1)).slice(-20).toString("hex"),this.signer=new r1(e)}get publicKey(){return Me.from(this.address)}async sign(e){let r=await this.signer._signTypedData(bg,yg,{address:this.address,"Transaction hash":e});return Me.from(r.slice(2),"hex")}static async verify(e,r,a){let i=e.toString(),h=Z3(bg,yg,{address:i,"Transaction hash":r},a);return i.toLowerCase()===h.toLowerCase()}},bg={name:"Bundlr",version:"1"},yg={Bundlr:[{name:"Transaction hash",type:"bytes"},{name:"address",type:"address"}]};ie();ae();ne();var rT=class{ownerLength=Wr[wr.TYPEDETHEREUM].pubLength;signatureLength=Wr[wr.TYPEDETHEREUM].sigLength;signatureType=wr.TYPEDETHEREUM;address;signer;publicKey;constructor(e){this.signer=e.getSigner()}async ready(){this.address=(await this.signer.getAddress()).toString().toLowerCase(),this.publicKey=Me.from(this.address)}async sign(e){let r=await this.signer._signTypedData(bg,yg,{address:this.address,"Transaction hash":e});return Me.from(r.slice(2),"hex")}static verify(e,r,a){let i=e.toString(),h=Z3(bg,yg,{address:i,"Transaction hash":r},a);return i.toLowerCase()===h.toLowerCase()}};ie();ae();ne();var $X=gi(qo(),1);var v1=class{signer;publicKey;ownerLength=Wr[wr.ARWEAVE].pubLength;signatureLength=Wr[wr.ARWEAVE].sigLength;signatureType=wr.ARWEAVE;constructor(e){this.signer=e}async setPublicKey(){let e=await this.signer.getActivePublicKey();this.publicKey=$X.default.toBuffer(e)}async sign(e){this.publicKey||await this.setPublicKey();let r={name:"RSA-PSS",saltLength:32},a=await this.signer.signature(e,r);return new Uint8Array(Object.values(a).map(h=>+h))}static async verify(e,r,a){return await xn().verify(e,r,a)}};ie();ae();ne();var wg=class extends Io{signatureType=wr.KYVE};var _g={1:Hl,2:xo,3:Io,4:J0,5:X0,6:Q0,7:ed};ie();ae();ne();ie();ae();ne();async function H4e(t){return Ul([(0,Pi.stringToBuffer)("dataitem"),(0,Pi.stringToBuffer)("1"),(0,Pi.stringToBuffer)(t.signatureType.toString()),t.rawOwner,t.rawTarget,t.rawAnchor,t.rawTags,t.rawData])}var Mg=H4e;ie();ae();ne();ie();ae();ne();function xg(t,e){let r=new Uint8Array(t);if(e<0)throw new Error("Array is unsigned, cannot represent -ve numbers");if(e>2**(t*8)-1)throw new Error(`Number ${e} is too large for an array of ${t} bytes`);for(let a=0;a<r.length;a++){let i=e&255;r[a]=i,e=(e-i)/256}return r}function x8(t){return xg(8,t)}function iT(t){return xg(2,t)}function K4e(t){return xg(16,t)}function S8(t){return xg(32,t)}function yn(t){let e=0;for(let r=t.length-1;r>=0;r--)e=e*256+t[r];return e}ie();ae();ne();var Eg=gi(qo(),1);ie();ae();ne();var Is=gi(qo(),1);lo();ie();ae();ne();var Sg=class{buf;pos;constructor(e=Me.alloc(E8),r=0){this.buf=e,this.pos=r}writeTags(e){if(!Array.isArray(e))throw new Error("input must be array");let r=e.length,a;if(r)for(this.writeLong(r),a=0;a<r;a++){let i=e[a];if(typeof i?.name!="string"||typeof i?.value!="string")throw new Error(`Invalid tag format for ${i}, expected {name:string, value: string}`);this.writeString(i.name),this.writeString(i.value)}this.writeLong(0)}toBuffer(){let e=Me.alloc(this.pos);if(this.pos>this.buf.length)throw new Error(`Too many tag bytes (${this.pos} > ${this.buf.length})`);return this.buf.copy(e,0,0,this.pos),e}writeLong(e){let r=this.buf,a,i;if(e>=-1073741824&&e<1073741824){i=e>=0?e<<1:~e<<1|1;do r[this.pos]=i&127,i>>=7;while(i&&(r[this.pos++]|=128))}else{a=e>=0?e*2:-e*2-1;do r[this.pos]=a&127,a/=128;while(a>=1&&(r[this.pos++]|=128))}this.pos++,this.buf=r}writeString(e){let r=Me.byteLength(e),a=this.buf;this.writeLong(r);let i=this.pos;if(this.pos+=r,!(this.pos>a.length)){if(r>64)this.buf.write(e,this.pos-r,r,"utf8");else{let h,l,p,b;for(h=0,l=r;h<l;h++)p=e.charCodeAt(h),p<128?a[i++]=p:p<2048?(a[i++]=p>>6|192,a[i++]=p&63|128):(p&64512)===55296&&((b=e.charCodeAt(h+1))&64512)===56320?(p=65536+((p&1023)<<10)+(b&1023),h++,a[i++]=p>>18|240,a[i++]=p>>12&63|128,a[i++]=p>>6&63|128,a[i++]=p&63|128):(a[i++]=p>>12|224,a[i++]=p>>6&63|128,a[i++]=p&63|128)}this.buf=a}}readLong(){let e=0,r=0,a=this.buf,i,h,l,p;do i=a[this.pos++],h=i&128,e|=(i&127)<<r,r+=7;while(h&&r<28);if(h){l=e,p=268435456;do i=a[this.pos++],l+=(i&127)*p,p*=128;while(i&128);return(l%2?-(l+1):l)/2}return e>>1^-(e&1)}skipLong(){let e=this.buf;for(;e[this.pos++]&128;);}readTags(){let e=[],r;for(;r=this.readLong();)for(r<0&&(r=-r,this.skipLong());r--;){let a=this.readString(),i=this.readString();e.push({name:a,value:i})}return e}readString(){let e=this.readLong(),r=this.pos,a=this.buf;if(this.pos+=e,this.pos>a.length)throw new Error("TAP Position out of range");return this.buf.slice(r,r+e).toString()}};function nT(t){if(t?.length===0)return Me.allocUnsafe(0);let e=new Sg;return e.writeTags(t),e.toBuffer()}function m1(t){return new Sg(t).readTags()}du();var R8=80,E8=4096,A8=class t{binary;_id;constructor(e){this.binary=e}static isDataItem(e){return e.binary!==void 0}get signatureType(){let e=yn(this.binary.subarray(0,2));if(wr?.[e]!==void 0)return e;throw new Error("Unknown signature type: "+e)}async isValid(){return t.verify(this.binary)}get id(){return Is.default.encode(this.rawId)}set id(e){this._id=Is.default.toBuffer(e)}get rawId(){return pf("sha256").update(this.rawSignature).digest()}set rawId(e){this._id=e}get rawSignature(){return this.binary.subarray(2,2+this.signatureLength)}get signature(){return Is.default.encode(this.rawSignature)}set rawOwner(e){if(e.byteLength!=this.ownerLength)throw new Error(`Expected raw owner (pubkey) to be ${this.ownerLength} bytes, got ${e.byteLength} bytes.`);this.binary.set(e,2+this.signatureLength)}get rawOwner(){return this.binary.subarray(2+this.signatureLength,2+this.signatureLength+this.ownerLength)}get signatureLength(){return Wr[this.signatureType].sigLength}get owner(){return Is.default.encode(this.rawOwner)}get ownerLength(){return Wr[this.signatureType].pubLength}get rawTarget(){let e=this.getTargetStart();return this.binary[e]==1?this.binary.subarray(e+1,e+33):Me.alloc(0)}get target(){return Is.default.encode(this.rawTarget)}get rawAnchor(){let e=this.getAnchorStart();return this.binary[e]==1?this.binary.subarray(e+1,e+33):Me.alloc(0)}get anchor(){return Is.default.encode(this.rawAnchor)}get rawTags(){let e=this.getTagsStart(),r=yn(this.binary.subarray(e+8,e+16));return this.binary.subarray(e+16,e+16+r)}get tags(){let e=this.getTagsStart();if(yn(this.binary.subarray(e,e+8))==0)return[];let a=yn(this.binary.subarray(e+8,e+16));return m1(Me.from(this.binary.subarray(e+16,e+16+a)))}get tagsB64Url(){return this.tags.map(r=>({name:Is.default.encode(r.name),value:Is.default.encode(r.value)}))}getStartOfData(){let e=this.getTagsStart(),r=this.binary.subarray(e+8,e+16),a=yn(r);return e+16+a}get rawData(){let e=this.getTagsStart(),r=this.binary.subarray(e+8,e+16),a=yn(r),i=e+16+a;return this.binary.subarray(i,this.binary.length)}get data(){return Is.default.encode(this.rawData)}getRaw(){return this.binary}async sign(e){return this._id=await T8(this,e),this.rawId}async setSignature(e){this.binary.set(e,2),this._id=Me.from(await xn().hash(e))}isSigned(){return(this._id?.length??0)>0}toJSON(){return{signature:this.signature,owner:this.owner,target:this.target,tags:this.tags.map(e=>({name:Is.default.encode(e.name),value:Is.default.encode(e.value)})),data:this.data}}static async verify(e){if(e.byteLength<R8)return!1;let r=new t(e),a=r.signatureType,i=r.getTagsStart(),h=yn(e.subarray(i,i+8)),l=e.subarray(i+8,i+16),p=yn(l);if(p>E8)return!1;if(h>0)try{if(m1(Me.from(e.subarray(i+16,i+16+p))).length!==h)return!1}catch{return!1}let b=_g[a],g=await Mg(r);return await b.verify(r.rawOwner,g,r.rawSignature)}async getSignatureData(){return Mg(this)}getTagsStart(){let e=this.getTargetStart(),r=this.binary[e]==1,a=e+(r?33:1),i=this.binary[a]==1;return a+=i?33:1,a}getTargetStart(){return 2+this.signatureLength+this.ownerLength}getAnchorStart(){let e=this.getTargetStart()+1,r=this.binary[this.getTargetStart()]==1;return e+=r?32:0,e}},g1=A8;du();var Bu=32,k8=class{length;items;binary;constructor(e){this.binary=e,this.length=this.getDataItemCount(),this.items=this.getItems()}getRaw(){return this.binary}get(e){if(typeof e=="number"){if(e>=this.length)throw new RangeError("Index out of range");return this.getByIndex(e)}else return this.getById(e)}getSizes(){let e=[];for(let r=Bu;r<Bu+64*this.length;r+=64)e.push(yn(this.binary.subarray(r,r+32)));return e}getIds(){let e=[];for(let r=Bu;r<Bu+64*this.length;r+=64){let a=this.binary.subarray(r+32,r+64);if(a.length===0)throw new Error("Invalid bundle, id specified in headers doesn't exist");e.push(Eg.default.encode(a))}return e}getIdBy(e){if(e>this.length-1)throw new RangeError("Index of bundle out of range");let r=64+64*e;return Eg.default.encode(this.binary.subarray(r,r+32))}async toTransaction(e,r,a){let i=await r.createTransaction({data:this.binary,...e},a);return i.addTag("Bundle-Format","binary"),i.addTag("Bundle-Version","2.0.0"),i}async verify(){for(let e of this.items){let r=await e.isValid(),a=(0,Eg.default)(pf("sha256").update(e.rawSignature).digest());if(!(r&&e.id===a))return!1}return!0}getOffset(e){let r=0;for(let a=Bu;a<Bu+64*this.length;a+=64){let i=yn(this.binary.subarray(a,a+32));r+=i;let h=this.binary.subarray(a+32,a+64);if(Me.compare(h,e)===0)return{startOffset:r,size:i}}return{startOffset:-1,size:-1}}getByIndex(e){let r=0,a=this.getBundleStart(),i=0,h,l;for(let y=Bu;y<Bu+64*this.length;y+=64){if(h=yn(this.binary.subarray(y,y+32)),i++===e){l=this.binary.subarray(y+32,y+64);break}r+=h}let p=a+r,b=this.binary.subarray(p,p+h),g=new g1(b);return g.rawId=l,g}getById(e){let r=Eg.default.toBuffer(e),a=this.getOffset(r);if(a.startOffset===-1)throw new Error("Transaction not found");let h=this.getBundleStart()+a.startOffset;return new g1(this.binary.subarray(h,h+a.size))}getDataItemCount(){return yn(this.binary.subarray(0,32))}getBundleStart(){return 32+64*this.length}getItems(){let e=new Array(this.length),r=0,a=this.getBundleStart(),i=0;for(let h=Bu;h<Bu+64*this.length;h+=64){let l=yn(this.binary.subarray(h,h+32)),p=this.binary.subarray(h+32,h+64);if(p.length===0)throw new Error("Invalid bundle, id specified in headers doesn't exist");let b=a+r,g=this.binary.subarray(b,b+l);r+=l;let y=new g1(g);y.rawId=p,e[i]=y,i++}return e}},aT=k8;function W4e(t){return new aT(t)}async function V4e(t,e){let r=new Uint8Array(64*t.length),a=await Promise.all(t.map(async(h,l)=>{let p=h.isSigned()?h.rawId:await T8(h,e),b=new Uint8Array(64);return b.set(S8(h.getRaw().byteLength),0),b.set(p,32),r.set(b,64*l),h.getRaw()})).then(h=>Me.concat(h)),i=Me.concat([Me.from(S8(t.length)),Me.from(r),a]);return new aT(i)}async function qX(t,e){let r=await Mg(t),a=await e.sign(r),i=await xn().hash(a);return{signature:Me.from(a),id:Me.from(i)}}async function T8(t,e){let{signature:r,id:a}=await qX(t,e);return t.getRaw().set(r,2),a}ie();ae();ne();var UX=gi(qo(),1);function Ag(t,e,r){let a=e.publicKey,i=r?.target?UX.default.toBuffer(r.target):null,h=1+(i?.byteLength??0),l=r?.anchor?Me.from(r.anchor):null,p=1+(l?.byteLength??0),b=(r?.tags?.length??0)>0?nT(r?.tags):null,g=16+(b?b.byteLength:0),y=typeof t=="string"?Me.from(t):Me.from(t),M=y.byteLength,x=2+e.signatureLength+e.ownerLength+h+p+g+M,E=Me.alloc(x);if(E.set(iT(e.signatureType),0),E.set(new Uint8Array(e.signatureLength).fill(0),2),a.byteLength!==e.ownerLength)throw new Error(`Owner must be ${e.ownerLength} bytes, but was incorrectly ${a.byteLength}`);E.set(a,2+e.signatureLength);let A=2+e.signatureLength+e.ownerLength;if(E[A]=i?1:0,i){if(i.byteLength!==32)throw new Error(`Target must be 32 bytes but was incorrectly ${i.byteLength}`);E.set(i,A+1)}let k=A+h,P=k+1;if(E[k]=l?1:0,l){if(P+=l.byteLength,l.byteLength!==32)throw new Error("Anchor must be 32 bytes");E.set(l,k+1)}E.set(x8(r?.tags?.length??0),P);let N=x8(b?.byteLength??0);E.set(N,P+8),b&&E.set(b,P+16);let L=P+g;return E.set(y,L),new g1(E)}ie();ae();ne();ie();ae();ne();var oT=class{signatureType;rawSignature;signature;signatureLength;rawOwner;owner;ownerLength;rawTarget;target;rawAnchor;anchor;rawTags;tags;rawData;data;static async verify(...e){throw new Error("You must implement `verify`")}};ie();ae();ne();ie();ae();ne();var hT={};Ha(hT,{default:()=>J4e,processStream:()=>HX,streamExportForTesting:()=>X4e,streamSigner:()=>Y4e});ie();ae();ne();I8();var td=gi(qo(),1);du();async function HX(t){let e=KX(t),r=(await e.next()).value;r=await La(e,r,32);let a=yn(r.subarray(0,32));r=r.subarray(32);let i=64*a;r=await La(e,r,i);let h=new Array(a);for(let b=0;b<i;b+=64)h[b/64]=[yn(r.subarray(b,b+32)),(0,td.default)(Me.from(r.subarray(b+32,b+64)))];r=r.subarray(i);let l=32+i,p=[];for(let[b,g]of h){r=await La(e,r,R8),r=await La(e,r,2);let y=yn(r.subarray(0,2));r=r.subarray(2);let{sigLength:M,pubLength:x,sigName:E}=Wr[y];r=await La(e,r,M);let A=r.subarray(0,M);r=r.subarray(M),r=await La(e,r,x);let k=r.subarray(0,x);r=r.subarray(x),r=await La(e,r,1);let P=r[0]===1;P&&(r=await La(e,r,33));let N=P?r.subarray(1,33):Me.allocUnsafe(0);r=r.subarray(P?33:1),r=await La(e,r,1);let L=r[0]===1;L&&(r=await La(e,r,33));let C=L?r.subarray(1,33):Me.allocUnsafe(0);r=r.subarray(L?33:1),r=await La(e,r,8);let Y=yn(r.subarray(0,8));r=r.subarray(8),r=await La(e,r,8);let G=yn(r.subarray(0,8));r=r.subarray(8),r=await La(e,r,G);let ee=r.subarray(0,G),D=Y!==0&&G!==0?m1(Me.from(ee)):[];if(D.length!==Y)throw new Error("Tags lengths don't match");r=r.subarray(G);let U=new zX;U._transform=function(f,u,c){this.push(f),c()};let V=Ul([(0,Pi.stringToBuffer)("dataitem"),(0,Pi.stringToBuffer)("1"),(0,Pi.stringToBuffer)(y.toString()),k,N,C,ee,U]),_=2+M+x+(P?33:1)+(L?33:1)+16+G,n=b-_;if(r.byteLength>n)U.write(r.subarray(0,n)),r=r.subarray(n);else{let f=r.byteLength;for(U.write(r);n>f;){if(r=(await e.next()).value,!r)throw new Error(`Not enough data bytes expected: ${n} received: ${f}`);f+=r.byteLength,f>n?U.write(r.subarray(0,r.byteLength-(f-n))):U.write(r)}r=r.subarray(r.byteLength-(f-n))}if(U.end(),g!==(0,td.default)(pf("sha256").update(A).digest()))throw new Error("ID doesn't match signature");if(!await _g[y].verify(k,await V,A))throw new Error("Invalid signature");p.push({id:g,sigName:E,signature:(0,td.default)(Me.from(A)),target:(0,td.default)(Me.from(N)),anchor:(0,td.default)(Me.from(C)),owner:(0,td.default)(Me.from(k)),tags:D,dataOffset:l+_,dataSize:n}),l+=_+n}return p}async function Y4e(t,e,r,a){let i=Ag("",r,a),h=new ZX,l=[(0,Pi.stringToBuffer)("dataitem"),(0,Pi.stringToBuffer)("1"),(0,Pi.stringToBuffer)(i.signatureType.toString()),i.rawOwner,i.rawTarget,i.rawAnchor,i.rawTags,t],p=await Ul(l),b=Me.from(await r.sign(p));return i.setSignature(b),h.write(i.getRaw()),e.pipe(h)}async function La(t,e,r){if(e.byteLength>=r)return e;let{done:a,value:i}=await t.next();if(a&&!i)throw new Error("Invalid buffer");return La(t,Me.concat([Me.from(e),Me.from(i)]),r)}async function*KX(t){for await(let e of t)yield e}var J4e=HX,X4e={readBytes:La,getReader:KX};var Q4e={...sT,stream:hT};globalThis.arbundles??=Q4e;ie();ae();ne();ie();ae();ne();ie();ae();ne();ie();ae();ne();var fi;(function(t){t.assertEqual=i=>i;function e(i){}t.assertIs=e;function r(i){throw new Error}t.assertNever=r,t.arrayToEnum=i=>{let h={};for(let l of i)h[l]=l;return h},t.getValidEnumValues=i=>{let h=t.objectKeys(i).filter(p=>typeof i[i[p]]!="number"),l={};for(let p of h)l[p]=i[p];return t.objectValues(l)},t.objectValues=i=>t.objectKeys(i).map(function(h){return i[h]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let h=[];for(let l in i)Object.prototype.hasOwnProperty.call(i,l)&&h.push(l);return h},t.find=(i,h)=>{for(let l of i)if(h(l))return l},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&isFinite(i)&&Math.floor(i)===i;function a(i,h=" | "){return i.map(l=>typeof l=="string"?`'${l}'`:l).join(h)}t.joinValues=a,t.jsonStringifyReplacer=(i,h)=>typeof h=="bigint"?h.toString():h})(fi||(fi={}));var cT;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(cT||(cT={}));var Yt=fi.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),lc=t=>{switch(typeof t){case"undefined":return Yt.undefined;case"string":return Yt.string;case"number":return isNaN(t)?Yt.nan:Yt.number;case"boolean":return Yt.boolean;case"function":return Yt.function;case"bigint":return Yt.bigint;case"symbol":return Yt.symbol;case"object":return Array.isArray(t)?Yt.array:t===null?Yt.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?Yt.promise:typeof Map<"u"&&t instanceof Map?Yt.map:typeof Set<"u"&&t instanceof Set?Yt.set:typeof Date<"u"&&t instanceof Date?Yt.date:Yt.object;default:return Yt.unknown}},Pt=fi.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),ewe=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),Bo=class t extends Error{constructor(e){super(),this.issues=[],this.addIssue=a=>{this.issues=[...this.issues,a]},this.addIssues=(a=[])=>{this.issues=[...this.issues,...a]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}get errors(){return this.issues}format(e){let r=e||function(h){return h.message},a={_errors:[]},i=h=>{for(let l of h.issues)if(l.code==="invalid_union")l.unionErrors.map(i);else if(l.code==="invalid_return_type")i(l.returnTypeError);else if(l.code==="invalid_arguments")i(l.argumentsError);else if(l.path.length===0)a._errors.push(r(l));else{let p=a,b=0;for(;b<l.path.length;){let g=l.path[b];b===l.path.length-1?(p[g]=p[g]||{_errors:[]},p[g]._errors.push(r(l))):p[g]=p[g]||{_errors:[]},p=p[g],b++}}};return i(this),a}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,fi.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r={},a=[];for(let i of this.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(e(i))):a.push(e(i));return{formErrors:a,fieldErrors:r}}get formErrors(){return this.flatten()}};Bo.create=t=>new Bo(t);var w1=(t,e)=>{let r;switch(t.code){case Pt.invalid_type:t.received===Yt.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case Pt.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,fi.jsonStringifyReplacer)}`;break;case Pt.unrecognized_keys:r=`Unrecognized key(s) in object: ${fi.joinValues(t.keys,", ")}`;break;case Pt.invalid_union:r="Invalid input";break;case Pt.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${fi.joinValues(t.options)}`;break;case Pt.invalid_enum_value:r=`Invalid enum value. Expected ${fi.joinValues(t.options)}, received '${t.received}'`;break;case Pt.invalid_arguments:r="Invalid function arguments";break;case Pt.invalid_return_type:r="Invalid function return type";break;case Pt.invalid_date:r="Invalid date";break;case Pt.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:fi.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case Pt.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case Pt.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case Pt.custom:r="Invalid input";break;case Pt.invalid_intersection_types:r="Intersection results could not be merged";break;case Pt.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case Pt.not_finite:r="Number must be finite";break;default:r=e.defaultError,fi.assertNever(t)}return{message:r}},GX=w1;function twe(t){GX=t}function B8(){return GX}var P8=t=>{let{data:e,path:r,errorMaps:a,issueData:i}=t,h=[...r,...i.path||[]],l={...i,path:h};if(i.message!==void 0)return{...i,path:h,message:i.message};let p="",b=a.filter(g=>!!g).slice().reverse();for(let g of b)p=g(l,{data:e,defaultError:p}).message;return{...i,path:h,message:p}},rwe=[];function Wt(t,e){let r=B8(),a=P8({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===w1?void 0:w1].filter(i=>!!i)});t.common.issues.push(a)}var Ia=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let a=[];for(let i of r){if(i.status==="aborted")return pr;i.status==="dirty"&&e.dirty(),a.push(i.value)}return{status:e.value,value:a}}static async mergeObjectAsync(e,r){let a=[];for(let i of r){let h=await i.key,l=await i.value;a.push({key:h,value:l})}return t.mergeObjectSync(e,a)}static mergeObjectSync(e,r){let a={};for(let i of r){let{key:h,value:l}=i;if(h.status==="aborted"||l.status==="aborted")return pr;h.status==="dirty"&&e.dirty(),l.status==="dirty"&&e.dirty(),h.value!=="__proto__"&&(typeof l.value<"u"||i.alwaysSet)&&(a[h.value]=l.value)}return{status:e.value,value:a}}},pr=Object.freeze({status:"aborted"}),y1=t=>({status:"dirty",value:t}),Da=t=>({status:"valid",value:t}),dT=t=>t.status==="aborted",pT=t=>t.status==="dirty",Ig=t=>t.status==="valid",Bg=t=>typeof Promise<"u"&&t instanceof Promise;function O8(t,e,r,a){if(r==="a"&&!a)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!a:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?a:r==="a"?a.call(t):a?a.value:e.get(t)}function YX(t,e,r,a,i){if(a==="m")throw new TypeError("Private method is not writable");if(a==="a"&&!i)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return a==="a"?i.call(t,r):i?i.value=r:e.set(t,r),r}var rr;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(rr||(rr={}));var Tg,kg,Ps=class{constructor(e,r,a,i){this._cachedPath=[],this.parent=e,this.data=r,this._path=a,this._key=i}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},WX=(t,e)=>{if(Ig(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new Bo(t.common.issues);return this._error=r,this._error}}};function Br(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:a,description:i}=t;if(e&&(r||a))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(l,p)=>{var b,g;let{message:y}=t;return l.code==="invalid_enum_value"?{message:y??p.defaultError}:typeof p.data>"u"?{message:(b=y??a)!==null&&b!==void 0?b:p.defaultError}:l.code!=="invalid_type"?{message:p.defaultError}:{message:(g=y??r)!==null&&g!==void 0?g:p.defaultError}},description:i}}var Pr=class{constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(e){return lc(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:lc(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Ia,ctx:{common:e.parent.common,data:e.data,parsedType:lc(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(Bg(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let a=this.safeParse(e,r);if(a.success)return a.data;throw a.error}safeParse(e,r){var a;let i={common:{issues:[],async:(a=r?.async)!==null&&a!==void 0?a:!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:lc(e)},h=this._parseSync({data:e,path:i.path,parent:i});return WX(i,h)}async parseAsync(e,r){let a=await this.safeParseAsync(e,r);if(a.success)return a.data;throw a.error}async safeParseAsync(e,r){let a={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:lc(e)},i=this._parse({data:e,path:a.path,parent:a}),h=await(Bg(i)?i:Promise.resolve(i));return WX(a,h)}refine(e,r){let a=i=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(i):r;return this._refinement((i,h)=>{let l=e(i),p=()=>h.addIssue({code:Pt.custom,...a(i)});return typeof Promise<"u"&&l instanceof Promise?l.then(b=>b?!0:(p(),!1)):l?!0:(p(),!1)})}refinement(e,r){return this._refinement((a,i)=>e(a)?!0:(i.addIssue(typeof r=="function"?r(a,i):r),!1))}_refinement(e){return new Po({schema:this,typeName:lr.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}optional(){return Bs.create(this,this._def)}nullable(){return Ou.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Lh.create(this,this._def)}promise(){return pc.create(this,this._def)}or(e){return fd.create([this,e],this._def)}and(e){return ud.create(this,e,this._def)}transform(e){return new Po({...Br(this._def),schema:this,typeName:lr.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new pd({...Br(this._def),innerType:this,defaultValue:r,typeName:lr.ZodDefault})}brand(){return new Pg({typeName:lr.ZodBranded,type:this,...Br(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new vd({...Br(this._def),innerType:this,catchValue:r,typeName:lr.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return Og.create(this,e)}readonly(){return md.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},iwe=/^c[^\s-]{8,}$/i,nwe=/^[0-9a-z]+$/,awe=/^[0-9A-HJKMNP-TV-Z]{26}$/,owe=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,swe=/^[a-z0-9_-]{21}$/i,fwe=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,uwe=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,hwe="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",lT,lwe=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,cwe=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,dwe=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,JX="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",pwe=new RegExp(`^${JX}$`);function XX(t){let e="([01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d";return t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`),e}function vwe(t){return new RegExp(`^${XX(t)}$`)}function QX(t){let e=`${JX}T${XX(t)}`,r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function mwe(t,e){return!!((e==="v4"||!e)&&lwe.test(t)||(e==="v6"||!e)&&cwe.test(t))}var cc=class t extends Pr{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==Yt.string){let h=this._getOrReturnCtx(e);return Wt(h,{code:Pt.invalid_type,expected:Yt.string,received:h.parsedType}),pr}let a=new Ia,i;for(let h of this._def.checks)if(h.kind==="min")e.data.length<h.value&&(i=this._getOrReturnCtx(e,i),Wt(i,{code:Pt.too_small,minimum:h.value,type:"string",inclusive:!0,exact:!1,message:h.message}),a.dirty());else if(h.kind==="max")e.data.length>h.value&&(i=this._getOrReturnCtx(e,i),Wt(i,{code:Pt.too_big,maximum:h.value,type:"string",inclusive:!0,exact:!1,message:h.message}),a.dirty());else if(h.kind==="length"){let l=e.data.length>h.value,p=e.data.length<h.value;(l||p)&&(i=this._getOrReturnCtx(e,i),l?Wt(i,{code:Pt.too_big,maximum:h.value,type:"string",inclusive:!0,exact:!0,message:h.message}):p&&Wt(i,{code:Pt.too_small,minimum:h.value,type:"string",inclusive:!0,exact:!0,message:h.message}),a.dirty())}else if(h.kind==="email")uwe.test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{validation:"email",code:Pt.invalid_string,message:h.message}),a.dirty());else if(h.kind==="emoji")lT||(lT=new RegExp(hwe,"u")),lT.test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{validation:"emoji",code:Pt.invalid_string,message:h.message}),a.dirty());else if(h.kind==="uuid")owe.test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{validation:"uuid",code:Pt.invalid_string,message:h.message}),a.dirty());else if(h.kind==="nanoid")swe.test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{validation:"nanoid",code:Pt.invalid_string,message:h.message}),a.dirty());else if(h.kind==="cuid")iwe.test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{validation:"cuid",code:Pt.invalid_string,message:h.message}),a.dirty());else if(h.kind==="cuid2")nwe.test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{validation:"cuid2",code:Pt.invalid_string,message:h.message}),a.dirty());else if(h.kind==="ulid")awe.test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{validation:"ulid",code:Pt.invalid_string,message:h.message}),a.dirty());else if(h.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),Wt(i,{validation:"url",code:Pt.invalid_string,message:h.message}),a.dirty()}else h.kind==="regex"?(h.regex.lastIndex=0,h.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{validation:"regex",code:Pt.invalid_string,message:h.message}),a.dirty())):h.kind==="trim"?e.data=e.data.trim():h.kind==="includes"?e.data.includes(h.value,h.position)||(i=this._getOrReturnCtx(e,i),Wt(i,{code:Pt.invalid_string,validation:{includes:h.value,position:h.position},message:h.message}),a.dirty()):h.kind==="toLowerCase"?e.data=e.data.toLowerCase():h.kind==="toUpperCase"?e.data=e.data.toUpperCase():h.kind==="startsWith"?e.data.startsWith(h.value)||(i=this._getOrReturnCtx(e,i),Wt(i,{code:Pt.invalid_string,validation:{startsWith:h.value},message:h.message}),a.dirty()):h.kind==="endsWith"?e.data.endsWith(h.value)||(i=this._getOrReturnCtx(e,i),Wt(i,{code:Pt.invalid_string,validation:{endsWith:h.value},message:h.message}),a.dirty()):h.kind==="datetime"?QX(h).test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{code:Pt.invalid_string,validation:"datetime",message:h.message}),a.dirty()):h.kind==="date"?pwe.test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{code:Pt.invalid_string,validation:"date",message:h.message}),a.dirty()):h.kind==="time"?vwe(h).test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{code:Pt.invalid_string,validation:"time",message:h.message}),a.dirty()):h.kind==="duration"?fwe.test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{validation:"duration",code:Pt.invalid_string,message:h.message}),a.dirty()):h.kind==="ip"?mwe(e.data,h.version)||(i=this._getOrReturnCtx(e,i),Wt(i,{validation:"ip",code:Pt.invalid_string,message:h.message}),a.dirty()):h.kind==="base64"?dwe.test(e.data)||(i=this._getOrReturnCtx(e,i),Wt(i,{validation:"base64",code:Pt.invalid_string,message:h.message}),a.dirty()):fi.assertNever(h);return{status:a.value,value:e.data}}_regex(e,r,a){return this.refinement(i=>e.test(i),{validation:r,code:Pt.invalid_string,...rr.errToObj(a)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...rr.errToObj(e)})}url(e){return this._addCheck({kind:"url",...rr.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...rr.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...rr.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...rr.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...rr.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...rr.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...rr.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...rr.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...rr.errToObj(e)})}datetime(e){var r,a;return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:(r=e?.offset)!==null&&r!==void 0?r:!1,local:(a=e?.local)!==null&&a!==void 0?a:!1,...rr.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...rr.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...rr.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...rr.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...rr.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...rr.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...rr.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...rr.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...rr.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...rr.errToObj(r)})}nonempty(e){return this.min(1,rr.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};cc.create=t=>{var e;return new cc({checks:[],typeName:lr.ZodString,coerce:(e=t?.coerce)!==null&&e!==void 0?e:!1,...Br(t)})};function gwe(t,e){let r=(t.toString().split(".")[1]||"").length,a=(e.toString().split(".")[1]||"").length,i=r>a?r:a,h=parseInt(t.toFixed(i).replace(".","")),l=parseInt(e.toFixed(i).replace(".",""));return h%l/Math.pow(10,i)}var rd=class t extends Pr{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==Yt.number){let h=this._getOrReturnCtx(e);return Wt(h,{code:Pt.invalid_type,expected:Yt.number,received:h.parsedType}),pr}let a,i=new Ia;for(let h of this._def.checks)h.kind==="int"?fi.isInteger(e.data)||(a=this._getOrReturnCtx(e,a),Wt(a,{code:Pt.invalid_type,expected:"integer",received:"float",message:h.message}),i.dirty()):h.kind==="min"?(h.inclusive?e.data<h.value:e.data<=h.value)&&(a=this._getOrReturnCtx(e,a),Wt(a,{code:Pt.too_small,minimum:h.value,type:"number",inclusive:h.inclusive,exact:!1,message:h.message}),i.dirty()):h.kind==="max"?(h.inclusive?e.data>h.value:e.data>=h.value)&&(a=this._getOrReturnCtx(e,a),Wt(a,{code:Pt.too_big,maximum:h.value,type:"number",inclusive:h.inclusive,exact:!1,message:h.message}),i.dirty()):h.kind==="multipleOf"?gwe(e.data,h.value)!==0&&(a=this._getOrReturnCtx(e,a),Wt(a,{code:Pt.not_multiple_of,multipleOf:h.value,message:h.message}),i.dirty()):h.kind==="finite"?Number.isFinite(e.data)||(a=this._getOrReturnCtx(e,a),Wt(a,{code:Pt.not_finite,message:h.message}),i.dirty()):fi.assertNever(h);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,rr.toString(r))}gt(e,r){return this.setLimit("min",e,!1,rr.toString(r))}lte(e,r){return this.setLimit("max",e,!0,rr.toString(r))}lt(e,r){return this.setLimit("max",e,!1,rr.toString(r))}setLimit(e,r,a,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:a,message:rr.toString(i)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:rr.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:rr.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:rr.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:rr.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:rr.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:rr.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:rr.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:rr.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:rr.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&fi.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let a of this._def.checks){if(a.kind==="finite"||a.kind==="int"||a.kind==="multipleOf")return!0;a.kind==="min"?(r===null||a.value>r)&&(r=a.value):a.kind==="max"&&(e===null||a.value<e)&&(e=a.value)}return Number.isFinite(r)&&Number.isFinite(e)}};rd.create=t=>new rd({checks:[],typeName:lr.ZodNumber,coerce:t?.coerce||!1,...Br(t)});var id=class t extends Pr{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce&&(e.data=BigInt(e.data)),this._getType(e)!==Yt.bigint){let h=this._getOrReturnCtx(e);return Wt(h,{code:Pt.invalid_type,expected:Yt.bigint,received:h.parsedType}),pr}let a,i=new Ia;for(let h of this._def.checks)h.kind==="min"?(h.inclusive?e.data<h.value:e.data<=h.value)&&(a=this._getOrReturnCtx(e,a),Wt(a,{code:Pt.too_small,type:"bigint",minimum:h.value,inclusive:h.inclusive,message:h.message}),i.dirty()):h.kind==="max"?(h.inclusive?e.data>h.value:e.data>=h.value)&&(a=this._getOrReturnCtx(e,a),Wt(a,{code:Pt.too_big,type:"bigint",maximum:h.value,inclusive:h.inclusive,message:h.message}),i.dirty()):h.kind==="multipleOf"?e.data%h.value!==BigInt(0)&&(a=this._getOrReturnCtx(e,a),Wt(a,{code:Pt.not_multiple_of,multipleOf:h.value,message:h.message}),i.dirty()):fi.assertNever(h);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,rr.toString(r))}gt(e,r){return this.setLimit("min",e,!1,rr.toString(r))}lte(e,r){return this.setLimit("max",e,!0,rr.toString(r))}lt(e,r){return this.setLimit("max",e,!1,rr.toString(r))}setLimit(e,r,a,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:a,message:rr.toString(i)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:rr.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:rr.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:rr.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:rr.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:rr.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};id.create=t=>{var e;return new id({checks:[],typeName:lr.ZodBigInt,coerce:(e=t?.coerce)!==null&&e!==void 0?e:!1,...Br(t)})};var nd=class extends Pr{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==Yt.boolean){let a=this._getOrReturnCtx(e);return Wt(a,{code:Pt.invalid_type,expected:Yt.boolean,received:a.parsedType}),pr}return Da(e.data)}};nd.create=t=>new nd({typeName:lr.ZodBoolean,coerce:t?.coerce||!1,...Br(t)});var ad=class t extends Pr{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==Yt.date){let h=this._getOrReturnCtx(e);return Wt(h,{code:Pt.invalid_type,expected:Yt.date,received:h.parsedType}),pr}if(isNaN(e.data.getTime())){let h=this._getOrReturnCtx(e);return Wt(h,{code:Pt.invalid_date}),pr}let a=new Ia,i;for(let h of this._def.checks)h.kind==="min"?e.data.getTime()<h.value&&(i=this._getOrReturnCtx(e,i),Wt(i,{code:Pt.too_small,message:h.message,inclusive:!0,exact:!1,minimum:h.value,type:"date"}),a.dirty()):h.kind==="max"?e.data.getTime()>h.value&&(i=this._getOrReturnCtx(e,i),Wt(i,{code:Pt.too_big,message:h.message,inclusive:!0,exact:!1,maximum:h.value,type:"date"}),a.dirty()):fi.assertNever(h);return{status:a.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:rr.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:rr.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}};ad.create=t=>new ad({checks:[],coerce:t?.coerce||!1,typeName:lr.ZodDate,...Br(t)});var _1=class extends Pr{_parse(e){if(this._getType(e)!==Yt.symbol){let a=this._getOrReturnCtx(e);return Wt(a,{code:Pt.invalid_type,expected:Yt.symbol,received:a.parsedType}),pr}return Da(e.data)}};_1.create=t=>new _1({typeName:lr.ZodSymbol,...Br(t)});var od=class extends Pr{_parse(e){if(this._getType(e)!==Yt.undefined){let a=this._getOrReturnCtx(e);return Wt(a,{code:Pt.invalid_type,expected:Yt.undefined,received:a.parsedType}),pr}return Da(e.data)}};od.create=t=>new od({typeName:lr.ZodUndefined,...Br(t)});var sd=class extends Pr{_parse(e){if(this._getType(e)!==Yt.null){let a=this._getOrReturnCtx(e);return Wt(a,{code:Pt.invalid_type,expected:Yt.null,received:a.parsedType}),pr}return Da(e.data)}};sd.create=t=>new sd({typeName:lr.ZodNull,...Br(t)});var dc=class extends Pr{constructor(){super(...arguments),this._any=!0}_parse(e){return Da(e.data)}};dc.create=t=>new dc({typeName:lr.ZodAny,...Br(t)});var Ch=class extends Pr{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Da(e.data)}};Ch.create=t=>new Ch({typeName:lr.ZodUnknown,...Br(t)});var Tf=class extends Pr{_parse(e){let r=this._getOrReturnCtx(e);return Wt(r,{code:Pt.invalid_type,expected:Yt.never,received:r.parsedType}),pr}};Tf.create=t=>new Tf({typeName:lr.ZodNever,...Br(t)});var M1=class extends Pr{_parse(e){if(this._getType(e)!==Yt.undefined){let a=this._getOrReturnCtx(e);return Wt(a,{code:Pt.invalid_type,expected:Yt.void,received:a.parsedType}),pr}return Da(e.data)}};M1.create=t=>new M1({typeName:lr.ZodVoid,...Br(t)});var Lh=class t extends Pr{_parse(e){let{ctx:r,status:a}=this._processInputParams(e),i=this._def;if(r.parsedType!==Yt.array)return Wt(r,{code:Pt.invalid_type,expected:Yt.array,received:r.parsedType}),pr;if(i.exactLength!==null){let l=r.data.length>i.exactLength.value,p=r.data.length<i.exactLength.value;(l||p)&&(Wt(r,{code:l?Pt.too_big:Pt.too_small,minimum:p?i.exactLength.value:void 0,maximum:l?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),a.dirty())}if(i.minLength!==null&&r.data.length<i.minLength.value&&(Wt(r,{code:Pt.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),a.dirty()),i.maxLength!==null&&r.data.length>i.maxLength.value&&(Wt(r,{code:Pt.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),a.dirty()),r.common.async)return Promise.all([...r.data].map((l,p)=>i.type._parseAsync(new Ps(r,l,r.path,p)))).then(l=>Ia.mergeArray(a,l));let h=[...r.data].map((l,p)=>i.type._parseSync(new Ps(r,l,r.path,p)));return Ia.mergeArray(a,h)}get element(){return this._def.type}min(e,r){return new t({...this._def,minLength:{value:e,message:rr.toString(r)}})}max(e,r){return new t({...this._def,maxLength:{value:e,message:rr.toString(r)}})}length(e,r){return new t({...this._def,exactLength:{value:e,message:rr.toString(r)}})}nonempty(e){return this.min(1,e)}};Lh.create=(t,e)=>new Lh({type:t,minLength:null,maxLength:null,exactLength:null,typeName:lr.ZodArray,...Br(e)});function b1(t){if(t instanceof ao){let e={};for(let r in t.shape){let a=t.shape[r];e[r]=Bs.create(b1(a))}return new ao({...t._def,shape:()=>e})}else return t instanceof Lh?new Lh({...t._def,type:b1(t.element)}):t instanceof Bs?Bs.create(b1(t.unwrap())):t instanceof Ou?Ou.create(b1(t.unwrap())):t instanceof Pu?Pu.create(t.items.map(e=>b1(e))):t}var ao=class t extends Pr{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),r=fi.objectKeys(e);return this._cached={shape:e,keys:r}}_parse(e){if(this._getType(e)!==Yt.object){let g=this._getOrReturnCtx(e);return Wt(g,{code:Pt.invalid_type,expected:Yt.object,received:g.parsedType}),pr}let{status:a,ctx:i}=this._processInputParams(e),{shape:h,keys:l}=this._getCached(),p=[];if(!(this._def.catchall instanceof Tf&&this._def.unknownKeys==="strip"))for(let g in i.data)l.includes(g)||p.push(g);let b=[];for(let g of l){let y=h[g],M=i.data[g];b.push({key:{status:"valid",value:g},value:y._parse(new Ps(i,M,i.path,g)),alwaysSet:g in i.data})}if(this._def.catchall instanceof Tf){let g=this._def.unknownKeys;if(g==="passthrough")for(let y of p)b.push({key:{status:"valid",value:y},value:{status:"valid",value:i.data[y]}});else if(g==="strict")p.length>0&&(Wt(i,{code:Pt.unrecognized_keys,keys:p}),a.dirty());else if(g!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let g=this._def.catchall;for(let y of p){let M=i.data[y];b.push({key:{status:"valid",value:y},value:g._parse(new Ps(i,M,i.path,y)),alwaysSet:y in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let g=[];for(let y of b){let M=await y.key,x=await y.value;g.push({key:M,value:x,alwaysSet:y.alwaysSet})}return g}).then(g=>Ia.mergeObjectSync(a,g)):Ia.mergeObjectSync(a,b)}get shape(){return this._def.shape()}strict(e){return rr.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,a)=>{var i,h,l,p;let b=(l=(h=(i=this._def).errorMap)===null||h===void 0?void 0:h.call(i,r,a).message)!==null&&l!==void 0?l:a.defaultError;return r.code==="unrecognized_keys"?{message:(p=rr.errToObj(e).message)!==null&&p!==void 0?p:b}:{message:b}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:lr.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let r={};return fi.objectKeys(e).forEach(a=>{e[a]&&this.shape[a]&&(r[a]=this.shape[a])}),new t({...this._def,shape:()=>r})}omit(e){let r={};return fi.objectKeys(this.shape).forEach(a=>{e[a]||(r[a]=this.shape[a])}),new t({...this._def,shape:()=>r})}deepPartial(){return b1(this)}partial(e){let r={};return fi.objectKeys(this.shape).forEach(a=>{let i=this.shape[a];e&&!e[a]?r[a]=i:r[a]=i.optional()}),new t({...this._def,shape:()=>r})}required(e){let r={};return fi.objectKeys(this.shape).forEach(a=>{if(e&&!e[a])r[a]=this.shape[a];else{let h=this.shape[a];for(;h instanceof Bs;)h=h._def.innerType;r[a]=h}}),new t({...this._def,shape:()=>r})}keyof(){return eQ(fi.objectKeys(this.shape))}};ao.create=(t,e)=>new ao({shape:()=>t,unknownKeys:"strip",catchall:Tf.create(),typeName:lr.ZodObject,...Br(e)});ao.strictCreate=(t,e)=>new ao({shape:()=>t,unknownKeys:"strict",catchall:Tf.create(),typeName:lr.ZodObject,...Br(e)});ao.lazycreate=(t,e)=>new ao({shape:t,unknownKeys:"strip",catchall:Tf.create(),typeName:lr.ZodObject,...Br(e)});var fd=class extends Pr{_parse(e){let{ctx:r}=this._processInputParams(e),a=this._def.options;function i(h){for(let p of h)if(p.result.status==="valid")return p.result;for(let p of h)if(p.result.status==="dirty")return r.common.issues.push(...p.ctx.common.issues),p.result;let l=h.map(p=>new Bo(p.ctx.common.issues));return Wt(r,{code:Pt.invalid_union,unionErrors:l}),pr}if(r.common.async)return Promise.all(a.map(async h=>{let l={...r,common:{...r.common,issues:[]},parent:null};return{result:await h._parseAsync({data:r.data,path:r.path,parent:l}),ctx:l}})).then(i);{let h,l=[];for(let b of a){let g={...r,common:{...r.common,issues:[]},parent:null},y=b._parseSync({data:r.data,path:r.path,parent:g});if(y.status==="valid")return y;y.status==="dirty"&&!h&&(h={result:y,ctx:g}),g.common.issues.length&&l.push(g.common.issues)}if(h)return r.common.issues.push(...h.ctx.common.issues),h.result;let p=l.map(b=>new Bo(b));return Wt(r,{code:Pt.invalid_union,unionErrors:p}),pr}}get options(){return this._def.options}};fd.create=(t,e)=>new fd({options:t,typeName:lr.ZodUnion,...Br(e)});var Nh=t=>t instanceof hd?Nh(t.schema):t instanceof Po?Nh(t.innerType()):t instanceof ld?[t.value]:t instanceof cd?t.options:t instanceof dd?fi.objectValues(t.enum):t instanceof pd?Nh(t._def.innerType):t instanceof od?[void 0]:t instanceof sd?[null]:t instanceof Bs?[void 0,...Nh(t.unwrap())]:t instanceof Ou?[null,...Nh(t.unwrap())]:t instanceof Pg||t instanceof md?Nh(t.unwrap()):t instanceof vd?Nh(t._def.innerType):[],N8=class t extends Pr{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==Yt.object)return Wt(r,{code:Pt.invalid_type,expected:Yt.object,received:r.parsedType}),pr;let a=this.discriminator,i=r.data[a],h=this.optionsMap.get(i);return h?r.common.async?h._parseAsync({data:r.data,path:r.path,parent:r}):h._parseSync({data:r.data,path:r.path,parent:r}):(Wt(r,{code:Pt.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[a]}),pr)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,a){let i=new Map;for(let h of r){let l=Nh(h.shape[e]);if(!l.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let p of l){if(i.has(p))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(p)}`);i.set(p,h)}}return new t({typeName:lr.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:i,...Br(a)})}};function vT(t,e){let r=lc(t),a=lc(e);if(t===e)return{valid:!0,data:t};if(r===Yt.object&&a===Yt.object){let i=fi.objectKeys(e),h=fi.objectKeys(t).filter(p=>i.indexOf(p)!==-1),l={...t,...e};for(let p of h){let b=vT(t[p],e[p]);if(!b.valid)return{valid:!1};l[p]=b.data}return{valid:!0,data:l}}else if(r===Yt.array&&a===Yt.array){if(t.length!==e.length)return{valid:!1};let i=[];for(let h=0;h<t.length;h++){let l=t[h],p=e[h],b=vT(l,p);if(!b.valid)return{valid:!1};i.push(b.data)}return{valid:!0,data:i}}else return r===Yt.date&&a===Yt.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var ud=class extends Pr{_parse(e){let{status:r,ctx:a}=this._processInputParams(e),i=(h,l)=>{if(dT(h)||dT(l))return pr;let p=vT(h.value,l.value);return p.valid?((pT(h)||pT(l))&&r.dirty(),{status:r.value,value:p.data}):(Wt(a,{code:Pt.invalid_intersection_types}),pr)};return a.common.async?Promise.all([this._def.left._parseAsync({data:a.data,path:a.path,parent:a}),this._def.right._parseAsync({data:a.data,path:a.path,parent:a})]).then(([h,l])=>i(h,l)):i(this._def.left._parseSync({data:a.data,path:a.path,parent:a}),this._def.right._parseSync({data:a.data,path:a.path,parent:a}))}};ud.create=(t,e,r)=>new ud({left:t,right:e,typeName:lr.ZodIntersection,...Br(r)});var Pu=class t extends Pr{_parse(e){let{status:r,ctx:a}=this._processInputParams(e);if(a.parsedType!==Yt.array)return Wt(a,{code:Pt.invalid_type,expected:Yt.array,received:a.parsedType}),pr;if(a.data.length<this._def.items.length)return Wt(a,{code:Pt.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),pr;!this._def.rest&&a.data.length>this._def.items.length&&(Wt(a,{code:Pt.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let h=[...a.data].map((l,p)=>{let b=this._def.items[p]||this._def.rest;return b?b._parse(new Ps(a,l,a.path,p)):null}).filter(l=>!!l);return a.common.async?Promise.all(h).then(l=>Ia.mergeArray(r,l)):Ia.mergeArray(r,h)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};Pu.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Pu({items:t,typeName:lr.ZodTuple,rest:null,...Br(e)})};var C8=class t extends Pr{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:a}=this._processInputParams(e);if(a.parsedType!==Yt.object)return Wt(a,{code:Pt.invalid_type,expected:Yt.object,received:a.parsedType}),pr;let i=[],h=this._def.keyType,l=this._def.valueType;for(let p in a.data)i.push({key:h._parse(new Ps(a,p,a.path,p)),value:l._parse(new Ps(a,a.data[p],a.path,p)),alwaysSet:p in a.data});return a.common.async?Ia.mergeObjectAsync(r,i):Ia.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(e,r,a){return r instanceof Pr?new t({keyType:e,valueType:r,typeName:lr.ZodRecord,...Br(a)}):new t({keyType:cc.create(),valueType:e,typeName:lr.ZodRecord,...Br(r)})}},x1=class extends Pr{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:a}=this._processInputParams(e);if(a.parsedType!==Yt.map)return Wt(a,{code:Pt.invalid_type,expected:Yt.map,received:a.parsedType}),pr;let i=this._def.keyType,h=this._def.valueType,l=[...a.data.entries()].map(([p,b],g)=>({key:i._parse(new Ps(a,p,a.path,[g,"key"])),value:h._parse(new Ps(a,b,a.path,[g,"value"]))}));if(a.common.async){let p=new Map;return Promise.resolve().then(async()=>{for(let b of l){let g=await b.key,y=await b.value;if(g.status==="aborted"||y.status==="aborted")return pr;(g.status==="dirty"||y.status==="dirty")&&r.dirty(),p.set(g.value,y.value)}return{status:r.value,value:p}})}else{let p=new Map;for(let b of l){let g=b.key,y=b.value;if(g.status==="aborted"||y.status==="aborted")return pr;(g.status==="dirty"||y.status==="dirty")&&r.dirty(),p.set(g.value,y.value)}return{status:r.value,value:p}}}};x1.create=(t,e,r)=>new x1({valueType:e,keyType:t,typeName:lr.ZodMap,...Br(r)});var S1=class t extends Pr{_parse(e){let{status:r,ctx:a}=this._processInputParams(e);if(a.parsedType!==Yt.set)return Wt(a,{code:Pt.invalid_type,expected:Yt.set,received:a.parsedType}),pr;let i=this._def;i.minSize!==null&&a.data.size<i.minSize.value&&(Wt(a,{code:Pt.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),r.dirty()),i.maxSize!==null&&a.data.size>i.maxSize.value&&(Wt(a,{code:Pt.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());let h=this._def.valueType;function l(b){let g=new Set;for(let y of b){if(y.status==="aborted")return pr;y.status==="dirty"&&r.dirty(),g.add(y.value)}return{status:r.value,value:g}}let p=[...a.data.values()].map((b,g)=>h._parse(new Ps(a,b,a.path,g)));return a.common.async?Promise.all(p).then(b=>l(b)):l(p)}min(e,r){return new t({...this._def,minSize:{value:e,message:rr.toString(r)}})}max(e,r){return new t({...this._def,maxSize:{value:e,message:rr.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};S1.create=(t,e)=>new S1({valueType:t,minSize:null,maxSize:null,typeName:lr.ZodSet,...Br(e)});var L8=class t extends Pr{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==Yt.function)return Wt(r,{code:Pt.invalid_type,expected:Yt.function,received:r.parsedType}),pr;function a(p,b){return P8({data:p,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,B8(),w1].filter(g=>!!g),issueData:{code:Pt.invalid_arguments,argumentsError:b}})}function i(p,b){return P8({data:p,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,B8(),w1].filter(g=>!!g),issueData:{code:Pt.invalid_return_type,returnTypeError:b}})}let h={errorMap:r.common.contextualErrorMap},l=r.data;if(this._def.returns instanceof pc){let p=this;return Da(async function(...b){let g=new Bo([]),y=await p._def.args.parseAsync(b,h).catch(E=>{throw g.addIssue(a(b,E)),g}),M=await Reflect.apply(l,this,y);return await p._def.returns._def.type.parseAsync(M,h).catch(E=>{throw g.addIssue(i(M,E)),g})})}else{let p=this;return Da(function(...b){let g=p._def.args.safeParse(b,h);if(!g.success)throw new Bo([a(b,g.error)]);let y=Reflect.apply(l,this,g.data),M=p._def.returns.safeParse(y,h);if(!M.success)throw new Bo([i(y,M.error)]);return M.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:Pu.create(e).rest(Ch.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,a){return new t({args:e||Pu.create([]).rest(Ch.create()),returns:r||Ch.create(),typeName:lr.ZodFunction,...Br(a)})}},hd=class extends Pr{get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};hd.create=(t,e)=>new hd({getter:t,typeName:lr.ZodLazy,...Br(e)});var ld=class extends Pr{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return Wt(r,{received:r.data,code:Pt.invalid_literal,expected:this._def.value}),pr}return{status:"valid",value:e.data}}get value(){return this._def.value}};ld.create=(t,e)=>new ld({value:t,typeName:lr.ZodLiteral,...Br(e)});function eQ(t,e){return new cd({values:t,typeName:lr.ZodEnum,...Br(e)})}var cd=class t extends Pr{constructor(){super(...arguments),Tg.set(this,void 0)}_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),a=this._def.values;return Wt(r,{expected:fi.joinValues(a),received:r.parsedType,code:Pt.invalid_type}),pr}if(O8(this,Tg,"f")||YX(this,Tg,new Set(this._def.values),"f"),!O8(this,Tg,"f").has(e.data)){let r=this._getOrReturnCtx(e),a=this._def.values;return Wt(r,{received:r.data,code:Pt.invalid_enum_value,options:a}),pr}return Da(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return t.create(e,{...this._def,...r})}exclude(e,r=this._def){return t.create(this.options.filter(a=>!e.includes(a)),{...this._def,...r})}};Tg=new WeakMap;cd.create=eQ;var dd=class extends Pr{constructor(){super(...arguments),kg.set(this,void 0)}_parse(e){let r=fi.getValidEnumValues(this._def.values),a=this._getOrReturnCtx(e);if(a.parsedType!==Yt.string&&a.parsedType!==Yt.number){let i=fi.objectValues(r);return Wt(a,{expected:fi.joinValues(i),received:a.parsedType,code:Pt.invalid_type}),pr}if(O8(this,kg,"f")||YX(this,kg,new Set(fi.getValidEnumValues(this._def.values)),"f"),!O8(this,kg,"f").has(e.data)){let i=fi.objectValues(r);return Wt(a,{received:a.data,code:Pt.invalid_enum_value,options:i}),pr}return Da(e.data)}get enum(){return this._def.values}};kg=new WeakMap;dd.create=(t,e)=>new dd({values:t,typeName:lr.ZodNativeEnum,...Br(e)});var pc=class extends Pr{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==Yt.promise&&r.common.async===!1)return Wt(r,{code:Pt.invalid_type,expected:Yt.promise,received:r.parsedType}),pr;let a=r.parsedType===Yt.promise?r.data:Promise.resolve(r.data);return Da(a.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}};pc.create=(t,e)=>new pc({type:t,typeName:lr.ZodPromise,...Br(e)});var Po=class extends Pr{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===lr.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:a}=this._processInputParams(e),i=this._def.effect||null,h={addIssue:l=>{Wt(a,l),l.fatal?r.abort():r.dirty()},get path(){return a.path}};if(h.addIssue=h.addIssue.bind(h),i.type==="preprocess"){let l=i.transform(a.data,h);if(a.common.async)return Promise.resolve(l).then(async p=>{if(r.value==="aborted")return pr;let b=await this._def.schema._parseAsync({data:p,path:a.path,parent:a});return b.status==="aborted"?pr:b.status==="dirty"||r.value==="dirty"?y1(b.value):b});{if(r.value==="aborted")return pr;let p=this._def.schema._parseSync({data:l,path:a.path,parent:a});return p.status==="aborted"?pr:p.status==="dirty"||r.value==="dirty"?y1(p.value):p}}if(i.type==="refinement"){let l=p=>{let b=i.refinement(p,h);if(a.common.async)return Promise.resolve(b);if(b instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return p};if(a.common.async===!1){let p=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});return p.status==="aborted"?pr:(p.status==="dirty"&&r.dirty(),l(p.value),{status:r.value,value:p.value})}else return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(p=>p.status==="aborted"?pr:(p.status==="dirty"&&r.dirty(),l(p.value).then(()=>({status:r.value,value:p.value}))))}if(i.type==="transform")if(a.common.async===!1){let l=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});if(!Ig(l))return l;let p=i.transform(l.value,h);if(p instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:p}}else return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(l=>Ig(l)?Promise.resolve(i.transform(l.value,h)).then(p=>({status:r.value,value:p})):l);fi.assertNever(i)}};Po.create=(t,e,r)=>new Po({schema:t,typeName:lr.ZodEffects,effect:e,...Br(r)});Po.createWithPreprocess=(t,e,r)=>new Po({schema:e,effect:{type:"preprocess",transform:t},typeName:lr.ZodEffects,...Br(r)});var Bs=class extends Pr{_parse(e){return this._getType(e)===Yt.undefined?Da(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Bs.create=(t,e)=>new Bs({innerType:t,typeName:lr.ZodOptional,...Br(e)});var Ou=class extends Pr{_parse(e){return this._getType(e)===Yt.null?Da(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Ou.create=(t,e)=>new Ou({innerType:t,typeName:lr.ZodNullable,...Br(e)});var pd=class extends Pr{_parse(e){let{ctx:r}=this._processInputParams(e),a=r.data;return r.parsedType===Yt.undefined&&(a=this._def.defaultValue()),this._def.innerType._parse({data:a,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};pd.create=(t,e)=>new pd({innerType:t,typeName:lr.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...Br(e)});var vd=class extends Pr{_parse(e){let{ctx:r}=this._processInputParams(e),a={...r,common:{...r.common,issues:[]}},i=this._def.innerType._parse({data:a.data,path:a.path,parent:{...a}});return Bg(i)?i.then(h=>({status:"valid",value:h.status==="valid"?h.value:this._def.catchValue({get error(){return new Bo(a.common.issues)},input:a.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Bo(a.common.issues)},input:a.data})}}removeCatch(){return this._def.innerType}};vd.create=(t,e)=>new vd({innerType:t,typeName:lr.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...Br(e)});var E1=class extends Pr{_parse(e){if(this._getType(e)!==Yt.nan){let a=this._getOrReturnCtx(e);return Wt(a,{code:Pt.invalid_type,expected:Yt.nan,received:a.parsedType}),pr}return{status:"valid",value:e.data}}};E1.create=t=>new E1({typeName:lr.ZodNaN,...Br(t)});var bwe=Symbol("zod_brand"),Pg=class extends Pr{_parse(e){let{ctx:r}=this._processInputParams(e),a=r.data;return this._def.type._parse({data:a,path:r.path,parent:r})}unwrap(){return this._def.type}},Og=class t extends Pr{_parse(e){let{status:r,ctx:a}=this._processInputParams(e);if(a.common.async)return(async()=>{let h=await this._def.in._parseAsync({data:a.data,path:a.path,parent:a});return h.status==="aborted"?pr:h.status==="dirty"?(r.dirty(),y1(h.value)):this._def.out._parseAsync({data:h.value,path:a.path,parent:a})})();{let i=this._def.in._parseSync({data:a.data,path:a.path,parent:a});return i.status==="aborted"?pr:i.status==="dirty"?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:a.path,parent:a})}}static create(e,r){return new t({in:e,out:r,typeName:lr.ZodPipeline})}},md=class extends Pr{_parse(e){let r=this._def.innerType._parse(e),a=i=>(Ig(i)&&(i.value=Object.freeze(i.value)),i);return Bg(r)?r.then(i=>a(i)):a(r)}unwrap(){return this._def.innerType}};md.create=(t,e)=>new md({innerType:t,typeName:lr.ZodReadonly,...Br(e)});function tQ(t,e={},r){return t?dc.create().superRefine((a,i)=>{var h,l;if(!t(a)){let p=typeof e=="function"?e(a):typeof e=="string"?{message:e}:e,b=(l=(h=p.fatal)!==null&&h!==void 0?h:r)!==null&&l!==void 0?l:!0,g=typeof p=="string"?{message:p}:p;i.addIssue({code:"custom",...g,fatal:b})}}):dc.create()}var ywe={object:ao.lazycreate},lr;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(lr||(lr={}));var wwe=(t,e={message:`Input not instance of ${t.name}`})=>tQ(r=>r instanceof t,e),rQ=cc.create,iQ=rd.create,_we=E1.create,Mwe=id.create,nQ=nd.create,xwe=ad.create,Swe=_1.create,Ewe=od.create,Awe=sd.create,Rwe=dc.create,Twe=Ch.create,kwe=Tf.create,Iwe=M1.create,Bwe=Lh.create,Pwe=ao.create,Owe=ao.strictCreate,Nwe=fd.create,Cwe=N8.create,Lwe=ud.create,Dwe=Pu.create,$we=C8.create,qwe=x1.create,Uwe=S1.create,Fwe=L8.create,jwe=hd.create,zwe=ld.create,Zwe=cd.create,Hwe=dd.create,Kwe=pc.create,VX=Po.create,Wwe=Bs.create,Vwe=Ou.create,Gwe=Po.createWithPreprocess,Ywe=Og.create,Jwe=()=>rQ().optional(),Xwe=()=>iQ().optional(),Qwe=()=>nQ().optional(),e5e={string:t=>cc.create({...t,coerce:!0}),number:t=>rd.create({...t,coerce:!0}),boolean:t=>nd.create({...t,coerce:!0}),bigint:t=>id.create({...t,coerce:!0}),date:t=>ad.create({...t,coerce:!0})},t5e=pr,vr=Object.freeze({__proto__:null,defaultErrorMap:w1,setErrorMap:twe,getErrorMap:B8,makeIssue:P8,EMPTY_PATH:rwe,addIssueToContext:Wt,ParseStatus:Ia,INVALID:pr,DIRTY:y1,OK:Da,isAborted:dT,isDirty:pT,isValid:Ig,isAsync:Bg,get util(){return fi},get objectUtil(){return cT},ZodParsedType:Yt,getParsedType:lc,ZodType:Pr,datetimeRegex:QX,ZodString:cc,ZodNumber:rd,ZodBigInt:id,ZodBoolean:nd,ZodDate:ad,ZodSymbol:_1,ZodUndefined:od,ZodNull:sd,ZodAny:dc,ZodUnknown:Ch,ZodNever:Tf,ZodVoid:M1,ZodArray:Lh,ZodObject:ao,ZodUnion:fd,ZodDiscriminatedUnion:N8,ZodIntersection:ud,ZodTuple:Pu,ZodRecord:C8,ZodMap:x1,ZodSet:S1,ZodFunction:L8,ZodLazy:hd,ZodLiteral:ld,ZodEnum:cd,ZodNativeEnum:dd,ZodPromise:pc,ZodEffects:Po,ZodTransformer:Po,ZodOptional:Bs,ZodNullable:Ou,ZodDefault:pd,ZodCatch:vd,ZodNaN:E1,BRAND:bwe,ZodBranded:Pg,ZodPipeline:Og,ZodReadonly:md,custom:tQ,Schema:Pr,ZodSchema:Pr,late:ywe,get ZodFirstPartyTypeKind(){return lr},coerce:e5e,any:Rwe,array:Bwe,bigint:Mwe,boolean:nQ,date:xwe,discriminatedUnion:Cwe,effect:VX,enum:Zwe,function:Fwe,instanceof:wwe,intersection:Lwe,lazy:jwe,literal:zwe,map:qwe,nan:_we,nativeEnum:Hwe,never:kwe,null:Awe,nullable:Vwe,number:iQ,object:Pwe,oboolean:Qwe,onumber:Xwe,optional:Wwe,ostring:Jwe,pipeline:Ywe,preprocess:Gwe,promise:Kwe,record:$we,set:Uwe,strictObject:Owe,string:rQ,symbol:Swe,transformer:VX,tuple:Dwe,undefined:Ewe,union:Nwe,unknown:Twe,void:Iwe,NEVER:t5e,ZodIssueCode:Pt,quotelessJson:ewe,ZodError:Bo});ie();ae();ne();var D8=new RegExp("^[a-zA-Z0-9_-]{43}$"),Lft=new RegExp("^(?:(?!-)[A-Za-z0-9-]{1,63}(?<!-)\\.)+[A-Za-z]{1,63}$"),Dft=new RegExp("^[0-9]{12},[0-9]{13},[a-fA-F0-9]{64}$"),$ft=He.env.ARNS_REGISTRY_TX??"bLAgYxAdX2Ry-nt6aH2ixgvJXbpsEYm28NgJgyqfs-U",qft="_NctcA2sRy1-J4OmIQZbYFPM17piNcbdBPH2ncX2RL8",r5e="GaQrvEMKBpkjofgnBi_B3IgIDmY_XYelVLB6GcRGrHc",Uft=r5e,A1="agYcCFJtrMG6cqMuZfskIkFTGvUPddICmtQSBIoPdiA",$8="i_le_yKKPVstLTDSmkHRqf-wYphMnwB9OhleiTgMkWc",mT=1e6,aQ="cbn0KKrBZH7hdNkNokuXLtGryrWM--PjSTBqIzw9Kkk",gT="16_FyX-V2QU0RPSh1GIaEETSaUjNb0oVjCFpVbAfQq4",oQ="_GQ33BkPtZrqxA84vM8Zk-N2aO0toNNu_C-l-rawrBA";var gd=vr.string({description:"Arweave Transaction ID"}).refine(t=>D8.test(t),{message:"Must be an Arweave Transaction ID"}),sQ=vr.string({description:"Integer String"}).refine(t=>{let e=parseInt(t);return Number.isInteger(e)&&e>=0},{message:"Must be a non negative integer string"}),i5e=vr.string(),uQ=vr.array(vr.string()),q8=vr.object({transactionId:gd.describe("The Target ID of the undername"),ttlSeconds:vr.number()}),bT=vr.record(vr.string(),q8),yT=vr.array(gd.describe("Controller address")),wT=vr.record(gd.describe("Holder address"),vr.number()),_T=vr.object({Name:vr.string().describe("The name of the ANT."),Ticker:vr.string().describe("The ticker symbol for the ANT."),Description:vr.string().describe("The description for the ANT."),Keywords:uQ.describe("The keywords for the ANT."),Denomination:vr.number().describe("The number of decimal places to use for the ANT. Defaults to 0 if not set representing whole numbers.").min(0,{message:"Denomination must be a non-negative number"}),Owner:gd.describe("The Owners address."),Controllers:yT.describe("Controllers of the ANT who have administrative privileges."),Records:bT.describe("Records associated with the ANT."),Balances:wT.describe("Balance details for each address holding the ANT."),Logo:gd.describe("Transaction ID of the ANT logo."),TotalSupply:vr.number().describe("Total supply of the ANT in circulation.").min(0,{message:"Total supply must be a non-negative number"}),Initialized:vr.boolean().describe("Flag indicating whether the ANT has been initialized.")}),n5e=["balance","balances","totalSupply","info","controllers","record","records","state"],a5e=["_eval","_default","transfer","addController","removeController","setRecord","removeRecord","setName","setTicker","setDescription","setKeywords","setLogo","initializeState","releaseName","reassignName","approvePrimaryName","removePrimaryNames"],o5e=[...n5e,...a5e],fQ=vr.array(vr.string({description:"Handler Name"})).refine(t=>o5e.every(e=>t.includes(e)),{message:"ANT is missing required handlers"}),hQ=vr.object({Name:vr.string().describe("The name of the ANT."),Owner:gd.describe("The Owners address."),Ticker:vr.string().describe("The ticker symbol for the ANT."),"Total-Supply":sQ.describe("Total supply of the ANT in circulation."),Description:i5e.describe("The description for the ANT."),Keywords:uQ.describe("The keywords for the ANT."),Logo:gd.describe("Transaction ID of the ANT logo."),Denomination:sQ.describe("The number of decimal places to use for the ANT. Defaults to 0 if not set representing whole numbers."),Handlers:fQ.optional().describe("List of handlers for the ANT."),HandlerNames:fQ.optional().describe('Deprecated: List of handlers for the ANT. Use "Handlers" instead.')});function Wft(t){return _T.safeParse(t).success}ie();ae();ne();ie();ae();ne();ie();ae();ne();var lQ=t=>D8.test(t);function rut(t){return t!==void 0&&!isNaN(parseInt(t.toString()))}var En=t=>t.filter(e=>e.value!==void 0&&e.value!==""),Oo=t=>{let e=[{name:"Cursor",value:t?.cursor?.toString()},{name:"Limit",value:t?.limit?.toString()},{name:"Sort-By",value:t?.sortBy?.toString()},{name:"Sort-Order",value:t?.sortOrder?.toString()}];return En(e)};var s5e=["Buy-Record","Extend-Lease","Increase-Undername-Limit","Upgrade-Name","Primary-Name-Request"],fut=["Buy-Record","Extend-Lease"],uut=t=>s5e.indexOf(t)!==-1,f5e=["balance","stakes","any"],hut=t=>f5e.indexOf(t)!==-1;function Dh(t){return"process"in t}function $h(t){return"processId"in t&&typeof t.processId=="string"&&lQ(t.processId)===!0}function lut(t){return t.type==="lease"}ie();ae();ne();var MT=class t{constructor(e){this.positiveFiniteInteger=e;if(!Number.isFinite(this.positiveFiniteInteger)||!Number.isInteger(this.positiveFiniteInteger)||this.positiveFiniteInteger<0)throw new Error(`Number must be a non-negative integer value! ${e}`)}[Symbol.toPrimitive](e){return e==="string"&&this.toString(),this.positiveFiniteInteger}plus(e){return new t(this.positiveFiniteInteger+e.positiveFiniteInteger)}minus(e){return new t(this.positiveFiniteInteger-e.positiveFiniteInteger)}isGreaterThan(e){return this.positiveFiniteInteger>e.positiveFiniteInteger}isGreaterThanOrEqualTo(e){return this.positiveFiniteInteger>=e.positiveFiniteInteger}isLessThan(e){return this.positiveFiniteInteger<e.positiveFiniteInteger}isLessThanOrEqualTo(e){return this.positiveFiniteInteger<=e.positiveFiniteInteger}toString(){return`${this.positiveFiniteInteger}`}valueOf(){return this.positiveFiniteInteger}toJSON(){return this.positiveFiniteInteger}equals(e){return this.positiveFiniteInteger===e.positiveFiniteInteger}},xT=class{value;constructor(e){if(!Number.isFinite(e)||e<0)throw new Error("ARIOToken must be a non-negative finite number");this.value=+e.toFixed(6)}valueOf(){return this.value}toMARIO(){return new ST(Math.floor(this.value*mT))}toString(){return`${this.value}`}},ST=class t extends MT{constructor(e){super(e)}multiply(e){let r=Math.floor(this.valueOf()*e.valueOf());return new t(r)}divide(e){if(e.valueOf()===0)throw new Error("Cannot divide by zero");let r=Math.floor(this.valueOf()/e.valueOf());return new t(r)}plus(e){let r=super.plus(e);return new t(r.valueOf())}minus(e){let r=super.minus(e);return new t(r.valueOf())}toARIO(){return new xT(this.valueOf()/mT)}};ie();ae();ne();ie();ae();ne();var kf=class extends Error{constructor(e){super(e),this.name=this.constructor.name}},cQ=class extends kf{},dQ=class extends kf{},pQ=class extends kf{constructor(e,r){super(`Failed request: ${e}: ${r}`)}},vQ=class extends kf{},U8=class extends kf{},mQ=class extends kf{constructor(){super("Invalid signer. Please provide a valid signer to interact with the contract.")}},Nu=class extends kf{constructor(){super("Invalid contract configuration")}},gQ=class extends kf{constructor(){super("Invalid process configuration")}},bQ=class extends kf{};ie();ae();ne();var $f=gi($ae(),1);ie();ae();ne();var W4="3.1.0";var Fu=class t{logger;silent=!1;static default=new t;constructor({level:e="info"}={}){e==="none"&&(this.silent=!0),typeof window<"u"?this.logger=console:this.logger=(0,$f.createLogger)({level:e,silent:this.silent,defaultMeta:{name:"ar-io-sdk",version:W4},format:$f.format.combine($f.format.timestamp(),$f.format.json()),transports:[new $f.transports.Console({format:$f.format.combine($f.format.timestamp(),$f.format.json())})]})}info(e,...r){this.silent||this.logger.info(e,...r)}warn(e,...r){this.silent||this.logger.warn(e,...r)}error(e,...r){this.silent||this.logger.error(e,...r)}debug(e,...r){this.silent||this.logger.debug(e,...r)}setLogLevel(e){this.silent=e==="none","silent"in this.logger&&(this.logger.silent=e==="none"),"level"in this.logger&&(this.logger.level=e)}};ie();ae();ne();ie();ae();ne();ie();ae();ne();var fBe=Object.create,oB=Object.defineProperty,uBe=Object.getOwnPropertyDescriptor,hoe=Object.getOwnPropertyNames,hBe=Object.getPrototypeOf,lBe=Object.prototype.hasOwnProperty,Lo=(t,e)=>function(){return e||(0,t[hoe(t)[0]])((e={exports:{}}).exports,e),e.exports},loe=(t,e)=>{for(var r in e)oB(t,r,{get:e[r],enumerable:!0})},cBe=(t,e,r,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of hoe(e))!lBe.call(t,i)&&i!==r&&oB(t,i,{get:()=>e[i],enumerable:!(a=uBe(e,i))||a.enumerable});return t},sB=(t,e,r)=>(r=t!=null?fBe(hBe(t)):{},cBe(e||!t||!t.__esModule?oB(r,"default",{value:t,enumerable:!0}):r,t)),dBe=Lo({"node_modules/obliterator/iterator.js"(t,e){function r(a){if(typeof a!="function")throw new Error("obliterator/iterator: expecting a function!");this.next=a}typeof Symbol<"u"&&(r.prototype[Symbol.iterator]=function(){return this}),r.of=function(){var a=arguments,i=a.length,h=0;return new r(function(){return h>=i?{done:!0}:{done:!1,value:a[h++]}})},r.empty=function(){var a=new r(function(){return{done:!0}});return a},r.fromSequence=function(a){var i=0,h=a.length;return new r(function(){return i>=h?{done:!0}:{done:!1,value:a[i++]}})},r.is=function(a){return a instanceof r?!0:typeof a=="object"&&a!==null&&typeof a.next=="function"},e.exports=r}}),pBe=Lo({"node_modules/obliterator/support.js"(t){t.ARRAY_BUFFER_SUPPORT=typeof ArrayBuffer<"u",t.SYMBOL_SUPPORT=typeof Symbol<"u"}}),fB=Lo({"node_modules/obliterator/foreach.js"(t,e){var r=pBe(),a=r.ARRAY_BUFFER_SUPPORT,i=r.SYMBOL_SUPPORT;e.exports=function(l,p){var b,g,y,M,x;if(!l)throw new Error("obliterator/forEach: invalid iterable.");if(typeof p!="function")throw new Error("obliterator/forEach: expecting a callback.");if(Array.isArray(l)||a&&ArrayBuffer.isView(l)||typeof l=="string"||l.toString()==="[object Arguments]"){for(y=0,M=l.length;y<M;y++)p(l[y],y);return}if(typeof l.forEach=="function"){l.forEach(p);return}if(i&&Symbol.iterator in l&&typeof l.next!="function"&&(l=l[Symbol.iterator]()),typeof l.next=="function"){for(b=l,y=0;x=b.next(),x.done!==!0;)p(x.value,y),y++;return}for(g in l)l.hasOwnProperty(g)&&p(l[g],g)}}}),uB=Lo({"node_modules/mnemonist/utils/typed-arrays.js"(t){var e=Math.pow(2,8)-1,r=Math.pow(2,16)-1,a=Math.pow(2,32)-1,i=Math.pow(2,7)-1,h=Math.pow(2,15)-1,l=Math.pow(2,31)-1;t.getPointerArray=function(b){var g=b-1;if(g<=e)return Uint8Array;if(g<=r)return Uint16Array;if(g<=a)return Uint32Array;throw new Error("mnemonist: Pointer Array of size > 4294967295 is not supported.")},t.getSignedPointerArray=function(b){var g=b-1;return g<=i?Int8Array:g<=h?Int16Array:g<=l?Int32Array:Float64Array},t.getNumberType=function(b){return b===(b|0)?Math.sign(b)===-1?b<=127&&b>=-128?Int8Array:b<=32767&&b>=-32768?Int16Array:Int32Array:b<=255?Uint8Array:b<=65535?Uint16Array:Uint32Array:Float64Array};var p={Uint8Array:1,Int8Array:2,Uint16Array:3,Int16Array:4,Uint32Array:5,Int32Array:6,Float32Array:7,Float64Array:8};t.getMinimalRepresentation=function(b,g){var y=null,M=0,x,E,A,k,P;for(k=0,P=b.length;k<P;k++)A=g?g(b[k]):b[k],E=t.getNumberType(A),x=p[E.name],x>M&&(M=x,y=E);return y},t.isTypedArray=function(b){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView(b)},t.concat=function(){var b=0,g,y,M;for(g=0,M=arguments.length;g<M;g++)b+=arguments[g].length;var x=new arguments[0].constructor(b);for(g=0,y=0;g<M;g++)x.set(arguments[g],y),y+=arguments[g].length;return x},t.indices=function(b){for(var g=t.getPointerArray(b),y=new g(b),M=0;M<b;M++)y[M]=M;return y}}}),coe=Lo({"node_modules/mnemonist/utils/iterables.js"(t){var e=fB(),r=uB();function a(p){return Array.isArray(p)||r.isTypedArray(p)}function i(p){if(typeof p.length=="number")return p.length;if(typeof p.size=="number")return p.size}function h(p){var b=i(p),g=typeof b=="number"?new Array(b):[],y=0;return e(p,function(M){g[y++]=M}),g}function l(p){var b=i(p),g=typeof b=="number"?r.getPointerArray(b):Array,y=typeof b=="number"?new Array(b):[],M=typeof b=="number"?new g(b):[],x=0;return e(p,function(E){y[x]=E,M[x]=x++}),[y,M]}t.isArrayLike=a,t.guessLength=i,t.toArray=h,t.toArrayWithIndices=l}}),vBe=Lo({"node_modules/mnemonist/lru-cache.js"(t,e){var r=dBe(),a=fB(),i=uB(),h=coe();function l(p,b,g){if(arguments.length<2&&(g=p,p=null,b=null),this.capacity=g,typeof this.capacity!="number"||this.capacity<=0)throw new Error("mnemonist/lru-cache: capacity should be positive number.");if(!isFinite(this.capacity)||Math.floor(this.capacity)!==this.capacity)throw new Error("mnemonist/lru-cache: capacity should be a finite positive integer.");var y=i.getPointerArray(g);this.forward=new y(g),this.backward=new y(g),this.K=typeof p=="function"?new p(g):new Array(g),this.V=typeof b=="function"?new b(g):new Array(g),this.size=0,this.head=0,this.tail=0,this.items={}}l.prototype.clear=function(){this.size=0,this.head=0,this.tail=0,this.items={}},l.prototype.splayOnTop=function(p){var b=this.head;if(this.head===p)return this;var g=this.backward[p],y=this.forward[p];return this.tail===p?this.tail=g:this.backward[y]=g,this.forward[g]=y,this.backward[b]=p,this.head=p,this.forward[p]=b,this},l.prototype.set=function(p,b){var g=this.items[p];if(typeof g<"u"){this.splayOnTop(g),this.V[g]=b;return}this.size<this.capacity?g=this.size++:(g=this.tail,this.tail=this.backward[g],delete this.items[this.K[g]]),this.items[p]=g,this.K[g]=p,this.V[g]=b,this.forward[g]=this.head,this.backward[this.head]=g,this.head=g},l.prototype.setpop=function(p,b){var g=null,y=null,M=this.items[p];return typeof M<"u"?(this.splayOnTop(M),g=this.V[M],this.V[M]=b,{evicted:!1,key:p,value:g}):(this.size<this.capacity?M=this.size++:(M=this.tail,this.tail=this.backward[M],g=this.V[M],y=this.K[M],delete this.items[y]),this.items[p]=M,this.K[M]=p,this.V[M]=b,this.forward[M]=this.head,this.backward[this.head]=M,this.head=M,y?{evicted:!0,key:y,value:g}:null)},l.prototype.has=function(p){return p in this.items},l.prototype.get=function(p){var b=this.items[p];if(!(typeof b>"u"))return this.splayOnTop(b),this.V[b]},l.prototype.peek=function(p){var b=this.items[p];if(!(typeof b>"u"))return this.V[b]},l.prototype.forEach=function(p,b){b=arguments.length>1?b:this;for(var g=0,y=this.size,M=this.head,x=this.K,E=this.V,A=this.forward;g<y;)p.call(b,E[M],x[M],this),M=A[M],g++},l.prototype.keys=function(){var p=0,b=this.size,g=this.head,y=this.K,M=this.forward;return new r(function(){if(p>=b)return{done:!0};var x=y[g];return p++,p<b&&(g=M[g]),{done:!1,value:x}})},l.prototype.values=function(){var p=0,b=this.size,g=this.head,y=this.V,M=this.forward;return new r(function(){if(p>=b)return{done:!0};var x=y[g];return p++,p<b&&(g=M[g]),{done:!1,value:x}})},l.prototype.entries=function(){var p=0,b=this.size,g=this.head,y=this.K,M=this.V,x=this.forward;return new r(function(){if(p>=b)return{done:!0};var E=y[g],A=M[g];return p++,p<b&&(g=x[g]),{done:!1,value:[E,A]}})},typeof Symbol<"u"&&(l.prototype[Symbol.iterator]=l.prototype.entries),l.prototype.inspect=function(){for(var p=new Map,b=this.entries(),g;g=b.next(),!g.done;)p.set(g.value[0],g.value[1]);return Object.defineProperty(p,"constructor",{value:l,enumerable:!1}),p},typeof Symbol<"u"&&(l.prototype[Symbol.for("nodejs.util.inspect.custom")]=l.prototype.inspect),l.from=function(p,b,g,y){if(arguments.length<2){if(y=h.guessLength(p),typeof y!="number")throw new Error("mnemonist/lru-cache.from: could not guess iterable length. Please provide desired capacity as last argument.")}else arguments.length===2&&(y=b,b=null,g=null);var M=new l(b,g,y);return a(p,function(x,E){M.set(E,x)}),M},e.exports=l}}),mBe=Lo({"node_modules/mnemonist/lru-map.js"(t,e){var r=vBe(),a=fB(),i=uB(),h=coe();function l(p,b,g){if(arguments.length<2&&(g=p,p=null,b=null),this.capacity=g,typeof this.capacity!="number"||this.capacity<=0)throw new Error("mnemonist/lru-map: capacity should be positive number.");if(!isFinite(this.capacity)||Math.floor(this.capacity)!==this.capacity)throw new Error("mnemonist/lru-map: capacity should be a finite positive integer.");var y=i.getPointerArray(g);this.forward=new y(g),this.backward=new y(g),this.K=typeof p=="function"?new p(g):new Array(g),this.V=typeof b=="function"?new b(g):new Array(g),this.size=0,this.head=0,this.tail=0,this.items=new Map}l.prototype.clear=function(){this.size=0,this.head=0,this.tail=0,this.items.clear()},l.prototype.set=function(p,b){var g=this.items.get(p);if(typeof g<"u"){this.splayOnTop(g),this.V[g]=b;return}this.size<this.capacity?g=this.size++:(g=this.tail,this.tail=this.backward[g],this.items.delete(this.K[g])),this.items.set(p,g),this.K[g]=p,this.V[g]=b,this.forward[g]=this.head,this.backward[this.head]=g,this.head=g},l.prototype.setpop=function(p,b){var g=null,y=null,M=this.items.get(p);return typeof M<"u"?(this.splayOnTop(M),g=this.V[M],this.V[M]=b,{evicted:!1,key:p,value:g}):(this.size<this.capacity?M=this.size++:(M=this.tail,this.tail=this.backward[M],g=this.V[M],y=this.K[M],this.items.delete(y)),this.items.set(p,M),this.K[M]=p,this.V[M]=b,this.forward[M]=this.head,this.backward[this.head]=M,this.head=M,y?{evicted:!0,key:y,value:g}:null)},l.prototype.has=function(p){return this.items.has(p)},l.prototype.get=function(p){var b=this.items.get(p);if(!(typeof b>"u"))return this.splayOnTop(b),this.V[b]},l.prototype.peek=function(p){var b=this.items.get(p);if(!(typeof b>"u"))return this.V[b]},l.prototype.splayOnTop=r.prototype.splayOnTop,l.prototype.forEach=r.prototype.forEach,l.prototype.keys=r.prototype.keys,l.prototype.values=r.prototype.values,l.prototype.entries=r.prototype.entries,typeof Symbol<"u"&&(l.prototype[Symbol.iterator]=l.prototype.entries),l.prototype.inspect=r.prototype.inspect,l.from=function(p,b,g,y){if(arguments.length<2){if(y=h.guessLength(p),typeof y!="number")throw new Error("mnemonist/lru-cache.from: could not guess iterable length. Please provide desired capacity as last argument.")}else arguments.length===2&&(y=b,b=null,g=null);var M=new l(b,g,y);return a(p,function(x,E){M.set(E,x)}),M},e.exports=l}}),gBe=Lo({"node_modules/ms/index.js"(t,e){var r=1e3,a=r*60,i=a*60,h=i*24,l=h*7,p=h*365.25;e.exports=function(x,E){E=E||{};var A=typeof x;if(A==="string"&&x.length>0)return b(x);if(A==="number"&&isFinite(x))return E.long?y(x):g(x);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(x))};function b(x){if(x=String(x),!(x.length>100)){var E=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(x);if(E){var A=parseFloat(E[1]),k=(E[2]||"ms").toLowerCase();switch(k){case"years":case"year":case"yrs":case"yr":case"y":return A*p;case"weeks":case"week":case"w":return A*l;case"days":case"day":case"d":return A*h;case"hours":case"hour":case"hrs":case"hr":case"h":return A*i;case"minutes":case"minute":case"mins":case"min":case"m":return A*a;case"seconds":case"second":case"secs":case"sec":case"s":return A*r;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return A;default:return}}}}function g(x){var E=Math.abs(x);return E>=h?Math.round(x/h)+"d":E>=i?Math.round(x/i)+"h":E>=a?Math.round(x/a)+"m":E>=r?Math.round(x/r)+"s":x+"ms"}function y(x){var E=Math.abs(x);return E>=h?M(x,E,h,"day"):E>=i?M(x,E,i,"hour"):E>=a?M(x,E,a,"minute"):E>=r?M(x,E,r,"second"):x+" ms"}function M(x,E,A,k){var P=E>=A*1.5;return Math.round(x/A)+" "+k+(P?"s":"")}}}),bBe=Lo({"node_modules/debug/src/common.js"(t,e){function r(a){h.debug=h,h.default=h,h.coerce=M,h.disable=b,h.enable=p,h.enabled=g,h.humanize=gBe(),h.destroy=x,Object.keys(a).forEach(E=>{h[E]=a[E]}),h.names=[],h.skips=[],h.formatters={};function i(E){let A=0;for(let k=0;k<E.length;k++)A=(A<<5)-A+E.charCodeAt(k),A|=0;return h.colors[Math.abs(A)%h.colors.length]}h.selectColor=i;function h(E){let A,k=null,P,N;function L(...C){if(!L.enabled)return;let Y=L,G=Number(new Date),ee=G-(A||G);Y.diff=ee,Y.prev=A,Y.curr=G,A=G,C[0]=h.coerce(C[0]),typeof C[0]!="string"&&C.unshift("%O");let D=0;C[0]=C[0].replace(/%([a-zA-Z%])/g,(V,_)=>{if(V==="%%")return"%";D++;let n=h.formatters[_];if(typeof n=="function"){let s=C[D];V=n.call(Y,s),C.splice(D,1),D--}return V}),h.formatArgs.call(Y,C),(Y.log||h.log).apply(Y,C)}return L.namespace=E,L.useColors=h.useColors(),L.color=h.selectColor(E),L.extend=l,L.destroy=h.destroy,Object.defineProperty(L,"enabled",{enumerable:!0,configurable:!1,get:()=>k!==null?k:(P!==h.namespaces&&(P=h.namespaces,N=h.enabled(E)),N),set:C=>{k=C}}),typeof h.init=="function"&&h.init(L),L}function l(E,A){let k=h(this.namespace+(typeof A>"u"?":":A)+E);return k.log=this.log,k}function p(E){h.save(E),h.namespaces=E,h.names=[],h.skips=[];let A,k=(typeof E=="string"?E:"").split(/[\s,]+/),P=k.length;for(A=0;A<P;A++)k[A]&&(E=k[A].replace(/\*/g,".*?"),E[0]==="-"?h.skips.push(new RegExp("^"+E.slice(1)+"$")):h.names.push(new RegExp("^"+E+"$")))}function b(){let E=[...h.names.map(y),...h.skips.map(y).map(A=>"-"+A)].join(",");return h.enable(""),E}function g(E){if(E[E.length-1]==="*")return!0;let A,k;for(A=0,k=h.skips.length;A<k;A++)if(h.skips[A].test(E))return!1;for(A=0,k=h.names.length;A<k;A++)if(h.names[A].test(E))return!0;return!1}function y(E){return E.toString().substring(2,E.toString().length-2).replace(/\.\*\?$/,"*")}function M(E){return E instanceof Error?E.stack||E.message:E}function x(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return h.enable(h.load()),h}e.exports=r}}),yBe=Lo({"node_modules/debug/src/browser.js"(t,e){t.formatArgs=a,t.save=i,t.load=h,t.useColors=r,t.storage=l(),t.destroy=(()=>{let b=!1;return()=>{b||(b=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function r(){return typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs)?!0:typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/)?!1:typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function a(b){if(b[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+b[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;let g="color: "+this.color;b.splice(1,0,g,"color: inherit");let y=0,M=0;b[0].replace(/%[a-zA-Z%]/g,x=>{x!=="%%"&&(y++,x==="%c"&&(M=y))}),b.splice(M,0,g)}t.log=console.debug||console.log||(()=>{});function i(b){try{b?t.storage.setItem("debug",b):t.storage.removeItem("debug")}catch{}}function h(){let b;try{b=t.storage.getItem("debug")}catch{}return!b&&typeof He<"u"&&"env"in He&&(b=He.env.DEBUG),b}function l(){try{return localStorage}catch{}}e.exports=bBe()(t);var{formatters:p}=e.exports;p.j=function(b){try{return JSON.stringify(b)}catch(g){return"[UnexpectedJSONParseError]: "+g.message}}}}),wBe=Lo({"node_modules/base64-js/index.js"(t){"use strict";t.byteLength=b,t.toByteArray=y,t.fromByteArray=E;var e=[],r=[],a=typeof Uint8Array<"u"?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(h=0,l=i.length;h<l;++h)e[h]=i[h],r[i.charCodeAt(h)]=h;var h,l;r[45]=62,r[95]=63;function p(A){var k=A.length;if(k%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var P=A.indexOf("=");P===-1&&(P=k);var N=P===k?0:4-P%4;return[P,N]}function b(A){var k=p(A),P=k[0],N=k[1];return(P+N)*3/4-N}function g(A,k,P){return(k+P)*3/4-P}function y(A){var k,P=p(A),N=P[0],L=P[1],C=new a(g(A,N,L)),Y=0,G=L>0?N-4:N,ee;for(ee=0;ee<G;ee+=4)k=r[A.charCodeAt(ee)]<<18|r[A.charCodeAt(ee+1)]<<12|r[A.charCodeAt(ee+2)]<<6|r[A.charCodeAt(ee+3)],C[Y++]=k>>16&255,C[Y++]=k>>8&255,C[Y++]=k&255;return L===2&&(k=r[A.charCodeAt(ee)]<<2|r[A.charCodeAt(ee+1)]>>4,C[Y++]=k&255),L===1&&(k=r[A.charCodeAt(ee)]<<10|r[A.charCodeAt(ee+1)]<<4|r[A.charCodeAt(ee+2)]>>2,C[Y++]=k>>8&255,C[Y++]=k&255),C}function M(A){return e[A>>18&63]+e[A>>12&63]+e[A>>6&63]+e[A&63]}function x(A,k,P){for(var N,L=[],C=k;C<P;C+=3)N=(A[C]<<16&16711680)+(A[C+1]<<8&65280)+(A[C+2]&255),L.push(M(N));return L.join("")}function E(A){for(var k,P=A.length,N=P%3,L=[],C=16383,Y=0,G=P-N;Y<G;Y+=C)L.push(x(A,Y,Y+C>G?G:Y+C));return N===1?(k=A[P-1],L.push(e[k>>2]+e[k<<4&63]+"==")):N===2&&(k=(A[P-2]<<8)+A[P-1],L.push(e[k>>10]+e[k>>4&63]+e[k<<2&63]+"=")),L.join("")}}}),_Be=Lo({"node_modules/ieee754/index.js"(t){t.read=function(e,r,a,i,h){var l,p,b=h*8-i-1,g=(1<<b)-1,y=g>>1,M=-7,x=a?h-1:0,E=a?-1:1,A=e[r+x];for(x+=E,l=A&(1<<-M)-1,A>>=-M,M+=b;M>0;l=l*256+e[r+x],x+=E,M-=8);for(p=l&(1<<-M)-1,l>>=-M,M+=i;M>0;p=p*256+e[r+x],x+=E,M-=8);if(l===0)l=1-y;else{if(l===g)return p?NaN:(A?-1:1)*(1/0);p=p+Math.pow(2,i),l=l-y}return(A?-1:1)*p*Math.pow(2,l-i)},t.write=function(e,r,a,i,h,l){var p,b,g,y=l*8-h-1,M=(1<<y)-1,x=M>>1,E=h===23?Math.pow(2,-24)-Math.pow(2,-77):0,A=i?0:l-1,k=i?1:-1,P=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(b=isNaN(r)?1:0,p=M):(p=Math.floor(Math.log(r)/Math.LN2),r*(g=Math.pow(2,-p))<1&&(p--,g*=2),p+x>=1?r+=E/g:r+=E*Math.pow(2,1-x),r*g>=2&&(p++,g/=2),p+x>=M?(b=0,p=M):p+x>=1?(b=(r*g-1)*Math.pow(2,h),p=p+x):(b=r*Math.pow(2,x-1)*Math.pow(2,h),p=0));h>=8;e[a+A]=b&255,A+=k,b/=256,h-=8);for(p=p<<h|b,y+=h;y>0;e[a+A]=p&255,A+=k,p/=256,y-=8);e[a+A-k]|=P*128}}}),MBe=Lo({"node_modules/buffer/index.js"(t){"use strict";var e=wBe(),r=_Be(),a=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=p,t.SlowBuffer=L,t.INSPECT_MAX_BYTES=50;var i=2147483647;t.kMaxLength=i,p.TYPED_ARRAY_SUPPORT=h(),!p.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 h(){try{let T=new Uint8Array(1),I={foo:function(){return 42}};return Object.setPrototypeOf(I,Uint8Array.prototype),Object.setPrototypeOf(T,I),T.foo()===42}catch{return!1}}Object.defineProperty(p.prototype,"parent",{enumerable:!0,get:function(){if(p.isBuffer(this))return this.buffer}}),Object.defineProperty(p.prototype,"offset",{enumerable:!0,get:function(){if(p.isBuffer(this))return this.byteOffset}});function l(T){if(T>i)throw new RangeError('The value "'+T+'" is invalid for option "size"');let I=new Uint8Array(T);return Object.setPrototypeOf(I,p.prototype),I}function p(T,I,O){if(typeof T=="number"){if(typeof I=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return M(T)}return b(T,I,O)}p.poolSize=8192;function b(T,I,O){if(typeof T=="string")return x(T,I);if(ArrayBuffer.isView(T))return A(T);if(T==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof T);if(ut(T,ArrayBuffer)||T&&ut(T.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(ut(T,SharedArrayBuffer)||T&&ut(T.buffer,SharedArrayBuffer)))return k(T,I,O);if(typeof T=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let q=T.valueOf&&T.valueOf();if(q!=null&&q!==T)return p.from(q,I,O);let H=P(T);if(H)return H;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof T[Symbol.toPrimitive]=="function")return p.from(T[Symbol.toPrimitive]("string"),I,O);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof T)}p.from=function(T,I,O){return b(T,I,O)},Object.setPrototypeOf(p.prototype,Uint8Array.prototype),Object.setPrototypeOf(p,Uint8Array);function g(T){if(typeof T!="number")throw new TypeError('"size" argument must be of type number');if(T<0)throw new RangeError('The value "'+T+'" is invalid for option "size"')}function y(T,I,O){return g(T),T<=0?l(T):I!==void 0?typeof O=="string"?l(T).fill(I,O):l(T).fill(I):l(T)}p.alloc=function(T,I,O){return y(T,I,O)};function M(T){return g(T),l(T<0?0:N(T)|0)}p.allocUnsafe=function(T){return M(T)},p.allocUnsafeSlow=function(T){return M(T)};function x(T,I){if((typeof I!="string"||I==="")&&(I="utf8"),!p.isEncoding(I))throw new TypeError("Unknown encoding: "+I);let O=C(T,I)|0,q=l(O),H=q.write(T,I);return H!==O&&(q=q.slice(0,H)),q}function E(T){let I=T.length<0?0:N(T.length)|0,O=l(I);for(let q=0;q<I;q+=1)O[q]=T[q]&255;return O}function A(T){if(ut(T,Uint8Array)){let I=new Uint8Array(T);return k(I.buffer,I.byteOffset,I.byteLength)}return E(T)}function k(T,I,O){if(I<0||T.byteLength<I)throw new RangeError('"offset" is outside of buffer bounds');if(T.byteLength<I+(O||0))throw new RangeError('"length" is outside of buffer bounds');let q;return I===void 0&&O===void 0?q=new Uint8Array(T):O===void 0?q=new Uint8Array(T,I):q=new Uint8Array(T,I,O),Object.setPrototypeOf(q,p.prototype),q}function P(T){if(p.isBuffer(T)){let I=N(T.length)|0,O=l(I);return O.length===0||T.copy(O,0,0,I),O}if(T.length!==void 0)return typeof T.length!="number"||Ze(T.length)?l(0):E(T);if(T.type==="Buffer"&&Array.isArray(T.data))return E(T.data)}function N(T){if(T>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return T|0}function L(T){return+T!=T&&(T=0),p.alloc(+T)}p.isBuffer=function(I){return I!=null&&I._isBuffer===!0&&I!==p.prototype},p.compare=function(I,O){if(ut(I,Uint8Array)&&(I=p.from(I,I.offset,I.byteLength)),ut(O,Uint8Array)&&(O=p.from(O,O.offset,O.byteLength)),!p.isBuffer(I)||!p.isBuffer(O))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(I===O)return 0;let q=I.length,H=O.length;for(let W=0,fe=Math.min(q,H);W<fe;++W)if(I[W]!==O[W]){q=I[W],H=O[W];break}return q<H?-1:H<q?1:0},p.isEncoding=function(I){switch(String(I).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}},p.concat=function(I,O){if(!Array.isArray(I))throw new TypeError('"list" argument must be an Array of Buffers');if(I.length===0)return p.alloc(0);let q;if(O===void 0)for(O=0,q=0;q<I.length;++q)O+=I[q].length;let H=p.allocUnsafe(O),W=0;for(q=0;q<I.length;++q){let fe=I[q];if(ut(fe,Uint8Array))W+fe.length>H.length?(p.isBuffer(fe)||(fe=p.from(fe)),fe.copy(H,W)):Uint8Array.prototype.set.call(H,fe,W);else if(p.isBuffer(fe))fe.copy(H,W);else throw new TypeError('"list" argument must be an Array of Buffers');W+=fe.length}return H};function C(T,I){if(p.isBuffer(T))return T.length;if(ArrayBuffer.isView(T)||ut(T,ArrayBuffer))return T.byteLength;if(typeof T!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof T);let O=T.length,q=arguments.length>2&&arguments[2]===!0;if(!q&&O===0)return 0;let H=!1;for(;;)switch(I){case"ascii":case"latin1":case"binary":return O;case"utf8":case"utf-8":return oe(T).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O*2;case"hex":return O>>>1;case"base64":return ge(T).length;default:if(H)return q?-1:oe(T).length;I=(""+I).toLowerCase(),H=!0}}p.byteLength=C;function Y(T,I,O){let q=!1;if((I===void 0||I<0)&&(I=0),I>this.length||((O===void 0||O>this.length)&&(O=this.length),O<=0)||(O>>>=0,I>>>=0,O<=I))return"";for(T||(T="utf8");;)switch(T){case"hex":return o(this,I,O);case"utf8":case"utf-8":return u(this,I,O);case"ascii":return w(this,I,O);case"latin1":case"binary":return d(this,I,O);case"base64":return f(this,I,O);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return v(this,I,O);default:if(q)throw new TypeError("Unknown encoding: "+T);T=(T+"").toLowerCase(),q=!0}}p.prototype._isBuffer=!0;function G(T,I,O){let q=T[I];T[I]=T[O],T[O]=q}p.prototype.swap16=function(){let I=this.length;if(I%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let O=0;O<I;O+=2)G(this,O,O+1);return this},p.prototype.swap32=function(){let I=this.length;if(I%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let O=0;O<I;O+=4)G(this,O,O+3),G(this,O+1,O+2);return this},p.prototype.swap64=function(){let I=this.length;if(I%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let O=0;O<I;O+=8)G(this,O,O+7),G(this,O+1,O+6),G(this,O+2,O+5),G(this,O+3,O+4);return this},p.prototype.toString=function(){let I=this.length;return I===0?"":arguments.length===0?u(this,0,I):Y.apply(this,arguments)},p.prototype.toLocaleString=p.prototype.toString,p.prototype.equals=function(I){if(!p.isBuffer(I))throw new TypeError("Argument must be a Buffer");return this===I?!0:p.compare(this,I)===0},p.prototype.inspect=function(){let I="",O=t.INSPECT_MAX_BYTES;return I=this.toString("hex",0,O).replace(/(.{2})/g,"$1 ").trim(),this.length>O&&(I+=" ... "),"<Buffer "+I+">"},a&&(p.prototype[a]=p.prototype.inspect),p.prototype.compare=function(I,O,q,H,W){if(ut(I,Uint8Array)&&(I=p.from(I,I.offset,I.byteLength)),!p.isBuffer(I))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof I);if(O===void 0&&(O=0),q===void 0&&(q=I?I.length:0),H===void 0&&(H=0),W===void 0&&(W=this.length),O<0||q>I.length||H<0||W>this.length)throw new RangeError("out of range index");if(H>=W&&O>=q)return 0;if(H>=W)return-1;if(O>=q)return 1;if(O>>>=0,q>>>=0,H>>>=0,W>>>=0,this===I)return 0;let fe=W-H,st=q-O,ue=Math.min(fe,st),me=this.slice(H,W),pe=I.slice(O,q);for(let be=0;be<ue;++be)if(me[be]!==pe[be]){fe=me[be],st=pe[be];break}return fe<st?-1:st<fe?1:0};function ee(T,I,O,q,H){if(T.length===0)return-1;if(typeof O=="string"?(q=O,O=0):O>2147483647?O=2147483647:O<-2147483648&&(O=-2147483648),O=+O,Ze(O)&&(O=H?0:T.length-1),O<0&&(O=T.length+O),O>=T.length){if(H)return-1;O=T.length-1}else if(O<0)if(H)O=0;else return-1;if(typeof I=="string"&&(I=p.from(I,q)),p.isBuffer(I))return I.length===0?-1:D(T,I,O,q,H);if(typeof I=="number")return I=I&255,typeof Uint8Array.prototype.indexOf=="function"?H?Uint8Array.prototype.indexOf.call(T,I,O):Uint8Array.prototype.lastIndexOf.call(T,I,O):D(T,[I],O,q,H);throw new TypeError("val must be string, number or Buffer")}function D(T,I,O,q,H){let W=1,fe=T.length,st=I.length;if(q!==void 0&&(q=String(q).toLowerCase(),q==="ucs2"||q==="ucs-2"||q==="utf16le"||q==="utf-16le")){if(T.length<2||I.length<2)return-1;W=2,fe/=2,st/=2,O/=2}function ue(pe,be){return W===1?pe[be]:pe.readUInt16BE(be*W)}let me;if(H){let pe=-1;for(me=O;me<fe;me++)if(ue(T,me)===ue(I,pe===-1?0:me-pe)){if(pe===-1&&(pe=me),me-pe+1===st)return pe*W}else pe!==-1&&(me-=me-pe),pe=-1}else for(O+st>fe&&(O=fe-st),me=O;me>=0;me--){let pe=!0;for(let be=0;be<st;be++)if(ue(T,me+be)!==ue(I,be)){pe=!1;break}if(pe)return me}return-1}p.prototype.includes=function(I,O,q){return this.indexOf(I,O,q)!==-1},p.prototype.indexOf=function(I,O,q){return ee(this,I,O,q,!0)},p.prototype.lastIndexOf=function(I,O,q){return ee(this,I,O,q,!1)};function U(T,I,O,q){O=Number(O)||0;let H=T.length-O;q?(q=Number(q),q>H&&(q=H)):q=H;let W=I.length;q>W/2&&(q=W/2);let fe;for(fe=0;fe<q;++fe){let st=parseInt(I.substr(fe*2,2),16);if(Ze(st))return fe;T[O+fe]=st}return fe}function V(T,I,O,q){return Se(oe(I,T.length-O),T,O,q)}function _(T,I,O,q){return Se(ce(I),T,O,q)}function n(T,I,O,q){return Se(ge(I),T,O,q)}function s(T,I,O,q){return Se(ot(I,T.length-O),T,O,q)}p.prototype.write=function(I,O,q,H){if(O===void 0)H="utf8",q=this.length,O=0;else if(q===void 0&&typeof O=="string")H=O,q=this.length,O=0;else if(isFinite(O))O=O>>>0,isFinite(q)?(q=q>>>0,H===void 0&&(H="utf8")):(H=q,q=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let W=this.length-O;if((q===void 0||q>W)&&(q=W),I.length>0&&(q<0||O<0)||O>this.length)throw new RangeError("Attempt to write outside buffer bounds");H||(H="utf8");let fe=!1;for(;;)switch(H){case"hex":return U(this,I,O,q);case"utf8":case"utf-8":return V(this,I,O,q);case"ascii":case"latin1":case"binary":return _(this,I,O,q);case"base64":return n(this,I,O,q);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return s(this,I,O,q);default:if(fe)throw new TypeError("Unknown encoding: "+H);H=(""+H).toLowerCase(),fe=!0}},p.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function f(T,I,O){return I===0&&O===T.length?e.fromByteArray(T):e.fromByteArray(T.slice(I,O))}function u(T,I,O){O=Math.min(T.length,O);let q=[],H=I;for(;H<O;){let W=T[H],fe=null,st=W>239?4:W>223?3:W>191?2:1;if(H+st<=O){let ue,me,pe,be;switch(st){case 1:W<128&&(fe=W);break;case 2:ue=T[H+1],(ue&192)===128&&(be=(W&31)<<6|ue&63,be>127&&(fe=be));break;case 3:ue=T[H+1],me=T[H+2],(ue&192)===128&&(me&192)===128&&(be=(W&15)<<12|(ue&63)<<6|me&63,be>2047&&(be<55296||be>57343)&&(fe=be));break;case 4:ue=T[H+1],me=T[H+2],pe=T[H+3],(ue&192)===128&&(me&192)===128&&(pe&192)===128&&(be=(W&15)<<18|(ue&63)<<12|(me&63)<<6|pe&63,be>65535&&be<1114112&&(fe=be))}}fe===null?(fe=65533,st=1):fe>65535&&(fe-=65536,q.push(fe>>>10&1023|55296),fe=56320|fe&1023),q.push(fe),H+=st}return m(q)}var c=4096;function m(T){let I=T.length;if(I<=c)return String.fromCharCode.apply(String,T);let O="",q=0;for(;q<I;)O+=String.fromCharCode.apply(String,T.slice(q,q+=c));return O}function w(T,I,O){let q="";O=Math.min(T.length,O);for(let H=I;H<O;++H)q+=String.fromCharCode(T[H]&127);return q}function d(T,I,O){let q="";O=Math.min(T.length,O);for(let H=I;H<O;++H)q+=String.fromCharCode(T[H]);return q}function o(T,I,O){let q=T.length;(!I||I<0)&&(I=0),(!O||O<0||O>q)&&(O=q);let H="";for(let W=I;W<O;++W)H+=Ge[T[W]];return H}function v(T,I,O){let q=T.slice(I,O),H="";for(let W=0;W<q.length-1;W+=2)H+=String.fromCharCode(q[W]+q[W+1]*256);return H}p.prototype.slice=function(I,O){let q=this.length;I=~~I,O=O===void 0?q:~~O,I<0?(I+=q,I<0&&(I=0)):I>q&&(I=q),O<0?(O+=q,O<0&&(O=0)):O>q&&(O=q),O<I&&(O=I);let H=this.subarray(I,O);return Object.setPrototypeOf(H,p.prototype),H};function R(T,I,O){if(T%1!==0||T<0)throw new RangeError("offset is not uint");if(T+I>O)throw new RangeError("Trying to access beyond buffer length")}p.prototype.readUintLE=p.prototype.readUIntLE=function(I,O,q){I=I>>>0,O=O>>>0,q||R(I,O,this.length);let H=this[I],W=1,fe=0;for(;++fe<O&&(W*=256);)H+=this[I+fe]*W;return H},p.prototype.readUintBE=p.prototype.readUIntBE=function(I,O,q){I=I>>>0,O=O>>>0,q||R(I,O,this.length);let H=this[I+--O],W=1;for(;O>0&&(W*=256);)H+=this[I+--O]*W;return H},p.prototype.readUint8=p.prototype.readUInt8=function(I,O){return I=I>>>0,O||R(I,1,this.length),this[I]},p.prototype.readUint16LE=p.prototype.readUInt16LE=function(I,O){return I=I>>>0,O||R(I,2,this.length),this[I]|this[I+1]<<8},p.prototype.readUint16BE=p.prototype.readUInt16BE=function(I,O){return I=I>>>0,O||R(I,2,this.length),this[I]<<8|this[I+1]},p.prototype.readUint32LE=p.prototype.readUInt32LE=function(I,O){return I=I>>>0,O||R(I,4,this.length),(this[I]|this[I+1]<<8|this[I+2]<<16)+this[I+3]*16777216},p.prototype.readUint32BE=p.prototype.readUInt32BE=function(I,O){return I=I>>>0,O||R(I,4,this.length),this[I]*16777216+(this[I+1]<<16|this[I+2]<<8|this[I+3])},p.prototype.readBigUInt64LE=lt(function(I){I=I>>>0,J(I,"offset");let O=this[I],q=this[I+7];(O===void 0||q===void 0)&&X(I,this.length-8);let H=O+this[++I]*2**8+this[++I]*2**16+this[++I]*2**24,W=this[++I]+this[++I]*2**8+this[++I]*2**16+q*2**24;return BigInt(H)+(BigInt(W)<<BigInt(32))}),p.prototype.readBigUInt64BE=lt(function(I){I=I>>>0,J(I,"offset");let O=this[I],q=this[I+7];(O===void 0||q===void 0)&&X(I,this.length-8);let H=O*2**24+this[++I]*2**16+this[++I]*2**8+this[++I],W=this[++I]*2**24+this[++I]*2**16+this[++I]*2**8+q;return(BigInt(H)<<BigInt(32))+BigInt(W)}),p.prototype.readIntLE=function(I,O,q){I=I>>>0,O=O>>>0,q||R(I,O,this.length);let H=this[I],W=1,fe=0;for(;++fe<O&&(W*=256);)H+=this[I+fe]*W;return W*=128,H>=W&&(H-=Math.pow(2,8*O)),H},p.prototype.readIntBE=function(I,O,q){I=I>>>0,O=O>>>0,q||R(I,O,this.length);let H=O,W=1,fe=this[I+--H];for(;H>0&&(W*=256);)fe+=this[I+--H]*W;return W*=128,fe>=W&&(fe-=Math.pow(2,8*O)),fe},p.prototype.readInt8=function(I,O){return I=I>>>0,O||R(I,1,this.length),this[I]&128?(255-this[I]+1)*-1:this[I]},p.prototype.readInt16LE=function(I,O){I=I>>>0,O||R(I,2,this.length);let q=this[I]|this[I+1]<<8;return q&32768?q|4294901760:q},p.prototype.readInt16BE=function(I,O){I=I>>>0,O||R(I,2,this.length);let q=this[I+1]|this[I]<<8;return q&32768?q|4294901760:q},p.prototype.readInt32LE=function(I,O){return I=I>>>0,O||R(I,4,this.length),this[I]|this[I+1]<<8|this[I+2]<<16|this[I+3]<<24},p.prototype.readInt32BE=function(I,O){return I=I>>>0,O||R(I,4,this.length),this[I]<<24|this[I+1]<<16|this[I+2]<<8|this[I+3]},p.prototype.readBigInt64LE=lt(function(I){I=I>>>0,J(I,"offset");let O=this[I],q=this[I+7];(O===void 0||q===void 0)&&X(I,this.length-8);let H=this[I+4]+this[I+5]*2**8+this[I+6]*2**16+(q<<24);return(BigInt(H)<<BigInt(32))+BigInt(O+this[++I]*2**8+this[++I]*2**16+this[++I]*2**24)}),p.prototype.readBigInt64BE=lt(function(I){I=I>>>0,J(I,"offset");let O=this[I],q=this[I+7];(O===void 0||q===void 0)&&X(I,this.length-8);let H=(O<<24)+this[++I]*2**16+this[++I]*2**8+this[++I];return(BigInt(H)<<BigInt(32))+BigInt(this[++I]*2**24+this[++I]*2**16+this[++I]*2**8+q)}),p.prototype.readFloatLE=function(I,O){return I=I>>>0,O||R(I,4,this.length),r.read(this,I,!0,23,4)},p.prototype.readFloatBE=function(I,O){return I=I>>>0,O||R(I,4,this.length),r.read(this,I,!1,23,4)},p.prototype.readDoubleLE=function(I,O){return I=I>>>0,O||R(I,8,this.length),r.read(this,I,!0,52,8)},p.prototype.readDoubleBE=function(I,O){return I=I>>>0,O||R(I,8,this.length),r.read(this,I,!1,52,8)};function S(T,I,O,q,H,W){if(!p.isBuffer(T))throw new TypeError('"buffer" argument must be a Buffer instance');if(I>H||I<W)throw new RangeError('"value" argument is out of bounds');if(O+q>T.length)throw new RangeError("Index out of range")}p.prototype.writeUintLE=p.prototype.writeUIntLE=function(I,O,q,H){if(I=+I,O=O>>>0,q=q>>>0,!H){let st=Math.pow(2,8*q)-1;S(this,I,O,q,st,0)}let W=1,fe=0;for(this[O]=I&255;++fe<q&&(W*=256);)this[O+fe]=I/W&255;return O+q},p.prototype.writeUintBE=p.prototype.writeUIntBE=function(I,O,q,H){if(I=+I,O=O>>>0,q=q>>>0,!H){let st=Math.pow(2,8*q)-1;S(this,I,O,q,st,0)}let W=q-1,fe=1;for(this[O+W]=I&255;--W>=0&&(fe*=256);)this[O+W]=I/fe&255;return O+q},p.prototype.writeUint8=p.prototype.writeUInt8=function(I,O,q){return I=+I,O=O>>>0,q||S(this,I,O,1,255,0),this[O]=I&255,O+1},p.prototype.writeUint16LE=p.prototype.writeUInt16LE=function(I,O,q){return I=+I,O=O>>>0,q||S(this,I,O,2,65535,0),this[O]=I&255,this[O+1]=I>>>8,O+2},p.prototype.writeUint16BE=p.prototype.writeUInt16BE=function(I,O,q){return I=+I,O=O>>>0,q||S(this,I,O,2,65535,0),this[O]=I>>>8,this[O+1]=I&255,O+2},p.prototype.writeUint32LE=p.prototype.writeUInt32LE=function(I,O,q){return I=+I,O=O>>>0,q||S(this,I,O,4,4294967295,0),this[O+3]=I>>>24,this[O+2]=I>>>16,this[O+1]=I>>>8,this[O]=I&255,O+4},p.prototype.writeUint32BE=p.prototype.writeUInt32BE=function(I,O,q){return I=+I,O=O>>>0,q||S(this,I,O,4,4294967295,0),this[O]=I>>>24,this[O+1]=I>>>16,this[O+2]=I>>>8,this[O+3]=I&255,O+4};function B(T,I,O,q,H){j(I,q,H,T,O,7);let W=Number(I&BigInt(4294967295));T[O++]=W,W=W>>8,T[O++]=W,W=W>>8,T[O++]=W,W=W>>8,T[O++]=W;let fe=Number(I>>BigInt(32)&BigInt(4294967295));return T[O++]=fe,fe=fe>>8,T[O++]=fe,fe=fe>>8,T[O++]=fe,fe=fe>>8,T[O++]=fe,O}function F(T,I,O,q,H){j(I,q,H,T,O,7);let W=Number(I&BigInt(4294967295));T[O+7]=W,W=W>>8,T[O+6]=W,W=W>>8,T[O+5]=W,W=W>>8,T[O+4]=W;let fe=Number(I>>BigInt(32)&BigInt(4294967295));return T[O+3]=fe,fe=fe>>8,T[O+2]=fe,fe=fe>>8,T[O+1]=fe,fe=fe>>8,T[O]=fe,O+8}p.prototype.writeBigUInt64LE=lt(function(I,O=0){return B(this,I,O,BigInt(0),BigInt("0xffffffffffffffff"))}),p.prototype.writeBigUInt64BE=lt(function(I,O=0){return F(this,I,O,BigInt(0),BigInt("0xffffffffffffffff"))}),p.prototype.writeIntLE=function(I,O,q,H){if(I=+I,O=O>>>0,!H){let ue=Math.pow(2,8*q-1);S(this,I,O,q,ue-1,-ue)}let W=0,fe=1,st=0;for(this[O]=I&255;++W<q&&(fe*=256);)I<0&&st===0&&this[O+W-1]!==0&&(st=1),this[O+W]=(I/fe>>0)-st&255;return O+q},p.prototype.writeIntBE=function(I,O,q,H){if(I=+I,O=O>>>0,!H){let ue=Math.pow(2,8*q-1);S(this,I,O,q,ue-1,-ue)}let W=q-1,fe=1,st=0;for(this[O+W]=I&255;--W>=0&&(fe*=256);)I<0&&st===0&&this[O+W+1]!==0&&(st=1),this[O+W]=(I/fe>>0)-st&255;return O+q},p.prototype.writeInt8=function(I,O,q){return I=+I,O=O>>>0,q||S(this,I,O,1,127,-128),I<0&&(I=255+I+1),this[O]=I&255,O+1},p.prototype.writeInt16LE=function(I,O,q){return I=+I,O=O>>>0,q||S(this,I,O,2,32767,-32768),this[O]=I&255,this[O+1]=I>>>8,O+2},p.prototype.writeInt16BE=function(I,O,q){return I=+I,O=O>>>0,q||S(this,I,O,2,32767,-32768),this[O]=I>>>8,this[O+1]=I&255,O+2},p.prototype.writeInt32LE=function(I,O,q){return I=+I,O=O>>>0,q||S(this,I,O,4,2147483647,-2147483648),this[O]=I&255,this[O+1]=I>>>8,this[O+2]=I>>>16,this[O+3]=I>>>24,O+4},p.prototype.writeInt32BE=function(I,O,q){return I=+I,O=O>>>0,q||S(this,I,O,4,2147483647,-2147483648),I<0&&(I=4294967295+I+1),this[O]=I>>>24,this[O+1]=I>>>16,this[O+2]=I>>>8,this[O+3]=I&255,O+4},p.prototype.writeBigInt64LE=lt(function(I,O=0){return B(this,I,O,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),p.prototype.writeBigInt64BE=lt(function(I,O=0){return F(this,I,O,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function $(T,I,O,q,H,W){if(O+q>T.length)throw new RangeError("Index out of range");if(O<0)throw new RangeError("Index out of range")}function re(T,I,O,q,H){return I=+I,O=O>>>0,H||$(T,I,O,4,34028234663852886e22,-34028234663852886e22),r.write(T,I,O,q,23,4),O+4}p.prototype.writeFloatLE=function(I,O,q){return re(this,I,O,!0,q)},p.prototype.writeFloatBE=function(I,O,q){return re(this,I,O,!1,q)};function Q(T,I,O,q,H){return I=+I,O=O>>>0,H||$(T,I,O,8,17976931348623157e292,-17976931348623157e292),r.write(T,I,O,q,52,8),O+8}p.prototype.writeDoubleLE=function(I,O,q){return Q(this,I,O,!0,q)},p.prototype.writeDoubleBE=function(I,O,q){return Q(this,I,O,!1,q)},p.prototype.copy=function(I,O,q,H){if(!p.isBuffer(I))throw new TypeError("argument should be a Buffer");if(q||(q=0),!H&&H!==0&&(H=this.length),O>=I.length&&(O=I.length),O||(O=0),H>0&&H<q&&(H=q),H===q||I.length===0||this.length===0)return 0;if(O<0)throw new RangeError("targetStart out of bounds");if(q<0||q>=this.length)throw new RangeError("Index out of range");if(H<0)throw new RangeError("sourceEnd out of bounds");H>this.length&&(H=this.length),I.length-O<H-q&&(H=I.length-O+q);let W=H-q;return this===I&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(O,q,H):Uint8Array.prototype.set.call(I,this.subarray(q,H),O),W},p.prototype.fill=function(I,O,q,H){if(typeof I=="string"){if(typeof O=="string"?(H=O,O=0,q=this.length):typeof q=="string"&&(H=q,q=this.length),H!==void 0&&typeof H!="string")throw new TypeError("encoding must be a string");if(typeof H=="string"&&!p.isEncoding(H))throw new TypeError("Unknown encoding: "+H);if(I.length===1){let fe=I.charCodeAt(0);(H==="utf8"&&fe<128||H==="latin1")&&(I=fe)}}else typeof I=="number"?I=I&255:typeof I=="boolean"&&(I=Number(I));if(O<0||this.length<O||this.length<q)throw new RangeError("Out of range index");if(q<=O)return this;O=O>>>0,q=q===void 0?this.length:q>>>0,I||(I=0);let W;if(typeof I=="number")for(W=O;W<q;++W)this[W]=I;else{let fe=p.isBuffer(I)?I:p.from(I,H),st=fe.length;if(st===0)throw new TypeError('The value "'+I+'" is invalid for argument "value"');for(W=0;W<q-O;++W)this[W+O]=fe[W%st]}return this};var Z={};function K(T,I,O){Z[T]=class extends O{constructor(){super(),Object.defineProperty(this,"message",{value:I.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${T}]`,this.stack,delete this.name}get code(){return T}set code(H){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:H,writable:!0})}toString(){return`${this.name} [${T}]: ${this.message}`}}}K("ERR_BUFFER_OUT_OF_BOUNDS",function(T){return T?`${T} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),K("ERR_INVALID_ARG_TYPE",function(T,I){return`The "${T}" argument must be of type number. Received type ${typeof I}`},TypeError),K("ERR_OUT_OF_RANGE",function(T,I,O){let q=`The value of "${T}" is out of range.`,H=O;return Number.isInteger(O)&&Math.abs(O)>2**32?H=le(String(O)):typeof O=="bigint"&&(H=String(O),(O>BigInt(2)**BigInt(32)||O<-(BigInt(2)**BigInt(32)))&&(H=le(H)),H+="n"),q+=` It must be ${I}. Received ${H}`,q},RangeError);function le(T){let I="",O=T.length,q=T[0]==="-"?1:0;for(;O>=q+4;O-=3)I=`_${T.slice(O-3,O)}${I}`;return`${T.slice(0,O)}${I}`}function te(T,I,O){J(I,"offset"),(T[I]===void 0||T[I+O]===void 0)&&X(I,T.length-(O+1))}function j(T,I,O,q,H,W){if(T>O||T<I){let fe=typeof I=="bigint"?"n":"",st;throw W>3?I===0||I===BigInt(0)?st=`>= 0${fe} and < 2${fe} ** ${(W+1)*8}${fe}`:st=`>= -(2${fe} ** ${(W+1)*8-1}${fe}) and < 2 ** ${(W+1)*8-1}${fe}`:st=`>= ${I}${fe} and <= ${O}${fe}`,new Z.ERR_OUT_OF_RANGE("value",st,T)}te(q,H,W)}function J(T,I){if(typeof T!="number")throw new Z.ERR_INVALID_ARG_TYPE(I,"number",T)}function X(T,I,O){throw Math.floor(T)!==T?(J(T,O),new Z.ERR_OUT_OF_RANGE(O||"offset","an integer",T)):I<0?new Z.ERR_BUFFER_OUT_OF_BOUNDS:new Z.ERR_OUT_OF_RANGE(O||"offset",`>= ${O?1:0} and <= ${I}`,T)}var he=/[^+/0-9A-Za-z-_]/g;function Te(T){if(T=T.split("=")[0],T=T.trim().replace(he,""),T.length<2)return"";for(;T.length%4!==0;)T=T+"=";return T}function oe(T,I){I=I||1/0;let O,q=T.length,H=null,W=[];for(let fe=0;fe<q;++fe){if(O=T.charCodeAt(fe),O>55295&&O<57344){if(!H){if(O>56319){(I-=3)>-1&&W.push(239,191,189);continue}else if(fe+1===q){(I-=3)>-1&&W.push(239,191,189);continue}H=O;continue}if(O<56320){(I-=3)>-1&&W.push(239,191,189),H=O;continue}O=(H-55296<<10|O-56320)+65536}else H&&(I-=3)>-1&&W.push(239,191,189);if(H=null,O<128){if((I-=1)<0)break;W.push(O)}else if(O<2048){if((I-=2)<0)break;W.push(O>>6|192,O&63|128)}else if(O<65536){if((I-=3)<0)break;W.push(O>>12|224,O>>6&63|128,O&63|128)}else if(O<1114112){if((I-=4)<0)break;W.push(O>>18|240,O>>12&63|128,O>>6&63|128,O&63|128)}else throw new Error("Invalid code point")}return W}function ce(T){let I=[];for(let O=0;O<T.length;++O)I.push(T.charCodeAt(O)&255);return I}function ot(T,I){let O,q,H,W=[];for(let fe=0;fe<T.length&&!((I-=2)<0);++fe)O=T.charCodeAt(fe),q=O>>8,H=O%256,W.push(H),W.push(q);return W}function ge(T){return e.toByteArray(Te(T))}function Se(T,I,O,q){let H;for(H=0;H<q&&!(H+O>=I.length||H>=T.length);++H)I[H+O]=T[H];return H}function ut(T,I){return T instanceof I||T!=null&&T.constructor!=null&&T.constructor.name!=null&&T.constructor.name===I.name}function Ze(T){return T!==T}var Ge=function(){let T="0123456789abcdef",I=new Array(256);for(let O=0;O<16;++O){let q=O*16;for(let H=0;H<16;++H)I[q+H]=T[O]+T[H]}return I}();function lt(T){return typeof BigInt>"u"?z:T}function z(){throw new Error("BigInt not supported")}}}),xBe={"@@functional/placeholder":!0};function Yi(t){return t===xBe}function Fa(t){return function e(r){return arguments.length===0||Yi(r)?e:t.apply(this,arguments)}}function Fn(t){return function e(r,a){switch(arguments.length){case 0:return e;case 1:return Yi(r)?e:Fa(function(i){return t(r,i)});default:return Yi(r)&&Yi(a)?e:Yi(r)?Fa(function(i){return t(i,a)}):Yi(a)?Fa(function(i){return t(r,i)}):t(r,a)}}}function Sw(t,e){switch(t){case 0:return function(){return e.apply(this,arguments)};case 1:return function(r){return e.apply(this,arguments)};case 2:return function(r,a){return e.apply(this,arguments)};case 3:return function(r,a,i){return e.apply(this,arguments)};case 4:return function(r,a,i,h){return e.apply(this,arguments)};case 5:return function(r,a,i,h,l){return e.apply(this,arguments)};case 6:return function(r,a,i,h,l,p){return e.apply(this,arguments)};case 7:return function(r,a,i,h,l,p,b){return e.apply(this,arguments)};case 8:return function(r,a,i,h,l,p,b,g){return e.apply(this,arguments)};case 9:return function(r,a,i,h,l,p,b,g,y){return e.apply(this,arguments)};case 10:return function(r,a,i,h,l,p,b,g,y,M){return e.apply(this,arguments)};default:throw new Error("First argument to _arity must be a non-negative integer no greater than ten")}}function doe(t,e,r){return function(){for(var a=[],i=0,h=t,l=0,p=!1;l<e.length||i<arguments.length;){var b;l<e.length&&(!Yi(e[l])||i>=arguments.length)?b=e[l]:(b=arguments[i],i+=1),a[l]=b,Yi(b)?p=!0:h-=1,l+=1}return!p&&h<=0?r.apply(this,a):Sw(Math.max(0,h),doe(t,a,r))}}var SBe=Fn(function(t,e){return t===1?Fa(e):Sw(t,doe(t,[],e))}),poe=SBe;function hB(t){return function e(r,a,i){switch(arguments.length){case 0:return e;case 1:return Yi(r)?e:Fn(function(h,l){return t(r,h,l)});case 2:return Yi(r)&&Yi(a)?e:Yi(r)?Fn(function(h,l){return t(h,a,l)}):Yi(a)?Fn(function(h,l){return t(r,h,l)}):Fa(function(h){return t(r,a,h)});default:return Yi(r)&&Yi(a)&&Yi(i)?e:Yi(r)&&Yi(a)?Fn(function(h,l){return t(h,l,i)}):Yi(r)&&Yi(i)?Fn(function(h,l){return t(h,a,l)}):Yi(a)&&Yi(i)?Fn(function(h,l){return t(r,h,l)}):Yi(r)?Fa(function(h){return t(h,a,i)}):Yi(a)?Fa(function(h){return t(r,h,i)}):Yi(i)?Fa(function(h){return t(r,a,h)}):t(r,a,i)}}}var lB=Array.isArray||function(t){return t!=null&&t.length>=0&&Object.prototype.toString.call(t)==="[object Array]"};function EBe(t){return t!=null&&typeof t["@@transducer/step"]=="function"}function cB(t,e,r){return function(){if(arguments.length===0)return r();var a=arguments[arguments.length-1];if(!lB(a)){for(var i=0;i<t.length;){if(typeof a[t[i]]=="function")return a[t[i]].apply(a,Array.prototype.slice.call(arguments,0,-1));i+=1}if(EBe(a)){var h=e.apply(null,Array.prototype.slice.call(arguments,0,-1));return h(a)}}return r.apply(this,arguments)}}function ABe(t){return t&&t["@@transducer/reduced"]?t:{"@@transducer/value":t,"@@transducer/reduced":!0}}var B2={init:function(){return this.xf["@@transducer/init"]()},result:function(t){return this.xf["@@transducer/result"](t)}};function qae(t){for(var e=[],r;!(r=t.next()).done;)e.push(r.value);return e}function Uae(t,e,r){for(var a=0,i=r.length;a<i;){if(t(e,r[a]))return!0;a+=1}return!1}function RBe(t){var e=String(t).match(/^function (\w*)/);return e==null?"":e[1]}function ew(t,e){return Object.prototype.hasOwnProperty.call(e,t)}function TBe(t,e){return t===e?t!==0||1/t===1/e:t!==t&&e!==e}var AI=typeof Object.is=="function"?Object.is:TBe,Fae=Object.prototype.toString,kBe=function(){return Fae.call(arguments)==="[object Arguments]"?function(t){return Fae.call(t)==="[object Arguments]"}:function(t){return ew("callee",t)}}(),IBe=kBe,BBe=!{toString:null}.propertyIsEnumerable("toString"),jae=["constructor","valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],zae=function(){"use strict";return arguments.propertyIsEnumerable("length")}(),PBe=function(t,e){for(var r=0;r<t.length;){if(t[r]===e)return!0;r+=1}return!1},OBe=Fa(typeof Object.keys=="function"&&!zae?function(t){return Object(t)!==t?[]:Object.keys(t)}:function(t){if(Object(t)!==t)return[];var e,r,a=[],i=zae&&IBe(t);for(e in t)ew(e,t)&&(!i||e!=="length")&&(a[a.length]=e);if(BBe)for(r=jae.length-1;r>=0;)e=jae[r],ew(e,t)&&!PBe(a,e)&&(a[a.length]=e),r-=1;return a}),ev=OBe,NBe=Fa(function(t){return t===null?"Null":t===void 0?"Undefined":Object.prototype.toString.call(t).slice(8,-1)}),Zae=NBe;function Hae(t,e,r,a){var i=qae(t),h=qae(e);function l(p,b){return dB(p,b,r.slice(),a.slice())}return!Uae(function(p,b){return!Uae(l,b,p)},h,i)}function dB(t,e,r,a){if(AI(t,e))return!0;var i=Zae(t);if(i!==Zae(e))return!1;if(typeof t["fantasy-land/equals"]=="function"||typeof e["fantasy-land/equals"]=="function")return typeof t["fantasy-land/equals"]=="function"&&t["fantasy-land/equals"](e)&&typeof e["fantasy-land/equals"]=="function"&&e["fantasy-land/equals"](t);if(typeof t.equals=="function"||typeof e.equals=="function")return typeof t.equals=="function"&&t.equals(e)&&typeof e.equals=="function"&&e.equals(t);switch(i){case"Arguments":case"Array":case"Object":if(typeof t.constructor=="function"&&RBe(t.constructor)==="Promise")return t===e;break;case"Boolean":case"Number":case"String":if(!(typeof t==typeof e&&AI(t.valueOf(),e.valueOf())))return!1;break;case"Date":if(!AI(t.valueOf(),e.valueOf()))return!1;break;case"Error":return t.name===e.name&&t.message===e.message;case"RegExp":if(!(t.source===e.source&&t.global===e.global&&t.ignoreCase===e.ignoreCase&&t.multiline===e.multiline&&t.sticky===e.sticky&&t.unicode===e.unicode))return!1;break}for(var h=r.length-1;h>=0;){if(r[h]===t)return a[h]===e;h-=1}switch(i){case"Map":return t.size!==e.size?!1:Hae(t.entries(),e.entries(),r.concat([t]),a.concat([e]));case"Set":return t.size!==e.size?!1:Hae(t.values(),e.values(),r.concat([t]),a.concat([e]));case"Arguments":case"Array":case"Object":case"Boolean":case"Number":case"String":case"Date":case"Error":case"RegExp":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"ArrayBuffer":break;default:return!1}var l=ev(t);if(l.length!==ev(e).length)return!1;var p=r.concat([t]),b=a.concat([e]);for(h=l.length-1;h>=0;){var g=l[h];if(!(ew(g,e)&&dB(e[g],t[g],p,b)))return!1;h-=1}return!0}var CBe=Fn(function(t,e){return dB(t,e,[],[])}),voe=CBe;function LBe(t,e,r){var a,i;if(typeof t.indexOf=="function")switch(typeof e){case"number":if(e===0){for(a=1/e;r<t.length;){if(i=t[r],i===0&&1/i===a)return r;r+=1}return-1}else if(e!==e){for(;r<t.length;){if(i=t[r],typeof i=="number"&&i!==i)return r;r+=1}return-1}return t.indexOf(e,r);case"string":case"boolean":case"function":case"undefined":return t.indexOf(e,r);case"object":if(e===null)return t.indexOf(e,r)}for(;r<t.length;){if(voe(t[r],e))return r;r+=1}return-1}function DBe(t,e){return LBe(e,t,0)>=0}function k2(t,e){for(var r=0,a=e.length,i=Array(a);r<a;)i[r]=t(e[r]),r+=1;return i}function RI(t){var e=t.replace(/\\/g,"\\\\").replace(/[\b]/g,"\\b").replace(/\f/g,"\\f").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/\v/g,"\\v").replace(/\0/g,"\\0");return'"'+e.replace(/"/g,'\\"')+'"'}var b2=function(t){return(t<10?"0":"")+t},$Be=typeof Date.prototype.toISOString=="function"?function(t){return t.toISOString()}:function(t){return t.getUTCFullYear()+"-"+b2(t.getUTCMonth()+1)+"-"+b2(t.getUTCDate())+"T"+b2(t.getUTCHours())+":"+b2(t.getUTCMinutes())+":"+b2(t.getUTCSeconds())+"."+(t.getUTCMilliseconds()/1e3).toFixed(3).slice(2,5)+"Z"},qBe=$Be;function UBe(t){return function(){return!t.apply(this,arguments)}}function moe(t,e,r){for(var a=0,i=r.length;a<i;)e=t(e,r[a]),a+=1;return e}function FBe(t,e){for(var r=0,a=e.length,i=[];r<a;)t(e[r])&&(i[i.length]=e[r]),r+=1;return i}function jBe(t){return Object.prototype.toString.call(t)==="[object Object]"}var zBe=function(){function t(e,r){this.xf=r,this.f=e}return t.prototype["@@transducer/init"]=B2.init,t.prototype["@@transducer/result"]=B2.result,t.prototype["@@transducer/step"]=function(e,r){return this.f(r)?this.xf["@@transducer/step"](e,r):e},t}();function ZBe(t){return function(e){return new zBe(t,e)}}var HBe=Fn(cB(["fantasy-land/filter","filter"],ZBe,function(t,e){return jBe(e)?moe(function(r,a){return t(e[a])&&(r[a]=e[a]),r},{},ev(e)):FBe(t,e)})),KBe=HBe,WBe=Fn(function(t,e){return KBe(UBe(t),e)}),VBe=WBe;function goe(t,e){var r=function(h){var l=e.concat([t]);return DBe(h,l)?"<Circular>":goe(h,l)},a=function(h,l){return k2(function(p){return RI(p)+": "+r(h[p])},l.slice().sort())};switch(Object.prototype.toString.call(t)){case"[object Arguments]":return"(function() { return arguments; }("+k2(r,t).join(", ")+"))";case"[object Array]":return"["+k2(r,t).concat(a(t,VBe(function(h){return/^\d+$/.test(h)},ev(t)))).join(", ")+"]";case"[object Boolean]":return typeof t=="object"?"new Boolean("+r(t.valueOf())+")":t.toString();case"[object Date]":return"new Date("+(isNaN(t.valueOf())?r(NaN):RI(qBe(t)))+")";case"[object Map]":return"new Map("+r(Array.from(t))+")";case"[object Null]":return"null";case"[object Number]":return typeof t=="object"?"new Number("+r(t.valueOf())+")":1/t===-1/0?"-0":t.toString(10);case"[object Set]":return"new Set("+r(Array.from(t).sort())+")";case"[object String]":return typeof t=="object"?"new String("+r(t.valueOf())+")":RI(t);case"[object Undefined]":return"undefined";default:if(typeof t.toString=="function"){var i=t.toString();if(i!=="[object Object]")return i}return"{"+a(t,ev(t)).join(", ")+"}"}}var GBe=Fa(function(t){return goe(t,[])}),Kae=GBe,YBe=Fn(function(t,e){if(t===e)return e;function r(p,b){if(p>b!=b>p)return b>p?b:p}var a=r(t,e);if(a!==void 0)return a;var i=r(typeof t,typeof e);if(i!==void 0)return i===typeof t?t:e;var h=Kae(t),l=r(h,Kae(e));return l!==void 0&&l===h?t:e}),JBe=YBe,XBe=function(){function t(e,r){this.xf=r,this.f=e}return t.prototype["@@transducer/init"]=B2.init,t.prototype["@@transducer/result"]=B2.result,t.prototype["@@transducer/step"]=function(e,r){return this.xf["@@transducer/step"](e,this.f(r))},t}(),QBe=function(t){return function(e){return new XBe(t,e)}},ePe=QBe,tPe=Fn(cB(["fantasy-land/map","map"],ePe,function(t,e){switch(Object.prototype.toString.call(e)){case"[object Function]":return poe(e.length,function(){return t.call(this,e.apply(this,arguments))});case"[object Object]":return moe(function(r,a){return r[a]=t(e[a]),r},{},ev(e));default:return k2(t,e)}})),rPe=tPe,boe=Number.isInteger||function(t){return t<<0===t};function yoe(t){return Object.prototype.toString.call(t)==="[object String]"}function woe(t,e){var r=t<0?e.length+t:t;return yoe(e)?e.charAt(r):e[r]}var iPe=Fn(function(t,e){if(e!=null)return boe(t)?woe(t,e):e[t]}),Ew=iPe,nPe=Fn(function(t,e){return rPe(Ew(t),e)}),aPe=nPe,oPe=Fa(function(t){return lB(t)?!0:!t||typeof t!="object"||yoe(t)?!1:t.length===0?!0:t.length>0?t.hasOwnProperty(0)&&t.hasOwnProperty(t.length-1):!1}),sPe=oPe,Wae=typeof Symbol<"u"?Symbol.iterator:"@@iterator";function fPe(t,e,r){return function(a,i,h){if(sPe(h))return t(a,i,h);if(h==null)return i;if(typeof h["fantasy-land/reduce"]=="function")return e(a,i,h,"fantasy-land/reduce");if(h[Wae]!=null)return r(a,i,h[Wae]());if(typeof h.next=="function")return r(a,i,h);if(typeof h.reduce=="function")return e(a,i,h,"reduce");throw new TypeError("reduce: list must be array or iterable")}}function uPe(t,e,r){for(var a=0,i=r.length;a<i;){if(e=t["@@transducer/step"](e,r[a]),e&&e["@@transducer/reduced"]){e=e["@@transducer/value"];break}a+=1}return t["@@transducer/result"](e)}var hPe=Fn(function(t,e){return Sw(t.length,function(){return t.apply(e,arguments)})}),lPe=hPe;function cPe(t,e,r){for(var a=r.next();!a.done;){if(e=t["@@transducer/step"](e,a.value),e&&e["@@transducer/reduced"]){e=e["@@transducer/value"];break}a=r.next()}return t["@@transducer/result"](e)}function dPe(t,e,r,a){return t["@@transducer/result"](r[a](lPe(t["@@transducer/step"],t),e))}var pPe=fPe(uPe,dPe,cPe),vPe=pPe,mPe=function(){function t(e){this.f=e}return t.prototype["@@transducer/init"]=function(){throw new Error("init not implemented on XWrap")},t.prototype["@@transducer/result"]=function(e){return e},t.prototype["@@transducer/step"]=function(e,r){return this.f(e,r)},t}();function gPe(t){return new mPe(t)}var bPe=hB(function(t,e,r){return vPe(typeof t=="function"?gPe(t):t,e,r)}),_oe=bPe;function yPe(t,e){return function(){return e.call(this,t.apply(this,arguments))}}function Moe(t,e){return function(){var r=arguments.length;if(r===0)return e();var a=arguments[r-1];return lB(a)||typeof a[t]!="function"?e.apply(this,arguments):a[t].apply(a,Array.prototype.slice.call(arguments,0,r-1))}}var wPe=hB(Moe("slice",function(t,e,r){return Array.prototype.slice.call(r,t,e)})),_Pe=wPe,MPe=Fa(Moe("tail",_Pe(1,1/0))),xPe=MPe;function xoe(){if(arguments.length===0)throw new Error("pipe requires at least one argument");return Sw(arguments[0].length,_oe(yPe,arguments[0],xPe(arguments)))}var SPe=Fn(function(t,e){return poe(_oe(JBe,0,aPe("length",e)),function(){var r=arguments,a=this;return t.apply(a,k2(function(i){return i.apply(a,r)},e))})}),EPe=SPe,APe=Fn(function(t,e){return e==null||e!==e?t:e}),CI=APe,RPe=function(){function t(e,r){this.xf=r,this.f=e,this.found=!1}return t.prototype["@@transducer/init"]=B2.init,t.prototype["@@transducer/result"]=function(e){return this.found||(e=this.xf["@@transducer/step"](e,void 0)),this.xf["@@transducer/result"](e)},t.prototype["@@transducer/step"]=function(e,r){return this.f(r)&&(this.found=!0,e=ABe(this.xf["@@transducer/step"](e,r))),e},t}();function TPe(t){return function(e){return new RPe(t,e)}}var kPe=Fn(cB(["find"],TPe,function(t,e){for(var r=0,a=e.length;r<a;){if(t(e[r]))return e[r];r+=1}})),IPe=kPe,BPe=Fa(function(t){return EPe(function(){return Array.prototype.slice.call(arguments,0)},t)}),PPe=BPe;function OPe(t,e){for(var r=e,a=0;a<t.length;a+=1){if(r==null)return;var i=t[a];boe(i)?r=woe(i,r):r=r[i]}return r}var NPe=Fn(OPe),Soe=NPe,CPe=hB(function(t,e,r){return voe(t,Ew(e,r))}),LPe=CPe,tw=class extends Error{name="InvalidSchedulerLocation"},DPe=class extends Error{name="SchedulerTagNotFound"},$Pe=class extends Error{name="TransactionNotFound"},qPe="Url",UPe="Time-To-Live",FPe="Scheduler",LI=t=>xoe(CI([]),IPe(LPe(t,"name")),CI({}),Ew("value")),Eoe=t=>xoe(e=>{if(!e)throw new $Pe(t);return e},Ew("tags"),CI([]));function Aoe({fetch:t,GRAPHQL_URL:e}){return async({query:r,variables:a})=>t(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:r,variables:a})}).then(i=>i.json())}function jPe({fetch:t,GRAPHQL_URL:e}){let r=Aoe({fetch:t,GRAPHQL_URL:e}),a=Roe({fetch:t,GRAPHQL_URL:e}),i=`
133
133
  query GetTransactions ($transactionIds: [ID!]!) {
134
134
  transactions(ids: $transactionIds) {
135
135
  edges {
@@ -184,7 +184,7 @@ nonce: bundlr`),Me.from(i))}};ie();ae();ne();var Q0=class{_publicKey;ownerLength
184
184
  }
185
185
  }
186
186
  }
187
- }`,i=wt.object({data:wt.object({transactions:wt.object({edges:wt.array(wt.object({node:wt.record(wt.any())}))})})});return h=>zr(h).chain(Di(l=>t(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:a,variables:{transactionIds:[l]}})}).then(async p=>{if(p.ok)return p.json();throw r('Error Encountered when querying gateway for transaction "%s"',l),new Error(`${p.status}: ${await p.text()}`)}).then(i.parse).then(eLe(["data","transactions","edges","0","node"])))).toPromise()}var lDe=sB(yBe(),1),Ose=(t="@permaweb/aoconnect")=>{let e=(0,lDe.default)(t);return e.child=r=>Ose(`${e.namespace}:${r}`),e.tap=(r,...a)=>sLe((...i)=>e(r,...a,...i)),e},Nse=({url:t,path:e})=>e?e.startsWith("/")?Nse({url:t,path:e.slice(1)}):(t=new URL(t),t.pathname+=e,t.toString()):t;function cDe(t){return uv(Bw([]),fv((e,r)=>uv(iLe([],r.name),xB(r.value),Us(r.name,Gh,e))(e),{}),kw(e=>e.length>1?e:e[0]))(t)}function Ds(t,e){return r=>ise(cCe([aoe(t,"name"),EB(MB(e),aoe(e,"value"),yB)]),r)}function foe(t){return dse([[I2(String),X1(t)],[I2(Array),HCe(t)],[yB,MNe]])}function zd(t){let e;return I2($s,t)?(e=new Error(dDe(t)),e.stack+=t.stack):I2(Error,t)?e=t:jCe("message",t)?e=new Error(t.message):I2(String,t)?e=new Error(t):e=new Error("An error occurred"),e}function dDe(t){return uv(e=>function r(a,i,h){return fv((l,p)=>uv(dse([[X1(Rt.invalid_arguments),()=>r(p.argumentsError,422,"Invalid Arguments")],[X1(Rt.invalid_return_type),()=>r(p.returnTypeError,500,"Invalid Return")],[X1(Rt.invalid_union),()=>TCe(b=>r(b,400,"Invalid Union"),p.unionErrors)],[yB,()=>[{...p,status:i,contextCode:h}]]]),SB(l))(p.code),[],a.issues)}(e,400,""),e=>fv((r,a)=>{let{message:i,path:h,contextCode:l}=a,p=h[1]||h[0],b=l?`${l} `:"";return r.push(`${b}'${p}': ${i}.`),r},[],e),JCe(" | "))(t)}var pDe=wt.object({id:wt.string().min(1,{message:"message is required to be a message id"}),processId:wt.string().min(1,{message:"process is required to be a process id"})});function vDe(){return t=>zr(t).map(pDe.parse).map(()=>t)}var db=wt.object({name:wt.string(),value:wt.string()}),mDe=wt.function().args(wt.object({Id:wt.string(),Target:wt.string(),Owner:wt.string(),Anchor:wt.string().optional(),Data:wt.any().default("1234"),Tags:wt.array(wt.object({name:wt.string(),value:wt.string()}))})).returns(wt.promise(wt.any())),gDe=wt.function().args(wt.object({id:wt.string().min(1,{message:"message id is required"}),processId:wt.string().min(1,{message:"process id is required"})})).returns(wt.promise(wt.any())),bDe=wt.function().args(wt.object({process:wt.string().min(1,{message:"process id is required"}),from:wt.string().optional(),to:wt.string().optional(),sort:wt.enum(["ASC","DESC"]).default("ASC"),limit:wt.number().optional()})).returns(wt.promise(wt.object({edges:wt.array(wt.object({cursor:wt.string(),node:wt.object({Output:wt.any().optional(),Messages:wt.array(wt.any()).optional(),Spawns:wt.array(wt.any()).optional(),Error:wt.any().optional()})}))}))),Cse=wt.function().args(wt.object({processId:wt.string(),data:wt.any(),tags:wt.array(db),anchor:wt.string().optional(),signer:wt.any()})).returns(wt.promise(wt.object({messageId:wt.string()}).passthrough())),yDe=wt.function().args(wt.object({data:wt.any(),tags:wt.array(db),signer:wt.any()})).returns(wt.promise(wt.object({processId:wt.string()}).passthrough())),wDe=wt.function().args(wt.object({process:wt.string(),message:wt.string(),baseLayer:wt.boolean().optional(),exclude:wt.array(wt.string()).optional()})).returns(wt.promise(wt.object({assignmentId:wt.string()}).passthrough())),Lse=Cse,qmt=wt.function().args(wt.object({suUrl:wt.string().url(),processId:wt.string()})).returns(wt.promise(wt.object({tags:wt.array(db)}).passthrough())),Umt=wt.function().args(wt.string()).returns(wt.promise(wt.object({url:wt.string()}))),_De=wt.function().args(wt.string()).returns(wt.promise(wt.boolean())),MDe=wt.function().args(wt.string()).returns(wt.promise(wt.object({tags:wt.array(db)}).passthrough())),Pw=wt.function().args(wt.object({data:wt.any(),tags:wt.array(db),target:wt.string().optional(),anchor:wt.string().optional()})).returns(wt.promise(wt.object({id:wt.string(),raw:wt.any()})));function xDe({loadResult:t}){return t=Di(gDe.implement(t)),e=>zr({id:e.id,processId:e.processId}).chain(t)}function SDe(t){let e=vDe(t),r=xDe(t);return({message:a,process:i})=>zr({id:a,processId:i}).chain(e).chain(r).map(t.logger.tap('readResult result for message "%s": %O',a)).map(h=>h).bimap(zd,jd).toPromise()}var EDe=wt.array(wt.object({name:wt.string(),value:wt.string()}));function ADe(){return t=>zr(t.tags).map(Bw([])).map(Ds("Data-Protocol","ao")).map(Ds("Variant")).map(Ds("Type")).map(Ds("SDK")).map(SB(Gh,[{name:"Data-Protocol",value:"ao"},{name:"Variant",value:"ao.TN.1"},{name:"Type",value:"Message"},{name:"SDK",value:"aoconnect"}])).map(EDe.parse).map(Us("tags",Gh,t))}function RDe({logger:t}){return e=>zr(e).chain(EB(MB(e.data),()=>$d(e),()=>$d(Math.random().toString().slice(-4)).map(Us("data",Gh,e)).map(r=>uv(Fd("tags"),Ds("Content-Type"),xB({name:"Content-Type",value:"text/plain"}),Us("tags",Gh,r))(r)).map(t.tap('added pseudo-random string as message "data"'))))}function TDe(t){let e=ADe(t),r=RDe(t),a=Cse.implement(t.deployMessage);return i=>zr(i).chain(e).chain(r).chain(Di(({id:h,data:l,tags:p,anchor:b,signer:g})=>a({processId:h,data:l,tags:p,anchor:b,signer:Pw.implement(g)}))).map(h=>Us("messageId",h.messageId,i))}function kDe(t){let e=TDe(t);return({process:r,data:a,tags:i,anchor:h,signer:l})=>zr({id:r,data:a,tags:i,anchor:h,signer:l}).chain(e).map(p=>p.messageId).bimap(zd,jd).toPromise()}var w2=(t,e,r)=>a=>e(a[t])?$d(a):Tc(`Tag '${t}': ${r}`);function IDe({loadTransactionMeta:t,logger:e}){return t=Di(MDe.implement(t)),r=>zr(r).chain(t).map(Fd("tags")).map(cDe).chain(w2("Data-Protocol",foe("ao"),"value 'ao' was not found on module")).chain(w2("Type",foe("Module"),"value 'Module' was not found on module")).chain(w2("Module-Format",PI,"was not found on module")).chain(w2("Input-Encoding",PI,"was not found on module")).chain(w2("Output-Encoding",PI,"was not found on module")).bimap(e.tap("Verifying module source failed: %s"),e.tap("Verified module source"))}function BDe({logger:t,validateScheduler:e}){return e=Di(_De.implement(e)),r=>zr(r).chain(a=>e(a).chain(i=>i?$d(a):Tc(`Valid Scheduler-Location owned by ${a} not found`))).bimap(t.tap("Verifying scheduler failed: %s"),t.tap("Verified scheduler"))}function PDe({logger:t}){return e=>zr(e).map(t.tap("Checking for signer")).chain(r=>r?$d(r):Tc("signer not found"))}function ODe(t){let e=t.logger.child("verifyInput");t={...t,logger:e};let r=IDe(t),a=BDe(t),i=PDe(t);return h=>zr(h).chain(l=>r(l.module).map(()=>l)).chain(l=>a(l.scheduler)).map(()=>h).chain(l=>i(l.signer).map(()=>l)).bimap(e.tap("Error when verify input: %s"),e.tap("Successfully verified inputs"))}var NDe=wt.array(wt.object({name:wt.string(),value:wt.string()}));function CDe(){return t=>zr(t).map(Fd("tags")).map(Bw([])).map(Ds("Data-Protocol","ao")).map(Ds("Variant")).map(Ds("Type")).map(Ds("Module")).map(Ds("Scheduler")).map(Ds("SDK")).map(SB(Gh,[{name:"Data-Protocol",value:"ao"},{name:"Variant",value:"ao.TN.1"},{name:"Type",value:"Process"},{name:"Module",value:t.module},{name:"Scheduler",value:t.scheduler},{name:"SDK",value:"aoconnect"}])).map(NDe.parse).map(Us("tags",Gh,t))}function LDe({logger:t}){return e=>zr(e).chain(EB(MB(e.data),()=>$d(e),()=>$d(Math.random().toString().slice(-4)).map(Us("data",Gh,e)).map(r=>uv(Fd("tags"),Ds("Content-Type"),xB({name:"Content-Type",value:"text/plain"}),Us("tags",Gh,r))(r)).map(t.tap('added pseudo-random string as process "data"'))))}function DDe(t){let e=t.logger.child("uploadProcess");t={...t,logger:e};let r=CDe(t),a=LDe(t),i=yDe.implement(t.deployProcess);return h=>zr(h).chain(r).chain(a).chain(Di(({data:l,tags:p,signer:b})=>i({data:l,tags:p,signer:Pw.implement(b)}))).map(l=>Us("processId",l.processId,h))}function $De(t){let e=ODe(t),r=DDe(t);return({module:a,scheduler:i,signer:h,tags:l,data:p})=>zr({module:a,scheduler:i,signer:h,tags:l,data:p}).chain(e).chain(r).map(b=>b.processId).bimap(zd,jd).toPromise()}function qDe(t){let e=Lse.implement(t.deployMonitor);return r=>zr(r).chain(Di(({id:a,signer:i})=>e({processId:a,signer:Pw.implement(i),data:Math.random().toString().slice(-4),tags:[]}))).map(a=>Us("monitorId",a.messageId,r))}function UDe(t){let e=qDe(t);return({process:r,signer:a})=>zr({id:r,signer:a}).chain(e).map(i=>i.monitorId).bimap(zd,jd).toPromise()}function FDe(t){let e=Lse.implement(t.deployUnmonitor);return r=>zr(r).chain(Di(({id:a,signer:i})=>e({processId:a,signer:Pw.implement(i),data:Math.random().toString().slice(-4),tags:[]}))).map(a=>Us("monitorId",a.messageId,r))}function jDe(t){let e=FDe(t);return({process:r,signer:a})=>zr({id:r,signer:a}).chain(e).map(i=>i.monitorId).bimap(zd,jd).toPromise()}var zDe=wt.object({process:wt.string().min(1,{message:"process identifier is required"}),from:wt.string().optional(),to:wt.string().optional(),sort:wt.enum(["ASC","DESC"]).default("ASC"),limit:wt.number().optional()});function ZDe(){return t=>zr(t).map(zDe.parse).map(()=>t)}function HDe({queryResults:t}){return t=Di(bDe.implement(t)),e=>zr({process:e.process,from:e.from,to:e.to,sort:e.sort,limit:e.limit}).chain(t)}function KDe(t){let e=ZDe(t),r=HDe(t);return({process:a,from:i,to:h,sort:l,limit:p})=>zr({process:a,from:i,to:h,sort:l,limit:p}).chain(e).chain(r).map(t.logger.tap('readResults result for message "%s": %O',a)).map(b=>b).bimap(zd,jd).toPromise()}var WDe=wt.object({Id:wt.string(),Target:wt.string(),Owner:wt.string(),Anchor:wt.string().optional(),Data:wt.any().default("1234"),Tags:wt.array(wt.object({name:wt.string(),value:wt.string()}))});function VDe(){return t=>zr(t).map(WDe.parse).map(e=>(e.Tags=e.Tags.concat([{name:"Data-Protocol",value:"ao"},{name:"Type",value:"Message"},{name:"Variant",value:"ao.TN.1"}]),e))}function GDe({dryrunFetch:t}){return Di(mDe.implement(t))}function YDe(t){let e=VDe(t),r=GDe(t);return a=>zr(a).map(JDe).chain(e).chain(r).toPromise()}function JDe({process:t,data:e,tags:r,anchor:a,...i}){return{Id:"1234",Owner:"1234",...i,Target:t,Data:e||"1234",Tags:r||[],Anchor:a||"0"}}function XDe(t){let e=wDe.implement(t.deployAssign);return r=>zr(r).chain(Di(({process:a,message:i,baseLayer:h,exclude:l})=>e({process:a,message:i,baseLayer:h,exclude:l}))).map(a=>Us("assignmentId",a.assignmentId,r))}function QDe(t){let e=XDe(t);return({process:r,message:a,baseLayer:i,exclude:h})=>zr({process:r,message:a,baseLayer:i,exclude:h}).chain(e).map(l=>l.assignmentId).bimap(zd,jd).toPromise()}var e$e="https://arweave.net",t$e="https://mu.ao-testnet.xyz",r$e="https://cu.ao-testnet.xyz";function vv({GRAPHQL_URL:t,GATEWAY_URL:e=e$e,MU_URL:r=t$e,CU_URL:a=r$e}={}){let i=Ose();t||(t=Nse({url:e,path:"/graphql"}));let{validate:h}=Qoe({cacheSize:100,GRAPHQL_URL:t}),l=wNe({MAX_SIZE:25}),p=i.child("result"),b=SDe({loadResult:gNe({fetch,CU_URL:a,logger:p}),logger:p}),g=i.child("message"),y=kDe({loadProcessMeta:kI({fetch,cache:l,logger:g}),deployMessage:lNe({fetch,MU_URL:r,logger:g}),logger:g}),M=i.child("spawn"),x=$De({loadTransactionMeta:hDe({fetch,GRAPHQL_URL:t,logger:M}),validateScheduler:h,deployProcess:cNe({fetch,MU_URL:r,logger:M}),logger:M}),E=i.child("monitor"),A=UDe({loadProcessMeta:kI({fetch,cache:l,logger:E}),deployMonitor:dNe({fetch,MU_URL:r,logger:E}),logger:E}),k=i.child("unmonitor"),P=jDe({loadProcessMeta:kI({fetch,cache:l,logger:k}),deployUnmonitor:pNe({fetch,MU_URL:r,logger:k}),logger:E}),N=i.child("results"),L=KDe({queryResults:bNe({fetch,CU_URL:a,logger:N}),logger:N}),C=i.child("dryrun"),Y=YDe({dryrunFetch:mNe({fetch,CU_URL:a,logger:C}),logger:C}),G=i.child("assign"),ee=QDe({deployAssign:vNe({fetch,MU_URL:r,logger:G}),logger:g});return{result:b,results:L,message:y,spawn:x,monitor:A,unmonitor:P,dryrun:Y,assign:ee}}var Dse={};loe(Dse,{createDataItemSigner:()=>R$e});var $se=sB(MBe(),1),qse={};loe(qse,{AVSCTap:()=>pb,ArweaveSigner:()=>IB,DataItem:()=>ub,MAX_TAG_BYTES:()=>Ow,MIN_BINARY_SIZE:()=>OB,SIG_CONFIG:()=>pv,SignatureConfig:()=>Ls,Signer:()=>zse,createData:()=>Wse,default:()=>S$e,deserializeTags:()=>xw,indexToType:()=>BB,serializeTags:()=>PB,tagsExceedLimit:()=>Kse,warparbundles:()=>E$e});var i$e=Object.create,TB=Object.defineProperty,n$e=Object.getOwnPropertyDescriptor,a$e=Object.getOwnPropertyNames,o$e=Object.getPrototypeOf,s$e=Object.prototype.hasOwnProperty,Jh=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),f$e=(t,e)=>{for(var r in e)TB(t,r,{get:e[r],enumerable:!0})},u$e=(t,e,r,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of a$e(e))!s$e.call(t,i)&&i!==r&&TB(t,i,{get:()=>e[i],enumerable:!(a=n$e(e,i))||a.enumerable});return t},Zd=(t,e,r)=>(r=t!=null?i$e(o$e(t)):{},u$e(e||!t||!t.__esModule?TB(r,"default",{value:t,enumerable:!0}):r,t)),h$e=Jh(t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});function e(r){var a=4,i=r.length,h=i%a;if(!h)return r;var l=i,p=a-h,b=i+p,g=Me.alloc(b);for(g.write(r);p--;)g.write("=",l++);return g.toString()}t.default=e}),l$e=Jh(t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var e=h$e();function r(b,g){return g===void 0&&(g="utf8"),Me.isBuffer(b)?h(b.toString("base64")):h(Me.from(b,g).toString("base64"))}function a(b,g){return g===void 0&&(g="utf8"),Me.from(i(b),"base64").toString(g)}function i(b){return b=b.toString(),e.default(b).replace(/\-/g,"+").replace(/_/g,"/")}function h(b){return b.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function l(b){return Me.from(i(b),"base64")}var p=r;p.encode=r,p.decode=a,p.toBase64=i,p.fromBase64=h,p.toBuffer=l,t.default=p}),kB=Jh((t,e)=>{e.exports=l$e().default,e.exports.default=e.exports}),Use=Jh(t=>{"use strict";t.byteLength=b,t.toByteArray=y,t.fromByteArray=E;var e=[],r=[],a=typeof Uint8Array<"u"?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(h=0,l=i.length;h<l;++h)e[h]=i[h],r[i.charCodeAt(h)]=h;var h,l;r[45]=62,r[95]=63;function p(A){var k=A.length;if(k%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var P=A.indexOf("=");P===-1&&(P=k);var N=P===k?0:4-P%4;return[P,N]}function b(A){var k=p(A),P=k[0],N=k[1];return(P+N)*3/4-N}function g(A,k,P){return(k+P)*3/4-P}function y(A){var k,P=p(A),N=P[0],L=P[1],C=new a(g(A,N,L)),Y=0,G=L>0?N-4:N,ee;for(ee=0;ee<G;ee+=4)k=r[A.charCodeAt(ee)]<<18|r[A.charCodeAt(ee+1)]<<12|r[A.charCodeAt(ee+2)]<<6|r[A.charCodeAt(ee+3)],C[Y++]=k>>16&255,C[Y++]=k>>8&255,C[Y++]=k&255;return L===2&&(k=r[A.charCodeAt(ee)]<<2|r[A.charCodeAt(ee+1)]>>4,C[Y++]=k&255),L===1&&(k=r[A.charCodeAt(ee)]<<10|r[A.charCodeAt(ee+1)]<<4|r[A.charCodeAt(ee+2)]>>2,C[Y++]=k>>8&255,C[Y++]=k&255),C}function M(A){return e[A>>18&63]+e[A>>12&63]+e[A>>6&63]+e[A&63]}function x(A,k,P){for(var N,L=[],C=k;C<P;C+=3)N=(A[C]<<16&16711680)+(A[C+1]<<8&65280)+(A[C+2]&255),L.push(M(N));return L.join("")}function E(A){for(var k,P=A.length,N=P%3,L=[],C=16383,Y=0,G=P-N;Y<G;Y+=C)L.push(x(A,Y,Y+C>G?G:Y+C));return N===1?(k=A[P-1],L.push(e[k>>2]+e[k<<4&63]+"==")):N===2&&(k=(A[P-2]<<8)+A[P-1],L.push(e[k>>10]+e[k>>4&63]+e[k<<2&63]+"=")),L.join("")}}),Fse=Jh(t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.b64UrlDecode=t.b64UrlEncode=t.bufferTob64Url=t.bufferTob64=t.b64UrlToBuffer=t.stringToB64Url=t.stringToBuffer=t.bufferToString=t.b64UrlToString=t.concatBuffers=void 0;var e=Use();function r(x){let E=0;for(let P=0;P<x.length;P++)E+=x[P].byteLength;let A=new Uint8Array(E),k=0;A.set(new Uint8Array(x[0]),k),k+=x[0].byteLength;for(let P=1;P<x.length;P++)A.set(new Uint8Array(x[P]),k),k+=x[P].byteLength;return A}t.concatBuffers=r;function a(x){let E=p(x);return i(E)}t.b64UrlToString=a;function i(x){return new TextDecoder("utf-8",{fatal:!0}).decode(x)}t.bufferToString=i;function h(x){return new TextEncoder().encode(x)}t.stringToBuffer=h;function l(x){return g(h(x))}t.stringToB64Url=l;function p(x){return new Uint8Array(e.toByteArray(M(x)))}t.b64UrlToBuffer=p;function b(x){return e.fromByteArray(new Uint8Array(x))}t.bufferTob64=b;function g(x){return y(b(x))}t.bufferTob64Url=g;function y(x){return x.replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")}t.b64UrlEncode=y;function M(x){x=x.replace(/\-/g,"+").replace(/\_/g,"/");let E;return x.length%4==0?E=0:E=4-x.length%4,x.concat("=".repeat(E))}t.b64UrlDecode=M}),c$e=Jh(t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var e=Fse(),r=class{keyLength=4096;publicExponent=65537;hashAlgorithm="sha256";driver;constructor(){if(!this.detectWebCrypto())throw new Error("SubtleCrypto not available!");this.driver=crypto.subtle}async generateJWK(){let a=await this.driver.generateKey({name:"RSA-PSS",modulusLength:4096,publicExponent:new Uint8Array([1,0,1]),hash:{name:"SHA-256"}},!0,["sign"]),i=await this.driver.exportKey("jwk",a.privateKey);return{kty:i.kty,e:i.e,n:i.n,d:i.d,p:i.p,q:i.q,dp:i.dp,dq:i.dq,qi:i.qi}}async sign(a,i,{saltLength:h}={}){let l=await this.driver.sign({name:"RSA-PSS",saltLength:32},await this.jwkToCryptoKey(a),i);return new Uint8Array(l)}async hash(a,i="SHA-256"){let h=await this.driver.digest(i,a);return new Uint8Array(h)}async verify(a,i,h){let l={kty:"RSA",e:"AQAB",n:a},p=await this.jwkToPublicCryptoKey(l),b=await this.driver.digest("SHA-256",i),g=await this.driver.verify({name:"RSA-PSS",saltLength:0},p,h,i),y=await this.driver.verify({name:"RSA-PSS",saltLength:32},p,h,i),M=await this.driver.verify({name:"RSA-PSS",saltLength:Math.ceil((p.algorithm.modulusLength-1)/8)-b.byteLength-2},p,h,i);return g||y||M}async jwkToCryptoKey(a){return this.driver.importKey("jwk",a,{name:"RSA-PSS",hash:{name:"SHA-256"}},!1,["sign"])}async jwkToPublicCryptoKey(a){return this.driver.importKey("jwk",a,{name:"RSA-PSS",hash:{name:"SHA-256"}},!1,["verify"])}detectWebCrypto(){if(typeof crypto>"u")return!1;let a=crypto?.subtle;return a===void 0?!1:["generateKey","importKey","exportKey","digest","sign"].every(i=>typeof a[i]=="function")}async encrypt(a,i,h){let l=await this.driver.importKey("raw",typeof i=="string"?e.stringToBuffer(i):i,{name:"PBKDF2",length:32},!1,["deriveKey"]),p=await this.driver.deriveKey({name:"PBKDF2",salt:h?e.stringToBuffer(h):e.stringToBuffer("salt"),iterations:1e5,hash:"SHA-256"},l,{name:"AES-CBC",length:256},!1,["encrypt","decrypt"]),b=new Uint8Array(16);crypto.getRandomValues(b);let g=await this.driver.encrypt({name:"AES-CBC",iv:b},p,a);return e.concatBuffers([b,g])}async decrypt(a,i,h){let l=await this.driver.importKey("raw",typeof i=="string"?e.stringToBuffer(i):i,{name:"PBKDF2",length:32},!1,["deriveKey"]),p=await this.driver.deriveKey({name:"PBKDF2",salt:h?e.stringToBuffer(h):e.stringToBuffer("salt"),iterations:1e5,hash:"SHA-256"},l,{name:"AES-CBC",length:256},!1,["encrypt","decrypt"]),b=a.slice(0,16),g=await this.driver.decrypt({name:"AES-CBC",iv:b},p,a.slice(16));return e.concatBuffers([g])}};t.default=r}),d$e=Jh(t=>{t.read=function(e,r,a,i,h){var l,p,b=h*8-i-1,g=(1<<b)-1,y=g>>1,M=-7,x=a?h-1:0,E=a?-1:1,A=e[r+x];for(x+=E,l=A&(1<<-M)-1,A>>=-M,M+=b;M>0;l=l*256+e[r+x],x+=E,M-=8);for(p=l&(1<<-M)-1,l>>=-M,M+=i;M>0;p=p*256+e[r+x],x+=E,M-=8);if(l===0)l=1-y;else{if(l===g)return p?NaN:(A?-1:1)*(1/0);p=p+Math.pow(2,i),l=l-y}return(A?-1:1)*p*Math.pow(2,l-i)},t.write=function(e,r,a,i,h,l){var p,b,g,y=l*8-h-1,M=(1<<y)-1,x=M>>1,E=h===23?Math.pow(2,-24)-Math.pow(2,-77):0,A=i?0:l-1,k=i?1:-1,P=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(b=isNaN(r)?1:0,p=M):(p=Math.floor(Math.log(r)/Math.LN2),r*(g=Math.pow(2,-p))<1&&(p--,g*=2),p+x>=1?r+=E/g:r+=E*Math.pow(2,1-x),r*g>=2&&(p++,g/=2),p+x>=M?(b=0,p=M):p+x>=1?(b=(r*g-1)*Math.pow(2,h),p=p+x):(b=r*Math.pow(2,x-1)*Math.pow(2,h),p=0));h>=8;e[a+A]=b&255,A+=k,b/=256,h-=8);for(p=p<<h|b,y+=h;y>0;e[a+A]=p&255,A+=k,p/=256,y-=8);e[a+A-k]|=P*128}}),nB=Jh(t=>{"use strict";var e=Use(),r=d$e(),a=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=p,t.SlowBuffer=L,t.INSPECT_MAX_BYTES=50;var i=2147483647;t.kMaxLength=i,p.TYPED_ARRAY_SUPPORT=h(),!p.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 h(){try{let T=new Uint8Array(1),I={foo:function(){return 42}};return Object.setPrototypeOf(I,Uint8Array.prototype),Object.setPrototypeOf(T,I),T.foo()===42}catch{return!1}}Object.defineProperty(p.prototype,"parent",{enumerable:!0,get:function(){if(p.isBuffer(this))return this.buffer}}),Object.defineProperty(p.prototype,"offset",{enumerable:!0,get:function(){if(p.isBuffer(this))return this.byteOffset}});function l(T){if(T>i)throw new RangeError('The value "'+T+'" is invalid for option "size"');let I=new Uint8Array(T);return Object.setPrototypeOf(I,p.prototype),I}function p(T,I,O){if(typeof T=="number"){if(typeof I=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return M(T)}return b(T,I,O)}p.poolSize=8192;function b(T,I,O){if(typeof T=="string")return x(T,I);if(ArrayBuffer.isView(T))return A(T);if(T==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof T);if(ut(T,ArrayBuffer)||T&&ut(T.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(ut(T,SharedArrayBuffer)||T&&ut(T.buffer,SharedArrayBuffer)))return k(T,I,O);if(typeof T=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let q=T.valueOf&&T.valueOf();if(q!=null&&q!==T)return p.from(q,I,O);let H=P(T);if(H)return H;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof T[Symbol.toPrimitive]=="function")return p.from(T[Symbol.toPrimitive]("string"),I,O);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof T)}p.from=function(T,I,O){return b(T,I,O)},Object.setPrototypeOf(p.prototype,Uint8Array.prototype),Object.setPrototypeOf(p,Uint8Array);function g(T){if(typeof T!="number")throw new TypeError('"size" argument must be of type number');if(T<0)throw new RangeError('The value "'+T+'" is invalid for option "size"')}function y(T,I,O){return g(T),T<=0?l(T):I!==void 0?typeof O=="string"?l(T).fill(I,O):l(T).fill(I):l(T)}p.alloc=function(T,I,O){return y(T,I,O)};function M(T){return g(T),l(T<0?0:N(T)|0)}p.allocUnsafe=function(T){return M(T)},p.allocUnsafeSlow=function(T){return M(T)};function x(T,I){if((typeof I!="string"||I==="")&&(I="utf8"),!p.isEncoding(I))throw new TypeError("Unknown encoding: "+I);let O=C(T,I)|0,q=l(O),H=q.write(T,I);return H!==O&&(q=q.slice(0,H)),q}function E(T){let I=T.length<0?0:N(T.length)|0,O=l(I);for(let q=0;q<I;q+=1)O[q]=T[q]&255;return O}function A(T){if(ut(T,Uint8Array)){let I=new Uint8Array(T);return k(I.buffer,I.byteOffset,I.byteLength)}return E(T)}function k(T,I,O){if(I<0||T.byteLength<I)throw new RangeError('"offset" is outside of buffer bounds');if(T.byteLength<I+(O||0))throw new RangeError('"length" is outside of buffer bounds');let q;return I===void 0&&O===void 0?q=new Uint8Array(T):O===void 0?q=new Uint8Array(T,I):q=new Uint8Array(T,I,O),Object.setPrototypeOf(q,p.prototype),q}function P(T){if(p.isBuffer(T)){let I=N(T.length)|0,O=l(I);return O.length===0||T.copy(O,0,0,I),O}if(T.length!==void 0)return typeof T.length!="number"||Ze(T.length)?l(0):E(T);if(T.type==="Buffer"&&Array.isArray(T.data))return E(T.data)}function N(T){if(T>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return T|0}function L(T){return+T!=T&&(T=0),p.alloc(+T)}p.isBuffer=function(T){return T!=null&&T._isBuffer===!0&&T!==p.prototype},p.compare=function(T,I){if(ut(T,Uint8Array)&&(T=p.from(T,T.offset,T.byteLength)),ut(I,Uint8Array)&&(I=p.from(I,I.offset,I.byteLength)),!p.isBuffer(T)||!p.isBuffer(I))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(T===I)return 0;let O=T.length,q=I.length;for(let H=0,W=Math.min(O,q);H<W;++H)if(T[H]!==I[H]){O=T[H],q=I[H];break}return O<q?-1:q<O?1:0},p.isEncoding=function(T){switch(String(T).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}},p.concat=function(T,I){if(!Array.isArray(T))throw new TypeError('"list" argument must be an Array of Buffers');if(T.length===0)return p.alloc(0);let O;if(I===void 0)for(I=0,O=0;O<T.length;++O)I+=T[O].length;let q=p.allocUnsafe(I),H=0;for(O=0;O<T.length;++O){let W=T[O];if(ut(W,Uint8Array))H+W.length>q.length?(p.isBuffer(W)||(W=p.from(W)),W.copy(q,H)):Uint8Array.prototype.set.call(q,W,H);else if(p.isBuffer(W))W.copy(q,H);else throw new TypeError('"list" argument must be an Array of Buffers');H+=W.length}return q};function C(T,I){if(p.isBuffer(T))return T.length;if(ArrayBuffer.isView(T)||ut(T,ArrayBuffer))return T.byteLength;if(typeof T!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof T);let O=T.length,q=arguments.length>2&&arguments[2]===!0;if(!q&&O===0)return 0;let H=!1;for(;;)switch(I){case"ascii":case"latin1":case"binary":return O;case"utf8":case"utf-8":return oe(T).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O*2;case"hex":return O>>>1;case"base64":return ge(T).length;default:if(H)return q?-1:oe(T).length;I=(""+I).toLowerCase(),H=!0}}p.byteLength=C;function Y(T,I,O){let q=!1;if((I===void 0||I<0)&&(I=0),I>this.length||((O===void 0||O>this.length)&&(O=this.length),O<=0)||(O>>>=0,I>>>=0,O<=I))return"";for(T||(T="utf8");;)switch(T){case"hex":return o(this,I,O);case"utf8":case"utf-8":return u(this,I,O);case"ascii":return w(this,I,O);case"latin1":case"binary":return d(this,I,O);case"base64":return f(this,I,O);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return v(this,I,O);default:if(q)throw new TypeError("Unknown encoding: "+T);T=(T+"").toLowerCase(),q=!0}}p.prototype._isBuffer=!0;function G(T,I,O){let q=T[I];T[I]=T[O],T[O]=q}p.prototype.swap16=function(){let T=this.length;if(T%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let I=0;I<T;I+=2)G(this,I,I+1);return this},p.prototype.swap32=function(){let T=this.length;if(T%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let I=0;I<T;I+=4)G(this,I,I+3),G(this,I+1,I+2);return this},p.prototype.swap64=function(){let T=this.length;if(T%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let I=0;I<T;I+=8)G(this,I,I+7),G(this,I+1,I+6),G(this,I+2,I+5),G(this,I+3,I+4);return this},p.prototype.toString=function(){let T=this.length;return T===0?"":arguments.length===0?u(this,0,T):Y.apply(this,arguments)},p.prototype.toLocaleString=p.prototype.toString,p.prototype.equals=function(T){if(!p.isBuffer(T))throw new TypeError("Argument must be a Buffer");return this===T?!0:p.compare(this,T)===0},p.prototype.inspect=function(){let T="",I=t.INSPECT_MAX_BYTES;return T=this.toString("hex",0,I).replace(/(.{2})/g,"$1 ").trim(),this.length>I&&(T+=" ... "),"<Buffer "+T+">"},a&&(p.prototype[a]=p.prototype.inspect),p.prototype.compare=function(T,I,O,q,H){if(ut(T,Uint8Array)&&(T=p.from(T,T.offset,T.byteLength)),!p.isBuffer(T))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof T);if(I===void 0&&(I=0),O===void 0&&(O=T?T.length:0),q===void 0&&(q=0),H===void 0&&(H=this.length),I<0||O>T.length||q<0||H>this.length)throw new RangeError("out of range index");if(q>=H&&I>=O)return 0;if(q>=H)return-1;if(I>=O)return 1;if(I>>>=0,O>>>=0,q>>>=0,H>>>=0,this===T)return 0;let W=H-q,fe=O-I,st=Math.min(W,fe),ue=this.slice(q,H),me=T.slice(I,O);for(let pe=0;pe<st;++pe)if(ue[pe]!==me[pe]){W=ue[pe],fe=me[pe];break}return W<fe?-1:fe<W?1:0};function ee(T,I,O,q,H){if(T.length===0)return-1;if(typeof O=="string"?(q=O,O=0):O>2147483647?O=2147483647:O<-2147483648&&(O=-2147483648),O=+O,Ze(O)&&(O=H?0:T.length-1),O<0&&(O=T.length+O),O>=T.length){if(H)return-1;O=T.length-1}else if(O<0)if(H)O=0;else return-1;if(typeof I=="string"&&(I=p.from(I,q)),p.isBuffer(I))return I.length===0?-1:D(T,I,O,q,H);if(typeof I=="number")return I=I&255,typeof Uint8Array.prototype.indexOf=="function"?H?Uint8Array.prototype.indexOf.call(T,I,O):Uint8Array.prototype.lastIndexOf.call(T,I,O):D(T,[I],O,q,H);throw new TypeError("val must be string, number or Buffer")}function D(T,I,O,q,H){let W=1,fe=T.length,st=I.length;if(q!==void 0&&(q=String(q).toLowerCase(),q==="ucs2"||q==="ucs-2"||q==="utf16le"||q==="utf-16le")){if(T.length<2||I.length<2)return-1;W=2,fe/=2,st/=2,O/=2}function ue(pe,be){return W===1?pe[be]:pe.readUInt16BE(be*W)}let me;if(H){let pe=-1;for(me=O;me<fe;me++)if(ue(T,me)===ue(I,pe===-1?0:me-pe)){if(pe===-1&&(pe=me),me-pe+1===st)return pe*W}else pe!==-1&&(me-=me-pe),pe=-1}else for(O+st>fe&&(O=fe-st),me=O;me>=0;me--){let pe=!0;for(let be=0;be<st;be++)if(ue(T,me+be)!==ue(I,be)){pe=!1;break}if(pe)return me}return-1}p.prototype.includes=function(T,I,O){return this.indexOf(T,I,O)!==-1},p.prototype.indexOf=function(T,I,O){return ee(this,T,I,O,!0)},p.prototype.lastIndexOf=function(T,I,O){return ee(this,T,I,O,!1)};function U(T,I,O,q){O=Number(O)||0;let H=T.length-O;q?(q=Number(q),q>H&&(q=H)):q=H;let W=I.length;q>W/2&&(q=W/2);let fe;for(fe=0;fe<q;++fe){let st=parseInt(I.substr(fe*2,2),16);if(Ze(st))return fe;T[O+fe]=st}return fe}function V(T,I,O,q){return Se(oe(I,T.length-O),T,O,q)}function _(T,I,O,q){return Se(ce(I),T,O,q)}function n(T,I,O,q){return Se(ge(I),T,O,q)}function s(T,I,O,q){return Se(ot(I,T.length-O),T,O,q)}p.prototype.write=function(T,I,O,q){if(I===void 0)q="utf8",O=this.length,I=0;else if(O===void 0&&typeof I=="string")q=I,O=this.length,I=0;else if(isFinite(I))I=I>>>0,isFinite(O)?(O=O>>>0,q===void 0&&(q="utf8")):(q=O,O=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let H=this.length-I;if((O===void 0||O>H)&&(O=H),T.length>0&&(O<0||I<0)||I>this.length)throw new RangeError("Attempt to write outside buffer bounds");q||(q="utf8");let W=!1;for(;;)switch(q){case"hex":return U(this,T,I,O);case"utf8":case"utf-8":return V(this,T,I,O);case"ascii":case"latin1":case"binary":return _(this,T,I,O);case"base64":return n(this,T,I,O);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return s(this,T,I,O);default:if(W)throw new TypeError("Unknown encoding: "+q);q=(""+q).toLowerCase(),W=!0}},p.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function f(T,I,O){return I===0&&O===T.length?e.fromByteArray(T):e.fromByteArray(T.slice(I,O))}function u(T,I,O){O=Math.min(T.length,O);let q=[],H=I;for(;H<O;){let W=T[H],fe=null,st=W>239?4:W>223?3:W>191?2:1;if(H+st<=O){let ue,me,pe,be;switch(st){case 1:W<128&&(fe=W);break;case 2:ue=T[H+1],(ue&192)===128&&(be=(W&31)<<6|ue&63,be>127&&(fe=be));break;case 3:ue=T[H+1],me=T[H+2],(ue&192)===128&&(me&192)===128&&(be=(W&15)<<12|(ue&63)<<6|me&63,be>2047&&(be<55296||be>57343)&&(fe=be));break;case 4:ue=T[H+1],me=T[H+2],pe=T[H+3],(ue&192)===128&&(me&192)===128&&(pe&192)===128&&(be=(W&15)<<18|(ue&63)<<12|(me&63)<<6|pe&63,be>65535&&be<1114112&&(fe=be))}}fe===null?(fe=65533,st=1):fe>65535&&(fe-=65536,q.push(fe>>>10&1023|55296),fe=56320|fe&1023),q.push(fe),H+=st}return m(q)}var c=4096;function m(T){let I=T.length;if(I<=c)return String.fromCharCode.apply(String,T);let O="",q=0;for(;q<I;)O+=String.fromCharCode.apply(String,T.slice(q,q+=c));return O}function w(T,I,O){let q="";O=Math.min(T.length,O);for(let H=I;H<O;++H)q+=String.fromCharCode(T[H]&127);return q}function d(T,I,O){let q="";O=Math.min(T.length,O);for(let H=I;H<O;++H)q+=String.fromCharCode(T[H]);return q}function o(T,I,O){let q=T.length;(!I||I<0)&&(I=0),(!O||O<0||O>q)&&(O=q);let H="";for(let W=I;W<O;++W)H+=Ge[T[W]];return H}function v(T,I,O){let q=T.slice(I,O),H="";for(let W=0;W<q.length-1;W+=2)H+=String.fromCharCode(q[W]+q[W+1]*256);return H}p.prototype.slice=function(T,I){let O=this.length;T=~~T,I=I===void 0?O:~~I,T<0?(T+=O,T<0&&(T=0)):T>O&&(T=O),I<0?(I+=O,I<0&&(I=0)):I>O&&(I=O),I<T&&(I=T);let q=this.subarray(T,I);return Object.setPrototypeOf(q,p.prototype),q};function R(T,I,O){if(T%1!==0||T<0)throw new RangeError("offset is not uint");if(T+I>O)throw new RangeError("Trying to access beyond buffer length")}p.prototype.readUintLE=p.prototype.readUIntLE=function(T,I,O){T=T>>>0,I=I>>>0,O||R(T,I,this.length);let q=this[T],H=1,W=0;for(;++W<I&&(H*=256);)q+=this[T+W]*H;return q},p.prototype.readUintBE=p.prototype.readUIntBE=function(T,I,O){T=T>>>0,I=I>>>0,O||R(T,I,this.length);let q=this[T+--I],H=1;for(;I>0&&(H*=256);)q+=this[T+--I]*H;return q},p.prototype.readUint8=p.prototype.readUInt8=function(T,I){return T=T>>>0,I||R(T,1,this.length),this[T]},p.prototype.readUint16LE=p.prototype.readUInt16LE=function(T,I){return T=T>>>0,I||R(T,2,this.length),this[T]|this[T+1]<<8},p.prototype.readUint16BE=p.prototype.readUInt16BE=function(T,I){return T=T>>>0,I||R(T,2,this.length),this[T]<<8|this[T+1]},p.prototype.readUint32LE=p.prototype.readUInt32LE=function(T,I){return T=T>>>0,I||R(T,4,this.length),(this[T]|this[T+1]<<8|this[T+2]<<16)+this[T+3]*16777216},p.prototype.readUint32BE=p.prototype.readUInt32BE=function(T,I){return T=T>>>0,I||R(T,4,this.length),this[T]*16777216+(this[T+1]<<16|this[T+2]<<8|this[T+3])},p.prototype.readBigUInt64LE=lt(function(T){T=T>>>0,J(T,"offset");let I=this[T],O=this[T+7];(I===void 0||O===void 0)&&X(T,this.length-8);let q=I+this[++T]*2**8+this[++T]*2**16+this[++T]*2**24,H=this[++T]+this[++T]*2**8+this[++T]*2**16+O*2**24;return BigInt(q)+(BigInt(H)<<BigInt(32))}),p.prototype.readBigUInt64BE=lt(function(T){T=T>>>0,J(T,"offset");let I=this[T],O=this[T+7];(I===void 0||O===void 0)&&X(T,this.length-8);let q=I*2**24+this[++T]*2**16+this[++T]*2**8+this[++T],H=this[++T]*2**24+this[++T]*2**16+this[++T]*2**8+O;return(BigInt(q)<<BigInt(32))+BigInt(H)}),p.prototype.readIntLE=function(T,I,O){T=T>>>0,I=I>>>0,O||R(T,I,this.length);let q=this[T],H=1,W=0;for(;++W<I&&(H*=256);)q+=this[T+W]*H;return H*=128,q>=H&&(q-=Math.pow(2,8*I)),q},p.prototype.readIntBE=function(T,I,O){T=T>>>0,I=I>>>0,O||R(T,I,this.length);let q=I,H=1,W=this[T+--q];for(;q>0&&(H*=256);)W+=this[T+--q]*H;return H*=128,W>=H&&(W-=Math.pow(2,8*I)),W},p.prototype.readInt8=function(T,I){return T=T>>>0,I||R(T,1,this.length),this[T]&128?(255-this[T]+1)*-1:this[T]},p.prototype.readInt16LE=function(T,I){T=T>>>0,I||R(T,2,this.length);let O=this[T]|this[T+1]<<8;return O&32768?O|4294901760:O},p.prototype.readInt16BE=function(T,I){T=T>>>0,I||R(T,2,this.length);let O=this[T+1]|this[T]<<8;return O&32768?O|4294901760:O},p.prototype.readInt32LE=function(T,I){return T=T>>>0,I||R(T,4,this.length),this[T]|this[T+1]<<8|this[T+2]<<16|this[T+3]<<24},p.prototype.readInt32BE=function(T,I){return T=T>>>0,I||R(T,4,this.length),this[T]<<24|this[T+1]<<16|this[T+2]<<8|this[T+3]},p.prototype.readBigInt64LE=lt(function(T){T=T>>>0,J(T,"offset");let I=this[T],O=this[T+7];(I===void 0||O===void 0)&&X(T,this.length-8);let q=this[T+4]+this[T+5]*2**8+this[T+6]*2**16+(O<<24);return(BigInt(q)<<BigInt(32))+BigInt(I+this[++T]*2**8+this[++T]*2**16+this[++T]*2**24)}),p.prototype.readBigInt64BE=lt(function(T){T=T>>>0,J(T,"offset");let I=this[T],O=this[T+7];(I===void 0||O===void 0)&&X(T,this.length-8);let q=(I<<24)+this[++T]*2**16+this[++T]*2**8+this[++T];return(BigInt(q)<<BigInt(32))+BigInt(this[++T]*2**24+this[++T]*2**16+this[++T]*2**8+O)}),p.prototype.readFloatLE=function(T,I){return T=T>>>0,I||R(T,4,this.length),r.read(this,T,!0,23,4)},p.prototype.readFloatBE=function(T,I){return T=T>>>0,I||R(T,4,this.length),r.read(this,T,!1,23,4)},p.prototype.readDoubleLE=function(T,I){return T=T>>>0,I||R(T,8,this.length),r.read(this,T,!0,52,8)},p.prototype.readDoubleBE=function(T,I){return T=T>>>0,I||R(T,8,this.length),r.read(this,T,!1,52,8)};function S(T,I,O,q,H,W){if(!p.isBuffer(T))throw new TypeError('"buffer" argument must be a Buffer instance');if(I>H||I<W)throw new RangeError('"value" argument is out of bounds');if(O+q>T.length)throw new RangeError("Index out of range")}p.prototype.writeUintLE=p.prototype.writeUIntLE=function(T,I,O,q){if(T=+T,I=I>>>0,O=O>>>0,!q){let fe=Math.pow(2,8*O)-1;S(this,T,I,O,fe,0)}let H=1,W=0;for(this[I]=T&255;++W<O&&(H*=256);)this[I+W]=T/H&255;return I+O},p.prototype.writeUintBE=p.prototype.writeUIntBE=function(T,I,O,q){if(T=+T,I=I>>>0,O=O>>>0,!q){let fe=Math.pow(2,8*O)-1;S(this,T,I,O,fe,0)}let H=O-1,W=1;for(this[I+H]=T&255;--H>=0&&(W*=256);)this[I+H]=T/W&255;return I+O},p.prototype.writeUint8=p.prototype.writeUInt8=function(T,I,O){return T=+T,I=I>>>0,O||S(this,T,I,1,255,0),this[I]=T&255,I+1},p.prototype.writeUint16LE=p.prototype.writeUInt16LE=function(T,I,O){return T=+T,I=I>>>0,O||S(this,T,I,2,65535,0),this[I]=T&255,this[I+1]=T>>>8,I+2},p.prototype.writeUint16BE=p.prototype.writeUInt16BE=function(T,I,O){return T=+T,I=I>>>0,O||S(this,T,I,2,65535,0),this[I]=T>>>8,this[I+1]=T&255,I+2},p.prototype.writeUint32LE=p.prototype.writeUInt32LE=function(T,I,O){return T=+T,I=I>>>0,O||S(this,T,I,4,4294967295,0),this[I+3]=T>>>24,this[I+2]=T>>>16,this[I+1]=T>>>8,this[I]=T&255,I+4},p.prototype.writeUint32BE=p.prototype.writeUInt32BE=function(T,I,O){return T=+T,I=I>>>0,O||S(this,T,I,4,4294967295,0),this[I]=T>>>24,this[I+1]=T>>>16,this[I+2]=T>>>8,this[I+3]=T&255,I+4};function B(T,I,O,q,H){j(I,q,H,T,O,7);let W=Number(I&BigInt(4294967295));T[O++]=W,W=W>>8,T[O++]=W,W=W>>8,T[O++]=W,W=W>>8,T[O++]=W;let fe=Number(I>>BigInt(32)&BigInt(4294967295));return T[O++]=fe,fe=fe>>8,T[O++]=fe,fe=fe>>8,T[O++]=fe,fe=fe>>8,T[O++]=fe,O}function F(T,I,O,q,H){j(I,q,H,T,O,7);let W=Number(I&BigInt(4294967295));T[O+7]=W,W=W>>8,T[O+6]=W,W=W>>8,T[O+5]=W,W=W>>8,T[O+4]=W;let fe=Number(I>>BigInt(32)&BigInt(4294967295));return T[O+3]=fe,fe=fe>>8,T[O+2]=fe,fe=fe>>8,T[O+1]=fe,fe=fe>>8,T[O]=fe,O+8}p.prototype.writeBigUInt64LE=lt(function(T,I=0){return B(this,T,I,BigInt(0),BigInt("0xffffffffffffffff"))}),p.prototype.writeBigUInt64BE=lt(function(T,I=0){return F(this,T,I,BigInt(0),BigInt("0xffffffffffffffff"))}),p.prototype.writeIntLE=function(T,I,O,q){if(T=+T,I=I>>>0,!q){let st=Math.pow(2,8*O-1);S(this,T,I,O,st-1,-st)}let H=0,W=1,fe=0;for(this[I]=T&255;++H<O&&(W*=256);)T<0&&fe===0&&this[I+H-1]!==0&&(fe=1),this[I+H]=(T/W>>0)-fe&255;return I+O},p.prototype.writeIntBE=function(T,I,O,q){if(T=+T,I=I>>>0,!q){let st=Math.pow(2,8*O-1);S(this,T,I,O,st-1,-st)}let H=O-1,W=1,fe=0;for(this[I+H]=T&255;--H>=0&&(W*=256);)T<0&&fe===0&&this[I+H+1]!==0&&(fe=1),this[I+H]=(T/W>>0)-fe&255;return I+O},p.prototype.writeInt8=function(T,I,O){return T=+T,I=I>>>0,O||S(this,T,I,1,127,-128),T<0&&(T=255+T+1),this[I]=T&255,I+1},p.prototype.writeInt16LE=function(T,I,O){return T=+T,I=I>>>0,O||S(this,T,I,2,32767,-32768),this[I]=T&255,this[I+1]=T>>>8,I+2},p.prototype.writeInt16BE=function(T,I,O){return T=+T,I=I>>>0,O||S(this,T,I,2,32767,-32768),this[I]=T>>>8,this[I+1]=T&255,I+2},p.prototype.writeInt32LE=function(T,I,O){return T=+T,I=I>>>0,O||S(this,T,I,4,2147483647,-2147483648),this[I]=T&255,this[I+1]=T>>>8,this[I+2]=T>>>16,this[I+3]=T>>>24,I+4},p.prototype.writeInt32BE=function(T,I,O){return T=+T,I=I>>>0,O||S(this,T,I,4,2147483647,-2147483648),T<0&&(T=4294967295+T+1),this[I]=T>>>24,this[I+1]=T>>>16,this[I+2]=T>>>8,this[I+3]=T&255,I+4},p.prototype.writeBigInt64LE=lt(function(T,I=0){return B(this,T,I,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),p.prototype.writeBigInt64BE=lt(function(T,I=0){return F(this,T,I,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function $(T,I,O,q,H,W){if(O+q>T.length)throw new RangeError("Index out of range");if(O<0)throw new RangeError("Index out of range")}function re(T,I,O,q,H){return I=+I,O=O>>>0,H||$(T,I,O,4,34028234663852886e22,-34028234663852886e22),r.write(T,I,O,q,23,4),O+4}p.prototype.writeFloatLE=function(T,I,O){return re(this,T,I,!0,O)},p.prototype.writeFloatBE=function(T,I,O){return re(this,T,I,!1,O)};function Q(T,I,O,q,H){return I=+I,O=O>>>0,H||$(T,I,O,8,17976931348623157e292,-17976931348623157e292),r.write(T,I,O,q,52,8),O+8}p.prototype.writeDoubleLE=function(T,I,O){return Q(this,T,I,!0,O)},p.prototype.writeDoubleBE=function(T,I,O){return Q(this,T,I,!1,O)},p.prototype.copy=function(T,I,O,q){if(!p.isBuffer(T))throw new TypeError("argument should be a Buffer");if(O||(O=0),!q&&q!==0&&(q=this.length),I>=T.length&&(I=T.length),I||(I=0),q>0&&q<O&&(q=O),q===O||T.length===0||this.length===0)return 0;if(I<0)throw new RangeError("targetStart out of bounds");if(O<0||O>=this.length)throw new RangeError("Index out of range");if(q<0)throw new RangeError("sourceEnd out of bounds");q>this.length&&(q=this.length),T.length-I<q-O&&(q=T.length-I+O);let H=q-O;return this===T&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(I,O,q):Uint8Array.prototype.set.call(T,this.subarray(O,q),I),H},p.prototype.fill=function(T,I,O,q){if(typeof T=="string"){if(typeof I=="string"?(q=I,I=0,O=this.length):typeof O=="string"&&(q=O,O=this.length),q!==void 0&&typeof q!="string")throw new TypeError("encoding must be a string");if(typeof q=="string"&&!p.isEncoding(q))throw new TypeError("Unknown encoding: "+q);if(T.length===1){let W=T.charCodeAt(0);(q==="utf8"&&W<128||q==="latin1")&&(T=W)}}else typeof T=="number"?T=T&255:typeof T=="boolean"&&(T=Number(T));if(I<0||this.length<I||this.length<O)throw new RangeError("Out of range index");if(O<=I)return this;I=I>>>0,O=O===void 0?this.length:O>>>0,T||(T=0);let H;if(typeof T=="number")for(H=I;H<O;++H)this[H]=T;else{let W=p.isBuffer(T)?T:p.from(T,q),fe=W.length;if(fe===0)throw new TypeError('The value "'+T+'" is invalid for argument "value"');for(H=0;H<O-I;++H)this[H+I]=W[H%fe]}return this};var Z={};function K(T,I,O){Z[T]=class extends O{constructor(){super(),Object.defineProperty(this,"message",{value:I.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${T}]`,this.stack,delete this.name}get code(){return T}set code(q){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:q,writable:!0})}toString(){return`${this.name} [${T}]: ${this.message}`}}}K("ERR_BUFFER_OUT_OF_BOUNDS",function(T){return T?`${T} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),K("ERR_INVALID_ARG_TYPE",function(T,I){return`The "${T}" argument must be of type number. Received type ${typeof I}`},TypeError),K("ERR_OUT_OF_RANGE",function(T,I,O){let q=`The value of "${T}" is out of range.`,H=O;return Number.isInteger(O)&&Math.abs(O)>2**32?H=le(String(O)):typeof O=="bigint"&&(H=String(O),(O>BigInt(2)**BigInt(32)||O<-(BigInt(2)**BigInt(32)))&&(H=le(H)),H+="n"),q+=` It must be ${I}. Received ${H}`,q},RangeError);function le(T){let I="",O=T.length,q=T[0]==="-"?1:0;for(;O>=q+4;O-=3)I=`_${T.slice(O-3,O)}${I}`;return`${T.slice(0,O)}${I}`}function te(T,I,O){J(I,"offset"),(T[I]===void 0||T[I+O]===void 0)&&X(I,T.length-(O+1))}function j(T,I,O,q,H,W){if(T>O||T<I){let fe=typeof I=="bigint"?"n":"",st;throw W>3?I===0||I===BigInt(0)?st=`>= 0${fe} and < 2${fe} ** ${(W+1)*8}${fe}`:st=`>= -(2${fe} ** ${(W+1)*8-1}${fe}) and < 2 ** ${(W+1)*8-1}${fe}`:st=`>= ${I}${fe} and <= ${O}${fe}`,new Z.ERR_OUT_OF_RANGE("value",st,T)}te(q,H,W)}function J(T,I){if(typeof T!="number")throw new Z.ERR_INVALID_ARG_TYPE(I,"number",T)}function X(T,I,O){throw Math.floor(T)!==T?(J(T,O),new Z.ERR_OUT_OF_RANGE(O||"offset","an integer",T)):I<0?new Z.ERR_BUFFER_OUT_OF_BOUNDS:new Z.ERR_OUT_OF_RANGE(O||"offset",`>= ${O?1:0} and <= ${I}`,T)}var he=/[^+/0-9A-Za-z-_]/g;function Te(T){if(T=T.split("=")[0],T=T.trim().replace(he,""),T.length<2)return"";for(;T.length%4!==0;)T=T+"=";return T}function oe(T,I){I=I||1/0;let O,q=T.length,H=null,W=[];for(let fe=0;fe<q;++fe){if(O=T.charCodeAt(fe),O>55295&&O<57344){if(!H){if(O>56319){(I-=3)>-1&&W.push(239,191,189);continue}else if(fe+1===q){(I-=3)>-1&&W.push(239,191,189);continue}H=O;continue}if(O<56320){(I-=3)>-1&&W.push(239,191,189),H=O;continue}O=(H-55296<<10|O-56320)+65536}else H&&(I-=3)>-1&&W.push(239,191,189);if(H=null,O<128){if((I-=1)<0)break;W.push(O)}else if(O<2048){if((I-=2)<0)break;W.push(O>>6|192,O&63|128)}else if(O<65536){if((I-=3)<0)break;W.push(O>>12|224,O>>6&63|128,O&63|128)}else if(O<1114112){if((I-=4)<0)break;W.push(O>>18|240,O>>12&63|128,O>>6&63|128,O&63|128)}else throw new Error("Invalid code point")}return W}function ce(T){let I=[];for(let O=0;O<T.length;++O)I.push(T.charCodeAt(O)&255);return I}function ot(T,I){let O,q,H,W=[];for(let fe=0;fe<T.length&&!((I-=2)<0);++fe)O=T.charCodeAt(fe),q=O>>8,H=O%256,W.push(H),W.push(q);return W}function ge(T){return e.toByteArray(Te(T))}function Se(T,I,O,q){let H;for(H=0;H<q&&!(H+O>=I.length||H>=T.length);++H)I[H+O]=T[H];return H}function ut(T,I){return T instanceof I||T!=null&&T.constructor!=null&&T.constructor.name!=null&&T.constructor.name===I.name}function Ze(T){return T!==T}var Ge=function(){let T="0123456789abcdef",I=new Array(256);for(let O=0;O<16;++O){let q=O*16;for(let H=0;H<16;++H)I[q+H]=T[O]+T[H]}return I}();function lt(T){return typeof BigInt>"u"?z:T}function z(){throw new Error("BigInt not supported")}}),p$e=Jh((t,e)=>{typeof window<"u"?(window.global=window,global.fetch=window.fetch,e.exports={Buffer:nB().Buffer,Crypto:window.crypto}):e.exports={Buffer:nB().Buffer,Crypto:crypto}}),jse={};f$e(jse,{AVSCTap:()=>pb,ArweaveSigner:()=>IB,DataItem:()=>ub,MAX_TAG_BYTES:()=>Ow,MIN_BINARY_SIZE:()=>OB,SIG_CONFIG:()=>pv,SignatureConfig:()=>Ls,Signer:()=>zse,createData:()=>Wse,deserializeTags:()=>xw,indexToType:()=>BB,serializeTags:()=>PB,tagsExceedLimit:()=>Kse});var zse=class{signer;publicKey;signatureType;signatureLength;ownerLength;pem;static verify(t,e,r,a){throw new Error("You must implement verify method on child")}},v$e=Zd(kB(),1),Ff=Zd(Fse(),1);async function Zse(t){if(Array.isArray(t)){let i=(0,Ff.concatBuffers)([(0,Ff.stringToBuffer)("list"),(0,Ff.stringToBuffer)(t.length.toString())]);return await Hse(t,await Wh().hash(i,"SHA-384"))}let e=t,r=(0,Ff.concatBuffers)([(0,Ff.stringToBuffer)("blob"),(0,Ff.stringToBuffer)(e.byteLength.toString())]),a=(0,Ff.concatBuffers)([await Wh().hash(r,"SHA-384"),await Wh().hash(e,"SHA-384")]);return await Wh().hash(a,"SHA-384")}async function Hse(t,e){if(t.length<1)return e;let r=(0,Ff.concatBuffers)([e,await Zse(t[0])]),a=await Wh().hash(r,"SHA-384");return await Hse(t.slice(1),a)}var NI=Zd(c$e(),1),m$e=NI.default.default?NI.default.default:NI.default,g$e=class extends m$e{getPublicKey(t){throw new Error("Unimplemented")}},b$e;function Wh(){return b$e??=new g$e}var Ls;(function(t){t[t.ARWEAVE=1]="ARWEAVE",t[t.ED25519=2]="ED25519",t[t.ETHEREUM=3]="ETHEREUM",t[t.SOLANA=4]="SOLANA",t[t.INJECTEDAPTOS=5]="INJECTEDAPTOS",t[t.MULTIAPTOS=6]="MULTIAPTOS",t[t.TYPEDETHEREUM=7]="TYPEDETHEREUM"})(Ls||(Ls={}));var pv={[Ls.ARWEAVE]:{sigLength:512,pubLength:512,sigName:"arweave"},[Ls.ED25519]:{sigLength:64,pubLength:32,sigName:"ed25519"},[Ls.ETHEREUM]:{sigLength:65,pubLength:65,sigName:"ethereum"},[Ls.SOLANA]:{sigLength:64,pubLength:32,sigName:"solana"},[Ls.INJECTEDAPTOS]:{sigLength:64,pubLength:32,sigName:"injectedAptos"},[Ls.MULTIAPTOS]:{sigLength:64*32+4,pubLength:32*32+1,sigName:"multiAptos"},[Ls.TYPEDETHEREUM]:{sigLength:65,pubLength:42,sigName:"typedEthereum"}},IB=class{signatureType=1;ownerLength=pv[1].pubLength;signatureLength=pv[1].sigLength;jwk;pk;constructor(t){this.pk=t.n,this.jwk=t}get publicKey(){return v$e.default.toBuffer(this.pk)}sign(t){return Wh().sign(this.jwk,t)}static async verify(t,e,r){return await Wh().verify(t,e,r)}},BB={1:IB},ju=Zd(kB(),1);async function aB(t){return Zse([(0,Ff.stringToBuffer)("dataitem"),(0,Ff.stringToBuffer)("1"),(0,Ff.stringToBuffer)(t.signatureType.toString()),t.rawOwner,t.rawTarget,t.rawAnchor,t.rawTags,t.rawData])}async function y$e(t,e){let r=await aB(t),a=await e.sign(r),i=await Wh().hash(a);return{signature:Me.from(a),id:Me.from(i)}}async function w$e(t,e){let{signature:r,id:a}=await y$e(t,e);return t.getRaw().set(r,2),a}var pb=class{buf;pos;constructor(t=Me.alloc(Ow),e=0){this.buf=t,this.pos=e}writeTags(t){if(!Array.isArray(t))throw new Error("input must be array");let e=t.length,r;if(e)for(this.writeLong(e),r=0;r<e;r++){let a=t[r];if(a?.name===void 0||a?.value===void 0)throw new Error(`Invalid tag format for ${a}, expected {name:string, value: string}`);this.writeString(a.name),this.writeString(a.value)}this.writeLong(0)}toBuffer(){let t=Me.alloc(this.pos);if(this.pos>this.buf.length)throw new Error(`Too many tag bytes (${this.pos} > ${this.buf.length})`);return this.buf.copy(t,0,0,this.pos),t}tagsExceedLimit(){return this.pos>this.buf.length}writeLong(t){let e=this.buf,r,a;if(t>=-1073741824&&t<1073741824){a=t>=0?t<<1:~t<<1|1;do e[this.pos]=a&127,a>>=7;while(a&&(e[this.pos++]|=128))}else{r=t>=0?t*2:-t*2-1;do e[this.pos]=r&127,r/=128;while(r>=1&&(e[this.pos++]|=128))}this.pos++,this.buf=e}writeString(t){let e=Me.byteLength(t),r=this.buf;this.writeLong(e);let a=this.pos;if(this.pos+=e,!(this.pos>r.length)){if(e>64)this.buf.write(t,this.pos-e,e,"utf8");else{let i,h,l,p;for(i=0,h=e;i<h;i++)l=t.charCodeAt(i),l<128?r[a++]=l:l<2048?(r[a++]=l>>6|192,r[a++]=l&63|128):(l&64512)===55296&&((p=t.charCodeAt(i+1))&64512)===56320?(l=65536+((l&1023)<<10)+(p&1023),i++,r[a++]=l>>18|240,r[a++]=l>>12&63|128,r[a++]=l>>6&63|128,r[a++]=l&63|128):(r[a++]=l>>12|224,r[a++]=l>>6&63|128,r[a++]=l&63|128)}this.buf=r}}readLong(){let t=0,e=0,r=this.buf,a,i,h,l;do a=r[this.pos++],i=a&128,t|=(a&127)<<e,e+=7;while(i&&e<28);if(i){h=t,l=268435456;do a=r[this.pos++],h+=(a&127)*l,l*=128;while(a&128);return(h%2?-(h+1):h)/2}return t>>1^-(t&1)}skipLong(){let t=this.buf;for(;t[this.pos++]&128;);}readTags(){let t=[],e;for(;e=this.readLong();)for(e<0&&(e=-e,this.skipLong());e--;){let r=this.readString(),a=this.readString();t.push({name:r,value:a})}return t}readString(){let t=this.readLong(),e=this.pos,r=this.buf;if(this.pos+=t,!(this.pos>r.length))return this.buf.slice(e,e+t).toString()}};function PB(t){let e=new pb;return e.writeTags(t),e.toBuffer()}function Kse(t){let e=new pb;return e.writeTags(t),e.tagsExceedLimit()}function xw(t){return new pb(t).readTags()}function yc(t){let e=0;for(let r=t.length-1;r>=0;r--)e=e*256+t[r];return e}function _$e(t){if(t>29)throw new Error("Short too long");let e=[0,0];for(let r=0;r<e.length;r++){let a=t&255;e[r]=a,t=(t-a)/256}return Uint8Array.from(e)}function uoe(t){let e=[0,0,0,0,0,0,0,0];for(let r=0;r<e.length;r++){let a=t&255;e[r]=a,t=(t-a)/256}return Uint8Array.from(e)}var M$e=Zd(p$e(),1),V1=Zd(nB(),1),Ow=4096,OB=80,ub=class{binary;_id;constructor(t){this.binary=t}static isDataItem(t){return t.binary!==void 0}get signatureType(){let t=yc(this.binary.subarray(0,2));if(Ls?.[t]!==void 0)return t;throw new Error("Unknown signature type: "+t)}async isValid(){return ub.verify(this.binary)}get id(){return(async()=>ju.default.encode(await this.rawId))()}set id(t){this._id=ju.default.toBuffer(t)}get rawId(){return(async()=>V1.Buffer.from(await M$e.Crypto.subtle.digest("SHA-256",this.rawSignature)))()}set rawId(t){this._id=t}get rawSignature(){return this.binary.subarray(2,2+this.signatureLength)}get signature(){return ju.default.encode(this.rawSignature)}set rawOwner(t){if(t.byteLength!=this.ownerLength)throw new Error(`Expected raw owner (pubkey) to be ${this.ownerLength} bytes, got ${t.byteLength} bytes.`);this.binary.set(t,2+this.signatureLength)}get rawOwner(){return this.binary.subarray(2+this.signatureLength,2+this.signatureLength+this.ownerLength)}get signatureLength(){return pv[this.signatureType].sigLength}get owner(){return ju.default.encode(this.rawOwner)}get ownerLength(){return pv[this.signatureType].pubLength}get rawTarget(){let t=this.getTargetStart();return this.binary[t]==1?this.binary.subarray(t+1,t+33):V1.Buffer.alloc(0)}get target(){return ju.default.encode(this.rawTarget)}get rawAnchor(){let t=this.getAnchorStart();return this.binary[t]==1?this.binary.subarray(t+1,t+33):V1.Buffer.alloc(0)}get anchor(){return this.rawAnchor.toString()}get rawTags(){let t=this.getTagsStart(),e=yc(this.binary.subarray(t+8,t+16));return this.binary.subarray(t+16,t+16+e)}get tags(){let t=this.getTagsStart();if(yc(this.binary.subarray(t,t+8))==0)return[];let e=yc(this.binary.subarray(t+8,t+16));return xw(V1.Buffer.from(this.binary.subarray(t+16,t+16+e)))}get tagsB64Url(){return this.tags.map(t=>({name:ju.default.encode(t.name),value:ju.default.encode(t.value)}))}getStartOfData(){let t=this.getTagsStart(),e=this.binary.subarray(t+8,t+16),r=yc(e);return t+16+r}get rawData(){let t=this.getTagsStart(),e=this.binary.subarray(t+8,t+16),r=yc(e),a=t+16+r;return this.binary.subarray(a,this.binary.length)}get data(){return ju.default.encode(this.rawData)}getRaw(){return this.binary}async sign(t){return this._id=await w$e(this,t),this.rawId}async setSignature(t){this.binary.set(t,2),this._id=V1.Buffer.from(await Wh().hash(t))}isSigned(){return(this._id?.length??0)>0}toJSON(){return{signature:this.signature,owner:this.owner,target:this.target,tags:this.tags.map(t=>({name:ju.default.encode(t.name),value:ju.default.encode(t.value)})),data:this.data}}static async verify(t){if(t.byteLength<OB)return!1;let e=new ub(t),r=e.signatureType,a=e.getTagsStart(),i=yc(t.subarray(a,a+8)),h=t.subarray(a+8,a+16),l=yc(h);if(l>Ow)return!1;if(i>0)try{if(xw(V1.Buffer.from(t.subarray(a+16,a+16+l))).length!==i)return!1}catch{return!1}let p=BB[r],b=await aB(e);return await p.verify(e.rawOwner,b,e.rawSignature)}async getSignatureData(){return aB(this)}getTagsStart(){let t=this.getTargetStart(),e=this.binary[t]==1,r=t+(e?33:1),a=this.binary[r]==1;return r+=a?33:1,r}getTargetStart(){return 2+this.signatureLength+this.ownerLength}getAnchorStart(){let t=this.getTargetStart()+1,e=this.binary[this.getTargetStart()]==1;return t+=e?32:0,t}},x$e=Zd(kB(),1);function Wse(t,e,r){let a=e.publicKey,i=r?.target?x$e.default.toBuffer(r.target):null,h=1+(i?.byteLength??0),l=r?.anchor?Me.from(r.anchor):null,p=1+(l?.byteLength??0),b=(r?.tags?.length??0)>0?PB(r.tags):null,g=16+(b?b.byteLength:0),y=Me.from(t),M=y.byteLength,x=2+e.signatureLength+e.ownerLength+h+p+g+M,E=Me.alloc(x);if(E.set(_$e(e.signatureType),0),E.set(new Uint8Array(e.signatureLength).fill(0),2),a.byteLength!==e.ownerLength)throw new Error(`Owner must be ${e.ownerLength} bytes, but was incorrectly ${a.byteLength}`);E.set(a,2+e.signatureLength);let A=2+e.signatureLength+e.ownerLength;if(E[A]=i?1:0,i){if(i.byteLength!==32)throw new Error(`Target must be 32 bytes but was incorrectly ${i.byteLength}`);E.set(i,A+1)}let k=A+h,P=k+1;if(E[k]=l?1:0,l){if(P+=l.byteLength,l.byteLength!==32)throw new Error("Anchor must be 32 bytes");E.set(l,k+1)}E.set(uoe(r?.tags?.length??0),P);let N=uoe(b?.byteLength??0);E.set(N,P+8),b&&E.set(b,P+16);let L=P+g;return E.set(y,L),new ub(E)}var NB={...jse};globalThis.arbundles??=NB;var S$e=NB,E$e=NB;globalThis.Buffer||(globalThis.Buffer=$se.Buffer);var{DataItem:A$e}=qse;function R$e(t){return async({data:r,tags:a,target:i,anchor:h,createDataItem:l=p=>new A$e(p)})=>{let p=await t.signDataItem({data:r,tags:a,target:i,anchor:h}),b=l($se.Buffer.from(p));return{id:await b.id,raw:await b.getRaw()}}}var T$e=globalThis.GATEWAY_URL||void 0,k$e=globalThis.MU_URL||void 0,I$e=globalThis.CU_URL||void 0,B$e=globalThis.GRAPHQL_URL||void 0,{result:Fmt,results:jmt,message:zmt,spawn:Zmt,monitor:Hmt,unmonitor:Kmt,dryrun:Wmt,assign:Vmt}=vv({GATEWAY_URL:T$e,MU_URL:k$e,CU_URL:I$e,GRAPHQL_URL:B$e}),Vse=Dse.createDataItemSigner;ie();ae();ne();var Ffe=gi(Ufe(),1),hP=Ffe.default.init({host:"arweave.net",port:443,protocol:"https"});async function qbt({signer:t,module:e=aQ,luaCodeTxId:r=gT,ao:a=vv(),scheduler:i=oQ,state:h,stateContractTxId:l,antRegistryId:p=$8,logger:b=Fu.default,arweave:g=hP}){let y=await g.transactions.getData(r,{decode:!0,string:!0}),M=await a.spawn({module:e,scheduler:i,signer:t,tags:[{name:"ANT-Registry-Id",value:p},{name:"Source-Code-TX-ID",value:r}]}),x=new Pa({processId:M,ao:a,logger:b}),{id:E}=await x.send({tags:[{name:"Action",value:"Eval"},{name:"App-Name",value:"ArNS-ANT"},{name:"Source-Code-TX-ID",value:r}],data:y,signer:t});if(b.debug("Spawned ANT",{processId:M,module:e,scheduler:i,luaCodeTxId:r,evalId:E}),h){let{id:P}=await x.send({tags:[{name:"Action",value:"Initialize-State"},...l!==void 0?[{name:"State-Contract-TX-ID",value:l}]:[]],data:JSON.stringify(h),signer:t});b.debug("Initialized ANT",{processId:M,module:e,scheduler:i,initializeMsgId:P})}let A=Hd.init({process:new Pa({processId:p,ao:a,logger:b}),signer:t}),{id:k}=await A.register({processId:M});return b.debug("Registered ANT to ANT Registry",{processId:M,module:e,scheduler:i,antRegistrationMsgId:k,antRegistryId:p}),M}async function Ubt({signer:t,processId:e,luaCodeTxId:r=gT,ao:a=vv(),logger:i=Fu.default,arweave:h=hP}){let l=new Pa({processId:e,ao:a,logger:i}),p=await h.transactions.getData(r,{decode:!0,string:!0}),{id:b}=await l.send({tags:[{name:"Action",value:"Eval"},{name:"App-Name",value:"ArNS-ANT"},{name:"Source-Code-TX-ID",value:r}],data:p,signer:t});return i.debug("Evolved ANT",{processId:e,luaCodeTxId:r,evalMsgId:b}),b}function Jqe(t){let e=vr.object({name:vr.string(),value:vr.union([vr.string(),vr.number()])}),r=vr.function().args(vr.object({data:vr.union([vr.string(),vr.instanceof(Me)]),tags:vr.array(e).optional(),target:vr.string().optional(),anchor:vr.string().optional()})).returns(vr.promise(vr.object({id:vr.string(),raw:vr.instanceof(ArrayBuffer)})));try{return r.parse(t),!0}catch{return!1}}function Bc(t){return Jqe(t)?t:"publicKey"in t?async({data:r,tags:a,target:i,anchor:h})=>{t.publicKey===void 0&&"setPublicKey"in t&&typeof t.setPublicKey=="function"&&await t.setPublicKey();let l=Ag(r,t,{tags:a,target:i,anchor:h});return l.sign(t).then(async()=>({id:await l.id,raw:await l.getRaw()}))}:Vse(t)}var Xqe="-k7t8xMoB8hW482609Z9F4bTFMC3MnuW8bTvTyT8pFI";function Fbt({owner:t,targetId:e,ttlSeconds:r=3600,keywords:a=[],controllers:i=[],description:h="",ticker:l="aos",name:p="ANT"}){return{ticker:l,name:p,description:h,keywords:a,owner:t,controllers:[t,...i],balances:{[t]:1},records:{"@":{transactionId:e??Xqe.toString(),ttlSeconds:r}}}}ie();ae();ne();function Pc(t,e){let r=t.safeParse(e);if(!r.success)throw new Error(JSON.stringify(r.error.format(),null,2));return r}var Fw=class{static init({signer:e,strict:r=!1,...a}){if(Dh(a)||$h(a))return e?new lP({signer:e,strict:r,...a}):new jw({strict:r,...a});throw new Nu}},jw=class{process;strict;constructor(e){if(this.strict=e.strict||!1,Dh(e))this.process=e.process;else if($h(e))this.process=new Pa({processId:e.processId});else throw new Nu}async getState({strict:e}={strict:this.strict}){let r=[{name:"Action",value:"State"}],a=await this.process.read({tags:r});return e&&Pc(_T.passthrough().and(vr.object({Records:vr.record(vr.string(),q8.passthrough())})),a),a}async getInfo({strict:e}={strict:this.strict}){let r=[{name:"Action",value:"Info"}],a=await this.process.read({tags:r});return e&&Pc(hQ.passthrough(),a),a}async getRecord({undername:e},{strict:r}={strict:this.strict}){let a=[{name:"Sub-Domain",value:e},{name:"Action",value:"Record"}],i=await this.process.read({tags:a});return r&&Pc(q8.passthrough(),i),i}async getRecords({strict:e}={strict:this.strict}){let r=[{name:"Action",value:"Records"}],a=await this.process.read({tags:r});return e&&Pc(bT,a),a}async getOwner({strict:e}={strict:this.strict}){return(await this.getInfo({strict:e})).Owner}async getControllers({strict:e}={strict:this.strict}){let r=[{name:"Action",value:"Controllers"}],a=await this.process.read({tags:r});return e&&Pc(yT,a),a}async getName({strict:e}={strict:this.strict}){return(await this.getInfo({strict:e})).Name}async getTicker({strict:e}={strict:this.strict}){return(await this.getInfo({strict:e})).Ticker}async getBalances({strict:e}={strict:this.strict}){let r=[{name:"Action",value:"Balances"}],a=await this.process.read({tags:r});return e&&Pc(wT,a),a}async getBalance({address:e},{strict:r}={strict:this.strict}){let a=[{name:"Action",value:"Balance"},{name:"Recipient",value:e}],i=await this.process.read({tags:a});return r&&Pc(vr.number(),i),i}async getHandlers(){let e=await this.getInfo();return e.Handlers??e.HandlerNames}},lP=class extends jw{signer;constructor({signer:e,...r}){super(r),this.signer=Bc(e)}async transfer({target:e},r){let a=[...r?.tags??[],{name:"Action",value:"Transfer"},{name:"Recipient",value:e}];return this.process.send({tags:a,signer:this.signer})}async addController({controller:e},r){let a=[...r?.tags??[],{name:"Action",value:"Add-Controller"},{name:"Controller",value:e}];return this.process.send({tags:a,signer:this.signer})}async removeController({controller:e},r){let a=[...r?.tags??[],{name:"Action",value:"Remove-Controller"},{name:"Controller",value:e}];return this.process.send({tags:a,signer:this.signer})}async setRecord({undername:e,transactionId:r,ttlSeconds:a},i){return this.process.send({tags:[...i?.tags??[],{name:"Action",value:"Set-Record"},{name:"Sub-Domain",value:e},{name:"Transaction-Id",value:r},{name:"TTL-Seconds",value:a.toString()}],signer:this.signer})}async removeRecord({undername:e},r){return this.process.send({tags:[...r?.tags??[],{name:"Action",value:"Remove-Record"},{name:"Sub-Domain",value:e}],signer:this.signer})}async setTicker({ticker:e},r){return this.process.send({tags:[...r?.tags??[],{name:"Action",value:"Set-Ticker"},{name:"Ticker",value:e}],signer:this.signer})}async setName({name:e},r){return this.process.send({tags:[...r?.tags??[],{name:"Action",value:"Set-Name"},{name:"Name",value:e}],signer:this.signer})}async setDescription({description:e},r){return this.process.send({tags:[...r?.tags??[],{name:"Action",value:"Set-Description"},{name:"Description",value:e}],signer:this.signer})}async setKeywords({keywords:e},r){return this.process.send({tags:[...r?.tags??[],{name:"Action",value:"Set-Keywords"},{name:"Keywords",value:JSON.stringify(e)}],signer:this.signer})}async setLogo({txId:e},r){return this.process.send({tags:[...r?.tags??[],{name:"Action",value:"Set-Logo"},{name:"Logo",value:e}],signer:this.signer})}async releaseName({name:e,arioProcessId:r},a){return this.process.send({tags:[...a?.tags??[],{name:"Action",value:"Release-Name"},{name:"Name",value:e},{name:"IO-Process-Id",value:r},{name:"ARIO-Process-Id",value:r}],signer:this.signer})}async reassignName({name:e,arioProcessId:r,antProcessId:a},i){return this.process.send({tags:[...i?.tags??[],{name:"Action",value:"Reassign-Name"},{name:"Name",value:e},{name:"IO-Process-Id",value:r},{name:"ARIO-Process-Id",value:r},{name:"Process-Id",value:a}],signer:this.signer})}async approvePrimaryNameRequest({name:e,address:r,arioProcessId:a},i){return this.process.send({tags:[...i?.tags??[],{name:"Action",value:"Approve-Primary-Name"},{name:"Name",value:e},{name:"Recipient",value:r},{name:"IO-Process-Id",value:a},{name:"ARIO-Process-Id",value:a}],signer:this.signer})}async removePrimaryNames({names:e,arioProcessId:r},a){return this.process.send({tags:[...a?.tags??[],{name:"Action",value:"Remove-Primary-Names"},{name:"Names",value:e.join(",")},{name:"IO-Process-Id",value:r},{name:"ARIO-Process-Id",value:r}],signer:this.signer})}};ie();ae();ne();var Hd=class{static init(e){if(e&&e.signer){let{signer:r,...a}=e;return new cP({...a,signer:r})}return new zw(e)}},zw=class{process;constructor(e){if(e&&($h(e)||Dh(e)))if(Dh(e))this.process=e.process;else if($h(e))this.process=new Pa({processId:e.processId});else throw new Nu;else this.process=new Pa({processId:$8})}async accessControlList({address:e}){return this.process.read({tags:[{name:"Action",value:"Access-Control-List"},{name:"Address",value:e}]})}},cP=class extends zw{signer;constructor({signer:e,...r}){super(r),this.signer=Bc(e)}async register({processId:e}){return this.process.send({tags:[{name:"Action",value:"Register"},{name:"Process-Id",value:e}],signer:this.signer})}};ie();ae();ne();ie();ae();ne();ie();ae();ne();du();var jfe="+",zfe="/",Zfe="-",Hfe="_",Kfe="=";function Qqe(t){let e=t.length%4;return e&&(t+=Kfe.repeat(4-e)),t.replaceAll(Zfe,jfe).replaceAll(Hfe,zfe)}function eUe(t){return t.replaceAll(jfe,Zfe).replaceAll(zfe,Hfe).replaceAll(Kfe,"")}function Nyt(t){let e=Qqe(t);return Me.from(e,"base64")}function tUe(t){let e=t.toString("base64");return eUe(e)}function Cyt(t){return tUe(pf("sha256").update(Uint8Array.from(t)).digest())}function Wfe(t=32){let e=nE(t);return Array.from(e,r=>r.toString(16).padStart(2,"0")).join("").slice(0,t)}ie();ae();ne();function dP(t){try{return JSON.parse(t)}catch{return t}}var Pa=class{logger;processId;ao;constructor({processId:e,ao:r=vv(),logger:a=Fu.default}){this.processId=e,this.logger=a,this.ao=r}isMessageDataEmpty(e){return e===void 0||e==="null"||e===""||e===null}async read({tags:e,retries:r=3,fromAddress:a}){let i=0,h;for(;i<r;)try{this.logger.debug("Evaluating read interaction on contract",{tags:e});let l={process:this.processId,tags:e};a!==void 0&&(l.Owner=a);let p=await this.ao.dryrun(l);this.logger.debug("Read interaction result",{result:p});let b=Vfe(p);if(b!==void 0)throw new Error(b);if(p.Messages===void 0||p.Messages.length===0)throw this.logger.debug(`Process ${this.processId} does not support provided action.`,p,e),new Error(`Process ${this.processId} does not support provided action.`);let g=p.Messages?.[0]?.Data;return this.isMessageDataEmpty(g)?void 0:dP(p.Messages[0].Data)}catch(l){i++,this.logger.debug(`Read attempt ${i} failed`,{error:l instanceof Error?l.message:l,tags:e}),h=l,await new Promise(p=>setTimeout(p,2**i*1e3))}throw h}async send({tags:e,data:r,signer:a,retries:i=3}){let h=0,l;for(;h<i;)try{this.logger.debug("Evaluating send interaction on contract",{tags:e,data:r,processId:this.processId});let p=Wfe(32),b=await this.ao.message({process:this.processId,tags:[...e,{name:"AR-IO-SDK",value:W4}],data:r,signer:a,anchor:p});this.logger.debug("Sent message to process",{messageId:b,processId:this.processId,anchor:p});let g=await this.ao.result({message:b,process:this.processId});this.logger.debug("Message result",{output:g,messageId:b,processId:this.processId});let y=Vfe(g);if(y!==void 0)throw new U8(y);if(g.Messages?.length===0||g.Messages===void 0)return{id:b};if(g.Messages.length===0)throw new Error(`Process ${this.processId} does not support provided action.`);if(this.isMessageDataEmpty(g.Messages[0].Data))return{id:b};let M=dP(g.Messages[0].Data);return this.logger.debug("Message result data",{resultData:M,messageId:b,processId:this.processId}),{id:b,result:M}}catch(p){if(this.logger.error("Error sending message to process",{error:p.message,processId:this.processId,tags:e}),p.message.includes("500"))this.logger.debug("Retrying send interaction",{attempts:h,retries:i,error:p.message,processId:this.processId}),await new Promise(b=>setTimeout(b,2**h*2e3)),h++,l=p;else throw p}throw l}};function Vfe(t){let e=t.Error;if(e!==void 0)return e;let r=t.Messages?.[0]?.Tags?.find(a=>a.name==="Error")?.value;if(r!==void 0){let a=r.match(/\d+/)?.[0];return`${r.replace(/\[string "aos"\]:\d+:/,"")} (line ${a})`.trim()}}var Eb=class{static init(e){if(e&&e.signer){let{signer:r,...a}=e;return new pP({...a,signer:r})}return new Zw(e)}},Zw=class{process;constructor(e){if(!e)this.process=new Pa({processId:A1});else if(Dh(e))this.process=e.process;else if($h(e))this.process=new Pa({processId:e.processId});else throw new Nu}async getInfo(){return this.process.read({tags:[{name:"Action",value:"Info"}]})}async getTokenSupply(){return this.process.read({tags:[{name:"Action",value:"Total-Token-Supply"}]})}async getEpochSettings(e){let r=[{name:"Action",value:"Epoch-Settings"},{name:"Timestamp",value:e?.timestamp?.toString()??Date.now().toString()},{name:"Epoch-Index",value:e?.epochIndex?.toString()}];return this.process.read({tags:wn(r)})}async getEpoch(e){let r=[{name:"Action",value:"Epoch"},{name:"Timestamp",value:e?.timestamp?.toString()??Date.now().toString()},{name:"Epoch-Index",value:e?.epochIndex?.toString()}];return this.process.read({tags:wn(r)})}async getArNSRecord({name:e}){return this.process.read({tags:[{name:"Action",value:"Record"},{name:"Name",value:e}]})}async getArNSRecords(e){return this.process.read({tags:[{name:"Action",value:"Paginated-Records"},...Oo(e)]})}async getArNSReservedNames(e){return this.process.read({tags:[{name:"Action",value:"Reserved-Names"},...Oo(e)]})}async getArNSReservedName({name:e}){return this.process.read({tags:[{name:"Action",value:"Reserved-Name"},{name:"Name",value:e}]})}async getBalance({address:e}){return this.process.read({tags:[{name:"Action",value:"Balance"},{name:"Address",value:e}]})}async getBalances(e){return this.process.read({tags:[{name:"Action",value:"Paginated-Balances"},...Oo(e)]})}async getVault({address:e,vaultId:r}){return this.process.read({tags:[{name:"Action",value:"Vault"},{name:"Address",value:e},{name:"Vault-Id",value:r}]})}async getVaults(e){return this.process.read({tags:[{name:"Action",value:"Paginated-Vaults"},...Oo(e)]})}async getGateway({address:e}){return this.process.read({tags:[{name:"Action",value:"Gateway"},{name:"Address",value:e}]})}async getGatewayDelegates({address:e,...r}){return this.process.read({tags:[{name:"Action",value:"Paginated-Delegates"},{name:"Address",value:e},...Oo(r)]})}async getGatewayDelegateAllowList({address:e,...r}){return this.process.read({tags:[{name:"Action",value:"Paginated-Allowed-Delegates"},{name:"Address",value:e},...Oo(r)]})}async getGateways(e){return this.process.read({tags:[{name:"Action",value:"Paginated-Gateways"},...Oo(e)]})}async getCurrentEpoch(){return this.process.read({tags:[{name:"Action",value:"Epoch"}]})}async getPrescribedObservers(e){let r=[{name:"Action",value:"Epoch-Prescribed-Observers"},{name:"Timestamp",value:e?.timestamp?.toString()??Date.now().toString()},{name:"Epoch-Index",value:e?.epochIndex?.toString()}];return this.process.read({tags:wn(r)})}async getPrescribedNames(e){let r=[{name:"Action",value:"Epoch-Prescribed-Names"},{name:"Timestamp",value:e?.timestamp?.toString()??Date.now().toString()},{name:"Epoch-Index",value:e?.epochIndex?.toString()}];return this.process.read({tags:wn(r)})}async getObservations(e){let r=[{name:"Action",value:"Epoch-Observations"},{name:"Timestamp",value:e?.timestamp?.toString()??Date.now().toString()},{name:"Epoch-Index",value:e?.epochIndex?.toString()}];return this.process.read({tags:wn(r)})}async getDistributions(e){let r=[{name:"Action",value:"Epoch-Distributions"},{name:"Timestamp",value:e?.timestamp?.toString()??Date.now().toString()},{name:"Epoch-Index",value:e?.epochIndex?.toString()}];return this.process.read({tags:wn(r)})}async getTokenCost({intent:e,type:r,years:a,name:i,quantity:h,fromAddress:l}){let p=[{name:"Action",value:"Token-Cost"},{name:"Intent",value:e},{name:"Name",value:i},{name:"Years",value:a?.toString()},{name:"Quantity",value:h?.toString()},{name:"Purchase-Type",value:r}];return this.process.read({tags:wn(p),fromAddress:l})}async getCostDetails({intent:e,type:r,years:a,name:i,quantity:h,fromAddress:l,fundFrom:p}){let b=[{name:"Action",value:"Get-Cost-Details-For-Action"},{name:"Intent",value:e},{name:"Name",value:i},{name:"Years",value:a?.toString()},{name:"Quantity",value:h?.toString()},{name:"Purchase-Type",value:r},{name:"Fund-From",value:p}];return this.process.read({tags:wn(b),fromAddress:l})}async getRegistrationFees(){return this.process.read({tags:[{name:"Action",value:"Get-Registration-Fees"}]})}async getDemandFactor(){return this.process.read({tags:[{name:"Action",value:"Demand-Factor"}]})}async getDemandFactorSettings(){return this.process.read({tags:[{name:"Action",value:"Demand-Factor-Settings"}]})}async getArNSReturnedNames(e){return this.process.read({tags:[{name:"Action",value:"Returned-Names"},...Oo(e)]})}async getArNSReturnedName({name:e}){let r=[{name:"Action",value:"Returned-Name"},{name:"Name",value:e}];return this.process.read({tags:r})}async getDelegations(e){let r=[{name:"Action",value:"Paginated-Delegations"},{name:"Address",value:e.address},...Oo(e)];return this.process.read({tags:wn(r)})}async getAllowedDelegates(e){return this.getGatewayDelegateAllowList(e)}async getGatewayVaults(e){return this.process.read({tags:[{name:"Action",value:"Paginated-Gateway-Vaults"},{name:"Address",value:e.address},...Oo(e)]})}async getPrimaryNameRequest(e){let r=[{name:"Action",value:"Primary-Name-Request"},{name:"Initiator",value:e.initiator}];return this.process.read({tags:r})}async getPrimaryNameRequests(e){return this.process.read({tags:[{name:"Action",value:"Primary-Name-Requests"},...Oo(e)]})}async getPrimaryName(e){let r=[{name:"Action",value:"Primary-Name"},{name:"Address",value:e?.address},{name:"Name",value:e?.name}];return this.process.read({tags:wn(r)})}async getPrimaryNames(e){return this.process.read({tags:[{name:"Action",value:"Primary-Names"},...Oo(e)]})}async getRedelegationFee(e){return this.process.read({tags:[{name:"Action",value:"Redelegation-Fee"},{name:"Address",value:e.address}]})}async getGatewayRegistrySettings(){return this.process.read({tags:[{name:"Action",value:"Gateway-Registry-Settings"}]})}},pP=class extends Zw{signer;constructor({signer:e,...r}){if(Object.keys(r).length===0)super({process:new Pa({processId:A1})}),this.signer=Bc(e);else if(Dh(r))super({process:r.process}),this.signer=Bc(e);else if($h(r))super({process:new Pa({processId:r.processId})}),this.signer=Bc(e);else throw new Nu}async transfer({target:e,qty:r},a){let{tags:i=[]}=a||{};return this.process.send({tags:[...i,{name:"Action",value:"Transfer"},{name:"Recipient",value:e},{name:"Quantity",value:r.valueOf().toString()}],signer:this.signer})}async joinNetwork({operatorStake:e,allowDelegatedStaking:r,allowedDelegates:a,delegateRewardShareRatio:i,fqdn:h,label:l,minDelegatedStake:p,note:b,port:g,properties:y,protocol:M,autoStake:x,observerAddress:E},A){let{tags:k=[]}=A||{},P=[...k,{name:"Action",value:"Join-Network"},{name:"Operator-Stake",value:e.valueOf().toString()},{name:"Allow-Delegated-Staking",value:r?.toString()},{name:"Allowed-Delegates",value:a?.join(",")},{name:"Delegate-Reward-Share-Ratio",value:i?.toString()},{name:"FQDN",value:h},{name:"Label",value:l},{name:"Min-Delegated-Stake",value:p?.valueOf().toString()},{name:"Note",value:b},{name:"Port",value:g?.toString()},{name:"Properties",value:y},{name:"Protocol",value:M},{name:"Auto-Stake",value:x?.toString()},{name:"Observer-Address",value:E}];return this.process.send({signer:this.signer,tags:wn(P)})}async leaveNetwork(e){let{tags:r=[]}=e||{};return this.process.send({signer:this.signer,tags:[...r,{name:"Action",value:"Leave-Network"}]})}async updateGatewaySettings({allowDelegatedStaking:e,allowedDelegates:r,delegateRewardShareRatio:a,fqdn:i,label:h,minDelegatedStake:l,note:p,port:b,properties:g,protocol:y,autoStake:M,observerAddress:x},E){let{tags:A=[]}=E||{},k=[...A,{name:"Action",value:"Update-Gateway-Settings"},{name:"Label",value:h},{name:"Note",value:p},{name:"FQDN",value:i},{name:"Port",value:b?.toString()},{name:"Properties",value:g},{name:"Protocol",value:y},{name:"Observer-Address",value:x},{name:"Allow-Delegated-Staking",value:e?.toString()},{name:"Allowed-Delegates",value:r?.join(",")},{name:"Delegate-Reward-Share-Ratio",value:a?.toString()},{name:"Min-Delegated-Stake",value:l?.valueOf().toString()},{name:"Auto-Stake",value:M?.toString()}];return this.process.send({signer:this.signer,tags:wn(k)})}async delegateStake(e,r){let{tags:a=[]}=r||{};return this.process.send({signer:this.signer,tags:[...a,{name:"Action",value:"Delegate-Stake"},{name:"Target",value:e.target},{name:"Quantity",value:e.stakeQty.valueOf().toString()}]})}async decreaseDelegateStake(e,r){let{tags:a=[]}=r||{};return this.process.send({signer:this.signer,tags:[...a,{name:"Action",value:"Decrease-Delegate-Stake"},{name:"Target",value:e.target},{name:"Quantity",value:e.decreaseQty.valueOf().toString()},{name:"Instant",value:`${e.instant||!1}`}]})}async instantWithdrawal(e,r){let{tags:a=[]}=r||{},i=[...a,{name:"Action",value:"Instant-Withdrawal"},{name:"Vault-Id",value:e.vaultId},{name:"Address",value:e.gatewayAddress}];return this.process.send({signer:this.signer,tags:wn(i)})}async increaseOperatorStake(e,r){let{tags:a=[]}=r||{};return this.process.send({signer:this.signer,tags:[...a,{name:"Action",value:"Increase-Operator-Stake"},{name:"Quantity",value:e.increaseQty.valueOf().toString()}]})}async decreaseOperatorStake(e,r){let{tags:a=[]}=r||{};return this.process.send({signer:this.signer,tags:[...a,{name:"Action",value:"Decrease-Operator-Stake"},{name:"Quantity",value:e.decreaseQty.valueOf().toString()},{name:"Instant",value:`${e.instant||!1}`}]})}async saveObservations(e,r){let{tags:a=[]}=r||{};return this.process.send({signer:this.signer,tags:[...a,{name:"Action",value:"Save-Observations"},{name:"Report-Tx-Id",value:e.reportTxId},{name:"Failed-Gateways",value:e.failedGateways.join(",")}]})}async buyRecord(e,r){let{tags:a=[]}=r||{},i=[...a,{name:"Action",value:"Buy-Record"},{name:"Name",value:e.name},{name:"Years",value:e.years?.toString()??"1"},{name:"Process-Id",value:e.processId},{name:"Purchase-Type",value:e.type||"lease"},{name:"Fund-From",value:e.fundFrom}];return this.process.send({signer:this.signer,tags:wn(i)})}async upgradeRecord(e,r){let{tags:a=[]}=r||{},i=[...a,{name:"Action",value:"Upgrade-Name"},{name:"Name",value:e.name},{name:"Fund-From",value:e.fundFrom}];return this.process.send({signer:this.signer,tags:wn(i)})}async extendLease(e,r){let{tags:a=[]}=r||{},i=[...a,{name:"Action",value:"Extend-Lease"},{name:"Name",value:e.name},{name:"Years",value:e.years.toString()},{name:"Fund-From",value:e.fundFrom}];return this.process.send({signer:this.signer,tags:wn(i)})}async increaseUndernameLimit(e,r){let{tags:a=[]}=r||{},i=[...a,{name:"Action",value:"Increase-Undername-Limit"},{name:"Name",value:e.name},{name:"Quantity",value:e.increaseCount.toString()},{name:"Fund-From",value:e.fundFrom}];return this.process.send({signer:this.signer,tags:wn(i)})}async cancelWithdrawal(e,r){let{tags:a=[]}=r||{},i=[...a,{name:"Action",value:"Cancel-Withdrawal"},{name:"Vault-Id",value:e.vaultId},{name:"Address",value:e.gatewayAddress}];return this.process.send({signer:this.signer,tags:wn(i)})}async requestPrimaryName(e,r){let{tags:a=[]}=r||{},i=[...a,{name:"Action",value:"Request-Primary-Name"},{name:"Name",value:e.name}];return this.process.send({signer:this.signer,tags:wn(i)})}async redelegateStake(e,r){let{tags:a=[]}=r||{},i=[...a,{name:"Action",value:"Redelegate-Stake"},{name:"Target",value:e.target},{name:"Source",value:e.source},{name:"Quantity",value:e.stakeQty.valueOf().toString()},{name:"Vault-Id",value:e.vaultId}];return this.process.send({signer:this.signer,tags:wn(i)})}};ie();ae();ne();ie();ae();ne();ie();ae();ne();var mP=gi(Yfe(),1);ie();ae();ne();var nUe=Object.defineProperty,aUe=(t,e,r)=>e in t?nUe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Rb=(t,e,r)=>(aUe(t,typeof e!="symbol"?e+"":e,r),r),gP=class{constructor(e){Rb(this,"value"),Rb(this,"next"),this.value=e}},bP=class{constructor(){Rb(this,"head"),Rb(this,"tail"),Rb(this,"_size",0),this.clear()}clear(){this.head=void 0,this.tail=void 0,this._size=0}push(e){let r=new gP(e);return this.head&&this.tail?(this.tail.next=r,this.tail=r):(this.head=r,this.tail=r),this._size++,this._size}pop(){if(!this.head)return;let e=this.head;return this.head=this.head.next,this._size--,e.value}get size(){return this._size}*[Symbol.iterator](){let e=this.head;for(;e;)yield e.value,e=e.next}};function Jfe(t){if(!((Number.isInteger(t)||t===1/0)&&t>0))throw new TypeError("Expected `concurrency` to be a number greater than 1");let e=new bP,r=0,a=()=>{r--,e.size>0&&e.pop()()},i=async(p,b,g)=>{r++;let y=(async()=>p(...g))();b(y);try{await y}catch{}a()},h=(p,b,g)=>{e.push(i.bind(null,p,b,g)),(async()=>(await Promise.resolve(),r<t&&e.size>0&&e.pop()()))()},l=(p,...b)=>new Promise(g=>{h(p,g,b)});return Object.defineProperties(l,{activeCount:{get:()=>r},pendingCount:{get:()=>e.size},clearQueue:{value:()=>{e.clear()}}}),l}var l3t=async({address:t,registry:e=Hd.init()})=>{let r=await e.accessControlList({address:t});return[...new Set([...r.Owned,...r.Controlled])]};function Xfe(t,e){return new Promise((r,a)=>{let i=setTimeout(()=>{a(new Error("Timeout"))},t);e.then(h=>{clearTimeout(i),r(h)}).catch(h=>{clearTimeout(i),a(h)})})}var Qfe=class extends mP.default{contract;timeoutMs;throttle;logger;strict;constructor({contract:e=Eb.init({processId:A1}),timeoutMs:r=6e4,concurrency:a=30,logger:i=Fu.default,strict:h=!1}={}){super(),this.contract=e,this.timeoutMs=r,this.throttle=Jfe(a),this.logger=i,this.strict=h}async fetchProcessesOwnedByWallet({address:e,pageSize:r,antRegistry:a=Hd.init()}){let i={},h=await a.accessControlList({address:e}),l=new Set([...h.Owned,...h.Controlled]);await Xfe(this.timeoutMs,oUe({contract:this.contract,emitter:this,pageSize:r})).catch(b=>(this.emit("error",`Error getting ArNS records: ${b}`),this.logger.error("Error getting ArNS records",{message:b?.message,stack:b?.stack}),{})).then(b=>{Object.entries(b).forEach(([g,y])=>{l.has(y.processId)&&(i[y.processId]==null&&(i[y.processId]={state:void 0,names:{}}),i[y.processId].names[g]=y)})});let p=Object.keys(i).length;this.emit("progress",0,p),await Promise.all(Object.keys(i).map(async(b,g)=>this.throttle(async()=>{if(i[b].state!==void 0){this.emit("progress",g+1,p);return}let y=Fw.init({processId:b,strict:this.strict}),M=await Xfe(this.timeoutMs,y.getState()).catch(x=>{this.emit("error",`Error getting state for process ${b}: ${x}`)});(M?.Owner===e||M?.Controllers.includes(e))&&(i[b].state=M,this.emit("process",b,i[b])),this.emit("progress",g+1,p)}))),this.emit("end",i)}},oUe=async({contract:t=Eb.init({processId:A1}),emitter:e,logger:r=Fu.default,pageSize:a=5e4})=>{let i,h=Date.now(),l={};do{let p=await t.getArNSRecords({cursor:i,limit:a}).catch(b=>{r?.error("Error getting ArNS records",{message:b?.message,stack:b?.stack}),e?.emit("arns:error",`Error getting ArNS records: ${b}`)});if(!p)return{};p.items.forEach(b=>{let{name:g,...y}=b;l[g]=y}),r.debug("Fetched page of ArNS records",{totalRecordCount:p.totalItems,fetchedRecordCount:Object.keys(l).length,cursor:p.nextCursor}),e?.emit("arns:pageLoaded",{totalRecordCount:p.totalItems,fetchedRecordCount:Object.keys(l).length,records:p.items,cursor:p.nextCursor}),i=p.nextCursor}while(i!==void 0);return e?.emit("arns:end",l),r.debug("Fetched all ArNS records",{totalRecordCount:Object.keys(l).length,durationMs:Date.now()-h}),l};export{Fw as ANT,Hd as ANTRegistry,gT as ANT_LUA_ID,$8 as ANT_REGISTRY_ID,Pa as AOProcess,aQ as AOS_MODULE_ID,Eb as ARIO,Zw as ARIOReadable,xT as ARIOToken,pP as ARIOWriteable,r5e as ARIO_DEVNET_PROCESS_ID,A1 as ARIO_TESTNET_PROCESS_ID,qft as ARNS_DEVNET_REGISTRY_TX,$ft as ARNS_TESTNET_REGISTRY_TX,D8 as ARWEAVE_TX_REGEX,bQ as AbortError,wT as AntBalancesSchema,yT as AntControllersSchema,i5e as AntDescriptionSchema,o5e as AntHandlerNames,fQ as AntHandlersSchema,hQ as AntInfoSchema,uQ as AntKeywordsSchema,n5e as AntReadHandlers,q8 as AntRecordSchema,bT as AntRecordsSchema,_T as AntStateSchema,a5e as AntWriteHandlers,jw as AoANTReadable,zw as AoANTRegistryReadable,cP as AoANTRegistryWriteable,lP as AoANTWriteable,Qfe as ArNSEventEmitter,v1 as ArconnectSigner,Hl as ArweaveSigner,gd as ArweaveTxIdSchema,dQ as BadRequest,kf as BaseError,oQ as DEFAULT_SCHEDULER_ID,Lft as FQDN_REGEX,pQ as FailedRequestError,sQ as IntegerStringSchema,Nu as InvalidContractConfigurationError,gQ as InvalidProcessConfigurationError,mQ as InvalidSignerError,Fu as Logger,mT as MARIO_PER_ARIO,cQ as NotFound,Dft as SORT_KEY_REGEX,vQ as UnknownError,U8 as WriteInteractionError,Uft as arioDevnetProcessId,Bc as createAoSigner,Xqe as defaultTargetManifestId,Ubt as evolveANT,oUe as fetchAllArNSRecords,Nyt as fromB64Url,f5e as fundFromOptions,l3t as getANTProcessesOwnedByWallet,Wfe as getRandomText,Fbt as initANTStateForAddress,fut as intentsUsingYears,Wft as isAoANTState,Jqe as isAoSigner,rut as isBlockHeight,lut as isLeasedArNSRecord,Dh as isProcessConfiguration,$h as isProcessIdConfiguration,hut as isValidFundFrom,uut as isValidIntent,ST as mARIOToken,Oo as paginationParamsToTags,Pc as parseSchemaResult,wn as pruneTags,dP as safeDecode,Cyt as sha256B64Url,qbt as spawnANT,tUe as toB64Url,s5e as validIntents,lQ as validateArweaveId};
187
+ }`,i=wt.object({data:wt.object({transactions:wt.object({edges:wt.array(wt.object({node:wt.record(wt.any())}))})})});return h=>zr(h).chain(Di(l=>t(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:a,variables:{transactionIds:[l]}})}).then(async p=>{if(p.ok)return p.json();throw r('Error Encountered when querying gateway for transaction "%s"',l),new Error(`${p.status}: ${await p.text()}`)}).then(i.parse).then(eLe(["data","transactions","edges","0","node"])))).toPromise()}var lDe=sB(yBe(),1),Ose=(t="@permaweb/aoconnect")=>{let e=(0,lDe.default)(t);return e.child=r=>Ose(`${e.namespace}:${r}`),e.tap=(r,...a)=>sLe((...i)=>e(r,...a,...i)),e},Nse=({url:t,path:e})=>e?e.startsWith("/")?Nse({url:t,path:e.slice(1)}):(t=new URL(t),t.pathname+=e,t.toString()):t;function cDe(t){return uv(Bw([]),fv((e,r)=>uv(iLe([],r.name),xB(r.value),Us(r.name,Gh,e))(e),{}),kw(e=>e.length>1?e:e[0]))(t)}function Ds(t,e){return r=>ise(cCe([aoe(t,"name"),EB(MB(e),aoe(e,"value"),yB)]),r)}function foe(t){return dse([[I2(String),X1(t)],[I2(Array),HCe(t)],[yB,MNe]])}function zd(t){let e;return I2($s,t)?(e=new Error(dDe(t)),e.stack+=t.stack):I2(Error,t)?e=t:jCe("message",t)?e=new Error(t.message):I2(String,t)?e=new Error(t):e=new Error("An error occurred"),e}function dDe(t){return uv(e=>function r(a,i,h){return fv((l,p)=>uv(dse([[X1(Rt.invalid_arguments),()=>r(p.argumentsError,422,"Invalid Arguments")],[X1(Rt.invalid_return_type),()=>r(p.returnTypeError,500,"Invalid Return")],[X1(Rt.invalid_union),()=>TCe(b=>r(b,400,"Invalid Union"),p.unionErrors)],[yB,()=>[{...p,status:i,contextCode:h}]]]),SB(l))(p.code),[],a.issues)}(e,400,""),e=>fv((r,a)=>{let{message:i,path:h,contextCode:l}=a,p=h[1]||h[0],b=l?`${l} `:"";return r.push(`${b}'${p}': ${i}.`),r},[],e),JCe(" | "))(t)}var pDe=wt.object({id:wt.string().min(1,{message:"message is required to be a message id"}),processId:wt.string().min(1,{message:"process is required to be a process id"})});function vDe(){return t=>zr(t).map(pDe.parse).map(()=>t)}var db=wt.object({name:wt.string(),value:wt.string()}),mDe=wt.function().args(wt.object({Id:wt.string(),Target:wt.string(),Owner:wt.string(),Anchor:wt.string().optional(),Data:wt.any().default("1234"),Tags:wt.array(wt.object({name:wt.string(),value:wt.string()}))})).returns(wt.promise(wt.any())),gDe=wt.function().args(wt.object({id:wt.string().min(1,{message:"message id is required"}),processId:wt.string().min(1,{message:"process id is required"})})).returns(wt.promise(wt.any())),bDe=wt.function().args(wt.object({process:wt.string().min(1,{message:"process id is required"}),from:wt.string().optional(),to:wt.string().optional(),sort:wt.enum(["ASC","DESC"]).default("ASC"),limit:wt.number().optional()})).returns(wt.promise(wt.object({edges:wt.array(wt.object({cursor:wt.string(),node:wt.object({Output:wt.any().optional(),Messages:wt.array(wt.any()).optional(),Spawns:wt.array(wt.any()).optional(),Error:wt.any().optional()})}))}))),Cse=wt.function().args(wt.object({processId:wt.string(),data:wt.any(),tags:wt.array(db),anchor:wt.string().optional(),signer:wt.any()})).returns(wt.promise(wt.object({messageId:wt.string()}).passthrough())),yDe=wt.function().args(wt.object({data:wt.any(),tags:wt.array(db),signer:wt.any()})).returns(wt.promise(wt.object({processId:wt.string()}).passthrough())),wDe=wt.function().args(wt.object({process:wt.string(),message:wt.string(),baseLayer:wt.boolean().optional(),exclude:wt.array(wt.string()).optional()})).returns(wt.promise(wt.object({assignmentId:wt.string()}).passthrough())),Lse=Cse,qmt=wt.function().args(wt.object({suUrl:wt.string().url(),processId:wt.string()})).returns(wt.promise(wt.object({tags:wt.array(db)}).passthrough())),Umt=wt.function().args(wt.string()).returns(wt.promise(wt.object({url:wt.string()}))),_De=wt.function().args(wt.string()).returns(wt.promise(wt.boolean())),MDe=wt.function().args(wt.string()).returns(wt.promise(wt.object({tags:wt.array(db)}).passthrough())),Pw=wt.function().args(wt.object({data:wt.any(),tags:wt.array(db),target:wt.string().optional(),anchor:wt.string().optional()})).returns(wt.promise(wt.object({id:wt.string(),raw:wt.any()})));function xDe({loadResult:t}){return t=Di(gDe.implement(t)),e=>zr({id:e.id,processId:e.processId}).chain(t)}function SDe(t){let e=vDe(t),r=xDe(t);return({message:a,process:i})=>zr({id:a,processId:i}).chain(e).chain(r).map(t.logger.tap('readResult result for message "%s": %O',a)).map(h=>h).bimap(zd,jd).toPromise()}var EDe=wt.array(wt.object({name:wt.string(),value:wt.string()}));function ADe(){return t=>zr(t.tags).map(Bw([])).map(Ds("Data-Protocol","ao")).map(Ds("Variant")).map(Ds("Type")).map(Ds("SDK")).map(SB(Gh,[{name:"Data-Protocol",value:"ao"},{name:"Variant",value:"ao.TN.1"},{name:"Type",value:"Message"},{name:"SDK",value:"aoconnect"}])).map(EDe.parse).map(Us("tags",Gh,t))}function RDe({logger:t}){return e=>zr(e).chain(EB(MB(e.data),()=>$d(e),()=>$d(Math.random().toString().slice(-4)).map(Us("data",Gh,e)).map(r=>uv(Fd("tags"),Ds("Content-Type"),xB({name:"Content-Type",value:"text/plain"}),Us("tags",Gh,r))(r)).map(t.tap('added pseudo-random string as message "data"'))))}function TDe(t){let e=ADe(t),r=RDe(t),a=Cse.implement(t.deployMessage);return i=>zr(i).chain(e).chain(r).chain(Di(({id:h,data:l,tags:p,anchor:b,signer:g})=>a({processId:h,data:l,tags:p,anchor:b,signer:Pw.implement(g)}))).map(h=>Us("messageId",h.messageId,i))}function kDe(t){let e=TDe(t);return({process:r,data:a,tags:i,anchor:h,signer:l})=>zr({id:r,data:a,tags:i,anchor:h,signer:l}).chain(e).map(p=>p.messageId).bimap(zd,jd).toPromise()}var w2=(t,e,r)=>a=>e(a[t])?$d(a):Tc(`Tag '${t}': ${r}`);function IDe({loadTransactionMeta:t,logger:e}){return t=Di(MDe.implement(t)),r=>zr(r).chain(t).map(Fd("tags")).map(cDe).chain(w2("Data-Protocol",foe("ao"),"value 'ao' was not found on module")).chain(w2("Type",foe("Module"),"value 'Module' was not found on module")).chain(w2("Module-Format",PI,"was not found on module")).chain(w2("Input-Encoding",PI,"was not found on module")).chain(w2("Output-Encoding",PI,"was not found on module")).bimap(e.tap("Verifying module source failed: %s"),e.tap("Verified module source"))}function BDe({logger:t,validateScheduler:e}){return e=Di(_De.implement(e)),r=>zr(r).chain(a=>e(a).chain(i=>i?$d(a):Tc(`Valid Scheduler-Location owned by ${a} not found`))).bimap(t.tap("Verifying scheduler failed: %s"),t.tap("Verified scheduler"))}function PDe({logger:t}){return e=>zr(e).map(t.tap("Checking for signer")).chain(r=>r?$d(r):Tc("signer not found"))}function ODe(t){let e=t.logger.child("verifyInput");t={...t,logger:e};let r=IDe(t),a=BDe(t),i=PDe(t);return h=>zr(h).chain(l=>r(l.module).map(()=>l)).chain(l=>a(l.scheduler)).map(()=>h).chain(l=>i(l.signer).map(()=>l)).bimap(e.tap("Error when verify input: %s"),e.tap("Successfully verified inputs"))}var NDe=wt.array(wt.object({name:wt.string(),value:wt.string()}));function CDe(){return t=>zr(t).map(Fd("tags")).map(Bw([])).map(Ds("Data-Protocol","ao")).map(Ds("Variant")).map(Ds("Type")).map(Ds("Module")).map(Ds("Scheduler")).map(Ds("SDK")).map(SB(Gh,[{name:"Data-Protocol",value:"ao"},{name:"Variant",value:"ao.TN.1"},{name:"Type",value:"Process"},{name:"Module",value:t.module},{name:"Scheduler",value:t.scheduler},{name:"SDK",value:"aoconnect"}])).map(NDe.parse).map(Us("tags",Gh,t))}function LDe({logger:t}){return e=>zr(e).chain(EB(MB(e.data),()=>$d(e),()=>$d(Math.random().toString().slice(-4)).map(Us("data",Gh,e)).map(r=>uv(Fd("tags"),Ds("Content-Type"),xB({name:"Content-Type",value:"text/plain"}),Us("tags",Gh,r))(r)).map(t.tap('added pseudo-random string as process "data"'))))}function DDe(t){let e=t.logger.child("uploadProcess");t={...t,logger:e};let r=CDe(t),a=LDe(t),i=yDe.implement(t.deployProcess);return h=>zr(h).chain(r).chain(a).chain(Di(({data:l,tags:p,signer:b})=>i({data:l,tags:p,signer:Pw.implement(b)}))).map(l=>Us("processId",l.processId,h))}function $De(t){let e=ODe(t),r=DDe(t);return({module:a,scheduler:i,signer:h,tags:l,data:p})=>zr({module:a,scheduler:i,signer:h,tags:l,data:p}).chain(e).chain(r).map(b=>b.processId).bimap(zd,jd).toPromise()}function qDe(t){let e=Lse.implement(t.deployMonitor);return r=>zr(r).chain(Di(({id:a,signer:i})=>e({processId:a,signer:Pw.implement(i),data:Math.random().toString().slice(-4),tags:[]}))).map(a=>Us("monitorId",a.messageId,r))}function UDe(t){let e=qDe(t);return({process:r,signer:a})=>zr({id:r,signer:a}).chain(e).map(i=>i.monitorId).bimap(zd,jd).toPromise()}function FDe(t){let e=Lse.implement(t.deployUnmonitor);return r=>zr(r).chain(Di(({id:a,signer:i})=>e({processId:a,signer:Pw.implement(i),data:Math.random().toString().slice(-4),tags:[]}))).map(a=>Us("monitorId",a.messageId,r))}function jDe(t){let e=FDe(t);return({process:r,signer:a})=>zr({id:r,signer:a}).chain(e).map(i=>i.monitorId).bimap(zd,jd).toPromise()}var zDe=wt.object({process:wt.string().min(1,{message:"process identifier is required"}),from:wt.string().optional(),to:wt.string().optional(),sort:wt.enum(["ASC","DESC"]).default("ASC"),limit:wt.number().optional()});function ZDe(){return t=>zr(t).map(zDe.parse).map(()=>t)}function HDe({queryResults:t}){return t=Di(bDe.implement(t)),e=>zr({process:e.process,from:e.from,to:e.to,sort:e.sort,limit:e.limit}).chain(t)}function KDe(t){let e=ZDe(t),r=HDe(t);return({process:a,from:i,to:h,sort:l,limit:p})=>zr({process:a,from:i,to:h,sort:l,limit:p}).chain(e).chain(r).map(t.logger.tap('readResults result for message "%s": %O',a)).map(b=>b).bimap(zd,jd).toPromise()}var WDe=wt.object({Id:wt.string(),Target:wt.string(),Owner:wt.string(),Anchor:wt.string().optional(),Data:wt.any().default("1234"),Tags:wt.array(wt.object({name:wt.string(),value:wt.string()}))});function VDe(){return t=>zr(t).map(WDe.parse).map(e=>(e.Tags=e.Tags.concat([{name:"Data-Protocol",value:"ao"},{name:"Type",value:"Message"},{name:"Variant",value:"ao.TN.1"}]),e))}function GDe({dryrunFetch:t}){return Di(mDe.implement(t))}function YDe(t){let e=VDe(t),r=GDe(t);return a=>zr(a).map(JDe).chain(e).chain(r).toPromise()}function JDe({process:t,data:e,tags:r,anchor:a,...i}){return{Id:"1234",Owner:"1234",...i,Target:t,Data:e||"1234",Tags:r||[],Anchor:a||"0"}}function XDe(t){let e=wDe.implement(t.deployAssign);return r=>zr(r).chain(Di(({process:a,message:i,baseLayer:h,exclude:l})=>e({process:a,message:i,baseLayer:h,exclude:l}))).map(a=>Us("assignmentId",a.assignmentId,r))}function QDe(t){let e=XDe(t);return({process:r,message:a,baseLayer:i,exclude:h})=>zr({process:r,message:a,baseLayer:i,exclude:h}).chain(e).map(l=>l.assignmentId).bimap(zd,jd).toPromise()}var e$e="https://arweave.net",t$e="https://mu.ao-testnet.xyz",r$e="https://cu.ao-testnet.xyz";function vv({GRAPHQL_URL:t,GATEWAY_URL:e=e$e,MU_URL:r=t$e,CU_URL:a=r$e}={}){let i=Ose();t||(t=Nse({url:e,path:"/graphql"}));let{validate:h}=Qoe({cacheSize:100,GRAPHQL_URL:t}),l=wNe({MAX_SIZE:25}),p=i.child("result"),b=SDe({loadResult:gNe({fetch,CU_URL:a,logger:p}),logger:p}),g=i.child("message"),y=kDe({loadProcessMeta:kI({fetch,cache:l,logger:g}),deployMessage:lNe({fetch,MU_URL:r,logger:g}),logger:g}),M=i.child("spawn"),x=$De({loadTransactionMeta:hDe({fetch,GRAPHQL_URL:t,logger:M}),validateScheduler:h,deployProcess:cNe({fetch,MU_URL:r,logger:M}),logger:M}),E=i.child("monitor"),A=UDe({loadProcessMeta:kI({fetch,cache:l,logger:E}),deployMonitor:dNe({fetch,MU_URL:r,logger:E}),logger:E}),k=i.child("unmonitor"),P=jDe({loadProcessMeta:kI({fetch,cache:l,logger:k}),deployUnmonitor:pNe({fetch,MU_URL:r,logger:k}),logger:E}),N=i.child("results"),L=KDe({queryResults:bNe({fetch,CU_URL:a,logger:N}),logger:N}),C=i.child("dryrun"),Y=YDe({dryrunFetch:mNe({fetch,CU_URL:a,logger:C}),logger:C}),G=i.child("assign"),ee=QDe({deployAssign:vNe({fetch,MU_URL:r,logger:G}),logger:g});return{result:b,results:L,message:y,spawn:x,monitor:A,unmonitor:P,dryrun:Y,assign:ee}}var Dse={};loe(Dse,{createDataItemSigner:()=>R$e});var $se=sB(MBe(),1),qse={};loe(qse,{AVSCTap:()=>pb,ArweaveSigner:()=>IB,DataItem:()=>ub,MAX_TAG_BYTES:()=>Ow,MIN_BINARY_SIZE:()=>OB,SIG_CONFIG:()=>pv,SignatureConfig:()=>Ls,Signer:()=>zse,createData:()=>Wse,default:()=>S$e,deserializeTags:()=>xw,indexToType:()=>BB,serializeTags:()=>PB,tagsExceedLimit:()=>Kse,warparbundles:()=>E$e});var i$e=Object.create,TB=Object.defineProperty,n$e=Object.getOwnPropertyDescriptor,a$e=Object.getOwnPropertyNames,o$e=Object.getPrototypeOf,s$e=Object.prototype.hasOwnProperty,Jh=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),f$e=(t,e)=>{for(var r in e)TB(t,r,{get:e[r],enumerable:!0})},u$e=(t,e,r,a)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of a$e(e))!s$e.call(t,i)&&i!==r&&TB(t,i,{get:()=>e[i],enumerable:!(a=n$e(e,i))||a.enumerable});return t},Zd=(t,e,r)=>(r=t!=null?i$e(o$e(t)):{},u$e(e||!t||!t.__esModule?TB(r,"default",{value:t,enumerable:!0}):r,t)),h$e=Jh(t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});function e(r){var a=4,i=r.length,h=i%a;if(!h)return r;var l=i,p=a-h,b=i+p,g=Me.alloc(b);for(g.write(r);p--;)g.write("=",l++);return g.toString()}t.default=e}),l$e=Jh(t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var e=h$e();function r(b,g){return g===void 0&&(g="utf8"),Me.isBuffer(b)?h(b.toString("base64")):h(Me.from(b,g).toString("base64"))}function a(b,g){return g===void 0&&(g="utf8"),Me.from(i(b),"base64").toString(g)}function i(b){return b=b.toString(),e.default(b).replace(/\-/g,"+").replace(/_/g,"/")}function h(b){return b.replace(/=/g,"").replace(/\+/g,"-").replace(/\//g,"_")}function l(b){return Me.from(i(b),"base64")}var p=r;p.encode=r,p.decode=a,p.toBase64=i,p.fromBase64=h,p.toBuffer=l,t.default=p}),kB=Jh((t,e)=>{e.exports=l$e().default,e.exports.default=e.exports}),Use=Jh(t=>{"use strict";t.byteLength=b,t.toByteArray=y,t.fromByteArray=E;var e=[],r=[],a=typeof Uint8Array<"u"?Uint8Array:Array,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(h=0,l=i.length;h<l;++h)e[h]=i[h],r[i.charCodeAt(h)]=h;var h,l;r[45]=62,r[95]=63;function p(A){var k=A.length;if(k%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var P=A.indexOf("=");P===-1&&(P=k);var N=P===k?0:4-P%4;return[P,N]}function b(A){var k=p(A),P=k[0],N=k[1];return(P+N)*3/4-N}function g(A,k,P){return(k+P)*3/4-P}function y(A){var k,P=p(A),N=P[0],L=P[1],C=new a(g(A,N,L)),Y=0,G=L>0?N-4:N,ee;for(ee=0;ee<G;ee+=4)k=r[A.charCodeAt(ee)]<<18|r[A.charCodeAt(ee+1)]<<12|r[A.charCodeAt(ee+2)]<<6|r[A.charCodeAt(ee+3)],C[Y++]=k>>16&255,C[Y++]=k>>8&255,C[Y++]=k&255;return L===2&&(k=r[A.charCodeAt(ee)]<<2|r[A.charCodeAt(ee+1)]>>4,C[Y++]=k&255),L===1&&(k=r[A.charCodeAt(ee)]<<10|r[A.charCodeAt(ee+1)]<<4|r[A.charCodeAt(ee+2)]>>2,C[Y++]=k>>8&255,C[Y++]=k&255),C}function M(A){return e[A>>18&63]+e[A>>12&63]+e[A>>6&63]+e[A&63]}function x(A,k,P){for(var N,L=[],C=k;C<P;C+=3)N=(A[C]<<16&16711680)+(A[C+1]<<8&65280)+(A[C+2]&255),L.push(M(N));return L.join("")}function E(A){for(var k,P=A.length,N=P%3,L=[],C=16383,Y=0,G=P-N;Y<G;Y+=C)L.push(x(A,Y,Y+C>G?G:Y+C));return N===1?(k=A[P-1],L.push(e[k>>2]+e[k<<4&63]+"==")):N===2&&(k=(A[P-2]<<8)+A[P-1],L.push(e[k>>10]+e[k>>4&63]+e[k<<2&63]+"=")),L.join("")}}),Fse=Jh(t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.b64UrlDecode=t.b64UrlEncode=t.bufferTob64Url=t.bufferTob64=t.b64UrlToBuffer=t.stringToB64Url=t.stringToBuffer=t.bufferToString=t.b64UrlToString=t.concatBuffers=void 0;var e=Use();function r(x){let E=0;for(let P=0;P<x.length;P++)E+=x[P].byteLength;let A=new Uint8Array(E),k=0;A.set(new Uint8Array(x[0]),k),k+=x[0].byteLength;for(let P=1;P<x.length;P++)A.set(new Uint8Array(x[P]),k),k+=x[P].byteLength;return A}t.concatBuffers=r;function a(x){let E=p(x);return i(E)}t.b64UrlToString=a;function i(x){return new TextDecoder("utf-8",{fatal:!0}).decode(x)}t.bufferToString=i;function h(x){return new TextEncoder().encode(x)}t.stringToBuffer=h;function l(x){return g(h(x))}t.stringToB64Url=l;function p(x){return new Uint8Array(e.toByteArray(M(x)))}t.b64UrlToBuffer=p;function b(x){return e.fromByteArray(new Uint8Array(x))}t.bufferTob64=b;function g(x){return y(b(x))}t.bufferTob64Url=g;function y(x){return x.replace(/\+/g,"-").replace(/\//g,"_").replace(/\=/g,"")}t.b64UrlEncode=y;function M(x){x=x.replace(/\-/g,"+").replace(/\_/g,"/");let E;return x.length%4==0?E=0:E=4-x.length%4,x.concat("=".repeat(E))}t.b64UrlDecode=M}),c$e=Jh(t=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var e=Fse(),r=class{keyLength=4096;publicExponent=65537;hashAlgorithm="sha256";driver;constructor(){if(!this.detectWebCrypto())throw new Error("SubtleCrypto not available!");this.driver=crypto.subtle}async generateJWK(){let a=await this.driver.generateKey({name:"RSA-PSS",modulusLength:4096,publicExponent:new Uint8Array([1,0,1]),hash:{name:"SHA-256"}},!0,["sign"]),i=await this.driver.exportKey("jwk",a.privateKey);return{kty:i.kty,e:i.e,n:i.n,d:i.d,p:i.p,q:i.q,dp:i.dp,dq:i.dq,qi:i.qi}}async sign(a,i,{saltLength:h}={}){let l=await this.driver.sign({name:"RSA-PSS",saltLength:32},await this.jwkToCryptoKey(a),i);return new Uint8Array(l)}async hash(a,i="SHA-256"){let h=await this.driver.digest(i,a);return new Uint8Array(h)}async verify(a,i,h){let l={kty:"RSA",e:"AQAB",n:a},p=await this.jwkToPublicCryptoKey(l),b=await this.driver.digest("SHA-256",i),g=await this.driver.verify({name:"RSA-PSS",saltLength:0},p,h,i),y=await this.driver.verify({name:"RSA-PSS",saltLength:32},p,h,i),M=await this.driver.verify({name:"RSA-PSS",saltLength:Math.ceil((p.algorithm.modulusLength-1)/8)-b.byteLength-2},p,h,i);return g||y||M}async jwkToCryptoKey(a){return this.driver.importKey("jwk",a,{name:"RSA-PSS",hash:{name:"SHA-256"}},!1,["sign"])}async jwkToPublicCryptoKey(a){return this.driver.importKey("jwk",a,{name:"RSA-PSS",hash:{name:"SHA-256"}},!1,["verify"])}detectWebCrypto(){if(typeof crypto>"u")return!1;let a=crypto?.subtle;return a===void 0?!1:["generateKey","importKey","exportKey","digest","sign"].every(i=>typeof a[i]=="function")}async encrypt(a,i,h){let l=await this.driver.importKey("raw",typeof i=="string"?e.stringToBuffer(i):i,{name:"PBKDF2",length:32},!1,["deriveKey"]),p=await this.driver.deriveKey({name:"PBKDF2",salt:h?e.stringToBuffer(h):e.stringToBuffer("salt"),iterations:1e5,hash:"SHA-256"},l,{name:"AES-CBC",length:256},!1,["encrypt","decrypt"]),b=new Uint8Array(16);crypto.getRandomValues(b);let g=await this.driver.encrypt({name:"AES-CBC",iv:b},p,a);return e.concatBuffers([b,g])}async decrypt(a,i,h){let l=await this.driver.importKey("raw",typeof i=="string"?e.stringToBuffer(i):i,{name:"PBKDF2",length:32},!1,["deriveKey"]),p=await this.driver.deriveKey({name:"PBKDF2",salt:h?e.stringToBuffer(h):e.stringToBuffer("salt"),iterations:1e5,hash:"SHA-256"},l,{name:"AES-CBC",length:256},!1,["encrypt","decrypt"]),b=a.slice(0,16),g=await this.driver.decrypt({name:"AES-CBC",iv:b},p,a.slice(16));return e.concatBuffers([g])}};t.default=r}),d$e=Jh(t=>{t.read=function(e,r,a,i,h){var l,p,b=h*8-i-1,g=(1<<b)-1,y=g>>1,M=-7,x=a?h-1:0,E=a?-1:1,A=e[r+x];for(x+=E,l=A&(1<<-M)-1,A>>=-M,M+=b;M>0;l=l*256+e[r+x],x+=E,M-=8);for(p=l&(1<<-M)-1,l>>=-M,M+=i;M>0;p=p*256+e[r+x],x+=E,M-=8);if(l===0)l=1-y;else{if(l===g)return p?NaN:(A?-1:1)*(1/0);p=p+Math.pow(2,i),l=l-y}return(A?-1:1)*p*Math.pow(2,l-i)},t.write=function(e,r,a,i,h,l){var p,b,g,y=l*8-h-1,M=(1<<y)-1,x=M>>1,E=h===23?Math.pow(2,-24)-Math.pow(2,-77):0,A=i?0:l-1,k=i?1:-1,P=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(b=isNaN(r)?1:0,p=M):(p=Math.floor(Math.log(r)/Math.LN2),r*(g=Math.pow(2,-p))<1&&(p--,g*=2),p+x>=1?r+=E/g:r+=E*Math.pow(2,1-x),r*g>=2&&(p++,g/=2),p+x>=M?(b=0,p=M):p+x>=1?(b=(r*g-1)*Math.pow(2,h),p=p+x):(b=r*Math.pow(2,x-1)*Math.pow(2,h),p=0));h>=8;e[a+A]=b&255,A+=k,b/=256,h-=8);for(p=p<<h|b,y+=h;y>0;e[a+A]=p&255,A+=k,p/=256,y-=8);e[a+A-k]|=P*128}}),nB=Jh(t=>{"use strict";var e=Use(),r=d$e(),a=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=p,t.SlowBuffer=L,t.INSPECT_MAX_BYTES=50;var i=2147483647;t.kMaxLength=i,p.TYPED_ARRAY_SUPPORT=h(),!p.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 h(){try{let T=new Uint8Array(1),I={foo:function(){return 42}};return Object.setPrototypeOf(I,Uint8Array.prototype),Object.setPrototypeOf(T,I),T.foo()===42}catch{return!1}}Object.defineProperty(p.prototype,"parent",{enumerable:!0,get:function(){if(p.isBuffer(this))return this.buffer}}),Object.defineProperty(p.prototype,"offset",{enumerable:!0,get:function(){if(p.isBuffer(this))return this.byteOffset}});function l(T){if(T>i)throw new RangeError('The value "'+T+'" is invalid for option "size"');let I=new Uint8Array(T);return Object.setPrototypeOf(I,p.prototype),I}function p(T,I,O){if(typeof T=="number"){if(typeof I=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return M(T)}return b(T,I,O)}p.poolSize=8192;function b(T,I,O){if(typeof T=="string")return x(T,I);if(ArrayBuffer.isView(T))return A(T);if(T==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof T);if(ut(T,ArrayBuffer)||T&&ut(T.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(ut(T,SharedArrayBuffer)||T&&ut(T.buffer,SharedArrayBuffer)))return k(T,I,O);if(typeof T=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let q=T.valueOf&&T.valueOf();if(q!=null&&q!==T)return p.from(q,I,O);let H=P(T);if(H)return H;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof T[Symbol.toPrimitive]=="function")return p.from(T[Symbol.toPrimitive]("string"),I,O);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof T)}p.from=function(T,I,O){return b(T,I,O)},Object.setPrototypeOf(p.prototype,Uint8Array.prototype),Object.setPrototypeOf(p,Uint8Array);function g(T){if(typeof T!="number")throw new TypeError('"size" argument must be of type number');if(T<0)throw new RangeError('The value "'+T+'" is invalid for option "size"')}function y(T,I,O){return g(T),T<=0?l(T):I!==void 0?typeof O=="string"?l(T).fill(I,O):l(T).fill(I):l(T)}p.alloc=function(T,I,O){return y(T,I,O)};function M(T){return g(T),l(T<0?0:N(T)|0)}p.allocUnsafe=function(T){return M(T)},p.allocUnsafeSlow=function(T){return M(T)};function x(T,I){if((typeof I!="string"||I==="")&&(I="utf8"),!p.isEncoding(I))throw new TypeError("Unknown encoding: "+I);let O=C(T,I)|0,q=l(O),H=q.write(T,I);return H!==O&&(q=q.slice(0,H)),q}function E(T){let I=T.length<0?0:N(T.length)|0,O=l(I);for(let q=0;q<I;q+=1)O[q]=T[q]&255;return O}function A(T){if(ut(T,Uint8Array)){let I=new Uint8Array(T);return k(I.buffer,I.byteOffset,I.byteLength)}return E(T)}function k(T,I,O){if(I<0||T.byteLength<I)throw new RangeError('"offset" is outside of buffer bounds');if(T.byteLength<I+(O||0))throw new RangeError('"length" is outside of buffer bounds');let q;return I===void 0&&O===void 0?q=new Uint8Array(T):O===void 0?q=new Uint8Array(T,I):q=new Uint8Array(T,I,O),Object.setPrototypeOf(q,p.prototype),q}function P(T){if(p.isBuffer(T)){let I=N(T.length)|0,O=l(I);return O.length===0||T.copy(O,0,0,I),O}if(T.length!==void 0)return typeof T.length!="number"||Ze(T.length)?l(0):E(T);if(T.type==="Buffer"&&Array.isArray(T.data))return E(T.data)}function N(T){if(T>=i)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+i.toString(16)+" bytes");return T|0}function L(T){return+T!=T&&(T=0),p.alloc(+T)}p.isBuffer=function(T){return T!=null&&T._isBuffer===!0&&T!==p.prototype},p.compare=function(T,I){if(ut(T,Uint8Array)&&(T=p.from(T,T.offset,T.byteLength)),ut(I,Uint8Array)&&(I=p.from(I,I.offset,I.byteLength)),!p.isBuffer(T)||!p.isBuffer(I))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(T===I)return 0;let O=T.length,q=I.length;for(let H=0,W=Math.min(O,q);H<W;++H)if(T[H]!==I[H]){O=T[H],q=I[H];break}return O<q?-1:q<O?1:0},p.isEncoding=function(T){switch(String(T).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}},p.concat=function(T,I){if(!Array.isArray(T))throw new TypeError('"list" argument must be an Array of Buffers');if(T.length===0)return p.alloc(0);let O;if(I===void 0)for(I=0,O=0;O<T.length;++O)I+=T[O].length;let q=p.allocUnsafe(I),H=0;for(O=0;O<T.length;++O){let W=T[O];if(ut(W,Uint8Array))H+W.length>q.length?(p.isBuffer(W)||(W=p.from(W)),W.copy(q,H)):Uint8Array.prototype.set.call(q,W,H);else if(p.isBuffer(W))W.copy(q,H);else throw new TypeError('"list" argument must be an Array of Buffers');H+=W.length}return q};function C(T,I){if(p.isBuffer(T))return T.length;if(ArrayBuffer.isView(T)||ut(T,ArrayBuffer))return T.byteLength;if(typeof T!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof T);let O=T.length,q=arguments.length>2&&arguments[2]===!0;if(!q&&O===0)return 0;let H=!1;for(;;)switch(I){case"ascii":case"latin1":case"binary":return O;case"utf8":case"utf-8":return oe(T).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O*2;case"hex":return O>>>1;case"base64":return ge(T).length;default:if(H)return q?-1:oe(T).length;I=(""+I).toLowerCase(),H=!0}}p.byteLength=C;function Y(T,I,O){let q=!1;if((I===void 0||I<0)&&(I=0),I>this.length||((O===void 0||O>this.length)&&(O=this.length),O<=0)||(O>>>=0,I>>>=0,O<=I))return"";for(T||(T="utf8");;)switch(T){case"hex":return o(this,I,O);case"utf8":case"utf-8":return u(this,I,O);case"ascii":return w(this,I,O);case"latin1":case"binary":return d(this,I,O);case"base64":return f(this,I,O);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return v(this,I,O);default:if(q)throw new TypeError("Unknown encoding: "+T);T=(T+"").toLowerCase(),q=!0}}p.prototype._isBuffer=!0;function G(T,I,O){let q=T[I];T[I]=T[O],T[O]=q}p.prototype.swap16=function(){let T=this.length;if(T%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let I=0;I<T;I+=2)G(this,I,I+1);return this},p.prototype.swap32=function(){let T=this.length;if(T%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let I=0;I<T;I+=4)G(this,I,I+3),G(this,I+1,I+2);return this},p.prototype.swap64=function(){let T=this.length;if(T%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let I=0;I<T;I+=8)G(this,I,I+7),G(this,I+1,I+6),G(this,I+2,I+5),G(this,I+3,I+4);return this},p.prototype.toString=function(){let T=this.length;return T===0?"":arguments.length===0?u(this,0,T):Y.apply(this,arguments)},p.prototype.toLocaleString=p.prototype.toString,p.prototype.equals=function(T){if(!p.isBuffer(T))throw new TypeError("Argument must be a Buffer");return this===T?!0:p.compare(this,T)===0},p.prototype.inspect=function(){let T="",I=t.INSPECT_MAX_BYTES;return T=this.toString("hex",0,I).replace(/(.{2})/g,"$1 ").trim(),this.length>I&&(T+=" ... "),"<Buffer "+T+">"},a&&(p.prototype[a]=p.prototype.inspect),p.prototype.compare=function(T,I,O,q,H){if(ut(T,Uint8Array)&&(T=p.from(T,T.offset,T.byteLength)),!p.isBuffer(T))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof T);if(I===void 0&&(I=0),O===void 0&&(O=T?T.length:0),q===void 0&&(q=0),H===void 0&&(H=this.length),I<0||O>T.length||q<0||H>this.length)throw new RangeError("out of range index");if(q>=H&&I>=O)return 0;if(q>=H)return-1;if(I>=O)return 1;if(I>>>=0,O>>>=0,q>>>=0,H>>>=0,this===T)return 0;let W=H-q,fe=O-I,st=Math.min(W,fe),ue=this.slice(q,H),me=T.slice(I,O);for(let pe=0;pe<st;++pe)if(ue[pe]!==me[pe]){W=ue[pe],fe=me[pe];break}return W<fe?-1:fe<W?1:0};function ee(T,I,O,q,H){if(T.length===0)return-1;if(typeof O=="string"?(q=O,O=0):O>2147483647?O=2147483647:O<-2147483648&&(O=-2147483648),O=+O,Ze(O)&&(O=H?0:T.length-1),O<0&&(O=T.length+O),O>=T.length){if(H)return-1;O=T.length-1}else if(O<0)if(H)O=0;else return-1;if(typeof I=="string"&&(I=p.from(I,q)),p.isBuffer(I))return I.length===0?-1:D(T,I,O,q,H);if(typeof I=="number")return I=I&255,typeof Uint8Array.prototype.indexOf=="function"?H?Uint8Array.prototype.indexOf.call(T,I,O):Uint8Array.prototype.lastIndexOf.call(T,I,O):D(T,[I],O,q,H);throw new TypeError("val must be string, number or Buffer")}function D(T,I,O,q,H){let W=1,fe=T.length,st=I.length;if(q!==void 0&&(q=String(q).toLowerCase(),q==="ucs2"||q==="ucs-2"||q==="utf16le"||q==="utf-16le")){if(T.length<2||I.length<2)return-1;W=2,fe/=2,st/=2,O/=2}function ue(pe,be){return W===1?pe[be]:pe.readUInt16BE(be*W)}let me;if(H){let pe=-1;for(me=O;me<fe;me++)if(ue(T,me)===ue(I,pe===-1?0:me-pe)){if(pe===-1&&(pe=me),me-pe+1===st)return pe*W}else pe!==-1&&(me-=me-pe),pe=-1}else for(O+st>fe&&(O=fe-st),me=O;me>=0;me--){let pe=!0;for(let be=0;be<st;be++)if(ue(T,me+be)!==ue(I,be)){pe=!1;break}if(pe)return me}return-1}p.prototype.includes=function(T,I,O){return this.indexOf(T,I,O)!==-1},p.prototype.indexOf=function(T,I,O){return ee(this,T,I,O,!0)},p.prototype.lastIndexOf=function(T,I,O){return ee(this,T,I,O,!1)};function U(T,I,O,q){O=Number(O)||0;let H=T.length-O;q?(q=Number(q),q>H&&(q=H)):q=H;let W=I.length;q>W/2&&(q=W/2);let fe;for(fe=0;fe<q;++fe){let st=parseInt(I.substr(fe*2,2),16);if(Ze(st))return fe;T[O+fe]=st}return fe}function V(T,I,O,q){return Se(oe(I,T.length-O),T,O,q)}function _(T,I,O,q){return Se(ce(I),T,O,q)}function n(T,I,O,q){return Se(ge(I),T,O,q)}function s(T,I,O,q){return Se(ot(I,T.length-O),T,O,q)}p.prototype.write=function(T,I,O,q){if(I===void 0)q="utf8",O=this.length,I=0;else if(O===void 0&&typeof I=="string")q=I,O=this.length,I=0;else if(isFinite(I))I=I>>>0,isFinite(O)?(O=O>>>0,q===void 0&&(q="utf8")):(q=O,O=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let H=this.length-I;if((O===void 0||O>H)&&(O=H),T.length>0&&(O<0||I<0)||I>this.length)throw new RangeError("Attempt to write outside buffer bounds");q||(q="utf8");let W=!1;for(;;)switch(q){case"hex":return U(this,T,I,O);case"utf8":case"utf-8":return V(this,T,I,O);case"ascii":case"latin1":case"binary":return _(this,T,I,O);case"base64":return n(this,T,I,O);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return s(this,T,I,O);default:if(W)throw new TypeError("Unknown encoding: "+q);q=(""+q).toLowerCase(),W=!0}},p.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function f(T,I,O){return I===0&&O===T.length?e.fromByteArray(T):e.fromByteArray(T.slice(I,O))}function u(T,I,O){O=Math.min(T.length,O);let q=[],H=I;for(;H<O;){let W=T[H],fe=null,st=W>239?4:W>223?3:W>191?2:1;if(H+st<=O){let ue,me,pe,be;switch(st){case 1:W<128&&(fe=W);break;case 2:ue=T[H+1],(ue&192)===128&&(be=(W&31)<<6|ue&63,be>127&&(fe=be));break;case 3:ue=T[H+1],me=T[H+2],(ue&192)===128&&(me&192)===128&&(be=(W&15)<<12|(ue&63)<<6|me&63,be>2047&&(be<55296||be>57343)&&(fe=be));break;case 4:ue=T[H+1],me=T[H+2],pe=T[H+3],(ue&192)===128&&(me&192)===128&&(pe&192)===128&&(be=(W&15)<<18|(ue&63)<<12|(me&63)<<6|pe&63,be>65535&&be<1114112&&(fe=be))}}fe===null?(fe=65533,st=1):fe>65535&&(fe-=65536,q.push(fe>>>10&1023|55296),fe=56320|fe&1023),q.push(fe),H+=st}return m(q)}var c=4096;function m(T){let I=T.length;if(I<=c)return String.fromCharCode.apply(String,T);let O="",q=0;for(;q<I;)O+=String.fromCharCode.apply(String,T.slice(q,q+=c));return O}function w(T,I,O){let q="";O=Math.min(T.length,O);for(let H=I;H<O;++H)q+=String.fromCharCode(T[H]&127);return q}function d(T,I,O){let q="";O=Math.min(T.length,O);for(let H=I;H<O;++H)q+=String.fromCharCode(T[H]);return q}function o(T,I,O){let q=T.length;(!I||I<0)&&(I=0),(!O||O<0||O>q)&&(O=q);let H="";for(let W=I;W<O;++W)H+=Ge[T[W]];return H}function v(T,I,O){let q=T.slice(I,O),H="";for(let W=0;W<q.length-1;W+=2)H+=String.fromCharCode(q[W]+q[W+1]*256);return H}p.prototype.slice=function(T,I){let O=this.length;T=~~T,I=I===void 0?O:~~I,T<0?(T+=O,T<0&&(T=0)):T>O&&(T=O),I<0?(I+=O,I<0&&(I=0)):I>O&&(I=O),I<T&&(I=T);let q=this.subarray(T,I);return Object.setPrototypeOf(q,p.prototype),q};function R(T,I,O){if(T%1!==0||T<0)throw new RangeError("offset is not uint");if(T+I>O)throw new RangeError("Trying to access beyond buffer length")}p.prototype.readUintLE=p.prototype.readUIntLE=function(T,I,O){T=T>>>0,I=I>>>0,O||R(T,I,this.length);let q=this[T],H=1,W=0;for(;++W<I&&(H*=256);)q+=this[T+W]*H;return q},p.prototype.readUintBE=p.prototype.readUIntBE=function(T,I,O){T=T>>>0,I=I>>>0,O||R(T,I,this.length);let q=this[T+--I],H=1;for(;I>0&&(H*=256);)q+=this[T+--I]*H;return q},p.prototype.readUint8=p.prototype.readUInt8=function(T,I){return T=T>>>0,I||R(T,1,this.length),this[T]},p.prototype.readUint16LE=p.prototype.readUInt16LE=function(T,I){return T=T>>>0,I||R(T,2,this.length),this[T]|this[T+1]<<8},p.prototype.readUint16BE=p.prototype.readUInt16BE=function(T,I){return T=T>>>0,I||R(T,2,this.length),this[T]<<8|this[T+1]},p.prototype.readUint32LE=p.prototype.readUInt32LE=function(T,I){return T=T>>>0,I||R(T,4,this.length),(this[T]|this[T+1]<<8|this[T+2]<<16)+this[T+3]*16777216},p.prototype.readUint32BE=p.prototype.readUInt32BE=function(T,I){return T=T>>>0,I||R(T,4,this.length),this[T]*16777216+(this[T+1]<<16|this[T+2]<<8|this[T+3])},p.prototype.readBigUInt64LE=lt(function(T){T=T>>>0,J(T,"offset");let I=this[T],O=this[T+7];(I===void 0||O===void 0)&&X(T,this.length-8);let q=I+this[++T]*2**8+this[++T]*2**16+this[++T]*2**24,H=this[++T]+this[++T]*2**8+this[++T]*2**16+O*2**24;return BigInt(q)+(BigInt(H)<<BigInt(32))}),p.prototype.readBigUInt64BE=lt(function(T){T=T>>>0,J(T,"offset");let I=this[T],O=this[T+7];(I===void 0||O===void 0)&&X(T,this.length-8);let q=I*2**24+this[++T]*2**16+this[++T]*2**8+this[++T],H=this[++T]*2**24+this[++T]*2**16+this[++T]*2**8+O;return(BigInt(q)<<BigInt(32))+BigInt(H)}),p.prototype.readIntLE=function(T,I,O){T=T>>>0,I=I>>>0,O||R(T,I,this.length);let q=this[T],H=1,W=0;for(;++W<I&&(H*=256);)q+=this[T+W]*H;return H*=128,q>=H&&(q-=Math.pow(2,8*I)),q},p.prototype.readIntBE=function(T,I,O){T=T>>>0,I=I>>>0,O||R(T,I,this.length);let q=I,H=1,W=this[T+--q];for(;q>0&&(H*=256);)W+=this[T+--q]*H;return H*=128,W>=H&&(W-=Math.pow(2,8*I)),W},p.prototype.readInt8=function(T,I){return T=T>>>0,I||R(T,1,this.length),this[T]&128?(255-this[T]+1)*-1:this[T]},p.prototype.readInt16LE=function(T,I){T=T>>>0,I||R(T,2,this.length);let O=this[T]|this[T+1]<<8;return O&32768?O|4294901760:O},p.prototype.readInt16BE=function(T,I){T=T>>>0,I||R(T,2,this.length);let O=this[T+1]|this[T]<<8;return O&32768?O|4294901760:O},p.prototype.readInt32LE=function(T,I){return T=T>>>0,I||R(T,4,this.length),this[T]|this[T+1]<<8|this[T+2]<<16|this[T+3]<<24},p.prototype.readInt32BE=function(T,I){return T=T>>>0,I||R(T,4,this.length),this[T]<<24|this[T+1]<<16|this[T+2]<<8|this[T+3]},p.prototype.readBigInt64LE=lt(function(T){T=T>>>0,J(T,"offset");let I=this[T],O=this[T+7];(I===void 0||O===void 0)&&X(T,this.length-8);let q=this[T+4]+this[T+5]*2**8+this[T+6]*2**16+(O<<24);return(BigInt(q)<<BigInt(32))+BigInt(I+this[++T]*2**8+this[++T]*2**16+this[++T]*2**24)}),p.prototype.readBigInt64BE=lt(function(T){T=T>>>0,J(T,"offset");let I=this[T],O=this[T+7];(I===void 0||O===void 0)&&X(T,this.length-8);let q=(I<<24)+this[++T]*2**16+this[++T]*2**8+this[++T];return(BigInt(q)<<BigInt(32))+BigInt(this[++T]*2**24+this[++T]*2**16+this[++T]*2**8+O)}),p.prototype.readFloatLE=function(T,I){return T=T>>>0,I||R(T,4,this.length),r.read(this,T,!0,23,4)},p.prototype.readFloatBE=function(T,I){return T=T>>>0,I||R(T,4,this.length),r.read(this,T,!1,23,4)},p.prototype.readDoubleLE=function(T,I){return T=T>>>0,I||R(T,8,this.length),r.read(this,T,!0,52,8)},p.prototype.readDoubleBE=function(T,I){return T=T>>>0,I||R(T,8,this.length),r.read(this,T,!1,52,8)};function S(T,I,O,q,H,W){if(!p.isBuffer(T))throw new TypeError('"buffer" argument must be a Buffer instance');if(I>H||I<W)throw new RangeError('"value" argument is out of bounds');if(O+q>T.length)throw new RangeError("Index out of range")}p.prototype.writeUintLE=p.prototype.writeUIntLE=function(T,I,O,q){if(T=+T,I=I>>>0,O=O>>>0,!q){let fe=Math.pow(2,8*O)-1;S(this,T,I,O,fe,0)}let H=1,W=0;for(this[I]=T&255;++W<O&&(H*=256);)this[I+W]=T/H&255;return I+O},p.prototype.writeUintBE=p.prototype.writeUIntBE=function(T,I,O,q){if(T=+T,I=I>>>0,O=O>>>0,!q){let fe=Math.pow(2,8*O)-1;S(this,T,I,O,fe,0)}let H=O-1,W=1;for(this[I+H]=T&255;--H>=0&&(W*=256);)this[I+H]=T/W&255;return I+O},p.prototype.writeUint8=p.prototype.writeUInt8=function(T,I,O){return T=+T,I=I>>>0,O||S(this,T,I,1,255,0),this[I]=T&255,I+1},p.prototype.writeUint16LE=p.prototype.writeUInt16LE=function(T,I,O){return T=+T,I=I>>>0,O||S(this,T,I,2,65535,0),this[I]=T&255,this[I+1]=T>>>8,I+2},p.prototype.writeUint16BE=p.prototype.writeUInt16BE=function(T,I,O){return T=+T,I=I>>>0,O||S(this,T,I,2,65535,0),this[I]=T>>>8,this[I+1]=T&255,I+2},p.prototype.writeUint32LE=p.prototype.writeUInt32LE=function(T,I,O){return T=+T,I=I>>>0,O||S(this,T,I,4,4294967295,0),this[I+3]=T>>>24,this[I+2]=T>>>16,this[I+1]=T>>>8,this[I]=T&255,I+4},p.prototype.writeUint32BE=p.prototype.writeUInt32BE=function(T,I,O){return T=+T,I=I>>>0,O||S(this,T,I,4,4294967295,0),this[I]=T>>>24,this[I+1]=T>>>16,this[I+2]=T>>>8,this[I+3]=T&255,I+4};function B(T,I,O,q,H){j(I,q,H,T,O,7);let W=Number(I&BigInt(4294967295));T[O++]=W,W=W>>8,T[O++]=W,W=W>>8,T[O++]=W,W=W>>8,T[O++]=W;let fe=Number(I>>BigInt(32)&BigInt(4294967295));return T[O++]=fe,fe=fe>>8,T[O++]=fe,fe=fe>>8,T[O++]=fe,fe=fe>>8,T[O++]=fe,O}function F(T,I,O,q,H){j(I,q,H,T,O,7);let W=Number(I&BigInt(4294967295));T[O+7]=W,W=W>>8,T[O+6]=W,W=W>>8,T[O+5]=W,W=W>>8,T[O+4]=W;let fe=Number(I>>BigInt(32)&BigInt(4294967295));return T[O+3]=fe,fe=fe>>8,T[O+2]=fe,fe=fe>>8,T[O+1]=fe,fe=fe>>8,T[O]=fe,O+8}p.prototype.writeBigUInt64LE=lt(function(T,I=0){return B(this,T,I,BigInt(0),BigInt("0xffffffffffffffff"))}),p.prototype.writeBigUInt64BE=lt(function(T,I=0){return F(this,T,I,BigInt(0),BigInt("0xffffffffffffffff"))}),p.prototype.writeIntLE=function(T,I,O,q){if(T=+T,I=I>>>0,!q){let st=Math.pow(2,8*O-1);S(this,T,I,O,st-1,-st)}let H=0,W=1,fe=0;for(this[I]=T&255;++H<O&&(W*=256);)T<0&&fe===0&&this[I+H-1]!==0&&(fe=1),this[I+H]=(T/W>>0)-fe&255;return I+O},p.prototype.writeIntBE=function(T,I,O,q){if(T=+T,I=I>>>0,!q){let st=Math.pow(2,8*O-1);S(this,T,I,O,st-1,-st)}let H=O-1,W=1,fe=0;for(this[I+H]=T&255;--H>=0&&(W*=256);)T<0&&fe===0&&this[I+H+1]!==0&&(fe=1),this[I+H]=(T/W>>0)-fe&255;return I+O},p.prototype.writeInt8=function(T,I,O){return T=+T,I=I>>>0,O||S(this,T,I,1,127,-128),T<0&&(T=255+T+1),this[I]=T&255,I+1},p.prototype.writeInt16LE=function(T,I,O){return T=+T,I=I>>>0,O||S(this,T,I,2,32767,-32768),this[I]=T&255,this[I+1]=T>>>8,I+2},p.prototype.writeInt16BE=function(T,I,O){return T=+T,I=I>>>0,O||S(this,T,I,2,32767,-32768),this[I]=T>>>8,this[I+1]=T&255,I+2},p.prototype.writeInt32LE=function(T,I,O){return T=+T,I=I>>>0,O||S(this,T,I,4,2147483647,-2147483648),this[I]=T&255,this[I+1]=T>>>8,this[I+2]=T>>>16,this[I+3]=T>>>24,I+4},p.prototype.writeInt32BE=function(T,I,O){return T=+T,I=I>>>0,O||S(this,T,I,4,2147483647,-2147483648),T<0&&(T=4294967295+T+1),this[I]=T>>>24,this[I+1]=T>>>16,this[I+2]=T>>>8,this[I+3]=T&255,I+4},p.prototype.writeBigInt64LE=lt(function(T,I=0){return B(this,T,I,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),p.prototype.writeBigInt64BE=lt(function(T,I=0){return F(this,T,I,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function $(T,I,O,q,H,W){if(O+q>T.length)throw new RangeError("Index out of range");if(O<0)throw new RangeError("Index out of range")}function re(T,I,O,q,H){return I=+I,O=O>>>0,H||$(T,I,O,4,34028234663852886e22,-34028234663852886e22),r.write(T,I,O,q,23,4),O+4}p.prototype.writeFloatLE=function(T,I,O){return re(this,T,I,!0,O)},p.prototype.writeFloatBE=function(T,I,O){return re(this,T,I,!1,O)};function Q(T,I,O,q,H){return I=+I,O=O>>>0,H||$(T,I,O,8,17976931348623157e292,-17976931348623157e292),r.write(T,I,O,q,52,8),O+8}p.prototype.writeDoubleLE=function(T,I,O){return Q(this,T,I,!0,O)},p.prototype.writeDoubleBE=function(T,I,O){return Q(this,T,I,!1,O)},p.prototype.copy=function(T,I,O,q){if(!p.isBuffer(T))throw new TypeError("argument should be a Buffer");if(O||(O=0),!q&&q!==0&&(q=this.length),I>=T.length&&(I=T.length),I||(I=0),q>0&&q<O&&(q=O),q===O||T.length===0||this.length===0)return 0;if(I<0)throw new RangeError("targetStart out of bounds");if(O<0||O>=this.length)throw new RangeError("Index out of range");if(q<0)throw new RangeError("sourceEnd out of bounds");q>this.length&&(q=this.length),T.length-I<q-O&&(q=T.length-I+O);let H=q-O;return this===T&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(I,O,q):Uint8Array.prototype.set.call(T,this.subarray(O,q),I),H},p.prototype.fill=function(T,I,O,q){if(typeof T=="string"){if(typeof I=="string"?(q=I,I=0,O=this.length):typeof O=="string"&&(q=O,O=this.length),q!==void 0&&typeof q!="string")throw new TypeError("encoding must be a string");if(typeof q=="string"&&!p.isEncoding(q))throw new TypeError("Unknown encoding: "+q);if(T.length===1){let W=T.charCodeAt(0);(q==="utf8"&&W<128||q==="latin1")&&(T=W)}}else typeof T=="number"?T=T&255:typeof T=="boolean"&&(T=Number(T));if(I<0||this.length<I||this.length<O)throw new RangeError("Out of range index");if(O<=I)return this;I=I>>>0,O=O===void 0?this.length:O>>>0,T||(T=0);let H;if(typeof T=="number")for(H=I;H<O;++H)this[H]=T;else{let W=p.isBuffer(T)?T:p.from(T,q),fe=W.length;if(fe===0)throw new TypeError('The value "'+T+'" is invalid for argument "value"');for(H=0;H<O-I;++H)this[H+I]=W[H%fe]}return this};var Z={};function K(T,I,O){Z[T]=class extends O{constructor(){super(),Object.defineProperty(this,"message",{value:I.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${T}]`,this.stack,delete this.name}get code(){return T}set code(q){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:q,writable:!0})}toString(){return`${this.name} [${T}]: ${this.message}`}}}K("ERR_BUFFER_OUT_OF_BOUNDS",function(T){return T?`${T} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),K("ERR_INVALID_ARG_TYPE",function(T,I){return`The "${T}" argument must be of type number. Received type ${typeof I}`},TypeError),K("ERR_OUT_OF_RANGE",function(T,I,O){let q=`The value of "${T}" is out of range.`,H=O;return Number.isInteger(O)&&Math.abs(O)>2**32?H=le(String(O)):typeof O=="bigint"&&(H=String(O),(O>BigInt(2)**BigInt(32)||O<-(BigInt(2)**BigInt(32)))&&(H=le(H)),H+="n"),q+=` It must be ${I}. Received ${H}`,q},RangeError);function le(T){let I="",O=T.length,q=T[0]==="-"?1:0;for(;O>=q+4;O-=3)I=`_${T.slice(O-3,O)}${I}`;return`${T.slice(0,O)}${I}`}function te(T,I,O){J(I,"offset"),(T[I]===void 0||T[I+O]===void 0)&&X(I,T.length-(O+1))}function j(T,I,O,q,H,W){if(T>O||T<I){let fe=typeof I=="bigint"?"n":"",st;throw W>3?I===0||I===BigInt(0)?st=`>= 0${fe} and < 2${fe} ** ${(W+1)*8}${fe}`:st=`>= -(2${fe} ** ${(W+1)*8-1}${fe}) and < 2 ** ${(W+1)*8-1}${fe}`:st=`>= ${I}${fe} and <= ${O}${fe}`,new Z.ERR_OUT_OF_RANGE("value",st,T)}te(q,H,W)}function J(T,I){if(typeof T!="number")throw new Z.ERR_INVALID_ARG_TYPE(I,"number",T)}function X(T,I,O){throw Math.floor(T)!==T?(J(T,O),new Z.ERR_OUT_OF_RANGE(O||"offset","an integer",T)):I<0?new Z.ERR_BUFFER_OUT_OF_BOUNDS:new Z.ERR_OUT_OF_RANGE(O||"offset",`>= ${O?1:0} and <= ${I}`,T)}var he=/[^+/0-9A-Za-z-_]/g;function Te(T){if(T=T.split("=")[0],T=T.trim().replace(he,""),T.length<2)return"";for(;T.length%4!==0;)T=T+"=";return T}function oe(T,I){I=I||1/0;let O,q=T.length,H=null,W=[];for(let fe=0;fe<q;++fe){if(O=T.charCodeAt(fe),O>55295&&O<57344){if(!H){if(O>56319){(I-=3)>-1&&W.push(239,191,189);continue}else if(fe+1===q){(I-=3)>-1&&W.push(239,191,189);continue}H=O;continue}if(O<56320){(I-=3)>-1&&W.push(239,191,189),H=O;continue}O=(H-55296<<10|O-56320)+65536}else H&&(I-=3)>-1&&W.push(239,191,189);if(H=null,O<128){if((I-=1)<0)break;W.push(O)}else if(O<2048){if((I-=2)<0)break;W.push(O>>6|192,O&63|128)}else if(O<65536){if((I-=3)<0)break;W.push(O>>12|224,O>>6&63|128,O&63|128)}else if(O<1114112){if((I-=4)<0)break;W.push(O>>18|240,O>>12&63|128,O>>6&63|128,O&63|128)}else throw new Error("Invalid code point")}return W}function ce(T){let I=[];for(let O=0;O<T.length;++O)I.push(T.charCodeAt(O)&255);return I}function ot(T,I){let O,q,H,W=[];for(let fe=0;fe<T.length&&!((I-=2)<0);++fe)O=T.charCodeAt(fe),q=O>>8,H=O%256,W.push(H),W.push(q);return W}function ge(T){return e.toByteArray(Te(T))}function Se(T,I,O,q){let H;for(H=0;H<q&&!(H+O>=I.length||H>=T.length);++H)I[H+O]=T[H];return H}function ut(T,I){return T instanceof I||T!=null&&T.constructor!=null&&T.constructor.name!=null&&T.constructor.name===I.name}function Ze(T){return T!==T}var Ge=function(){let T="0123456789abcdef",I=new Array(256);for(let O=0;O<16;++O){let q=O*16;for(let H=0;H<16;++H)I[q+H]=T[O]+T[H]}return I}();function lt(T){return typeof BigInt>"u"?z:T}function z(){throw new Error("BigInt not supported")}}),p$e=Jh((t,e)=>{typeof window<"u"?(window.global=window,global.fetch=window.fetch,e.exports={Buffer:nB().Buffer,Crypto:window.crypto}):e.exports={Buffer:nB().Buffer,Crypto:crypto}}),jse={};f$e(jse,{AVSCTap:()=>pb,ArweaveSigner:()=>IB,DataItem:()=>ub,MAX_TAG_BYTES:()=>Ow,MIN_BINARY_SIZE:()=>OB,SIG_CONFIG:()=>pv,SignatureConfig:()=>Ls,Signer:()=>zse,createData:()=>Wse,deserializeTags:()=>xw,indexToType:()=>BB,serializeTags:()=>PB,tagsExceedLimit:()=>Kse});var zse=class{signer;publicKey;signatureType;signatureLength;ownerLength;pem;static verify(t,e,r,a){throw new Error("You must implement verify method on child")}},v$e=Zd(kB(),1),Ff=Zd(Fse(),1);async function Zse(t){if(Array.isArray(t)){let i=(0,Ff.concatBuffers)([(0,Ff.stringToBuffer)("list"),(0,Ff.stringToBuffer)(t.length.toString())]);return await Hse(t,await Wh().hash(i,"SHA-384"))}let e=t,r=(0,Ff.concatBuffers)([(0,Ff.stringToBuffer)("blob"),(0,Ff.stringToBuffer)(e.byteLength.toString())]),a=(0,Ff.concatBuffers)([await Wh().hash(r,"SHA-384"),await Wh().hash(e,"SHA-384")]);return await Wh().hash(a,"SHA-384")}async function Hse(t,e){if(t.length<1)return e;let r=(0,Ff.concatBuffers)([e,await Zse(t[0])]),a=await Wh().hash(r,"SHA-384");return await Hse(t.slice(1),a)}var NI=Zd(c$e(),1),m$e=NI.default.default?NI.default.default:NI.default,g$e=class extends m$e{getPublicKey(t){throw new Error("Unimplemented")}},b$e;function Wh(){return b$e??=new g$e}var Ls;(function(t){t[t.ARWEAVE=1]="ARWEAVE",t[t.ED25519=2]="ED25519",t[t.ETHEREUM=3]="ETHEREUM",t[t.SOLANA=4]="SOLANA",t[t.INJECTEDAPTOS=5]="INJECTEDAPTOS",t[t.MULTIAPTOS=6]="MULTIAPTOS",t[t.TYPEDETHEREUM=7]="TYPEDETHEREUM"})(Ls||(Ls={}));var pv={[Ls.ARWEAVE]:{sigLength:512,pubLength:512,sigName:"arweave"},[Ls.ED25519]:{sigLength:64,pubLength:32,sigName:"ed25519"},[Ls.ETHEREUM]:{sigLength:65,pubLength:65,sigName:"ethereum"},[Ls.SOLANA]:{sigLength:64,pubLength:32,sigName:"solana"},[Ls.INJECTEDAPTOS]:{sigLength:64,pubLength:32,sigName:"injectedAptos"},[Ls.MULTIAPTOS]:{sigLength:64*32+4,pubLength:32*32+1,sigName:"multiAptos"},[Ls.TYPEDETHEREUM]:{sigLength:65,pubLength:42,sigName:"typedEthereum"}},IB=class{signatureType=1;ownerLength=pv[1].pubLength;signatureLength=pv[1].sigLength;jwk;pk;constructor(t){this.pk=t.n,this.jwk=t}get publicKey(){return v$e.default.toBuffer(this.pk)}sign(t){return Wh().sign(this.jwk,t)}static async verify(t,e,r){return await Wh().verify(t,e,r)}},BB={1:IB},ju=Zd(kB(),1);async function aB(t){return Zse([(0,Ff.stringToBuffer)("dataitem"),(0,Ff.stringToBuffer)("1"),(0,Ff.stringToBuffer)(t.signatureType.toString()),t.rawOwner,t.rawTarget,t.rawAnchor,t.rawTags,t.rawData])}async function y$e(t,e){let r=await aB(t),a=await e.sign(r),i=await Wh().hash(a);return{signature:Me.from(a),id:Me.from(i)}}async function w$e(t,e){let{signature:r,id:a}=await y$e(t,e);return t.getRaw().set(r,2),a}var pb=class{buf;pos;constructor(t=Me.alloc(Ow),e=0){this.buf=t,this.pos=e}writeTags(t){if(!Array.isArray(t))throw new Error("input must be array");let e=t.length,r;if(e)for(this.writeLong(e),r=0;r<e;r++){let a=t[r];if(a?.name===void 0||a?.value===void 0)throw new Error(`Invalid tag format for ${a}, expected {name:string, value: string}`);this.writeString(a.name),this.writeString(a.value)}this.writeLong(0)}toBuffer(){let t=Me.alloc(this.pos);if(this.pos>this.buf.length)throw new Error(`Too many tag bytes (${this.pos} > ${this.buf.length})`);return this.buf.copy(t,0,0,this.pos),t}tagsExceedLimit(){return this.pos>this.buf.length}writeLong(t){let e=this.buf,r,a;if(t>=-1073741824&&t<1073741824){a=t>=0?t<<1:~t<<1|1;do e[this.pos]=a&127,a>>=7;while(a&&(e[this.pos++]|=128))}else{r=t>=0?t*2:-t*2-1;do e[this.pos]=r&127,r/=128;while(r>=1&&(e[this.pos++]|=128))}this.pos++,this.buf=e}writeString(t){let e=Me.byteLength(t),r=this.buf;this.writeLong(e);let a=this.pos;if(this.pos+=e,!(this.pos>r.length)){if(e>64)this.buf.write(t,this.pos-e,e,"utf8");else{let i,h,l,p;for(i=0,h=e;i<h;i++)l=t.charCodeAt(i),l<128?r[a++]=l:l<2048?(r[a++]=l>>6|192,r[a++]=l&63|128):(l&64512)===55296&&((p=t.charCodeAt(i+1))&64512)===56320?(l=65536+((l&1023)<<10)+(p&1023),i++,r[a++]=l>>18|240,r[a++]=l>>12&63|128,r[a++]=l>>6&63|128,r[a++]=l&63|128):(r[a++]=l>>12|224,r[a++]=l>>6&63|128,r[a++]=l&63|128)}this.buf=r}}readLong(){let t=0,e=0,r=this.buf,a,i,h,l;do a=r[this.pos++],i=a&128,t|=(a&127)<<e,e+=7;while(i&&e<28);if(i){h=t,l=268435456;do a=r[this.pos++],h+=(a&127)*l,l*=128;while(a&128);return(h%2?-(h+1):h)/2}return t>>1^-(t&1)}skipLong(){let t=this.buf;for(;t[this.pos++]&128;);}readTags(){let t=[],e;for(;e=this.readLong();)for(e<0&&(e=-e,this.skipLong());e--;){let r=this.readString(),a=this.readString();t.push({name:r,value:a})}return t}readString(){let t=this.readLong(),e=this.pos,r=this.buf;if(this.pos+=t,!(this.pos>r.length))return this.buf.slice(e,e+t).toString()}};function PB(t){let e=new pb;return e.writeTags(t),e.toBuffer()}function Kse(t){let e=new pb;return e.writeTags(t),e.tagsExceedLimit()}function xw(t){return new pb(t).readTags()}function yc(t){let e=0;for(let r=t.length-1;r>=0;r--)e=e*256+t[r];return e}function _$e(t){if(t>29)throw new Error("Short too long");let e=[0,0];for(let r=0;r<e.length;r++){let a=t&255;e[r]=a,t=(t-a)/256}return Uint8Array.from(e)}function uoe(t){let e=[0,0,0,0,0,0,0,0];for(let r=0;r<e.length;r++){let a=t&255;e[r]=a,t=(t-a)/256}return Uint8Array.from(e)}var M$e=Zd(p$e(),1),V1=Zd(nB(),1),Ow=4096,OB=80,ub=class{binary;_id;constructor(t){this.binary=t}static isDataItem(t){return t.binary!==void 0}get signatureType(){let t=yc(this.binary.subarray(0,2));if(Ls?.[t]!==void 0)return t;throw new Error("Unknown signature type: "+t)}async isValid(){return ub.verify(this.binary)}get id(){return(async()=>ju.default.encode(await this.rawId))()}set id(t){this._id=ju.default.toBuffer(t)}get rawId(){return(async()=>V1.Buffer.from(await M$e.Crypto.subtle.digest("SHA-256",this.rawSignature)))()}set rawId(t){this._id=t}get rawSignature(){return this.binary.subarray(2,2+this.signatureLength)}get signature(){return ju.default.encode(this.rawSignature)}set rawOwner(t){if(t.byteLength!=this.ownerLength)throw new Error(`Expected raw owner (pubkey) to be ${this.ownerLength} bytes, got ${t.byteLength} bytes.`);this.binary.set(t,2+this.signatureLength)}get rawOwner(){return this.binary.subarray(2+this.signatureLength,2+this.signatureLength+this.ownerLength)}get signatureLength(){return pv[this.signatureType].sigLength}get owner(){return ju.default.encode(this.rawOwner)}get ownerLength(){return pv[this.signatureType].pubLength}get rawTarget(){let t=this.getTargetStart();return this.binary[t]==1?this.binary.subarray(t+1,t+33):V1.Buffer.alloc(0)}get target(){return ju.default.encode(this.rawTarget)}get rawAnchor(){let t=this.getAnchorStart();return this.binary[t]==1?this.binary.subarray(t+1,t+33):V1.Buffer.alloc(0)}get anchor(){return this.rawAnchor.toString()}get rawTags(){let t=this.getTagsStart(),e=yc(this.binary.subarray(t+8,t+16));return this.binary.subarray(t+16,t+16+e)}get tags(){let t=this.getTagsStart();if(yc(this.binary.subarray(t,t+8))==0)return[];let e=yc(this.binary.subarray(t+8,t+16));return xw(V1.Buffer.from(this.binary.subarray(t+16,t+16+e)))}get tagsB64Url(){return this.tags.map(t=>({name:ju.default.encode(t.name),value:ju.default.encode(t.value)}))}getStartOfData(){let t=this.getTagsStart(),e=this.binary.subarray(t+8,t+16),r=yc(e);return t+16+r}get rawData(){let t=this.getTagsStart(),e=this.binary.subarray(t+8,t+16),r=yc(e),a=t+16+r;return this.binary.subarray(a,this.binary.length)}get data(){return ju.default.encode(this.rawData)}getRaw(){return this.binary}async sign(t){return this._id=await w$e(this,t),this.rawId}async setSignature(t){this.binary.set(t,2),this._id=V1.Buffer.from(await Wh().hash(t))}isSigned(){return(this._id?.length??0)>0}toJSON(){return{signature:this.signature,owner:this.owner,target:this.target,tags:this.tags.map(t=>({name:ju.default.encode(t.name),value:ju.default.encode(t.value)})),data:this.data}}static async verify(t){if(t.byteLength<OB)return!1;let e=new ub(t),r=e.signatureType,a=e.getTagsStart(),i=yc(t.subarray(a,a+8)),h=t.subarray(a+8,a+16),l=yc(h);if(l>Ow)return!1;if(i>0)try{if(xw(V1.Buffer.from(t.subarray(a+16,a+16+l))).length!==i)return!1}catch{return!1}let p=BB[r],b=await aB(e);return await p.verify(e.rawOwner,b,e.rawSignature)}async getSignatureData(){return aB(this)}getTagsStart(){let t=this.getTargetStart(),e=this.binary[t]==1,r=t+(e?33:1),a=this.binary[r]==1;return r+=a?33:1,r}getTargetStart(){return 2+this.signatureLength+this.ownerLength}getAnchorStart(){let t=this.getTargetStart()+1,e=this.binary[this.getTargetStart()]==1;return t+=e?32:0,t}},x$e=Zd(kB(),1);function Wse(t,e,r){let a=e.publicKey,i=r?.target?x$e.default.toBuffer(r.target):null,h=1+(i?.byteLength??0),l=r?.anchor?Me.from(r.anchor):null,p=1+(l?.byteLength??0),b=(r?.tags?.length??0)>0?PB(r.tags):null,g=16+(b?b.byteLength:0),y=Me.from(t),M=y.byteLength,x=2+e.signatureLength+e.ownerLength+h+p+g+M,E=Me.alloc(x);if(E.set(_$e(e.signatureType),0),E.set(new Uint8Array(e.signatureLength).fill(0),2),a.byteLength!==e.ownerLength)throw new Error(`Owner must be ${e.ownerLength} bytes, but was incorrectly ${a.byteLength}`);E.set(a,2+e.signatureLength);let A=2+e.signatureLength+e.ownerLength;if(E[A]=i?1:0,i){if(i.byteLength!==32)throw new Error(`Target must be 32 bytes but was incorrectly ${i.byteLength}`);E.set(i,A+1)}let k=A+h,P=k+1;if(E[k]=l?1:0,l){if(P+=l.byteLength,l.byteLength!==32)throw new Error("Anchor must be 32 bytes");E.set(l,k+1)}E.set(uoe(r?.tags?.length??0),P);let N=uoe(b?.byteLength??0);E.set(N,P+8),b&&E.set(b,P+16);let L=P+g;return E.set(y,L),new ub(E)}var NB={...jse};globalThis.arbundles??=NB;var S$e=NB,E$e=NB;globalThis.Buffer||(globalThis.Buffer=$se.Buffer);var{DataItem:A$e}=qse;function R$e(t){return async({data:r,tags:a,target:i,anchor:h,createDataItem:l=p=>new A$e(p)})=>{let p=await t.signDataItem({data:r,tags:a,target:i,anchor:h}),b=l($se.Buffer.from(p));return{id:await b.id,raw:await b.getRaw()}}}var T$e=globalThis.GATEWAY_URL||void 0,k$e=globalThis.MU_URL||void 0,I$e=globalThis.CU_URL||void 0,B$e=globalThis.GRAPHQL_URL||void 0,{result:Fmt,results:jmt,message:zmt,spawn:Zmt,monitor:Hmt,unmonitor:Kmt,dryrun:Wmt,assign:Vmt}=vv({GATEWAY_URL:T$e,MU_URL:k$e,CU_URL:I$e,GRAPHQL_URL:B$e}),Vse=Dse.createDataItemSigner;ie();ae();ne();var Ffe=gi(Ufe(),1),hP=Ffe.default.init({host:"arweave.net",port:443,protocol:"https"});async function qbt({signer:t,module:e=aQ,luaCodeTxId:r=gT,ao:a=vv(),scheduler:i=oQ,state:h,stateContractTxId:l,antRegistryId:p=$8,logger:b=Fu.default,arweave:g=hP}){let y=await g.transactions.getData(r,{decode:!0,string:!0}),M=await a.spawn({module:e,scheduler:i,signer:t,tags:[{name:"ANT-Registry-Id",value:p},{name:"Source-Code-TX-ID",value:r}]}),x=new Pa({processId:M,ao:a,logger:b}),{id:E}=await x.send({tags:[{name:"Action",value:"Eval"},{name:"App-Name",value:"ArNS-ANT"},{name:"Source-Code-TX-ID",value:r}],data:y,signer:t});if(b.debug("Spawned ANT",{processId:M,module:e,scheduler:i,luaCodeTxId:r,evalId:E}),h){let{id:P}=await x.send({tags:[{name:"Action",value:"Initialize-State"},...l!==void 0?[{name:"State-Contract-TX-ID",value:l}]:[]],data:JSON.stringify(h),signer:t});b.debug("Initialized ANT",{processId:M,module:e,scheduler:i,initializeMsgId:P})}let A=Hd.init({process:new Pa({processId:p,ao:a,logger:b}),signer:t}),{id:k}=await A.register({processId:M});return b.debug("Registered ANT to ANT Registry",{processId:M,module:e,scheduler:i,antRegistrationMsgId:k,antRegistryId:p}),M}async function Ubt({signer:t,processId:e,luaCodeTxId:r=gT,ao:a=vv(),logger:i=Fu.default,arweave:h=hP}){let l=new Pa({processId:e,ao:a,logger:i}),p=await h.transactions.getData(r,{decode:!0,string:!0}),{id:b}=await l.send({tags:[{name:"Action",value:"Eval"},{name:"App-Name",value:"ArNS-ANT"},{name:"Source-Code-TX-ID",value:r}],data:p,signer:t});return i.debug("Evolved ANT",{processId:e,luaCodeTxId:r,evalMsgId:b}),b}function Jqe(t){let e=vr.object({name:vr.string(),value:vr.union([vr.string(),vr.number()])}),r=vr.function().args(vr.object({data:vr.union([vr.string(),vr.instanceof(Me)]),tags:vr.array(e).optional(),target:vr.string().optional(),anchor:vr.string().optional()})).returns(vr.promise(vr.object({id:vr.string(),raw:vr.instanceof(ArrayBuffer)})));try{return r.parse(t),!0}catch{return!1}}function Bc(t){return Jqe(t)?t:"publicKey"in t?async({data:r,tags:a,target:i,anchor:h})=>{t.publicKey===void 0&&"setPublicKey"in t&&typeof t.setPublicKey=="function"&&await t.setPublicKey();let l=Ag(r,t,{tags:a,target:i,anchor:h});return l.sign(t).then(async()=>({id:await l.id,raw:await l.getRaw()}))}:Vse(t)}var Xqe="-k7t8xMoB8hW482609Z9F4bTFMC3MnuW8bTvTyT8pFI";function Fbt({owner:t,targetId:e,ttlSeconds:r=3600,keywords:a=[],controllers:i=[],description:h="",ticker:l="aos",name:p="ANT"}){return{ticker:l,name:p,description:h,keywords:a,owner:t,controllers:[t,...i],balances:{[t]:1},records:{"@":{transactionId:e??Xqe.toString(),ttlSeconds:r}}}}ie();ae();ne();function Pc(t,e){let r=t.safeParse(e);if(!r.success)throw new Error(JSON.stringify(r.error.format(),null,2));return r}var Fw=class{static init({signer:e,strict:r=!1,...a}){if(Dh(a)||$h(a))return e?new lP({signer:e,strict:r,...a}):new jw({strict:r,...a});throw new Nu}},jw=class{process;strict;constructor(e){if(this.strict=e.strict||!1,Dh(e))this.process=e.process;else if($h(e))this.process=new Pa({processId:e.processId});else throw new Nu}async getState({strict:e}={strict:this.strict}){let r=[{name:"Action",value:"State"}],a=await this.process.read({tags:r});return e&&Pc(_T.passthrough().and(vr.object({Records:vr.record(vr.string(),q8.passthrough())})),a),a}async getInfo({strict:e}={strict:this.strict}){let r=[{name:"Action",value:"Info"}],a=await this.process.read({tags:r});return e&&Pc(hQ.passthrough(),a),a}async getRecord({undername:e},{strict:r}={strict:this.strict}){let a=[{name:"Sub-Domain",value:e},{name:"Action",value:"Record"}],i=await this.process.read({tags:a});return r&&Pc(q8.passthrough(),i),i}async getRecords({strict:e}={strict:this.strict}){let r=[{name:"Action",value:"Records"}],a=await this.process.read({tags:r});return e&&Pc(bT,a),a}async getOwner({strict:e}={strict:this.strict}){return(await this.getInfo({strict:e})).Owner}async getControllers({strict:e}={strict:this.strict}){let r=[{name:"Action",value:"Controllers"}],a=await this.process.read({tags:r});return e&&Pc(yT,a),a}async getName({strict:e}={strict:this.strict}){return(await this.getInfo({strict:e})).Name}async getTicker({strict:e}={strict:this.strict}){return(await this.getInfo({strict:e})).Ticker}async getBalances({strict:e}={strict:this.strict}){let r=[{name:"Action",value:"Balances"}],a=await this.process.read({tags:r});return e&&Pc(wT,a),a}async getBalance({address:e},{strict:r}={strict:this.strict}){let a=[{name:"Action",value:"Balance"},{name:"Recipient",value:e}],i=await this.process.read({tags:a});return r&&Pc(vr.number(),i),i}async getHandlers(){let e=await this.getInfo();return e.Handlers??e.HandlerNames}},lP=class extends jw{signer;constructor({signer:e,...r}){super(r),this.signer=Bc(e)}async transfer({target:e},r){let a=[...r?.tags??[],{name:"Action",value:"Transfer"},{name:"Recipient",value:e}];return this.process.send({tags:a,signer:this.signer})}async addController({controller:e},r){let a=[...r?.tags??[],{name:"Action",value:"Add-Controller"},{name:"Controller",value:e}];return this.process.send({tags:a,signer:this.signer})}async removeController({controller:e},r){let a=[...r?.tags??[],{name:"Action",value:"Remove-Controller"},{name:"Controller",value:e}];return this.process.send({tags:a,signer:this.signer})}async setRecord({undername:e,transactionId:r,ttlSeconds:a},i){return this.process.send({tags:[...i?.tags??[],{name:"Action",value:"Set-Record"},{name:"Sub-Domain",value:e},{name:"Transaction-Id",value:r},{name:"TTL-Seconds",value:a.toString()}],signer:this.signer})}async removeRecord({undername:e},r){return this.process.send({tags:[...r?.tags??[],{name:"Action",value:"Remove-Record"},{name:"Sub-Domain",value:e}],signer:this.signer})}async setTicker({ticker:e},r){return this.process.send({tags:[...r?.tags??[],{name:"Action",value:"Set-Ticker"},{name:"Ticker",value:e}],signer:this.signer})}async setName({name:e},r){return this.process.send({tags:[...r?.tags??[],{name:"Action",value:"Set-Name"},{name:"Name",value:e}],signer:this.signer})}async setDescription({description:e},r){return this.process.send({tags:[...r?.tags??[],{name:"Action",value:"Set-Description"},{name:"Description",value:e}],signer:this.signer})}async setKeywords({keywords:e},r){return this.process.send({tags:[...r?.tags??[],{name:"Action",value:"Set-Keywords"},{name:"Keywords",value:JSON.stringify(e)}],signer:this.signer})}async setLogo({txId:e},r){return this.process.send({tags:[...r?.tags??[],{name:"Action",value:"Set-Logo"},{name:"Logo",value:e}],signer:this.signer})}async releaseName({name:e,arioProcessId:r},a){return this.process.send({tags:[...a?.tags??[],{name:"Action",value:"Release-Name"},{name:"Name",value:e},{name:"IO-Process-Id",value:r},{name:"ARIO-Process-Id",value:r}],signer:this.signer})}async reassignName({name:e,arioProcessId:r,antProcessId:a},i){return this.process.send({tags:[...i?.tags??[],{name:"Action",value:"Reassign-Name"},{name:"Name",value:e},{name:"IO-Process-Id",value:r},{name:"ARIO-Process-Id",value:r},{name:"Process-Id",value:a}],signer:this.signer})}async approvePrimaryNameRequest({name:e,address:r,arioProcessId:a},i){return this.process.send({tags:[...i?.tags??[],{name:"Action",value:"Approve-Primary-Name"},{name:"Name",value:e},{name:"Recipient",value:r},{name:"IO-Process-Id",value:a},{name:"ARIO-Process-Id",value:a}],signer:this.signer})}async removePrimaryNames({names:e,arioProcessId:r},a){return this.process.send({tags:[...a?.tags??[],{name:"Action",value:"Remove-Primary-Names"},{name:"Names",value:e.join(",")},{name:"IO-Process-Id",value:r},{name:"ARIO-Process-Id",value:r}],signer:this.signer})}};ie();ae();ne();var Hd=class{static init(e){if(e&&e.signer){let{signer:r,...a}=e;return new cP({...a,signer:r})}return new zw(e)}},zw=class{process;constructor(e){if(e&&($h(e)||Dh(e)))if(Dh(e))this.process=e.process;else if($h(e))this.process=new Pa({processId:e.processId});else throw new Nu;else this.process=new Pa({processId:$8})}async accessControlList({address:e}){return this.process.read({tags:[{name:"Action",value:"Access-Control-List"},{name:"Address",value:e}]})}},cP=class extends zw{signer;constructor({signer:e,...r}){super(r),this.signer=Bc(e)}async register({processId:e}){return this.process.send({tags:[{name:"Action",value:"Register"},{name:"Process-Id",value:e}],signer:this.signer})}};ie();ae();ne();ie();ae();ne();ie();ae();ne();du();var jfe="+",zfe="/",Zfe="-",Hfe="_",Kfe="=";function Qqe(t){let e=t.length%4;return e&&(t+=Kfe.repeat(4-e)),t.replaceAll(Zfe,jfe).replaceAll(Hfe,zfe)}function eUe(t){return t.replaceAll(jfe,Zfe).replaceAll(zfe,Hfe).replaceAll(Kfe,"")}function Nyt(t){let e=Qqe(t);return Me.from(e,"base64")}function tUe(t){let e=t.toString("base64");return eUe(e)}function Cyt(t){return tUe(pf("sha256").update(Uint8Array.from(t)).digest())}function Wfe(t=32){let e=nE(t);return Array.from(e,r=>r.toString(16).padStart(2,"0")).join("").slice(0,t)}ie();ae();ne();function dP(t){try{return JSON.parse(t)}catch{return t}}var Pa=class{logger;processId;ao;constructor({processId:e,ao:r=vv(),logger:a=Fu.default}){this.processId=e,this.logger=a,this.ao=r}isMessageDataEmpty(e){return e===void 0||e==="null"||e===""||e===null}async read({tags:e,retries:r=3,fromAddress:a}){let i=0,h;for(;i<r;)try{this.logger.debug("Evaluating read interaction on contract",{tags:e});let l={process:this.processId,tags:e};a!==void 0&&(l.Owner=a);let p=await this.ao.dryrun(l);this.logger.debug("Read interaction result",{result:p});let b=Vfe(p);if(b!==void 0)throw new Error(b);if(p.Messages===void 0||p.Messages.length===0)throw this.logger.debug(`Process ${this.processId} does not support provided action.`,p,e),new Error(`Process ${this.processId} does not support provided action.`);let g=p.Messages?.[0]?.Data;return this.isMessageDataEmpty(g)?void 0:dP(p.Messages[0].Data)}catch(l){i++,this.logger.debug(`Read attempt ${i} failed`,{error:l instanceof Error?l.message:l,tags:e}),h=l,await new Promise(p=>setTimeout(p,2**i*1e3))}throw h}async send({tags:e,data:r,signer:a,retries:i=3}){let h=0,l;for(;h<i;)try{this.logger.debug("Evaluating send interaction on contract",{tags:e,data:r,processId:this.processId});let p=Wfe(32),b=await this.ao.message({process:this.processId,tags:[...e,{name:"AR-IO-SDK",value:W4}],data:r,signer:a,anchor:p});this.logger.debug("Sent message to process",{messageId:b,processId:this.processId,anchor:p});let g=await this.ao.result({message:b,process:this.processId});this.logger.debug("Message result",{output:g,messageId:b,processId:this.processId});let y=Vfe(g);if(y!==void 0)throw new U8(y);if(g.Messages?.length===0||g.Messages===void 0)return{id:b};if(g.Messages.length===0)throw new Error(`Process ${this.processId} does not support provided action.`);if(this.isMessageDataEmpty(g.Messages[0].Data))return{id:b};let M=dP(g.Messages[0].Data);return this.logger.debug("Message result data",{resultData:M,messageId:b,processId:this.processId}),{id:b,result:M}}catch(p){if(this.logger.error("Error sending message to process",{error:p.message,processId:this.processId,tags:e}),p.message.includes("500"))this.logger.debug("Retrying send interaction",{attempts:h,retries:i,error:p.message,processId:this.processId}),await new Promise(b=>setTimeout(b,2**h*2e3)),h++,l=p;else throw p}throw l}};function Vfe(t){let e=t.Error;if(e!==void 0)return e;let r=t.Messages?.[0]?.Tags?.find(a=>a.name==="Error")?.value;if(r!==void 0){let a=r.match(/\d+/)?.[0];return`${r.replace(/\[string "aos"\]:\d+:/,"")} (line ${a})`.trim()}}var Eb=class{static init(e){if(e&&e.signer){let{signer:r,...a}=e;return new pP({...a,signer:r})}return new Zw(e)}},Zw=class{process;epochSettings;constructor(e){if(!e)this.process=new Pa({processId:A1});else if(Dh(e))this.process=e.process;else if($h(e))this.process=new Pa({processId:e.processId});else throw new Nu}async getInfo(){return this.process.read({tags:[{name:"Action",value:"Info"}]})}async getTokenSupply(){return this.process.read({tags:[{name:"Action",value:"Total-Token-Supply"}]})}async computeEpochIndexForTimestamp(e){let r=await this.getEpochSettings(),a=r.epochZeroStartTimestamp,i=r.durationMs;return Math.floor((e-a)/i)}async computeEpochIndex(e){let r=e?.epochIndex;if(r!==void 0)return r.toString();let a=e?.timestamp;if(a!==void 0)return(await this.computeEpochIndexForTimestamp(a)).toString()}async getEpochSettings(){return this.epochSettings??=await this.process.read({tags:[{name:"Action",value:"Epoch-Settings"}]})}async getEpoch(e){let r=[{name:"Action",value:"Epoch"},{name:"Epoch-Index",value:await this.computeEpochIndex(e)}];return this.process.read({tags:En(r)})}async getArNSRecord({name:e}){return this.process.read({tags:[{name:"Action",value:"Record"},{name:"Name",value:e}]})}async getArNSRecords(e){return this.process.read({tags:[{name:"Action",value:"Paginated-Records"},...Oo(e)]})}async getArNSReservedNames(e){return this.process.read({tags:[{name:"Action",value:"Reserved-Names"},...Oo(e)]})}async getArNSReservedName({name:e}){return this.process.read({tags:[{name:"Action",value:"Reserved-Name"},{name:"Name",value:e}]})}async getBalance({address:e}){return this.process.read({tags:[{name:"Action",value:"Balance"},{name:"Address",value:e}]})}async getBalances(e){return this.process.read({tags:[{name:"Action",value:"Paginated-Balances"},...Oo(e)]})}async getVault({address:e,vaultId:r}){return this.process.read({tags:[{name:"Action",value:"Vault"},{name:"Address",value:e},{name:"Vault-Id",value:r}]})}async getVaults(e){return this.process.read({tags:[{name:"Action",value:"Paginated-Vaults"},...Oo(e)]})}async getGateway({address:e}){return this.process.read({tags:[{name:"Action",value:"Gateway"},{name:"Address",value:e}]})}async getGatewayDelegates({address:e,...r}){return this.process.read({tags:[{name:"Action",value:"Paginated-Delegates"},{name:"Address",value:e},...Oo(r)]})}async getGatewayDelegateAllowList({address:e,...r}){return this.process.read({tags:[{name:"Action",value:"Paginated-Allowed-Delegates"},{name:"Address",value:e},...Oo(r)]})}async getGateways(e){return this.process.read({tags:[{name:"Action",value:"Paginated-Gateways"},...Oo(e)]})}async getCurrentEpoch(){return this.process.read({tags:[{name:"Action",value:"Epoch"}]})}async getPrescribedObservers(e){let r=[{name:"Action",value:"Epoch-Prescribed-Observers"},{name:"Epoch-Index",value:await this.computeEpochIndex(e)}];return this.process.read({tags:En(r)})}async getPrescribedNames(e){let r=[{name:"Action",value:"Epoch-Prescribed-Names"},{name:"Epoch-Index",value:await this.computeEpochIndex(e)}];return this.process.read({tags:En(r)})}async getObservations(e){let r=[{name:"Action",value:"Epoch-Observations"},{name:"Epoch-Index",value:await this.computeEpochIndex(e)}];return this.process.read({tags:En(r)})}async getDistributions(e){let r=[{name:"Action",value:"Epoch-Distributions"},{name:"Epoch-Index",value:await this.computeEpochIndex(e)}];return this.process.read({tags:En(r)})}async getTokenCost({intent:e,type:r,years:a,name:i,quantity:h,fromAddress:l}){let p=[{name:"Action",value:"Token-Cost"},{name:"Intent",value:e},{name:"Name",value:i},{name:"Years",value:a?.toString()},{name:"Quantity",value:h?.toString()},{name:"Purchase-Type",value:r}];return this.process.read({tags:En(p),fromAddress:l})}async getCostDetails({intent:e,type:r,years:a,name:i,quantity:h,fromAddress:l,fundFrom:p}){let b=[{name:"Action",value:"Get-Cost-Details-For-Action"},{name:"Intent",value:e},{name:"Name",value:i},{name:"Years",value:a?.toString()},{name:"Quantity",value:h?.toString()},{name:"Purchase-Type",value:r},{name:"Fund-From",value:p}];return this.process.read({tags:En(b),fromAddress:l})}async getRegistrationFees(){return this.process.read({tags:[{name:"Action",value:"Get-Registration-Fees"}]})}async getDemandFactor(){return this.process.read({tags:[{name:"Action",value:"Demand-Factor"}]})}async getDemandFactorSettings(){return this.process.read({tags:[{name:"Action",value:"Demand-Factor-Settings"}]})}async getArNSReturnedNames(e){return this.process.read({tags:[{name:"Action",value:"Returned-Names"},...Oo(e)]})}async getArNSReturnedName({name:e}){let r=[{name:"Action",value:"Returned-Name"},{name:"Name",value:e}];return this.process.read({tags:r})}async getDelegations(e){let r=[{name:"Action",value:"Paginated-Delegations"},{name:"Address",value:e.address},...Oo(e)];return this.process.read({tags:En(r)})}async getAllowedDelegates(e){return this.getGatewayDelegateAllowList(e)}async getGatewayVaults(e){return this.process.read({tags:[{name:"Action",value:"Paginated-Gateway-Vaults"},{name:"Address",value:e.address},...Oo(e)]})}async getPrimaryNameRequest(e){let r=[{name:"Action",value:"Primary-Name-Request"},{name:"Initiator",value:e.initiator}];return this.process.read({tags:r})}async getPrimaryNameRequests(e){return this.process.read({tags:[{name:"Action",value:"Primary-Name-Requests"},...Oo(e)]})}async getPrimaryName(e){let r=[{name:"Action",value:"Primary-Name"},{name:"Address",value:e?.address},{name:"Name",value:e?.name}];return this.process.read({tags:En(r)})}async getPrimaryNames(e){return this.process.read({tags:[{name:"Action",value:"Primary-Names"},...Oo(e)]})}async getRedelegationFee(e){return this.process.read({tags:[{name:"Action",value:"Redelegation-Fee"},{name:"Address",value:e.address}]})}async getGatewayRegistrySettings(){return this.process.read({tags:[{name:"Action",value:"Gateway-Registry-Settings"}]})}},pP=class extends Zw{signer;constructor({signer:e,...r}){if(Object.keys(r).length===0)super({process:new Pa({processId:A1})}),this.signer=Bc(e);else if(Dh(r))super({process:r.process}),this.signer=Bc(e);else if($h(r))super({process:new Pa({processId:r.processId})}),this.signer=Bc(e);else throw new Nu}async transfer({target:e,qty:r},a){let{tags:i=[]}=a||{};return this.process.send({tags:[...i,{name:"Action",value:"Transfer"},{name:"Recipient",value:e},{name:"Quantity",value:r.valueOf().toString()}],signer:this.signer})}async joinNetwork({operatorStake:e,allowDelegatedStaking:r,allowedDelegates:a,delegateRewardShareRatio:i,fqdn:h,label:l,minDelegatedStake:p,note:b,port:g,properties:y,protocol:M,autoStake:x,observerAddress:E},A){let{tags:k=[]}=A||{},P=[...k,{name:"Action",value:"Join-Network"},{name:"Operator-Stake",value:e.valueOf().toString()},{name:"Allow-Delegated-Staking",value:r?.toString()},{name:"Allowed-Delegates",value:a?.join(",")},{name:"Delegate-Reward-Share-Ratio",value:i?.toString()},{name:"FQDN",value:h},{name:"Label",value:l},{name:"Min-Delegated-Stake",value:p?.valueOf().toString()},{name:"Note",value:b},{name:"Port",value:g?.toString()},{name:"Properties",value:y},{name:"Protocol",value:M},{name:"Auto-Stake",value:x?.toString()},{name:"Observer-Address",value:E}];return this.process.send({signer:this.signer,tags:En(P)})}async leaveNetwork(e){let{tags:r=[]}=e||{};return this.process.send({signer:this.signer,tags:[...r,{name:"Action",value:"Leave-Network"}]})}async updateGatewaySettings({allowDelegatedStaking:e,allowedDelegates:r,delegateRewardShareRatio:a,fqdn:i,label:h,minDelegatedStake:l,note:p,port:b,properties:g,protocol:y,autoStake:M,observerAddress:x},E){let{tags:A=[]}=E||{},k=[...A,{name:"Action",value:"Update-Gateway-Settings"},{name:"Label",value:h},{name:"Note",value:p},{name:"FQDN",value:i},{name:"Port",value:b?.toString()},{name:"Properties",value:g},{name:"Protocol",value:y},{name:"Observer-Address",value:x},{name:"Allow-Delegated-Staking",value:e?.toString()},{name:"Allowed-Delegates",value:r?.join(",")},{name:"Delegate-Reward-Share-Ratio",value:a?.toString()},{name:"Min-Delegated-Stake",value:l?.valueOf().toString()},{name:"Auto-Stake",value:M?.toString()}];return this.process.send({signer:this.signer,tags:En(k)})}async delegateStake(e,r){let{tags:a=[]}=r||{};return this.process.send({signer:this.signer,tags:[...a,{name:"Action",value:"Delegate-Stake"},{name:"Target",value:e.target},{name:"Quantity",value:e.stakeQty.valueOf().toString()}]})}async decreaseDelegateStake(e,r){let{tags:a=[]}=r||{};return this.process.send({signer:this.signer,tags:[...a,{name:"Action",value:"Decrease-Delegate-Stake"},{name:"Target",value:e.target},{name:"Quantity",value:e.decreaseQty.valueOf().toString()},{name:"Instant",value:`${e.instant||!1}`}]})}async instantWithdrawal(e,r){let{tags:a=[]}=r||{},i=[...a,{name:"Action",value:"Instant-Withdrawal"},{name:"Vault-Id",value:e.vaultId},{name:"Address",value:e.gatewayAddress}];return this.process.send({signer:this.signer,tags:En(i)})}async increaseOperatorStake(e,r){let{tags:a=[]}=r||{};return this.process.send({signer:this.signer,tags:[...a,{name:"Action",value:"Increase-Operator-Stake"},{name:"Quantity",value:e.increaseQty.valueOf().toString()}]})}async decreaseOperatorStake(e,r){let{tags:a=[]}=r||{};return this.process.send({signer:this.signer,tags:[...a,{name:"Action",value:"Decrease-Operator-Stake"},{name:"Quantity",value:e.decreaseQty.valueOf().toString()},{name:"Instant",value:`${e.instant||!1}`}]})}async saveObservations(e,r){let{tags:a=[]}=r||{};return this.process.send({signer:this.signer,tags:[...a,{name:"Action",value:"Save-Observations"},{name:"Report-Tx-Id",value:e.reportTxId},{name:"Failed-Gateways",value:e.failedGateways.join(",")}]})}async buyRecord(e,r){let{tags:a=[]}=r||{},i=[...a,{name:"Action",value:"Buy-Record"},{name:"Name",value:e.name},{name:"Years",value:e.years?.toString()??"1"},{name:"Process-Id",value:e.processId},{name:"Purchase-Type",value:e.type||"lease"},{name:"Fund-From",value:e.fundFrom}];return this.process.send({signer:this.signer,tags:En(i)})}async upgradeRecord(e,r){let{tags:a=[]}=r||{},i=[...a,{name:"Action",value:"Upgrade-Name"},{name:"Name",value:e.name},{name:"Fund-From",value:e.fundFrom}];return this.process.send({signer:this.signer,tags:En(i)})}async extendLease(e,r){let{tags:a=[]}=r||{},i=[...a,{name:"Action",value:"Extend-Lease"},{name:"Name",value:e.name},{name:"Years",value:e.years.toString()},{name:"Fund-From",value:e.fundFrom}];return this.process.send({signer:this.signer,tags:En(i)})}async increaseUndernameLimit(e,r){let{tags:a=[]}=r||{},i=[...a,{name:"Action",value:"Increase-Undername-Limit"},{name:"Name",value:e.name},{name:"Quantity",value:e.increaseCount.toString()},{name:"Fund-From",value:e.fundFrom}];return this.process.send({signer:this.signer,tags:En(i)})}async cancelWithdrawal(e,r){let{tags:a=[]}=r||{},i=[...a,{name:"Action",value:"Cancel-Withdrawal"},{name:"Vault-Id",value:e.vaultId},{name:"Address",value:e.gatewayAddress}];return this.process.send({signer:this.signer,tags:En(i)})}async requestPrimaryName(e,r){let{tags:a=[]}=r||{},i=[...a,{name:"Action",value:"Request-Primary-Name"},{name:"Name",value:e.name}];return this.process.send({signer:this.signer,tags:En(i)})}async redelegateStake(e,r){let{tags:a=[]}=r||{},i=[...a,{name:"Action",value:"Redelegate-Stake"},{name:"Target",value:e.target},{name:"Source",value:e.source},{name:"Quantity",value:e.stakeQty.valueOf().toString()},{name:"Vault-Id",value:e.vaultId}];return this.process.send({signer:this.signer,tags:En(i)})}};ie();ae();ne();ie();ae();ne();ie();ae();ne();var mP=gi(Yfe(),1);ie();ae();ne();var nUe=Object.defineProperty,aUe=(t,e,r)=>e in t?nUe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,Rb=(t,e,r)=>(aUe(t,typeof e!="symbol"?e+"":e,r),r),gP=class{constructor(e){Rb(this,"value"),Rb(this,"next"),this.value=e}},bP=class{constructor(){Rb(this,"head"),Rb(this,"tail"),Rb(this,"_size",0),this.clear()}clear(){this.head=void 0,this.tail=void 0,this._size=0}push(e){let r=new gP(e);return this.head&&this.tail?(this.tail.next=r,this.tail=r):(this.head=r,this.tail=r),this._size++,this._size}pop(){if(!this.head)return;let e=this.head;return this.head=this.head.next,this._size--,e.value}get size(){return this._size}*[Symbol.iterator](){let e=this.head;for(;e;)yield e.value,e=e.next}};function Jfe(t){if(!((Number.isInteger(t)||t===1/0)&&t>0))throw new TypeError("Expected `concurrency` to be a number greater than 1");let e=new bP,r=0,a=()=>{r--,e.size>0&&e.pop()()},i=async(p,b,g)=>{r++;let y=(async()=>p(...g))();b(y);try{await y}catch{}a()},h=(p,b,g)=>{e.push(i.bind(null,p,b,g)),(async()=>(await Promise.resolve(),r<t&&e.size>0&&e.pop()()))()},l=(p,...b)=>new Promise(g=>{h(p,g,b)});return Object.defineProperties(l,{activeCount:{get:()=>r},pendingCount:{get:()=>e.size},clearQueue:{value:()=>{e.clear()}}}),l}var l3t=async({address:t,registry:e=Hd.init()})=>{let r=await e.accessControlList({address:t});return[...new Set([...r.Owned,...r.Controlled])]};function Xfe(t,e){return new Promise((r,a)=>{let i=setTimeout(()=>{a(new Error("Timeout"))},t);e.then(h=>{clearTimeout(i),r(h)}).catch(h=>{clearTimeout(i),a(h)})})}var Qfe=class extends mP.default{contract;timeoutMs;throttle;logger;strict;constructor({contract:e=Eb.init({processId:A1}),timeoutMs:r=6e4,concurrency:a=30,logger:i=Fu.default,strict:h=!1}={}){super(),this.contract=e,this.timeoutMs=r,this.throttle=Jfe(a),this.logger=i,this.strict=h}async fetchProcessesOwnedByWallet({address:e,pageSize:r,antRegistry:a=Hd.init()}){let i={},h=await a.accessControlList({address:e}),l=new Set([...h.Owned,...h.Controlled]);await Xfe(this.timeoutMs,oUe({contract:this.contract,emitter:this,pageSize:r})).catch(b=>(this.emit("error",`Error getting ArNS records: ${b}`),this.logger.error("Error getting ArNS records",{message:b?.message,stack:b?.stack}),{})).then(b=>{Object.entries(b).forEach(([g,y])=>{l.has(y.processId)&&(i[y.processId]==null&&(i[y.processId]={state:void 0,names:{}}),i[y.processId].names[g]=y)})});let p=Object.keys(i).length;this.emit("progress",0,p),await Promise.all(Object.keys(i).map(async(b,g)=>this.throttle(async()=>{if(i[b].state!==void 0){this.emit("progress",g+1,p);return}let y=Fw.init({processId:b,strict:this.strict}),M=await Xfe(this.timeoutMs,y.getState()).catch(x=>{this.emit("error",`Error getting state for process ${b}: ${x}`)});(M?.Owner===e||M?.Controllers.includes(e))&&(i[b].state=M,this.emit("process",b,i[b])),this.emit("progress",g+1,p)}))),this.emit("end",i)}},oUe=async({contract:t=Eb.init({processId:A1}),emitter:e,logger:r=Fu.default,pageSize:a=5e4})=>{let i,h=Date.now(),l={};do{let p=await t.getArNSRecords({cursor:i,limit:a}).catch(b=>{r?.error("Error getting ArNS records",{message:b?.message,stack:b?.stack}),e?.emit("arns:error",`Error getting ArNS records: ${b}`)});if(!p)return{};p.items.forEach(b=>{let{name:g,...y}=b;l[g]=y}),r.debug("Fetched page of ArNS records",{totalRecordCount:p.totalItems,fetchedRecordCount:Object.keys(l).length,cursor:p.nextCursor}),e?.emit("arns:pageLoaded",{totalRecordCount:p.totalItems,fetchedRecordCount:Object.keys(l).length,records:p.items,cursor:p.nextCursor}),i=p.nextCursor}while(i!==void 0);return e?.emit("arns:end",l),r.debug("Fetched all ArNS records",{totalRecordCount:Object.keys(l).length,durationMs:Date.now()-h}),l};export{Fw as ANT,Hd as ANTRegistry,gT as ANT_LUA_ID,$8 as ANT_REGISTRY_ID,Pa as AOProcess,aQ as AOS_MODULE_ID,Eb as ARIO,Zw as ARIOReadable,xT as ARIOToken,pP as ARIOWriteable,r5e as ARIO_DEVNET_PROCESS_ID,A1 as ARIO_TESTNET_PROCESS_ID,qft as ARNS_DEVNET_REGISTRY_TX,$ft as ARNS_TESTNET_REGISTRY_TX,D8 as ARWEAVE_TX_REGEX,bQ as AbortError,wT as AntBalancesSchema,yT as AntControllersSchema,i5e as AntDescriptionSchema,o5e as AntHandlerNames,fQ as AntHandlersSchema,hQ as AntInfoSchema,uQ as AntKeywordsSchema,n5e as AntReadHandlers,q8 as AntRecordSchema,bT as AntRecordsSchema,_T as AntStateSchema,a5e as AntWriteHandlers,jw as AoANTReadable,zw as AoANTRegistryReadable,cP as AoANTRegistryWriteable,lP as AoANTWriteable,Qfe as ArNSEventEmitter,v1 as ArconnectSigner,Hl as ArweaveSigner,gd as ArweaveTxIdSchema,dQ as BadRequest,kf as BaseError,oQ as DEFAULT_SCHEDULER_ID,Lft as FQDN_REGEX,pQ as FailedRequestError,sQ as IntegerStringSchema,Nu as InvalidContractConfigurationError,gQ as InvalidProcessConfigurationError,mQ as InvalidSignerError,Fu as Logger,mT as MARIO_PER_ARIO,cQ as NotFound,Dft as SORT_KEY_REGEX,vQ as UnknownError,U8 as WriteInteractionError,Uft as arioDevnetProcessId,Bc as createAoSigner,Xqe as defaultTargetManifestId,Ubt as evolveANT,oUe as fetchAllArNSRecords,Nyt as fromB64Url,f5e as fundFromOptions,l3t as getANTProcessesOwnedByWallet,Wfe as getRandomText,Fbt as initANTStateForAddress,fut as intentsUsingYears,Wft as isAoANTState,Jqe as isAoSigner,rut as isBlockHeight,lut as isLeasedArNSRecord,Dh as isProcessConfiguration,$h as isProcessIdConfiguration,hut as isValidFundFrom,uut as isValidIntent,ST as mARIOToken,Oo as paginationParamsToTags,Pc as parseSchemaResult,En as pruneTags,dP as safeDecode,Cyt as sha256B64Url,qbt as spawnANT,tUe as toB64Url,s5e as validIntents,lQ as validateArweaveId};
188
188
  /*! Bundled license information:
189
189
 
190
190
  @jspm/core/nodelibs/browser/buffer.js: