@elizaos/plugin-elizacloud 2.0.0-alpha.5 → 2.0.0-alpha.537
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.
- package/LICENSE +21 -0
- package/README.md +185 -0
- package/dist/actions/check-credits.d.ts.map +1 -1
- package/dist/actions/confirmation.d.ts +7 -0
- package/dist/actions/confirmation.d.ts.map +1 -0
- package/dist/actions/freeze-agent.d.ts.map +1 -1
- package/dist/actions/provision-agent.d.ts.map +1 -1
- package/dist/actions/resume-agent.d.ts.map +1 -1
- package/dist/browser/index.browser.js +22 -19
- package/dist/browser/index.browser.js.map +37 -31
- package/dist/cjs/index.node.cjs +1298 -451
- package/dist/cjs/index.node.js.map +37 -31
- package/dist/cloud-providers/cloud-status.d.ts.map +1 -1
- package/dist/cloud-providers/container-health.d.ts.map +1 -1
- package/dist/cloud-providers/credit-balance.d.ts.map +1 -1
- package/dist/cloud-providers/model-registry.d.ts.map +1 -1
- package/dist/index.browser.d.ts +2 -1
- package/dist/index.browser.d.ts.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.node.d.ts +2 -1
- package/dist/index.node.d.ts.map +1 -1
- package/dist/init.d.ts.map +1 -1
- package/dist/models/embeddings.d.ts.map +1 -1
- package/dist/models/image.d.ts.map +1 -1
- package/dist/models/index.d.ts +1 -1
- package/dist/models/index.d.ts.map +1 -1
- package/dist/models/object.d.ts.map +1 -1
- package/dist/models/research.d.ts.map +1 -1
- package/dist/models/speech.d.ts.map +1 -1
- package/dist/models/text.d.ts +5 -2
- package/dist/models/text.d.ts.map +1 -1
- package/dist/models/tokenization.d.ts.map +1 -1
- package/dist/models/transcription.d.ts.map +1 -1
- package/dist/node/index.node.js +1280 -428
- package/dist/node/index.node.js.map +37 -31
- package/dist/providers/openai.d.ts.map +1 -1
- package/dist/services/cloud-auth.d.ts +140 -4
- package/dist/services/cloud-auth.d.ts.map +1 -1
- package/dist/services/cloud-backup.d.ts.map +1 -1
- package/dist/services/cloud-bootstrap.d.ts +38 -0
- package/dist/services/cloud-bootstrap.d.ts.map +1 -0
- package/dist/services/cloud-bridge.d.ts +1 -1
- package/dist/services/cloud-bridge.d.ts.map +1 -1
- package/dist/services/cloud-container.d.ts.map +1 -1
- package/dist/services/cloud-managed-gateway-relay.d.ts +38 -0
- package/dist/services/cloud-managed-gateway-relay.d.ts.map +1 -0
- package/dist/services/cloud-model-registry.d.ts +0 -1
- package/dist/services/cloud-model-registry.d.ts.map +1 -1
- package/dist/types/cloud.d.ts +41 -19
- package/dist/types/cloud.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/utils/cloud-api.d.ts +2 -27
- package/dist/utils/cloud-api.d.ts.map +1 -1
- package/dist/utils/config.d.ts +6 -3
- package/dist/utils/config.d.ts.map +1 -1
- package/dist/utils/events.d.ts.map +1 -1
- package/dist/utils/forwarded-settings.d.ts +1 -1
- package/dist/utils/forwarded-settings.d.ts.map +1 -1
- package/dist/utils/helpers.d.ts.map +1 -1
- package/dist/utils/responses-output.d.ts +6 -0
- package/dist/utils/responses-output.d.ts.map +1 -0
- package/dist/utils/sdk-client.d.ts +5 -0
- package/dist/utils/sdk-client.d.ts.map +1 -0
- package/package.json +84 -16
- package/types/cloud.ts +54 -41
- package/types/index.ts +6 -0
- package/dist/actions/index.d.ts +0 -5
- package/dist/actions/index.d.ts.map +0 -1
- package/dist/build.d.ts +0 -3
- package/dist/build.d.ts.map +0 -1
- package/dist/cloud-providers/index.d.ts +0 -4
- package/dist/cloud-providers/index.d.ts.map +0 -1
- package/dist/generated/specs/specs.d.ts +0 -55
- package/dist/generated/specs/specs.d.ts.map +0 -1
- package/dist/services/index.d.ts +0 -5
- package/dist/services/index.d.ts.map +0 -1
|
@@ -1,22 +1,25 @@
|
|
|
1
|
-
var zY=Object.create;var{getPrototypeOf:MY,defineProperty:LO,getOwnPropertyNames:CX,getOwnPropertyDescriptor:qY}=Object,KX=Object.prototype.hasOwnProperty;var PY=(Q,$,V)=>{V=Q!=null?zY(MY(Q)):{};let W=$||!Q||!Q.__esModule?LO(V,"default",{value:Q,enumerable:!0}):V;for(let C of CX(Q))if(!KX.call(W,C))LO(W,C,{get:()=>Q[C],enumerable:!0});return W},IX=new WeakMap,h0=(Q)=>{var $=IX.get(Q),V;if($)return $;if($=LO({},"__esModule",{value:!0}),Q&&typeof Q==="object"||typeof Q==="function")CX(Q).map((W)=>!KX.call($,W)&&LO($,W,{get:()=>Q[W],enumerable:!(V=qY(Q,W))||V.enumerable}));return IX.set(Q,$),$},kY=(Q,$)=>()=>($||Q(($={exports:{}}).exports,$),$.exports);var WO=(Q,$)=>{for(var V in $)LO(Q,V,{get:$[V],enumerable:!0,configurable:!0,set:(W)=>$[V]=()=>W})};var HO=(Q,$)=>()=>(Q&&($=Q(Q=0)),$);var _Y=((Q)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(Q,{get:($,V)=>(typeof require<"u"?require:$)[V]}):Q)(function(Q){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+Q+'" is not supported')});var WU={};WO(WU,{transcode:()=>qA,resolveObjectURL:()=>TA,kStringMaxLength:()=>mX,kMaxLength:()=>FO,isUtf8:()=>zA,isAscii:()=>MA,default:()=>PA,constants:()=>rY,btoa:()=>nY,atob:()=>mY,INSPECT_MAX_BYTES:()=>nX,File:()=>sY,Buffer:()=>G0,Blob:()=>tY});function uY(Q){var $=Q.length;if($%4>0)throw Error("Invalid string. Length must be a multiple of 4");var V=Q.indexOf("=");if(V===-1)V=$;var W=V===$?0:4-V%4;return[V,W]}function bY(Q,$){return(Q+$)*3/4-$}function lY(Q){var $,V=uY(Q),W=V[0],C=V[1],F=new Uint8Array(bY(W,C)),A=0,z=C>0?W-4:W,M;for(M=0;M<z;M+=4)$=fU[Q.charCodeAt(M)]<<18|fU[Q.charCodeAt(M+1)]<<12|fU[Q.charCodeAt(M+2)]<<6|fU[Q.charCodeAt(M+3)],F[A++]=$>>16&255,F[A++]=$>>8&255,F[A++]=$&255;if(C===2)$=fU[Q.charCodeAt(M)]<<2|fU[Q.charCodeAt(M+1)]>>4,F[A++]=$&255;if(C===1)$=fU[Q.charCodeAt(M)]<<10|fU[Q.charCodeAt(M+1)]<<4|fU[Q.charCodeAt(M+2)]>>2,F[A++]=$>>8&255,F[A++]=$&255;return F}function dY(Q){return uU[Q>>18&63]+uU[Q>>12&63]+uU[Q>>6&63]+uU[Q&63]}function oY(Q,$,V){var W,C=[];for(var F=$;F<V;F+=3)W=(Q[F]<<16&16711680)+(Q[F+1]<<8&65280)+(Q[F+2]&255),C.push(dY(W));return C.join("")}function hX(Q){var $,V=Q.length,W=V%3,C=[],F=16383;for(var A=0,z=V-W;A<z;A+=F)C.push(oY(Q,A,A+F>z?z:A+F));if(W===1)$=Q[V-1],C.push(uU[$>>2]+uU[$<<4&63]+"==");else if(W===2)$=(Q[V-2]<<8)+Q[V-1],C.push(uU[$>>10]+uU[$>>4&63]+uU[$<<2&63]+"=");return C.join("")}function cO(Q,$,V,W,C){var F,A,z=C*8-W-1,M=(1<<z)-1,S=M>>1,R=-7,L=V?C-1:0,H=V?-1:1,q=Q[$+L];L+=H,F=q&(1<<-R)-1,q>>=-R,R+=z;for(;R>0;F=F*256+Q[$+L],L+=H,R-=8);A=F&(1<<-R)-1,F>>=-R,R+=W;for(;R>0;A=A*256+Q[$+L],L+=H,R-=8);if(F===0)F=1-S;else if(F===M)return A?NaN:(q?-1:1)*(1/0);else A=A+Math.pow(2,W),F=F-S;return(q?-1:1)*A*Math.pow(2,F-W)}function oX(Q,$,V,W,C,F){var A,z,M,S=F*8-C-1,R=(1<<S)-1,L=R>>1,H=C===23?Math.pow(2,-24)-Math.pow(2,-77):0,q=W?0:F-1,P=W?1:-1,_=$<0||$===0&&1/$<0?1:0;if($=Math.abs($),isNaN($)||$===1/0)z=isNaN($)?1:0,A=R;else{if(A=Math.floor(Math.log($)/Math.LN2),$*(M=Math.pow(2,-A))<1)A--,M*=2;if(A+L>=1)$+=H/M;else $+=H*Math.pow(2,1-L);if($*M>=2)A++,M/=2;if(A+L>=R)z=0,A=R;else if(A+L>=1)z=($*M-1)*Math.pow(2,C),A=A+L;else z=$*Math.pow(2,L-1)*Math.pow(2,C),A=0}for(;C>=8;Q[V+q]=z&255,q+=P,z/=256,C-=8);A=A<<C|z,S+=C;for(;S>0;Q[V+q]=A&255,q+=P,A/=256,S-=8);Q[V+q-P]|=_*128}function oU(Q){if(Q>FO)throw RangeError('The value "'+Q+'" is invalid for option "size"');let $=new Uint8Array(Q);return Object.setPrototypeOf($,G0.prototype),$}function RZ(Q,$,V){return class extends V{constructor(){super();Object.defineProperty(this,"message",{value:$.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${Q}]`,this.stack,delete this.name}get code(){return Q}set code(W){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:W,writable:!0})}toString(){return`${this.name} [${Q}]: ${this.message}`}}}function G0(Q,$,V){if(typeof Q==="number"){if(typeof $==="string")throw TypeError('The "string" argument must be of type string. Received type number');return TZ(Q)}return sX(Q,$,V)}function sX(Q,$,V){if(typeof Q==="string")return UA(Q,$);if(ArrayBuffer.isView(Q))return OA(Q);if(Q==null)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof Q);if(bU(Q,ArrayBuffer)||Q&&bU(Q.buffer,ArrayBuffer))return SZ(Q,$,V);if(typeof SharedArrayBuffer<"u"&&(bU(Q,SharedArrayBuffer)||Q&&bU(Q.buffer,SharedArrayBuffer)))return SZ(Q,$,V);if(typeof Q==="number")throw TypeError('The "value" argument must not be of type number. Received type number');let W=Q.valueOf&&Q.valueOf();if(W!=null&&W!==Q)return G0.from(W,$,V);let C=ZA(Q);if(C)return C;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof Q[Symbol.toPrimitive]==="function")return G0.from(Q[Symbol.toPrimitive]("string"),$,V);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof Q)}function tX(Q){if(typeof Q!=="number")throw TypeError('"size" argument must be of type number');else if(Q<0)throw RangeError('The value "'+Q+'" is invalid for option "size"')}function iY(Q,$,V){if(tX(Q),Q<=0)return oU(Q);if($!==void 0)return typeof V==="string"?oU(Q).fill($,V):oU(Q).fill($);return oU(Q)}function TZ(Q){return tX(Q),oU(Q<0?0:zZ(Q)|0)}function UA(Q,$){if(typeof $!=="string"||$==="")$="utf8";if(!G0.isEncoding($))throw TypeError("Unknown encoding: "+$);let V=rX(Q,$)|0,W=oU(V),C=W.write(Q,$);if(C!==V)W=W.slice(0,C);return W}function DZ(Q){let $=Q.length<0?0:zZ(Q.length)|0,V=oU($);for(let W=0;W<$;W+=1)V[W]=Q[W]&255;return V}function OA(Q){if(bU(Q,Uint8Array)){let $=new Uint8Array(Q);return SZ($.buffer,$.byteOffset,$.byteLength)}return DZ(Q)}function SZ(Q,$,V){if($<0||Q.byteLength<$)throw RangeError('"offset" is outside of buffer bounds');if(Q.byteLength<$+(V||0))throw RangeError('"length" is outside of buffer bounds');let W;if($===void 0&&V===void 0)W=new Uint8Array(Q);else if(V===void 0)W=new Uint8Array(Q,$);else W=new Uint8Array(Q,$,V);return Object.setPrototypeOf(W,G0.prototype),W}function ZA(Q){if(G0.isBuffer(Q)){let $=zZ(Q.length)|0,V=oU($);if(V.length===0)return V;return Q.copy(V,0,0,$),V}if(Q.length!==void 0){if(typeof Q.length!=="number"||Number.isNaN(Q.length))return oU(0);return DZ(Q)}if(Q.type==="Buffer"&&Array.isArray(Q.data))return DZ(Q.data)}function zZ(Q){if(Q>=FO)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+FO.toString(16)+" bytes");return Q|0}function rX(Q,$){if(G0.isBuffer(Q))return Q.length;if(ArrayBuffer.isView(Q)||bU(Q,ArrayBuffer))return Q.byteLength;if(typeof Q!=="string")throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof Q);let V=Q.length,W=arguments.length>2&&arguments[2]===!0;if(!W&&V===0)return 0;let C=!1;for(;;)switch($){case"ascii":case"latin1":case"binary":return V;case"utf8":case"utf-8":return FZ(Q).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return V*2;case"hex":return V>>>1;case"base64":return YQ(Q).length;default:if(C)return W?-1:FZ(Q).length;$=(""+$).toLowerCase(),C=!0}}function XA(Q,$,V){let W=!1;if($===void 0||$<0)$=0;if($>this.length)return"";if(V===void 0||V>this.length)V=this.length;if(V<=0)return"";if(V>>>=0,$>>>=0,V<=$)return"";if(!Q)Q="utf8";while(!0)switch(Q){case"hex":return CA(this,$,V);case"utf8":case"utf-8":return eX(this,$,V);case"ascii":return EA(this,$,V);case"latin1":case"binary":return IA(this,$,V);case"base64":return GA(this,$,V);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return KA(this,$,V);default:if(W)throw TypeError("Unknown encoding: "+Q);Q=(Q+"").toLowerCase(),W=!0}}function QO(Q,$,V){let W=Q[$];Q[$]=Q[V],Q[V]=W}function aX(Q,$,V,W,C){if(Q.length===0)return-1;if(typeof V==="string")W=V,V=0;else if(V>2147483647)V=2147483647;else if(V<-2147483648)V=-2147483648;if(V=+V,Number.isNaN(V))V=C?0:Q.length-1;if(V<0)V=Q.length+V;if(V>=Q.length)if(C)return-1;else V=Q.length-1;else if(V<0)if(C)V=0;else return-1;if(typeof $==="string")$=G0.from($,W);if(G0.isBuffer($)){if($.length===0)return-1;return bX(Q,$,V,W,C)}else if(typeof $==="number"){if($=$&255,typeof Uint8Array.prototype.indexOf==="function")if(C)return Uint8Array.prototype.indexOf.call(Q,$,V);else return Uint8Array.prototype.lastIndexOf.call(Q,$,V);return bX(Q,[$],V,W,C)}throw TypeError("val must be string, number or Buffer")}function bX(Q,$,V,W,C){let F=1,A=Q.length,z=$.length;if(W!==void 0){if(W=String(W).toLowerCase(),W==="ucs2"||W==="ucs-2"||W==="utf16le"||W==="utf-16le"){if(Q.length<2||$.length<2)return-1;F=2,A/=2,z/=2,V/=2}}function M(R,L){if(F===1)return R[L];else return R.readUInt16BE(L*F)}let S;if(C){let R=-1;for(S=V;S<A;S++)if(M(Q,S)===M($,R===-1?0:S-R)){if(R===-1)R=S;if(S-R+1===z)return R*F}else{if(R!==-1)S-=S-R;R=-1}}else{if(V+z>A)V=A-z;for(S=V;S>=0;S--){let R=!0;for(let L=0;L<z;L++)if(M(Q,S+L)!==M($,L)){R=!1;break}if(R)return S}}return-1}function QA(Q,$,V,W){V=Number(V)||0;let C=Q.length-V;if(!W)W=C;else if(W=Number(W),W>C)W=C;let F=$.length;if(W>F/2)W=F/2;let A;for(A=0;A<W;++A){let z=parseInt($.substr(A*2,2),16);if(Number.isNaN(z))return A;Q[V+A]=z}return A}function YA(Q,$,V,W){return pO(FZ($,Q.length-V),Q,V,W)}function AA(Q,$,V,W){return pO(DA($),Q,V,W)}function $A(Q,$,V,W){return pO(YQ($),Q,V,W)}function JA(Q,$,V,W){return pO(SA($,Q.length-V),Q,V,W)}function GA(Q,$,V){if($===0&&V===Q.length)return hX(Q);else return hX(Q.slice($,V))}function eX(Q,$,V){V=Math.min(Q.length,V);let W=[],C=$;while(C<V){let F=Q[C],A=null,z=F>239?4:F>223?3:F>191?2:1;if(C+z<=V){let M,S,R,L;switch(z){case 1:if(F<128)A=F;break;case 2:if(M=Q[C+1],(M&192)===128){if(L=(F&31)<<6|M&63,L>127)A=L}break;case 3:if(M=Q[C+1],S=Q[C+2],(M&192)===128&&(S&192)===128){if(L=(F&15)<<12|(M&63)<<6|S&63,L>2047&&(L<55296||L>57343))A=L}break;case 4:if(M=Q[C+1],S=Q[C+2],R=Q[C+3],(M&192)===128&&(S&192)===128&&(R&192)===128){if(L=(F&15)<<18|(M&63)<<12|(S&63)<<6|R&63,L>65535&&L<1114112)A=L}}}if(A===null)A=65533,z=1;else if(A>65535)A-=65536,W.push(A>>>10&1023|55296),A=56320|A&1023;W.push(A),C+=z}return VA(W)}function VA(Q){let $=Q.length;if($<=lX)return String.fromCharCode.apply(String,Q);let V="",W=0;while(W<$)V+=String.fromCharCode.apply(String,Q.slice(W,W+=lX));return V}function EA(Q,$,V){let W="";V=Math.min(Q.length,V);for(let C=$;C<V;++C)W+=String.fromCharCode(Q[C]&127);return W}function IA(Q,$,V){let W="";V=Math.min(Q.length,V);for(let C=$;C<V;++C)W+=String.fromCharCode(Q[C]);return W}function CA(Q,$,V){let W=Q.length;if(!$||$<0)$=0;if(!V||V<0||V>W)V=W;let C="";for(let F=$;F<V;++F)C+=FA[Q[F]];return C}function KA(Q,$,V){let W=Q.slice($,V),C="";for(let F=0;F<W.length-1;F+=2)C+=String.fromCharCode(W[F]+W[F+1]*256);return C}function LU(Q,$,V){if(Q%1!==0||Q<0)throw RangeError("offset is not uint");if(Q+$>V)throw RangeError("Trying to access beyond buffer length")}function kU(Q,$,V,W,C,F){if(!G0.isBuffer(Q))throw TypeError('"buffer" argument must be a Buffer instance');if($>C||$<F)throw RangeError('"value" argument is out of bounds');if(V+W>Q.length)throw RangeError("Index out of range")}function iX(Q,$,V,W,C){QQ($,W,C,Q,V,7);let F=Number($&BigInt(4294967295));Q[V++]=F,F=F>>8,Q[V++]=F,F=F>>8,Q[V++]=F,F=F>>8,Q[V++]=F;let A=Number($>>BigInt(32)&BigInt(4294967295));return Q[V++]=A,A=A>>8,Q[V++]=A,A=A>>8,Q[V++]=A,A=A>>8,Q[V++]=A,V}function UQ(Q,$,V,W,C){QQ($,W,C,Q,V,7);let F=Number($&BigInt(4294967295));Q[V+7]=F,F=F>>8,Q[V+6]=F,F=F>>8,Q[V+5]=F,F=F>>8,Q[V+4]=F;let A=Number($>>BigInt(32)&BigInt(4294967295));return Q[V+3]=A,A=A>>8,Q[V+2]=A,A=A>>8,Q[V+1]=A,A=A>>8,Q[V]=A,V+8}function OQ(Q,$,V,W,C,F){if(V+W>Q.length)throw RangeError("Index out of range");if(V<0)throw RangeError("Index out of range")}function ZQ(Q,$,V,W,C){if($=+$,V=V>>>0,!C)OQ(Q,$,V,4,340282346638528860000000000000000000000,-340282346638528860000000000000000000000);return oX(Q,$,V,W,23,4),V+4}function XQ(Q,$,V,W,C){if($=+$,V=V>>>0,!C)OQ(Q,$,V,8,179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000,-179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000);return oX(Q,$,V,W,52,8),V+8}function dX(Q){let $="",V=Q.length,W=Q[0]==="-"?1:0;for(;V>=W+4;V-=3)$=`_${Q.slice(V-3,V)}${$}`;return`${Q.slice(0,V)}${$}`}function LA(Q,$,V){if(GO($,"offset"),Q[$]===void 0||Q[$+V]===void 0)RO($,Q.length-(V+1))}function QQ(Q,$,V,W,C,F){if(Q>V||Q<$){let A=typeof $==="bigint"?"n":"",z;if(F>3)if($===0||$===BigInt(0))z=`>= 0${A} and < 2${A} ** ${(F+1)*8}${A}`;else z=`>= -(2${A} ** ${(F+1)*8-1}${A}) and < 2 ** ${(F+1)*8-1}${A}`;else z=`>= ${$}${A} and <= ${V}${A}`;throw new HZ("value",z,Q)}LA(W,C,F)}function GO(Q,$){if(typeof Q!=="number")throw new eY($,"number",Q)}function RO(Q,$,V){if(Math.floor(Q)!==Q)throw GO(Q,V),new HZ(V||"offset","an integer",Q);if($<0)throw new aY;throw new HZ(V||"offset",`>= ${V?1:0} and <= ${$}`,Q)}function HA(Q){if(Q=Q.split("=")[0],Q=Q.trim().replace(WA,""),Q.length<2)return"";while(Q.length%4!==0)Q=Q+"=";return Q}function FZ(Q,$){$=$||1/0;let V,W=Q.length,C=null,F=[];for(let A=0;A<W;++A){if(V=Q.charCodeAt(A),V>55295&&V<57344){if(!C){if(V>56319){if(($-=3)>-1)F.push(239,191,189);continue}else if(A+1===W){if(($-=3)>-1)F.push(239,191,189);continue}C=V;continue}if(V<56320){if(($-=3)>-1)F.push(239,191,189);C=V;continue}V=(C-55296<<10|V-56320)+65536}else if(C){if(($-=3)>-1)F.push(239,191,189)}if(C=null,V<128){if(($-=1)<0)break;F.push(V)}else if(V<2048){if(($-=2)<0)break;F.push(V>>6|192,V&63|128)}else if(V<65536){if(($-=3)<0)break;F.push(V>>12|224,V>>6&63|128,V&63|128)}else if(V<1114112){if(($-=4)<0)break;F.push(V>>18|240,V>>12&63|128,V>>6&63|128,V&63|128)}else throw Error("Invalid code point")}return F}function DA(Q){let $=[];for(let V=0;V<Q.length;++V)$.push(Q.charCodeAt(V)&255);return $}function SA(Q,$){let V,W,C,F=[];for(let A=0;A<Q.length;++A){if(($-=2)<0)break;V=Q.charCodeAt(A),W=V>>8,C=V%256,F.push(C),F.push(W)}return F}function YQ(Q){return lY(HA(Q))}function pO(Q,$,V,W){let C;for(C=0;C<W;++C){if(C+V>=$.length||C>=Q.length)break;$[C+V]=Q[C]}return C}function bU(Q,$){return Q instanceof $||Q!=null&&Q.constructor!=null&&Q.constructor.name!=null&&Q.constructor.name===$.name}function eU(Q){return typeof BigInt>"u"?RA:Q}function RA(){throw Error("BigInt not supported")}function MZ(Q){return()=>{throw Error(Q+" is not implemented for node:buffer browser polyfill")}}var uU,fU,WZ="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",XO,pX,uX,nX=50,FO=2147483647,mX=536870888,nY,mY,sY,tY,rY,aY,eY,HZ,lX=4096,WA,FA,TA,zA,MA=(Q)=>{for(let $ of Q)if($.charCodeAt(0)>127)return!1;return!0},qA,PA;var HU=HO(()=>{uU=[],fU=[];for(XO=0,pX=WZ.length;XO<pX;++XO)uU[XO]=WZ[XO],fU[WZ.charCodeAt(XO)]=XO;fU[45]=62;fU[95]=63;uX=typeof Symbol==="function"&&typeof Symbol.for==="function"?Symbol.for("nodejs.util.inspect.custom"):null,nY=globalThis.btoa,mY=globalThis.atob,sY=globalThis.File,tY=globalThis.Blob,rY={MAX_LENGTH:FO,MAX_STRING_LENGTH:mX};aY=RZ("ERR_BUFFER_OUT_OF_BOUNDS",function(Q){if(Q)return`${Q} is outside of buffer bounds`;return"Attempt to access memory outside buffer bounds"},RangeError),eY=RZ("ERR_INVALID_ARG_TYPE",function(Q,$){return`The "${Q}" argument must be of type number. Received type ${typeof $}`},TypeError),HZ=RZ("ERR_OUT_OF_RANGE",function(Q,$,V){let W=`The value of "${Q}" is out of range.`,C=V;if(Number.isInteger(V)&&Math.abs(V)>4294967296)C=dX(String(V));else if(typeof V==="bigint"){if(C=String(V),V>BigInt(2)**BigInt(32)||V<-(BigInt(2)**BigInt(32)))C=dX(C);C+="n"}return W+=` It must be ${$}. Received ${C}`,W},RangeError);Object.defineProperty(G0.prototype,"parent",{enumerable:!0,get:function(){if(!G0.isBuffer(this))return;return this.buffer}});Object.defineProperty(G0.prototype,"offset",{enumerable:!0,get:function(){if(!G0.isBuffer(this))return;return this.byteOffset}});G0.poolSize=8192;G0.from=function(Q,$,V){return sX(Q,$,V)};Object.setPrototypeOf(G0.prototype,Uint8Array.prototype);Object.setPrototypeOf(G0,Uint8Array);G0.alloc=function(Q,$,V){return iY(Q,$,V)};G0.allocUnsafe=function(Q){return TZ(Q)};G0.allocUnsafeSlow=function(Q){return TZ(Q)};G0.isBuffer=function(Q){return Q!=null&&Q._isBuffer===!0&&Q!==G0.prototype};G0.compare=function(Q,$){if(bU(Q,Uint8Array))Q=G0.from(Q,Q.offset,Q.byteLength);if(bU($,Uint8Array))$=G0.from($,$.offset,$.byteLength);if(!G0.isBuffer(Q)||!G0.isBuffer($))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(Q===$)return 0;let V=Q.length,W=$.length;for(let C=0,F=Math.min(V,W);C<F;++C)if(Q[C]!==$[C]){V=Q[C],W=$[C];break}if(V<W)return-1;if(W<V)return 1;return 0};G0.isEncoding=function(Q){switch(String(Q).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}};G0.concat=function(Q,$){if(!Array.isArray(Q))throw TypeError('"list" argument must be an Array of Buffers');if(Q.length===0)return G0.alloc(0);let V;if($===void 0){$=0;for(V=0;V<Q.length;++V)$+=Q[V].length}let W=G0.allocUnsafe($),C=0;for(V=0;V<Q.length;++V){let F=Q[V];if(bU(F,Uint8Array))if(C+F.length>W.length){if(!G0.isBuffer(F))F=G0.from(F);F.copy(W,C)}else Uint8Array.prototype.set.call(W,F,C);else if(!G0.isBuffer(F))throw TypeError('"list" argument must be an Array of Buffers');else F.copy(W,C);C+=F.length}return W};G0.byteLength=rX;G0.prototype._isBuffer=!0;G0.prototype.swap16=function(){let Q=this.length;if(Q%2!==0)throw RangeError("Buffer size must be a multiple of 16-bits");for(let $=0;$<Q;$+=2)QO(this,$,$+1);return this};G0.prototype.swap32=function(){let Q=this.length;if(Q%4!==0)throw RangeError("Buffer size must be a multiple of 32-bits");for(let $=0;$<Q;$+=4)QO(this,$,$+3),QO(this,$+1,$+2);return this};G0.prototype.swap64=function(){let Q=this.length;if(Q%8!==0)throw RangeError("Buffer size must be a multiple of 64-bits");for(let $=0;$<Q;$+=8)QO(this,$,$+7),QO(this,$+1,$+6),QO(this,$+2,$+5),QO(this,$+3,$+4);return this};G0.prototype.toString=function(){let Q=this.length;if(Q===0)return"";if(arguments.length===0)return eX(this,0,Q);return XA.apply(this,arguments)};G0.prototype.toLocaleString=G0.prototype.toString;G0.prototype.equals=function(Q){if(!G0.isBuffer(Q))throw TypeError("Argument must be a Buffer");if(this===Q)return!0;return G0.compare(this,Q)===0};G0.prototype.inspect=function(){let Q="",$=nX;if(Q=this.toString("hex",0,$).replace(/(.{2})/g,"$1 ").trim(),this.length>$)Q+=" ... ";return"<Buffer "+Q+">"};if(uX)G0.prototype[uX]=G0.prototype.inspect;G0.prototype.compare=function(Q,$,V,W,C){if(bU(Q,Uint8Array))Q=G0.from(Q,Q.offset,Q.byteLength);if(!G0.isBuffer(Q))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof Q);if($===void 0)$=0;if(V===void 0)V=Q?Q.length:0;if(W===void 0)W=0;if(C===void 0)C=this.length;if($<0||V>Q.length||W<0||C>this.length)throw RangeError("out of range index");if(W>=C&&$>=V)return 0;if(W>=C)return-1;if($>=V)return 1;if($>>>=0,V>>>=0,W>>>=0,C>>>=0,this===Q)return 0;let F=C-W,A=V-$,z=Math.min(F,A),M=this.slice(W,C),S=Q.slice($,V);for(let R=0;R<z;++R)if(M[R]!==S[R]){F=M[R],A=S[R];break}if(F<A)return-1;if(A<F)return 1;return 0};G0.prototype.includes=function(Q,$,V){return this.indexOf(Q,$,V)!==-1};G0.prototype.indexOf=function(Q,$,V){return aX(this,Q,$,V,!0)};G0.prototype.lastIndexOf=function(Q,$,V){return aX(this,Q,$,V,!1)};G0.prototype.write=function(Q,$,V,W){if($===void 0)W="utf8",V=this.length,$=0;else if(V===void 0&&typeof $==="string")W=$,V=this.length,$=0;else if(isFinite($))if($=$>>>0,isFinite(V)){if(V=V>>>0,W===void 0)W="utf8"}else W=V,V=void 0;else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let C=this.length-$;if(V===void 0||V>C)V=C;if(Q.length>0&&(V<0||$<0)||$>this.length)throw RangeError("Attempt to write outside buffer bounds");if(!W)W="utf8";let F=!1;for(;;)switch(W){case"hex":return QA(this,Q,$,V);case"utf8":case"utf-8":return YA(this,Q,$,V);case"ascii":case"latin1":case"binary":return AA(this,Q,$,V);case"base64":return $A(this,Q,$,V);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return JA(this,Q,$,V);default:if(F)throw TypeError("Unknown encoding: "+W);W=(""+W).toLowerCase(),F=!0}};G0.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};G0.prototype.slice=function(Q,$){let V=this.length;if(Q=~~Q,$=$===void 0?V:~~$,Q<0){if(Q+=V,Q<0)Q=0}else if(Q>V)Q=V;if($<0){if($+=V,$<0)$=0}else if($>V)$=V;if($<Q)$=Q;let W=this.subarray(Q,$);return Object.setPrototypeOf(W,G0.prototype),W};G0.prototype.readUintLE=G0.prototype.readUIntLE=function(Q,$,V){if(Q=Q>>>0,$=$>>>0,!V)LU(Q,$,this.length);let W=this[Q],C=1,F=0;while(++F<$&&(C*=256))W+=this[Q+F]*C;return W};G0.prototype.readUintBE=G0.prototype.readUIntBE=function(Q,$,V){if(Q=Q>>>0,$=$>>>0,!V)LU(Q,$,this.length);let W=this[Q+--$],C=1;while($>0&&(C*=256))W+=this[Q+--$]*C;return W};G0.prototype.readUint8=G0.prototype.readUInt8=function(Q,$){if(Q=Q>>>0,!$)LU(Q,1,this.length);return this[Q]};G0.prototype.readUint16LE=G0.prototype.readUInt16LE=function(Q,$){if(Q=Q>>>0,!$)LU(Q,2,this.length);return this[Q]|this[Q+1]<<8};G0.prototype.readUint16BE=G0.prototype.readUInt16BE=function(Q,$){if(Q=Q>>>0,!$)LU(Q,2,this.length);return this[Q]<<8|this[Q+1]};G0.prototype.readUint32LE=G0.prototype.readUInt32LE=function(Q,$){if(Q=Q>>>0,!$)LU(Q,4,this.length);return(this[Q]|this[Q+1]<<8|this[Q+2]<<16)+this[Q+3]*16777216};G0.prototype.readUint32BE=G0.prototype.readUInt32BE=function(Q,$){if(Q=Q>>>0,!$)LU(Q,4,this.length);return this[Q]*16777216+(this[Q+1]<<16|this[Q+2]<<8|this[Q+3])};G0.prototype.readBigUInt64LE=eU(function(Q){Q=Q>>>0,GO(Q,"offset");let $=this[Q],V=this[Q+7];if($===void 0||V===void 0)RO(Q,this.length-8);let W=$+this[++Q]*256+this[++Q]*65536+this[++Q]*16777216,C=this[++Q]+this[++Q]*256+this[++Q]*65536+V*16777216;return BigInt(W)+(BigInt(C)<<BigInt(32))});G0.prototype.readBigUInt64BE=eU(function(Q){Q=Q>>>0,GO(Q,"offset");let $=this[Q],V=this[Q+7];if($===void 0||V===void 0)RO(Q,this.length-8);let W=$*16777216+this[++Q]*65536+this[++Q]*256+this[++Q],C=this[++Q]*16777216+this[++Q]*65536+this[++Q]*256+V;return(BigInt(W)<<BigInt(32))+BigInt(C)});G0.prototype.readIntLE=function(Q,$,V){if(Q=Q>>>0,$=$>>>0,!V)LU(Q,$,this.length);let W=this[Q],C=1,F=0;while(++F<$&&(C*=256))W+=this[Q+F]*C;if(C*=128,W>=C)W-=Math.pow(2,8*$);return W};G0.prototype.readIntBE=function(Q,$,V){if(Q=Q>>>0,$=$>>>0,!V)LU(Q,$,this.length);let W=$,C=1,F=this[Q+--W];while(W>0&&(C*=256))F+=this[Q+--W]*C;if(C*=128,F>=C)F-=Math.pow(2,8*$);return F};G0.prototype.readInt8=function(Q,$){if(Q=Q>>>0,!$)LU(Q,1,this.length);if(!(this[Q]&128))return this[Q];return(255-this[Q]+1)*-1};G0.prototype.readInt16LE=function(Q,$){if(Q=Q>>>0,!$)LU(Q,2,this.length);let V=this[Q]|this[Q+1]<<8;return V&32768?V|4294901760:V};G0.prototype.readInt16BE=function(Q,$){if(Q=Q>>>0,!$)LU(Q,2,this.length);let V=this[Q+1]|this[Q]<<8;return V&32768?V|4294901760:V};G0.prototype.readInt32LE=function(Q,$){if(Q=Q>>>0,!$)LU(Q,4,this.length);return this[Q]|this[Q+1]<<8|this[Q+2]<<16|this[Q+3]<<24};G0.prototype.readInt32BE=function(Q,$){if(Q=Q>>>0,!$)LU(Q,4,this.length);return this[Q]<<24|this[Q+1]<<16|this[Q+2]<<8|this[Q+3]};G0.prototype.readBigInt64LE=eU(function(Q){Q=Q>>>0,GO(Q,"offset");let $=this[Q],V=this[Q+7];if($===void 0||V===void 0)RO(Q,this.length-8);let W=this[Q+4]+this[Q+5]*256+this[Q+6]*65536+(V<<24);return(BigInt(W)<<BigInt(32))+BigInt($+this[++Q]*256+this[++Q]*65536+this[++Q]*16777216)});G0.prototype.readBigInt64BE=eU(function(Q){Q=Q>>>0,GO(Q,"offset");let $=this[Q],V=this[Q+7];if($===void 0||V===void 0)RO(Q,this.length-8);let W=($<<24)+this[++Q]*65536+this[++Q]*256+this[++Q];return(BigInt(W)<<BigInt(32))+BigInt(this[++Q]*16777216+this[++Q]*65536+this[++Q]*256+V)});G0.prototype.readFloatLE=function(Q,$){if(Q=Q>>>0,!$)LU(Q,4,this.length);return cO(this,Q,!0,23,4)};G0.prototype.readFloatBE=function(Q,$){if(Q=Q>>>0,!$)LU(Q,4,this.length);return cO(this,Q,!1,23,4)};G0.prototype.readDoubleLE=function(Q,$){if(Q=Q>>>0,!$)LU(Q,8,this.length);return cO(this,Q,!0,52,8)};G0.prototype.readDoubleBE=function(Q,$){if(Q=Q>>>0,!$)LU(Q,8,this.length);return cO(this,Q,!1,52,8)};G0.prototype.writeUintLE=G0.prototype.writeUIntLE=function(Q,$,V,W){if(Q=+Q,$=$>>>0,V=V>>>0,!W){let A=Math.pow(2,8*V)-1;kU(this,Q,$,V,A,0)}let C=1,F=0;this[$]=Q&255;while(++F<V&&(C*=256))this[$+F]=Q/C&255;return $+V};G0.prototype.writeUintBE=G0.prototype.writeUIntBE=function(Q,$,V,W){if(Q=+Q,$=$>>>0,V=V>>>0,!W){let A=Math.pow(2,8*V)-1;kU(this,Q,$,V,A,0)}let C=V-1,F=1;this[$+C]=Q&255;while(--C>=0&&(F*=256))this[$+C]=Q/F&255;return $+V};G0.prototype.writeUint8=G0.prototype.writeUInt8=function(Q,$,V){if(Q=+Q,$=$>>>0,!V)kU(this,Q,$,1,255,0);return this[$]=Q&255,$+1};G0.prototype.writeUint16LE=G0.prototype.writeUInt16LE=function(Q,$,V){if(Q=+Q,$=$>>>0,!V)kU(this,Q,$,2,65535,0);return this[$]=Q&255,this[$+1]=Q>>>8,$+2};G0.prototype.writeUint16BE=G0.prototype.writeUInt16BE=function(Q,$,V){if(Q=+Q,$=$>>>0,!V)kU(this,Q,$,2,65535,0);return this[$]=Q>>>8,this[$+1]=Q&255,$+2};G0.prototype.writeUint32LE=G0.prototype.writeUInt32LE=function(Q,$,V){if(Q=+Q,$=$>>>0,!V)kU(this,Q,$,4,4294967295,0);return this[$+3]=Q>>>24,this[$+2]=Q>>>16,this[$+1]=Q>>>8,this[$]=Q&255,$+4};G0.prototype.writeUint32BE=G0.prototype.writeUInt32BE=function(Q,$,V){if(Q=+Q,$=$>>>0,!V)kU(this,Q,$,4,4294967295,0);return this[$]=Q>>>24,this[$+1]=Q>>>16,this[$+2]=Q>>>8,this[$+3]=Q&255,$+4};G0.prototype.writeBigUInt64LE=eU(function(Q,$=0){return iX(this,Q,$,BigInt(0),BigInt("0xffffffffffffffff"))});G0.prototype.writeBigUInt64BE=eU(function(Q,$=0){return UQ(this,Q,$,BigInt(0),BigInt("0xffffffffffffffff"))});G0.prototype.writeIntLE=function(Q,$,V,W){if(Q=+Q,$=$>>>0,!W){let z=Math.pow(2,8*V-1);kU(this,Q,$,V,z-1,-z)}let C=0,F=1,A=0;this[$]=Q&255;while(++C<V&&(F*=256)){if(Q<0&&A===0&&this[$+C-1]!==0)A=1;this[$+C]=(Q/F>>0)-A&255}return $+V};G0.prototype.writeIntBE=function(Q,$,V,W){if(Q=+Q,$=$>>>0,!W){let z=Math.pow(2,8*V-1);kU(this,Q,$,V,z-1,-z)}let C=V-1,F=1,A=0;this[$+C]=Q&255;while(--C>=0&&(F*=256)){if(Q<0&&A===0&&this[$+C+1]!==0)A=1;this[$+C]=(Q/F>>0)-A&255}return $+V};G0.prototype.writeInt8=function(Q,$,V){if(Q=+Q,$=$>>>0,!V)kU(this,Q,$,1,127,-128);if(Q<0)Q=255+Q+1;return this[$]=Q&255,$+1};G0.prototype.writeInt16LE=function(Q,$,V){if(Q=+Q,$=$>>>0,!V)kU(this,Q,$,2,32767,-32768);return this[$]=Q&255,this[$+1]=Q>>>8,$+2};G0.prototype.writeInt16BE=function(Q,$,V){if(Q=+Q,$=$>>>0,!V)kU(this,Q,$,2,32767,-32768);return this[$]=Q>>>8,this[$+1]=Q&255,$+2};G0.prototype.writeInt32LE=function(Q,$,V){if(Q=+Q,$=$>>>0,!V)kU(this,Q,$,4,2147483647,-2147483648);return this[$]=Q&255,this[$+1]=Q>>>8,this[$+2]=Q>>>16,this[$+3]=Q>>>24,$+4};G0.prototype.writeInt32BE=function(Q,$,V){if(Q=+Q,$=$>>>0,!V)kU(this,Q,$,4,2147483647,-2147483648);if(Q<0)Q=4294967295+Q+1;return this[$]=Q>>>24,this[$+1]=Q>>>16,this[$+2]=Q>>>8,this[$+3]=Q&255,$+4};G0.prototype.writeBigInt64LE=eU(function(Q,$=0){return iX(this,Q,$,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});G0.prototype.writeBigInt64BE=eU(function(Q,$=0){return UQ(this,Q,$,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});G0.prototype.writeFloatLE=function(Q,$,V){return ZQ(this,Q,$,!0,V)};G0.prototype.writeFloatBE=function(Q,$,V){return ZQ(this,Q,$,!1,V)};G0.prototype.writeDoubleLE=function(Q,$,V){return XQ(this,Q,$,!0,V)};G0.prototype.writeDoubleBE=function(Q,$,V){return XQ(this,Q,$,!1,V)};G0.prototype.copy=function(Q,$,V,W){if(!G0.isBuffer(Q))throw TypeError("argument should be a Buffer");if(!V)V=0;if(!W&&W!==0)W=this.length;if($>=Q.length)$=Q.length;if(!$)$=0;if(W>0&&W<V)W=V;if(W===V)return 0;if(Q.length===0||this.length===0)return 0;if($<0)throw RangeError("targetStart out of bounds");if(V<0||V>=this.length)throw RangeError("Index out of range");if(W<0)throw RangeError("sourceEnd out of bounds");if(W>this.length)W=this.length;if(Q.length-$<W-V)W=Q.length-$+V;let C=W-V;if(this===Q&&typeof Uint8Array.prototype.copyWithin==="function")this.copyWithin($,V,W);else Uint8Array.prototype.set.call(Q,this.subarray(V,W),$);return C};G0.prototype.fill=function(Q,$,V,W){if(typeof Q==="string"){if(typeof $==="string")W=$,$=0,V=this.length;else if(typeof V==="string")W=V,V=this.length;if(W!==void 0&&typeof W!=="string")throw TypeError("encoding must be a string");if(typeof W==="string"&&!G0.isEncoding(W))throw TypeError("Unknown encoding: "+W);if(Q.length===1){let F=Q.charCodeAt(0);if(W==="utf8"&&F<128||W==="latin1")Q=F}}else if(typeof Q==="number")Q=Q&255;else if(typeof Q==="boolean")Q=Number(Q);if($<0||this.length<$||this.length<V)throw RangeError("Out of range index");if(V<=$)return this;if($=$>>>0,V=V===void 0?this.length:V>>>0,!Q)Q=0;let C;if(typeof Q==="number")for(C=$;C<V;++C)this[C]=Q;else{let F=G0.isBuffer(Q)?Q:G0.from(Q,W),A=F.length;if(A===0)throw TypeError('The value "'+Q+'" is invalid for argument "value"');for(C=0;C<V-$;++C)this[C+$]=F[C%A]}return this};WA=/[^+/0-9A-Za-z-_]/g;FA=function(){let Q=Array(256);for(let $=0;$<16;++$){let V=$*16;for(let W=0;W<16;++W)Q[V+W]="0123456789abcdef"[$]+"0123456789abcdef"[W]}return Q}();TA=MZ("resolveObjectURL"),zA=MZ("isUtf8"),qA=MZ("transcode"),PA=G0});var zO={};WO(zO,{setMaxListeners:()=>WQ,once:()=>KQ,listenerCount:()=>HQ,init:()=>iU,getMaxListeners:()=>SQ,getEventListeners:()=>LQ,default:()=>fA,captureRejectionSymbol:()=>VQ,addAbortListener:()=>FQ,EventEmitter:()=>iU});function EQ(Q,$){var{_events:V}=Q;if($[0]??=Error("Unhandled error."),!V)throw $[0];var W=V[GQ];if(W)for(var C of $Q.call(W))C.apply(Q,$);var F=V.error;if(!F)throw $[0];for(var C of $Q.call(F))C.apply(Q,$);return!0}function vA(Q,$,V,W){$.then(void 0,function(C){queueMicrotask(()=>jA(Q,C,V,W))})}function jA(Q,$,V,W){if(typeof Q[AQ]==="function")Q[AQ]($,V,...W);else try{Q[YO]=!1,Q.emit("error",$)}finally{Q[YO]=!0}}function IQ(Q,$,V){V.warned=!0;let W=Error(`Possible EventEmitter memory leak detected. ${V.length} ${String($)} listeners added to [${Q.constructor.name}]. Use emitter.setMaxListeners() to increase limit`);W.name="MaxListenersExceededWarning",W.emitter=Q,W.type=$,W.count=V.length,console.warn(W)}function CQ(Q,$,...V){this.removeListener(Q,$),$.apply(this,V)}function KQ(Q,$,V){var W=V?.signal;if(DQ(W,"options.signal"),W?.aborted)throw new qZ(void 0,{cause:W?.reason});let{resolve:C,reject:F,promise:A}=$newPromiseCapability(Promise),z=(R)=>{if(Q.removeListener($,M),W!=null)hO(W,"abort",S);F(R)},M=(...R)=>{if(typeof Q.removeListener==="function")Q.removeListener("error",z);if(W!=null)hO(W,"abort",S);C(R)};if(JQ(Q,$,M,{once:!0}),$!=="error"&&typeof Q.once==="function")Q.once("error",z);function S(){hO(Q,$,M),hO(Q,"error",z),F(new qZ(void 0,{cause:W?.reason}))}if(W!=null)JQ(W,"abort",S,{once:!0});return A}function LQ(Q,$){return Q.listeners($)}function WQ(Q,...$){kZ(Q,"setMaxListeners",0);var V;if($&&(V=$.length))for(let W=0;W<V;W++)$[W].setMaxListeners(Q);else AO=Q}function HQ(Q,$){return Q.listenerCount($)}function hO(Q,$,V,W){if(typeof Q.removeListener==="function")Q.removeListener($,V);else Q.removeEventListener($,V,W)}function JQ(Q,$,V,W){if(typeof Q.on==="function")if(W.once)Q.once($,V);else Q.on($,V);else Q.addEventListener($,V,W)}function VO(Q,$,V){let W=TypeError(`The "${Q}" argument must be of type ${$}. Received ${V}`);return W.code="ERR_INVALID_ARG_TYPE",W}function NA(Q,$,V){let W=RangeError(`The "${Q}" argument is out of range. It must be ${$}. Received ${V}`);return W.code="ERR_OUT_OF_RANGE",W}function DQ(Q,$){if(Q!==void 0&&(Q===null||typeof Q!=="object"||!("aborted"in Q)))throw VO($,"AbortSignal",Q)}function kZ(Q,$,V,W){if(typeof Q!=="number")throw VO($,"number",Q);if(V!=null&&Q<V||W!=null&&Q>W||(V!=null||W!=null)&&Number.isNaN(Q))throw NA($,`${V!=null?`>= ${V}`:""}${V!=null&&W!=null?" && ":""}${W!=null?`<= ${W}`:""}`,Q)}function TO(Q){if(typeof Q!=="function")throw TypeError("The listener must be a function")}function gA(Q,$){if(typeof Q!=="boolean")throw VO($,"boolean",Q)}function SQ(Q){return Q?._maxListeners??AO}function FQ(Q,$){if(Q===void 0)throw VO("signal","AbortSignal",Q);if(DQ(Q,"signal"),typeof $!=="function")throw VO("listener","function",$);let V;if(Q.aborted)queueMicrotask(()=>$());else Q.addEventListener("abort",$,{__proto__:null,once:!0}),V=()=>{Q.removeEventListener("abort",$)};return{__proto__:null,[Symbol.dispose](){V?.()}}}var PZ,YO,GQ,kA,_A,AQ,VQ,$Q,AO=10,iU=function(Q){if(this._events===void 0||this._events===this.__proto__._events)this._events={__proto__:null},this._eventsCount=0;if(this._maxListeners??=void 0,this[YO]=Q?.captureRejections?Boolean(Q?.captureRejections):o0[YO])this.emit=xA},o0,BA=function(Q,...$){if(Q==="error")return EQ(this,$);var{_events:V}=this;if(V===void 0)return!1;var W=V[Q];if(W===void 0)return!1;let C=W.length>1?W.slice():W;for(let F=0,{length:A}=C;F<A;F++){let z=C[F];switch($.length){case 0:z.call(this);break;case 1:z.call(this,$[0]);break;case 2:z.call(this,$[0],$[1]);break;case 3:z.call(this,$[0],$[1],$[2]);break;default:z.apply(this,$);break}}return!0},xA=function(Q,...$){if(Q==="error")return EQ(this,$);var{_events:V}=this;if(V===void 0)return!1;var W=V[Q];if(W===void 0)return!1;let C=W.length>1?W.slice():W;for(let F=0,{length:A}=C;F<A;F++){let z=C[F],M;switch($.length){case 0:M=z.call(this);break;case 1:M=z.call(this,$[0]);break;case 2:M=z.call(this,$[0],$[1]);break;case 3:M=z.call(this,$[0],$[1],$[2]);break;default:M=z.apply(this,$);break}if(M!==void 0&&typeof M?.then==="function"&&M.then===Promise.prototype.then)vA(this,M,Q,$)}return!0},qZ,fA;var MO=HO(()=>{PZ=Symbol.for,YO=Symbol("kCapture"),GQ=PZ("events.errorMonitor"),kA=Symbol("events.maxEventTargetListeners"),_A=Symbol("events.maxEventTargetListenersWarned"),AQ=PZ("nodejs.rejection"),VQ=PZ("nodejs.rejection"),$Q=Array.prototype.slice,o0=iU.prototype={};o0._events=void 0;o0._eventsCount=0;o0._maxListeners=void 0;o0.setMaxListeners=function(Q){return kZ(Q,"setMaxListeners",0),this._maxListeners=Q,this};o0.constructor=iU;o0.getMaxListeners=function(){return this?._maxListeners??AO};o0.emit=BA;o0.addListener=function(Q,$){TO($);var V=this._events;if(!V)V=this._events={__proto__:null},this._eventsCount=0;else if(V.newListener)this.emit("newListener",Q,$.listener??$);var W=V[Q];if(!W)V[Q]=[$],this._eventsCount++;else{W.push($);var C=this._maxListeners??AO;if(C>0&&W.length>C&&!W.warned)IQ(this,Q,W)}return this};o0.on=o0.addListener;o0.prependListener=function(Q,$){TO($);var V=this._events;if(!V)V=this._events={__proto__:null},this._eventsCount=0;else if(V.newListener)this.emit("newListener",Q,$.listener??$);var W=V[Q];if(!W)V[Q]=[$],this._eventsCount++;else{W.unshift($);var C=this._maxListeners??AO;if(C>0&&W.length>C&&!W.warned)IQ(this,Q,W)}return this};o0.once=function(Q,$){TO($);let V=CQ.bind(this,Q,$);return V.listener=$,this.addListener(Q,V),this};o0.prependOnceListener=function(Q,$){TO($);let V=CQ.bind(this,Q,$);return V.listener=$,this.prependListener(Q,V),this};o0.removeListener=function(Q,$){TO($);var{_events:V}=this;if(!V)return this;var W=V[Q];if(!W)return this;var C=W.length;let F=-1;for(let A=C-1;A>=0;A--)if(W[A]===$||W[A].listener===$){F=A;break}if(F<0)return this;if(F===0)W.shift();else W.splice(F,1);if(W.length===0)delete V[Q],this._eventsCount--;return this};o0.off=o0.removeListener;o0.removeAllListeners=function(Q){var{_events:$}=this;if(Q&&$){if($[Q])delete $[Q],this._eventsCount--}else this._events={__proto__:null};return this};o0.listeners=function(Q){var{_events:$}=this;if(!$)return[];var V=$[Q];if(!V)return[];return V.map((W)=>W.listener??W)};o0.rawListeners=function(Q){var{_events:$}=this;if(!$)return[];var V=$[Q];if(!V)return[];return V.slice()};o0.listenerCount=function(Q){var{_events:$}=this;if(!$)return 0;return $[Q]?.length??0};o0.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]};o0[YO]=!1;qZ=class qZ extends Error{constructor(Q="The operation was aborted",$=void 0){if($!==void 0&&typeof $!=="object")throw VO("options","Object",$);super(Q,$);this.code="ABORT_ERR",this.name="AbortError"}};Object.defineProperties(iU,{captureRejections:{get(){return o0[YO]},set(Q){gA(Q,"EventEmitter.captureRejections"),o0[YO]=Q},enumerable:!0},defaultMaxListeners:{enumerable:!0,get:()=>{return AO},set:(Q)=>{kZ(Q,"defaultMaxListeners",0),AO=Q}},kMaxEventTargetListeners:{value:kA,enumerable:!1,configurable:!1,writable:!1},kMaxEventTargetListenersWarned:{value:_A,enumerable:!1,configurable:!1,writable:!1}});Object.assign(iU,{once:KQ,getEventListeners:LQ,getMaxListeners:SQ,setMaxListeners:WQ,EventEmitter:iU,usingDomains:!1,captureRejectionSymbol:VQ,errorMonitor:GQ,addAbortListener:FQ,init:iU,listenerCount:HQ});fA=iU});var dO=kY((XE,_Q)=>{var b0=(Q,$)=>()=>($||Q(($={exports:{}}).exports,$),$.exports),n0=b0((Q,$)=>{class V extends Error{constructor(W){if(!Array.isArray(W))throw TypeError(`Expected input to be an Array, got ${typeof W}`);let C="";for(let F=0;F<W.length;F++)C+=` ${W[F].stack}
|
|
2
|
-
`;super(C);this.name="AggregateError",this.errors=W}}$.exports={AggregateError:V,ArrayIsArray(W){return Array.isArray(W)},ArrayPrototypeIncludes(W,C){return W.includes(C)},ArrayPrototypeIndexOf(W,C){return W.indexOf(C)},ArrayPrototypeJoin(W,C){return W.join(C)},ArrayPrototypeMap(W,C){return W.map(C)},ArrayPrototypePop(W,C){return W.pop(C)},ArrayPrototypePush(W,C){return W.push(C)},ArrayPrototypeSlice(W,C,F){return W.slice(C,F)},Error,FunctionPrototypeCall(W,C,...F){return W.call(C,...F)},FunctionPrototypeSymbolHasInstance(W,C){return Function.prototype[Symbol.hasInstance].call(W,C)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(W,C){return Object.defineProperties(W,C)},ObjectDefineProperty(W,C,F){return Object.defineProperty(W,C,F)},ObjectGetOwnPropertyDescriptor(W,C){return Object.getOwnPropertyDescriptor(W,C)},ObjectKeys(W){return Object.keys(W)},ObjectSetPrototypeOf(W,C){return Object.setPrototypeOf(W,C)},Promise,PromisePrototypeCatch(W,C){return W.catch(C)},PromisePrototypeThen(W,C,F){return W.then(C,F)},PromiseReject(W){return Promise.reject(W)},PromiseResolve(W){return Promise.resolve(W)},ReflectApply:Reflect.apply,RegExpPrototypeTest(W,C){return W.test(C)},SafeSet:Set,String,StringPrototypeSlice(W,C,F){return W.slice(C,F)},StringPrototypeToLowerCase(W){return W.toLowerCase()},StringPrototypeToUpperCase(W){return W.toUpperCase()},StringPrototypeTrim(W){return W.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet(W,C,F){return W.set(C,F)},Boolean,Uint8Array}}),RQ=b0((Q,$)=>{$.exports={format(V,...W){return V.replace(/%([sdifj])/g,function(...[C,F]){let A=W.shift();if(F==="f")return A.toFixed(6);else if(F==="j")return JSON.stringify(A);else if(F==="s"&&typeof A==="object")return`${A.constructor!==Object?A.constructor.name:""} {}`.trim();else return A.toString()})},inspect(V){switch(typeof V){case"string":if(V.includes("'")){if(!V.includes('"'))return`"${V}"`;else if(!V.includes("`")&&!V.includes("${"))return`\`${V}\``}return`'${V}'`;case"number":if(isNaN(V))return"NaN";else if(Object.is(V,-0))return String(V);return V;case"bigint":return`${String(V)}n`;case"boolean":case"undefined":return String(V);case"object":return"{}"}}}}),zU=b0((Q,$)=>{var{format:V,inspect:W}=RQ(),{AggregateError:C}=n0(),F=globalThis.AggregateError||C,A=Symbol("kIsNodeError"),z=["string","function","number","object","Function","Object","boolean","bigint","symbol"],M=/^([A-Z][a-z0-9]*)+$/,S={};function R(B,j){if(!B)throw new S.ERR_INTERNAL_ASSERTION(j)}function L(B){let j="",x=B.length,f=B[0]==="-"?1:0;for(;x>=f+4;x-=3)j=`_${B.slice(x-3,x)}${j}`;return`${B.slice(0,x)}${j}`}function H(B,j,x){if(typeof j==="function")return R(j.length<=x.length,`Code: ${B}; The provided arguments length (${x.length}) does not match the required ones (${j.length}).`),j(...x);let f=(j.match(/%[dfijoOs]/g)||[]).length;if(R(f===x.length,`Code: ${B}; The provided arguments length (${x.length}) does not match the required ones (${f}).`),x.length===0)return j;return V(j,...x)}function q(B,j,x){if(!x)x=Error;class f extends x{constructor(...w){super(H(B,j,w))}toString(){return`${this.name} [${B}]: ${this.message}`}}Object.defineProperties(f.prototype,{name:{value:x.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${B}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),f.prototype.code=B,f.prototype[A]=!0,S[B]=f}function P(B){let j="__node_internal_"+B.name;return Object.defineProperty(B,"name",{value:j}),B}function _(B,j){if(B&&j&&B!==j){if(Array.isArray(j.errors))return j.errors.push(B),j;let x=new F([j,B],j.message);return x.code=j.code,x}return B||j}class k extends Error{constructor(B="The operation was aborted",j=void 0){if(j!==void 0&&typeof j!=="object")throw new S.ERR_INVALID_ARG_TYPE("options","Object",j);super(B,j);this.code="ABORT_ERR",this.name="AbortError"}}q("ERR_ASSERTION","%s",Error),q("ERR_INVALID_ARG_TYPE",(B,j,x)=>{if(R(typeof B==="string","'name' must be a string"),!Array.isArray(j))j=[j];let f="The ";if(B.endsWith(" argument"))f+=`${B} `;else f+=`"${B}" ${B.includes(".")?"property":"argument"} `;f+="must be ";let w=[],d=[],Y0=[];for(let A0 of j)if(R(typeof A0==="string","All expected entries have to be of type string"),z.includes(A0))w.push(A0.toLowerCase());else if(M.test(A0))d.push(A0);else R(A0!=="object",'The value "object" should be written as "Object"'),Y0.push(A0);if(d.length>0){let A0=w.indexOf("object");if(A0!==-1)w.splice(w,A0,1),d.push("Object")}if(w.length>0){switch(w.length){case 1:f+=`of type ${w[0]}`;break;case 2:f+=`one of type ${w[0]} or ${w[1]}`;break;default:{let A0=w.pop();f+=`one of type ${w.join(", ")}, or ${A0}`}}if(d.length>0||Y0.length>0)f+=" or "}if(d.length>0){switch(d.length){case 1:f+=`an instance of ${d[0]}`;break;case 2:f+=`an instance of ${d[0]} or ${d[1]}`;break;default:{let A0=d.pop();f+=`an instance of ${d.join(", ")}, or ${A0}`}}if(Y0.length>0)f+=" or "}switch(Y0.length){case 0:break;case 1:if(Y0[0].toLowerCase()!==Y0[0])f+="an ";f+=`${Y0[0]}`;break;case 2:f+=`one of ${Y0[0]} or ${Y0[1]}`;break;default:{let A0=Y0.pop();f+=`one of ${Y0.join(", ")}, or ${A0}`}}if(x==null)f+=`. Received ${x}`;else if(typeof x==="function"&&x.name)f+=`. Received function ${x.name}`;else if(typeof x==="object"){var J0;if((J0=x.constructor)!==null&&J0!==void 0&&J0.name)f+=`. Received an instance of ${x.constructor.name}`;else{let A0=W(x,{depth:-1});f+=`. Received ${A0}`}}else{let A0=W(x,{colors:!1});if(A0.length>25)A0=`${A0.slice(0,25)}...`;f+=`. Received type ${typeof x} (${A0})`}return f},TypeError),q("ERR_INVALID_ARG_VALUE",(B,j,x="is invalid")=>{let f=W(j);if(f.length>128)f=f.slice(0,128)+"...";return`The ${B.includes(".")?"property":"argument"} '${B}' ${x}. Received ${f}`},TypeError),q("ERR_INVALID_RETURN_VALUE",(B,j,x)=>{var f;let w=x!==null&&x!==void 0&&(f=x.constructor)!==null&&f!==void 0&&f.name?`instance of ${x.constructor.name}`:`type ${typeof x}`;return`Expected ${B} to be returned from the "${j}" function but got ${w}.`},TypeError),q("ERR_MISSING_ARGS",(...B)=>{R(B.length>0,"At least one arg needs to be specified");let j,x=B.length;switch(B=(Array.isArray(B)?B:[B]).map((f)=>`"${f}"`).join(" or "),x){case 1:j+=`The ${B[0]} argument`;break;case 2:j+=`The ${B[0]} and ${B[1]} arguments`;break;default:{let f=B.pop();j+=`The ${B.join(", ")}, and ${f} arguments`}break}return`${j} must be specified`},TypeError),q("ERR_OUT_OF_RANGE",(B,j,x)=>{R(j,'Missing "range" argument');let f;if(Number.isInteger(x)&&Math.abs(x)>4294967296)f=L(String(x));else if(typeof x==="bigint"){f=String(x);let w=BigInt(2)**BigInt(32);if(x>w||x<-w)f=L(f);f+="n"}else f=W(x);return`The value of "${B}" is out of range. It must be ${j}. Received ${f}`},RangeError),q("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),q("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),q("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),q("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),q("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),q("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),q("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),q("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),q("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),q("ERR_STREAM_WRITE_AFTER_END","write after end",Error),q("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),$.exports={AbortError:k,aggregateTwoErrors:P(_),hideStackFrames:P,codes:S}}),wA=b0((Q,$)=>{Object.defineProperty(Q,"__esModule",{value:!0});var V=new WeakMap,W=new WeakMap;function C(u){let O0=V.get(u);return console.assert(O0!=null,"'this' is expected an Event object, but got",u),O0}function F(u){if(u.passiveListener!=null){if(typeof console<"u"&&typeof console.error==="function")console.error("Unable to preventDefault inside passive event listener invocation.",u.passiveListener);return}if(!u.event.cancelable)return;if(u.canceled=!0,typeof u.event.preventDefault==="function")u.event.preventDefault()}function A(u,O0){V.set(this,{eventTarget:u,event:O0,eventPhase:2,currentTarget:u,canceled:!1,stopped:!1,immediateStopped:!1,passiveListener:null,timeStamp:O0.timeStamp||Date.now()}),Object.defineProperty(this,"isTrusted",{value:!1,enumerable:!0});let U=Object.keys(O0);for(let X=0;X<U.length;++X){let J=U[X];if(!(J in this))Object.defineProperty(this,J,z(J))}}if(A.prototype={get type(){return C(this).event.type},get target(){return C(this).eventTarget},get currentTarget(){return C(this).currentTarget},composedPath(){let u=C(this).currentTarget;if(u==null)return[];return[u]},get NONE(){return 0},get CAPTURING_PHASE(){return 1},get AT_TARGET(){return 2},get BUBBLING_PHASE(){return 3},get eventPhase(){return C(this).eventPhase},stopPropagation(){let u=C(this);if(u.stopped=!0,typeof u.event.stopPropagation==="function")u.event.stopPropagation()},stopImmediatePropagation(){let u=C(this);if(u.stopped=!0,u.immediateStopped=!0,typeof u.event.stopImmediatePropagation==="function")u.event.stopImmediatePropagation()},get bubbles(){return Boolean(C(this).event.bubbles)},get cancelable(){return Boolean(C(this).event.cancelable)},preventDefault(){F(C(this))},get defaultPrevented(){return C(this).canceled},get composed(){return Boolean(C(this).event.composed)},get timeStamp(){return C(this).timeStamp},get srcElement(){return C(this).eventTarget},get cancelBubble(){return C(this).stopped},set cancelBubble(u){if(!u)return;let O0=C(this);if(O0.stopped=!0,typeof O0.event.cancelBubble==="boolean")O0.event.cancelBubble=!0},get returnValue(){return!C(this).canceled},set returnValue(u){if(!u)F(C(this))},initEvent(){}},Object.defineProperty(A.prototype,"constructor",{value:A,configurable:!0,writable:!0}),typeof window<"u"&&typeof window.Event<"u")Object.setPrototypeOf(A.prototype,window.Event.prototype),W.set(window.Event.prototype,A);function z(u){return{get(){return C(this).event[u]},set(O0){C(this).event[u]=O0},configurable:!0,enumerable:!0}}function M(u){return{value(){let O0=C(this).event;return O0[u].apply(O0,arguments)},configurable:!0,enumerable:!0}}function S(u,O0){let U=Object.keys(O0);if(U.length===0)return u;function X(J,Z){u.call(this,J,Z)}X.prototype=Object.create(u.prototype,{constructor:{value:X,configurable:!0,writable:!0}});for(let J=0;J<U.length;++J){let Z=U[J];if(!(Z in u.prototype)){let Y=typeof Object.getOwnPropertyDescriptor(O0,Z).value==="function";Object.defineProperty(X.prototype,Z,Y?M(Z):z(Z))}}return X}function R(u){if(u==null||u===Object.prototype)return A;let O0=W.get(u);if(O0==null)O0=S(R(Object.getPrototypeOf(u)),u),W.set(u,O0);return O0}function L(u,O0){return new(R(Object.getPrototypeOf(O0)))(u,O0)}function H(u){return C(u).immediateStopped}function q(u,O0){C(u).eventPhase=O0}function P(u,O0){C(u).currentTarget=O0}function _(u,O0){C(u).passiveListener=O0}var k=new WeakMap,B=1,j=2,x=3;function f(u){return u!==null&&typeof u==="object"}function w(u){let O0=k.get(u);if(O0==null)throw TypeError("'this' is expected an EventTarget object, but got another value.");return O0}function d(u){return{get(){let O0=w(this).get(u);while(O0!=null){if(O0.listenerType===x)return O0.listener;O0=O0.next}return null},set(O0){if(typeof O0!=="function"&&!f(O0))O0=null;let U=w(this),X=null,J=U.get(u);while(J!=null){if(J.listenerType===x)if(X!==null)X.next=J.next;else if(J.next!==null)U.set(u,J.next);else U.delete(u);else X=J;J=J.next}if(O0!==null){let Z={listener:O0,listenerType:x,passive:!1,once:!1,next:null};if(X===null)U.set(u,Z);else X.next=Z}},configurable:!0,enumerable:!0}}function Y0(u,O0){Object.defineProperty(u,`on${O0}`,d(O0))}function J0(u){function O0(){A0.call(this)}O0.prototype=Object.create(A0.prototype,{constructor:{value:O0,configurable:!0,writable:!0}});for(let U=0;U<u.length;++U)Y0(O0.prototype,u[U]);return O0}function A0(){if(this instanceof A0){k.set(this,new Map);return}if(arguments.length===1&&Array.isArray(arguments[0]))return J0(arguments[0]);if(arguments.length>0){let u=Array(arguments.length);for(let O0=0;O0<arguments.length;++O0)u[O0]=arguments[O0];return J0(u)}throw TypeError("Cannot call a class as a function")}if(A0.prototype={addEventListener(u,O0,U){if(O0==null)return;if(typeof O0!=="function"&&!f(O0))throw TypeError("'listener' should be a function or an object.");let X=w(this),J=f(U),Z=(J?Boolean(U.capture):Boolean(U))?B:j,Y={listener:O0,listenerType:Z,passive:J&&Boolean(U.passive),once:J&&Boolean(U.once),next:null},I=X.get(u);if(I===void 0){X.set(u,Y);return}let K=null;while(I!=null){if(I.listener===O0&&I.listenerType===Z)return;K=I,I=I.next}K.next=Y},removeEventListener(u,O0,U){if(O0==null)return;let X=w(this),J=(f(U)?Boolean(U.capture):Boolean(U))?B:j,Z=null,Y=X.get(u);while(Y!=null){if(Y.listener===O0&&Y.listenerType===J){if(Z!==null)Z.next=Y.next;else if(Y.next!==null)X.set(u,Y.next);else X.delete(u);return}Z=Y,Y=Y.next}},dispatchEvent(u){if(u==null||typeof u.type!=="string")throw TypeError('"event.type" should be a string.');let O0=w(this),U=u.type,X=O0.get(U);if(X==null)return!0;let J=L(this,u),Z=null;while(X!=null){if(X.once)if(Z!==null)Z.next=X.next;else if(X.next!==null)O0.set(U,X.next);else O0.delete(U);else Z=X;if(_(J,X.passive?X.listener:null),typeof X.listener==="function")try{X.listener.call(this,J)}catch(Y){if(typeof console<"u"&&typeof console.error==="function")console.error(Y)}else if(X.listenerType!==x&&typeof X.listener.handleEvent==="function")X.listener.handleEvent(J);if(H(J))break;X=X.next}return _(J,null),q(J,0),P(J,null),!J.defaultPrevented}},Object.defineProperty(A0.prototype,"constructor",{value:A0,configurable:!0,writable:!0}),typeof window<"u"&&typeof window.EventTarget<"u")Object.setPrototypeOf(A0.prototype,window.EventTarget.prototype);Q.defineEventAttribute=Y0,Q.EventTarget=A0,Q.default=A0,$.exports=A0,$.exports.EventTarget=$.exports.default=A0,$.exports.defineEventAttribute=Y0}),qO=b0((Q,$)=>{Object.defineProperty(Q,"__esModule",{value:!0});var V=wA();class W extends V.EventTarget{constructor(){super();throw TypeError("AbortSignal cannot be constructed directly")}get aborted(){let R=A.get(this);if(typeof R!=="boolean")throw TypeError(`Expected 'this' to be an 'AbortSignal' object, but got ${this===null?"null":typeof this}`);return R}}V.defineEventAttribute(W.prototype,"abort");function C(){let R=Object.create(W.prototype);return V.EventTarget.call(R),A.set(R,!1),R}function F(R){if(A.get(R)!==!1)return;A.set(R,!0),R.dispatchEvent({type:"abort"})}var A=new WeakMap;if(Object.defineProperties(W.prototype,{aborted:{enumerable:!0}}),typeof Symbol==="function"&&typeof Symbol.toStringTag==="symbol")Object.defineProperty(W.prototype,Symbol.toStringTag,{configurable:!0,value:"AbortSignal"});class z{constructor(){M.set(this,C())}get signal(){return S(this)}abort(){F(S(this))}}var M=new WeakMap;function S(R){let L=M.get(R);if(L==null)throw TypeError(`Expected 'this' to be an 'AbortController' object, but got ${R===null?"null":typeof R}`);return L}if(Object.defineProperties(z.prototype,{signal:{enumerable:!0},abort:{enumerable:!0}}),typeof Symbol==="function"&&typeof Symbol.toStringTag==="symbol")Object.defineProperty(z.prototype,Symbol.toStringTag,{configurable:!0,value:"AbortController"});Q.AbortController=z,Q.AbortSignal=W,Q.default=z,$.exports=z,$.exports.AbortController=$.exports.default=z,$.exports.AbortSignal=W}),_U=b0((Q,$)=>{var V=(HU(),h0(WU)),{format:W,inspect:C}=RQ(),{codes:{ERR_INVALID_ARG_TYPE:F}}=zU(),{kResistStopPropagation:A,AggregateError:z,SymbolDispose:M}=n0(),S=globalThis.AbortSignal||qO().AbortSignal,R=globalThis.AbortController||qO().AbortController,L=Object.getPrototypeOf(async function(){}).constructor,H=globalThis.Blob||V.Blob,q=typeof H<"u"?function(k){return k instanceof H}:function(k){return!1},P=(k,B)=>{if(k!==void 0&&(k===null||typeof k!=="object"||!("aborted"in k)))throw new F(B,"AbortSignal",k)},_=(k,B)=>{if(typeof k!=="function")throw new F(B,"Function",k)};$.exports={AggregateError:z,kEmptyObject:Object.freeze({}),once(k){let B=!1;return function(...j){if(B)return;B=!0,k.apply(this,j)}},createDeferredPromise:function(){let k,B;return{promise:new Promise((j,x)=>{k=j,B=x}),resolve:k,reject:B}},promisify(k){return new Promise((B,j)=>{k((x,...f)=>{if(x)return j(x);return B(...f)})})},debuglog(){return function(){}},format:W,inspect:C,types:{isAsyncFunction(k){return k instanceof L},isArrayBufferView(k){return ArrayBuffer.isView(k)}},isBlob:q,deprecate(k,B){return k},addAbortListener:(MO(),h0(zO)).addAbortListener||function(k,B){if(k===void 0)throw new F("signal","AbortSignal",k);P(k,"signal"),_(B,"listener");let j;if(k.aborted)queueMicrotask(()=>B());else k.addEventListener("abort",B,{__proto__:null,once:!0,[A]:!0}),j=()=>{k.removeEventListener("abort",B)};return{__proto__:null,[M](){var x;(x=j)===null||x===void 0||x()}}},AbortSignalAny:S.any||function(k){if(k.length===1)return k[0];let B=new R,j=()=>B.abort();return k.forEach((x)=>{P(x,"signals"),x.addEventListener("abort",j,{once:!0})}),B.signal.addEventListener("abort",()=>{k.forEach((x)=>x.removeEventListener("abort",j))},{once:!0}),B.signal}},$.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")}),PO=b0((Q,$)=>{var{ArrayIsArray:V,ArrayPrototypeIncludes:W,ArrayPrototypeJoin:C,ArrayPrototypeMap:F,NumberIsInteger:A,NumberIsNaN:z,NumberMAX_SAFE_INTEGER:M,NumberMIN_SAFE_INTEGER:S,NumberParseInt:R,ObjectPrototypeHasOwnProperty:L,RegExpPrototypeExec:H,String:q,StringPrototypeToUpperCase:P,StringPrototypeTrim:_}=n0(),{hideStackFrames:k,codes:{ERR_SOCKET_BAD_PORT:B,ERR_INVALID_ARG_TYPE:j,ERR_INVALID_ARG_VALUE:x,ERR_OUT_OF_RANGE:f,ERR_UNKNOWN_SIGNAL:w}}=zU(),{normalizeEncoding:d}=_U(),{isAsyncFunction:Y0,isArrayBufferView:J0}=_U().types,A0={};function u(c){return c===(c|0)}function O0(c){return c===c>>>0}var U=/^[0-7]+$/,X="must be a 32-bit unsigned integer or an octal string";function J(c,o,N0){if(typeof c>"u")c=N0;if(typeof c==="string"){if(H(U,c)===null)throw new x(o,c,X);c=R(c,8)}return I(c,o),c}var Z=k((c,o,N0=S,s=M)=>{if(typeof c!=="number")throw new j(o,"number",c);if(!A(c))throw new f(o,"an integer",c);if(c<N0||c>s)throw new f(o,`>= ${N0} && <= ${s}`,c)}),Y=k((c,o,N0=-2147483648,s=2147483647)=>{if(typeof c!=="number")throw new j(o,"number",c);if(!A(c))throw new f(o,"an integer",c);if(c<N0||c>s)throw new f(o,`>= ${N0} && <= ${s}`,c)}),I=k((c,o,N0=!1)=>{if(typeof c!=="number")throw new j(o,"number",c);if(!A(c))throw new f(o,"an integer",c);let s=N0?1:0,Z0=4294967295;if(c<s||c>Z0)throw new f(o,`>= ${s} && <= ${Z0}`,c)});function K(c,o){if(typeof c!=="string")throw new j(o,"string",c)}function G(c,o,N0=void 0,s){if(typeof c!=="number")throw new j(o,"number",c);if(N0!=null&&c<N0||s!=null&&c>s||(N0!=null||s!=null)&&z(c))throw new f(o,`${N0!=null?`>= ${N0}`:""}${N0!=null&&s!=null?" && ":""}${s!=null?`<= ${s}`:""}`,c)}var O=k((c,o,N0)=>{if(!W(N0,c)){let s="must be one of: "+C(F(N0,(Z0)=>typeof Z0==="string"?`'${Z0}'`:q(Z0)),", ");throw new x(o,c,s)}});function E(c,o){if(typeof c!=="boolean")throw new j(o,"boolean",c)}function T(c,o,N0){return c==null||!L(c,o)?N0:c[o]}var D=k((c,o,N0=null)=>{let s=T(N0,"allowArray",!1),Z0=T(N0,"allowFunction",!1);if(!T(N0,"nullable",!1)&&c===null||!s&&V(c)||typeof c!=="object"&&(!Z0||typeof c!=="function"))throw new j(o,"Object",c)}),v=k((c,o)=>{if(c!=null&&typeof c!=="object"&&typeof c!=="function")throw new j(o,"a dictionary",c)}),g=k((c,o,N0=0)=>{if(!V(c))throw new j(o,"Array",c);if(c.length<N0){let s=`must be longer than ${N0}`;throw new x(o,c,s)}});function p(c,o){g(c,o);for(let N0=0;N0<c.length;N0++)K(c[N0],`${o}[${N0}]`)}function n(c,o){g(c,o);for(let N0=0;N0<c.length;N0++)E(c[N0],`${o}[${N0}]`)}function V0(c,o){g(c,o);for(let N0=0;N0<c.length;N0++){let s=c[N0],Z0=`${o}[${N0}]`;if(s==null)throw new j(Z0,"AbortSignal",s);i(s,Z0)}}function r(c,o="signal"){if(K(c,o),A0[c]===void 0){if(A0[P(c)]!==void 0)throw new w(c+" (signals must use all capital letters)");throw new w(c)}}var l=k((c,o="buffer")=>{if(!J0(c))throw new j(o,["Buffer","TypedArray","DataView"],c)});function X0(c,o){let N0=d(o),s=c.length;if(N0==="hex"&&s%2!==0)throw new x("encoding",o,`is invalid for data of length ${s}`)}function m(c,o="Port",N0=!0){if(typeof c!=="number"&&typeof c!=="string"||typeof c==="string"&&_(c).length===0||+c!==+c>>>0||c>65535||c===0&&!N0)throw new B(o,c,N0);return c|0}var i=k((c,o)=>{if(c!==void 0&&(c===null||typeof c!=="object"||!("aborted"in c)))throw new j(o,"AbortSignal",c)}),g0=k((c,o)=>{if(typeof c!=="function")throw new j(o,"Function",c)}),y=k((c,o)=>{if(typeof c!=="function"||Y0(c))throw new j(o,"Function",c)}),h=k((c,o)=>{if(c!==void 0)throw new j(o,"undefined",c)});function Q0(c,o,N0){if(!W(N0,c))throw new j(o,`('${C(N0,"|")}')`,c)}var t=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function e(c,o){if(typeof c>"u"||!H(t,c))throw new x(o,c,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function F0(c){if(typeof c==="string")return e(c,"hints"),c;else if(V(c)){let o=c.length,N0="";if(o===0)return N0;for(let s=0;s<o;s++){let Z0=c[s];if(e(Z0,"hints"),N0+=Z0,s!==o-1)N0+=", "}return N0}throw new x("hints",c,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}$.exports={isInt32:u,isUint32:O0,parseFileMode:J,validateArray:g,validateStringArray:p,validateBooleanArray:n,validateAbortSignalArray:V0,validateBoolean:E,validateBuffer:l,validateDictionary:v,validateEncoding:X0,validateFunction:g0,validateInt32:Y,validateInteger:Z,validateNumber:G,validateObject:D,validateOneOf:O,validatePlainFunction:y,validatePort:m,validateSignalName:r,validateString:K,validateUint32:I,validateUndefined:h,validateUnion:Q0,validateAbortSignal:i,validateLinkHeaderValue:F0}}),$O=b0((Q,$)=>{$.exports=globalThis.process}),mU=b0((Q,$)=>{var{SymbolAsyncIterator:V,SymbolIterator:W,SymbolFor:C}=n0(),F=C("nodejs.stream.destroyed"),A=C("nodejs.stream.errored"),z=C("nodejs.stream.readable"),M=C("nodejs.stream.writable"),S=C("nodejs.stream.disturbed"),R=C("nodejs.webstream.isClosedPromise"),L=C("nodejs.webstream.controllerErrorFunction");function H(T,D=!1){var v;return!!(T&&typeof T.pipe==="function"&&typeof T.on==="function"&&(!D||typeof T.pause==="function"&&typeof T.resume==="function")&&(!T._writableState||((v=T._readableState)===null||v===void 0?void 0:v.readable)!==!1)&&(!T._writableState||T._readableState))}function q(T){var D;return!!(T&&typeof T.write==="function"&&typeof T.on==="function"&&(!T._readableState||((D=T._writableState)===null||D===void 0?void 0:D.writable)!==!1))}function P(T){return!!(T&&typeof T.pipe==="function"&&T._readableState&&typeof T.on==="function"&&typeof T.write==="function")}function _(T){return T&&(T._readableState||T._writableState||typeof T.write==="function"&&typeof T.on==="function"||typeof T.pipe==="function"&&typeof T.on==="function")}function k(T){return!!(T&&!_(T)&&typeof T.pipeThrough==="function"&&typeof T.getReader==="function"&&typeof T.cancel==="function")}function B(T){return!!(T&&!_(T)&&typeof T.getWriter==="function"&&typeof T.abort==="function")}function j(T){return!!(T&&!_(T)&&typeof T.readable==="object"&&typeof T.writable==="object")}function x(T){return k(T)||B(T)||j(T)}function f(T,D){if(T==null)return!1;if(D===!0)return typeof T[V]==="function";if(D===!1)return typeof T[W]==="function";return typeof T[V]==="function"||typeof T[W]==="function"}function w(T){if(!_(T))return null;let{_writableState:D,_readableState:v}=T,g=D||v;return!!(T.destroyed||T[F]||g!==null&&g!==void 0&&g.destroyed)}function d(T){if(!q(T))return null;if(T.writableEnded===!0)return!0;let D=T._writableState;if(D!==null&&D!==void 0&&D.errored)return!1;if(typeof(D===null||D===void 0?void 0:D.ended)!=="boolean")return null;return D.ended}function Y0(T,D){if(!q(T))return null;if(T.writableFinished===!0)return!0;let v=T._writableState;if(v!==null&&v!==void 0&&v.errored)return!1;if(typeof(v===null||v===void 0?void 0:v.finished)!=="boolean")return null;return!!(v.finished||D===!1&&v.ended===!0&&v.length===0)}function J0(T){if(!H(T))return null;if(T.readableEnded===!0)return!0;let D=T._readableState;if(!D||D.errored)return!1;if(typeof(D===null||D===void 0?void 0:D.ended)!=="boolean")return null;return D.ended}function A0(T,D){if(!H(T))return null;let v=T._readableState;if(v!==null&&v!==void 0&&v.errored)return!1;if(typeof(v===null||v===void 0?void 0:v.endEmitted)!=="boolean")return null;return!!(v.endEmitted||D===!1&&v.ended===!0&&v.length===0)}function u(T){if(T&&T[z]!=null)return T[z];if(typeof(T===null||T===void 0?void 0:T.readable)!=="boolean")return null;if(w(T))return!1;return H(T)&&T.readable&&!A0(T)}function O0(T){if(T&&T[M]!=null)return T[M];if(typeof(T===null||T===void 0?void 0:T.writable)!=="boolean")return null;if(w(T))return!1;return q(T)&&T.writable&&!d(T)}function U(T,D){if(!_(T))return null;if(w(T))return!0;if((D===null||D===void 0?void 0:D.readable)!==!1&&u(T))return!1;if((D===null||D===void 0?void 0:D.writable)!==!1&&O0(T))return!1;return!0}function X(T){var D,v;if(!_(T))return null;if(T.writableErrored)return T.writableErrored;return(D=(v=T._writableState)===null||v===void 0?void 0:v.errored)!==null&&D!==void 0?D:null}function J(T){var D,v;if(!_(T))return null;if(T.readableErrored)return T.readableErrored;return(D=(v=T._readableState)===null||v===void 0?void 0:v.errored)!==null&&D!==void 0?D:null}function Z(T){if(!_(T))return null;if(typeof T.closed==="boolean")return T.closed;let{_writableState:D,_readableState:v}=T;if(typeof(D===null||D===void 0?void 0:D.closed)==="boolean"||typeof(v===null||v===void 0?void 0:v.closed)==="boolean")return(D===null||D===void 0?void 0:D.closed)||(v===null||v===void 0?void 0:v.closed);if(typeof T._closed==="boolean"&&Y(T))return T._closed;return null}function Y(T){return typeof T._closed==="boolean"&&typeof T._defaultKeepAlive==="boolean"&&typeof T._removedConnection==="boolean"&&typeof T._removedContLen==="boolean"}function I(T){return typeof T._sent100==="boolean"&&Y(T)}function K(T){var D;return typeof T._consuming==="boolean"&&typeof T._dumped==="boolean"&&((D=T.req)===null||D===void 0?void 0:D.upgradeOrConnect)===void 0}function G(T){if(!_(T))return null;let{_writableState:D,_readableState:v}=T,g=D||v;return!g&&I(T)||!!(g&&g.autoDestroy&&g.emitClose&&g.closed===!1)}function O(T){var D;return!!(T&&((D=T[S])!==null&&D!==void 0?D:T.readableDidRead||T.readableAborted))}function E(T){var D,v,g,p,n,V0,r,l,X0,m;return!!(T&&((D=(v=(g=(p=(n=(V0=T[A])!==null&&V0!==void 0?V0:T.readableErrored)!==null&&n!==void 0?n:T.writableErrored)!==null&&p!==void 0?p:(r=T._readableState)===null||r===void 0?void 0:r.errorEmitted)!==null&&g!==void 0?g:(l=T._writableState)===null||l===void 0?void 0:l.errorEmitted)!==null&&v!==void 0?v:(X0=T._readableState)===null||X0===void 0?void 0:X0.errored)!==null&&D!==void 0?D:(m=T._writableState)===null||m===void 0?void 0:m.errored))}$.exports={isDestroyed:w,kIsDestroyed:F,isDisturbed:O,kIsDisturbed:S,isErrored:E,kIsErrored:A,isReadable:u,kIsReadable:z,kIsClosedPromise:R,kControllerErrorFunction:L,kIsWritable:M,isClosed:Z,isDuplexNodeStream:P,isFinished:U,isIterable:f,isReadableNodeStream:H,isReadableStream:k,isReadableEnded:J0,isReadableFinished:A0,isReadableErrored:J,isNodeStream:_,isWebStream:x,isWritable:O0,isWritableNodeStream:q,isWritableStream:B,isWritableEnded:d,isWritableFinished:Y0,isWritableErrored:X,isServerRequest:K,isServerResponse:I,willEmitClose:G,isTransformStream:j}}),UO=b0((Q,$)=>{var V=$O(),{AbortError:W,codes:C}=zU(),{ERR_INVALID_ARG_TYPE:F,ERR_STREAM_PREMATURE_CLOSE:A}=C,{kEmptyObject:z,once:M}=_U(),{validateAbortSignal:S,validateFunction:R,validateObject:L,validateBoolean:H}=PO(),{Promise:q,PromisePrototypeThen:P,SymbolDispose:_}=n0(),{isClosed:k,isReadable:B,isReadableNodeStream:j,isReadableStream:x,isReadableFinished:f,isReadableErrored:w,isWritable:d,isWritableNodeStream:Y0,isWritableStream:J0,isWritableFinished:A0,isWritableErrored:u,isNodeStream:O0,willEmitClose:U,kIsClosedPromise:X}=mU(),J;function Z(O){return O.setHeader&&typeof O.abort==="function"}var Y=()=>{};function I(O,E,T){var D,v;if(arguments.length===2)T=E,E=z;else if(E==null)E=z;else L(E,"options");if(R(T,"callback"),S(E.signal,"options.signal"),T=M(T),x(O)||J0(O))return K(O,E,T);if(!O0(O))throw new F("stream",["ReadableStream","WritableStream","Stream"],O);let g=(D=E.readable)!==null&&D!==void 0?D:j(O),p=(v=E.writable)!==null&&v!==void 0?v:Y0(O),n=O._writableState,V0=O._readableState,r=()=>{if(!O.writable)m()},l=U(O)&&j(O)===g&&Y0(O)===p,X0=A0(O,!1),m=()=>{if(X0=!0,O.destroyed)l=!1;if(l&&(!O.readable||g))return;if(!g||i)T.call(O)},i=f(O,!1),g0=()=>{if(i=!0,O.destroyed)l=!1;if(l&&(!O.writable||p))return;if(!p||X0)T.call(O)},y=(c)=>{T.call(O,c)},h=k(O),Q0=()=>{h=!0;let c=u(O)||w(O);if(c&&typeof c!=="boolean")return T.call(O,c);if(g&&!i&&j(O,!0)){if(!f(O,!1))return T.call(O,new A)}if(p&&!X0){if(!A0(O,!1))return T.call(O,new A)}T.call(O)},t=()=>{h=!0;let c=u(O)||w(O);if(c&&typeof c!=="boolean")return T.call(O,c);T.call(O)},e=()=>{O.req.on("finish",m)};if(Z(O)){if(O.on("complete",m),!l)O.on("abort",Q0);if(O.req)e();else O.on("request",e)}else if(p&&!n)O.on("end",r),O.on("close",r);if(!l&&typeof O.aborted==="boolean")O.on("aborted",Q0);if(O.on("end",g0),O.on("finish",m),E.error!==!1)O.on("error",y);if(O.on("close",Q0),h)V.nextTick(Q0);else if(n!==null&&n!==void 0&&n.errorEmitted||V0!==null&&V0!==void 0&&V0.errorEmitted){if(!l)V.nextTick(t)}else if(!g&&(!l||B(O))&&(X0||d(O)===!1))V.nextTick(t);else if(!p&&(!l||d(O))&&(i||B(O)===!1))V.nextTick(t);else if(V0&&O.req&&O.aborted)V.nextTick(t);let F0=()=>{if(T=Y,O.removeListener("aborted",Q0),O.removeListener("complete",m),O.removeListener("abort",Q0),O.removeListener("request",e),O.req)O.req.removeListener("finish",m);O.removeListener("end",r),O.removeListener("close",r),O.removeListener("finish",m),O.removeListener("end",g0),O.removeListener("error",y),O.removeListener("close",Q0)};if(E.signal&&!h){let c=()=>{let o=T;F0(),o.call(O,new W(void 0,{cause:E.signal.reason}))};if(E.signal.aborted)V.nextTick(c);else{J=J||_U().addAbortListener;let o=J(E.signal,c),N0=T;T=M((...s)=>{o[_](),N0.apply(O,s)})}}return F0}function K(O,E,T){let D=!1,v=Y;if(E.signal)if(v=()=>{D=!0,T.call(O,new W(void 0,{cause:E.signal.reason}))},E.signal.aborted)V.nextTick(v);else{J=J||_U().addAbortListener;let p=J(E.signal,v),n=T;T=M((...V0)=>{p[_](),n.apply(O,V0)})}let g=(...p)=>{if(!D)V.nextTick(()=>T.apply(O,p))};return P(O[X].promise,g,g),Y}function G(O,E){var T;let D=!1;if(E===null)E=z;if((T=E)!==null&&T!==void 0&&T.cleanup)H(E.cleanup,"cleanup"),D=E.cleanup;return new q((v,g)=>{let p=I(O,E,(n)=>{if(D)p();if(n)g(n);else v()})})}$.exports=I,$.exports.finished=G}),EO=b0((Q,$)=>{var V=$O(),{aggregateTwoErrors:W,codes:{ERR_MULTIPLE_CALLBACK:C},AbortError:F}=zU(),{Symbol:A}=n0(),{kIsDestroyed:z,isDestroyed:M,isFinished:S,isServerRequest:R}=mU(),L=A("kDestroy"),H=A("kConstruct");function q(U,X,J){if(U){if(U.stack,X&&!X.errored)X.errored=U;if(J&&!J.errored)J.errored=U}}function P(U,X){let J=this._readableState,Z=this._writableState,Y=Z||J;if(Z!==null&&Z!==void 0&&Z.destroyed||J!==null&&J!==void 0&&J.destroyed){if(typeof X==="function")X();return this}if(q(U,Z,J),Z)Z.destroyed=!0;if(J)J.destroyed=!0;if(!Y.constructed)this.once(L,function(I){_(this,W(I,U),X)});else _(this,U,X);return this}function _(U,X,J){let Z=!1;function Y(I){if(Z)return;Z=!0;let{_readableState:K,_writableState:G}=U;if(q(I,G,K),G)G.closed=!0;if(K)K.closed=!0;if(typeof J==="function")J(I);if(I)V.nextTick(k,U,I);else V.nextTick(B,U)}try{U._destroy(X||null,Y)}catch(I){Y(I)}}function k(U,X){j(U,X),B(U)}function B(U){let{_readableState:X,_writableState:J}=U;if(J)J.closeEmitted=!0;if(X)X.closeEmitted=!0;if(J!==null&&J!==void 0&&J.emitClose||X!==null&&X!==void 0&&X.emitClose)U.emit("close")}function j(U,X){let{_readableState:J,_writableState:Z}=U;if(Z!==null&&Z!==void 0&&Z.errorEmitted||J!==null&&J!==void 0&&J.errorEmitted)return;if(Z)Z.errorEmitted=!0;if(J)J.errorEmitted=!0;U.emit("error",X)}function x(){let U=this._readableState,X=this._writableState;if(U)U.constructed=!0,U.closed=!1,U.closeEmitted=!1,U.destroyed=!1,U.errored=null,U.errorEmitted=!1,U.reading=!1,U.ended=U.readable===!1,U.endEmitted=U.readable===!1;if(X)X.constructed=!0,X.destroyed=!1,X.closed=!1,X.closeEmitted=!1,X.errored=null,X.errorEmitted=!1,X.finalCalled=!1,X.prefinished=!1,X.ended=X.writable===!1,X.ending=X.writable===!1,X.finished=X.writable===!1}function f(U,X,J){let{_readableState:Z,_writableState:Y}=U;if(Y!==null&&Y!==void 0&&Y.destroyed||Z!==null&&Z!==void 0&&Z.destroyed)return this;if(Z!==null&&Z!==void 0&&Z.autoDestroy||Y!==null&&Y!==void 0&&Y.autoDestroy)U.destroy(X);else if(X){if(X.stack,Y&&!Y.errored)Y.errored=X;if(Z&&!Z.errored)Z.errored=X;if(J)V.nextTick(j,U,X);else j(U,X)}}function w(U,X){if(typeof U._construct!=="function")return;let{_readableState:J,_writableState:Z}=U;if(J)J.constructed=!1;if(Z)Z.constructed=!1;if(U.once(H,X),U.listenerCount(H)>1)return;V.nextTick(d,U)}function d(U){let X=!1;function J(Z){if(X){f(U,Z!==null&&Z!==void 0?Z:new C);return}X=!0;let{_readableState:Y,_writableState:I}=U,K=I||Y;if(Y)Y.constructed=!0;if(I)I.constructed=!0;if(K.destroyed)U.emit(L,Z);else if(Z)f(U,Z,!0);else V.nextTick(Y0,U)}try{U._construct((Z)=>{V.nextTick(J,Z)})}catch(Z){V.nextTick(J,Z)}}function Y0(U){U.emit(H)}function J0(U){return(U===null||U===void 0?void 0:U.setHeader)&&typeof U.abort==="function"}function A0(U){U.emit("close")}function u(U,X){U.emit("error",X),V.nextTick(A0,U)}function O0(U,X){if(!U||M(U))return;if(!X&&!S(U))X=new F;if(R(U))U.socket=null,U.destroy(X);else if(J0(U))U.abort();else if(J0(U.req))U.req.abort();else if(typeof U.destroy==="function")U.destroy(X);else if(typeof U.close==="function")U.close();else if(X)V.nextTick(u,U,X);else V.nextTick(A0,U);if(!U.destroyed)U[z]=!0}$.exports={construct:w,destroyer:O0,destroy:P,undestroy:x,errorOrDestroy:f}}),_Z=b0((Q,$)=>{var{ArrayIsArray:V,ObjectSetPrototypeOf:W}=n0(),{EventEmitter:C}=(MO(),h0(zO));function F(z){C.call(this,z)}W(F.prototype,C.prototype),W(F,C),F.prototype.pipe=function(z,M){let S=this;function R(B){if(z.writable&&z.write(B)===!1&&S.pause)S.pause()}S.on("data",R);function L(){if(S.readable&&S.resume)S.resume()}if(z.on("drain",L),!z._isStdio&&(!M||M.end!==!1))S.on("end",q),S.on("close",P);let H=!1;function q(){if(H)return;H=!0,z.end()}function P(){if(H)return;if(H=!0,typeof z.destroy==="function")z.destroy()}function _(B){if(k(),C.listenerCount(this,"error")===0)this.emit("error",B)}A(S,"error",_),A(z,"error",_);function k(){S.removeListener("data",R),z.removeListener("drain",L),S.removeListener("end",q),S.removeListener("close",P),S.removeListener("error",_),z.removeListener("error",_),S.removeListener("end",k),S.removeListener("close",k),z.removeListener("close",k)}return S.on("end",k),S.on("close",k),z.on("close",k),z.emit("pipe",S),z};function A(z,M,S){if(typeof z.prependListener==="function")return z.prependListener(M,S);if(!z._events||!z._events[M])z.on(M,S);else if(V(z._events[M]))z._events[M].unshift(S);else z._events[M]=[S,z._events[M]]}$.exports={Stream:F,prependListener:A}}),uO=b0((Q,$)=>{var{SymbolDispose:V}=n0(),{AbortError:W,codes:C}=zU(),{isNodeStream:F,isWebStream:A,kControllerErrorFunction:z}=mU(),M=UO(),{ERR_INVALID_ARG_TYPE:S}=C,R,L=(H,q)=>{if(typeof H!=="object"||!("aborted"in H))throw new S(q,"AbortSignal",H)};$.exports.addAbortSignal=function(H,q){if(L(H,"signal"),!F(q)&&!A(q))throw new S("stream",["ReadableStream","WritableStream","Stream"],q);return $.exports.addAbortSignalNoValidate(H,q)},$.exports.addAbortSignalNoValidate=function(H,q){if(typeof H!=="object"||!("aborted"in H))return q;let P=F(q)?()=>{q.destroy(new W(void 0,{cause:H.reason}))}:()=>{q[z](new W(void 0,{cause:H.reason}))};if(H.aborted)P();else{R=R||_U().addAbortListener;let _=R(H,P);M(q,_[V])}return q}}),yA=b0((Q,$)=>{var{StringPrototypeSlice:V,SymbolIterator:W,TypedArrayPrototypeSet:C,Uint8Array:F}=n0(),{Buffer:A}=(HU(),h0(WU)),{inspect:z}=_U();$.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(M){let S={data:M,next:null};if(this.length>0)this.tail.next=S;else this.head=S;this.tail=S,++this.length}unshift(M){let S={data:M,next:this.head};if(this.length===0)this.tail=S;this.head=S,++this.length}shift(){if(this.length===0)return;let M=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;return--this.length,M}clear(){this.head=this.tail=null,this.length=0}join(M){if(this.length===0)return"";let S=this.head,R=""+S.data;while((S=S.next)!==null)R+=M+S.data;return R}concat(M){if(this.length===0)return A.alloc(0);let S=A.allocUnsafe(M>>>0),R=this.head,L=0;while(R)C(S,R.data,L),L+=R.data.length,R=R.next;return S}consume(M,S){let R=this.head.data;if(M<R.length){let L=R.slice(0,M);return this.head.data=R.slice(M),L}if(M===R.length)return this.shift();return S?this._getString(M):this._getBuffer(M)}first(){return this.head.data}*[W](){for(let M=this.head;M;M=M.next)yield M.data}_getString(M){let S="",R=this.head,L=0;do{let H=R.data;if(M>H.length)S+=H,M-=H.length;else{if(M===H.length)if(S+=H,++L,R.next)this.head=R.next;else this.head=this.tail=null;else S+=V(H,0,M),this.head=R,R.data=V(H,M);break}++L}while((R=R.next)!==null);return this.length-=L,S}_getBuffer(M){let S=A.allocUnsafe(M),R=M,L=this.head,H=0;do{let q=L.data;if(M>q.length)C(S,q,R-M),M-=q.length;else{if(M===q.length)if(C(S,q,R-M),++H,L.next)this.head=L.next;else this.head=this.tail=null;else C(S,new F(q.buffer,q.byteOffset,M),R-M),this.head=L,L.data=q.slice(M);break}++H}while((L=L.next)!==null);return this.length-=H,S}[Symbol.for("nodejs.util.inspect.custom")](M,S){return z(this,{...S,depth:0,customInspect:!1})}}}),bO=b0((Q,$)=>{var{MathFloor:V,NumberIsInteger:W}=n0(),{validateInteger:C}=PO(),{ERR_INVALID_ARG_VALUE:F}=zU().codes,A=16384,z=16;function M(H,q,P){return H.highWaterMark!=null?H.highWaterMark:q?H[P]:null}function S(H){return H?z:A}function R(H,q){if(C(q,"value",0),H)z=q;else A=q}function L(H,q,P,_){let k=M(q,_,P);if(k!=null){if(!W(k)||k<0){let B=_?`options.${P}`:"options.highWaterMark";throw new F(B,k)}return V(k)}return S(H.objectMode)}$.exports={getHighWaterMark:L,getDefaultHighWaterMark:S,setDefaultHighWaterMark:R}}),cA=b0((Q,$)=>{/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var V=(HU(),h0(WU)),W=V.Buffer;function C(A,z){for(var M in A)z[M]=A[M]}if(W.from&&W.alloc&&W.allocUnsafe&&W.allocUnsafeSlow)$.exports=V;else C(V,Q),Q.Buffer=F;function F(A,z,M){return W(A,z,M)}F.prototype=Object.create(W.prototype),C(W,F),F.from=function(A,z,M){if(typeof A==="number")throw TypeError("Argument must not be a number");return W(A,z,M)},F.alloc=function(A,z,M){if(typeof A!=="number")throw TypeError("Argument must be a number");var S=W(A);if(z!==void 0)if(typeof M==="string")S.fill(z,M);else S.fill(z);else S.fill(0);return S},F.allocUnsafe=function(A){if(typeof A!=="number")throw TypeError("Argument must be a number");return W(A)},F.allocUnsafeSlow=function(A){if(typeof A!=="number")throw TypeError("Argument must be a number");return V.SlowBuffer(A)}}),pA=b0((Q)=>{var $=cA().Buffer,V=$.isEncoding||function(j){switch(j=""+j,j&&j.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function W(j){if(!j)return"utf8";var x;while(!0)switch(j){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return j;default:if(x)return;j=(""+j).toLowerCase(),x=!0}}function C(j){var x=W(j);if(typeof x!=="string"&&($.isEncoding===V||!V(j)))throw Error("Unknown encoding: "+j);return x||j}Q.StringDecoder=F;function F(j){this.encoding=C(j);var x;switch(this.encoding){case"utf16le":this.text=H,this.end=q,x=4;break;case"utf8":this.fillLast=S,x=4;break;case"base64":this.text=P,this.end=_,x=3;break;default:this.write=k,this.end=B;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=$.allocUnsafe(x)}F.prototype.write=function(j){if(j.length===0)return"";var x,f;if(this.lastNeed){if(x=this.fillLast(j),x===void 0)return"";f=this.lastNeed,this.lastNeed=0}else f=0;if(f<j.length)return x?x+this.text(j,f):this.text(j,f);return x||""},F.prototype.end=L,F.prototype.text=R,F.prototype.fillLast=function(j){if(this.lastNeed<=j.length)return j.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);j.copy(this.lastChar,this.lastTotal-this.lastNeed,0,j.length),this.lastNeed-=j.length};function A(j){if(j<=127)return 0;else if(j>>5===6)return 2;else if(j>>4===14)return 3;else if(j>>3===30)return 4;return j>>6===2?-1:-2}function z(j,x,f){var w=x.length-1;if(w<f)return 0;var d=A(x[w]);if(d>=0){if(d>0)j.lastNeed=d-1;return d}if(--w<f||d===-2)return 0;if(d=A(x[w]),d>=0){if(d>0)j.lastNeed=d-2;return d}if(--w<f||d===-2)return 0;if(d=A(x[w]),d>=0){if(d>0)if(d===2)d=0;else j.lastNeed=d-3;return d}return 0}function M(j,x,f){if((x[0]&192)!==128)return j.lastNeed=0,"�";if(j.lastNeed>1&&x.length>1){if((x[1]&192)!==128)return j.lastNeed=1,"�";if(j.lastNeed>2&&x.length>2){if((x[2]&192)!==128)return j.lastNeed=2,"�"}}}function S(j){var x=this.lastTotal-this.lastNeed,f=M(this,j,x);if(f!==void 0)return f;if(this.lastNeed<=j.length)return j.copy(this.lastChar,x,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);j.copy(this.lastChar,x,0,j.length),this.lastNeed-=j.length}function R(j,x){var f=z(this,j,x);if(!this.lastNeed)return j.toString("utf8",x);this.lastTotal=f;var w=j.length-(f-this.lastNeed);return j.copy(this.lastChar,0,w),j.toString("utf8",x,w)}function L(j){var x=j&&j.length?this.write(j):"";if(this.lastNeed)return x+"�";return x}function H(j,x){if((j.length-x)%2===0){var f=j.toString("utf16le",x);if(f){var w=f.charCodeAt(f.length-1);if(w>=55296&&w<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=j[j.length-2],this.lastChar[1]=j[j.length-1],f.slice(0,-1)}return f}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=j[j.length-1],j.toString("utf16le",x,j.length-1)}function q(j){var x=j&&j.length?this.write(j):"";if(this.lastNeed){var f=this.lastTotal-this.lastNeed;return x+this.lastChar.toString("utf16le",0,f)}return x}function P(j,x){var f=(j.length-x)%3;if(f===0)return j.toString("base64",x);if(this.lastNeed=3-f,this.lastTotal=3,f===1)this.lastChar[0]=j[j.length-1];else this.lastChar[0]=j[j.length-2],this.lastChar[1]=j[j.length-1];return j.toString("base64",x,j.length-f)}function _(j){var x=j&&j.length?this.write(j):"";if(this.lastNeed)return x+this.lastChar.toString("base64",0,3-this.lastNeed);return x}function k(j){return j.toString(this.encoding)}function B(j){return j&&j.length?this.write(j):""}}),TQ=b0((Q,$)=>{var V=$O(),{PromisePrototypeThen:W,SymbolAsyncIterator:C,SymbolIterator:F}=n0(),{Buffer:A}=(HU(),h0(WU)),{ERR_INVALID_ARG_TYPE:z,ERR_STREAM_NULL_VALUES:M}=zU().codes;function S(R,L,H){let q;if(typeof L==="string"||L instanceof A)return new R({objectMode:!0,...H,read(){this.push(L),this.push(null)}});let P;if(L&&L[C])P=!0,q=L[C]();else if(L&&L[F])P=!1,q=L[F]();else throw new z("iterable",["Iterable"],L);let _=new R({objectMode:!0,highWaterMark:1,...H}),k=!1;_._read=function(){if(!k)k=!0,j()},_._destroy=function(x,f){W(B(x),()=>V.nextTick(f,x),(w)=>V.nextTick(f,w||x))};async function B(x){let f=x!==void 0&&x!==null,w=typeof q.throw==="function";if(f&&w){let{value:d,done:Y0}=await q.throw(x);if(await d,Y0)return}if(typeof q.return==="function"){let{value:d}=await q.return();await d}}async function j(){for(;;){try{let{value:x,done:f}=P?await q.next():q.next();if(f)_.push(null);else{let w=x&&typeof x.then==="function"?await x:x;if(w===null)throw k=!1,new M;else if(_.push(w))continue;else k=!1}}catch(x){_.destroy(x)}break}}return _}$.exports=S}),lO=b0((Q,$)=>{var V=$O(),{ArrayPrototypeIndexOf:W,NumberIsInteger:C,NumberIsNaN:F,NumberParseInt:A,ObjectDefineProperties:z,ObjectKeys:M,ObjectSetPrototypeOf:S,Promise:R,SafeSet:L,SymbolAsyncDispose:H,SymbolAsyncIterator:q,Symbol:P}=n0();$.exports=s,s.ReadableState=N0;var{EventEmitter:_}=(MO(),h0(zO)),{Stream:k,prependListener:B}=_Z(),{Buffer:j}=(HU(),h0(WU)),{addAbortSignal:x}=uO(),f=UO(),w=_U().debuglog("stream",(N)=>{w=N}),d=yA(),Y0=EO(),{getHighWaterMark:J0,getDefaultHighWaterMark:A0}=bO(),{aggregateTwoErrors:u,codes:{ERR_INVALID_ARG_TYPE:O0,ERR_METHOD_NOT_IMPLEMENTED:U,ERR_OUT_OF_RANGE:X,ERR_STREAM_PUSH_AFTER_EOF:J,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:Z},AbortError:Y}=zU(),{validateObject:I}=PO(),K=P("kPaused"),{StringDecoder:G}=pA(),O=TQ();S(s.prototype,k.prototype),S(s,k);var E=()=>{},{errorOrDestroy:T}=Y0,D=1,v=2,g=4,p=8,n=16,V0=32,r=64,l=128,X0=256,m=512,i=1024,g0=2048,y=4096,h=8192,Q0=16384,t=32768,e=65536,F0=131072,c=262144;function o(N){return{enumerable:!1,get(){return(this.state&N)!==0},set(b){if(b)this.state|=N;else this.state&=~N}}}z(N0.prototype,{objectMode:o(D),ended:o(v),endEmitted:o(g),reading:o(p),constructed:o(n),sync:o(V0),needReadable:o(r),emittedReadable:o(l),readableListening:o(X0),resumeScheduled:o(m),errorEmitted:o(i),emitClose:o(g0),autoDestroy:o(y),destroyed:o(h),closed:o(Q0),closeEmitted:o(t),multiAwaitDrain:o(e),readingMore:o(F0),dataEmitted:o(c)});function N0(N,b,a){if(typeof a!=="boolean")a=b instanceof nU();if(this.state=g0|y|n|V0,N&&N.objectMode)this.state|=D;if(a&&N&&N.readableObjectMode)this.state|=D;if(this.highWaterMark=N?J0(this,N,"readableHighWaterMark",a):A0(!1),this.buffer=new d,this.length=0,this.pipes=[],this.flowing=null,this[K]=null,N&&N.emitClose===!1)this.state&=~g0;if(N&&N.autoDestroy===!1)this.state&=~y;if(this.errored=null,this.defaultEncoding=N&&N.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,N&&N.encoding)this.decoder=new G(N.encoding),this.encoding=N.encoding}function s(N){if(!(this instanceof s))return new s(N);let b=this instanceof nU();if(this._readableState=new N0(N,this,b),N){if(typeof N.read==="function")this._read=N.read;if(typeof N.destroy==="function")this._destroy=N.destroy;if(typeof N.construct==="function")this._construct=N.construct;if(N.signal&&!b)x(N.signal,this)}k.call(this,N),Y0.construct(this,()=>{if(this._readableState.needReadable)D0(this,this._readableState)})}s.prototype.destroy=Y0.destroy,s.prototype._undestroy=Y0.undestroy,s.prototype._destroy=function(N,b){b(N)},s.prototype[_.captureRejectionSymbol]=function(N){this.destroy(N)},s.prototype[H]=function(){let N;if(!this.destroyed)N=this.readableEnded?null:new Y,this.destroy(N);return new R((b,a)=>f(this,(U0)=>U0&&U0!==N?a(U0):b(null)))},s.prototype.push=function(N,b){return Z0(this,N,b,!1)},s.prototype.unshift=function(N,b){return Z0(this,N,b,!0)};function Z0(N,b,a,U0){w("readableAddChunk",b);let f0=N._readableState,I0;if((f0.state&D)===0){if(typeof b==="string"){if(a=a||f0.defaultEncoding,f0.encoding!==a)if(U0&&f0.encoding)b=j.from(b,a).toString(f0.encoding);else b=j.from(b,a),a=""}else if(b instanceof j)a="";else if(k._isUint8Array(b))b=k._uint8ArrayToBuffer(b),a="";else if(b!=null)I0=new O0("chunk",["string","Buffer","Uint8Array"],b)}if(I0)T(N,I0);else if(b===null)f0.state&=~p,E0(N,f0);else if((f0.state&D)!==0||b&&b.length>0)if(U0)if((f0.state&g)!==0)T(N,new Z);else if(f0.destroyed||f0.errored)return!1;else w0(N,f0,b,!0);else if(f0.ended)T(N,new J);else if(f0.destroyed||f0.errored)return!1;else if(f0.state&=~p,f0.decoder&&!a)if(b=f0.decoder.write(b),f0.objectMode||b.length!==0)w0(N,f0,b,!1);else D0(N,f0);else w0(N,f0,b,!1);else if(!U0)f0.state&=~p,D0(N,f0);return!f0.ended&&(f0.length<f0.highWaterMark||f0.length===0)}function w0(N,b,a,U0){if(b.flowing&&b.length===0&&!b.sync&&N.listenerCount("data")>0){if((b.state&e)!==0)b.awaitDrainWriters.clear();else b.awaitDrainWriters=null;b.dataEmitted=!0,N.emit("data",a)}else{if(b.length+=b.objectMode?1:a.length,U0)b.buffer.unshift(a);else b.buffer.push(a);if((b.state&r)!==0)L0(N)}D0(N,b)}s.prototype.isPaused=function(){let N=this._readableState;return N[K]===!0||N.flowing===!1},s.prototype.setEncoding=function(N){let b=new G(N);this._readableState.decoder=b,this._readableState.encoding=this._readableState.decoder.encoding;let a=this._readableState.buffer,U0="";for(let f0 of a)U0+=b.write(f0);if(a.clear(),U0!=="")a.push(U0);return this._readableState.length=U0.length,this};var C0=1073741824;function K0(N){if(N>C0)throw new X("size","<= 1GiB",N);else N--,N|=N>>>1,N|=N>>>2,N|=N>>>4,N|=N>>>8,N|=N>>>16,N++;return N}function s0(N,b){if(N<=0||b.length===0&&b.ended)return 0;if((b.state&D)!==0)return 1;if(F(N)){if(b.flowing&&b.length)return b.buffer.first().length;return b.length}if(N<=b.length)return N;return b.ended?b.length:0}s.prototype.read=function(N){if(w("read",N),N===void 0)N=NaN;else if(!C(N))N=A(N,10);let b=this._readableState,a=N;if(N>b.highWaterMark)b.highWaterMark=K0(N);if(N!==0)b.state&=~l;if(N===0&&b.needReadable&&((b.highWaterMark!==0?b.length>=b.highWaterMark:b.length>0)||b.ended)){if(w("read: emitReadable",b.length,b.ended),b.length===0&&b.ended)CU(this);else L0(this);return null}if(N=s0(N,b),N===0&&b.ended){if(b.length===0)CU(this);return null}let U0=(b.state&r)!==0;if(w("need readable",U0),b.length===0||b.length-N<b.highWaterMark)U0=!0,w("length less than watermark",U0);if(b.ended||b.reading||b.destroyed||b.errored||!b.constructed)U0=!1,w("reading, ended or constructing",U0);else if(U0){if(w("do read"),b.state|=p|V0,b.length===0)b.state|=r;try{this._read(b.highWaterMark)}catch(I0){T(this,I0)}if(b.state&=~V0,!b.reading)N=s0(a,b)}let f0;if(N>0)f0=z0(N,b);else f0=null;if(f0===null)b.needReadable=b.length<=b.highWaterMark,N=0;else if(b.length-=N,b.multiAwaitDrain)b.awaitDrainWriters.clear();else b.awaitDrainWriters=null;if(b.length===0){if(!b.ended)b.needReadable=!0;if(a!==N&&b.ended)CU(this)}if(f0!==null&&!b.errorEmitted&&!b.closeEmitted)b.dataEmitted=!0,this.emit("data",f0);return f0};function E0(N,b){if(w("onEofChunk"),b.ended)return;if(b.decoder){let a=b.decoder.end();if(a&&a.length)b.buffer.push(a),b.length+=b.objectMode?1:a.length}if(b.ended=!0,b.sync)L0(N);else b.needReadable=!1,b.emittedReadable=!0,e0(N)}function L0(N){let b=N._readableState;if(w("emitReadable",b.needReadable,b.emittedReadable),b.needReadable=!1,!b.emittedReadable)w("emitReadable",b.flowing),b.emittedReadable=!0,V.nextTick(e0,N)}function e0(N){let b=N._readableState;if(w("emitReadable_",b.destroyed,b.length,b.ended),!b.destroyed&&!b.errored&&(b.length||b.ended))N.emit("readable"),b.emittedReadable=!1;b.needReadable=!b.flowing&&!b.ended&&b.length<=b.highWaterMark,T0(N)}function D0(N,b){if(!b.readingMore&&b.constructed)b.readingMore=!0,V.nextTick(H0,N,b)}function H0(N,b){while(!b.reading&&!b.ended&&(b.length<b.highWaterMark||b.flowing&&b.length===0)){let a=b.length;if(w("maybeReadMore read 0"),N.read(0),a===b.length)break}b.readingMore=!1}s.prototype._read=function(N){throw new U("_read()")},s.prototype.pipe=function(N,b){let a=this,U0=this._readableState;if(U0.pipes.length===1){if(!U0.multiAwaitDrain)U0.multiAwaitDrain=!0,U0.awaitDrainWriters=new L(U0.awaitDrainWriters?[U0.awaitDrainWriters]:[])}U0.pipes.push(N),w("pipe count=%d opts=%j",U0.pipes.length,b);let f0=(!b||b.end!==!1)&&N!==V.stdout&&N!==V.stderr?W0:y0;if(U0.endEmitted)V.nextTick(f0);else a.once("end",f0);N.on("unpipe",I0);function I0(d0,l0){if(w("onunpipe"),d0===a){if(l0&&l0.hasUnpiped===!1)l0.hasUnpiped=!0,x0()}}function W0(){w("onend"),N.end()}let t0,q0=!1;function x0(){if(w("cleanup"),N.removeListener("close",r0),N.removeListener("finish",c0),t0)N.removeListener("drain",t0);if(N.removeListener("error",S0),N.removeListener("unpipe",I0),a.removeListener("end",W0),a.removeListener("end",y0),a.removeListener("data",P0),q0=!0,t0&&U0.awaitDrainWriters&&(!N._writableState||N._writableState.needDrain))t0()}function SU(){if(!q0){if(U0.pipes.length===1&&U0.pipes[0]===N)w("false write response, pause",0),U0.awaitDrainWriters=N,U0.multiAwaitDrain=!1;else if(U0.pipes.length>1&&U0.pipes.includes(N))w("false write response, pause",U0.awaitDrainWriters.size),U0.awaitDrainWriters.add(N);a.pause()}if(!t0)t0=FU(a,N),N.on("drain",t0)}a.on("data",P0);function P0(d0){w("ondata");let l0=N.write(d0);if(w("dest.write",l0),l0===!1)SU()}function S0(d0){if(w("onerror",d0),y0(),N.removeListener("error",S0),N.listenerCount("error")===0){let l0=N._writableState||N._readableState;if(l0&&!l0.errorEmitted)T(N,d0);else N.emit("error",d0)}}B(N,"error",S0);function r0(){N.removeListener("finish",c0),y0()}N.once("close",r0);function c0(){w("onfinish"),N.removeListener("close",r0),y0()}N.once("finish",c0);function y0(){w("unpipe"),a.unpipe(N)}if(N.emit("pipe",a),N.writableNeedDrain===!0)SU();else if(!U0.flowing)w("pipe resume"),a.resume();return N};function FU(N,b){return function(){let a=N._readableState;if(a.awaitDrainWriters===b)w("pipeOnDrain",1),a.awaitDrainWriters=null;else if(a.multiAwaitDrain)w("pipeOnDrain",a.awaitDrainWriters.size),a.awaitDrainWriters.delete(b);if((!a.awaitDrainWriters||a.awaitDrainWriters.size===0)&&N.listenerCount("data"))N.resume()}}s.prototype.unpipe=function(N){let b=this._readableState,a={hasUnpiped:!1};if(b.pipes.length===0)return this;if(!N){let f0=b.pipes;b.pipes=[],this.pause();for(let I0=0;I0<f0.length;I0++)f0[I0].emit("unpipe",this,{hasUnpiped:!1});return this}let U0=W(b.pipes,N);if(U0===-1)return this;if(b.pipes.splice(U0,1),b.pipes.length===0)this.pause();return N.emit("unpipe",this,a),this},s.prototype.on=function(N,b){let a=k.prototype.on.call(this,N,b),U0=this._readableState;if(N==="data"){if(U0.readableListening=this.listenerCount("readable")>0,U0.flowing!==!1)this.resume()}else if(N==="readable"){if(!U0.endEmitted&&!U0.readableListening){if(U0.readableListening=U0.needReadable=!0,U0.flowing=!1,U0.emittedReadable=!1,w("on readable",U0.length,U0.reading),U0.length)L0(this);else if(!U0.reading)V.nextTick(k0,this)}}return a},s.prototype.addListener=s.prototype.on,s.prototype.removeListener=function(N,b){let a=k.prototype.removeListener.call(this,N,b);if(N==="readable")V.nextTick(R0,this);return a},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(N){let b=k.prototype.removeAllListeners.apply(this,arguments);if(N==="readable"||N===void 0)V.nextTick(R0,this);return b};function R0(N){let b=N._readableState;if(b.readableListening=N.listenerCount("readable")>0,b.resumeScheduled&&b[K]===!1)b.flowing=!0;else if(N.listenerCount("data")>0)N.resume();else if(!b.readableListening)b.flowing=null}function k0(N){w("readable nexttick read 0"),N.read(0)}s.prototype.resume=function(){let N=this._readableState;if(!N.flowing)w("resume"),N.flowing=!N.readableListening,RU(this,N);return N[K]=!1,this};function RU(N,b){if(!b.resumeScheduled)b.resumeScheduled=!0,V.nextTick(_0,N,b)}function _0(N,b){if(w("resume",b.reading),!b.reading)N.read(0);if(b.resumeScheduled=!1,N.emit("resume"),T0(N),b.flowing&&!b.reading)N.read(0)}s.prototype.pause=function(){if(w("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1)w("pause"),this._readableState.flowing=!1,this.emit("pause");return this._readableState[K]=!0,this};function T0(N){let b=N._readableState;w("flow",b.flowing);while(b.flowing&&N.read()!==null);}s.prototype.wrap=function(N){let b=!1;N.on("data",(U0)=>{if(!this.push(U0)&&N.pause)b=!0,N.pause()}),N.on("end",()=>{this.push(null)}),N.on("error",(U0)=>{T(this,U0)}),N.on("close",()=>{this.destroy()}),N.on("destroy",()=>{this.destroy()}),this._read=()=>{if(b&&N.resume)b=!1,N.resume()};let a=M(N);for(let U0=1;U0<a.length;U0++){let f0=a[U0];if(this[f0]===void 0&&typeof N[f0]==="function")this[f0]=N[f0].bind(N)}return this},s.prototype[q]=function(){return DU(this)},s.prototype.iterator=function(N){if(N!==void 0)I(N,"options");return DU(this,N)};function DU(N,b){if(typeof N.read!=="function")N=s.wrap(N,{objectMode:!0});let a=v0(N,b);return a.stream=N,a}async function*v0(N,b){let a=E;function U0(W0){if(this===N)a(),a=E;else a=W0}N.on("readable",U0);let f0,I0=f(N,{writable:!1},(W0)=>{f0=W0?u(f0,W0):null,a(),a=E});try{while(!0){let W0=N.destroyed?null:N.read();if(W0!==null)yield W0;else if(f0)throw f0;else if(f0===null)return;else await new R(U0)}}catch(W0){throw f0=u(f0,W0),f0}finally{if((f0||(b===null||b===void 0?void 0:b.destroyOnReturn)!==!1)&&(f0===void 0||N._readableState.autoDestroy))Y0.destroyer(N,null);else N.off("readable",U0),I0()}}z(s.prototype,{readable:{__proto__:null,get(){let N=this._readableState;return!!N&&N.readable!==!1&&!N.destroyed&&!N.errorEmitted&&!N.endEmitted},set(N){if(this._readableState)this._readableState.readable=!!N}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(N){if(this._readableState)this._readableState.flowing=N}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return this._readableState?this._readableState.closed:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set(N){if(!this._readableState)return;this._readableState.destroyed=N}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}}),z(N0.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[K]!==!1},set(N){this[K]=!!N}}}),s._fromList=z0;function z0(N,b){if(b.length===0)return null;let a;if(b.objectMode)a=b.buffer.shift();else if(!N||N>=b.length){if(b.decoder)a=b.buffer.join("");else if(b.buffer.length===1)a=b.buffer.first();else a=b.buffer.concat(b.length);b.buffer.clear()}else a=b.buffer.consume(N,b.decoder);return a}function CU(N){let b=N._readableState;if(w("endReadable",b.endEmitted),!b.endEmitted)b.ended=!0,V.nextTick(j0,b,N)}function j0(N,b){if(w("endReadableNT",N.endEmitted,N.length),!N.errored&&!N.closeEmitted&&!N.endEmitted&&N.length===0){if(N.endEmitted=!0,b.emit("end"),b.writable&&b.allowHalfOpen===!1)V.nextTick(B0,b);else if(N.autoDestroy){let a=b._writableState;if(!a||a.autoDestroy&&(a.finished||a.writable===!1))b.destroy()}}}function B0(N){if(N.writable&&!N.writableEnded&&!N.destroyed)N.end()}s.from=function(N,b){return O(s,N,b)};var KU;function M0(){if(KU===void 0)KU={};return KU}s.fromWeb=function(N,b){return M0().newStreamReadableFromReadableStream(N,b)},s.toWeb=function(N,b){return M0().newReadableStreamFromStreamReadable(N,b)},s.wrap=function(N,b){var a,U0;return new s({objectMode:(a=(U0=N.readableObjectMode)!==null&&U0!==void 0?U0:N.objectMode)!==null&&a!==void 0?a:!0,...b,destroy(f0,I0){Y0.destroyer(N,f0),I0(f0)}}).wrap(N)}}),vZ=b0((Q,$)=>{var V=$O(),{ArrayPrototypeSlice:W,Error:C,FunctionPrototypeSymbolHasInstance:F,ObjectDefineProperty:A,ObjectDefineProperties:z,ObjectSetPrototypeOf:M,StringPrototypeToLowerCase:S,Symbol:R,SymbolHasInstance:L}=n0();$.exports=I,I.WritableState=Z;var{EventEmitter:H}=(MO(),h0(zO)),q=_Z().Stream,{Buffer:P}=(HU(),h0(WU)),_=EO(),{addAbortSignal:k}=uO(),{getHighWaterMark:B,getDefaultHighWaterMark:j}=bO(),{ERR_INVALID_ARG_TYPE:x,ERR_METHOD_NOT_IMPLEMENTED:f,ERR_MULTIPLE_CALLBACK:w,ERR_STREAM_CANNOT_PIPE:d,ERR_STREAM_DESTROYED:Y0,ERR_STREAM_ALREADY_FINISHED:J0,ERR_STREAM_NULL_VALUES:A0,ERR_STREAM_WRITE_AFTER_END:u,ERR_UNKNOWN_ENCODING:O0}=zU().codes,{errorOrDestroy:U}=_;M(I.prototype,q.prototype),M(I,q);function X(){}var J=R("kOnFinished");function Z(y,h,Q0){if(typeof Q0!=="boolean")Q0=h instanceof nU();if(this.objectMode=!!(y&&y.objectMode),Q0)this.objectMode=this.objectMode||!!(y&&y.writableObjectMode);this.highWaterMark=y?B(this,y,"writableHighWaterMark",Q0):j(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;let t=!!(y&&y.decodeStrings===!1);this.decodeStrings=!t,this.defaultEncoding=y&&y.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=T.bind(void 0,h),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,Y(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!y||y.emitClose!==!1,this.autoDestroy=!y||y.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[J]=[]}function Y(y){y.buffered=[],y.bufferedIndex=0,y.allBuffers=!0,y.allNoop=!0}Z.prototype.getBuffer=function(){return W(this.buffered,this.bufferedIndex)},A(Z.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function I(y){let h=this instanceof nU();if(!h&&!F(I,this))return new I(y);if(this._writableState=new Z(y,this,h),y){if(typeof y.write==="function")this._write=y.write;if(typeof y.writev==="function")this._writev=y.writev;if(typeof y.destroy==="function")this._destroy=y.destroy;if(typeof y.final==="function")this._final=y.final;if(typeof y.construct==="function")this._construct=y.construct;if(y.signal)k(y.signal,this)}q.call(this,y),_.construct(this,()=>{let Q0=this._writableState;if(!Q0.writing)p(this,Q0);l(this,Q0)})}A(I,L,{__proto__:null,value:function(y){if(F(this,y))return!0;if(this!==I)return!1;return y&&y._writableState instanceof Z}}),I.prototype.pipe=function(){U(this,new d)};function K(y,h,Q0,t){let e=y._writableState;if(typeof Q0==="function")t=Q0,Q0=e.defaultEncoding;else{if(!Q0)Q0=e.defaultEncoding;else if(Q0!=="buffer"&&!P.isEncoding(Q0))throw new O0(Q0);if(typeof t!=="function")t=X}if(h===null)throw new A0;else if(!e.objectMode)if(typeof h==="string"){if(e.decodeStrings!==!1)h=P.from(h,Q0),Q0="buffer"}else if(h instanceof P)Q0="buffer";else if(q._isUint8Array(h))h=q._uint8ArrayToBuffer(h),Q0="buffer";else throw new x("chunk",["string","Buffer","Uint8Array"],h);let F0;if(e.ending)F0=new u;else if(e.destroyed)F0=new Y0("write");if(F0)return V.nextTick(t,F0),U(y,F0,!0),F0;return e.pendingcb++,G(y,e,h,Q0,t)}I.prototype.write=function(y,h,Q0){return K(this,y,h,Q0)===!0},I.prototype.cork=function(){this._writableState.corked++},I.prototype.uncork=function(){let y=this._writableState;if(y.corked){if(y.corked--,!y.writing)p(this,y)}},I.prototype.setDefaultEncoding=function(y){if(typeof y==="string")y=S(y);if(!P.isEncoding(y))throw new O0(y);return this._writableState.defaultEncoding=y,this};function G(y,h,Q0,t,e){let F0=h.objectMode?1:Q0.length;h.length+=F0;let c=h.length<h.highWaterMark;if(!c)h.needDrain=!0;if(h.writing||h.corked||h.errored||!h.constructed){if(h.buffered.push({chunk:Q0,encoding:t,callback:e}),h.allBuffers&&t!=="buffer")h.allBuffers=!1;if(h.allNoop&&e!==X)h.allNoop=!1}else h.writelen=F0,h.writecb=e,h.writing=!0,h.sync=!0,y._write(Q0,t,h.onwrite),h.sync=!1;return c&&!h.errored&&!h.destroyed}function O(y,h,Q0,t,e,F0,c){if(h.writelen=t,h.writecb=c,h.writing=!0,h.sync=!0,h.destroyed)h.onwrite(new Y0("write"));else if(Q0)y._writev(e,h.onwrite);else y._write(e,F0,h.onwrite);h.sync=!1}function E(y,h,Q0,t){--h.pendingcb,t(Q0),g(h),U(y,Q0)}function T(y,h){let Q0=y._writableState,t=Q0.sync,e=Q0.writecb;if(typeof e!=="function"){U(y,new w);return}if(Q0.writing=!1,Q0.writecb=null,Q0.length-=Q0.writelen,Q0.writelen=0,h){if(h.stack,!Q0.errored)Q0.errored=h;if(y._readableState&&!y._readableState.errored)y._readableState.errored=h;if(t)V.nextTick(E,y,Q0,h,e);else E(y,Q0,h,e)}else{if(Q0.buffered.length>Q0.bufferedIndex)p(y,Q0);if(t)if(Q0.afterWriteTickInfo!==null&&Q0.afterWriteTickInfo.cb===e)Q0.afterWriteTickInfo.count++;else Q0.afterWriteTickInfo={count:1,cb:e,stream:y,state:Q0},V.nextTick(D,Q0.afterWriteTickInfo);else v(y,Q0,1,e)}}function D({stream:y,state:h,count:Q0,cb:t}){return h.afterWriteTickInfo=null,v(y,h,Q0,t)}function v(y,h,Q0,t){if(!h.ending&&!y.destroyed&&h.length===0&&h.needDrain)h.needDrain=!1,y.emit("drain");while(Q0-- >0)h.pendingcb--,t();if(h.destroyed)g(h);l(y,h)}function g(y){if(y.writing)return;for(let e=y.bufferedIndex;e<y.buffered.length;++e){var h;let{chunk:F0,callback:c}=y.buffered[e],o=y.objectMode?1:F0.length;y.length-=o,c((h=y.errored)!==null&&h!==void 0?h:new Y0("write"))}let Q0=y[J].splice(0);for(let e=0;e<Q0.length;e++){var t;Q0[e]((t=y.errored)!==null&&t!==void 0?t:new Y0("end"))}Y(y)}function p(y,h){if(h.corked||h.bufferProcessing||h.destroyed||!h.constructed)return;let{buffered:Q0,bufferedIndex:t,objectMode:e}=h,F0=Q0.length-t;if(!F0)return;let c=t;if(h.bufferProcessing=!0,F0>1&&y._writev){h.pendingcb-=F0-1;let o=h.allNoop?X:(s)=>{for(let Z0=c;Z0<Q0.length;++Z0)Q0[Z0].callback(s)},N0=h.allNoop&&c===0?Q0:W(Q0,c);N0.allBuffers=h.allBuffers,O(y,h,!0,h.length,N0,"",o),Y(h)}else{do{let{chunk:o,encoding:N0,callback:s}=Q0[c];Q0[c++]=null;let Z0=e?1:o.length;O(y,h,!1,Z0,o,N0,s)}while(c<Q0.length&&!h.writing);if(c===Q0.length)Y(h);else if(c>256)Q0.splice(0,c),h.bufferedIndex=0;else h.bufferedIndex=c}h.bufferProcessing=!1}I.prototype._write=function(y,h,Q0){if(this._writev)this._writev([{chunk:y,encoding:h}],Q0);else throw new f("_write()")},I.prototype._writev=null,I.prototype.end=function(y,h,Q0){let t=this._writableState;if(typeof y==="function")Q0=y,y=null,h=null;else if(typeof h==="function")Q0=h,h=null;let e;if(y!==null&&y!==void 0){let F0=K(this,y,h);if(F0 instanceof C)e=F0}if(t.corked)t.corked=1,this.uncork();if(e);else if(!t.errored&&!t.ending)t.ending=!0,l(this,t,!0),t.ended=!0;else if(t.finished)e=new J0("end");else if(t.destroyed)e=new Y0("end");if(typeof Q0==="function")if(e||t.finished)V.nextTick(Q0,e);else t[J].push(Q0);return this};function n(y){return y.ending&&!y.destroyed&&y.constructed&&y.length===0&&!y.errored&&y.buffered.length===0&&!y.finished&&!y.writing&&!y.errorEmitted&&!y.closeEmitted}function V0(y,h){let Q0=!1;function t(e){if(Q0){U(y,e!==null&&e!==void 0?e:w());return}if(Q0=!0,h.pendingcb--,e){let F0=h[J].splice(0);for(let c=0;c<F0.length;c++)F0[c](e);U(y,e,h.sync)}else if(n(h))h.prefinished=!0,y.emit("prefinish"),h.pendingcb++,V.nextTick(X0,y,h)}h.sync=!0,h.pendingcb++;try{y._final(t)}catch(e){t(e)}h.sync=!1}function r(y,h){if(!h.prefinished&&!h.finalCalled)if(typeof y._final==="function"&&!h.destroyed)h.finalCalled=!0,V0(y,h);else h.prefinished=!0,y.emit("prefinish")}function l(y,h,Q0){if(n(h)){if(r(y,h),h.pendingcb===0){if(Q0)h.pendingcb++,V.nextTick((t,e)=>{if(n(e))X0(t,e);else e.pendingcb--},y,h);else if(n(h))h.pendingcb++,X0(y,h)}}}function X0(y,h){h.pendingcb--,h.finished=!0;let Q0=h[J].splice(0);for(let t=0;t<Q0.length;t++)Q0[t]();if(y.emit("finish"),h.autoDestroy){let t=y._readableState;if(!t||t.autoDestroy&&(t.endEmitted||t.readable===!1))y.destroy()}}z(I.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(y){if(this._writableState)this._writableState.destroyed=y}},writable:{__proto__:null,get(){let y=this._writableState;return!!y&&y.writable!==!1&&!y.destroyed&&!y.errored&&!y.ending&&!y.ended},set(y){if(this._writableState)this._writableState.writable=!!y}},writableFinished:{__proto__:null,get(){return this._writableState?this._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return this._writableState?this._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return this._writableState?this._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){let y=this._writableState;if(!y)return!1;return!y.destroyed&&!y.ending&&y.needDrain}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)}}});var m=_.destroy;I.prototype.destroy=function(y,h){let Q0=this._writableState;if(!Q0.destroyed&&(Q0.bufferedIndex<Q0.buffered.length||Q0[J].length))V.nextTick(g,Q0);return m.call(this,y,h),this},I.prototype._undestroy=_.undestroy,I.prototype._destroy=function(y,h){h(y)},I.prototype[H.captureRejectionSymbol]=function(y){this.destroy(y)};var i;function g0(){if(i===void 0)i={};return i}I.fromWeb=function(y,h){return g0().newStreamWritableFromWritableStream(y,h)},I.toWeb=function(y){return g0().newWritableStreamFromStreamWritable(y)}}),hA=b0((Q,$)=>{var V=$O(),W=(HU(),h0(WU)),{isReadable:C,isWritable:F,isIterable:A,isNodeStream:z,isReadableNodeStream:M,isWritableNodeStream:S,isDuplexNodeStream:R,isReadableStream:L,isWritableStream:H}=mU(),q=UO(),{AbortError:P,codes:{ERR_INVALID_ARG_TYPE:_,ERR_INVALID_RETURN_VALUE:k}}=zU(),{destroyer:B}=EO(),j=nU(),x=lO(),f=vZ(),{createDeferredPromise:w}=_U(),d=TQ(),Y0=globalThis.Blob||W.Blob,J0=typeof Y0<"u"?function(J){return J instanceof Y0}:function(J){return!1},A0=globalThis.AbortController||qO().AbortController,{FunctionPrototypeCall:u}=n0();class O0 extends j{constructor(J){super(J);if((J===null||J===void 0?void 0:J.readable)===!1)this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0;if((J===null||J===void 0?void 0:J.writable)===!1)this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0}}$.exports=function J(Z,Y){if(R(Z))return Z;if(M(Z))return X({readable:Z});if(S(Z))return X({writable:Z});if(z(Z))return X({writable:!1,readable:!1});if(L(Z))return X({readable:x.fromWeb(Z)});if(H(Z))return X({writable:f.fromWeb(Z)});if(typeof Z==="function"){let{value:K,write:G,final:O,destroy:E}=U(Z);if(A(K))return d(O0,K,{objectMode:!0,write:G,final:O,destroy:E});let T=K===null||K===void 0?void 0:K.then;if(typeof T==="function"){let D,v=u(T,K,(g)=>{if(g!=null)throw new k("nully","body",g)},(g)=>{B(D,g)});return D=new O0({objectMode:!0,readable:!1,write:G,final(g){O(async()=>{try{await v,V.nextTick(g,null)}catch(p){V.nextTick(g,p)}})},destroy:E})}throw new k("Iterable, AsyncIterable or AsyncFunction",Y,K)}if(J0(Z))return J(Z.arrayBuffer());if(A(Z))return d(O0,Z,{objectMode:!0,writable:!1});if(L(Z===null||Z===void 0?void 0:Z.readable)&&H(Z===null||Z===void 0?void 0:Z.writable))return O0.fromWeb(Z);if(typeof(Z===null||Z===void 0?void 0:Z.writable)==="object"||typeof(Z===null||Z===void 0?void 0:Z.readable)==="object"){let K=Z!==null&&Z!==void 0&&Z.readable?M(Z===null||Z===void 0?void 0:Z.readable)?Z===null||Z===void 0?void 0:Z.readable:J(Z.readable):void 0,G=Z!==null&&Z!==void 0&&Z.writable?S(Z===null||Z===void 0?void 0:Z.writable)?Z===null||Z===void 0?void 0:Z.writable:J(Z.writable):void 0;return X({readable:K,writable:G})}let I=Z===null||Z===void 0?void 0:Z.then;if(typeof I==="function"){let K;return u(I,Z,(G)=>{if(G!=null)K.push(G);K.push(null)},(G)=>{B(K,G)}),K=new O0({objectMode:!0,writable:!1,read(){}})}throw new _(Y,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],Z)};function U(J){let{promise:Z,resolve:Y}=w(),I=new A0,K=I.signal;return{value:J(async function*(){while(!0){let G=Z;Z=null;let{chunk:O,done:E,cb:T}=await G;if(V.nextTick(T),E)return;if(K.aborted)throw new P(void 0,{cause:K.reason});({promise:Z,resolve:Y}=w()),yield O}}(),{signal:K}),write(G,O,E){let T=Y;Y=null,T({chunk:G,done:!1,cb:E})},final(G){let O=Y;Y=null,O({done:!0,cb:G})},destroy(G,O){I.abort(),O(G)}}}function X(J){let Z=J.readable&&typeof J.readable.read!=="function"?x.wrap(J.readable):J.readable,Y=J.writable,I=!!C(Z),K=!!F(Y),G,O,E,T,D;function v(g){let p=T;if(T=null,p)p(g);else if(g)D.destroy(g)}if(D=new O0({readableObjectMode:!!(Z!==null&&Z!==void 0&&Z.readableObjectMode),writableObjectMode:!!(Y!==null&&Y!==void 0&&Y.writableObjectMode),readable:I,writable:K}),K)q(Y,(g)=>{if(K=!1,g)B(Z,g);v(g)}),D._write=function(g,p,n){if(Y.write(g,p))n();else G=n},D._final=function(g){Y.end(),O=g},Y.on("drain",function(){if(G){let g=G;G=null,g()}}),Y.on("finish",function(){if(O){let g=O;O=null,g()}});if(I)q(Z,(g)=>{if(I=!1,g)B(Z,g);v(g)}),Z.on("readable",function(){if(E){let g=E;E=null,g()}}),Z.on("end",function(){D.push(null)}),D._read=function(){while(!0){let g=Z.read();if(g===null){E=D._read;return}if(!D.push(g))return}};return D._destroy=function(g,p){if(!g&&T!==null)g=new P;if(E=null,G=null,O=null,T===null)p(g);else T=p,B(Y,g),B(Z,g)},D}}),nU=b0((Q,$)=>{var{ObjectDefineProperties:V,ObjectGetOwnPropertyDescriptor:W,ObjectKeys:C,ObjectSetPrototypeOf:F}=n0();$.exports=M;var A=lO(),z=vZ();F(M.prototype,A.prototype),F(M,A);{let H=C(z.prototype);for(let q=0;q<H.length;q++){let P=H[q];if(!M.prototype[P])M.prototype[P]=z.prototype[P]}}function M(H){if(!(this instanceof M))return new M(H);if(A.call(this,H),z.call(this,H),H){if(this.allowHalfOpen=H.allowHalfOpen!==!1,H.readable===!1)this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0;if(H.writable===!1)this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0}else this.allowHalfOpen=!0}V(M.prototype,{writable:{__proto__:null,...W(z.prototype,"writable")},writableHighWaterMark:{__proto__:null,...W(z.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...W(z.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...W(z.prototype,"writableBuffer")},writableLength:{__proto__:null,...W(z.prototype,"writableLength")},writableFinished:{__proto__:null,...W(z.prototype,"writableFinished")},writableCorked:{__proto__:null,...W(z.prototype,"writableCorked")},writableEnded:{__proto__:null,...W(z.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...W(z.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){if(this._readableState===void 0||this._writableState===void 0)return!1;return this._readableState.destroyed&&this._writableState.destroyed},set(H){if(this._readableState&&this._writableState)this._readableState.destroyed=H,this._writableState.destroyed=H}}});var S;function R(){if(S===void 0)S={};return S}M.fromWeb=function(H,q){return R().newStreamDuplexFromReadableWritablePair(H,q)},M.toWeb=function(H){return R().newReadableWritablePairFromDuplex(H)};var L;M.from=function(H){if(!L)L=hA();return L(H,"body")}}),zQ=b0((Q,$)=>{var{ObjectSetPrototypeOf:V,Symbol:W}=n0();$.exports=M;var{ERR_METHOD_NOT_IMPLEMENTED:C}=zU().codes,F=nU(),{getHighWaterMark:A}=bO();V(M.prototype,F.prototype),V(M,F);var z=W("kCallback");function M(L){if(!(this instanceof M))return new M(L);let H=L?A(this,L,"readableHighWaterMark",!0):null;if(H===0)L={...L,highWaterMark:null,readableHighWaterMark:H,writableHighWaterMark:L.writableHighWaterMark||0};if(F.call(this,L),this._readableState.sync=!1,this[z]=null,L){if(typeof L.transform==="function")this._transform=L.transform;if(typeof L.flush==="function")this._flush=L.flush}this.on("prefinish",R)}function S(L){if(typeof this._flush==="function"&&!this.destroyed)this._flush((H,q)=>{if(H){if(L)L(H);else this.destroy(H);return}if(q!=null)this.push(q);if(this.push(null),L)L()});else if(this.push(null),L)L()}function R(){if(this._final!==S)S.call(this)}M.prototype._final=S,M.prototype._transform=function(L,H,q){throw new C("_transform()")},M.prototype._write=function(L,H,q){let P=this._readableState,_=this._writableState,k=P.length;this._transform(L,H,(B,j)=>{if(B){q(B);return}if(j!=null)this.push(j);if(_.ended||k===P.length||P.length<P.highWaterMark)q();else this[z]=q})},M.prototype._read=function(){if(this[z]){let L=this[z];this[z]=null,L()}}}),MQ=b0((Q,$)=>{var{ObjectSetPrototypeOf:V}=n0();$.exports=C;var W=zQ();V(C.prototype,W.prototype),V(C,W);function C(F){if(!(this instanceof C))return new C(F);W.call(this,F)}C.prototype._transform=function(F,A,z){z(null,F)}}),jZ=b0((Q,$)=>{var V=$O(),{ArrayIsArray:W,Promise:C,SymbolAsyncIterator:F,SymbolDispose:A}=n0(),z=UO(),{once:M}=_U(),S=EO(),R=nU(),{aggregateTwoErrors:L,codes:{ERR_INVALID_ARG_TYPE:H,ERR_INVALID_RETURN_VALUE:q,ERR_MISSING_ARGS:P,ERR_STREAM_DESTROYED:_,ERR_STREAM_PREMATURE_CLOSE:k},AbortError:B}=zU(),{validateFunction:j,validateAbortSignal:x}=PO(),{isIterable:f,isReadable:w,isReadableNodeStream:d,isNodeStream:Y0,isTransformStream:J0,isWebStream:A0,isReadableStream:u,isReadableFinished:O0}=mU(),U=globalThis.AbortController||qO().AbortController,X,J,Z;function Y(g,p,n){let V0=!1;g.on("close",()=>{V0=!0});let r=z(g,{readable:p,writable:n},(l)=>{V0=!l});return{destroy:(l)=>{if(V0)return;V0=!0,S.destroyer(g,l||new _("pipe"))},cleanup:r}}function I(g){return j(g[g.length-1],"streams[stream.length - 1]"),g.pop()}function K(g){if(f(g))return g;else if(d(g))return G(g);throw new H("val",["Readable","Iterable","AsyncIterable"],g)}async function*G(g){if(!J)J=lO();yield*J.prototype[F].call(g)}async function O(g,p,n,{end:V0}){let r,l=null,X0=(g0)=>{if(g0)r=g0;if(l){let y=l;l=null,y()}},m=()=>new C((g0,y)=>{if(r)y(r);else l=()=>{if(r)y(r);else g0()}});p.on("drain",X0);let i=z(p,{readable:!1},X0);try{if(p.writableNeedDrain)await m();for await(let g0 of g)if(!p.write(g0))await m();if(V0)p.end(),await m();n()}catch(g0){n(r!==g0?L(r,g0):g0)}finally{i(),p.off("drain",X0)}}async function E(g,p,n,{end:V0}){if(J0(p))p=p.writable;let r=p.getWriter();try{for await(let l of g)await r.ready,r.write(l).catch(()=>{});if(await r.ready,V0)await r.close();n()}catch(l){try{await r.abort(l),n(l)}catch(X0){n(X0)}}}function T(...g){return D(g,M(I(g)))}function D(g,p,n){if(g.length===1&&W(g[0]))g=g[0];if(g.length<2)throw new P("streams");let V0=new U,r=V0.signal,l=n===null||n===void 0?void 0:n.signal,X0=[];x(l,"options.signal");function m(){e(new B)}Z=Z||_U().addAbortListener;let i;if(l)i=Z(l,m);let g0,y,h=[],Q0=0;function t(s){e(s,--Q0===0)}function e(s,Z0){var w0;if(s&&(!g0||g0.code==="ERR_STREAM_PREMATURE_CLOSE"))g0=s;if(!g0&&!Z0)return;while(h.length)h.shift()(g0);if((w0=i)===null||w0===void 0||w0[A](),V0.abort(),Z0){if(!g0)X0.forEach((C0)=>C0());V.nextTick(p,g0,y)}}let F0;for(let s=0;s<g.length;s++){let Z0=g[s],w0=s<g.length-1,C0=s>0,K0=w0||(n===null||n===void 0?void 0:n.end)!==!1,s0=s===g.length-1;if(Y0(Z0)){let E0=function(L0){if(L0&&L0.name!=="AbortError"&&L0.code!=="ERR_STREAM_PREMATURE_CLOSE")t(L0)};var c=E0;if(K0){let{destroy:L0,cleanup:e0}=Y(Z0,w0,C0);if(h.push(L0),w(Z0)&&s0)X0.push(e0)}if(Z0.on("error",E0),w(Z0)&&s0)X0.push(()=>{Z0.removeListener("error",E0)})}if(s===0)if(typeof Z0==="function"){if(F0=Z0({signal:r}),!f(F0))throw new q("Iterable, AsyncIterable or Stream","source",F0)}else if(f(Z0)||d(Z0)||J0(Z0))F0=Z0;else F0=R.from(Z0);else if(typeof Z0==="function"){if(J0(F0)){var o;F0=K((o=F0)===null||o===void 0?void 0:o.readable)}else F0=K(F0);if(F0=Z0(F0,{signal:r}),w0){if(!f(F0,!0))throw new q("AsyncIterable",`transform[${s-1}]`,F0)}else{var N0;if(!X)X=MQ();let E0=new X({objectMode:!0}),L0=(N0=F0)===null||N0===void 0?void 0:N0.then;if(typeof L0==="function")Q0++,L0.call(F0,(H0)=>{if(y=H0,H0!=null)E0.write(H0);if(K0)E0.end();V.nextTick(t)},(H0)=>{E0.destroy(H0),V.nextTick(t,H0)});else if(f(F0,!0))Q0++,O(F0,E0,t,{end:K0});else if(u(F0)||J0(F0)){let H0=F0.readable||F0;Q0++,O(H0,E0,t,{end:K0})}else throw new q("AsyncIterable or Promise","destination",F0);F0=E0;let{destroy:e0,cleanup:D0}=Y(F0,!1,!0);if(h.push(e0),s0)X0.push(D0)}}else if(Y0(Z0)){if(d(F0)){Q0+=2;let E0=v(F0,Z0,t,{end:K0});if(w(Z0)&&s0)X0.push(E0)}else if(J0(F0)||u(F0)){let E0=F0.readable||F0;Q0++,O(E0,Z0,t,{end:K0})}else if(f(F0))Q0++,O(F0,Z0,t,{end:K0});else throw new H("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],F0);F0=Z0}else if(A0(Z0)){if(d(F0))Q0++,E(K(F0),Z0,t,{end:K0});else if(u(F0)||f(F0))Q0++,E(F0,Z0,t,{end:K0});else if(J0(F0))Q0++,E(F0.readable,Z0,t,{end:K0});else throw new H("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],F0);F0=Z0}else F0=R.from(Z0)}if(r!==null&&r!==void 0&&r.aborted||l!==null&&l!==void 0&&l.aborted)V.nextTick(m);return F0}function v(g,p,n,{end:V0}){let r=!1;if(p.on("close",()=>{if(!r)n(new k)}),g.pipe(p,{end:!1}),V0){let X0=function(){r=!0,p.end()};var l=X0;if(O0(g))V.nextTick(X0);else g.once("end",X0)}else n();return z(g,{readable:!0,writable:!1},(X0)=>{let m=g._readableState;if(X0&&X0.code==="ERR_STREAM_PREMATURE_CLOSE"&&m&&m.ended&&!m.errored&&!m.errorEmitted)g.once("end",n).once("error",n);else n(X0)}),z(p,{readable:!1,writable:!0},n)}$.exports={pipelineImpl:D,pipeline:T}}),qQ=b0((Q,$)=>{var{pipeline:V}=jZ(),W=nU(),{destroyer:C}=EO(),{isNodeStream:F,isReadable:A,isWritable:z,isWebStream:M,isTransformStream:S,isWritableStream:R,isReadableStream:L}=mU(),{AbortError:H,codes:{ERR_INVALID_ARG_VALUE:q,ERR_MISSING_ARGS:P}}=zU(),_=UO();$.exports=function(...k){if(k.length===0)throw new P("streams");if(k.length===1)return W.from(k[0]);let B=[...k];if(typeof k[0]==="function")k[0]=W.from(k[0]);if(typeof k[k.length-1]==="function"){let U=k.length-1;k[U]=W.from(k[U])}for(let U=0;U<k.length;++U){if(!F(k[U])&&!M(k[U]))continue;if(U<k.length-1&&!(A(k[U])||L(k[U])||S(k[U])))throw new q(`streams[${U}]`,B[U],"must be readable");if(U>0&&!(z(k[U])||R(k[U])||S(k[U])))throw new q(`streams[${U}]`,B[U],"must be writable")}let j,x,f,w,d;function Y0(U){let X=w;if(w=null,X)X(U);else if(U)d.destroy(U);else if(!O0&&!u)d.destroy()}let J0=k[0],A0=V(k,Y0),u=!!(z(J0)||R(J0)||S(J0)),O0=!!(A(A0)||L(A0)||S(A0));if(d=new W({writableObjectMode:!!(J0!==null&&J0!==void 0&&J0.writableObjectMode),readableObjectMode:!!(A0!==null&&A0!==void 0&&A0.readableObjectMode),writable:u,readable:O0}),u){if(F(J0))d._write=function(X,J,Z){if(J0.write(X,J))Z();else j=Z},d._final=function(X){J0.end(),x=X},J0.on("drain",function(){if(j){let X=j;j=null,X()}});else if(M(J0)){let X=(S(J0)?J0.writable:J0).getWriter();d._write=async function(J,Z,Y){try{await X.ready,X.write(J).catch(()=>{}),Y()}catch(I){Y(I)}},d._final=async function(J){try{await X.ready,X.close().catch(()=>{}),x=J}catch(Z){J(Z)}}}let U=S(A0)?A0.readable:A0;_(U,()=>{if(x){let X=x;x=null,X()}})}if(O0){if(F(A0))A0.on("readable",function(){if(f){let U=f;f=null,U()}}),A0.on("end",function(){d.push(null)}),d._read=function(){while(!0){let U=A0.read();if(U===null){f=d._read;return}if(!d.push(U))return}};else if(M(A0)){let U=(S(A0)?A0.readable:A0).getReader();d._read=async function(){while(!0)try{let{value:X,done:J}=await U.read();if(!d.push(X))return;if(J){d.push(null);return}}catch{return}}}}return d._destroy=function(U,X){if(!U&&w!==null)U=new H;if(f=null,j=null,x=null,w===null)X(U);else if(w=X,F(A0))C(A0,U)},d}}),uA=b0((Q,$)=>{var V=globalThis.AbortController||qO().AbortController,{codes:{ERR_INVALID_ARG_VALUE:W,ERR_INVALID_ARG_TYPE:C,ERR_MISSING_ARGS:F,ERR_OUT_OF_RANGE:A},AbortError:z}=zU(),{validateAbortSignal:M,validateInteger:S,validateObject:R}=PO(),L=n0().Symbol("kWeak"),H=n0().Symbol("kResistStopPropagation"),{finished:q}=UO(),P=qQ(),{addAbortSignalNoValidate:_}=uO(),{isWritable:k,isNodeStream:B}=mU(),{deprecate:j}=_U(),{ArrayPrototypePush:x,Boolean:f,MathFloor:w,Number:d,NumberIsNaN:Y0,Promise:J0,PromiseReject:A0,PromiseResolve:u,PromisePrototypeThen:O0,Symbol:U}=n0(),X=U("kEmpty"),J=U("kEof");function Z(l,X0){if(X0!=null)R(X0,"options");if((X0===null||X0===void 0?void 0:X0.signal)!=null)M(X0.signal,"options.signal");if(B(l)&&!k(l))throw new W("stream",l,"must be writable");let m=P(this,l);if(X0!==null&&X0!==void 0&&X0.signal)_(X0.signal,m);return m}function Y(l,X0){if(typeof l!=="function")throw new C("fn",["Function","AsyncFunction"],l);if(X0!=null)R(X0,"options");if((X0===null||X0===void 0?void 0:X0.signal)!=null)M(X0.signal,"options.signal");let m=1;if((X0===null||X0===void 0?void 0:X0.concurrency)!=null)m=w(X0.concurrency);let i=m-1;if((X0===null||X0===void 0?void 0:X0.highWaterMark)!=null)i=w(X0.highWaterMark);return S(m,"options.concurrency",1),S(i,"options.highWaterMark",0),i+=m,async function*(){let g0=_U().AbortSignalAny([X0===null||X0===void 0?void 0:X0.signal].filter(f)),y=this,h=[],Q0={signal:g0},t,e,F0=!1,c=0;function o(){F0=!0,N0()}function N0(){c-=1,s()}function s(){if(e&&!F0&&c<m&&h.length<i)e(),e=null}async function Z0(){try{for await(let w0 of y){if(F0)return;if(g0.aborted)throw new z;try{if(w0=l(w0,Q0),w0===X)continue;w0=u(w0)}catch(C0){w0=A0(C0)}if(c+=1,O0(w0,N0,o),h.push(w0),t)t(),t=null;if(!F0&&(h.length>=i||c>=m))await new J0((C0)=>{e=C0})}h.push(J)}catch(w0){let C0=A0(w0);O0(C0,N0,o),h.push(C0)}finally{if(F0=!0,t)t(),t=null}}Z0();try{while(!0){while(h.length>0){let w0=await h[0];if(w0===J)return;if(g0.aborted)throw new z;if(w0!==X)yield w0;h.shift(),s()}await new J0((w0)=>{t=w0})}}finally{if(F0=!0,e)e(),e=null}}.call(this)}function I(l=void 0){if(l!=null)R(l,"options");if((l===null||l===void 0?void 0:l.signal)!=null)M(l.signal,"options.signal");return async function*(){let X0=0;for await(let i of this){var m;if(l!==null&&l!==void 0&&(m=l.signal)!==null&&m!==void 0&&m.aborted)throw new z({cause:l.signal.reason});yield[X0++,i]}}.call(this)}async function K(l,X0=void 0){for await(let m of T.call(this,l,X0))return!0;return!1}async function G(l,X0=void 0){if(typeof l!=="function")throw new C("fn",["Function","AsyncFunction"],l);return!await K.call(this,async(...m)=>{return!await l(...m)},X0)}async function O(l,X0){for await(let m of T.call(this,l,X0))return m;return}async function E(l,X0){if(typeof l!=="function")throw new C("fn",["Function","AsyncFunction"],l);async function m(i,g0){return await l(i,g0),X}for await(let i of Y.call(this,m,X0));}function T(l,X0){if(typeof l!=="function")throw new C("fn",["Function","AsyncFunction"],l);async function m(i,g0){if(await l(i,g0))return i;return X}return Y.call(this,m,X0)}class D extends F{constructor(){super("reduce");this.message="Reduce of an empty stream requires an initial value"}}async function v(l,X0,m){var i;if(typeof l!=="function")throw new C("reducer",["Function","AsyncFunction"],l);if(m!=null)R(m,"options");if((m===null||m===void 0?void 0:m.signal)!=null)M(m.signal,"options.signal");let g0=arguments.length>1;if(m!==null&&m!==void 0&&(i=m.signal)!==null&&i!==void 0&&i.aborted){let e=new z(void 0,{cause:m.signal.reason});throw this.once("error",()=>{}),await q(this.destroy(e)),e}let y=new V,h=y.signal;if(m!==null&&m!==void 0&&m.signal){let e={once:!0,[L]:this,[H]:!0};m.signal.addEventListener("abort",()=>y.abort(),e)}let Q0=!1;try{for await(let e of this){var t;if(Q0=!0,m!==null&&m!==void 0&&(t=m.signal)!==null&&t!==void 0&&t.aborted)throw new z;if(!g0)X0=e,g0=!0;else X0=await l(X0,e,{signal:h})}if(!Q0&&!g0)throw new D}finally{y.abort()}return X0}async function g(l){if(l!=null)R(l,"options");if((l===null||l===void 0?void 0:l.signal)!=null)M(l.signal,"options.signal");let X0=[];for await(let i of this){var m;if(l!==null&&l!==void 0&&(m=l.signal)!==null&&m!==void 0&&m.aborted)throw new z(void 0,{cause:l.signal.reason});x(X0,i)}return X0}function p(l,X0){let m=Y.call(this,l,X0);return async function*(){for await(let i of m)yield*i}.call(this)}function n(l){if(l=d(l),Y0(l))return 0;if(l<0)throw new A("number",">= 0",l);return l}function V0(l,X0=void 0){if(X0!=null)R(X0,"options");if((X0===null||X0===void 0?void 0:X0.signal)!=null)M(X0.signal,"options.signal");return l=n(l),async function*(){var m;if(X0!==null&&X0!==void 0&&(m=X0.signal)!==null&&m!==void 0&&m.aborted)throw new z;for await(let g0 of this){var i;if(X0!==null&&X0!==void 0&&(i=X0.signal)!==null&&i!==void 0&&i.aborted)throw new z;if(l--<=0)yield g0}}.call(this)}function r(l,X0=void 0){if(X0!=null)R(X0,"options");if((X0===null||X0===void 0?void 0:X0.signal)!=null)M(X0.signal,"options.signal");return l=n(l),async function*(){var m;if(X0!==null&&X0!==void 0&&(m=X0.signal)!==null&&m!==void 0&&m.aborted)throw new z;for await(let g0 of this){var i;if(X0!==null&&X0!==void 0&&(i=X0.signal)!==null&&i!==void 0&&i.aborted)throw new z;if(l-- >0)yield g0;if(l<=0)return}}.call(this)}$.exports.streamReturningOperators={asIndexedPairs:j(I,"readable.asIndexedPairs will be removed in a future version."),drop:V0,filter:T,flatMap:p,map:Y,take:r,compose:Z},$.exports.promiseReturningOperators={every:G,forEach:E,reduce:v,toArray:g,some:K,find:O}}),PQ=b0((Q,$)=>{var{ArrayPrototypePop:V,Promise:W}=n0(),{isIterable:C,isNodeStream:F,isWebStream:A}=mU(),{pipelineImpl:z}=jZ(),{finished:M}=UO();kQ();function S(...R){return new W((L,H)=>{let q,P,_=R[R.length-1];if(_&&typeof _==="object"&&!F(_)&&!C(_)&&!A(_)){let k=V(R);q=k.signal,P=k.end}z(R,(k,B)=>{if(k)H(k);else L(B)},{signal:q,end:P})})}$.exports={finished:M,pipeline:S}}),kQ=b0((Q,$)=>{var{Buffer:V}=(HU(),h0(WU)),{ObjectDefineProperty:W,ObjectKeys:C,ReflectApply:F}=n0(),{promisify:{custom:A}}=_U(),{streamReturningOperators:z,promiseReturningOperators:M}=uA(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:S}}=zU(),R=qQ(),{setDefaultHighWaterMark:L,getDefaultHighWaterMark:H}=bO(),{pipeline:q}=jZ(),{destroyer:P}=EO(),_=UO(),k=PQ(),B=mU(),j=$.exports=_Z().Stream;j.isDestroyed=B.isDestroyed,j.isDisturbed=B.isDisturbed,j.isErrored=B.isErrored,j.isReadable=B.isReadable,j.isWritable=B.isWritable,j.Readable=lO();for(let f of C(z)){let w=function(...Y0){if(new.target)throw S();return j.Readable.from(F(d,this,Y0))},d=z[f];W(w,"name",{__proto__:null,value:d.name}),W(w,"length",{__proto__:null,value:d.length}),W(j.Readable.prototype,f,{__proto__:null,value:w,enumerable:!1,configurable:!0,writable:!0})}for(let f of C(M)){let w=function(...Y0){if(new.target)throw S();return F(d,this,Y0)},d=M[f];W(w,"name",{__proto__:null,value:d.name}),W(w,"length",{__proto__:null,value:d.length}),W(j.Readable.prototype,f,{__proto__:null,value:w,enumerable:!1,configurable:!0,writable:!0})}j.Writable=vZ(),j.Duplex=nU(),j.Transform=zQ(),j.PassThrough=MQ(),j.pipeline=q;var{addAbortSignal:x}=uO();j.addAbortSignal=x,j.finished=_,j.destroy=P,j.compose=R,j.setDefaultHighWaterMark=L,j.getDefaultHighWaterMark=H,W(j,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return k}}),W(q,A,{__proto__:null,enumerable:!0,get(){return k.pipeline}}),W(_,A,{__proto__:null,enumerable:!0,get(){return k.finished}}),j.Stream=j,j._isUint8Array=function(f){return f instanceof Uint8Array},j._uint8ArrayToBuffer=function(f){return V.from(f.buffer,f.byteOffset,f.byteLength)}}),bA=b0((Q,$)=>{var V=dO();{let W=kQ(),C=PQ(),F=W.Readable.destroy;$.exports=W.Readable,$.exports._uint8ArrayToBuffer=W._uint8ArrayToBuffer,$.exports._isUint8Array=W._isUint8Array,$.exports.isDisturbed=W.isDisturbed,$.exports.isErrored=W.isErrored,$.exports.isReadable=W.isReadable,$.exports.Readable=W.Readable,$.exports.Writable=W.Writable,$.exports.Duplex=W.Duplex,$.exports.Transform=W.Transform,$.exports.PassThrough=W.PassThrough,$.exports.addAbortSignal=W.addAbortSignal,$.exports.finished=W.finished,$.exports.destroy=W.destroy,$.exports.destroy=F,$.exports.pipeline=W.pipeline,$.exports.compose=W.compose,Object.defineProperty(W,"promises",{configurable:!0,enumerable:!0,get(){return C}}),$.exports.Stream=W.Stream}$.exports.default=$.exports});_Q.exports=bA()});var lZ={};WO(lZ,{uptime:()=>E$,type:()=>L$,totalmem:()=>C$,tmpdir:()=>fQ,tmpDir:()=>F$,release:()=>W$,platform:()=>S$,networkInterfaces:()=>H$,loadavg:()=>V$,hostname:()=>G$,homedir:()=>T$,getNetworkInterfaces:()=>gQ,freemem:()=>I$,endianness:()=>J$,cpus:()=>K$,arch:()=>D$,EOL:()=>R$});var J$=function(){return"LE"},G$=function(){if(typeof location<"u")return location.hostname;else return""},V$=function(){return[]},E$=function(){return 0},I$=function(){return Number.MAX_VALUE},C$=function(){return Number.MAX_VALUE},K$=function(){return[]},L$=function(){return"Browser"},W$=function(){if(typeof navigator<"u")return navigator.appVersion;return""},gQ=function(){return{}},H$,D$=function(){return"javascript"},S$=function(){return"browser"},fQ=function(){return"/tmp"},F$,R$=`
|
|
3
|
-
`,
|
|
4
|
-
`)>-1)if(
|
|
5
|
-
`).map(function(
|
|
6
|
-
`).slice(2);else
|
|
7
|
-
`+
|
|
8
|
-
`).map(function(
|
|
9
|
-
`)}else
|
|
10
|
-
`)>=0)
|
|
11
|
-
`)+" "
|
|
12
|
-
`)+" "+V[1];return V[0]+$+" "+Q.join(", ")+" "+V[1]}function wQ(Q){return Array.isArray(Q)}function rZ(Q){return typeof Q==="boolean"}function eO(Q){return Q===null}function N$(Q){return Q==null}function yQ(Q){return typeof Q==="number"}function iO(Q){return typeof Q==="string"}function g$(Q){return typeof Q==="symbol"}function CO(Q){return Q===void 0}function sO(Q){return KO(Q)&&aZ(Q)==="[object RegExp]"}function KO(Q){return typeof Q==="object"&&Q!==null}function sZ(Q){return KO(Q)&&aZ(Q)==="[object Date]"}function tO(Q){return KO(Q)&&(aZ(Q)==="[object Error]"||Q instanceof Error)}function rO(Q){return typeof Q==="function"}function f$(Q){return Q===null||typeof Q==="boolean"||typeof Q==="number"||typeof Q==="string"||typeof Q==="symbol"||typeof Q>"u"}function w$(Q){return Q instanceof Buffer}function aZ(Q){return Object.prototype.toString.call(Q)}function nZ(Q){return Q<10?"0"+Q.toString(10):Q.toString(10)}function c$(){var Q=new Date,$=[nZ(Q.getHours()),nZ(Q.getMinutes()),nZ(Q.getSeconds())].join(":");return[Q.getDate(),y$[Q.getMonth()],$].join(" ")}function cQ(...Q){console.log("%s - %s",c$(),tZ.apply(null,Q))}function pQ(Q,$){if($)Q.super_=$,Q.prototype=Object.create($.prototype,{constructor:{value:Q,enumerable:!1,writable:!0,configurable:!0}})}function eZ(Q,$){if(!$||!KO($))return Q;var V=Object.keys($),W=V.length;while(W--)Q[V[W]]=$[V[W]];return Q}function hQ(Q,$){return Object.prototype.hasOwnProperty.call(Q,$)}function iZ(Q,$){if(!Q){var V=Error("Promise was rejected with a falsy value");V.reason=Q,Q=V}return $(Q)}function bQ(Q){if(typeof Q!=="function")throw TypeError('The "original" argument must be of type Function');function $(...V){var W=V.pop();if(typeof W!=="function")throw TypeError("The last argument must be of type Function");var C=this,F=function(...A){return W.apply(C,...A)};Q.apply(this,V).then(function(A){process.nextTick(F.bind(null,null,A))},function(A){process.nextTick(iZ.bind(null,A,F))})}return Object.setPrototypeOf($,Object.getPrototypeOf(Q)),Object.defineProperties($,Object.getOwnPropertyDescriptors(Q)),$}var z$,q$,JO,x$=()=>{},y$,uQ,lQ,dQ,p$;var nQ=HO(()=>{z$=/%[sdj%]/g;q$=((Q={},$={},V)=>((V=typeof process<"u"&&!1)&&(V=V.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase()),$=new RegExp("^"+V+"$","i"),(W)=>{if(W=W.toUpperCase(),!Q[W])if($.test(W))Q[W]=function(...C){console.error("%s: %s",W,pid,tZ.apply(null,...C))};else Q[W]=function(){};return Q[W]}))(),JO=((Q)=>(Q.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},Q.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},Q.custom=Symbol.for("nodejs.util.inspect.custom"),Q))(function(Q,$,...V){var W={seen:[],stylize:k$};if(V.length>=1)W.depth=V[0];if(V.length>=2)W.colors=V[1];if(rZ($))W.showHidden=$;else if($)eZ(W,$);if(CO(W.showHidden))W.showHidden=!1;if(CO(W.depth))W.depth=2;if(CO(W.colors))W.colors=!1;if(W.colors)W.stylize=P$;return aO(W,Q,W.depth)});y$=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];uQ=((Q)=>(Q.custom=Symbol.for("nodejs.util.promisify.custom"),Q))(function(Q){if(typeof Q!=="function")throw TypeError('The "original" argument must be of type Function');if(kCustomPromisifiedSymbol&&Q[kCustomPromisifiedSymbol]){var $=Q[kCustomPromisifiedSymbol];if(typeof $!=="function")throw TypeError('The "nodejs.util.promisify.custom" argument must be of type Function');return Object.defineProperty($,kCustomPromisifiedSymbol,{value:$,enumerable:!1,writable:!1,configurable:!0}),$}function $(...V){var W,C,F=new Promise(function(A,z){W=A,C=z});V.push(function(A,z){if(A)C(A);else W(z)});try{Q.apply(this,V)}catch(A){C(A)}return F}if(Object.setPrototypeOf($,Object.getPrototypeOf(Q)),kCustomPromisifiedSymbol)Object.defineProperty($,kCustomPromisifiedSymbol,{value:$,enumerable:!1,writable:!1,configurable:!0});return Object.defineProperties($,Object.getOwnPropertyDescriptors(Q))});({TextEncoder:lQ,TextDecoder:dQ}=globalThis),p$={TextEncoder:lQ,TextDecoder:dQ,promisify:uQ,log:cQ,inherits:pQ,_extend:eZ,callbackifyOnRejected:iZ,callbackify:bQ}});var vU={};WO(vU,{webcrypto:()=>IV,rng:()=>MG,randomUUID:()=>GV,randomFillSync:()=>QV,randomFill:()=>XV,randomBytes:()=>qG,publicEncrypt:()=>iG,publicDecrypt:()=>OV,pseudoRandomBytes:()=>zG,prng:()=>TG,privateEncrypt:()=>UV,privateDecrypt:()=>ZV,pbkdf2Sync:()=>xG,pbkdf2:()=>BG,listCiphers:()=>bG,getRandomValues:()=>JV,getHashes:()=>jG,getDiffieHellman:()=>oG,getCurves:()=>EV,getCiphers:()=>uG,default:()=>CV,createVerify:()=>rG,createSign:()=>sG,createHmac:()=>vG,createHash:()=>kG,createECDH:()=>eG,createDiffieHellmanGroup:()=>dG,createDiffieHellman:()=>nG,createDecipheriv:()=>hG,createDecipher:()=>cG,createCredentials:()=>YV,createCipheriv:()=>wG,createCipher:()=>gG,constants:()=>AV,Verify:()=>aG,Sign:()=>tG,Hmac:()=>_G,Hash:()=>PG,DiffieHellmanGroup:()=>lG,DiffieHellman:()=>mG,Decipheriv:()=>pG,Decipher:()=>yG,DEFAULT_ENCODING:()=>$V,Cipheriv:()=>fG,Cipher:()=>NG});function EV(){return VV}var h$,u$,mQ,b$,l$,d$=(Q,$,V)=>{V=Q!=null?h$(u$(Q)):{};let W=$||!Q||!Q.__esModule?mQ(V,"default",{value:Q,enumerable:!0}):V;for(let C of b$(Q))if(!l$.call(W,C))mQ(W,C,{get:()=>Q[C],enumerable:!0});return W},$0=(Q,$)=>()=>($||Q(($={exports:{}}).exports,$),$.exports),UZ,OZ,tQ,o$,OX,ZX,MU,n$,vO,rQ,m$,s$,t$,r$,aQ,a$,e$,i$,UJ,OJ,ZJ,XJ,QJ,YJ,AJ,jO,ZZ,eQ,$J,iQ,UY,JJ,BO,XX,QX,GJ,OY,YX,VJ,ZY,EJ,XY,QY,IJ,CJ,KJ,LJ,WJ,HJ,DJ,SJ,FJ,RJ,TJ,zJ,MJ,qJ,AX,YY,PJ,AY,kJ,_J,vJ,jJ,sU,OO,$Y,wU,JY,XZ,BJ,xU,xJ,NJ,gJ,GY,dU,xO,VY,fJ,EY,wJ,IY,yJ,cJ,pJ,hJ,$X,uJ,JX,bJ,lJ,dJ,oJ,nJ,mJ,sJ,tJ,rJ,aJ,eJ,iJ,UG,OG,sQ,ZG,_O,XG,CY,KY,QG,YG,LY,AG,$G,NO,JG,GG,VG,EG,IG,CG,WY,KG,HY,DY,SY,GX,FY,LG,RY,WG,HG,UX,DG,SG,FG,RG,p0,TG,zG,MG,qG,PG,kG,_G,vG,jG,BG,xG,NG,gG,fG,wG,yG,cG,pG,hG,uG,bG,lG,dG,oG,nG,mG,sG,tG,rG,aG,eG,iG,UV,OV,ZV,XV,QV,YV,AV,$V="buffer",JV=(Q)=>{return crypto.getRandomValues(Q)},GV=()=>{return crypto.randomUUID()},VV,IV,CV;var jU=HO(()=>{h$=Object.create,{getPrototypeOf:u$,defineProperty:mQ,getOwnPropertyNames:b$}=Object,l$=Object.prototype.hasOwnProperty,UZ=$0((Q,$)=>{$.exports=(jU(),h0(vU)).randomBytes}),OZ=$0((Q,$)=>{$.exports=(jU(),h0(vU)).createHash}),tQ=$0((Q,$)=>{$.exports=(jU(),h0(vU)).createHmac}),o$=$0((Q,$)=>{$.exports={sha224WithRSAEncryption:{sign:"rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},"RSA-SHA224":{sign:"ecdsa/rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},sha256WithRSAEncryption:{sign:"rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},"RSA-SHA256":{sign:"ecdsa/rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},sha384WithRSAEncryption:{sign:"rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},"RSA-SHA384":{sign:"ecdsa/rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},sha512WithRSAEncryption:{sign:"rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA512":{sign:"ecdsa/rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA1":{sign:"rsa",hash:"sha1",id:"3021300906052b0e03021a05000414"},"ecdsa-with-SHA1":{sign:"ecdsa",hash:"sha1",id:""},sha256:{sign:"ecdsa",hash:"sha256",id:""},sha224:{sign:"ecdsa",hash:"sha224",id:""},sha384:{sign:"ecdsa",hash:"sha384",id:""},sha512:{sign:"ecdsa",hash:"sha512",id:""},"DSA-SHA":{sign:"dsa",hash:"sha1",id:""},"DSA-SHA1":{sign:"dsa",hash:"sha1",id:""},DSA:{sign:"dsa",hash:"sha1",id:""},"DSA-WITH-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-WITH-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-WITH-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-WITH-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-RIPEMD160":{sign:"dsa",hash:"rmd160",id:""},ripemd160WithRSA:{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},"RSA-RIPEMD160":{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},md5WithRSAEncryption:{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"},"RSA-MD5":{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"}}}),OX=$0((Q,$)=>{var V=isFinite,W=Math.pow(2,30)-1;$.exports=function(C,F){if(typeof C!=="number")throw TypeError("Iterations not a number");if(C<0||!V(C))throw TypeError("Bad iterations");if(typeof F!=="number")throw TypeError("Key length not a number");if(F<0||F>W||F!==F)throw TypeError("Bad key length")}}),ZX=$0((Q,$)=>{var V;if(globalThis.process&&globalThis.process.browser)V="utf-8";else if(globalThis.process&&globalThis.process.version)W=parseInt(process.version.split(".")[0].slice(1),10),V=W>=6?"utf-8":"binary";else V="utf-8";var W;$.exports=V}),MU=$0((Q,$)=>{/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var V=(HU(),h0(WU)),W=V.Buffer;function C(A,z){for(var M in A)z[M]=A[M]}if(W.from&&W.alloc&&W.allocUnsafe&&W.allocUnsafeSlow)$.exports=V;else C(V,Q),Q.Buffer=F;function F(A,z,M){return W(A,z,M)}F.prototype=Object.create(W.prototype),C(W,F),F.from=function(A,z,M){if(typeof A==="number")throw TypeError("Argument must not be a number");return W(A,z,M)},F.alloc=function(A,z,M){if(typeof A!=="number")throw TypeError("Argument must be a number");var S=W(A);if(z!==void 0)if(typeof M==="string")S.fill(z,M);else S.fill(z);else S.fill(0);return S},F.allocUnsafe=function(A){if(typeof A!=="number")throw TypeError("Argument must be a number");return W(A)},F.allocUnsafeSlow=function(A){if(typeof A!=="number")throw TypeError("Argument must be a number");return V.SlowBuffer(A)}}),n$=$0((Q,$)=>{var V={}.toString;$.exports=Array.isArray||function(W){return V.call(W)=="[object Array]"}}),vO=$0((Q,$)=>{$.exports=TypeError}),rQ=$0((Q,$)=>{$.exports=Object}),m$=$0((Q,$)=>{$.exports=Error}),s$=$0((Q,$)=>{$.exports=EvalError}),t$=$0((Q,$)=>{$.exports=RangeError}),r$=$0((Q,$)=>{$.exports=ReferenceError}),aQ=$0((Q,$)=>{$.exports=SyntaxError}),a$=$0((Q,$)=>{$.exports=URIError}),e$=$0((Q,$)=>{$.exports=Math.abs}),i$=$0((Q,$)=>{$.exports=Math.floor}),UJ=$0((Q,$)=>{$.exports=Math.max}),OJ=$0((Q,$)=>{$.exports=Math.min}),ZJ=$0((Q,$)=>{$.exports=Math.pow}),XJ=$0((Q,$)=>{$.exports=Math.round}),QJ=$0((Q,$)=>{$.exports=Number.isNaN||function(V){return V!==V}}),YJ=$0((Q,$)=>{var V=QJ();$.exports=function(W){if(V(W)||W===0)return W;return W<0?-1:1}}),AJ=$0((Q,$)=>{$.exports=Object.getOwnPropertyDescriptor}),jO=$0((Q,$)=>{var V=AJ();if(V)try{V([],"length")}catch(W){V=null}$.exports=V}),ZZ=$0((Q,$)=>{var V=Object.defineProperty||!1;if(V)try{V({},"a",{value:1})}catch(W){V=!1}$.exports=V}),eQ=$0((Q,$)=>{$.exports=function(){if(typeof Symbol!=="function"||typeof Object.getOwnPropertySymbols!=="function")return!1;if(typeof Symbol.iterator==="symbol")return!0;var V={},W=Symbol("test"),C=Object(W);if(typeof W==="string")return!1;if(Object.prototype.toString.call(W)!=="[object Symbol]")return!1;if(Object.prototype.toString.call(C)!=="[object Symbol]")return!1;var F=42;V[W]=F;for(var A in V)return!1;if(typeof Object.keys==="function"&&Object.keys(V).length!==0)return!1;if(typeof Object.getOwnPropertyNames==="function"&&Object.getOwnPropertyNames(V).length!==0)return!1;var z=Object.getOwnPropertySymbols(V);if(z.length!==1||z[0]!==W)return!1;if(!Object.prototype.propertyIsEnumerable.call(V,W))return!1;if(typeof Object.getOwnPropertyDescriptor==="function"){var M=Object.getOwnPropertyDescriptor(V,W);if(M.value!==F||M.enumerable!==!0)return!1}return!0}}),$J=$0((Q,$)=>{var V=typeof Symbol<"u"&&Symbol,W=eQ();$.exports=function(){if(typeof V!=="function")return!1;if(typeof Symbol!=="function")return!1;if(typeof V("foo")!=="symbol")return!1;if(typeof Symbol("bar")!=="symbol")return!1;return W()}}),iQ=$0((Q,$)=>{$.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null}),UY=$0((Q,$)=>{var V=rQ();$.exports=V.getPrototypeOf||null}),JJ=$0((Q,$)=>{var V="Function.prototype.bind called on incompatible ",W=Object.prototype.toString,C=Math.max,F="[object Function]",A=function(S,R){var L=[];for(var H=0;H<S.length;H+=1)L[H]=S[H];for(var q=0;q<R.length;q+=1)L[q+S.length]=R[q];return L},z=function(S,R){var L=[];for(var H=R||0,q=0;H<S.length;H+=1,q+=1)L[q]=S[H];return L},M=function(S,R){var L="";for(var H=0;H<S.length;H+=1)if(L+=S[H],H+1<S.length)L+=R;return L};$.exports=function(S){var R=this;if(typeof R!=="function"||W.apply(R)!==F)throw TypeError(V+R);var L=z(arguments,1),H,q=function(){if(this instanceof H){var j=R.apply(this,A(L,arguments));if(Object(j)===j)return j;return this}return R.apply(S,A(L,arguments))},P=C(0,R.length-L.length),_=[];for(var k=0;k<P;k++)_[k]="$"+k;if(H=Function("binder","return function ("+M(_,",")+"){ return binder.apply(this,arguments); }")(q),R.prototype){var B=function(){};B.prototype=R.prototype,H.prototype=new B,B.prototype=null}return H}}),BO=$0((Q,$)=>{var V=JJ();$.exports=Function.prototype.bind||V}),XX=$0((Q,$)=>{$.exports=Function.prototype.call}),QX=$0((Q,$)=>{$.exports=Function.prototype.apply}),GJ=$0((Q,$)=>{$.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply}),OY=$0((Q,$)=>{var V=BO(),W=QX(),C=XX(),F=GJ();$.exports=F||V.call(C,W)}),YX=$0((Q,$)=>{var V=BO(),W=vO(),C=XX(),F=OY();$.exports=function(A){if(A.length<1||typeof A[0]!=="function")throw new W("a function is required");return F(V,C,A)}}),VJ=$0((Q,$)=>{var V=YX(),W=jO(),C;try{C=[].__proto__===Array.prototype}catch(M){if(!M||typeof M!=="object"||!("code"in M)||M.code!=="ERR_PROTO_ACCESS")throw M}var F=!!C&&W&&W(Object.prototype,"__proto__"),A=Object,z=A.getPrototypeOf;$.exports=F&&typeof F.get==="function"?V([F.get]):typeof z==="function"?function(M){return z(M==null?M:A(M))}:!1}),ZY=$0((Q,$)=>{var V=iQ(),W=UY(),C=VJ();$.exports=V?function(F){return V(F)}:W?function(F){if(!F||typeof F!=="object"&&typeof F!=="function")throw TypeError("getProto: not an object");return W(F)}:C?function(F){return C(F)}:null}),EJ=$0((Q,$)=>{var V=Function.prototype.call,W=Object.prototype.hasOwnProperty,C=BO();$.exports=C.call(V,W)}),XY=$0((Q,$)=>{var V,W=rQ(),C=m$(),F=s$(),A=t$(),z=r$(),M=aQ(),S=vO(),R=a$(),L=e$(),H=i$(),q=UJ(),P=OJ(),_=ZJ(),k=XJ(),B=YJ(),j=Function,x=function(X0){try{return j('"use strict"; return ('+X0+").constructor;")()}catch(m){}},f=jO(),w=ZZ(),d=function(){throw new S},Y0=f?function(){try{return arguments.callee,d}catch(X0){try{return f(arguments,"callee").get}catch(m){return d}}}():d,J0=$J()(),A0=ZY(),u=UY(),O0=iQ(),U=QX(),X=XX(),J={},Z=typeof Uint8Array>"u"||!A0?V:A0(Uint8Array),Y={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?V:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?V:ArrayBuffer,"%ArrayIteratorPrototype%":J0&&A0?A0([][Symbol.iterator]()):V,"%AsyncFromSyncIteratorPrototype%":V,"%AsyncFunction%":J,"%AsyncGenerator%":J,"%AsyncGeneratorFunction%":J,"%AsyncIteratorPrototype%":J,"%Atomics%":typeof Atomics>"u"?V:Atomics,"%BigInt%":typeof BigInt>"u"?V:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?V:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?V:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?V:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":C,"%eval%":eval,"%EvalError%":F,"%Float16Array%":typeof Float16Array>"u"?V:Float16Array,"%Float32Array%":typeof Float32Array>"u"?V:Float32Array,"%Float64Array%":typeof Float64Array>"u"?V:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?V:FinalizationRegistry,"%Function%":j,"%GeneratorFunction%":J,"%Int8Array%":typeof Int8Array>"u"?V:Int8Array,"%Int16Array%":typeof Int16Array>"u"?V:Int16Array,"%Int32Array%":typeof Int32Array>"u"?V:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":J0&&A0?A0(A0([][Symbol.iterator]())):V,"%JSON%":typeof JSON==="object"?JSON:V,"%Map%":typeof Map>"u"?V:Map,"%MapIteratorPrototype%":typeof Map>"u"||!J0||!A0?V:A0(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":W,"%Object.getOwnPropertyDescriptor%":f,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?V:Promise,"%Proxy%":typeof Proxy>"u"?V:Proxy,"%RangeError%":A,"%ReferenceError%":z,"%Reflect%":typeof Reflect>"u"?V:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?V:Set,"%SetIteratorPrototype%":typeof Set>"u"||!J0||!A0?V:A0(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?V:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":J0&&A0?A0(""[Symbol.iterator]()):V,"%Symbol%":J0?Symbol:V,"%SyntaxError%":M,"%ThrowTypeError%":Y0,"%TypedArray%":Z,"%TypeError%":S,"%Uint8Array%":typeof Uint8Array>"u"?V:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?V:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?V:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?V:Uint32Array,"%URIError%":R,"%WeakMap%":typeof WeakMap>"u"?V:WeakMap,"%WeakRef%":typeof WeakRef>"u"?V:WeakRef,"%WeakSet%":typeof WeakSet>"u"?V:WeakSet,"%Function.prototype.call%":X,"%Function.prototype.apply%":U,"%Object.defineProperty%":w,"%Object.getPrototypeOf%":u,"%Math.abs%":L,"%Math.floor%":H,"%Math.max%":q,"%Math.min%":P,"%Math.pow%":_,"%Math.round%":k,"%Math.sign%":B,"%Reflect.getPrototypeOf%":O0};if(A0)try{null.error}catch(X0){I=A0(A0(X0)),Y["%Error.prototype%"]=I}var I,K=function X0(m){var i;if(m==="%AsyncFunction%")i=x("async function () {}");else if(m==="%GeneratorFunction%")i=x("function* () {}");else if(m==="%AsyncGeneratorFunction%")i=x("async function* () {}");else if(m==="%AsyncGenerator%"){var g0=X0("%AsyncGeneratorFunction%");if(g0)i=g0.prototype}else if(m==="%AsyncIteratorPrototype%"){var y=X0("%AsyncGenerator%");if(y&&A0)i=A0(y.prototype)}return Y[m]=i,i},G={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},O=BO(),E=EJ(),T=O.call(X,Array.prototype.concat),D=O.call(U,Array.prototype.splice),v=O.call(X,String.prototype.replace),g=O.call(X,String.prototype.slice),p=O.call(X,RegExp.prototype.exec),n=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,V0=/\\(\\)?/g,r=function(X0){var m=g(X0,0,1),i=g(X0,-1);if(m==="%"&&i!=="%")throw new M("invalid intrinsic syntax, expected closing `%`");else if(i==="%"&&m!=="%")throw new M("invalid intrinsic syntax, expected opening `%`");var g0=[];return v(X0,n,function(y,h,Q0,t){g0[g0.length]=Q0?v(t,V0,"$1"):h||y}),g0},l=function(X0,m){var i=X0,g0;if(E(G,i))g0=G[i],i="%"+g0[0]+"%";if(E(Y,i)){var y=Y[i];if(y===J)y=K(i);if(typeof y>"u"&&!m)throw new S("intrinsic "+X0+" exists, but is not available. Please file an issue!");return{alias:g0,name:i,value:y}}throw new M("intrinsic "+X0+" does not exist!")};$.exports=function(X0,m){if(typeof X0!=="string"||X0.length===0)throw new S("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof m!=="boolean")throw new S('"allowMissing" argument must be a boolean');if(p(/^%?[^%]*%?$/,X0)===null)throw new M("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var i=r(X0),g0=i.length>0?i[0]:"",y=l("%"+g0+"%",m),h=y.name,Q0=y.value,t=!1,e=y.alias;if(e)g0=e[0],D(i,T([0,1],e));for(var F0=1,c=!0;F0<i.length;F0+=1){var o=i[F0],N0=g(o,0,1),s=g(o,-1);if((N0==='"'||N0==="'"||N0==="`"||(s==='"'||s==="'"||s==="`"))&&N0!==s)throw new M("property names with quotes must have matching quotes");if(o==="constructor"||!c)t=!0;if(g0+="."+o,h="%"+g0+"%",E(Y,h))Q0=Y[h];else if(Q0!=null){if(!(o in Q0)){if(!m)throw new S("base intrinsic for "+X0+" exists, but the property is not available.");return}if(f&&F0+1>=i.length){var Z0=f(Q0,o);if(c=!!Z0,c&&"get"in Z0&&!("originalValue"in Z0.get))Q0=Z0.get;else Q0=Q0[o]}else c=E(Q0,o),Q0=Q0[o];if(c&&!t)Y[h]=Q0}}return Q0}}),QY=$0((Q,$)=>{var V=XY(),W=YX(),C=W([V("%String.prototype.indexOf%")]);$.exports=function(F,A){var z=V(F,!!A);if(typeof z==="function"&&C(F,".prototype.")>-1)return W([z]);return z}}),IJ=$0((Q,$)=>{var V=Function.prototype.toString,W=typeof Reflect==="object"&&Reflect!==null&&Reflect.apply,C,F;if(typeof W==="function"&&typeof Object.defineProperty==="function")try{C=Object.defineProperty({},"length",{get:function(){throw F}}),F={},W(function(){throw 42},null,C)}catch(f){if(f!==F)W=null}else W=null;var A=/^\s*class\b/,z=function(f){try{var w=V.call(f);return A.test(w)}catch(d){return!1}},M=function(f){try{if(z(f))return!1;return V.call(f),!0}catch(w){return!1}},S=Object.prototype.toString,R="[object Object]",L="[object Function]",H="[object GeneratorFunction]",q="[object HTMLAllCollection]",P="[object HTML document.all class]",_="[object HTMLCollection]",k=typeof Symbol==="function"&&!!Symbol.toStringTag,B=!(0 in[,]),j=function(){return!1};if(typeof document==="object"){if(x=document.all,S.call(x)===S.call(document.all))j=function(f){if((B||!f)&&(typeof f>"u"||typeof f==="object"))try{var w=S.call(f);return(w===q||w===P||w===_||w===R)&&f("")==null}catch(d){}return!1}}var x;$.exports=W?function(f){if(j(f))return!0;if(!f)return!1;if(typeof f!=="function"&&typeof f!=="object")return!1;try{W(f,null,C)}catch(w){if(w!==F)return!1}return!z(f)&&M(f)}:function(f){if(j(f))return!0;if(!f)return!1;if(typeof f!=="function"&&typeof f!=="object")return!1;if(k)return M(f);if(z(f))return!1;var w=S.call(f);if(w!==L&&w!==H&&!/^\[object HTML/.test(w))return!1;return M(f)}}),CJ=$0((Q,$)=>{var V=IJ(),W=Object.prototype.toString,C=Object.prototype.hasOwnProperty,F=function(S,R,L){for(var H=0,q=S.length;H<q;H++)if(C.call(S,H))if(L==null)R(S[H],H,S);else R.call(L,S[H],H,S)},A=function(S,R,L){for(var H=0,q=S.length;H<q;H++)if(L==null)R(S.charAt(H),H,S);else R.call(L,S.charAt(H),H,S)},z=function(S,R,L){for(var H in S)if(C.call(S,H))if(L==null)R(S[H],H,S);else R.call(L,S[H],H,S)};function M(S){return W.call(S)==="[object Array]"}$.exports=function(S,R,L){if(!V(R))throw TypeError("iterator must be a function");var H;if(arguments.length>=3)H=L;if(M(S))F(S,R,H);else if(typeof S==="string")A(S,R,H);else z(S,R,H)}}),KJ=$0((Q,$)=>{$.exports=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]}),LJ=$0((Q,$)=>{var V=KJ(),W=typeof globalThis>"u"?globalThis:globalThis;$.exports=function(){var C=[];for(var F=0;F<V.length;F++)if(typeof W[V[F]]==="function")C[C.length]=V[F];return C}}),WJ=$0((Q,$)=>{var V=ZZ(),W=aQ(),C=vO(),F=jO();$.exports=function(A,z,M){if(!A||typeof A!=="object"&&typeof A!=="function")throw new C("`obj` must be an object or a function`");if(typeof z!=="string"&&typeof z!=="symbol")throw new C("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!=="boolean"&&arguments[3]!==null)throw new C("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!=="boolean"&&arguments[4]!==null)throw new C("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!=="boolean"&&arguments[5]!==null)throw new C("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!=="boolean")throw new C("`loose`, if provided, must be a boolean");var S=arguments.length>3?arguments[3]:null,R=arguments.length>4?arguments[4]:null,L=arguments.length>5?arguments[5]:null,H=arguments.length>6?arguments[6]:!1,q=!!F&&F(A,z);if(V)V(A,z,{configurable:L===null&&q?q.configurable:!L,enumerable:S===null&&q?q.enumerable:!S,value:M,writable:R===null&&q?q.writable:!R});else if(H||!S&&!R&&!L)A[z]=M;else throw new W("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}}),HJ=$0((Q,$)=>{var V=ZZ(),W=function(){return!!V};W.hasArrayLengthDefineBug=function(){if(!V)return null;try{return V([],"length",{value:1}).length!==1}catch(C){return!0}},$.exports=W}),DJ=$0((Q,$)=>{var V=XY(),W=WJ(),C=HJ()(),F=jO(),A=vO(),z=V("%Math.floor%");$.exports=function(M,S){if(typeof M!=="function")throw new A("`fn` is not a function");if(typeof S!=="number"||S<0||S>4294967295||z(S)!==S)throw new A("`length` must be a positive 32-bit integer");var R=arguments.length>2&&!!arguments[2],L=!0,H=!0;if("length"in M&&F){var q=F(M,"length");if(q&&!q.configurable)L=!1;if(q&&!q.writable)H=!1}if(L||H||!R)if(C)W(M,"length",S,!0,!0);else W(M,"length",S);return M}}),SJ=$0((Q,$)=>{var V=BO(),W=QX(),C=OY();$.exports=function(){return C(V,W,arguments)}}),FJ=$0((Q,$)=>{var V=DJ(),W=ZZ(),C=YX(),F=SJ();if($.exports=function(A){var z=C(arguments),M=A.length-(arguments.length-1);return V(z,1+(M>0?M:0),!0)},W)W($.exports,"apply",{value:F});else $.exports.apply=F}),RJ=$0((Q,$)=>{var V=eQ();$.exports=function(){return V()&&!!Symbol.toStringTag}}),TJ=$0((Q,$)=>{var V=CJ(),W=LJ(),C=FJ(),F=QY(),A=jO(),z=ZY(),M=F("Object.prototype.toString"),S=RJ()(),R=typeof globalThis>"u"?globalThis:globalThis,L=W(),H=F("String.prototype.slice"),q=F("Array.prototype.indexOf",!0)||function(B,j){for(var x=0;x<B.length;x+=1)if(B[x]===j)return x;return-1},P={__proto__:null};if(S&&A&&z)V(L,function(B){var j=new R[B];if(Symbol.toStringTag in j&&z){var x=z(j),f=A(x,Symbol.toStringTag);if(!f&&x){var w=z(x);f=A(w,Symbol.toStringTag)}P["$"+B]=C(f.get)}});else V(L,function(B){var j=new R[B],x=j.slice||j.set;if(x)P["$"+B]=C(x)});var _=function(B){var j=!1;return V(P,function(x,f){if(!j)try{if("$"+x(B)===f)j=H(f,1)}catch(w){}}),j},k=function(B){var j=!1;return V(P,function(x,f){if(!j)try{x(B),j=H(f,1)}catch(w){}}),j};$.exports=function(B){if(!B||typeof B!=="object")return!1;if(!S){var j=H(M(B),8,-1);if(q(L,j)>-1)return j;if(j!=="Object")return!1;return k(B)}if(!A)return null;return _(B)}}),zJ=$0((Q,$)=>{var V=TJ();$.exports=function(W){return!!V(W)}}),MJ=$0((Q,$)=>{var V=vO(),W=QY(),C=W("TypedArray.prototype.buffer",!0),F=zJ();$.exports=C||function(A){if(!F(A))throw new V("Not a Typed Array");return A.buffer}}),qJ=$0((Q,$)=>{var V=MU().Buffer,W=n$(),C=MJ(),F=ArrayBuffer.isView||function(S){try{return C(S),!0}catch(R){return!1}},A=typeof Uint8Array<"u",z=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",M=z&&(V.prototype instanceof Uint8Array||V.TYPED_ARRAY_SUPPORT);$.exports=function(S,R){if(V.isBuffer(S)){if(S.constructor&&!("isBuffer"in S))return V.from(S);return S}if(typeof S==="string")return V.from(S,R);if(z&&F(S)){if(S.byteLength===0)return V.alloc(0);if(M){var L=V.from(S.buffer,S.byteOffset,S.byteLength);if(L.byteLength===S.byteLength)return L}var H=S instanceof Uint8Array?S:new Uint8Array(S.buffer,S.byteOffset,S.byteLength),q=V.from(H);if(q.length===S.byteLength)return q}if(A&&S instanceof Uint8Array)return V.from(S);var P=W(S);if(P)for(var _=0;_<S.length;_+=1){var k=S[_];if(typeof k!=="number"||k<0||k>255||~~k!==k)throw RangeError("Array items must be numbers in the range 0-255.")}if(P||V.isBuffer(S)&&S.constructor&&typeof S.constructor.isBuffer==="function"&&S.constructor.isBuffer(S))return V.from(S);throw TypeError('The "data" argument must be a string, an Array, a Buffer, a Uint8Array, or a DataView.')}}),AX=$0((Q,$)=>{var V=MU().Buffer,W=qJ(),C=typeof Uint8Array<"u",F=C&&typeof ArrayBuffer<"u",A=F&&ArrayBuffer.isView;$.exports=function(z,M,S){if(typeof z==="string"||V.isBuffer(z)||C&&z instanceof Uint8Array||A&&A(z))return W(z,M);throw TypeError(S+" must be a string, a Buffer, a Uint8Array, or a DataView")}}),YY=$0((Q,$)=>{var V={__proto__:null,md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,"sha512-256":32,rmd160:20,ripemd160:20},W={__proto__:null,"sha-1":"sha1","sha-224":"sha224","sha-256":"sha256","sha-384":"sha384","sha-512":"sha512","ripemd-160":"ripemd160"},C=tQ(),F=MU().Buffer,A=OX(),z=ZX(),M=AX();function S(R,L,H,q,P){A(H,q),R=M(R,z,"Password"),L=M(L,z,"Salt");var _=(P||"sha1").toLowerCase(),k=W[_]||_,B=V[k];if(typeof B!=="number"||!B)throw TypeError("Digest algorithm not supported: "+P);var j=F.allocUnsafe(q),x=F.allocUnsafe(L.length+4);L.copy(x,0,0,L.length);var f=0,w=B,d=Math.ceil(q/w);for(var Y0=1;Y0<=d;Y0++){x.writeUInt32BE(Y0,L.length);var J0=C(k,R).update(x).digest(),A0=J0;for(var u=1;u<H;u++){A0=C(k,R).update(A0).digest();for(var O0=0;O0<w;O0++)J0[O0]^=A0[O0]}J0.copy(j,f),f+=w}return j}$.exports=S}),PJ=$0((Q,$)=>{var V=MU().Buffer,W=OX(),C=ZX(),F=YY(),A=AX(),z,M=globalThis.crypto&&globalThis.crypto.subtle,S={sha:"SHA-1","sha-1":"SHA-1",sha1:"SHA-1",sha256:"SHA-256","sha-256":"SHA-256",sha384:"SHA-384","sha-384":"SHA-384","sha-512":"SHA-512",sha512:"SHA-512"},R=[],L;function H(){if(L)return L;if(globalThis.process&&globalThis.process.nextTick)L=globalThis.process.nextTick;else if(globalThis.queueMicrotask)L=globalThis.queueMicrotask;else if(globalThis.setImmediate)L=globalThis.setImmediate;else L=globalThis.setTimeout;return L}function q(k,B,j,x,f){return M.importKey("raw",k,{name:"PBKDF2"},!1,["deriveBits"]).then(function(w){return M.deriveBits({name:"PBKDF2",salt:B,iterations:j,hash:{name:f}},w,x<<3)}).then(function(w){return V.from(w)})}function P(k){if(globalThis.process&&!globalThis.process.browser)return Promise.resolve(!1);if(!M||!M.importKey||!M.deriveBits)return Promise.resolve(!1);if(R[k]!==void 0)return R[k];z=z||V.alloc(8);var B=q(z,z,10,128,k).then(function(){return!0},function(){return!1});return R[k]=B,B}function _(k,B){k.then(function(j){H()(function(){B(null,j)})},function(j){H()(function(){B(j)})})}$.exports=function(k,B,j,x,f,w){if(typeof f==="function")w=f,f=void 0;if(W(j,x),k=A(k,C,"Password"),B=A(B,C,"Salt"),typeof w!=="function")throw Error("No callback provided to pbkdf2");f=f||"sha1";var d=S[f.toLowerCase()];if(!d||typeof globalThis.Promise!=="function"){H()(function(){var Y0;try{Y0=F(k,B,j,x,f)}catch(J0){w(J0);return}w(null,Y0)});return}_(P(d).then(function(Y0){if(Y0)return q(k,B,j,x,d);return F(k,B,j,x,f)}),w)}}),AY=$0((Q)=>{var $=(jU(),h0(vU)),V=OX(),W=ZX(),C=AX();function F(z,M,S,R,L,H){if(V(S,R),z=C(z,W,"Password"),M=C(M,W,"Salt"),typeof L==="function")H=L,L="sha1";if(typeof H!=="function")throw Error("No callback provided to pbkdf2");return $.pbkdf2(z,M,S,R,L,H)}function A(z,M,S,R,L){return V(S,R),z=C(z,W,"Password"),M=C(M,W,"Salt"),L=L||"sha1",$.pbkdf2Sync(z,M,S,R,L)}if(!$.pbkdf2Sync||$.pbkdf2Sync.toString().indexOf("keylen, digest")===-1)Q.pbkdf2Sync=YY(),Q.pbkdf2=PJ();else Q.pbkdf2Sync=A,Q.pbkdf2=F}),kJ=$0((Q)=>{var $=(jU(),h0(vU));Q.createCipher=Q.Cipher=$.createCipher,Q.createCipheriv=Q.Cipheriv=$.createCipheriv,Q.createDecipher=Q.Decipher=$.createDecipher,Q.createDecipheriv=Q.Decipheriv=$.createDecipheriv,Q.listCiphers=Q.getCiphers=$.getCiphers}),_J=$0((Q)=>{var $=(jU(),h0(vU));Q.DiffieHellmanGroup=$.DiffieHellmanGroup,Q.createDiffieHellmanGroup=$.createDiffieHellmanGroup,Q.getDiffieHellman=$.getDiffieHellman,Q.createDiffieHellman=$.createDiffieHellman,Q.DiffieHellman=$.DiffieHellman}),vJ=$0((Q)=>{var $=(jU(),h0(vU));Q.createSign=$.createSign,Q.Sign=$.Sign,Q.createVerify=$.createVerify,Q.Verify=$.Verify}),jJ=$0((Q,$)=>{$.exports={name:"elliptic",version:"6.6.1",description:"EC cryptography",main:"lib/elliptic.js",files:["lib"],scripts:{lint:"eslint lib test","lint:fix":"npm run lint -- --fix",unit:"istanbul test _mocha --reporter=spec test/index.js",test:"npm run lint && npm run unit",version:"grunt dist && git add dist/"},repository:{type:"git",url:"git@github.com:indutny/elliptic"},keywords:["EC","Elliptic","curve","Cryptography"],author:"Fedor Indutny <fedor@indutny.com>",license:"MIT",bugs:{url:"https://github.com/indutny/elliptic/issues"},homepage:"https://github.com/indutny/elliptic",devDependencies:{brfs:"^2.0.2",coveralls:"^3.1.0",eslint:"^7.6.0",grunt:"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1",istanbul:"^0.4.5",mocha:"^8.0.1"},dependencies:{"bn.js":"^4.11.9",brorand:"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1",inherits:"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"}}}),sU=$0((Q,$)=>{(function(V,W){function C(U,X){if(!U)throw Error(X||"Assertion failed")}function F(U,X){U.super_=X;var J=function(){};J.prototype=X.prototype,U.prototype=new J,U.prototype.constructor=U}function A(U,X,J){if(A.isBN(U))return U;if(this.negative=0,this.words=null,this.length=0,this.red=null,U!==null){if(X==="le"||X==="be")J=X,X=10;this._init(U||0,X||10,J||"be")}}if(typeof V==="object")V.exports=A;else W.BN=A;A.BN=A,A.wordSize=26;var z;try{if(typeof window<"u"&&typeof window.Buffer<"u")z=window.Buffer;else z=(HU(),h0(WU)).Buffer}catch(U){}A.isBN=function(U){if(U instanceof A)return!0;return U!==null&&typeof U==="object"&&U.constructor.wordSize===A.wordSize&&Array.isArray(U.words)},A.max=function(U,X){if(U.cmp(X)>0)return U;return X},A.min=function(U,X){if(U.cmp(X)<0)return U;return X},A.prototype._init=function(U,X,J){if(typeof U==="number")return this._initNumber(U,X,J);if(typeof U==="object")return this._initArray(U,X,J);if(X==="hex")X=16;C(X===(X|0)&&X>=2&&X<=36),U=U.toString().replace(/\s+/g,"");var Z=0;if(U[0]==="-")Z++,this.negative=1;if(Z<U.length){if(X===16)this._parseHex(U,Z,J);else if(this._parseBase(U,X,Z),J==="le")this._initArray(this.toArray(),X,J)}},A.prototype._initNumber=function(U,X,J){if(U<0)this.negative=1,U=-U;if(U<67108864)this.words=[U&67108863],this.length=1;else if(U<4503599627370496)this.words=[U&67108863,U/67108864&67108863],this.length=2;else C(U<9007199254740992),this.words=[U&67108863,U/67108864&67108863,1],this.length=3;if(J!=="le")return;this._initArray(this.toArray(),X,J)},A.prototype._initArray=function(U,X,J){if(C(typeof U.length==="number"),U.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(U.length/3),this.words=Array(this.length);for(var Z=0;Z<this.length;Z++)this.words[Z]=0;var Y,I,K=0;if(J==="be"){for(Z=U.length-1,Y=0;Z>=0;Z-=3)if(I=U[Z]|U[Z-1]<<8|U[Z-2]<<16,this.words[Y]|=I<<K&67108863,this.words[Y+1]=I>>>26-K&67108863,K+=24,K>=26)K-=26,Y++}else if(J==="le"){for(Z=0,Y=0;Z<U.length;Z+=3)if(I=U[Z]|U[Z+1]<<8|U[Z+2]<<16,this.words[Y]|=I<<K&67108863,this.words[Y+1]=I>>>26-K&67108863,K+=24,K>=26)K-=26,Y++}return this.strip()};function M(U,X){var J=U.charCodeAt(X);if(J>=65&&J<=70)return J-55;else if(J>=97&&J<=102)return J-87;else return J-48&15}function S(U,X,J){var Z=M(U,J);if(J-1>=X)Z|=M(U,J-1)<<4;return Z}A.prototype._parseHex=function(U,X,J){this.length=Math.ceil((U.length-X)/6),this.words=Array(this.length);for(var Z=0;Z<this.length;Z++)this.words[Z]=0;var Y=0,I=0,K;if(J==="be")for(Z=U.length-1;Z>=X;Z-=2)if(K=S(U,X,Z)<<Y,this.words[I]|=K&67108863,Y>=18)Y-=18,I+=1,this.words[I]|=K>>>26;else Y+=8;else{var G=U.length-X;for(Z=G%2===0?X+1:X;Z<U.length;Z+=2)if(K=S(U,X,Z)<<Y,this.words[I]|=K&67108863,Y>=18)Y-=18,I+=1,this.words[I]|=K>>>26;else Y+=8}this.strip()};function R(U,X,J,Z){var Y=0,I=Math.min(U.length,J);for(var K=X;K<I;K++){var G=U.charCodeAt(K)-48;if(Y*=Z,G>=49)Y+=G-49+10;else if(G>=17)Y+=G-17+10;else Y+=G}return Y}A.prototype._parseBase=function(U,X,J){this.words=[0],this.length=1;for(var Z=0,Y=1;Y<=67108863;Y*=X)Z++;Z--,Y=Y/X|0;var I=U.length-J,K=I%Z,G=Math.min(I,I-K)+J,O=0;for(var E=J;E<G;E+=Z)if(O=R(U,E,E+Z,X),this.imuln(Y),this.words[0]+O<67108864)this.words[0]+=O;else this._iaddn(O);if(K!==0){var T=1;O=R(U,E,U.length,X);for(E=0;E<K;E++)T*=X;if(this.imuln(T),this.words[0]+O<67108864)this.words[0]+=O;else this._iaddn(O)}this.strip()},A.prototype.copy=function(U){U.words=Array(this.length);for(var X=0;X<this.length;X++)U.words[X]=this.words[X];U.length=this.length,U.negative=this.negative,U.red=this.red},A.prototype.clone=function(){var U=new A(null);return this.copy(U),U},A.prototype._expand=function(U){while(this.length<U)this.words[this.length++]=0;return this},A.prototype.strip=function(){while(this.length>1&&this.words[this.length-1]===0)this.length--;return this._normSign()},A.prototype._normSign=function(){if(this.length===1&&this.words[0]===0)this.negative=0;return this},A.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var L=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],H=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],q=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64000000,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,24300000,28629151,33554432,39135393,45435424,52521875,60466176];if(A.prototype.toString=function(U,X){U=U||10,X=X|0||1;var J;if(U===16||U==="hex"){J="";var Z=0,Y=0;for(var I=0;I<this.length;I++){var K=this.words[I],G=((K<<Z|Y)&16777215).toString(16);if(Y=K>>>24-Z&16777215,Z+=2,Z>=26)Z-=26,I--;if(Y!==0||I!==this.length-1)J=L[6-G.length]+G+J;else J=G+J}if(Y!==0)J=Y.toString(16)+J;while(J.length%X!==0)J="0"+J;if(this.negative!==0)J="-"+J;return J}if(U===(U|0)&&U>=2&&U<=36){var O=H[U],E=q[U];J="";var T=this.clone();T.negative=0;while(!T.isZero()){var D=T.modn(E).toString(U);if(T=T.idivn(E),!T.isZero())J=L[O-D.length]+D+J;else J=D+J}if(this.isZero())J="0"+J;while(J.length%X!==0)J="0"+J;if(this.negative!==0)J="-"+J;return J}C(!1,"Base should be between 2 and 36")},A.prototype.toNumber=function(){var U=this.words[0];if(this.length===2)U+=this.words[1]*67108864;else if(this.length===3&&this.words[2]===1)U+=4503599627370496+this.words[1]*67108864;else if(this.length>2)C(!1,"Number can only safely store up to 53 bits");return this.negative!==0?-U:U},A.prototype.toJSON=function(){return this.toString(16)},A.prototype.toBuffer=function(U,X){return C(typeof z<"u"),this.toArrayLike(z,U,X)},A.prototype.toArray=function(U,X){return this.toArrayLike(Array,U,X)},A.prototype.toArrayLike=function(U,X,J){var Z=this.byteLength(),Y=J||Math.max(1,Z);C(Z<=Y,"byte array longer than desired length"),C(Y>0,"Requested array length <= 0"),this.strip();var I=X==="le",K=new U(Y),G,O,E=this.clone();if(!I){for(O=0;O<Y-Z;O++)K[O]=0;for(O=0;!E.isZero();O++)G=E.andln(255),E.iushrn(8),K[Y-O-1]=G}else{for(O=0;!E.isZero();O++)G=E.andln(255),E.iushrn(8),K[O]=G;for(;O<Y;O++)K[O]=0}return K},Math.clz32)A.prototype._countBits=function(U){return 32-Math.clz32(U)};else A.prototype._countBits=function(U){var X=U,J=0;if(X>=4096)J+=13,X>>>=13;if(X>=64)J+=7,X>>>=7;if(X>=8)J+=4,X>>>=4;if(X>=2)J+=2,X>>>=2;return J+X};A.prototype._zeroBits=function(U){if(U===0)return 26;var X=U,J=0;if((X&8191)===0)J+=13,X>>>=13;if((X&127)===0)J+=7,X>>>=7;if((X&15)===0)J+=4,X>>>=4;if((X&3)===0)J+=2,X>>>=2;if((X&1)===0)J++;return J},A.prototype.bitLength=function(){var U=this.words[this.length-1],X=this._countBits(U);return(this.length-1)*26+X};function P(U){var X=Array(U.bitLength());for(var J=0;J<X.length;J++){var Z=J/26|0,Y=J%26;X[J]=(U.words[Z]&1<<Y)>>>Y}return X}A.prototype.zeroBits=function(){if(this.isZero())return 0;var U=0;for(var X=0;X<this.length;X++){var J=this._zeroBits(this.words[X]);if(U+=J,J!==26)break}return U},A.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},A.prototype.toTwos=function(U){if(this.negative!==0)return this.abs().inotn(U).iaddn(1);return this.clone()},A.prototype.fromTwos=function(U){if(this.testn(U-1))return this.notn(U).iaddn(1).ineg();return this.clone()},A.prototype.isNeg=function(){return this.negative!==0},A.prototype.neg=function(){return this.clone().ineg()},A.prototype.ineg=function(){if(!this.isZero())this.negative^=1;return this},A.prototype.iuor=function(U){while(this.length<U.length)this.words[this.length++]=0;for(var X=0;X<U.length;X++)this.words[X]=this.words[X]|U.words[X];return this.strip()},A.prototype.ior=function(U){return C((this.negative|U.negative)===0),this.iuor(U)},A.prototype.or=function(U){if(this.length>U.length)return this.clone().ior(U);return U.clone().ior(this)},A.prototype.uor=function(U){if(this.length>U.length)return this.clone().iuor(U);return U.clone().iuor(this)},A.prototype.iuand=function(U){var X;if(this.length>U.length)X=U;else X=this;for(var J=0;J<X.length;J++)this.words[J]=this.words[J]&U.words[J];return this.length=X.length,this.strip()},A.prototype.iand=function(U){return C((this.negative|U.negative)===0),this.iuand(U)},A.prototype.and=function(U){if(this.length>U.length)return this.clone().iand(U);return U.clone().iand(this)},A.prototype.uand=function(U){if(this.length>U.length)return this.clone().iuand(U);return U.clone().iuand(this)},A.prototype.iuxor=function(U){var X,J;if(this.length>U.length)X=this,J=U;else X=U,J=this;for(var Z=0;Z<J.length;Z++)this.words[Z]=X.words[Z]^J.words[Z];if(this!==X)for(;Z<X.length;Z++)this.words[Z]=X.words[Z];return this.length=X.length,this.strip()},A.prototype.ixor=function(U){return C((this.negative|U.negative)===0),this.iuxor(U)},A.prototype.xor=function(U){if(this.length>U.length)return this.clone().ixor(U);return U.clone().ixor(this)},A.prototype.uxor=function(U){if(this.length>U.length)return this.clone().iuxor(U);return U.clone().iuxor(this)},A.prototype.inotn=function(U){C(typeof U==="number"&&U>=0);var X=Math.ceil(U/26)|0,J=U%26;if(this._expand(X),J>0)X--;for(var Z=0;Z<X;Z++)this.words[Z]=~this.words[Z]&67108863;if(J>0)this.words[Z]=~this.words[Z]&67108863>>26-J;return this.strip()},A.prototype.notn=function(U){return this.clone().inotn(U)},A.prototype.setn=function(U,X){C(typeof U==="number"&&U>=0);var J=U/26|0,Z=U%26;if(this._expand(J+1),X)this.words[J]=this.words[J]|1<<Z;else this.words[J]=this.words[J]&~(1<<Z);return this.strip()},A.prototype.iadd=function(U){var X;if(this.negative!==0&&U.negative===0)return this.negative=0,X=this.isub(U),this.negative^=1,this._normSign();else if(this.negative===0&&U.negative!==0)return U.negative=0,X=this.isub(U),U.negative=1,X._normSign();var J,Z;if(this.length>U.length)J=this,Z=U;else J=U,Z=this;var Y=0;for(var I=0;I<Z.length;I++)X=(J.words[I]|0)+(Z.words[I]|0)+Y,this.words[I]=X&67108863,Y=X>>>26;for(;Y!==0&&I<J.length;I++)X=(J.words[I]|0)+Y,this.words[I]=X&67108863,Y=X>>>26;if(this.length=J.length,Y!==0)this.words[this.length]=Y,this.length++;else if(J!==this)for(;I<J.length;I++)this.words[I]=J.words[I];return this},A.prototype.add=function(U){var X;if(U.negative!==0&&this.negative===0)return U.negative=0,X=this.sub(U),U.negative^=1,X;else if(U.negative===0&&this.negative!==0)return this.negative=0,X=U.sub(this),this.negative=1,X;if(this.length>U.length)return this.clone().iadd(U);return U.clone().iadd(this)},A.prototype.isub=function(U){if(U.negative!==0){U.negative=0;var X=this.iadd(U);return U.negative=1,X._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(U),this.negative=1,this._normSign();var J=this.cmp(U);if(J===0)return this.negative=0,this.length=1,this.words[0]=0,this;var Z,Y;if(J>0)Z=this,Y=U;else Z=U,Y=this;var I=0;for(var K=0;K<Y.length;K++)X=(Z.words[K]|0)-(Y.words[K]|0)+I,I=X>>26,this.words[K]=X&67108863;for(;I!==0&&K<Z.length;K++)X=(Z.words[K]|0)+I,I=X>>26,this.words[K]=X&67108863;if(I===0&&K<Z.length&&Z!==this)for(;K<Z.length;K++)this.words[K]=Z.words[K];if(this.length=Math.max(this.length,K),Z!==this)this.negative=1;return this.strip()},A.prototype.sub=function(U){return this.clone().isub(U)};function _(U,X,J){J.negative=X.negative^U.negative;var Z=U.length+X.length|0;J.length=Z,Z=Z-1|0;var Y=U.words[0]|0,I=X.words[0]|0,K=Y*I,G=K&67108863,O=K/67108864|0;J.words[0]=G;for(var E=1;E<Z;E++){var T=O>>>26,D=O&67108863,v=Math.min(E,X.length-1);for(var g=Math.max(0,E-U.length+1);g<=v;g++){var p=E-g|0;Y=U.words[p]|0,I=X.words[g]|0,K=Y*I+D,T+=K/67108864|0,D=K&67108863}J.words[E]=D|0,O=T|0}if(O!==0)J.words[E]=O|0;else J.length--;return J.strip()}var k=function(U,X,J){var Z=U.words,Y=X.words,I=J.words,K=0,G,O,E,T=Z[0]|0,D=T&8191,v=T>>>13,g=Z[1]|0,p=g&8191,n=g>>>13,V0=Z[2]|0,r=V0&8191,l=V0>>>13,X0=Z[3]|0,m=X0&8191,i=X0>>>13,g0=Z[4]|0,y=g0&8191,h=g0>>>13,Q0=Z[5]|0,t=Q0&8191,e=Q0>>>13,F0=Z[6]|0,c=F0&8191,o=F0>>>13,N0=Z[7]|0,s=N0&8191,Z0=N0>>>13,w0=Z[8]|0,C0=w0&8191,K0=w0>>>13,s0=Z[9]|0,E0=s0&8191,L0=s0>>>13,e0=Y[0]|0,D0=e0&8191,H0=e0>>>13,FU=Y[1]|0,R0=FU&8191,k0=FU>>>13,RU=Y[2]|0,_0=RU&8191,T0=RU>>>13,DU=Y[3]|0,v0=DU&8191,z0=DU>>>13,CU=Y[4]|0,j0=CU&8191,B0=CU>>>13,KU=Y[5]|0,M0=KU&8191,N=KU>>>13,b=Y[6]|0,a=b&8191,U0=b>>>13,f0=Y[7]|0,I0=f0&8191,W0=f0>>>13,t0=Y[8]|0,q0=t0&8191,x0=t0>>>13,SU=Y[9]|0,P0=SU&8191,S0=SU>>>13;J.negative=U.negative^X.negative,J.length=19,G=Math.imul(D,D0),O=Math.imul(D,H0),O=O+Math.imul(v,D0)|0,E=Math.imul(v,H0);var r0=(K+G|0)+((O&8191)<<13)|0;K=(E+(O>>>13)|0)+(r0>>>26)|0,r0&=67108863,G=Math.imul(p,D0),O=Math.imul(p,H0),O=O+Math.imul(n,D0)|0,E=Math.imul(n,H0),G=G+Math.imul(D,R0)|0,O=O+Math.imul(D,k0)|0,O=O+Math.imul(v,R0)|0,E=E+Math.imul(v,k0)|0;var c0=(K+G|0)+((O&8191)<<13)|0;K=(E+(O>>>13)|0)+(c0>>>26)|0,c0&=67108863,G=Math.imul(r,D0),O=Math.imul(r,H0),O=O+Math.imul(l,D0)|0,E=Math.imul(l,H0),G=G+Math.imul(p,R0)|0,O=O+Math.imul(p,k0)|0,O=O+Math.imul(n,R0)|0,E=E+Math.imul(n,k0)|0,G=G+Math.imul(D,_0)|0,O=O+Math.imul(D,T0)|0,O=O+Math.imul(v,_0)|0,E=E+Math.imul(v,T0)|0;var y0=(K+G|0)+((O&8191)<<13)|0;K=(E+(O>>>13)|0)+(y0>>>26)|0,y0&=67108863,G=Math.imul(m,D0),O=Math.imul(m,H0),O=O+Math.imul(i,D0)|0,E=Math.imul(i,H0),G=G+Math.imul(r,R0)|0,O=O+Math.imul(r,k0)|0,O=O+Math.imul(l,R0)|0,E=E+Math.imul(l,k0)|0,G=G+Math.imul(p,_0)|0,O=O+Math.imul(p,T0)|0,O=O+Math.imul(n,_0)|0,E=E+Math.imul(n,T0)|0,G=G+Math.imul(D,v0)|0,O=O+Math.imul(D,z0)|0,O=O+Math.imul(v,v0)|0,E=E+Math.imul(v,z0)|0;var d0=(K+G|0)+((O&8191)<<13)|0;K=(E+(O>>>13)|0)+(d0>>>26)|0,d0&=67108863,G=Math.imul(y,D0),O=Math.imul(y,H0),O=O+Math.imul(h,D0)|0,E=Math.imul(h,H0),G=G+Math.imul(m,R0)|0,O=O+Math.imul(m,k0)|0,O=O+Math.imul(i,R0)|0,E=E+Math.imul(i,k0)|0,G=G+Math.imul(r,_0)|0,O=O+Math.imul(r,T0)|0,O=O+Math.imul(l,_0)|0,E=E+Math.imul(l,T0)|0,G=G+Math.imul(p,v0)|0,O=O+Math.imul(p,z0)|0,O=O+Math.imul(n,v0)|0,E=E+Math.imul(n,z0)|0,G=G+Math.imul(D,j0)|0,O=O+Math.imul(D,B0)|0,O=O+Math.imul(v,j0)|0,E=E+Math.imul(v,B0)|0;var l0=(K+G|0)+((O&8191)<<13)|0;K=(E+(O>>>13)|0)+(l0>>>26)|0,l0&=67108863,G=Math.imul(t,D0),O=Math.imul(t,H0),O=O+Math.imul(e,D0)|0,E=Math.imul(e,H0),G=G+Math.imul(y,R0)|0,O=O+Math.imul(y,k0)|0,O=O+Math.imul(h,R0)|0,E=E+Math.imul(h,k0)|0,G=G+Math.imul(m,_0)|0,O=O+Math.imul(m,T0)|0,O=O+Math.imul(i,_0)|0,E=E+Math.imul(i,T0)|0,G=G+Math.imul(r,v0)|0,O=O+Math.imul(r,z0)|0,O=O+Math.imul(l,v0)|0,E=E+Math.imul(l,z0)|0,G=G+Math.imul(p,j0)|0,O=O+Math.imul(p,B0)|0,O=O+Math.imul(n,j0)|0,E=E+Math.imul(n,B0)|0,G=G+Math.imul(D,M0)|0,O=O+Math.imul(D,N)|0,O=O+Math.imul(v,M0)|0,E=E+Math.imul(v,N)|0;var i0=(K+G|0)+((O&8191)<<13)|0;K=(E+(O>>>13)|0)+(i0>>>26)|0,i0&=67108863,G=Math.imul(c,D0),O=Math.imul(c,H0),O=O+Math.imul(o,D0)|0,E=Math.imul(o,H0),G=G+Math.imul(t,R0)|0,O=O+Math.imul(t,k0)|0,O=O+Math.imul(e,R0)|0,E=E+Math.imul(e,k0)|0,G=G+Math.imul(y,_0)|0,O=O+Math.imul(y,T0)|0,O=O+Math.imul(h,_0)|0,E=E+Math.imul(h,T0)|0,G=G+Math.imul(m,v0)|0,O=O+Math.imul(m,z0)|0,O=O+Math.imul(i,v0)|0,E=E+Math.imul(i,z0)|0,G=G+Math.imul(r,j0)|0,O=O+Math.imul(r,B0)|0,O=O+Math.imul(l,j0)|0,E=E+Math.imul(l,B0)|0,G=G+Math.imul(p,M0)|0,O=O+Math.imul(p,N)|0,O=O+Math.imul(n,M0)|0,E=E+Math.imul(n,N)|0,G=G+Math.imul(D,a)|0,O=O+Math.imul(D,U0)|0,O=O+Math.imul(v,a)|0,E=E+Math.imul(v,U0)|0;var UU=(K+G|0)+((O&8191)<<13)|0;K=(E+(O>>>13)|0)+(UU>>>26)|0,UU&=67108863,G=Math.imul(s,D0),O=Math.imul(s,H0),O=O+Math.imul(Z0,D0)|0,E=Math.imul(Z0,H0),G=G+Math.imul(c,R0)|0,O=O+Math.imul(c,k0)|0,O=O+Math.imul(o,R0)|0,E=E+Math.imul(o,k0)|0,G=G+Math.imul(t,_0)|0,O=O+Math.imul(t,T0)|0,O=O+Math.imul(e,_0)|0,E=E+Math.imul(e,T0)|0,G=G+Math.imul(y,v0)|0,O=O+Math.imul(y,z0)|0,O=O+Math.imul(h,v0)|0,E=E+Math.imul(h,z0)|0,G=G+Math.imul(m,j0)|0,O=O+Math.imul(m,B0)|0,O=O+Math.imul(i,j0)|0,E=E+Math.imul(i,B0)|0,G=G+Math.imul(r,M0)|0,O=O+Math.imul(r,N)|0,O=O+Math.imul(l,M0)|0,E=E+Math.imul(l,N)|0,G=G+Math.imul(p,a)|0,O=O+Math.imul(p,U0)|0,O=O+Math.imul(n,a)|0,E=E+Math.imul(n,U0)|0,G=G+Math.imul(D,I0)|0,O=O+Math.imul(D,W0)|0,O=O+Math.imul(v,I0)|0,E=E+Math.imul(v,W0)|0;var OU=(K+G|0)+((O&8191)<<13)|0;K=(E+(O>>>13)|0)+(OU>>>26)|0,OU&=67108863,G=Math.imul(C0,D0),O=Math.imul(C0,H0),O=O+Math.imul(K0,D0)|0,E=Math.imul(K0,H0),G=G+Math.imul(s,R0)|0,O=O+Math.imul(s,k0)|0,O=O+Math.imul(Z0,R0)|0,E=E+Math.imul(Z0,k0)|0,G=G+Math.imul(c,_0)|0,O=O+Math.imul(c,T0)|0,O=O+Math.imul(o,_0)|0,E=E+Math.imul(o,T0)|0,G=G+Math.imul(t,v0)|0,O=O+Math.imul(t,z0)|0,O=O+Math.imul(e,v0)|0,E=E+Math.imul(e,z0)|0,G=G+Math.imul(y,j0)|0,O=O+Math.imul(y,B0)|0,O=O+Math.imul(h,j0)|0,E=E+Math.imul(h,B0)|0,G=G+Math.imul(m,M0)|0,O=O+Math.imul(m,N)|0,O=O+Math.imul(i,M0)|0,E=E+Math.imul(i,N)|0,G=G+Math.imul(r,a)|0,O=O+Math.imul(r,U0)|0,O=O+Math.imul(l,a)|0,E=E+Math.imul(l,U0)|0,G=G+Math.imul(p,I0)|0,O=O+Math.imul(p,W0)|0,O=O+Math.imul(n,I0)|0,E=E+Math.imul(n,W0)|0,G=G+Math.imul(D,q0)|0,O=O+Math.imul(D,x0)|0,O=O+Math.imul(v,q0)|0,E=E+Math.imul(v,x0)|0;var ZU=(K+G|0)+((O&8191)<<13)|0;K=(E+(O>>>13)|0)+(ZU>>>26)|0,ZU&=67108863,G=Math.imul(E0,D0),O=Math.imul(E0,H0),O=O+Math.imul(L0,D0)|0,E=Math.imul(L0,H0),G=G+Math.imul(C0,R0)|0,O=O+Math.imul(C0,k0)|0,O=O+Math.imul(K0,R0)|0,E=E+Math.imul(K0,k0)|0,G=G+Math.imul(s,_0)|0,O=O+Math.imul(s,T0)|0,O=O+Math.imul(Z0,_0)|0,E=E+Math.imul(Z0,T0)|0,G=G+Math.imul(c,v0)|0,O=O+Math.imul(c,z0)|0,O=O+Math.imul(o,v0)|0,E=E+Math.imul(o,z0)|0,G=G+Math.imul(t,j0)|0,O=O+Math.imul(t,B0)|0,O=O+Math.imul(e,j0)|0,E=E+Math.imul(e,B0)|0,G=G+Math.imul(y,M0)|0,O=O+Math.imul(y,N)|0,O=O+Math.imul(h,M0)|0,E=E+Math.imul(h,N)|0,G=G+Math.imul(m,a)|0,O=O+Math.imul(m,U0)|0,O=O+Math.imul(i,a)|0,E=E+Math.imul(i,U0)|0,G=G+Math.imul(r,I0)|0,O=O+Math.imul(r,W0)|0,O=O+Math.imul(l,I0)|0,E=E+Math.imul(l,W0)|0,G=G+Math.imul(p,q0)|0,O=O+Math.imul(p,x0)|0,O=O+Math.imul(n,q0)|0,E=E+Math.imul(n,x0)|0,G=G+Math.imul(D,P0)|0,O=O+Math.imul(D,S0)|0,O=O+Math.imul(v,P0)|0,E=E+Math.imul(v,S0)|0;var XU=(K+G|0)+((O&8191)<<13)|0;K=(E+(O>>>13)|0)+(XU>>>26)|0,XU&=67108863,G=Math.imul(E0,R0),O=Math.imul(E0,k0),O=O+Math.imul(L0,R0)|0,E=Math.imul(L0,k0),G=G+Math.imul(C0,_0)|0,O=O+Math.imul(C0,T0)|0,O=O+Math.imul(K0,_0)|0,E=E+Math.imul(K0,T0)|0,G=G+Math.imul(s,v0)|0,O=O+Math.imul(s,z0)|0,O=O+Math.imul(Z0,v0)|0,E=E+Math.imul(Z0,z0)|0,G=G+Math.imul(c,j0)|0,O=O+Math.imul(c,B0)|0,O=O+Math.imul(o,j0)|0,E=E+Math.imul(o,B0)|0,G=G+Math.imul(t,M0)|0,O=O+Math.imul(t,N)|0,O=O+Math.imul(e,M0)|0,E=E+Math.imul(e,N)|0,G=G+Math.imul(y,a)|0,O=O+Math.imul(y,U0)|0,O=O+Math.imul(h,a)|0,E=E+Math.imul(h,U0)|0,G=G+Math.imul(m,I0)|0,O=O+Math.imul(m,W0)|0,O=O+Math.imul(i,I0)|0,E=E+Math.imul(i,W0)|0,G=G+Math.imul(r,q0)|0,O=O+Math.imul(r,x0)|0,O=O+Math.imul(l,q0)|0,E=E+Math.imul(l,x0)|0,G=G+Math.imul(p,P0)|0,O=O+Math.imul(p,S0)|0,O=O+Math.imul(n,P0)|0,E=E+Math.imul(n,S0)|0;var QU=(K+G|0)+((O&8191)<<13)|0;K=(E+(O>>>13)|0)+(QU>>>26)|0,QU&=67108863,G=Math.imul(E0,_0),O=Math.imul(E0,T0),O=O+Math.imul(L0,_0)|0,E=Math.imul(L0,T0),G=G+Math.imul(C0,v0)|0,O=O+Math.imul(C0,z0)|0,O=O+Math.imul(K0,v0)|0,E=E+Math.imul(K0,z0)|0,G=G+Math.imul(s,j0)|0,O=O+Math.imul(s,B0)|0,O=O+Math.imul(Z0,j0)|0,E=E+Math.imul(Z0,B0)|0,G=G+Math.imul(c,M0)|0,O=O+Math.imul(c,N)|0,O=O+Math.imul(o,M0)|0,E=E+Math.imul(o,N)|0,G=G+Math.imul(t,a)|0,O=O+Math.imul(t,U0)|0,O=O+Math.imul(e,a)|0,E=E+Math.imul(e,U0)|0,G=G+Math.imul(y,I0)|0,O=O+Math.imul(y,W0)|0,O=O+Math.imul(h,I0)|0,E=E+Math.imul(h,W0)|0,G=G+Math.imul(m,q0)|0,O=O+Math.imul(m,x0)|0,O=O+Math.imul(i,q0)|0,E=E+Math.imul(i,x0)|0,G=G+Math.imul(r,P0)|0,O=O+Math.imul(r,S0)|0,O=O+Math.imul(l,P0)|0,E=E+Math.imul(l,S0)|0;var YU=(K+G|0)+((O&8191)<<13)|0;K=(E+(O>>>13)|0)+(YU>>>26)|0,YU&=67108863,G=Math.imul(E0,v0),O=Math.imul(E0,z0),O=O+Math.imul(L0,v0)|0,E=Math.imul(L0,z0),G=G+Math.imul(C0,j0)|0,O=O+Math.imul(C0,B0)|0,O=O+Math.imul(K0,j0)|0,E=E+Math.imul(K0,B0)|0,G=G+Math.imul(s,M0)|0,O=O+Math.imul(s,N)|0,O=O+Math.imul(Z0,M0)|0,E=E+Math.imul(Z0,N)|0,G=G+Math.imul(c,a)|0,O=O+Math.imul(c,U0)|0,O=O+Math.imul(o,a)|0,E=E+Math.imul(o,U0)|0,G=G+Math.imul(t,I0)|0,O=O+Math.imul(t,W0)|0,O=O+Math.imul(e,I0)|0,E=E+Math.imul(e,W0)|0,G=G+Math.imul(y,q0)|0,O=O+Math.imul(y,x0)|0,O=O+Math.imul(h,q0)|0,E=E+Math.imul(h,x0)|0,G=G+Math.imul(m,P0)|0,O=O+Math.imul(m,S0)|0,O=O+Math.imul(i,P0)|0,E=E+Math.imul(i,S0)|0;var AU=(K+G|0)+((O&8191)<<13)|0;K=(E+(O>>>13)|0)+(AU>>>26)|0,AU&=67108863,G=Math.imul(E0,j0),O=Math.imul(E0,B0),O=O+Math.imul(L0,j0)|0,E=Math.imul(L0,B0),G=G+Math.imul(C0,M0)|0,O=O+Math.imul(C0,N)|0,O=O+Math.imul(K0,M0)|0,E=E+Math.imul(K0,N)|0,G=G+Math.imul(s,a)|0,O=O+Math.imul(s,U0)|0,O=O+Math.imul(Z0,a)|0,E=E+Math.imul(Z0,U0)|0,G=G+Math.imul(c,I0)|0,O=O+Math.imul(c,W0)|0,O=O+Math.imul(o,I0)|0,E=E+Math.imul(o,W0)|0,G=G+Math.imul(t,q0)|0,O=O+Math.imul(t,x0)|0,O=O+Math.imul(e,q0)|0,E=E+Math.imul(e,x0)|0,G=G+Math.imul(y,P0)|0,O=O+Math.imul(y,S0)|0,O=O+Math.imul(h,P0)|0,E=E+Math.imul(h,S0)|0;var $U=(K+G|0)+((O&8191)<<13)|0;K=(E+(O>>>13)|0)+($U>>>26)|0,$U&=67108863,G=Math.imul(E0,M0),O=Math.imul(E0,N),O=O+Math.imul(L0,M0)|0,E=Math.imul(L0,N),G=G+Math.imul(C0,a)|0,O=O+Math.imul(C0,U0)|0,O=O+Math.imul(K0,a)|0,E=E+Math.imul(K0,U0)|0,G=G+Math.imul(s,I0)|0,O=O+Math.imul(s,W0)|0,O=O+Math.imul(Z0,I0)|0,E=E+Math.imul(Z0,W0)|0,G=G+Math.imul(c,q0)|0,O=O+Math.imul(c,x0)|0,O=O+Math.imul(o,q0)|0,E=E+Math.imul(o,x0)|0,G=G+Math.imul(t,P0)|0,O=O+Math.imul(t,S0)|0,O=O+Math.imul(e,P0)|0,E=E+Math.imul(e,S0)|0;var JU=(K+G|0)+((O&8191)<<13)|0;K=(E+(O>>>13)|0)+(JU>>>26)|0,JU&=67108863,G=Math.imul(E0,a),O=Math.imul(E0,U0),O=O+Math.imul(L0,a)|0,E=Math.imul(L0,U0),G=G+Math.imul(C0,I0)|0,O=O+Math.imul(C0,W0)|0,O=O+Math.imul(K0,I0)|0,E=E+Math.imul(K0,W0)|0,G=G+Math.imul(s,q0)|0,O=O+Math.imul(s,x0)|0,O=O+Math.imul(Z0,q0)|0,E=E+Math.imul(Z0,x0)|0,G=G+Math.imul(c,P0)|0,O=O+Math.imul(c,S0)|0,O=O+Math.imul(o,P0)|0,E=E+Math.imul(o,S0)|0;var GU=(K+G|0)+((O&8191)<<13)|0;K=(E+(O>>>13)|0)+(GU>>>26)|0,GU&=67108863,G=Math.imul(E0,I0),O=Math.imul(E0,W0),O=O+Math.imul(L0,I0)|0,E=Math.imul(L0,W0),G=G+Math.imul(C0,q0)|0,O=O+Math.imul(C0,x0)|0,O=O+Math.imul(K0,q0)|0,E=E+Math.imul(K0,x0)|0,G=G+Math.imul(s,P0)|0,O=O+Math.imul(s,S0)|0,O=O+Math.imul(Z0,P0)|0,E=E+Math.imul(Z0,S0)|0;var VU=(K+G|0)+((O&8191)<<13)|0;K=(E+(O>>>13)|0)+(VU>>>26)|0,VU&=67108863,G=Math.imul(E0,q0),O=Math.imul(E0,x0),O=O+Math.imul(L0,q0)|0,E=Math.imul(L0,x0),G=G+Math.imul(C0,P0)|0,O=O+Math.imul(C0,S0)|0,O=O+Math.imul(K0,P0)|0,E=E+Math.imul(K0,S0)|0;var EU=(K+G|0)+((O&8191)<<13)|0;K=(E+(O>>>13)|0)+(EU>>>26)|0,EU&=67108863,G=Math.imul(E0,P0),O=Math.imul(E0,S0),O=O+Math.imul(L0,P0)|0,E=Math.imul(L0,S0);var IU=(K+G|0)+((O&8191)<<13)|0;if(K=(E+(O>>>13)|0)+(IU>>>26)|0,IU&=67108863,I[0]=r0,I[1]=c0,I[2]=y0,I[3]=d0,I[4]=l0,I[5]=i0,I[6]=UU,I[7]=OU,I[8]=ZU,I[9]=XU,I[10]=QU,I[11]=YU,I[12]=AU,I[13]=$U,I[14]=JU,I[15]=GU,I[16]=VU,I[17]=EU,I[18]=IU,K!==0)I[19]=K,J.length++;return J};if(!Math.imul)k=_;function B(U,X,J){J.negative=X.negative^U.negative,J.length=U.length+X.length;var Z=0,Y=0;for(var I=0;I<J.length-1;I++){var K=Y;Y=0;var G=Z&67108863,O=Math.min(I,X.length-1);for(var E=Math.max(0,I-U.length+1);E<=O;E++){var T=I-E,D=U.words[T]|0,v=X.words[E]|0,g=D*v,p=g&67108863;K=K+(g/67108864|0)|0,p=p+G|0,G=p&67108863,K=K+(p>>>26)|0,Y+=K>>>26,K&=67108863}J.words[I]=G,Z=K,K=Y}if(Z!==0)J.words[I]=Z;else J.length--;return J.strip()}function j(U,X,J){var Z=new x;return Z.mulp(U,X,J)}A.prototype.mulTo=function(U,X){var J,Z=this.length+U.length;if(this.length===10&&U.length===10)J=k(this,U,X);else if(Z<63)J=_(this,U,X);else if(Z<1024)J=B(this,U,X);else J=j(this,U,X);return J};function x(U,X){this.x=U,this.y=X}x.prototype.makeRBT=function(U){var X=Array(U),J=A.prototype._countBits(U)-1;for(var Z=0;Z<U;Z++)X[Z]=this.revBin(Z,J,U);return X},x.prototype.revBin=function(U,X,J){if(U===0||U===J-1)return U;var Z=0;for(var Y=0;Y<X;Y++)Z|=(U&1)<<X-Y-1,U>>=1;return Z},x.prototype.permute=function(U,X,J,Z,Y,I){for(var K=0;K<I;K++)Z[K]=X[U[K]],Y[K]=J[U[K]]},x.prototype.transform=function(U,X,J,Z,Y,I){this.permute(I,U,X,J,Z,Y);for(var K=1;K<Y;K<<=1){var G=K<<1,O=Math.cos(2*Math.PI/G),E=Math.sin(2*Math.PI/G);for(var T=0;T<Y;T+=G){var D=O,v=E;for(var g=0;g<K;g++){var p=J[T+g],n=Z[T+g],V0=J[T+g+K],r=Z[T+g+K],l=D*V0-v*r;if(r=D*r+v*V0,V0=l,J[T+g]=p+V0,Z[T+g]=n+r,J[T+g+K]=p-V0,Z[T+g+K]=n-r,g!==G)l=O*D-E*v,v=O*v+E*D,D=l}}}},x.prototype.guessLen13b=function(U,X){var J=Math.max(X,U)|1,Z=J&1,Y=0;for(J=J/2|0;J;J=J>>>1)Y++;return 1<<Y+1+Z},x.prototype.conjugate=function(U,X,J){if(J<=1)return;for(var Z=0;Z<J/2;Z++){var Y=U[Z];U[Z]=U[J-Z-1],U[J-Z-1]=Y,Y=X[Z],X[Z]=-X[J-Z-1],X[J-Z-1]=-Y}},x.prototype.normalize13b=function(U,X){var J=0;for(var Z=0;Z<X/2;Z++){var Y=Math.round(U[2*Z+1]/X)*8192+Math.round(U[2*Z]/X)+J;if(U[Z]=Y&67108863,Y<67108864)J=0;else J=Y/67108864|0}return U},x.prototype.convert13b=function(U,X,J,Z){var Y=0;for(var I=0;I<X;I++)Y=Y+(U[I]|0),J[2*I]=Y&8191,Y=Y>>>13,J[2*I+1]=Y&8191,Y=Y>>>13;for(I=2*X;I<Z;++I)J[I]=0;C(Y===0),C((Y&-8192)===0)},x.prototype.stub=function(U){var X=Array(U);for(var J=0;J<U;J++)X[J]=0;return X},x.prototype.mulp=function(U,X,J){var Z=2*this.guessLen13b(U.length,X.length),Y=this.makeRBT(Z),I=this.stub(Z),K=Array(Z),G=Array(Z),O=Array(Z),E=Array(Z),T=Array(Z),D=Array(Z),v=J.words;v.length=Z,this.convert13b(U.words,U.length,K,Z),this.convert13b(X.words,X.length,E,Z),this.transform(K,I,G,O,Z,Y),this.transform(E,I,T,D,Z,Y);for(var g=0;g<Z;g++){var p=G[g]*T[g]-O[g]*D[g];O[g]=G[g]*D[g]+O[g]*T[g],G[g]=p}return this.conjugate(G,O,Z),this.transform(G,O,v,I,Z,Y),this.conjugate(v,I,Z),this.normalize13b(v,Z),J.negative=U.negative^X.negative,J.length=U.length+X.length,J.strip()},A.prototype.mul=function(U){var X=new A(null);return X.words=Array(this.length+U.length),this.mulTo(U,X)},A.prototype.mulf=function(U){var X=new A(null);return X.words=Array(this.length+U.length),j(this,U,X)},A.prototype.imul=function(U){return this.clone().mulTo(U,this)},A.prototype.imuln=function(U){C(typeof U==="number"),C(U<67108864);var X=0;for(var J=0;J<this.length;J++){var Z=(this.words[J]|0)*U,Y=(Z&67108863)+(X&67108863);X>>=26,X+=Z/67108864|0,X+=Y>>>26,this.words[J]=Y&67108863}if(X!==0)this.words[J]=X,this.length++;return this.length=U===0?1:this.length,this},A.prototype.muln=function(U){return this.clone().imuln(U)},A.prototype.sqr=function(){return this.mul(this)},A.prototype.isqr=function(){return this.imul(this.clone())},A.prototype.pow=function(U){var X=P(U);if(X.length===0)return new A(1);var J=this;for(var Z=0;Z<X.length;Z++,J=J.sqr())if(X[Z]!==0)break;if(++Z<X.length)for(var Y=J.sqr();Z<X.length;Z++,Y=Y.sqr()){if(X[Z]===0)continue;J=J.mul(Y)}return J},A.prototype.iushln=function(U){C(typeof U==="number"&&U>=0);var X=U%26,J=(U-X)/26,Z=67108863>>>26-X<<26-X,Y;if(X!==0){var I=0;for(Y=0;Y<this.length;Y++){var K=this.words[Y]&Z,G=(this.words[Y]|0)-K<<X;this.words[Y]=G|I,I=K>>>26-X}if(I)this.words[Y]=I,this.length++}if(J!==0){for(Y=this.length-1;Y>=0;Y--)this.words[Y+J]=this.words[Y];for(Y=0;Y<J;Y++)this.words[Y]=0;this.length+=J}return this.strip()},A.prototype.ishln=function(U){return C(this.negative===0),this.iushln(U)},A.prototype.iushrn=function(U,X,J){C(typeof U==="number"&&U>=0);var Z;if(X)Z=(X-X%26)/26;else Z=0;var Y=U%26,I=Math.min((U-Y)/26,this.length),K=67108863^67108863>>>Y<<Y,G=J;if(Z-=I,Z=Math.max(0,Z),G){for(var O=0;O<I;O++)G.words[O]=this.words[O];G.length=I}if(I===0);else if(this.length>I){this.length-=I;for(O=0;O<this.length;O++)this.words[O]=this.words[O+I]}else this.words[0]=0,this.length=1;var E=0;for(O=this.length-1;O>=0&&(E!==0||O>=Z);O--){var T=this.words[O]|0;this.words[O]=E<<26-Y|T>>>Y,E=T&K}if(G&&E!==0)G.words[G.length++]=E;if(this.length===0)this.words[0]=0,this.length=1;return this.strip()},A.prototype.ishrn=function(U,X,J){return C(this.negative===0),this.iushrn(U,X,J)},A.prototype.shln=function(U){return this.clone().ishln(U)},A.prototype.ushln=function(U){return this.clone().iushln(U)},A.prototype.shrn=function(U){return this.clone().ishrn(U)},A.prototype.ushrn=function(U){return this.clone().iushrn(U)},A.prototype.testn=function(U){C(typeof U==="number"&&U>=0);var X=U%26,J=(U-X)/26,Z=1<<X;if(this.length<=J)return!1;var Y=this.words[J];return!!(Y&Z)},A.prototype.imaskn=function(U){C(typeof U==="number"&&U>=0);var X=U%26,J=(U-X)/26;if(C(this.negative===0,"imaskn works only with positive numbers"),this.length<=J)return this;if(X!==0)J++;if(this.length=Math.min(J,this.length),X!==0){var Z=67108863^67108863>>>X<<X;this.words[this.length-1]&=Z}return this.strip()},A.prototype.maskn=function(U){return this.clone().imaskn(U)},A.prototype.iaddn=function(U){if(C(typeof U==="number"),C(U<67108864),U<0)return this.isubn(-U);if(this.negative!==0){if(this.length===1&&(this.words[0]|0)<U)return this.words[0]=U-(this.words[0]|0),this.negative=0,this;return this.negative=0,this.isubn(U),this.negative=1,this}return this._iaddn(U)},A.prototype._iaddn=function(U){this.words[0]+=U;for(var X=0;X<this.length&&this.words[X]>=67108864;X++)if(this.words[X]-=67108864,X===this.length-1)this.words[X+1]=1;else this.words[X+1]++;return this.length=Math.max(this.length,X+1),this},A.prototype.isubn=function(U){if(C(typeof U==="number"),C(U<67108864),U<0)return this.iaddn(-U);if(this.negative!==0)return this.negative=0,this.iaddn(U),this.negative=1,this;if(this.words[0]-=U,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var X=0;X<this.length&&this.words[X]<0;X++)this.words[X]+=67108864,this.words[X+1]-=1;return this.strip()},A.prototype.addn=function(U){return this.clone().iaddn(U)},A.prototype.subn=function(U){return this.clone().isubn(U)},A.prototype.iabs=function(){return this.negative=0,this},A.prototype.abs=function(){return this.clone().iabs()},A.prototype._ishlnsubmul=function(U,X,J){var Z=U.length+J,Y;this._expand(Z);var I,K=0;for(Y=0;Y<U.length;Y++){I=(this.words[Y+J]|0)+K;var G=(U.words[Y]|0)*X;I-=G&67108863,K=(I>>26)-(G/67108864|0),this.words[Y+J]=I&67108863}for(;Y<this.length-J;Y++)I=(this.words[Y+J]|0)+K,K=I>>26,this.words[Y+J]=I&67108863;if(K===0)return this.strip();C(K===-1),K=0;for(Y=0;Y<this.length;Y++)I=-(this.words[Y]|0)+K,K=I>>26,this.words[Y]=I&67108863;return this.negative=1,this.strip()},A.prototype._wordDiv=function(U,X){var J=this.length-U.length,Z=this.clone(),Y=U,I=Y.words[Y.length-1]|0,K=this._countBits(I);if(J=26-K,J!==0)Y=Y.ushln(J),Z.iushln(J),I=Y.words[Y.length-1]|0;var G=Z.length-Y.length,O;if(X!=="mod"){O=new A(null),O.length=G+1,O.words=Array(O.length);for(var E=0;E<O.length;E++)O.words[E]=0}var T=Z.clone()._ishlnsubmul(Y,1,G);if(T.negative===0){if(Z=T,O)O.words[G]=1}for(var D=G-1;D>=0;D--){var v=(Z.words[Y.length+D]|0)*67108864+(Z.words[Y.length+D-1]|0);v=Math.min(v/I|0,67108863),Z._ishlnsubmul(Y,v,D);while(Z.negative!==0)if(v--,Z.negative=0,Z._ishlnsubmul(Y,1,D),!Z.isZero())Z.negative^=1;if(O)O.words[D]=v}if(O)O.strip();if(Z.strip(),X!=="div"&&J!==0)Z.iushrn(J);return{div:O||null,mod:Z}},A.prototype.divmod=function(U,X,J){if(C(!U.isZero()),this.isZero())return{div:new A(0),mod:new A(0)};var Z,Y,I;if(this.negative!==0&&U.negative===0){if(I=this.neg().divmod(U,X),X!=="mod")Z=I.div.neg();if(X!=="div"){if(Y=I.mod.neg(),J&&Y.negative!==0)Y.iadd(U)}return{div:Z,mod:Y}}if(this.negative===0&&U.negative!==0){if(I=this.divmod(U.neg(),X),X!=="mod")Z=I.div.neg();return{div:Z,mod:I.mod}}if((this.negative&U.negative)!==0){if(I=this.neg().divmod(U.neg(),X),X!=="div"){if(Y=I.mod.neg(),J&&Y.negative!==0)Y.isub(U)}return{div:I.div,mod:Y}}if(U.length>this.length||this.cmp(U)<0)return{div:new A(0),mod:this};if(U.length===1){if(X==="div")return{div:this.divn(U.words[0]),mod:null};if(X==="mod")return{div:null,mod:new A(this.modn(U.words[0]))};return{div:this.divn(U.words[0]),mod:new A(this.modn(U.words[0]))}}return this._wordDiv(U,X)},A.prototype.div=function(U){return this.divmod(U,"div",!1).div},A.prototype.mod=function(U){return this.divmod(U,"mod",!1).mod},A.prototype.umod=function(U){return this.divmod(U,"mod",!0).mod},A.prototype.divRound=function(U){var X=this.divmod(U);if(X.mod.isZero())return X.div;var J=X.div.negative!==0?X.mod.isub(U):X.mod,Z=U.ushrn(1),Y=U.andln(1),I=J.cmp(Z);if(I<0||Y===1&&I===0)return X.div;return X.div.negative!==0?X.div.isubn(1):X.div.iaddn(1)},A.prototype.modn=function(U){C(U<=67108863);var X=67108864%U,J=0;for(var Z=this.length-1;Z>=0;Z--)J=(X*J+(this.words[Z]|0))%U;return J},A.prototype.idivn=function(U){C(U<=67108863);var X=0;for(var J=this.length-1;J>=0;J--){var Z=(this.words[J]|0)+X*67108864;this.words[J]=Z/U|0,X=Z%U}return this.strip()},A.prototype.divn=function(U){return this.clone().idivn(U)},A.prototype.egcd=function(U){C(U.negative===0),C(!U.isZero());var X=this,J=U.clone();if(X.negative!==0)X=X.umod(U);else X=X.clone();var Z=new A(1),Y=new A(0),I=new A(0),K=new A(1),G=0;while(X.isEven()&&J.isEven())X.iushrn(1),J.iushrn(1),++G;var O=J.clone(),E=X.clone();while(!X.isZero()){for(var T=0,D=1;(X.words[0]&D)===0&&T<26;++T,D<<=1);if(T>0){X.iushrn(T);while(T-- >0){if(Z.isOdd()||Y.isOdd())Z.iadd(O),Y.isub(E);Z.iushrn(1),Y.iushrn(1)}}for(var v=0,g=1;(J.words[0]&g)===0&&v<26;++v,g<<=1);if(v>0){J.iushrn(v);while(v-- >0){if(I.isOdd()||K.isOdd())I.iadd(O),K.isub(E);I.iushrn(1),K.iushrn(1)}}if(X.cmp(J)>=0)X.isub(J),Z.isub(I),Y.isub(K);else J.isub(X),I.isub(Z),K.isub(Y)}return{a:I,b:K,gcd:J.iushln(G)}},A.prototype._invmp=function(U){C(U.negative===0),C(!U.isZero());var X=this,J=U.clone();if(X.negative!==0)X=X.umod(U);else X=X.clone();var Z=new A(1),Y=new A(0),I=J.clone();while(X.cmpn(1)>0&&J.cmpn(1)>0){for(var K=0,G=1;(X.words[0]&G)===0&&K<26;++K,G<<=1);if(K>0){X.iushrn(K);while(K-- >0){if(Z.isOdd())Z.iadd(I);Z.iushrn(1)}}for(var O=0,E=1;(J.words[0]&E)===0&&O<26;++O,E<<=1);if(O>0){J.iushrn(O);while(O-- >0){if(Y.isOdd())Y.iadd(I);Y.iushrn(1)}}if(X.cmp(J)>=0)X.isub(J),Z.isub(Y);else J.isub(X),Y.isub(Z)}var T;if(X.cmpn(1)===0)T=Z;else T=Y;if(T.cmpn(0)<0)T.iadd(U);return T},A.prototype.gcd=function(U){if(this.isZero())return U.abs();if(U.isZero())return this.abs();var X=this.clone(),J=U.clone();X.negative=0,J.negative=0;for(var Z=0;X.isEven()&&J.isEven();Z++)X.iushrn(1),J.iushrn(1);do{while(X.isEven())X.iushrn(1);while(J.isEven())J.iushrn(1);var Y=X.cmp(J);if(Y<0){var I=X;X=J,J=I}else if(Y===0||J.cmpn(1)===0)break;X.isub(J)}while(!0);return J.iushln(Z)},A.prototype.invm=function(U){return this.egcd(U).a.umod(U)},A.prototype.isEven=function(){return(this.words[0]&1)===0},A.prototype.isOdd=function(){return(this.words[0]&1)===1},A.prototype.andln=function(U){return this.words[0]&U},A.prototype.bincn=function(U){C(typeof U==="number");var X=U%26,J=(U-X)/26,Z=1<<X;if(this.length<=J)return this._expand(J+1),this.words[J]|=Z,this;var Y=Z;for(var I=J;Y!==0&&I<this.length;I++){var K=this.words[I]|0;K+=Y,Y=K>>>26,K&=67108863,this.words[I]=K}if(Y!==0)this.words[I]=Y,this.length++;return this},A.prototype.isZero=function(){return this.length===1&&this.words[0]===0},A.prototype.cmpn=function(U){var X=U<0;if(this.negative!==0&&!X)return-1;if(this.negative===0&&X)return 1;this.strip();var J;if(this.length>1)J=1;else{if(X)U=-U;C(U<=67108863,"Number is too big");var Z=this.words[0]|0;J=Z===U?0:Z<U?-1:1}if(this.negative!==0)return-J|0;return J},A.prototype.cmp=function(U){if(this.negative!==0&&U.negative===0)return-1;if(this.negative===0&&U.negative!==0)return 1;var X=this.ucmp(U);if(this.negative!==0)return-X|0;return X},A.prototype.ucmp=function(U){if(this.length>U.length)return 1;if(this.length<U.length)return-1;var X=0;for(var J=this.length-1;J>=0;J--){var Z=this.words[J]|0,Y=U.words[J]|0;if(Z===Y)continue;if(Z<Y)X=-1;else if(Z>Y)X=1;break}return X},A.prototype.gtn=function(U){return this.cmpn(U)===1},A.prototype.gt=function(U){return this.cmp(U)===1},A.prototype.gten=function(U){return this.cmpn(U)>=0},A.prototype.gte=function(U){return this.cmp(U)>=0},A.prototype.ltn=function(U){return this.cmpn(U)===-1},A.prototype.lt=function(U){return this.cmp(U)===-1},A.prototype.lten=function(U){return this.cmpn(U)<=0},A.prototype.lte=function(U){return this.cmp(U)<=0},A.prototype.eqn=function(U){return this.cmpn(U)===0},A.prototype.eq=function(U){return this.cmp(U)===0},A.red=function(U){return new u(U)},A.prototype.toRed=function(U){return C(!this.red,"Already a number in reduction context"),C(this.negative===0,"red works only with positives"),U.convertTo(this)._forceRed(U)},A.prototype.fromRed=function(){return C(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},A.prototype._forceRed=function(U){return this.red=U,this},A.prototype.forceRed=function(U){return C(!this.red,"Already a number in reduction context"),this._forceRed(U)},A.prototype.redAdd=function(U){return C(this.red,"redAdd works only with red numbers"),this.red.add(this,U)},A.prototype.redIAdd=function(U){return C(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,U)},A.prototype.redSub=function(U){return C(this.red,"redSub works only with red numbers"),this.red.sub(this,U)},A.prototype.redISub=function(U){return C(this.red,"redISub works only with red numbers"),this.red.isub(this,U)},A.prototype.redShl=function(U){return C(this.red,"redShl works only with red numbers"),this.red.shl(this,U)},A.prototype.redMul=function(U){return C(this.red,"redMul works only with red numbers"),this.red._verify2(this,U),this.red.mul(this,U)},A.prototype.redIMul=function(U){return C(this.red,"redMul works only with red numbers"),this.red._verify2(this,U),this.red.imul(this,U)},A.prototype.redSqr=function(){return C(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},A.prototype.redISqr=function(){return C(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},A.prototype.redSqrt=function(){return C(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},A.prototype.redInvm=function(){return C(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},A.prototype.redNeg=function(){return C(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},A.prototype.redPow=function(U){return C(this.red&&!U.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,U)};var f={k256:null,p224:null,p192:null,p25519:null};function w(U,X){this.name=U,this.p=new A(X,16),this.n=this.p.bitLength(),this.k=new A(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}w.prototype._tmp=function(){var U=new A(null);return U.words=Array(Math.ceil(this.n/13)),U},w.prototype.ireduce=function(U){var X=U,J;do this.split(X,this.tmp),X=this.imulK(X),X=X.iadd(this.tmp),J=X.bitLength();while(J>this.n);var Z=J<this.n?-1:X.ucmp(this.p);if(Z===0)X.words[0]=0,X.length=1;else if(Z>0)X.isub(this.p);else if(X.strip!==void 0)X.strip();else X._strip();return X},w.prototype.split=function(U,X){U.iushrn(this.n,0,X)},w.prototype.imulK=function(U){return U.imul(this.k)};function d(){w.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}F(d,w),d.prototype.split=function(U,X){var J=4194303,Z=Math.min(U.length,9);for(var Y=0;Y<Z;Y++)X.words[Y]=U.words[Y];if(X.length=Z,U.length<=9){U.words[0]=0,U.length=1;return}var I=U.words[9];X.words[X.length++]=I&J;for(Y=10;Y<U.length;Y++){var K=U.words[Y]|0;U.words[Y-10]=(K&J)<<4|I>>>22,I=K}if(I>>>=22,U.words[Y-10]=I,I===0&&U.length>10)U.length-=10;else U.length-=9},d.prototype.imulK=function(U){U.words[U.length]=0,U.words[U.length+1]=0,U.length+=2;var X=0;for(var J=0;J<U.length;J++){var Z=U.words[J]|0;X+=Z*977,U.words[J]=X&67108863,X=Z*64+(X/67108864|0)}if(U.words[U.length-1]===0){if(U.length--,U.words[U.length-1]===0)U.length--}return U};function Y0(){w.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}F(Y0,w);function J0(){w.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}F(J0,w);function A0(){w.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}F(A0,w),A0.prototype.imulK=function(U){var X=0;for(var J=0;J<U.length;J++){var Z=(U.words[J]|0)*19+X,Y=Z&67108863;Z>>>=26,U.words[J]=Y,X=Z}if(X!==0)U.words[U.length++]=X;return U},A._prime=function(U){if(f[U])return f[U];var X;if(U==="k256")X=new d;else if(U==="p224")X=new Y0;else if(U==="p192")X=new J0;else if(U==="p25519")X=new A0;else throw Error("Unknown prime "+U);return f[U]=X,X};function u(U){if(typeof U==="string"){var X=A._prime(U);this.m=X.p,this.prime=X}else C(U.gtn(1),"modulus must be greater than 1"),this.m=U,this.prime=null}u.prototype._verify1=function(U){C(U.negative===0,"red works only with positives"),C(U.red,"red works only with red numbers")},u.prototype._verify2=function(U,X){C((U.negative|X.negative)===0,"red works only with positives"),C(U.red&&U.red===X.red,"red works only with red numbers")},u.prototype.imod=function(U){if(this.prime)return this.prime.ireduce(U)._forceRed(this);return U.umod(this.m)._forceRed(this)},u.prototype.neg=function(U){if(U.isZero())return U.clone();return this.m.sub(U)._forceRed(this)},u.prototype.add=function(U,X){this._verify2(U,X);var J=U.add(X);if(J.cmp(this.m)>=0)J.isub(this.m);return J._forceRed(this)},u.prototype.iadd=function(U,X){this._verify2(U,X);var J=U.iadd(X);if(J.cmp(this.m)>=0)J.isub(this.m);return J},u.prototype.sub=function(U,X){this._verify2(U,X);var J=U.sub(X);if(J.cmpn(0)<0)J.iadd(this.m);return J._forceRed(this)},u.prototype.isub=function(U,X){this._verify2(U,X);var J=U.isub(X);if(J.cmpn(0)<0)J.iadd(this.m);return J},u.prototype.shl=function(U,X){return this._verify1(U),this.imod(U.ushln(X))},u.prototype.imul=function(U,X){return this._verify2(U,X),this.imod(U.imul(X))},u.prototype.mul=function(U,X){return this._verify2(U,X),this.imod(U.mul(X))},u.prototype.isqr=function(U){return this.imul(U,U.clone())},u.prototype.sqr=function(U){return this.mul(U,U)},u.prototype.sqrt=function(U){if(U.isZero())return U.clone();var X=this.m.andln(3);if(C(X%2===1),X===3){var J=this.m.add(new A(1)).iushrn(2);return this.pow(U,J)}var Z=this.m.subn(1),Y=0;while(!Z.isZero()&&Z.andln(1)===0)Y++,Z.iushrn(1);C(!Z.isZero());var I=new A(1).toRed(this),K=I.redNeg(),G=this.m.subn(1).iushrn(1),O=this.m.bitLength();O=new A(2*O*O).toRed(this);while(this.pow(O,G).cmp(K)!==0)O.redIAdd(K);var E=this.pow(O,Z),T=this.pow(U,Z.addn(1).iushrn(1)),D=this.pow(U,Z),v=Y;while(D.cmp(I)!==0){var g=D;for(var p=0;g.cmp(I)!==0;p++)g=g.redSqr();C(p<v);var n=this.pow(E,new A(1).iushln(v-p-1));T=T.redMul(n),E=n.redSqr(),D=D.redMul(E),v=p}return T},u.prototype.invm=function(U){var X=U._invmp(this.m);if(X.negative!==0)return X.negative=0,this.imod(X).redNeg();else return this.imod(X)},u.prototype.pow=function(U,X){if(X.isZero())return new A(1).toRed(this);if(X.cmpn(1)===0)return U.clone();var J=4,Z=Array(1<<J);Z[0]=new A(1).toRed(this),Z[1]=U;for(var Y=2;Y<Z.length;Y++)Z[Y]=this.mul(Z[Y-1],U);var I=Z[0],K=0,G=0,O=X.bitLength()%26;if(O===0)O=26;for(Y=X.length-1;Y>=0;Y--){var E=X.words[Y];for(var T=O-1;T>=0;T--){var D=E>>T&1;if(I!==Z[0])I=this.sqr(I);if(D===0&&K===0){G=0;continue}if(K<<=1,K|=D,G++,G!==J&&(Y!==0||T!==0))continue;I=this.mul(I,Z[K]),G=0,K=0}O=26}return I},u.prototype.convertTo=function(U){var X=U.umod(this.m);return X===U?X.clone():X},u.prototype.convertFrom=function(U){var X=U.clone();return X.red=null,X},A.mont=function(U){return new O0(U)};function O0(U){if(u.call(this,U),this.shift=this.m.bitLength(),this.shift%26!==0)this.shift+=26-this.shift%26;this.r=new A(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}F(O0,u),O0.prototype.convertTo=function(U){return this.imod(U.ushln(this.shift))},O0.prototype.convertFrom=function(U){var X=this.imod(U.mul(this.rinv));return X.red=null,X},O0.prototype.imul=function(U,X){if(U.isZero()||X.isZero())return U.words[0]=0,U.length=1,U;var J=U.imul(X),Z=J.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Y=J.isub(Z).iushrn(this.shift),I=Y;if(Y.cmp(this.m)>=0)I=Y.isub(this.m);else if(Y.cmpn(0)<0)I=Y.iadd(this.m);return I._forceRed(this)},O0.prototype.mul=function(U,X){if(U.isZero()||X.isZero())return new A(0)._forceRed(this);var J=U.mul(X),Z=J.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Y=J.isub(Z).iushrn(this.shift),I=Y;if(Y.cmp(this.m)>=0)I=Y.isub(this.m);else if(Y.cmpn(0)<0)I=Y.iadd(this.m);return I._forceRed(this)},O0.prototype.invm=function(U){var X=this.imod(U._invmp(this.m).mul(this.r2));return X._forceRed(this)}})(typeof $>"u"||$,Q)}),OO=$0((Q,$)=>{$.exports=V;function V(W,C){if(!W)throw Error(C||"Assertion failed")}V.equal=function(W,C,F){if(W!=C)throw Error(F||"Assertion failed: "+W+" != "+C)}}),$Y=$0((Q)=>{var $=Q;function V(F,A){if(Array.isArray(F))return F.slice();if(!F)return[];var z=[];if(typeof F!=="string"){for(var M=0;M<F.length;M++)z[M]=F[M]|0;return z}if(A==="hex"){if(F=F.replace(/[^a-z0-9]+/ig,""),F.length%2!==0)F="0"+F;for(var M=0;M<F.length;M+=2)z.push(parseInt(F[M]+F[M+1],16))}else for(var M=0;M<F.length;M++){var S=F.charCodeAt(M),R=S>>8,L=S&255;if(R)z.push(R,L);else z.push(L)}return z}$.toArray=V;function W(F){if(F.length===1)return"0"+F;else return F}$.zero2=W;function C(F){var A="";for(var z=0;z<F.length;z++)A+=W(F[z].toString(16));return A}$.toHex=C,$.encode=function(F,A){if(A==="hex")return C(F);else return F}}),wU=$0((Q)=>{var $=Q,V=sU(),W=OO(),C=$Y();$.assert=W,$.toArray=C.toArray,$.zero2=C.zero2,$.toHex=C.toHex,$.encode=C.encode;function F(R,L,H){var q=Array(Math.max(R.bitLength(),H)+1),P;for(P=0;P<q.length;P+=1)q[P]=0;var _=1<<L+1,k=R.clone();for(P=0;P<q.length;P++){var B,j=k.andln(_-1);if(k.isOdd()){if(j>(_>>1)-1)B=(_>>1)-j;else B=j;k.isubn(B)}else B=0;q[P]=B,k.iushrn(1)}return q}$.getNAF=F;function A(R,L){var H=[[],[]];R=R.clone(),L=L.clone();var q=0,P=0,_;while(R.cmpn(-q)>0||L.cmpn(-P)>0){var k=R.andln(3)+q&3,B=L.andln(3)+P&3;if(k===3)k=-1;if(B===3)B=-1;var j;if((k&1)===0)j=0;else if(_=R.andln(7)+q&7,(_===3||_===5)&&B===2)j=-k;else j=k;H[0].push(j);var x;if((B&1)===0)x=0;else if(_=L.andln(7)+P&7,(_===3||_===5)&&k===2)x=-B;else x=B;if(H[1].push(x),2*q===j+1)q=1-q;if(2*P===x+1)P=1-P;R.iushrn(1),L.iushrn(1)}return H}$.getJSF=A;function z(R,L,H){var q="_"+L;R.prototype[L]=function(){return this[q]!==void 0?this[q]:this[q]=H.call(this)}}$.cachedProperty=z;function M(R){return typeof R==="string"?$.toArray(R,"hex"):R}$.parseBytes=M;function S(R){return new V(R,"hex","le")}$.intFromLE=S}),JY=$0((Q,$)=>{var V;$.exports=function(F){if(!V)V=new W(null);return V.generate(F)};function W(F){this.rand=F}if($.exports.Rand=W,W.prototype.generate=function(F){return this._rand(F)},W.prototype._rand=function(F){if(this.rand.getBytes)return this.rand.getBytes(F);var A=new Uint8Array(F);for(var z=0;z<A.length;z++)A[z]=this.rand.getByte();return A},typeof self==="object"){if(self.crypto&&self.crypto.getRandomValues)W.prototype._rand=function(F){var A=new Uint8Array(F);return self.crypto.getRandomValues(A),A};else if(self.msCrypto&&self.msCrypto.getRandomValues)W.prototype._rand=function(F){var A=new Uint8Array(F);return self.msCrypto.getRandomValues(A),A};else if(typeof window==="object")W.prototype._rand=function(){throw Error("Not implemented yet")}}else try{if(C=(jU(),h0(vU)),typeof C.randomBytes!=="function")throw Error("Not supported");W.prototype._rand=function(F){return C.randomBytes(F)}}catch(F){}var C}),XZ=$0((Q,$)=>{var V=sU(),W=wU(),C=W.getNAF,F=W.getJSF,A=W.assert;function z(S,R){this.type=S,this.p=new V(R.p,16),this.red=R.prime?V.red(R.prime):V.mont(this.p),this.zero=new V(0).toRed(this.red),this.one=new V(1).toRed(this.red),this.two=new V(2).toRed(this.red),this.n=R.n&&new V(R.n,16),this.g=R.g&&this.pointFromJSON(R.g,R.gRed),this._wnafT1=[,,,,],this._wnafT2=[,,,,],this._wnafT3=[,,,,],this._wnafT4=[,,,,],this._bitLength=this.n?this.n.bitLength():0;var L=this.n&&this.p.div(this.n);if(!L||L.cmpn(100)>0)this.redN=null;else this._maxwellTrick=!0,this.redN=this.n.toRed(this.red)}$.exports=z,z.prototype.point=function(){throw Error("Not implemented")},z.prototype.validate=function(){throw Error("Not implemented")},z.prototype._fixedNafMul=function(S,R){A(S.precomputed);var L=S._getDoubles(),H=C(R,1,this._bitLength),q=(1<<L.step+1)-(L.step%2===0?2:1);q/=3;var P=[],_,k;for(_=0;_<H.length;_+=L.step){k=0;for(var B=_+L.step-1;B>=_;B--)k=(k<<1)+H[B];P.push(k)}var j=this.jpoint(null,null,null),x=this.jpoint(null,null,null);for(var f=q;f>0;f--){for(_=0;_<P.length;_++)if(k=P[_],k===f)x=x.mixedAdd(L.points[_]);else if(k===-f)x=x.mixedAdd(L.points[_].neg());j=j.add(x)}return j.toP()},z.prototype._wnafMul=function(S,R){var L=4,H=S._getNAFPoints(L);L=H.wnd;var q=H.points,P=C(R,L,this._bitLength),_=this.jpoint(null,null,null);for(var k=P.length-1;k>=0;k--){for(var B=0;k>=0&&P[k]===0;k--)B++;if(k>=0)B++;if(_=_.dblp(B),k<0)break;var j=P[k];if(A(j!==0),S.type==="affine")if(j>0)_=_.mixedAdd(q[j-1>>1]);else _=_.mixedAdd(q[-j-1>>1].neg());else if(j>0)_=_.add(q[j-1>>1]);else _=_.add(q[-j-1>>1].neg())}return S.type==="affine"?_.toP():_},z.prototype._wnafMulAdd=function(S,R,L,H,q){var P=this._wnafT1,_=this._wnafT2,k=this._wnafT3,B=0,j,x,f;for(j=0;j<H;j++){f=R[j];var w=f._getNAFPoints(S);P[j]=w.wnd,_[j]=w.points}for(j=H-1;j>=1;j-=2){var d=j-1,Y0=j;if(P[d]!==1||P[Y0]!==1){k[d]=C(L[d],P[d],this._bitLength),k[Y0]=C(L[Y0],P[Y0],this._bitLength),B=Math.max(k[d].length,B),B=Math.max(k[Y0].length,B);continue}var J0=[R[d],null,null,R[Y0]];if(R[d].y.cmp(R[Y0].y)===0)J0[1]=R[d].add(R[Y0]),J0[2]=R[d].toJ().mixedAdd(R[Y0].neg());else if(R[d].y.cmp(R[Y0].y.redNeg())===0)J0[1]=R[d].toJ().mixedAdd(R[Y0]),J0[2]=R[d].add(R[Y0].neg());else J0[1]=R[d].toJ().mixedAdd(R[Y0]),J0[2]=R[d].toJ().mixedAdd(R[Y0].neg());var A0=[-3,-1,-5,-7,0,7,5,1,3],u=F(L[d],L[Y0]);B=Math.max(u[0].length,B),k[d]=Array(B),k[Y0]=Array(B);for(x=0;x<B;x++){var O0=u[0][x]|0,U=u[1][x]|0;k[d][x]=A0[(O0+1)*3+(U+1)],k[Y0][x]=0,_[d]=J0}}var X=this.jpoint(null,null,null),J=this._wnafT4;for(j=B;j>=0;j--){var Z=0;while(j>=0){var Y=!0;for(x=0;x<H;x++)if(J[x]=k[x][j]|0,J[x]!==0)Y=!1;if(!Y)break;Z++,j--}if(j>=0)Z++;if(X=X.dblp(Z),j<0)break;for(x=0;x<H;x++){var I=J[x];if(I===0)continue;else if(I>0)f=_[x][I-1>>1];else if(I<0)f=_[x][-I-1>>1].neg();if(f.type==="affine")X=X.mixedAdd(f);else X=X.add(f)}}for(j=0;j<H;j++)_[j]=null;if(q)return X;else return X.toP()};function M(S,R){this.curve=S,this.type=R,this.precomputed=null}z.BasePoint=M,M.prototype.eq=function(){throw Error("Not implemented")},M.prototype.validate=function(){return this.curve.validate(this)},z.prototype.decodePoint=function(S,R){S=W.toArray(S,R);var L=this.p.byteLength();if((S[0]===4||S[0]===6||S[0]===7)&&S.length-1===2*L){if(S[0]===6)A(S[S.length-1]%2===0);else if(S[0]===7)A(S[S.length-1]%2===1);var H=this.point(S.slice(1,1+L),S.slice(1+L,1+2*L));return H}else if((S[0]===2||S[0]===3)&&S.length-1===L)return this.pointFromX(S.slice(1,1+L),S[0]===3);throw Error("Unknown point format")},M.prototype.encodeCompressed=function(S){return this.encode(S,!0)},M.prototype._encode=function(S){var R=this.curve.p.byteLength(),L=this.getX().toArray("be",R);if(S)return[this.getY().isEven()?2:3].concat(L);return[4].concat(L,this.getY().toArray("be",R))},M.prototype.encode=function(S,R){return W.encode(this._encode(R),S)},M.prototype.precompute=function(S){if(this.precomputed)return this;var R={doubles:null,naf:null,beta:null};return R.naf=this._getNAFPoints(8),R.doubles=this._getDoubles(4,S),R.beta=this._getBeta(),this.precomputed=R,this},M.prototype._hasDoubles=function(S){if(!this.precomputed)return!1;var R=this.precomputed.doubles;if(!R)return!1;return R.points.length>=Math.ceil((S.bitLength()+1)/R.step)},M.prototype._getDoubles=function(S,R){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;var L=[this],H=this;for(var q=0;q<R;q+=S){for(var P=0;P<S;P++)H=H.dbl();L.push(H)}return{step:S,points:L}},M.prototype._getNAFPoints=function(S){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;var R=[this],L=(1<<S)-1,H=L===1?null:this.dbl();for(var q=1;q<L;q++)R[q]=R[q-1].add(H);return{wnd:S,points:R}},M.prototype._getBeta=function(){return null},M.prototype.dblp=function(S){var R=this;for(var L=0;L<S;L++)R=R.dbl();return R}}),BJ=$0((Q,$)=>{if(typeof Object.create==="function")$.exports=function(V,W){if(W)V.super_=W,V.prototype=Object.create(W.prototype,{constructor:{value:V,enumerable:!1,writable:!0,configurable:!0}})};else $.exports=function(V,W){if(W){V.super_=W;var C=function(){};C.prototype=W.prototype,V.prototype=new C,V.prototype.constructor=V}}}),xU=$0((Q,$)=>{try{if(V=(nQ(),h0(oQ)),typeof V.inherits!=="function")throw"";$.exports=V.inherits}catch(W){$.exports=BJ()}var V}),xJ=$0((Q,$)=>{var V=wU(),W=sU(),C=xU(),F=XZ(),A=V.assert;function z(R){F.call(this,"short",R),this.a=new W(R.a,16).toRed(this.red),this.b=new W(R.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(R),this._endoWnafT1=[,,,,],this._endoWnafT2=[,,,,]}C(z,F),$.exports=z,z.prototype._getEndomorphism=function(R){if(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)return;var L,H;if(R.beta)L=new W(R.beta,16).toRed(this.red);else{var q=this._getEndoRoots(this.p);L=q[0].cmp(q[1])<0?q[0]:q[1],L=L.toRed(this.red)}if(R.lambda)H=new W(R.lambda,16);else{var P=this._getEndoRoots(this.n);if(this.g.mul(P[0]).x.cmp(this.g.x.redMul(L))===0)H=P[0];else H=P[1],A(this.g.mul(H).x.cmp(this.g.x.redMul(L))===0)}var _;if(R.basis)_=R.basis.map(function(k){return{a:new W(k.a,16),b:new W(k.b,16)}});else _=this._getEndoBasis(H);return{beta:L,lambda:H,basis:_}},z.prototype._getEndoRoots=function(R){var L=R===this.p?this.red:W.mont(R),H=new W(2).toRed(L).redInvm(),q=H.redNeg(),P=new W(3).toRed(L).redNeg().redSqrt().redMul(H),_=q.redAdd(P).fromRed(),k=q.redSub(P).fromRed();return[_,k]},z.prototype._getEndoBasis=function(R){var L=this.n.ushrn(Math.floor(this.n.bitLength()/2)),H=R,q=this.n.clone(),P=new W(1),_=new W(0),k=new W(0),B=new W(1),j,x,f,w,d,Y0,J0,A0=0,u,O0;while(H.cmpn(0)!==0){var U=q.div(H);u=q.sub(U.mul(H)),O0=k.sub(U.mul(P));var X=B.sub(U.mul(_));if(!f&&u.cmp(L)<0)j=J0.neg(),x=P,f=u.neg(),w=O0;else if(f&&++A0===2)break;J0=u,q=H,H=u,k=P,P=O0,B=_,_=X}d=u.neg(),Y0=O0;var J=f.sqr().add(w.sqr()),Z=d.sqr().add(Y0.sqr());if(Z.cmp(J)>=0)d=j,Y0=x;if(f.negative)f=f.neg(),w=w.neg();if(d.negative)d=d.neg(),Y0=Y0.neg();return[{a:f,b:w},{a:d,b:Y0}]},z.prototype._endoSplit=function(R){var L=this.endo.basis,H=L[0],q=L[1],P=q.b.mul(R).divRound(this.n),_=H.b.neg().mul(R).divRound(this.n),k=P.mul(H.a),B=_.mul(q.a),j=P.mul(H.b),x=_.mul(q.b),f=R.sub(k).sub(B),w=j.add(x).neg();return{k1:f,k2:w}},z.prototype.pointFromX=function(R,L){if(R=new W(R,16),!R.red)R=R.toRed(this.red);var H=R.redSqr().redMul(R).redIAdd(R.redMul(this.a)).redIAdd(this.b),q=H.redSqrt();if(q.redSqr().redSub(H).cmp(this.zero)!==0)throw Error("invalid point");var P=q.fromRed().isOdd();if(L&&!P||!L&&P)q=q.redNeg();return this.point(R,q)},z.prototype.validate=function(R){if(R.inf)return!0;var{x:L,y:H}=R,q=this.a.redMul(L),P=L.redSqr().redMul(L).redIAdd(q).redIAdd(this.b);return H.redSqr().redISub(P).cmpn(0)===0},z.prototype._endoWnafMulAdd=function(R,L,H){var q=this._endoWnafT1,P=this._endoWnafT2;for(var _=0;_<R.length;_++){var k=this._endoSplit(L[_]),B=R[_],j=B._getBeta();if(k.k1.negative)k.k1.ineg(),B=B.neg(!0);if(k.k2.negative)k.k2.ineg(),j=j.neg(!0);q[_*2]=B,q[_*2+1]=j,P[_*2]=k.k1,P[_*2+1]=k.k2}var x=this._wnafMulAdd(1,q,P,_*2,H);for(var f=0;f<_*2;f++)q[f]=null,P[f]=null;return x};function M(R,L,H,q){if(F.BasePoint.call(this,R,"affine"),L===null&&H===null)this.x=null,this.y=null,this.inf=!0;else{if(this.x=new W(L,16),this.y=new W(H,16),q)this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red);if(!this.x.red)this.x=this.x.toRed(this.curve.red);if(!this.y.red)this.y=this.y.toRed(this.curve.red);this.inf=!1}}C(M,F.BasePoint),z.prototype.point=function(R,L,H){return new M(this,R,L,H)},z.prototype.pointFromJSON=function(R,L){return M.fromJSON(this,R,L)},M.prototype._getBeta=function(){if(!this.curve.endo)return;var R=this.precomputed;if(R&&R.beta)return R.beta;var L=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(R){var H=this.curve,q=function(P){return H.point(P.x.redMul(H.endo.beta),P.y)};R.beta=L,L.precomputed={beta:null,naf:R.naf&&{wnd:R.naf.wnd,points:R.naf.points.map(q)},doubles:R.doubles&&{step:R.doubles.step,points:R.doubles.points.map(q)}}}return L},M.prototype.toJSON=function(){if(!this.precomputed)return[this.x,this.y];return[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)}}]},M.fromJSON=function(R,L,H){if(typeof L==="string")L=JSON.parse(L);var q=R.point(L[0],L[1],H);if(!L[2])return q;function P(k){return R.point(k[0],k[1],H)}var _=L[2];return q.precomputed={beta:null,doubles:_.doubles&&{step:_.doubles.step,points:[q].concat(_.doubles.points.map(P))},naf:_.naf&&{wnd:_.naf.wnd,points:[q].concat(_.naf.points.map(P))}},q},M.prototype.inspect=function(){if(this.isInfinity())return"<EC Point Infinity>";return"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},M.prototype.isInfinity=function(){return this.inf},M.prototype.add=function(R){if(this.inf)return R;if(R.inf)return this;if(this.eq(R))return this.dbl();if(this.neg().eq(R))return this.curve.point(null,null);if(this.x.cmp(R.x)===0)return this.curve.point(null,null);var L=this.y.redSub(R.y);if(L.cmpn(0)!==0)L=L.redMul(this.x.redSub(R.x).redInvm());var H=L.redSqr().redISub(this.x).redISub(R.x),q=L.redMul(this.x.redSub(H)).redISub(this.y);return this.curve.point(H,q)},M.prototype.dbl=function(){if(this.inf)return this;var R=this.y.redAdd(this.y);if(R.cmpn(0)===0)return this.curve.point(null,null);var L=this.curve.a,H=this.x.redSqr(),q=R.redInvm(),P=H.redAdd(H).redIAdd(H).redIAdd(L).redMul(q),_=P.redSqr().redISub(this.x.redAdd(this.x)),k=P.redMul(this.x.redSub(_)).redISub(this.y);return this.curve.point(_,k)},M.prototype.getX=function(){return this.x.fromRed()},M.prototype.getY=function(){return this.y.fromRed()},M.prototype.mul=function(R){if(R=new W(R,16),this.isInfinity())return this;else if(this._hasDoubles(R))return this.curve._fixedNafMul(this,R);else if(this.curve.endo)return this.curve._endoWnafMulAdd([this],[R]);else return this.curve._wnafMul(this,R)},M.prototype.mulAdd=function(R,L,H){var q=[this,L],P=[R,H];if(this.curve.endo)return this.curve._endoWnafMulAdd(q,P);else return this.curve._wnafMulAdd(1,q,P,2)},M.prototype.jmulAdd=function(R,L,H){var q=[this,L],P=[R,H];if(this.curve.endo)return this.curve._endoWnafMulAdd(q,P,!0);else return this.curve._wnafMulAdd(1,q,P,2,!0)},M.prototype.eq=function(R){return this===R||this.inf===R.inf&&(this.inf||this.x.cmp(R.x)===0&&this.y.cmp(R.y)===0)},M.prototype.neg=function(R){if(this.inf)return this;var L=this.curve.point(this.x,this.y.redNeg());if(R&&this.precomputed){var H=this.precomputed,q=function(P){return P.neg()};L.precomputed={naf:H.naf&&{wnd:H.naf.wnd,points:H.naf.points.map(q)},doubles:H.doubles&&{step:H.doubles.step,points:H.doubles.points.map(q)}}}return L},M.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var R=this.curve.jpoint(this.x,this.y,this.curve.one);return R};function S(R,L,H,q){if(F.BasePoint.call(this,R,"jacobian"),L===null&&H===null&&q===null)this.x=this.curve.one,this.y=this.curve.one,this.z=new W(0);else this.x=new W(L,16),this.y=new W(H,16),this.z=new W(q,16);if(!this.x.red)this.x=this.x.toRed(this.curve.red);if(!this.y.red)this.y=this.y.toRed(this.curve.red);if(!this.z.red)this.z=this.z.toRed(this.curve.red);this.zOne=this.z===this.curve.one}C(S,F.BasePoint),z.prototype.jpoint=function(R,L,H){return new S(this,R,L,H)},S.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var R=this.z.redInvm(),L=R.redSqr(),H=this.x.redMul(L),q=this.y.redMul(L).redMul(R);return this.curve.point(H,q)},S.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},S.prototype.add=function(R){if(this.isInfinity())return R;if(R.isInfinity())return this;var L=R.z.redSqr(),H=this.z.redSqr(),q=this.x.redMul(L),P=R.x.redMul(H),_=this.y.redMul(L.redMul(R.z)),k=R.y.redMul(H.redMul(this.z)),B=q.redSub(P),j=_.redSub(k);if(B.cmpn(0)===0)if(j.cmpn(0)!==0)return this.curve.jpoint(null,null,null);else return this.dbl();var x=B.redSqr(),f=x.redMul(B),w=q.redMul(x),d=j.redSqr().redIAdd(f).redISub(w).redISub(w),Y0=j.redMul(w.redISub(d)).redISub(_.redMul(f)),J0=this.z.redMul(R.z).redMul(B);return this.curve.jpoint(d,Y0,J0)},S.prototype.mixedAdd=function(R){if(this.isInfinity())return R.toJ();if(R.isInfinity())return this;var L=this.z.redSqr(),H=this.x,q=R.x.redMul(L),P=this.y,_=R.y.redMul(L).redMul(this.z),k=H.redSub(q),B=P.redSub(_);if(k.cmpn(0)===0)if(B.cmpn(0)!==0)return this.curve.jpoint(null,null,null);else return this.dbl();var j=k.redSqr(),x=j.redMul(k),f=H.redMul(j),w=B.redSqr().redIAdd(x).redISub(f).redISub(f),d=B.redMul(f.redISub(w)).redISub(P.redMul(x)),Y0=this.z.redMul(k);return this.curve.jpoint(w,d,Y0)},S.prototype.dblp=function(R){if(R===0)return this;if(this.isInfinity())return this;if(!R)return this.dbl();var L;if(this.curve.zeroA||this.curve.threeA){var H=this;for(L=0;L<R;L++)H=H.dbl();return H}var q=this.curve.a,P=this.curve.tinv,_=this.x,k=this.y,B=this.z,j=B.redSqr().redSqr(),x=k.redAdd(k);for(L=0;L<R;L++){var f=_.redSqr(),w=x.redSqr(),d=w.redSqr(),Y0=f.redAdd(f).redIAdd(f).redIAdd(q.redMul(j)),J0=_.redMul(w),A0=Y0.redSqr().redISub(J0.redAdd(J0)),u=J0.redISub(A0),O0=Y0.redMul(u);O0=O0.redIAdd(O0).redISub(d);var U=x.redMul(B);if(L+1<R)j=j.redMul(d);_=A0,B=U,x=O0}return this.curve.jpoint(_,x.redMul(P),B)},S.prototype.dbl=function(){if(this.isInfinity())return this;if(this.curve.zeroA)return this._zeroDbl();else if(this.curve.threeA)return this._threeDbl();else return this._dbl()},S.prototype._zeroDbl=function(){var R,L,H;if(this.zOne){var q=this.x.redSqr(),P=this.y.redSqr(),_=P.redSqr(),k=this.x.redAdd(P).redSqr().redISub(q).redISub(_);k=k.redIAdd(k);var B=q.redAdd(q).redIAdd(q),j=B.redSqr().redISub(k).redISub(k),x=_.redIAdd(_);x=x.redIAdd(x),x=x.redIAdd(x),R=j,L=B.redMul(k.redISub(j)).redISub(x),H=this.y.redAdd(this.y)}else{var f=this.x.redSqr(),w=this.y.redSqr(),d=w.redSqr(),Y0=this.x.redAdd(w).redSqr().redISub(f).redISub(d);Y0=Y0.redIAdd(Y0);var J0=f.redAdd(f).redIAdd(f),A0=J0.redSqr(),u=d.redIAdd(d);u=u.redIAdd(u),u=u.redIAdd(u),R=A0.redISub(Y0).redISub(Y0),L=J0.redMul(Y0.redISub(R)).redISub(u),H=this.y.redMul(this.z),H=H.redIAdd(H)}return this.curve.jpoint(R,L,H)},S.prototype._threeDbl=function(){var R,L,H;if(this.zOne){var q=this.x.redSqr(),P=this.y.redSqr(),_=P.redSqr(),k=this.x.redAdd(P).redSqr().redISub(q).redISub(_);k=k.redIAdd(k);var B=q.redAdd(q).redIAdd(q).redIAdd(this.curve.a),j=B.redSqr().redISub(k).redISub(k);R=j;var x=_.redIAdd(_);x=x.redIAdd(x),x=x.redIAdd(x),L=B.redMul(k.redISub(j)).redISub(x),H=this.y.redAdd(this.y)}else{var f=this.z.redSqr(),w=this.y.redSqr(),d=this.x.redMul(w),Y0=this.x.redSub(f).redMul(this.x.redAdd(f));Y0=Y0.redAdd(Y0).redIAdd(Y0);var J0=d.redIAdd(d);J0=J0.redIAdd(J0);var A0=J0.redAdd(J0);R=Y0.redSqr().redISub(A0),H=this.y.redAdd(this.z).redSqr().redISub(w).redISub(f);var u=w.redSqr();u=u.redIAdd(u),u=u.redIAdd(u),u=u.redIAdd(u),L=Y0.redMul(J0.redISub(R)).redISub(u)}return this.curve.jpoint(R,L,H)},S.prototype._dbl=function(){var R=this.curve.a,L=this.x,H=this.y,q=this.z,P=q.redSqr().redSqr(),_=L.redSqr(),k=H.redSqr(),B=_.redAdd(_).redIAdd(_).redIAdd(R.redMul(P)),j=L.redAdd(L);j=j.redIAdd(j);var x=j.redMul(k),f=B.redSqr().redISub(x.redAdd(x)),w=x.redISub(f),d=k.redSqr();d=d.redIAdd(d),d=d.redIAdd(d),d=d.redIAdd(d);var Y0=B.redMul(w).redISub(d),J0=H.redAdd(H).redMul(q);return this.curve.jpoint(f,Y0,J0)},S.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var R=this.x.redSqr(),L=this.y.redSqr(),H=this.z.redSqr(),q=L.redSqr(),P=R.redAdd(R).redIAdd(R),_=P.redSqr(),k=this.x.redAdd(L).redSqr().redISub(R).redISub(q);k=k.redIAdd(k),k=k.redAdd(k).redIAdd(k),k=k.redISub(_);var B=k.redSqr(),j=q.redIAdd(q);j=j.redIAdd(j),j=j.redIAdd(j),j=j.redIAdd(j);var x=P.redIAdd(k).redSqr().redISub(_).redISub(B).redISub(j),f=L.redMul(x);f=f.redIAdd(f),f=f.redIAdd(f);var w=this.x.redMul(B).redISub(f);w=w.redIAdd(w),w=w.redIAdd(w);var d=this.y.redMul(x.redMul(j.redISub(x)).redISub(k.redMul(B)));d=d.redIAdd(d),d=d.redIAdd(d),d=d.redIAdd(d);var Y0=this.z.redAdd(k).redSqr().redISub(H).redISub(B);return this.curve.jpoint(w,d,Y0)},S.prototype.mul=function(R,L){return R=new W(R,L),this.curve._wnafMul(this,R)},S.prototype.eq=function(R){if(R.type==="affine")return this.eq(R.toJ());if(this===R)return!0;var L=this.z.redSqr(),H=R.z.redSqr();if(this.x.redMul(H).redISub(R.x.redMul(L)).cmpn(0)!==0)return!1;var q=L.redMul(this.z),P=H.redMul(R.z);return this.y.redMul(P).redISub(R.y.redMul(q)).cmpn(0)===0},S.prototype.eqXToP=function(R){var L=this.z.redSqr(),H=R.toRed(this.curve.red).redMul(L);if(this.x.cmp(H)===0)return!0;var q=R.clone(),P=this.curve.redN.redMul(L);for(;;){if(q.iadd(this.curve.n),q.cmp(this.curve.p)>=0)return!1;if(H.redIAdd(P),this.x.cmp(H)===0)return!0}},S.prototype.inspect=function(){if(this.isInfinity())return"<EC JPoint Infinity>";return"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},S.prototype.isInfinity=function(){return this.z.cmpn(0)===0}}),NJ=$0((Q,$)=>{var V=sU(),W=xU(),C=XZ(),F=wU();function A(M){C.call(this,"mont",M),this.a=new V(M.a,16).toRed(this.red),this.b=new V(M.b,16).toRed(this.red),this.i4=new V(4).toRed(this.red).redInvm(),this.two=new V(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}W(A,C),$.exports=A,A.prototype.validate=function(M){var S=M.normalize().x,R=S.redSqr(),L=R.redMul(S).redAdd(R.redMul(this.a)).redAdd(S),H=L.redSqrt();return H.redSqr().cmp(L)===0};function z(M,S,R){if(C.BasePoint.call(this,M,"projective"),S===null&&R===null)this.x=this.curve.one,this.z=this.curve.zero;else{if(this.x=new V(S,16),this.z=new V(R,16),!this.x.red)this.x=this.x.toRed(this.curve.red);if(!this.z.red)this.z=this.z.toRed(this.curve.red)}}W(z,C.BasePoint),A.prototype.decodePoint=function(M,S){return this.point(F.toArray(M,S),1)},A.prototype.point=function(M,S){return new z(this,M,S)},A.prototype.pointFromJSON=function(M){return z.fromJSON(this,M)},z.prototype.precompute=function(){},z.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},z.fromJSON=function(M,S){return new z(M,S[0],S[1]||M.one)},z.prototype.inspect=function(){if(this.isInfinity())return"<EC Point Infinity>";return"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},z.prototype.isInfinity=function(){return this.z.cmpn(0)===0},z.prototype.dbl=function(){var M=this.x.redAdd(this.z),S=M.redSqr(),R=this.x.redSub(this.z),L=R.redSqr(),H=S.redSub(L),q=S.redMul(L),P=H.redMul(L.redAdd(this.curve.a24.redMul(H)));return this.curve.point(q,P)},z.prototype.add=function(){throw Error("Not supported on Montgomery curve")},z.prototype.diffAdd=function(M,S){var R=this.x.redAdd(this.z),L=this.x.redSub(this.z),H=M.x.redAdd(M.z),q=M.x.redSub(M.z),P=q.redMul(R),_=H.redMul(L),k=S.z.redMul(P.redAdd(_).redSqr()),B=S.x.redMul(P.redISub(_).redSqr());return this.curve.point(k,B)},z.prototype.mul=function(M){var S=M.clone(),R=this,L=this.curve.point(null,null),H=this;for(var q=[];S.cmpn(0)!==0;S.iushrn(1))q.push(S.andln(1));for(var P=q.length-1;P>=0;P--)if(q[P]===0)R=R.diffAdd(L,H),L=L.dbl();else L=R.diffAdd(L,H),R=R.dbl();return L},z.prototype.mulAdd=function(){throw Error("Not supported on Montgomery curve")},z.prototype.jumlAdd=function(){throw Error("Not supported on Montgomery curve")},z.prototype.eq=function(M){return this.getX().cmp(M.getX())===0},z.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},z.prototype.getX=function(){return this.normalize(),this.x.fromRed()}}),gJ=$0((Q,$)=>{var V=wU(),W=sU(),C=xU(),F=XZ(),A=V.assert;function z(S){this.twisted=(S.a|0)!==1,this.mOneA=this.twisted&&(S.a|0)===-1,this.extended=this.mOneA,F.call(this,"edwards",S),this.a=new W(S.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new W(S.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new W(S.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),A(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(S.c|0)===1}C(z,F),$.exports=z,z.prototype._mulA=function(S){if(this.mOneA)return S.redNeg();else return this.a.redMul(S)},z.prototype._mulC=function(S){if(this.oneC)return S;else return this.c.redMul(S)},z.prototype.jpoint=function(S,R,L,H){return this.point(S,R,L,H)},z.prototype.pointFromX=function(S,R){if(S=new W(S,16),!S.red)S=S.toRed(this.red);var L=S.redSqr(),H=this.c2.redSub(this.a.redMul(L)),q=this.one.redSub(this.c2.redMul(this.d).redMul(L)),P=H.redMul(q.redInvm()),_=P.redSqrt();if(_.redSqr().redSub(P).cmp(this.zero)!==0)throw Error("invalid point");var k=_.fromRed().isOdd();if(R&&!k||!R&&k)_=_.redNeg();return this.point(S,_)},z.prototype.pointFromY=function(S,R){if(S=new W(S,16),!S.red)S=S.toRed(this.red);var L=S.redSqr(),H=L.redSub(this.c2),q=L.redMul(this.d).redMul(this.c2).redSub(this.a),P=H.redMul(q.redInvm());if(P.cmp(this.zero)===0)if(R)throw Error("invalid point");else return this.point(this.zero,S);var _=P.redSqrt();if(_.redSqr().redSub(P).cmp(this.zero)!==0)throw Error("invalid point");if(_.fromRed().isOdd()!==R)_=_.redNeg();return this.point(_,S)},z.prototype.validate=function(S){if(S.isInfinity())return!0;S.normalize();var R=S.x.redSqr(),L=S.y.redSqr(),H=R.redMul(this.a).redAdd(L),q=this.c2.redMul(this.one.redAdd(this.d.redMul(R).redMul(L)));return H.cmp(q)===0};function M(S,R,L,H,q){if(F.BasePoint.call(this,S,"projective"),R===null&&L===null&&H===null)this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0;else{if(this.x=new W(R,16),this.y=new W(L,16),this.z=H?new W(H,16):this.curve.one,this.t=q&&new W(q,16),!this.x.red)this.x=this.x.toRed(this.curve.red);if(!this.y.red)this.y=this.y.toRed(this.curve.red);if(!this.z.red)this.z=this.z.toRed(this.curve.red);if(this.t&&!this.t.red)this.t=this.t.toRed(this.curve.red);if(this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t){if(this.t=this.x.redMul(this.y),!this.zOne)this.t=this.t.redMul(this.z.redInvm())}}}C(M,F.BasePoint),z.prototype.pointFromJSON=function(S){return M.fromJSON(this,S)},z.prototype.point=function(S,R,L,H){return new M(this,S,R,L,H)},M.fromJSON=function(S,R){return new M(S,R[0],R[1],R[2])},M.prototype.inspect=function(){if(this.isInfinity())return"<EC Point Infinity>";return"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},M.prototype.isInfinity=function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)},M.prototype._extDbl=function(){var S=this.x.redSqr(),R=this.y.redSqr(),L=this.z.redSqr();L=L.redIAdd(L);var H=this.curve._mulA(S),q=this.x.redAdd(this.y).redSqr().redISub(S).redISub(R),P=H.redAdd(R),_=P.redSub(L),k=H.redSub(R),B=q.redMul(_),j=P.redMul(k),x=q.redMul(k),f=_.redMul(P);return this.curve.point(B,j,f,x)},M.prototype._projDbl=function(){var S=this.x.redAdd(this.y).redSqr(),R=this.x.redSqr(),L=this.y.redSqr(),H,q,P,_,k,B;if(this.curve.twisted){_=this.curve._mulA(R);var j=_.redAdd(L);if(this.zOne)H=S.redSub(R).redSub(L).redMul(j.redSub(this.curve.two)),q=j.redMul(_.redSub(L)),P=j.redSqr().redSub(j).redSub(j);else k=this.z.redSqr(),B=j.redSub(k).redISub(k),H=S.redSub(R).redISub(L).redMul(B),q=j.redMul(_.redSub(L)),P=j.redMul(B)}else _=R.redAdd(L),k=this.curve._mulC(this.z).redSqr(),B=_.redSub(k).redSub(k),H=this.curve._mulC(S.redISub(_)).redMul(B),q=this.curve._mulC(_).redMul(R.redISub(L)),P=_.redMul(B);return this.curve.point(H,q,P)},M.prototype.dbl=function(){if(this.isInfinity())return this;if(this.curve.extended)return this._extDbl();else return this._projDbl()},M.prototype._extAdd=function(S){var R=this.y.redSub(this.x).redMul(S.y.redSub(S.x)),L=this.y.redAdd(this.x).redMul(S.y.redAdd(S.x)),H=this.t.redMul(this.curve.dd).redMul(S.t),q=this.z.redMul(S.z.redAdd(S.z)),P=L.redSub(R),_=q.redSub(H),k=q.redAdd(H),B=L.redAdd(R),j=P.redMul(_),x=k.redMul(B),f=P.redMul(B),w=_.redMul(k);return this.curve.point(j,x,w,f)},M.prototype._projAdd=function(S){var R=this.z.redMul(S.z),L=R.redSqr(),H=this.x.redMul(S.x),q=this.y.redMul(S.y),P=this.curve.d.redMul(H).redMul(q),_=L.redSub(P),k=L.redAdd(P),B=this.x.redAdd(this.y).redMul(S.x.redAdd(S.y)).redISub(H).redISub(q),j=R.redMul(_).redMul(B),x,f;if(this.curve.twisted)x=R.redMul(k).redMul(q.redSub(this.curve._mulA(H))),f=_.redMul(k);else x=R.redMul(k).redMul(q.redSub(H)),f=this.curve._mulC(_).redMul(k);return this.curve.point(j,x,f)},M.prototype.add=function(S){if(this.isInfinity())return S;if(S.isInfinity())return this;if(this.curve.extended)return this._extAdd(S);else return this._projAdd(S)},M.prototype.mul=function(S){if(this._hasDoubles(S))return this.curve._fixedNafMul(this,S);else return this.curve._wnafMul(this,S)},M.prototype.mulAdd=function(S,R,L){return this.curve._wnafMulAdd(1,[this,R],[S,L],2,!1)},M.prototype.jmulAdd=function(S,R,L){return this.curve._wnafMulAdd(1,[this,R],[S,L],2,!0)},M.prototype.normalize=function(){if(this.zOne)return this;var S=this.z.redInvm();if(this.x=this.x.redMul(S),this.y=this.y.redMul(S),this.t)this.t=this.t.redMul(S);return this.z=this.curve.one,this.zOne=!0,this},M.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},M.prototype.getX=function(){return this.normalize(),this.x.fromRed()},M.prototype.getY=function(){return this.normalize(),this.y.fromRed()},M.prototype.eq=function(S){return this===S||this.getX().cmp(S.getX())===0&&this.getY().cmp(S.getY())===0},M.prototype.eqXToP=function(S){var R=S.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(R)===0)return!0;var L=S.clone(),H=this.curve.redN.redMul(this.z);for(;;){if(L.iadd(this.curve.n),L.cmp(this.curve.p)>=0)return!1;if(R.redIAdd(H),this.x.cmp(R)===0)return!0}},M.prototype.toP=M.prototype.normalize,M.prototype.mixedAdd=M.prototype.add}),GY=$0((Q)=>{var $=Q;$.base=XZ(),$.short=xJ(),$.mont=NJ(),$.edwards=gJ()}),dU=$0((Q)=>{var $=OO(),V=xU();Q.inherits=V;function W(X,J){if((X.charCodeAt(J)&64512)!==55296)return!1;if(J<0||J+1>=X.length)return!1;return(X.charCodeAt(J+1)&64512)===56320}function C(X,J){if(Array.isArray(X))return X.slice();if(!X)return[];var Z=[];if(typeof X==="string"){if(!J){var Y=0;for(var I=0;I<X.length;I++){var K=X.charCodeAt(I);if(K<128)Z[Y++]=K;else if(K<2048)Z[Y++]=K>>6|192,Z[Y++]=K&63|128;else if(W(X,I))K=65536+((K&1023)<<10)+(X.charCodeAt(++I)&1023),Z[Y++]=K>>18|240,Z[Y++]=K>>12&63|128,Z[Y++]=K>>6&63|128,Z[Y++]=K&63|128;else Z[Y++]=K>>12|224,Z[Y++]=K>>6&63|128,Z[Y++]=K&63|128}}else if(J==="hex"){if(X=X.replace(/[^a-z0-9]+/ig,""),X.length%2!==0)X="0"+X;for(I=0;I<X.length;I+=2)Z.push(parseInt(X[I]+X[I+1],16))}}else for(I=0;I<X.length;I++)Z[I]=X[I]|0;return Z}Q.toArray=C;function F(X){var J="";for(var Z=0;Z<X.length;Z++)J+=M(X[Z].toString(16));return J}Q.toHex=F;function A(X){var J=X>>>24|X>>>8&65280|X<<8&16711680|(X&255)<<24;return J>>>0}Q.htonl=A;function z(X,J){var Z="";for(var Y=0;Y<X.length;Y++){var I=X[Y];if(J==="little")I=A(I);Z+=S(I.toString(16))}return Z}Q.toHex32=z;function M(X){if(X.length===1)return"0"+X;else return X}Q.zero2=M;function S(X){if(X.length===7)return"0"+X;else if(X.length===6)return"00"+X;else if(X.length===5)return"000"+X;else if(X.length===4)return"0000"+X;else if(X.length===3)return"00000"+X;else if(X.length===2)return"000000"+X;else if(X.length===1)return"0000000"+X;else return X}Q.zero8=S;function R(X,J,Z,Y){var I=Z-J;$(I%4===0);var K=Array(I/4);for(var G=0,O=J;G<K.length;G++,O+=4){var E;if(Y==="big")E=X[O]<<24|X[O+1]<<16|X[O+2]<<8|X[O+3];else E=X[O+3]<<24|X[O+2]<<16|X[O+1]<<8|X[O];K[G]=E>>>0}return K}Q.join32=R;function L(X,J){var Z=Array(X.length*4);for(var Y=0,I=0;Y<X.length;Y++,I+=4){var K=X[Y];if(J==="big")Z[I]=K>>>24,Z[I+1]=K>>>16&255,Z[I+2]=K>>>8&255,Z[I+3]=K&255;else Z[I+3]=K>>>24,Z[I+2]=K>>>16&255,Z[I+1]=K>>>8&255,Z[I]=K&255}return Z}Q.split32=L;function H(X,J){return X>>>J|X<<32-J}Q.rotr32=H;function q(X,J){return X<<J|X>>>32-J}Q.rotl32=q;function P(X,J){return X+J>>>0}Q.sum32=P;function _(X,J,Z){return X+J+Z>>>0}Q.sum32_3=_;function k(X,J,Z,Y){return X+J+Z+Y>>>0}Q.sum32_4=k;function B(X,J,Z,Y,I){return X+J+Z+Y+I>>>0}Q.sum32_5=B;function j(X,J,Z,Y){var I=X[J],K=X[J+1],G=Y+K>>>0,O=(G<Y?1:0)+Z+I;X[J]=O>>>0,X[J+1]=G}Q.sum64=j;function x(X,J,Z,Y){var I=J+Y>>>0,K=(I<J?1:0)+X+Z;return K>>>0}Q.sum64_hi=x;function f(X,J,Z,Y){var I=J+Y;return I>>>0}Q.sum64_lo=f;function w(X,J,Z,Y,I,K,G,O){var E=0,T=J;T=T+Y>>>0,E+=T<J?1:0,T=T+K>>>0,E+=T<K?1:0,T=T+O>>>0,E+=T<O?1:0;var D=X+Z+I+G+E;return D>>>0}Q.sum64_4_hi=w;function d(X,J,Z,Y,I,K,G,O){var E=J+Y+K+O;return E>>>0}Q.sum64_4_lo=d;function Y0(X,J,Z,Y,I,K,G,O,E,T){var D=0,v=J;v=v+Y>>>0,D+=v<J?1:0,v=v+K>>>0,D+=v<K?1:0,v=v+O>>>0,D+=v<O?1:0,v=v+T>>>0,D+=v<T?1:0;var g=X+Z+I+G+E+D;return g>>>0}Q.sum64_5_hi=Y0;function J0(X,J,Z,Y,I,K,G,O,E,T){var D=J+Y+K+O+T;return D>>>0}Q.sum64_5_lo=J0;function A0(X,J,Z){var Y=J<<32-Z|X>>>Z;return Y>>>0}Q.rotr64_hi=A0;function u(X,J,Z){var Y=X<<32-Z|J>>>Z;return Y>>>0}Q.rotr64_lo=u;function O0(X,J,Z){return X>>>Z}Q.shr64_hi=O0;function U(X,J,Z){var Y=X<<32-Z|J>>>Z;return Y>>>0}Q.shr64_lo=U}),xO=$0((Q)=>{var $=dU(),V=OO();function W(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}Q.BlockHash=W,W.prototype.update=function(C,F){if(C=$.toArray(C,F),!this.pending)this.pending=C;else this.pending=this.pending.concat(C);if(this.pendingTotal+=C.length,this.pending.length>=this._delta8){C=this.pending;var A=C.length%this._delta8;if(this.pending=C.slice(C.length-A,C.length),this.pending.length===0)this.pending=null;C=$.join32(C,0,C.length-A,this.endian);for(var z=0;z<C.length;z+=this._delta32)this._update(C,z,z+this._delta32)}return this},W.prototype.digest=function(C){return this.update(this._pad()),V(this.pending===null),this._digest(C)},W.prototype._pad=function(){var C=this.pendingTotal,F=this._delta8,A=F-(C+this.padLength)%F,z=Array(A+this.padLength);z[0]=128;for(var M=1;M<A;M++)z[M]=0;if(C<<=3,this.endian==="big"){for(var S=8;S<this.padLength;S++)z[M++]=0;z[M++]=0,z[M++]=0,z[M++]=0,z[M++]=0,z[M++]=C>>>24&255,z[M++]=C>>>16&255,z[M++]=C>>>8&255,z[M++]=C&255}else{z[M++]=C&255,z[M++]=C>>>8&255,z[M++]=C>>>16&255,z[M++]=C>>>24&255,z[M++]=0,z[M++]=0,z[M++]=0,z[M++]=0;for(S=8;S<this.padLength;S++)z[M++]=0}return z}}),VY=$0((Q)=>{var $=dU(),V=$.rotr32;function W(L,H,q,P){if(L===0)return C(H,q,P);if(L===1||L===3)return A(H,q,P);if(L===2)return F(H,q,P)}Q.ft_1=W;function C(L,H,q){return L&H^~L&q}Q.ch32=C;function F(L,H,q){return L&H^L&q^H&q}Q.maj32=F;function A(L,H,q){return L^H^q}Q.p32=A;function z(L){return V(L,2)^V(L,13)^V(L,22)}Q.s0_256=z;function M(L){return V(L,6)^V(L,11)^V(L,25)}Q.s1_256=M;function S(L){return V(L,7)^V(L,18)^L>>>3}Q.g0_256=S;function R(L){return V(L,17)^V(L,19)^L>>>10}Q.g1_256=R}),fJ=$0((Q,$)=>{var V=dU(),W=xO(),C=VY(),F=V.rotl32,A=V.sum32,z=V.sum32_5,M=C.ft_1,S=W.BlockHash,R=[1518500249,1859775393,2400959708,3395469782];function L(){if(!(this instanceof L))return new L;S.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=Array(80)}V.inherits(L,S),$.exports=L,L.blockSize=512,L.outSize=160,L.hmacStrength=80,L.padLength=64,L.prototype._update=function(H,q){var P=this.W;for(var _=0;_<16;_++)P[_]=H[q+_];for(;_<P.length;_++)P[_]=F(P[_-3]^P[_-8]^P[_-14]^P[_-16],1);var k=this.h[0],B=this.h[1],j=this.h[2],x=this.h[3],f=this.h[4];for(_=0;_<P.length;_++){var w=~~(_/20),d=z(F(k,5),M(w,B,j,x),f,P[_],R[w]);f=x,x=j,j=F(B,30),B=k,k=d}this.h[0]=A(this.h[0],k),this.h[1]=A(this.h[1],B),this.h[2]=A(this.h[2],j),this.h[3]=A(this.h[3],x),this.h[4]=A(this.h[4],f)},L.prototype._digest=function(H){if(H==="hex")return V.toHex32(this.h,"big");else return V.split32(this.h,"big")}}),EY=$0((Q,$)=>{var V=dU(),W=xO(),C=VY(),F=OO(),A=V.sum32,z=V.sum32_4,M=V.sum32_5,S=C.ch32,R=C.maj32,L=C.s0_256,H=C.s1_256,q=C.g0_256,P=C.g1_256,_=W.BlockHash,k=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function B(){if(!(this instanceof B))return new B;_.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=k,this.W=Array(64)}V.inherits(B,_),$.exports=B,B.blockSize=512,B.outSize=256,B.hmacStrength=192,B.padLength=64,B.prototype._update=function(j,x){var f=this.W;for(var w=0;w<16;w++)f[w]=j[x+w];for(;w<f.length;w++)f[w]=z(P(f[w-2]),f[w-7],q(f[w-15]),f[w-16]);var d=this.h[0],Y0=this.h[1],J0=this.h[2],A0=this.h[3],u=this.h[4],O0=this.h[5],U=this.h[6],X=this.h[7];F(this.k.length===f.length);for(w=0;w<f.length;w++){var J=M(X,H(u),S(u,O0,U),this.k[w],f[w]),Z=A(L(d),R(d,Y0,J0));X=U,U=O0,O0=u,u=A(A0,J),A0=J0,J0=Y0,Y0=d,d=A(J,Z)}this.h[0]=A(this.h[0],d),this.h[1]=A(this.h[1],Y0),this.h[2]=A(this.h[2],J0),this.h[3]=A(this.h[3],A0),this.h[4]=A(this.h[4],u),this.h[5]=A(this.h[5],O0),this.h[6]=A(this.h[6],U),this.h[7]=A(this.h[7],X)},B.prototype._digest=function(j){if(j==="hex")return V.toHex32(this.h,"big");else return V.split32(this.h,"big")}}),wJ=$0((Q,$)=>{var V=dU(),W=EY();function C(){if(!(this instanceof C))return new C;W.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}V.inherits(C,W),$.exports=C,C.blockSize=512,C.outSize=224,C.hmacStrength=192,C.padLength=64,C.prototype._digest=function(F){if(F==="hex")return V.toHex32(this.h.slice(0,7),"big");else return V.split32(this.h.slice(0,7),"big")}}),IY=$0((Q,$)=>{var V=dU(),W=xO(),C=OO(),F=V.rotr64_hi,A=V.rotr64_lo,z=V.shr64_hi,M=V.shr64_lo,S=V.sum64,R=V.sum64_hi,L=V.sum64_lo,H=V.sum64_4_hi,q=V.sum64_4_lo,P=V.sum64_5_hi,_=V.sum64_5_lo,k=W.BlockHash,B=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function j(){if(!(this instanceof j))return new j;k.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=B,this.W=Array(160)}V.inherits(j,k),$.exports=j,j.blockSize=1024,j.outSize=512,j.hmacStrength=192,j.padLength=128,j.prototype._prepareBlock=function(Z,Y){var I=this.W;for(var K=0;K<32;K++)I[K]=Z[Y+K];for(;K<I.length;K+=2){var G=X(I[K-4],I[K-3]),O=J(I[K-4],I[K-3]),E=I[K-14],T=I[K-13],D=O0(I[K-30],I[K-29]),v=U(I[K-30],I[K-29]),g=I[K-32],p=I[K-31];I[K]=H(G,O,E,T,D,v,g,p),I[K+1]=q(G,O,E,T,D,v,g,p)}},j.prototype._update=function(Z,Y){this._prepareBlock(Z,Y);var I=this.W,K=this.h[0],G=this.h[1],O=this.h[2],E=this.h[3],T=this.h[4],D=this.h[5],v=this.h[6],g=this.h[7],p=this.h[8],n=this.h[9],V0=this.h[10],r=this.h[11],l=this.h[12],X0=this.h[13],m=this.h[14],i=this.h[15];C(this.k.length===I.length);for(var g0=0;g0<I.length;g0+=2){var y=m,h=i,Q0=A0(p,n),t=u(p,n),e=x(p,n,V0,r,l,X0),F0=f(p,n,V0,r,l,X0),c=this.k[g0],o=this.k[g0+1],N0=I[g0],s=I[g0+1],Z0=P(y,h,Q0,t,e,F0,c,o,N0,s),w0=_(y,h,Q0,t,e,F0,c,o,N0,s);y=Y0(K,G),h=J0(K,G),Q0=w(K,G,O,E,T,D),t=d(K,G,O,E,T,D);var C0=R(y,h,Q0,t),K0=L(y,h,Q0,t);m=l,i=X0,l=V0,X0=r,V0=p,r=n,p=R(v,g,Z0,w0),n=L(g,g,Z0,w0),v=T,g=D,T=O,D=E,O=K,E=G,K=R(Z0,w0,C0,K0),G=L(Z0,w0,C0,K0)}S(this.h,0,K,G),S(this.h,2,O,E),S(this.h,4,T,D),S(this.h,6,v,g),S(this.h,8,p,n),S(this.h,10,V0,r),S(this.h,12,l,X0),S(this.h,14,m,i)},j.prototype._digest=function(Z){if(Z==="hex")return V.toHex32(this.h,"big");else return V.split32(this.h,"big")};function x(Z,Y,I,K,G){var O=Z&I^~Z&G;if(O<0)O+=4294967296;return O}function f(Z,Y,I,K,G,O){var E=Y&K^~Y&O;if(E<0)E+=4294967296;return E}function w(Z,Y,I,K,G){var O=Z&I^Z&G^I&G;if(O<0)O+=4294967296;return O}function d(Z,Y,I,K,G,O){var E=Y&K^Y&O^K&O;if(E<0)E+=4294967296;return E}function Y0(Z,Y){var I=F(Z,Y,28),K=F(Y,Z,2),G=F(Y,Z,7),O=I^K^G;if(O<0)O+=4294967296;return O}function J0(Z,Y){var I=A(Z,Y,28),K=A(Y,Z,2),G=A(Y,Z,7),O=I^K^G;if(O<0)O+=4294967296;return O}function A0(Z,Y){var I=F(Z,Y,14),K=F(Z,Y,18),G=F(Y,Z,9),O=I^K^G;if(O<0)O+=4294967296;return O}function u(Z,Y){var I=A(Z,Y,14),K=A(Z,Y,18),G=A(Y,Z,9),O=I^K^G;if(O<0)O+=4294967296;return O}function O0(Z,Y){var I=F(Z,Y,1),K=F(Z,Y,8),G=z(Z,Y,7),O=I^K^G;if(O<0)O+=4294967296;return O}function U(Z,Y){var I=A(Z,Y,1),K=A(Z,Y,8),G=M(Z,Y,7),O=I^K^G;if(O<0)O+=4294967296;return O}function X(Z,Y){var I=F(Z,Y,19),K=F(Y,Z,29),G=z(Z,Y,6),O=I^K^G;if(O<0)O+=4294967296;return O}function J(Z,Y){var I=A(Z,Y,19),K=A(Y,Z,29),G=M(Z,Y,6),O=I^K^G;if(O<0)O+=4294967296;return O}}),yJ=$0((Q,$)=>{var V=dU(),W=IY();function C(){if(!(this instanceof C))return new C;W.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}V.inherits(C,W),$.exports=C,C.blockSize=1024,C.outSize=384,C.hmacStrength=192,C.padLength=128,C.prototype._digest=function(F){if(F==="hex")return V.toHex32(this.h.slice(0,12),"big");else return V.split32(this.h.slice(0,12),"big")}}),cJ=$0((Q)=>{Q.sha1=fJ(),Q.sha224=wJ(),Q.sha256=EY(),Q.sha384=yJ(),Q.sha512=IY()}),pJ=$0((Q)=>{var $=dU(),V=xO(),W=$.rotl32,C=$.sum32,F=$.sum32_3,A=$.sum32_4,z=V.BlockHash;function M(){if(!(this instanceof M))return new M;z.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}$.inherits(M,z),Q.ripemd160=M,M.blockSize=512,M.outSize=160,M.hmacStrength=192,M.padLength=64,M.prototype._update=function(k,B){var j=this.h[0],x=this.h[1],f=this.h[2],w=this.h[3],d=this.h[4],Y0=j,J0=x,A0=f,u=w,O0=d;for(var U=0;U<80;U++){var X=C(W(A(j,S(U,x,f,w),k[H[U]+B],R(U)),P[U]),d);j=d,d=w,w=W(f,10),f=x,x=X,X=C(W(A(Y0,S(79-U,J0,A0,u),k[q[U]+B],L(U)),_[U]),O0),Y0=O0,O0=u,u=W(A0,10),A0=J0,J0=X}X=F(this.h[1],f,u),this.h[1]=F(this.h[2],w,O0),this.h[2]=F(this.h[3],d,Y0),this.h[3]=F(this.h[4],j,J0),this.h[4]=F(this.h[0],x,A0),this.h[0]=X},M.prototype._digest=function(k){if(k==="hex")return $.toHex32(this.h,"little");else return $.split32(this.h,"little")};function S(k,B,j,x){if(k<=15)return B^j^x;else if(k<=31)return B&j|~B&x;else if(k<=47)return(B|~j)^x;else if(k<=63)return B&x|j&~x;else return B^(j|~x)}function R(k){if(k<=15)return 0;else if(k<=31)return 1518500249;else if(k<=47)return 1859775393;else if(k<=63)return 2400959708;else return 2840853838}function L(k){if(k<=15)return 1352829926;else if(k<=31)return 1548603684;else if(k<=47)return 1836072691;else if(k<=63)return 2053994217;else return 0}var H=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],q=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],P=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],_=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]}),hJ=$0((Q,$)=>{var V=dU(),W=OO();function C(F,A,z){if(!(this instanceof C))return new C(F,A,z);this.Hash=F,this.blockSize=F.blockSize/8,this.outSize=F.outSize/8,this.inner=null,this.outer=null,this._init(V.toArray(A,z))}$.exports=C,C.prototype._init=function(F){if(F.length>this.blockSize)F=new this.Hash().update(F).digest();W(F.length<=this.blockSize);for(var A=F.length;A<this.blockSize;A++)F.push(0);for(A=0;A<F.length;A++)F[A]^=54;this.inner=new this.Hash().update(F);for(A=0;A<F.length;A++)F[A]^=106;this.outer=new this.Hash().update(F)},C.prototype.update=function(F,A){return this.inner.update(F,A),this},C.prototype.digest=function(F){return this.outer.update(this.inner.digest()),this.outer.digest(F)}}),$X=$0((Q)=>{var $=Q;$.utils=dU(),$.common=xO(),$.sha=cJ(),$.ripemd=pJ(),$.hmac=hJ(),$.sha1=$.sha.sha1,$.sha256=$.sha.sha256,$.sha224=$.sha.sha224,$.sha384=$.sha.sha384,$.sha512=$.sha.sha512,$.ripemd160=$.ripemd.ripemd160}),uJ=$0((Q,$)=>{$.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}}),JX=$0((Q)=>{var $=Q,V=$X(),W=GY(),C=wU(),F=C.assert;function A(S){if(S.type==="short")this.curve=new W.short(S);else if(S.type==="edwards")this.curve=new W.edwards(S);else this.curve=new W.mont(S);this.g=this.curve.g,this.n=this.curve.n,this.hash=S.hash,F(this.g.validate(),"Invalid curve"),F(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}$.PresetCurve=A;function z(S,R){Object.defineProperty($,S,{configurable:!0,enumerable:!0,get:function(){var L=new A(R);return Object.defineProperty($,S,{configurable:!0,enumerable:!0,value:L}),L}})}z("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:V.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),z("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:V.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),z("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:V.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),z("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:V.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"]}),z("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:V.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"]}),z("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:V.sha256,gRed:!1,g:["9"]}),z("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:V.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var M;try{M=uJ()}catch(S){M=void 0}z("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:V.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",M]})}),bJ=$0((Q,$)=>{var V=$X(),W=$Y(),C=OO();function F(A){if(!(this instanceof F))return new F(A);this.hash=A.hash,this.predResist=!!A.predResist,this.outLen=this.hash.outSize,this.minEntropy=A.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var z=W.toArray(A.entropy,A.entropyEnc||"hex"),M=W.toArray(A.nonce,A.nonceEnc||"hex"),S=W.toArray(A.pers,A.persEnc||"hex");C(z.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(z,M,S)}$.exports=F,F.prototype._init=function(A,z,M){var S=A.concat(z).concat(M);this.K=Array(this.outLen/8),this.V=Array(this.outLen/8);for(var R=0;R<this.V.length;R++)this.K[R]=0,this.V[R]=1;this._update(S),this._reseed=1,this.reseedInterval=281474976710656},F.prototype._hmac=function(){return new V.hmac(this.hash,this.K)},F.prototype._update=function(A){var z=this._hmac().update(this.V).update([0]);if(A)z=z.update(A);if(this.K=z.digest(),this.V=this._hmac().update(this.V).digest(),!A)return;this.K=this._hmac().update(this.V).update([1]).update(A).digest(),this.V=this._hmac().update(this.V).digest()},F.prototype.reseed=function(A,z,M,S){if(typeof z!=="string")S=M,M=z,z=null;A=W.toArray(A,z),M=W.toArray(M,S),C(A.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(A.concat(M||[])),this._reseed=1},F.prototype.generate=function(A,z,M,S){if(this._reseed>this.reseedInterval)throw Error("Reseed is required");if(typeof z!=="string")S=M,M=z,z=null;if(M)M=W.toArray(M,S||"hex"),this._update(M);var R=[];while(R.length<A)this.V=this._hmac().update(this.V).digest(),R=R.concat(this.V);var L=R.slice(0,A);return this._update(M),this._reseed++,W.encode(L,z)}}),lJ=$0((Q,$)=>{var V=sU(),W=wU(),C=W.assert;function F(A,z){if(this.ec=A,this.priv=null,this.pub=null,z.priv)this._importPrivate(z.priv,z.privEnc);if(z.pub)this._importPublic(z.pub,z.pubEnc)}$.exports=F,F.fromPublic=function(A,z,M){if(z instanceof F)return z;return new F(A,{pub:z,pubEnc:M})},F.fromPrivate=function(A,z,M){if(z instanceof F)return z;return new F(A,{priv:z,privEnc:M})},F.prototype.validate=function(){var A=this.getPublic();if(A.isInfinity())return{result:!1,reason:"Invalid public key"};if(!A.validate())return{result:!1,reason:"Public key is not a point"};if(!A.mul(this.ec.curve.n).isInfinity())return{result:!1,reason:"Public key * N != O"};return{result:!0,reason:null}},F.prototype.getPublic=function(A,z){if(typeof A==="string")z=A,A=null;if(!this.pub)this.pub=this.ec.g.mul(this.priv);if(!z)return this.pub;return this.pub.encode(z,A)},F.prototype.getPrivate=function(A){if(A==="hex")return this.priv.toString(16,2);else return this.priv},F.prototype._importPrivate=function(A,z){this.priv=new V(A,z||16),this.priv=this.priv.umod(this.ec.curve.n)},F.prototype._importPublic=function(A,z){if(A.x||A.y){if(this.ec.curve.type==="mont")C(A.x,"Need x coordinate");else if(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")C(A.x&&A.y,"Need both x and y coordinate");this.pub=this.ec.curve.point(A.x,A.y);return}this.pub=this.ec.curve.decodePoint(A,z)},F.prototype.derive=function(A){if(!A.validate())C(A.validate(),"public point not validated");return A.mul(this.priv).getX()},F.prototype.sign=function(A,z,M){return this.ec.sign(A,this,z,M)},F.prototype.verify=function(A,z,M){return this.ec.verify(A,z,this,void 0,M)},F.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}}),dJ=$0((Q,$)=>{var V=sU(),W=wU(),C=W.assert;function F(R,L){if(R instanceof F)return R;if(this._importDER(R,L))return;if(C(R.r&&R.s,"Signature without r or s"),this.r=new V(R.r,16),this.s=new V(R.s,16),R.recoveryParam===void 0)this.recoveryParam=null;else this.recoveryParam=R.recoveryParam}$.exports=F;function A(){this.place=0}function z(R,L){var H=R[L.place++];if(!(H&128))return H;var q=H&15;if(q===0||q>4)return!1;if(R[L.place]===0)return!1;var P=0;for(var _=0,k=L.place;_<q;_++,k++)P<<=8,P|=R[k],P>>>=0;if(P<=127)return!1;return L.place=k,P}function M(R){var L=0,H=R.length-1;while(!R[L]&&!(R[L+1]&128)&&L<H)L++;if(L===0)return R;return R.slice(L)}F.prototype._importDER=function(R,L){R=W.toArray(R,L);var H=new A;if(R[H.place++]!==48)return!1;var q=z(R,H);if(q===!1)return!1;if(q+H.place!==R.length)return!1;if(R[H.place++]!==2)return!1;var P=z(R,H);if(P===!1)return!1;if((R[H.place]&128)!==0)return!1;var _=R.slice(H.place,P+H.place);if(H.place+=P,R[H.place++]!==2)return!1;var k=z(R,H);if(k===!1)return!1;if(R.length!==k+H.place)return!1;if((R[H.place]&128)!==0)return!1;var B=R.slice(H.place,k+H.place);if(_[0]===0)if(_[1]&128)_=_.slice(1);else return!1;if(B[0]===0)if(B[1]&128)B=B.slice(1);else return!1;return this.r=new V(_),this.s=new V(B),this.recoveryParam=null,!0};function S(R,L){if(L<128){R.push(L);return}var H=1+(Math.log(L)/Math.LN2>>>3);R.push(H|128);while(--H)R.push(L>>>(H<<3)&255);R.push(L)}F.prototype.toDER=function(R){var L=this.r.toArray(),H=this.s.toArray();if(L[0]&128)L=[0].concat(L);if(H[0]&128)H=[0].concat(H);L=M(L),H=M(H);while(!H[0]&&!(H[1]&128))H=H.slice(1);var q=[2];S(q,L.length),q=q.concat(L),q.push(2),S(q,H.length);var P=q.concat(H),_=[48];return S(_,P.length),_=_.concat(P),W.encode(_,R)}}),oJ=$0((Q,$)=>{var V=sU(),W=bJ(),C=wU(),F=JX(),A=JY(),z=C.assert,M=lJ(),S=dJ();function R(L){if(!(this instanceof R))return new R(L);if(typeof L==="string")z(Object.prototype.hasOwnProperty.call(F,L),"Unknown curve "+L),L=F[L];if(L instanceof F.PresetCurve)L={curve:L};this.curve=L.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=L.curve.g,this.g.precompute(L.curve.n.bitLength()+1),this.hash=L.hash||L.curve.hash}$.exports=R,R.prototype.keyPair=function(L){return new M(this,L)},R.prototype.keyFromPrivate=function(L,H){return M.fromPrivate(this,L,H)},R.prototype.keyFromPublic=function(L,H){return M.fromPublic(this,L,H)},R.prototype.genKeyPair=function(L){if(!L)L={};var H=new W({hash:this.hash,pers:L.pers,persEnc:L.persEnc||"utf8",entropy:L.entropy||A(this.hash.hmacStrength),entropyEnc:L.entropy&&L.entropyEnc||"utf8",nonce:this.n.toArray()}),q=this.n.byteLength(),P=this.n.sub(new V(2));for(;;){var _=new V(H.generate(q));if(_.cmp(P)>0)continue;return _.iaddn(1),this.keyFromPrivate(_)}},R.prototype._truncateToN=function(L,H,q){var P;if(V.isBN(L)||typeof L==="number")L=new V(L,16),P=L.byteLength();else if(typeof L==="object")P=L.length,L=new V(L,16);else{var _=L.toString();P=_.length+1>>>1,L=new V(_,16)}if(typeof q!=="number")q=P*8;var k=q-this.n.bitLength();if(k>0)L=L.ushrn(k);if(!H&&L.cmp(this.n)>=0)return L.sub(this.n);else return L},R.prototype.sign=function(L,H,q,P){if(typeof q==="object")P=q,q=null;if(!P)P={};if(typeof L!=="string"&&typeof L!=="number"&&!V.isBN(L)){z(typeof L==="object"&&L&&typeof L.length==="number","Expected message to be an array-like, a hex string, or a BN instance"),z(L.length>>>0===L.length);for(var _=0;_<L.length;_++)z((L[_]&255)===L[_])}H=this.keyFromPrivate(H,q),L=this._truncateToN(L,!1,P.msgBitLength),z(!L.isNeg(),"Can not sign a negative message");var k=this.n.byteLength(),B=H.getPrivate().toArray("be",k),j=L.toArray("be",k);z(new V(j).eq(L),"Can not sign message");var x=new W({hash:this.hash,entropy:B,nonce:j,pers:P.pers,persEnc:P.persEnc||"utf8"}),f=this.n.sub(new V(1));for(var w=0;;w++){var d=P.k?P.k(w):new V(x.generate(this.n.byteLength()));if(d=this._truncateToN(d,!0),d.cmpn(1)<=0||d.cmp(f)>=0)continue;var Y0=this.g.mul(d);if(Y0.isInfinity())continue;var J0=Y0.getX(),A0=J0.umod(this.n);if(A0.cmpn(0)===0)continue;var u=d.invm(this.n).mul(A0.mul(H.getPrivate()).iadd(L));if(u=u.umod(this.n),u.cmpn(0)===0)continue;var O0=(Y0.getY().isOdd()?1:0)|(J0.cmp(A0)!==0?2:0);if(P.canonical&&u.cmp(this.nh)>0)u=this.n.sub(u),O0^=1;return new S({r:A0,s:u,recoveryParam:O0})}},R.prototype.verify=function(L,H,q,P,_){if(!_)_={};L=this._truncateToN(L,!1,_.msgBitLength),q=this.keyFromPublic(q,P),H=new S(H,"hex");var{r:k,s:B}=H;if(k.cmpn(1)<0||k.cmp(this.n)>=0)return!1;if(B.cmpn(1)<0||B.cmp(this.n)>=0)return!1;var j=B.invm(this.n),x=j.mul(L).umod(this.n),f=j.mul(k).umod(this.n),w;if(!this.curve._maxwellTrick){if(w=this.g.mulAdd(x,q.getPublic(),f),w.isInfinity())return!1;return w.getX().umod(this.n).cmp(k)===0}if(w=this.g.jmulAdd(x,q.getPublic(),f),w.isInfinity())return!1;return w.eqXToP(k)},R.prototype.recoverPubKey=function(L,H,q,P){z((3&q)===q,"The recovery param is more than two bits"),H=new S(H,P);var _=this.n,k=new V(L),B=H.r,j=H.s,x=q&1,f=q>>1;if(B.cmp(this.curve.p.umod(this.curve.n))>=0&&f)throw Error("Unable to find sencond key candinate");if(f)B=this.curve.pointFromX(B.add(this.curve.n),x);else B=this.curve.pointFromX(B,x);var w=H.r.invm(_),d=_.sub(k).mul(w).umod(_),Y0=j.mul(w).umod(_);return this.g.mulAdd(d,B,Y0)},R.prototype.getKeyRecoveryParam=function(L,H,q,P){if(H=new S(H,P),H.recoveryParam!==null)return H.recoveryParam;for(var _=0;_<4;_++){var k;try{k=this.recoverPubKey(L,H,_)}catch(B){continue}if(k.eq(q))return _}throw Error("Unable to find valid recovery factor")}}),nJ=$0((Q,$)=>{var V=wU(),W=V.assert,C=V.parseBytes,F=V.cachedProperty;function A(z,M){if(this.eddsa=z,this._secret=C(M.secret),z.isPoint(M.pub))this._pub=M.pub;else this._pubBytes=C(M.pub)}A.fromPublic=function(z,M){if(M instanceof A)return M;return new A(z,{pub:M})},A.fromSecret=function(z,M){if(M instanceof A)return M;return new A(z,{secret:M})},A.prototype.secret=function(){return this._secret},F(A,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())}),F(A,"pub",function(){if(this._pubBytes)return this.eddsa.decodePoint(this._pubBytes);return this.eddsa.g.mul(this.priv())}),F(A,"privBytes",function(){var z=this.eddsa,M=this.hash(),S=z.encodingLength-1,R=M.slice(0,z.encodingLength);return R[0]&=248,R[S]&=127,R[S]|=64,R}),F(A,"priv",function(){return this.eddsa.decodeInt(this.privBytes())}),F(A,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()}),F(A,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)}),A.prototype.sign=function(z){return W(this._secret,"KeyPair can only verify"),this.eddsa.sign(z,this)},A.prototype.verify=function(z,M){return this.eddsa.verify(z,M,this)},A.prototype.getSecret=function(z){return W(this._secret,"KeyPair is public only"),V.encode(this.secret(),z)},A.prototype.getPublic=function(z){return V.encode(this.pubBytes(),z)},$.exports=A}),mJ=$0((Q,$)=>{var V=sU(),W=wU(),C=W.assert,F=W.cachedProperty,A=W.parseBytes;function z(M,S){if(this.eddsa=M,typeof S!=="object")S=A(S);if(Array.isArray(S))C(S.length===M.encodingLength*2,"Signature has invalid size"),S={R:S.slice(0,M.encodingLength),S:S.slice(M.encodingLength)};if(C(S.R&&S.S,"Signature without R or S"),M.isPoint(S.R))this._R=S.R;if(S.S instanceof V)this._S=S.S;this._Rencoded=Array.isArray(S.R)?S.R:S.Rencoded,this._Sencoded=Array.isArray(S.S)?S.S:S.Sencoded}F(z,"S",function(){return this.eddsa.decodeInt(this.Sencoded())}),F(z,"R",function(){return this.eddsa.decodePoint(this.Rencoded())}),F(z,"Rencoded",function(){return this.eddsa.encodePoint(this.R())}),F(z,"Sencoded",function(){return this.eddsa.encodeInt(this.S())}),z.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},z.prototype.toHex=function(){return W.encode(this.toBytes(),"hex").toUpperCase()},$.exports=z}),sJ=$0((Q,$)=>{var V=$X(),W=JX(),C=wU(),F=C.assert,A=C.parseBytes,z=nJ(),M=mJ();function S(R){if(F(R==="ed25519","only tested with ed25519 so far"),!(this instanceof S))return new S(R);R=W[R].curve,this.curve=R,this.g=R.g,this.g.precompute(R.n.bitLength()+1),this.pointClass=R.point().constructor,this.encodingLength=Math.ceil(R.n.bitLength()/8),this.hash=V.sha512}$.exports=S,S.prototype.sign=function(R,L){R=A(R);var H=this.keyFromSecret(L),q=this.hashInt(H.messagePrefix(),R),P=this.g.mul(q),_=this.encodePoint(P),k=this.hashInt(_,H.pubBytes(),R).mul(H.priv()),B=q.add(k).umod(this.curve.n);return this.makeSignature({R:P,S:B,Rencoded:_})},S.prototype.verify=function(R,L,H){if(R=A(R),L=this.makeSignature(L),L.S().gte(L.eddsa.curve.n)||L.S().isNeg())return!1;var q=this.keyFromPublic(H),P=this.hashInt(L.Rencoded(),q.pubBytes(),R),_=this.g.mul(L.S()),k=L.R().add(q.pub().mul(P));return k.eq(_)},S.prototype.hashInt=function(){var R=this.hash();for(var L=0;L<arguments.length;L++)R.update(arguments[L]);return C.intFromLE(R.digest()).umod(this.curve.n)},S.prototype.keyFromPublic=function(R){return z.fromPublic(this,R)},S.prototype.keyFromSecret=function(R){return z.fromSecret(this,R)},S.prototype.makeSignature=function(R){if(R instanceof M)return R;return new M(this,R)},S.prototype.encodePoint=function(R){var L=R.getY().toArray("le",this.encodingLength);return L[this.encodingLength-1]|=R.getX().isOdd()?128:0,L},S.prototype.decodePoint=function(R){R=C.parseBytes(R);var L=R.length-1,H=R.slice(0,L).concat(R[L]&-129),q=(R[L]&128)!==0,P=C.intFromLE(H);return this.curve.pointFromY(P,q)},S.prototype.encodeInt=function(R){return R.toArray("le",this.encodingLength)},S.prototype.decodeInt=function(R){return C.intFromLE(R)},S.prototype.isPoint=function(R){return R instanceof this.pointClass}}),tJ=$0((Q)=>{var $=Q;$.version=jJ().version,$.utils=wU(),$.rand=JY(),$.curve=GY(),$.curves=JX(),$.ec=oJ(),$.eddsa=sJ()}),rJ=$0((Q,$)=>{(function(V,W){function C(U,X){if(!U)throw Error(X||"Assertion failed")}function F(U,X){U.super_=X;var J=function(){};J.prototype=X.prototype,U.prototype=new J,U.prototype.constructor=U}function A(U,X,J){if(A.isBN(U))return U;if(this.negative=0,this.words=null,this.length=0,this.red=null,U!==null){if(X==="le"||X==="be")J=X,X=10;this._init(U||0,X||10,J||"be")}}if(typeof V==="object")V.exports=A;else W.BN=A;A.BN=A,A.wordSize=26;var z;try{if(typeof window<"u"&&typeof window.Buffer<"u")z=window.Buffer;else z=(HU(),h0(WU)).Buffer}catch(U){}A.isBN=function(U){if(U instanceof A)return!0;return U!==null&&typeof U==="object"&&U.constructor.wordSize===A.wordSize&&Array.isArray(U.words)},A.max=function(U,X){if(U.cmp(X)>0)return U;return X},A.min=function(U,X){if(U.cmp(X)<0)return U;return X},A.prototype._init=function(U,X,J){if(typeof U==="number")return this._initNumber(U,X,J);if(typeof U==="object")return this._initArray(U,X,J);if(X==="hex")X=16;C(X===(X|0)&&X>=2&&X<=36),U=U.toString().replace(/\s+/g,"");var Z=0;if(U[0]==="-")Z++,this.negative=1;if(Z<U.length){if(X===16)this._parseHex(U,Z,J);else if(this._parseBase(U,X,Z),J==="le")this._initArray(this.toArray(),X,J)}},A.prototype._initNumber=function(U,X,J){if(U<0)this.negative=1,U=-U;if(U<67108864)this.words=[U&67108863],this.length=1;else if(U<4503599627370496)this.words=[U&67108863,U/67108864&67108863],this.length=2;else C(U<9007199254740992),this.words=[U&67108863,U/67108864&67108863,1],this.length=3;if(J!=="le")return;this._initArray(this.toArray(),X,J)},A.prototype._initArray=function(U,X,J){if(C(typeof U.length==="number"),U.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(U.length/3),this.words=Array(this.length);for(var Z=0;Z<this.length;Z++)this.words[Z]=0;var Y,I,K=0;if(J==="be"){for(Z=U.length-1,Y=0;Z>=0;Z-=3)if(I=U[Z]|U[Z-1]<<8|U[Z-2]<<16,this.words[Y]|=I<<K&67108863,this.words[Y+1]=I>>>26-K&67108863,K+=24,K>=26)K-=26,Y++}else if(J==="le"){for(Z=0,Y=0;Z<U.length;Z+=3)if(I=U[Z]|U[Z+1]<<8|U[Z+2]<<16,this.words[Y]|=I<<K&67108863,this.words[Y+1]=I>>>26-K&67108863,K+=24,K>=26)K-=26,Y++}return this.strip()};function M(U,X){var J=U.charCodeAt(X);if(J>=65&&J<=70)return J-55;else if(J>=97&&J<=102)return J-87;else return J-48&15}function S(U,X,J){var Z=M(U,J);if(J-1>=X)Z|=M(U,J-1)<<4;return Z}A.prototype._parseHex=function(U,X,J){this.length=Math.ceil((U.length-X)/6),this.words=Array(this.length);for(var Z=0;Z<this.length;Z++)this.words[Z]=0;var Y=0,I=0,K;if(J==="be")for(Z=U.length-1;Z>=X;Z-=2)if(K=S(U,X,Z)<<Y,this.words[I]|=K&67108863,Y>=18)Y-=18,I+=1,this.words[I]|=K>>>26;else Y+=8;else{var G=U.length-X;for(Z=G%2===0?X+1:X;Z<U.length;Z+=2)if(K=S(U,X,Z)<<Y,this.words[I]|=K&67108863,Y>=18)Y-=18,I+=1,this.words[I]|=K>>>26;else Y+=8}this.strip()};function R(U,X,J,Z){var Y=0,I=Math.min(U.length,J);for(var K=X;K<I;K++){var G=U.charCodeAt(K)-48;if(Y*=Z,G>=49)Y+=G-49+10;else if(G>=17)Y+=G-17+10;else Y+=G}return Y}A.prototype._parseBase=function(U,X,J){this.words=[0],this.length=1;for(var Z=0,Y=1;Y<=67108863;Y*=X)Z++;Z--,Y=Y/X|0;var I=U.length-J,K=I%Z,G=Math.min(I,I-K)+J,O=0;for(var E=J;E<G;E+=Z)if(O=R(U,E,E+Z,X),this.imuln(Y),this.words[0]+O<67108864)this.words[0]+=O;else this._iaddn(O);if(K!==0){var T=1;O=R(U,E,U.length,X);for(E=0;E<K;E++)T*=X;if(this.imuln(T),this.words[0]+O<67108864)this.words[0]+=O;else this._iaddn(O)}this.strip()},A.prototype.copy=function(U){U.words=Array(this.length);for(var X=0;X<this.length;X++)U.words[X]=this.words[X];U.length=this.length,U.negative=this.negative,U.red=this.red},A.prototype.clone=function(){var U=new A(null);return this.copy(U),U},A.prototype._expand=function(U){while(this.length<U)this.words[this.length++]=0;return this},A.prototype.strip=function(){while(this.length>1&&this.words[this.length-1]===0)this.length--;return this._normSign()},A.prototype._normSign=function(){if(this.length===1&&this.words[0]===0)this.negative=0;return this},A.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var L=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],H=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],q=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64000000,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,24300000,28629151,33554432,39135393,45435424,52521875,60466176];if(A.prototype.toString=function(U,X){U=U||10,X=X|0||1;var J;if(U===16||U==="hex"){J="";var Z=0,Y=0;for(var I=0;I<this.length;I++){var K=this.words[I],G=((K<<Z|Y)&16777215).toString(16);if(Y=K>>>24-Z&16777215,Z+=2,Z>=26)Z-=26,I--;if(Y!==0||I!==this.length-1)J=L[6-G.length]+G+J;else J=G+J}if(Y!==0)J=Y.toString(16)+J;while(J.length%X!==0)J="0"+J;if(this.negative!==0)J="-"+J;return J}if(U===(U|0)&&U>=2&&U<=36){var O=H[U],E=q[U];J="";var T=this.clone();T.negative=0;while(!T.isZero()){var D=T.modn(E).toString(U);if(T=T.idivn(E),!T.isZero())J=L[O-D.length]+D+J;else J=D+J}if(this.isZero())J="0"+J;while(J.length%X!==0)J="0"+J;if(this.negative!==0)J="-"+J;return J}C(!1,"Base should be between 2 and 36")},A.prototype.toNumber=function(){var U=this.words[0];if(this.length===2)U+=this.words[1]*67108864;else if(this.length===3&&this.words[2]===1)U+=4503599627370496+this.words[1]*67108864;else if(this.length>2)C(!1,"Number can only safely store up to 53 bits");return this.negative!==0?-U:U},A.prototype.toJSON=function(){return this.toString(16)},A.prototype.toBuffer=function(U,X){return C(typeof z<"u"),this.toArrayLike(z,U,X)},A.prototype.toArray=function(U,X){return this.toArrayLike(Array,U,X)},A.prototype.toArrayLike=function(U,X,J){var Z=this.byteLength(),Y=J||Math.max(1,Z);C(Z<=Y,"byte array longer than desired length"),C(Y>0,"Requested array length <= 0"),this.strip();var I=X==="le",K=new U(Y),G,O,E=this.clone();if(!I){for(O=0;O<Y-Z;O++)K[O]=0;for(O=0;!E.isZero();O++)G=E.andln(255),E.iushrn(8),K[Y-O-1]=G}else{for(O=0;!E.isZero();O++)G=E.andln(255),E.iushrn(8),K[O]=G;for(;O<Y;O++)K[O]=0}return K},Math.clz32)A.prototype._countBits=function(U){return 32-Math.clz32(U)};else A.prototype._countBits=function(U){var X=U,J=0;if(X>=4096)J+=13,X>>>=13;if(X>=64)J+=7,X>>>=7;if(X>=8)J+=4,X>>>=4;if(X>=2)J+=2,X>>>=2;return J+X};A.prototype._zeroBits=function(U){if(U===0)return 26;var X=U,J=0;if((X&8191)===0)J+=13,X>>>=13;if((X&127)===0)J+=7,X>>>=7;if((X&15)===0)J+=4,X>>>=4;if((X&3)===0)J+=2,X>>>=2;if((X&1)===0)J++;return J},A.prototype.bitLength=function(){var U=this.words[this.length-1],X=this._countBits(U);return(this.length-1)*26+X};function P(U){var X=Array(U.bitLength());for(var J=0;J<X.length;J++){var Z=J/26|0,Y=J%26;X[J]=(U.words[Z]&1<<Y)>>>Y}return X}A.prototype.zeroBits=function(){if(this.isZero())return 0;var U=0;for(var X=0;X<this.length;X++){var J=this._zeroBits(this.words[X]);if(U+=J,J!==26)break}return U},A.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},A.prototype.toTwos=function(U){if(this.negative!==0)return this.abs().inotn(U).iaddn(1);return this.clone()},A.prototype.fromTwos=function(U){if(this.testn(U-1))return this.notn(U).iaddn(1).ineg();return this.clone()},A.prototype.isNeg=function(){return this.negative!==0},A.prototype.neg=function(){return this.clone().ineg()},A.prototype.ineg=function(){if(!this.isZero())this.negative^=1;return this},A.prototype.iuor=function(U){while(this.length<U.length)this.words[this.length++]=0;for(var X=0;X<U.length;X++)this.words[X]=this.words[X]|U.words[X];return this.strip()},A.prototype.ior=function(U){return C((this.negative|U.negative)===0),this.iuor(U)},A.prototype.or=function(U){if(this.length>U.length)return this.clone().ior(U);return U.clone().ior(this)},A.prototype.uor=function(U){if(this.length>U.length)return this.clone().iuor(U);return U.clone().iuor(this)},A.prototype.iuand=function(U){var X;if(this.length>U.length)X=U;else X=this;for(var J=0;J<X.length;J++)this.words[J]=this.words[J]&U.words[J];return this.length=X.length,this.strip()},A.prototype.iand=function(U){return C((this.negative|U.negative)===0),this.iuand(U)},A.prototype.and=function(U){if(this.length>U.length)return this.clone().iand(U);return U.clone().iand(this)},A.prototype.uand=function(U){if(this.length>U.length)return this.clone().iuand(U);return U.clone().iuand(this)},A.prototype.iuxor=function(U){var X,J;if(this.length>U.length)X=this,J=U;else X=U,J=this;for(var Z=0;Z<J.length;Z++)this.words[Z]=X.words[Z]^J.words[Z];if(this!==X)for(;Z<X.length;Z++)this.words[Z]=X.words[Z];return this.length=X.length,this.strip()},A.prototype.ixor=function(U){return C((this.negative|U.negative)===0),this.iuxor(U)},A.prototype.xor=function(U){if(this.length>U.length)return this.clone().ixor(U);return U.clone().ixor(this)},A.prototype.uxor=function(U){if(this.length>U.length)return this.clone().iuxor(U);return U.clone().iuxor(this)},A.prototype.inotn=function(U){C(typeof U==="number"&&U>=0);var X=Math.ceil(U/26)|0,J=U%26;if(this._expand(X),J>0)X--;for(var Z=0;Z<X;Z++)this.words[Z]=~this.words[Z]&67108863;if(J>0)this.words[Z]=~this.words[Z]&67108863>>26-J;return this.strip()},A.prototype.notn=function(U){return this.clone().inotn(U)},A.prototype.setn=function(U,X){C(typeof U==="number"&&U>=0);var J=U/26|0,Z=U%26;if(this._expand(J+1),X)this.words[J]=this.words[J]|1<<Z;else this.words[J]=this.words[J]&~(1<<Z);return this.strip()},A.prototype.iadd=function(U){var X;if(this.negative!==0&&U.negative===0)return this.negative=0,X=this.isub(U),this.negative^=1,this._normSign();else if(this.negative===0&&U.negative!==0)return U.negative=0,X=this.isub(U),U.negative=1,X._normSign();var J,Z;if(this.length>U.length)J=this,Z=U;else J=U,Z=this;var Y=0;for(var I=0;I<Z.length;I++)X=(J.words[I]|0)+(Z.words[I]|0)+Y,this.words[I]=X&67108863,Y=X>>>26;for(;Y!==0&&I<J.length;I++)X=(J.words[I]|0)+Y,this.words[I]=X&67108863,Y=X>>>26;if(this.length=J.length,Y!==0)this.words[this.length]=Y,this.length++;else if(J!==this)for(;I<J.length;I++)this.words[I]=J.words[I];return this},A.prototype.add=function(U){var X;if(U.negative!==0&&this.negative===0)return U.negative=0,X=this.sub(U),U.negative^=1,X;else if(U.negative===0&&this.negative!==0)return this.negative=0,X=U.sub(this),this.negative=1,X;if(this.length>U.length)return this.clone().iadd(U);return U.clone().iadd(this)},A.prototype.isub=function(U){if(U.negative!==0){U.negative=0;var X=this.iadd(U);return U.negative=1,X._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(U),this.negative=1,this._normSign();var J=this.cmp(U);if(J===0)return this.negative=0,this.length=1,this.words[0]=0,this;var Z,Y;if(J>0)Z=this,Y=U;else Z=U,Y=this;var I=0;for(var K=0;K<Y.length;K++)X=(Z.words[K]|0)-(Y.words[K]|0)+I,I=X>>26,this.words[K]=X&67108863;for(;I!==0&&K<Z.length;K++)X=(Z.words[K]|0)+I,I=X>>26,this.words[K]=X&67108863;if(I===0&&K<Z.length&&Z!==this)for(;K<Z.length;K++)this.words[K]=Z.words[K];if(this.length=Math.max(this.length,K),Z!==this)this.negative=1;return this.strip()},A.prototype.sub=function(U){return this.clone().isub(U)};function _(U,X,J){J.negative=X.negative^U.negative;var Z=U.length+X.length|0;J.length=Z,Z=Z-1|0;var Y=U.words[0]|0,I=X.words[0]|0,K=Y*I,G=K&67108863,O=K/67108864|0;J.words[0]=G;for(var E=1;E<Z;E++){var T=O>>>26,D=O&67108863,v=Math.min(E,X.length-1);for(var g=Math.max(0,E-U.length+1);g<=v;g++){var p=E-g|0;Y=U.words[p]|0,I=X.words[g]|0,K=Y*I+D,T+=K/67108864|0,D=K&67108863}J.words[E]=D|0,O=T|0}if(O!==0)J.words[E]=O|0;else J.length--;return J.strip()}var k=function(U,X,J){var Z=U.words,Y=X.words,I=J.words,K=0,G,O,E,T=Z[0]|0,D=T&8191,v=T>>>13,g=Z[1]|0,p=g&8191,n=g>>>13,V0=Z[2]|0,r=V0&8191,l=V0>>>13,X0=Z[3]|0,m=X0&8191,i=X0>>>13,g0=Z[4]|0,y=g0&8191,h=g0>>>13,Q0=Z[5]|0,t=Q0&8191,e=Q0>>>13,F0=Z[6]|0,c=F0&8191,o=F0>>>13,N0=Z[7]|0,s=N0&8191,Z0=N0>>>13,w0=Z[8]|0,C0=w0&8191,K0=w0>>>13,s0=Z[9]|0,E0=s0&8191,L0=s0>>>13,e0=Y[0]|0,D0=e0&8191,H0=e0>>>13,FU=Y[1]|0,R0=FU&8191,k0=FU>>>13,RU=Y[2]|0,_0=RU&8191,T0=RU>>>13,DU=Y[3]|0,v0=DU&8191,z0=DU>>>13,CU=Y[4]|0,j0=CU&8191,B0=CU>>>13,KU=Y[5]|0,M0=KU&8191,N=KU>>>13,b=Y[6]|0,a=b&8191,U0=b>>>13,f0=Y[7]|0,I0=f0&8191,W0=f0>>>13,t0=Y[8]|0,q0=t0&8191,x0=t0>>>13,SU=Y[9]|0,P0=SU&8191,S0=SU>>>13;J.negative=U.negative^X.negative,J.length=19,G=Math.imul(D,D0),O=Math.imul(D,H0),O=O+Math.imul(v,D0)|0,E=Math.imul(v,H0);var r0=(K+G|0)+((O&8191)<<13)|0;K=(E+(O>>>13)|0)+(r0>>>26)|0,r0&=67108863,G=Math.imul(p,D0),O=Math.imul(p,H0),O=O+Math.imul(n,D0)|0,E=Math.imul(n,H0),G=G+Math.imul(D,R0)|0,O=O+Math.imul(D,k0)|0,O=O+Math.imul(v,R0)|0,E=E+Math.imul(v,k0)|0;var c0=(K+G|0)+((O&8191)<<13)|0;K=(E+(O>>>13)|0)+(c0>>>26)|0,c0&=67108863,G=Math.imul(r,D0),O=Math.imul(r,H0),O=O+Math.imul(l,D0)|0,E=Math.imul(l,H0),G=G+Math.imul(p,R0)|0,O=O+Math.imul(p,k0)|0,O=O+Math.imul(n,R0)|0,E=E+Math.imul(n,k0)|0,G=G+Math.imul(D,_0)|0,O=O+Math.imul(D,T0)|0,O=O+Math.imul(v,_0)|0,E=E+Math.imul(v,T0)|0;var y0=(K+G|0)+((O&8191)<<13)|0;K=(E+(O>>>13)|0)+(y0>>>26)|0,y0&=67108863,G=Math.imul(m,D0),O=Math.imul(m,H0),O=O+Math.imul(i,D0)|0,E=Math.imul(i,H0),G=G+Math.imul(r,R0)|0,O=O+Math.imul(r,k0)|0,O=O+Math.imul(l,R0)|0,E=E+Math.imul(l,k0)|0,G=G+Math.imul(p,_0)|0,O=O+Math.imul(p,T0)|0,O=O+Math.imul(n,_0)|0,E=E+Math.imul(n,T0)|0,G=G+Math.imul(D,v0)|0,O=O+Math.imul(D,z0)|0,O=O+Math.imul(v,v0)|0,E=E+Math.imul(v,z0)|0;var d0=(K+G|0)+((O&8191)<<13)|0;K=(E+(O>>>13)|0)+(d0>>>26)|0,d0&=67108863,G=Math.imul(y,D0),O=Math.imul(y,H0),O=O+Math.imul(h,D0)|0,E=Math.imul(h,H0),G=G+Math.imul(m,R0)|0,O=O+Math.imul(m,k0)|0,O=O+Math.imul(i,R0)|0,E=E+Math.imul(i,k0)|0,G=G+Math.imul(r,_0)|0,O=O+Math.imul(r,T0)|0,O=O+Math.imul(l,_0)|0,E=E+Math.imul(l,T0)|0,G=G+Math.imul(p,v0)|0,O=O+Math.imul(p,z0)|0,O=O+Math.imul(n,v0)|0,E=E+Math.imul(n,z0)|0,G=G+Math.imul(D,j0)|0,O=O+Math.imul(D,B0)|0,O=O+Math.imul(v,j0)|0,E=E+Math.imul(v,B0)|0;var l0=(K+G|0)+((O&8191)<<13)|0;K=(E+(O>>>13)|0)+(l0>>>26)|0,l0&=67108863,G=Math.imul(t,D0),O=Math.imul(t,H0),O=O+Math.imul(e,D0)|0,E=Math.imul(e,H0),G=G+Math.imul(y,R0)|0,O=O+Math.imul(y,k0)|0,O=O+Math.imul(h,R0)|0,E=E+Math.imul(h,k0)|0,G=G+Math.imul(m,_0)|0,O=O+Math.imul(m,T0)|0,O=O+Math.imul(i,_0)|0,E=E+Math.imul(i,T0)|0,G=G+Math.imul(r,v0)|0,O=O+Math.imul(r,z0)|0,O=O+Math.imul(l,v0)|0,E=E+Math.imul(l,z0)|0,G=G+Math.imul(p,j0)|0,O=O+Math.imul(p,B0)|0,O=O+Math.imul(n,j0)|0,E=E+Math.imul(n,B0)|0,G=G+Math.imul(D,M0)|0,O=O+Math.imul(D,N)|0,O=O+Math.imul(v,M0)|0,E=E+Math.imul(v,N)|0;var i0=(K+G|0)+((O&8191)<<13)|0;K=(E+(O>>>13)|0)+(i0>>>26)|0,i0&=67108863,G=Math.imul(c,D0),O=Math.imul(c,H0),O=O+Math.imul(o,D0)|0,E=Math.imul(o,H0),G=G+Math.imul(t,R0)|0,O=O+Math.imul(t,k0)|0,O=O+Math.imul(e,R0)|0,E=E+Math.imul(e,k0)|0,G=G+Math.imul(y,_0)|0,O=O+Math.imul(y,T0)|0,O=O+Math.imul(h,_0)|0,E=E+Math.imul(h,T0)|0,G=G+Math.imul(m,v0)|0,O=O+Math.imul(m,z0)|0,O=O+Math.imul(i,v0)|0,E=E+Math.imul(i,z0)|0,G=G+Math.imul(r,j0)|0,O=O+Math.imul(r,B0)|0,O=O+Math.imul(l,j0)|0,E=E+Math.imul(l,B0)|0,G=G+Math.imul(p,M0)|0,O=O+Math.imul(p,N)|0,O=O+Math.imul(n,M0)|0,E=E+Math.imul(n,N)|0,G=G+Math.imul(D,a)|0,O=O+Math.imul(D,U0)|0,O=O+Math.imul(v,a)|0,E=E+Math.imul(v,U0)|0;var UU=(K+G|0)+((O&8191)<<13)|0;K=(E+(O>>>13)|0)+(UU>>>26)|0,UU&=67108863,G=Math.imul(s,D0),O=Math.imul(s,H0),O=O+Math.imul(Z0,D0)|0,E=Math.imul(Z0,H0),G=G+Math.imul(c,R0)|0,O=O+Math.imul(c,k0)|0,O=O+Math.imul(o,R0)|0,E=E+Math.imul(o,k0)|0,G=G+Math.imul(t,_0)|0,O=O+Math.imul(t,T0)|0,O=O+Math.imul(e,_0)|0,E=E+Math.imul(e,T0)|0,G=G+Math.imul(y,v0)|0,O=O+Math.imul(y,z0)|0,O=O+Math.imul(h,v0)|0,E=E+Math.imul(h,z0)|0,G=G+Math.imul(m,j0)|0,O=O+Math.imul(m,B0)|0,O=O+Math.imul(i,j0)|0,E=E+Math.imul(i,B0)|0,G=G+Math.imul(r,M0)|0,O=O+Math.imul(r,N)|0,O=O+Math.imul(l,M0)|0,E=E+Math.imul(l,N)|0,G=G+Math.imul(p,a)|0,O=O+Math.imul(p,U0)|0,O=O+Math.imul(n,a)|0,E=E+Math.imul(n,U0)|0,G=G+Math.imul(D,I0)|0,O=O+Math.imul(D,W0)|0,O=O+Math.imul(v,I0)|0,E=E+Math.imul(v,W0)|0;var OU=(K+G|0)+((O&8191)<<13)|0;K=(E+(O>>>13)|0)+(OU>>>26)|0,OU&=67108863,G=Math.imul(C0,D0),O=Math.imul(C0,H0),O=O+Math.imul(K0,D0)|0,E=Math.imul(K0,H0),G=G+Math.imul(s,R0)|0,O=O+Math.imul(s,k0)|0,O=O+Math.imul(Z0,R0)|0,E=E+Math.imul(Z0,k0)|0,G=G+Math.imul(c,_0)|0,O=O+Math.imul(c,T0)|0,O=O+Math.imul(o,_0)|0,E=E+Math.imul(o,T0)|0,G=G+Math.imul(t,v0)|0,O=O+Math.imul(t,z0)|0,O=O+Math.imul(e,v0)|0,E=E+Math.imul(e,z0)|0,G=G+Math.imul(y,j0)|0,O=O+Math.imul(y,B0)|0,O=O+Math.imul(h,j0)|0,E=E+Math.imul(h,B0)|0,G=G+Math.imul(m,M0)|0,O=O+Math.imul(m,N)|0,O=O+Math.imul(i,M0)|0,E=E+Math.imul(i,N)|0,G=G+Math.imul(r,a)|0,O=O+Math.imul(r,U0)|0,O=O+Math.imul(l,a)|0,E=E+Math.imul(l,U0)|0,G=G+Math.imul(p,I0)|0,O=O+Math.imul(p,W0)|0,O=O+Math.imul(n,I0)|0,E=E+Math.imul(n,W0)|0,G=G+Math.imul(D,q0)|0,O=O+Math.imul(D,x0)|0,O=O+Math.imul(v,q0)|0,E=E+Math.imul(v,x0)|0;var ZU=(K+G|0)+((O&8191)<<13)|0;K=(E+(O>>>13)|0)+(ZU>>>26)|0,ZU&=67108863,G=Math.imul(E0,D0),O=Math.imul(E0,H0),O=O+Math.imul(L0,D0)|0,E=Math.imul(L0,H0),G=G+Math.imul(C0,R0)|0,O=O+Math.imul(C0,k0)|0,O=O+Math.imul(K0,R0)|0,E=E+Math.imul(K0,k0)|0,G=G+Math.imul(s,_0)|0,O=O+Math.imul(s,T0)|0,O=O+Math.imul(Z0,_0)|0,E=E+Math.imul(Z0,T0)|0,G=G+Math.imul(c,v0)|0,O=O+Math.imul(c,z0)|0,O=O+Math.imul(o,v0)|0,E=E+Math.imul(o,z0)|0,G=G+Math.imul(t,j0)|0,O=O+Math.imul(t,B0)|0,O=O+Math.imul(e,j0)|0,E=E+Math.imul(e,B0)|0,G=G+Math.imul(y,M0)|0,O=O+Math.imul(y,N)|0,O=O+Math.imul(h,M0)|0,E=E+Math.imul(h,N)|0,G=G+Math.imul(m,a)|0,O=O+Math.imul(m,U0)|0,O=O+Math.imul(i,a)|0,E=E+Math.imul(i,U0)|0,G=G+Math.imul(r,I0)|0,O=O+Math.imul(r,W0)|0,O=O+Math.imul(l,I0)|0,E=E+Math.imul(l,W0)|0,G=G+Math.imul(p,q0)|0,O=O+Math.imul(p,x0)|0,O=O+Math.imul(n,q0)|0,E=E+Math.imul(n,x0)|0,G=G+Math.imul(D,P0)|0,O=O+Math.imul(D,S0)|0,O=O+Math.imul(v,P0)|0,E=E+Math.imul(v,S0)|0;var XU=(K+G|0)+((O&8191)<<13)|0;K=(E+(O>>>13)|0)+(XU>>>26)|0,XU&=67108863,G=Math.imul(E0,R0),O=Math.imul(E0,k0),O=O+Math.imul(L0,R0)|0,E=Math.imul(L0,k0),G=G+Math.imul(C0,_0)|0,O=O+Math.imul(C0,T0)|0,O=O+Math.imul(K0,_0)|0,E=E+Math.imul(K0,T0)|0,G=G+Math.imul(s,v0)|0,O=O+Math.imul(s,z0)|0,O=O+Math.imul(Z0,v0)|0,E=E+Math.imul(Z0,z0)|0,G=G+Math.imul(c,j0)|0,O=O+Math.imul(c,B0)|0,O=O+Math.imul(o,j0)|0,E=E+Math.imul(o,B0)|0,G=G+Math.imul(t,M0)|0,O=O+Math.imul(t,N)|0,O=O+Math.imul(e,M0)|0,E=E+Math.imul(e,N)|0,G=G+Math.imul(y,a)|0,O=O+Math.imul(y,U0)|0,O=O+Math.imul(h,a)|0,E=E+Math.imul(h,U0)|0,G=G+Math.imul(m,I0)|0,O=O+Math.imul(m,W0)|0,O=O+Math.imul(i,I0)|0,E=E+Math.imul(i,W0)|0,G=G+Math.imul(r,q0)|0,O=O+Math.imul(r,x0)|0,O=O+Math.imul(l,q0)|0,E=E+Math.imul(l,x0)|0,G=G+Math.imul(p,P0)|0,O=O+Math.imul(p,S0)|0,O=O+Math.imul(n,P0)|0,E=E+Math.imul(n,S0)|0;var QU=(K+G|0)+((O&8191)<<13)|0;K=(E+(O>>>13)|0)+(QU>>>26)|0,QU&=67108863,G=Math.imul(E0,_0),O=Math.imul(E0,T0),O=O+Math.imul(L0,_0)|0,E=Math.imul(L0,T0),G=G+Math.imul(C0,v0)|0,O=O+Math.imul(C0,z0)|0,O=O+Math.imul(K0,v0)|0,E=E+Math.imul(K0,z0)|0,G=G+Math.imul(s,j0)|0,O=O+Math.imul(s,B0)|0,O=O+Math.imul(Z0,j0)|0,E=E+Math.imul(Z0,B0)|0,G=G+Math.imul(c,M0)|0,O=O+Math.imul(c,N)|0,O=O+Math.imul(o,M0)|0,E=E+Math.imul(o,N)|0,G=G+Math.imul(t,a)|0,O=O+Math.imul(t,U0)|0,O=O+Math.imul(e,a)|0,E=E+Math.imul(e,U0)|0,G=G+Math.imul(y,I0)|0,O=O+Math.imul(y,W0)|0,O=O+Math.imul(h,I0)|0,E=E+Math.imul(h,W0)|0,G=G+Math.imul(m,q0)|0,O=O+Math.imul(m,x0)|0,O=O+Math.imul(i,q0)|0,E=E+Math.imul(i,x0)|0,G=G+Math.imul(r,P0)|0,O=O+Math.imul(r,S0)|0,O=O+Math.imul(l,P0)|0,E=E+Math.imul(l,S0)|0;var YU=(K+G|0)+((O&8191)<<13)|0;K=(E+(O>>>13)|0)+(YU>>>26)|0,YU&=67108863,G=Math.imul(E0,v0),O=Math.imul(E0,z0),O=O+Math.imul(L0,v0)|0,E=Math.imul(L0,z0),G=G+Math.imul(C0,j0)|0,O=O+Math.imul(C0,B0)|0,O=O+Math.imul(K0,j0)|0,E=E+Math.imul(K0,B0)|0,G=G+Math.imul(s,M0)|0,O=O+Math.imul(s,N)|0,O=O+Math.imul(Z0,M0)|0,E=E+Math.imul(Z0,N)|0,G=G+Math.imul(c,a)|0,O=O+Math.imul(c,U0)|0,O=O+Math.imul(o,a)|0,E=E+Math.imul(o,U0)|0,G=G+Math.imul(t,I0)|0,O=O+Math.imul(t,W0)|0,O=O+Math.imul(e,I0)|0,E=E+Math.imul(e,W0)|0,G=G+Math.imul(y,q0)|0,O=O+Math.imul(y,x0)|0,O=O+Math.imul(h,q0)|0,E=E+Math.imul(h,x0)|0,G=G+Math.imul(m,P0)|0,O=O+Math.imul(m,S0)|0,O=O+Math.imul(i,P0)|0,E=E+Math.imul(i,S0)|0;var AU=(K+G|0)+((O&8191)<<13)|0;K=(E+(O>>>13)|0)+(AU>>>26)|0,AU&=67108863,G=Math.imul(E0,j0),O=Math.imul(E0,B0),O=O+Math.imul(L0,j0)|0,E=Math.imul(L0,B0),G=G+Math.imul(C0,M0)|0,O=O+Math.imul(C0,N)|0,O=O+Math.imul(K0,M0)|0,E=E+Math.imul(K0,N)|0,G=G+Math.imul(s,a)|0,O=O+Math.imul(s,U0)|0,O=O+Math.imul(Z0,a)|0,E=E+Math.imul(Z0,U0)|0,G=G+Math.imul(c,I0)|0,O=O+Math.imul(c,W0)|0,O=O+Math.imul(o,I0)|0,E=E+Math.imul(o,W0)|0,G=G+Math.imul(t,q0)|0,O=O+Math.imul(t,x0)|0,O=O+Math.imul(e,q0)|0,E=E+Math.imul(e,x0)|0,G=G+Math.imul(y,P0)|0,O=O+Math.imul(y,S0)|0,O=O+Math.imul(h,P0)|0,E=E+Math.imul(h,S0)|0;var $U=(K+G|0)+((O&8191)<<13)|0;K=(E+(O>>>13)|0)+($U>>>26)|0,$U&=67108863,G=Math.imul(E0,M0),O=Math.imul(E0,N),O=O+Math.imul(L0,M0)|0,E=Math.imul(L0,N),G=G+Math.imul(C0,a)|0,O=O+Math.imul(C0,U0)|0,O=O+Math.imul(K0,a)|0,E=E+Math.imul(K0,U0)|0,G=G+Math.imul(s,I0)|0,O=O+Math.imul(s,W0)|0,O=O+Math.imul(Z0,I0)|0,E=E+Math.imul(Z0,W0)|0,G=G+Math.imul(c,q0)|0,O=O+Math.imul(c,x0)|0,O=O+Math.imul(o,q0)|0,E=E+Math.imul(o,x0)|0,G=G+Math.imul(t,P0)|0,O=O+Math.imul(t,S0)|0,O=O+Math.imul(e,P0)|0,E=E+Math.imul(e,S0)|0;var JU=(K+G|0)+((O&8191)<<13)|0;K=(E+(O>>>13)|0)+(JU>>>26)|0,JU&=67108863,G=Math.imul(E0,a),O=Math.imul(E0,U0),O=O+Math.imul(L0,a)|0,E=Math.imul(L0,U0),G=G+Math.imul(C0,I0)|0,O=O+Math.imul(C0,W0)|0,O=O+Math.imul(K0,I0)|0,E=E+Math.imul(K0,W0)|0,G=G+Math.imul(s,q0)|0,O=O+Math.imul(s,x0)|0,O=O+Math.imul(Z0,q0)|0,E=E+Math.imul(Z0,x0)|0,G=G+Math.imul(c,P0)|0,O=O+Math.imul(c,S0)|0,O=O+Math.imul(o,P0)|0,E=E+Math.imul(o,S0)|0;var GU=(K+G|0)+((O&8191)<<13)|0;K=(E+(O>>>13)|0)+(GU>>>26)|0,GU&=67108863,G=Math.imul(E0,I0),O=Math.imul(E0,W0),O=O+Math.imul(L0,I0)|0,E=Math.imul(L0,W0),G=G+Math.imul(C0,q0)|0,O=O+Math.imul(C0,x0)|0,O=O+Math.imul(K0,q0)|0,E=E+Math.imul(K0,x0)|0,G=G+Math.imul(s,P0)|0,O=O+Math.imul(s,S0)|0,O=O+Math.imul(Z0,P0)|0,E=E+Math.imul(Z0,S0)|0;var VU=(K+G|0)+((O&8191)<<13)|0;K=(E+(O>>>13)|0)+(VU>>>26)|0,VU&=67108863,G=Math.imul(E0,q0),O=Math.imul(E0,x0),O=O+Math.imul(L0,q0)|0,E=Math.imul(L0,x0),G=G+Math.imul(C0,P0)|0,O=O+Math.imul(C0,S0)|0,O=O+Math.imul(K0,P0)|0,E=E+Math.imul(K0,S0)|0;var EU=(K+G|0)+((O&8191)<<13)|0;K=(E+(O>>>13)|0)+(EU>>>26)|0,EU&=67108863,G=Math.imul(E0,P0),O=Math.imul(E0,S0),O=O+Math.imul(L0,P0)|0,E=Math.imul(L0,S0);var IU=(K+G|0)+((O&8191)<<13)|0;if(K=(E+(O>>>13)|0)+(IU>>>26)|0,IU&=67108863,I[0]=r0,I[1]=c0,I[2]=y0,I[3]=d0,I[4]=l0,I[5]=i0,I[6]=UU,I[7]=OU,I[8]=ZU,I[9]=XU,I[10]=QU,I[11]=YU,I[12]=AU,I[13]=$U,I[14]=JU,I[15]=GU,I[16]=VU,I[17]=EU,I[18]=IU,K!==0)I[19]=K,J.length++;return J};if(!Math.imul)k=_;function B(U,X,J){J.negative=X.negative^U.negative,J.length=U.length+X.length;var Z=0,Y=0;for(var I=0;I<J.length-1;I++){var K=Y;Y=0;var G=Z&67108863,O=Math.min(I,X.length-1);for(var E=Math.max(0,I-U.length+1);E<=O;E++){var T=I-E,D=U.words[T]|0,v=X.words[E]|0,g=D*v,p=g&67108863;K=K+(g/67108864|0)|0,p=p+G|0,G=p&67108863,K=K+(p>>>26)|0,Y+=K>>>26,K&=67108863}J.words[I]=G,Z=K,K=Y}if(Z!==0)J.words[I]=Z;else J.length--;return J.strip()}function j(U,X,J){var Z=new x;return Z.mulp(U,X,J)}A.prototype.mulTo=function(U,X){var J,Z=this.length+U.length;if(this.length===10&&U.length===10)J=k(this,U,X);else if(Z<63)J=_(this,U,X);else if(Z<1024)J=B(this,U,X);else J=j(this,U,X);return J};function x(U,X){this.x=U,this.y=X}x.prototype.makeRBT=function(U){var X=Array(U),J=A.prototype._countBits(U)-1;for(var Z=0;Z<U;Z++)X[Z]=this.revBin(Z,J,U);return X},x.prototype.revBin=function(U,X,J){if(U===0||U===J-1)return U;var Z=0;for(var Y=0;Y<X;Y++)Z|=(U&1)<<X-Y-1,U>>=1;return Z},x.prototype.permute=function(U,X,J,Z,Y,I){for(var K=0;K<I;K++)Z[K]=X[U[K]],Y[K]=J[U[K]]},x.prototype.transform=function(U,X,J,Z,Y,I){this.permute(I,U,X,J,Z,Y);for(var K=1;K<Y;K<<=1){var G=K<<1,O=Math.cos(2*Math.PI/G),E=Math.sin(2*Math.PI/G);for(var T=0;T<Y;T+=G){var D=O,v=E;for(var g=0;g<K;g++){var p=J[T+g],n=Z[T+g],V0=J[T+g+K],r=Z[T+g+K],l=D*V0-v*r;if(r=D*r+v*V0,V0=l,J[T+g]=p+V0,Z[T+g]=n+r,J[T+g+K]=p-V0,Z[T+g+K]=n-r,g!==G)l=O*D-E*v,v=O*v+E*D,D=l}}}},x.prototype.guessLen13b=function(U,X){var J=Math.max(X,U)|1,Z=J&1,Y=0;for(J=J/2|0;J;J=J>>>1)Y++;return 1<<Y+1+Z},x.prototype.conjugate=function(U,X,J){if(J<=1)return;for(var Z=0;Z<J/2;Z++){var Y=U[Z];U[Z]=U[J-Z-1],U[J-Z-1]=Y,Y=X[Z],X[Z]=-X[J-Z-1],X[J-Z-1]=-Y}},x.prototype.normalize13b=function(U,X){var J=0;for(var Z=0;Z<X/2;Z++){var Y=Math.round(U[2*Z+1]/X)*8192+Math.round(U[2*Z]/X)+J;if(U[Z]=Y&67108863,Y<67108864)J=0;else J=Y/67108864|0}return U},x.prototype.convert13b=function(U,X,J,Z){var Y=0;for(var I=0;I<X;I++)Y=Y+(U[I]|0),J[2*I]=Y&8191,Y=Y>>>13,J[2*I+1]=Y&8191,Y=Y>>>13;for(I=2*X;I<Z;++I)J[I]=0;C(Y===0),C((Y&-8192)===0)},x.prototype.stub=function(U){var X=Array(U);for(var J=0;J<U;J++)X[J]=0;return X},x.prototype.mulp=function(U,X,J){var Z=2*this.guessLen13b(U.length,X.length),Y=this.makeRBT(Z),I=this.stub(Z),K=Array(Z),G=Array(Z),O=Array(Z),E=Array(Z),T=Array(Z),D=Array(Z),v=J.words;v.length=Z,this.convert13b(U.words,U.length,K,Z),this.convert13b(X.words,X.length,E,Z),this.transform(K,I,G,O,Z,Y),this.transform(E,I,T,D,Z,Y);for(var g=0;g<Z;g++){var p=G[g]*T[g]-O[g]*D[g];O[g]=G[g]*D[g]+O[g]*T[g],G[g]=p}return this.conjugate(G,O,Z),this.transform(G,O,v,I,Z,Y),this.conjugate(v,I,Z),this.normalize13b(v,Z),J.negative=U.negative^X.negative,J.length=U.length+X.length,J.strip()},A.prototype.mul=function(U){var X=new A(null);return X.words=Array(this.length+U.length),this.mulTo(U,X)},A.prototype.mulf=function(U){var X=new A(null);return X.words=Array(this.length+U.length),j(this,U,X)},A.prototype.imul=function(U){return this.clone().mulTo(U,this)},A.prototype.imuln=function(U){C(typeof U==="number"),C(U<67108864);var X=0;for(var J=0;J<this.length;J++){var Z=(this.words[J]|0)*U,Y=(Z&67108863)+(X&67108863);X>>=26,X+=Z/67108864|0,X+=Y>>>26,this.words[J]=Y&67108863}if(X!==0)this.words[J]=X,this.length++;return this.length=U===0?1:this.length,this},A.prototype.muln=function(U){return this.clone().imuln(U)},A.prototype.sqr=function(){return this.mul(this)},A.prototype.isqr=function(){return this.imul(this.clone())},A.prototype.pow=function(U){var X=P(U);if(X.length===0)return new A(1);var J=this;for(var Z=0;Z<X.length;Z++,J=J.sqr())if(X[Z]!==0)break;if(++Z<X.length)for(var Y=J.sqr();Z<X.length;Z++,Y=Y.sqr()){if(X[Z]===0)continue;J=J.mul(Y)}return J},A.prototype.iushln=function(U){C(typeof U==="number"&&U>=0);var X=U%26,J=(U-X)/26,Z=67108863>>>26-X<<26-X,Y;if(X!==0){var I=0;for(Y=0;Y<this.length;Y++){var K=this.words[Y]&Z,G=(this.words[Y]|0)-K<<X;this.words[Y]=G|I,I=K>>>26-X}if(I)this.words[Y]=I,this.length++}if(J!==0){for(Y=this.length-1;Y>=0;Y--)this.words[Y+J]=this.words[Y];for(Y=0;Y<J;Y++)this.words[Y]=0;this.length+=J}return this.strip()},A.prototype.ishln=function(U){return C(this.negative===0),this.iushln(U)},A.prototype.iushrn=function(U,X,J){C(typeof U==="number"&&U>=0);var Z;if(X)Z=(X-X%26)/26;else Z=0;var Y=U%26,I=Math.min((U-Y)/26,this.length),K=67108863^67108863>>>Y<<Y,G=J;if(Z-=I,Z=Math.max(0,Z),G){for(var O=0;O<I;O++)G.words[O]=this.words[O];G.length=I}if(I===0);else if(this.length>I){this.length-=I;for(O=0;O<this.length;O++)this.words[O]=this.words[O+I]}else this.words[0]=0,this.length=1;var E=0;for(O=this.length-1;O>=0&&(E!==0||O>=Z);O--){var T=this.words[O]|0;this.words[O]=E<<26-Y|T>>>Y,E=T&K}if(G&&E!==0)G.words[G.length++]=E;if(this.length===0)this.words[0]=0,this.length=1;return this.strip()},A.prototype.ishrn=function(U,X,J){return C(this.negative===0),this.iushrn(U,X,J)},A.prototype.shln=function(U){return this.clone().ishln(U)},A.prototype.ushln=function(U){return this.clone().iushln(U)},A.prototype.shrn=function(U){return this.clone().ishrn(U)},A.prototype.ushrn=function(U){return this.clone().iushrn(U)},A.prototype.testn=function(U){C(typeof U==="number"&&U>=0);var X=U%26,J=(U-X)/26,Z=1<<X;if(this.length<=J)return!1;var Y=this.words[J];return!!(Y&Z)},A.prototype.imaskn=function(U){C(typeof U==="number"&&U>=0);var X=U%26,J=(U-X)/26;if(C(this.negative===0,"imaskn works only with positive numbers"),this.length<=J)return this;if(X!==0)J++;if(this.length=Math.min(J,this.length),X!==0){var Z=67108863^67108863>>>X<<X;this.words[this.length-1]&=Z}return this.strip()},A.prototype.maskn=function(U){return this.clone().imaskn(U)},A.prototype.iaddn=function(U){if(C(typeof U==="number"),C(U<67108864),U<0)return this.isubn(-U);if(this.negative!==0){if(this.length===1&&(this.words[0]|0)<U)return this.words[0]=U-(this.words[0]|0),this.negative=0,this;return this.negative=0,this.isubn(U),this.negative=1,this}return this._iaddn(U)},A.prototype._iaddn=function(U){this.words[0]+=U;for(var X=0;X<this.length&&this.words[X]>=67108864;X++)if(this.words[X]-=67108864,X===this.length-1)this.words[X+1]=1;else this.words[X+1]++;return this.length=Math.max(this.length,X+1),this},A.prototype.isubn=function(U){if(C(typeof U==="number"),C(U<67108864),U<0)return this.iaddn(-U);if(this.negative!==0)return this.negative=0,this.iaddn(U),this.negative=1,this;if(this.words[0]-=U,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var X=0;X<this.length&&this.words[X]<0;X++)this.words[X]+=67108864,this.words[X+1]-=1;return this.strip()},A.prototype.addn=function(U){return this.clone().iaddn(U)},A.prototype.subn=function(U){return this.clone().isubn(U)},A.prototype.iabs=function(){return this.negative=0,this},A.prototype.abs=function(){return this.clone().iabs()},A.prototype._ishlnsubmul=function(U,X,J){var Z=U.length+J,Y;this._expand(Z);var I,K=0;for(Y=0;Y<U.length;Y++){I=(this.words[Y+J]|0)+K;var G=(U.words[Y]|0)*X;I-=G&67108863,K=(I>>26)-(G/67108864|0),this.words[Y+J]=I&67108863}for(;Y<this.length-J;Y++)I=(this.words[Y+J]|0)+K,K=I>>26,this.words[Y+J]=I&67108863;if(K===0)return this.strip();C(K===-1),K=0;for(Y=0;Y<this.length;Y++)I=-(this.words[Y]|0)+K,K=I>>26,this.words[Y]=I&67108863;return this.negative=1,this.strip()},A.prototype._wordDiv=function(U,X){var J=this.length-U.length,Z=this.clone(),Y=U,I=Y.words[Y.length-1]|0,K=this._countBits(I);if(J=26-K,J!==0)Y=Y.ushln(J),Z.iushln(J),I=Y.words[Y.length-1]|0;var G=Z.length-Y.length,O;if(X!=="mod"){O=new A(null),O.length=G+1,O.words=Array(O.length);for(var E=0;E<O.length;E++)O.words[E]=0}var T=Z.clone()._ishlnsubmul(Y,1,G);if(T.negative===0){if(Z=T,O)O.words[G]=1}for(var D=G-1;D>=0;D--){var v=(Z.words[Y.length+D]|0)*67108864+(Z.words[Y.length+D-1]|0);v=Math.min(v/I|0,67108863),Z._ishlnsubmul(Y,v,D);while(Z.negative!==0)if(v--,Z.negative=0,Z._ishlnsubmul(Y,1,D),!Z.isZero())Z.negative^=1;if(O)O.words[D]=v}if(O)O.strip();if(Z.strip(),X!=="div"&&J!==0)Z.iushrn(J);return{div:O||null,mod:Z}},A.prototype.divmod=function(U,X,J){if(C(!U.isZero()),this.isZero())return{div:new A(0),mod:new A(0)};var Z,Y,I;if(this.negative!==0&&U.negative===0){if(I=this.neg().divmod(U,X),X!=="mod")Z=I.div.neg();if(X!=="div"){if(Y=I.mod.neg(),J&&Y.negative!==0)Y.iadd(U)}return{div:Z,mod:Y}}if(this.negative===0&&U.negative!==0){if(I=this.divmod(U.neg(),X),X!=="mod")Z=I.div.neg();return{div:Z,mod:I.mod}}if((this.negative&U.negative)!==0){if(I=this.neg().divmod(U.neg(),X),X!=="div"){if(Y=I.mod.neg(),J&&Y.negative!==0)Y.isub(U)}return{div:I.div,mod:Y}}if(U.length>this.length||this.cmp(U)<0)return{div:new A(0),mod:this};if(U.length===1){if(X==="div")return{div:this.divn(U.words[0]),mod:null};if(X==="mod")return{div:null,mod:new A(this.modn(U.words[0]))};return{div:this.divn(U.words[0]),mod:new A(this.modn(U.words[0]))}}return this._wordDiv(U,X)},A.prototype.div=function(U){return this.divmod(U,"div",!1).div},A.prototype.mod=function(U){return this.divmod(U,"mod",!1).mod},A.prototype.umod=function(U){return this.divmod(U,"mod",!0).mod},A.prototype.divRound=function(U){var X=this.divmod(U);if(X.mod.isZero())return X.div;var J=X.div.negative!==0?X.mod.isub(U):X.mod,Z=U.ushrn(1),Y=U.andln(1),I=J.cmp(Z);if(I<0||Y===1&&I===0)return X.div;return X.div.negative!==0?X.div.isubn(1):X.div.iaddn(1)},A.prototype.modn=function(U){C(U<=67108863);var X=67108864%U,J=0;for(var Z=this.length-1;Z>=0;Z--)J=(X*J+(this.words[Z]|0))%U;return J},A.prototype.idivn=function(U){C(U<=67108863);var X=0;for(var J=this.length-1;J>=0;J--){var Z=(this.words[J]|0)+X*67108864;this.words[J]=Z/U|0,X=Z%U}return this.strip()},A.prototype.divn=function(U){return this.clone().idivn(U)},A.prototype.egcd=function(U){C(U.negative===0),C(!U.isZero());var X=this,J=U.clone();if(X.negative!==0)X=X.umod(U);else X=X.clone();var Z=new A(1),Y=new A(0),I=new A(0),K=new A(1),G=0;while(X.isEven()&&J.isEven())X.iushrn(1),J.iushrn(1),++G;var O=J.clone(),E=X.clone();while(!X.isZero()){for(var T=0,D=1;(X.words[0]&D)===0&&T<26;++T,D<<=1);if(T>0){X.iushrn(T);while(T-- >0){if(Z.isOdd()||Y.isOdd())Z.iadd(O),Y.isub(E);Z.iushrn(1),Y.iushrn(1)}}for(var v=0,g=1;(J.words[0]&g)===0&&v<26;++v,g<<=1);if(v>0){J.iushrn(v);while(v-- >0){if(I.isOdd()||K.isOdd())I.iadd(O),K.isub(E);I.iushrn(1),K.iushrn(1)}}if(X.cmp(J)>=0)X.isub(J),Z.isub(I),Y.isub(K);else J.isub(X),I.isub(Z),K.isub(Y)}return{a:I,b:K,gcd:J.iushln(G)}},A.prototype._invmp=function(U){C(U.negative===0),C(!U.isZero());var X=this,J=U.clone();if(X.negative!==0)X=X.umod(U);else X=X.clone();var Z=new A(1),Y=new A(0),I=J.clone();while(X.cmpn(1)>0&&J.cmpn(1)>0){for(var K=0,G=1;(X.words[0]&G)===0&&K<26;++K,G<<=1);if(K>0){X.iushrn(K);while(K-- >0){if(Z.isOdd())Z.iadd(I);Z.iushrn(1)}}for(var O=0,E=1;(J.words[0]&E)===0&&O<26;++O,E<<=1);if(O>0){J.iushrn(O);while(O-- >0){if(Y.isOdd())Y.iadd(I);Y.iushrn(1)}}if(X.cmp(J)>=0)X.isub(J),Z.isub(Y);else J.isub(X),Y.isub(Z)}var T;if(X.cmpn(1)===0)T=Z;else T=Y;if(T.cmpn(0)<0)T.iadd(U);return T},A.prototype.gcd=function(U){if(this.isZero())return U.abs();if(U.isZero())return this.abs();var X=this.clone(),J=U.clone();X.negative=0,J.negative=0;for(var Z=0;X.isEven()&&J.isEven();Z++)X.iushrn(1),J.iushrn(1);do{while(X.isEven())X.iushrn(1);while(J.isEven())J.iushrn(1);var Y=X.cmp(J);if(Y<0){var I=X;X=J,J=I}else if(Y===0||J.cmpn(1)===0)break;X.isub(J)}while(!0);return J.iushln(Z)},A.prototype.invm=function(U){return this.egcd(U).a.umod(U)},A.prototype.isEven=function(){return(this.words[0]&1)===0},A.prototype.isOdd=function(){return(this.words[0]&1)===1},A.prototype.andln=function(U){return this.words[0]&U},A.prototype.bincn=function(U){C(typeof U==="number");var X=U%26,J=(U-X)/26,Z=1<<X;if(this.length<=J)return this._expand(J+1),this.words[J]|=Z,this;var Y=Z;for(var I=J;Y!==0&&I<this.length;I++){var K=this.words[I]|0;K+=Y,Y=K>>>26,K&=67108863,this.words[I]=K}if(Y!==0)this.words[I]=Y,this.length++;return this},A.prototype.isZero=function(){return this.length===1&&this.words[0]===0},A.prototype.cmpn=function(U){var X=U<0;if(this.negative!==0&&!X)return-1;if(this.negative===0&&X)return 1;this.strip();var J;if(this.length>1)J=1;else{if(X)U=-U;C(U<=67108863,"Number is too big");var Z=this.words[0]|0;J=Z===U?0:Z<U?-1:1}if(this.negative!==0)return-J|0;return J},A.prototype.cmp=function(U){if(this.negative!==0&&U.negative===0)return-1;if(this.negative===0&&U.negative!==0)return 1;var X=this.ucmp(U);if(this.negative!==0)return-X|0;return X},A.prototype.ucmp=function(U){if(this.length>U.length)return 1;if(this.length<U.length)return-1;var X=0;for(var J=this.length-1;J>=0;J--){var Z=this.words[J]|0,Y=U.words[J]|0;if(Z===Y)continue;if(Z<Y)X=-1;else if(Z>Y)X=1;break}return X},A.prototype.gtn=function(U){return this.cmpn(U)===1},A.prototype.gt=function(U){return this.cmp(U)===1},A.prototype.gten=function(U){return this.cmpn(U)>=0},A.prototype.gte=function(U){return this.cmp(U)>=0},A.prototype.ltn=function(U){return this.cmpn(U)===-1},A.prototype.lt=function(U){return this.cmp(U)===-1},A.prototype.lten=function(U){return this.cmpn(U)<=0},A.prototype.lte=function(U){return this.cmp(U)<=0},A.prototype.eqn=function(U){return this.cmpn(U)===0},A.prototype.eq=function(U){return this.cmp(U)===0},A.red=function(U){return new u(U)},A.prototype.toRed=function(U){return C(!this.red,"Already a number in reduction context"),C(this.negative===0,"red works only with positives"),U.convertTo(this)._forceRed(U)},A.prototype.fromRed=function(){return C(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},A.prototype._forceRed=function(U){return this.red=U,this},A.prototype.forceRed=function(U){return C(!this.red,"Already a number in reduction context"),this._forceRed(U)},A.prototype.redAdd=function(U){return C(this.red,"redAdd works only with red numbers"),this.red.add(this,U)},A.prototype.redIAdd=function(U){return C(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,U)},A.prototype.redSub=function(U){return C(this.red,"redSub works only with red numbers"),this.red.sub(this,U)},A.prototype.redISub=function(U){return C(this.red,"redISub works only with red numbers"),this.red.isub(this,U)},A.prototype.redShl=function(U){return C(this.red,"redShl works only with red numbers"),this.red.shl(this,U)},A.prototype.redMul=function(U){return C(this.red,"redMul works only with red numbers"),this.red._verify2(this,U),this.red.mul(this,U)},A.prototype.redIMul=function(U){return C(this.red,"redMul works only with red numbers"),this.red._verify2(this,U),this.red.imul(this,U)},A.prototype.redSqr=function(){return C(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},A.prototype.redISqr=function(){return C(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},A.prototype.redSqrt=function(){return C(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},A.prototype.redInvm=function(){return C(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},A.prototype.redNeg=function(){return C(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},A.prototype.redPow=function(U){return C(this.red&&!U.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,U)};var f={k256:null,p224:null,p192:null,p25519:null};function w(U,X){this.name=U,this.p=new A(X,16),this.n=this.p.bitLength(),this.k=new A(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}w.prototype._tmp=function(){var U=new A(null);return U.words=Array(Math.ceil(this.n/13)),U},w.prototype.ireduce=function(U){var X=U,J;do this.split(X,this.tmp),X=this.imulK(X),X=X.iadd(this.tmp),J=X.bitLength();while(J>this.n);var Z=J<this.n?-1:X.ucmp(this.p);if(Z===0)X.words[0]=0,X.length=1;else if(Z>0)X.isub(this.p);else if(X.strip!==void 0)X.strip();else X._strip();return X},w.prototype.split=function(U,X){U.iushrn(this.n,0,X)},w.prototype.imulK=function(U){return U.imul(this.k)};function d(){w.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}F(d,w),d.prototype.split=function(U,X){var J=4194303,Z=Math.min(U.length,9);for(var Y=0;Y<Z;Y++)X.words[Y]=U.words[Y];if(X.length=Z,U.length<=9){U.words[0]=0,U.length=1;return}var I=U.words[9];X.words[X.length++]=I&J;for(Y=10;Y<U.length;Y++){var K=U.words[Y]|0;U.words[Y-10]=(K&J)<<4|I>>>22,I=K}if(I>>>=22,U.words[Y-10]=I,I===0&&U.length>10)U.length-=10;else U.length-=9},d.prototype.imulK=function(U){U.words[U.length]=0,U.words[U.length+1]=0,U.length+=2;var X=0;for(var J=0;J<U.length;J++){var Z=U.words[J]|0;X+=Z*977,U.words[J]=X&67108863,X=Z*64+(X/67108864|0)}if(U.words[U.length-1]===0){if(U.length--,U.words[U.length-1]===0)U.length--}return U};function Y0(){w.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}F(Y0,w);function J0(){w.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}F(J0,w);function A0(){w.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}F(A0,w),A0.prototype.imulK=function(U){var X=0;for(var J=0;J<U.length;J++){var Z=(U.words[J]|0)*19+X,Y=Z&67108863;Z>>>=26,U.words[J]=Y,X=Z}if(X!==0)U.words[U.length++]=X;return U},A._prime=function(U){if(f[U])return f[U];var X;if(U==="k256")X=new d;else if(U==="p224")X=new Y0;else if(U==="p192")X=new J0;else if(U==="p25519")X=new A0;else throw Error("Unknown prime "+U);return f[U]=X,X};function u(U){if(typeof U==="string"){var X=A._prime(U);this.m=X.p,this.prime=X}else C(U.gtn(1),"modulus must be greater than 1"),this.m=U,this.prime=null}u.prototype._verify1=function(U){C(U.negative===0,"red works only with positives"),C(U.red,"red works only with red numbers")},u.prototype._verify2=function(U,X){C((U.negative|X.negative)===0,"red works only with positives"),C(U.red&&U.red===X.red,"red works only with red numbers")},u.prototype.imod=function(U){if(this.prime)return this.prime.ireduce(U)._forceRed(this);return U.umod(this.m)._forceRed(this)},u.prototype.neg=function(U){if(U.isZero())return U.clone();return this.m.sub(U)._forceRed(this)},u.prototype.add=function(U,X){this._verify2(U,X);var J=U.add(X);if(J.cmp(this.m)>=0)J.isub(this.m);return J._forceRed(this)},u.prototype.iadd=function(U,X){this._verify2(U,X);var J=U.iadd(X);if(J.cmp(this.m)>=0)J.isub(this.m);return J},u.prototype.sub=function(U,X){this._verify2(U,X);var J=U.sub(X);if(J.cmpn(0)<0)J.iadd(this.m);return J._forceRed(this)},u.prototype.isub=function(U,X){this._verify2(U,X);var J=U.isub(X);if(J.cmpn(0)<0)J.iadd(this.m);return J},u.prototype.shl=function(U,X){return this._verify1(U),this.imod(U.ushln(X))},u.prototype.imul=function(U,X){return this._verify2(U,X),this.imod(U.imul(X))},u.prototype.mul=function(U,X){return this._verify2(U,X),this.imod(U.mul(X))},u.prototype.isqr=function(U){return this.imul(U,U.clone())},u.prototype.sqr=function(U){return this.mul(U,U)},u.prototype.sqrt=function(U){if(U.isZero())return U.clone();var X=this.m.andln(3);if(C(X%2===1),X===3){var J=this.m.add(new A(1)).iushrn(2);return this.pow(U,J)}var Z=this.m.subn(1),Y=0;while(!Z.isZero()&&Z.andln(1)===0)Y++,Z.iushrn(1);C(!Z.isZero());var I=new A(1).toRed(this),K=I.redNeg(),G=this.m.subn(1).iushrn(1),O=this.m.bitLength();O=new A(2*O*O).toRed(this);while(this.pow(O,G).cmp(K)!==0)O.redIAdd(K);var E=this.pow(O,Z),T=this.pow(U,Z.addn(1).iushrn(1)),D=this.pow(U,Z),v=Y;while(D.cmp(I)!==0){var g=D;for(var p=0;g.cmp(I)!==0;p++)g=g.redSqr();C(p<v);var n=this.pow(E,new A(1).iushln(v-p-1));T=T.redMul(n),E=n.redSqr(),D=D.redMul(E),v=p}return T},u.prototype.invm=function(U){var X=U._invmp(this.m);if(X.negative!==0)return X.negative=0,this.imod(X).redNeg();else return this.imod(X)},u.prototype.pow=function(U,X){if(X.isZero())return new A(1).toRed(this);if(X.cmpn(1)===0)return U.clone();var J=4,Z=Array(1<<J);Z[0]=new A(1).toRed(this),Z[1]=U;for(var Y=2;Y<Z.length;Y++)Z[Y]=this.mul(Z[Y-1],U);var I=Z[0],K=0,G=0,O=X.bitLength()%26;if(O===0)O=26;for(Y=X.length-1;Y>=0;Y--){var E=X.words[Y];for(var T=O-1;T>=0;T--){var D=E>>T&1;if(I!==Z[0])I=this.sqr(I);if(D===0&&K===0){G=0;continue}if(K<<=1,K|=D,G++,G!==J&&(Y!==0||T!==0))continue;I=this.mul(I,Z[K]),G=0,K=0}O=26}return I},u.prototype.convertTo=function(U){var X=U.umod(this.m);return X===U?X.clone():X},u.prototype.convertFrom=function(U){var X=U.clone();return X.red=null,X},A.mont=function(U){return new O0(U)};function O0(U){if(u.call(this,U),this.shift=this.m.bitLength(),this.shift%26!==0)this.shift+=26-this.shift%26;this.r=new A(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}F(O0,u),O0.prototype.convertTo=function(U){return this.imod(U.ushln(this.shift))},O0.prototype.convertFrom=function(U){var X=this.imod(U.mul(this.rinv));return X.red=null,X},O0.prototype.imul=function(U,X){if(U.isZero()||X.isZero())return U.words[0]=0,U.length=1,U;var J=U.imul(X),Z=J.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Y=J.isub(Z).iushrn(this.shift),I=Y;if(Y.cmp(this.m)>=0)I=Y.isub(this.m);else if(Y.cmpn(0)<0)I=Y.iadd(this.m);return I._forceRed(this)},O0.prototype.mul=function(U,X){if(U.isZero()||X.isZero())return new A(0)._forceRed(this);var J=U.mul(X),Z=J.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Y=J.isub(Z).iushrn(this.shift),I=Y;if(Y.cmp(this.m)>=0)I=Y.isub(this.m);else if(Y.cmpn(0)<0)I=Y.iadd(this.m);return I._forceRed(this)},O0.prototype.invm=function(U){var X=this.imod(U._invmp(this.m).mul(this.r2));return X._forceRed(this)}})(typeof $>"u"||$,Q)}),aJ=$0((Q,$)=>{var V=tJ(),W=rJ();$.exports=function(z){return new F(z)};var C={secp256k1:{name:"secp256k1",byteLength:32},secp224r1:{name:"p224",byteLength:28},prime256v1:{name:"p256",byteLength:32},prime192v1:{name:"p192",byteLength:24},ed25519:{name:"ed25519",byteLength:32},secp384r1:{name:"p384",byteLength:48},secp521r1:{name:"p521",byteLength:66}};C.p224=C.secp224r1,C.p256=C.secp256r1=C.prime256v1,C.p192=C.secp192r1=C.prime192v1,C.p384=C.secp384r1,C.p521=C.secp521r1;function F(z){if(this.curveType=C[z],!this.curveType)this.curveType={name:z};this.curve=new V.ec(this.curveType.name),this.keys=void 0}F.prototype.generateKeys=function(z,M){return this.keys=this.curve.genKeyPair(),this.getPublicKey(z,M)},F.prototype.computeSecret=function(z,M,S){if(M=M||"utf8",!Buffer.isBuffer(z))z=new Buffer(z,M);var R=this.curve.keyFromPublic(z).getPublic(),L=R.mul(this.keys.getPrivate()).getX();return A(L,S,this.curveType.byteLength)},F.prototype.getPublicKey=function(z,M){var S=this.keys.getPublic(M==="compressed",!0);if(M==="hybrid")if(S[S.length-1]%2)S[0]=7;else S[0]=6;return A(S,z)},F.prototype.getPrivateKey=function(z){return A(this.keys.getPrivate(),z)},F.prototype.setPublicKey=function(z,M){if(M=M||"utf8",!Buffer.isBuffer(z))z=new Buffer(z,M);return this.keys._importPublic(z),this},F.prototype.setPrivateKey=function(z,M){if(M=M||"utf8",!Buffer.isBuffer(z))z=new Buffer(z,M);var S=new W(z);return S=S.toString(16),this.keys=this.curve.genKeyPair(),this.keys._importPrivate(S),this};function A(z,M,S){if(!Array.isArray(z))z=z.toArray();var R=new Buffer(z);if(S&&R.length<S){var L=new Buffer(S-R.length);L.fill(0),R=Buffer.concat([L,R])}if(!M)return R;else return R.toString(M)}}),eJ=$0((Q,$)=>{var V=(jU(),h0(vU)).createECDH;$.exports=V||aJ()}),iJ=$0((Q,$)=>{(function(V,W){function C(U,X){if(!U)throw Error(X||"Assertion failed")}function F(U,X){U.super_=X;var J=function(){};J.prototype=X.prototype,U.prototype=new J,U.prototype.constructor=U}function A(U,X,J){if(A.isBN(U))return U;if(this.negative=0,this.words=null,this.length=0,this.red=null,U!==null){if(X==="le"||X==="be")J=X,X=10;this._init(U||0,X||10,J||"be")}}if(typeof V==="object")V.exports=A;else W.BN=A;A.BN=A,A.wordSize=26;var z;try{if(typeof window<"u"&&typeof window.Buffer<"u")z=window.Buffer;else z=(HU(),h0(WU)).Buffer}catch(U){}A.isBN=function(U){if(U instanceof A)return!0;return U!==null&&typeof U==="object"&&U.constructor.wordSize===A.wordSize&&Array.isArray(U.words)},A.max=function(U,X){if(U.cmp(X)>0)return U;return X},A.min=function(U,X){if(U.cmp(X)<0)return U;return X},A.prototype._init=function(U,X,J){if(typeof U==="number")return this._initNumber(U,X,J);if(typeof U==="object")return this._initArray(U,X,J);if(X==="hex")X=16;C(X===(X|0)&&X>=2&&X<=36),U=U.toString().replace(/\s+/g,"");var Z=0;if(U[0]==="-")Z++,this.negative=1;if(Z<U.length){if(X===16)this._parseHex(U,Z,J);else if(this._parseBase(U,X,Z),J==="le")this._initArray(this.toArray(),X,J)}},A.prototype._initNumber=function(U,X,J){if(U<0)this.negative=1,U=-U;if(U<67108864)this.words=[U&67108863],this.length=1;else if(U<4503599627370496)this.words=[U&67108863,U/67108864&67108863],this.length=2;else C(U<9007199254740992),this.words=[U&67108863,U/67108864&67108863,1],this.length=3;if(J!=="le")return;this._initArray(this.toArray(),X,J)},A.prototype._initArray=function(U,X,J){if(C(typeof U.length==="number"),U.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(U.length/3),this.words=Array(this.length);for(var Z=0;Z<this.length;Z++)this.words[Z]=0;var Y,I,K=0;if(J==="be"){for(Z=U.length-1,Y=0;Z>=0;Z-=3)if(I=U[Z]|U[Z-1]<<8|U[Z-2]<<16,this.words[Y]|=I<<K&67108863,this.words[Y+1]=I>>>26-K&67108863,K+=24,K>=26)K-=26,Y++}else if(J==="le"){for(Z=0,Y=0;Z<U.length;Z+=3)if(I=U[Z]|U[Z+1]<<8|U[Z+2]<<16,this.words[Y]|=I<<K&67108863,this.words[Y+1]=I>>>26-K&67108863,K+=24,K>=26)K-=26,Y++}return this.strip()};function M(U,X){var J=U.charCodeAt(X);if(J>=65&&J<=70)return J-55;else if(J>=97&&J<=102)return J-87;else return J-48&15}function S(U,X,J){var Z=M(U,J);if(J-1>=X)Z|=M(U,J-1)<<4;return Z}A.prototype._parseHex=function(U,X,J){this.length=Math.ceil((U.length-X)/6),this.words=Array(this.length);for(var Z=0;Z<this.length;Z++)this.words[Z]=0;var Y=0,I=0,K;if(J==="be")for(Z=U.length-1;Z>=X;Z-=2)if(K=S(U,X,Z)<<Y,this.words[I]|=K&67108863,Y>=18)Y-=18,I+=1,this.words[I]|=K>>>26;else Y+=8;else{var G=U.length-X;for(Z=G%2===0?X+1:X;Z<U.length;Z+=2)if(K=S(U,X,Z)<<Y,this.words[I]|=K&67108863,Y>=18)Y-=18,I+=1,this.words[I]|=K>>>26;else Y+=8}this.strip()};function R(U,X,J,Z){var Y=0,I=Math.min(U.length,J);for(var K=X;K<I;K++){var G=U.charCodeAt(K)-48;if(Y*=Z,G>=49)Y+=G-49+10;else if(G>=17)Y+=G-17+10;else Y+=G}return Y}A.prototype._parseBase=function(U,X,J){this.words=[0],this.length=1;for(var Z=0,Y=1;Y<=67108863;Y*=X)Z++;Z--,Y=Y/X|0;var I=U.length-J,K=I%Z,G=Math.min(I,I-K)+J,O=0;for(var E=J;E<G;E+=Z)if(O=R(U,E,E+Z,X),this.imuln(Y),this.words[0]+O<67108864)this.words[0]+=O;else this._iaddn(O);if(K!==0){var T=1;O=R(U,E,U.length,X);for(E=0;E<K;E++)T*=X;if(this.imuln(T),this.words[0]+O<67108864)this.words[0]+=O;else this._iaddn(O)}this.strip()},A.prototype.copy=function(U){U.words=Array(this.length);for(var X=0;X<this.length;X++)U.words[X]=this.words[X];U.length=this.length,U.negative=this.negative,U.red=this.red},A.prototype.clone=function(){var U=new A(null);return this.copy(U),U},A.prototype._expand=function(U){while(this.length<U)this.words[this.length++]=0;return this},A.prototype.strip=function(){while(this.length>1&&this.words[this.length-1]===0)this.length--;return this._normSign()},A.prototype._normSign=function(){if(this.length===1&&this.words[0]===0)this.negative=0;return this},A.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var L=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],H=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],q=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64000000,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,24300000,28629151,33554432,39135393,45435424,52521875,60466176];if(A.prototype.toString=function(U,X){U=U||10,X=X|0||1;var J;if(U===16||U==="hex"){J="";var Z=0,Y=0;for(var I=0;I<this.length;I++){var K=this.words[I],G=((K<<Z|Y)&16777215).toString(16);if(Y=K>>>24-Z&16777215,Z+=2,Z>=26)Z-=26,I--;if(Y!==0||I!==this.length-1)J=L[6-G.length]+G+J;else J=G+J}if(Y!==0)J=Y.toString(16)+J;while(J.length%X!==0)J="0"+J;if(this.negative!==0)J="-"+J;return J}if(U===(U|0)&&U>=2&&U<=36){var O=H[U],E=q[U];J="";var T=this.clone();T.negative=0;while(!T.isZero()){var D=T.modn(E).toString(U);if(T=T.idivn(E),!T.isZero())J=L[O-D.length]+D+J;else J=D+J}if(this.isZero())J="0"+J;while(J.length%X!==0)J="0"+J;if(this.negative!==0)J="-"+J;return J}C(!1,"Base should be between 2 and 36")},A.prototype.toNumber=function(){var U=this.words[0];if(this.length===2)U+=this.words[1]*67108864;else if(this.length===3&&this.words[2]===1)U+=4503599627370496+this.words[1]*67108864;else if(this.length>2)C(!1,"Number can only safely store up to 53 bits");return this.negative!==0?-U:U},A.prototype.toJSON=function(){return this.toString(16)},A.prototype.toBuffer=function(U,X){return C(typeof z<"u"),this.toArrayLike(z,U,X)},A.prototype.toArray=function(U,X){return this.toArrayLike(Array,U,X)},A.prototype.toArrayLike=function(U,X,J){var Z=this.byteLength(),Y=J||Math.max(1,Z);C(Z<=Y,"byte array longer than desired length"),C(Y>0,"Requested array length <= 0"),this.strip();var I=X==="le",K=new U(Y),G,O,E=this.clone();if(!I){for(O=0;O<Y-Z;O++)K[O]=0;for(O=0;!E.isZero();O++)G=E.andln(255),E.iushrn(8),K[Y-O-1]=G}else{for(O=0;!E.isZero();O++)G=E.andln(255),E.iushrn(8),K[O]=G;for(;O<Y;O++)K[O]=0}return K},Math.clz32)A.prototype._countBits=function(U){return 32-Math.clz32(U)};else A.prototype._countBits=function(U){var X=U,J=0;if(X>=4096)J+=13,X>>>=13;if(X>=64)J+=7,X>>>=7;if(X>=8)J+=4,X>>>=4;if(X>=2)J+=2,X>>>=2;return J+X};A.prototype._zeroBits=function(U){if(U===0)return 26;var X=U,J=0;if((X&8191)===0)J+=13,X>>>=13;if((X&127)===0)J+=7,X>>>=7;if((X&15)===0)J+=4,X>>>=4;if((X&3)===0)J+=2,X>>>=2;if((X&1)===0)J++;return J},A.prototype.bitLength=function(){var U=this.words[this.length-1],X=this._countBits(U);return(this.length-1)*26+X};function P(U){var X=Array(U.bitLength());for(var J=0;J<X.length;J++){var Z=J/26|0,Y=J%26;X[J]=(U.words[Z]&1<<Y)>>>Y}return X}A.prototype.zeroBits=function(){if(this.isZero())return 0;var U=0;for(var X=0;X<this.length;X++){var J=this._zeroBits(this.words[X]);if(U+=J,J!==26)break}return U},A.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},A.prototype.toTwos=function(U){if(this.negative!==0)return this.abs().inotn(U).iaddn(1);return this.clone()},A.prototype.fromTwos=function(U){if(this.testn(U-1))return this.notn(U).iaddn(1).ineg();return this.clone()},A.prototype.isNeg=function(){return this.negative!==0},A.prototype.neg=function(){return this.clone().ineg()},A.prototype.ineg=function(){if(!this.isZero())this.negative^=1;return this},A.prototype.iuor=function(U){while(this.length<U.length)this.words[this.length++]=0;for(var X=0;X<U.length;X++)this.words[X]=this.words[X]|U.words[X];return this.strip()},A.prototype.ior=function(U){return C((this.negative|U.negative)===0),this.iuor(U)},A.prototype.or=function(U){if(this.length>U.length)return this.clone().ior(U);return U.clone().ior(this)},A.prototype.uor=function(U){if(this.length>U.length)return this.clone().iuor(U);return U.clone().iuor(this)},A.prototype.iuand=function(U){var X;if(this.length>U.length)X=U;else X=this;for(var J=0;J<X.length;J++)this.words[J]=this.words[J]&U.words[J];return this.length=X.length,this.strip()},A.prototype.iand=function(U){return C((this.negative|U.negative)===0),this.iuand(U)},A.prototype.and=function(U){if(this.length>U.length)return this.clone().iand(U);return U.clone().iand(this)},A.prototype.uand=function(U){if(this.length>U.length)return this.clone().iuand(U);return U.clone().iuand(this)},A.prototype.iuxor=function(U){var X,J;if(this.length>U.length)X=this,J=U;else X=U,J=this;for(var Z=0;Z<J.length;Z++)this.words[Z]=X.words[Z]^J.words[Z];if(this!==X)for(;Z<X.length;Z++)this.words[Z]=X.words[Z];return this.length=X.length,this.strip()},A.prototype.ixor=function(U){return C((this.negative|U.negative)===0),this.iuxor(U)},A.prototype.xor=function(U){if(this.length>U.length)return this.clone().ixor(U);return U.clone().ixor(this)},A.prototype.uxor=function(U){if(this.length>U.length)return this.clone().iuxor(U);return U.clone().iuxor(this)},A.prototype.inotn=function(U){C(typeof U==="number"&&U>=0);var X=Math.ceil(U/26)|0,J=U%26;if(this._expand(X),J>0)X--;for(var Z=0;Z<X;Z++)this.words[Z]=~this.words[Z]&67108863;if(J>0)this.words[Z]=~this.words[Z]&67108863>>26-J;return this.strip()},A.prototype.notn=function(U){return this.clone().inotn(U)},A.prototype.setn=function(U,X){C(typeof U==="number"&&U>=0);var J=U/26|0,Z=U%26;if(this._expand(J+1),X)this.words[J]=this.words[J]|1<<Z;else this.words[J]=this.words[J]&~(1<<Z);return this.strip()},A.prototype.iadd=function(U){var X;if(this.negative!==0&&U.negative===0)return this.negative=0,X=this.isub(U),this.negative^=1,this._normSign();else if(this.negative===0&&U.negative!==0)return U.negative=0,X=this.isub(U),U.negative=1,X._normSign();var J,Z;if(this.length>U.length)J=this,Z=U;else J=U,Z=this;var Y=0;for(var I=0;I<Z.length;I++)X=(J.words[I]|0)+(Z.words[I]|0)+Y,this.words[I]=X&67108863,Y=X>>>26;for(;Y!==0&&I<J.length;I++)X=(J.words[I]|0)+Y,this.words[I]=X&67108863,Y=X>>>26;if(this.length=J.length,Y!==0)this.words[this.length]=Y,this.length++;else if(J!==this)for(;I<J.length;I++)this.words[I]=J.words[I];return this},A.prototype.add=function(U){var X;if(U.negative!==0&&this.negative===0)return U.negative=0,X=this.sub(U),U.negative^=1,X;else if(U.negative===0&&this.negative!==0)return this.negative=0,X=U.sub(this),this.negative=1,X;if(this.length>U.length)return this.clone().iadd(U);return U.clone().iadd(this)},A.prototype.isub=function(U){if(U.negative!==0){U.negative=0;var X=this.iadd(U);return U.negative=1,X._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(U),this.negative=1,this._normSign();var J=this.cmp(U);if(J===0)return this.negative=0,this.length=1,this.words[0]=0,this;var Z,Y;if(J>0)Z=this,Y=U;else Z=U,Y=this;var I=0;for(var K=0;K<Y.length;K++)X=(Z.words[K]|0)-(Y.words[K]|0)+I,I=X>>26,this.words[K]=X&67108863;for(;I!==0&&K<Z.length;K++)X=(Z.words[K]|0)+I,I=X>>26,this.words[K]=X&67108863;if(I===0&&K<Z.length&&Z!==this)for(;K<Z.length;K++)this.words[K]=Z.words[K];if(this.length=Math.max(this.length,K),Z!==this)this.negative=1;return this.strip()},A.prototype.sub=function(U){return this.clone().isub(U)};function _(U,X,J){J.negative=X.negative^U.negative;var Z=U.length+X.length|0;J.length=Z,Z=Z-1|0;var Y=U.words[0]|0,I=X.words[0]|0,K=Y*I,G=K&67108863,O=K/67108864|0;J.words[0]=G;for(var E=1;E<Z;E++){var T=O>>>26,D=O&67108863,v=Math.min(E,X.length-1);for(var g=Math.max(0,E-U.length+1);g<=v;g++){var p=E-g|0;Y=U.words[p]|0,I=X.words[g]|0,K=Y*I+D,T+=K/67108864|0,D=K&67108863}J.words[E]=D|0,O=T|0}if(O!==0)J.words[E]=O|0;else J.length--;return J.strip()}var k=function(U,X,J){var Z=U.words,Y=X.words,I=J.words,K=0,G,O,E,T=Z[0]|0,D=T&8191,v=T>>>13,g=Z[1]|0,p=g&8191,n=g>>>13,V0=Z[2]|0,r=V0&8191,l=V0>>>13,X0=Z[3]|0,m=X0&8191,i=X0>>>13,g0=Z[4]|0,y=g0&8191,h=g0>>>13,Q0=Z[5]|0,t=Q0&8191,e=Q0>>>13,F0=Z[6]|0,c=F0&8191,o=F0>>>13,N0=Z[7]|0,s=N0&8191,Z0=N0>>>13,w0=Z[8]|0,C0=w0&8191,K0=w0>>>13,s0=Z[9]|0,E0=s0&8191,L0=s0>>>13,e0=Y[0]|0,D0=e0&8191,H0=e0>>>13,FU=Y[1]|0,R0=FU&8191,k0=FU>>>13,RU=Y[2]|0,_0=RU&8191,T0=RU>>>13,DU=Y[3]|0,v0=DU&8191,z0=DU>>>13,CU=Y[4]|0,j0=CU&8191,B0=CU>>>13,KU=Y[5]|0,M0=KU&8191,N=KU>>>13,b=Y[6]|0,a=b&8191,U0=b>>>13,f0=Y[7]|0,I0=f0&8191,W0=f0>>>13,t0=Y[8]|0,q0=t0&8191,x0=t0>>>13,SU=Y[9]|0,P0=SU&8191,S0=SU>>>13;J.negative=U.negative^X.negative,J.length=19,G=Math.imul(D,D0),O=Math.imul(D,H0),O=O+Math.imul(v,D0)|0,E=Math.imul(v,H0);var r0=(K+G|0)+((O&8191)<<13)|0;K=(E+(O>>>13)|0)+(r0>>>26)|0,r0&=67108863,G=Math.imul(p,D0),O=Math.imul(p,H0),O=O+Math.imul(n,D0)|0,E=Math.imul(n,H0),G=G+Math.imul(D,R0)|0,O=O+Math.imul(D,k0)|0,O=O+Math.imul(v,R0)|0,E=E+Math.imul(v,k0)|0;var c0=(K+G|0)+((O&8191)<<13)|0;K=(E+(O>>>13)|0)+(c0>>>26)|0,c0&=67108863,G=Math.imul(r,D0),O=Math.imul(r,H0),O=O+Math.imul(l,D0)|0,E=Math.imul(l,H0),G=G+Math.imul(p,R0)|0,O=O+Math.imul(p,k0)|0,O=O+Math.imul(n,R0)|0,E=E+Math.imul(n,k0)|0,G=G+Math.imul(D,_0)|0,O=O+Math.imul(D,T0)|0,O=O+Math.imul(v,_0)|0,E=E+Math.imul(v,T0)|0;var y0=(K+G|0)+((O&8191)<<13)|0;K=(E+(O>>>13)|0)+(y0>>>26)|0,y0&=67108863,G=Math.imul(m,D0),O=Math.imul(m,H0),O=O+Math.imul(i,D0)|0,E=Math.imul(i,H0),G=G+Math.imul(r,R0)|0,O=O+Math.imul(r,k0)|0,O=O+Math.imul(l,R0)|0,E=E+Math.imul(l,k0)|0,G=G+Math.imul(p,_0)|0,O=O+Math.imul(p,T0)|0,O=O+Math.imul(n,_0)|0,E=E+Math.imul(n,T0)|0,G=G+Math.imul(D,v0)|0,O=O+Math.imul(D,z0)|0,O=O+Math.imul(v,v0)|0,E=E+Math.imul(v,z0)|0;var d0=(K+G|0)+((O&8191)<<13)|0;K=(E+(O>>>13)|0)+(d0>>>26)|0,d0&=67108863,G=Math.imul(y,D0),O=Math.imul(y,H0),O=O+Math.imul(h,D0)|0,E=Math.imul(h,H0),G=G+Math.imul(m,R0)|0,O=O+Math.imul(m,k0)|0,O=O+Math.imul(i,R0)|0,E=E+Math.imul(i,k0)|0,G=G+Math.imul(r,_0)|0,O=O+Math.imul(r,T0)|0,O=O+Math.imul(l,_0)|0,E=E+Math.imul(l,T0)|0,G=G+Math.imul(p,v0)|0,O=O+Math.imul(p,z0)|0,O=O+Math.imul(n,v0)|0,E=E+Math.imul(n,z0)|0,G=G+Math.imul(D,j0)|0,O=O+Math.imul(D,B0)|0,O=O+Math.imul(v,j0)|0,E=E+Math.imul(v,B0)|0;var l0=(K+G|0)+((O&8191)<<13)|0;K=(E+(O>>>13)|0)+(l0>>>26)|0,l0&=67108863,G=Math.imul(t,D0),O=Math.imul(t,H0),O=O+Math.imul(e,D0)|0,E=Math.imul(e,H0),G=G+Math.imul(y,R0)|0,O=O+Math.imul(y,k0)|0,O=O+Math.imul(h,R0)|0,E=E+Math.imul(h,k0)|0,G=G+Math.imul(m,_0)|0,O=O+Math.imul(m,T0)|0,O=O+Math.imul(i,_0)|0,E=E+Math.imul(i,T0)|0,G=G+Math.imul(r,v0)|0,O=O+Math.imul(r,z0)|0,O=O+Math.imul(l,v0)|0,E=E+Math.imul(l,z0)|0,G=G+Math.imul(p,j0)|0,O=O+Math.imul(p,B0)|0,O=O+Math.imul(n,j0)|0,E=E+Math.imul(n,B0)|0,G=G+Math.imul(D,M0)|0,O=O+Math.imul(D,N)|0,O=O+Math.imul(v,M0)|0,E=E+Math.imul(v,N)|0;var i0=(K+G|0)+((O&8191)<<13)|0;K=(E+(O>>>13)|0)+(i0>>>26)|0,i0&=67108863,G=Math.imul(c,D0),O=Math.imul(c,H0),O=O+Math.imul(o,D0)|0,E=Math.imul(o,H0),G=G+Math.imul(t,R0)|0,O=O+Math.imul(t,k0)|0,O=O+Math.imul(e,R0)|0,E=E+Math.imul(e,k0)|0,G=G+Math.imul(y,_0)|0,O=O+Math.imul(y,T0)|0,O=O+Math.imul(h,_0)|0,E=E+Math.imul(h,T0)|0,G=G+Math.imul(m,v0)|0,O=O+Math.imul(m,z0)|0,O=O+Math.imul(i,v0)|0,E=E+Math.imul(i,z0)|0,G=G+Math.imul(r,j0)|0,O=O+Math.imul(r,B0)|0,O=O+Math.imul(l,j0)|0,E=E+Math.imul(l,B0)|0,G=G+Math.imul(p,M0)|0,O=O+Math.imul(p,N)|0,O=O+Math.imul(n,M0)|0,E=E+Math.imul(n,N)|0,G=G+Math.imul(D,a)|0,O=O+Math.imul(D,U0)|0,O=O+Math.imul(v,a)|0,E=E+Math.imul(v,U0)|0;var UU=(K+G|0)+((O&8191)<<13)|0;K=(E+(O>>>13)|0)+(UU>>>26)|0,UU&=67108863,G=Math.imul(s,D0),O=Math.imul(s,H0),O=O+Math.imul(Z0,D0)|0,E=Math.imul(Z0,H0),G=G+Math.imul(c,R0)|0,O=O+Math.imul(c,k0)|0,O=O+Math.imul(o,R0)|0,E=E+Math.imul(o,k0)|0,G=G+Math.imul(t,_0)|0,O=O+Math.imul(t,T0)|0,O=O+Math.imul(e,_0)|0,E=E+Math.imul(e,T0)|0,G=G+Math.imul(y,v0)|0,O=O+Math.imul(y,z0)|0,O=O+Math.imul(h,v0)|0,E=E+Math.imul(h,z0)|0,G=G+Math.imul(m,j0)|0,O=O+Math.imul(m,B0)|0,O=O+Math.imul(i,j0)|0,E=E+Math.imul(i,B0)|0,G=G+Math.imul(r,M0)|0,O=O+Math.imul(r,N)|0,O=O+Math.imul(l,M0)|0,E=E+Math.imul(l,N)|0,G=G+Math.imul(p,a)|0,O=O+Math.imul(p,U0)|0,O=O+Math.imul(n,a)|0,E=E+Math.imul(n,U0)|0,G=G+Math.imul(D,I0)|0,O=O+Math.imul(D,W0)|0,O=O+Math.imul(v,I0)|0,E=E+Math.imul(v,W0)|0;var OU=(K+G|0)+((O&8191)<<13)|0;K=(E+(O>>>13)|0)+(OU>>>26)|0,OU&=67108863,G=Math.imul(C0,D0),O=Math.imul(C0,H0),O=O+Math.imul(K0,D0)|0,E=Math.imul(K0,H0),G=G+Math.imul(s,R0)|0,O=O+Math.imul(s,k0)|0,O=O+Math.imul(Z0,R0)|0,E=E+Math.imul(Z0,k0)|0,G=G+Math.imul(c,_0)|0,O=O+Math.imul(c,T0)|0,O=O+Math.imul(o,_0)|0,E=E+Math.imul(o,T0)|0,G=G+Math.imul(t,v0)|0,O=O+Math.imul(t,z0)|0,O=O+Math.imul(e,v0)|0,E=E+Math.imul(e,z0)|0,G=G+Math.imul(y,j0)|0,O=O+Math.imul(y,B0)|0,O=O+Math.imul(h,j0)|0,E=E+Math.imul(h,B0)|0,G=G+Math.imul(m,M0)|0,O=O+Math.imul(m,N)|0,O=O+Math.imul(i,M0)|0,E=E+Math.imul(i,N)|0,G=G+Math.imul(r,a)|0,O=O+Math.imul(r,U0)|0,O=O+Math.imul(l,a)|0,E=E+Math.imul(l,U0)|0,G=G+Math.imul(p,I0)|0,O=O+Math.imul(p,W0)|0,O=O+Math.imul(n,I0)|0,E=E+Math.imul(n,W0)|0,G=G+Math.imul(D,q0)|0,O=O+Math.imul(D,x0)|0,O=O+Math.imul(v,q0)|0,E=E+Math.imul(v,x0)|0;var ZU=(K+G|0)+((O&8191)<<13)|0;K=(E+(O>>>13)|0)+(ZU>>>26)|0,ZU&=67108863,G=Math.imul(E0,D0),O=Math.imul(E0,H0),O=O+Math.imul(L0,D0)|0,E=Math.imul(L0,H0),G=G+Math.imul(C0,R0)|0,O=O+Math.imul(C0,k0)|0,O=O+Math.imul(K0,R0)|0,E=E+Math.imul(K0,k0)|0,G=G+Math.imul(s,_0)|0,O=O+Math.imul(s,T0)|0,O=O+Math.imul(Z0,_0)|0,E=E+Math.imul(Z0,T0)|0,G=G+Math.imul(c,v0)|0,O=O+Math.imul(c,z0)|0,O=O+Math.imul(o,v0)|0,E=E+Math.imul(o,z0)|0,G=G+Math.imul(t,j0)|0,O=O+Math.imul(t,B0)|0,O=O+Math.imul(e,j0)|0,E=E+Math.imul(e,B0)|0,G=G+Math.imul(y,M0)|0,O=O+Math.imul(y,N)|0,O=O+Math.imul(h,M0)|0,E=E+Math.imul(h,N)|0,G=G+Math.imul(m,a)|0,O=O+Math.imul(m,U0)|0,O=O+Math.imul(i,a)|0,E=E+Math.imul(i,U0)|0,G=G+Math.imul(r,I0)|0,O=O+Math.imul(r,W0)|0,O=O+Math.imul(l,I0)|0,E=E+Math.imul(l,W0)|0,G=G+Math.imul(p,q0)|0,O=O+Math.imul(p,x0)|0,O=O+Math.imul(n,q0)|0,E=E+Math.imul(n,x0)|0,G=G+Math.imul(D,P0)|0,O=O+Math.imul(D,S0)|0,O=O+Math.imul(v,P0)|0,E=E+Math.imul(v,S0)|0;var XU=(K+G|0)+((O&8191)<<13)|0;K=(E+(O>>>13)|0)+(XU>>>26)|0,XU&=67108863,G=Math.imul(E0,R0),O=Math.imul(E0,k0),O=O+Math.imul(L0,R0)|0,E=Math.imul(L0,k0),G=G+Math.imul(C0,_0)|0,O=O+Math.imul(C0,T0)|0,O=O+Math.imul(K0,_0)|0,E=E+Math.imul(K0,T0)|0,G=G+Math.imul(s,v0)|0,O=O+Math.imul(s,z0)|0,O=O+Math.imul(Z0,v0)|0,E=E+Math.imul(Z0,z0)|0,G=G+Math.imul(c,j0)|0,O=O+Math.imul(c,B0)|0,O=O+Math.imul(o,j0)|0,E=E+Math.imul(o,B0)|0,G=G+Math.imul(t,M0)|0,O=O+Math.imul(t,N)|0,O=O+Math.imul(e,M0)|0,E=E+Math.imul(e,N)|0,G=G+Math.imul(y,a)|0,O=O+Math.imul(y,U0)|0,O=O+Math.imul(h,a)|0,E=E+Math.imul(h,U0)|0,G=G+Math.imul(m,I0)|0,O=O+Math.imul(m,W0)|0,O=O+Math.imul(i,I0)|0,E=E+Math.imul(i,W0)|0,G=G+Math.imul(r,q0)|0,O=O+Math.imul(r,x0)|0,O=O+Math.imul(l,q0)|0,E=E+Math.imul(l,x0)|0,G=G+Math.imul(p,P0)|0,O=O+Math.imul(p,S0)|0,O=O+Math.imul(n,P0)|0,E=E+Math.imul(n,S0)|0;var QU=(K+G|0)+((O&8191)<<13)|0;K=(E+(O>>>13)|0)+(QU>>>26)|0,QU&=67108863,G=Math.imul(E0,_0),O=Math.imul(E0,T0),O=O+Math.imul(L0,_0)|0,E=Math.imul(L0,T0),G=G+Math.imul(C0,v0)|0,O=O+Math.imul(C0,z0)|0,O=O+Math.imul(K0,v0)|0,E=E+Math.imul(K0,z0)|0,G=G+Math.imul(s,j0)|0,O=O+Math.imul(s,B0)|0,O=O+Math.imul(Z0,j0)|0,E=E+Math.imul(Z0,B0)|0,G=G+Math.imul(c,M0)|0,O=O+Math.imul(c,N)|0,O=O+Math.imul(o,M0)|0,E=E+Math.imul(o,N)|0,G=G+Math.imul(t,a)|0,O=O+Math.imul(t,U0)|0,O=O+Math.imul(e,a)|0,E=E+Math.imul(e,U0)|0,G=G+Math.imul(y,I0)|0,O=O+Math.imul(y,W0)|0,O=O+Math.imul(h,I0)|0,E=E+Math.imul(h,W0)|0,G=G+Math.imul(m,q0)|0,O=O+Math.imul(m,x0)|0,O=O+Math.imul(i,q0)|0,E=E+Math.imul(i,x0)|0,G=G+Math.imul(r,P0)|0,O=O+Math.imul(r,S0)|0,O=O+Math.imul(l,P0)|0,E=E+Math.imul(l,S0)|0;var YU=(K+G|0)+((O&8191)<<13)|0;K=(E+(O>>>13)|0)+(YU>>>26)|0,YU&=67108863,G=Math.imul(E0,v0),O=Math.imul(E0,z0),O=O+Math.imul(L0,v0)|0,E=Math.imul(L0,z0),G=G+Math.imul(C0,j0)|0,O=O+Math.imul(C0,B0)|0,O=O+Math.imul(K0,j0)|0,E=E+Math.imul(K0,B0)|0,G=G+Math.imul(s,M0)|0,O=O+Math.imul(s,N)|0,O=O+Math.imul(Z0,M0)|0,E=E+Math.imul(Z0,N)|0,G=G+Math.imul(c,a)|0,O=O+Math.imul(c,U0)|0,O=O+Math.imul(o,a)|0,E=E+Math.imul(o,U0)|0,G=G+Math.imul(t,I0)|0,O=O+Math.imul(t,W0)|0,O=O+Math.imul(e,I0)|0,E=E+Math.imul(e,W0)|0,G=G+Math.imul(y,q0)|0,O=O+Math.imul(y,x0)|0,O=O+Math.imul(h,q0)|0,E=E+Math.imul(h,x0)|0,G=G+Math.imul(m,P0)|0,O=O+Math.imul(m,S0)|0,O=O+Math.imul(i,P0)|0,E=E+Math.imul(i,S0)|0;var AU=(K+G|0)+((O&8191)<<13)|0;K=(E+(O>>>13)|0)+(AU>>>26)|0,AU&=67108863,G=Math.imul(E0,j0),O=Math.imul(E0,B0),O=O+Math.imul(L0,j0)|0,E=Math.imul(L0,B0),G=G+Math.imul(C0,M0)|0,O=O+Math.imul(C0,N)|0,O=O+Math.imul(K0,M0)|0,E=E+Math.imul(K0,N)|0,G=G+Math.imul(s,a)|0,O=O+Math.imul(s,U0)|0,O=O+Math.imul(Z0,a)|0,E=E+Math.imul(Z0,U0)|0,G=G+Math.imul(c,I0)|0,O=O+Math.imul(c,W0)|0,O=O+Math.imul(o,I0)|0,E=E+Math.imul(o,W0)|0,G=G+Math.imul(t,q0)|0,O=O+Math.imul(t,x0)|0,O=O+Math.imul(e,q0)|0,E=E+Math.imul(e,x0)|0,G=G+Math.imul(y,P0)|0,O=O+Math.imul(y,S0)|0,O=O+Math.imul(h,P0)|0,E=E+Math.imul(h,S0)|0;var $U=(K+G|0)+((O&8191)<<13)|0;K=(E+(O>>>13)|0)+($U>>>26)|0,$U&=67108863,G=Math.imul(E0,M0),O=Math.imul(E0,N),O=O+Math.imul(L0,M0)|0,E=Math.imul(L0,N),G=G+Math.imul(C0,a)|0,O=O+Math.imul(C0,U0)|0,O=O+Math.imul(K0,a)|0,E=E+Math.imul(K0,U0)|0,G=G+Math.imul(s,I0)|0,O=O+Math.imul(s,W0)|0,O=O+Math.imul(Z0,I0)|0,E=E+Math.imul(Z0,W0)|0,G=G+Math.imul(c,q0)|0,O=O+Math.imul(c,x0)|0,O=O+Math.imul(o,q0)|0,E=E+Math.imul(o,x0)|0,G=G+Math.imul(t,P0)|0,O=O+Math.imul(t,S0)|0,O=O+Math.imul(e,P0)|0,E=E+Math.imul(e,S0)|0;var JU=(K+G|0)+((O&8191)<<13)|0;K=(E+(O>>>13)|0)+(JU>>>26)|0,JU&=67108863,G=Math.imul(E0,a),O=Math.imul(E0,U0),O=O+Math.imul(L0,a)|0,E=Math.imul(L0,U0),G=G+Math.imul(C0,I0)|0,O=O+Math.imul(C0,W0)|0,O=O+Math.imul(K0,I0)|0,E=E+Math.imul(K0,W0)|0,G=G+Math.imul(s,q0)|0,O=O+Math.imul(s,x0)|0,O=O+Math.imul(Z0,q0)|0,E=E+Math.imul(Z0,x0)|0,G=G+Math.imul(c,P0)|0,O=O+Math.imul(c,S0)|0,O=O+Math.imul(o,P0)|0,E=E+Math.imul(o,S0)|0;var GU=(K+G|0)+((O&8191)<<13)|0;K=(E+(O>>>13)|0)+(GU>>>26)|0,GU&=67108863,G=Math.imul(E0,I0),O=Math.imul(E0,W0),O=O+Math.imul(L0,I0)|0,E=Math.imul(L0,W0),G=G+Math.imul(C0,q0)|0,O=O+Math.imul(C0,x0)|0,O=O+Math.imul(K0,q0)|0,E=E+Math.imul(K0,x0)|0,G=G+Math.imul(s,P0)|0,O=O+Math.imul(s,S0)|0,O=O+Math.imul(Z0,P0)|0,E=E+Math.imul(Z0,S0)|0;var VU=(K+G|0)+((O&8191)<<13)|0;K=(E+(O>>>13)|0)+(VU>>>26)|0,VU&=67108863,G=Math.imul(E0,q0),O=Math.imul(E0,x0),O=O+Math.imul(L0,q0)|0,E=Math.imul(L0,x0),G=G+Math.imul(C0,P0)|0,O=O+Math.imul(C0,S0)|0,O=O+Math.imul(K0,P0)|0,E=E+Math.imul(K0,S0)|0;var EU=(K+G|0)+((O&8191)<<13)|0;K=(E+(O>>>13)|0)+(EU>>>26)|0,EU&=67108863,G=Math.imul(E0,P0),O=Math.imul(E0,S0),O=O+Math.imul(L0,P0)|0,E=Math.imul(L0,S0);var IU=(K+G|0)+((O&8191)<<13)|0;if(K=(E+(O>>>13)|0)+(IU>>>26)|0,IU&=67108863,I[0]=r0,I[1]=c0,I[2]=y0,I[3]=d0,I[4]=l0,I[5]=i0,I[6]=UU,I[7]=OU,I[8]=ZU,I[9]=XU,I[10]=QU,I[11]=YU,I[12]=AU,I[13]=$U,I[14]=JU,I[15]=GU,I[16]=VU,I[17]=EU,I[18]=IU,K!==0)I[19]=K,J.length++;return J};if(!Math.imul)k=_;function B(U,X,J){J.negative=X.negative^U.negative,J.length=U.length+X.length;var Z=0,Y=0;for(var I=0;I<J.length-1;I++){var K=Y;Y=0;var G=Z&67108863,O=Math.min(I,X.length-1);for(var E=Math.max(0,I-U.length+1);E<=O;E++){var T=I-E,D=U.words[T]|0,v=X.words[E]|0,g=D*v,p=g&67108863;K=K+(g/67108864|0)|0,p=p+G|0,G=p&67108863,K=K+(p>>>26)|0,Y+=K>>>26,K&=67108863}J.words[I]=G,Z=K,K=Y}if(Z!==0)J.words[I]=Z;else J.length--;return J.strip()}function j(U,X,J){var Z=new x;return Z.mulp(U,X,J)}A.prototype.mulTo=function(U,X){var J,Z=this.length+U.length;if(this.length===10&&U.length===10)J=k(this,U,X);else if(Z<63)J=_(this,U,X);else if(Z<1024)J=B(this,U,X);else J=j(this,U,X);return J};function x(U,X){this.x=U,this.y=X}x.prototype.makeRBT=function(U){var X=Array(U),J=A.prototype._countBits(U)-1;for(var Z=0;Z<U;Z++)X[Z]=this.revBin(Z,J,U);return X},x.prototype.revBin=function(U,X,J){if(U===0||U===J-1)return U;var Z=0;for(var Y=0;Y<X;Y++)Z|=(U&1)<<X-Y-1,U>>=1;return Z},x.prototype.permute=function(U,X,J,Z,Y,I){for(var K=0;K<I;K++)Z[K]=X[U[K]],Y[K]=J[U[K]]},x.prototype.transform=function(U,X,J,Z,Y,I){this.permute(I,U,X,J,Z,Y);for(var K=1;K<Y;K<<=1){var G=K<<1,O=Math.cos(2*Math.PI/G),E=Math.sin(2*Math.PI/G);for(var T=0;T<Y;T+=G){var D=O,v=E;for(var g=0;g<K;g++){var p=J[T+g],n=Z[T+g],V0=J[T+g+K],r=Z[T+g+K],l=D*V0-v*r;if(r=D*r+v*V0,V0=l,J[T+g]=p+V0,Z[T+g]=n+r,J[T+g+K]=p-V0,Z[T+g+K]=n-r,g!==G)l=O*D-E*v,v=O*v+E*D,D=l}}}},x.prototype.guessLen13b=function(U,X){var J=Math.max(X,U)|1,Z=J&1,Y=0;for(J=J/2|0;J;J=J>>>1)Y++;return 1<<Y+1+Z},x.prototype.conjugate=function(U,X,J){if(J<=1)return;for(var Z=0;Z<J/2;Z++){var Y=U[Z];U[Z]=U[J-Z-1],U[J-Z-1]=Y,Y=X[Z],X[Z]=-X[J-Z-1],X[J-Z-1]=-Y}},x.prototype.normalize13b=function(U,X){var J=0;for(var Z=0;Z<X/2;Z++){var Y=Math.round(U[2*Z+1]/X)*8192+Math.round(U[2*Z]/X)+J;if(U[Z]=Y&67108863,Y<67108864)J=0;else J=Y/67108864|0}return U},x.prototype.convert13b=function(U,X,J,Z){var Y=0;for(var I=0;I<X;I++)Y=Y+(U[I]|0),J[2*I]=Y&8191,Y=Y>>>13,J[2*I+1]=Y&8191,Y=Y>>>13;for(I=2*X;I<Z;++I)J[I]=0;C(Y===0),C((Y&-8192)===0)},x.prototype.stub=function(U){var X=Array(U);for(var J=0;J<U;J++)X[J]=0;return X},x.prototype.mulp=function(U,X,J){var Z=2*this.guessLen13b(U.length,X.length),Y=this.makeRBT(Z),I=this.stub(Z),K=Array(Z),G=Array(Z),O=Array(Z),E=Array(Z),T=Array(Z),D=Array(Z),v=J.words;v.length=Z,this.convert13b(U.words,U.length,K,Z),this.convert13b(X.words,X.length,E,Z),this.transform(K,I,G,O,Z,Y),this.transform(E,I,T,D,Z,Y);for(var g=0;g<Z;g++){var p=G[g]*T[g]-O[g]*D[g];O[g]=G[g]*D[g]+O[g]*T[g],G[g]=p}return this.conjugate(G,O,Z),this.transform(G,O,v,I,Z,Y),this.conjugate(v,I,Z),this.normalize13b(v,Z),J.negative=U.negative^X.negative,J.length=U.length+X.length,J.strip()},A.prototype.mul=function(U){var X=new A(null);return X.words=Array(this.length+U.length),this.mulTo(U,X)},A.prototype.mulf=function(U){var X=new A(null);return X.words=Array(this.length+U.length),j(this,U,X)},A.prototype.imul=function(U){return this.clone().mulTo(U,this)},A.prototype.imuln=function(U){C(typeof U==="number"),C(U<67108864);var X=0;for(var J=0;J<this.length;J++){var Z=(this.words[J]|0)*U,Y=(Z&67108863)+(X&67108863);X>>=26,X+=Z/67108864|0,X+=Y>>>26,this.words[J]=Y&67108863}if(X!==0)this.words[J]=X,this.length++;return this.length=U===0?1:this.length,this},A.prototype.muln=function(U){return this.clone().imuln(U)},A.prototype.sqr=function(){return this.mul(this)},A.prototype.isqr=function(){return this.imul(this.clone())},A.prototype.pow=function(U){var X=P(U);if(X.length===0)return new A(1);var J=this;for(var Z=0;Z<X.length;Z++,J=J.sqr())if(X[Z]!==0)break;if(++Z<X.length)for(var Y=J.sqr();Z<X.length;Z++,Y=Y.sqr()){if(X[Z]===0)continue;J=J.mul(Y)}return J},A.prototype.iushln=function(U){C(typeof U==="number"&&U>=0);var X=U%26,J=(U-X)/26,Z=67108863>>>26-X<<26-X,Y;if(X!==0){var I=0;for(Y=0;Y<this.length;Y++){var K=this.words[Y]&Z,G=(this.words[Y]|0)-K<<X;this.words[Y]=G|I,I=K>>>26-X}if(I)this.words[Y]=I,this.length++}if(J!==0){for(Y=this.length-1;Y>=0;Y--)this.words[Y+J]=this.words[Y];for(Y=0;Y<J;Y++)this.words[Y]=0;this.length+=J}return this.strip()},A.prototype.ishln=function(U){return C(this.negative===0),this.iushln(U)},A.prototype.iushrn=function(U,X,J){C(typeof U==="number"&&U>=0);var Z;if(X)Z=(X-X%26)/26;else Z=0;var Y=U%26,I=Math.min((U-Y)/26,this.length),K=67108863^67108863>>>Y<<Y,G=J;if(Z-=I,Z=Math.max(0,Z),G){for(var O=0;O<I;O++)G.words[O]=this.words[O];G.length=I}if(I===0);else if(this.length>I){this.length-=I;for(O=0;O<this.length;O++)this.words[O]=this.words[O+I]}else this.words[0]=0,this.length=1;var E=0;for(O=this.length-1;O>=0&&(E!==0||O>=Z);O--){var T=this.words[O]|0;this.words[O]=E<<26-Y|T>>>Y,E=T&K}if(G&&E!==0)G.words[G.length++]=E;if(this.length===0)this.words[0]=0,this.length=1;return this.strip()},A.prototype.ishrn=function(U,X,J){return C(this.negative===0),this.iushrn(U,X,J)},A.prototype.shln=function(U){return this.clone().ishln(U)},A.prototype.ushln=function(U){return this.clone().iushln(U)},A.prototype.shrn=function(U){return this.clone().ishrn(U)},A.prototype.ushrn=function(U){return this.clone().iushrn(U)},A.prototype.testn=function(U){C(typeof U==="number"&&U>=0);var X=U%26,J=(U-X)/26,Z=1<<X;if(this.length<=J)return!1;var Y=this.words[J];return!!(Y&Z)},A.prototype.imaskn=function(U){C(typeof U==="number"&&U>=0);var X=U%26,J=(U-X)/26;if(C(this.negative===0,"imaskn works only with positive numbers"),this.length<=J)return this;if(X!==0)J++;if(this.length=Math.min(J,this.length),X!==0){var Z=67108863^67108863>>>X<<X;this.words[this.length-1]&=Z}return this.strip()},A.prototype.maskn=function(U){return this.clone().imaskn(U)},A.prototype.iaddn=function(U){if(C(typeof U==="number"),C(U<67108864),U<0)return this.isubn(-U);if(this.negative!==0){if(this.length===1&&(this.words[0]|0)<U)return this.words[0]=U-(this.words[0]|0),this.negative=0,this;return this.negative=0,this.isubn(U),this.negative=1,this}return this._iaddn(U)},A.prototype._iaddn=function(U){this.words[0]+=U;for(var X=0;X<this.length&&this.words[X]>=67108864;X++)if(this.words[X]-=67108864,X===this.length-1)this.words[X+1]=1;else this.words[X+1]++;return this.length=Math.max(this.length,X+1),this},A.prototype.isubn=function(U){if(C(typeof U==="number"),C(U<67108864),U<0)return this.iaddn(-U);if(this.negative!==0)return this.negative=0,this.iaddn(U),this.negative=1,this;if(this.words[0]-=U,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var X=0;X<this.length&&this.words[X]<0;X++)this.words[X]+=67108864,this.words[X+1]-=1;return this.strip()},A.prototype.addn=function(U){return this.clone().iaddn(U)},A.prototype.subn=function(U){return this.clone().isubn(U)},A.prototype.iabs=function(){return this.negative=0,this},A.prototype.abs=function(){return this.clone().iabs()},A.prototype._ishlnsubmul=function(U,X,J){var Z=U.length+J,Y;this._expand(Z);var I,K=0;for(Y=0;Y<U.length;Y++){I=(this.words[Y+J]|0)+K;var G=(U.words[Y]|0)*X;I-=G&67108863,K=(I>>26)-(G/67108864|0),this.words[Y+J]=I&67108863}for(;Y<this.length-J;Y++)I=(this.words[Y+J]|0)+K,K=I>>26,this.words[Y+J]=I&67108863;if(K===0)return this.strip();C(K===-1),K=0;for(Y=0;Y<this.length;Y++)I=-(this.words[Y]|0)+K,K=I>>26,this.words[Y]=I&67108863;return this.negative=1,this.strip()},A.prototype._wordDiv=function(U,X){var J=this.length-U.length,Z=this.clone(),Y=U,I=Y.words[Y.length-1]|0,K=this._countBits(I);if(J=26-K,J!==0)Y=Y.ushln(J),Z.iushln(J),I=Y.words[Y.length-1]|0;var G=Z.length-Y.length,O;if(X!=="mod"){O=new A(null),O.length=G+1,O.words=Array(O.length);for(var E=0;E<O.length;E++)O.words[E]=0}var T=Z.clone()._ishlnsubmul(Y,1,G);if(T.negative===0){if(Z=T,O)O.words[G]=1}for(var D=G-1;D>=0;D--){var v=(Z.words[Y.length+D]|0)*67108864+(Z.words[Y.length+D-1]|0);v=Math.min(v/I|0,67108863),Z._ishlnsubmul(Y,v,D);while(Z.negative!==0)if(v--,Z.negative=0,Z._ishlnsubmul(Y,1,D),!Z.isZero())Z.negative^=1;if(O)O.words[D]=v}if(O)O.strip();if(Z.strip(),X!=="div"&&J!==0)Z.iushrn(J);return{div:O||null,mod:Z}},A.prototype.divmod=function(U,X,J){if(C(!U.isZero()),this.isZero())return{div:new A(0),mod:new A(0)};var Z,Y,I;if(this.negative!==0&&U.negative===0){if(I=this.neg().divmod(U,X),X!=="mod")Z=I.div.neg();if(X!=="div"){if(Y=I.mod.neg(),J&&Y.negative!==0)Y.iadd(U)}return{div:Z,mod:Y}}if(this.negative===0&&U.negative!==0){if(I=this.divmod(U.neg(),X),X!=="mod")Z=I.div.neg();return{div:Z,mod:I.mod}}if((this.negative&U.negative)!==0){if(I=this.neg().divmod(U.neg(),X),X!=="div"){if(Y=I.mod.neg(),J&&Y.negative!==0)Y.isub(U)}return{div:I.div,mod:Y}}if(U.length>this.length||this.cmp(U)<0)return{div:new A(0),mod:this};if(U.length===1){if(X==="div")return{div:this.divn(U.words[0]),mod:null};if(X==="mod")return{div:null,mod:new A(this.modn(U.words[0]))};return{div:this.divn(U.words[0]),mod:new A(this.modn(U.words[0]))}}return this._wordDiv(U,X)},A.prototype.div=function(U){return this.divmod(U,"div",!1).div},A.prototype.mod=function(U){return this.divmod(U,"mod",!1).mod},A.prototype.umod=function(U){return this.divmod(U,"mod",!0).mod},A.prototype.divRound=function(U){var X=this.divmod(U);if(X.mod.isZero())return X.div;var J=X.div.negative!==0?X.mod.isub(U):X.mod,Z=U.ushrn(1),Y=U.andln(1),I=J.cmp(Z);if(I<0||Y===1&&I===0)return X.div;return X.div.negative!==0?X.div.isubn(1):X.div.iaddn(1)},A.prototype.modn=function(U){C(U<=67108863);var X=67108864%U,J=0;for(var Z=this.length-1;Z>=0;Z--)J=(X*J+(this.words[Z]|0))%U;return J},A.prototype.idivn=function(U){C(U<=67108863);var X=0;for(var J=this.length-1;J>=0;J--){var Z=(this.words[J]|0)+X*67108864;this.words[J]=Z/U|0,X=Z%U}return this.strip()},A.prototype.divn=function(U){return this.clone().idivn(U)},A.prototype.egcd=function(U){C(U.negative===0),C(!U.isZero());var X=this,J=U.clone();if(X.negative!==0)X=X.umod(U);else X=X.clone();var Z=new A(1),Y=new A(0),I=new A(0),K=new A(1),G=0;while(X.isEven()&&J.isEven())X.iushrn(1),J.iushrn(1),++G;var O=J.clone(),E=X.clone();while(!X.isZero()){for(var T=0,D=1;(X.words[0]&D)===0&&T<26;++T,D<<=1);if(T>0){X.iushrn(T);while(T-- >0){if(Z.isOdd()||Y.isOdd())Z.iadd(O),Y.isub(E);Z.iushrn(1),Y.iushrn(1)}}for(var v=0,g=1;(J.words[0]&g)===0&&v<26;++v,g<<=1);if(v>0){J.iushrn(v);while(v-- >0){if(I.isOdd()||K.isOdd())I.iadd(O),K.isub(E);I.iushrn(1),K.iushrn(1)}}if(X.cmp(J)>=0)X.isub(J),Z.isub(I),Y.isub(K);else J.isub(X),I.isub(Z),K.isub(Y)}return{a:I,b:K,gcd:J.iushln(G)}},A.prototype._invmp=function(U){C(U.negative===0),C(!U.isZero());var X=this,J=U.clone();if(X.negative!==0)X=X.umod(U);else X=X.clone();var Z=new A(1),Y=new A(0),I=J.clone();while(X.cmpn(1)>0&&J.cmpn(1)>0){for(var K=0,G=1;(X.words[0]&G)===0&&K<26;++K,G<<=1);if(K>0){X.iushrn(K);while(K-- >0){if(Z.isOdd())Z.iadd(I);Z.iushrn(1)}}for(var O=0,E=1;(J.words[0]&E)===0&&O<26;++O,E<<=1);if(O>0){J.iushrn(O);while(O-- >0){if(Y.isOdd())Y.iadd(I);Y.iushrn(1)}}if(X.cmp(J)>=0)X.isub(J),Z.isub(Y);else J.isub(X),Y.isub(Z)}var T;if(X.cmpn(1)===0)T=Z;else T=Y;if(T.cmpn(0)<0)T.iadd(U);return T},A.prototype.gcd=function(U){if(this.isZero())return U.abs();if(U.isZero())return this.abs();var X=this.clone(),J=U.clone();X.negative=0,J.negative=0;for(var Z=0;X.isEven()&&J.isEven();Z++)X.iushrn(1),J.iushrn(1);do{while(X.isEven())X.iushrn(1);while(J.isEven())J.iushrn(1);var Y=X.cmp(J);if(Y<0){var I=X;X=J,J=I}else if(Y===0||J.cmpn(1)===0)break;X.isub(J)}while(!0);return J.iushln(Z)},A.prototype.invm=function(U){return this.egcd(U).a.umod(U)},A.prototype.isEven=function(){return(this.words[0]&1)===0},A.prototype.isOdd=function(){return(this.words[0]&1)===1},A.prototype.andln=function(U){return this.words[0]&U},A.prototype.bincn=function(U){C(typeof U==="number");var X=U%26,J=(U-X)/26,Z=1<<X;if(this.length<=J)return this._expand(J+1),this.words[J]|=Z,this;var Y=Z;for(var I=J;Y!==0&&I<this.length;I++){var K=this.words[I]|0;K+=Y,Y=K>>>26,K&=67108863,this.words[I]=K}if(Y!==0)this.words[I]=Y,this.length++;return this},A.prototype.isZero=function(){return this.length===1&&this.words[0]===0},A.prototype.cmpn=function(U){var X=U<0;if(this.negative!==0&&!X)return-1;if(this.negative===0&&X)return 1;this.strip();var J;if(this.length>1)J=1;else{if(X)U=-U;C(U<=67108863,"Number is too big");var Z=this.words[0]|0;J=Z===U?0:Z<U?-1:1}if(this.negative!==0)return-J|0;return J},A.prototype.cmp=function(U){if(this.negative!==0&&U.negative===0)return-1;if(this.negative===0&&U.negative!==0)return 1;var X=this.ucmp(U);if(this.negative!==0)return-X|0;return X},A.prototype.ucmp=function(U){if(this.length>U.length)return 1;if(this.length<U.length)return-1;var X=0;for(var J=this.length-1;J>=0;J--){var Z=this.words[J]|0,Y=U.words[J]|0;if(Z===Y)continue;if(Z<Y)X=-1;else if(Z>Y)X=1;break}return X},A.prototype.gtn=function(U){return this.cmpn(U)===1},A.prototype.gt=function(U){return this.cmp(U)===1},A.prototype.gten=function(U){return this.cmpn(U)>=0},A.prototype.gte=function(U){return this.cmp(U)>=0},A.prototype.ltn=function(U){return this.cmpn(U)===-1},A.prototype.lt=function(U){return this.cmp(U)===-1},A.prototype.lten=function(U){return this.cmpn(U)<=0},A.prototype.lte=function(U){return this.cmp(U)<=0},A.prototype.eqn=function(U){return this.cmpn(U)===0},A.prototype.eq=function(U){return this.cmp(U)===0},A.red=function(U){return new u(U)},A.prototype.toRed=function(U){return C(!this.red,"Already a number in reduction context"),C(this.negative===0,"red works only with positives"),U.convertTo(this)._forceRed(U)},A.prototype.fromRed=function(){return C(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},A.prototype._forceRed=function(U){return this.red=U,this},A.prototype.forceRed=function(U){return C(!this.red,"Already a number in reduction context"),this._forceRed(U)},A.prototype.redAdd=function(U){return C(this.red,"redAdd works only with red numbers"),this.red.add(this,U)},A.prototype.redIAdd=function(U){return C(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,U)},A.prototype.redSub=function(U){return C(this.red,"redSub works only with red numbers"),this.red.sub(this,U)},A.prototype.redISub=function(U){return C(this.red,"redISub works only with red numbers"),this.red.isub(this,U)},A.prototype.redShl=function(U){return C(this.red,"redShl works only with red numbers"),this.red.shl(this,U)},A.prototype.redMul=function(U){return C(this.red,"redMul works only with red numbers"),this.red._verify2(this,U),this.red.mul(this,U)},A.prototype.redIMul=function(U){return C(this.red,"redMul works only with red numbers"),this.red._verify2(this,U),this.red.imul(this,U)},A.prototype.redSqr=function(){return C(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},A.prototype.redISqr=function(){return C(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},A.prototype.redSqrt=function(){return C(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},A.prototype.redInvm=function(){return C(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},A.prototype.redNeg=function(){return C(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},A.prototype.redPow=function(U){return C(this.red&&!U.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,U)};var f={k256:null,p224:null,p192:null,p25519:null};function w(U,X){this.name=U,this.p=new A(X,16),this.n=this.p.bitLength(),this.k=new A(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}w.prototype._tmp=function(){var U=new A(null);return U.words=Array(Math.ceil(this.n/13)),U},w.prototype.ireduce=function(U){var X=U,J;do this.split(X,this.tmp),X=this.imulK(X),X=X.iadd(this.tmp),J=X.bitLength();while(J>this.n);var Z=J<this.n?-1:X.ucmp(this.p);if(Z===0)X.words[0]=0,X.length=1;else if(Z>0)X.isub(this.p);else if(X.strip!==void 0)X.strip();else X._strip();return X},w.prototype.split=function(U,X){U.iushrn(this.n,0,X)},w.prototype.imulK=function(U){return U.imul(this.k)};function d(){w.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}F(d,w),d.prototype.split=function(U,X){var J=4194303,Z=Math.min(U.length,9);for(var Y=0;Y<Z;Y++)X.words[Y]=U.words[Y];if(X.length=Z,U.length<=9){U.words[0]=0,U.length=1;return}var I=U.words[9];X.words[X.length++]=I&J;for(Y=10;Y<U.length;Y++){var K=U.words[Y]|0;U.words[Y-10]=(K&J)<<4|I>>>22,I=K}if(I>>>=22,U.words[Y-10]=I,I===0&&U.length>10)U.length-=10;else U.length-=9},d.prototype.imulK=function(U){U.words[U.length]=0,U.words[U.length+1]=0,U.length+=2;var X=0;for(var J=0;J<U.length;J++){var Z=U.words[J]|0;X+=Z*977,U.words[J]=X&67108863,X=Z*64+(X/67108864|0)}if(U.words[U.length-1]===0){if(U.length--,U.words[U.length-1]===0)U.length--}return U};function Y0(){w.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}F(Y0,w);function J0(){w.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}F(J0,w);function A0(){w.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}F(A0,w),A0.prototype.imulK=function(U){var X=0;for(var J=0;J<U.length;J++){var Z=(U.words[J]|0)*19+X,Y=Z&67108863;Z>>>=26,U.words[J]=Y,X=Z}if(X!==0)U.words[U.length++]=X;return U},A._prime=function(U){if(f[U])return f[U];var X;if(U==="k256")X=new d;else if(U==="p224")X=new Y0;else if(U==="p192")X=new J0;else if(U==="p25519")X=new A0;else throw Error("Unknown prime "+U);return f[U]=X,X};function u(U){if(typeof U==="string"){var X=A._prime(U);this.m=X.p,this.prime=X}else C(U.gtn(1),"modulus must be greater than 1"),this.m=U,this.prime=null}u.prototype._verify1=function(U){C(U.negative===0,"red works only with positives"),C(U.red,"red works only with red numbers")},u.prototype._verify2=function(U,X){C((U.negative|X.negative)===0,"red works only with positives"),C(U.red&&U.red===X.red,"red works only with red numbers")},u.prototype.imod=function(U){if(this.prime)return this.prime.ireduce(U)._forceRed(this);return U.umod(this.m)._forceRed(this)},u.prototype.neg=function(U){if(U.isZero())return U.clone();return this.m.sub(U)._forceRed(this)},u.prototype.add=function(U,X){this._verify2(U,X);var J=U.add(X);if(J.cmp(this.m)>=0)J.isub(this.m);return J._forceRed(this)},u.prototype.iadd=function(U,X){this._verify2(U,X);var J=U.iadd(X);if(J.cmp(this.m)>=0)J.isub(this.m);return J},u.prototype.sub=function(U,X){this._verify2(U,X);var J=U.sub(X);if(J.cmpn(0)<0)J.iadd(this.m);return J._forceRed(this)},u.prototype.isub=function(U,X){this._verify2(U,X);var J=U.isub(X);if(J.cmpn(0)<0)J.iadd(this.m);return J},u.prototype.shl=function(U,X){return this._verify1(U),this.imod(U.ushln(X))},u.prototype.imul=function(U,X){return this._verify2(U,X),this.imod(U.imul(X))},u.prototype.mul=function(U,X){return this._verify2(U,X),this.imod(U.mul(X))},u.prototype.isqr=function(U){return this.imul(U,U.clone())},u.prototype.sqr=function(U){return this.mul(U,U)},u.prototype.sqrt=function(U){if(U.isZero())return U.clone();var X=this.m.andln(3);if(C(X%2===1),X===3){var J=this.m.add(new A(1)).iushrn(2);return this.pow(U,J)}var Z=this.m.subn(1),Y=0;while(!Z.isZero()&&Z.andln(1)===0)Y++,Z.iushrn(1);C(!Z.isZero());var I=new A(1).toRed(this),K=I.redNeg(),G=this.m.subn(1).iushrn(1),O=this.m.bitLength();O=new A(2*O*O).toRed(this);while(this.pow(O,G).cmp(K)!==0)O.redIAdd(K);var E=this.pow(O,Z),T=this.pow(U,Z.addn(1).iushrn(1)),D=this.pow(U,Z),v=Y;while(D.cmp(I)!==0){var g=D;for(var p=0;g.cmp(I)!==0;p++)g=g.redSqr();C(p<v);var n=this.pow(E,new A(1).iushln(v-p-1));T=T.redMul(n),E=n.redSqr(),D=D.redMul(E),v=p}return T},u.prototype.invm=function(U){var X=U._invmp(this.m);if(X.negative!==0)return X.negative=0,this.imod(X).redNeg();else return this.imod(X)},u.prototype.pow=function(U,X){if(X.isZero())return new A(1).toRed(this);if(X.cmpn(1)===0)return U.clone();var J=4,Z=Array(1<<J);Z[0]=new A(1).toRed(this),Z[1]=U;for(var Y=2;Y<Z.length;Y++)Z[Y]=this.mul(Z[Y-1],U);var I=Z[0],K=0,G=0,O=X.bitLength()%26;if(O===0)O=26;for(Y=X.length-1;Y>=0;Y--){var E=X.words[Y];for(var T=O-1;T>=0;T--){var D=E>>T&1;if(I!==Z[0])I=this.sqr(I);if(D===0&&K===0){G=0;continue}if(K<<=1,K|=D,G++,G!==J&&(Y!==0||T!==0))continue;I=this.mul(I,Z[K]),G=0,K=0}O=26}return I},u.prototype.convertTo=function(U){var X=U.umod(this.m);return X===U?X.clone():X},u.prototype.convertFrom=function(U){var X=U.clone();return X.red=null,X},A.mont=function(U){return new O0(U)};function O0(U){if(u.call(this,U),this.shift=this.m.bitLength(),this.shift%26!==0)this.shift+=26-this.shift%26;this.r=new A(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}F(O0,u),O0.prototype.convertTo=function(U){return this.imod(U.ushln(this.shift))},O0.prototype.convertFrom=function(U){var X=this.imod(U.mul(this.rinv));return X.red=null,X},O0.prototype.imul=function(U,X){if(U.isZero()||X.isZero())return U.words[0]=0,U.length=1,U;var J=U.imul(X),Z=J.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Y=J.isub(Z).iushrn(this.shift),I=Y;if(Y.cmp(this.m)>=0)I=Y.isub(this.m);else if(Y.cmpn(0)<0)I=Y.iadd(this.m);return I._forceRed(this)},O0.prototype.mul=function(U,X){if(U.isZero()||X.isZero())return new A(0)._forceRed(this);var J=U.mul(X),Z=J.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Y=J.isub(Z).iushrn(this.shift),I=Y;if(Y.cmp(this.m)>=0)I=Y.isub(this.m);else if(Y.cmpn(0)<0)I=Y.iadd(this.m);return I._forceRed(this)},O0.prototype.invm=function(U){var X=this.imod(U._invmp(this.m).mul(this.r2));return X._forceRed(this)}})(typeof $>"u"||$,Q)}),UG=$0((Q)=>{var $=NO(),V=xU(),W=Q;W.define=function(F,A){return new C(F,A)};function C(F,A){this.name=F,this.body=A,this.decoders={},this.encoders={}}C.prototype._createNamed=function(F){var A;try{A=(()=>{throw new Error("Cannot require module "+"vm");})().runInThisContext("(function "+this.name+`(entity) {
|
|
1
|
+
var YC=Object.create;var{getPrototypeOf:SC,defineProperty:TO,getOwnPropertyNames:cA,getOwnPropertyDescriptor:VC}=Object,pA=Object.prototype.hasOwnProperty;function hA($){return this[$]}var LC,RC,DC=($,I,E)=>{var L=$!=null&&typeof $==="object";if(L){var S=I?LC??=new WeakMap:RC??=new WeakMap,K=S.get($);if(K)return K}E=$!=null?YC(SC($)):{};let Q=I||!$||!$.__esModule?TO(E,"default",{value:$,enumerable:!0}):E;for(let T of cA($))if(!pA.call(Q,T))TO(Q,T,{get:hA.bind($,T),enumerable:!0});if(L)S.set($,Q);return Q},l0=($)=>{var I=(yA??=new WeakMap).get($),E;if(I)return I;if(I=TO({},"__esModule",{value:!0}),$&&typeof $==="object"||typeof $==="function"){for(var L of cA($))if(!pA.call(I,L))TO(I,L,{get:hA.bind($,L),enumerable:!(E=VC($,L))||E.enumerable})}return yA.set($,I),I},yA,KC=($,I)=>()=>(I||$((I={exports:{}}).exports,I),I.exports);var HC=($)=>$;function WC($,I){this[$]=HC.bind(null,I)}var qO=($,I)=>{for(var E in I)TO($,E,{get:I[E],enumerable:!0,configurable:!0,set:WC.bind(I,E)})};var PO=($,I)=>()=>($&&(I=$($=0)),I);var FC=(($)=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy($,{get:(I,E)=>(typeof require<"u"?require:I)[E]}):$)(function($){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+$+'" is not supported')});var RU={};qO(RU,{transcode:()=>WQ,resolveObjectURL:()=>DQ,kStringMaxLength:()=>M$,kMaxLength:()=>_O,isUtf8:()=>KQ,isAscii:()=>HQ,default:()=>FQ,constants:()=>oC,btoa:()=>uC,atob:()=>lC,INSPECT_MAX_BYTES:()=>F$,File:()=>dC,Buffer:()=>G0,Blob:()=>bC});function wC($){var I=$.length;if(I%4>0)throw Error("Invalid string. Length must be a multiple of 4");var E=$.indexOf("=");if(E===-1)E=I;var L=E===I?0:4-E%4;return[E,L]}function yC($,I){return($+I)*3/4-I}function cC($){var I,E=wC($),L=E[0],S=E[1],K=new Uint8Array(yC(L,S)),Q=0,T=S>0?L-4:L,M;for(M=0;M<T;M+=4)I=fU[$.charCodeAt(M)]<<18|fU[$.charCodeAt(M+1)]<<12|fU[$.charCodeAt(M+2)]<<6|fU[$.charCodeAt(M+3)],K[Q++]=I>>16&255,K[Q++]=I>>8&255,K[Q++]=I&255;if(S===2)I=fU[$.charCodeAt(M)]<<2|fU[$.charCodeAt(M+1)]>>4,K[Q++]=I&255;if(S===1)I=fU[$.charCodeAt(M)]<<10|fU[$.charCodeAt(M+1)]<<4|fU[$.charCodeAt(M+2)]>>2,K[Q++]=I>>8&255,K[Q++]=I&255;return K}function pC($){return hU[$>>18&63]+hU[$>>12&63]+hU[$>>6&63]+hU[$&63]}function hC($,I,E){var L,S=[];for(var K=I;K<E;K+=3)L=($[K]<<16&16711680)+($[K+1]<<8&65280)+($[K+2]&255),S.push(pC(L));return S.join("")}function L$($){var I,E=$.length,L=E%3,S=[],K=16383;for(var Q=0,T=E-L;Q<T;Q+=K)S.push(hC($,Q,Q+K>T?T:Q+K));if(L===1)I=$[E-1],S.push(hU[I>>2]+hU[I<<4&63]+"==");else if(L===2)I=($[E-2]<<8)+$[E-1],S.push(hU[I>>10]+hU[I>>4&63]+hU[I<<2&63]+"=");return S.join("")}function sO($,I,E,L,S){var K,Q,T=S*8-L-1,M=(1<<T)-1,H=M>>1,F=-7,R=E?S-1:0,D=E?-1:1,q=$[I+R];R+=D,K=q&(1<<-F)-1,q>>=-F,F+=T;for(;F>0;K=K*256+$[I+R],R+=D,F-=8);Q=K&(1<<-F)-1,K>>=-F,F+=L;for(;F>0;Q=Q*256+$[I+R],R+=D,F-=8);if(K===0)K=1-H;else if(K===M)return Q?NaN:(q?-1:1)*(1/0);else Q=Q+Math.pow(2,L),K=K-H;return(q?-1:1)*Q*Math.pow(2,K-L)}function W$($,I,E,L,S,K){var Q,T,M,H=K*8-S-1,F=(1<<H)-1,R=F>>1,D=S===23?Math.pow(2,-24)-Math.pow(2,-77):0,q=L?0:K-1,P=L?1:-1,_=I<0||I===0&&1/I<0?1:0;if(I=Math.abs(I),isNaN(I)||I===1/0)T=isNaN(I)?1:0,Q=F;else{if(Q=Math.floor(Math.log(I)/Math.LN2),I*(M=Math.pow(2,-Q))<1)Q--,M*=2;if(Q+R>=1)I+=D/M;else I+=D*Math.pow(2,1-R);if(I*M>=2)Q++,M/=2;if(Q+R>=F)T=0,Q=F;else if(Q+R>=1)T=(I*M-1)*Math.pow(2,S),Q=Q+R;else T=I*Math.pow(2,R-1)*Math.pow(2,S),Q=0}for(;S>=8;$[E+q]=T&255,q+=P,T/=256,S-=8);Q=Q<<S|T,H+=S;for(;H>0;$[E+q]=Q&255,q+=P,Q/=256,H-=8);$[E+q-P]|=_*128}function oU($){if($>_O)throw RangeError('The value "'+$+'" is invalid for option "size"');let I=new Uint8Array($);return Object.setPrototypeOf(I,G0.prototype),I}function wZ($,I,E){return class extends E{constructor(){super();Object.defineProperty(this,"message",{value:I.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${$}]`,this.stack,delete this.name}get code(){return $}set code(L){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:L,writable:!0})}toString(){return`${this.name} [${$}]: ${this.message}`}}}function G0($,I,E){if(typeof $==="number"){if(typeof I==="string")throw TypeError('The "string" argument must be of type string. Received type number');return yZ($)}return z$($,I,E)}function z$($,I,E){if(typeof $==="string")return mC($,I);if(ArrayBuffer.isView($))return rC($);if($==null)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof $);if(uU($,ArrayBuffer)||$&&uU($.buffer,ArrayBuffer))return NZ($,I,E);if(typeof SharedArrayBuffer<"u"&&(uU($,SharedArrayBuffer)||$&&uU($.buffer,SharedArrayBuffer)))return NZ($,I,E);if(typeof $==="number")throw TypeError('The "value" argument must not be of type number. Received type number');let L=$.valueOf&&$.valueOf();if(L!=null&&L!==$)return G0.from(L,I,E);let S=eC($);if(S)return S;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof $[Symbol.toPrimitive]==="function")return G0.from($[Symbol.toPrimitive]("string"),I,E);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof $)}function T$($){if(typeof $!=="number")throw TypeError('"size" argument must be of type number');else if($<0)throw RangeError('The value "'+$+'" is invalid for option "size"')}function sC($,I,E){if(T$($),$<=0)return oU($);if(I!==void 0)return typeof E==="string"?oU($).fill(I,E):oU($).fill(I);return oU($)}function yZ($){return T$($),oU($<0?0:cZ($)|0)}function mC($,I){if(typeof I!=="string"||I==="")I="utf8";if(!G0.isEncoding(I))throw TypeError("Unknown encoding: "+I);let E=q$($,I)|0,L=oU(E),S=L.write($,I);if(S!==E)L=L.slice(0,S);return L}function xZ($){let I=$.length<0?0:cZ($.length)|0,E=oU(I);for(let L=0;L<I;L+=1)E[L]=$[L]&255;return E}function rC($){if(uU($,Uint8Array)){let I=new Uint8Array($);return NZ(I.buffer,I.byteOffset,I.byteLength)}return xZ($)}function NZ($,I,E){if(I<0||$.byteLength<I)throw RangeError('"offset" is outside of buffer bounds');if($.byteLength<I+(E||0))throw RangeError('"length" is outside of buffer bounds');let L;if(I===void 0&&E===void 0)L=new Uint8Array($);else if(E===void 0)L=new Uint8Array($,I);else L=new Uint8Array($,I,E);return Object.setPrototypeOf(L,G0.prototype),L}function eC($){if(G0.isBuffer($)){let I=cZ($.length)|0,E=oU(I);if(E.length===0)return E;return $.copy(E,0,0,I),E}if($.length!==void 0){if(typeof $.length!=="number"||Number.isNaN($.length))return oU(0);return xZ($)}if($.type==="Buffer"&&Array.isArray($.data))return xZ($.data)}function cZ($){if($>=_O)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+_O.toString(16)+" bytes");return $|0}function q$($,I){if(G0.isBuffer($))return $.length;if(ArrayBuffer.isView($)||uU($,ArrayBuffer))return $.byteLength;if(typeof $!=="string")throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof $);let E=$.length,L=arguments.length>2&&arguments[2]===!0;if(!L&&E===0)return 0;let S=!1;for(;;)switch(I){case"ascii":case"latin1":case"binary":return E;case"utf8":case"utf-8":return fZ($).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return E*2;case"hex":return E>>>1;case"base64":return N$($).length;default:if(S)return L?-1:fZ($).length;I=(""+I).toLowerCase(),S=!0}}function aC($,I,E){let L=!1;if(I===void 0||I<0)I=0;if(I>this.length)return"";if(E===void 0||E>this.length)E=this.length;if(E<=0)return"";if(E>>>=0,I>>>=0,E<=I)return"";if(!$)$="utf8";while(!0)switch($){case"hex":return XQ(this,I,E);case"utf8":case"utf-8":return k$(this,I,E);case"ascii":return CQ(this,I,E);case"latin1":case"binary":return QQ(this,I,E);case"base64":return $Q(this,I,E);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return GQ(this,I,E);default:if(L)throw TypeError("Unknown encoding: "+$);$=($+"").toLowerCase(),L=!0}}function IO($,I,E){let L=$[I];$[I]=$[E],$[E]=L}function P$($,I,E,L,S){if($.length===0)return-1;if(typeof E==="string")L=E,E=0;else if(E>2147483647)E=2147483647;else if(E<-2147483648)E=-2147483648;if(E=+E,Number.isNaN(E))E=S?0:$.length-1;if(E<0)E=$.length+E;if(E>=$.length)if(S)return-1;else E=$.length-1;else if(E<0)if(S)E=0;else return-1;if(typeof I==="string")I=G0.from(I,L);if(G0.isBuffer(I)){if(I.length===0)return-1;return D$($,I,E,L,S)}else if(typeof I==="number"){if(I=I&255,typeof Uint8Array.prototype.indexOf==="function")if(S)return Uint8Array.prototype.indexOf.call($,I,E);else return Uint8Array.prototype.lastIndexOf.call($,I,E);return D$($,[I],E,L,S)}throw TypeError("val must be string, number or Buffer")}function D$($,I,E,L,S){let K=1,Q=$.length,T=I.length;if(L!==void 0){if(L=String(L).toLowerCase(),L==="ucs2"||L==="ucs-2"||L==="utf16le"||L==="utf-16le"){if($.length<2||I.length<2)return-1;K=2,Q/=2,T/=2,E/=2}}function M(F,R){if(K===1)return F[R];else return F.readUInt16BE(R*K)}let H;if(S){let F=-1;for(H=E;H<Q;H++)if(M($,H)===M(I,F===-1?0:H-F)){if(F===-1)F=H;if(H-F+1===T)return F*K}else{if(F!==-1)H-=H-F;F=-1}}else{if(E+T>Q)E=Q-T;for(H=E;H>=0;H--){let F=!0;for(let R=0;R<T;R++)if(M($,H+R)!==M(I,R)){F=!1;break}if(F)return H}}return-1}function iC($,I,E,L){E=Number(E)||0;let S=$.length-E;if(!L)L=S;else if(L=Number(L),L>S)L=S;let K=I.length;if(L>K/2)L=K/2;let Q;for(Q=0;Q<L;++Q){let T=parseInt(I.substr(Q*2,2),16);if(Number.isNaN(T))return Q;$[E+Q]=T}return Q}function UQ($,I,E,L){return mO(fZ(I,$.length-E),$,E,L)}function OQ($,I,E,L){return mO(SQ(I),$,E,L)}function ZQ($,I,E,L){return mO(N$(I),$,E,L)}function AQ($,I,E,L){return mO(VQ(I,$.length-E),$,E,L)}function $Q($,I,E){if(I===0&&E===$.length)return L$($);else return L$($.slice(I,E))}function k$($,I,E){E=Math.min($.length,E);let L=[],S=I;while(S<E){let K=$[S],Q=null,T=K>239?4:K>223?3:K>191?2:1;if(S+T<=E){let M,H,F,R;switch(T){case 1:if(K<128)Q=K;break;case 2:if(M=$[S+1],(M&192)===128){if(R=(K&31)<<6|M&63,R>127)Q=R}break;case 3:if(M=$[S+1],H=$[S+2],(M&192)===128&&(H&192)===128){if(R=(K&15)<<12|(M&63)<<6|H&63,R>2047&&(R<55296||R>57343))Q=R}break;case 4:if(M=$[S+1],H=$[S+2],F=$[S+3],(M&192)===128&&(H&192)===128&&(F&192)===128){if(R=(K&15)<<18|(M&63)<<12|(H&63)<<6|F&63,R>65535&&R<1114112)Q=R}}}if(Q===null)Q=65533,T=1;else if(Q>65535)Q-=65536,L.push(Q>>>10&1023|55296),Q=56320|Q&1023;L.push(Q),S+=T}return IQ(L)}function IQ($){let I=$.length;if(I<=K$)return String.fromCharCode.apply(String,$);let E="",L=0;while(L<I)E+=String.fromCharCode.apply(String,$.slice(L,L+=K$));return E}function CQ($,I,E){let L="";E=Math.min($.length,E);for(let S=I;S<E;++S)L+=String.fromCharCode($[S]&127);return L}function QQ($,I,E){let L="";E=Math.min($.length,E);for(let S=I;S<E;++S)L+=String.fromCharCode($[S]);return L}function XQ($,I,E){let L=$.length;if(!I||I<0)I=0;if(!E||E<0||E>L)E=L;let S="";for(let K=I;K<E;++K)S+=LQ[$[K]];return S}function GQ($,I,E){let L=$.slice(I,E),S="";for(let K=0;K<L.length-1;K+=2)S+=String.fromCharCode(L[K]+L[K+1]*256);return S}function LU($,I,E){if($%1!==0||$<0)throw RangeError("offset is not uint");if($+I>E)throw RangeError("Trying to access beyond buffer length")}function kU($,I,E,L,S,K){if(!G0.isBuffer($))throw TypeError('"buffer" argument must be a Buffer instance');if(I>S||I<K)throw RangeError('"value" argument is out of bounds');if(E+L>$.length)throw RangeError("Index out of range")}function _$($,I,E,L,S){x$(I,L,S,$,E,7);let K=Number(I&BigInt(4294967295));$[E++]=K,K=K>>8,$[E++]=K,K=K>>8,$[E++]=K,K=K>>8,$[E++]=K;let Q=Number(I>>BigInt(32)&BigInt(4294967295));return $[E++]=Q,Q=Q>>8,$[E++]=Q,Q=Q>>8,$[E++]=Q,Q=Q>>8,$[E++]=Q,E}function j$($,I,E,L,S){x$(I,L,S,$,E,7);let K=Number(I&BigInt(4294967295));$[E+7]=K,K=K>>8,$[E+6]=K,K=K>>8,$[E+5]=K,K=K>>8,$[E+4]=K;let Q=Number(I>>BigInt(32)&BigInt(4294967295));return $[E+3]=Q,Q=Q>>8,$[E+2]=Q,Q=Q>>8,$[E+1]=Q,Q=Q>>8,$[E]=Q,E+8}function v$($,I,E,L,S,K){if(E+L>$.length)throw RangeError("Index out of range");if(E<0)throw RangeError("Index out of range")}function B$($,I,E,L,S){if(I=+I,E=E>>>0,!S)v$($,I,E,4,340282346638528860000000000000000000000,-340282346638528860000000000000000000000);return W$($,I,E,L,23,4),E+4}function g$($,I,E,L,S){if(I=+I,E=E>>>0,!S)v$($,I,E,8,179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000,-179769313486231570000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000);return W$($,I,E,L,52,8),E+8}function H$($){let I="",E=$.length,L=$[0]==="-"?1:0;for(;E>=L+4;E-=3)I=`_${$.slice(E-3,E)}${I}`;return`${$.slice(0,E)}${I}`}function EQ($,I,E){if(DO(I,"offset"),$[I]===void 0||$[I+E]===void 0)jO(I,$.length-(E+1))}function x$($,I,E,L,S,K){if($>E||$<I){let Q=typeof I==="bigint"?"n":"",T;if(K>3)if(I===0||I===BigInt(0))T=`>= 0${Q} and < 2${Q} ** ${(K+1)*8}${Q}`;else T=`>= -(2${Q} ** ${(K+1)*8-1}${Q}) and < 2 ** ${(K+1)*8-1}${Q}`;else T=`>= ${I}${Q} and <= ${E}${Q}`;throw new gZ("value",T,$)}EQ(L,S,K)}function DO($,I){if(typeof $!=="number")throw new tC(I,"number",$)}function jO($,I,E){if(Math.floor($)!==$)throw DO($,E),new gZ(E||"offset","an integer",$);if(I<0)throw new nC;throw new gZ(E||"offset",`>= ${E?1:0} and <= ${I}`,$)}function YQ($){if($=$.split("=")[0],$=$.trim().replace(JQ,""),$.length<2)return"";while($.length%4!==0)$=$+"=";return $}function fZ($,I){I=I||1/0;let E,L=$.length,S=null,K=[];for(let Q=0;Q<L;++Q){if(E=$.charCodeAt(Q),E>55295&&E<57344){if(!S){if(E>56319){if((I-=3)>-1)K.push(239,191,189);continue}else if(Q+1===L){if((I-=3)>-1)K.push(239,191,189);continue}S=E;continue}if(E<56320){if((I-=3)>-1)K.push(239,191,189);S=E;continue}E=(S-55296<<10|E-56320)+65536}else if(S){if((I-=3)>-1)K.push(239,191,189)}if(S=null,E<128){if((I-=1)<0)break;K.push(E)}else if(E<2048){if((I-=2)<0)break;K.push(E>>6|192,E&63|128)}else if(E<65536){if((I-=3)<0)break;K.push(E>>12|224,E>>6&63|128,E&63|128)}else if(E<1114112){if((I-=4)<0)break;K.push(E>>18|240,E>>12&63|128,E>>6&63|128,E&63|128)}else throw Error("Invalid code point")}return K}function SQ($){let I=[];for(let E=0;E<$.length;++E)I.push($.charCodeAt(E)&255);return I}function VQ($,I){let E,L,S,K=[];for(let Q=0;Q<$.length;++Q){if((I-=2)<0)break;E=$.charCodeAt(Q),L=E>>8,S=E%256,K.push(S),K.push(L)}return K}function N$($){return cC(YQ($))}function mO($,I,E,L){let S;for(S=0;S<L;++S){if(S+E>=I.length||S>=$.length)break;I[S+E]=$[S]}return S}function uU($,I){return $ instanceof I||$!=null&&$.constructor!=null&&$.constructor.name!=null&&$.constructor.name===I.name}function eU($){return typeof BigInt>"u"?RQ:$}function RQ(){throw Error("BigInt not supported")}function pZ($){return()=>{throw Error($+" is not implemented for node:buffer browser polyfill")}}var hU,fU,BZ="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",$O,V$,R$,F$=50,_O=2147483647,M$=536870888,uC,lC,dC,bC,oC,nC,tC,gZ,K$=4096,JQ,LQ,DQ,KQ,HQ=($)=>{for(let I of $)if(I.charCodeAt(0)>127)return!1;return!0},WQ,FQ;var DU=PO(()=>{hU=[],fU=[];for($O=0,V$=BZ.length;$O<V$;++$O)hU[$O]=BZ[$O],fU[BZ.charCodeAt($O)]=$O;fU[45]=62;fU[95]=63;R$=typeof Symbol==="function"&&typeof Symbol.for==="function"?Symbol.for("nodejs.util.inspect.custom"):null,uC=globalThis.btoa,lC=globalThis.atob,dC=globalThis.File,bC=globalThis.Blob,oC={MAX_LENGTH:_O,MAX_STRING_LENGTH:M$};nC=wZ("ERR_BUFFER_OUT_OF_BOUNDS",function($){if($)return`${$} is outside of buffer bounds`;return"Attempt to access memory outside buffer bounds"},RangeError),tC=wZ("ERR_INVALID_ARG_TYPE",function($,I){return`The "${$}" argument must be of type number. Received type ${typeof I}`},TypeError),gZ=wZ("ERR_OUT_OF_RANGE",function($,I,E){let L=`The value of "${$}" is out of range.`,S=E;if(Number.isInteger(E)&&Math.abs(E)>4294967296)S=H$(String(E));else if(typeof E==="bigint"){if(S=String(E),E>BigInt(2)**BigInt(32)||E<-(BigInt(2)**BigInt(32)))S=H$(S);S+="n"}return L+=` It must be ${I}. Received ${S}`,L},RangeError);Object.defineProperty(G0.prototype,"parent",{enumerable:!0,get:function(){if(!G0.isBuffer(this))return;return this.buffer}});Object.defineProperty(G0.prototype,"offset",{enumerable:!0,get:function(){if(!G0.isBuffer(this))return;return this.byteOffset}});G0.poolSize=8192;G0.from=function($,I,E){return z$($,I,E)};Object.setPrototypeOf(G0.prototype,Uint8Array.prototype);Object.setPrototypeOf(G0,Uint8Array);G0.alloc=function($,I,E){return sC($,I,E)};G0.allocUnsafe=function($){return yZ($)};G0.allocUnsafeSlow=function($){return yZ($)};G0.isBuffer=function($){return $!=null&&$._isBuffer===!0&&$!==G0.prototype};G0.compare=function($,I){if(uU($,Uint8Array))$=G0.from($,$.offset,$.byteLength);if(uU(I,Uint8Array))I=G0.from(I,I.offset,I.byteLength);if(!G0.isBuffer($)||!G0.isBuffer(I))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if($===I)return 0;let E=$.length,L=I.length;for(let S=0,K=Math.min(E,L);S<K;++S)if($[S]!==I[S]){E=$[S],L=I[S];break}if(E<L)return-1;if(L<E)return 1;return 0};G0.isEncoding=function($){switch(String($).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}};G0.concat=function($,I){if(!Array.isArray($))throw TypeError('"list" argument must be an Array of Buffers');if($.length===0)return G0.alloc(0);let E;if(I===void 0){I=0;for(E=0;E<$.length;++E)I+=$[E].length}let L=G0.allocUnsafe(I),S=0;for(E=0;E<$.length;++E){let K=$[E];if(uU(K,Uint8Array))if(S+K.length>L.length){if(!G0.isBuffer(K))K=G0.from(K);K.copy(L,S)}else Uint8Array.prototype.set.call(L,K,S);else if(!G0.isBuffer(K))throw TypeError('"list" argument must be an Array of Buffers');else K.copy(L,S);S+=K.length}return L};G0.byteLength=q$;G0.prototype._isBuffer=!0;G0.prototype.swap16=function(){let $=this.length;if($%2!==0)throw RangeError("Buffer size must be a multiple of 16-bits");for(let I=0;I<$;I+=2)IO(this,I,I+1);return this};G0.prototype.swap32=function(){let $=this.length;if($%4!==0)throw RangeError("Buffer size must be a multiple of 32-bits");for(let I=0;I<$;I+=4)IO(this,I,I+3),IO(this,I+1,I+2);return this};G0.prototype.swap64=function(){let $=this.length;if($%8!==0)throw RangeError("Buffer size must be a multiple of 64-bits");for(let I=0;I<$;I+=8)IO(this,I,I+7),IO(this,I+1,I+6),IO(this,I+2,I+5),IO(this,I+3,I+4);return this};G0.prototype.toString=function(){let $=this.length;if($===0)return"";if(arguments.length===0)return k$(this,0,$);return aC.apply(this,arguments)};G0.prototype.toLocaleString=G0.prototype.toString;G0.prototype.equals=function($){if(!G0.isBuffer($))throw TypeError("Argument must be a Buffer");if(this===$)return!0;return G0.compare(this,$)===0};G0.prototype.inspect=function(){let $="",I=F$;if($=this.toString("hex",0,I).replace(/(.{2})/g,"$1 ").trim(),this.length>I)$+=" ... ";return"<Buffer "+$+">"};if(R$)G0.prototype[R$]=G0.prototype.inspect;G0.prototype.compare=function($,I,E,L,S){if(uU($,Uint8Array))$=G0.from($,$.offset,$.byteLength);if(!G0.isBuffer($))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof $);if(I===void 0)I=0;if(E===void 0)E=$?$.length:0;if(L===void 0)L=0;if(S===void 0)S=this.length;if(I<0||E>$.length||L<0||S>this.length)throw RangeError("out of range index");if(L>=S&&I>=E)return 0;if(L>=S)return-1;if(I>=E)return 1;if(I>>>=0,E>>>=0,L>>>=0,S>>>=0,this===$)return 0;let K=S-L,Q=E-I,T=Math.min(K,Q),M=this.slice(L,S),H=$.slice(I,E);for(let F=0;F<T;++F)if(M[F]!==H[F]){K=M[F],Q=H[F];break}if(K<Q)return-1;if(Q<K)return 1;return 0};G0.prototype.includes=function($,I,E){return this.indexOf($,I,E)!==-1};G0.prototype.indexOf=function($,I,E){return P$(this,$,I,E,!0)};G0.prototype.lastIndexOf=function($,I,E){return P$(this,$,I,E,!1)};G0.prototype.write=function($,I,E,L){if(I===void 0)L="utf8",E=this.length,I=0;else if(E===void 0&&typeof I==="string")L=I,E=this.length,I=0;else if(isFinite(I))if(I=I>>>0,isFinite(E)){if(E=E>>>0,L===void 0)L="utf8"}else L=E,E=void 0;else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let S=this.length-I;if(E===void 0||E>S)E=S;if($.length>0&&(E<0||I<0)||I>this.length)throw RangeError("Attempt to write outside buffer bounds");if(!L)L="utf8";let K=!1;for(;;)switch(L){case"hex":return iC(this,$,I,E);case"utf8":case"utf-8":return UQ(this,$,I,E);case"ascii":case"latin1":case"binary":return OQ(this,$,I,E);case"base64":return ZQ(this,$,I,E);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return AQ(this,$,I,E);default:if(K)throw TypeError("Unknown encoding: "+L);L=(""+L).toLowerCase(),K=!0}};G0.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};G0.prototype.slice=function($,I){let E=this.length;if($=~~$,I=I===void 0?E:~~I,$<0){if($+=E,$<0)$=0}else if($>E)$=E;if(I<0){if(I+=E,I<0)I=0}else if(I>E)I=E;if(I<$)I=$;let L=this.subarray($,I);return Object.setPrototypeOf(L,G0.prototype),L};G0.prototype.readUintLE=G0.prototype.readUIntLE=function($,I,E){if($=$>>>0,I=I>>>0,!E)LU($,I,this.length);let L=this[$],S=1,K=0;while(++K<I&&(S*=256))L+=this[$+K]*S;return L};G0.prototype.readUintBE=G0.prototype.readUIntBE=function($,I,E){if($=$>>>0,I=I>>>0,!E)LU($,I,this.length);let L=this[$+--I],S=1;while(I>0&&(S*=256))L+=this[$+--I]*S;return L};G0.prototype.readUint8=G0.prototype.readUInt8=function($,I){if($=$>>>0,!I)LU($,1,this.length);return this[$]};G0.prototype.readUint16LE=G0.prototype.readUInt16LE=function($,I){if($=$>>>0,!I)LU($,2,this.length);return this[$]|this[$+1]<<8};G0.prototype.readUint16BE=G0.prototype.readUInt16BE=function($,I){if($=$>>>0,!I)LU($,2,this.length);return this[$]<<8|this[$+1]};G0.prototype.readUint32LE=G0.prototype.readUInt32LE=function($,I){if($=$>>>0,!I)LU($,4,this.length);return(this[$]|this[$+1]<<8|this[$+2]<<16)+this[$+3]*16777216};G0.prototype.readUint32BE=G0.prototype.readUInt32BE=function($,I){if($=$>>>0,!I)LU($,4,this.length);return this[$]*16777216+(this[$+1]<<16|this[$+2]<<8|this[$+3])};G0.prototype.readBigUInt64LE=eU(function($){$=$>>>0,DO($,"offset");let I=this[$],E=this[$+7];if(I===void 0||E===void 0)jO($,this.length-8);let L=I+this[++$]*256+this[++$]*65536+this[++$]*16777216,S=this[++$]+this[++$]*256+this[++$]*65536+E*16777216;return BigInt(L)+(BigInt(S)<<BigInt(32))});G0.prototype.readBigUInt64BE=eU(function($){$=$>>>0,DO($,"offset");let I=this[$],E=this[$+7];if(I===void 0||E===void 0)jO($,this.length-8);let L=I*16777216+this[++$]*65536+this[++$]*256+this[++$],S=this[++$]*16777216+this[++$]*65536+this[++$]*256+E;return(BigInt(L)<<BigInt(32))+BigInt(S)});G0.prototype.readIntLE=function($,I,E){if($=$>>>0,I=I>>>0,!E)LU($,I,this.length);let L=this[$],S=1,K=0;while(++K<I&&(S*=256))L+=this[$+K]*S;if(S*=128,L>=S)L-=Math.pow(2,8*I);return L};G0.prototype.readIntBE=function($,I,E){if($=$>>>0,I=I>>>0,!E)LU($,I,this.length);let L=I,S=1,K=this[$+--L];while(L>0&&(S*=256))K+=this[$+--L]*S;if(S*=128,K>=S)K-=Math.pow(2,8*I);return K};G0.prototype.readInt8=function($,I){if($=$>>>0,!I)LU($,1,this.length);if(!(this[$]&128))return this[$];return(255-this[$]+1)*-1};G0.prototype.readInt16LE=function($,I){if($=$>>>0,!I)LU($,2,this.length);let E=this[$]|this[$+1]<<8;return E&32768?E|4294901760:E};G0.prototype.readInt16BE=function($,I){if($=$>>>0,!I)LU($,2,this.length);let E=this[$+1]|this[$]<<8;return E&32768?E|4294901760:E};G0.prototype.readInt32LE=function($,I){if($=$>>>0,!I)LU($,4,this.length);return this[$]|this[$+1]<<8|this[$+2]<<16|this[$+3]<<24};G0.prototype.readInt32BE=function($,I){if($=$>>>0,!I)LU($,4,this.length);return this[$]<<24|this[$+1]<<16|this[$+2]<<8|this[$+3]};G0.prototype.readBigInt64LE=eU(function($){$=$>>>0,DO($,"offset");let I=this[$],E=this[$+7];if(I===void 0||E===void 0)jO($,this.length-8);let L=this[$+4]+this[$+5]*256+this[$+6]*65536+(E<<24);return(BigInt(L)<<BigInt(32))+BigInt(I+this[++$]*256+this[++$]*65536+this[++$]*16777216)});G0.prototype.readBigInt64BE=eU(function($){$=$>>>0,DO($,"offset");let I=this[$],E=this[$+7];if(I===void 0||E===void 0)jO($,this.length-8);let L=(I<<24)+this[++$]*65536+this[++$]*256+this[++$];return(BigInt(L)<<BigInt(32))+BigInt(this[++$]*16777216+this[++$]*65536+this[++$]*256+E)});G0.prototype.readFloatLE=function($,I){if($=$>>>0,!I)LU($,4,this.length);return sO(this,$,!0,23,4)};G0.prototype.readFloatBE=function($,I){if($=$>>>0,!I)LU($,4,this.length);return sO(this,$,!1,23,4)};G0.prototype.readDoubleLE=function($,I){if($=$>>>0,!I)LU($,8,this.length);return sO(this,$,!0,52,8)};G0.prototype.readDoubleBE=function($,I){if($=$>>>0,!I)LU($,8,this.length);return sO(this,$,!1,52,8)};G0.prototype.writeUintLE=G0.prototype.writeUIntLE=function($,I,E,L){if($=+$,I=I>>>0,E=E>>>0,!L){let Q=Math.pow(2,8*E)-1;kU(this,$,I,E,Q,0)}let S=1,K=0;this[I]=$&255;while(++K<E&&(S*=256))this[I+K]=$/S&255;return I+E};G0.prototype.writeUintBE=G0.prototype.writeUIntBE=function($,I,E,L){if($=+$,I=I>>>0,E=E>>>0,!L){let Q=Math.pow(2,8*E)-1;kU(this,$,I,E,Q,0)}let S=E-1,K=1;this[I+S]=$&255;while(--S>=0&&(K*=256))this[I+S]=$/K&255;return I+E};G0.prototype.writeUint8=G0.prototype.writeUInt8=function($,I,E){if($=+$,I=I>>>0,!E)kU(this,$,I,1,255,0);return this[I]=$&255,I+1};G0.prototype.writeUint16LE=G0.prototype.writeUInt16LE=function($,I,E){if($=+$,I=I>>>0,!E)kU(this,$,I,2,65535,0);return this[I]=$&255,this[I+1]=$>>>8,I+2};G0.prototype.writeUint16BE=G0.prototype.writeUInt16BE=function($,I,E){if($=+$,I=I>>>0,!E)kU(this,$,I,2,65535,0);return this[I]=$>>>8,this[I+1]=$&255,I+2};G0.prototype.writeUint32LE=G0.prototype.writeUInt32LE=function($,I,E){if($=+$,I=I>>>0,!E)kU(this,$,I,4,4294967295,0);return this[I+3]=$>>>24,this[I+2]=$>>>16,this[I+1]=$>>>8,this[I]=$&255,I+4};G0.prototype.writeUint32BE=G0.prototype.writeUInt32BE=function($,I,E){if($=+$,I=I>>>0,!E)kU(this,$,I,4,4294967295,0);return this[I]=$>>>24,this[I+1]=$>>>16,this[I+2]=$>>>8,this[I+3]=$&255,I+4};G0.prototype.writeBigUInt64LE=eU(function($,I=0){return _$(this,$,I,BigInt(0),BigInt("0xffffffffffffffff"))});G0.prototype.writeBigUInt64BE=eU(function($,I=0){return j$(this,$,I,BigInt(0),BigInt("0xffffffffffffffff"))});G0.prototype.writeIntLE=function($,I,E,L){if($=+$,I=I>>>0,!L){let T=Math.pow(2,8*E-1);kU(this,$,I,E,T-1,-T)}let S=0,K=1,Q=0;this[I]=$&255;while(++S<E&&(K*=256)){if($<0&&Q===0&&this[I+S-1]!==0)Q=1;this[I+S]=($/K>>0)-Q&255}return I+E};G0.prototype.writeIntBE=function($,I,E,L){if($=+$,I=I>>>0,!L){let T=Math.pow(2,8*E-1);kU(this,$,I,E,T-1,-T)}let S=E-1,K=1,Q=0;this[I+S]=$&255;while(--S>=0&&(K*=256)){if($<0&&Q===0&&this[I+S+1]!==0)Q=1;this[I+S]=($/K>>0)-Q&255}return I+E};G0.prototype.writeInt8=function($,I,E){if($=+$,I=I>>>0,!E)kU(this,$,I,1,127,-128);if($<0)$=255+$+1;return this[I]=$&255,I+1};G0.prototype.writeInt16LE=function($,I,E){if($=+$,I=I>>>0,!E)kU(this,$,I,2,32767,-32768);return this[I]=$&255,this[I+1]=$>>>8,I+2};G0.prototype.writeInt16BE=function($,I,E){if($=+$,I=I>>>0,!E)kU(this,$,I,2,32767,-32768);return this[I]=$>>>8,this[I+1]=$&255,I+2};G0.prototype.writeInt32LE=function($,I,E){if($=+$,I=I>>>0,!E)kU(this,$,I,4,2147483647,-2147483648);return this[I]=$&255,this[I+1]=$>>>8,this[I+2]=$>>>16,this[I+3]=$>>>24,I+4};G0.prototype.writeInt32BE=function($,I,E){if($=+$,I=I>>>0,!E)kU(this,$,I,4,2147483647,-2147483648);if($<0)$=4294967295+$+1;return this[I]=$>>>24,this[I+1]=$>>>16,this[I+2]=$>>>8,this[I+3]=$&255,I+4};G0.prototype.writeBigInt64LE=eU(function($,I=0){return _$(this,$,I,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});G0.prototype.writeBigInt64BE=eU(function($,I=0){return j$(this,$,I,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});G0.prototype.writeFloatLE=function($,I,E){return B$(this,$,I,!0,E)};G0.prototype.writeFloatBE=function($,I,E){return B$(this,$,I,!1,E)};G0.prototype.writeDoubleLE=function($,I,E){return g$(this,$,I,!0,E)};G0.prototype.writeDoubleBE=function($,I,E){return g$(this,$,I,!1,E)};G0.prototype.copy=function($,I,E,L){if(!G0.isBuffer($))throw TypeError("argument should be a Buffer");if(!E)E=0;if(!L&&L!==0)L=this.length;if(I>=$.length)I=$.length;if(!I)I=0;if(L>0&&L<E)L=E;if(L===E)return 0;if($.length===0||this.length===0)return 0;if(I<0)throw RangeError("targetStart out of bounds");if(E<0||E>=this.length)throw RangeError("Index out of range");if(L<0)throw RangeError("sourceEnd out of bounds");if(L>this.length)L=this.length;if($.length-I<L-E)L=$.length-I+E;let S=L-E;if(this===$&&typeof Uint8Array.prototype.copyWithin==="function")this.copyWithin(I,E,L);else Uint8Array.prototype.set.call($,this.subarray(E,L),I);return S};G0.prototype.fill=function($,I,E,L){if(typeof $==="string"){if(typeof I==="string")L=I,I=0,E=this.length;else if(typeof E==="string")L=E,E=this.length;if(L!==void 0&&typeof L!=="string")throw TypeError("encoding must be a string");if(typeof L==="string"&&!G0.isEncoding(L))throw TypeError("Unknown encoding: "+L);if($.length===1){let K=$.charCodeAt(0);if(L==="utf8"&&K<128||L==="latin1")$=K}}else if(typeof $==="number")$=$&255;else if(typeof $==="boolean")$=Number($);if(I<0||this.length<I||this.length<E)throw RangeError("Out of range index");if(E<=I)return this;if(I=I>>>0,E=E===void 0?this.length:E>>>0,!$)$=0;let S;if(typeof $==="number")for(S=I;S<E;++S)this[S]=$;else{let K=G0.isBuffer($)?$:G0.from($,L),Q=K.length;if(Q===0)throw TypeError('The value "'+$+'" is invalid for argument "value"');for(S=0;S<E-I;++S)this[S+I]=K[S%Q]}return this};JQ=/[^+/0-9A-Za-z-_]/g;LQ=function(){let $=Array(256);for(let I=0;I<16;++I){let E=I*16;for(let L=0;L<16;++L)$[E+L]="0123456789abcdef"[I]+"0123456789abcdef"[L]}return $}();DQ=pZ("resolveObjectURL"),KQ=pZ("isUtf8"),WQ=pZ("transcode"),FQ=G0});var BO={};qO(BO,{setMaxListeners:()=>o$,once:()=>d$,listenerCount:()=>n$,init:()=>aU,getMaxListeners:()=>s$,getEventListeners:()=>b$,default:()=>vQ,captureRejectionSymbol:()=>p$,addAbortListener:()=>m$,EventEmitter:()=>aU});function h$($,I){var{_events:E}=$;if(I[0]??=Error("Unhandled error."),!E)throw I[0];var L=E[c$];if(L)for(var S of w$.call(L))S.apply($,I);var K=E.error;if(!K)throw I[0];for(var S of w$.call(K))S.apply($,I);return!0}function TQ($,I,E,L){I.then(void 0,function(S){queueMicrotask(()=>qQ($,S,E,L))})}function qQ($,I,E,L){if(typeof $[f$]==="function")$[f$](I,E,...L);else try{$[CO]=!1,$.emit("error",I)}finally{$[CO]=!0}}function u$($,I,E){E.warned=!0;let L=Error(`Possible EventEmitter memory leak detected. ${E.length} ${String(I)} listeners added to [${$.constructor.name}]. Use emitter.setMaxListeners() to increase limit`);L.name="MaxListenersExceededWarning",L.emitter=$,L.type=I,L.count=E.length,console.warn(L)}function l$($,I,...E){this.removeListener($,I),I.apply(this,E)}function d$($,I,E){var L=E?.signal;if(t$(L,"options.signal"),L?.aborted)throw new hZ(void 0,{cause:L?.reason});let{resolve:S,reject:K,promise:Q}=$newPromiseCapability(Promise),T=(F)=>{if($.removeListener(I,M),L!=null)rO(L,"abort",H);K(F)},M=(...F)=>{if(typeof $.removeListener==="function")$.removeListener("error",T);if(L!=null)rO(L,"abort",H);S(F)};if(y$($,I,M,{once:!0}),I!=="error"&&typeof $.once==="function")$.once("error",T);function H(){rO($,I,M),rO($,"error",T),K(new hZ(void 0,{cause:L?.reason}))}if(L!=null)y$(L,"abort",H,{once:!0});return Q}function b$($,I){return $.listeners(I)}function o$($,...I){lZ($,"setMaxListeners",0);var E;if(I&&(E=I.length))for(let L=0;L<E;L++)I[L].setMaxListeners($);else QO=$}function n$($,I){return $.listenerCount(I)}function rO($,I,E,L){if(typeof $.removeListener==="function")$.removeListener(I,E);else $.removeEventListener(I,E,L)}function y$($,I,E,L){if(typeof $.on==="function")if(L.once)$.once(I,E);else $.on(I,E);else $.addEventListener(I,E,L)}function KO($,I,E){let L=TypeError(`The "${$}" argument must be of type ${I}. Received ${E}`);return L.code="ERR_INVALID_ARG_TYPE",L}function _Q($,I,E){let L=RangeError(`The "${$}" argument is out of range. It must be ${I}. Received ${E}`);return L.code="ERR_OUT_OF_RANGE",L}function t$($,I){if($!==void 0&&($===null||typeof $!=="object"||!("aborted"in $)))throw KO(I,"AbortSignal",$)}function lZ($,I,E,L){if(typeof $!=="number")throw KO(I,"number",$);if(E!=null&&$<E||L!=null&&$>L||(E!=null||L!=null)&&Number.isNaN($))throw _Q(I,`${E!=null?`>= ${E}`:""}${E!=null&&L!=null?" && ":""}${L!=null?`<= ${L}`:""}`,$)}function vO($){if(typeof $!=="function")throw TypeError("The listener must be a function")}function jQ($,I){if(typeof $!=="boolean")throw KO(I,"boolean",$)}function s$($){return $?._maxListeners??QO}function m$($,I){if($===void 0)throw KO("signal","AbortSignal",$);if(t$($,"signal"),typeof I!=="function")throw KO("listener","function",I);let E;if($.aborted)queueMicrotask(()=>I());else $.addEventListener("abort",I,{__proto__:null,once:!0}),E=()=>{$.removeEventListener("abort",I)};return{__proto__:null,[Symbol.dispose](){E?.()}}}var uZ,CO,c$,MQ,zQ,f$,p$,w$,QO=10,aU=function($){if(this._events===void 0||this._events===this.__proto__._events)this._events={__proto__:null},this._eventsCount=0;if(this._maxListeners??=void 0,this[CO]=$?.captureRejections?Boolean($?.captureRejections):n0[CO])this.emit=kQ},n0,PQ=function($,...I){if($==="error")return h$(this,I);var{_events:E}=this;if(E===void 0)return!1;var L=E[$];if(L===void 0)return!1;let S=L.length>1?L.slice():L;for(let K=0,{length:Q}=S;K<Q;K++){let T=S[K];switch(I.length){case 0:T.call(this);break;case 1:T.call(this,I[0]);break;case 2:T.call(this,I[0],I[1]);break;case 3:T.call(this,I[0],I[1],I[2]);break;default:T.apply(this,I);break}}return!0},kQ=function($,...I){if($==="error")return h$(this,I);var{_events:E}=this;if(E===void 0)return!1;var L=E[$];if(L===void 0)return!1;let S=L.length>1?L.slice():L;for(let K=0,{length:Q}=S;K<Q;K++){let T=S[K],M;switch(I.length){case 0:M=T.call(this);break;case 1:M=T.call(this,I[0]);break;case 2:M=T.call(this,I[0],I[1]);break;case 3:M=T.call(this,I[0],I[1],I[2]);break;default:M=T.apply(this,I);break}if(M!==void 0&&typeof M?.then==="function"&&M.then===Promise.prototype.then)TQ(this,M,$,I)}return!0},hZ,vQ;var gO=PO(()=>{uZ=Symbol.for,CO=Symbol("kCapture"),c$=uZ("events.errorMonitor"),MQ=Symbol("events.maxEventTargetListeners"),zQ=Symbol("events.maxEventTargetListenersWarned"),f$=uZ("nodejs.rejection"),p$=uZ("nodejs.rejection"),w$=Array.prototype.slice,n0=aU.prototype={};n0._events=void 0;n0._eventsCount=0;n0._maxListeners=void 0;n0.setMaxListeners=function($){return lZ($,"setMaxListeners",0),this._maxListeners=$,this};n0.constructor=aU;n0.getMaxListeners=function(){return this?._maxListeners??QO};n0.emit=PQ;n0.addListener=function($,I){vO(I);var E=this._events;if(!E)E=this._events={__proto__:null},this._eventsCount=0;else if(E.newListener)this.emit("newListener",$,I.listener??I);var L=E[$];if(!L)E[$]=[I],this._eventsCount++;else{L.push(I);var S=this._maxListeners??QO;if(S>0&&L.length>S&&!L.warned)u$(this,$,L)}return this};n0.on=n0.addListener;n0.prependListener=function($,I){vO(I);var E=this._events;if(!E)E=this._events={__proto__:null},this._eventsCount=0;else if(E.newListener)this.emit("newListener",$,I.listener??I);var L=E[$];if(!L)E[$]=[I],this._eventsCount++;else{L.unshift(I);var S=this._maxListeners??QO;if(S>0&&L.length>S&&!L.warned)u$(this,$,L)}return this};n0.once=function($,I){vO(I);let E=l$.bind(this,$,I);return E.listener=I,this.addListener($,E),this};n0.prependOnceListener=function($,I){vO(I);let E=l$.bind(this,$,I);return E.listener=I,this.prependListener($,E),this};n0.removeListener=function($,I){vO(I);var{_events:E}=this;if(!E)return this;var L=E[$];if(!L)return this;var S=L.length;let K=-1;for(let Q=S-1;Q>=0;Q--)if(L[Q]===I||L[Q].listener===I){K=Q;break}if(K<0)return this;if(K===0)L.shift();else L.splice(K,1);if(L.length===0)delete E[$],this._eventsCount--;return this};n0.off=n0.removeListener;n0.removeAllListeners=function($){var{_events:I}=this;if($&&I){if(I[$])delete I[$],this._eventsCount--}else this._events={__proto__:null};return this};n0.listeners=function($){var{_events:I}=this;if(!I)return[];var E=I[$];if(!E)return[];return E.map((L)=>L.listener??L)};n0.rawListeners=function($){var{_events:I}=this;if(!I)return[];var E=I[$];if(!E)return[];return E.slice()};n0.listenerCount=function($){var{_events:I}=this;if(!I)return 0;return I[$]?.length??0};n0.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]};n0[CO]=!1;hZ=class hZ extends Error{constructor($="The operation was aborted",I=void 0){if(I!==void 0&&typeof I!=="object")throw KO("options","Object",I);super($,I);this.code="ABORT_ERR",this.name="AbortError"}};Object.defineProperties(aU,{captureRejections:{get(){return n0[CO]},set($){jQ($,"EventEmitter.captureRejections"),n0[CO]=$},enumerable:!0},defaultMaxListeners:{enumerable:!0,get:()=>{return QO},set:($)=>{lZ($,"defaultMaxListeners",0),QO=$}},kMaxEventTargetListeners:{value:MQ,enumerable:!1,configurable:!1,writable:!1},kMaxEventTargetListenersWarned:{value:zQ,enumerable:!1,configurable:!1,writable:!1}});Object.assign(aU,{once:d$,getEventListeners:b$,getMaxListeners:s$,setMaxListeners:o$,EventEmitter:aU,usingDomains:!1,captureRejectionSymbol:p$,errorMonitor:c$,addAbortListener:m$,init:aU,listenerCount:n$});vQ=aU});var UZ=KC((kY,AI)=>{var d0=($,I)=>()=>(I||$((I={exports:{}}).exports,I),I.exports),s0=d0(($,I)=>{class E extends Error{constructor(L){if(!Array.isArray(L))throw TypeError(`Expected input to be an Array, got ${typeof L}`);let S="";for(let K=0;K<L.length;K++)S+=` ${L[K].stack}
|
|
2
|
+
`;super(S);this.name="AggregateError",this.errors=L}}I.exports={AggregateError:E,ArrayIsArray(L){return Array.isArray(L)},ArrayPrototypeIncludes(L,S){return L.includes(S)},ArrayPrototypeIndexOf(L,S){return L.indexOf(S)},ArrayPrototypeJoin(L,S){return L.join(S)},ArrayPrototypeMap(L,S){return L.map(S)},ArrayPrototypePop(L,S){return L.pop(S)},ArrayPrototypePush(L,S){return L.push(S)},ArrayPrototypeSlice(L,S,K){return L.slice(S,K)},Error,FunctionPrototypeCall(L,S,...K){return L.call(S,...K)},FunctionPrototypeSymbolHasInstance(L,S){return Function.prototype[Symbol.hasInstance].call(L,S)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(L,S){return Object.defineProperties(L,S)},ObjectDefineProperty(L,S,K){return Object.defineProperty(L,S,K)},ObjectGetOwnPropertyDescriptor(L,S){return Object.getOwnPropertyDescriptor(L,S)},ObjectKeys(L){return Object.keys(L)},ObjectSetPrototypeOf(L,S){return Object.setPrototypeOf(L,S)},Promise,PromisePrototypeCatch(L,S){return L.catch(S)},PromisePrototypeThen(L,S,K){return L.then(S,K)},PromiseReject(L){return Promise.reject(L)},PromiseResolve(L){return Promise.resolve(L)},ReflectApply:Reflect.apply,RegExpPrototypeTest(L,S){return L.test(S)},SafeSet:Set,String,StringPrototypeSlice(L,S,K){return L.slice(S,K)},StringPrototypeToLowerCase(L){return L.toLowerCase()},StringPrototypeToUpperCase(L){return L.toUpperCase()},StringPrototypeTrim(L){return L.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet(L,S,K){return L.set(S,K)},Boolean,Uint8Array}}),r$=d0(($,I)=>{I.exports={format(E,...L){return E.replace(/%([sdifj])/g,function(...[S,K]){let Q=L.shift();if(K==="f")return Q.toFixed(6);else if(K==="j")return JSON.stringify(Q);else if(K==="s"&&typeof Q==="object")return`${Q.constructor!==Object?Q.constructor.name:""} {}`.trim();else return Q.toString()})},inspect(E){switch(typeof E){case"string":if(E.includes("'")){if(!E.includes('"'))return`"${E}"`;else if(!E.includes("`")&&!E.includes("${"))return`\`${E}\``}return`'${E}'`;case"number":if(isNaN(E))return"NaN";else if(Object.is(E,-0))return String(E);return E;case"bigint":return`${String(E)}n`;case"boolean":case"undefined":return String(E);case"object":return"{}"}}}}),TU=d0(($,I)=>{var{format:E,inspect:L}=r$(),{AggregateError:S}=s0(),K=globalThis.AggregateError||S,Q=Symbol("kIsNodeError"),T=["string","function","number","object","Function","Object","boolean","bigint","symbol"],M=/^([A-Z][a-z0-9]*)+$/,H={};function F(B,v){if(!B)throw new H.ERR_INTERNAL_ASSERTION(v)}function R(B){let v="",g=B.length,f=B[0]==="-"?1:0;for(;g>=f+4;g-=3)v=`_${B.slice(g-3,g)}${v}`;return`${B.slice(0,g)}${v}`}function D(B,v,g){if(typeof v==="function")return F(v.length<=g.length,`Code: ${B}; The provided arguments length (${g.length}) does not match the required ones (${v.length}).`),v(...g);let f=(v.match(/%[dfijoOs]/g)||[]).length;if(F(f===g.length,`Code: ${B}; The provided arguments length (${g.length}) does not match the required ones (${f}).`),g.length===0)return v;return E(v,...g)}function q(B,v,g){if(!g)g=Error;class f extends g{constructor(...w){super(D(B,v,w))}toString(){return`${this.name} [${B}]: ${this.message}`}}Object.defineProperties(f.prototype,{name:{value:g.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${B}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),f.prototype.code=B,f.prototype[Q]=!0,H[B]=f}function P(B){let v="__node_internal_"+B.name;return Object.defineProperty(B,"name",{value:v}),B}function _(B,v){if(B&&v&&B!==v){if(Array.isArray(v.errors))return v.errors.push(B),v;let g=new K([v,B],v.message);return g.code=v.code,g}return B||v}class k extends Error{constructor(B="The operation was aborted",v=void 0){if(v!==void 0&&typeof v!=="object")throw new H.ERR_INVALID_ARG_TYPE("options","Object",v);super(B,v);this.code="ABORT_ERR",this.name="AbortError"}}q("ERR_ASSERTION","%s",Error),q("ERR_INVALID_ARG_TYPE",(B,v,g)=>{if(F(typeof B==="string","'name' must be a string"),!Array.isArray(v))v=[v];let f="The ";if(B.endsWith(" argument"))f+=`${B} `;else f+=`"${B}" ${B.includes(".")?"property":"argument"} `;f+="must be ";let w=[],b=[],I0=[];for(let C0 of v)if(F(typeof C0==="string","All expected entries have to be of type string"),T.includes(C0))w.push(C0.toLowerCase());else if(M.test(C0))b.push(C0);else F(C0!=="object",'The value "object" should be written as "Object"'),I0.push(C0);if(b.length>0){let C0=w.indexOf("object");if(C0!==-1)w.splice(w,C0,1),b.push("Object")}if(w.length>0){switch(w.length){case 1:f+=`of type ${w[0]}`;break;case 2:f+=`one of type ${w[0]} or ${w[1]}`;break;default:{let C0=w.pop();f+=`one of type ${w.join(", ")}, or ${C0}`}}if(b.length>0||I0.length>0)f+=" or "}if(b.length>0){switch(b.length){case 1:f+=`an instance of ${b[0]}`;break;case 2:f+=`an instance of ${b[0]} or ${b[1]}`;break;default:{let C0=b.pop();f+=`an instance of ${b.join(", ")}, or ${C0}`}}if(I0.length>0)f+=" or "}switch(I0.length){case 0:break;case 1:if(I0[0].toLowerCase()!==I0[0])f+="an ";f+=`${I0[0]}`;break;case 2:f+=`one of ${I0[0]} or ${I0[1]}`;break;default:{let C0=I0.pop();f+=`one of ${I0.join(", ")}, or ${C0}`}}if(g==null)f+=`. Received ${g}`;else if(typeof g==="function"&&g.name)f+=`. Received function ${g.name}`;else if(typeof g==="object"){var X0;if((X0=g.constructor)!==null&&X0!==void 0&&X0.name)f+=`. Received an instance of ${g.constructor.name}`;else{let C0=L(g,{depth:-1});f+=`. Received ${C0}`}}else{let C0=L(g,{colors:!1});if(C0.length>25)C0=`${C0.slice(0,25)}...`;f+=`. Received type ${typeof g} (${C0})`}return f},TypeError),q("ERR_INVALID_ARG_VALUE",(B,v,g="is invalid")=>{let f=L(v);if(f.length>128)f=f.slice(0,128)+"...";return`The ${B.includes(".")?"property":"argument"} '${B}' ${g}. Received ${f}`},TypeError),q("ERR_INVALID_RETURN_VALUE",(B,v,g)=>{var f;let w=g!==null&&g!==void 0&&(f=g.constructor)!==null&&f!==void 0&&f.name?`instance of ${g.constructor.name}`:`type ${typeof g}`;return`Expected ${B} to be returned from the "${v}" function but got ${w}.`},TypeError),q("ERR_MISSING_ARGS",(...B)=>{F(B.length>0,"At least one arg needs to be specified");let v,g=B.length;switch(B=(Array.isArray(B)?B:[B]).map((f)=>`"${f}"`).join(" or "),g){case 1:v+=`The ${B[0]} argument`;break;case 2:v+=`The ${B[0]} and ${B[1]} arguments`;break;default:{let f=B.pop();v+=`The ${B.join(", ")}, and ${f} arguments`}break}return`${v} must be specified`},TypeError),q("ERR_OUT_OF_RANGE",(B,v,g)=>{F(v,'Missing "range" argument');let f;if(Number.isInteger(g)&&Math.abs(g)>4294967296)f=R(String(g));else if(typeof g==="bigint"){f=String(g);let w=BigInt(2)**BigInt(32);if(g>w||g<-w)f=R(f);f+="n"}else f=L(g);return`The value of "${B}" is out of range. It must be ${v}. Received ${f}`},RangeError),q("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),q("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),q("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),q("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),q("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),q("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),q("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),q("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),q("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),q("ERR_STREAM_WRITE_AFTER_END","write after end",Error),q("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),I.exports={AbortError:k,aggregateTwoErrors:P(_),hideStackFrames:P,codes:H}}),BQ=d0(($,I)=>{Object.defineProperty($,"__esModule",{value:!0});var E=new WeakMap,L=new WeakMap;function S(u){let O0=E.get(u);return console.assert(O0!=null,"'this' is expected an Event object, but got",u),O0}function K(u){if(u.passiveListener!=null){if(typeof console<"u"&&typeof console.error==="function")console.error("Unable to preventDefault inside passive event listener invocation.",u.passiveListener);return}if(!u.event.cancelable)return;if(u.canceled=!0,typeof u.event.preventDefault==="function")u.event.preventDefault()}function Q(u,O0){E.set(this,{eventTarget:u,event:O0,eventPhase:2,currentTarget:u,canceled:!1,stopped:!1,immediateStopped:!1,passiveListener:null,timeStamp:O0.timeStamp||Date.now()}),Object.defineProperty(this,"isTrusted",{value:!1,enumerable:!0});let U=Object.keys(O0);for(let A=0;A<U.length;++A){let X=U[A];if(!(X in this))Object.defineProperty(this,X,T(X))}}if(Q.prototype={get type(){return S(this).event.type},get target(){return S(this).eventTarget},get currentTarget(){return S(this).currentTarget},composedPath(){let u=S(this).currentTarget;if(u==null)return[];return[u]},get NONE(){return 0},get CAPTURING_PHASE(){return 1},get AT_TARGET(){return 2},get BUBBLING_PHASE(){return 3},get eventPhase(){return S(this).eventPhase},stopPropagation(){let u=S(this);if(u.stopped=!0,typeof u.event.stopPropagation==="function")u.event.stopPropagation()},stopImmediatePropagation(){let u=S(this);if(u.stopped=!0,u.immediateStopped=!0,typeof u.event.stopImmediatePropagation==="function")u.event.stopImmediatePropagation()},get bubbles(){return Boolean(S(this).event.bubbles)},get cancelable(){return Boolean(S(this).event.cancelable)},preventDefault(){K(S(this))},get defaultPrevented(){return S(this).canceled},get composed(){return Boolean(S(this).event.composed)},get timeStamp(){return S(this).timeStamp},get srcElement(){return S(this).eventTarget},get cancelBubble(){return S(this).stopped},set cancelBubble(u){if(!u)return;let O0=S(this);if(O0.stopped=!0,typeof O0.event.cancelBubble==="boolean")O0.event.cancelBubble=!0},get returnValue(){return!S(this).canceled},set returnValue(u){if(!u)K(S(this))},initEvent(){}},Object.defineProperty(Q.prototype,"constructor",{value:Q,configurable:!0,writable:!0}),typeof window<"u"&&typeof window.Event<"u")Object.setPrototypeOf(Q.prototype,window.Event.prototype),L.set(window.Event.prototype,Q);function T(u){return{get(){return S(this).event[u]},set(O0){S(this).event[u]=O0},configurable:!0,enumerable:!0}}function M(u){return{value(){let O0=S(this).event;return O0[u].apply(O0,arguments)},configurable:!0,enumerable:!0}}function H(u,O0){let U=Object.keys(O0);if(U.length===0)return u;function A(X,Z){u.call(this,X,Z)}A.prototype=Object.create(u.prototype,{constructor:{value:A,configurable:!0,writable:!0}});for(let X=0;X<U.length;++X){let Z=U[X];if(!(Z in u.prototype)){let C=typeof Object.getOwnPropertyDescriptor(O0,Z).value==="function";Object.defineProperty(A.prototype,Z,C?M(Z):T(Z))}}return A}function F(u){if(u==null||u===Object.prototype)return Q;let O0=L.get(u);if(O0==null)O0=H(F(Object.getPrototypeOf(u)),u),L.set(u,O0);return O0}function R(u,O0){return new(F(Object.getPrototypeOf(O0)))(u,O0)}function D(u){return S(u).immediateStopped}function q(u,O0){S(u).eventPhase=O0}function P(u,O0){S(u).currentTarget=O0}function _(u,O0){S(u).passiveListener=O0}var k=new WeakMap,B=1,v=2,g=3;function f(u){return u!==null&&typeof u==="object"}function w(u){let O0=k.get(u);if(O0==null)throw TypeError("'this' is expected an EventTarget object, but got another value.");return O0}function b(u){return{get(){let O0=w(this).get(u);while(O0!=null){if(O0.listenerType===g)return O0.listener;O0=O0.next}return null},set(O0){if(typeof O0!=="function"&&!f(O0))O0=null;let U=w(this),A=null,X=U.get(u);while(X!=null){if(X.listenerType===g)if(A!==null)A.next=X.next;else if(X.next!==null)U.set(u,X.next);else U.delete(u);else A=X;X=X.next}if(O0!==null){let Z={listener:O0,listenerType:g,passive:!1,once:!1,next:null};if(A===null)U.set(u,Z);else A.next=Z}},configurable:!0,enumerable:!0}}function I0(u,O0){Object.defineProperty(u,`on${O0}`,b(O0))}function X0(u){function O0(){C0.call(this)}O0.prototype=Object.create(C0.prototype,{constructor:{value:O0,configurable:!0,writable:!0}});for(let U=0;U<u.length;++U)I0(O0.prototype,u[U]);return O0}function C0(){if(this instanceof C0){k.set(this,new Map);return}if(arguments.length===1&&Array.isArray(arguments[0]))return X0(arguments[0]);if(arguments.length>0){let u=Array(arguments.length);for(let O0=0;O0<arguments.length;++O0)u[O0]=arguments[O0];return X0(u)}throw TypeError("Cannot call a class as a function")}if(C0.prototype={addEventListener(u,O0,U){if(O0==null)return;if(typeof O0!=="function"&&!f(O0))throw TypeError("'listener' should be a function or an object.");let A=w(this),X=f(U),Z=(X?Boolean(U.capture):Boolean(U))?B:v,C={listener:O0,listenerType:Z,passive:X&&Boolean(U.passive),once:X&&Boolean(U.once),next:null},Y=A.get(u);if(Y===void 0){A.set(u,C);return}let V=null;while(Y!=null){if(Y.listener===O0&&Y.listenerType===Z)return;V=Y,Y=Y.next}V.next=C},removeEventListener(u,O0,U){if(O0==null)return;let A=w(this),X=(f(U)?Boolean(U.capture):Boolean(U))?B:v,Z=null,C=A.get(u);while(C!=null){if(C.listener===O0&&C.listenerType===X){if(Z!==null)Z.next=C.next;else if(C.next!==null)A.set(u,C.next);else A.delete(u);return}Z=C,C=C.next}},dispatchEvent(u){if(u==null||typeof u.type!=="string")throw TypeError('"event.type" should be a string.');let O0=w(this),U=u.type,A=O0.get(U);if(A==null)return!0;let X=R(this,u),Z=null;while(A!=null){if(A.once)if(Z!==null)Z.next=A.next;else if(A.next!==null)O0.set(U,A.next);else O0.delete(U);else Z=A;if(_(X,A.passive?A.listener:null),typeof A.listener==="function")try{A.listener.call(this,X)}catch(C){if(typeof console<"u"&&typeof console.error==="function")console.error(C)}else if(A.listenerType!==g&&typeof A.listener.handleEvent==="function")A.listener.handleEvent(X);if(D(X))break;A=A.next}return _(X,null),q(X,0),P(X,null),!X.defaultPrevented}},Object.defineProperty(C0.prototype,"constructor",{value:C0,configurable:!0,writable:!0}),typeof window<"u"&&typeof window.EventTarget<"u")Object.setPrototypeOf(C0.prototype,window.EventTarget.prototype);$.defineEventAttribute=I0,$.EventTarget=C0,$.default=C0,I.exports=C0,I.exports.EventTarget=I.exports.default=C0,I.exports.defineEventAttribute=I0}),xO=d0(($,I)=>{Object.defineProperty($,"__esModule",{value:!0});var E=BQ();class L extends E.EventTarget{constructor(){super();throw TypeError("AbortSignal cannot be constructed directly")}get aborted(){let F=Q.get(this);if(typeof F!=="boolean")throw TypeError(`Expected 'this' to be an 'AbortSignal' object, but got ${this===null?"null":typeof this}`);return F}}E.defineEventAttribute(L.prototype,"abort");function S(){let F=Object.create(L.prototype);return E.EventTarget.call(F),Q.set(F,!1),F}function K(F){if(Q.get(F)!==!1)return;Q.set(F,!0),F.dispatchEvent({type:"abort"})}var Q=new WeakMap;if(Object.defineProperties(L.prototype,{aborted:{enumerable:!0}}),typeof Symbol==="function"&&typeof Symbol.toStringTag==="symbol")Object.defineProperty(L.prototype,Symbol.toStringTag,{configurable:!0,value:"AbortSignal"});class T{constructor(){M.set(this,S())}get signal(){return H(this)}abort(){K(H(this))}}var M=new WeakMap;function H(F){let R=M.get(F);if(R==null)throw TypeError(`Expected 'this' to be an 'AbortController' object, but got ${F===null?"null":typeof F}`);return R}if(Object.defineProperties(T.prototype,{signal:{enumerable:!0},abort:{enumerable:!0}}),typeof Symbol==="function"&&typeof Symbol.toStringTag==="symbol")Object.defineProperty(T.prototype,Symbol.toStringTag,{configurable:!0,value:"AbortController"});$.AbortController=T,$.AbortSignal=L,$.default=T,I.exports=T,I.exports.AbortController=I.exports.default=T,I.exports.AbortSignal=L}),_U=d0(($,I)=>{var E=(DU(),l0(RU)),{format:L,inspect:S}=r$(),{codes:{ERR_INVALID_ARG_TYPE:K}}=TU(),{kResistStopPropagation:Q,AggregateError:T,SymbolDispose:M}=s0(),H=globalThis.AbortSignal||xO().AbortSignal,F=globalThis.AbortController||xO().AbortController,R=Object.getPrototypeOf(async function(){}).constructor,D=globalThis.Blob||E.Blob,q=typeof D<"u"?function(k){return k instanceof D}:function(k){return!1},P=(k,B)=>{if(k!==void 0&&(k===null||typeof k!=="object"||!("aborted"in k)))throw new K(B,"AbortSignal",k)},_=(k,B)=>{if(typeof k!=="function")throw new K(B,"Function",k)};I.exports={AggregateError:T,kEmptyObject:Object.freeze({}),once(k){let B=!1;return function(...v){if(B)return;B=!0,k.apply(this,v)}},createDeferredPromise:function(){let k,B;return{promise:new Promise((v,g)=>{k=v,B=g}),resolve:k,reject:B}},promisify(k){return new Promise((B,v)=>{k((g,...f)=>{if(g)return v(g);return B(...f)})})},debuglog(){return function(){}},format:L,inspect:S,types:{isAsyncFunction(k){return k instanceof R},isArrayBufferView(k){return ArrayBuffer.isView(k)}},isBlob:q,deprecate(k,B){return k},addAbortListener:(gO(),l0(BO)).addAbortListener||function(k,B){if(k===void 0)throw new K("signal","AbortSignal",k);P(k,"signal"),_(B,"listener");let v;if(k.aborted)queueMicrotask(()=>B());else k.addEventListener("abort",B,{__proto__:null,once:!0,[Q]:!0}),v=()=>{k.removeEventListener("abort",B)};return{__proto__:null,[M](){var g;(g=v)===null||g===void 0||g()}}},AbortSignalAny:H.any||function(k){if(k.length===1)return k[0];let B=new F,v=()=>B.abort();return k.forEach((g)=>{P(g,"signals"),g.addEventListener("abort",v,{once:!0})}),B.signal.addEventListener("abort",()=>{k.forEach((g)=>g.removeEventListener("abort",v))},{once:!0}),B.signal}},I.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")}),NO=d0(($,I)=>{var{ArrayIsArray:E,ArrayPrototypeIncludes:L,ArrayPrototypeJoin:S,ArrayPrototypeMap:K,NumberIsInteger:Q,NumberIsNaN:T,NumberMAX_SAFE_INTEGER:M,NumberMIN_SAFE_INTEGER:H,NumberParseInt:F,ObjectPrototypeHasOwnProperty:R,RegExpPrototypeExec:D,String:q,StringPrototypeToUpperCase:P,StringPrototypeTrim:_}=s0(),{hideStackFrames:k,codes:{ERR_SOCKET_BAD_PORT:B,ERR_INVALID_ARG_TYPE:v,ERR_INVALID_ARG_VALUE:g,ERR_OUT_OF_RANGE:f,ERR_UNKNOWN_SIGNAL:w}}=TU(),{normalizeEncoding:b}=_U(),{isAsyncFunction:I0,isArrayBufferView:X0}=_U().types,C0={};function u(c){return c===(c|0)}function O0(c){return c===c>>>0}var U=/^[0-7]+$/,A="must be a 32-bit unsigned integer or an octal string";function X(c,o,x0){if(typeof c>"u")c=x0;if(typeof c==="string"){if(D(U,c)===null)throw new g(o,c,A);c=F(c,8)}return Y(c,o),c}var Z=k((c,o,x0=H,s=M)=>{if(typeof c!=="number")throw new v(o,"number",c);if(!Q(c))throw new f(o,"an integer",c);if(c<x0||c>s)throw new f(o,`>= ${x0} && <= ${s}`,c)}),C=k((c,o,x0=-2147483648,s=2147483647)=>{if(typeof c!=="number")throw new v(o,"number",c);if(!Q(c))throw new f(o,"an integer",c);if(c<x0||c>s)throw new f(o,`>= ${x0} && <= ${s}`,c)}),Y=k((c,o,x0=!1)=>{if(typeof c!=="number")throw new v(o,"number",c);if(!Q(c))throw new f(o,"an integer",c);let s=x0?1:0,Z0=4294967295;if(c<s||c>Z0)throw new f(o,`>= ${s} && <= ${Z0}`,c)});function V(c,o){if(typeof c!=="string")throw new v(o,"string",c)}function G(c,o,x0=void 0,s){if(typeof c!=="number")throw new v(o,"number",c);if(x0!=null&&c<x0||s!=null&&c>s||(x0!=null||s!=null)&&T(c))throw new f(o,`${x0!=null?`>= ${x0}`:""}${x0!=null&&s!=null?" && ":""}${s!=null?`<= ${s}`:""}`,c)}var O=k((c,o,x0)=>{if(!L(x0,c)){let s="must be one of: "+S(K(x0,(Z0)=>typeof Z0==="string"?`'${Z0}'`:q(Z0)),", ");throw new g(o,c,s)}});function J(c,o){if(typeof c!=="boolean")throw new v(o,"boolean",c)}function z(c,o,x0){return c==null||!R(c,o)?x0:c[o]}var W=k((c,o,x0=null)=>{let s=z(x0,"allowArray",!1),Z0=z(x0,"allowFunction",!1);if(!z(x0,"nullable",!1)&&c===null||!s&&E(c)||typeof c!=="object"&&(!Z0||typeof c!=="function"))throw new v(o,"Object",c)}),j=k((c,o)=>{if(c!=null&&typeof c!=="object"&&typeof c!=="function")throw new v(o,"a dictionary",c)}),N=k((c,o,x0=0)=>{if(!E(c))throw new v(o,"Array",c);if(c.length<x0){let s=`must be longer than ${x0}`;throw new g(o,c,s)}});function p(c,o){N(c,o);for(let x0=0;x0<c.length;x0++)V(c[x0],`${o}[${x0}]`)}function n(c,o){N(c,o);for(let x0=0;x0<c.length;x0++)J(c[x0],`${o}[${x0}]`)}function E0(c,o){N(c,o);for(let x0=0;x0<c.length;x0++){let s=c[x0],Z0=`${o}[${x0}]`;if(s==null)throw new v(Z0,"AbortSignal",s);i(s,Z0)}}function r(c,o="signal"){if(V(c,o),C0[c]===void 0){if(C0[P(c)]!==void 0)throw new w(c+" (signals must use all capital letters)");throw new w(c)}}var d=k((c,o="buffer")=>{if(!X0(c))throw new v(o,["Buffer","TypedArray","DataView"],c)});function A0(c,o){let x0=b(o),s=c.length;if(x0==="hex"&&s%2!==0)throw new g("encoding",o,`is invalid for data of length ${s}`)}function t(c,o="Port",x0=!0){if(typeof c!=="number"&&typeof c!=="string"||typeof c==="string"&&_(c).length===0||+c!==+c>>>0||c>65535||c===0&&!x0)throw new B(o,c,x0);return c|0}var i=k((c,o)=>{if(c!==void 0&&(c===null||typeof c!=="object"||!("aborted"in c)))throw new v(o,"AbortSignal",c)}),N0=k((c,o)=>{if(typeof c!=="function")throw new v(o,"Function",c)}),y=k((c,o)=>{if(typeof c!=="function"||I0(c))throw new v(o,"Function",c)}),h=k((c,o)=>{if(c!==void 0)throw new v(o,"undefined",c)});function $0(c,o,x0){if(!L(x0,c))throw new v(o,`('${S(x0,"|")}')`,c)}var m=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function a(c,o){if(typeof c>"u"||!D(m,c))throw new g(o,c,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function W0(c){if(typeof c==="string")return a(c,"hints"),c;else if(E(c)){let o=c.length,x0="";if(o===0)return x0;for(let s=0;s<o;s++){let Z0=c[s];if(a(Z0,"hints"),x0+=Z0,s!==o-1)x0+=", "}return x0}throw new g("hints",c,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}I.exports={isInt32:u,isUint32:O0,parseFileMode:X,validateArray:N,validateStringArray:p,validateBooleanArray:n,validateAbortSignalArray:E0,validateBoolean:J,validateBuffer:d,validateDictionary:j,validateEncoding:A0,validateFunction:N0,validateInt32:C,validateInteger:Z,validateNumber:G,validateObject:W,validateOneOf:O,validatePlainFunction:y,validatePort:t,validateSignalName:r,validateString:V,validateUint32:Y,validateUndefined:h,validateUnion:$0,validateAbortSignal:i,validateLinkHeaderValue:W0}}),XO=d0(($,I)=>{I.exports=globalThis.process}),tU=d0(($,I)=>{var{SymbolAsyncIterator:E,SymbolIterator:L,SymbolFor:S}=s0(),K=S("nodejs.stream.destroyed"),Q=S("nodejs.stream.errored"),T=S("nodejs.stream.readable"),M=S("nodejs.stream.writable"),H=S("nodejs.stream.disturbed"),F=S("nodejs.webstream.isClosedPromise"),R=S("nodejs.webstream.controllerErrorFunction");function D(z,W=!1){var j;return!!(z&&typeof z.pipe==="function"&&typeof z.on==="function"&&(!W||typeof z.pause==="function"&&typeof z.resume==="function")&&(!z._writableState||((j=z._readableState)===null||j===void 0?void 0:j.readable)!==!1)&&(!z._writableState||z._readableState))}function q(z){var W;return!!(z&&typeof z.write==="function"&&typeof z.on==="function"&&(!z._readableState||((W=z._writableState)===null||W===void 0?void 0:W.writable)!==!1))}function P(z){return!!(z&&typeof z.pipe==="function"&&z._readableState&&typeof z.on==="function"&&typeof z.write==="function")}function _(z){return z&&(z._readableState||z._writableState||typeof z.write==="function"&&typeof z.on==="function"||typeof z.pipe==="function"&&typeof z.on==="function")}function k(z){return!!(z&&!_(z)&&typeof z.pipeThrough==="function"&&typeof z.getReader==="function"&&typeof z.cancel==="function")}function B(z){return!!(z&&!_(z)&&typeof z.getWriter==="function"&&typeof z.abort==="function")}function v(z){return!!(z&&!_(z)&&typeof z.readable==="object"&&typeof z.writable==="object")}function g(z){return k(z)||B(z)||v(z)}function f(z,W){if(z==null)return!1;if(W===!0)return typeof z[E]==="function";if(W===!1)return typeof z[L]==="function";return typeof z[E]==="function"||typeof z[L]==="function"}function w(z){if(!_(z))return null;let{_writableState:W,_readableState:j}=z,N=W||j;return!!(z.destroyed||z[K]||N!==null&&N!==void 0&&N.destroyed)}function b(z){if(!q(z))return null;if(z.writableEnded===!0)return!0;let W=z._writableState;if(W!==null&&W!==void 0&&W.errored)return!1;if(typeof(W===null||W===void 0?void 0:W.ended)!=="boolean")return null;return W.ended}function I0(z,W){if(!q(z))return null;if(z.writableFinished===!0)return!0;let j=z._writableState;if(j!==null&&j!==void 0&&j.errored)return!1;if(typeof(j===null||j===void 0?void 0:j.finished)!=="boolean")return null;return!!(j.finished||W===!1&&j.ended===!0&&j.length===0)}function X0(z){if(!D(z))return null;if(z.readableEnded===!0)return!0;let W=z._readableState;if(!W||W.errored)return!1;if(typeof(W===null||W===void 0?void 0:W.ended)!=="boolean")return null;return W.ended}function C0(z,W){if(!D(z))return null;let j=z._readableState;if(j!==null&&j!==void 0&&j.errored)return!1;if(typeof(j===null||j===void 0?void 0:j.endEmitted)!=="boolean")return null;return!!(j.endEmitted||W===!1&&j.ended===!0&&j.length===0)}function u(z){if(z&&z[T]!=null)return z[T];if(typeof(z===null||z===void 0?void 0:z.readable)!=="boolean")return null;if(w(z))return!1;return D(z)&&z.readable&&!C0(z)}function O0(z){if(z&&z[M]!=null)return z[M];if(typeof(z===null||z===void 0?void 0:z.writable)!=="boolean")return null;if(w(z))return!1;return q(z)&&z.writable&&!b(z)}function U(z,W){if(!_(z))return null;if(w(z))return!0;if((W===null||W===void 0?void 0:W.readable)!==!1&&u(z))return!1;if((W===null||W===void 0?void 0:W.writable)!==!1&&O0(z))return!1;return!0}function A(z){var W,j;if(!_(z))return null;if(z.writableErrored)return z.writableErrored;return(W=(j=z._writableState)===null||j===void 0?void 0:j.errored)!==null&&W!==void 0?W:null}function X(z){var W,j;if(!_(z))return null;if(z.readableErrored)return z.readableErrored;return(W=(j=z._readableState)===null||j===void 0?void 0:j.errored)!==null&&W!==void 0?W:null}function Z(z){if(!_(z))return null;if(typeof z.closed==="boolean")return z.closed;let{_writableState:W,_readableState:j}=z;if(typeof(W===null||W===void 0?void 0:W.closed)==="boolean"||typeof(j===null||j===void 0?void 0:j.closed)==="boolean")return(W===null||W===void 0?void 0:W.closed)||(j===null||j===void 0?void 0:j.closed);if(typeof z._closed==="boolean"&&C(z))return z._closed;return null}function C(z){return typeof z._closed==="boolean"&&typeof z._defaultKeepAlive==="boolean"&&typeof z._removedConnection==="boolean"&&typeof z._removedContLen==="boolean"}function Y(z){return typeof z._sent100==="boolean"&&C(z)}function V(z){var W;return typeof z._consuming==="boolean"&&typeof z._dumped==="boolean"&&((W=z.req)===null||W===void 0?void 0:W.upgradeOrConnect)===void 0}function G(z){if(!_(z))return null;let{_writableState:W,_readableState:j}=z,N=W||j;return!N&&Y(z)||!!(N&&N.autoDestroy&&N.emitClose&&N.closed===!1)}function O(z){var W;return!!(z&&((W=z[H])!==null&&W!==void 0?W:z.readableDidRead||z.readableAborted))}function J(z){var W,j,N,p,n,E0,r,d,A0,t;return!!(z&&((W=(j=(N=(p=(n=(E0=z[Q])!==null&&E0!==void 0?E0:z.readableErrored)!==null&&n!==void 0?n:z.writableErrored)!==null&&p!==void 0?p:(r=z._readableState)===null||r===void 0?void 0:r.errorEmitted)!==null&&N!==void 0?N:(d=z._writableState)===null||d===void 0?void 0:d.errorEmitted)!==null&&j!==void 0?j:(A0=z._readableState)===null||A0===void 0?void 0:A0.errored)!==null&&W!==void 0?W:(t=z._writableState)===null||t===void 0?void 0:t.errored))}I.exports={isDestroyed:w,kIsDestroyed:K,isDisturbed:O,kIsDisturbed:H,isErrored:J,kIsErrored:Q,isReadable:u,kIsReadable:T,kIsClosedPromise:F,kControllerErrorFunction:R,kIsWritable:M,isClosed:Z,isDuplexNodeStream:P,isFinished:U,isIterable:f,isReadableNodeStream:D,isReadableStream:k,isReadableEnded:X0,isReadableFinished:C0,isReadableErrored:X,isNodeStream:_,isWebStream:g,isWritable:O0,isWritableNodeStream:q,isWritableStream:B,isWritableEnded:b,isWritableFinished:I0,isWritableErrored:A,isServerRequest:V,isServerResponse:Y,willEmitClose:G,isTransformStream:v}}),iU=d0(($,I)=>{var E=XO(),{AbortError:L,codes:S}=TU(),{ERR_INVALID_ARG_TYPE:K,ERR_STREAM_PREMATURE_CLOSE:Q}=S,{kEmptyObject:T,once:M}=_U(),{validateAbortSignal:H,validateFunction:F,validateObject:R,validateBoolean:D}=NO(),{Promise:q,PromisePrototypeThen:P,SymbolDispose:_}=s0(),{isClosed:k,isReadable:B,isReadableNodeStream:v,isReadableStream:g,isReadableFinished:f,isReadableErrored:w,isWritable:b,isWritableNodeStream:I0,isWritableStream:X0,isWritableFinished:C0,isWritableErrored:u,isNodeStream:O0,willEmitClose:U,kIsClosedPromise:A}=tU(),X;function Z(O){return O.setHeader&&typeof O.abort==="function"}var C=()=>{};function Y(O,J,z){var W,j;if(arguments.length===2)z=J,J=T;else if(J==null)J=T;else R(J,"options");if(F(z,"callback"),H(J.signal,"options.signal"),z=M(z),g(O)||X0(O))return V(O,J,z);if(!O0(O))throw new K("stream",["ReadableStream","WritableStream","Stream"],O);let N=(W=J.readable)!==null&&W!==void 0?W:v(O),p=(j=J.writable)!==null&&j!==void 0?j:I0(O),n=O._writableState,E0=O._readableState,r=()=>{if(!O.writable)t()},d=U(O)&&v(O)===N&&I0(O)===p,A0=C0(O,!1),t=()=>{if(A0=!0,O.destroyed)d=!1;if(d&&(!O.readable||N))return;if(!N||i)z.call(O)},i=f(O,!1),N0=()=>{if(i=!0,O.destroyed)d=!1;if(d&&(!O.writable||p))return;if(!p||A0)z.call(O)},y=(c)=>{z.call(O,c)},h=k(O),$0=()=>{h=!0;let c=u(O)||w(O);if(c&&typeof c!=="boolean")return z.call(O,c);if(N&&!i&&v(O,!0)){if(!f(O,!1))return z.call(O,new Q)}if(p&&!A0){if(!C0(O,!1))return z.call(O,new Q)}z.call(O)},m=()=>{h=!0;let c=u(O)||w(O);if(c&&typeof c!=="boolean")return z.call(O,c);z.call(O)},a=()=>{O.req.on("finish",t)};if(Z(O)){if(O.on("complete",t),!d)O.on("abort",$0);if(O.req)a();else O.on("request",a)}else if(p&&!n)O.on("end",r),O.on("close",r);if(!d&&typeof O.aborted==="boolean")O.on("aborted",$0);if(O.on("end",N0),O.on("finish",t),J.error!==!1)O.on("error",y);if(O.on("close",$0),h)E.nextTick($0);else if(n!==null&&n!==void 0&&n.errorEmitted||E0!==null&&E0!==void 0&&E0.errorEmitted){if(!d)E.nextTick(m)}else if(!N&&(!d||B(O))&&(A0||b(O)===!1))E.nextTick(m);else if(!p&&(!d||b(O))&&(i||B(O)===!1))E.nextTick(m);else if(E0&&O.req&&O.aborted)E.nextTick(m);let W0=()=>{if(z=C,O.removeListener("aborted",$0),O.removeListener("complete",t),O.removeListener("abort",$0),O.removeListener("request",a),O.req)O.req.removeListener("finish",t);O.removeListener("end",r),O.removeListener("close",r),O.removeListener("finish",t),O.removeListener("end",N0),O.removeListener("error",y),O.removeListener("close",$0)};if(J.signal&&!h){let c=()=>{let o=z;W0(),o.call(O,new L(void 0,{cause:J.signal.reason}))};if(J.signal.aborted)E.nextTick(c);else{X=X||_U().addAbortListener;let o=X(J.signal,c),x0=z;z=M((...s)=>{o[_](),x0.apply(O,s)})}}return W0}function V(O,J,z){let W=!1,j=C;if(J.signal)if(j=()=>{W=!0,z.call(O,new L(void 0,{cause:J.signal.reason}))},J.signal.aborted)E.nextTick(j);else{X=X||_U().addAbortListener;let p=X(J.signal,j),n=z;z=M((...E0)=>{p[_](),n.apply(O,E0)})}let N=(...p)=>{if(!W)E.nextTick(()=>z.apply(O,p))};return P(O[A].promise,N,N),C}function G(O,J){var z;let W=!1;if(J===null)J=T;if((z=J)!==null&&z!==void 0&&z.cleanup)D(J.cleanup,"cleanup"),W=J.cleanup;return new q((j,N)=>{let p=Y(O,J,(n)=>{if(W)p();if(n)N(n);else j()})})}I.exports=Y,I.exports.finished=G}),HO=d0(($,I)=>{var E=XO(),{aggregateTwoErrors:L,codes:{ERR_MULTIPLE_CALLBACK:S},AbortError:K}=TU(),{Symbol:Q}=s0(),{kIsDestroyed:T,isDestroyed:M,isFinished:H,isServerRequest:F}=tU(),R=Q("kDestroy"),D=Q("kConstruct");function q(U,A,X){if(U){if(U.stack,A&&!A.errored)A.errored=U;if(X&&!X.errored)X.errored=U}}function P(U,A){let X=this._readableState,Z=this._writableState,C=Z||X;if(Z!==null&&Z!==void 0&&Z.destroyed||X!==null&&X!==void 0&&X.destroyed){if(typeof A==="function")A();return this}if(q(U,Z,X),Z)Z.destroyed=!0;if(X)X.destroyed=!0;if(!C.constructed)this.once(R,function(Y){_(this,L(Y,U),A)});else _(this,U,A);return this}function _(U,A,X){let Z=!1;function C(Y){if(Z)return;Z=!0;let{_readableState:V,_writableState:G}=U;if(q(Y,G,V),G)G.closed=!0;if(V)V.closed=!0;if(typeof X==="function")X(Y);if(Y)E.nextTick(k,U,Y);else E.nextTick(B,U)}try{U._destroy(A||null,C)}catch(Y){C(Y)}}function k(U,A){v(U,A),B(U)}function B(U){let{_readableState:A,_writableState:X}=U;if(X)X.closeEmitted=!0;if(A)A.closeEmitted=!0;if(X!==null&&X!==void 0&&X.emitClose||A!==null&&A!==void 0&&A.emitClose)U.emit("close")}function v(U,A){let{_readableState:X,_writableState:Z}=U;if(Z!==null&&Z!==void 0&&Z.errorEmitted||X!==null&&X!==void 0&&X.errorEmitted)return;if(Z)Z.errorEmitted=!0;if(X)X.errorEmitted=!0;U.emit("error",A)}function g(){let U=this._readableState,A=this._writableState;if(U)U.constructed=!0,U.closed=!1,U.closeEmitted=!1,U.destroyed=!1,U.errored=null,U.errorEmitted=!1,U.reading=!1,U.ended=U.readable===!1,U.endEmitted=U.readable===!1;if(A)A.constructed=!0,A.destroyed=!1,A.closed=!1,A.closeEmitted=!1,A.errored=null,A.errorEmitted=!1,A.finalCalled=!1,A.prefinished=!1,A.ended=A.writable===!1,A.ending=A.writable===!1,A.finished=A.writable===!1}function f(U,A,X){let{_readableState:Z,_writableState:C}=U;if(C!==null&&C!==void 0&&C.destroyed||Z!==null&&Z!==void 0&&Z.destroyed)return this;if(Z!==null&&Z!==void 0&&Z.autoDestroy||C!==null&&C!==void 0&&C.autoDestroy)U.destroy(A);else if(A){if(A.stack,C&&!C.errored)C.errored=A;if(Z&&!Z.errored)Z.errored=A;if(X)E.nextTick(v,U,A);else v(U,A)}}function w(U,A){if(typeof U._construct!=="function")return;let{_readableState:X,_writableState:Z}=U;if(X)X.constructed=!1;if(Z)Z.constructed=!1;if(U.once(D,A),U.listenerCount(D)>1)return;E.nextTick(b,U)}function b(U){let A=!1;function X(Z){if(A){f(U,Z!==null&&Z!==void 0?Z:new S);return}A=!0;let{_readableState:C,_writableState:Y}=U,V=Y||C;if(C)C.constructed=!0;if(Y)Y.constructed=!0;if(V.destroyed)U.emit(R,Z);else if(Z)f(U,Z,!0);else E.nextTick(I0,U)}try{U._construct((Z)=>{E.nextTick(X,Z)})}catch(Z){E.nextTick(X,Z)}}function I0(U){U.emit(D)}function X0(U){return(U===null||U===void 0?void 0:U.setHeader)&&typeof U.abort==="function"}function C0(U){U.emit("close")}function u(U,A){U.emit("error",A),E.nextTick(C0,U)}function O0(U,A){if(!U||M(U))return;if(!A&&!H(U))A=new K;if(F(U))U.socket=null,U.destroy(A);else if(X0(U))U.abort();else if(X0(U.req))U.req.abort();else if(typeof U.destroy==="function")U.destroy(A);else if(typeof U.close==="function")U.close();else if(A)E.nextTick(u,U,A);else E.nextTick(C0,U);if(!U.destroyed)U[T]=!0}I.exports={construct:w,destroyer:O0,destroy:P,undestroy:g,errorOrDestroy:f}}),dZ=d0(($,I)=>{var{ArrayIsArray:E,ObjectSetPrototypeOf:L}=s0(),{EventEmitter:S}=(gO(),l0(BO));function K(T){S.call(this,T)}L(K.prototype,S.prototype),L(K,S),K.prototype.pipe=function(T,M){let H=this;function F(B){if(T.writable&&T.write(B)===!1&&H.pause)H.pause()}H.on("data",F);function R(){if(H.readable&&H.resume)H.resume()}if(T.on("drain",R),!T._isStdio&&(!M||M.end!==!1))H.on("end",q),H.on("close",P);let D=!1;function q(){if(D)return;D=!0,T.end()}function P(){if(D)return;if(D=!0,typeof T.destroy==="function")T.destroy()}function _(B){if(k(),S.listenerCount(this,"error")===0)this.emit("error",B)}Q(H,"error",_),Q(T,"error",_);function k(){H.removeListener("data",F),T.removeListener("drain",R),H.removeListener("end",q),H.removeListener("close",P),H.removeListener("error",_),T.removeListener("error",_),H.removeListener("end",k),H.removeListener("close",k),T.removeListener("close",k)}return H.on("end",k),H.on("close",k),T.on("close",k),T.emit("pipe",H),T};function Q(T,M,H){if(typeof T.prependListener==="function")return T.prependListener(M,H);if(!T._events||!T._events[M])T.on(M,H);else if(E(T._events[M]))T._events[M].unshift(H);else T._events[M]=[H,T._events[M]]}I.exports={Stream:K,prependListener:Q}}),eO=d0(($,I)=>{var{SymbolDispose:E}=s0(),{AbortError:L,codes:S}=TU(),{isNodeStream:K,isWebStream:Q,kControllerErrorFunction:T}=tU(),M=iU(),{ERR_INVALID_ARG_TYPE:H}=S,F,R=(D,q)=>{if(typeof D!=="object"||!("aborted"in D))throw new H(q,"AbortSignal",D)};I.exports.addAbortSignal=function(D,q){if(R(D,"signal"),!K(q)&&!Q(q))throw new H("stream",["ReadableStream","WritableStream","Stream"],q);return I.exports.addAbortSignalNoValidate(D,q)},I.exports.addAbortSignalNoValidate=function(D,q){if(typeof D!=="object"||!("aborted"in D))return q;let P=K(q)?()=>{q.destroy(new L(void 0,{cause:D.reason}))}:()=>{q[T](new L(void 0,{cause:D.reason}))};if(D.aborted)P();else{F=F||_U().addAbortListener;let _=F(D,P);M(q,_[E])}return q}}),gQ=d0(($,I)=>{var{StringPrototypeSlice:E,SymbolIterator:L,TypedArrayPrototypeSet:S,Uint8Array:K}=s0(),{Buffer:Q}=(DU(),l0(RU)),{inspect:T}=_U();I.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(M){let H={data:M,next:null};if(this.length>0)this.tail.next=H;else this.head=H;this.tail=H,++this.length}unshift(M){let H={data:M,next:this.head};if(this.length===0)this.tail=H;this.head=H,++this.length}shift(){if(this.length===0)return;let M=this.head.data;if(this.length===1)this.head=this.tail=null;else this.head=this.head.next;return--this.length,M}clear(){this.head=this.tail=null,this.length=0}join(M){if(this.length===0)return"";let H=this.head,F=""+H.data;while((H=H.next)!==null)F+=M+H.data;return F}concat(M){if(this.length===0)return Q.alloc(0);let H=Q.allocUnsafe(M>>>0),F=this.head,R=0;while(F)S(H,F.data,R),R+=F.data.length,F=F.next;return H}consume(M,H){let F=this.head.data;if(M<F.length){let R=F.slice(0,M);return this.head.data=F.slice(M),R}if(M===F.length)return this.shift();return H?this._getString(M):this._getBuffer(M)}first(){return this.head.data}*[L](){for(let M=this.head;M;M=M.next)yield M.data}_getString(M){let H="",F=this.head,R=0;do{let D=F.data;if(M>D.length)H+=D,M-=D.length;else{if(M===D.length)if(H+=D,++R,F.next)this.head=F.next;else this.head=this.tail=null;else H+=E(D,0,M),this.head=F,F.data=E(D,M);break}++R}while((F=F.next)!==null);return this.length-=R,H}_getBuffer(M){let H=Q.allocUnsafe(M),F=M,R=this.head,D=0;do{let q=R.data;if(M>q.length)S(H,q,F-M),M-=q.length;else{if(M===q.length)if(S(H,q,F-M),++D,R.next)this.head=R.next;else this.head=this.tail=null;else S(H,new K(q.buffer,q.byteOffset,M),F-M),this.head=R,R.data=q.slice(M);break}++D}while((R=R.next)!==null);return this.length-=D,H}[Symbol.for("nodejs.util.inspect.custom")](M,H){return T(this,{...H,depth:0,customInspect:!1})}}}),aO=d0(($,I)=>{var{MathFloor:E,NumberIsInteger:L}=s0(),{validateInteger:S}=NO(),{ERR_INVALID_ARG_VALUE:K}=TU().codes,Q=16384,T=16;function M(D,q,P){return D.highWaterMark!=null?D.highWaterMark:q?D[P]:null}function H(D){return D?T:Q}function F(D,q){if(S(q,"value",0),D)T=q;else Q=q}function R(D,q,P,_){let k=M(q,_,P);if(k!=null){if(!L(k)||k<0){let B=_?`options.${P}`:"options.highWaterMark";throw new K(B,k)}return E(k)}return H(D.objectMode)}I.exports={getHighWaterMark:R,getDefaultHighWaterMark:H,setDefaultHighWaterMark:F}}),xQ=d0(($,I)=>{/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var E=(DU(),l0(RU)),L=E.Buffer;function S(Q,T){for(var M in Q)T[M]=Q[M]}if(L.from&&L.alloc&&L.allocUnsafe&&L.allocUnsafeSlow)I.exports=E;else S(E,$),$.Buffer=K;function K(Q,T,M){return L(Q,T,M)}K.prototype=Object.create(L.prototype),S(L,K),K.from=function(Q,T,M){if(typeof Q==="number")throw TypeError("Argument must not be a number");return L(Q,T,M)},K.alloc=function(Q,T,M){if(typeof Q!=="number")throw TypeError("Argument must be a number");var H=L(Q);if(T!==void 0)if(typeof M==="string")H.fill(T,M);else H.fill(T);else H.fill(0);return H},K.allocUnsafe=function(Q){if(typeof Q!=="number")throw TypeError("Argument must be a number");return L(Q)},K.allocUnsafeSlow=function(Q){if(typeof Q!=="number")throw TypeError("Argument must be a number");return E.SlowBuffer(Q)}}),NQ=d0(($)=>{var I=xQ().Buffer,E=I.isEncoding||function(v){switch(v=""+v,v&&v.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function L(v){if(!v)return"utf8";var g;while(!0)switch(v){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return v;default:if(g)return;v=(""+v).toLowerCase(),g=!0}}function S(v){var g=L(v);if(typeof g!=="string"&&(I.isEncoding===E||!E(v)))throw Error("Unknown encoding: "+v);return g||v}$.StringDecoder=K;function K(v){this.encoding=S(v);var g;switch(this.encoding){case"utf16le":this.text=D,this.end=q,g=4;break;case"utf8":this.fillLast=H,g=4;break;case"base64":this.text=P,this.end=_,g=3;break;default:this.write=k,this.end=B;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=I.allocUnsafe(g)}K.prototype.write=function(v){if(v.length===0)return"";var g,f;if(this.lastNeed){if(g=this.fillLast(v),g===void 0)return"";f=this.lastNeed,this.lastNeed=0}else f=0;if(f<v.length)return g?g+this.text(v,f):this.text(v,f);return g||""},K.prototype.end=R,K.prototype.text=F,K.prototype.fillLast=function(v){if(this.lastNeed<=v.length)return v.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);v.copy(this.lastChar,this.lastTotal-this.lastNeed,0,v.length),this.lastNeed-=v.length};function Q(v){if(v<=127)return 0;else if(v>>5===6)return 2;else if(v>>4===14)return 3;else if(v>>3===30)return 4;return v>>6===2?-1:-2}function T(v,g,f){var w=g.length-1;if(w<f)return 0;var b=Q(g[w]);if(b>=0){if(b>0)v.lastNeed=b-1;return b}if(--w<f||b===-2)return 0;if(b=Q(g[w]),b>=0){if(b>0)v.lastNeed=b-2;return b}if(--w<f||b===-2)return 0;if(b=Q(g[w]),b>=0){if(b>0)if(b===2)b=0;else v.lastNeed=b-3;return b}return 0}function M(v,g,f){if((g[0]&192)!==128)return v.lastNeed=0,"�";if(v.lastNeed>1&&g.length>1){if((g[1]&192)!==128)return v.lastNeed=1,"�";if(v.lastNeed>2&&g.length>2){if((g[2]&192)!==128)return v.lastNeed=2,"�"}}}function H(v){var g=this.lastTotal-this.lastNeed,f=M(this,v,g);if(f!==void 0)return f;if(this.lastNeed<=v.length)return v.copy(this.lastChar,g,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);v.copy(this.lastChar,g,0,v.length),this.lastNeed-=v.length}function F(v,g){var f=T(this,v,g);if(!this.lastNeed)return v.toString("utf8",g);this.lastTotal=f;var w=v.length-(f-this.lastNeed);return v.copy(this.lastChar,0,w),v.toString("utf8",g,w)}function R(v){var g=v&&v.length?this.write(v):"";if(this.lastNeed)return g+"�";return g}function D(v,g){if((v.length-g)%2===0){var f=v.toString("utf16le",g);if(f){var w=f.charCodeAt(f.length-1);if(w>=55296&&w<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=v[v.length-2],this.lastChar[1]=v[v.length-1],f.slice(0,-1)}return f}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=v[v.length-1],v.toString("utf16le",g,v.length-1)}function q(v){var g=v&&v.length?this.write(v):"";if(this.lastNeed){var f=this.lastTotal-this.lastNeed;return g+this.lastChar.toString("utf16le",0,f)}return g}function P(v,g){var f=(v.length-g)%3;if(f===0)return v.toString("base64",g);if(this.lastNeed=3-f,this.lastTotal=3,f===1)this.lastChar[0]=v[v.length-1];else this.lastChar[0]=v[v.length-2],this.lastChar[1]=v[v.length-1];return v.toString("base64",g,v.length-f)}function _(v){var g=v&&v.length?this.write(v):"";if(this.lastNeed)return g+this.lastChar.toString("base64",0,3-this.lastNeed);return g}function k(v){return v.toString(this.encoding)}function B(v){return v&&v.length?this.write(v):""}}),e$=d0(($,I)=>{var E=XO(),{PromisePrototypeThen:L,SymbolAsyncIterator:S,SymbolIterator:K}=s0(),{Buffer:Q}=(DU(),l0(RU)),{ERR_INVALID_ARG_TYPE:T,ERR_STREAM_NULL_VALUES:M}=TU().codes;function H(F,R,D){let q;if(typeof R==="string"||R instanceof Q)return new F({objectMode:!0,...D,read(){this.push(R),this.push(null)}});let P;if(R&&R[S])P=!0,q=R[S]();else if(R&&R[K])P=!1,q=R[K]();else throw new T("iterable",["Iterable"],R);let _=new F({objectMode:!0,highWaterMark:1,...D}),k=!1;_._read=function(){if(!k)k=!0,v()},_._destroy=function(g,f){L(B(g),()=>E.nextTick(f,g),(w)=>E.nextTick(f,w||g))};async function B(g){let f=g!==void 0&&g!==null,w=typeof q.throw==="function";if(f&&w){let{value:b,done:I0}=await q.throw(g);if(await b,I0)return}if(typeof q.return==="function"){let{value:b}=await q.return();await b}}async function v(){for(;;){try{let{value:g,done:f}=P?await q.next():q.next();if(f)_.push(null);else{let w=g&&typeof g.then==="function"?await g:g;if(w===null)throw k=!1,new M;else if(_.push(w))continue;else k=!1}}catch(g){_.destroy(g)}break}}return _}I.exports=H}),iO=d0(($,I)=>{var E=XO(),{ArrayPrototypeIndexOf:L,NumberIsInteger:S,NumberIsNaN:K,NumberParseInt:Q,ObjectDefineProperties:T,ObjectKeys:M,ObjectSetPrototypeOf:H,Promise:F,SafeSet:R,SymbolAsyncDispose:D,SymbolAsyncIterator:q,Symbol:P}=s0();I.exports=s,s.ReadableState=x0;var{EventEmitter:_}=(gO(),l0(BO)),{Stream:k,prependListener:B}=dZ(),{Buffer:v}=(DU(),l0(RU)),{addAbortSignal:g}=eO(),f=iU(),w=_U().debuglog("stream",(x)=>{w=x}),b=gQ(),I0=HO(),{getHighWaterMark:X0,getDefaultHighWaterMark:C0}=aO(),{aggregateTwoErrors:u,codes:{ERR_INVALID_ARG_TYPE:O0,ERR_METHOD_NOT_IMPLEMENTED:U,ERR_OUT_OF_RANGE:A,ERR_STREAM_PUSH_AFTER_EOF:X,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:Z},AbortError:C}=TU(),{validateObject:Y}=NO(),V=P("kPaused"),{StringDecoder:G}=NQ(),O=e$();H(s.prototype,k.prototype),H(s,k);var J=()=>{},{errorOrDestroy:z}=I0,W=1,j=2,N=4,p=8,n=16,E0=32,r=64,d=128,A0=256,t=512,i=1024,N0=2048,y=4096,h=8192,$0=16384,m=32768,a=65536,W0=131072,c=262144;function o(x){return{enumerable:!1,get(){return(this.state&x)!==0},set(l){if(l)this.state|=x;else this.state&=~x}}}T(x0.prototype,{objectMode:o(W),ended:o(j),endEmitted:o(N),reading:o(p),constructed:o(n),sync:o(E0),needReadable:o(r),emittedReadable:o(d),readableListening:o(A0),resumeScheduled:o(t),errorEmitted:o(i),emitClose:o(N0),autoDestroy:o(y),destroyed:o(h),closed:o($0),closeEmitted:o(m),multiAwaitDrain:o(a),readingMore:o(W0),dataEmitted:o(c)});function x0(x,l,e){if(typeof e!=="boolean")e=l instanceof nU();if(this.state=N0|y|n|E0,x&&x.objectMode)this.state|=W;if(e&&x&&x.readableObjectMode)this.state|=W;if(this.highWaterMark=x?X0(this,x,"readableHighWaterMark",e):C0(!1),this.buffer=new b,this.length=0,this.pipes=[],this.flowing=null,this[V]=null,x&&x.emitClose===!1)this.state&=~N0;if(x&&x.autoDestroy===!1)this.state&=~y;if(this.errored=null,this.defaultEncoding=x&&x.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,x&&x.encoding)this.decoder=new G(x.encoding),this.encoding=x.encoding}function s(x){if(!(this instanceof s))return new s(x);let l=this instanceof nU();if(this._readableState=new x0(x,this,l),x){if(typeof x.read==="function")this._read=x.read;if(typeof x.destroy==="function")this._destroy=x.destroy;if(typeof x.construct==="function")this._construct=x.construct;if(x.signal&&!l)g(x.signal,this)}k.call(this,x),I0.construct(this,()=>{if(this._readableState.needReadable)K0(this,this._readableState)})}s.prototype.destroy=I0.destroy,s.prototype._undestroy=I0.undestroy,s.prototype._destroy=function(x,l){l(x)},s.prototype[_.captureRejectionSymbol]=function(x){this.destroy(x)},s.prototype[D]=function(){let x;if(!this.destroyed)x=this.readableEnded?null:new C,this.destroy(x);return new F((l,e)=>f(this,(U0)=>U0&&U0!==x?e(U0):l(null)))},s.prototype.push=function(x,l){return Z0(this,x,l,!1)},s.prototype.unshift=function(x,l){return Z0(this,x,l,!0)};function Z0(x,l,e,U0){w("readableAddChunk",l);let f0=x._readableState,Y0;if((f0.state&W)===0){if(typeof l==="string"){if(e=e||f0.defaultEncoding,f0.encoding!==e)if(U0&&f0.encoding)l=v.from(l,e).toString(f0.encoding);else l=v.from(l,e),e=""}else if(l instanceof v)e="";else if(k._isUint8Array(l))l=k._uint8ArrayToBuffer(l),e="";else if(l!=null)Y0=new O0("chunk",["string","Buffer","Uint8Array"],l)}if(Y0)z(x,Y0);else if(l===null)f0.state&=~p,J0(x,f0);else if((f0.state&W)!==0||l&&l.length>0)if(U0)if((f0.state&N)!==0)z(x,new Z);else if(f0.destroyed||f0.errored)return!1;else w0(x,f0,l,!0);else if(f0.ended)z(x,new X);else if(f0.destroyed||f0.errored)return!1;else if(f0.state&=~p,f0.decoder&&!e)if(l=f0.decoder.write(l),f0.objectMode||l.length!==0)w0(x,f0,l,!1);else K0(x,f0);else w0(x,f0,l,!1);else if(!U0)f0.state&=~p,K0(x,f0);return!f0.ended&&(f0.length<f0.highWaterMark||f0.length===0)}function w0(x,l,e,U0){if(l.flowing&&l.length===0&&!l.sync&&x.listenerCount("data")>0){if((l.state&a)!==0)l.awaitDrainWriters.clear();else l.awaitDrainWriters=null;l.dataEmitted=!0,x.emit("data",e)}else{if(l.length+=l.objectMode?1:e.length,U0)l.buffer.unshift(e);else l.buffer.push(e);if((l.state&r)!==0)L0(x)}K0(x,l)}s.prototype.isPaused=function(){let x=this._readableState;return x[V]===!0||x.flowing===!1},s.prototype.setEncoding=function(x){let l=new G(x);this._readableState.decoder=l,this._readableState.encoding=this._readableState.decoder.encoding;let e=this._readableState.buffer,U0="";for(let f0 of e)U0+=l.write(f0);if(e.clear(),U0!=="")e.push(U0);return this._readableState.length=U0.length,this};var S0=1073741824;function V0(x){if(x>S0)throw new A("size","<= 1GiB",x);else x--,x|=x>>>1,x|=x>>>2,x|=x>>>4,x|=x>>>8,x|=x>>>16,x++;return x}function m0(x,l){if(x<=0||l.length===0&&l.ended)return 0;if((l.state&W)!==0)return 1;if(K(x)){if(l.flowing&&l.length)return l.buffer.first().length;return l.length}if(x<=l.length)return x;return l.ended?l.length:0}s.prototype.read=function(x){if(w("read",x),x===void 0)x=NaN;else if(!S(x))x=Q(x,10);let l=this._readableState,e=x;if(x>l.highWaterMark)l.highWaterMark=V0(x);if(x!==0)l.state&=~d;if(x===0&&l.needReadable&&((l.highWaterMark!==0?l.length>=l.highWaterMark:l.length>0)||l.ended)){if(w("read: emitReadable",l.length,l.ended),l.length===0&&l.ended)SU(this);else L0(this);return null}if(x=m0(x,l),x===0&&l.ended){if(l.length===0)SU(this);return null}let U0=(l.state&r)!==0;if(w("need readable",U0),l.length===0||l.length-x<l.highWaterMark)U0=!0,w("length less than watermark",U0);if(l.ended||l.reading||l.destroyed||l.errored||!l.constructed)U0=!1,w("reading, ended or constructing",U0);else if(U0){if(w("do read"),l.state|=p|E0,l.length===0)l.state|=r;try{this._read(l.highWaterMark)}catch(Y0){z(this,Y0)}if(l.state&=~E0,!l.reading)x=m0(e,l)}let f0;if(x>0)f0=z0(x,l);else f0=null;if(f0===null)l.needReadable=l.length<=l.highWaterMark,x=0;else if(l.length-=x,l.multiAwaitDrain)l.awaitDrainWriters.clear();else l.awaitDrainWriters=null;if(l.length===0){if(!l.ended)l.needReadable=!0;if(e!==x&&l.ended)SU(this)}if(f0!==null&&!l.errorEmitted&&!l.closeEmitted)l.dataEmitted=!0,this.emit("data",f0);return f0};function J0(x,l){if(w("onEofChunk"),l.ended)return;if(l.decoder){let e=l.decoder.end();if(e&&e.length)l.buffer.push(e),l.length+=l.objectMode?1:e.length}if(l.ended=!0,l.sync)L0(x);else l.needReadable=!1,l.emittedReadable=!0,a0(x)}function L0(x){let l=x._readableState;if(w("emitReadable",l.needReadable,l.emittedReadable),l.needReadable=!1,!l.emittedReadable)w("emitReadable",l.flowing),l.emittedReadable=!0,E.nextTick(a0,x)}function a0(x){let l=x._readableState;if(w("emitReadable_",l.destroyed,l.length,l.ended),!l.destroyed&&!l.errored&&(l.length||l.ended))x.emit("readable"),l.emittedReadable=!1;l.needReadable=!l.flowing&&!l.ended&&l.length<=l.highWaterMark,M0(x)}function K0(x,l){if(!l.readingMore&&l.constructed)l.readingMore=!0,E.nextTick(D0,x,l)}function D0(x,l){while(!l.reading&&!l.ended&&(l.length<l.highWaterMark||l.flowing&&l.length===0)){let e=l.length;if(w("maybeReadMore read 0"),x.read(0),e===l.length)break}l.readingMore=!1}s.prototype._read=function(x){throw new U("_read()")},s.prototype.pipe=function(x,l){let e=this,U0=this._readableState;if(U0.pipes.length===1){if(!U0.multiAwaitDrain)U0.multiAwaitDrain=!0,U0.awaitDrainWriters=new R(U0.awaitDrainWriters?[U0.awaitDrainWriters]:[])}U0.pipes.push(x),w("pipe count=%d opts=%j",U0.pipes.length,l);let f0=(!l||l.end!==!1)&&x!==E.stdout&&x!==E.stderr?R0:y0;if(U0.endEmitted)E.nextTick(f0);else e.once("end",f0);x.on("unpipe",Y0);function Y0(o0,b0){if(w("onunpipe"),o0===e){if(b0&&b0.hasUnpiped===!1)b0.hasUnpiped=!0,g0()}}function R0(){w("onend"),x.end()}let r0,q0=!1;function g0(){if(w("cleanup"),x.removeListener("close",e0),x.removeListener("finish",c0),r0)x.removeListener("drain",r0);if(x.removeListener("error",H0),x.removeListener("unpipe",Y0),e.removeListener("end",R0),e.removeListener("end",y0),e.removeListener("data",P0),q0=!0,r0&&U0.awaitDrainWriters&&(!x._writableState||x._writableState.needDrain))r0()}function HU(){if(!q0){if(U0.pipes.length===1&&U0.pipes[0]===x)w("false write response, pause",0),U0.awaitDrainWriters=x,U0.multiAwaitDrain=!1;else if(U0.pipes.length>1&&U0.pipes.includes(x))w("false write response, pause",U0.awaitDrainWriters.size),U0.awaitDrainWriters.add(x);e.pause()}if(!r0)r0=WU(e,x),x.on("drain",r0)}e.on("data",P0);function P0(o0){w("ondata");let b0=x.write(o0);if(w("dest.write",b0),b0===!1)HU()}function H0(o0){if(w("onerror",o0),y0(),x.removeListener("error",H0),x.listenerCount("error")===0){let b0=x._writableState||x._readableState;if(b0&&!b0.errorEmitted)z(x,o0);else x.emit("error",o0)}}B(x,"error",H0);function e0(){x.removeListener("finish",c0),y0()}x.once("close",e0);function c0(){w("onfinish"),x.removeListener("close",e0),y0()}x.once("finish",c0);function y0(){w("unpipe"),e.unpipe(x)}if(x.emit("pipe",e),x.writableNeedDrain===!0)HU();else if(!U0.flowing)w("pipe resume"),e.resume();return x};function WU(x,l){return function(){let e=x._readableState;if(e.awaitDrainWriters===l)w("pipeOnDrain",1),e.awaitDrainWriters=null;else if(e.multiAwaitDrain)w("pipeOnDrain",e.awaitDrainWriters.size),e.awaitDrainWriters.delete(l);if((!e.awaitDrainWriters||e.awaitDrainWriters.size===0)&&x.listenerCount("data"))x.resume()}}s.prototype.unpipe=function(x){let l=this._readableState,e={hasUnpiped:!1};if(l.pipes.length===0)return this;if(!x){let f0=l.pipes;l.pipes=[],this.pause();for(let Y0=0;Y0<f0.length;Y0++)f0[Y0].emit("unpipe",this,{hasUnpiped:!1});return this}let U0=L(l.pipes,x);if(U0===-1)return this;if(l.pipes.splice(U0,1),l.pipes.length===0)this.pause();return x.emit("unpipe",this,e),this},s.prototype.on=function(x,l){let e=k.prototype.on.call(this,x,l),U0=this._readableState;if(x==="data"){if(U0.readableListening=this.listenerCount("readable")>0,U0.flowing!==!1)this.resume()}else if(x==="readable"){if(!U0.endEmitted&&!U0.readableListening){if(U0.readableListening=U0.needReadable=!0,U0.flowing=!1,U0.emittedReadable=!1,w("on readable",U0.length,U0.reading),U0.length)L0(this);else if(!U0.reading)E.nextTick(k0,this)}}return e},s.prototype.addListener=s.prototype.on,s.prototype.removeListener=function(x,l){let e=k.prototype.removeListener.call(this,x,l);if(x==="readable")E.nextTick(F0,this);return e},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(x){let l=k.prototype.removeAllListeners.apply(this,arguments);if(x==="readable"||x===void 0)E.nextTick(F0,this);return l};function F0(x){let l=x._readableState;if(l.readableListening=x.listenerCount("readable")>0,l.resumeScheduled&&l[V]===!1)l.flowing=!0;else if(x.listenerCount("data")>0)x.resume();else if(!l.readableListening)l.flowing=null}function k0(x){w("readable nexttick read 0"),x.read(0)}s.prototype.resume=function(){let x=this._readableState;if(!x.flowing)w("resume"),x.flowing=!x.readableListening,FU(this,x);return x[V]=!1,this};function FU(x,l){if(!l.resumeScheduled)l.resumeScheduled=!0,E.nextTick(_0,x,l)}function _0(x,l){if(w("resume",l.reading),!l.reading)x.read(0);if(l.resumeScheduled=!1,x.emit("resume"),M0(x),l.flowing&&!l.reading)x.read(0)}s.prototype.pause=function(){if(w("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1)w("pause"),this._readableState.flowing=!1,this.emit("pause");return this._readableState[V]=!0,this};function M0(x){let l=x._readableState;w("flow",l.flowing);while(l.flowing&&x.read()!==null);}s.prototype.wrap=function(x){let l=!1;x.on("data",(U0)=>{if(!this.push(U0)&&x.pause)l=!0,x.pause()}),x.on("end",()=>{this.push(null)}),x.on("error",(U0)=>{z(this,U0)}),x.on("close",()=>{this.destroy()}),x.on("destroy",()=>{this.destroy()}),this._read=()=>{if(l&&x.resume)l=!1,x.resume()};let e=M(x);for(let U0=1;U0<e.length;U0++){let f0=e[U0];if(this[f0]===void 0&&typeof x[f0]==="function")this[f0]=x[f0].bind(x)}return this},s.prototype[q]=function(){return KU(this)},s.prototype.iterator=function(x){if(x!==void 0)Y(x,"options");return KU(this,x)};function KU(x,l){if(typeof x.read!=="function")x=s.wrap(x,{objectMode:!0});let e=j0(x,l);return e.stream=x,e}async function*j0(x,l){let e=J;function U0(R0){if(this===x)e(),e=J;else e=R0}x.on("readable",U0);let f0,Y0=f(x,{writable:!1},(R0)=>{f0=R0?u(f0,R0):null,e(),e=J});try{while(!0){let R0=x.destroyed?null:x.read();if(R0!==null)yield R0;else if(f0)throw f0;else if(f0===null)return;else await new F(U0)}}catch(R0){throw f0=u(f0,R0),f0}finally{if((f0||(l===null||l===void 0?void 0:l.destroyOnReturn)!==!1)&&(f0===void 0||x._readableState.autoDestroy))I0.destroyer(x,null);else x.off("readable",U0),Y0()}}T(s.prototype,{readable:{__proto__:null,get(){let x=this._readableState;return!!x&&x.readable!==!1&&!x.destroyed&&!x.errorEmitted&&!x.endEmitted},set(x){if(this._readableState)this._readableState.readable=!!x}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(x){if(this._readableState)this._readableState.flowing=x}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return this._readableState?this._readableState.closed:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set(x){if(!this._readableState)return;this._readableState.destroyed=x}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}}),T(x0.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[V]!==!1},set(x){this[V]=!!x}}}),s._fromList=z0;function z0(x,l){if(l.length===0)return null;let e;if(l.objectMode)e=l.buffer.shift();else if(!x||x>=l.length){if(l.decoder)e=l.buffer.join("");else if(l.buffer.length===1)e=l.buffer.first();else e=l.buffer.concat(l.length);l.buffer.clear()}else e=l.buffer.consume(x,l.decoder);return e}function SU(x){let l=x._readableState;if(w("endReadable",l.endEmitted),!l.endEmitted)l.ended=!0,E.nextTick(v0,l,x)}function v0(x,l){if(w("endReadableNT",x.endEmitted,x.length),!x.errored&&!x.closeEmitted&&!x.endEmitted&&x.length===0){if(x.endEmitted=!0,l.emit("end"),l.writable&&l.allowHalfOpen===!1)E.nextTick(B0,l);else if(x.autoDestroy){let e=l._writableState;if(!e||e.autoDestroy&&(e.finished||e.writable===!1))l.destroy()}}}function B0(x){if(x.writable&&!x.writableEnded&&!x.destroyed)x.end()}s.from=function(x,l){return O(s,x,l)};var VU;function T0(){if(VU===void 0)VU={};return VU}s.fromWeb=function(x,l){return T0().newStreamReadableFromReadableStream(x,l)},s.toWeb=function(x,l){return T0().newReadableStreamFromStreamReadable(x,l)},s.wrap=function(x,l){var e,U0;return new s({objectMode:(e=(U0=x.readableObjectMode)!==null&&U0!==void 0?U0:x.objectMode)!==null&&e!==void 0?e:!0,...l,destroy(f0,Y0){I0.destroyer(x,f0),Y0(f0)}}).wrap(x)}}),bZ=d0(($,I)=>{var E=XO(),{ArrayPrototypeSlice:L,Error:S,FunctionPrototypeSymbolHasInstance:K,ObjectDefineProperty:Q,ObjectDefineProperties:T,ObjectSetPrototypeOf:M,StringPrototypeToLowerCase:H,Symbol:F,SymbolHasInstance:R}=s0();I.exports=Y,Y.WritableState=Z;var{EventEmitter:D}=(gO(),l0(BO)),q=dZ().Stream,{Buffer:P}=(DU(),l0(RU)),_=HO(),{addAbortSignal:k}=eO(),{getHighWaterMark:B,getDefaultHighWaterMark:v}=aO(),{ERR_INVALID_ARG_TYPE:g,ERR_METHOD_NOT_IMPLEMENTED:f,ERR_MULTIPLE_CALLBACK:w,ERR_STREAM_CANNOT_PIPE:b,ERR_STREAM_DESTROYED:I0,ERR_STREAM_ALREADY_FINISHED:X0,ERR_STREAM_NULL_VALUES:C0,ERR_STREAM_WRITE_AFTER_END:u,ERR_UNKNOWN_ENCODING:O0}=TU().codes,{errorOrDestroy:U}=_;M(Y.prototype,q.prototype),M(Y,q);function A(){}var X=F("kOnFinished");function Z(y,h,$0){if(typeof $0!=="boolean")$0=h instanceof nU();if(this.objectMode=!!(y&&y.objectMode),$0)this.objectMode=this.objectMode||!!(y&&y.writableObjectMode);this.highWaterMark=y?B(this,y,"writableHighWaterMark",$0):v(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;let m=!!(y&&y.decodeStrings===!1);this.decodeStrings=!m,this.defaultEncoding=y&&y.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=z.bind(void 0,h),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,C(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!y||y.emitClose!==!1,this.autoDestroy=!y||y.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[X]=[]}function C(y){y.buffered=[],y.bufferedIndex=0,y.allBuffers=!0,y.allNoop=!0}Z.prototype.getBuffer=function(){return L(this.buffered,this.bufferedIndex)},Q(Z.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function Y(y){let h=this instanceof nU();if(!h&&!K(Y,this))return new Y(y);if(this._writableState=new Z(y,this,h),y){if(typeof y.write==="function")this._write=y.write;if(typeof y.writev==="function")this._writev=y.writev;if(typeof y.destroy==="function")this._destroy=y.destroy;if(typeof y.final==="function")this._final=y.final;if(typeof y.construct==="function")this._construct=y.construct;if(y.signal)k(y.signal,this)}q.call(this,y),_.construct(this,()=>{let $0=this._writableState;if(!$0.writing)p(this,$0);d(this,$0)})}Q(Y,R,{__proto__:null,value:function(y){if(K(this,y))return!0;if(this!==Y)return!1;return y&&y._writableState instanceof Z}}),Y.prototype.pipe=function(){U(this,new b)};function V(y,h,$0,m){let a=y._writableState;if(typeof $0==="function")m=$0,$0=a.defaultEncoding;else{if(!$0)$0=a.defaultEncoding;else if($0!=="buffer"&&!P.isEncoding($0))throw new O0($0);if(typeof m!=="function")m=A}if(h===null)throw new C0;else if(!a.objectMode)if(typeof h==="string"){if(a.decodeStrings!==!1)h=P.from(h,$0),$0="buffer"}else if(h instanceof P)$0="buffer";else if(q._isUint8Array(h))h=q._uint8ArrayToBuffer(h),$0="buffer";else throw new g("chunk",["string","Buffer","Uint8Array"],h);let W0;if(a.ending)W0=new u;else if(a.destroyed)W0=new I0("write");if(W0)return E.nextTick(m,W0),U(y,W0,!0),W0;return a.pendingcb++,G(y,a,h,$0,m)}Y.prototype.write=function(y,h,$0){return V(this,y,h,$0)===!0},Y.prototype.cork=function(){this._writableState.corked++},Y.prototype.uncork=function(){let y=this._writableState;if(y.corked){if(y.corked--,!y.writing)p(this,y)}},Y.prototype.setDefaultEncoding=function(y){if(typeof y==="string")y=H(y);if(!P.isEncoding(y))throw new O0(y);return this._writableState.defaultEncoding=y,this};function G(y,h,$0,m,a){let W0=h.objectMode?1:$0.length;h.length+=W0;let c=h.length<h.highWaterMark;if(!c)h.needDrain=!0;if(h.writing||h.corked||h.errored||!h.constructed){if(h.buffered.push({chunk:$0,encoding:m,callback:a}),h.allBuffers&&m!=="buffer")h.allBuffers=!1;if(h.allNoop&&a!==A)h.allNoop=!1}else h.writelen=W0,h.writecb=a,h.writing=!0,h.sync=!0,y._write($0,m,h.onwrite),h.sync=!1;return c&&!h.errored&&!h.destroyed}function O(y,h,$0,m,a,W0,c){if(h.writelen=m,h.writecb=c,h.writing=!0,h.sync=!0,h.destroyed)h.onwrite(new I0("write"));else if($0)y._writev(a,h.onwrite);else y._write(a,W0,h.onwrite);h.sync=!1}function J(y,h,$0,m){--h.pendingcb,m($0),N(h),U(y,$0)}function z(y,h){let $0=y._writableState,m=$0.sync,a=$0.writecb;if(typeof a!=="function"){U(y,new w);return}if($0.writing=!1,$0.writecb=null,$0.length-=$0.writelen,$0.writelen=0,h){if(h.stack,!$0.errored)$0.errored=h;if(y._readableState&&!y._readableState.errored)y._readableState.errored=h;if(m)E.nextTick(J,y,$0,h,a);else J(y,$0,h,a)}else{if($0.buffered.length>$0.bufferedIndex)p(y,$0);if(m)if($0.afterWriteTickInfo!==null&&$0.afterWriteTickInfo.cb===a)$0.afterWriteTickInfo.count++;else $0.afterWriteTickInfo={count:1,cb:a,stream:y,state:$0},E.nextTick(W,$0.afterWriteTickInfo);else j(y,$0,1,a)}}function W({stream:y,state:h,count:$0,cb:m}){return h.afterWriteTickInfo=null,j(y,h,$0,m)}function j(y,h,$0,m){if(!h.ending&&!y.destroyed&&h.length===0&&h.needDrain)h.needDrain=!1,y.emit("drain");while($0-- >0)h.pendingcb--,m();if(h.destroyed)N(h);d(y,h)}function N(y){if(y.writing)return;for(let a=y.bufferedIndex;a<y.buffered.length;++a){var h;let{chunk:W0,callback:c}=y.buffered[a],o=y.objectMode?1:W0.length;y.length-=o,c((h=y.errored)!==null&&h!==void 0?h:new I0("write"))}let $0=y[X].splice(0);for(let a=0;a<$0.length;a++){var m;$0[a]((m=y.errored)!==null&&m!==void 0?m:new I0("end"))}C(y)}function p(y,h){if(h.corked||h.bufferProcessing||h.destroyed||!h.constructed)return;let{buffered:$0,bufferedIndex:m,objectMode:a}=h,W0=$0.length-m;if(!W0)return;let c=m;if(h.bufferProcessing=!0,W0>1&&y._writev){h.pendingcb-=W0-1;let o=h.allNoop?A:(s)=>{for(let Z0=c;Z0<$0.length;++Z0)$0[Z0].callback(s)},x0=h.allNoop&&c===0?$0:L($0,c);x0.allBuffers=h.allBuffers,O(y,h,!0,h.length,x0,"",o),C(h)}else{do{let{chunk:o,encoding:x0,callback:s}=$0[c];$0[c++]=null;let Z0=a?1:o.length;O(y,h,!1,Z0,o,x0,s)}while(c<$0.length&&!h.writing);if(c===$0.length)C(h);else if(c>256)$0.splice(0,c),h.bufferedIndex=0;else h.bufferedIndex=c}h.bufferProcessing=!1}Y.prototype._write=function(y,h,$0){if(this._writev)this._writev([{chunk:y,encoding:h}],$0);else throw new f("_write()")},Y.prototype._writev=null,Y.prototype.end=function(y,h,$0){let m=this._writableState;if(typeof y==="function")$0=y,y=null,h=null;else if(typeof h==="function")$0=h,h=null;let a;if(y!==null&&y!==void 0){let W0=V(this,y,h);if(W0 instanceof S)a=W0}if(m.corked)m.corked=1,this.uncork();if(a);else if(!m.errored&&!m.ending)m.ending=!0,d(this,m,!0),m.ended=!0;else if(m.finished)a=new X0("end");else if(m.destroyed)a=new I0("end");if(typeof $0==="function")if(a||m.finished)E.nextTick($0,a);else m[X].push($0);return this};function n(y){return y.ending&&!y.destroyed&&y.constructed&&y.length===0&&!y.errored&&y.buffered.length===0&&!y.finished&&!y.writing&&!y.errorEmitted&&!y.closeEmitted}function E0(y,h){let $0=!1;function m(a){if($0){U(y,a!==null&&a!==void 0?a:w());return}if($0=!0,h.pendingcb--,a){let W0=h[X].splice(0);for(let c=0;c<W0.length;c++)W0[c](a);U(y,a,h.sync)}else if(n(h))h.prefinished=!0,y.emit("prefinish"),h.pendingcb++,E.nextTick(A0,y,h)}h.sync=!0,h.pendingcb++;try{y._final(m)}catch(a){m(a)}h.sync=!1}function r(y,h){if(!h.prefinished&&!h.finalCalled)if(typeof y._final==="function"&&!h.destroyed)h.finalCalled=!0,E0(y,h);else h.prefinished=!0,y.emit("prefinish")}function d(y,h,$0){if(n(h)){if(r(y,h),h.pendingcb===0){if($0)h.pendingcb++,E.nextTick((m,a)=>{if(n(a))A0(m,a);else a.pendingcb--},y,h);else if(n(h))h.pendingcb++,A0(y,h)}}}function A0(y,h){h.pendingcb--,h.finished=!0;let $0=h[X].splice(0);for(let m=0;m<$0.length;m++)$0[m]();if(y.emit("finish"),h.autoDestroy){let m=y._readableState;if(!m||m.autoDestroy&&(m.endEmitted||m.readable===!1))y.destroy()}}T(Y.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(y){if(this._writableState)this._writableState.destroyed=y}},writable:{__proto__:null,get(){let y=this._writableState;return!!y&&y.writable!==!1&&!y.destroyed&&!y.errored&&!y.ending&&!y.ended},set(y){if(this._writableState)this._writableState.writable=!!y}},writableFinished:{__proto__:null,get(){return this._writableState?this._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return this._writableState?this._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return this._writableState?this._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){let y=this._writableState;if(!y)return!1;return!y.destroyed&&!y.ending&&y.needDrain}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)}}});var t=_.destroy;Y.prototype.destroy=function(y,h){let $0=this._writableState;if(!$0.destroyed&&($0.bufferedIndex<$0.buffered.length||$0[X].length))E.nextTick(N,$0);return t.call(this,y,h),this},Y.prototype._undestroy=_.undestroy,Y.prototype._destroy=function(y,h){h(y)},Y.prototype[D.captureRejectionSymbol]=function(y){this.destroy(y)};var i;function N0(){if(i===void 0)i={};return i}Y.fromWeb=function(y,h){return N0().newStreamWritableFromWritableStream(y,h)},Y.toWeb=function(y){return N0().newWritableStreamFromStreamWritable(y)}}),fQ=d0(($,I)=>{var E=XO(),L=(DU(),l0(RU)),{isReadable:S,isWritable:K,isIterable:Q,isNodeStream:T,isReadableNodeStream:M,isWritableNodeStream:H,isDuplexNodeStream:F,isReadableStream:R,isWritableStream:D}=tU(),q=iU(),{AbortError:P,codes:{ERR_INVALID_ARG_TYPE:_,ERR_INVALID_RETURN_VALUE:k}}=TU(),{destroyer:B}=HO(),v=nU(),g=iO(),f=bZ(),{createDeferredPromise:w}=_U(),b=e$(),I0=globalThis.Blob||L.Blob,X0=typeof I0<"u"?function(X){return X instanceof I0}:function(X){return!1},C0=globalThis.AbortController||xO().AbortController,{FunctionPrototypeCall:u}=s0();class O0 extends v{constructor(X){super(X);if((X===null||X===void 0?void 0:X.readable)===!1)this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0;if((X===null||X===void 0?void 0:X.writable)===!1)this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0}}I.exports=function X(Z,C){if(F(Z))return Z;if(M(Z))return A({readable:Z});if(H(Z))return A({writable:Z});if(T(Z))return A({writable:!1,readable:!1});if(R(Z))return A({readable:g.fromWeb(Z)});if(D(Z))return A({writable:f.fromWeb(Z)});if(typeof Z==="function"){let{value:V,write:G,final:O,destroy:J}=U(Z);if(Q(V))return b(O0,V,{objectMode:!0,write:G,final:O,destroy:J});let z=V===null||V===void 0?void 0:V.then;if(typeof z==="function"){let W,j=u(z,V,(N)=>{if(N!=null)throw new k("nully","body",N)},(N)=>{B(W,N)});return W=new O0({objectMode:!0,readable:!1,write:G,final(N){O(async()=>{try{await j,E.nextTick(N,null)}catch(p){E.nextTick(N,p)}})},destroy:J})}throw new k("Iterable, AsyncIterable or AsyncFunction",C,V)}if(X0(Z))return X(Z.arrayBuffer());if(Q(Z))return b(O0,Z,{objectMode:!0,writable:!1});if(R(Z===null||Z===void 0?void 0:Z.readable)&&D(Z===null||Z===void 0?void 0:Z.writable))return O0.fromWeb(Z);if(typeof(Z===null||Z===void 0?void 0:Z.writable)==="object"||typeof(Z===null||Z===void 0?void 0:Z.readable)==="object"){let V=Z!==null&&Z!==void 0&&Z.readable?M(Z===null||Z===void 0?void 0:Z.readable)?Z===null||Z===void 0?void 0:Z.readable:X(Z.readable):void 0,G=Z!==null&&Z!==void 0&&Z.writable?H(Z===null||Z===void 0?void 0:Z.writable)?Z===null||Z===void 0?void 0:Z.writable:X(Z.writable):void 0;return A({readable:V,writable:G})}let Y=Z===null||Z===void 0?void 0:Z.then;if(typeof Y==="function"){let V;return u(Y,Z,(G)=>{if(G!=null)V.push(G);V.push(null)},(G)=>{B(V,G)}),V=new O0({objectMode:!0,writable:!1,read(){}})}throw new _(C,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],Z)};function U(X){let{promise:Z,resolve:C}=w(),Y=new C0,V=Y.signal;return{value:X(async function*(){while(!0){let G=Z;Z=null;let{chunk:O,done:J,cb:z}=await G;if(E.nextTick(z),J)return;if(V.aborted)throw new P(void 0,{cause:V.reason});({promise:Z,resolve:C}=w()),yield O}}(),{signal:V}),write(G,O,J){let z=C;C=null,z({chunk:G,done:!1,cb:J})},final(G){let O=C;C=null,O({done:!0,cb:G})},destroy(G,O){Y.abort(),O(G)}}}function A(X){let Z=X.readable&&typeof X.readable.read!=="function"?g.wrap(X.readable):X.readable,C=X.writable,Y=!!S(Z),V=!!K(C),G,O,J,z,W;function j(N){let p=z;if(z=null,p)p(N);else if(N)W.destroy(N)}if(W=new O0({readableObjectMode:!!(Z!==null&&Z!==void 0&&Z.readableObjectMode),writableObjectMode:!!(C!==null&&C!==void 0&&C.writableObjectMode),readable:Y,writable:V}),V)q(C,(N)=>{if(V=!1,N)B(Z,N);j(N)}),W._write=function(N,p,n){if(C.write(N,p))n();else G=n},W._final=function(N){C.end(),O=N},C.on("drain",function(){if(G){let N=G;G=null,N()}}),C.on("finish",function(){if(O){let N=O;O=null,N()}});if(Y)q(Z,(N)=>{if(Y=!1,N)B(Z,N);j(N)}),Z.on("readable",function(){if(J){let N=J;J=null,N()}}),Z.on("end",function(){W.push(null)}),W._read=function(){while(!0){let N=Z.read();if(N===null){J=W._read;return}if(!W.push(N))return}};return W._destroy=function(N,p){if(!N&&z!==null)N=new P;if(J=null,G=null,O=null,z===null)p(N);else z=p,B(C,N),B(Z,N)},W}}),nU=d0(($,I)=>{var{ObjectDefineProperties:E,ObjectGetOwnPropertyDescriptor:L,ObjectKeys:S,ObjectSetPrototypeOf:K}=s0();I.exports=M;var Q=iO(),T=bZ();K(M.prototype,Q.prototype),K(M,Q);{let D=S(T.prototype);for(let q=0;q<D.length;q++){let P=D[q];if(!M.prototype[P])M.prototype[P]=T.prototype[P]}}function M(D){if(!(this instanceof M))return new M(D);if(Q.call(this,D),T.call(this,D),D){if(this.allowHalfOpen=D.allowHalfOpen!==!1,D.readable===!1)this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0;if(D.writable===!1)this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0}else this.allowHalfOpen=!0}E(M.prototype,{writable:{__proto__:null,...L(T.prototype,"writable")},writableHighWaterMark:{__proto__:null,...L(T.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...L(T.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...L(T.prototype,"writableBuffer")},writableLength:{__proto__:null,...L(T.prototype,"writableLength")},writableFinished:{__proto__:null,...L(T.prototype,"writableFinished")},writableCorked:{__proto__:null,...L(T.prototype,"writableCorked")},writableEnded:{__proto__:null,...L(T.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...L(T.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){if(this._readableState===void 0||this._writableState===void 0)return!1;return this._readableState.destroyed&&this._writableState.destroyed},set(D){if(this._readableState&&this._writableState)this._readableState.destroyed=D,this._writableState.destroyed=D}}});var H;function F(){if(H===void 0)H={};return H}M.fromWeb=function(D,q){return F().newStreamDuplexFromReadableWritablePair(D,q)},M.toWeb=function(D){return F().newReadableWritablePairFromDuplex(D)};var R;M.from=function(D){if(!R)R=fQ();return R(D,"body")}}),a$=d0(($,I)=>{var{ObjectSetPrototypeOf:E,Symbol:L}=s0();I.exports=M;var{ERR_METHOD_NOT_IMPLEMENTED:S}=TU().codes,K=nU(),{getHighWaterMark:Q}=aO();E(M.prototype,K.prototype),E(M,K);var T=L("kCallback");function M(R){if(!(this instanceof M))return new M(R);let D=R?Q(this,R,"readableHighWaterMark",!0):null;if(D===0)R={...R,highWaterMark:null,readableHighWaterMark:D,writableHighWaterMark:R.writableHighWaterMark||0};if(K.call(this,R),this._readableState.sync=!1,this[T]=null,R){if(typeof R.transform==="function")this._transform=R.transform;if(typeof R.flush==="function")this._flush=R.flush}this.on("prefinish",F)}function H(R){if(typeof this._flush==="function"&&!this.destroyed)this._flush((D,q)=>{if(D){if(R)R(D);else this.destroy(D);return}if(q!=null)this.push(q);if(this.push(null),R)R()});else if(this.push(null),R)R()}function F(){if(this._final!==H)H.call(this)}M.prototype._final=H,M.prototype._transform=function(R,D,q){throw new S("_transform()")},M.prototype._write=function(R,D,q){let P=this._readableState,_=this._writableState,k=P.length;this._transform(R,D,(B,v)=>{if(B){q(B);return}if(v!=null)this.push(v);if(_.ended||k===P.length||P.length<P.highWaterMark)q();else this[T]=q})},M.prototype._read=function(){if(this[T]){let R=this[T];this[T]=null,R()}}}),i$=d0(($,I)=>{var{ObjectSetPrototypeOf:E}=s0();I.exports=S;var L=a$();E(S.prototype,L.prototype),E(S,L);function S(K){if(!(this instanceof S))return new S(K);L.call(this,K)}S.prototype._transform=function(K,Q,T){T(null,K)}}),oZ=d0(($,I)=>{var E=XO(),{ArrayIsArray:L,Promise:S,SymbolAsyncIterator:K,SymbolDispose:Q}=s0(),T=iU(),{once:M}=_U(),H=HO(),F=nU(),{aggregateTwoErrors:R,codes:{ERR_INVALID_ARG_TYPE:D,ERR_INVALID_RETURN_VALUE:q,ERR_MISSING_ARGS:P,ERR_STREAM_DESTROYED:_,ERR_STREAM_PREMATURE_CLOSE:k},AbortError:B}=TU(),{validateFunction:v,validateAbortSignal:g}=NO(),{isIterable:f,isReadable:w,isReadableNodeStream:b,isNodeStream:I0,isTransformStream:X0,isWebStream:C0,isReadableStream:u,isReadableFinished:O0}=tU(),U=globalThis.AbortController||xO().AbortController,A,X,Z;function C(N,p,n){let E0=!1;N.on("close",()=>{E0=!0});let r=T(N,{readable:p,writable:n},(d)=>{E0=!d});return{destroy:(d)=>{if(E0)return;E0=!0,H.destroyer(N,d||new _("pipe"))},cleanup:r}}function Y(N){return v(N[N.length-1],"streams[stream.length - 1]"),N.pop()}function V(N){if(f(N))return N;else if(b(N))return G(N);throw new D("val",["Readable","Iterable","AsyncIterable"],N)}async function*G(N){if(!X)X=iO();yield*X.prototype[K].call(N)}async function O(N,p,n,{end:E0}){let r,d=null,A0=(N0)=>{if(N0)r=N0;if(d){let y=d;d=null,y()}},t=()=>new S((N0,y)=>{if(r)y(r);else d=()=>{if(r)y(r);else N0()}});p.on("drain",A0);let i=T(p,{readable:!1},A0);try{if(p.writableNeedDrain)await t();for await(let N0 of N)if(!p.write(N0))await t();if(E0)p.end(),await t();n()}catch(N0){n(r!==N0?R(r,N0):N0)}finally{i(),p.off("drain",A0)}}async function J(N,p,n,{end:E0}){if(X0(p))p=p.writable;let r=p.getWriter();try{for await(let d of N)await r.ready,r.write(d).catch(()=>{});if(await r.ready,E0)await r.close();n()}catch(d){try{await r.abort(d),n(d)}catch(A0){n(A0)}}}function z(...N){return W(N,M(Y(N)))}function W(N,p,n){if(N.length===1&&L(N[0]))N=N[0];if(N.length<2)throw new P("streams");let E0=new U,r=E0.signal,d=n===null||n===void 0?void 0:n.signal,A0=[];g(d,"options.signal");function t(){a(new B)}Z=Z||_U().addAbortListener;let i;if(d)i=Z(d,t);let N0,y,h=[],$0=0;function m(s){a(s,--$0===0)}function a(s,Z0){var w0;if(s&&(!N0||N0.code==="ERR_STREAM_PREMATURE_CLOSE"))N0=s;if(!N0&&!Z0)return;while(h.length)h.shift()(N0);if((w0=i)===null||w0===void 0||w0[Q](),E0.abort(),Z0){if(!N0)A0.forEach((S0)=>S0());E.nextTick(p,N0,y)}}let W0;for(let s=0;s<N.length;s++){let Z0=N[s],w0=s<N.length-1,S0=s>0,V0=w0||(n===null||n===void 0?void 0:n.end)!==!1,m0=s===N.length-1;if(I0(Z0)){let J0=function(L0){if(L0&&L0.name!=="AbortError"&&L0.code!=="ERR_STREAM_PREMATURE_CLOSE")m(L0)};var c=J0;if(V0){let{destroy:L0,cleanup:a0}=C(Z0,w0,S0);if(h.push(L0),w(Z0)&&m0)A0.push(a0)}if(Z0.on("error",J0),w(Z0)&&m0)A0.push(()=>{Z0.removeListener("error",J0)})}if(s===0)if(typeof Z0==="function"){if(W0=Z0({signal:r}),!f(W0))throw new q("Iterable, AsyncIterable or Stream","source",W0)}else if(f(Z0)||b(Z0)||X0(Z0))W0=Z0;else W0=F.from(Z0);else if(typeof Z0==="function"){if(X0(W0)){var o;W0=V((o=W0)===null||o===void 0?void 0:o.readable)}else W0=V(W0);if(W0=Z0(W0,{signal:r}),w0){if(!f(W0,!0))throw new q("AsyncIterable",`transform[${s-1}]`,W0)}else{var x0;if(!A)A=i$();let J0=new A({objectMode:!0}),L0=(x0=W0)===null||x0===void 0?void 0:x0.then;if(typeof L0==="function")$0++,L0.call(W0,(D0)=>{if(y=D0,D0!=null)J0.write(D0);if(V0)J0.end();E.nextTick(m)},(D0)=>{J0.destroy(D0),E.nextTick(m,D0)});else if(f(W0,!0))$0++,O(W0,J0,m,{end:V0});else if(u(W0)||X0(W0)){let D0=W0.readable||W0;$0++,O(D0,J0,m,{end:V0})}else throw new q("AsyncIterable or Promise","destination",W0);W0=J0;let{destroy:a0,cleanup:K0}=C(W0,!1,!0);if(h.push(a0),m0)A0.push(K0)}}else if(I0(Z0)){if(b(W0)){$0+=2;let J0=j(W0,Z0,m,{end:V0});if(w(Z0)&&m0)A0.push(J0)}else if(X0(W0)||u(W0)){let J0=W0.readable||W0;$0++,O(J0,Z0,m,{end:V0})}else if(f(W0))$0++,O(W0,Z0,m,{end:V0});else throw new D("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],W0);W0=Z0}else if(C0(Z0)){if(b(W0))$0++,J(V(W0),Z0,m,{end:V0});else if(u(W0)||f(W0))$0++,J(W0,Z0,m,{end:V0});else if(X0(W0))$0++,J(W0.readable,Z0,m,{end:V0});else throw new D("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],W0);W0=Z0}else W0=F.from(Z0)}if(r!==null&&r!==void 0&&r.aborted||d!==null&&d!==void 0&&d.aborted)E.nextTick(t);return W0}function j(N,p,n,{end:E0}){let r=!1;if(p.on("close",()=>{if(!r)n(new k)}),N.pipe(p,{end:!1}),E0){let A0=function(){r=!0,p.end()};var d=A0;if(O0(N))E.nextTick(A0);else N.once("end",A0)}else n();return T(N,{readable:!0,writable:!1},(A0)=>{let t=N._readableState;if(A0&&A0.code==="ERR_STREAM_PREMATURE_CLOSE"&&t&&t.ended&&!t.errored&&!t.errorEmitted)N.once("end",n).once("error",n);else n(A0)}),T(p,{readable:!1,writable:!0},n)}I.exports={pipelineImpl:W,pipeline:z}}),UI=d0(($,I)=>{var{pipeline:E}=oZ(),L=nU(),{destroyer:S}=HO(),{isNodeStream:K,isReadable:Q,isWritable:T,isWebStream:M,isTransformStream:H,isWritableStream:F,isReadableStream:R}=tU(),{AbortError:D,codes:{ERR_INVALID_ARG_VALUE:q,ERR_MISSING_ARGS:P}}=TU(),_=iU();I.exports=function(...k){if(k.length===0)throw new P("streams");if(k.length===1)return L.from(k[0]);let B=[...k];if(typeof k[0]==="function")k[0]=L.from(k[0]);if(typeof k[k.length-1]==="function"){let U=k.length-1;k[U]=L.from(k[U])}for(let U=0;U<k.length;++U){if(!K(k[U])&&!M(k[U]))continue;if(U<k.length-1&&!(Q(k[U])||R(k[U])||H(k[U])))throw new q(`streams[${U}]`,B[U],"must be readable");if(U>0&&!(T(k[U])||F(k[U])||H(k[U])))throw new q(`streams[${U}]`,B[U],"must be writable")}let v,g,f,w,b;function I0(U){let A=w;if(w=null,A)A(U);else if(U)b.destroy(U);else if(!O0&&!u)b.destroy()}let X0=k[0],C0=E(k,I0),u=!!(T(X0)||F(X0)||H(X0)),O0=!!(Q(C0)||R(C0)||H(C0));if(b=new L({writableObjectMode:!!(X0!==null&&X0!==void 0&&X0.writableObjectMode),readableObjectMode:!!(C0!==null&&C0!==void 0&&C0.readableObjectMode),writable:u,readable:O0}),u){if(K(X0))b._write=function(A,X,Z){if(X0.write(A,X))Z();else v=Z},b._final=function(A){X0.end(),g=A},X0.on("drain",function(){if(v){let A=v;v=null,A()}});else if(M(X0)){let A=(H(X0)?X0.writable:X0).getWriter();b._write=async function(X,Z,C){try{await A.ready,A.write(X).catch(()=>{}),C()}catch(Y){C(Y)}},b._final=async function(X){try{await A.ready,A.close().catch(()=>{}),g=X}catch(Z){X(Z)}}}let U=H(C0)?C0.readable:C0;_(U,()=>{if(g){let A=g;g=null,A()}})}if(O0){if(K(C0))C0.on("readable",function(){if(f){let U=f;f=null,U()}}),C0.on("end",function(){b.push(null)}),b._read=function(){while(!0){let U=C0.read();if(U===null){f=b._read;return}if(!b.push(U))return}};else if(M(C0)){let U=(H(C0)?C0.readable:C0).getReader();b._read=async function(){while(!0)try{let{value:A,done:X}=await U.read();if(!b.push(A))return;if(X){b.push(null);return}}catch{return}}}}return b._destroy=function(U,A){if(!U&&w!==null)U=new D;if(f=null,v=null,g=null,w===null)A(U);else if(w=A,K(C0))S(C0,U)},b}}),wQ=d0(($,I)=>{var E=globalThis.AbortController||xO().AbortController,{codes:{ERR_INVALID_ARG_VALUE:L,ERR_INVALID_ARG_TYPE:S,ERR_MISSING_ARGS:K,ERR_OUT_OF_RANGE:Q},AbortError:T}=TU(),{validateAbortSignal:M,validateInteger:H,validateObject:F}=NO(),R=s0().Symbol("kWeak"),D=s0().Symbol("kResistStopPropagation"),{finished:q}=iU(),P=UI(),{addAbortSignalNoValidate:_}=eO(),{isWritable:k,isNodeStream:B}=tU(),{deprecate:v}=_U(),{ArrayPrototypePush:g,Boolean:f,MathFloor:w,Number:b,NumberIsNaN:I0,Promise:X0,PromiseReject:C0,PromiseResolve:u,PromisePrototypeThen:O0,Symbol:U}=s0(),A=U("kEmpty"),X=U("kEof");function Z(d,A0){if(A0!=null)F(A0,"options");if((A0===null||A0===void 0?void 0:A0.signal)!=null)M(A0.signal,"options.signal");if(B(d)&&!k(d))throw new L("stream",d,"must be writable");let t=P(this,d);if(A0!==null&&A0!==void 0&&A0.signal)_(A0.signal,t);return t}function C(d,A0){if(typeof d!=="function")throw new S("fn",["Function","AsyncFunction"],d);if(A0!=null)F(A0,"options");if((A0===null||A0===void 0?void 0:A0.signal)!=null)M(A0.signal,"options.signal");let t=1;if((A0===null||A0===void 0?void 0:A0.concurrency)!=null)t=w(A0.concurrency);let i=t-1;if((A0===null||A0===void 0?void 0:A0.highWaterMark)!=null)i=w(A0.highWaterMark);return H(t,"options.concurrency",1),H(i,"options.highWaterMark",0),i+=t,async function*(){let N0=_U().AbortSignalAny([A0===null||A0===void 0?void 0:A0.signal].filter(f)),y=this,h=[],$0={signal:N0},m,a,W0=!1,c=0;function o(){W0=!0,x0()}function x0(){c-=1,s()}function s(){if(a&&!W0&&c<t&&h.length<i)a(),a=null}async function Z0(){try{for await(let w0 of y){if(W0)return;if(N0.aborted)throw new T;try{if(w0=d(w0,$0),w0===A)continue;w0=u(w0)}catch(S0){w0=C0(S0)}if(c+=1,O0(w0,x0,o),h.push(w0),m)m(),m=null;if(!W0&&(h.length>=i||c>=t))await new X0((S0)=>{a=S0})}h.push(X)}catch(w0){let S0=C0(w0);O0(S0,x0,o),h.push(S0)}finally{if(W0=!0,m)m(),m=null}}Z0();try{while(!0){while(h.length>0){let w0=await h[0];if(w0===X)return;if(N0.aborted)throw new T;if(w0!==A)yield w0;h.shift(),s()}await new X0((w0)=>{m=w0})}}finally{if(W0=!0,a)a(),a=null}}.call(this)}function Y(d=void 0){if(d!=null)F(d,"options");if((d===null||d===void 0?void 0:d.signal)!=null)M(d.signal,"options.signal");return async function*(){let A0=0;for await(let i of this){var t;if(d!==null&&d!==void 0&&(t=d.signal)!==null&&t!==void 0&&t.aborted)throw new T({cause:d.signal.reason});yield[A0++,i]}}.call(this)}async function V(d,A0=void 0){for await(let t of z.call(this,d,A0))return!0;return!1}async function G(d,A0=void 0){if(typeof d!=="function")throw new S("fn",["Function","AsyncFunction"],d);return!await V.call(this,async(...t)=>{return!await d(...t)},A0)}async function O(d,A0){for await(let t of z.call(this,d,A0))return t;return}async function J(d,A0){if(typeof d!=="function")throw new S("fn",["Function","AsyncFunction"],d);async function t(i,N0){return await d(i,N0),A}for await(let i of C.call(this,t,A0));}function z(d,A0){if(typeof d!=="function")throw new S("fn",["Function","AsyncFunction"],d);async function t(i,N0){if(await d(i,N0))return i;return A}return C.call(this,t,A0)}class W extends K{constructor(){super("reduce");this.message="Reduce of an empty stream requires an initial value"}}async function j(d,A0,t){var i;if(typeof d!=="function")throw new S("reducer",["Function","AsyncFunction"],d);if(t!=null)F(t,"options");if((t===null||t===void 0?void 0:t.signal)!=null)M(t.signal,"options.signal");let N0=arguments.length>1;if(t!==null&&t!==void 0&&(i=t.signal)!==null&&i!==void 0&&i.aborted){let a=new T(void 0,{cause:t.signal.reason});throw this.once("error",()=>{}),await q(this.destroy(a)),a}let y=new E,h=y.signal;if(t!==null&&t!==void 0&&t.signal){let a={once:!0,[R]:this,[D]:!0};t.signal.addEventListener("abort",()=>y.abort(),a)}let $0=!1;try{for await(let a of this){var m;if($0=!0,t!==null&&t!==void 0&&(m=t.signal)!==null&&m!==void 0&&m.aborted)throw new T;if(!N0)A0=a,N0=!0;else A0=await d(A0,a,{signal:h})}if(!$0&&!N0)throw new W}finally{y.abort()}return A0}async function N(d){if(d!=null)F(d,"options");if((d===null||d===void 0?void 0:d.signal)!=null)M(d.signal,"options.signal");let A0=[];for await(let i of this){var t;if(d!==null&&d!==void 0&&(t=d.signal)!==null&&t!==void 0&&t.aborted)throw new T(void 0,{cause:d.signal.reason});g(A0,i)}return A0}function p(d,A0){let t=C.call(this,d,A0);return async function*(){for await(let i of t)yield*i}.call(this)}function n(d){if(d=b(d),I0(d))return 0;if(d<0)throw new Q("number",">= 0",d);return d}function E0(d,A0=void 0){if(A0!=null)F(A0,"options");if((A0===null||A0===void 0?void 0:A0.signal)!=null)M(A0.signal,"options.signal");return d=n(d),async function*(){var t;if(A0!==null&&A0!==void 0&&(t=A0.signal)!==null&&t!==void 0&&t.aborted)throw new T;for await(let N0 of this){var i;if(A0!==null&&A0!==void 0&&(i=A0.signal)!==null&&i!==void 0&&i.aborted)throw new T;if(d--<=0)yield N0}}.call(this)}function r(d,A0=void 0){if(A0!=null)F(A0,"options");if((A0===null||A0===void 0?void 0:A0.signal)!=null)M(A0.signal,"options.signal");return d=n(d),async function*(){var t;if(A0!==null&&A0!==void 0&&(t=A0.signal)!==null&&t!==void 0&&t.aborted)throw new T;for await(let N0 of this){var i;if(A0!==null&&A0!==void 0&&(i=A0.signal)!==null&&i!==void 0&&i.aborted)throw new T;if(d-- >0)yield N0;if(d<=0)return}}.call(this)}I.exports.streamReturningOperators={asIndexedPairs:v(Y,"readable.asIndexedPairs will be removed in a future version."),drop:E0,filter:z,flatMap:p,map:C,take:r,compose:Z},I.exports.promiseReturningOperators={every:G,forEach:J,reduce:j,toArray:N,some:V,find:O}}),OI=d0(($,I)=>{var{ArrayPrototypePop:E,Promise:L}=s0(),{isIterable:S,isNodeStream:K,isWebStream:Q}=tU(),{pipelineImpl:T}=oZ(),{finished:M}=iU();ZI();function H(...F){return new L((R,D)=>{let q,P,_=F[F.length-1];if(_&&typeof _==="object"&&!K(_)&&!S(_)&&!Q(_)){let k=E(F);q=k.signal,P=k.end}T(F,(k,B)=>{if(k)D(k);else R(B)},{signal:q,end:P})})}I.exports={finished:M,pipeline:H}}),ZI=d0(($,I)=>{var{Buffer:E}=(DU(),l0(RU)),{ObjectDefineProperty:L,ObjectKeys:S,ReflectApply:K}=s0(),{promisify:{custom:Q}}=_U(),{streamReturningOperators:T,promiseReturningOperators:M}=wQ(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:H}}=TU(),F=UI(),{setDefaultHighWaterMark:R,getDefaultHighWaterMark:D}=aO(),{pipeline:q}=oZ(),{destroyer:P}=HO(),_=iU(),k=OI(),B=tU(),v=I.exports=dZ().Stream;v.isDestroyed=B.isDestroyed,v.isDisturbed=B.isDisturbed,v.isErrored=B.isErrored,v.isReadable=B.isReadable,v.isWritable=B.isWritable,v.Readable=iO();for(let f of S(T)){let w=function(...I0){if(new.target)throw H();return v.Readable.from(K(b,this,I0))},b=T[f];L(w,"name",{__proto__:null,value:b.name}),L(w,"length",{__proto__:null,value:b.length}),L(v.Readable.prototype,f,{__proto__:null,value:w,enumerable:!1,configurable:!0,writable:!0})}for(let f of S(M)){let w=function(...I0){if(new.target)throw H();return K(b,this,I0)},b=M[f];L(w,"name",{__proto__:null,value:b.name}),L(w,"length",{__proto__:null,value:b.length}),L(v.Readable.prototype,f,{__proto__:null,value:w,enumerable:!1,configurable:!0,writable:!0})}v.Writable=bZ(),v.Duplex=nU(),v.Transform=a$(),v.PassThrough=i$(),v.pipeline=q;var{addAbortSignal:g}=eO();v.addAbortSignal=g,v.finished=_,v.destroy=P,v.compose=F,v.setDefaultHighWaterMark=R,v.getDefaultHighWaterMark=D,L(v,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return k}}),L(q,Q,{__proto__:null,enumerable:!0,get(){return k.pipeline}}),L(_,Q,{__proto__:null,enumerable:!0,get(){return k.finished}}),v.Stream=v,v._isUint8Array=function(f){return f instanceof Uint8Array},v._uint8ArrayToBuffer=function(f){return E.from(f.buffer,f.byteOffset,f.byteLength)}}),yQ=d0(($,I)=>{var E=UZ();{let L=ZI(),S=OI(),K=L.Readable.destroy;I.exports=L.Readable,I.exports._uint8ArrayToBuffer=L._uint8ArrayToBuffer,I.exports._isUint8Array=L._isUint8Array,I.exports.isDisturbed=L.isDisturbed,I.exports.isErrored=L.isErrored,I.exports.isReadable=L.isReadable,I.exports.Readable=L.Readable,I.exports.Writable=L.Writable,I.exports.Duplex=L.Duplex,I.exports.Transform=L.Transform,I.exports.PassThrough=L.PassThrough,I.exports.addAbortSignal=L.addAbortSignal,I.exports.finished=L.finished,I.exports.destroy=L.destroy,I.exports.destroy=K,I.exports.pipeline=L.pipeline,I.exports.compose=L.compose,Object.defineProperty(L,"promises",{configurable:!0,enumerable:!0,get(){return S}}),I.exports.Stream=L.Stream}I.exports.default=I.exports});AI.exports=yQ()});var EA={};qO(EA,{uptime:()=>QX,type:()=>JX,totalmem:()=>GX,tmpdir:()=>KI,tmpDir:()=>RX,release:()=>YX,platform:()=>LX,networkInterfaces:()=>SX,loadavg:()=>CX,hostname:()=>IX,homedir:()=>KX,getNetworkInterfaces:()=>DI,freemem:()=>XX,endianness:()=>$X,cpus:()=>EX,arch:()=>VX,EOL:()=>DX});var $X=function(){return"LE"},IX=function(){if(typeof location<"u")return location.hostname;else return""},CX=function(){return[]},QX=function(){return 0},XX=function(){return Number.MAX_VALUE},GX=function(){return Number.MAX_VALUE},EX=function(){return[]},JX=function(){return"Browser"},YX=function(){if(typeof navigator<"u")return navigator.appVersion;return""},DI=function(){return{}},SX,VX=function(){return"javascript"},LX=function(){return"browser"},KI=function(){return"/tmp"},RX,DX=`
|
|
3
|
+
`,KX=function(){return"/"};var JA=PO(()=>{SX=DI,RX=KI});var _I={};qO(_I,{types:()=>_X,promisify:()=>TI,log:()=>FI,isUndefined:()=>FO,isSymbol:()=>vX,isString:()=>QZ,isRegExp:()=>ZZ,isPrimitive:()=>BX,isObject:()=>MO,isNumber:()=>WI,isNullOrUndefined:()=>jX,isNull:()=>CZ,isFunction:()=>$Z,isError:()=>AZ,isDate:()=>LA,isBuffer:()=>gX,isBoolean:()=>DA,isArray:()=>HI,inspect:()=>JO,inherits:()=>MI,format:()=>RA,deprecate:()=>WX,default:()=>fX,debuglog:()=>FX,callbackifyOnRejected:()=>WA,callbackify:()=>qI,_extend:()=>HA,TextEncoder:()=>PI,TextDecoder:()=>kI});function RA($,...I){if(!QZ($)){var E=[$];for(var L=0;L<I.length;L++)E.push(JO(I[L]));return E.join(" ")}var L=0,S=I.length,K=String($).replace(HX,function(T){if(T==="%%")return"%";if(L>=S)return T;switch(T){case"%s":return String(I[L++]);case"%d":return Number(I[L++]);case"%j":try{return JSON.stringify(I[L++])}catch(M){return"[Circular]"}default:return T}});for(var Q=I[L];L<S;Q=I[++L])if(CZ(Q)||!MO(Q))K+=" "+Q;else K+=" "+JO(Q);return K}function WX($,I){if(typeof process>"u"||process?.noDeprecation===!0)return $;var E=!1;function L(...S){if(!E){if(process.throwDeprecation)throw Error(I);else if(process.traceDeprecation)console.trace(I);else console.error(I);E=!0}return $.apply(this,...S)}return L}function MX($,I){var E=JO.styles[I];if(E)return"\x1B["+JO.colors[E][0]+"m"+$+"\x1B["+JO.colors[E][1]+"m";else return $}function zX($,I){return $}function TX($){var I={};return $.forEach(function(E,L){I[E]=!0}),I}function IZ($,I,E){if($.customInspect&&I&&$Z(I.inspect)&&I.inspect!==JO&&!(I.constructor&&I.constructor.prototype===I)){var L=I.inspect(E,$);if(!QZ(L))L=IZ($,L,E);return L}var S=qX($,I);if(S)return S;var K=Object.keys(I),Q=TX(K);if($.showHidden)K=Object.getOwnPropertyNames(I);if(AZ(I)&&(K.indexOf("message")>=0||K.indexOf("description")>=0))return YA(I);if(K.length===0){if($Z(I)){var T=I.name?": "+I.name:"";return $.stylize("[Function"+T+"]","special")}if(ZZ(I))return $.stylize(RegExp.prototype.toString.call(I),"regexp");if(LA(I))return $.stylize(Date.prototype.toString.call(I),"date");if(AZ(I))return YA(I)}var M="",H=!1,F=["{","}"];if(HI(I))H=!0,F=["[","]"];if($Z(I)){var R=I.name?": "+I.name:"";M=" [Function"+R+"]"}if(ZZ(I))M=" "+RegExp.prototype.toString.call(I);if(LA(I))M=" "+Date.prototype.toUTCString.call(I);if(AZ(I))M=" "+YA(I);if(K.length===0&&(!H||I.length==0))return F[0]+M+F[1];if(E<0)if(ZZ(I))return $.stylize(RegExp.prototype.toString.call(I),"regexp");else return $.stylize("[Object]","special");$.seen.push(I);var D;if(H)D=PX($,I,E,Q,K);else D=K.map(function(q){return VA($,I,E,Q,q,H)});return $.seen.pop(),kX(D,M,F)}function qX($,I){if(FO(I))return $.stylize("undefined","undefined");if(QZ(I)){var E="'"+JSON.stringify(I).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return $.stylize(E,"string")}if(WI(I))return $.stylize(""+I,"number");if(DA(I))return $.stylize(""+I,"boolean");if(CZ(I))return $.stylize("null","null")}function YA($){return"["+Error.prototype.toString.call($)+"]"}function PX($,I,E,L,S){var K=[];for(var Q=0,T=I.length;Q<T;++Q)if(zI(I,String(Q)))K.push(VA($,I,E,L,String(Q),!0));else K.push("");return S.forEach(function(M){if(!M.match(/^\d+$/))K.push(VA($,I,E,L,M,!0))}),K}function VA($,I,E,L,S,K){var Q,T,M;if(M=Object.getOwnPropertyDescriptor(I,S)||{value:I[S]},M.get)if(M.set)T=$.stylize("[Getter/Setter]","special");else T=$.stylize("[Getter]","special");else if(M.set)T=$.stylize("[Setter]","special");if(!zI(L,S))Q="["+S+"]";if(!T)if($.seen.indexOf(M.value)<0){if(CZ(E))T=IZ($,M.value,null);else T=IZ($,M.value,E-1);if(T.indexOf(`
|
|
4
|
+
`)>-1)if(K)T=T.split(`
|
|
5
|
+
`).map(function(H){return" "+H}).join(`
|
|
6
|
+
`).slice(2);else T=`
|
|
7
|
+
`+T.split(`
|
|
8
|
+
`).map(function(H){return" "+H}).join(`
|
|
9
|
+
`)}else T=$.stylize("[Circular]","special");if(FO(Q)){if(K&&S.match(/^\d+$/))return T;if(Q=JSON.stringify(""+S),Q.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/))Q=Q.slice(1,-1),Q=$.stylize(Q,"name");else Q=Q.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),Q=$.stylize(Q,"string")}return Q+": "+T}function kX($,I,E){var L=0,S=$.reduce(function(K,Q){if(L++,Q.indexOf(`
|
|
10
|
+
`)>=0)L++;return K+Q.replace(/\u001b\[\d\d?m/g,"").length+1},0);if(S>60)return E[0]+(I===""?"":I+`
|
|
11
|
+
`)+" "+$.join(`,
|
|
12
|
+
`)+" "+E[1];return E[0]+I+" "+$.join(", ")+" "+E[1]}function HI($){return Array.isArray($)}function DA($){return typeof $==="boolean"}function CZ($){return $===null}function jX($){return $==null}function WI($){return typeof $==="number"}function QZ($){return typeof $==="string"}function vX($){return typeof $==="symbol"}function FO($){return $===void 0}function ZZ($){return MO($)&&KA($)==="[object RegExp]"}function MO($){return typeof $==="object"&&$!==null}function LA($){return MO($)&&KA($)==="[object Date]"}function AZ($){return MO($)&&(KA($)==="[object Error]"||$ instanceof Error)}function $Z($){return typeof $==="function"}function BX($){return $===null||typeof $==="boolean"||typeof $==="number"||typeof $==="string"||typeof $==="symbol"||typeof $>"u"}function gX($){return $ instanceof Buffer}function KA($){return Object.prototype.toString.call($)}function SA($){return $<10?"0"+$.toString(10):$.toString(10)}function NX(){var $=new Date,I=[SA($.getHours()),SA($.getMinutes()),SA($.getSeconds())].join(":");return[$.getDate(),xX[$.getMonth()],I].join(" ")}function FI(...$){console.log("%s - %s",NX(),RA.apply(null,$))}function MI($,I){if(I)$.super_=I,$.prototype=Object.create(I.prototype,{constructor:{value:$,enumerable:!1,writable:!0,configurable:!0}})}function HA($,I){if(!I||!MO(I))return $;var E=Object.keys(I),L=E.length;while(L--)$[E[L]]=I[E[L]];return $}function zI($,I){return Object.prototype.hasOwnProperty.call($,I)}function WA($,I){if(!$){var E=Error("Promise was rejected with a falsy value");E.reason=$,$=E}return I($)}function qI($){if(typeof $!=="function")throw TypeError('The "original" argument must be of type Function');function I(...E){var L=E.pop();if(typeof L!=="function")throw TypeError("The last argument must be of type Function");var S=this,K=function(...Q){return L.apply(S,...Q)};$.apply(this,E).then(function(Q){process.nextTick(K.bind(null,null,Q))},function(Q){process.nextTick(WA.bind(null,Q,K))})}return Object.setPrototypeOf(I,Object.getPrototypeOf($)),Object.defineProperties(I,Object.getOwnPropertyDescriptors($)),I}var HX,FX,JO,_X=()=>{},xX,TI,PI,kI,fX;var jI=PO(()=>{HX=/%[sdj%]/g;FX=(($={},I={},E)=>((E=typeof process<"u"&&!1)&&(E=E.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase()),I=new RegExp("^"+E+"$","i"),(L)=>{if(L=L.toUpperCase(),!$[L])if(I.test(L))$[L]=function(...S){console.error("%s: %s",L,pid,RA.apply(null,...S))};else $[L]=function(){};return $[L]}))(),JO=(($)=>($.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},$.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},$.custom=Symbol.for("nodejs.util.inspect.custom"),$))(function($,I,...E){var L={seen:[],stylize:zX};if(E.length>=1)L.depth=E[0];if(E.length>=2)L.colors=E[1];if(DA(I))L.showHidden=I;else if(I)HA(L,I);if(FO(L.showHidden))L.showHidden=!1;if(FO(L.depth))L.depth=2;if(FO(L.colors))L.colors=!1;if(L.colors)L.stylize=MX;return IZ(L,$,L.depth)});xX=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];TI=(($)=>($.custom=Symbol.for("nodejs.util.promisify.custom"),$))(function($){if(typeof $!=="function")throw TypeError('The "original" argument must be of type Function');if(kCustomPromisifiedSymbol&&$[kCustomPromisifiedSymbol]){var I=$[kCustomPromisifiedSymbol];if(typeof I!=="function")throw TypeError('The "nodejs.util.promisify.custom" argument must be of type Function');return Object.defineProperty(I,kCustomPromisifiedSymbol,{value:I,enumerable:!1,writable:!1,configurable:!0}),I}function I(...E){var L,S,K=new Promise(function(Q,T){L=Q,S=T});E.push(function(Q,T){if(Q)S(Q);else L(T)});try{$.apply(this,E)}catch(Q){S(Q)}return K}if(Object.setPrototypeOf(I,Object.getPrototypeOf($)),kCustomPromisifiedSymbol)Object.defineProperty(I,kCustomPromisifiedSymbol,{value:I,enumerable:!1,writable:!1,configurable:!0});return Object.defineProperties(I,Object.getOwnPropertyDescriptors($))});({TextEncoder:PI,TextDecoder:kI}=globalThis),fX={TextEncoder:PI,TextDecoder:kI,promisify:TI,log:FI,inherits:MI,_extend:HA,callbackifyOnRejected:WA,callbackify:qI}});var jU={};qO(jU,{webcrypto:()=>XJ,rng:()=>WE,randomUUID:()=>IJ,randomFillSync:()=>UJ,randomFill:()=>iE,randomBytes:()=>FE,publicEncrypt:()=>mE,publicDecrypt:()=>eE,pseudoRandomBytes:()=>HE,prng:()=>KE,privateEncrypt:()=>rE,privateDecrypt:()=>aE,pbkdf2Sync:()=>_E,pbkdf2:()=>kE,listCiphers:()=>cE,getRandomValues:()=>$J,getHashes:()=>PE,getDiffieHellman:()=>uE,getCurves:()=>QJ,getCiphers:()=>yE,default:()=>GJ,createVerify:()=>nE,createSign:()=>bE,createHmac:()=>qE,createHash:()=>zE,createECDH:()=>sE,createDiffieHellmanGroup:()=>hE,createDiffieHellman:()=>lE,createDecipheriv:()=>wE,createDecipher:()=>NE,createCredentials:()=>OJ,createCipheriv:()=>gE,createCipher:()=>vE,constants:()=>ZJ,Verify:()=>tE,Sign:()=>oE,Hmac:()=>TE,Hash:()=>ME,DiffieHellmanGroup:()=>pE,DiffieHellman:()=>dE,Decipheriv:()=>fE,Decipher:()=>xE,DEFAULT_ENCODING:()=>AJ,Cipheriv:()=>BE,Cipher:()=>jE});function QJ(){return CJ}var wX,yX,vI,cX,pX,hX=($,I,E)=>{E=$!=null?wX(yX($)):{};let L=I||!$||!$.__esModule?vI(E,"default",{value:$,enumerable:!0}):E;for(let S of cX($))if(!pX.call(L,S))vI(L,S,{get:()=>$[S],enumerable:!0});return L},Q0=($,I)=>()=>(I||$((I={exports:{}}).exports,I),I.exports),XZ,GZ,gI,uX,MA,zA,qU,lX,pO,xI,dX,bX,oX,nX,NI,tX,sX,mX,rX,eX,aX,iX,UG,OG,ZG,hO,EZ,fI,AG,wI,yI,$G,uO,TA,qA,IG,cI,PA,CG,pI,QG,hI,uI,XG,GG,EG,JG,YG,SG,VG,LG,RG,DG,KG,HG,WG,FG,kA,lI,MG,dI,zG,TG,qG,PG,sU,UO,bI,wU,oI,JZ,kG,gU,_G,jG,vG,nI,lU,lO,tI,BG,sI,gG,mI,xG,NG,fG,wG,_A,yG,jA,cG,pG,hG,uG,lG,dG,bG,oG,nG,tG,sG,mG,rG,eG,BI,aG,cO,iG,rI,eI,UE,OE,aI,ZE,AE,dO,$E,IE,CE,QE,XE,GE,iI,EE,UC,OC,ZC,vA,AC,JE,$C,YE,SE,FA,VE,LE,RE,DE,h0,KE,HE,WE,FE,ME,zE,TE,qE,PE,kE,_E,jE,vE,BE,gE,xE,NE,fE,wE,yE,cE,pE,hE,uE,lE,dE,bE,oE,nE,tE,sE,mE,rE,eE,aE,iE,UJ,OJ,ZJ,AJ="buffer",$J=($)=>{return crypto.getRandomValues($)},IJ=()=>{return crypto.randomUUID()},CJ,XJ,GJ;var vU=PO(()=>{wX=Object.create,{getPrototypeOf:yX,defineProperty:vI,getOwnPropertyNames:cX}=Object,pX=Object.prototype.hasOwnProperty,XZ=Q0(($,I)=>{I.exports=(vU(),l0(jU)).randomBytes}),GZ=Q0(($,I)=>{I.exports=(vU(),l0(jU)).createHash}),gI=Q0(($,I)=>{I.exports=(vU(),l0(jU)).createHmac}),uX=Q0(($,I)=>{I.exports={sha224WithRSAEncryption:{sign:"rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},"RSA-SHA224":{sign:"ecdsa/rsa",hash:"sha224",id:"302d300d06096086480165030402040500041c"},sha256WithRSAEncryption:{sign:"rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},"RSA-SHA256":{sign:"ecdsa/rsa",hash:"sha256",id:"3031300d060960864801650304020105000420"},sha384WithRSAEncryption:{sign:"rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},"RSA-SHA384":{sign:"ecdsa/rsa",hash:"sha384",id:"3041300d060960864801650304020205000430"},sha512WithRSAEncryption:{sign:"rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA512":{sign:"ecdsa/rsa",hash:"sha512",id:"3051300d060960864801650304020305000440"},"RSA-SHA1":{sign:"rsa",hash:"sha1",id:"3021300906052b0e03021a05000414"},"ecdsa-with-SHA1":{sign:"ecdsa",hash:"sha1",id:""},sha256:{sign:"ecdsa",hash:"sha256",id:""},sha224:{sign:"ecdsa",hash:"sha224",id:""},sha384:{sign:"ecdsa",hash:"sha384",id:""},sha512:{sign:"ecdsa",hash:"sha512",id:""},"DSA-SHA":{sign:"dsa",hash:"sha1",id:""},"DSA-SHA1":{sign:"dsa",hash:"sha1",id:""},DSA:{sign:"dsa",hash:"sha1",id:""},"DSA-WITH-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-SHA224":{sign:"dsa",hash:"sha224",id:""},"DSA-WITH-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-SHA256":{sign:"dsa",hash:"sha256",id:""},"DSA-WITH-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-SHA384":{sign:"dsa",hash:"sha384",id:""},"DSA-WITH-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-SHA512":{sign:"dsa",hash:"sha512",id:""},"DSA-RIPEMD160":{sign:"dsa",hash:"rmd160",id:""},ripemd160WithRSA:{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},"RSA-RIPEMD160":{sign:"rsa",hash:"rmd160",id:"3021300906052b2403020105000414"},md5WithRSAEncryption:{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"},"RSA-MD5":{sign:"rsa",hash:"md5",id:"3020300c06082a864886f70d020505000410"}}}),MA=Q0(($,I)=>{var E=isFinite,L=Math.pow(2,30)-1;I.exports=function(S,K){if(typeof S!=="number")throw TypeError("Iterations not a number");if(S<0||!E(S))throw TypeError("Bad iterations");if(typeof K!=="number")throw TypeError("Key length not a number");if(K<0||K>L||K!==K)throw TypeError("Bad key length")}}),zA=Q0(($,I)=>{var E;if(globalThis.process&&globalThis.process.browser)E="utf-8";else if(globalThis.process&&globalThis.process.version)L=parseInt(process.version.split(".")[0].slice(1),10),E=L>=6?"utf-8":"binary";else E="utf-8";var L;I.exports=E}),qU=Q0(($,I)=>{/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */var E=(DU(),l0(RU)),L=E.Buffer;function S(Q,T){for(var M in Q)T[M]=Q[M]}if(L.from&&L.alloc&&L.allocUnsafe&&L.allocUnsafeSlow)I.exports=E;else S(E,$),$.Buffer=K;function K(Q,T,M){return L(Q,T,M)}K.prototype=Object.create(L.prototype),S(L,K),K.from=function(Q,T,M){if(typeof Q==="number")throw TypeError("Argument must not be a number");return L(Q,T,M)},K.alloc=function(Q,T,M){if(typeof Q!=="number")throw TypeError("Argument must be a number");var H=L(Q);if(T!==void 0)if(typeof M==="string")H.fill(T,M);else H.fill(T);else H.fill(0);return H},K.allocUnsafe=function(Q){if(typeof Q!=="number")throw TypeError("Argument must be a number");return L(Q)},K.allocUnsafeSlow=function(Q){if(typeof Q!=="number")throw TypeError("Argument must be a number");return E.SlowBuffer(Q)}}),lX=Q0(($,I)=>{var E={}.toString;I.exports=Array.isArray||function(L){return E.call(L)=="[object Array]"}}),pO=Q0(($,I)=>{I.exports=TypeError}),xI=Q0(($,I)=>{I.exports=Object}),dX=Q0(($,I)=>{I.exports=Error}),bX=Q0(($,I)=>{I.exports=EvalError}),oX=Q0(($,I)=>{I.exports=RangeError}),nX=Q0(($,I)=>{I.exports=ReferenceError}),NI=Q0(($,I)=>{I.exports=SyntaxError}),tX=Q0(($,I)=>{I.exports=URIError}),sX=Q0(($,I)=>{I.exports=Math.abs}),mX=Q0(($,I)=>{I.exports=Math.floor}),rX=Q0(($,I)=>{I.exports=Math.max}),eX=Q0(($,I)=>{I.exports=Math.min}),aX=Q0(($,I)=>{I.exports=Math.pow}),iX=Q0(($,I)=>{I.exports=Math.round}),UG=Q0(($,I)=>{I.exports=Number.isNaN||function(E){return E!==E}}),OG=Q0(($,I)=>{var E=UG();I.exports=function(L){if(E(L)||L===0)return L;return L<0?-1:1}}),ZG=Q0(($,I)=>{I.exports=Object.getOwnPropertyDescriptor}),hO=Q0(($,I)=>{var E=ZG();if(E)try{E([],"length")}catch(L){E=null}I.exports=E}),EZ=Q0(($,I)=>{var E=Object.defineProperty||!1;if(E)try{E({},"a",{value:1})}catch(L){E=!1}I.exports=E}),fI=Q0(($,I)=>{I.exports=function(){if(typeof Symbol!=="function"||typeof Object.getOwnPropertySymbols!=="function")return!1;if(typeof Symbol.iterator==="symbol")return!0;var E={},L=Symbol("test"),S=Object(L);if(typeof L==="string")return!1;if(Object.prototype.toString.call(L)!=="[object Symbol]")return!1;if(Object.prototype.toString.call(S)!=="[object Symbol]")return!1;var K=42;E[L]=K;for(var Q in E)return!1;if(typeof Object.keys==="function"&&Object.keys(E).length!==0)return!1;if(typeof Object.getOwnPropertyNames==="function"&&Object.getOwnPropertyNames(E).length!==0)return!1;var T=Object.getOwnPropertySymbols(E);if(T.length!==1||T[0]!==L)return!1;if(!Object.prototype.propertyIsEnumerable.call(E,L))return!1;if(typeof Object.getOwnPropertyDescriptor==="function"){var M=Object.getOwnPropertyDescriptor(E,L);if(M.value!==K||M.enumerable!==!0)return!1}return!0}}),AG=Q0(($,I)=>{var E=typeof Symbol<"u"&&Symbol,L=fI();I.exports=function(){if(typeof E!=="function")return!1;if(typeof Symbol!=="function")return!1;if(typeof E("foo")!=="symbol")return!1;if(typeof Symbol("bar")!=="symbol")return!1;return L()}}),wI=Q0(($,I)=>{I.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null}),yI=Q0(($,I)=>{var E=xI();I.exports=E.getPrototypeOf||null}),$G=Q0(($,I)=>{var E="Function.prototype.bind called on incompatible ",L=Object.prototype.toString,S=Math.max,K="[object Function]",Q=function(H,F){var R=[];for(var D=0;D<H.length;D+=1)R[D]=H[D];for(var q=0;q<F.length;q+=1)R[q+H.length]=F[q];return R},T=function(H,F){var R=[];for(var D=F||0,q=0;D<H.length;D+=1,q+=1)R[q]=H[D];return R},M=function(H,F){var R="";for(var D=0;D<H.length;D+=1)if(R+=H[D],D+1<H.length)R+=F;return R};I.exports=function(H){var F=this;if(typeof F!=="function"||L.apply(F)!==K)throw TypeError(E+F);var R=T(arguments,1),D,q=function(){if(this instanceof D){var v=F.apply(this,Q(R,arguments));if(Object(v)===v)return v;return this}return F.apply(H,Q(R,arguments))},P=S(0,F.length-R.length),_=[];for(var k=0;k<P;k++)_[k]="$"+k;if(D=Function("binder","return function ("+M(_,",")+"){ return binder.apply(this,arguments); }")(q),F.prototype){var B=function(){};B.prototype=F.prototype,D.prototype=new B,B.prototype=null}return D}}),uO=Q0(($,I)=>{var E=$G();I.exports=Function.prototype.bind||E}),TA=Q0(($,I)=>{I.exports=Function.prototype.call}),qA=Q0(($,I)=>{I.exports=Function.prototype.apply}),IG=Q0(($,I)=>{I.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply}),cI=Q0(($,I)=>{var E=uO(),L=qA(),S=TA(),K=IG();I.exports=K||E.call(S,L)}),PA=Q0(($,I)=>{var E=uO(),L=pO(),S=TA(),K=cI();I.exports=function(Q){if(Q.length<1||typeof Q[0]!=="function")throw new L("a function is required");return K(E,S,Q)}}),CG=Q0(($,I)=>{var E=PA(),L=hO(),S;try{S=[].__proto__===Array.prototype}catch(M){if(!M||typeof M!=="object"||!("code"in M)||M.code!=="ERR_PROTO_ACCESS")throw M}var K=!!S&&L&&L(Object.prototype,"__proto__"),Q=Object,T=Q.getPrototypeOf;I.exports=K&&typeof K.get==="function"?E([K.get]):typeof T==="function"?function(M){return T(M==null?M:Q(M))}:!1}),pI=Q0(($,I)=>{var E=wI(),L=yI(),S=CG();I.exports=E?function(K){return E(K)}:L?function(K){if(!K||typeof K!=="object"&&typeof K!=="function")throw TypeError("getProto: not an object");return L(K)}:S?function(K){return S(K)}:null}),QG=Q0(($,I)=>{var E=Function.prototype.call,L=Object.prototype.hasOwnProperty,S=uO();I.exports=S.call(E,L)}),hI=Q0(($,I)=>{var E,L=xI(),S=dX(),K=bX(),Q=oX(),T=nX(),M=NI(),H=pO(),F=tX(),R=sX(),D=mX(),q=rX(),P=eX(),_=aX(),k=iX(),B=OG(),v=Function,g=function(A0){try{return v('"use strict"; return ('+A0+").constructor;")()}catch(t){}},f=hO(),w=EZ(),b=function(){throw new H},I0=f?function(){try{return arguments.callee,b}catch(A0){try{return f(arguments,"callee").get}catch(t){return b}}}():b,X0=AG()(),C0=pI(),u=yI(),O0=wI(),U=qA(),A=TA(),X={},Z=typeof Uint8Array>"u"||!C0?E:C0(Uint8Array),C={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?E:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?E:ArrayBuffer,"%ArrayIteratorPrototype%":X0&&C0?C0([][Symbol.iterator]()):E,"%AsyncFromSyncIteratorPrototype%":E,"%AsyncFunction%":X,"%AsyncGenerator%":X,"%AsyncGeneratorFunction%":X,"%AsyncIteratorPrototype%":X,"%Atomics%":typeof Atomics>"u"?E:Atomics,"%BigInt%":typeof BigInt>"u"?E:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?E:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?E:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?E:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":S,"%eval%":eval,"%EvalError%":K,"%Float16Array%":typeof Float16Array>"u"?E:Float16Array,"%Float32Array%":typeof Float32Array>"u"?E:Float32Array,"%Float64Array%":typeof Float64Array>"u"?E:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?E:FinalizationRegistry,"%Function%":v,"%GeneratorFunction%":X,"%Int8Array%":typeof Int8Array>"u"?E:Int8Array,"%Int16Array%":typeof Int16Array>"u"?E:Int16Array,"%Int32Array%":typeof Int32Array>"u"?E:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":X0&&C0?C0(C0([][Symbol.iterator]())):E,"%JSON%":typeof JSON==="object"?JSON:E,"%Map%":typeof Map>"u"?E:Map,"%MapIteratorPrototype%":typeof Map>"u"||!X0||!C0?E:C0(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":L,"%Object.getOwnPropertyDescriptor%":f,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?E:Promise,"%Proxy%":typeof Proxy>"u"?E:Proxy,"%RangeError%":Q,"%ReferenceError%":T,"%Reflect%":typeof Reflect>"u"?E:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?E:Set,"%SetIteratorPrototype%":typeof Set>"u"||!X0||!C0?E:C0(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?E:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":X0&&C0?C0(""[Symbol.iterator]()):E,"%Symbol%":X0?Symbol:E,"%SyntaxError%":M,"%ThrowTypeError%":I0,"%TypedArray%":Z,"%TypeError%":H,"%Uint8Array%":typeof Uint8Array>"u"?E:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?E:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?E:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?E:Uint32Array,"%URIError%":F,"%WeakMap%":typeof WeakMap>"u"?E:WeakMap,"%WeakRef%":typeof WeakRef>"u"?E:WeakRef,"%WeakSet%":typeof WeakSet>"u"?E:WeakSet,"%Function.prototype.call%":A,"%Function.prototype.apply%":U,"%Object.defineProperty%":w,"%Object.getPrototypeOf%":u,"%Math.abs%":R,"%Math.floor%":D,"%Math.max%":q,"%Math.min%":P,"%Math.pow%":_,"%Math.round%":k,"%Math.sign%":B,"%Reflect.getPrototypeOf%":O0};if(C0)try{null.error}catch(A0){Y=C0(C0(A0)),C["%Error.prototype%"]=Y}var Y,V=function A0(t){var i;if(t==="%AsyncFunction%")i=g("async function () {}");else if(t==="%GeneratorFunction%")i=g("function* () {}");else if(t==="%AsyncGeneratorFunction%")i=g("async function* () {}");else if(t==="%AsyncGenerator%"){var N0=A0("%AsyncGeneratorFunction%");if(N0)i=N0.prototype}else if(t==="%AsyncIteratorPrototype%"){var y=A0("%AsyncGenerator%");if(y&&C0)i=C0(y.prototype)}return C[t]=i,i},G={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},O=uO(),J=QG(),z=O.call(A,Array.prototype.concat),W=O.call(U,Array.prototype.splice),j=O.call(A,String.prototype.replace),N=O.call(A,String.prototype.slice),p=O.call(A,RegExp.prototype.exec),n=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,E0=/\\(\\)?/g,r=function(A0){var t=N(A0,0,1),i=N(A0,-1);if(t==="%"&&i!=="%")throw new M("invalid intrinsic syntax, expected closing `%`");else if(i==="%"&&t!=="%")throw new M("invalid intrinsic syntax, expected opening `%`");var N0=[];return j(A0,n,function(y,h,$0,m){N0[N0.length]=$0?j(m,E0,"$1"):h||y}),N0},d=function(A0,t){var i=A0,N0;if(J(G,i))N0=G[i],i="%"+N0[0]+"%";if(J(C,i)){var y=C[i];if(y===X)y=V(i);if(typeof y>"u"&&!t)throw new H("intrinsic "+A0+" exists, but is not available. Please file an issue!");return{alias:N0,name:i,value:y}}throw new M("intrinsic "+A0+" does not exist!")};I.exports=function(A0,t){if(typeof A0!=="string"||A0.length===0)throw new H("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof t!=="boolean")throw new H('"allowMissing" argument must be a boolean');if(p(/^%?[^%]*%?$/,A0)===null)throw new M("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var i=r(A0),N0=i.length>0?i[0]:"",y=d("%"+N0+"%",t),h=y.name,$0=y.value,m=!1,a=y.alias;if(a)N0=a[0],W(i,z([0,1],a));for(var W0=1,c=!0;W0<i.length;W0+=1){var o=i[W0],x0=N(o,0,1),s=N(o,-1);if((x0==='"'||x0==="'"||x0==="`"||(s==='"'||s==="'"||s==="`"))&&x0!==s)throw new M("property names with quotes must have matching quotes");if(o==="constructor"||!c)m=!0;if(N0+="."+o,h="%"+N0+"%",J(C,h))$0=C[h];else if($0!=null){if(!(o in $0)){if(!t)throw new H("base intrinsic for "+A0+" exists, but the property is not available.");return}if(f&&W0+1>=i.length){var Z0=f($0,o);if(c=!!Z0,c&&"get"in Z0&&!("originalValue"in Z0.get))$0=Z0.get;else $0=$0[o]}else c=J($0,o),$0=$0[o];if(c&&!m)C[h]=$0}}return $0}}),uI=Q0(($,I)=>{var E=hI(),L=PA(),S=L([E("%String.prototype.indexOf%")]);I.exports=function(K,Q){var T=E(K,!!Q);if(typeof T==="function"&&S(K,".prototype.")>-1)return L([T]);return T}}),XG=Q0(($,I)=>{var E=Function.prototype.toString,L=typeof Reflect==="object"&&Reflect!==null&&Reflect.apply,S,K;if(typeof L==="function"&&typeof Object.defineProperty==="function")try{S=Object.defineProperty({},"length",{get:function(){throw K}}),K={},L(function(){throw 42},null,S)}catch(f){if(f!==K)L=null}else L=null;var Q=/^\s*class\b/,T=function(f){try{var w=E.call(f);return Q.test(w)}catch(b){return!1}},M=function(f){try{if(T(f))return!1;return E.call(f),!0}catch(w){return!1}},H=Object.prototype.toString,F="[object Object]",R="[object Function]",D="[object GeneratorFunction]",q="[object HTMLAllCollection]",P="[object HTML document.all class]",_="[object HTMLCollection]",k=typeof Symbol==="function"&&!!Symbol.toStringTag,B=!(0 in[,]),v=function(){return!1};if(typeof document==="object"){if(g=document.all,H.call(g)===H.call(document.all))v=function(f){if((B||!f)&&(typeof f>"u"||typeof f==="object"))try{var w=H.call(f);return(w===q||w===P||w===_||w===F)&&f("")==null}catch(b){}return!1}}var g;I.exports=L?function(f){if(v(f))return!0;if(!f)return!1;if(typeof f!=="function"&&typeof f!=="object")return!1;try{L(f,null,S)}catch(w){if(w!==K)return!1}return!T(f)&&M(f)}:function(f){if(v(f))return!0;if(!f)return!1;if(typeof f!=="function"&&typeof f!=="object")return!1;if(k)return M(f);if(T(f))return!1;var w=H.call(f);if(w!==R&&w!==D&&!/^\[object HTML/.test(w))return!1;return M(f)}}),GG=Q0(($,I)=>{var E=XG(),L=Object.prototype.toString,S=Object.prototype.hasOwnProperty,K=function(H,F,R){for(var D=0,q=H.length;D<q;D++)if(S.call(H,D))if(R==null)F(H[D],D,H);else F.call(R,H[D],D,H)},Q=function(H,F,R){for(var D=0,q=H.length;D<q;D++)if(R==null)F(H.charAt(D),D,H);else F.call(R,H.charAt(D),D,H)},T=function(H,F,R){for(var D in H)if(S.call(H,D))if(R==null)F(H[D],D,H);else F.call(R,H[D],D,H)};function M(H){return L.call(H)==="[object Array]"}I.exports=function(H,F,R){if(!E(F))throw TypeError("iterator must be a function");var D;if(arguments.length>=3)D=R;if(M(H))K(H,F,D);else if(typeof H==="string")Q(H,F,D);else T(H,F,D)}}),EG=Q0(($,I)=>{I.exports=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]}),JG=Q0(($,I)=>{var E=EG(),L=typeof globalThis>"u"?globalThis:globalThis;I.exports=function(){var S=[];for(var K=0;K<E.length;K++)if(typeof L[E[K]]==="function")S[S.length]=E[K];return S}}),YG=Q0(($,I)=>{var E=EZ(),L=NI(),S=pO(),K=hO();I.exports=function(Q,T,M){if(!Q||typeof Q!=="object"&&typeof Q!=="function")throw new S("`obj` must be an object or a function`");if(typeof T!=="string"&&typeof T!=="symbol")throw new S("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!=="boolean"&&arguments[3]!==null)throw new S("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!=="boolean"&&arguments[4]!==null)throw new S("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!=="boolean"&&arguments[5]!==null)throw new S("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!=="boolean")throw new S("`loose`, if provided, must be a boolean");var H=arguments.length>3?arguments[3]:null,F=arguments.length>4?arguments[4]:null,R=arguments.length>5?arguments[5]:null,D=arguments.length>6?arguments[6]:!1,q=!!K&&K(Q,T);if(E)E(Q,T,{configurable:R===null&&q?q.configurable:!R,enumerable:H===null&&q?q.enumerable:!H,value:M,writable:F===null&&q?q.writable:!F});else if(D||!H&&!F&&!R)Q[T]=M;else throw new L("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}}),SG=Q0(($,I)=>{var E=EZ(),L=function(){return!!E};L.hasArrayLengthDefineBug=function(){if(!E)return null;try{return E([],"length",{value:1}).length!==1}catch(S){return!0}},I.exports=L}),VG=Q0(($,I)=>{var E=hI(),L=YG(),S=SG()(),K=hO(),Q=pO(),T=E("%Math.floor%");I.exports=function(M,H){if(typeof M!=="function")throw new Q("`fn` is not a function");if(typeof H!=="number"||H<0||H>4294967295||T(H)!==H)throw new Q("`length` must be a positive 32-bit integer");var F=arguments.length>2&&!!arguments[2],R=!0,D=!0;if("length"in M&&K){var q=K(M,"length");if(q&&!q.configurable)R=!1;if(q&&!q.writable)D=!1}if(R||D||!F)if(S)L(M,"length",H,!0,!0);else L(M,"length",H);return M}}),LG=Q0(($,I)=>{var E=uO(),L=qA(),S=cI();I.exports=function(){return S(E,L,arguments)}}),RG=Q0(($,I)=>{var E=VG(),L=EZ(),S=PA(),K=LG();if(I.exports=function(Q){var T=S(arguments),M=Q.length-(arguments.length-1);return E(T,1+(M>0?M:0),!0)},L)L(I.exports,"apply",{value:K});else I.exports.apply=K}),DG=Q0(($,I)=>{var E=fI();I.exports=function(){return E()&&!!Symbol.toStringTag}}),KG=Q0(($,I)=>{var E=GG(),L=JG(),S=RG(),K=uI(),Q=hO(),T=pI(),M=K("Object.prototype.toString"),H=DG()(),F=typeof globalThis>"u"?globalThis:globalThis,R=L(),D=K("String.prototype.slice"),q=K("Array.prototype.indexOf",!0)||function(B,v){for(var g=0;g<B.length;g+=1)if(B[g]===v)return g;return-1},P={__proto__:null};if(H&&Q&&T)E(R,function(B){var v=new F[B];if(Symbol.toStringTag in v&&T){var g=T(v),f=Q(g,Symbol.toStringTag);if(!f&&g){var w=T(g);f=Q(w,Symbol.toStringTag)}P["$"+B]=S(f.get)}});else E(R,function(B){var v=new F[B],g=v.slice||v.set;if(g)P["$"+B]=S(g)});var _=function(B){var v=!1;return E(P,function(g,f){if(!v)try{if("$"+g(B)===f)v=D(f,1)}catch(w){}}),v},k=function(B){var v=!1;return E(P,function(g,f){if(!v)try{g(B),v=D(f,1)}catch(w){}}),v};I.exports=function(B){if(!B||typeof B!=="object")return!1;if(!H){var v=D(M(B),8,-1);if(q(R,v)>-1)return v;if(v!=="Object")return!1;return k(B)}if(!Q)return null;return _(B)}}),HG=Q0(($,I)=>{var E=KG();I.exports=function(L){return!!E(L)}}),WG=Q0(($,I)=>{var E=pO(),L=uI(),S=L("TypedArray.prototype.buffer",!0),K=HG();I.exports=S||function(Q){if(!K(Q))throw new E("Not a Typed Array");return Q.buffer}}),FG=Q0(($,I)=>{var E=qU().Buffer,L=lX(),S=WG(),K=ArrayBuffer.isView||function(H){try{return S(H),!0}catch(F){return!1}},Q=typeof Uint8Array<"u",T=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",M=T&&(E.prototype instanceof Uint8Array||E.TYPED_ARRAY_SUPPORT);I.exports=function(H,F){if(E.isBuffer(H)){if(H.constructor&&!("isBuffer"in H))return E.from(H);return H}if(typeof H==="string")return E.from(H,F);if(T&&K(H)){if(H.byteLength===0)return E.alloc(0);if(M){var R=E.from(H.buffer,H.byteOffset,H.byteLength);if(R.byteLength===H.byteLength)return R}var D=H instanceof Uint8Array?H:new Uint8Array(H.buffer,H.byteOffset,H.byteLength),q=E.from(D);if(q.length===H.byteLength)return q}if(Q&&H instanceof Uint8Array)return E.from(H);var P=L(H);if(P)for(var _=0;_<H.length;_+=1){var k=H[_];if(typeof k!=="number"||k<0||k>255||~~k!==k)throw RangeError("Array items must be numbers in the range 0-255.")}if(P||E.isBuffer(H)&&H.constructor&&typeof H.constructor.isBuffer==="function"&&H.constructor.isBuffer(H))return E.from(H);throw TypeError('The "data" argument must be a string, an Array, a Buffer, a Uint8Array, or a DataView.')}}),kA=Q0(($,I)=>{var E=qU().Buffer,L=FG(),S=typeof Uint8Array<"u",K=S&&typeof ArrayBuffer<"u",Q=K&&ArrayBuffer.isView;I.exports=function(T,M,H){if(typeof T==="string"||E.isBuffer(T)||S&&T instanceof Uint8Array||Q&&Q(T))return L(T,M);throw TypeError(H+" must be a string, a Buffer, a Uint8Array, or a DataView")}}),lI=Q0(($,I)=>{var E={__proto__:null,md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,"sha512-256":32,rmd160:20,ripemd160:20},L={__proto__:null,"sha-1":"sha1","sha-224":"sha224","sha-256":"sha256","sha-384":"sha384","sha-512":"sha512","ripemd-160":"ripemd160"},S=gI(),K=qU().Buffer,Q=MA(),T=zA(),M=kA();function H(F,R,D,q,P){Q(D,q),F=M(F,T,"Password"),R=M(R,T,"Salt");var _=(P||"sha1").toLowerCase(),k=L[_]||_,B=E[k];if(typeof B!=="number"||!B)throw TypeError("Digest algorithm not supported: "+P);var v=K.allocUnsafe(q),g=K.allocUnsafe(R.length+4);R.copy(g,0,0,R.length);var f=0,w=B,b=Math.ceil(q/w);for(var I0=1;I0<=b;I0++){g.writeUInt32BE(I0,R.length);var X0=S(k,F).update(g).digest(),C0=X0;for(var u=1;u<D;u++){C0=S(k,F).update(C0).digest();for(var O0=0;O0<w;O0++)X0[O0]^=C0[O0]}X0.copy(v,f),f+=w}return v}I.exports=H}),MG=Q0(($,I)=>{var E=qU().Buffer,L=MA(),S=zA(),K=lI(),Q=kA(),T,M=globalThis.crypto&&globalThis.crypto.subtle,H={sha:"SHA-1","sha-1":"SHA-1",sha1:"SHA-1",sha256:"SHA-256","sha-256":"SHA-256",sha384:"SHA-384","sha-384":"SHA-384","sha-512":"SHA-512",sha512:"SHA-512"},F=[],R;function D(){if(R)return R;if(globalThis.process&&globalThis.process.nextTick)R=globalThis.process.nextTick;else if(globalThis.queueMicrotask)R=globalThis.queueMicrotask;else if(globalThis.setImmediate)R=globalThis.setImmediate;else R=globalThis.setTimeout;return R}function q(k,B,v,g,f){return M.importKey("raw",k,{name:"PBKDF2"},!1,["deriveBits"]).then(function(w){return M.deriveBits({name:"PBKDF2",salt:B,iterations:v,hash:{name:f}},w,g<<3)}).then(function(w){return E.from(w)})}function P(k){if(globalThis.process&&!globalThis.process.browser)return Promise.resolve(!1);if(!M||!M.importKey||!M.deriveBits)return Promise.resolve(!1);if(F[k]!==void 0)return F[k];T=T||E.alloc(8);var B=q(T,T,10,128,k).then(function(){return!0},function(){return!1});return F[k]=B,B}function _(k,B){k.then(function(v){D()(function(){B(null,v)})},function(v){D()(function(){B(v)})})}I.exports=function(k,B,v,g,f,w){if(typeof f==="function")w=f,f=void 0;if(L(v,g),k=Q(k,S,"Password"),B=Q(B,S,"Salt"),typeof w!=="function")throw Error("No callback provided to pbkdf2");f=f||"sha1";var b=H[f.toLowerCase()];if(!b||typeof globalThis.Promise!=="function"){D()(function(){var I0;try{I0=K(k,B,v,g,f)}catch(X0){w(X0);return}w(null,I0)});return}_(P(b).then(function(I0){if(I0)return q(k,B,v,g,b);return K(k,B,v,g,f)}),w)}}),dI=Q0(($)=>{var I=(vU(),l0(jU)),E=MA(),L=zA(),S=kA();function K(T,M,H,F,R,D){if(E(H,F),T=S(T,L,"Password"),M=S(M,L,"Salt"),typeof R==="function")D=R,R="sha1";if(typeof D!=="function")throw Error("No callback provided to pbkdf2");return I.pbkdf2(T,M,H,F,R,D)}function Q(T,M,H,F,R){return E(H,F),T=S(T,L,"Password"),M=S(M,L,"Salt"),R=R||"sha1",I.pbkdf2Sync(T,M,H,F,R)}if(!I.pbkdf2Sync||I.pbkdf2Sync.toString().indexOf("keylen, digest")===-1)$.pbkdf2Sync=lI(),$.pbkdf2=MG();else $.pbkdf2Sync=Q,$.pbkdf2=K}),zG=Q0(($)=>{var I=(vU(),l0(jU));$.createCipher=$.Cipher=I.createCipher,$.createCipheriv=$.Cipheriv=I.createCipheriv,$.createDecipher=$.Decipher=I.createDecipher,$.createDecipheriv=$.Decipheriv=I.createDecipheriv,$.listCiphers=$.getCiphers=I.getCiphers}),TG=Q0(($)=>{var I=(vU(),l0(jU));$.DiffieHellmanGroup=I.DiffieHellmanGroup,$.createDiffieHellmanGroup=I.createDiffieHellmanGroup,$.getDiffieHellman=I.getDiffieHellman,$.createDiffieHellman=I.createDiffieHellman,$.DiffieHellman=I.DiffieHellman}),qG=Q0(($)=>{var I=(vU(),l0(jU));$.createSign=I.createSign,$.Sign=I.Sign,$.createVerify=I.createVerify,$.Verify=I.Verify}),PG=Q0(($,I)=>{I.exports={name:"elliptic",version:"6.6.1",description:"EC cryptography",main:"lib/elliptic.js",files:["lib"],scripts:{lint:"eslint lib test","lint:fix":"npm run lint -- --fix",unit:"istanbul test _mocha --reporter=spec test/index.js",test:"npm run lint && npm run unit",version:"grunt dist && git add dist/"},repository:{type:"git",url:"git@github.com:indutny/elliptic"},keywords:["EC","Elliptic","curve","Cryptography"],author:"Fedor Indutny <fedor@indutny.com>",license:"MIT",bugs:{url:"https://github.com/indutny/elliptic/issues"},homepage:"https://github.com/indutny/elliptic",devDependencies:{brfs:"^2.0.2",coveralls:"^3.1.0",eslint:"^7.6.0",grunt:"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1",istanbul:"^0.4.5",mocha:"^8.0.1"},dependencies:{"bn.js":"^4.11.9",brorand:"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1",inherits:"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"}}}),sU=Q0(($,I)=>{(function(E,L){function S(U,A){if(!U)throw Error(A||"Assertion failed")}function K(U,A){U.super_=A;var X=function(){};X.prototype=A.prototype,U.prototype=new X,U.prototype.constructor=U}function Q(U,A,X){if(Q.isBN(U))return U;if(this.negative=0,this.words=null,this.length=0,this.red=null,U!==null){if(A==="le"||A==="be")X=A,A=10;this._init(U||0,A||10,X||"be")}}if(typeof E==="object")E.exports=Q;else L.BN=Q;Q.BN=Q,Q.wordSize=26;var T;try{if(typeof window<"u"&&typeof window.Buffer<"u")T=window.Buffer;else T=(DU(),l0(RU)).Buffer}catch(U){}Q.isBN=function(U){if(U instanceof Q)return!0;return U!==null&&typeof U==="object"&&U.constructor.wordSize===Q.wordSize&&Array.isArray(U.words)},Q.max=function(U,A){if(U.cmp(A)>0)return U;return A},Q.min=function(U,A){if(U.cmp(A)<0)return U;return A},Q.prototype._init=function(U,A,X){if(typeof U==="number")return this._initNumber(U,A,X);if(typeof U==="object")return this._initArray(U,A,X);if(A==="hex")A=16;S(A===(A|0)&&A>=2&&A<=36),U=U.toString().replace(/\s+/g,"");var Z=0;if(U[0]==="-")Z++,this.negative=1;if(Z<U.length){if(A===16)this._parseHex(U,Z,X);else if(this._parseBase(U,A,Z),X==="le")this._initArray(this.toArray(),A,X)}},Q.prototype._initNumber=function(U,A,X){if(U<0)this.negative=1,U=-U;if(U<67108864)this.words=[U&67108863],this.length=1;else if(U<4503599627370496)this.words=[U&67108863,U/67108864&67108863],this.length=2;else S(U<9007199254740992),this.words=[U&67108863,U/67108864&67108863,1],this.length=3;if(X!=="le")return;this._initArray(this.toArray(),A,X)},Q.prototype._initArray=function(U,A,X){if(S(typeof U.length==="number"),U.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(U.length/3),this.words=Array(this.length);for(var Z=0;Z<this.length;Z++)this.words[Z]=0;var C,Y,V=0;if(X==="be"){for(Z=U.length-1,C=0;Z>=0;Z-=3)if(Y=U[Z]|U[Z-1]<<8|U[Z-2]<<16,this.words[C]|=Y<<V&67108863,this.words[C+1]=Y>>>26-V&67108863,V+=24,V>=26)V-=26,C++}else if(X==="le"){for(Z=0,C=0;Z<U.length;Z+=3)if(Y=U[Z]|U[Z+1]<<8|U[Z+2]<<16,this.words[C]|=Y<<V&67108863,this.words[C+1]=Y>>>26-V&67108863,V+=24,V>=26)V-=26,C++}return this.strip()};function M(U,A){var X=U.charCodeAt(A);if(X>=65&&X<=70)return X-55;else if(X>=97&&X<=102)return X-87;else return X-48&15}function H(U,A,X){var Z=M(U,X);if(X-1>=A)Z|=M(U,X-1)<<4;return Z}Q.prototype._parseHex=function(U,A,X){this.length=Math.ceil((U.length-A)/6),this.words=Array(this.length);for(var Z=0;Z<this.length;Z++)this.words[Z]=0;var C=0,Y=0,V;if(X==="be")for(Z=U.length-1;Z>=A;Z-=2)if(V=H(U,A,Z)<<C,this.words[Y]|=V&67108863,C>=18)C-=18,Y+=1,this.words[Y]|=V>>>26;else C+=8;else{var G=U.length-A;for(Z=G%2===0?A+1:A;Z<U.length;Z+=2)if(V=H(U,A,Z)<<C,this.words[Y]|=V&67108863,C>=18)C-=18,Y+=1,this.words[Y]|=V>>>26;else C+=8}this.strip()};function F(U,A,X,Z){var C=0,Y=Math.min(U.length,X);for(var V=A;V<Y;V++){var G=U.charCodeAt(V)-48;if(C*=Z,G>=49)C+=G-49+10;else if(G>=17)C+=G-17+10;else C+=G}return C}Q.prototype._parseBase=function(U,A,X){this.words=[0],this.length=1;for(var Z=0,C=1;C<=67108863;C*=A)Z++;Z--,C=C/A|0;var Y=U.length-X,V=Y%Z,G=Math.min(Y,Y-V)+X,O=0;for(var J=X;J<G;J+=Z)if(O=F(U,J,J+Z,A),this.imuln(C),this.words[0]+O<67108864)this.words[0]+=O;else this._iaddn(O);if(V!==0){var z=1;O=F(U,J,U.length,A);for(J=0;J<V;J++)z*=A;if(this.imuln(z),this.words[0]+O<67108864)this.words[0]+=O;else this._iaddn(O)}this.strip()},Q.prototype.copy=function(U){U.words=Array(this.length);for(var A=0;A<this.length;A++)U.words[A]=this.words[A];U.length=this.length,U.negative=this.negative,U.red=this.red},Q.prototype.clone=function(){var U=new Q(null);return this.copy(U),U},Q.prototype._expand=function(U){while(this.length<U)this.words[this.length++]=0;return this},Q.prototype.strip=function(){while(this.length>1&&this.words[this.length-1]===0)this.length--;return this._normSign()},Q.prototype._normSign=function(){if(this.length===1&&this.words[0]===0)this.negative=0;return this},Q.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var R=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],D=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],q=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64000000,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,24300000,28629151,33554432,39135393,45435424,52521875,60466176];if(Q.prototype.toString=function(U,A){U=U||10,A=A|0||1;var X;if(U===16||U==="hex"){X="";var Z=0,C=0;for(var Y=0;Y<this.length;Y++){var V=this.words[Y],G=((V<<Z|C)&16777215).toString(16);if(C=V>>>24-Z&16777215,Z+=2,Z>=26)Z-=26,Y--;if(C!==0||Y!==this.length-1)X=R[6-G.length]+G+X;else X=G+X}if(C!==0)X=C.toString(16)+X;while(X.length%A!==0)X="0"+X;if(this.negative!==0)X="-"+X;return X}if(U===(U|0)&&U>=2&&U<=36){var O=D[U],J=q[U];X="";var z=this.clone();z.negative=0;while(!z.isZero()){var W=z.modn(J).toString(U);if(z=z.idivn(J),!z.isZero())X=R[O-W.length]+W+X;else X=W+X}if(this.isZero())X="0"+X;while(X.length%A!==0)X="0"+X;if(this.negative!==0)X="-"+X;return X}S(!1,"Base should be between 2 and 36")},Q.prototype.toNumber=function(){var U=this.words[0];if(this.length===2)U+=this.words[1]*67108864;else if(this.length===3&&this.words[2]===1)U+=4503599627370496+this.words[1]*67108864;else if(this.length>2)S(!1,"Number can only safely store up to 53 bits");return this.negative!==0?-U:U},Q.prototype.toJSON=function(){return this.toString(16)},Q.prototype.toBuffer=function(U,A){return S(typeof T<"u"),this.toArrayLike(T,U,A)},Q.prototype.toArray=function(U,A){return this.toArrayLike(Array,U,A)},Q.prototype.toArrayLike=function(U,A,X){var Z=this.byteLength(),C=X||Math.max(1,Z);S(Z<=C,"byte array longer than desired length"),S(C>0,"Requested array length <= 0"),this.strip();var Y=A==="le",V=new U(C),G,O,J=this.clone();if(!Y){for(O=0;O<C-Z;O++)V[O]=0;for(O=0;!J.isZero();O++)G=J.andln(255),J.iushrn(8),V[C-O-1]=G}else{for(O=0;!J.isZero();O++)G=J.andln(255),J.iushrn(8),V[O]=G;for(;O<C;O++)V[O]=0}return V},Math.clz32)Q.prototype._countBits=function(U){return 32-Math.clz32(U)};else Q.prototype._countBits=function(U){var A=U,X=0;if(A>=4096)X+=13,A>>>=13;if(A>=64)X+=7,A>>>=7;if(A>=8)X+=4,A>>>=4;if(A>=2)X+=2,A>>>=2;return X+A};Q.prototype._zeroBits=function(U){if(U===0)return 26;var A=U,X=0;if((A&8191)===0)X+=13,A>>>=13;if((A&127)===0)X+=7,A>>>=7;if((A&15)===0)X+=4,A>>>=4;if((A&3)===0)X+=2,A>>>=2;if((A&1)===0)X++;return X},Q.prototype.bitLength=function(){var U=this.words[this.length-1],A=this._countBits(U);return(this.length-1)*26+A};function P(U){var A=Array(U.bitLength());for(var X=0;X<A.length;X++){var Z=X/26|0,C=X%26;A[X]=(U.words[Z]&1<<C)>>>C}return A}Q.prototype.zeroBits=function(){if(this.isZero())return 0;var U=0;for(var A=0;A<this.length;A++){var X=this._zeroBits(this.words[A]);if(U+=X,X!==26)break}return U},Q.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},Q.prototype.toTwos=function(U){if(this.negative!==0)return this.abs().inotn(U).iaddn(1);return this.clone()},Q.prototype.fromTwos=function(U){if(this.testn(U-1))return this.notn(U).iaddn(1).ineg();return this.clone()},Q.prototype.isNeg=function(){return this.negative!==0},Q.prototype.neg=function(){return this.clone().ineg()},Q.prototype.ineg=function(){if(!this.isZero())this.negative^=1;return this},Q.prototype.iuor=function(U){while(this.length<U.length)this.words[this.length++]=0;for(var A=0;A<U.length;A++)this.words[A]=this.words[A]|U.words[A];return this.strip()},Q.prototype.ior=function(U){return S((this.negative|U.negative)===0),this.iuor(U)},Q.prototype.or=function(U){if(this.length>U.length)return this.clone().ior(U);return U.clone().ior(this)},Q.prototype.uor=function(U){if(this.length>U.length)return this.clone().iuor(U);return U.clone().iuor(this)},Q.prototype.iuand=function(U){var A;if(this.length>U.length)A=U;else A=this;for(var X=0;X<A.length;X++)this.words[X]=this.words[X]&U.words[X];return this.length=A.length,this.strip()},Q.prototype.iand=function(U){return S((this.negative|U.negative)===0),this.iuand(U)},Q.prototype.and=function(U){if(this.length>U.length)return this.clone().iand(U);return U.clone().iand(this)},Q.prototype.uand=function(U){if(this.length>U.length)return this.clone().iuand(U);return U.clone().iuand(this)},Q.prototype.iuxor=function(U){var A,X;if(this.length>U.length)A=this,X=U;else A=U,X=this;for(var Z=0;Z<X.length;Z++)this.words[Z]=A.words[Z]^X.words[Z];if(this!==A)for(;Z<A.length;Z++)this.words[Z]=A.words[Z];return this.length=A.length,this.strip()},Q.prototype.ixor=function(U){return S((this.negative|U.negative)===0),this.iuxor(U)},Q.prototype.xor=function(U){if(this.length>U.length)return this.clone().ixor(U);return U.clone().ixor(this)},Q.prototype.uxor=function(U){if(this.length>U.length)return this.clone().iuxor(U);return U.clone().iuxor(this)},Q.prototype.inotn=function(U){S(typeof U==="number"&&U>=0);var A=Math.ceil(U/26)|0,X=U%26;if(this._expand(A),X>0)A--;for(var Z=0;Z<A;Z++)this.words[Z]=~this.words[Z]&67108863;if(X>0)this.words[Z]=~this.words[Z]&67108863>>26-X;return this.strip()},Q.prototype.notn=function(U){return this.clone().inotn(U)},Q.prototype.setn=function(U,A){S(typeof U==="number"&&U>=0);var X=U/26|0,Z=U%26;if(this._expand(X+1),A)this.words[X]=this.words[X]|1<<Z;else this.words[X]=this.words[X]&~(1<<Z);return this.strip()},Q.prototype.iadd=function(U){var A;if(this.negative!==0&&U.negative===0)return this.negative=0,A=this.isub(U),this.negative^=1,this._normSign();else if(this.negative===0&&U.negative!==0)return U.negative=0,A=this.isub(U),U.negative=1,A._normSign();var X,Z;if(this.length>U.length)X=this,Z=U;else X=U,Z=this;var C=0;for(var Y=0;Y<Z.length;Y++)A=(X.words[Y]|0)+(Z.words[Y]|0)+C,this.words[Y]=A&67108863,C=A>>>26;for(;C!==0&&Y<X.length;Y++)A=(X.words[Y]|0)+C,this.words[Y]=A&67108863,C=A>>>26;if(this.length=X.length,C!==0)this.words[this.length]=C,this.length++;else if(X!==this)for(;Y<X.length;Y++)this.words[Y]=X.words[Y];return this},Q.prototype.add=function(U){var A;if(U.negative!==0&&this.negative===0)return U.negative=0,A=this.sub(U),U.negative^=1,A;else if(U.negative===0&&this.negative!==0)return this.negative=0,A=U.sub(this),this.negative=1,A;if(this.length>U.length)return this.clone().iadd(U);return U.clone().iadd(this)},Q.prototype.isub=function(U){if(U.negative!==0){U.negative=0;var A=this.iadd(U);return U.negative=1,A._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(U),this.negative=1,this._normSign();var X=this.cmp(U);if(X===0)return this.negative=0,this.length=1,this.words[0]=0,this;var Z,C;if(X>0)Z=this,C=U;else Z=U,C=this;var Y=0;for(var V=0;V<C.length;V++)A=(Z.words[V]|0)-(C.words[V]|0)+Y,Y=A>>26,this.words[V]=A&67108863;for(;Y!==0&&V<Z.length;V++)A=(Z.words[V]|0)+Y,Y=A>>26,this.words[V]=A&67108863;if(Y===0&&V<Z.length&&Z!==this)for(;V<Z.length;V++)this.words[V]=Z.words[V];if(this.length=Math.max(this.length,V),Z!==this)this.negative=1;return this.strip()},Q.prototype.sub=function(U){return this.clone().isub(U)};function _(U,A,X){X.negative=A.negative^U.negative;var Z=U.length+A.length|0;X.length=Z,Z=Z-1|0;var C=U.words[0]|0,Y=A.words[0]|0,V=C*Y,G=V&67108863,O=V/67108864|0;X.words[0]=G;for(var J=1;J<Z;J++){var z=O>>>26,W=O&67108863,j=Math.min(J,A.length-1);for(var N=Math.max(0,J-U.length+1);N<=j;N++){var p=J-N|0;C=U.words[p]|0,Y=A.words[N]|0,V=C*Y+W,z+=V/67108864|0,W=V&67108863}X.words[J]=W|0,O=z|0}if(O!==0)X.words[J]=O|0;else X.length--;return X.strip()}var k=function(U,A,X){var Z=U.words,C=A.words,Y=X.words,V=0,G,O,J,z=Z[0]|0,W=z&8191,j=z>>>13,N=Z[1]|0,p=N&8191,n=N>>>13,E0=Z[2]|0,r=E0&8191,d=E0>>>13,A0=Z[3]|0,t=A0&8191,i=A0>>>13,N0=Z[4]|0,y=N0&8191,h=N0>>>13,$0=Z[5]|0,m=$0&8191,a=$0>>>13,W0=Z[6]|0,c=W0&8191,o=W0>>>13,x0=Z[7]|0,s=x0&8191,Z0=x0>>>13,w0=Z[8]|0,S0=w0&8191,V0=w0>>>13,m0=Z[9]|0,J0=m0&8191,L0=m0>>>13,a0=C[0]|0,K0=a0&8191,D0=a0>>>13,WU=C[1]|0,F0=WU&8191,k0=WU>>>13,FU=C[2]|0,_0=FU&8191,M0=FU>>>13,KU=C[3]|0,j0=KU&8191,z0=KU>>>13,SU=C[4]|0,v0=SU&8191,B0=SU>>>13,VU=C[5]|0,T0=VU&8191,x=VU>>>13,l=C[6]|0,e=l&8191,U0=l>>>13,f0=C[7]|0,Y0=f0&8191,R0=f0>>>13,r0=C[8]|0,q0=r0&8191,g0=r0>>>13,HU=C[9]|0,P0=HU&8191,H0=HU>>>13;X.negative=U.negative^A.negative,X.length=19,G=Math.imul(W,K0),O=Math.imul(W,D0),O=O+Math.imul(j,K0)|0,J=Math.imul(j,D0);var e0=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(e0>>>26)|0,e0&=67108863,G=Math.imul(p,K0),O=Math.imul(p,D0),O=O+Math.imul(n,K0)|0,J=Math.imul(n,D0),G=G+Math.imul(W,F0)|0,O=O+Math.imul(W,k0)|0,O=O+Math.imul(j,F0)|0,J=J+Math.imul(j,k0)|0;var c0=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(c0>>>26)|0,c0&=67108863,G=Math.imul(r,K0),O=Math.imul(r,D0),O=O+Math.imul(d,K0)|0,J=Math.imul(d,D0),G=G+Math.imul(p,F0)|0,O=O+Math.imul(p,k0)|0,O=O+Math.imul(n,F0)|0,J=J+Math.imul(n,k0)|0,G=G+Math.imul(W,_0)|0,O=O+Math.imul(W,M0)|0,O=O+Math.imul(j,_0)|0,J=J+Math.imul(j,M0)|0;var y0=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(y0>>>26)|0,y0&=67108863,G=Math.imul(t,K0),O=Math.imul(t,D0),O=O+Math.imul(i,K0)|0,J=Math.imul(i,D0),G=G+Math.imul(r,F0)|0,O=O+Math.imul(r,k0)|0,O=O+Math.imul(d,F0)|0,J=J+Math.imul(d,k0)|0,G=G+Math.imul(p,_0)|0,O=O+Math.imul(p,M0)|0,O=O+Math.imul(n,_0)|0,J=J+Math.imul(n,M0)|0,G=G+Math.imul(W,j0)|0,O=O+Math.imul(W,z0)|0,O=O+Math.imul(j,j0)|0,J=J+Math.imul(j,z0)|0;var o0=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(o0>>>26)|0,o0&=67108863,G=Math.imul(y,K0),O=Math.imul(y,D0),O=O+Math.imul(h,K0)|0,J=Math.imul(h,D0),G=G+Math.imul(t,F0)|0,O=O+Math.imul(t,k0)|0,O=O+Math.imul(i,F0)|0,J=J+Math.imul(i,k0)|0,G=G+Math.imul(r,_0)|0,O=O+Math.imul(r,M0)|0,O=O+Math.imul(d,_0)|0,J=J+Math.imul(d,M0)|0,G=G+Math.imul(p,j0)|0,O=O+Math.imul(p,z0)|0,O=O+Math.imul(n,j0)|0,J=J+Math.imul(n,z0)|0,G=G+Math.imul(W,v0)|0,O=O+Math.imul(W,B0)|0,O=O+Math.imul(j,v0)|0,J=J+Math.imul(j,B0)|0;var b0=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(b0>>>26)|0,b0&=67108863,G=Math.imul(m,K0),O=Math.imul(m,D0),O=O+Math.imul(a,K0)|0,J=Math.imul(a,D0),G=G+Math.imul(y,F0)|0,O=O+Math.imul(y,k0)|0,O=O+Math.imul(h,F0)|0,J=J+Math.imul(h,k0)|0,G=G+Math.imul(t,_0)|0,O=O+Math.imul(t,M0)|0,O=O+Math.imul(i,_0)|0,J=J+Math.imul(i,M0)|0,G=G+Math.imul(r,j0)|0,O=O+Math.imul(r,z0)|0,O=O+Math.imul(d,j0)|0,J=J+Math.imul(d,z0)|0,G=G+Math.imul(p,v0)|0,O=O+Math.imul(p,B0)|0,O=O+Math.imul(n,v0)|0,J=J+Math.imul(n,B0)|0,G=G+Math.imul(W,T0)|0,O=O+Math.imul(W,x)|0,O=O+Math.imul(j,T0)|0,J=J+Math.imul(j,x)|0;var i0=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(i0>>>26)|0,i0&=67108863,G=Math.imul(c,K0),O=Math.imul(c,D0),O=O+Math.imul(o,K0)|0,J=Math.imul(o,D0),G=G+Math.imul(m,F0)|0,O=O+Math.imul(m,k0)|0,O=O+Math.imul(a,F0)|0,J=J+Math.imul(a,k0)|0,G=G+Math.imul(y,_0)|0,O=O+Math.imul(y,M0)|0,O=O+Math.imul(h,_0)|0,J=J+Math.imul(h,M0)|0,G=G+Math.imul(t,j0)|0,O=O+Math.imul(t,z0)|0,O=O+Math.imul(i,j0)|0,J=J+Math.imul(i,z0)|0,G=G+Math.imul(r,v0)|0,O=O+Math.imul(r,B0)|0,O=O+Math.imul(d,v0)|0,J=J+Math.imul(d,B0)|0,G=G+Math.imul(p,T0)|0,O=O+Math.imul(p,x)|0,O=O+Math.imul(n,T0)|0,J=J+Math.imul(n,x)|0,G=G+Math.imul(W,e)|0,O=O+Math.imul(W,U0)|0,O=O+Math.imul(j,e)|0,J=J+Math.imul(j,U0)|0;var UU=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(UU>>>26)|0,UU&=67108863,G=Math.imul(s,K0),O=Math.imul(s,D0),O=O+Math.imul(Z0,K0)|0,J=Math.imul(Z0,D0),G=G+Math.imul(c,F0)|0,O=O+Math.imul(c,k0)|0,O=O+Math.imul(o,F0)|0,J=J+Math.imul(o,k0)|0,G=G+Math.imul(m,_0)|0,O=O+Math.imul(m,M0)|0,O=O+Math.imul(a,_0)|0,J=J+Math.imul(a,M0)|0,G=G+Math.imul(y,j0)|0,O=O+Math.imul(y,z0)|0,O=O+Math.imul(h,j0)|0,J=J+Math.imul(h,z0)|0,G=G+Math.imul(t,v0)|0,O=O+Math.imul(t,B0)|0,O=O+Math.imul(i,v0)|0,J=J+Math.imul(i,B0)|0,G=G+Math.imul(r,T0)|0,O=O+Math.imul(r,x)|0,O=O+Math.imul(d,T0)|0,J=J+Math.imul(d,x)|0,G=G+Math.imul(p,e)|0,O=O+Math.imul(p,U0)|0,O=O+Math.imul(n,e)|0,J=J+Math.imul(n,U0)|0,G=G+Math.imul(W,Y0)|0,O=O+Math.imul(W,R0)|0,O=O+Math.imul(j,Y0)|0,J=J+Math.imul(j,R0)|0;var OU=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(OU>>>26)|0,OU&=67108863,G=Math.imul(S0,K0),O=Math.imul(S0,D0),O=O+Math.imul(V0,K0)|0,J=Math.imul(V0,D0),G=G+Math.imul(s,F0)|0,O=O+Math.imul(s,k0)|0,O=O+Math.imul(Z0,F0)|0,J=J+Math.imul(Z0,k0)|0,G=G+Math.imul(c,_0)|0,O=O+Math.imul(c,M0)|0,O=O+Math.imul(o,_0)|0,J=J+Math.imul(o,M0)|0,G=G+Math.imul(m,j0)|0,O=O+Math.imul(m,z0)|0,O=O+Math.imul(a,j0)|0,J=J+Math.imul(a,z0)|0,G=G+Math.imul(y,v0)|0,O=O+Math.imul(y,B0)|0,O=O+Math.imul(h,v0)|0,J=J+Math.imul(h,B0)|0,G=G+Math.imul(t,T0)|0,O=O+Math.imul(t,x)|0,O=O+Math.imul(i,T0)|0,J=J+Math.imul(i,x)|0,G=G+Math.imul(r,e)|0,O=O+Math.imul(r,U0)|0,O=O+Math.imul(d,e)|0,J=J+Math.imul(d,U0)|0,G=G+Math.imul(p,Y0)|0,O=O+Math.imul(p,R0)|0,O=O+Math.imul(n,Y0)|0,J=J+Math.imul(n,R0)|0,G=G+Math.imul(W,q0)|0,O=O+Math.imul(W,g0)|0,O=O+Math.imul(j,q0)|0,J=J+Math.imul(j,g0)|0;var ZU=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(ZU>>>26)|0,ZU&=67108863,G=Math.imul(J0,K0),O=Math.imul(J0,D0),O=O+Math.imul(L0,K0)|0,J=Math.imul(L0,D0),G=G+Math.imul(S0,F0)|0,O=O+Math.imul(S0,k0)|0,O=O+Math.imul(V0,F0)|0,J=J+Math.imul(V0,k0)|0,G=G+Math.imul(s,_0)|0,O=O+Math.imul(s,M0)|0,O=O+Math.imul(Z0,_0)|0,J=J+Math.imul(Z0,M0)|0,G=G+Math.imul(c,j0)|0,O=O+Math.imul(c,z0)|0,O=O+Math.imul(o,j0)|0,J=J+Math.imul(o,z0)|0,G=G+Math.imul(m,v0)|0,O=O+Math.imul(m,B0)|0,O=O+Math.imul(a,v0)|0,J=J+Math.imul(a,B0)|0,G=G+Math.imul(y,T0)|0,O=O+Math.imul(y,x)|0,O=O+Math.imul(h,T0)|0,J=J+Math.imul(h,x)|0,G=G+Math.imul(t,e)|0,O=O+Math.imul(t,U0)|0,O=O+Math.imul(i,e)|0,J=J+Math.imul(i,U0)|0,G=G+Math.imul(r,Y0)|0,O=O+Math.imul(r,R0)|0,O=O+Math.imul(d,Y0)|0,J=J+Math.imul(d,R0)|0,G=G+Math.imul(p,q0)|0,O=O+Math.imul(p,g0)|0,O=O+Math.imul(n,q0)|0,J=J+Math.imul(n,g0)|0,G=G+Math.imul(W,P0)|0,O=O+Math.imul(W,H0)|0,O=O+Math.imul(j,P0)|0,J=J+Math.imul(j,H0)|0;var AU=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(AU>>>26)|0,AU&=67108863,G=Math.imul(J0,F0),O=Math.imul(J0,k0),O=O+Math.imul(L0,F0)|0,J=Math.imul(L0,k0),G=G+Math.imul(S0,_0)|0,O=O+Math.imul(S0,M0)|0,O=O+Math.imul(V0,_0)|0,J=J+Math.imul(V0,M0)|0,G=G+Math.imul(s,j0)|0,O=O+Math.imul(s,z0)|0,O=O+Math.imul(Z0,j0)|0,J=J+Math.imul(Z0,z0)|0,G=G+Math.imul(c,v0)|0,O=O+Math.imul(c,B0)|0,O=O+Math.imul(o,v0)|0,J=J+Math.imul(o,B0)|0,G=G+Math.imul(m,T0)|0,O=O+Math.imul(m,x)|0,O=O+Math.imul(a,T0)|0,J=J+Math.imul(a,x)|0,G=G+Math.imul(y,e)|0,O=O+Math.imul(y,U0)|0,O=O+Math.imul(h,e)|0,J=J+Math.imul(h,U0)|0,G=G+Math.imul(t,Y0)|0,O=O+Math.imul(t,R0)|0,O=O+Math.imul(i,Y0)|0,J=J+Math.imul(i,R0)|0,G=G+Math.imul(r,q0)|0,O=O+Math.imul(r,g0)|0,O=O+Math.imul(d,q0)|0,J=J+Math.imul(d,g0)|0,G=G+Math.imul(p,P0)|0,O=O+Math.imul(p,H0)|0,O=O+Math.imul(n,P0)|0,J=J+Math.imul(n,H0)|0;var $U=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+($U>>>26)|0,$U&=67108863,G=Math.imul(J0,_0),O=Math.imul(J0,M0),O=O+Math.imul(L0,_0)|0,J=Math.imul(L0,M0),G=G+Math.imul(S0,j0)|0,O=O+Math.imul(S0,z0)|0,O=O+Math.imul(V0,j0)|0,J=J+Math.imul(V0,z0)|0,G=G+Math.imul(s,v0)|0,O=O+Math.imul(s,B0)|0,O=O+Math.imul(Z0,v0)|0,J=J+Math.imul(Z0,B0)|0,G=G+Math.imul(c,T0)|0,O=O+Math.imul(c,x)|0,O=O+Math.imul(o,T0)|0,J=J+Math.imul(o,x)|0,G=G+Math.imul(m,e)|0,O=O+Math.imul(m,U0)|0,O=O+Math.imul(a,e)|0,J=J+Math.imul(a,U0)|0,G=G+Math.imul(y,Y0)|0,O=O+Math.imul(y,R0)|0,O=O+Math.imul(h,Y0)|0,J=J+Math.imul(h,R0)|0,G=G+Math.imul(t,q0)|0,O=O+Math.imul(t,g0)|0,O=O+Math.imul(i,q0)|0,J=J+Math.imul(i,g0)|0,G=G+Math.imul(r,P0)|0,O=O+Math.imul(r,H0)|0,O=O+Math.imul(d,P0)|0,J=J+Math.imul(d,H0)|0;var IU=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(IU>>>26)|0,IU&=67108863,G=Math.imul(J0,j0),O=Math.imul(J0,z0),O=O+Math.imul(L0,j0)|0,J=Math.imul(L0,z0),G=G+Math.imul(S0,v0)|0,O=O+Math.imul(S0,B0)|0,O=O+Math.imul(V0,v0)|0,J=J+Math.imul(V0,B0)|0,G=G+Math.imul(s,T0)|0,O=O+Math.imul(s,x)|0,O=O+Math.imul(Z0,T0)|0,J=J+Math.imul(Z0,x)|0,G=G+Math.imul(c,e)|0,O=O+Math.imul(c,U0)|0,O=O+Math.imul(o,e)|0,J=J+Math.imul(o,U0)|0,G=G+Math.imul(m,Y0)|0,O=O+Math.imul(m,R0)|0,O=O+Math.imul(a,Y0)|0,J=J+Math.imul(a,R0)|0,G=G+Math.imul(y,q0)|0,O=O+Math.imul(y,g0)|0,O=O+Math.imul(h,q0)|0,J=J+Math.imul(h,g0)|0,G=G+Math.imul(t,P0)|0,O=O+Math.imul(t,H0)|0,O=O+Math.imul(i,P0)|0,J=J+Math.imul(i,H0)|0;var CU=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(CU>>>26)|0,CU&=67108863,G=Math.imul(J0,v0),O=Math.imul(J0,B0),O=O+Math.imul(L0,v0)|0,J=Math.imul(L0,B0),G=G+Math.imul(S0,T0)|0,O=O+Math.imul(S0,x)|0,O=O+Math.imul(V0,T0)|0,J=J+Math.imul(V0,x)|0,G=G+Math.imul(s,e)|0,O=O+Math.imul(s,U0)|0,O=O+Math.imul(Z0,e)|0,J=J+Math.imul(Z0,U0)|0,G=G+Math.imul(c,Y0)|0,O=O+Math.imul(c,R0)|0,O=O+Math.imul(o,Y0)|0,J=J+Math.imul(o,R0)|0,G=G+Math.imul(m,q0)|0,O=O+Math.imul(m,g0)|0,O=O+Math.imul(a,q0)|0,J=J+Math.imul(a,g0)|0,G=G+Math.imul(y,P0)|0,O=O+Math.imul(y,H0)|0,O=O+Math.imul(h,P0)|0,J=J+Math.imul(h,H0)|0;var QU=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(QU>>>26)|0,QU&=67108863,G=Math.imul(J0,T0),O=Math.imul(J0,x),O=O+Math.imul(L0,T0)|0,J=Math.imul(L0,x),G=G+Math.imul(S0,e)|0,O=O+Math.imul(S0,U0)|0,O=O+Math.imul(V0,e)|0,J=J+Math.imul(V0,U0)|0,G=G+Math.imul(s,Y0)|0,O=O+Math.imul(s,R0)|0,O=O+Math.imul(Z0,Y0)|0,J=J+Math.imul(Z0,R0)|0,G=G+Math.imul(c,q0)|0,O=O+Math.imul(c,g0)|0,O=O+Math.imul(o,q0)|0,J=J+Math.imul(o,g0)|0,G=G+Math.imul(m,P0)|0,O=O+Math.imul(m,H0)|0,O=O+Math.imul(a,P0)|0,J=J+Math.imul(a,H0)|0;var XU=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(XU>>>26)|0,XU&=67108863,G=Math.imul(J0,e),O=Math.imul(J0,U0),O=O+Math.imul(L0,e)|0,J=Math.imul(L0,U0),G=G+Math.imul(S0,Y0)|0,O=O+Math.imul(S0,R0)|0,O=O+Math.imul(V0,Y0)|0,J=J+Math.imul(V0,R0)|0,G=G+Math.imul(s,q0)|0,O=O+Math.imul(s,g0)|0,O=O+Math.imul(Z0,q0)|0,J=J+Math.imul(Z0,g0)|0,G=G+Math.imul(c,P0)|0,O=O+Math.imul(c,H0)|0,O=O+Math.imul(o,P0)|0,J=J+Math.imul(o,H0)|0;var GU=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(GU>>>26)|0,GU&=67108863,G=Math.imul(J0,Y0),O=Math.imul(J0,R0),O=O+Math.imul(L0,Y0)|0,J=Math.imul(L0,R0),G=G+Math.imul(S0,q0)|0,O=O+Math.imul(S0,g0)|0,O=O+Math.imul(V0,q0)|0,J=J+Math.imul(V0,g0)|0,G=G+Math.imul(s,P0)|0,O=O+Math.imul(s,H0)|0,O=O+Math.imul(Z0,P0)|0,J=J+Math.imul(Z0,H0)|0;var EU=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(EU>>>26)|0,EU&=67108863,G=Math.imul(J0,q0),O=Math.imul(J0,g0),O=O+Math.imul(L0,q0)|0,J=Math.imul(L0,g0),G=G+Math.imul(S0,P0)|0,O=O+Math.imul(S0,H0)|0,O=O+Math.imul(V0,P0)|0,J=J+Math.imul(V0,H0)|0;var JU=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(JU>>>26)|0,JU&=67108863,G=Math.imul(J0,P0),O=Math.imul(J0,H0),O=O+Math.imul(L0,P0)|0,J=Math.imul(L0,H0);var YU=(V+G|0)+((O&8191)<<13)|0;if(V=(J+(O>>>13)|0)+(YU>>>26)|0,YU&=67108863,Y[0]=e0,Y[1]=c0,Y[2]=y0,Y[3]=o0,Y[4]=b0,Y[5]=i0,Y[6]=UU,Y[7]=OU,Y[8]=ZU,Y[9]=AU,Y[10]=$U,Y[11]=IU,Y[12]=CU,Y[13]=QU,Y[14]=XU,Y[15]=GU,Y[16]=EU,Y[17]=JU,Y[18]=YU,V!==0)Y[19]=V,X.length++;return X};if(!Math.imul)k=_;function B(U,A,X){X.negative=A.negative^U.negative,X.length=U.length+A.length;var Z=0,C=0;for(var Y=0;Y<X.length-1;Y++){var V=C;C=0;var G=Z&67108863,O=Math.min(Y,A.length-1);for(var J=Math.max(0,Y-U.length+1);J<=O;J++){var z=Y-J,W=U.words[z]|0,j=A.words[J]|0,N=W*j,p=N&67108863;V=V+(N/67108864|0)|0,p=p+G|0,G=p&67108863,V=V+(p>>>26)|0,C+=V>>>26,V&=67108863}X.words[Y]=G,Z=V,V=C}if(Z!==0)X.words[Y]=Z;else X.length--;return X.strip()}function v(U,A,X){var Z=new g;return Z.mulp(U,A,X)}Q.prototype.mulTo=function(U,A){var X,Z=this.length+U.length;if(this.length===10&&U.length===10)X=k(this,U,A);else if(Z<63)X=_(this,U,A);else if(Z<1024)X=B(this,U,A);else X=v(this,U,A);return X};function g(U,A){this.x=U,this.y=A}g.prototype.makeRBT=function(U){var A=Array(U),X=Q.prototype._countBits(U)-1;for(var Z=0;Z<U;Z++)A[Z]=this.revBin(Z,X,U);return A},g.prototype.revBin=function(U,A,X){if(U===0||U===X-1)return U;var Z=0;for(var C=0;C<A;C++)Z|=(U&1)<<A-C-1,U>>=1;return Z},g.prototype.permute=function(U,A,X,Z,C,Y){for(var V=0;V<Y;V++)Z[V]=A[U[V]],C[V]=X[U[V]]},g.prototype.transform=function(U,A,X,Z,C,Y){this.permute(Y,U,A,X,Z,C);for(var V=1;V<C;V<<=1){var G=V<<1,O=Math.cos(2*Math.PI/G),J=Math.sin(2*Math.PI/G);for(var z=0;z<C;z+=G){var W=O,j=J;for(var N=0;N<V;N++){var p=X[z+N],n=Z[z+N],E0=X[z+N+V],r=Z[z+N+V],d=W*E0-j*r;if(r=W*r+j*E0,E0=d,X[z+N]=p+E0,Z[z+N]=n+r,X[z+N+V]=p-E0,Z[z+N+V]=n-r,N!==G)d=O*W-J*j,j=O*j+J*W,W=d}}}},g.prototype.guessLen13b=function(U,A){var X=Math.max(A,U)|1,Z=X&1,C=0;for(X=X/2|0;X;X=X>>>1)C++;return 1<<C+1+Z},g.prototype.conjugate=function(U,A,X){if(X<=1)return;for(var Z=0;Z<X/2;Z++){var C=U[Z];U[Z]=U[X-Z-1],U[X-Z-1]=C,C=A[Z],A[Z]=-A[X-Z-1],A[X-Z-1]=-C}},g.prototype.normalize13b=function(U,A){var X=0;for(var Z=0;Z<A/2;Z++){var C=Math.round(U[2*Z+1]/A)*8192+Math.round(U[2*Z]/A)+X;if(U[Z]=C&67108863,C<67108864)X=0;else X=C/67108864|0}return U},g.prototype.convert13b=function(U,A,X,Z){var C=0;for(var Y=0;Y<A;Y++)C=C+(U[Y]|0),X[2*Y]=C&8191,C=C>>>13,X[2*Y+1]=C&8191,C=C>>>13;for(Y=2*A;Y<Z;++Y)X[Y]=0;S(C===0),S((C&-8192)===0)},g.prototype.stub=function(U){var A=Array(U);for(var X=0;X<U;X++)A[X]=0;return A},g.prototype.mulp=function(U,A,X){var Z=2*this.guessLen13b(U.length,A.length),C=this.makeRBT(Z),Y=this.stub(Z),V=Array(Z),G=Array(Z),O=Array(Z),J=Array(Z),z=Array(Z),W=Array(Z),j=X.words;j.length=Z,this.convert13b(U.words,U.length,V,Z),this.convert13b(A.words,A.length,J,Z),this.transform(V,Y,G,O,Z,C),this.transform(J,Y,z,W,Z,C);for(var N=0;N<Z;N++){var p=G[N]*z[N]-O[N]*W[N];O[N]=G[N]*W[N]+O[N]*z[N],G[N]=p}return this.conjugate(G,O,Z),this.transform(G,O,j,Y,Z,C),this.conjugate(j,Y,Z),this.normalize13b(j,Z),X.negative=U.negative^A.negative,X.length=U.length+A.length,X.strip()},Q.prototype.mul=function(U){var A=new Q(null);return A.words=Array(this.length+U.length),this.mulTo(U,A)},Q.prototype.mulf=function(U){var A=new Q(null);return A.words=Array(this.length+U.length),v(this,U,A)},Q.prototype.imul=function(U){return this.clone().mulTo(U,this)},Q.prototype.imuln=function(U){S(typeof U==="number"),S(U<67108864);var A=0;for(var X=0;X<this.length;X++){var Z=(this.words[X]|0)*U,C=(Z&67108863)+(A&67108863);A>>=26,A+=Z/67108864|0,A+=C>>>26,this.words[X]=C&67108863}if(A!==0)this.words[X]=A,this.length++;return this.length=U===0?1:this.length,this},Q.prototype.muln=function(U){return this.clone().imuln(U)},Q.prototype.sqr=function(){return this.mul(this)},Q.prototype.isqr=function(){return this.imul(this.clone())},Q.prototype.pow=function(U){var A=P(U);if(A.length===0)return new Q(1);var X=this;for(var Z=0;Z<A.length;Z++,X=X.sqr())if(A[Z]!==0)break;if(++Z<A.length)for(var C=X.sqr();Z<A.length;Z++,C=C.sqr()){if(A[Z]===0)continue;X=X.mul(C)}return X},Q.prototype.iushln=function(U){S(typeof U==="number"&&U>=0);var A=U%26,X=(U-A)/26,Z=67108863>>>26-A<<26-A,C;if(A!==0){var Y=0;for(C=0;C<this.length;C++){var V=this.words[C]&Z,G=(this.words[C]|0)-V<<A;this.words[C]=G|Y,Y=V>>>26-A}if(Y)this.words[C]=Y,this.length++}if(X!==0){for(C=this.length-1;C>=0;C--)this.words[C+X]=this.words[C];for(C=0;C<X;C++)this.words[C]=0;this.length+=X}return this.strip()},Q.prototype.ishln=function(U){return S(this.negative===0),this.iushln(U)},Q.prototype.iushrn=function(U,A,X){S(typeof U==="number"&&U>=0);var Z;if(A)Z=(A-A%26)/26;else Z=0;var C=U%26,Y=Math.min((U-C)/26,this.length),V=67108863^67108863>>>C<<C,G=X;if(Z-=Y,Z=Math.max(0,Z),G){for(var O=0;O<Y;O++)G.words[O]=this.words[O];G.length=Y}if(Y===0);else if(this.length>Y){this.length-=Y;for(O=0;O<this.length;O++)this.words[O]=this.words[O+Y]}else this.words[0]=0,this.length=1;var J=0;for(O=this.length-1;O>=0&&(J!==0||O>=Z);O--){var z=this.words[O]|0;this.words[O]=J<<26-C|z>>>C,J=z&V}if(G&&J!==0)G.words[G.length++]=J;if(this.length===0)this.words[0]=0,this.length=1;return this.strip()},Q.prototype.ishrn=function(U,A,X){return S(this.negative===0),this.iushrn(U,A,X)},Q.prototype.shln=function(U){return this.clone().ishln(U)},Q.prototype.ushln=function(U){return this.clone().iushln(U)},Q.prototype.shrn=function(U){return this.clone().ishrn(U)},Q.prototype.ushrn=function(U){return this.clone().iushrn(U)},Q.prototype.testn=function(U){S(typeof U==="number"&&U>=0);var A=U%26,X=(U-A)/26,Z=1<<A;if(this.length<=X)return!1;var C=this.words[X];return!!(C&Z)},Q.prototype.imaskn=function(U){S(typeof U==="number"&&U>=0);var A=U%26,X=(U-A)/26;if(S(this.negative===0,"imaskn works only with positive numbers"),this.length<=X)return this;if(A!==0)X++;if(this.length=Math.min(X,this.length),A!==0){var Z=67108863^67108863>>>A<<A;this.words[this.length-1]&=Z}return this.strip()},Q.prototype.maskn=function(U){return this.clone().imaskn(U)},Q.prototype.iaddn=function(U){if(S(typeof U==="number"),S(U<67108864),U<0)return this.isubn(-U);if(this.negative!==0){if(this.length===1&&(this.words[0]|0)<U)return this.words[0]=U-(this.words[0]|0),this.negative=0,this;return this.negative=0,this.isubn(U),this.negative=1,this}return this._iaddn(U)},Q.prototype._iaddn=function(U){this.words[0]+=U;for(var A=0;A<this.length&&this.words[A]>=67108864;A++)if(this.words[A]-=67108864,A===this.length-1)this.words[A+1]=1;else this.words[A+1]++;return this.length=Math.max(this.length,A+1),this},Q.prototype.isubn=function(U){if(S(typeof U==="number"),S(U<67108864),U<0)return this.iaddn(-U);if(this.negative!==0)return this.negative=0,this.iaddn(U),this.negative=1,this;if(this.words[0]-=U,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var A=0;A<this.length&&this.words[A]<0;A++)this.words[A]+=67108864,this.words[A+1]-=1;return this.strip()},Q.prototype.addn=function(U){return this.clone().iaddn(U)},Q.prototype.subn=function(U){return this.clone().isubn(U)},Q.prototype.iabs=function(){return this.negative=0,this},Q.prototype.abs=function(){return this.clone().iabs()},Q.prototype._ishlnsubmul=function(U,A,X){var Z=U.length+X,C;this._expand(Z);var Y,V=0;for(C=0;C<U.length;C++){Y=(this.words[C+X]|0)+V;var G=(U.words[C]|0)*A;Y-=G&67108863,V=(Y>>26)-(G/67108864|0),this.words[C+X]=Y&67108863}for(;C<this.length-X;C++)Y=(this.words[C+X]|0)+V,V=Y>>26,this.words[C+X]=Y&67108863;if(V===0)return this.strip();S(V===-1),V=0;for(C=0;C<this.length;C++)Y=-(this.words[C]|0)+V,V=Y>>26,this.words[C]=Y&67108863;return this.negative=1,this.strip()},Q.prototype._wordDiv=function(U,A){var X=this.length-U.length,Z=this.clone(),C=U,Y=C.words[C.length-1]|0,V=this._countBits(Y);if(X=26-V,X!==0)C=C.ushln(X),Z.iushln(X),Y=C.words[C.length-1]|0;var G=Z.length-C.length,O;if(A!=="mod"){O=new Q(null),O.length=G+1,O.words=Array(O.length);for(var J=0;J<O.length;J++)O.words[J]=0}var z=Z.clone()._ishlnsubmul(C,1,G);if(z.negative===0){if(Z=z,O)O.words[G]=1}for(var W=G-1;W>=0;W--){var j=(Z.words[C.length+W]|0)*67108864+(Z.words[C.length+W-1]|0);j=Math.min(j/Y|0,67108863),Z._ishlnsubmul(C,j,W);while(Z.negative!==0)if(j--,Z.negative=0,Z._ishlnsubmul(C,1,W),!Z.isZero())Z.negative^=1;if(O)O.words[W]=j}if(O)O.strip();if(Z.strip(),A!=="div"&&X!==0)Z.iushrn(X);return{div:O||null,mod:Z}},Q.prototype.divmod=function(U,A,X){if(S(!U.isZero()),this.isZero())return{div:new Q(0),mod:new Q(0)};var Z,C,Y;if(this.negative!==0&&U.negative===0){if(Y=this.neg().divmod(U,A),A!=="mod")Z=Y.div.neg();if(A!=="div"){if(C=Y.mod.neg(),X&&C.negative!==0)C.iadd(U)}return{div:Z,mod:C}}if(this.negative===0&&U.negative!==0){if(Y=this.divmod(U.neg(),A),A!=="mod")Z=Y.div.neg();return{div:Z,mod:Y.mod}}if((this.negative&U.negative)!==0){if(Y=this.neg().divmod(U.neg(),A),A!=="div"){if(C=Y.mod.neg(),X&&C.negative!==0)C.isub(U)}return{div:Y.div,mod:C}}if(U.length>this.length||this.cmp(U)<0)return{div:new Q(0),mod:this};if(U.length===1){if(A==="div")return{div:this.divn(U.words[0]),mod:null};if(A==="mod")return{div:null,mod:new Q(this.modn(U.words[0]))};return{div:this.divn(U.words[0]),mod:new Q(this.modn(U.words[0]))}}return this._wordDiv(U,A)},Q.prototype.div=function(U){return this.divmod(U,"div",!1).div},Q.prototype.mod=function(U){return this.divmod(U,"mod",!1).mod},Q.prototype.umod=function(U){return this.divmod(U,"mod",!0).mod},Q.prototype.divRound=function(U){var A=this.divmod(U);if(A.mod.isZero())return A.div;var X=A.div.negative!==0?A.mod.isub(U):A.mod,Z=U.ushrn(1),C=U.andln(1),Y=X.cmp(Z);if(Y<0||C===1&&Y===0)return A.div;return A.div.negative!==0?A.div.isubn(1):A.div.iaddn(1)},Q.prototype.modn=function(U){S(U<=67108863);var A=67108864%U,X=0;for(var Z=this.length-1;Z>=0;Z--)X=(A*X+(this.words[Z]|0))%U;return X},Q.prototype.idivn=function(U){S(U<=67108863);var A=0;for(var X=this.length-1;X>=0;X--){var Z=(this.words[X]|0)+A*67108864;this.words[X]=Z/U|0,A=Z%U}return this.strip()},Q.prototype.divn=function(U){return this.clone().idivn(U)},Q.prototype.egcd=function(U){S(U.negative===0),S(!U.isZero());var A=this,X=U.clone();if(A.negative!==0)A=A.umod(U);else A=A.clone();var Z=new Q(1),C=new Q(0),Y=new Q(0),V=new Q(1),G=0;while(A.isEven()&&X.isEven())A.iushrn(1),X.iushrn(1),++G;var O=X.clone(),J=A.clone();while(!A.isZero()){for(var z=0,W=1;(A.words[0]&W)===0&&z<26;++z,W<<=1);if(z>0){A.iushrn(z);while(z-- >0){if(Z.isOdd()||C.isOdd())Z.iadd(O),C.isub(J);Z.iushrn(1),C.iushrn(1)}}for(var j=0,N=1;(X.words[0]&N)===0&&j<26;++j,N<<=1);if(j>0){X.iushrn(j);while(j-- >0){if(Y.isOdd()||V.isOdd())Y.iadd(O),V.isub(J);Y.iushrn(1),V.iushrn(1)}}if(A.cmp(X)>=0)A.isub(X),Z.isub(Y),C.isub(V);else X.isub(A),Y.isub(Z),V.isub(C)}return{a:Y,b:V,gcd:X.iushln(G)}},Q.prototype._invmp=function(U){S(U.negative===0),S(!U.isZero());var A=this,X=U.clone();if(A.negative!==0)A=A.umod(U);else A=A.clone();var Z=new Q(1),C=new Q(0),Y=X.clone();while(A.cmpn(1)>0&&X.cmpn(1)>0){for(var V=0,G=1;(A.words[0]&G)===0&&V<26;++V,G<<=1);if(V>0){A.iushrn(V);while(V-- >0){if(Z.isOdd())Z.iadd(Y);Z.iushrn(1)}}for(var O=0,J=1;(X.words[0]&J)===0&&O<26;++O,J<<=1);if(O>0){X.iushrn(O);while(O-- >0){if(C.isOdd())C.iadd(Y);C.iushrn(1)}}if(A.cmp(X)>=0)A.isub(X),Z.isub(C);else X.isub(A),C.isub(Z)}var z;if(A.cmpn(1)===0)z=Z;else z=C;if(z.cmpn(0)<0)z.iadd(U);return z},Q.prototype.gcd=function(U){if(this.isZero())return U.abs();if(U.isZero())return this.abs();var A=this.clone(),X=U.clone();A.negative=0,X.negative=0;for(var Z=0;A.isEven()&&X.isEven();Z++)A.iushrn(1),X.iushrn(1);do{while(A.isEven())A.iushrn(1);while(X.isEven())X.iushrn(1);var C=A.cmp(X);if(C<0){var Y=A;A=X,X=Y}else if(C===0||X.cmpn(1)===0)break;A.isub(X)}while(!0);return X.iushln(Z)},Q.prototype.invm=function(U){return this.egcd(U).a.umod(U)},Q.prototype.isEven=function(){return(this.words[0]&1)===0},Q.prototype.isOdd=function(){return(this.words[0]&1)===1},Q.prototype.andln=function(U){return this.words[0]&U},Q.prototype.bincn=function(U){S(typeof U==="number");var A=U%26,X=(U-A)/26,Z=1<<A;if(this.length<=X)return this._expand(X+1),this.words[X]|=Z,this;var C=Z;for(var Y=X;C!==0&&Y<this.length;Y++){var V=this.words[Y]|0;V+=C,C=V>>>26,V&=67108863,this.words[Y]=V}if(C!==0)this.words[Y]=C,this.length++;return this},Q.prototype.isZero=function(){return this.length===1&&this.words[0]===0},Q.prototype.cmpn=function(U){var A=U<0;if(this.negative!==0&&!A)return-1;if(this.negative===0&&A)return 1;this.strip();var X;if(this.length>1)X=1;else{if(A)U=-U;S(U<=67108863,"Number is too big");var Z=this.words[0]|0;X=Z===U?0:Z<U?-1:1}if(this.negative!==0)return-X|0;return X},Q.prototype.cmp=function(U){if(this.negative!==0&&U.negative===0)return-1;if(this.negative===0&&U.negative!==0)return 1;var A=this.ucmp(U);if(this.negative!==0)return-A|0;return A},Q.prototype.ucmp=function(U){if(this.length>U.length)return 1;if(this.length<U.length)return-1;var A=0;for(var X=this.length-1;X>=0;X--){var Z=this.words[X]|0,C=U.words[X]|0;if(Z===C)continue;if(Z<C)A=-1;else if(Z>C)A=1;break}return A},Q.prototype.gtn=function(U){return this.cmpn(U)===1},Q.prototype.gt=function(U){return this.cmp(U)===1},Q.prototype.gten=function(U){return this.cmpn(U)>=0},Q.prototype.gte=function(U){return this.cmp(U)>=0},Q.prototype.ltn=function(U){return this.cmpn(U)===-1},Q.prototype.lt=function(U){return this.cmp(U)===-1},Q.prototype.lten=function(U){return this.cmpn(U)<=0},Q.prototype.lte=function(U){return this.cmp(U)<=0},Q.prototype.eqn=function(U){return this.cmpn(U)===0},Q.prototype.eq=function(U){return this.cmp(U)===0},Q.red=function(U){return new u(U)},Q.prototype.toRed=function(U){return S(!this.red,"Already a number in reduction context"),S(this.negative===0,"red works only with positives"),U.convertTo(this)._forceRed(U)},Q.prototype.fromRed=function(){return S(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},Q.prototype._forceRed=function(U){return this.red=U,this},Q.prototype.forceRed=function(U){return S(!this.red,"Already a number in reduction context"),this._forceRed(U)},Q.prototype.redAdd=function(U){return S(this.red,"redAdd works only with red numbers"),this.red.add(this,U)},Q.prototype.redIAdd=function(U){return S(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,U)},Q.prototype.redSub=function(U){return S(this.red,"redSub works only with red numbers"),this.red.sub(this,U)},Q.prototype.redISub=function(U){return S(this.red,"redISub works only with red numbers"),this.red.isub(this,U)},Q.prototype.redShl=function(U){return S(this.red,"redShl works only with red numbers"),this.red.shl(this,U)},Q.prototype.redMul=function(U){return S(this.red,"redMul works only with red numbers"),this.red._verify2(this,U),this.red.mul(this,U)},Q.prototype.redIMul=function(U){return S(this.red,"redMul works only with red numbers"),this.red._verify2(this,U),this.red.imul(this,U)},Q.prototype.redSqr=function(){return S(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},Q.prototype.redISqr=function(){return S(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},Q.prototype.redSqrt=function(){return S(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},Q.prototype.redInvm=function(){return S(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},Q.prototype.redNeg=function(){return S(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},Q.prototype.redPow=function(U){return S(this.red&&!U.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,U)};var f={k256:null,p224:null,p192:null,p25519:null};function w(U,A){this.name=U,this.p=new Q(A,16),this.n=this.p.bitLength(),this.k=new Q(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}w.prototype._tmp=function(){var U=new Q(null);return U.words=Array(Math.ceil(this.n/13)),U},w.prototype.ireduce=function(U){var A=U,X;do this.split(A,this.tmp),A=this.imulK(A),A=A.iadd(this.tmp),X=A.bitLength();while(X>this.n);var Z=X<this.n?-1:A.ucmp(this.p);if(Z===0)A.words[0]=0,A.length=1;else if(Z>0)A.isub(this.p);else if(A.strip!==void 0)A.strip();else A._strip();return A},w.prototype.split=function(U,A){U.iushrn(this.n,0,A)},w.prototype.imulK=function(U){return U.imul(this.k)};function b(){w.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}K(b,w),b.prototype.split=function(U,A){var X=4194303,Z=Math.min(U.length,9);for(var C=0;C<Z;C++)A.words[C]=U.words[C];if(A.length=Z,U.length<=9){U.words[0]=0,U.length=1;return}var Y=U.words[9];A.words[A.length++]=Y&X;for(C=10;C<U.length;C++){var V=U.words[C]|0;U.words[C-10]=(V&X)<<4|Y>>>22,Y=V}if(Y>>>=22,U.words[C-10]=Y,Y===0&&U.length>10)U.length-=10;else U.length-=9},b.prototype.imulK=function(U){U.words[U.length]=0,U.words[U.length+1]=0,U.length+=2;var A=0;for(var X=0;X<U.length;X++){var Z=U.words[X]|0;A+=Z*977,U.words[X]=A&67108863,A=Z*64+(A/67108864|0)}if(U.words[U.length-1]===0){if(U.length--,U.words[U.length-1]===0)U.length--}return U};function I0(){w.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}K(I0,w);function X0(){w.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}K(X0,w);function C0(){w.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}K(C0,w),C0.prototype.imulK=function(U){var A=0;for(var X=0;X<U.length;X++){var Z=(U.words[X]|0)*19+A,C=Z&67108863;Z>>>=26,U.words[X]=C,A=Z}if(A!==0)U.words[U.length++]=A;return U},Q._prime=function(U){if(f[U])return f[U];var A;if(U==="k256")A=new b;else if(U==="p224")A=new I0;else if(U==="p192")A=new X0;else if(U==="p25519")A=new C0;else throw Error("Unknown prime "+U);return f[U]=A,A};function u(U){if(typeof U==="string"){var A=Q._prime(U);this.m=A.p,this.prime=A}else S(U.gtn(1),"modulus must be greater than 1"),this.m=U,this.prime=null}u.prototype._verify1=function(U){S(U.negative===0,"red works only with positives"),S(U.red,"red works only with red numbers")},u.prototype._verify2=function(U,A){S((U.negative|A.negative)===0,"red works only with positives"),S(U.red&&U.red===A.red,"red works only with red numbers")},u.prototype.imod=function(U){if(this.prime)return this.prime.ireduce(U)._forceRed(this);return U.umod(this.m)._forceRed(this)},u.prototype.neg=function(U){if(U.isZero())return U.clone();return this.m.sub(U)._forceRed(this)},u.prototype.add=function(U,A){this._verify2(U,A);var X=U.add(A);if(X.cmp(this.m)>=0)X.isub(this.m);return X._forceRed(this)},u.prototype.iadd=function(U,A){this._verify2(U,A);var X=U.iadd(A);if(X.cmp(this.m)>=0)X.isub(this.m);return X},u.prototype.sub=function(U,A){this._verify2(U,A);var X=U.sub(A);if(X.cmpn(0)<0)X.iadd(this.m);return X._forceRed(this)},u.prototype.isub=function(U,A){this._verify2(U,A);var X=U.isub(A);if(X.cmpn(0)<0)X.iadd(this.m);return X},u.prototype.shl=function(U,A){return this._verify1(U),this.imod(U.ushln(A))},u.prototype.imul=function(U,A){return this._verify2(U,A),this.imod(U.imul(A))},u.prototype.mul=function(U,A){return this._verify2(U,A),this.imod(U.mul(A))},u.prototype.isqr=function(U){return this.imul(U,U.clone())},u.prototype.sqr=function(U){return this.mul(U,U)},u.prototype.sqrt=function(U){if(U.isZero())return U.clone();var A=this.m.andln(3);if(S(A%2===1),A===3){var X=this.m.add(new Q(1)).iushrn(2);return this.pow(U,X)}var Z=this.m.subn(1),C=0;while(!Z.isZero()&&Z.andln(1)===0)C++,Z.iushrn(1);S(!Z.isZero());var Y=new Q(1).toRed(this),V=Y.redNeg(),G=this.m.subn(1).iushrn(1),O=this.m.bitLength();O=new Q(2*O*O).toRed(this);while(this.pow(O,G).cmp(V)!==0)O.redIAdd(V);var J=this.pow(O,Z),z=this.pow(U,Z.addn(1).iushrn(1)),W=this.pow(U,Z),j=C;while(W.cmp(Y)!==0){var N=W;for(var p=0;N.cmp(Y)!==0;p++)N=N.redSqr();S(p<j);var n=this.pow(J,new Q(1).iushln(j-p-1));z=z.redMul(n),J=n.redSqr(),W=W.redMul(J),j=p}return z},u.prototype.invm=function(U){var A=U._invmp(this.m);if(A.negative!==0)return A.negative=0,this.imod(A).redNeg();else return this.imod(A)},u.prototype.pow=function(U,A){if(A.isZero())return new Q(1).toRed(this);if(A.cmpn(1)===0)return U.clone();var X=4,Z=Array(1<<X);Z[0]=new Q(1).toRed(this),Z[1]=U;for(var C=2;C<Z.length;C++)Z[C]=this.mul(Z[C-1],U);var Y=Z[0],V=0,G=0,O=A.bitLength()%26;if(O===0)O=26;for(C=A.length-1;C>=0;C--){var J=A.words[C];for(var z=O-1;z>=0;z--){var W=J>>z&1;if(Y!==Z[0])Y=this.sqr(Y);if(W===0&&V===0){G=0;continue}if(V<<=1,V|=W,G++,G!==X&&(C!==0||z!==0))continue;Y=this.mul(Y,Z[V]),G=0,V=0}O=26}return Y},u.prototype.convertTo=function(U){var A=U.umod(this.m);return A===U?A.clone():A},u.prototype.convertFrom=function(U){var A=U.clone();return A.red=null,A},Q.mont=function(U){return new O0(U)};function O0(U){if(u.call(this,U),this.shift=this.m.bitLength(),this.shift%26!==0)this.shift+=26-this.shift%26;this.r=new Q(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}K(O0,u),O0.prototype.convertTo=function(U){return this.imod(U.ushln(this.shift))},O0.prototype.convertFrom=function(U){var A=this.imod(U.mul(this.rinv));return A.red=null,A},O0.prototype.imul=function(U,A){if(U.isZero()||A.isZero())return U.words[0]=0,U.length=1,U;var X=U.imul(A),Z=X.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),C=X.isub(Z).iushrn(this.shift),Y=C;if(C.cmp(this.m)>=0)Y=C.isub(this.m);else if(C.cmpn(0)<0)Y=C.iadd(this.m);return Y._forceRed(this)},O0.prototype.mul=function(U,A){if(U.isZero()||A.isZero())return new Q(0)._forceRed(this);var X=U.mul(A),Z=X.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),C=X.isub(Z).iushrn(this.shift),Y=C;if(C.cmp(this.m)>=0)Y=C.isub(this.m);else if(C.cmpn(0)<0)Y=C.iadd(this.m);return Y._forceRed(this)},O0.prototype.invm=function(U){var A=this.imod(U._invmp(this.m).mul(this.r2));return A._forceRed(this)}})(typeof I>"u"||I,$)}),UO=Q0(($,I)=>{I.exports=E;function E(L,S){if(!L)throw Error(S||"Assertion failed")}E.equal=function(L,S,K){if(L!=S)throw Error(K||"Assertion failed: "+L+" != "+S)}}),bI=Q0(($)=>{var I=$;function E(K,Q){if(Array.isArray(K))return K.slice();if(!K)return[];var T=[];if(typeof K!=="string"){for(var M=0;M<K.length;M++)T[M]=K[M]|0;return T}if(Q==="hex"){if(K=K.replace(/[^a-z0-9]+/ig,""),K.length%2!==0)K="0"+K;for(var M=0;M<K.length;M+=2)T.push(parseInt(K[M]+K[M+1],16))}else for(var M=0;M<K.length;M++){var H=K.charCodeAt(M),F=H>>8,R=H&255;if(F)T.push(F,R);else T.push(R)}return T}I.toArray=E;function L(K){if(K.length===1)return"0"+K;else return K}I.zero2=L;function S(K){var Q="";for(var T=0;T<K.length;T++)Q+=L(K[T].toString(16));return Q}I.toHex=S,I.encode=function(K,Q){if(Q==="hex")return S(K);else return K}}),wU=Q0(($)=>{var I=$,E=sU(),L=UO(),S=bI();I.assert=L,I.toArray=S.toArray,I.zero2=S.zero2,I.toHex=S.toHex,I.encode=S.encode;function K(F,R,D){var q=Array(Math.max(F.bitLength(),D)+1),P;for(P=0;P<q.length;P+=1)q[P]=0;var _=1<<R+1,k=F.clone();for(P=0;P<q.length;P++){var B,v=k.andln(_-1);if(k.isOdd()){if(v>(_>>1)-1)B=(_>>1)-v;else B=v;k.isubn(B)}else B=0;q[P]=B,k.iushrn(1)}return q}I.getNAF=K;function Q(F,R){var D=[[],[]];F=F.clone(),R=R.clone();var q=0,P=0,_;while(F.cmpn(-q)>0||R.cmpn(-P)>0){var k=F.andln(3)+q&3,B=R.andln(3)+P&3;if(k===3)k=-1;if(B===3)B=-1;var v;if((k&1)===0)v=0;else if(_=F.andln(7)+q&7,(_===3||_===5)&&B===2)v=-k;else v=k;D[0].push(v);var g;if((B&1)===0)g=0;else if(_=R.andln(7)+P&7,(_===3||_===5)&&k===2)g=-B;else g=B;if(D[1].push(g),2*q===v+1)q=1-q;if(2*P===g+1)P=1-P;F.iushrn(1),R.iushrn(1)}return D}I.getJSF=Q;function T(F,R,D){var q="_"+R;F.prototype[R]=function(){return this[q]!==void 0?this[q]:this[q]=D.call(this)}}I.cachedProperty=T;function M(F){return typeof F==="string"?I.toArray(F,"hex"):F}I.parseBytes=M;function H(F){return new E(F,"hex","le")}I.intFromLE=H}),oI=Q0(($,I)=>{var E;I.exports=function(K){if(!E)E=new L(null);return E.generate(K)};function L(K){this.rand=K}if(I.exports.Rand=L,L.prototype.generate=function(K){return this._rand(K)},L.prototype._rand=function(K){if(this.rand.getBytes)return this.rand.getBytes(K);var Q=new Uint8Array(K);for(var T=0;T<Q.length;T++)Q[T]=this.rand.getByte();return Q},typeof self==="object"){if(self.crypto&&self.crypto.getRandomValues)L.prototype._rand=function(K){var Q=new Uint8Array(K);return self.crypto.getRandomValues(Q),Q};else if(self.msCrypto&&self.msCrypto.getRandomValues)L.prototype._rand=function(K){var Q=new Uint8Array(K);return self.msCrypto.getRandomValues(Q),Q};else if(typeof window==="object")L.prototype._rand=function(){throw Error("Not implemented yet")}}else try{if(S=(vU(),l0(jU)),typeof S.randomBytes!=="function")throw Error("Not supported");L.prototype._rand=function(K){return S.randomBytes(K)}}catch(K){}var S}),JZ=Q0(($,I)=>{var E=sU(),L=wU(),S=L.getNAF,K=L.getJSF,Q=L.assert;function T(H,F){this.type=H,this.p=new E(F.p,16),this.red=F.prime?E.red(F.prime):E.mont(this.p),this.zero=new E(0).toRed(this.red),this.one=new E(1).toRed(this.red),this.two=new E(2).toRed(this.red),this.n=F.n&&new E(F.n,16),this.g=F.g&&this.pointFromJSON(F.g,F.gRed),this._wnafT1=[,,,,],this._wnafT2=[,,,,],this._wnafT3=[,,,,],this._wnafT4=[,,,,],this._bitLength=this.n?this.n.bitLength():0;var R=this.n&&this.p.div(this.n);if(!R||R.cmpn(100)>0)this.redN=null;else this._maxwellTrick=!0,this.redN=this.n.toRed(this.red)}I.exports=T,T.prototype.point=function(){throw Error("Not implemented")},T.prototype.validate=function(){throw Error("Not implemented")},T.prototype._fixedNafMul=function(H,F){Q(H.precomputed);var R=H._getDoubles(),D=S(F,1,this._bitLength),q=(1<<R.step+1)-(R.step%2===0?2:1);q/=3;var P=[],_,k;for(_=0;_<D.length;_+=R.step){k=0;for(var B=_+R.step-1;B>=_;B--)k=(k<<1)+D[B];P.push(k)}var v=this.jpoint(null,null,null),g=this.jpoint(null,null,null);for(var f=q;f>0;f--){for(_=0;_<P.length;_++)if(k=P[_],k===f)g=g.mixedAdd(R.points[_]);else if(k===-f)g=g.mixedAdd(R.points[_].neg());v=v.add(g)}return v.toP()},T.prototype._wnafMul=function(H,F){var R=4,D=H._getNAFPoints(R);R=D.wnd;var q=D.points,P=S(F,R,this._bitLength),_=this.jpoint(null,null,null);for(var k=P.length-1;k>=0;k--){for(var B=0;k>=0&&P[k]===0;k--)B++;if(k>=0)B++;if(_=_.dblp(B),k<0)break;var v=P[k];if(Q(v!==0),H.type==="affine")if(v>0)_=_.mixedAdd(q[v-1>>1]);else _=_.mixedAdd(q[-v-1>>1].neg());else if(v>0)_=_.add(q[v-1>>1]);else _=_.add(q[-v-1>>1].neg())}return H.type==="affine"?_.toP():_},T.prototype._wnafMulAdd=function(H,F,R,D,q){var P=this._wnafT1,_=this._wnafT2,k=this._wnafT3,B=0,v,g,f;for(v=0;v<D;v++){f=F[v];var w=f._getNAFPoints(H);P[v]=w.wnd,_[v]=w.points}for(v=D-1;v>=1;v-=2){var b=v-1,I0=v;if(P[b]!==1||P[I0]!==1){k[b]=S(R[b],P[b],this._bitLength),k[I0]=S(R[I0],P[I0],this._bitLength),B=Math.max(k[b].length,B),B=Math.max(k[I0].length,B);continue}var X0=[F[b],null,null,F[I0]];if(F[b].y.cmp(F[I0].y)===0)X0[1]=F[b].add(F[I0]),X0[2]=F[b].toJ().mixedAdd(F[I0].neg());else if(F[b].y.cmp(F[I0].y.redNeg())===0)X0[1]=F[b].toJ().mixedAdd(F[I0]),X0[2]=F[b].add(F[I0].neg());else X0[1]=F[b].toJ().mixedAdd(F[I0]),X0[2]=F[b].toJ().mixedAdd(F[I0].neg());var C0=[-3,-1,-5,-7,0,7,5,1,3],u=K(R[b],R[I0]);B=Math.max(u[0].length,B),k[b]=Array(B),k[I0]=Array(B);for(g=0;g<B;g++){var O0=u[0][g]|0,U=u[1][g]|0;k[b][g]=C0[(O0+1)*3+(U+1)],k[I0][g]=0,_[b]=X0}}var A=this.jpoint(null,null,null),X=this._wnafT4;for(v=B;v>=0;v--){var Z=0;while(v>=0){var C=!0;for(g=0;g<D;g++)if(X[g]=k[g][v]|0,X[g]!==0)C=!1;if(!C)break;Z++,v--}if(v>=0)Z++;if(A=A.dblp(Z),v<0)break;for(g=0;g<D;g++){var Y=X[g];if(Y===0)continue;else if(Y>0)f=_[g][Y-1>>1];else if(Y<0)f=_[g][-Y-1>>1].neg();if(f.type==="affine")A=A.mixedAdd(f);else A=A.add(f)}}for(v=0;v<D;v++)_[v]=null;if(q)return A;else return A.toP()};function M(H,F){this.curve=H,this.type=F,this.precomputed=null}T.BasePoint=M,M.prototype.eq=function(){throw Error("Not implemented")},M.prototype.validate=function(){return this.curve.validate(this)},T.prototype.decodePoint=function(H,F){H=L.toArray(H,F);var R=this.p.byteLength();if((H[0]===4||H[0]===6||H[0]===7)&&H.length-1===2*R){if(H[0]===6)Q(H[H.length-1]%2===0);else if(H[0]===7)Q(H[H.length-1]%2===1);var D=this.point(H.slice(1,1+R),H.slice(1+R,1+2*R));return D}else if((H[0]===2||H[0]===3)&&H.length-1===R)return this.pointFromX(H.slice(1,1+R),H[0]===3);throw Error("Unknown point format")},M.prototype.encodeCompressed=function(H){return this.encode(H,!0)},M.prototype._encode=function(H){var F=this.curve.p.byteLength(),R=this.getX().toArray("be",F);if(H)return[this.getY().isEven()?2:3].concat(R);return[4].concat(R,this.getY().toArray("be",F))},M.prototype.encode=function(H,F){return L.encode(this._encode(F),H)},M.prototype.precompute=function(H){if(this.precomputed)return this;var F={doubles:null,naf:null,beta:null};return F.naf=this._getNAFPoints(8),F.doubles=this._getDoubles(4,H),F.beta=this._getBeta(),this.precomputed=F,this},M.prototype._hasDoubles=function(H){if(!this.precomputed)return!1;var F=this.precomputed.doubles;if(!F)return!1;return F.points.length>=Math.ceil((H.bitLength()+1)/F.step)},M.prototype._getDoubles=function(H,F){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;var R=[this],D=this;for(var q=0;q<F;q+=H){for(var P=0;P<H;P++)D=D.dbl();R.push(D)}return{step:H,points:R}},M.prototype._getNAFPoints=function(H){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;var F=[this],R=(1<<H)-1,D=R===1?null:this.dbl();for(var q=1;q<R;q++)F[q]=F[q-1].add(D);return{wnd:H,points:F}},M.prototype._getBeta=function(){return null},M.prototype.dblp=function(H){var F=this;for(var R=0;R<H;R++)F=F.dbl();return F}}),kG=Q0(($,I)=>{if(typeof Object.create==="function")I.exports=function(E,L){if(L)E.super_=L,E.prototype=Object.create(L.prototype,{constructor:{value:E,enumerable:!1,writable:!0,configurable:!0}})};else I.exports=function(E,L){if(L){E.super_=L;var S=function(){};S.prototype=L.prototype,E.prototype=new S,E.prototype.constructor=E}}}),gU=Q0(($,I)=>{try{if(E=(jI(),l0(_I)),typeof E.inherits!=="function")throw"";I.exports=E.inherits}catch(L){I.exports=kG()}var E}),_G=Q0(($,I)=>{var E=wU(),L=sU(),S=gU(),K=JZ(),Q=E.assert;function T(F){K.call(this,"short",F),this.a=new L(F.a,16).toRed(this.red),this.b=new L(F.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(F),this._endoWnafT1=[,,,,],this._endoWnafT2=[,,,,]}S(T,K),I.exports=T,T.prototype._getEndomorphism=function(F){if(!this.zeroA||!this.g||!this.n||this.p.modn(3)!==1)return;var R,D;if(F.beta)R=new L(F.beta,16).toRed(this.red);else{var q=this._getEndoRoots(this.p);R=q[0].cmp(q[1])<0?q[0]:q[1],R=R.toRed(this.red)}if(F.lambda)D=new L(F.lambda,16);else{var P=this._getEndoRoots(this.n);if(this.g.mul(P[0]).x.cmp(this.g.x.redMul(R))===0)D=P[0];else D=P[1],Q(this.g.mul(D).x.cmp(this.g.x.redMul(R))===0)}var _;if(F.basis)_=F.basis.map(function(k){return{a:new L(k.a,16),b:new L(k.b,16)}});else _=this._getEndoBasis(D);return{beta:R,lambda:D,basis:_}},T.prototype._getEndoRoots=function(F){var R=F===this.p?this.red:L.mont(F),D=new L(2).toRed(R).redInvm(),q=D.redNeg(),P=new L(3).toRed(R).redNeg().redSqrt().redMul(D),_=q.redAdd(P).fromRed(),k=q.redSub(P).fromRed();return[_,k]},T.prototype._getEndoBasis=function(F){var R=this.n.ushrn(Math.floor(this.n.bitLength()/2)),D=F,q=this.n.clone(),P=new L(1),_=new L(0),k=new L(0),B=new L(1),v,g,f,w,b,I0,X0,C0=0,u,O0;while(D.cmpn(0)!==0){var U=q.div(D);u=q.sub(U.mul(D)),O0=k.sub(U.mul(P));var A=B.sub(U.mul(_));if(!f&&u.cmp(R)<0)v=X0.neg(),g=P,f=u.neg(),w=O0;else if(f&&++C0===2)break;X0=u,q=D,D=u,k=P,P=O0,B=_,_=A}b=u.neg(),I0=O0;var X=f.sqr().add(w.sqr()),Z=b.sqr().add(I0.sqr());if(Z.cmp(X)>=0)b=v,I0=g;if(f.negative)f=f.neg(),w=w.neg();if(b.negative)b=b.neg(),I0=I0.neg();return[{a:f,b:w},{a:b,b:I0}]},T.prototype._endoSplit=function(F){var R=this.endo.basis,D=R[0],q=R[1],P=q.b.mul(F).divRound(this.n),_=D.b.neg().mul(F).divRound(this.n),k=P.mul(D.a),B=_.mul(q.a),v=P.mul(D.b),g=_.mul(q.b),f=F.sub(k).sub(B),w=v.add(g).neg();return{k1:f,k2:w}},T.prototype.pointFromX=function(F,R){if(F=new L(F,16),!F.red)F=F.toRed(this.red);var D=F.redSqr().redMul(F).redIAdd(F.redMul(this.a)).redIAdd(this.b),q=D.redSqrt();if(q.redSqr().redSub(D).cmp(this.zero)!==0)throw Error("invalid point");var P=q.fromRed().isOdd();if(R&&!P||!R&&P)q=q.redNeg();return this.point(F,q)},T.prototype.validate=function(F){if(F.inf)return!0;var{x:R,y:D}=F,q=this.a.redMul(R),P=R.redSqr().redMul(R).redIAdd(q).redIAdd(this.b);return D.redSqr().redISub(P).cmpn(0)===0},T.prototype._endoWnafMulAdd=function(F,R,D){var q=this._endoWnafT1,P=this._endoWnafT2;for(var _=0;_<F.length;_++){var k=this._endoSplit(R[_]),B=F[_],v=B._getBeta();if(k.k1.negative)k.k1.ineg(),B=B.neg(!0);if(k.k2.negative)k.k2.ineg(),v=v.neg(!0);q[_*2]=B,q[_*2+1]=v,P[_*2]=k.k1,P[_*2+1]=k.k2}var g=this._wnafMulAdd(1,q,P,_*2,D);for(var f=0;f<_*2;f++)q[f]=null,P[f]=null;return g};function M(F,R,D,q){if(K.BasePoint.call(this,F,"affine"),R===null&&D===null)this.x=null,this.y=null,this.inf=!0;else{if(this.x=new L(R,16),this.y=new L(D,16),q)this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red);if(!this.x.red)this.x=this.x.toRed(this.curve.red);if(!this.y.red)this.y=this.y.toRed(this.curve.red);this.inf=!1}}S(M,K.BasePoint),T.prototype.point=function(F,R,D){return new M(this,F,R,D)},T.prototype.pointFromJSON=function(F,R){return M.fromJSON(this,F,R)},M.prototype._getBeta=function(){if(!this.curve.endo)return;var F=this.precomputed;if(F&&F.beta)return F.beta;var R=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(F){var D=this.curve,q=function(P){return D.point(P.x.redMul(D.endo.beta),P.y)};F.beta=R,R.precomputed={beta:null,naf:F.naf&&{wnd:F.naf.wnd,points:F.naf.points.map(q)},doubles:F.doubles&&{step:F.doubles.step,points:F.doubles.points.map(q)}}}return R},M.prototype.toJSON=function(){if(!this.precomputed)return[this.x,this.y];return[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)}}]},M.fromJSON=function(F,R,D){if(typeof R==="string")R=JSON.parse(R);var q=F.point(R[0],R[1],D);if(!R[2])return q;function P(k){return F.point(k[0],k[1],D)}var _=R[2];return q.precomputed={beta:null,doubles:_.doubles&&{step:_.doubles.step,points:[q].concat(_.doubles.points.map(P))},naf:_.naf&&{wnd:_.naf.wnd,points:[q].concat(_.naf.points.map(P))}},q},M.prototype.inspect=function(){if(this.isInfinity())return"<EC Point Infinity>";return"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},M.prototype.isInfinity=function(){return this.inf},M.prototype.add=function(F){if(this.inf)return F;if(F.inf)return this;if(this.eq(F))return this.dbl();if(this.neg().eq(F))return this.curve.point(null,null);if(this.x.cmp(F.x)===0)return this.curve.point(null,null);var R=this.y.redSub(F.y);if(R.cmpn(0)!==0)R=R.redMul(this.x.redSub(F.x).redInvm());var D=R.redSqr().redISub(this.x).redISub(F.x),q=R.redMul(this.x.redSub(D)).redISub(this.y);return this.curve.point(D,q)},M.prototype.dbl=function(){if(this.inf)return this;var F=this.y.redAdd(this.y);if(F.cmpn(0)===0)return this.curve.point(null,null);var R=this.curve.a,D=this.x.redSqr(),q=F.redInvm(),P=D.redAdd(D).redIAdd(D).redIAdd(R).redMul(q),_=P.redSqr().redISub(this.x.redAdd(this.x)),k=P.redMul(this.x.redSub(_)).redISub(this.y);return this.curve.point(_,k)},M.prototype.getX=function(){return this.x.fromRed()},M.prototype.getY=function(){return this.y.fromRed()},M.prototype.mul=function(F){if(F=new L(F,16),this.isInfinity())return this;else if(this._hasDoubles(F))return this.curve._fixedNafMul(this,F);else if(this.curve.endo)return this.curve._endoWnafMulAdd([this],[F]);else return this.curve._wnafMul(this,F)},M.prototype.mulAdd=function(F,R,D){var q=[this,R],P=[F,D];if(this.curve.endo)return this.curve._endoWnafMulAdd(q,P);else return this.curve._wnafMulAdd(1,q,P,2)},M.prototype.jmulAdd=function(F,R,D){var q=[this,R],P=[F,D];if(this.curve.endo)return this.curve._endoWnafMulAdd(q,P,!0);else return this.curve._wnafMulAdd(1,q,P,2,!0)},M.prototype.eq=function(F){return this===F||this.inf===F.inf&&(this.inf||this.x.cmp(F.x)===0&&this.y.cmp(F.y)===0)},M.prototype.neg=function(F){if(this.inf)return this;var R=this.curve.point(this.x,this.y.redNeg());if(F&&this.precomputed){var D=this.precomputed,q=function(P){return P.neg()};R.precomputed={naf:D.naf&&{wnd:D.naf.wnd,points:D.naf.points.map(q)},doubles:D.doubles&&{step:D.doubles.step,points:D.doubles.points.map(q)}}}return R},M.prototype.toJ=function(){if(this.inf)return this.curve.jpoint(null,null,null);var F=this.curve.jpoint(this.x,this.y,this.curve.one);return F};function H(F,R,D,q){if(K.BasePoint.call(this,F,"jacobian"),R===null&&D===null&&q===null)this.x=this.curve.one,this.y=this.curve.one,this.z=new L(0);else this.x=new L(R,16),this.y=new L(D,16),this.z=new L(q,16);if(!this.x.red)this.x=this.x.toRed(this.curve.red);if(!this.y.red)this.y=this.y.toRed(this.curve.red);if(!this.z.red)this.z=this.z.toRed(this.curve.red);this.zOne=this.z===this.curve.one}S(H,K.BasePoint),T.prototype.jpoint=function(F,R,D){return new H(this,F,R,D)},H.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var F=this.z.redInvm(),R=F.redSqr(),D=this.x.redMul(R),q=this.y.redMul(R).redMul(F);return this.curve.point(D,q)},H.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},H.prototype.add=function(F){if(this.isInfinity())return F;if(F.isInfinity())return this;var R=F.z.redSqr(),D=this.z.redSqr(),q=this.x.redMul(R),P=F.x.redMul(D),_=this.y.redMul(R.redMul(F.z)),k=F.y.redMul(D.redMul(this.z)),B=q.redSub(P),v=_.redSub(k);if(B.cmpn(0)===0)if(v.cmpn(0)!==0)return this.curve.jpoint(null,null,null);else return this.dbl();var g=B.redSqr(),f=g.redMul(B),w=q.redMul(g),b=v.redSqr().redIAdd(f).redISub(w).redISub(w),I0=v.redMul(w.redISub(b)).redISub(_.redMul(f)),X0=this.z.redMul(F.z).redMul(B);return this.curve.jpoint(b,I0,X0)},H.prototype.mixedAdd=function(F){if(this.isInfinity())return F.toJ();if(F.isInfinity())return this;var R=this.z.redSqr(),D=this.x,q=F.x.redMul(R),P=this.y,_=F.y.redMul(R).redMul(this.z),k=D.redSub(q),B=P.redSub(_);if(k.cmpn(0)===0)if(B.cmpn(0)!==0)return this.curve.jpoint(null,null,null);else return this.dbl();var v=k.redSqr(),g=v.redMul(k),f=D.redMul(v),w=B.redSqr().redIAdd(g).redISub(f).redISub(f),b=B.redMul(f.redISub(w)).redISub(P.redMul(g)),I0=this.z.redMul(k);return this.curve.jpoint(w,b,I0)},H.prototype.dblp=function(F){if(F===0)return this;if(this.isInfinity())return this;if(!F)return this.dbl();var R;if(this.curve.zeroA||this.curve.threeA){var D=this;for(R=0;R<F;R++)D=D.dbl();return D}var q=this.curve.a,P=this.curve.tinv,_=this.x,k=this.y,B=this.z,v=B.redSqr().redSqr(),g=k.redAdd(k);for(R=0;R<F;R++){var f=_.redSqr(),w=g.redSqr(),b=w.redSqr(),I0=f.redAdd(f).redIAdd(f).redIAdd(q.redMul(v)),X0=_.redMul(w),C0=I0.redSqr().redISub(X0.redAdd(X0)),u=X0.redISub(C0),O0=I0.redMul(u);O0=O0.redIAdd(O0).redISub(b);var U=g.redMul(B);if(R+1<F)v=v.redMul(b);_=C0,B=U,g=O0}return this.curve.jpoint(_,g.redMul(P),B)},H.prototype.dbl=function(){if(this.isInfinity())return this;if(this.curve.zeroA)return this._zeroDbl();else if(this.curve.threeA)return this._threeDbl();else return this._dbl()},H.prototype._zeroDbl=function(){var F,R,D;if(this.zOne){var q=this.x.redSqr(),P=this.y.redSqr(),_=P.redSqr(),k=this.x.redAdd(P).redSqr().redISub(q).redISub(_);k=k.redIAdd(k);var B=q.redAdd(q).redIAdd(q),v=B.redSqr().redISub(k).redISub(k),g=_.redIAdd(_);g=g.redIAdd(g),g=g.redIAdd(g),F=v,R=B.redMul(k.redISub(v)).redISub(g),D=this.y.redAdd(this.y)}else{var f=this.x.redSqr(),w=this.y.redSqr(),b=w.redSqr(),I0=this.x.redAdd(w).redSqr().redISub(f).redISub(b);I0=I0.redIAdd(I0);var X0=f.redAdd(f).redIAdd(f),C0=X0.redSqr(),u=b.redIAdd(b);u=u.redIAdd(u),u=u.redIAdd(u),F=C0.redISub(I0).redISub(I0),R=X0.redMul(I0.redISub(F)).redISub(u),D=this.y.redMul(this.z),D=D.redIAdd(D)}return this.curve.jpoint(F,R,D)},H.prototype._threeDbl=function(){var F,R,D;if(this.zOne){var q=this.x.redSqr(),P=this.y.redSqr(),_=P.redSqr(),k=this.x.redAdd(P).redSqr().redISub(q).redISub(_);k=k.redIAdd(k);var B=q.redAdd(q).redIAdd(q).redIAdd(this.curve.a),v=B.redSqr().redISub(k).redISub(k);F=v;var g=_.redIAdd(_);g=g.redIAdd(g),g=g.redIAdd(g),R=B.redMul(k.redISub(v)).redISub(g),D=this.y.redAdd(this.y)}else{var f=this.z.redSqr(),w=this.y.redSqr(),b=this.x.redMul(w),I0=this.x.redSub(f).redMul(this.x.redAdd(f));I0=I0.redAdd(I0).redIAdd(I0);var X0=b.redIAdd(b);X0=X0.redIAdd(X0);var C0=X0.redAdd(X0);F=I0.redSqr().redISub(C0),D=this.y.redAdd(this.z).redSqr().redISub(w).redISub(f);var u=w.redSqr();u=u.redIAdd(u),u=u.redIAdd(u),u=u.redIAdd(u),R=I0.redMul(X0.redISub(F)).redISub(u)}return this.curve.jpoint(F,R,D)},H.prototype._dbl=function(){var F=this.curve.a,R=this.x,D=this.y,q=this.z,P=q.redSqr().redSqr(),_=R.redSqr(),k=D.redSqr(),B=_.redAdd(_).redIAdd(_).redIAdd(F.redMul(P)),v=R.redAdd(R);v=v.redIAdd(v);var g=v.redMul(k),f=B.redSqr().redISub(g.redAdd(g)),w=g.redISub(f),b=k.redSqr();b=b.redIAdd(b),b=b.redIAdd(b),b=b.redIAdd(b);var I0=B.redMul(w).redISub(b),X0=D.redAdd(D).redMul(q);return this.curve.jpoint(f,I0,X0)},H.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var F=this.x.redSqr(),R=this.y.redSqr(),D=this.z.redSqr(),q=R.redSqr(),P=F.redAdd(F).redIAdd(F),_=P.redSqr(),k=this.x.redAdd(R).redSqr().redISub(F).redISub(q);k=k.redIAdd(k),k=k.redAdd(k).redIAdd(k),k=k.redISub(_);var B=k.redSqr(),v=q.redIAdd(q);v=v.redIAdd(v),v=v.redIAdd(v),v=v.redIAdd(v);var g=P.redIAdd(k).redSqr().redISub(_).redISub(B).redISub(v),f=R.redMul(g);f=f.redIAdd(f),f=f.redIAdd(f);var w=this.x.redMul(B).redISub(f);w=w.redIAdd(w),w=w.redIAdd(w);var b=this.y.redMul(g.redMul(v.redISub(g)).redISub(k.redMul(B)));b=b.redIAdd(b),b=b.redIAdd(b),b=b.redIAdd(b);var I0=this.z.redAdd(k).redSqr().redISub(D).redISub(B);return this.curve.jpoint(w,b,I0)},H.prototype.mul=function(F,R){return F=new L(F,R),this.curve._wnafMul(this,F)},H.prototype.eq=function(F){if(F.type==="affine")return this.eq(F.toJ());if(this===F)return!0;var R=this.z.redSqr(),D=F.z.redSqr();if(this.x.redMul(D).redISub(F.x.redMul(R)).cmpn(0)!==0)return!1;var q=R.redMul(this.z),P=D.redMul(F.z);return this.y.redMul(P).redISub(F.y.redMul(q)).cmpn(0)===0},H.prototype.eqXToP=function(F){var R=this.z.redSqr(),D=F.toRed(this.curve.red).redMul(R);if(this.x.cmp(D)===0)return!0;var q=F.clone(),P=this.curve.redN.redMul(R);for(;;){if(q.iadd(this.curve.n),q.cmp(this.curve.p)>=0)return!1;if(D.redIAdd(P),this.x.cmp(D)===0)return!0}},H.prototype.inspect=function(){if(this.isInfinity())return"<EC JPoint Infinity>";return"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},H.prototype.isInfinity=function(){return this.z.cmpn(0)===0}}),jG=Q0(($,I)=>{var E=sU(),L=gU(),S=JZ(),K=wU();function Q(M){S.call(this,"mont",M),this.a=new E(M.a,16).toRed(this.red),this.b=new E(M.b,16).toRed(this.red),this.i4=new E(4).toRed(this.red).redInvm(),this.two=new E(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}L(Q,S),I.exports=Q,Q.prototype.validate=function(M){var H=M.normalize().x,F=H.redSqr(),R=F.redMul(H).redAdd(F.redMul(this.a)).redAdd(H),D=R.redSqrt();return D.redSqr().cmp(R)===0};function T(M,H,F){if(S.BasePoint.call(this,M,"projective"),H===null&&F===null)this.x=this.curve.one,this.z=this.curve.zero;else{if(this.x=new E(H,16),this.z=new E(F,16),!this.x.red)this.x=this.x.toRed(this.curve.red);if(!this.z.red)this.z=this.z.toRed(this.curve.red)}}L(T,S.BasePoint),Q.prototype.decodePoint=function(M,H){return this.point(K.toArray(M,H),1)},Q.prototype.point=function(M,H){return new T(this,M,H)},Q.prototype.pointFromJSON=function(M){return T.fromJSON(this,M)},T.prototype.precompute=function(){},T.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},T.fromJSON=function(M,H){return new T(M,H[0],H[1]||M.one)},T.prototype.inspect=function(){if(this.isInfinity())return"<EC Point Infinity>";return"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},T.prototype.isInfinity=function(){return this.z.cmpn(0)===0},T.prototype.dbl=function(){var M=this.x.redAdd(this.z),H=M.redSqr(),F=this.x.redSub(this.z),R=F.redSqr(),D=H.redSub(R),q=H.redMul(R),P=D.redMul(R.redAdd(this.curve.a24.redMul(D)));return this.curve.point(q,P)},T.prototype.add=function(){throw Error("Not supported on Montgomery curve")},T.prototype.diffAdd=function(M,H){var F=this.x.redAdd(this.z),R=this.x.redSub(this.z),D=M.x.redAdd(M.z),q=M.x.redSub(M.z),P=q.redMul(F),_=D.redMul(R),k=H.z.redMul(P.redAdd(_).redSqr()),B=H.x.redMul(P.redISub(_).redSqr());return this.curve.point(k,B)},T.prototype.mul=function(M){var H=M.clone(),F=this,R=this.curve.point(null,null),D=this;for(var q=[];H.cmpn(0)!==0;H.iushrn(1))q.push(H.andln(1));for(var P=q.length-1;P>=0;P--)if(q[P]===0)F=F.diffAdd(R,D),R=R.dbl();else R=F.diffAdd(R,D),F=F.dbl();return R},T.prototype.mulAdd=function(){throw Error("Not supported on Montgomery curve")},T.prototype.jumlAdd=function(){throw Error("Not supported on Montgomery curve")},T.prototype.eq=function(M){return this.getX().cmp(M.getX())===0},T.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},T.prototype.getX=function(){return this.normalize(),this.x.fromRed()}}),vG=Q0(($,I)=>{var E=wU(),L=sU(),S=gU(),K=JZ(),Q=E.assert;function T(H){this.twisted=(H.a|0)!==1,this.mOneA=this.twisted&&(H.a|0)===-1,this.extended=this.mOneA,K.call(this,"edwards",H),this.a=new L(H.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new L(H.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new L(H.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),Q(!this.twisted||this.c.fromRed().cmpn(1)===0),this.oneC=(H.c|0)===1}S(T,K),I.exports=T,T.prototype._mulA=function(H){if(this.mOneA)return H.redNeg();else return this.a.redMul(H)},T.prototype._mulC=function(H){if(this.oneC)return H;else return this.c.redMul(H)},T.prototype.jpoint=function(H,F,R,D){return this.point(H,F,R,D)},T.prototype.pointFromX=function(H,F){if(H=new L(H,16),!H.red)H=H.toRed(this.red);var R=H.redSqr(),D=this.c2.redSub(this.a.redMul(R)),q=this.one.redSub(this.c2.redMul(this.d).redMul(R)),P=D.redMul(q.redInvm()),_=P.redSqrt();if(_.redSqr().redSub(P).cmp(this.zero)!==0)throw Error("invalid point");var k=_.fromRed().isOdd();if(F&&!k||!F&&k)_=_.redNeg();return this.point(H,_)},T.prototype.pointFromY=function(H,F){if(H=new L(H,16),!H.red)H=H.toRed(this.red);var R=H.redSqr(),D=R.redSub(this.c2),q=R.redMul(this.d).redMul(this.c2).redSub(this.a),P=D.redMul(q.redInvm());if(P.cmp(this.zero)===0)if(F)throw Error("invalid point");else return this.point(this.zero,H);var _=P.redSqrt();if(_.redSqr().redSub(P).cmp(this.zero)!==0)throw Error("invalid point");if(_.fromRed().isOdd()!==F)_=_.redNeg();return this.point(_,H)},T.prototype.validate=function(H){if(H.isInfinity())return!0;H.normalize();var F=H.x.redSqr(),R=H.y.redSqr(),D=F.redMul(this.a).redAdd(R),q=this.c2.redMul(this.one.redAdd(this.d.redMul(F).redMul(R)));return D.cmp(q)===0};function M(H,F,R,D,q){if(K.BasePoint.call(this,H,"projective"),F===null&&R===null&&D===null)this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0;else{if(this.x=new L(F,16),this.y=new L(R,16),this.z=D?new L(D,16):this.curve.one,this.t=q&&new L(q,16),!this.x.red)this.x=this.x.toRed(this.curve.red);if(!this.y.red)this.y=this.y.toRed(this.curve.red);if(!this.z.red)this.z=this.z.toRed(this.curve.red);if(this.t&&!this.t.red)this.t=this.t.toRed(this.curve.red);if(this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t){if(this.t=this.x.redMul(this.y),!this.zOne)this.t=this.t.redMul(this.z.redInvm())}}}S(M,K.BasePoint),T.prototype.pointFromJSON=function(H){return M.fromJSON(this,H)},T.prototype.point=function(H,F,R,D){return new M(this,H,F,R,D)},M.fromJSON=function(H,F){return new M(H,F[0],F[1],F[2])},M.prototype.inspect=function(){if(this.isInfinity())return"<EC Point Infinity>";return"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},M.prototype.isInfinity=function(){return this.x.cmpn(0)===0&&(this.y.cmp(this.z)===0||this.zOne&&this.y.cmp(this.curve.c)===0)},M.prototype._extDbl=function(){var H=this.x.redSqr(),F=this.y.redSqr(),R=this.z.redSqr();R=R.redIAdd(R);var D=this.curve._mulA(H),q=this.x.redAdd(this.y).redSqr().redISub(H).redISub(F),P=D.redAdd(F),_=P.redSub(R),k=D.redSub(F),B=q.redMul(_),v=P.redMul(k),g=q.redMul(k),f=_.redMul(P);return this.curve.point(B,v,f,g)},M.prototype._projDbl=function(){var H=this.x.redAdd(this.y).redSqr(),F=this.x.redSqr(),R=this.y.redSqr(),D,q,P,_,k,B;if(this.curve.twisted){_=this.curve._mulA(F);var v=_.redAdd(R);if(this.zOne)D=H.redSub(F).redSub(R).redMul(v.redSub(this.curve.two)),q=v.redMul(_.redSub(R)),P=v.redSqr().redSub(v).redSub(v);else k=this.z.redSqr(),B=v.redSub(k).redISub(k),D=H.redSub(F).redISub(R).redMul(B),q=v.redMul(_.redSub(R)),P=v.redMul(B)}else _=F.redAdd(R),k=this.curve._mulC(this.z).redSqr(),B=_.redSub(k).redSub(k),D=this.curve._mulC(H.redISub(_)).redMul(B),q=this.curve._mulC(_).redMul(F.redISub(R)),P=_.redMul(B);return this.curve.point(D,q,P)},M.prototype.dbl=function(){if(this.isInfinity())return this;if(this.curve.extended)return this._extDbl();else return this._projDbl()},M.prototype._extAdd=function(H){var F=this.y.redSub(this.x).redMul(H.y.redSub(H.x)),R=this.y.redAdd(this.x).redMul(H.y.redAdd(H.x)),D=this.t.redMul(this.curve.dd).redMul(H.t),q=this.z.redMul(H.z.redAdd(H.z)),P=R.redSub(F),_=q.redSub(D),k=q.redAdd(D),B=R.redAdd(F),v=P.redMul(_),g=k.redMul(B),f=P.redMul(B),w=_.redMul(k);return this.curve.point(v,g,w,f)},M.prototype._projAdd=function(H){var F=this.z.redMul(H.z),R=F.redSqr(),D=this.x.redMul(H.x),q=this.y.redMul(H.y),P=this.curve.d.redMul(D).redMul(q),_=R.redSub(P),k=R.redAdd(P),B=this.x.redAdd(this.y).redMul(H.x.redAdd(H.y)).redISub(D).redISub(q),v=F.redMul(_).redMul(B),g,f;if(this.curve.twisted)g=F.redMul(k).redMul(q.redSub(this.curve._mulA(D))),f=_.redMul(k);else g=F.redMul(k).redMul(q.redSub(D)),f=this.curve._mulC(_).redMul(k);return this.curve.point(v,g,f)},M.prototype.add=function(H){if(this.isInfinity())return H;if(H.isInfinity())return this;if(this.curve.extended)return this._extAdd(H);else return this._projAdd(H)},M.prototype.mul=function(H){if(this._hasDoubles(H))return this.curve._fixedNafMul(this,H);else return this.curve._wnafMul(this,H)},M.prototype.mulAdd=function(H,F,R){return this.curve._wnafMulAdd(1,[this,F],[H,R],2,!1)},M.prototype.jmulAdd=function(H,F,R){return this.curve._wnafMulAdd(1,[this,F],[H,R],2,!0)},M.prototype.normalize=function(){if(this.zOne)return this;var H=this.z.redInvm();if(this.x=this.x.redMul(H),this.y=this.y.redMul(H),this.t)this.t=this.t.redMul(H);return this.z=this.curve.one,this.zOne=!0,this},M.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},M.prototype.getX=function(){return this.normalize(),this.x.fromRed()},M.prototype.getY=function(){return this.normalize(),this.y.fromRed()},M.prototype.eq=function(H){return this===H||this.getX().cmp(H.getX())===0&&this.getY().cmp(H.getY())===0},M.prototype.eqXToP=function(H){var F=H.toRed(this.curve.red).redMul(this.z);if(this.x.cmp(F)===0)return!0;var R=H.clone(),D=this.curve.redN.redMul(this.z);for(;;){if(R.iadd(this.curve.n),R.cmp(this.curve.p)>=0)return!1;if(F.redIAdd(D),this.x.cmp(F)===0)return!0}},M.prototype.toP=M.prototype.normalize,M.prototype.mixedAdd=M.prototype.add}),nI=Q0(($)=>{var I=$;I.base=JZ(),I.short=_G(),I.mont=jG(),I.edwards=vG()}),lU=Q0(($)=>{var I=UO(),E=gU();$.inherits=E;function L(A,X){if((A.charCodeAt(X)&64512)!==55296)return!1;if(X<0||X+1>=A.length)return!1;return(A.charCodeAt(X+1)&64512)===56320}function S(A,X){if(Array.isArray(A))return A.slice();if(!A)return[];var Z=[];if(typeof A==="string"){if(!X){var C=0;for(var Y=0;Y<A.length;Y++){var V=A.charCodeAt(Y);if(V<128)Z[C++]=V;else if(V<2048)Z[C++]=V>>6|192,Z[C++]=V&63|128;else if(L(A,Y))V=65536+((V&1023)<<10)+(A.charCodeAt(++Y)&1023),Z[C++]=V>>18|240,Z[C++]=V>>12&63|128,Z[C++]=V>>6&63|128,Z[C++]=V&63|128;else Z[C++]=V>>12|224,Z[C++]=V>>6&63|128,Z[C++]=V&63|128}}else if(X==="hex"){if(A=A.replace(/[^a-z0-9]+/ig,""),A.length%2!==0)A="0"+A;for(Y=0;Y<A.length;Y+=2)Z.push(parseInt(A[Y]+A[Y+1],16))}}else for(Y=0;Y<A.length;Y++)Z[Y]=A[Y]|0;return Z}$.toArray=S;function K(A){var X="";for(var Z=0;Z<A.length;Z++)X+=M(A[Z].toString(16));return X}$.toHex=K;function Q(A){var X=A>>>24|A>>>8&65280|A<<8&16711680|(A&255)<<24;return X>>>0}$.htonl=Q;function T(A,X){var Z="";for(var C=0;C<A.length;C++){var Y=A[C];if(X==="little")Y=Q(Y);Z+=H(Y.toString(16))}return Z}$.toHex32=T;function M(A){if(A.length===1)return"0"+A;else return A}$.zero2=M;function H(A){if(A.length===7)return"0"+A;else if(A.length===6)return"00"+A;else if(A.length===5)return"000"+A;else if(A.length===4)return"0000"+A;else if(A.length===3)return"00000"+A;else if(A.length===2)return"000000"+A;else if(A.length===1)return"0000000"+A;else return A}$.zero8=H;function F(A,X,Z,C){var Y=Z-X;I(Y%4===0);var V=Array(Y/4);for(var G=0,O=X;G<V.length;G++,O+=4){var J;if(C==="big")J=A[O]<<24|A[O+1]<<16|A[O+2]<<8|A[O+3];else J=A[O+3]<<24|A[O+2]<<16|A[O+1]<<8|A[O];V[G]=J>>>0}return V}$.join32=F;function R(A,X){var Z=Array(A.length*4);for(var C=0,Y=0;C<A.length;C++,Y+=4){var V=A[C];if(X==="big")Z[Y]=V>>>24,Z[Y+1]=V>>>16&255,Z[Y+2]=V>>>8&255,Z[Y+3]=V&255;else Z[Y+3]=V>>>24,Z[Y+2]=V>>>16&255,Z[Y+1]=V>>>8&255,Z[Y]=V&255}return Z}$.split32=R;function D(A,X){return A>>>X|A<<32-X}$.rotr32=D;function q(A,X){return A<<X|A>>>32-X}$.rotl32=q;function P(A,X){return A+X>>>0}$.sum32=P;function _(A,X,Z){return A+X+Z>>>0}$.sum32_3=_;function k(A,X,Z,C){return A+X+Z+C>>>0}$.sum32_4=k;function B(A,X,Z,C,Y){return A+X+Z+C+Y>>>0}$.sum32_5=B;function v(A,X,Z,C){var Y=A[X],V=A[X+1],G=C+V>>>0,O=(G<C?1:0)+Z+Y;A[X]=O>>>0,A[X+1]=G}$.sum64=v;function g(A,X,Z,C){var Y=X+C>>>0,V=(Y<X?1:0)+A+Z;return V>>>0}$.sum64_hi=g;function f(A,X,Z,C){var Y=X+C;return Y>>>0}$.sum64_lo=f;function w(A,X,Z,C,Y,V,G,O){var J=0,z=X;z=z+C>>>0,J+=z<X?1:0,z=z+V>>>0,J+=z<V?1:0,z=z+O>>>0,J+=z<O?1:0;var W=A+Z+Y+G+J;return W>>>0}$.sum64_4_hi=w;function b(A,X,Z,C,Y,V,G,O){var J=X+C+V+O;return J>>>0}$.sum64_4_lo=b;function I0(A,X,Z,C,Y,V,G,O,J,z){var W=0,j=X;j=j+C>>>0,W+=j<X?1:0,j=j+V>>>0,W+=j<V?1:0,j=j+O>>>0,W+=j<O?1:0,j=j+z>>>0,W+=j<z?1:0;var N=A+Z+Y+G+J+W;return N>>>0}$.sum64_5_hi=I0;function X0(A,X,Z,C,Y,V,G,O,J,z){var W=X+C+V+O+z;return W>>>0}$.sum64_5_lo=X0;function C0(A,X,Z){var C=X<<32-Z|A>>>Z;return C>>>0}$.rotr64_hi=C0;function u(A,X,Z){var C=A<<32-Z|X>>>Z;return C>>>0}$.rotr64_lo=u;function O0(A,X,Z){return A>>>Z}$.shr64_hi=O0;function U(A,X,Z){var C=A<<32-Z|X>>>Z;return C>>>0}$.shr64_lo=U}),lO=Q0(($)=>{var I=lU(),E=UO();function L(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}$.BlockHash=L,L.prototype.update=function(S,K){if(S=I.toArray(S,K),!this.pending)this.pending=S;else this.pending=this.pending.concat(S);if(this.pendingTotal+=S.length,this.pending.length>=this._delta8){S=this.pending;var Q=S.length%this._delta8;if(this.pending=S.slice(S.length-Q,S.length),this.pending.length===0)this.pending=null;S=I.join32(S,0,S.length-Q,this.endian);for(var T=0;T<S.length;T+=this._delta32)this._update(S,T,T+this._delta32)}return this},L.prototype.digest=function(S){return this.update(this._pad()),E(this.pending===null),this._digest(S)},L.prototype._pad=function(){var S=this.pendingTotal,K=this._delta8,Q=K-(S+this.padLength)%K,T=Array(Q+this.padLength);T[0]=128;for(var M=1;M<Q;M++)T[M]=0;if(S<<=3,this.endian==="big"){for(var H=8;H<this.padLength;H++)T[M++]=0;T[M++]=0,T[M++]=0,T[M++]=0,T[M++]=0,T[M++]=S>>>24&255,T[M++]=S>>>16&255,T[M++]=S>>>8&255,T[M++]=S&255}else{T[M++]=S&255,T[M++]=S>>>8&255,T[M++]=S>>>16&255,T[M++]=S>>>24&255,T[M++]=0,T[M++]=0,T[M++]=0,T[M++]=0;for(H=8;H<this.padLength;H++)T[M++]=0}return T}}),tI=Q0(($)=>{var I=lU(),E=I.rotr32;function L(R,D,q,P){if(R===0)return S(D,q,P);if(R===1||R===3)return Q(D,q,P);if(R===2)return K(D,q,P)}$.ft_1=L;function S(R,D,q){return R&D^~R&q}$.ch32=S;function K(R,D,q){return R&D^R&q^D&q}$.maj32=K;function Q(R,D,q){return R^D^q}$.p32=Q;function T(R){return E(R,2)^E(R,13)^E(R,22)}$.s0_256=T;function M(R){return E(R,6)^E(R,11)^E(R,25)}$.s1_256=M;function H(R){return E(R,7)^E(R,18)^R>>>3}$.g0_256=H;function F(R){return E(R,17)^E(R,19)^R>>>10}$.g1_256=F}),BG=Q0(($,I)=>{var E=lU(),L=lO(),S=tI(),K=E.rotl32,Q=E.sum32,T=E.sum32_5,M=S.ft_1,H=L.BlockHash,F=[1518500249,1859775393,2400959708,3395469782];function R(){if(!(this instanceof R))return new R;H.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=Array(80)}E.inherits(R,H),I.exports=R,R.blockSize=512,R.outSize=160,R.hmacStrength=80,R.padLength=64,R.prototype._update=function(D,q){var P=this.W;for(var _=0;_<16;_++)P[_]=D[q+_];for(;_<P.length;_++)P[_]=K(P[_-3]^P[_-8]^P[_-14]^P[_-16],1);var k=this.h[0],B=this.h[1],v=this.h[2],g=this.h[3],f=this.h[4];for(_=0;_<P.length;_++){var w=~~(_/20),b=T(K(k,5),M(w,B,v,g),f,P[_],F[w]);f=g,g=v,v=K(B,30),B=k,k=b}this.h[0]=Q(this.h[0],k),this.h[1]=Q(this.h[1],B),this.h[2]=Q(this.h[2],v),this.h[3]=Q(this.h[3],g),this.h[4]=Q(this.h[4],f)},R.prototype._digest=function(D){if(D==="hex")return E.toHex32(this.h,"big");else return E.split32(this.h,"big")}}),sI=Q0(($,I)=>{var E=lU(),L=lO(),S=tI(),K=UO(),Q=E.sum32,T=E.sum32_4,M=E.sum32_5,H=S.ch32,F=S.maj32,R=S.s0_256,D=S.s1_256,q=S.g0_256,P=S.g1_256,_=L.BlockHash,k=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function B(){if(!(this instanceof B))return new B;_.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=k,this.W=Array(64)}E.inherits(B,_),I.exports=B,B.blockSize=512,B.outSize=256,B.hmacStrength=192,B.padLength=64,B.prototype._update=function(v,g){var f=this.W;for(var w=0;w<16;w++)f[w]=v[g+w];for(;w<f.length;w++)f[w]=T(P(f[w-2]),f[w-7],q(f[w-15]),f[w-16]);var b=this.h[0],I0=this.h[1],X0=this.h[2],C0=this.h[3],u=this.h[4],O0=this.h[5],U=this.h[6],A=this.h[7];K(this.k.length===f.length);for(w=0;w<f.length;w++){var X=M(A,D(u),H(u,O0,U),this.k[w],f[w]),Z=Q(R(b),F(b,I0,X0));A=U,U=O0,O0=u,u=Q(C0,X),C0=X0,X0=I0,I0=b,b=Q(X,Z)}this.h[0]=Q(this.h[0],b),this.h[1]=Q(this.h[1],I0),this.h[2]=Q(this.h[2],X0),this.h[3]=Q(this.h[3],C0),this.h[4]=Q(this.h[4],u),this.h[5]=Q(this.h[5],O0),this.h[6]=Q(this.h[6],U),this.h[7]=Q(this.h[7],A)},B.prototype._digest=function(v){if(v==="hex")return E.toHex32(this.h,"big");else return E.split32(this.h,"big")}}),gG=Q0(($,I)=>{var E=lU(),L=sI();function S(){if(!(this instanceof S))return new S;L.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}E.inherits(S,L),I.exports=S,S.blockSize=512,S.outSize=224,S.hmacStrength=192,S.padLength=64,S.prototype._digest=function(K){if(K==="hex")return E.toHex32(this.h.slice(0,7),"big");else return E.split32(this.h.slice(0,7),"big")}}),mI=Q0(($,I)=>{var E=lU(),L=lO(),S=UO(),K=E.rotr64_hi,Q=E.rotr64_lo,T=E.shr64_hi,M=E.shr64_lo,H=E.sum64,F=E.sum64_hi,R=E.sum64_lo,D=E.sum64_4_hi,q=E.sum64_4_lo,P=E.sum64_5_hi,_=E.sum64_5_lo,k=L.BlockHash,B=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function v(){if(!(this instanceof v))return new v;k.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=B,this.W=Array(160)}E.inherits(v,k),I.exports=v,v.blockSize=1024,v.outSize=512,v.hmacStrength=192,v.padLength=128,v.prototype._prepareBlock=function(Z,C){var Y=this.W;for(var V=0;V<32;V++)Y[V]=Z[C+V];for(;V<Y.length;V+=2){var G=A(Y[V-4],Y[V-3]),O=X(Y[V-4],Y[V-3]),J=Y[V-14],z=Y[V-13],W=O0(Y[V-30],Y[V-29]),j=U(Y[V-30],Y[V-29]),N=Y[V-32],p=Y[V-31];Y[V]=D(G,O,J,z,W,j,N,p),Y[V+1]=q(G,O,J,z,W,j,N,p)}},v.prototype._update=function(Z,C){this._prepareBlock(Z,C);var Y=this.W,V=this.h[0],G=this.h[1],O=this.h[2],J=this.h[3],z=this.h[4],W=this.h[5],j=this.h[6],N=this.h[7],p=this.h[8],n=this.h[9],E0=this.h[10],r=this.h[11],d=this.h[12],A0=this.h[13],t=this.h[14],i=this.h[15];S(this.k.length===Y.length);for(var N0=0;N0<Y.length;N0+=2){var y=t,h=i,$0=C0(p,n),m=u(p,n),a=g(p,n,E0,r,d,A0),W0=f(p,n,E0,r,d,A0),c=this.k[N0],o=this.k[N0+1],x0=Y[N0],s=Y[N0+1],Z0=P(y,h,$0,m,a,W0,c,o,x0,s),w0=_(y,h,$0,m,a,W0,c,o,x0,s);y=I0(V,G),h=X0(V,G),$0=w(V,G,O,J,z,W),m=b(V,G,O,J,z,W);var S0=F(y,h,$0,m),V0=R(y,h,$0,m);t=d,i=A0,d=E0,A0=r,E0=p,r=n,p=F(j,N,Z0,w0),n=R(N,N,Z0,w0),j=z,N=W,z=O,W=J,O=V,J=G,V=F(Z0,w0,S0,V0),G=R(Z0,w0,S0,V0)}H(this.h,0,V,G),H(this.h,2,O,J),H(this.h,4,z,W),H(this.h,6,j,N),H(this.h,8,p,n),H(this.h,10,E0,r),H(this.h,12,d,A0),H(this.h,14,t,i)},v.prototype._digest=function(Z){if(Z==="hex")return E.toHex32(this.h,"big");else return E.split32(this.h,"big")};function g(Z,C,Y,V,G){var O=Z&Y^~Z&G;if(O<0)O+=4294967296;return O}function f(Z,C,Y,V,G,O){var J=C&V^~C&O;if(J<0)J+=4294967296;return J}function w(Z,C,Y,V,G){var O=Z&Y^Z&G^Y&G;if(O<0)O+=4294967296;return O}function b(Z,C,Y,V,G,O){var J=C&V^C&O^V&O;if(J<0)J+=4294967296;return J}function I0(Z,C){var Y=K(Z,C,28),V=K(C,Z,2),G=K(C,Z,7),O=Y^V^G;if(O<0)O+=4294967296;return O}function X0(Z,C){var Y=Q(Z,C,28),V=Q(C,Z,2),G=Q(C,Z,7),O=Y^V^G;if(O<0)O+=4294967296;return O}function C0(Z,C){var Y=K(Z,C,14),V=K(Z,C,18),G=K(C,Z,9),O=Y^V^G;if(O<0)O+=4294967296;return O}function u(Z,C){var Y=Q(Z,C,14),V=Q(Z,C,18),G=Q(C,Z,9),O=Y^V^G;if(O<0)O+=4294967296;return O}function O0(Z,C){var Y=K(Z,C,1),V=K(Z,C,8),G=T(Z,C,7),O=Y^V^G;if(O<0)O+=4294967296;return O}function U(Z,C){var Y=Q(Z,C,1),V=Q(Z,C,8),G=M(Z,C,7),O=Y^V^G;if(O<0)O+=4294967296;return O}function A(Z,C){var Y=K(Z,C,19),V=K(C,Z,29),G=T(Z,C,6),O=Y^V^G;if(O<0)O+=4294967296;return O}function X(Z,C){var Y=Q(Z,C,19),V=Q(C,Z,29),G=M(Z,C,6),O=Y^V^G;if(O<0)O+=4294967296;return O}}),xG=Q0(($,I)=>{var E=lU(),L=mI();function S(){if(!(this instanceof S))return new S;L.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}E.inherits(S,L),I.exports=S,S.blockSize=1024,S.outSize=384,S.hmacStrength=192,S.padLength=128,S.prototype._digest=function(K){if(K==="hex")return E.toHex32(this.h.slice(0,12),"big");else return E.split32(this.h.slice(0,12),"big")}}),NG=Q0(($)=>{$.sha1=BG(),$.sha224=gG(),$.sha256=sI(),$.sha384=xG(),$.sha512=mI()}),fG=Q0(($)=>{var I=lU(),E=lO(),L=I.rotl32,S=I.sum32,K=I.sum32_3,Q=I.sum32_4,T=E.BlockHash;function M(){if(!(this instanceof M))return new M;T.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}I.inherits(M,T),$.ripemd160=M,M.blockSize=512,M.outSize=160,M.hmacStrength=192,M.padLength=64,M.prototype._update=function(k,B){var v=this.h[0],g=this.h[1],f=this.h[2],w=this.h[3],b=this.h[4],I0=v,X0=g,C0=f,u=w,O0=b;for(var U=0;U<80;U++){var A=S(L(Q(v,H(U,g,f,w),k[D[U]+B],F(U)),P[U]),b);v=b,b=w,w=L(f,10),f=g,g=A,A=S(L(Q(I0,H(79-U,X0,C0,u),k[q[U]+B],R(U)),_[U]),O0),I0=O0,O0=u,u=L(C0,10),C0=X0,X0=A}A=K(this.h[1],f,u),this.h[1]=K(this.h[2],w,O0),this.h[2]=K(this.h[3],b,I0),this.h[3]=K(this.h[4],v,X0),this.h[4]=K(this.h[0],g,C0),this.h[0]=A},M.prototype._digest=function(k){if(k==="hex")return I.toHex32(this.h,"little");else return I.split32(this.h,"little")};function H(k,B,v,g){if(k<=15)return B^v^g;else if(k<=31)return B&v|~B&g;else if(k<=47)return(B|~v)^g;else if(k<=63)return B&g|v&~g;else return B^(v|~g)}function F(k){if(k<=15)return 0;else if(k<=31)return 1518500249;else if(k<=47)return 1859775393;else if(k<=63)return 2400959708;else return 2840853838}function R(k){if(k<=15)return 1352829926;else if(k<=31)return 1548603684;else if(k<=47)return 1836072691;else if(k<=63)return 2053994217;else return 0}var D=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],q=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],P=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],_=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]}),wG=Q0(($,I)=>{var E=lU(),L=UO();function S(K,Q,T){if(!(this instanceof S))return new S(K,Q,T);this.Hash=K,this.blockSize=K.blockSize/8,this.outSize=K.outSize/8,this.inner=null,this.outer=null,this._init(E.toArray(Q,T))}I.exports=S,S.prototype._init=function(K){if(K.length>this.blockSize)K=new this.Hash().update(K).digest();L(K.length<=this.blockSize);for(var Q=K.length;Q<this.blockSize;Q++)K.push(0);for(Q=0;Q<K.length;Q++)K[Q]^=54;this.inner=new this.Hash().update(K);for(Q=0;Q<K.length;Q++)K[Q]^=106;this.outer=new this.Hash().update(K)},S.prototype.update=function(K,Q){return this.inner.update(K,Q),this},S.prototype.digest=function(K){return this.outer.update(this.inner.digest()),this.outer.digest(K)}}),_A=Q0(($)=>{var I=$;I.utils=lU(),I.common=lO(),I.sha=NG(),I.ripemd=fG(),I.hmac=wG(),I.sha1=I.sha.sha1,I.sha256=I.sha.sha256,I.sha224=I.sha.sha224,I.sha384=I.sha.sha384,I.sha512=I.sha.sha512,I.ripemd160=I.ripemd.ripemd160}),yG=Q0(($,I)=>{I.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}}),jA=Q0(($)=>{var I=$,E=_A(),L=nI(),S=wU(),K=S.assert;function Q(H){if(H.type==="short")this.curve=new L.short(H);else if(H.type==="edwards")this.curve=new L.edwards(H);else this.curve=new L.mont(H);this.g=this.curve.g,this.n=this.curve.n,this.hash=H.hash,K(this.g.validate(),"Invalid curve"),K(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}I.PresetCurve=Q;function T(H,F){Object.defineProperty(I,H,{configurable:!0,enumerable:!0,get:function(){var R=new Q(F);return Object.defineProperty(I,H,{configurable:!0,enumerable:!0,value:R}),R}})}T("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:E.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),T("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:E.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),T("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:E.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),T("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:E.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"]}),T("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:E.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"]}),T("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:E.sha256,gRed:!1,g:["9"]}),T("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:E.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});var M;try{M=yG()}catch(H){M=void 0}T("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:E.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",M]})}),cG=Q0(($,I)=>{var E=_A(),L=bI(),S=UO();function K(Q){if(!(this instanceof K))return new K(Q);this.hash=Q.hash,this.predResist=!!Q.predResist,this.outLen=this.hash.outSize,this.minEntropy=Q.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var T=L.toArray(Q.entropy,Q.entropyEnc||"hex"),M=L.toArray(Q.nonce,Q.nonceEnc||"hex"),H=L.toArray(Q.pers,Q.persEnc||"hex");S(T.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(T,M,H)}I.exports=K,K.prototype._init=function(Q,T,M){var H=Q.concat(T).concat(M);this.K=Array(this.outLen/8),this.V=Array(this.outLen/8);for(var F=0;F<this.V.length;F++)this.K[F]=0,this.V[F]=1;this._update(H),this._reseed=1,this.reseedInterval=281474976710656},K.prototype._hmac=function(){return new E.hmac(this.hash,this.K)},K.prototype._update=function(Q){var T=this._hmac().update(this.V).update([0]);if(Q)T=T.update(Q);if(this.K=T.digest(),this.V=this._hmac().update(this.V).digest(),!Q)return;this.K=this._hmac().update(this.V).update([1]).update(Q).digest(),this.V=this._hmac().update(this.V).digest()},K.prototype.reseed=function(Q,T,M,H){if(typeof T!=="string")H=M,M=T,T=null;Q=L.toArray(Q,T),M=L.toArray(M,H),S(Q.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(Q.concat(M||[])),this._reseed=1},K.prototype.generate=function(Q,T,M,H){if(this._reseed>this.reseedInterval)throw Error("Reseed is required");if(typeof T!=="string")H=M,M=T,T=null;if(M)M=L.toArray(M,H||"hex"),this._update(M);var F=[];while(F.length<Q)this.V=this._hmac().update(this.V).digest(),F=F.concat(this.V);var R=F.slice(0,Q);return this._update(M),this._reseed++,L.encode(R,T)}}),pG=Q0(($,I)=>{var E=sU(),L=wU(),S=L.assert;function K(Q,T){if(this.ec=Q,this.priv=null,this.pub=null,T.priv)this._importPrivate(T.priv,T.privEnc);if(T.pub)this._importPublic(T.pub,T.pubEnc)}I.exports=K,K.fromPublic=function(Q,T,M){if(T instanceof K)return T;return new K(Q,{pub:T,pubEnc:M})},K.fromPrivate=function(Q,T,M){if(T instanceof K)return T;return new K(Q,{priv:T,privEnc:M})},K.prototype.validate=function(){var Q=this.getPublic();if(Q.isInfinity())return{result:!1,reason:"Invalid public key"};if(!Q.validate())return{result:!1,reason:"Public key is not a point"};if(!Q.mul(this.ec.curve.n).isInfinity())return{result:!1,reason:"Public key * N != O"};return{result:!0,reason:null}},K.prototype.getPublic=function(Q,T){if(typeof Q==="string")T=Q,Q=null;if(!this.pub)this.pub=this.ec.g.mul(this.priv);if(!T)return this.pub;return this.pub.encode(T,Q)},K.prototype.getPrivate=function(Q){if(Q==="hex")return this.priv.toString(16,2);else return this.priv},K.prototype._importPrivate=function(Q,T){this.priv=new E(Q,T||16),this.priv=this.priv.umod(this.ec.curve.n)},K.prototype._importPublic=function(Q,T){if(Q.x||Q.y){if(this.ec.curve.type==="mont")S(Q.x,"Need x coordinate");else if(this.ec.curve.type==="short"||this.ec.curve.type==="edwards")S(Q.x&&Q.y,"Need both x and y coordinate");this.pub=this.ec.curve.point(Q.x,Q.y);return}this.pub=this.ec.curve.decodePoint(Q,T)},K.prototype.derive=function(Q){if(!Q.validate())S(Q.validate(),"public point not validated");return Q.mul(this.priv).getX()},K.prototype.sign=function(Q,T,M){return this.ec.sign(Q,this,T,M)},K.prototype.verify=function(Q,T,M){return this.ec.verify(Q,T,this,void 0,M)},K.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}}),hG=Q0(($,I)=>{var E=sU(),L=wU(),S=L.assert;function K(F,R){if(F instanceof K)return F;if(this._importDER(F,R))return;if(S(F.r&&F.s,"Signature without r or s"),this.r=new E(F.r,16),this.s=new E(F.s,16),F.recoveryParam===void 0)this.recoveryParam=null;else this.recoveryParam=F.recoveryParam}I.exports=K;function Q(){this.place=0}function T(F,R){var D=F[R.place++];if(!(D&128))return D;var q=D&15;if(q===0||q>4)return!1;if(F[R.place]===0)return!1;var P=0;for(var _=0,k=R.place;_<q;_++,k++)P<<=8,P|=F[k],P>>>=0;if(P<=127)return!1;return R.place=k,P}function M(F){var R=0,D=F.length-1;while(!F[R]&&!(F[R+1]&128)&&R<D)R++;if(R===0)return F;return F.slice(R)}K.prototype._importDER=function(F,R){F=L.toArray(F,R);var D=new Q;if(F[D.place++]!==48)return!1;var q=T(F,D);if(q===!1)return!1;if(q+D.place!==F.length)return!1;if(F[D.place++]!==2)return!1;var P=T(F,D);if(P===!1)return!1;if((F[D.place]&128)!==0)return!1;var _=F.slice(D.place,P+D.place);if(D.place+=P,F[D.place++]!==2)return!1;var k=T(F,D);if(k===!1)return!1;if(F.length!==k+D.place)return!1;if((F[D.place]&128)!==0)return!1;var B=F.slice(D.place,k+D.place);if(_[0]===0)if(_[1]&128)_=_.slice(1);else return!1;if(B[0]===0)if(B[1]&128)B=B.slice(1);else return!1;return this.r=new E(_),this.s=new E(B),this.recoveryParam=null,!0};function H(F,R){if(R<128){F.push(R);return}var D=1+(Math.log(R)/Math.LN2>>>3);F.push(D|128);while(--D)F.push(R>>>(D<<3)&255);F.push(R)}K.prototype.toDER=function(F){var R=this.r.toArray(),D=this.s.toArray();if(R[0]&128)R=[0].concat(R);if(D[0]&128)D=[0].concat(D);R=M(R),D=M(D);while(!D[0]&&!(D[1]&128))D=D.slice(1);var q=[2];H(q,R.length),q=q.concat(R),q.push(2),H(q,D.length);var P=q.concat(D),_=[48];return H(_,P.length),_=_.concat(P),L.encode(_,F)}}),uG=Q0(($,I)=>{var E=sU(),L=cG(),S=wU(),K=jA(),Q=oI(),T=S.assert,M=pG(),H=hG();function F(R){if(!(this instanceof F))return new F(R);if(typeof R==="string")T(Object.prototype.hasOwnProperty.call(K,R),"Unknown curve "+R),R=K[R];if(R instanceof K.PresetCurve)R={curve:R};this.curve=R.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=R.curve.g,this.g.precompute(R.curve.n.bitLength()+1),this.hash=R.hash||R.curve.hash}I.exports=F,F.prototype.keyPair=function(R){return new M(this,R)},F.prototype.keyFromPrivate=function(R,D){return M.fromPrivate(this,R,D)},F.prototype.keyFromPublic=function(R,D){return M.fromPublic(this,R,D)},F.prototype.genKeyPair=function(R){if(!R)R={};var D=new L({hash:this.hash,pers:R.pers,persEnc:R.persEnc||"utf8",entropy:R.entropy||Q(this.hash.hmacStrength),entropyEnc:R.entropy&&R.entropyEnc||"utf8",nonce:this.n.toArray()}),q=this.n.byteLength(),P=this.n.sub(new E(2));for(;;){var _=new E(D.generate(q));if(_.cmp(P)>0)continue;return _.iaddn(1),this.keyFromPrivate(_)}},F.prototype._truncateToN=function(R,D,q){var P;if(E.isBN(R)||typeof R==="number")R=new E(R,16),P=R.byteLength();else if(typeof R==="object")P=R.length,R=new E(R,16);else{var _=R.toString();P=_.length+1>>>1,R=new E(_,16)}if(typeof q!=="number")q=P*8;var k=q-this.n.bitLength();if(k>0)R=R.ushrn(k);if(!D&&R.cmp(this.n)>=0)return R.sub(this.n);else return R},F.prototype.sign=function(R,D,q,P){if(typeof q==="object")P=q,q=null;if(!P)P={};if(typeof R!=="string"&&typeof R!=="number"&&!E.isBN(R)){T(typeof R==="object"&&R&&typeof R.length==="number","Expected message to be an array-like, a hex string, or a BN instance"),T(R.length>>>0===R.length);for(var _=0;_<R.length;_++)T((R[_]&255)===R[_])}D=this.keyFromPrivate(D,q),R=this._truncateToN(R,!1,P.msgBitLength),T(!R.isNeg(),"Can not sign a negative message");var k=this.n.byteLength(),B=D.getPrivate().toArray("be",k),v=R.toArray("be",k);T(new E(v).eq(R),"Can not sign message");var g=new L({hash:this.hash,entropy:B,nonce:v,pers:P.pers,persEnc:P.persEnc||"utf8"}),f=this.n.sub(new E(1));for(var w=0;;w++){var b=P.k?P.k(w):new E(g.generate(this.n.byteLength()));if(b=this._truncateToN(b,!0),b.cmpn(1)<=0||b.cmp(f)>=0)continue;var I0=this.g.mul(b);if(I0.isInfinity())continue;var X0=I0.getX(),C0=X0.umod(this.n);if(C0.cmpn(0)===0)continue;var u=b.invm(this.n).mul(C0.mul(D.getPrivate()).iadd(R));if(u=u.umod(this.n),u.cmpn(0)===0)continue;var O0=(I0.getY().isOdd()?1:0)|(X0.cmp(C0)!==0?2:0);if(P.canonical&&u.cmp(this.nh)>0)u=this.n.sub(u),O0^=1;return new H({r:C0,s:u,recoveryParam:O0})}},F.prototype.verify=function(R,D,q,P,_){if(!_)_={};R=this._truncateToN(R,!1,_.msgBitLength),q=this.keyFromPublic(q,P),D=new H(D,"hex");var{r:k,s:B}=D;if(k.cmpn(1)<0||k.cmp(this.n)>=0)return!1;if(B.cmpn(1)<0||B.cmp(this.n)>=0)return!1;var v=B.invm(this.n),g=v.mul(R).umod(this.n),f=v.mul(k).umod(this.n),w;if(!this.curve._maxwellTrick){if(w=this.g.mulAdd(g,q.getPublic(),f),w.isInfinity())return!1;return w.getX().umod(this.n).cmp(k)===0}if(w=this.g.jmulAdd(g,q.getPublic(),f),w.isInfinity())return!1;return w.eqXToP(k)},F.prototype.recoverPubKey=function(R,D,q,P){T((3&q)===q,"The recovery param is more than two bits"),D=new H(D,P);var _=this.n,k=new E(R),B=D.r,v=D.s,g=q&1,f=q>>1;if(B.cmp(this.curve.p.umod(this.curve.n))>=0&&f)throw Error("Unable to find sencond key candinate");if(f)B=this.curve.pointFromX(B.add(this.curve.n),g);else B=this.curve.pointFromX(B,g);var w=D.r.invm(_),b=_.sub(k).mul(w).umod(_),I0=v.mul(w).umod(_);return this.g.mulAdd(b,B,I0)},F.prototype.getKeyRecoveryParam=function(R,D,q,P){if(D=new H(D,P),D.recoveryParam!==null)return D.recoveryParam;for(var _=0;_<4;_++){var k;try{k=this.recoverPubKey(R,D,_)}catch(B){continue}if(k.eq(q))return _}throw Error("Unable to find valid recovery factor")}}),lG=Q0(($,I)=>{var E=wU(),L=E.assert,S=E.parseBytes,K=E.cachedProperty;function Q(T,M){if(this.eddsa=T,this._secret=S(M.secret),T.isPoint(M.pub))this._pub=M.pub;else this._pubBytes=S(M.pub)}Q.fromPublic=function(T,M){if(M instanceof Q)return M;return new Q(T,{pub:M})},Q.fromSecret=function(T,M){if(M instanceof Q)return M;return new Q(T,{secret:M})},Q.prototype.secret=function(){return this._secret},K(Q,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())}),K(Q,"pub",function(){if(this._pubBytes)return this.eddsa.decodePoint(this._pubBytes);return this.eddsa.g.mul(this.priv())}),K(Q,"privBytes",function(){var T=this.eddsa,M=this.hash(),H=T.encodingLength-1,F=M.slice(0,T.encodingLength);return F[0]&=248,F[H]&=127,F[H]|=64,F}),K(Q,"priv",function(){return this.eddsa.decodeInt(this.privBytes())}),K(Q,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()}),K(Q,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)}),Q.prototype.sign=function(T){return L(this._secret,"KeyPair can only verify"),this.eddsa.sign(T,this)},Q.prototype.verify=function(T,M){return this.eddsa.verify(T,M,this)},Q.prototype.getSecret=function(T){return L(this._secret,"KeyPair is public only"),E.encode(this.secret(),T)},Q.prototype.getPublic=function(T){return E.encode(this.pubBytes(),T)},I.exports=Q}),dG=Q0(($,I)=>{var E=sU(),L=wU(),S=L.assert,K=L.cachedProperty,Q=L.parseBytes;function T(M,H){if(this.eddsa=M,typeof H!=="object")H=Q(H);if(Array.isArray(H))S(H.length===M.encodingLength*2,"Signature has invalid size"),H={R:H.slice(0,M.encodingLength),S:H.slice(M.encodingLength)};if(S(H.R&&H.S,"Signature without R or S"),M.isPoint(H.R))this._R=H.R;if(H.S instanceof E)this._S=H.S;this._Rencoded=Array.isArray(H.R)?H.R:H.Rencoded,this._Sencoded=Array.isArray(H.S)?H.S:H.Sencoded}K(T,"S",function(){return this.eddsa.decodeInt(this.Sencoded())}),K(T,"R",function(){return this.eddsa.decodePoint(this.Rencoded())}),K(T,"Rencoded",function(){return this.eddsa.encodePoint(this.R())}),K(T,"Sencoded",function(){return this.eddsa.encodeInt(this.S())}),T.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},T.prototype.toHex=function(){return L.encode(this.toBytes(),"hex").toUpperCase()},I.exports=T}),bG=Q0(($,I)=>{var E=_A(),L=jA(),S=wU(),K=S.assert,Q=S.parseBytes,T=lG(),M=dG();function H(F){if(K(F==="ed25519","only tested with ed25519 so far"),!(this instanceof H))return new H(F);F=L[F].curve,this.curve=F,this.g=F.g,this.g.precompute(F.n.bitLength()+1),this.pointClass=F.point().constructor,this.encodingLength=Math.ceil(F.n.bitLength()/8),this.hash=E.sha512}I.exports=H,H.prototype.sign=function(F,R){F=Q(F);var D=this.keyFromSecret(R),q=this.hashInt(D.messagePrefix(),F),P=this.g.mul(q),_=this.encodePoint(P),k=this.hashInt(_,D.pubBytes(),F).mul(D.priv()),B=q.add(k).umod(this.curve.n);return this.makeSignature({R:P,S:B,Rencoded:_})},H.prototype.verify=function(F,R,D){if(F=Q(F),R=this.makeSignature(R),R.S().gte(R.eddsa.curve.n)||R.S().isNeg())return!1;var q=this.keyFromPublic(D),P=this.hashInt(R.Rencoded(),q.pubBytes(),F),_=this.g.mul(R.S()),k=R.R().add(q.pub().mul(P));return k.eq(_)},H.prototype.hashInt=function(){var F=this.hash();for(var R=0;R<arguments.length;R++)F.update(arguments[R]);return S.intFromLE(F.digest()).umod(this.curve.n)},H.prototype.keyFromPublic=function(F){return T.fromPublic(this,F)},H.prototype.keyFromSecret=function(F){return T.fromSecret(this,F)},H.prototype.makeSignature=function(F){if(F instanceof M)return F;return new M(this,F)},H.prototype.encodePoint=function(F){var R=F.getY().toArray("le",this.encodingLength);return R[this.encodingLength-1]|=F.getX().isOdd()?128:0,R},H.prototype.decodePoint=function(F){F=S.parseBytes(F);var R=F.length-1,D=F.slice(0,R).concat(F[R]&-129),q=(F[R]&128)!==0,P=S.intFromLE(D);return this.curve.pointFromY(P,q)},H.prototype.encodeInt=function(F){return F.toArray("le",this.encodingLength)},H.prototype.decodeInt=function(F){return S.intFromLE(F)},H.prototype.isPoint=function(F){return F instanceof this.pointClass}}),oG=Q0(($)=>{var I=$;I.version=PG().version,I.utils=wU(),I.rand=oI(),I.curve=nI(),I.curves=jA(),I.ec=uG(),I.eddsa=bG()}),nG=Q0(($,I)=>{(function(E,L){function S(U,A){if(!U)throw Error(A||"Assertion failed")}function K(U,A){U.super_=A;var X=function(){};X.prototype=A.prototype,U.prototype=new X,U.prototype.constructor=U}function Q(U,A,X){if(Q.isBN(U))return U;if(this.negative=0,this.words=null,this.length=0,this.red=null,U!==null){if(A==="le"||A==="be")X=A,A=10;this._init(U||0,A||10,X||"be")}}if(typeof E==="object")E.exports=Q;else L.BN=Q;Q.BN=Q,Q.wordSize=26;var T;try{if(typeof window<"u"&&typeof window.Buffer<"u")T=window.Buffer;else T=(DU(),l0(RU)).Buffer}catch(U){}Q.isBN=function(U){if(U instanceof Q)return!0;return U!==null&&typeof U==="object"&&U.constructor.wordSize===Q.wordSize&&Array.isArray(U.words)},Q.max=function(U,A){if(U.cmp(A)>0)return U;return A},Q.min=function(U,A){if(U.cmp(A)<0)return U;return A},Q.prototype._init=function(U,A,X){if(typeof U==="number")return this._initNumber(U,A,X);if(typeof U==="object")return this._initArray(U,A,X);if(A==="hex")A=16;S(A===(A|0)&&A>=2&&A<=36),U=U.toString().replace(/\s+/g,"");var Z=0;if(U[0]==="-")Z++,this.negative=1;if(Z<U.length){if(A===16)this._parseHex(U,Z,X);else if(this._parseBase(U,A,Z),X==="le")this._initArray(this.toArray(),A,X)}},Q.prototype._initNumber=function(U,A,X){if(U<0)this.negative=1,U=-U;if(U<67108864)this.words=[U&67108863],this.length=1;else if(U<4503599627370496)this.words=[U&67108863,U/67108864&67108863],this.length=2;else S(U<9007199254740992),this.words=[U&67108863,U/67108864&67108863,1],this.length=3;if(X!=="le")return;this._initArray(this.toArray(),A,X)},Q.prototype._initArray=function(U,A,X){if(S(typeof U.length==="number"),U.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(U.length/3),this.words=Array(this.length);for(var Z=0;Z<this.length;Z++)this.words[Z]=0;var C,Y,V=0;if(X==="be"){for(Z=U.length-1,C=0;Z>=0;Z-=3)if(Y=U[Z]|U[Z-1]<<8|U[Z-2]<<16,this.words[C]|=Y<<V&67108863,this.words[C+1]=Y>>>26-V&67108863,V+=24,V>=26)V-=26,C++}else if(X==="le"){for(Z=0,C=0;Z<U.length;Z+=3)if(Y=U[Z]|U[Z+1]<<8|U[Z+2]<<16,this.words[C]|=Y<<V&67108863,this.words[C+1]=Y>>>26-V&67108863,V+=24,V>=26)V-=26,C++}return this.strip()};function M(U,A){var X=U.charCodeAt(A);if(X>=65&&X<=70)return X-55;else if(X>=97&&X<=102)return X-87;else return X-48&15}function H(U,A,X){var Z=M(U,X);if(X-1>=A)Z|=M(U,X-1)<<4;return Z}Q.prototype._parseHex=function(U,A,X){this.length=Math.ceil((U.length-A)/6),this.words=Array(this.length);for(var Z=0;Z<this.length;Z++)this.words[Z]=0;var C=0,Y=0,V;if(X==="be")for(Z=U.length-1;Z>=A;Z-=2)if(V=H(U,A,Z)<<C,this.words[Y]|=V&67108863,C>=18)C-=18,Y+=1,this.words[Y]|=V>>>26;else C+=8;else{var G=U.length-A;for(Z=G%2===0?A+1:A;Z<U.length;Z+=2)if(V=H(U,A,Z)<<C,this.words[Y]|=V&67108863,C>=18)C-=18,Y+=1,this.words[Y]|=V>>>26;else C+=8}this.strip()};function F(U,A,X,Z){var C=0,Y=Math.min(U.length,X);for(var V=A;V<Y;V++){var G=U.charCodeAt(V)-48;if(C*=Z,G>=49)C+=G-49+10;else if(G>=17)C+=G-17+10;else C+=G}return C}Q.prototype._parseBase=function(U,A,X){this.words=[0],this.length=1;for(var Z=0,C=1;C<=67108863;C*=A)Z++;Z--,C=C/A|0;var Y=U.length-X,V=Y%Z,G=Math.min(Y,Y-V)+X,O=0;for(var J=X;J<G;J+=Z)if(O=F(U,J,J+Z,A),this.imuln(C),this.words[0]+O<67108864)this.words[0]+=O;else this._iaddn(O);if(V!==0){var z=1;O=F(U,J,U.length,A);for(J=0;J<V;J++)z*=A;if(this.imuln(z),this.words[0]+O<67108864)this.words[0]+=O;else this._iaddn(O)}this.strip()},Q.prototype.copy=function(U){U.words=Array(this.length);for(var A=0;A<this.length;A++)U.words[A]=this.words[A];U.length=this.length,U.negative=this.negative,U.red=this.red},Q.prototype.clone=function(){var U=new Q(null);return this.copy(U),U},Q.prototype._expand=function(U){while(this.length<U)this.words[this.length++]=0;return this},Q.prototype.strip=function(){while(this.length>1&&this.words[this.length-1]===0)this.length--;return this._normSign()},Q.prototype._normSign=function(){if(this.length===1&&this.words[0]===0)this.negative=0;return this},Q.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var R=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],D=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],q=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64000000,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,24300000,28629151,33554432,39135393,45435424,52521875,60466176];if(Q.prototype.toString=function(U,A){U=U||10,A=A|0||1;var X;if(U===16||U==="hex"){X="";var Z=0,C=0;for(var Y=0;Y<this.length;Y++){var V=this.words[Y],G=((V<<Z|C)&16777215).toString(16);if(C=V>>>24-Z&16777215,Z+=2,Z>=26)Z-=26,Y--;if(C!==0||Y!==this.length-1)X=R[6-G.length]+G+X;else X=G+X}if(C!==0)X=C.toString(16)+X;while(X.length%A!==0)X="0"+X;if(this.negative!==0)X="-"+X;return X}if(U===(U|0)&&U>=2&&U<=36){var O=D[U],J=q[U];X="";var z=this.clone();z.negative=0;while(!z.isZero()){var W=z.modn(J).toString(U);if(z=z.idivn(J),!z.isZero())X=R[O-W.length]+W+X;else X=W+X}if(this.isZero())X="0"+X;while(X.length%A!==0)X="0"+X;if(this.negative!==0)X="-"+X;return X}S(!1,"Base should be between 2 and 36")},Q.prototype.toNumber=function(){var U=this.words[0];if(this.length===2)U+=this.words[1]*67108864;else if(this.length===3&&this.words[2]===1)U+=4503599627370496+this.words[1]*67108864;else if(this.length>2)S(!1,"Number can only safely store up to 53 bits");return this.negative!==0?-U:U},Q.prototype.toJSON=function(){return this.toString(16)},Q.prototype.toBuffer=function(U,A){return S(typeof T<"u"),this.toArrayLike(T,U,A)},Q.prototype.toArray=function(U,A){return this.toArrayLike(Array,U,A)},Q.prototype.toArrayLike=function(U,A,X){var Z=this.byteLength(),C=X||Math.max(1,Z);S(Z<=C,"byte array longer than desired length"),S(C>0,"Requested array length <= 0"),this.strip();var Y=A==="le",V=new U(C),G,O,J=this.clone();if(!Y){for(O=0;O<C-Z;O++)V[O]=0;for(O=0;!J.isZero();O++)G=J.andln(255),J.iushrn(8),V[C-O-1]=G}else{for(O=0;!J.isZero();O++)G=J.andln(255),J.iushrn(8),V[O]=G;for(;O<C;O++)V[O]=0}return V},Math.clz32)Q.prototype._countBits=function(U){return 32-Math.clz32(U)};else Q.prototype._countBits=function(U){var A=U,X=0;if(A>=4096)X+=13,A>>>=13;if(A>=64)X+=7,A>>>=7;if(A>=8)X+=4,A>>>=4;if(A>=2)X+=2,A>>>=2;return X+A};Q.prototype._zeroBits=function(U){if(U===0)return 26;var A=U,X=0;if((A&8191)===0)X+=13,A>>>=13;if((A&127)===0)X+=7,A>>>=7;if((A&15)===0)X+=4,A>>>=4;if((A&3)===0)X+=2,A>>>=2;if((A&1)===0)X++;return X},Q.prototype.bitLength=function(){var U=this.words[this.length-1],A=this._countBits(U);return(this.length-1)*26+A};function P(U){var A=Array(U.bitLength());for(var X=0;X<A.length;X++){var Z=X/26|0,C=X%26;A[X]=(U.words[Z]&1<<C)>>>C}return A}Q.prototype.zeroBits=function(){if(this.isZero())return 0;var U=0;for(var A=0;A<this.length;A++){var X=this._zeroBits(this.words[A]);if(U+=X,X!==26)break}return U},Q.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},Q.prototype.toTwos=function(U){if(this.negative!==0)return this.abs().inotn(U).iaddn(1);return this.clone()},Q.prototype.fromTwos=function(U){if(this.testn(U-1))return this.notn(U).iaddn(1).ineg();return this.clone()},Q.prototype.isNeg=function(){return this.negative!==0},Q.prototype.neg=function(){return this.clone().ineg()},Q.prototype.ineg=function(){if(!this.isZero())this.negative^=1;return this},Q.prototype.iuor=function(U){while(this.length<U.length)this.words[this.length++]=0;for(var A=0;A<U.length;A++)this.words[A]=this.words[A]|U.words[A];return this.strip()},Q.prototype.ior=function(U){return S((this.negative|U.negative)===0),this.iuor(U)},Q.prototype.or=function(U){if(this.length>U.length)return this.clone().ior(U);return U.clone().ior(this)},Q.prototype.uor=function(U){if(this.length>U.length)return this.clone().iuor(U);return U.clone().iuor(this)},Q.prototype.iuand=function(U){var A;if(this.length>U.length)A=U;else A=this;for(var X=0;X<A.length;X++)this.words[X]=this.words[X]&U.words[X];return this.length=A.length,this.strip()},Q.prototype.iand=function(U){return S((this.negative|U.negative)===0),this.iuand(U)},Q.prototype.and=function(U){if(this.length>U.length)return this.clone().iand(U);return U.clone().iand(this)},Q.prototype.uand=function(U){if(this.length>U.length)return this.clone().iuand(U);return U.clone().iuand(this)},Q.prototype.iuxor=function(U){var A,X;if(this.length>U.length)A=this,X=U;else A=U,X=this;for(var Z=0;Z<X.length;Z++)this.words[Z]=A.words[Z]^X.words[Z];if(this!==A)for(;Z<A.length;Z++)this.words[Z]=A.words[Z];return this.length=A.length,this.strip()},Q.prototype.ixor=function(U){return S((this.negative|U.negative)===0),this.iuxor(U)},Q.prototype.xor=function(U){if(this.length>U.length)return this.clone().ixor(U);return U.clone().ixor(this)},Q.prototype.uxor=function(U){if(this.length>U.length)return this.clone().iuxor(U);return U.clone().iuxor(this)},Q.prototype.inotn=function(U){S(typeof U==="number"&&U>=0);var A=Math.ceil(U/26)|0,X=U%26;if(this._expand(A),X>0)A--;for(var Z=0;Z<A;Z++)this.words[Z]=~this.words[Z]&67108863;if(X>0)this.words[Z]=~this.words[Z]&67108863>>26-X;return this.strip()},Q.prototype.notn=function(U){return this.clone().inotn(U)},Q.prototype.setn=function(U,A){S(typeof U==="number"&&U>=0);var X=U/26|0,Z=U%26;if(this._expand(X+1),A)this.words[X]=this.words[X]|1<<Z;else this.words[X]=this.words[X]&~(1<<Z);return this.strip()},Q.prototype.iadd=function(U){var A;if(this.negative!==0&&U.negative===0)return this.negative=0,A=this.isub(U),this.negative^=1,this._normSign();else if(this.negative===0&&U.negative!==0)return U.negative=0,A=this.isub(U),U.negative=1,A._normSign();var X,Z;if(this.length>U.length)X=this,Z=U;else X=U,Z=this;var C=0;for(var Y=0;Y<Z.length;Y++)A=(X.words[Y]|0)+(Z.words[Y]|0)+C,this.words[Y]=A&67108863,C=A>>>26;for(;C!==0&&Y<X.length;Y++)A=(X.words[Y]|0)+C,this.words[Y]=A&67108863,C=A>>>26;if(this.length=X.length,C!==0)this.words[this.length]=C,this.length++;else if(X!==this)for(;Y<X.length;Y++)this.words[Y]=X.words[Y];return this},Q.prototype.add=function(U){var A;if(U.negative!==0&&this.negative===0)return U.negative=0,A=this.sub(U),U.negative^=1,A;else if(U.negative===0&&this.negative!==0)return this.negative=0,A=U.sub(this),this.negative=1,A;if(this.length>U.length)return this.clone().iadd(U);return U.clone().iadd(this)},Q.prototype.isub=function(U){if(U.negative!==0){U.negative=0;var A=this.iadd(U);return U.negative=1,A._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(U),this.negative=1,this._normSign();var X=this.cmp(U);if(X===0)return this.negative=0,this.length=1,this.words[0]=0,this;var Z,C;if(X>0)Z=this,C=U;else Z=U,C=this;var Y=0;for(var V=0;V<C.length;V++)A=(Z.words[V]|0)-(C.words[V]|0)+Y,Y=A>>26,this.words[V]=A&67108863;for(;Y!==0&&V<Z.length;V++)A=(Z.words[V]|0)+Y,Y=A>>26,this.words[V]=A&67108863;if(Y===0&&V<Z.length&&Z!==this)for(;V<Z.length;V++)this.words[V]=Z.words[V];if(this.length=Math.max(this.length,V),Z!==this)this.negative=1;return this.strip()},Q.prototype.sub=function(U){return this.clone().isub(U)};function _(U,A,X){X.negative=A.negative^U.negative;var Z=U.length+A.length|0;X.length=Z,Z=Z-1|0;var C=U.words[0]|0,Y=A.words[0]|0,V=C*Y,G=V&67108863,O=V/67108864|0;X.words[0]=G;for(var J=1;J<Z;J++){var z=O>>>26,W=O&67108863,j=Math.min(J,A.length-1);for(var N=Math.max(0,J-U.length+1);N<=j;N++){var p=J-N|0;C=U.words[p]|0,Y=A.words[N]|0,V=C*Y+W,z+=V/67108864|0,W=V&67108863}X.words[J]=W|0,O=z|0}if(O!==0)X.words[J]=O|0;else X.length--;return X.strip()}var k=function(U,A,X){var Z=U.words,C=A.words,Y=X.words,V=0,G,O,J,z=Z[0]|0,W=z&8191,j=z>>>13,N=Z[1]|0,p=N&8191,n=N>>>13,E0=Z[2]|0,r=E0&8191,d=E0>>>13,A0=Z[3]|0,t=A0&8191,i=A0>>>13,N0=Z[4]|0,y=N0&8191,h=N0>>>13,$0=Z[5]|0,m=$0&8191,a=$0>>>13,W0=Z[6]|0,c=W0&8191,o=W0>>>13,x0=Z[7]|0,s=x0&8191,Z0=x0>>>13,w0=Z[8]|0,S0=w0&8191,V0=w0>>>13,m0=Z[9]|0,J0=m0&8191,L0=m0>>>13,a0=C[0]|0,K0=a0&8191,D0=a0>>>13,WU=C[1]|0,F0=WU&8191,k0=WU>>>13,FU=C[2]|0,_0=FU&8191,M0=FU>>>13,KU=C[3]|0,j0=KU&8191,z0=KU>>>13,SU=C[4]|0,v0=SU&8191,B0=SU>>>13,VU=C[5]|0,T0=VU&8191,x=VU>>>13,l=C[6]|0,e=l&8191,U0=l>>>13,f0=C[7]|0,Y0=f0&8191,R0=f0>>>13,r0=C[8]|0,q0=r0&8191,g0=r0>>>13,HU=C[9]|0,P0=HU&8191,H0=HU>>>13;X.negative=U.negative^A.negative,X.length=19,G=Math.imul(W,K0),O=Math.imul(W,D0),O=O+Math.imul(j,K0)|0,J=Math.imul(j,D0);var e0=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(e0>>>26)|0,e0&=67108863,G=Math.imul(p,K0),O=Math.imul(p,D0),O=O+Math.imul(n,K0)|0,J=Math.imul(n,D0),G=G+Math.imul(W,F0)|0,O=O+Math.imul(W,k0)|0,O=O+Math.imul(j,F0)|0,J=J+Math.imul(j,k0)|0;var c0=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(c0>>>26)|0,c0&=67108863,G=Math.imul(r,K0),O=Math.imul(r,D0),O=O+Math.imul(d,K0)|0,J=Math.imul(d,D0),G=G+Math.imul(p,F0)|0,O=O+Math.imul(p,k0)|0,O=O+Math.imul(n,F0)|0,J=J+Math.imul(n,k0)|0,G=G+Math.imul(W,_0)|0,O=O+Math.imul(W,M0)|0,O=O+Math.imul(j,_0)|0,J=J+Math.imul(j,M0)|0;var y0=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(y0>>>26)|0,y0&=67108863,G=Math.imul(t,K0),O=Math.imul(t,D0),O=O+Math.imul(i,K0)|0,J=Math.imul(i,D0),G=G+Math.imul(r,F0)|0,O=O+Math.imul(r,k0)|0,O=O+Math.imul(d,F0)|0,J=J+Math.imul(d,k0)|0,G=G+Math.imul(p,_0)|0,O=O+Math.imul(p,M0)|0,O=O+Math.imul(n,_0)|0,J=J+Math.imul(n,M0)|0,G=G+Math.imul(W,j0)|0,O=O+Math.imul(W,z0)|0,O=O+Math.imul(j,j0)|0,J=J+Math.imul(j,z0)|0;var o0=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(o0>>>26)|0,o0&=67108863,G=Math.imul(y,K0),O=Math.imul(y,D0),O=O+Math.imul(h,K0)|0,J=Math.imul(h,D0),G=G+Math.imul(t,F0)|0,O=O+Math.imul(t,k0)|0,O=O+Math.imul(i,F0)|0,J=J+Math.imul(i,k0)|0,G=G+Math.imul(r,_0)|0,O=O+Math.imul(r,M0)|0,O=O+Math.imul(d,_0)|0,J=J+Math.imul(d,M0)|0,G=G+Math.imul(p,j0)|0,O=O+Math.imul(p,z0)|0,O=O+Math.imul(n,j0)|0,J=J+Math.imul(n,z0)|0,G=G+Math.imul(W,v0)|0,O=O+Math.imul(W,B0)|0,O=O+Math.imul(j,v0)|0,J=J+Math.imul(j,B0)|0;var b0=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(b0>>>26)|0,b0&=67108863,G=Math.imul(m,K0),O=Math.imul(m,D0),O=O+Math.imul(a,K0)|0,J=Math.imul(a,D0),G=G+Math.imul(y,F0)|0,O=O+Math.imul(y,k0)|0,O=O+Math.imul(h,F0)|0,J=J+Math.imul(h,k0)|0,G=G+Math.imul(t,_0)|0,O=O+Math.imul(t,M0)|0,O=O+Math.imul(i,_0)|0,J=J+Math.imul(i,M0)|0,G=G+Math.imul(r,j0)|0,O=O+Math.imul(r,z0)|0,O=O+Math.imul(d,j0)|0,J=J+Math.imul(d,z0)|0,G=G+Math.imul(p,v0)|0,O=O+Math.imul(p,B0)|0,O=O+Math.imul(n,v0)|0,J=J+Math.imul(n,B0)|0,G=G+Math.imul(W,T0)|0,O=O+Math.imul(W,x)|0,O=O+Math.imul(j,T0)|0,J=J+Math.imul(j,x)|0;var i0=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(i0>>>26)|0,i0&=67108863,G=Math.imul(c,K0),O=Math.imul(c,D0),O=O+Math.imul(o,K0)|0,J=Math.imul(o,D0),G=G+Math.imul(m,F0)|0,O=O+Math.imul(m,k0)|0,O=O+Math.imul(a,F0)|0,J=J+Math.imul(a,k0)|0,G=G+Math.imul(y,_0)|0,O=O+Math.imul(y,M0)|0,O=O+Math.imul(h,_0)|0,J=J+Math.imul(h,M0)|0,G=G+Math.imul(t,j0)|0,O=O+Math.imul(t,z0)|0,O=O+Math.imul(i,j0)|0,J=J+Math.imul(i,z0)|0,G=G+Math.imul(r,v0)|0,O=O+Math.imul(r,B0)|0,O=O+Math.imul(d,v0)|0,J=J+Math.imul(d,B0)|0,G=G+Math.imul(p,T0)|0,O=O+Math.imul(p,x)|0,O=O+Math.imul(n,T0)|0,J=J+Math.imul(n,x)|0,G=G+Math.imul(W,e)|0,O=O+Math.imul(W,U0)|0,O=O+Math.imul(j,e)|0,J=J+Math.imul(j,U0)|0;var UU=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(UU>>>26)|0,UU&=67108863,G=Math.imul(s,K0),O=Math.imul(s,D0),O=O+Math.imul(Z0,K0)|0,J=Math.imul(Z0,D0),G=G+Math.imul(c,F0)|0,O=O+Math.imul(c,k0)|0,O=O+Math.imul(o,F0)|0,J=J+Math.imul(o,k0)|0,G=G+Math.imul(m,_0)|0,O=O+Math.imul(m,M0)|0,O=O+Math.imul(a,_0)|0,J=J+Math.imul(a,M0)|0,G=G+Math.imul(y,j0)|0,O=O+Math.imul(y,z0)|0,O=O+Math.imul(h,j0)|0,J=J+Math.imul(h,z0)|0,G=G+Math.imul(t,v0)|0,O=O+Math.imul(t,B0)|0,O=O+Math.imul(i,v0)|0,J=J+Math.imul(i,B0)|0,G=G+Math.imul(r,T0)|0,O=O+Math.imul(r,x)|0,O=O+Math.imul(d,T0)|0,J=J+Math.imul(d,x)|0,G=G+Math.imul(p,e)|0,O=O+Math.imul(p,U0)|0,O=O+Math.imul(n,e)|0,J=J+Math.imul(n,U0)|0,G=G+Math.imul(W,Y0)|0,O=O+Math.imul(W,R0)|0,O=O+Math.imul(j,Y0)|0,J=J+Math.imul(j,R0)|0;var OU=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(OU>>>26)|0,OU&=67108863,G=Math.imul(S0,K0),O=Math.imul(S0,D0),O=O+Math.imul(V0,K0)|0,J=Math.imul(V0,D0),G=G+Math.imul(s,F0)|0,O=O+Math.imul(s,k0)|0,O=O+Math.imul(Z0,F0)|0,J=J+Math.imul(Z0,k0)|0,G=G+Math.imul(c,_0)|0,O=O+Math.imul(c,M0)|0,O=O+Math.imul(o,_0)|0,J=J+Math.imul(o,M0)|0,G=G+Math.imul(m,j0)|0,O=O+Math.imul(m,z0)|0,O=O+Math.imul(a,j0)|0,J=J+Math.imul(a,z0)|0,G=G+Math.imul(y,v0)|0,O=O+Math.imul(y,B0)|0,O=O+Math.imul(h,v0)|0,J=J+Math.imul(h,B0)|0,G=G+Math.imul(t,T0)|0,O=O+Math.imul(t,x)|0,O=O+Math.imul(i,T0)|0,J=J+Math.imul(i,x)|0,G=G+Math.imul(r,e)|0,O=O+Math.imul(r,U0)|0,O=O+Math.imul(d,e)|0,J=J+Math.imul(d,U0)|0,G=G+Math.imul(p,Y0)|0,O=O+Math.imul(p,R0)|0,O=O+Math.imul(n,Y0)|0,J=J+Math.imul(n,R0)|0,G=G+Math.imul(W,q0)|0,O=O+Math.imul(W,g0)|0,O=O+Math.imul(j,q0)|0,J=J+Math.imul(j,g0)|0;var ZU=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(ZU>>>26)|0,ZU&=67108863,G=Math.imul(J0,K0),O=Math.imul(J0,D0),O=O+Math.imul(L0,K0)|0,J=Math.imul(L0,D0),G=G+Math.imul(S0,F0)|0,O=O+Math.imul(S0,k0)|0,O=O+Math.imul(V0,F0)|0,J=J+Math.imul(V0,k0)|0,G=G+Math.imul(s,_0)|0,O=O+Math.imul(s,M0)|0,O=O+Math.imul(Z0,_0)|0,J=J+Math.imul(Z0,M0)|0,G=G+Math.imul(c,j0)|0,O=O+Math.imul(c,z0)|0,O=O+Math.imul(o,j0)|0,J=J+Math.imul(o,z0)|0,G=G+Math.imul(m,v0)|0,O=O+Math.imul(m,B0)|0,O=O+Math.imul(a,v0)|0,J=J+Math.imul(a,B0)|0,G=G+Math.imul(y,T0)|0,O=O+Math.imul(y,x)|0,O=O+Math.imul(h,T0)|0,J=J+Math.imul(h,x)|0,G=G+Math.imul(t,e)|0,O=O+Math.imul(t,U0)|0,O=O+Math.imul(i,e)|0,J=J+Math.imul(i,U0)|0,G=G+Math.imul(r,Y0)|0,O=O+Math.imul(r,R0)|0,O=O+Math.imul(d,Y0)|0,J=J+Math.imul(d,R0)|0,G=G+Math.imul(p,q0)|0,O=O+Math.imul(p,g0)|0,O=O+Math.imul(n,q0)|0,J=J+Math.imul(n,g0)|0,G=G+Math.imul(W,P0)|0,O=O+Math.imul(W,H0)|0,O=O+Math.imul(j,P0)|0,J=J+Math.imul(j,H0)|0;var AU=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(AU>>>26)|0,AU&=67108863,G=Math.imul(J0,F0),O=Math.imul(J0,k0),O=O+Math.imul(L0,F0)|0,J=Math.imul(L0,k0),G=G+Math.imul(S0,_0)|0,O=O+Math.imul(S0,M0)|0,O=O+Math.imul(V0,_0)|0,J=J+Math.imul(V0,M0)|0,G=G+Math.imul(s,j0)|0,O=O+Math.imul(s,z0)|0,O=O+Math.imul(Z0,j0)|0,J=J+Math.imul(Z0,z0)|0,G=G+Math.imul(c,v0)|0,O=O+Math.imul(c,B0)|0,O=O+Math.imul(o,v0)|0,J=J+Math.imul(o,B0)|0,G=G+Math.imul(m,T0)|0,O=O+Math.imul(m,x)|0,O=O+Math.imul(a,T0)|0,J=J+Math.imul(a,x)|0,G=G+Math.imul(y,e)|0,O=O+Math.imul(y,U0)|0,O=O+Math.imul(h,e)|0,J=J+Math.imul(h,U0)|0,G=G+Math.imul(t,Y0)|0,O=O+Math.imul(t,R0)|0,O=O+Math.imul(i,Y0)|0,J=J+Math.imul(i,R0)|0,G=G+Math.imul(r,q0)|0,O=O+Math.imul(r,g0)|0,O=O+Math.imul(d,q0)|0,J=J+Math.imul(d,g0)|0,G=G+Math.imul(p,P0)|0,O=O+Math.imul(p,H0)|0,O=O+Math.imul(n,P0)|0,J=J+Math.imul(n,H0)|0;var $U=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+($U>>>26)|0,$U&=67108863,G=Math.imul(J0,_0),O=Math.imul(J0,M0),O=O+Math.imul(L0,_0)|0,J=Math.imul(L0,M0),G=G+Math.imul(S0,j0)|0,O=O+Math.imul(S0,z0)|0,O=O+Math.imul(V0,j0)|0,J=J+Math.imul(V0,z0)|0,G=G+Math.imul(s,v0)|0,O=O+Math.imul(s,B0)|0,O=O+Math.imul(Z0,v0)|0,J=J+Math.imul(Z0,B0)|0,G=G+Math.imul(c,T0)|0,O=O+Math.imul(c,x)|0,O=O+Math.imul(o,T0)|0,J=J+Math.imul(o,x)|0,G=G+Math.imul(m,e)|0,O=O+Math.imul(m,U0)|0,O=O+Math.imul(a,e)|0,J=J+Math.imul(a,U0)|0,G=G+Math.imul(y,Y0)|0,O=O+Math.imul(y,R0)|0,O=O+Math.imul(h,Y0)|0,J=J+Math.imul(h,R0)|0,G=G+Math.imul(t,q0)|0,O=O+Math.imul(t,g0)|0,O=O+Math.imul(i,q0)|0,J=J+Math.imul(i,g0)|0,G=G+Math.imul(r,P0)|0,O=O+Math.imul(r,H0)|0,O=O+Math.imul(d,P0)|0,J=J+Math.imul(d,H0)|0;var IU=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(IU>>>26)|0,IU&=67108863,G=Math.imul(J0,j0),O=Math.imul(J0,z0),O=O+Math.imul(L0,j0)|0,J=Math.imul(L0,z0),G=G+Math.imul(S0,v0)|0,O=O+Math.imul(S0,B0)|0,O=O+Math.imul(V0,v0)|0,J=J+Math.imul(V0,B0)|0,G=G+Math.imul(s,T0)|0,O=O+Math.imul(s,x)|0,O=O+Math.imul(Z0,T0)|0,J=J+Math.imul(Z0,x)|0,G=G+Math.imul(c,e)|0,O=O+Math.imul(c,U0)|0,O=O+Math.imul(o,e)|0,J=J+Math.imul(o,U0)|0,G=G+Math.imul(m,Y0)|0,O=O+Math.imul(m,R0)|0,O=O+Math.imul(a,Y0)|0,J=J+Math.imul(a,R0)|0,G=G+Math.imul(y,q0)|0,O=O+Math.imul(y,g0)|0,O=O+Math.imul(h,q0)|0,J=J+Math.imul(h,g0)|0,G=G+Math.imul(t,P0)|0,O=O+Math.imul(t,H0)|0,O=O+Math.imul(i,P0)|0,J=J+Math.imul(i,H0)|0;var CU=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(CU>>>26)|0,CU&=67108863,G=Math.imul(J0,v0),O=Math.imul(J0,B0),O=O+Math.imul(L0,v0)|0,J=Math.imul(L0,B0),G=G+Math.imul(S0,T0)|0,O=O+Math.imul(S0,x)|0,O=O+Math.imul(V0,T0)|0,J=J+Math.imul(V0,x)|0,G=G+Math.imul(s,e)|0,O=O+Math.imul(s,U0)|0,O=O+Math.imul(Z0,e)|0,J=J+Math.imul(Z0,U0)|0,G=G+Math.imul(c,Y0)|0,O=O+Math.imul(c,R0)|0,O=O+Math.imul(o,Y0)|0,J=J+Math.imul(o,R0)|0,G=G+Math.imul(m,q0)|0,O=O+Math.imul(m,g0)|0,O=O+Math.imul(a,q0)|0,J=J+Math.imul(a,g0)|0,G=G+Math.imul(y,P0)|0,O=O+Math.imul(y,H0)|0,O=O+Math.imul(h,P0)|0,J=J+Math.imul(h,H0)|0;var QU=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(QU>>>26)|0,QU&=67108863,G=Math.imul(J0,T0),O=Math.imul(J0,x),O=O+Math.imul(L0,T0)|0,J=Math.imul(L0,x),G=G+Math.imul(S0,e)|0,O=O+Math.imul(S0,U0)|0,O=O+Math.imul(V0,e)|0,J=J+Math.imul(V0,U0)|0,G=G+Math.imul(s,Y0)|0,O=O+Math.imul(s,R0)|0,O=O+Math.imul(Z0,Y0)|0,J=J+Math.imul(Z0,R0)|0,G=G+Math.imul(c,q0)|0,O=O+Math.imul(c,g0)|0,O=O+Math.imul(o,q0)|0,J=J+Math.imul(o,g0)|0,G=G+Math.imul(m,P0)|0,O=O+Math.imul(m,H0)|0,O=O+Math.imul(a,P0)|0,J=J+Math.imul(a,H0)|0;var XU=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(XU>>>26)|0,XU&=67108863,G=Math.imul(J0,e),O=Math.imul(J0,U0),O=O+Math.imul(L0,e)|0,J=Math.imul(L0,U0),G=G+Math.imul(S0,Y0)|0,O=O+Math.imul(S0,R0)|0,O=O+Math.imul(V0,Y0)|0,J=J+Math.imul(V0,R0)|0,G=G+Math.imul(s,q0)|0,O=O+Math.imul(s,g0)|0,O=O+Math.imul(Z0,q0)|0,J=J+Math.imul(Z0,g0)|0,G=G+Math.imul(c,P0)|0,O=O+Math.imul(c,H0)|0,O=O+Math.imul(o,P0)|0,J=J+Math.imul(o,H0)|0;var GU=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(GU>>>26)|0,GU&=67108863,G=Math.imul(J0,Y0),O=Math.imul(J0,R0),O=O+Math.imul(L0,Y0)|0,J=Math.imul(L0,R0),G=G+Math.imul(S0,q0)|0,O=O+Math.imul(S0,g0)|0,O=O+Math.imul(V0,q0)|0,J=J+Math.imul(V0,g0)|0,G=G+Math.imul(s,P0)|0,O=O+Math.imul(s,H0)|0,O=O+Math.imul(Z0,P0)|0,J=J+Math.imul(Z0,H0)|0;var EU=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(EU>>>26)|0,EU&=67108863,G=Math.imul(J0,q0),O=Math.imul(J0,g0),O=O+Math.imul(L0,q0)|0,J=Math.imul(L0,g0),G=G+Math.imul(S0,P0)|0,O=O+Math.imul(S0,H0)|0,O=O+Math.imul(V0,P0)|0,J=J+Math.imul(V0,H0)|0;var JU=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(JU>>>26)|0,JU&=67108863,G=Math.imul(J0,P0),O=Math.imul(J0,H0),O=O+Math.imul(L0,P0)|0,J=Math.imul(L0,H0);var YU=(V+G|0)+((O&8191)<<13)|0;if(V=(J+(O>>>13)|0)+(YU>>>26)|0,YU&=67108863,Y[0]=e0,Y[1]=c0,Y[2]=y0,Y[3]=o0,Y[4]=b0,Y[5]=i0,Y[6]=UU,Y[7]=OU,Y[8]=ZU,Y[9]=AU,Y[10]=$U,Y[11]=IU,Y[12]=CU,Y[13]=QU,Y[14]=XU,Y[15]=GU,Y[16]=EU,Y[17]=JU,Y[18]=YU,V!==0)Y[19]=V,X.length++;return X};if(!Math.imul)k=_;function B(U,A,X){X.negative=A.negative^U.negative,X.length=U.length+A.length;var Z=0,C=0;for(var Y=0;Y<X.length-1;Y++){var V=C;C=0;var G=Z&67108863,O=Math.min(Y,A.length-1);for(var J=Math.max(0,Y-U.length+1);J<=O;J++){var z=Y-J,W=U.words[z]|0,j=A.words[J]|0,N=W*j,p=N&67108863;V=V+(N/67108864|0)|0,p=p+G|0,G=p&67108863,V=V+(p>>>26)|0,C+=V>>>26,V&=67108863}X.words[Y]=G,Z=V,V=C}if(Z!==0)X.words[Y]=Z;else X.length--;return X.strip()}function v(U,A,X){var Z=new g;return Z.mulp(U,A,X)}Q.prototype.mulTo=function(U,A){var X,Z=this.length+U.length;if(this.length===10&&U.length===10)X=k(this,U,A);else if(Z<63)X=_(this,U,A);else if(Z<1024)X=B(this,U,A);else X=v(this,U,A);return X};function g(U,A){this.x=U,this.y=A}g.prototype.makeRBT=function(U){var A=Array(U),X=Q.prototype._countBits(U)-1;for(var Z=0;Z<U;Z++)A[Z]=this.revBin(Z,X,U);return A},g.prototype.revBin=function(U,A,X){if(U===0||U===X-1)return U;var Z=0;for(var C=0;C<A;C++)Z|=(U&1)<<A-C-1,U>>=1;return Z},g.prototype.permute=function(U,A,X,Z,C,Y){for(var V=0;V<Y;V++)Z[V]=A[U[V]],C[V]=X[U[V]]},g.prototype.transform=function(U,A,X,Z,C,Y){this.permute(Y,U,A,X,Z,C);for(var V=1;V<C;V<<=1){var G=V<<1,O=Math.cos(2*Math.PI/G),J=Math.sin(2*Math.PI/G);for(var z=0;z<C;z+=G){var W=O,j=J;for(var N=0;N<V;N++){var p=X[z+N],n=Z[z+N],E0=X[z+N+V],r=Z[z+N+V],d=W*E0-j*r;if(r=W*r+j*E0,E0=d,X[z+N]=p+E0,Z[z+N]=n+r,X[z+N+V]=p-E0,Z[z+N+V]=n-r,N!==G)d=O*W-J*j,j=O*j+J*W,W=d}}}},g.prototype.guessLen13b=function(U,A){var X=Math.max(A,U)|1,Z=X&1,C=0;for(X=X/2|0;X;X=X>>>1)C++;return 1<<C+1+Z},g.prototype.conjugate=function(U,A,X){if(X<=1)return;for(var Z=0;Z<X/2;Z++){var C=U[Z];U[Z]=U[X-Z-1],U[X-Z-1]=C,C=A[Z],A[Z]=-A[X-Z-1],A[X-Z-1]=-C}},g.prototype.normalize13b=function(U,A){var X=0;for(var Z=0;Z<A/2;Z++){var C=Math.round(U[2*Z+1]/A)*8192+Math.round(U[2*Z]/A)+X;if(U[Z]=C&67108863,C<67108864)X=0;else X=C/67108864|0}return U},g.prototype.convert13b=function(U,A,X,Z){var C=0;for(var Y=0;Y<A;Y++)C=C+(U[Y]|0),X[2*Y]=C&8191,C=C>>>13,X[2*Y+1]=C&8191,C=C>>>13;for(Y=2*A;Y<Z;++Y)X[Y]=0;S(C===0),S((C&-8192)===0)},g.prototype.stub=function(U){var A=Array(U);for(var X=0;X<U;X++)A[X]=0;return A},g.prototype.mulp=function(U,A,X){var Z=2*this.guessLen13b(U.length,A.length),C=this.makeRBT(Z),Y=this.stub(Z),V=Array(Z),G=Array(Z),O=Array(Z),J=Array(Z),z=Array(Z),W=Array(Z),j=X.words;j.length=Z,this.convert13b(U.words,U.length,V,Z),this.convert13b(A.words,A.length,J,Z),this.transform(V,Y,G,O,Z,C),this.transform(J,Y,z,W,Z,C);for(var N=0;N<Z;N++){var p=G[N]*z[N]-O[N]*W[N];O[N]=G[N]*W[N]+O[N]*z[N],G[N]=p}return this.conjugate(G,O,Z),this.transform(G,O,j,Y,Z,C),this.conjugate(j,Y,Z),this.normalize13b(j,Z),X.negative=U.negative^A.negative,X.length=U.length+A.length,X.strip()},Q.prototype.mul=function(U){var A=new Q(null);return A.words=Array(this.length+U.length),this.mulTo(U,A)},Q.prototype.mulf=function(U){var A=new Q(null);return A.words=Array(this.length+U.length),v(this,U,A)},Q.prototype.imul=function(U){return this.clone().mulTo(U,this)},Q.prototype.imuln=function(U){S(typeof U==="number"),S(U<67108864);var A=0;for(var X=0;X<this.length;X++){var Z=(this.words[X]|0)*U,C=(Z&67108863)+(A&67108863);A>>=26,A+=Z/67108864|0,A+=C>>>26,this.words[X]=C&67108863}if(A!==0)this.words[X]=A,this.length++;return this.length=U===0?1:this.length,this},Q.prototype.muln=function(U){return this.clone().imuln(U)},Q.prototype.sqr=function(){return this.mul(this)},Q.prototype.isqr=function(){return this.imul(this.clone())},Q.prototype.pow=function(U){var A=P(U);if(A.length===0)return new Q(1);var X=this;for(var Z=0;Z<A.length;Z++,X=X.sqr())if(A[Z]!==0)break;if(++Z<A.length)for(var C=X.sqr();Z<A.length;Z++,C=C.sqr()){if(A[Z]===0)continue;X=X.mul(C)}return X},Q.prototype.iushln=function(U){S(typeof U==="number"&&U>=0);var A=U%26,X=(U-A)/26,Z=67108863>>>26-A<<26-A,C;if(A!==0){var Y=0;for(C=0;C<this.length;C++){var V=this.words[C]&Z,G=(this.words[C]|0)-V<<A;this.words[C]=G|Y,Y=V>>>26-A}if(Y)this.words[C]=Y,this.length++}if(X!==0){for(C=this.length-1;C>=0;C--)this.words[C+X]=this.words[C];for(C=0;C<X;C++)this.words[C]=0;this.length+=X}return this.strip()},Q.prototype.ishln=function(U){return S(this.negative===0),this.iushln(U)},Q.prototype.iushrn=function(U,A,X){S(typeof U==="number"&&U>=0);var Z;if(A)Z=(A-A%26)/26;else Z=0;var C=U%26,Y=Math.min((U-C)/26,this.length),V=67108863^67108863>>>C<<C,G=X;if(Z-=Y,Z=Math.max(0,Z),G){for(var O=0;O<Y;O++)G.words[O]=this.words[O];G.length=Y}if(Y===0);else if(this.length>Y){this.length-=Y;for(O=0;O<this.length;O++)this.words[O]=this.words[O+Y]}else this.words[0]=0,this.length=1;var J=0;for(O=this.length-1;O>=0&&(J!==0||O>=Z);O--){var z=this.words[O]|0;this.words[O]=J<<26-C|z>>>C,J=z&V}if(G&&J!==0)G.words[G.length++]=J;if(this.length===0)this.words[0]=0,this.length=1;return this.strip()},Q.prototype.ishrn=function(U,A,X){return S(this.negative===0),this.iushrn(U,A,X)},Q.prototype.shln=function(U){return this.clone().ishln(U)},Q.prototype.ushln=function(U){return this.clone().iushln(U)},Q.prototype.shrn=function(U){return this.clone().ishrn(U)},Q.prototype.ushrn=function(U){return this.clone().iushrn(U)},Q.prototype.testn=function(U){S(typeof U==="number"&&U>=0);var A=U%26,X=(U-A)/26,Z=1<<A;if(this.length<=X)return!1;var C=this.words[X];return!!(C&Z)},Q.prototype.imaskn=function(U){S(typeof U==="number"&&U>=0);var A=U%26,X=(U-A)/26;if(S(this.negative===0,"imaskn works only with positive numbers"),this.length<=X)return this;if(A!==0)X++;if(this.length=Math.min(X,this.length),A!==0){var Z=67108863^67108863>>>A<<A;this.words[this.length-1]&=Z}return this.strip()},Q.prototype.maskn=function(U){return this.clone().imaskn(U)},Q.prototype.iaddn=function(U){if(S(typeof U==="number"),S(U<67108864),U<0)return this.isubn(-U);if(this.negative!==0){if(this.length===1&&(this.words[0]|0)<U)return this.words[0]=U-(this.words[0]|0),this.negative=0,this;return this.negative=0,this.isubn(U),this.negative=1,this}return this._iaddn(U)},Q.prototype._iaddn=function(U){this.words[0]+=U;for(var A=0;A<this.length&&this.words[A]>=67108864;A++)if(this.words[A]-=67108864,A===this.length-1)this.words[A+1]=1;else this.words[A+1]++;return this.length=Math.max(this.length,A+1),this},Q.prototype.isubn=function(U){if(S(typeof U==="number"),S(U<67108864),U<0)return this.iaddn(-U);if(this.negative!==0)return this.negative=0,this.iaddn(U),this.negative=1,this;if(this.words[0]-=U,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var A=0;A<this.length&&this.words[A]<0;A++)this.words[A]+=67108864,this.words[A+1]-=1;return this.strip()},Q.prototype.addn=function(U){return this.clone().iaddn(U)},Q.prototype.subn=function(U){return this.clone().isubn(U)},Q.prototype.iabs=function(){return this.negative=0,this},Q.prototype.abs=function(){return this.clone().iabs()},Q.prototype._ishlnsubmul=function(U,A,X){var Z=U.length+X,C;this._expand(Z);var Y,V=0;for(C=0;C<U.length;C++){Y=(this.words[C+X]|0)+V;var G=(U.words[C]|0)*A;Y-=G&67108863,V=(Y>>26)-(G/67108864|0),this.words[C+X]=Y&67108863}for(;C<this.length-X;C++)Y=(this.words[C+X]|0)+V,V=Y>>26,this.words[C+X]=Y&67108863;if(V===0)return this.strip();S(V===-1),V=0;for(C=0;C<this.length;C++)Y=-(this.words[C]|0)+V,V=Y>>26,this.words[C]=Y&67108863;return this.negative=1,this.strip()},Q.prototype._wordDiv=function(U,A){var X=this.length-U.length,Z=this.clone(),C=U,Y=C.words[C.length-1]|0,V=this._countBits(Y);if(X=26-V,X!==0)C=C.ushln(X),Z.iushln(X),Y=C.words[C.length-1]|0;var G=Z.length-C.length,O;if(A!=="mod"){O=new Q(null),O.length=G+1,O.words=Array(O.length);for(var J=0;J<O.length;J++)O.words[J]=0}var z=Z.clone()._ishlnsubmul(C,1,G);if(z.negative===0){if(Z=z,O)O.words[G]=1}for(var W=G-1;W>=0;W--){var j=(Z.words[C.length+W]|0)*67108864+(Z.words[C.length+W-1]|0);j=Math.min(j/Y|0,67108863),Z._ishlnsubmul(C,j,W);while(Z.negative!==0)if(j--,Z.negative=0,Z._ishlnsubmul(C,1,W),!Z.isZero())Z.negative^=1;if(O)O.words[W]=j}if(O)O.strip();if(Z.strip(),A!=="div"&&X!==0)Z.iushrn(X);return{div:O||null,mod:Z}},Q.prototype.divmod=function(U,A,X){if(S(!U.isZero()),this.isZero())return{div:new Q(0),mod:new Q(0)};var Z,C,Y;if(this.negative!==0&&U.negative===0){if(Y=this.neg().divmod(U,A),A!=="mod")Z=Y.div.neg();if(A!=="div"){if(C=Y.mod.neg(),X&&C.negative!==0)C.iadd(U)}return{div:Z,mod:C}}if(this.negative===0&&U.negative!==0){if(Y=this.divmod(U.neg(),A),A!=="mod")Z=Y.div.neg();return{div:Z,mod:Y.mod}}if((this.negative&U.negative)!==0){if(Y=this.neg().divmod(U.neg(),A),A!=="div"){if(C=Y.mod.neg(),X&&C.negative!==0)C.isub(U)}return{div:Y.div,mod:C}}if(U.length>this.length||this.cmp(U)<0)return{div:new Q(0),mod:this};if(U.length===1){if(A==="div")return{div:this.divn(U.words[0]),mod:null};if(A==="mod")return{div:null,mod:new Q(this.modn(U.words[0]))};return{div:this.divn(U.words[0]),mod:new Q(this.modn(U.words[0]))}}return this._wordDiv(U,A)},Q.prototype.div=function(U){return this.divmod(U,"div",!1).div},Q.prototype.mod=function(U){return this.divmod(U,"mod",!1).mod},Q.prototype.umod=function(U){return this.divmod(U,"mod",!0).mod},Q.prototype.divRound=function(U){var A=this.divmod(U);if(A.mod.isZero())return A.div;var X=A.div.negative!==0?A.mod.isub(U):A.mod,Z=U.ushrn(1),C=U.andln(1),Y=X.cmp(Z);if(Y<0||C===1&&Y===0)return A.div;return A.div.negative!==0?A.div.isubn(1):A.div.iaddn(1)},Q.prototype.modn=function(U){S(U<=67108863);var A=67108864%U,X=0;for(var Z=this.length-1;Z>=0;Z--)X=(A*X+(this.words[Z]|0))%U;return X},Q.prototype.idivn=function(U){S(U<=67108863);var A=0;for(var X=this.length-1;X>=0;X--){var Z=(this.words[X]|0)+A*67108864;this.words[X]=Z/U|0,A=Z%U}return this.strip()},Q.prototype.divn=function(U){return this.clone().idivn(U)},Q.prototype.egcd=function(U){S(U.negative===0),S(!U.isZero());var A=this,X=U.clone();if(A.negative!==0)A=A.umod(U);else A=A.clone();var Z=new Q(1),C=new Q(0),Y=new Q(0),V=new Q(1),G=0;while(A.isEven()&&X.isEven())A.iushrn(1),X.iushrn(1),++G;var O=X.clone(),J=A.clone();while(!A.isZero()){for(var z=0,W=1;(A.words[0]&W)===0&&z<26;++z,W<<=1);if(z>0){A.iushrn(z);while(z-- >0){if(Z.isOdd()||C.isOdd())Z.iadd(O),C.isub(J);Z.iushrn(1),C.iushrn(1)}}for(var j=0,N=1;(X.words[0]&N)===0&&j<26;++j,N<<=1);if(j>0){X.iushrn(j);while(j-- >0){if(Y.isOdd()||V.isOdd())Y.iadd(O),V.isub(J);Y.iushrn(1),V.iushrn(1)}}if(A.cmp(X)>=0)A.isub(X),Z.isub(Y),C.isub(V);else X.isub(A),Y.isub(Z),V.isub(C)}return{a:Y,b:V,gcd:X.iushln(G)}},Q.prototype._invmp=function(U){S(U.negative===0),S(!U.isZero());var A=this,X=U.clone();if(A.negative!==0)A=A.umod(U);else A=A.clone();var Z=new Q(1),C=new Q(0),Y=X.clone();while(A.cmpn(1)>0&&X.cmpn(1)>0){for(var V=0,G=1;(A.words[0]&G)===0&&V<26;++V,G<<=1);if(V>0){A.iushrn(V);while(V-- >0){if(Z.isOdd())Z.iadd(Y);Z.iushrn(1)}}for(var O=0,J=1;(X.words[0]&J)===0&&O<26;++O,J<<=1);if(O>0){X.iushrn(O);while(O-- >0){if(C.isOdd())C.iadd(Y);C.iushrn(1)}}if(A.cmp(X)>=0)A.isub(X),Z.isub(C);else X.isub(A),C.isub(Z)}var z;if(A.cmpn(1)===0)z=Z;else z=C;if(z.cmpn(0)<0)z.iadd(U);return z},Q.prototype.gcd=function(U){if(this.isZero())return U.abs();if(U.isZero())return this.abs();var A=this.clone(),X=U.clone();A.negative=0,X.negative=0;for(var Z=0;A.isEven()&&X.isEven();Z++)A.iushrn(1),X.iushrn(1);do{while(A.isEven())A.iushrn(1);while(X.isEven())X.iushrn(1);var C=A.cmp(X);if(C<0){var Y=A;A=X,X=Y}else if(C===0||X.cmpn(1)===0)break;A.isub(X)}while(!0);return X.iushln(Z)},Q.prototype.invm=function(U){return this.egcd(U).a.umod(U)},Q.prototype.isEven=function(){return(this.words[0]&1)===0},Q.prototype.isOdd=function(){return(this.words[0]&1)===1},Q.prototype.andln=function(U){return this.words[0]&U},Q.prototype.bincn=function(U){S(typeof U==="number");var A=U%26,X=(U-A)/26,Z=1<<A;if(this.length<=X)return this._expand(X+1),this.words[X]|=Z,this;var C=Z;for(var Y=X;C!==0&&Y<this.length;Y++){var V=this.words[Y]|0;V+=C,C=V>>>26,V&=67108863,this.words[Y]=V}if(C!==0)this.words[Y]=C,this.length++;return this},Q.prototype.isZero=function(){return this.length===1&&this.words[0]===0},Q.prototype.cmpn=function(U){var A=U<0;if(this.negative!==0&&!A)return-1;if(this.negative===0&&A)return 1;this.strip();var X;if(this.length>1)X=1;else{if(A)U=-U;S(U<=67108863,"Number is too big");var Z=this.words[0]|0;X=Z===U?0:Z<U?-1:1}if(this.negative!==0)return-X|0;return X},Q.prototype.cmp=function(U){if(this.negative!==0&&U.negative===0)return-1;if(this.negative===0&&U.negative!==0)return 1;var A=this.ucmp(U);if(this.negative!==0)return-A|0;return A},Q.prototype.ucmp=function(U){if(this.length>U.length)return 1;if(this.length<U.length)return-1;var A=0;for(var X=this.length-1;X>=0;X--){var Z=this.words[X]|0,C=U.words[X]|0;if(Z===C)continue;if(Z<C)A=-1;else if(Z>C)A=1;break}return A},Q.prototype.gtn=function(U){return this.cmpn(U)===1},Q.prototype.gt=function(U){return this.cmp(U)===1},Q.prototype.gten=function(U){return this.cmpn(U)>=0},Q.prototype.gte=function(U){return this.cmp(U)>=0},Q.prototype.ltn=function(U){return this.cmpn(U)===-1},Q.prototype.lt=function(U){return this.cmp(U)===-1},Q.prototype.lten=function(U){return this.cmpn(U)<=0},Q.prototype.lte=function(U){return this.cmp(U)<=0},Q.prototype.eqn=function(U){return this.cmpn(U)===0},Q.prototype.eq=function(U){return this.cmp(U)===0},Q.red=function(U){return new u(U)},Q.prototype.toRed=function(U){return S(!this.red,"Already a number in reduction context"),S(this.negative===0,"red works only with positives"),U.convertTo(this)._forceRed(U)},Q.prototype.fromRed=function(){return S(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},Q.prototype._forceRed=function(U){return this.red=U,this},Q.prototype.forceRed=function(U){return S(!this.red,"Already a number in reduction context"),this._forceRed(U)},Q.prototype.redAdd=function(U){return S(this.red,"redAdd works only with red numbers"),this.red.add(this,U)},Q.prototype.redIAdd=function(U){return S(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,U)},Q.prototype.redSub=function(U){return S(this.red,"redSub works only with red numbers"),this.red.sub(this,U)},Q.prototype.redISub=function(U){return S(this.red,"redISub works only with red numbers"),this.red.isub(this,U)},Q.prototype.redShl=function(U){return S(this.red,"redShl works only with red numbers"),this.red.shl(this,U)},Q.prototype.redMul=function(U){return S(this.red,"redMul works only with red numbers"),this.red._verify2(this,U),this.red.mul(this,U)},Q.prototype.redIMul=function(U){return S(this.red,"redMul works only with red numbers"),this.red._verify2(this,U),this.red.imul(this,U)},Q.prototype.redSqr=function(){return S(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},Q.prototype.redISqr=function(){return S(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},Q.prototype.redSqrt=function(){return S(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},Q.prototype.redInvm=function(){return S(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},Q.prototype.redNeg=function(){return S(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},Q.prototype.redPow=function(U){return S(this.red&&!U.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,U)};var f={k256:null,p224:null,p192:null,p25519:null};function w(U,A){this.name=U,this.p=new Q(A,16),this.n=this.p.bitLength(),this.k=new Q(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}w.prototype._tmp=function(){var U=new Q(null);return U.words=Array(Math.ceil(this.n/13)),U},w.prototype.ireduce=function(U){var A=U,X;do this.split(A,this.tmp),A=this.imulK(A),A=A.iadd(this.tmp),X=A.bitLength();while(X>this.n);var Z=X<this.n?-1:A.ucmp(this.p);if(Z===0)A.words[0]=0,A.length=1;else if(Z>0)A.isub(this.p);else if(A.strip!==void 0)A.strip();else A._strip();return A},w.prototype.split=function(U,A){U.iushrn(this.n,0,A)},w.prototype.imulK=function(U){return U.imul(this.k)};function b(){w.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}K(b,w),b.prototype.split=function(U,A){var X=4194303,Z=Math.min(U.length,9);for(var C=0;C<Z;C++)A.words[C]=U.words[C];if(A.length=Z,U.length<=9){U.words[0]=0,U.length=1;return}var Y=U.words[9];A.words[A.length++]=Y&X;for(C=10;C<U.length;C++){var V=U.words[C]|0;U.words[C-10]=(V&X)<<4|Y>>>22,Y=V}if(Y>>>=22,U.words[C-10]=Y,Y===0&&U.length>10)U.length-=10;else U.length-=9},b.prototype.imulK=function(U){U.words[U.length]=0,U.words[U.length+1]=0,U.length+=2;var A=0;for(var X=0;X<U.length;X++){var Z=U.words[X]|0;A+=Z*977,U.words[X]=A&67108863,A=Z*64+(A/67108864|0)}if(U.words[U.length-1]===0){if(U.length--,U.words[U.length-1]===0)U.length--}return U};function I0(){w.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}K(I0,w);function X0(){w.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}K(X0,w);function C0(){w.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}K(C0,w),C0.prototype.imulK=function(U){var A=0;for(var X=0;X<U.length;X++){var Z=(U.words[X]|0)*19+A,C=Z&67108863;Z>>>=26,U.words[X]=C,A=Z}if(A!==0)U.words[U.length++]=A;return U},Q._prime=function(U){if(f[U])return f[U];var A;if(U==="k256")A=new b;else if(U==="p224")A=new I0;else if(U==="p192")A=new X0;else if(U==="p25519")A=new C0;else throw Error("Unknown prime "+U);return f[U]=A,A};function u(U){if(typeof U==="string"){var A=Q._prime(U);this.m=A.p,this.prime=A}else S(U.gtn(1),"modulus must be greater than 1"),this.m=U,this.prime=null}u.prototype._verify1=function(U){S(U.negative===0,"red works only with positives"),S(U.red,"red works only with red numbers")},u.prototype._verify2=function(U,A){S((U.negative|A.negative)===0,"red works only with positives"),S(U.red&&U.red===A.red,"red works only with red numbers")},u.prototype.imod=function(U){if(this.prime)return this.prime.ireduce(U)._forceRed(this);return U.umod(this.m)._forceRed(this)},u.prototype.neg=function(U){if(U.isZero())return U.clone();return this.m.sub(U)._forceRed(this)},u.prototype.add=function(U,A){this._verify2(U,A);var X=U.add(A);if(X.cmp(this.m)>=0)X.isub(this.m);return X._forceRed(this)},u.prototype.iadd=function(U,A){this._verify2(U,A);var X=U.iadd(A);if(X.cmp(this.m)>=0)X.isub(this.m);return X},u.prototype.sub=function(U,A){this._verify2(U,A);var X=U.sub(A);if(X.cmpn(0)<0)X.iadd(this.m);return X._forceRed(this)},u.prototype.isub=function(U,A){this._verify2(U,A);var X=U.isub(A);if(X.cmpn(0)<0)X.iadd(this.m);return X},u.prototype.shl=function(U,A){return this._verify1(U),this.imod(U.ushln(A))},u.prototype.imul=function(U,A){return this._verify2(U,A),this.imod(U.imul(A))},u.prototype.mul=function(U,A){return this._verify2(U,A),this.imod(U.mul(A))},u.prototype.isqr=function(U){return this.imul(U,U.clone())},u.prototype.sqr=function(U){return this.mul(U,U)},u.prototype.sqrt=function(U){if(U.isZero())return U.clone();var A=this.m.andln(3);if(S(A%2===1),A===3){var X=this.m.add(new Q(1)).iushrn(2);return this.pow(U,X)}var Z=this.m.subn(1),C=0;while(!Z.isZero()&&Z.andln(1)===0)C++,Z.iushrn(1);S(!Z.isZero());var Y=new Q(1).toRed(this),V=Y.redNeg(),G=this.m.subn(1).iushrn(1),O=this.m.bitLength();O=new Q(2*O*O).toRed(this);while(this.pow(O,G).cmp(V)!==0)O.redIAdd(V);var J=this.pow(O,Z),z=this.pow(U,Z.addn(1).iushrn(1)),W=this.pow(U,Z),j=C;while(W.cmp(Y)!==0){var N=W;for(var p=0;N.cmp(Y)!==0;p++)N=N.redSqr();S(p<j);var n=this.pow(J,new Q(1).iushln(j-p-1));z=z.redMul(n),J=n.redSqr(),W=W.redMul(J),j=p}return z},u.prototype.invm=function(U){var A=U._invmp(this.m);if(A.negative!==0)return A.negative=0,this.imod(A).redNeg();else return this.imod(A)},u.prototype.pow=function(U,A){if(A.isZero())return new Q(1).toRed(this);if(A.cmpn(1)===0)return U.clone();var X=4,Z=Array(1<<X);Z[0]=new Q(1).toRed(this),Z[1]=U;for(var C=2;C<Z.length;C++)Z[C]=this.mul(Z[C-1],U);var Y=Z[0],V=0,G=0,O=A.bitLength()%26;if(O===0)O=26;for(C=A.length-1;C>=0;C--){var J=A.words[C];for(var z=O-1;z>=0;z--){var W=J>>z&1;if(Y!==Z[0])Y=this.sqr(Y);if(W===0&&V===0){G=0;continue}if(V<<=1,V|=W,G++,G!==X&&(C!==0||z!==0))continue;Y=this.mul(Y,Z[V]),G=0,V=0}O=26}return Y},u.prototype.convertTo=function(U){var A=U.umod(this.m);return A===U?A.clone():A},u.prototype.convertFrom=function(U){var A=U.clone();return A.red=null,A},Q.mont=function(U){return new O0(U)};function O0(U){if(u.call(this,U),this.shift=this.m.bitLength(),this.shift%26!==0)this.shift+=26-this.shift%26;this.r=new Q(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}K(O0,u),O0.prototype.convertTo=function(U){return this.imod(U.ushln(this.shift))},O0.prototype.convertFrom=function(U){var A=this.imod(U.mul(this.rinv));return A.red=null,A},O0.prototype.imul=function(U,A){if(U.isZero()||A.isZero())return U.words[0]=0,U.length=1,U;var X=U.imul(A),Z=X.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),C=X.isub(Z).iushrn(this.shift),Y=C;if(C.cmp(this.m)>=0)Y=C.isub(this.m);else if(C.cmpn(0)<0)Y=C.iadd(this.m);return Y._forceRed(this)},O0.prototype.mul=function(U,A){if(U.isZero()||A.isZero())return new Q(0)._forceRed(this);var X=U.mul(A),Z=X.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),C=X.isub(Z).iushrn(this.shift),Y=C;if(C.cmp(this.m)>=0)Y=C.isub(this.m);else if(C.cmpn(0)<0)Y=C.iadd(this.m);return Y._forceRed(this)},O0.prototype.invm=function(U){var A=this.imod(U._invmp(this.m).mul(this.r2));return A._forceRed(this)}})(typeof I>"u"||I,$)}),tG=Q0(($,I)=>{var E=oG(),L=nG();I.exports=function(T){return new K(T)};var S={secp256k1:{name:"secp256k1",byteLength:32},secp224r1:{name:"p224",byteLength:28},prime256v1:{name:"p256",byteLength:32},prime192v1:{name:"p192",byteLength:24},ed25519:{name:"ed25519",byteLength:32},secp384r1:{name:"p384",byteLength:48},secp521r1:{name:"p521",byteLength:66}};S.p224=S.secp224r1,S.p256=S.secp256r1=S.prime256v1,S.p192=S.secp192r1=S.prime192v1,S.p384=S.secp384r1,S.p521=S.secp521r1;function K(T){if(this.curveType=S[T],!this.curveType)this.curveType={name:T};this.curve=new E.ec(this.curveType.name),this.keys=void 0}K.prototype.generateKeys=function(T,M){return this.keys=this.curve.genKeyPair(),this.getPublicKey(T,M)},K.prototype.computeSecret=function(T,M,H){if(M=M||"utf8",!Buffer.isBuffer(T))T=new Buffer(T,M);var F=this.curve.keyFromPublic(T).getPublic(),R=F.mul(this.keys.getPrivate()).getX();return Q(R,H,this.curveType.byteLength)},K.prototype.getPublicKey=function(T,M){var H=this.keys.getPublic(M==="compressed",!0);if(M==="hybrid")if(H[H.length-1]%2)H[0]=7;else H[0]=6;return Q(H,T)},K.prototype.getPrivateKey=function(T){return Q(this.keys.getPrivate(),T)},K.prototype.setPublicKey=function(T,M){if(M=M||"utf8",!Buffer.isBuffer(T))T=new Buffer(T,M);return this.keys._importPublic(T),this},K.prototype.setPrivateKey=function(T,M){if(M=M||"utf8",!Buffer.isBuffer(T))T=new Buffer(T,M);var H=new L(T);return H=H.toString(16),this.keys=this.curve.genKeyPair(),this.keys._importPrivate(H),this};function Q(T,M,H){if(!Array.isArray(T))T=T.toArray();var F=new Buffer(T);if(H&&F.length<H){var R=new Buffer(H-F.length);R.fill(0),F=Buffer.concat([R,F])}if(!M)return F;else return F.toString(M)}}),sG=Q0(($,I)=>{var E=(vU(),l0(jU)).createECDH;I.exports=E||tG()}),mG=Q0(($,I)=>{(function(E,L){function S(U,A){if(!U)throw Error(A||"Assertion failed")}function K(U,A){U.super_=A;var X=function(){};X.prototype=A.prototype,U.prototype=new X,U.prototype.constructor=U}function Q(U,A,X){if(Q.isBN(U))return U;if(this.negative=0,this.words=null,this.length=0,this.red=null,U!==null){if(A==="le"||A==="be")X=A,A=10;this._init(U||0,A||10,X||"be")}}if(typeof E==="object")E.exports=Q;else L.BN=Q;Q.BN=Q,Q.wordSize=26;var T;try{if(typeof window<"u"&&typeof window.Buffer<"u")T=window.Buffer;else T=(DU(),l0(RU)).Buffer}catch(U){}Q.isBN=function(U){if(U instanceof Q)return!0;return U!==null&&typeof U==="object"&&U.constructor.wordSize===Q.wordSize&&Array.isArray(U.words)},Q.max=function(U,A){if(U.cmp(A)>0)return U;return A},Q.min=function(U,A){if(U.cmp(A)<0)return U;return A},Q.prototype._init=function(U,A,X){if(typeof U==="number")return this._initNumber(U,A,X);if(typeof U==="object")return this._initArray(U,A,X);if(A==="hex")A=16;S(A===(A|0)&&A>=2&&A<=36),U=U.toString().replace(/\s+/g,"");var Z=0;if(U[0]==="-")Z++,this.negative=1;if(Z<U.length){if(A===16)this._parseHex(U,Z,X);else if(this._parseBase(U,A,Z),X==="le")this._initArray(this.toArray(),A,X)}},Q.prototype._initNumber=function(U,A,X){if(U<0)this.negative=1,U=-U;if(U<67108864)this.words=[U&67108863],this.length=1;else if(U<4503599627370496)this.words=[U&67108863,U/67108864&67108863],this.length=2;else S(U<9007199254740992),this.words=[U&67108863,U/67108864&67108863,1],this.length=3;if(X!=="le")return;this._initArray(this.toArray(),A,X)},Q.prototype._initArray=function(U,A,X){if(S(typeof U.length==="number"),U.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(U.length/3),this.words=Array(this.length);for(var Z=0;Z<this.length;Z++)this.words[Z]=0;var C,Y,V=0;if(X==="be"){for(Z=U.length-1,C=0;Z>=0;Z-=3)if(Y=U[Z]|U[Z-1]<<8|U[Z-2]<<16,this.words[C]|=Y<<V&67108863,this.words[C+1]=Y>>>26-V&67108863,V+=24,V>=26)V-=26,C++}else if(X==="le"){for(Z=0,C=0;Z<U.length;Z+=3)if(Y=U[Z]|U[Z+1]<<8|U[Z+2]<<16,this.words[C]|=Y<<V&67108863,this.words[C+1]=Y>>>26-V&67108863,V+=24,V>=26)V-=26,C++}return this.strip()};function M(U,A){var X=U.charCodeAt(A);if(X>=65&&X<=70)return X-55;else if(X>=97&&X<=102)return X-87;else return X-48&15}function H(U,A,X){var Z=M(U,X);if(X-1>=A)Z|=M(U,X-1)<<4;return Z}Q.prototype._parseHex=function(U,A,X){this.length=Math.ceil((U.length-A)/6),this.words=Array(this.length);for(var Z=0;Z<this.length;Z++)this.words[Z]=0;var C=0,Y=0,V;if(X==="be")for(Z=U.length-1;Z>=A;Z-=2)if(V=H(U,A,Z)<<C,this.words[Y]|=V&67108863,C>=18)C-=18,Y+=1,this.words[Y]|=V>>>26;else C+=8;else{var G=U.length-A;for(Z=G%2===0?A+1:A;Z<U.length;Z+=2)if(V=H(U,A,Z)<<C,this.words[Y]|=V&67108863,C>=18)C-=18,Y+=1,this.words[Y]|=V>>>26;else C+=8}this.strip()};function F(U,A,X,Z){var C=0,Y=Math.min(U.length,X);for(var V=A;V<Y;V++){var G=U.charCodeAt(V)-48;if(C*=Z,G>=49)C+=G-49+10;else if(G>=17)C+=G-17+10;else C+=G}return C}Q.prototype._parseBase=function(U,A,X){this.words=[0],this.length=1;for(var Z=0,C=1;C<=67108863;C*=A)Z++;Z--,C=C/A|0;var Y=U.length-X,V=Y%Z,G=Math.min(Y,Y-V)+X,O=0;for(var J=X;J<G;J+=Z)if(O=F(U,J,J+Z,A),this.imuln(C),this.words[0]+O<67108864)this.words[0]+=O;else this._iaddn(O);if(V!==0){var z=1;O=F(U,J,U.length,A);for(J=0;J<V;J++)z*=A;if(this.imuln(z),this.words[0]+O<67108864)this.words[0]+=O;else this._iaddn(O)}this.strip()},Q.prototype.copy=function(U){U.words=Array(this.length);for(var A=0;A<this.length;A++)U.words[A]=this.words[A];U.length=this.length,U.negative=this.negative,U.red=this.red},Q.prototype.clone=function(){var U=new Q(null);return this.copy(U),U},Q.prototype._expand=function(U){while(this.length<U)this.words[this.length++]=0;return this},Q.prototype.strip=function(){while(this.length>1&&this.words[this.length-1]===0)this.length--;return this._normSign()},Q.prototype._normSign=function(){if(this.length===1&&this.words[0]===0)this.negative=0;return this},Q.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var R=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],D=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],q=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64000000,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,24300000,28629151,33554432,39135393,45435424,52521875,60466176];if(Q.prototype.toString=function(U,A){U=U||10,A=A|0||1;var X;if(U===16||U==="hex"){X="";var Z=0,C=0;for(var Y=0;Y<this.length;Y++){var V=this.words[Y],G=((V<<Z|C)&16777215).toString(16);if(C=V>>>24-Z&16777215,Z+=2,Z>=26)Z-=26,Y--;if(C!==0||Y!==this.length-1)X=R[6-G.length]+G+X;else X=G+X}if(C!==0)X=C.toString(16)+X;while(X.length%A!==0)X="0"+X;if(this.negative!==0)X="-"+X;return X}if(U===(U|0)&&U>=2&&U<=36){var O=D[U],J=q[U];X="";var z=this.clone();z.negative=0;while(!z.isZero()){var W=z.modn(J).toString(U);if(z=z.idivn(J),!z.isZero())X=R[O-W.length]+W+X;else X=W+X}if(this.isZero())X="0"+X;while(X.length%A!==0)X="0"+X;if(this.negative!==0)X="-"+X;return X}S(!1,"Base should be between 2 and 36")},Q.prototype.toNumber=function(){var U=this.words[0];if(this.length===2)U+=this.words[1]*67108864;else if(this.length===3&&this.words[2]===1)U+=4503599627370496+this.words[1]*67108864;else if(this.length>2)S(!1,"Number can only safely store up to 53 bits");return this.negative!==0?-U:U},Q.prototype.toJSON=function(){return this.toString(16)},Q.prototype.toBuffer=function(U,A){return S(typeof T<"u"),this.toArrayLike(T,U,A)},Q.prototype.toArray=function(U,A){return this.toArrayLike(Array,U,A)},Q.prototype.toArrayLike=function(U,A,X){var Z=this.byteLength(),C=X||Math.max(1,Z);S(Z<=C,"byte array longer than desired length"),S(C>0,"Requested array length <= 0"),this.strip();var Y=A==="le",V=new U(C),G,O,J=this.clone();if(!Y){for(O=0;O<C-Z;O++)V[O]=0;for(O=0;!J.isZero();O++)G=J.andln(255),J.iushrn(8),V[C-O-1]=G}else{for(O=0;!J.isZero();O++)G=J.andln(255),J.iushrn(8),V[O]=G;for(;O<C;O++)V[O]=0}return V},Math.clz32)Q.prototype._countBits=function(U){return 32-Math.clz32(U)};else Q.prototype._countBits=function(U){var A=U,X=0;if(A>=4096)X+=13,A>>>=13;if(A>=64)X+=7,A>>>=7;if(A>=8)X+=4,A>>>=4;if(A>=2)X+=2,A>>>=2;return X+A};Q.prototype._zeroBits=function(U){if(U===0)return 26;var A=U,X=0;if((A&8191)===0)X+=13,A>>>=13;if((A&127)===0)X+=7,A>>>=7;if((A&15)===0)X+=4,A>>>=4;if((A&3)===0)X+=2,A>>>=2;if((A&1)===0)X++;return X},Q.prototype.bitLength=function(){var U=this.words[this.length-1],A=this._countBits(U);return(this.length-1)*26+A};function P(U){var A=Array(U.bitLength());for(var X=0;X<A.length;X++){var Z=X/26|0,C=X%26;A[X]=(U.words[Z]&1<<C)>>>C}return A}Q.prototype.zeroBits=function(){if(this.isZero())return 0;var U=0;for(var A=0;A<this.length;A++){var X=this._zeroBits(this.words[A]);if(U+=X,X!==26)break}return U},Q.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},Q.prototype.toTwos=function(U){if(this.negative!==0)return this.abs().inotn(U).iaddn(1);return this.clone()},Q.prototype.fromTwos=function(U){if(this.testn(U-1))return this.notn(U).iaddn(1).ineg();return this.clone()},Q.prototype.isNeg=function(){return this.negative!==0},Q.prototype.neg=function(){return this.clone().ineg()},Q.prototype.ineg=function(){if(!this.isZero())this.negative^=1;return this},Q.prototype.iuor=function(U){while(this.length<U.length)this.words[this.length++]=0;for(var A=0;A<U.length;A++)this.words[A]=this.words[A]|U.words[A];return this.strip()},Q.prototype.ior=function(U){return S((this.negative|U.negative)===0),this.iuor(U)},Q.prototype.or=function(U){if(this.length>U.length)return this.clone().ior(U);return U.clone().ior(this)},Q.prototype.uor=function(U){if(this.length>U.length)return this.clone().iuor(U);return U.clone().iuor(this)},Q.prototype.iuand=function(U){var A;if(this.length>U.length)A=U;else A=this;for(var X=0;X<A.length;X++)this.words[X]=this.words[X]&U.words[X];return this.length=A.length,this.strip()},Q.prototype.iand=function(U){return S((this.negative|U.negative)===0),this.iuand(U)},Q.prototype.and=function(U){if(this.length>U.length)return this.clone().iand(U);return U.clone().iand(this)},Q.prototype.uand=function(U){if(this.length>U.length)return this.clone().iuand(U);return U.clone().iuand(this)},Q.prototype.iuxor=function(U){var A,X;if(this.length>U.length)A=this,X=U;else A=U,X=this;for(var Z=0;Z<X.length;Z++)this.words[Z]=A.words[Z]^X.words[Z];if(this!==A)for(;Z<A.length;Z++)this.words[Z]=A.words[Z];return this.length=A.length,this.strip()},Q.prototype.ixor=function(U){return S((this.negative|U.negative)===0),this.iuxor(U)},Q.prototype.xor=function(U){if(this.length>U.length)return this.clone().ixor(U);return U.clone().ixor(this)},Q.prototype.uxor=function(U){if(this.length>U.length)return this.clone().iuxor(U);return U.clone().iuxor(this)},Q.prototype.inotn=function(U){S(typeof U==="number"&&U>=0);var A=Math.ceil(U/26)|0,X=U%26;if(this._expand(A),X>0)A--;for(var Z=0;Z<A;Z++)this.words[Z]=~this.words[Z]&67108863;if(X>0)this.words[Z]=~this.words[Z]&67108863>>26-X;return this.strip()},Q.prototype.notn=function(U){return this.clone().inotn(U)},Q.prototype.setn=function(U,A){S(typeof U==="number"&&U>=0);var X=U/26|0,Z=U%26;if(this._expand(X+1),A)this.words[X]=this.words[X]|1<<Z;else this.words[X]=this.words[X]&~(1<<Z);return this.strip()},Q.prototype.iadd=function(U){var A;if(this.negative!==0&&U.negative===0)return this.negative=0,A=this.isub(U),this.negative^=1,this._normSign();else if(this.negative===0&&U.negative!==0)return U.negative=0,A=this.isub(U),U.negative=1,A._normSign();var X,Z;if(this.length>U.length)X=this,Z=U;else X=U,Z=this;var C=0;for(var Y=0;Y<Z.length;Y++)A=(X.words[Y]|0)+(Z.words[Y]|0)+C,this.words[Y]=A&67108863,C=A>>>26;for(;C!==0&&Y<X.length;Y++)A=(X.words[Y]|0)+C,this.words[Y]=A&67108863,C=A>>>26;if(this.length=X.length,C!==0)this.words[this.length]=C,this.length++;else if(X!==this)for(;Y<X.length;Y++)this.words[Y]=X.words[Y];return this},Q.prototype.add=function(U){var A;if(U.negative!==0&&this.negative===0)return U.negative=0,A=this.sub(U),U.negative^=1,A;else if(U.negative===0&&this.negative!==0)return this.negative=0,A=U.sub(this),this.negative=1,A;if(this.length>U.length)return this.clone().iadd(U);return U.clone().iadd(this)},Q.prototype.isub=function(U){if(U.negative!==0){U.negative=0;var A=this.iadd(U);return U.negative=1,A._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(U),this.negative=1,this._normSign();var X=this.cmp(U);if(X===0)return this.negative=0,this.length=1,this.words[0]=0,this;var Z,C;if(X>0)Z=this,C=U;else Z=U,C=this;var Y=0;for(var V=0;V<C.length;V++)A=(Z.words[V]|0)-(C.words[V]|0)+Y,Y=A>>26,this.words[V]=A&67108863;for(;Y!==0&&V<Z.length;V++)A=(Z.words[V]|0)+Y,Y=A>>26,this.words[V]=A&67108863;if(Y===0&&V<Z.length&&Z!==this)for(;V<Z.length;V++)this.words[V]=Z.words[V];if(this.length=Math.max(this.length,V),Z!==this)this.negative=1;return this.strip()},Q.prototype.sub=function(U){return this.clone().isub(U)};function _(U,A,X){X.negative=A.negative^U.negative;var Z=U.length+A.length|0;X.length=Z,Z=Z-1|0;var C=U.words[0]|0,Y=A.words[0]|0,V=C*Y,G=V&67108863,O=V/67108864|0;X.words[0]=G;for(var J=1;J<Z;J++){var z=O>>>26,W=O&67108863,j=Math.min(J,A.length-1);for(var N=Math.max(0,J-U.length+1);N<=j;N++){var p=J-N|0;C=U.words[p]|0,Y=A.words[N]|0,V=C*Y+W,z+=V/67108864|0,W=V&67108863}X.words[J]=W|0,O=z|0}if(O!==0)X.words[J]=O|0;else X.length--;return X.strip()}var k=function(U,A,X){var Z=U.words,C=A.words,Y=X.words,V=0,G,O,J,z=Z[0]|0,W=z&8191,j=z>>>13,N=Z[1]|0,p=N&8191,n=N>>>13,E0=Z[2]|0,r=E0&8191,d=E0>>>13,A0=Z[3]|0,t=A0&8191,i=A0>>>13,N0=Z[4]|0,y=N0&8191,h=N0>>>13,$0=Z[5]|0,m=$0&8191,a=$0>>>13,W0=Z[6]|0,c=W0&8191,o=W0>>>13,x0=Z[7]|0,s=x0&8191,Z0=x0>>>13,w0=Z[8]|0,S0=w0&8191,V0=w0>>>13,m0=Z[9]|0,J0=m0&8191,L0=m0>>>13,a0=C[0]|0,K0=a0&8191,D0=a0>>>13,WU=C[1]|0,F0=WU&8191,k0=WU>>>13,FU=C[2]|0,_0=FU&8191,M0=FU>>>13,KU=C[3]|0,j0=KU&8191,z0=KU>>>13,SU=C[4]|0,v0=SU&8191,B0=SU>>>13,VU=C[5]|0,T0=VU&8191,x=VU>>>13,l=C[6]|0,e=l&8191,U0=l>>>13,f0=C[7]|0,Y0=f0&8191,R0=f0>>>13,r0=C[8]|0,q0=r0&8191,g0=r0>>>13,HU=C[9]|0,P0=HU&8191,H0=HU>>>13;X.negative=U.negative^A.negative,X.length=19,G=Math.imul(W,K0),O=Math.imul(W,D0),O=O+Math.imul(j,K0)|0,J=Math.imul(j,D0);var e0=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(e0>>>26)|0,e0&=67108863,G=Math.imul(p,K0),O=Math.imul(p,D0),O=O+Math.imul(n,K0)|0,J=Math.imul(n,D0),G=G+Math.imul(W,F0)|0,O=O+Math.imul(W,k0)|0,O=O+Math.imul(j,F0)|0,J=J+Math.imul(j,k0)|0;var c0=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(c0>>>26)|0,c0&=67108863,G=Math.imul(r,K0),O=Math.imul(r,D0),O=O+Math.imul(d,K0)|0,J=Math.imul(d,D0),G=G+Math.imul(p,F0)|0,O=O+Math.imul(p,k0)|0,O=O+Math.imul(n,F0)|0,J=J+Math.imul(n,k0)|0,G=G+Math.imul(W,_0)|0,O=O+Math.imul(W,M0)|0,O=O+Math.imul(j,_0)|0,J=J+Math.imul(j,M0)|0;var y0=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(y0>>>26)|0,y0&=67108863,G=Math.imul(t,K0),O=Math.imul(t,D0),O=O+Math.imul(i,K0)|0,J=Math.imul(i,D0),G=G+Math.imul(r,F0)|0,O=O+Math.imul(r,k0)|0,O=O+Math.imul(d,F0)|0,J=J+Math.imul(d,k0)|0,G=G+Math.imul(p,_0)|0,O=O+Math.imul(p,M0)|0,O=O+Math.imul(n,_0)|0,J=J+Math.imul(n,M0)|0,G=G+Math.imul(W,j0)|0,O=O+Math.imul(W,z0)|0,O=O+Math.imul(j,j0)|0,J=J+Math.imul(j,z0)|0;var o0=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(o0>>>26)|0,o0&=67108863,G=Math.imul(y,K0),O=Math.imul(y,D0),O=O+Math.imul(h,K0)|0,J=Math.imul(h,D0),G=G+Math.imul(t,F0)|0,O=O+Math.imul(t,k0)|0,O=O+Math.imul(i,F0)|0,J=J+Math.imul(i,k0)|0,G=G+Math.imul(r,_0)|0,O=O+Math.imul(r,M0)|0,O=O+Math.imul(d,_0)|0,J=J+Math.imul(d,M0)|0,G=G+Math.imul(p,j0)|0,O=O+Math.imul(p,z0)|0,O=O+Math.imul(n,j0)|0,J=J+Math.imul(n,z0)|0,G=G+Math.imul(W,v0)|0,O=O+Math.imul(W,B0)|0,O=O+Math.imul(j,v0)|0,J=J+Math.imul(j,B0)|0;var b0=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(b0>>>26)|0,b0&=67108863,G=Math.imul(m,K0),O=Math.imul(m,D0),O=O+Math.imul(a,K0)|0,J=Math.imul(a,D0),G=G+Math.imul(y,F0)|0,O=O+Math.imul(y,k0)|0,O=O+Math.imul(h,F0)|0,J=J+Math.imul(h,k0)|0,G=G+Math.imul(t,_0)|0,O=O+Math.imul(t,M0)|0,O=O+Math.imul(i,_0)|0,J=J+Math.imul(i,M0)|0,G=G+Math.imul(r,j0)|0,O=O+Math.imul(r,z0)|0,O=O+Math.imul(d,j0)|0,J=J+Math.imul(d,z0)|0,G=G+Math.imul(p,v0)|0,O=O+Math.imul(p,B0)|0,O=O+Math.imul(n,v0)|0,J=J+Math.imul(n,B0)|0,G=G+Math.imul(W,T0)|0,O=O+Math.imul(W,x)|0,O=O+Math.imul(j,T0)|0,J=J+Math.imul(j,x)|0;var i0=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(i0>>>26)|0,i0&=67108863,G=Math.imul(c,K0),O=Math.imul(c,D0),O=O+Math.imul(o,K0)|0,J=Math.imul(o,D0),G=G+Math.imul(m,F0)|0,O=O+Math.imul(m,k0)|0,O=O+Math.imul(a,F0)|0,J=J+Math.imul(a,k0)|0,G=G+Math.imul(y,_0)|0,O=O+Math.imul(y,M0)|0,O=O+Math.imul(h,_0)|0,J=J+Math.imul(h,M0)|0,G=G+Math.imul(t,j0)|0,O=O+Math.imul(t,z0)|0,O=O+Math.imul(i,j0)|0,J=J+Math.imul(i,z0)|0,G=G+Math.imul(r,v0)|0,O=O+Math.imul(r,B0)|0,O=O+Math.imul(d,v0)|0,J=J+Math.imul(d,B0)|0,G=G+Math.imul(p,T0)|0,O=O+Math.imul(p,x)|0,O=O+Math.imul(n,T0)|0,J=J+Math.imul(n,x)|0,G=G+Math.imul(W,e)|0,O=O+Math.imul(W,U0)|0,O=O+Math.imul(j,e)|0,J=J+Math.imul(j,U0)|0;var UU=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(UU>>>26)|0,UU&=67108863,G=Math.imul(s,K0),O=Math.imul(s,D0),O=O+Math.imul(Z0,K0)|0,J=Math.imul(Z0,D0),G=G+Math.imul(c,F0)|0,O=O+Math.imul(c,k0)|0,O=O+Math.imul(o,F0)|0,J=J+Math.imul(o,k0)|0,G=G+Math.imul(m,_0)|0,O=O+Math.imul(m,M0)|0,O=O+Math.imul(a,_0)|0,J=J+Math.imul(a,M0)|0,G=G+Math.imul(y,j0)|0,O=O+Math.imul(y,z0)|0,O=O+Math.imul(h,j0)|0,J=J+Math.imul(h,z0)|0,G=G+Math.imul(t,v0)|0,O=O+Math.imul(t,B0)|0,O=O+Math.imul(i,v0)|0,J=J+Math.imul(i,B0)|0,G=G+Math.imul(r,T0)|0,O=O+Math.imul(r,x)|0,O=O+Math.imul(d,T0)|0,J=J+Math.imul(d,x)|0,G=G+Math.imul(p,e)|0,O=O+Math.imul(p,U0)|0,O=O+Math.imul(n,e)|0,J=J+Math.imul(n,U0)|0,G=G+Math.imul(W,Y0)|0,O=O+Math.imul(W,R0)|0,O=O+Math.imul(j,Y0)|0,J=J+Math.imul(j,R0)|0;var OU=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(OU>>>26)|0,OU&=67108863,G=Math.imul(S0,K0),O=Math.imul(S0,D0),O=O+Math.imul(V0,K0)|0,J=Math.imul(V0,D0),G=G+Math.imul(s,F0)|0,O=O+Math.imul(s,k0)|0,O=O+Math.imul(Z0,F0)|0,J=J+Math.imul(Z0,k0)|0,G=G+Math.imul(c,_0)|0,O=O+Math.imul(c,M0)|0,O=O+Math.imul(o,_0)|0,J=J+Math.imul(o,M0)|0,G=G+Math.imul(m,j0)|0,O=O+Math.imul(m,z0)|0,O=O+Math.imul(a,j0)|0,J=J+Math.imul(a,z0)|0,G=G+Math.imul(y,v0)|0,O=O+Math.imul(y,B0)|0,O=O+Math.imul(h,v0)|0,J=J+Math.imul(h,B0)|0,G=G+Math.imul(t,T0)|0,O=O+Math.imul(t,x)|0,O=O+Math.imul(i,T0)|0,J=J+Math.imul(i,x)|0,G=G+Math.imul(r,e)|0,O=O+Math.imul(r,U0)|0,O=O+Math.imul(d,e)|0,J=J+Math.imul(d,U0)|0,G=G+Math.imul(p,Y0)|0,O=O+Math.imul(p,R0)|0,O=O+Math.imul(n,Y0)|0,J=J+Math.imul(n,R0)|0,G=G+Math.imul(W,q0)|0,O=O+Math.imul(W,g0)|0,O=O+Math.imul(j,q0)|0,J=J+Math.imul(j,g0)|0;var ZU=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(ZU>>>26)|0,ZU&=67108863,G=Math.imul(J0,K0),O=Math.imul(J0,D0),O=O+Math.imul(L0,K0)|0,J=Math.imul(L0,D0),G=G+Math.imul(S0,F0)|0,O=O+Math.imul(S0,k0)|0,O=O+Math.imul(V0,F0)|0,J=J+Math.imul(V0,k0)|0,G=G+Math.imul(s,_0)|0,O=O+Math.imul(s,M0)|0,O=O+Math.imul(Z0,_0)|0,J=J+Math.imul(Z0,M0)|0,G=G+Math.imul(c,j0)|0,O=O+Math.imul(c,z0)|0,O=O+Math.imul(o,j0)|0,J=J+Math.imul(o,z0)|0,G=G+Math.imul(m,v0)|0,O=O+Math.imul(m,B0)|0,O=O+Math.imul(a,v0)|0,J=J+Math.imul(a,B0)|0,G=G+Math.imul(y,T0)|0,O=O+Math.imul(y,x)|0,O=O+Math.imul(h,T0)|0,J=J+Math.imul(h,x)|0,G=G+Math.imul(t,e)|0,O=O+Math.imul(t,U0)|0,O=O+Math.imul(i,e)|0,J=J+Math.imul(i,U0)|0,G=G+Math.imul(r,Y0)|0,O=O+Math.imul(r,R0)|0,O=O+Math.imul(d,Y0)|0,J=J+Math.imul(d,R0)|0,G=G+Math.imul(p,q0)|0,O=O+Math.imul(p,g0)|0,O=O+Math.imul(n,q0)|0,J=J+Math.imul(n,g0)|0,G=G+Math.imul(W,P0)|0,O=O+Math.imul(W,H0)|0,O=O+Math.imul(j,P0)|0,J=J+Math.imul(j,H0)|0;var AU=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(AU>>>26)|0,AU&=67108863,G=Math.imul(J0,F0),O=Math.imul(J0,k0),O=O+Math.imul(L0,F0)|0,J=Math.imul(L0,k0),G=G+Math.imul(S0,_0)|0,O=O+Math.imul(S0,M0)|0,O=O+Math.imul(V0,_0)|0,J=J+Math.imul(V0,M0)|0,G=G+Math.imul(s,j0)|0,O=O+Math.imul(s,z0)|0,O=O+Math.imul(Z0,j0)|0,J=J+Math.imul(Z0,z0)|0,G=G+Math.imul(c,v0)|0,O=O+Math.imul(c,B0)|0,O=O+Math.imul(o,v0)|0,J=J+Math.imul(o,B0)|0,G=G+Math.imul(m,T0)|0,O=O+Math.imul(m,x)|0,O=O+Math.imul(a,T0)|0,J=J+Math.imul(a,x)|0,G=G+Math.imul(y,e)|0,O=O+Math.imul(y,U0)|0,O=O+Math.imul(h,e)|0,J=J+Math.imul(h,U0)|0,G=G+Math.imul(t,Y0)|0,O=O+Math.imul(t,R0)|0,O=O+Math.imul(i,Y0)|0,J=J+Math.imul(i,R0)|0,G=G+Math.imul(r,q0)|0,O=O+Math.imul(r,g0)|0,O=O+Math.imul(d,q0)|0,J=J+Math.imul(d,g0)|0,G=G+Math.imul(p,P0)|0,O=O+Math.imul(p,H0)|0,O=O+Math.imul(n,P0)|0,J=J+Math.imul(n,H0)|0;var $U=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+($U>>>26)|0,$U&=67108863,G=Math.imul(J0,_0),O=Math.imul(J0,M0),O=O+Math.imul(L0,_0)|0,J=Math.imul(L0,M0),G=G+Math.imul(S0,j0)|0,O=O+Math.imul(S0,z0)|0,O=O+Math.imul(V0,j0)|0,J=J+Math.imul(V0,z0)|0,G=G+Math.imul(s,v0)|0,O=O+Math.imul(s,B0)|0,O=O+Math.imul(Z0,v0)|0,J=J+Math.imul(Z0,B0)|0,G=G+Math.imul(c,T0)|0,O=O+Math.imul(c,x)|0,O=O+Math.imul(o,T0)|0,J=J+Math.imul(o,x)|0,G=G+Math.imul(m,e)|0,O=O+Math.imul(m,U0)|0,O=O+Math.imul(a,e)|0,J=J+Math.imul(a,U0)|0,G=G+Math.imul(y,Y0)|0,O=O+Math.imul(y,R0)|0,O=O+Math.imul(h,Y0)|0,J=J+Math.imul(h,R0)|0,G=G+Math.imul(t,q0)|0,O=O+Math.imul(t,g0)|0,O=O+Math.imul(i,q0)|0,J=J+Math.imul(i,g0)|0,G=G+Math.imul(r,P0)|0,O=O+Math.imul(r,H0)|0,O=O+Math.imul(d,P0)|0,J=J+Math.imul(d,H0)|0;var IU=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(IU>>>26)|0,IU&=67108863,G=Math.imul(J0,j0),O=Math.imul(J0,z0),O=O+Math.imul(L0,j0)|0,J=Math.imul(L0,z0),G=G+Math.imul(S0,v0)|0,O=O+Math.imul(S0,B0)|0,O=O+Math.imul(V0,v0)|0,J=J+Math.imul(V0,B0)|0,G=G+Math.imul(s,T0)|0,O=O+Math.imul(s,x)|0,O=O+Math.imul(Z0,T0)|0,J=J+Math.imul(Z0,x)|0,G=G+Math.imul(c,e)|0,O=O+Math.imul(c,U0)|0,O=O+Math.imul(o,e)|0,J=J+Math.imul(o,U0)|0,G=G+Math.imul(m,Y0)|0,O=O+Math.imul(m,R0)|0,O=O+Math.imul(a,Y0)|0,J=J+Math.imul(a,R0)|0,G=G+Math.imul(y,q0)|0,O=O+Math.imul(y,g0)|0,O=O+Math.imul(h,q0)|0,J=J+Math.imul(h,g0)|0,G=G+Math.imul(t,P0)|0,O=O+Math.imul(t,H0)|0,O=O+Math.imul(i,P0)|0,J=J+Math.imul(i,H0)|0;var CU=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(CU>>>26)|0,CU&=67108863,G=Math.imul(J0,v0),O=Math.imul(J0,B0),O=O+Math.imul(L0,v0)|0,J=Math.imul(L0,B0),G=G+Math.imul(S0,T0)|0,O=O+Math.imul(S0,x)|0,O=O+Math.imul(V0,T0)|0,J=J+Math.imul(V0,x)|0,G=G+Math.imul(s,e)|0,O=O+Math.imul(s,U0)|0,O=O+Math.imul(Z0,e)|0,J=J+Math.imul(Z0,U0)|0,G=G+Math.imul(c,Y0)|0,O=O+Math.imul(c,R0)|0,O=O+Math.imul(o,Y0)|0,J=J+Math.imul(o,R0)|0,G=G+Math.imul(m,q0)|0,O=O+Math.imul(m,g0)|0,O=O+Math.imul(a,q0)|0,J=J+Math.imul(a,g0)|0,G=G+Math.imul(y,P0)|0,O=O+Math.imul(y,H0)|0,O=O+Math.imul(h,P0)|0,J=J+Math.imul(h,H0)|0;var QU=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(QU>>>26)|0,QU&=67108863,G=Math.imul(J0,T0),O=Math.imul(J0,x),O=O+Math.imul(L0,T0)|0,J=Math.imul(L0,x),G=G+Math.imul(S0,e)|0,O=O+Math.imul(S0,U0)|0,O=O+Math.imul(V0,e)|0,J=J+Math.imul(V0,U0)|0,G=G+Math.imul(s,Y0)|0,O=O+Math.imul(s,R0)|0,O=O+Math.imul(Z0,Y0)|0,J=J+Math.imul(Z0,R0)|0,G=G+Math.imul(c,q0)|0,O=O+Math.imul(c,g0)|0,O=O+Math.imul(o,q0)|0,J=J+Math.imul(o,g0)|0,G=G+Math.imul(m,P0)|0,O=O+Math.imul(m,H0)|0,O=O+Math.imul(a,P0)|0,J=J+Math.imul(a,H0)|0;var XU=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(XU>>>26)|0,XU&=67108863,G=Math.imul(J0,e),O=Math.imul(J0,U0),O=O+Math.imul(L0,e)|0,J=Math.imul(L0,U0),G=G+Math.imul(S0,Y0)|0,O=O+Math.imul(S0,R0)|0,O=O+Math.imul(V0,Y0)|0,J=J+Math.imul(V0,R0)|0,G=G+Math.imul(s,q0)|0,O=O+Math.imul(s,g0)|0,O=O+Math.imul(Z0,q0)|0,J=J+Math.imul(Z0,g0)|0,G=G+Math.imul(c,P0)|0,O=O+Math.imul(c,H0)|0,O=O+Math.imul(o,P0)|0,J=J+Math.imul(o,H0)|0;var GU=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(GU>>>26)|0,GU&=67108863,G=Math.imul(J0,Y0),O=Math.imul(J0,R0),O=O+Math.imul(L0,Y0)|0,J=Math.imul(L0,R0),G=G+Math.imul(S0,q0)|0,O=O+Math.imul(S0,g0)|0,O=O+Math.imul(V0,q0)|0,J=J+Math.imul(V0,g0)|0,G=G+Math.imul(s,P0)|0,O=O+Math.imul(s,H0)|0,O=O+Math.imul(Z0,P0)|0,J=J+Math.imul(Z0,H0)|0;var EU=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(EU>>>26)|0,EU&=67108863,G=Math.imul(J0,q0),O=Math.imul(J0,g0),O=O+Math.imul(L0,q0)|0,J=Math.imul(L0,g0),G=G+Math.imul(S0,P0)|0,O=O+Math.imul(S0,H0)|0,O=O+Math.imul(V0,P0)|0,J=J+Math.imul(V0,H0)|0;var JU=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(JU>>>26)|0,JU&=67108863,G=Math.imul(J0,P0),O=Math.imul(J0,H0),O=O+Math.imul(L0,P0)|0,J=Math.imul(L0,H0);var YU=(V+G|0)+((O&8191)<<13)|0;if(V=(J+(O>>>13)|0)+(YU>>>26)|0,YU&=67108863,Y[0]=e0,Y[1]=c0,Y[2]=y0,Y[3]=o0,Y[4]=b0,Y[5]=i0,Y[6]=UU,Y[7]=OU,Y[8]=ZU,Y[9]=AU,Y[10]=$U,Y[11]=IU,Y[12]=CU,Y[13]=QU,Y[14]=XU,Y[15]=GU,Y[16]=EU,Y[17]=JU,Y[18]=YU,V!==0)Y[19]=V,X.length++;return X};if(!Math.imul)k=_;function B(U,A,X){X.negative=A.negative^U.negative,X.length=U.length+A.length;var Z=0,C=0;for(var Y=0;Y<X.length-1;Y++){var V=C;C=0;var G=Z&67108863,O=Math.min(Y,A.length-1);for(var J=Math.max(0,Y-U.length+1);J<=O;J++){var z=Y-J,W=U.words[z]|0,j=A.words[J]|0,N=W*j,p=N&67108863;V=V+(N/67108864|0)|0,p=p+G|0,G=p&67108863,V=V+(p>>>26)|0,C+=V>>>26,V&=67108863}X.words[Y]=G,Z=V,V=C}if(Z!==0)X.words[Y]=Z;else X.length--;return X.strip()}function v(U,A,X){var Z=new g;return Z.mulp(U,A,X)}Q.prototype.mulTo=function(U,A){var X,Z=this.length+U.length;if(this.length===10&&U.length===10)X=k(this,U,A);else if(Z<63)X=_(this,U,A);else if(Z<1024)X=B(this,U,A);else X=v(this,U,A);return X};function g(U,A){this.x=U,this.y=A}g.prototype.makeRBT=function(U){var A=Array(U),X=Q.prototype._countBits(U)-1;for(var Z=0;Z<U;Z++)A[Z]=this.revBin(Z,X,U);return A},g.prototype.revBin=function(U,A,X){if(U===0||U===X-1)return U;var Z=0;for(var C=0;C<A;C++)Z|=(U&1)<<A-C-1,U>>=1;return Z},g.prototype.permute=function(U,A,X,Z,C,Y){for(var V=0;V<Y;V++)Z[V]=A[U[V]],C[V]=X[U[V]]},g.prototype.transform=function(U,A,X,Z,C,Y){this.permute(Y,U,A,X,Z,C);for(var V=1;V<C;V<<=1){var G=V<<1,O=Math.cos(2*Math.PI/G),J=Math.sin(2*Math.PI/G);for(var z=0;z<C;z+=G){var W=O,j=J;for(var N=0;N<V;N++){var p=X[z+N],n=Z[z+N],E0=X[z+N+V],r=Z[z+N+V],d=W*E0-j*r;if(r=W*r+j*E0,E0=d,X[z+N]=p+E0,Z[z+N]=n+r,X[z+N+V]=p-E0,Z[z+N+V]=n-r,N!==G)d=O*W-J*j,j=O*j+J*W,W=d}}}},g.prototype.guessLen13b=function(U,A){var X=Math.max(A,U)|1,Z=X&1,C=0;for(X=X/2|0;X;X=X>>>1)C++;return 1<<C+1+Z},g.prototype.conjugate=function(U,A,X){if(X<=1)return;for(var Z=0;Z<X/2;Z++){var C=U[Z];U[Z]=U[X-Z-1],U[X-Z-1]=C,C=A[Z],A[Z]=-A[X-Z-1],A[X-Z-1]=-C}},g.prototype.normalize13b=function(U,A){var X=0;for(var Z=0;Z<A/2;Z++){var C=Math.round(U[2*Z+1]/A)*8192+Math.round(U[2*Z]/A)+X;if(U[Z]=C&67108863,C<67108864)X=0;else X=C/67108864|0}return U},g.prototype.convert13b=function(U,A,X,Z){var C=0;for(var Y=0;Y<A;Y++)C=C+(U[Y]|0),X[2*Y]=C&8191,C=C>>>13,X[2*Y+1]=C&8191,C=C>>>13;for(Y=2*A;Y<Z;++Y)X[Y]=0;S(C===0),S((C&-8192)===0)},g.prototype.stub=function(U){var A=Array(U);for(var X=0;X<U;X++)A[X]=0;return A},g.prototype.mulp=function(U,A,X){var Z=2*this.guessLen13b(U.length,A.length),C=this.makeRBT(Z),Y=this.stub(Z),V=Array(Z),G=Array(Z),O=Array(Z),J=Array(Z),z=Array(Z),W=Array(Z),j=X.words;j.length=Z,this.convert13b(U.words,U.length,V,Z),this.convert13b(A.words,A.length,J,Z),this.transform(V,Y,G,O,Z,C),this.transform(J,Y,z,W,Z,C);for(var N=0;N<Z;N++){var p=G[N]*z[N]-O[N]*W[N];O[N]=G[N]*W[N]+O[N]*z[N],G[N]=p}return this.conjugate(G,O,Z),this.transform(G,O,j,Y,Z,C),this.conjugate(j,Y,Z),this.normalize13b(j,Z),X.negative=U.negative^A.negative,X.length=U.length+A.length,X.strip()},Q.prototype.mul=function(U){var A=new Q(null);return A.words=Array(this.length+U.length),this.mulTo(U,A)},Q.prototype.mulf=function(U){var A=new Q(null);return A.words=Array(this.length+U.length),v(this,U,A)},Q.prototype.imul=function(U){return this.clone().mulTo(U,this)},Q.prototype.imuln=function(U){S(typeof U==="number"),S(U<67108864);var A=0;for(var X=0;X<this.length;X++){var Z=(this.words[X]|0)*U,C=(Z&67108863)+(A&67108863);A>>=26,A+=Z/67108864|0,A+=C>>>26,this.words[X]=C&67108863}if(A!==0)this.words[X]=A,this.length++;return this.length=U===0?1:this.length,this},Q.prototype.muln=function(U){return this.clone().imuln(U)},Q.prototype.sqr=function(){return this.mul(this)},Q.prototype.isqr=function(){return this.imul(this.clone())},Q.prototype.pow=function(U){var A=P(U);if(A.length===0)return new Q(1);var X=this;for(var Z=0;Z<A.length;Z++,X=X.sqr())if(A[Z]!==0)break;if(++Z<A.length)for(var C=X.sqr();Z<A.length;Z++,C=C.sqr()){if(A[Z]===0)continue;X=X.mul(C)}return X},Q.prototype.iushln=function(U){S(typeof U==="number"&&U>=0);var A=U%26,X=(U-A)/26,Z=67108863>>>26-A<<26-A,C;if(A!==0){var Y=0;for(C=0;C<this.length;C++){var V=this.words[C]&Z,G=(this.words[C]|0)-V<<A;this.words[C]=G|Y,Y=V>>>26-A}if(Y)this.words[C]=Y,this.length++}if(X!==0){for(C=this.length-1;C>=0;C--)this.words[C+X]=this.words[C];for(C=0;C<X;C++)this.words[C]=0;this.length+=X}return this.strip()},Q.prototype.ishln=function(U){return S(this.negative===0),this.iushln(U)},Q.prototype.iushrn=function(U,A,X){S(typeof U==="number"&&U>=0);var Z;if(A)Z=(A-A%26)/26;else Z=0;var C=U%26,Y=Math.min((U-C)/26,this.length),V=67108863^67108863>>>C<<C,G=X;if(Z-=Y,Z=Math.max(0,Z),G){for(var O=0;O<Y;O++)G.words[O]=this.words[O];G.length=Y}if(Y===0);else if(this.length>Y){this.length-=Y;for(O=0;O<this.length;O++)this.words[O]=this.words[O+Y]}else this.words[0]=0,this.length=1;var J=0;for(O=this.length-1;O>=0&&(J!==0||O>=Z);O--){var z=this.words[O]|0;this.words[O]=J<<26-C|z>>>C,J=z&V}if(G&&J!==0)G.words[G.length++]=J;if(this.length===0)this.words[0]=0,this.length=1;return this.strip()},Q.prototype.ishrn=function(U,A,X){return S(this.negative===0),this.iushrn(U,A,X)},Q.prototype.shln=function(U){return this.clone().ishln(U)},Q.prototype.ushln=function(U){return this.clone().iushln(U)},Q.prototype.shrn=function(U){return this.clone().ishrn(U)},Q.prototype.ushrn=function(U){return this.clone().iushrn(U)},Q.prototype.testn=function(U){S(typeof U==="number"&&U>=0);var A=U%26,X=(U-A)/26,Z=1<<A;if(this.length<=X)return!1;var C=this.words[X];return!!(C&Z)},Q.prototype.imaskn=function(U){S(typeof U==="number"&&U>=0);var A=U%26,X=(U-A)/26;if(S(this.negative===0,"imaskn works only with positive numbers"),this.length<=X)return this;if(A!==0)X++;if(this.length=Math.min(X,this.length),A!==0){var Z=67108863^67108863>>>A<<A;this.words[this.length-1]&=Z}return this.strip()},Q.prototype.maskn=function(U){return this.clone().imaskn(U)},Q.prototype.iaddn=function(U){if(S(typeof U==="number"),S(U<67108864),U<0)return this.isubn(-U);if(this.negative!==0){if(this.length===1&&(this.words[0]|0)<U)return this.words[0]=U-(this.words[0]|0),this.negative=0,this;return this.negative=0,this.isubn(U),this.negative=1,this}return this._iaddn(U)},Q.prototype._iaddn=function(U){this.words[0]+=U;for(var A=0;A<this.length&&this.words[A]>=67108864;A++)if(this.words[A]-=67108864,A===this.length-1)this.words[A+1]=1;else this.words[A+1]++;return this.length=Math.max(this.length,A+1),this},Q.prototype.isubn=function(U){if(S(typeof U==="number"),S(U<67108864),U<0)return this.iaddn(-U);if(this.negative!==0)return this.negative=0,this.iaddn(U),this.negative=1,this;if(this.words[0]-=U,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var A=0;A<this.length&&this.words[A]<0;A++)this.words[A]+=67108864,this.words[A+1]-=1;return this.strip()},Q.prototype.addn=function(U){return this.clone().iaddn(U)},Q.prototype.subn=function(U){return this.clone().isubn(U)},Q.prototype.iabs=function(){return this.negative=0,this},Q.prototype.abs=function(){return this.clone().iabs()},Q.prototype._ishlnsubmul=function(U,A,X){var Z=U.length+X,C;this._expand(Z);var Y,V=0;for(C=0;C<U.length;C++){Y=(this.words[C+X]|0)+V;var G=(U.words[C]|0)*A;Y-=G&67108863,V=(Y>>26)-(G/67108864|0),this.words[C+X]=Y&67108863}for(;C<this.length-X;C++)Y=(this.words[C+X]|0)+V,V=Y>>26,this.words[C+X]=Y&67108863;if(V===0)return this.strip();S(V===-1),V=0;for(C=0;C<this.length;C++)Y=-(this.words[C]|0)+V,V=Y>>26,this.words[C]=Y&67108863;return this.negative=1,this.strip()},Q.prototype._wordDiv=function(U,A){var X=this.length-U.length,Z=this.clone(),C=U,Y=C.words[C.length-1]|0,V=this._countBits(Y);if(X=26-V,X!==0)C=C.ushln(X),Z.iushln(X),Y=C.words[C.length-1]|0;var G=Z.length-C.length,O;if(A!=="mod"){O=new Q(null),O.length=G+1,O.words=Array(O.length);for(var J=0;J<O.length;J++)O.words[J]=0}var z=Z.clone()._ishlnsubmul(C,1,G);if(z.negative===0){if(Z=z,O)O.words[G]=1}for(var W=G-1;W>=0;W--){var j=(Z.words[C.length+W]|0)*67108864+(Z.words[C.length+W-1]|0);j=Math.min(j/Y|0,67108863),Z._ishlnsubmul(C,j,W);while(Z.negative!==0)if(j--,Z.negative=0,Z._ishlnsubmul(C,1,W),!Z.isZero())Z.negative^=1;if(O)O.words[W]=j}if(O)O.strip();if(Z.strip(),A!=="div"&&X!==0)Z.iushrn(X);return{div:O||null,mod:Z}},Q.prototype.divmod=function(U,A,X){if(S(!U.isZero()),this.isZero())return{div:new Q(0),mod:new Q(0)};var Z,C,Y;if(this.negative!==0&&U.negative===0){if(Y=this.neg().divmod(U,A),A!=="mod")Z=Y.div.neg();if(A!=="div"){if(C=Y.mod.neg(),X&&C.negative!==0)C.iadd(U)}return{div:Z,mod:C}}if(this.negative===0&&U.negative!==0){if(Y=this.divmod(U.neg(),A),A!=="mod")Z=Y.div.neg();return{div:Z,mod:Y.mod}}if((this.negative&U.negative)!==0){if(Y=this.neg().divmod(U.neg(),A),A!=="div"){if(C=Y.mod.neg(),X&&C.negative!==0)C.isub(U)}return{div:Y.div,mod:C}}if(U.length>this.length||this.cmp(U)<0)return{div:new Q(0),mod:this};if(U.length===1){if(A==="div")return{div:this.divn(U.words[0]),mod:null};if(A==="mod")return{div:null,mod:new Q(this.modn(U.words[0]))};return{div:this.divn(U.words[0]),mod:new Q(this.modn(U.words[0]))}}return this._wordDiv(U,A)},Q.prototype.div=function(U){return this.divmod(U,"div",!1).div},Q.prototype.mod=function(U){return this.divmod(U,"mod",!1).mod},Q.prototype.umod=function(U){return this.divmod(U,"mod",!0).mod},Q.prototype.divRound=function(U){var A=this.divmod(U);if(A.mod.isZero())return A.div;var X=A.div.negative!==0?A.mod.isub(U):A.mod,Z=U.ushrn(1),C=U.andln(1),Y=X.cmp(Z);if(Y<0||C===1&&Y===0)return A.div;return A.div.negative!==0?A.div.isubn(1):A.div.iaddn(1)},Q.prototype.modn=function(U){S(U<=67108863);var A=67108864%U,X=0;for(var Z=this.length-1;Z>=0;Z--)X=(A*X+(this.words[Z]|0))%U;return X},Q.prototype.idivn=function(U){S(U<=67108863);var A=0;for(var X=this.length-1;X>=0;X--){var Z=(this.words[X]|0)+A*67108864;this.words[X]=Z/U|0,A=Z%U}return this.strip()},Q.prototype.divn=function(U){return this.clone().idivn(U)},Q.prototype.egcd=function(U){S(U.negative===0),S(!U.isZero());var A=this,X=U.clone();if(A.negative!==0)A=A.umod(U);else A=A.clone();var Z=new Q(1),C=new Q(0),Y=new Q(0),V=new Q(1),G=0;while(A.isEven()&&X.isEven())A.iushrn(1),X.iushrn(1),++G;var O=X.clone(),J=A.clone();while(!A.isZero()){for(var z=0,W=1;(A.words[0]&W)===0&&z<26;++z,W<<=1);if(z>0){A.iushrn(z);while(z-- >0){if(Z.isOdd()||C.isOdd())Z.iadd(O),C.isub(J);Z.iushrn(1),C.iushrn(1)}}for(var j=0,N=1;(X.words[0]&N)===0&&j<26;++j,N<<=1);if(j>0){X.iushrn(j);while(j-- >0){if(Y.isOdd()||V.isOdd())Y.iadd(O),V.isub(J);Y.iushrn(1),V.iushrn(1)}}if(A.cmp(X)>=0)A.isub(X),Z.isub(Y),C.isub(V);else X.isub(A),Y.isub(Z),V.isub(C)}return{a:Y,b:V,gcd:X.iushln(G)}},Q.prototype._invmp=function(U){S(U.negative===0),S(!U.isZero());var A=this,X=U.clone();if(A.negative!==0)A=A.umod(U);else A=A.clone();var Z=new Q(1),C=new Q(0),Y=X.clone();while(A.cmpn(1)>0&&X.cmpn(1)>0){for(var V=0,G=1;(A.words[0]&G)===0&&V<26;++V,G<<=1);if(V>0){A.iushrn(V);while(V-- >0){if(Z.isOdd())Z.iadd(Y);Z.iushrn(1)}}for(var O=0,J=1;(X.words[0]&J)===0&&O<26;++O,J<<=1);if(O>0){X.iushrn(O);while(O-- >0){if(C.isOdd())C.iadd(Y);C.iushrn(1)}}if(A.cmp(X)>=0)A.isub(X),Z.isub(C);else X.isub(A),C.isub(Z)}var z;if(A.cmpn(1)===0)z=Z;else z=C;if(z.cmpn(0)<0)z.iadd(U);return z},Q.prototype.gcd=function(U){if(this.isZero())return U.abs();if(U.isZero())return this.abs();var A=this.clone(),X=U.clone();A.negative=0,X.negative=0;for(var Z=0;A.isEven()&&X.isEven();Z++)A.iushrn(1),X.iushrn(1);do{while(A.isEven())A.iushrn(1);while(X.isEven())X.iushrn(1);var C=A.cmp(X);if(C<0){var Y=A;A=X,X=Y}else if(C===0||X.cmpn(1)===0)break;A.isub(X)}while(!0);return X.iushln(Z)},Q.prototype.invm=function(U){return this.egcd(U).a.umod(U)},Q.prototype.isEven=function(){return(this.words[0]&1)===0},Q.prototype.isOdd=function(){return(this.words[0]&1)===1},Q.prototype.andln=function(U){return this.words[0]&U},Q.prototype.bincn=function(U){S(typeof U==="number");var A=U%26,X=(U-A)/26,Z=1<<A;if(this.length<=X)return this._expand(X+1),this.words[X]|=Z,this;var C=Z;for(var Y=X;C!==0&&Y<this.length;Y++){var V=this.words[Y]|0;V+=C,C=V>>>26,V&=67108863,this.words[Y]=V}if(C!==0)this.words[Y]=C,this.length++;return this},Q.prototype.isZero=function(){return this.length===1&&this.words[0]===0},Q.prototype.cmpn=function(U){var A=U<0;if(this.negative!==0&&!A)return-1;if(this.negative===0&&A)return 1;this.strip();var X;if(this.length>1)X=1;else{if(A)U=-U;S(U<=67108863,"Number is too big");var Z=this.words[0]|0;X=Z===U?0:Z<U?-1:1}if(this.negative!==0)return-X|0;return X},Q.prototype.cmp=function(U){if(this.negative!==0&&U.negative===0)return-1;if(this.negative===0&&U.negative!==0)return 1;var A=this.ucmp(U);if(this.negative!==0)return-A|0;return A},Q.prototype.ucmp=function(U){if(this.length>U.length)return 1;if(this.length<U.length)return-1;var A=0;for(var X=this.length-1;X>=0;X--){var Z=this.words[X]|0,C=U.words[X]|0;if(Z===C)continue;if(Z<C)A=-1;else if(Z>C)A=1;break}return A},Q.prototype.gtn=function(U){return this.cmpn(U)===1},Q.prototype.gt=function(U){return this.cmp(U)===1},Q.prototype.gten=function(U){return this.cmpn(U)>=0},Q.prototype.gte=function(U){return this.cmp(U)>=0},Q.prototype.ltn=function(U){return this.cmpn(U)===-1},Q.prototype.lt=function(U){return this.cmp(U)===-1},Q.prototype.lten=function(U){return this.cmpn(U)<=0},Q.prototype.lte=function(U){return this.cmp(U)<=0},Q.prototype.eqn=function(U){return this.cmpn(U)===0},Q.prototype.eq=function(U){return this.cmp(U)===0},Q.red=function(U){return new u(U)},Q.prototype.toRed=function(U){return S(!this.red,"Already a number in reduction context"),S(this.negative===0,"red works only with positives"),U.convertTo(this)._forceRed(U)},Q.prototype.fromRed=function(){return S(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},Q.prototype._forceRed=function(U){return this.red=U,this},Q.prototype.forceRed=function(U){return S(!this.red,"Already a number in reduction context"),this._forceRed(U)},Q.prototype.redAdd=function(U){return S(this.red,"redAdd works only with red numbers"),this.red.add(this,U)},Q.prototype.redIAdd=function(U){return S(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,U)},Q.prototype.redSub=function(U){return S(this.red,"redSub works only with red numbers"),this.red.sub(this,U)},Q.prototype.redISub=function(U){return S(this.red,"redISub works only with red numbers"),this.red.isub(this,U)},Q.prototype.redShl=function(U){return S(this.red,"redShl works only with red numbers"),this.red.shl(this,U)},Q.prototype.redMul=function(U){return S(this.red,"redMul works only with red numbers"),this.red._verify2(this,U),this.red.mul(this,U)},Q.prototype.redIMul=function(U){return S(this.red,"redMul works only with red numbers"),this.red._verify2(this,U),this.red.imul(this,U)},Q.prototype.redSqr=function(){return S(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},Q.prototype.redISqr=function(){return S(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},Q.prototype.redSqrt=function(){return S(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},Q.prototype.redInvm=function(){return S(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},Q.prototype.redNeg=function(){return S(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},Q.prototype.redPow=function(U){return S(this.red&&!U.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,U)};var f={k256:null,p224:null,p192:null,p25519:null};function w(U,A){this.name=U,this.p=new Q(A,16),this.n=this.p.bitLength(),this.k=new Q(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}w.prototype._tmp=function(){var U=new Q(null);return U.words=Array(Math.ceil(this.n/13)),U},w.prototype.ireduce=function(U){var A=U,X;do this.split(A,this.tmp),A=this.imulK(A),A=A.iadd(this.tmp),X=A.bitLength();while(X>this.n);var Z=X<this.n?-1:A.ucmp(this.p);if(Z===0)A.words[0]=0,A.length=1;else if(Z>0)A.isub(this.p);else if(A.strip!==void 0)A.strip();else A._strip();return A},w.prototype.split=function(U,A){U.iushrn(this.n,0,A)},w.prototype.imulK=function(U){return U.imul(this.k)};function b(){w.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}K(b,w),b.prototype.split=function(U,A){var X=4194303,Z=Math.min(U.length,9);for(var C=0;C<Z;C++)A.words[C]=U.words[C];if(A.length=Z,U.length<=9){U.words[0]=0,U.length=1;return}var Y=U.words[9];A.words[A.length++]=Y&X;for(C=10;C<U.length;C++){var V=U.words[C]|0;U.words[C-10]=(V&X)<<4|Y>>>22,Y=V}if(Y>>>=22,U.words[C-10]=Y,Y===0&&U.length>10)U.length-=10;else U.length-=9},b.prototype.imulK=function(U){U.words[U.length]=0,U.words[U.length+1]=0,U.length+=2;var A=0;for(var X=0;X<U.length;X++){var Z=U.words[X]|0;A+=Z*977,U.words[X]=A&67108863,A=Z*64+(A/67108864|0)}if(U.words[U.length-1]===0){if(U.length--,U.words[U.length-1]===0)U.length--}return U};function I0(){w.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}K(I0,w);function X0(){w.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}K(X0,w);function C0(){w.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}K(C0,w),C0.prototype.imulK=function(U){var A=0;for(var X=0;X<U.length;X++){var Z=(U.words[X]|0)*19+A,C=Z&67108863;Z>>>=26,U.words[X]=C,A=Z}if(A!==0)U.words[U.length++]=A;return U},Q._prime=function(U){if(f[U])return f[U];var A;if(U==="k256")A=new b;else if(U==="p224")A=new I0;else if(U==="p192")A=new X0;else if(U==="p25519")A=new C0;else throw Error("Unknown prime "+U);return f[U]=A,A};function u(U){if(typeof U==="string"){var A=Q._prime(U);this.m=A.p,this.prime=A}else S(U.gtn(1),"modulus must be greater than 1"),this.m=U,this.prime=null}u.prototype._verify1=function(U){S(U.negative===0,"red works only with positives"),S(U.red,"red works only with red numbers")},u.prototype._verify2=function(U,A){S((U.negative|A.negative)===0,"red works only with positives"),S(U.red&&U.red===A.red,"red works only with red numbers")},u.prototype.imod=function(U){if(this.prime)return this.prime.ireduce(U)._forceRed(this);return U.umod(this.m)._forceRed(this)},u.prototype.neg=function(U){if(U.isZero())return U.clone();return this.m.sub(U)._forceRed(this)},u.prototype.add=function(U,A){this._verify2(U,A);var X=U.add(A);if(X.cmp(this.m)>=0)X.isub(this.m);return X._forceRed(this)},u.prototype.iadd=function(U,A){this._verify2(U,A);var X=U.iadd(A);if(X.cmp(this.m)>=0)X.isub(this.m);return X},u.prototype.sub=function(U,A){this._verify2(U,A);var X=U.sub(A);if(X.cmpn(0)<0)X.iadd(this.m);return X._forceRed(this)},u.prototype.isub=function(U,A){this._verify2(U,A);var X=U.isub(A);if(X.cmpn(0)<0)X.iadd(this.m);return X},u.prototype.shl=function(U,A){return this._verify1(U),this.imod(U.ushln(A))},u.prototype.imul=function(U,A){return this._verify2(U,A),this.imod(U.imul(A))},u.prototype.mul=function(U,A){return this._verify2(U,A),this.imod(U.mul(A))},u.prototype.isqr=function(U){return this.imul(U,U.clone())},u.prototype.sqr=function(U){return this.mul(U,U)},u.prototype.sqrt=function(U){if(U.isZero())return U.clone();var A=this.m.andln(3);if(S(A%2===1),A===3){var X=this.m.add(new Q(1)).iushrn(2);return this.pow(U,X)}var Z=this.m.subn(1),C=0;while(!Z.isZero()&&Z.andln(1)===0)C++,Z.iushrn(1);S(!Z.isZero());var Y=new Q(1).toRed(this),V=Y.redNeg(),G=this.m.subn(1).iushrn(1),O=this.m.bitLength();O=new Q(2*O*O).toRed(this);while(this.pow(O,G).cmp(V)!==0)O.redIAdd(V);var J=this.pow(O,Z),z=this.pow(U,Z.addn(1).iushrn(1)),W=this.pow(U,Z),j=C;while(W.cmp(Y)!==0){var N=W;for(var p=0;N.cmp(Y)!==0;p++)N=N.redSqr();S(p<j);var n=this.pow(J,new Q(1).iushln(j-p-1));z=z.redMul(n),J=n.redSqr(),W=W.redMul(J),j=p}return z},u.prototype.invm=function(U){var A=U._invmp(this.m);if(A.negative!==0)return A.negative=0,this.imod(A).redNeg();else return this.imod(A)},u.prototype.pow=function(U,A){if(A.isZero())return new Q(1).toRed(this);if(A.cmpn(1)===0)return U.clone();var X=4,Z=Array(1<<X);Z[0]=new Q(1).toRed(this),Z[1]=U;for(var C=2;C<Z.length;C++)Z[C]=this.mul(Z[C-1],U);var Y=Z[0],V=0,G=0,O=A.bitLength()%26;if(O===0)O=26;for(C=A.length-1;C>=0;C--){var J=A.words[C];for(var z=O-1;z>=0;z--){var W=J>>z&1;if(Y!==Z[0])Y=this.sqr(Y);if(W===0&&V===0){G=0;continue}if(V<<=1,V|=W,G++,G!==X&&(C!==0||z!==0))continue;Y=this.mul(Y,Z[V]),G=0,V=0}O=26}return Y},u.prototype.convertTo=function(U){var A=U.umod(this.m);return A===U?A.clone():A},u.prototype.convertFrom=function(U){var A=U.clone();return A.red=null,A},Q.mont=function(U){return new O0(U)};function O0(U){if(u.call(this,U),this.shift=this.m.bitLength(),this.shift%26!==0)this.shift+=26-this.shift%26;this.r=new Q(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}K(O0,u),O0.prototype.convertTo=function(U){return this.imod(U.ushln(this.shift))},O0.prototype.convertFrom=function(U){var A=this.imod(U.mul(this.rinv));return A.red=null,A},O0.prototype.imul=function(U,A){if(U.isZero()||A.isZero())return U.words[0]=0,U.length=1,U;var X=U.imul(A),Z=X.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),C=X.isub(Z).iushrn(this.shift),Y=C;if(C.cmp(this.m)>=0)Y=C.isub(this.m);else if(C.cmpn(0)<0)Y=C.iadd(this.m);return Y._forceRed(this)},O0.prototype.mul=function(U,A){if(U.isZero()||A.isZero())return new Q(0)._forceRed(this);var X=U.mul(A),Z=X.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),C=X.isub(Z).iushrn(this.shift),Y=C;if(C.cmp(this.m)>=0)Y=C.isub(this.m);else if(C.cmpn(0)<0)Y=C.iadd(this.m);return Y._forceRed(this)},O0.prototype.invm=function(U){var A=this.imod(U._invmp(this.m).mul(this.r2));return A._forceRed(this)}})(typeof I>"u"||I,$)}),rG=Q0(($)=>{var I=dO(),E=gU(),L=$;L.define=function(K,Q){return new S(K,Q)};function S(K,Q){this.name=K,this.body=Q,this.decoders={},this.encoders={}}S.prototype._createNamed=function(K){var Q;try{Q=(()=>{throw new Error("Cannot require module "+"vm");})().runInThisContext("(function "+this.name+`(entity) {
|
|
13
13
|
this._initNamed(entity);
|
|
14
|
-
})`)}catch(z){A=function(M){this._initNamed(M)}}return V(A,F),A.prototype._initNamed=function(z){F.call(this,z)},new A(this)},C.prototype._getDecoder=function(F){if(F=F||"der",!this.decoders.hasOwnProperty(F))this.decoders[F]=this._createNamed($.decoders[F]);return this.decoders[F]},C.prototype.decode=function(F,A,z){return this._getDecoder(A).decode(F,z)},C.prototype._getEncoder=function(F){if(F=F||"der",!this.encoders.hasOwnProperty(F))this.encoders[F]=this._createNamed($.encoders[F]);return this.encoders[F]},C.prototype.encode=function(F,A,z){return this._getEncoder(A).encode(F,z)}}),OG=$0((Q)=>{var $=xU();function V(C){this._reporterState={obj:null,path:[],options:C||{},errors:[]}}Q.Reporter=V,V.prototype.isError=function(C){return C instanceof W},V.prototype.save=function(){var C=this._reporterState;return{obj:C.obj,pathLen:C.path.length}},V.prototype.restore=function(C){var F=this._reporterState;F.obj=C.obj,F.path=F.path.slice(0,C.pathLen)},V.prototype.enterKey=function(C){return this._reporterState.path.push(C)},V.prototype.exitKey=function(C){var F=this._reporterState;F.path=F.path.slice(0,C-1)},V.prototype.leaveKey=function(C,F,A){var z=this._reporterState;if(this.exitKey(C),z.obj!==null)z.obj[F]=A},V.prototype.path=function(){return this._reporterState.path.join("/")},V.prototype.enterObject=function(){var C=this._reporterState,F=C.obj;return C.obj={},F},V.prototype.leaveObject=function(C){var F=this._reporterState,A=F.obj;return F.obj=C,A},V.prototype.error=function(C){var F,A=this._reporterState,z=C instanceof W;if(z)F=C;else F=new W(A.path.map(function(M){return"["+JSON.stringify(M)+"]"}).join(""),C.message||C,C.stack);if(!A.options.partial)throw F;if(!z)A.errors.push(F);return F},V.prototype.wrapResult=function(C){var F=this._reporterState;if(!F.options.partial)return C;return{result:this.isError(C)?null:C,errors:F.errors}};function W(C,F){this.path=C,this.rethrow(F)}$(W,Error),W.prototype.rethrow=function(C){if(this.message=C+" at: "+(this.path||"(shallow)"),Error.captureStackTrace)Error.captureStackTrace(this,W);if(!this.stack)try{throw Error(this.message)}catch(F){this.stack=F.stack}return this}}),sQ=$0((Q)=>{var $=xU(),V=_O().Reporter,W=(HU(),h0(WU)).Buffer;function C(A,z){if(V.call(this,z),!W.isBuffer(A)){this.error("Input not Buffer");return}this.base=A,this.offset=0,this.length=A.length}$(C,V),Q.DecoderBuffer=C,C.prototype.save=function(){return{offset:this.offset,reporter:V.prototype.save.call(this)}},C.prototype.restore=function(A){var z=new C(this.base);return z.offset=A.offset,z.length=this.offset,this.offset=A.offset,V.prototype.restore.call(this,A.reporter),z},C.prototype.isEmpty=function(){return this.offset===this.length},C.prototype.readUInt8=function(A){if(this.offset+1<=this.length)return this.base.readUInt8(this.offset++,!0);else return this.error(A||"DecoderBuffer overrun")},C.prototype.skip=function(A,z){if(!(this.offset+A<=this.length))return this.error(z||"DecoderBuffer overrun");var M=new C(this.base);return M._reporterState=this._reporterState,M.offset=this.offset,M.length=this.offset+A,this.offset+=A,M},C.prototype.raw=function(A){return this.base.slice(A?A.offset:this.offset,this.length)};function F(A,z){if(Array.isArray(A))this.length=0,this.value=A.map(function(M){if(!(M instanceof F))M=new F(M,z);return this.length+=M.length,M},this);else if(typeof A==="number"){if(!(0<=A&&A<=255))return z.error("non-byte EncoderBuffer value");this.value=A,this.length=1}else if(typeof A==="string")this.value=A,this.length=W.byteLength(A);else if(W.isBuffer(A))this.value=A,this.length=A.length;else return z.error("Unsupported type: "+typeof A)}Q.EncoderBuffer=F,F.prototype.join=function(A,z){if(!A)A=new W(this.length);if(!z)z=0;if(this.length===0)return A;if(Array.isArray(this.value))this.value.forEach(function(M){M.join(A,z),z+=M.length});else{if(typeof this.value==="number")A[z]=this.value;else if(typeof this.value==="string")A.write(this.value,z);else if(W.isBuffer(this.value))this.value.copy(A,z);z+=this.length}return A}}),ZG=$0((Q,$)=>{var V=_O().Reporter,W=_O().EncoderBuffer,C=_O().DecoderBuffer,F=OO(),A=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],z=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(A),M=["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"];function S(L,H){var q={};if(this._baseState=q,q.enc=L,q.parent=H||null,q.children=null,q.tag=null,q.args=null,q.reverseArgs=null,q.choice=null,q.optional=!1,q.any=!1,q.obj=!1,q.use=null,q.useDecoder=null,q.key=null,q.default=null,q.explicit=null,q.implicit=null,q.contains=null,!q.parent)q.children=[],this._wrap()}$.exports=S;var R=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];S.prototype.clone=function(){var L=this._baseState,H={};R.forEach(function(P){H[P]=L[P]});var q=new this.constructor(H.parent);return q._baseState=H,q},S.prototype._wrap=function(){var L=this._baseState;z.forEach(function(H){this[H]=function(){var q=new this.constructor(this);return L.children.push(q),q[H].apply(q,arguments)}},this)},S.prototype._init=function(L){var H=this._baseState;F(H.parent===null),L.call(this),H.children=H.children.filter(function(q){return q._baseState.parent===this},this),F.equal(H.children.length,1,"Root node can have only one child")},S.prototype._useArgs=function(L){var H=this._baseState,q=L.filter(function(P){return P instanceof this.constructor},this);if(L=L.filter(function(P){return!(P instanceof this.constructor)},this),q.length!==0)F(H.children===null),H.children=q,q.forEach(function(P){P._baseState.parent=this},this);if(L.length!==0)F(H.args===null),H.args=L,H.reverseArgs=L.map(function(P){if(typeof P!=="object"||P.constructor!==Object)return P;var _={};return Object.keys(P).forEach(function(k){if(k==(k|0))k|=0;var B=P[k];_[B]=k}),_})},M.forEach(function(L){S.prototype[L]=function(){var H=this._baseState;throw Error(L+" not implemented for encoding: "+H.enc)}}),A.forEach(function(L){S.prototype[L]=function(){var H=this._baseState,q=Array.prototype.slice.call(arguments);return F(H.tag===null),H.tag=L,this._useArgs(q),this}}),S.prototype.use=function(L){F(L);var H=this._baseState;return F(H.use===null),H.use=L,this},S.prototype.optional=function(){var L=this._baseState;return L.optional=!0,this},S.prototype.def=function(L){var H=this._baseState;return F(H.default===null),H.default=L,H.optional=!0,this},S.prototype.explicit=function(L){var H=this._baseState;return F(H.explicit===null&&H.implicit===null),H.explicit=L,this},S.prototype.implicit=function(L){var H=this._baseState;return F(H.explicit===null&&H.implicit===null),H.implicit=L,this},S.prototype.obj=function(){var L=this._baseState,H=Array.prototype.slice.call(arguments);if(L.obj=!0,H.length!==0)this._useArgs(H);return this},S.prototype.key=function(L){var H=this._baseState;return F(H.key===null),H.key=L,this},S.prototype.any=function(){var L=this._baseState;return L.any=!0,this},S.prototype.choice=function(L){var H=this._baseState;return F(H.choice===null),H.choice=L,this._useArgs(Object.keys(L).map(function(q){return L[q]})),this},S.prototype.contains=function(L){var H=this._baseState;return F(H.use===null),H.contains=L,this},S.prototype._decode=function(L,H){var q=this._baseState;if(q.parent===null)return L.wrapResult(q.children[0]._decode(L,H));var P=q.default,_=!0,k=null;if(q.key!==null)k=L.enterKey(q.key);if(q.optional){var B=null;if(q.explicit!==null)B=q.explicit;else if(q.implicit!==null)B=q.implicit;else if(q.tag!==null)B=q.tag;if(B===null&&!q.any){var j=L.save();try{if(q.choice===null)this._decodeGeneric(q.tag,L,H);else this._decodeChoice(L,H);_=!0}catch(J0){_=!1}L.restore(j)}else if(_=this._peekTag(L,B,q.any),L.isError(_))return _}var x;if(q.obj&&_)x=L.enterObject();if(_){if(q.explicit!==null){var f=this._decodeTag(L,q.explicit);if(L.isError(f))return f;L=f}var w=L.offset;if(q.use===null&&q.choice===null){if(q.any)var j=L.save();var d=this._decodeTag(L,q.implicit!==null?q.implicit:q.tag,q.any);if(L.isError(d))return d;if(q.any)P=L.raw(j);else L=d}if(H&&H.track&&q.tag!==null)H.track(L.path(),w,L.length,"tagged");if(H&&H.track&&q.tag!==null)H.track(L.path(),L.offset,L.length,"content");if(q.any)P=P;else if(q.choice===null)P=this._decodeGeneric(q.tag,L,H);else P=this._decodeChoice(L,H);if(L.isError(P))return P;if(!q.any&&q.choice===null&&q.children!==null)q.children.forEach(function(J0){J0._decode(L,H)});if(q.contains&&(q.tag==="octstr"||q.tag==="bitstr")){var Y0=new C(P);P=this._getUse(q.contains,L._reporterState.obj)._decode(Y0,H)}}if(q.obj&&_)P=L.leaveObject(x);if(q.key!==null&&(P!==null||_===!0))L.leaveKey(k,q.key,P);else if(k!==null)L.exitKey(k);return P},S.prototype._decodeGeneric=function(L,H,q){var P=this._baseState;if(L==="seq"||L==="set")return null;if(L==="seqof"||L==="setof")return this._decodeList(H,L,P.args[0],q);else if(/str$/.test(L))return this._decodeStr(H,L,q);else if(L==="objid"&&P.args)return this._decodeObjid(H,P.args[0],P.args[1],q);else if(L==="objid")return this._decodeObjid(H,null,null,q);else if(L==="gentime"||L==="utctime")return this._decodeTime(H,L,q);else if(L==="null_")return this._decodeNull(H,q);else if(L==="bool")return this._decodeBool(H,q);else if(L==="objDesc")return this._decodeStr(H,L,q);else if(L==="int"||L==="enum")return this._decodeInt(H,P.args&&P.args[0],q);if(P.use!==null)return this._getUse(P.use,H._reporterState.obj)._decode(H,q);else return H.error("unknown tag: "+L)},S.prototype._getUse=function(L,H){var q=this._baseState;if(q.useDecoder=this._use(L,H),F(q.useDecoder._baseState.parent===null),q.useDecoder=q.useDecoder._baseState.children[0],q.implicit!==q.useDecoder._baseState.implicit)q.useDecoder=q.useDecoder.clone(),q.useDecoder._baseState.implicit=q.implicit;return q.useDecoder},S.prototype._decodeChoice=function(L,H){var q=this._baseState,P=null,_=!1;if(Object.keys(q.choice).some(function(k){var B=L.save(),j=q.choice[k];try{var x=j._decode(L,H);if(L.isError(x))return!1;P={type:k,value:x},_=!0}catch(f){return L.restore(B),!1}return!0},this),!_)return L.error("Choice not matched");return P},S.prototype._createEncoderBuffer=function(L){return new W(L,this.reporter)},S.prototype._encode=function(L,H,q){var P=this._baseState;if(P.default!==null&&P.default===L)return;var _=this._encodeValue(L,H,q);if(_===void 0)return;if(this._skipDefault(_,H,q))return;return _},S.prototype._encodeValue=function(L,H,q){var P=this._baseState;if(P.parent===null)return P.children[0]._encode(L,H||new V);var j=null;if(this.reporter=H,P.optional&&L===void 0)if(P.default!==null)L=P.default;else return;var _=null,k=!1;if(P.any)j=this._createEncoderBuffer(L);else if(P.choice)j=this._encodeChoice(L,H);else if(P.contains)_=this._getUse(P.contains,q)._encode(L,H),k=!0;else if(P.children)_=P.children.map(function(w){if(w._baseState.tag==="null_")return w._encode(null,H,L);if(w._baseState.key===null)return H.error("Child should have a key");var d=H.enterKey(w._baseState.key);if(typeof L!=="object")return H.error("Child expected, but input is not object");var Y0=w._encode(L[w._baseState.key],H,L);return H.leaveKey(d),Y0},this).filter(function(w){return w}),_=this._createEncoderBuffer(_);else if(P.tag==="seqof"||P.tag==="setof"){if(!(P.args&&P.args.length===1))return H.error("Too many args for : "+P.tag);if(!Array.isArray(L))return H.error("seqof/setof, but data is not Array");var B=this.clone();B._baseState.implicit=null,_=this._createEncoderBuffer(L.map(function(w){var d=this._baseState;return this._getUse(d.args[0],L)._encode(w,H)},B))}else if(P.use!==null)j=this._getUse(P.use,q)._encode(L,H);else _=this._encodePrimitive(P.tag,L),k=!0;var j;if(!P.any&&P.choice===null){var x=P.implicit!==null?P.implicit:P.tag,f=P.implicit===null?"universal":"context";if(x===null){if(P.use===null)H.error("Tag could be omitted only for .use()")}else if(P.use===null)j=this._encodeComposite(x,k,f,_)}if(P.explicit!==null)j=this._encodeComposite(P.explicit,!1,"context",j);return j},S.prototype._encodeChoice=function(L,H){var q=this._baseState,P=q.choice[L.type];if(!P)F(!1,L.type+" not found in "+JSON.stringify(Object.keys(q.choice)));return P._encode(L.value,H)},S.prototype._encodePrimitive=function(L,H){var q=this._baseState;if(/str$/.test(L))return this._encodeStr(H,L);else if(L==="objid"&&q.args)return this._encodeObjid(H,q.reverseArgs[0],q.args[1]);else if(L==="objid")return this._encodeObjid(H,null,null);else if(L==="gentime"||L==="utctime")return this._encodeTime(H,L);else if(L==="null_")return this._encodeNull();else if(L==="int"||L==="enum")return this._encodeInt(H,q.args&&q.reverseArgs[0]);else if(L==="bool")return this._encodeBool(H);else if(L==="objDesc")return this._encodeStr(H,L);else throw Error("Unsupported tag: "+L)},S.prototype._isNumstr=function(L){return/^[0-9 ]*$/.test(L)},S.prototype._isPrintstr=function(L){return/^[A-Za-z0-9 '\(\)\+,\-\.\/:=\?]*$/.test(L)}}),_O=$0((Q)=>{var $=Q;$.Reporter=OG().Reporter,$.DecoderBuffer=sQ().DecoderBuffer,$.EncoderBuffer=sQ().EncoderBuffer,$.Node=ZG()}),XG=$0((Q)=>{var $=CY();Q.tagClass={0:"universal",1:"application",2:"context",3:"private"},Q.tagClassByName=$._reverse(Q.tagClass),Q.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},Q.tagByName=$._reverse(Q.tag)}),CY=$0((Q)=>{var $=Q;$._reverse=function(V){var W={};return Object.keys(V).forEach(function(C){if((C|0)==C)C=C|0;var F=V[C];W[F]=C}),W},$.der=XG()}),KY=$0((Q,$)=>{var V=xU(),W=NO(),C=W.base,F=W.bignum,A=W.constants.der;function z(L){this.enc="der",this.name=L.name,this.entity=L,this.tree=new M,this.tree._init(L.body)}$.exports=z,z.prototype.decode=function(L,H){if(!(L instanceof C.DecoderBuffer))L=new C.DecoderBuffer(L,H);return this.tree._decode(L,H)};function M(L){C.Node.call(this,"der",L)}V(M,C.Node),M.prototype._peekTag=function(L,H,q){if(L.isEmpty())return!1;var P=L.save(),_=S(L,'Failed to peek tag: "'+H+'"');if(L.isError(_))return _;return L.restore(P),_.tag===H||_.tagStr===H||_.tagStr+"of"===H||q},M.prototype._decodeTag=function(L,H,q){var P=S(L,'Failed to decode tag of "'+H+'"');if(L.isError(P))return P;var _=R(L,P.primitive,'Failed to get length of "'+H+'"');if(L.isError(_))return _;if(!q&&P.tag!==H&&P.tagStr!==H&&P.tagStr+"of"!==H)return L.error('Failed to match tag: "'+H+'"');if(P.primitive||_!==null)return L.skip(_,'Failed to match body of: "'+H+'"');var k=L.save(),B=this._skipUntilEnd(L,'Failed to skip indefinite length body: "'+this.tag+'"');if(L.isError(B))return B;return _=L.offset-k.offset,L.restore(k),L.skip(_,'Failed to match body of: "'+H+'"')},M.prototype._skipUntilEnd=function(L,H){while(!0){var q=S(L,H);if(L.isError(q))return q;var P=R(L,q.primitive,H);if(L.isError(P))return P;var _;if(q.primitive||P!==null)_=L.skip(P);else _=this._skipUntilEnd(L,H);if(L.isError(_))return _;if(q.tagStr==="end")break}},M.prototype._decodeList=function(L,H,q,P){var _=[];while(!L.isEmpty()){var k=this._peekTag(L,"end");if(L.isError(k))return k;var B=q.decode(L,"der",P);if(L.isError(B)&&k)break;_.push(B)}return _},M.prototype._decodeStr=function(L,H){if(H==="bitstr"){var q=L.readUInt8();if(L.isError(q))return q;return{unused:q,data:L.raw()}}else if(H==="bmpstr"){var P=L.raw();if(P.length%2===1)return L.error("Decoding of string type: bmpstr length mismatch");var _="";for(var k=0;k<P.length/2;k++)_+=String.fromCharCode(P.readUInt16BE(k*2));return _}else if(H==="numstr"){var B=L.raw().toString("ascii");if(!this._isNumstr(B))return L.error("Decoding of string type: numstr unsupported characters");return B}else if(H==="octstr")return L.raw();else if(H==="objDesc")return L.raw();else if(H==="printstr"){var j=L.raw().toString("ascii");if(!this._isPrintstr(j))return L.error("Decoding of string type: printstr unsupported characters");return j}else if(/str$/.test(H))return L.raw().toString();else return L.error("Decoding of string type: "+H+" unsupported")},M.prototype._decodeObjid=function(L,H,q){var P,_=[],k=0;while(!L.isEmpty()){var B=L.readUInt8();if(k<<=7,k|=B&127,(B&128)===0)_.push(k),k=0}if(B&128)_.push(k);var j=_[0]/40|0,x=_[0]%40;if(q)P=_;else P=[j,x].concat(_.slice(1));if(H){var f=H[P.join(" ")];if(f===void 0)f=H[P.join(".")];if(f!==void 0)P=f}return P},M.prototype._decodeTime=function(L,H){var q=L.raw().toString();if(H==="gentime")var P=q.slice(0,4)|0,_=q.slice(4,6)|0,k=q.slice(6,8)|0,B=q.slice(8,10)|0,j=q.slice(10,12)|0,x=q.slice(12,14)|0;else if(H==="utctime"){var P=q.slice(0,2)|0,_=q.slice(2,4)|0,k=q.slice(4,6)|0,B=q.slice(6,8)|0,j=q.slice(8,10)|0,x=q.slice(10,12)|0;if(P<70)P=2000+P;else P=1900+P}else return L.error("Decoding "+H+" time is not supported yet");return Date.UTC(P,_-1,k,B,j,x,0)},M.prototype._decodeNull=function(L){return null},M.prototype._decodeBool=function(L){var H=L.readUInt8();if(L.isError(H))return H;else return H!==0},M.prototype._decodeInt=function(L,H){var q=L.raw(),P=new F(q);if(H)P=H[P.toString(10)]||P;return P},M.prototype._use=function(L,H){if(typeof L==="function")L=L(H);return L._getDecoder("der").tree};function S(L,H){var q=L.readUInt8(H);if(L.isError(q))return q;var P=A.tagClass[q>>6],_=(q&32)===0;if((q&31)===31){var k=q;q=0;while((k&128)===128){if(k=L.readUInt8(H),L.isError(k))return k;q<<=7,q|=k&127}}else q&=31;var B=A.tag[q];return{cls:P,primitive:_,tag:q,tagStr:B}}function R(L,H,q){var P=L.readUInt8(q);if(L.isError(P))return P;if(!H&&P===128)return null;if((P&128)===0)return P;var _=P&127;if(_>4)return L.error("length octect is too long");P=0;for(var k=0;k<_;k++){P<<=8;var B=L.readUInt8(q);if(L.isError(B))return B;P|=B}return P}}),QG=$0((Q,$)=>{var V=xU(),W=(HU(),h0(WU)).Buffer,C=KY();function F(A){C.call(this,A),this.enc="pem"}V(F,C),$.exports=F,F.prototype.decode=function(A,z){var M=A.toString().split(/[\r\n]+/g),S=z.label.toUpperCase(),R=/^-----(BEGIN|END) ([^-]+)-----$/,L=-1,H=-1;for(var q=0;q<M.length;q++){var P=M[q].match(R);if(P===null)continue;if(P[2]!==S)continue;if(L===-1){if(P[1]!=="BEGIN")break;L=q}else{if(P[1]!=="END")break;H=q;break}}if(L===-1||H===-1)throw Error("PEM section not found for: "+S);var _=M.slice(L+1,H).join("");_.replace(/[^a-z0-9\+\/=]+/gi,"");var k=new W(_,"base64");return C.prototype.decode.call(this,k,z)}}),YG=$0((Q)=>{var $=Q;$.der=KY(),$.pem=QG()}),LY=$0((Q,$)=>{var V=xU(),W=(HU(),h0(WU)).Buffer,C=NO(),F=C.base,A=C.constants.der;function z(L){this.enc="der",this.name=L.name,this.entity=L,this.tree=new M,this.tree._init(L.body)}$.exports=z,z.prototype.encode=function(L,H){return this.tree._encode(L,H).join()};function M(L){F.Node.call(this,"der",L)}V(M,F.Node),M.prototype._encodeComposite=function(L,H,q,P){var _=R(L,H,q,this.reporter);if(P.length<128){var j=new W(2);return j[0]=_,j[1]=P.length,this._createEncoderBuffer([j,P])}var k=1;for(var B=P.length;B>=256;B>>=8)k++;var j=new W(2+k);j[0]=_,j[1]=128|k;for(var B=1+k,x=P.length;x>0;B--,x>>=8)j[B]=x&255;return this._createEncoderBuffer([j,P])},M.prototype._encodeStr=function(L,H){if(H==="bitstr")return this._createEncoderBuffer([L.unused|0,L.data]);else if(H==="bmpstr"){var q=new W(L.length*2);for(var P=0;P<L.length;P++)q.writeUInt16BE(L.charCodeAt(P),P*2);return this._createEncoderBuffer(q)}else if(H==="numstr"){if(!this._isNumstr(L))return this.reporter.error("Encoding of string type: numstr supports only digits and space");return this._createEncoderBuffer(L)}else if(H==="printstr"){if(!this._isPrintstr(L))return this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark");return this._createEncoderBuffer(L)}else if(/str$/.test(H))return this._createEncoderBuffer(L);else if(H==="objDesc")return this._createEncoderBuffer(L);else return this.reporter.error("Encoding of string type: "+H+" unsupported")},M.prototype._encodeObjid=function(L,H,q){if(typeof L==="string"){if(!H)return this.reporter.error("string objid given, but no values map found");if(!H.hasOwnProperty(L))return this.reporter.error("objid not found in values map");L=H[L].split(/[\s\.]+/g);for(var P=0;P<L.length;P++)L[P]|=0}else if(Array.isArray(L)){L=L.slice();for(var P=0;P<L.length;P++)L[P]|=0}if(!Array.isArray(L))return this.reporter.error("objid() should be either array or string, got: "+JSON.stringify(L));if(!q){if(L[1]>=40)return this.reporter.error("Second objid identifier OOB");L.splice(0,2,L[0]*40+L[1])}var _=0;for(var P=0;P<L.length;P++){var k=L[P];for(_++;k>=128;k>>=7)_++}var B=new W(_),j=B.length-1;for(var P=L.length-1;P>=0;P--){var k=L[P];B[j--]=k&127;while((k>>=7)>0)B[j--]=128|k&127}return this._createEncoderBuffer(B)};function S(L){if(L<10)return"0"+L;else return L}M.prototype._encodeTime=function(L,H){var q,P=new Date(L);if(H==="gentime")q=[S(P.getFullYear()),S(P.getUTCMonth()+1),S(P.getUTCDate()),S(P.getUTCHours()),S(P.getUTCMinutes()),S(P.getUTCSeconds()),"Z"].join("");else if(H==="utctime")q=[S(P.getFullYear()%100),S(P.getUTCMonth()+1),S(P.getUTCDate()),S(P.getUTCHours()),S(P.getUTCMinutes()),S(P.getUTCSeconds()),"Z"].join("");else this.reporter.error("Encoding "+H+" time is not supported yet");return this._encodeStr(q,"octstr")},M.prototype._encodeNull=function(){return this._createEncoderBuffer("")},M.prototype._encodeInt=function(L,H){if(typeof L==="string"){if(!H)return this.reporter.error("String int or enum given, but no values map");if(!H.hasOwnProperty(L))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(L));L=H[L]}if(typeof L!=="number"&&!W.isBuffer(L)){var q=L.toArray();if(!L.sign&&q[0]&128)q.unshift(0);L=new W(q)}if(W.isBuffer(L)){var P=L.length;if(L.length===0)P++;var k=new W(P);if(L.copy(k),L.length===0)k[0]=0;return this._createEncoderBuffer(k)}if(L<128)return this._createEncoderBuffer(L);if(L<256)return this._createEncoderBuffer([0,L]);var P=1;for(var _=L;_>=256;_>>=8)P++;var k=Array(P);for(var _=k.length-1;_>=0;_--)k[_]=L&255,L>>=8;if(k[0]&128)k.unshift(0);return this._createEncoderBuffer(new W(k))},M.prototype._encodeBool=function(L){return this._createEncoderBuffer(L?255:0)},M.prototype._use=function(L,H){if(typeof L==="function")L=L(H);return L._getEncoder("der").tree},M.prototype._skipDefault=function(L,H,q){var P=this._baseState,_;if(P.default===null)return!1;var k=L.join();if(P.defaultBuffer===void 0)P.defaultBuffer=this._encodeValue(P.default,H,q).join();if(k.length!==P.defaultBuffer.length)return!1;for(_=0;_<k.length;_++)if(k[_]!==P.defaultBuffer[_])return!1;return!0};function R(L,H,q,P){var _;if(L==="seqof")L="seq";else if(L==="setof")L="set";if(A.tagByName.hasOwnProperty(L))_=A.tagByName[L];else if(typeof L==="number"&&(L|0)===L)_=L;else return P.error("Unknown tag: "+L);if(_>=31)return P.error("Multi-octet tag encoding unsupported");if(!H)_|=32;return _|=A.tagClassByName[q||"universal"]<<6,_}}),AG=$0((Q,$)=>{var V=xU(),W=LY();function C(F){W.call(this,F),this.enc="pem"}V(C,W),$.exports=C,C.prototype.encode=function(F,A){var z=W.prototype.encode.call(this,F),M=z.toString("base64"),S=["-----BEGIN "+A.label+"-----"];for(var R=0;R<M.length;R+=64)S.push(M.slice(R,R+64));return S.push("-----END "+A.label+"-----"),S.join(`
|
|
15
|
-
`)}}),$G=$0((Q)=>{var $=Q;$.der=LY(),$.pem=AG()}),NO=$0((Q)=>{var $=Q;$.bignum=iJ(),$.define=UG().define,$.base=_O(),$.constants=CY(),$.decoders=YG(),$.encoders=$G()}),JG=$0((Q,$)=>{var V=NO(),W=V.define("Time",function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})}),C=V.define("AttributeTypeValue",function(){this.seq().obj(this.key("type").objid(),this.key("value").any())}),F=V.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional(),this.key("curve").objid().optional())}),A=V.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(F),this.key("subjectPublicKey").bitstr())}),z=V.define("RelativeDistinguishedName",function(){this.setof(C)}),M=V.define("RDNSequence",function(){this.seqof(z)}),S=V.define("Name",function(){this.choice({rdnSequence:this.use(M)})}),R=V.define("Validity",function(){this.seq().obj(this.key("notBefore").use(W),this.key("notAfter").use(W))}),L=V.define("Extension",function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())}),H=V.define("TBSCertificate",function(){this.seq().obj(this.key("version").explicit(0).int().optional(),this.key("serialNumber").int(),this.key("signature").use(F),this.key("issuer").use(S),this.key("validity").use(R),this.key("subject").use(S),this.key("subjectPublicKeyInfo").use(A),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(L).optional())}),q=V.define("X509Certificate",function(){this.seq().obj(this.key("tbsCertificate").use(H),this.key("signatureAlgorithm").use(F),this.key("signatureValue").bitstr())});$.exports=q}),GG=$0((Q)=>{var $=NO();Q.certificate=JG();var V=$.define("RSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())});Q.RSAPrivateKey=V;var W=$.define("RSAPublicKey",function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())});Q.RSAPublicKey=W;var C=$.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())}),F=$.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(C),this.key("subjectPublicKey").bitstr())});Q.PublicKey=F;var A=$.define("PrivateKeyInfo",function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(C),this.key("subjectPrivateKey").octstr())});Q.PrivateKey=A;var z=$.define("EncryptedPrivateKeyInfo",function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())});Q.EncryptedPrivateKey=z;var M=$.define("DSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())});Q.DSAPrivateKey=M,Q.DSAparam=$.define("DSAparam",function(){this.int()});var S=$.define("ECParameters",function(){this.choice({namedCurve:this.objid()})}),R=$.define("ECPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(S),this.key("publicKey").optional().explicit(1).bitstr())});Q.ECPrivateKey=R,Q.signature=$.define("signature",function(){this.seq().obj(this.key("r").int(),this.key("s").int())})}),VG=$0((Q,$)=>{$.exports={"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"}}),EG=$0((Q,$)=>{var V=MU().Buffer,W=dO().Transform,C=xU();function F(S){W.call(this),this._block=V.allocUnsafe(S),this._blockSize=S,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}C(F,W),F.prototype._transform=function(S,R,L){var H=null;try{this.update(S,R)}catch(q){H=q}L(H)},F.prototype._flush=function(S){var R=null;try{this.push(this.digest())}catch(L){R=L}S(R)};var A=typeof Uint8Array<"u",z=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u"&&ArrayBuffer.isView&&(V.prototype instanceof Uint8Array||V.TYPED_ARRAY_SUPPORT);function M(S,R){if(S instanceof V)return S;if(typeof S==="string")return V.from(S,R);if(z&&ArrayBuffer.isView(S)){if(S.byteLength===0)return V.alloc(0);var L=V.from(S.buffer,S.byteOffset,S.byteLength);if(L.byteLength===S.byteLength)return L}if(A&&S instanceof Uint8Array)return V.from(S);if(V.isBuffer(S)&&S.constructor&&typeof S.constructor.isBuffer==="function"&&S.constructor.isBuffer(S))return V.from(S);throw TypeError('The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView.')}F.prototype.update=function(S,R){if(this._finalized)throw Error("Digest already called");S=M(S,R);var L=this._block,H=0;while(this._blockOffset+S.length-H>=this._blockSize){for(var q=this._blockOffset;q<this._blockSize;)L[q++]=S[H++];this._update(),this._blockOffset=0}while(H<S.length)L[this._blockOffset++]=S[H++];for(var P=0,_=S.length*8;_>0;++P)if(this._length[P]+=_,_=this._length[P]/4294967296|0,_>0)this._length[P]-=4294967296*_;return this},F.prototype._update=function(){throw Error("_update is not implemented")},F.prototype.digest=function(S){if(this._finalized)throw Error("Digest already called");this._finalized=!0;var R=this._digest();if(S!==void 0)R=R.toString(S);this._block.fill(0),this._blockOffset=0;for(var L=0;L<4;++L)this._length[L]=0;return R},F.prototype._digest=function(){throw Error("_digest is not implemented")},$.exports=F}),IG=$0((Q,$)=>{var V=xU(),W=EG(),C=MU().Buffer,F=Array(16);function A(){W.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}V(A,W),A.prototype._update=function(){var H=F;for(var q=0;q<16;++q)H[q]=this._block.readInt32LE(q*4);var P=this._a,_=this._b,k=this._c,B=this._d;P=M(P,_,k,B,H[0],3614090360,7),B=M(B,P,_,k,H[1],3905402710,12),k=M(k,B,P,_,H[2],606105819,17),_=M(_,k,B,P,H[3],3250441966,22),P=M(P,_,k,B,H[4],4118548399,7),B=M(B,P,_,k,H[5],1200080426,12),k=M(k,B,P,_,H[6],2821735955,17),_=M(_,k,B,P,H[7],4249261313,22),P=M(P,_,k,B,H[8],1770035416,7),B=M(B,P,_,k,H[9],2336552879,12),k=M(k,B,P,_,H[10],4294925233,17),_=M(_,k,B,P,H[11],2304563134,22),P=M(P,_,k,B,H[12],1804603682,7),B=M(B,P,_,k,H[13],4254626195,12),k=M(k,B,P,_,H[14],2792965006,17),_=M(_,k,B,P,H[15],1236535329,22),P=S(P,_,k,B,H[1],4129170786,5),B=S(B,P,_,k,H[6],3225465664,9),k=S(k,B,P,_,H[11],643717713,14),_=S(_,k,B,P,H[0],3921069994,20),P=S(P,_,k,B,H[5],3593408605,5),B=S(B,P,_,k,H[10],38016083,9),k=S(k,B,P,_,H[15],3634488961,14),_=S(_,k,B,P,H[4],3889429448,20),P=S(P,_,k,B,H[9],568446438,5),B=S(B,P,_,k,H[14],3275163606,9),k=S(k,B,P,_,H[3],4107603335,14),_=S(_,k,B,P,H[8],1163531501,20),P=S(P,_,k,B,H[13],2850285829,5),B=S(B,P,_,k,H[2],4243563512,9),k=S(k,B,P,_,H[7],1735328473,14),_=S(_,k,B,P,H[12],2368359562,20),P=R(P,_,k,B,H[5],4294588738,4),B=R(B,P,_,k,H[8],2272392833,11),k=R(k,B,P,_,H[11],1839030562,16),_=R(_,k,B,P,H[14],4259657740,23),P=R(P,_,k,B,H[1],2763975236,4),B=R(B,P,_,k,H[4],1272893353,11),k=R(k,B,P,_,H[7],4139469664,16),_=R(_,k,B,P,H[10],3200236656,23),P=R(P,_,k,B,H[13],681279174,4),B=R(B,P,_,k,H[0],3936430074,11),k=R(k,B,P,_,H[3],3572445317,16),_=R(_,k,B,P,H[6],76029189,23),P=R(P,_,k,B,H[9],3654602809,4),B=R(B,P,_,k,H[12],3873151461,11),k=R(k,B,P,_,H[15],530742520,16),_=R(_,k,B,P,H[2],3299628645,23),P=L(P,_,k,B,H[0],4096336452,6),B=L(B,P,_,k,H[7],1126891415,10),k=L(k,B,P,_,H[14],2878612391,15),_=L(_,k,B,P,H[5],4237533241,21),P=L(P,_,k,B,H[12],1700485571,6),B=L(B,P,_,k,H[3],2399980690,10),k=L(k,B,P,_,H[10],4293915773,15),_=L(_,k,B,P,H[1],2240044497,21),P=L(P,_,k,B,H[8],1873313359,6),B=L(B,P,_,k,H[15],4264355552,10),k=L(k,B,P,_,H[6],2734768916,15),_=L(_,k,B,P,H[13],1309151649,21),P=L(P,_,k,B,H[4],4149444226,6),B=L(B,P,_,k,H[11],3174756917,10),k=L(k,B,P,_,H[2],718787259,15),_=L(_,k,B,P,H[9],3951481745,21),this._a=this._a+P|0,this._b=this._b+_|0,this._c=this._c+k|0,this._d=this._d+B|0},A.prototype._digest=function(){if(this._block[this._blockOffset++]=128,this._blockOffset>56)this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0;this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var H=C.allocUnsafe(16);return H.writeInt32LE(this._a,0),H.writeInt32LE(this._b,4),H.writeInt32LE(this._c,8),H.writeInt32LE(this._d,12),H};function z(H,q){return H<<q|H>>>32-q}function M(H,q,P,_,k,B,j){return z(H+(q&P|~q&_)+k+B|0,j)+q|0}function S(H,q,P,_,k,B,j){return z(H+(q&_|P&~_)+k+B|0,j)+q|0}function R(H,q,P,_,k,B,j){return z(H+(q^P^_)+k+B|0,j)+q|0}function L(H,q,P,_,k,B,j){return z(H+(P^(q|~_))+k+B|0,j)+q|0}$.exports=A}),CG=$0((Q,$)=>{var V=MU().Buffer,W=IG();function C(F,A,z,M){if(!V.isBuffer(F))F=V.from(F,"binary");if(A){if(!V.isBuffer(A))A=V.from(A,"binary");if(A.length!==8)throw RangeError("salt should be Buffer with 8 byte length")}var S=z/8,R=V.alloc(S),L=V.alloc(M||0),H=V.alloc(0);while(S>0||M>0){var q=new W;if(q.update(H),q.update(F),A)q.update(A);H=q.digest();var P=0;if(S>0){var _=R.length-S;P=Math.min(S,H.length),H.copy(R,_,0,P),S-=P}if(P<H.length&&M>0){var k=L.length-M,B=Math.min(M,H.length-P);H.copy(L,k,P,P+B),M-=B}}return H.fill(0),{key:R,iv:L}}$.exports=C}),WY=$0((Q)=>{var $=(jU(),h0(vU));Q.createCipher=Q.Cipher=$.createCipher,Q.createCipheriv=Q.Cipheriv=$.createCipheriv,Q.createDecipher=Q.Decipher=$.createDecipher,Q.createDecipheriv=Q.Decipheriv=$.createDecipheriv,Q.listCiphers=Q.getCiphers=$.getCiphers}),KG=$0((Q,$)=>{var V=/Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r+/=]+)[\n\r]+/m,W=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m,C=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m,F=CG(),A=WY(),z=MU().Buffer;$.exports=function(M,S){var R=M.toString(),L=R.match(V),H;if(!L){var q=R.match(C);H=z.from(q[2].replace(/[\r\n]/g,""),"base64")}else{var P="aes"+L[1],_=z.from(L[2],"hex"),k=z.from(L[3].replace(/[\r\n]/g,""),"base64"),B=F(S,_.slice(0,8),parseInt(L[1],10)).key,j=[],x=A.createDecipheriv(P,B,_);j.push(x.update(k)),j.push(x.final()),H=z.concat(j)}var f=R.match(W)[1];return{tag:f,data:H}}}),HY=$0((Q,$)=>{var V=GG(),W=VG(),C=KG(),F=WY(),A=AY().pbkdf2Sync,z=MU().Buffer;function M(R,L){var H=R.algorithm.decrypt.kde.kdeparams.salt,q=parseInt(R.algorithm.decrypt.kde.kdeparams.iters.toString(),10),P=W[R.algorithm.decrypt.cipher.algo.join(".")],_=R.algorithm.decrypt.cipher.iv,k=R.subjectPrivateKey,B=parseInt(P.split("-")[1],10)/8,j=A(L,H,q,B,"sha1"),x=F.createDecipheriv(P,j,_),f=[];return f.push(x.update(k)),f.push(x.final()),z.concat(f)}function S(R){var L;if(typeof R==="object"&&!z.isBuffer(R))L=R.passphrase,R=R.key;if(typeof R==="string")R=z.from(R);var H=C(R,L),q=H.tag,P=H.data,_,k;switch(q){case"CERTIFICATE":k=V.certificate.decode(P,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":if(!k)k=V.PublicKey.decode(P,"der");switch(_=k.algorithm.algorithm.join("."),_){case"1.2.840.113549.1.1.1":return V.RSAPublicKey.decode(k.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return k.subjectPrivateKey=k.subjectPublicKey,{type:"ec",data:k};case"1.2.840.10040.4.1":return k.algorithm.params.pub_key=V.DSAparam.decode(k.subjectPublicKey.data,"der"),{type:"dsa",data:k.algorithm.params};default:throw Error("unknown key id "+_)}case"ENCRYPTED PRIVATE KEY":P=V.EncryptedPrivateKey.decode(P,"der"),P=M(P,L);case"PRIVATE KEY":switch(k=V.PrivateKey.decode(P,"der"),_=k.algorithm.algorithm.join("."),_){case"1.2.840.113549.1.1.1":return V.RSAPrivateKey.decode(k.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:k.algorithm.curve,privateKey:V.ECPrivateKey.decode(k.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return k.algorithm.params.priv_key=V.DSAparam.decode(k.subjectPrivateKey,"der"),{type:"dsa",params:k.algorithm.params};default:throw Error("unknown key id "+_)}case"RSA PUBLIC KEY":return V.RSAPublicKey.decode(P,"der");case"RSA PRIVATE KEY":return V.RSAPrivateKey.decode(P,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:V.DSAPrivateKey.decode(P,"der")};case"EC PRIVATE KEY":return P=V.ECPrivateKey.decode(P,"der"),{curve:P.parameters.value,privateKey:P.privateKey};default:throw Error("unknown key type "+q)}}S.signature=V.signature,$.exports=S}),DY=$0((Q,$)=>{var V=OZ(),W=MU().Buffer;$.exports=function(F,A){var z=W.alloc(0),M=0,S;while(z.length<A)S=C(M++),z=W.concat([z,V("sha1").update(F).update(S).digest()]);return z.slice(0,A)};function C(F){var A=W.allocUnsafe(4);return A.writeUInt32BE(F,0),A}}),SY=$0((Q,$)=>{$.exports=function(V,W){var C=V.length,F=-1;while(++F<C)V[F]^=W[F];return V}}),GX=$0((Q,$)=>{(function(V,W){function C(U,X){if(!U)throw Error(X||"Assertion failed")}function F(U,X){U.super_=X;var J=function(){};J.prototype=X.prototype,U.prototype=new J,U.prototype.constructor=U}function A(U,X,J){if(A.isBN(U))return U;if(this.negative=0,this.words=null,this.length=0,this.red=null,U!==null){if(X==="le"||X==="be")J=X,X=10;this._init(U||0,X||10,J||"be")}}if(typeof V==="object")V.exports=A;else W.BN=A;A.BN=A,A.wordSize=26;var z;try{if(typeof window<"u"&&typeof window.Buffer<"u")z=window.Buffer;else z=(HU(),h0(WU)).Buffer}catch(U){}A.isBN=function(U){if(U instanceof A)return!0;return U!==null&&typeof U==="object"&&U.constructor.wordSize===A.wordSize&&Array.isArray(U.words)},A.max=function(U,X){if(U.cmp(X)>0)return U;return X},A.min=function(U,X){if(U.cmp(X)<0)return U;return X},A.prototype._init=function(U,X,J){if(typeof U==="number")return this._initNumber(U,X,J);if(typeof U==="object")return this._initArray(U,X,J);if(X==="hex")X=16;C(X===(X|0)&&X>=2&&X<=36),U=U.toString().replace(/\s+/g,"");var Z=0;if(U[0]==="-")Z++,this.negative=1;if(Z<U.length){if(X===16)this._parseHex(U,Z,J);else if(this._parseBase(U,X,Z),J==="le")this._initArray(this.toArray(),X,J)}},A.prototype._initNumber=function(U,X,J){if(U<0)this.negative=1,U=-U;if(U<67108864)this.words=[U&67108863],this.length=1;else if(U<4503599627370496)this.words=[U&67108863,U/67108864&67108863],this.length=2;else C(U<9007199254740992),this.words=[U&67108863,U/67108864&67108863,1],this.length=3;if(J!=="le")return;this._initArray(this.toArray(),X,J)},A.prototype._initArray=function(U,X,J){if(C(typeof U.length==="number"),U.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(U.length/3),this.words=Array(this.length);for(var Z=0;Z<this.length;Z++)this.words[Z]=0;var Y,I,K=0;if(J==="be"){for(Z=U.length-1,Y=0;Z>=0;Z-=3)if(I=U[Z]|U[Z-1]<<8|U[Z-2]<<16,this.words[Y]|=I<<K&67108863,this.words[Y+1]=I>>>26-K&67108863,K+=24,K>=26)K-=26,Y++}else if(J==="le"){for(Z=0,Y=0;Z<U.length;Z+=3)if(I=U[Z]|U[Z+1]<<8|U[Z+2]<<16,this.words[Y]|=I<<K&67108863,this.words[Y+1]=I>>>26-K&67108863,K+=24,K>=26)K-=26,Y++}return this.strip()};function M(U,X){var J=U.charCodeAt(X);if(J>=65&&J<=70)return J-55;else if(J>=97&&J<=102)return J-87;else return J-48&15}function S(U,X,J){var Z=M(U,J);if(J-1>=X)Z|=M(U,J-1)<<4;return Z}A.prototype._parseHex=function(U,X,J){this.length=Math.ceil((U.length-X)/6),this.words=Array(this.length);for(var Z=0;Z<this.length;Z++)this.words[Z]=0;var Y=0,I=0,K;if(J==="be")for(Z=U.length-1;Z>=X;Z-=2)if(K=S(U,X,Z)<<Y,this.words[I]|=K&67108863,Y>=18)Y-=18,I+=1,this.words[I]|=K>>>26;else Y+=8;else{var G=U.length-X;for(Z=G%2===0?X+1:X;Z<U.length;Z+=2)if(K=S(U,X,Z)<<Y,this.words[I]|=K&67108863,Y>=18)Y-=18,I+=1,this.words[I]|=K>>>26;else Y+=8}this.strip()};function R(U,X,J,Z){var Y=0,I=Math.min(U.length,J);for(var K=X;K<I;K++){var G=U.charCodeAt(K)-48;if(Y*=Z,G>=49)Y+=G-49+10;else if(G>=17)Y+=G-17+10;else Y+=G}return Y}A.prototype._parseBase=function(U,X,J){this.words=[0],this.length=1;for(var Z=0,Y=1;Y<=67108863;Y*=X)Z++;Z--,Y=Y/X|0;var I=U.length-J,K=I%Z,G=Math.min(I,I-K)+J,O=0;for(var E=J;E<G;E+=Z)if(O=R(U,E,E+Z,X),this.imuln(Y),this.words[0]+O<67108864)this.words[0]+=O;else this._iaddn(O);if(K!==0){var T=1;O=R(U,E,U.length,X);for(E=0;E<K;E++)T*=X;if(this.imuln(T),this.words[0]+O<67108864)this.words[0]+=O;else this._iaddn(O)}this.strip()},A.prototype.copy=function(U){U.words=Array(this.length);for(var X=0;X<this.length;X++)U.words[X]=this.words[X];U.length=this.length,U.negative=this.negative,U.red=this.red},A.prototype.clone=function(){var U=new A(null);return this.copy(U),U},A.prototype._expand=function(U){while(this.length<U)this.words[this.length++]=0;return this},A.prototype.strip=function(){while(this.length>1&&this.words[this.length-1]===0)this.length--;return this._normSign()},A.prototype._normSign=function(){if(this.length===1&&this.words[0]===0)this.negative=0;return this},A.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var L=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],H=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],q=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64000000,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,24300000,28629151,33554432,39135393,45435424,52521875,60466176];if(A.prototype.toString=function(U,X){U=U||10,X=X|0||1;var J;if(U===16||U==="hex"){J="";var Z=0,Y=0;for(var I=0;I<this.length;I++){var K=this.words[I],G=((K<<Z|Y)&16777215).toString(16);if(Y=K>>>24-Z&16777215,Z+=2,Z>=26)Z-=26,I--;if(Y!==0||I!==this.length-1)J=L[6-G.length]+G+J;else J=G+J}if(Y!==0)J=Y.toString(16)+J;while(J.length%X!==0)J="0"+J;if(this.negative!==0)J="-"+J;return J}if(U===(U|0)&&U>=2&&U<=36){var O=H[U],E=q[U];J="";var T=this.clone();T.negative=0;while(!T.isZero()){var D=T.modn(E).toString(U);if(T=T.idivn(E),!T.isZero())J=L[O-D.length]+D+J;else J=D+J}if(this.isZero())J="0"+J;while(J.length%X!==0)J="0"+J;if(this.negative!==0)J="-"+J;return J}C(!1,"Base should be between 2 and 36")},A.prototype.toNumber=function(){var U=this.words[0];if(this.length===2)U+=this.words[1]*67108864;else if(this.length===3&&this.words[2]===1)U+=4503599627370496+this.words[1]*67108864;else if(this.length>2)C(!1,"Number can only safely store up to 53 bits");return this.negative!==0?-U:U},A.prototype.toJSON=function(){return this.toString(16)},A.prototype.toBuffer=function(U,X){return C(typeof z<"u"),this.toArrayLike(z,U,X)},A.prototype.toArray=function(U,X){return this.toArrayLike(Array,U,X)},A.prototype.toArrayLike=function(U,X,J){var Z=this.byteLength(),Y=J||Math.max(1,Z);C(Z<=Y,"byte array longer than desired length"),C(Y>0,"Requested array length <= 0"),this.strip();var I=X==="le",K=new U(Y),G,O,E=this.clone();if(!I){for(O=0;O<Y-Z;O++)K[O]=0;for(O=0;!E.isZero();O++)G=E.andln(255),E.iushrn(8),K[Y-O-1]=G}else{for(O=0;!E.isZero();O++)G=E.andln(255),E.iushrn(8),K[O]=G;for(;O<Y;O++)K[O]=0}return K},Math.clz32)A.prototype._countBits=function(U){return 32-Math.clz32(U)};else A.prototype._countBits=function(U){var X=U,J=0;if(X>=4096)J+=13,X>>>=13;if(X>=64)J+=7,X>>>=7;if(X>=8)J+=4,X>>>=4;if(X>=2)J+=2,X>>>=2;return J+X};A.prototype._zeroBits=function(U){if(U===0)return 26;var X=U,J=0;if((X&8191)===0)J+=13,X>>>=13;if((X&127)===0)J+=7,X>>>=7;if((X&15)===0)J+=4,X>>>=4;if((X&3)===0)J+=2,X>>>=2;if((X&1)===0)J++;return J},A.prototype.bitLength=function(){var U=this.words[this.length-1],X=this._countBits(U);return(this.length-1)*26+X};function P(U){var X=Array(U.bitLength());for(var J=0;J<X.length;J++){var Z=J/26|0,Y=J%26;X[J]=(U.words[Z]&1<<Y)>>>Y}return X}A.prototype.zeroBits=function(){if(this.isZero())return 0;var U=0;for(var X=0;X<this.length;X++){var J=this._zeroBits(this.words[X]);if(U+=J,J!==26)break}return U},A.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},A.prototype.toTwos=function(U){if(this.negative!==0)return this.abs().inotn(U).iaddn(1);return this.clone()},A.prototype.fromTwos=function(U){if(this.testn(U-1))return this.notn(U).iaddn(1).ineg();return this.clone()},A.prototype.isNeg=function(){return this.negative!==0},A.prototype.neg=function(){return this.clone().ineg()},A.prototype.ineg=function(){if(!this.isZero())this.negative^=1;return this},A.prototype.iuor=function(U){while(this.length<U.length)this.words[this.length++]=0;for(var X=0;X<U.length;X++)this.words[X]=this.words[X]|U.words[X];return this.strip()},A.prototype.ior=function(U){return C((this.negative|U.negative)===0),this.iuor(U)},A.prototype.or=function(U){if(this.length>U.length)return this.clone().ior(U);return U.clone().ior(this)},A.prototype.uor=function(U){if(this.length>U.length)return this.clone().iuor(U);return U.clone().iuor(this)},A.prototype.iuand=function(U){var X;if(this.length>U.length)X=U;else X=this;for(var J=0;J<X.length;J++)this.words[J]=this.words[J]&U.words[J];return this.length=X.length,this.strip()},A.prototype.iand=function(U){return C((this.negative|U.negative)===0),this.iuand(U)},A.prototype.and=function(U){if(this.length>U.length)return this.clone().iand(U);return U.clone().iand(this)},A.prototype.uand=function(U){if(this.length>U.length)return this.clone().iuand(U);return U.clone().iuand(this)},A.prototype.iuxor=function(U){var X,J;if(this.length>U.length)X=this,J=U;else X=U,J=this;for(var Z=0;Z<J.length;Z++)this.words[Z]=X.words[Z]^J.words[Z];if(this!==X)for(;Z<X.length;Z++)this.words[Z]=X.words[Z];return this.length=X.length,this.strip()},A.prototype.ixor=function(U){return C((this.negative|U.negative)===0),this.iuxor(U)},A.prototype.xor=function(U){if(this.length>U.length)return this.clone().ixor(U);return U.clone().ixor(this)},A.prototype.uxor=function(U){if(this.length>U.length)return this.clone().iuxor(U);return U.clone().iuxor(this)},A.prototype.inotn=function(U){C(typeof U==="number"&&U>=0);var X=Math.ceil(U/26)|0,J=U%26;if(this._expand(X),J>0)X--;for(var Z=0;Z<X;Z++)this.words[Z]=~this.words[Z]&67108863;if(J>0)this.words[Z]=~this.words[Z]&67108863>>26-J;return this.strip()},A.prototype.notn=function(U){return this.clone().inotn(U)},A.prototype.setn=function(U,X){C(typeof U==="number"&&U>=0);var J=U/26|0,Z=U%26;if(this._expand(J+1),X)this.words[J]=this.words[J]|1<<Z;else this.words[J]=this.words[J]&~(1<<Z);return this.strip()},A.prototype.iadd=function(U){var X;if(this.negative!==0&&U.negative===0)return this.negative=0,X=this.isub(U),this.negative^=1,this._normSign();else if(this.negative===0&&U.negative!==0)return U.negative=0,X=this.isub(U),U.negative=1,X._normSign();var J,Z;if(this.length>U.length)J=this,Z=U;else J=U,Z=this;var Y=0;for(var I=0;I<Z.length;I++)X=(J.words[I]|0)+(Z.words[I]|0)+Y,this.words[I]=X&67108863,Y=X>>>26;for(;Y!==0&&I<J.length;I++)X=(J.words[I]|0)+Y,this.words[I]=X&67108863,Y=X>>>26;if(this.length=J.length,Y!==0)this.words[this.length]=Y,this.length++;else if(J!==this)for(;I<J.length;I++)this.words[I]=J.words[I];return this},A.prototype.add=function(U){var X;if(U.negative!==0&&this.negative===0)return U.negative=0,X=this.sub(U),U.negative^=1,X;else if(U.negative===0&&this.negative!==0)return this.negative=0,X=U.sub(this),this.negative=1,X;if(this.length>U.length)return this.clone().iadd(U);return U.clone().iadd(this)},A.prototype.isub=function(U){if(U.negative!==0){U.negative=0;var X=this.iadd(U);return U.negative=1,X._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(U),this.negative=1,this._normSign();var J=this.cmp(U);if(J===0)return this.negative=0,this.length=1,this.words[0]=0,this;var Z,Y;if(J>0)Z=this,Y=U;else Z=U,Y=this;var I=0;for(var K=0;K<Y.length;K++)X=(Z.words[K]|0)-(Y.words[K]|0)+I,I=X>>26,this.words[K]=X&67108863;for(;I!==0&&K<Z.length;K++)X=(Z.words[K]|0)+I,I=X>>26,this.words[K]=X&67108863;if(I===0&&K<Z.length&&Z!==this)for(;K<Z.length;K++)this.words[K]=Z.words[K];if(this.length=Math.max(this.length,K),Z!==this)this.negative=1;return this.strip()},A.prototype.sub=function(U){return this.clone().isub(U)};function _(U,X,J){J.negative=X.negative^U.negative;var Z=U.length+X.length|0;J.length=Z,Z=Z-1|0;var Y=U.words[0]|0,I=X.words[0]|0,K=Y*I,G=K&67108863,O=K/67108864|0;J.words[0]=G;for(var E=1;E<Z;E++){var T=O>>>26,D=O&67108863,v=Math.min(E,X.length-1);for(var g=Math.max(0,E-U.length+1);g<=v;g++){var p=E-g|0;Y=U.words[p]|0,I=X.words[g]|0,K=Y*I+D,T+=K/67108864|0,D=K&67108863}J.words[E]=D|0,O=T|0}if(O!==0)J.words[E]=O|0;else J.length--;return J.strip()}var k=function(U,X,J){var Z=U.words,Y=X.words,I=J.words,K=0,G,O,E,T=Z[0]|0,D=T&8191,v=T>>>13,g=Z[1]|0,p=g&8191,n=g>>>13,V0=Z[2]|0,r=V0&8191,l=V0>>>13,X0=Z[3]|0,m=X0&8191,i=X0>>>13,g0=Z[4]|0,y=g0&8191,h=g0>>>13,Q0=Z[5]|0,t=Q0&8191,e=Q0>>>13,F0=Z[6]|0,c=F0&8191,o=F0>>>13,N0=Z[7]|0,s=N0&8191,Z0=N0>>>13,w0=Z[8]|0,C0=w0&8191,K0=w0>>>13,s0=Z[9]|0,E0=s0&8191,L0=s0>>>13,e0=Y[0]|0,D0=e0&8191,H0=e0>>>13,FU=Y[1]|0,R0=FU&8191,k0=FU>>>13,RU=Y[2]|0,_0=RU&8191,T0=RU>>>13,DU=Y[3]|0,v0=DU&8191,z0=DU>>>13,CU=Y[4]|0,j0=CU&8191,B0=CU>>>13,KU=Y[5]|0,M0=KU&8191,N=KU>>>13,b=Y[6]|0,a=b&8191,U0=b>>>13,f0=Y[7]|0,I0=f0&8191,W0=f0>>>13,t0=Y[8]|0,q0=t0&8191,x0=t0>>>13,SU=Y[9]|0,P0=SU&8191,S0=SU>>>13;J.negative=U.negative^X.negative,J.length=19,G=Math.imul(D,D0),O=Math.imul(D,H0),O=O+Math.imul(v,D0)|0,E=Math.imul(v,H0);var r0=(K+G|0)+((O&8191)<<13)|0;K=(E+(O>>>13)|0)+(r0>>>26)|0,r0&=67108863,G=Math.imul(p,D0),O=Math.imul(p,H0),O=O+Math.imul(n,D0)|0,E=Math.imul(n,H0),G=G+Math.imul(D,R0)|0,O=O+Math.imul(D,k0)|0,O=O+Math.imul(v,R0)|0,E=E+Math.imul(v,k0)|0;var c0=(K+G|0)+((O&8191)<<13)|0;K=(E+(O>>>13)|0)+(c0>>>26)|0,c0&=67108863,G=Math.imul(r,D0),O=Math.imul(r,H0),O=O+Math.imul(l,D0)|0,E=Math.imul(l,H0),G=G+Math.imul(p,R0)|0,O=O+Math.imul(p,k0)|0,O=O+Math.imul(n,R0)|0,E=E+Math.imul(n,k0)|0,G=G+Math.imul(D,_0)|0,O=O+Math.imul(D,T0)|0,O=O+Math.imul(v,_0)|0,E=E+Math.imul(v,T0)|0;var y0=(K+G|0)+((O&8191)<<13)|0;K=(E+(O>>>13)|0)+(y0>>>26)|0,y0&=67108863,G=Math.imul(m,D0),O=Math.imul(m,H0),O=O+Math.imul(i,D0)|0,E=Math.imul(i,H0),G=G+Math.imul(r,R0)|0,O=O+Math.imul(r,k0)|0,O=O+Math.imul(l,R0)|0,E=E+Math.imul(l,k0)|0,G=G+Math.imul(p,_0)|0,O=O+Math.imul(p,T0)|0,O=O+Math.imul(n,_0)|0,E=E+Math.imul(n,T0)|0,G=G+Math.imul(D,v0)|0,O=O+Math.imul(D,z0)|0,O=O+Math.imul(v,v0)|0,E=E+Math.imul(v,z0)|0;var d0=(K+G|0)+((O&8191)<<13)|0;K=(E+(O>>>13)|0)+(d0>>>26)|0,d0&=67108863,G=Math.imul(y,D0),O=Math.imul(y,H0),O=O+Math.imul(h,D0)|0,E=Math.imul(h,H0),G=G+Math.imul(m,R0)|0,O=O+Math.imul(m,k0)|0,O=O+Math.imul(i,R0)|0,E=E+Math.imul(i,k0)|0,G=G+Math.imul(r,_0)|0,O=O+Math.imul(r,T0)|0,O=O+Math.imul(l,_0)|0,E=E+Math.imul(l,T0)|0,G=G+Math.imul(p,v0)|0,O=O+Math.imul(p,z0)|0,O=O+Math.imul(n,v0)|0,E=E+Math.imul(n,z0)|0,G=G+Math.imul(D,j0)|0,O=O+Math.imul(D,B0)|0,O=O+Math.imul(v,j0)|0,E=E+Math.imul(v,B0)|0;var l0=(K+G|0)+((O&8191)<<13)|0;K=(E+(O>>>13)|0)+(l0>>>26)|0,l0&=67108863,G=Math.imul(t,D0),O=Math.imul(t,H0),O=O+Math.imul(e,D0)|0,E=Math.imul(e,H0),G=G+Math.imul(y,R0)|0,O=O+Math.imul(y,k0)|0,O=O+Math.imul(h,R0)|0,E=E+Math.imul(h,k0)|0,G=G+Math.imul(m,_0)|0,O=O+Math.imul(m,T0)|0,O=O+Math.imul(i,_0)|0,E=E+Math.imul(i,T0)|0,G=G+Math.imul(r,v0)|0,O=O+Math.imul(r,z0)|0,O=O+Math.imul(l,v0)|0,E=E+Math.imul(l,z0)|0,G=G+Math.imul(p,j0)|0,O=O+Math.imul(p,B0)|0,O=O+Math.imul(n,j0)|0,E=E+Math.imul(n,B0)|0,G=G+Math.imul(D,M0)|0,O=O+Math.imul(D,N)|0,O=O+Math.imul(v,M0)|0,E=E+Math.imul(v,N)|0;var i0=(K+G|0)+((O&8191)<<13)|0;K=(E+(O>>>13)|0)+(i0>>>26)|0,i0&=67108863,G=Math.imul(c,D0),O=Math.imul(c,H0),O=O+Math.imul(o,D0)|0,E=Math.imul(o,H0),G=G+Math.imul(t,R0)|0,O=O+Math.imul(t,k0)|0,O=O+Math.imul(e,R0)|0,E=E+Math.imul(e,k0)|0,G=G+Math.imul(y,_0)|0,O=O+Math.imul(y,T0)|0,O=O+Math.imul(h,_0)|0,E=E+Math.imul(h,T0)|0,G=G+Math.imul(m,v0)|0,O=O+Math.imul(m,z0)|0,O=O+Math.imul(i,v0)|0,E=E+Math.imul(i,z0)|0,G=G+Math.imul(r,j0)|0,O=O+Math.imul(r,B0)|0,O=O+Math.imul(l,j0)|0,E=E+Math.imul(l,B0)|0,G=G+Math.imul(p,M0)|0,O=O+Math.imul(p,N)|0,O=O+Math.imul(n,M0)|0,E=E+Math.imul(n,N)|0,G=G+Math.imul(D,a)|0,O=O+Math.imul(D,U0)|0,O=O+Math.imul(v,a)|0,E=E+Math.imul(v,U0)|0;var UU=(K+G|0)+((O&8191)<<13)|0;K=(E+(O>>>13)|0)+(UU>>>26)|0,UU&=67108863,G=Math.imul(s,D0),O=Math.imul(s,H0),O=O+Math.imul(Z0,D0)|0,E=Math.imul(Z0,H0),G=G+Math.imul(c,R0)|0,O=O+Math.imul(c,k0)|0,O=O+Math.imul(o,R0)|0,E=E+Math.imul(o,k0)|0,G=G+Math.imul(t,_0)|0,O=O+Math.imul(t,T0)|0,O=O+Math.imul(e,_0)|0,E=E+Math.imul(e,T0)|0,G=G+Math.imul(y,v0)|0,O=O+Math.imul(y,z0)|0,O=O+Math.imul(h,v0)|0,E=E+Math.imul(h,z0)|0,G=G+Math.imul(m,j0)|0,O=O+Math.imul(m,B0)|0,O=O+Math.imul(i,j0)|0,E=E+Math.imul(i,B0)|0,G=G+Math.imul(r,M0)|0,O=O+Math.imul(r,N)|0,O=O+Math.imul(l,M0)|0,E=E+Math.imul(l,N)|0,G=G+Math.imul(p,a)|0,O=O+Math.imul(p,U0)|0,O=O+Math.imul(n,a)|0,E=E+Math.imul(n,U0)|0,G=G+Math.imul(D,I0)|0,O=O+Math.imul(D,W0)|0,O=O+Math.imul(v,I0)|0,E=E+Math.imul(v,W0)|0;var OU=(K+G|0)+((O&8191)<<13)|0;K=(E+(O>>>13)|0)+(OU>>>26)|0,OU&=67108863,G=Math.imul(C0,D0),O=Math.imul(C0,H0),O=O+Math.imul(K0,D0)|0,E=Math.imul(K0,H0),G=G+Math.imul(s,R0)|0,O=O+Math.imul(s,k0)|0,O=O+Math.imul(Z0,R0)|0,E=E+Math.imul(Z0,k0)|0,G=G+Math.imul(c,_0)|0,O=O+Math.imul(c,T0)|0,O=O+Math.imul(o,_0)|0,E=E+Math.imul(o,T0)|0,G=G+Math.imul(t,v0)|0,O=O+Math.imul(t,z0)|0,O=O+Math.imul(e,v0)|0,E=E+Math.imul(e,z0)|0,G=G+Math.imul(y,j0)|0,O=O+Math.imul(y,B0)|0,O=O+Math.imul(h,j0)|0,E=E+Math.imul(h,B0)|0,G=G+Math.imul(m,M0)|0,O=O+Math.imul(m,N)|0,O=O+Math.imul(i,M0)|0,E=E+Math.imul(i,N)|0,G=G+Math.imul(r,a)|0,O=O+Math.imul(r,U0)|0,O=O+Math.imul(l,a)|0,E=E+Math.imul(l,U0)|0,G=G+Math.imul(p,I0)|0,O=O+Math.imul(p,W0)|0,O=O+Math.imul(n,I0)|0,E=E+Math.imul(n,W0)|0,G=G+Math.imul(D,q0)|0,O=O+Math.imul(D,x0)|0,O=O+Math.imul(v,q0)|0,E=E+Math.imul(v,x0)|0;var ZU=(K+G|0)+((O&8191)<<13)|0;K=(E+(O>>>13)|0)+(ZU>>>26)|0,ZU&=67108863,G=Math.imul(E0,D0),O=Math.imul(E0,H0),O=O+Math.imul(L0,D0)|0,E=Math.imul(L0,H0),G=G+Math.imul(C0,R0)|0,O=O+Math.imul(C0,k0)|0,O=O+Math.imul(K0,R0)|0,E=E+Math.imul(K0,k0)|0,G=G+Math.imul(s,_0)|0,O=O+Math.imul(s,T0)|0,O=O+Math.imul(Z0,_0)|0,E=E+Math.imul(Z0,T0)|0,G=G+Math.imul(c,v0)|0,O=O+Math.imul(c,z0)|0,O=O+Math.imul(o,v0)|0,E=E+Math.imul(o,z0)|0,G=G+Math.imul(t,j0)|0,O=O+Math.imul(t,B0)|0,O=O+Math.imul(e,j0)|0,E=E+Math.imul(e,B0)|0,G=G+Math.imul(y,M0)|0,O=O+Math.imul(y,N)|0,O=O+Math.imul(h,M0)|0,E=E+Math.imul(h,N)|0,G=G+Math.imul(m,a)|0,O=O+Math.imul(m,U0)|0,O=O+Math.imul(i,a)|0,E=E+Math.imul(i,U0)|0,G=G+Math.imul(r,I0)|0,O=O+Math.imul(r,W0)|0,O=O+Math.imul(l,I0)|0,E=E+Math.imul(l,W0)|0,G=G+Math.imul(p,q0)|0,O=O+Math.imul(p,x0)|0,O=O+Math.imul(n,q0)|0,E=E+Math.imul(n,x0)|0,G=G+Math.imul(D,P0)|0,O=O+Math.imul(D,S0)|0,O=O+Math.imul(v,P0)|0,E=E+Math.imul(v,S0)|0;var XU=(K+G|0)+((O&8191)<<13)|0;K=(E+(O>>>13)|0)+(XU>>>26)|0,XU&=67108863,G=Math.imul(E0,R0),O=Math.imul(E0,k0),O=O+Math.imul(L0,R0)|0,E=Math.imul(L0,k0),G=G+Math.imul(C0,_0)|0,O=O+Math.imul(C0,T0)|0,O=O+Math.imul(K0,_0)|0,E=E+Math.imul(K0,T0)|0,G=G+Math.imul(s,v0)|0,O=O+Math.imul(s,z0)|0,O=O+Math.imul(Z0,v0)|0,E=E+Math.imul(Z0,z0)|0,G=G+Math.imul(c,j0)|0,O=O+Math.imul(c,B0)|0,O=O+Math.imul(o,j0)|0,E=E+Math.imul(o,B0)|0,G=G+Math.imul(t,M0)|0,O=O+Math.imul(t,N)|0,O=O+Math.imul(e,M0)|0,E=E+Math.imul(e,N)|0,G=G+Math.imul(y,a)|0,O=O+Math.imul(y,U0)|0,O=O+Math.imul(h,a)|0,E=E+Math.imul(h,U0)|0,G=G+Math.imul(m,I0)|0,O=O+Math.imul(m,W0)|0,O=O+Math.imul(i,I0)|0,E=E+Math.imul(i,W0)|0,G=G+Math.imul(r,q0)|0,O=O+Math.imul(r,x0)|0,O=O+Math.imul(l,q0)|0,E=E+Math.imul(l,x0)|0,G=G+Math.imul(p,P0)|0,O=O+Math.imul(p,S0)|0,O=O+Math.imul(n,P0)|0,E=E+Math.imul(n,S0)|0;var QU=(K+G|0)+((O&8191)<<13)|0;K=(E+(O>>>13)|0)+(QU>>>26)|0,QU&=67108863,G=Math.imul(E0,_0),O=Math.imul(E0,T0),O=O+Math.imul(L0,_0)|0,E=Math.imul(L0,T0),G=G+Math.imul(C0,v0)|0,O=O+Math.imul(C0,z0)|0,O=O+Math.imul(K0,v0)|0,E=E+Math.imul(K0,z0)|0,G=G+Math.imul(s,j0)|0,O=O+Math.imul(s,B0)|0,O=O+Math.imul(Z0,j0)|0,E=E+Math.imul(Z0,B0)|0,G=G+Math.imul(c,M0)|0,O=O+Math.imul(c,N)|0,O=O+Math.imul(o,M0)|0,E=E+Math.imul(o,N)|0,G=G+Math.imul(t,a)|0,O=O+Math.imul(t,U0)|0,O=O+Math.imul(e,a)|0,E=E+Math.imul(e,U0)|0,G=G+Math.imul(y,I0)|0,O=O+Math.imul(y,W0)|0,O=O+Math.imul(h,I0)|0,E=E+Math.imul(h,W0)|0,G=G+Math.imul(m,q0)|0,O=O+Math.imul(m,x0)|0,O=O+Math.imul(i,q0)|0,E=E+Math.imul(i,x0)|0,G=G+Math.imul(r,P0)|0,O=O+Math.imul(r,S0)|0,O=O+Math.imul(l,P0)|0,E=E+Math.imul(l,S0)|0;var YU=(K+G|0)+((O&8191)<<13)|0;K=(E+(O>>>13)|0)+(YU>>>26)|0,YU&=67108863,G=Math.imul(E0,v0),O=Math.imul(E0,z0),O=O+Math.imul(L0,v0)|0,E=Math.imul(L0,z0),G=G+Math.imul(C0,j0)|0,O=O+Math.imul(C0,B0)|0,O=O+Math.imul(K0,j0)|0,E=E+Math.imul(K0,B0)|0,G=G+Math.imul(s,M0)|0,O=O+Math.imul(s,N)|0,O=O+Math.imul(Z0,M0)|0,E=E+Math.imul(Z0,N)|0,G=G+Math.imul(c,a)|0,O=O+Math.imul(c,U0)|0,O=O+Math.imul(o,a)|0,E=E+Math.imul(o,U0)|0,G=G+Math.imul(t,I0)|0,O=O+Math.imul(t,W0)|0,O=O+Math.imul(e,I0)|0,E=E+Math.imul(e,W0)|0,G=G+Math.imul(y,q0)|0,O=O+Math.imul(y,x0)|0,O=O+Math.imul(h,q0)|0,E=E+Math.imul(h,x0)|0,G=G+Math.imul(m,P0)|0,O=O+Math.imul(m,S0)|0,O=O+Math.imul(i,P0)|0,E=E+Math.imul(i,S0)|0;var AU=(K+G|0)+((O&8191)<<13)|0;K=(E+(O>>>13)|0)+(AU>>>26)|0,AU&=67108863,G=Math.imul(E0,j0),O=Math.imul(E0,B0),O=O+Math.imul(L0,j0)|0,E=Math.imul(L0,B0),G=G+Math.imul(C0,M0)|0,O=O+Math.imul(C0,N)|0,O=O+Math.imul(K0,M0)|0,E=E+Math.imul(K0,N)|0,G=G+Math.imul(s,a)|0,O=O+Math.imul(s,U0)|0,O=O+Math.imul(Z0,a)|0,E=E+Math.imul(Z0,U0)|0,G=G+Math.imul(c,I0)|0,O=O+Math.imul(c,W0)|0,O=O+Math.imul(o,I0)|0,E=E+Math.imul(o,W0)|0,G=G+Math.imul(t,q0)|0,O=O+Math.imul(t,x0)|0,O=O+Math.imul(e,q0)|0,E=E+Math.imul(e,x0)|0,G=G+Math.imul(y,P0)|0,O=O+Math.imul(y,S0)|0,O=O+Math.imul(h,P0)|0,E=E+Math.imul(h,S0)|0;var $U=(K+G|0)+((O&8191)<<13)|0;K=(E+(O>>>13)|0)+($U>>>26)|0,$U&=67108863,G=Math.imul(E0,M0),O=Math.imul(E0,N),O=O+Math.imul(L0,M0)|0,E=Math.imul(L0,N),G=G+Math.imul(C0,a)|0,O=O+Math.imul(C0,U0)|0,O=O+Math.imul(K0,a)|0,E=E+Math.imul(K0,U0)|0,G=G+Math.imul(s,I0)|0,O=O+Math.imul(s,W0)|0,O=O+Math.imul(Z0,I0)|0,E=E+Math.imul(Z0,W0)|0,G=G+Math.imul(c,q0)|0,O=O+Math.imul(c,x0)|0,O=O+Math.imul(o,q0)|0,E=E+Math.imul(o,x0)|0,G=G+Math.imul(t,P0)|0,O=O+Math.imul(t,S0)|0,O=O+Math.imul(e,P0)|0,E=E+Math.imul(e,S0)|0;var JU=(K+G|0)+((O&8191)<<13)|0;K=(E+(O>>>13)|0)+(JU>>>26)|0,JU&=67108863,G=Math.imul(E0,a),O=Math.imul(E0,U0),O=O+Math.imul(L0,a)|0,E=Math.imul(L0,U0),G=G+Math.imul(C0,I0)|0,O=O+Math.imul(C0,W0)|0,O=O+Math.imul(K0,I0)|0,E=E+Math.imul(K0,W0)|0,G=G+Math.imul(s,q0)|0,O=O+Math.imul(s,x0)|0,O=O+Math.imul(Z0,q0)|0,E=E+Math.imul(Z0,x0)|0,G=G+Math.imul(c,P0)|0,O=O+Math.imul(c,S0)|0,O=O+Math.imul(o,P0)|0,E=E+Math.imul(o,S0)|0;var GU=(K+G|0)+((O&8191)<<13)|0;K=(E+(O>>>13)|0)+(GU>>>26)|0,GU&=67108863,G=Math.imul(E0,I0),O=Math.imul(E0,W0),O=O+Math.imul(L0,I0)|0,E=Math.imul(L0,W0),G=G+Math.imul(C0,q0)|0,O=O+Math.imul(C0,x0)|0,O=O+Math.imul(K0,q0)|0,E=E+Math.imul(K0,x0)|0,G=G+Math.imul(s,P0)|0,O=O+Math.imul(s,S0)|0,O=O+Math.imul(Z0,P0)|0,E=E+Math.imul(Z0,S0)|0;var VU=(K+G|0)+((O&8191)<<13)|0;K=(E+(O>>>13)|0)+(VU>>>26)|0,VU&=67108863,G=Math.imul(E0,q0),O=Math.imul(E0,x0),O=O+Math.imul(L0,q0)|0,E=Math.imul(L0,x0),G=G+Math.imul(C0,P0)|0,O=O+Math.imul(C0,S0)|0,O=O+Math.imul(K0,P0)|0,E=E+Math.imul(K0,S0)|0;var EU=(K+G|0)+((O&8191)<<13)|0;K=(E+(O>>>13)|0)+(EU>>>26)|0,EU&=67108863,G=Math.imul(E0,P0),O=Math.imul(E0,S0),O=O+Math.imul(L0,P0)|0,E=Math.imul(L0,S0);var IU=(K+G|0)+((O&8191)<<13)|0;if(K=(E+(O>>>13)|0)+(IU>>>26)|0,IU&=67108863,I[0]=r0,I[1]=c0,I[2]=y0,I[3]=d0,I[4]=l0,I[5]=i0,I[6]=UU,I[7]=OU,I[8]=ZU,I[9]=XU,I[10]=QU,I[11]=YU,I[12]=AU,I[13]=$U,I[14]=JU,I[15]=GU,I[16]=VU,I[17]=EU,I[18]=IU,K!==0)I[19]=K,J.length++;return J};if(!Math.imul)k=_;function B(U,X,J){J.negative=X.negative^U.negative,J.length=U.length+X.length;var Z=0,Y=0;for(var I=0;I<J.length-1;I++){var K=Y;Y=0;var G=Z&67108863,O=Math.min(I,X.length-1);for(var E=Math.max(0,I-U.length+1);E<=O;E++){var T=I-E,D=U.words[T]|0,v=X.words[E]|0,g=D*v,p=g&67108863;K=K+(g/67108864|0)|0,p=p+G|0,G=p&67108863,K=K+(p>>>26)|0,Y+=K>>>26,K&=67108863}J.words[I]=G,Z=K,K=Y}if(Z!==0)J.words[I]=Z;else J.length--;return J.strip()}function j(U,X,J){var Z=new x;return Z.mulp(U,X,J)}A.prototype.mulTo=function(U,X){var J,Z=this.length+U.length;if(this.length===10&&U.length===10)J=k(this,U,X);else if(Z<63)J=_(this,U,X);else if(Z<1024)J=B(this,U,X);else J=j(this,U,X);return J};function x(U,X){this.x=U,this.y=X}x.prototype.makeRBT=function(U){var X=Array(U),J=A.prototype._countBits(U)-1;for(var Z=0;Z<U;Z++)X[Z]=this.revBin(Z,J,U);return X},x.prototype.revBin=function(U,X,J){if(U===0||U===J-1)return U;var Z=0;for(var Y=0;Y<X;Y++)Z|=(U&1)<<X-Y-1,U>>=1;return Z},x.prototype.permute=function(U,X,J,Z,Y,I){for(var K=0;K<I;K++)Z[K]=X[U[K]],Y[K]=J[U[K]]},x.prototype.transform=function(U,X,J,Z,Y,I){this.permute(I,U,X,J,Z,Y);for(var K=1;K<Y;K<<=1){var G=K<<1,O=Math.cos(2*Math.PI/G),E=Math.sin(2*Math.PI/G);for(var T=0;T<Y;T+=G){var D=O,v=E;for(var g=0;g<K;g++){var p=J[T+g],n=Z[T+g],V0=J[T+g+K],r=Z[T+g+K],l=D*V0-v*r;if(r=D*r+v*V0,V0=l,J[T+g]=p+V0,Z[T+g]=n+r,J[T+g+K]=p-V0,Z[T+g+K]=n-r,g!==G)l=O*D-E*v,v=O*v+E*D,D=l}}}},x.prototype.guessLen13b=function(U,X){var J=Math.max(X,U)|1,Z=J&1,Y=0;for(J=J/2|0;J;J=J>>>1)Y++;return 1<<Y+1+Z},x.prototype.conjugate=function(U,X,J){if(J<=1)return;for(var Z=0;Z<J/2;Z++){var Y=U[Z];U[Z]=U[J-Z-1],U[J-Z-1]=Y,Y=X[Z],X[Z]=-X[J-Z-1],X[J-Z-1]=-Y}},x.prototype.normalize13b=function(U,X){var J=0;for(var Z=0;Z<X/2;Z++){var Y=Math.round(U[2*Z+1]/X)*8192+Math.round(U[2*Z]/X)+J;if(U[Z]=Y&67108863,Y<67108864)J=0;else J=Y/67108864|0}return U},x.prototype.convert13b=function(U,X,J,Z){var Y=0;for(var I=0;I<X;I++)Y=Y+(U[I]|0),J[2*I]=Y&8191,Y=Y>>>13,J[2*I+1]=Y&8191,Y=Y>>>13;for(I=2*X;I<Z;++I)J[I]=0;C(Y===0),C((Y&-8192)===0)},x.prototype.stub=function(U){var X=Array(U);for(var J=0;J<U;J++)X[J]=0;return X},x.prototype.mulp=function(U,X,J){var Z=2*this.guessLen13b(U.length,X.length),Y=this.makeRBT(Z),I=this.stub(Z),K=Array(Z),G=Array(Z),O=Array(Z),E=Array(Z),T=Array(Z),D=Array(Z),v=J.words;v.length=Z,this.convert13b(U.words,U.length,K,Z),this.convert13b(X.words,X.length,E,Z),this.transform(K,I,G,O,Z,Y),this.transform(E,I,T,D,Z,Y);for(var g=0;g<Z;g++){var p=G[g]*T[g]-O[g]*D[g];O[g]=G[g]*D[g]+O[g]*T[g],G[g]=p}return this.conjugate(G,O,Z),this.transform(G,O,v,I,Z,Y),this.conjugate(v,I,Z),this.normalize13b(v,Z),J.negative=U.negative^X.negative,J.length=U.length+X.length,J.strip()},A.prototype.mul=function(U){var X=new A(null);return X.words=Array(this.length+U.length),this.mulTo(U,X)},A.prototype.mulf=function(U){var X=new A(null);return X.words=Array(this.length+U.length),j(this,U,X)},A.prototype.imul=function(U){return this.clone().mulTo(U,this)},A.prototype.imuln=function(U){C(typeof U==="number"),C(U<67108864);var X=0;for(var J=0;J<this.length;J++){var Z=(this.words[J]|0)*U,Y=(Z&67108863)+(X&67108863);X>>=26,X+=Z/67108864|0,X+=Y>>>26,this.words[J]=Y&67108863}if(X!==0)this.words[J]=X,this.length++;return this.length=U===0?1:this.length,this},A.prototype.muln=function(U){return this.clone().imuln(U)},A.prototype.sqr=function(){return this.mul(this)},A.prototype.isqr=function(){return this.imul(this.clone())},A.prototype.pow=function(U){var X=P(U);if(X.length===0)return new A(1);var J=this;for(var Z=0;Z<X.length;Z++,J=J.sqr())if(X[Z]!==0)break;if(++Z<X.length)for(var Y=J.sqr();Z<X.length;Z++,Y=Y.sqr()){if(X[Z]===0)continue;J=J.mul(Y)}return J},A.prototype.iushln=function(U){C(typeof U==="number"&&U>=0);var X=U%26,J=(U-X)/26,Z=67108863>>>26-X<<26-X,Y;if(X!==0){var I=0;for(Y=0;Y<this.length;Y++){var K=this.words[Y]&Z,G=(this.words[Y]|0)-K<<X;this.words[Y]=G|I,I=K>>>26-X}if(I)this.words[Y]=I,this.length++}if(J!==0){for(Y=this.length-1;Y>=0;Y--)this.words[Y+J]=this.words[Y];for(Y=0;Y<J;Y++)this.words[Y]=0;this.length+=J}return this.strip()},A.prototype.ishln=function(U){return C(this.negative===0),this.iushln(U)},A.prototype.iushrn=function(U,X,J){C(typeof U==="number"&&U>=0);var Z;if(X)Z=(X-X%26)/26;else Z=0;var Y=U%26,I=Math.min((U-Y)/26,this.length),K=67108863^67108863>>>Y<<Y,G=J;if(Z-=I,Z=Math.max(0,Z),G){for(var O=0;O<I;O++)G.words[O]=this.words[O];G.length=I}if(I===0);else if(this.length>I){this.length-=I;for(O=0;O<this.length;O++)this.words[O]=this.words[O+I]}else this.words[0]=0,this.length=1;var E=0;for(O=this.length-1;O>=0&&(E!==0||O>=Z);O--){var T=this.words[O]|0;this.words[O]=E<<26-Y|T>>>Y,E=T&K}if(G&&E!==0)G.words[G.length++]=E;if(this.length===0)this.words[0]=0,this.length=1;return this.strip()},A.prototype.ishrn=function(U,X,J){return C(this.negative===0),this.iushrn(U,X,J)},A.prototype.shln=function(U){return this.clone().ishln(U)},A.prototype.ushln=function(U){return this.clone().iushln(U)},A.prototype.shrn=function(U){return this.clone().ishrn(U)},A.prototype.ushrn=function(U){return this.clone().iushrn(U)},A.prototype.testn=function(U){C(typeof U==="number"&&U>=0);var X=U%26,J=(U-X)/26,Z=1<<X;if(this.length<=J)return!1;var Y=this.words[J];return!!(Y&Z)},A.prototype.imaskn=function(U){C(typeof U==="number"&&U>=0);var X=U%26,J=(U-X)/26;if(C(this.negative===0,"imaskn works only with positive numbers"),this.length<=J)return this;if(X!==0)J++;if(this.length=Math.min(J,this.length),X!==0){var Z=67108863^67108863>>>X<<X;this.words[this.length-1]&=Z}return this.strip()},A.prototype.maskn=function(U){return this.clone().imaskn(U)},A.prototype.iaddn=function(U){if(C(typeof U==="number"),C(U<67108864),U<0)return this.isubn(-U);if(this.negative!==0){if(this.length===1&&(this.words[0]|0)<U)return this.words[0]=U-(this.words[0]|0),this.negative=0,this;return this.negative=0,this.isubn(U),this.negative=1,this}return this._iaddn(U)},A.prototype._iaddn=function(U){this.words[0]+=U;for(var X=0;X<this.length&&this.words[X]>=67108864;X++)if(this.words[X]-=67108864,X===this.length-1)this.words[X+1]=1;else this.words[X+1]++;return this.length=Math.max(this.length,X+1),this},A.prototype.isubn=function(U){if(C(typeof U==="number"),C(U<67108864),U<0)return this.iaddn(-U);if(this.negative!==0)return this.negative=0,this.iaddn(U),this.negative=1,this;if(this.words[0]-=U,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var X=0;X<this.length&&this.words[X]<0;X++)this.words[X]+=67108864,this.words[X+1]-=1;return this.strip()},A.prototype.addn=function(U){return this.clone().iaddn(U)},A.prototype.subn=function(U){return this.clone().isubn(U)},A.prototype.iabs=function(){return this.negative=0,this},A.prototype.abs=function(){return this.clone().iabs()},A.prototype._ishlnsubmul=function(U,X,J){var Z=U.length+J,Y;this._expand(Z);var I,K=0;for(Y=0;Y<U.length;Y++){I=(this.words[Y+J]|0)+K;var G=(U.words[Y]|0)*X;I-=G&67108863,K=(I>>26)-(G/67108864|0),this.words[Y+J]=I&67108863}for(;Y<this.length-J;Y++)I=(this.words[Y+J]|0)+K,K=I>>26,this.words[Y+J]=I&67108863;if(K===0)return this.strip();C(K===-1),K=0;for(Y=0;Y<this.length;Y++)I=-(this.words[Y]|0)+K,K=I>>26,this.words[Y]=I&67108863;return this.negative=1,this.strip()},A.prototype._wordDiv=function(U,X){var J=this.length-U.length,Z=this.clone(),Y=U,I=Y.words[Y.length-1]|0,K=this._countBits(I);if(J=26-K,J!==0)Y=Y.ushln(J),Z.iushln(J),I=Y.words[Y.length-1]|0;var G=Z.length-Y.length,O;if(X!=="mod"){O=new A(null),O.length=G+1,O.words=Array(O.length);for(var E=0;E<O.length;E++)O.words[E]=0}var T=Z.clone()._ishlnsubmul(Y,1,G);if(T.negative===0){if(Z=T,O)O.words[G]=1}for(var D=G-1;D>=0;D--){var v=(Z.words[Y.length+D]|0)*67108864+(Z.words[Y.length+D-1]|0);v=Math.min(v/I|0,67108863),Z._ishlnsubmul(Y,v,D);while(Z.negative!==0)if(v--,Z.negative=0,Z._ishlnsubmul(Y,1,D),!Z.isZero())Z.negative^=1;if(O)O.words[D]=v}if(O)O.strip();if(Z.strip(),X!=="div"&&J!==0)Z.iushrn(J);return{div:O||null,mod:Z}},A.prototype.divmod=function(U,X,J){if(C(!U.isZero()),this.isZero())return{div:new A(0),mod:new A(0)};var Z,Y,I;if(this.negative!==0&&U.negative===0){if(I=this.neg().divmod(U,X),X!=="mod")Z=I.div.neg();if(X!=="div"){if(Y=I.mod.neg(),J&&Y.negative!==0)Y.iadd(U)}return{div:Z,mod:Y}}if(this.negative===0&&U.negative!==0){if(I=this.divmod(U.neg(),X),X!=="mod")Z=I.div.neg();return{div:Z,mod:I.mod}}if((this.negative&U.negative)!==0){if(I=this.neg().divmod(U.neg(),X),X!=="div"){if(Y=I.mod.neg(),J&&Y.negative!==0)Y.isub(U)}return{div:I.div,mod:Y}}if(U.length>this.length||this.cmp(U)<0)return{div:new A(0),mod:this};if(U.length===1){if(X==="div")return{div:this.divn(U.words[0]),mod:null};if(X==="mod")return{div:null,mod:new A(this.modn(U.words[0]))};return{div:this.divn(U.words[0]),mod:new A(this.modn(U.words[0]))}}return this._wordDiv(U,X)},A.prototype.div=function(U){return this.divmod(U,"div",!1).div},A.prototype.mod=function(U){return this.divmod(U,"mod",!1).mod},A.prototype.umod=function(U){return this.divmod(U,"mod",!0).mod},A.prototype.divRound=function(U){var X=this.divmod(U);if(X.mod.isZero())return X.div;var J=X.div.negative!==0?X.mod.isub(U):X.mod,Z=U.ushrn(1),Y=U.andln(1),I=J.cmp(Z);if(I<0||Y===1&&I===0)return X.div;return X.div.negative!==0?X.div.isubn(1):X.div.iaddn(1)},A.prototype.modn=function(U){C(U<=67108863);var X=67108864%U,J=0;for(var Z=this.length-1;Z>=0;Z--)J=(X*J+(this.words[Z]|0))%U;return J},A.prototype.idivn=function(U){C(U<=67108863);var X=0;for(var J=this.length-1;J>=0;J--){var Z=(this.words[J]|0)+X*67108864;this.words[J]=Z/U|0,X=Z%U}return this.strip()},A.prototype.divn=function(U){return this.clone().idivn(U)},A.prototype.egcd=function(U){C(U.negative===0),C(!U.isZero());var X=this,J=U.clone();if(X.negative!==0)X=X.umod(U);else X=X.clone();var Z=new A(1),Y=new A(0),I=new A(0),K=new A(1),G=0;while(X.isEven()&&J.isEven())X.iushrn(1),J.iushrn(1),++G;var O=J.clone(),E=X.clone();while(!X.isZero()){for(var T=0,D=1;(X.words[0]&D)===0&&T<26;++T,D<<=1);if(T>0){X.iushrn(T);while(T-- >0){if(Z.isOdd()||Y.isOdd())Z.iadd(O),Y.isub(E);Z.iushrn(1),Y.iushrn(1)}}for(var v=0,g=1;(J.words[0]&g)===0&&v<26;++v,g<<=1);if(v>0){J.iushrn(v);while(v-- >0){if(I.isOdd()||K.isOdd())I.iadd(O),K.isub(E);I.iushrn(1),K.iushrn(1)}}if(X.cmp(J)>=0)X.isub(J),Z.isub(I),Y.isub(K);else J.isub(X),I.isub(Z),K.isub(Y)}return{a:I,b:K,gcd:J.iushln(G)}},A.prototype._invmp=function(U){C(U.negative===0),C(!U.isZero());var X=this,J=U.clone();if(X.negative!==0)X=X.umod(U);else X=X.clone();var Z=new A(1),Y=new A(0),I=J.clone();while(X.cmpn(1)>0&&J.cmpn(1)>0){for(var K=0,G=1;(X.words[0]&G)===0&&K<26;++K,G<<=1);if(K>0){X.iushrn(K);while(K-- >0){if(Z.isOdd())Z.iadd(I);Z.iushrn(1)}}for(var O=0,E=1;(J.words[0]&E)===0&&O<26;++O,E<<=1);if(O>0){J.iushrn(O);while(O-- >0){if(Y.isOdd())Y.iadd(I);Y.iushrn(1)}}if(X.cmp(J)>=0)X.isub(J),Z.isub(Y);else J.isub(X),Y.isub(Z)}var T;if(X.cmpn(1)===0)T=Z;else T=Y;if(T.cmpn(0)<0)T.iadd(U);return T},A.prototype.gcd=function(U){if(this.isZero())return U.abs();if(U.isZero())return this.abs();var X=this.clone(),J=U.clone();X.negative=0,J.negative=0;for(var Z=0;X.isEven()&&J.isEven();Z++)X.iushrn(1),J.iushrn(1);do{while(X.isEven())X.iushrn(1);while(J.isEven())J.iushrn(1);var Y=X.cmp(J);if(Y<0){var I=X;X=J,J=I}else if(Y===0||J.cmpn(1)===0)break;X.isub(J)}while(!0);return J.iushln(Z)},A.prototype.invm=function(U){return this.egcd(U).a.umod(U)},A.prototype.isEven=function(){return(this.words[0]&1)===0},A.prototype.isOdd=function(){return(this.words[0]&1)===1},A.prototype.andln=function(U){return this.words[0]&U},A.prototype.bincn=function(U){C(typeof U==="number");var X=U%26,J=(U-X)/26,Z=1<<X;if(this.length<=J)return this._expand(J+1),this.words[J]|=Z,this;var Y=Z;for(var I=J;Y!==0&&I<this.length;I++){var K=this.words[I]|0;K+=Y,Y=K>>>26,K&=67108863,this.words[I]=K}if(Y!==0)this.words[I]=Y,this.length++;return this},A.prototype.isZero=function(){return this.length===1&&this.words[0]===0},A.prototype.cmpn=function(U){var X=U<0;if(this.negative!==0&&!X)return-1;if(this.negative===0&&X)return 1;this.strip();var J;if(this.length>1)J=1;else{if(X)U=-U;C(U<=67108863,"Number is too big");var Z=this.words[0]|0;J=Z===U?0:Z<U?-1:1}if(this.negative!==0)return-J|0;return J},A.prototype.cmp=function(U){if(this.negative!==0&&U.negative===0)return-1;if(this.negative===0&&U.negative!==0)return 1;var X=this.ucmp(U);if(this.negative!==0)return-X|0;return X},A.prototype.ucmp=function(U){if(this.length>U.length)return 1;if(this.length<U.length)return-1;var X=0;for(var J=this.length-1;J>=0;J--){var Z=this.words[J]|0,Y=U.words[J]|0;if(Z===Y)continue;if(Z<Y)X=-1;else if(Z>Y)X=1;break}return X},A.prototype.gtn=function(U){return this.cmpn(U)===1},A.prototype.gt=function(U){return this.cmp(U)===1},A.prototype.gten=function(U){return this.cmpn(U)>=0},A.prototype.gte=function(U){return this.cmp(U)>=0},A.prototype.ltn=function(U){return this.cmpn(U)===-1},A.prototype.lt=function(U){return this.cmp(U)===-1},A.prototype.lten=function(U){return this.cmpn(U)<=0},A.prototype.lte=function(U){return this.cmp(U)<=0},A.prototype.eqn=function(U){return this.cmpn(U)===0},A.prototype.eq=function(U){return this.cmp(U)===0},A.red=function(U){return new u(U)},A.prototype.toRed=function(U){return C(!this.red,"Already a number in reduction context"),C(this.negative===0,"red works only with positives"),U.convertTo(this)._forceRed(U)},A.prototype.fromRed=function(){return C(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},A.prototype._forceRed=function(U){return this.red=U,this},A.prototype.forceRed=function(U){return C(!this.red,"Already a number in reduction context"),this._forceRed(U)},A.prototype.redAdd=function(U){return C(this.red,"redAdd works only with red numbers"),this.red.add(this,U)},A.prototype.redIAdd=function(U){return C(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,U)},A.prototype.redSub=function(U){return C(this.red,"redSub works only with red numbers"),this.red.sub(this,U)},A.prototype.redISub=function(U){return C(this.red,"redISub works only with red numbers"),this.red.isub(this,U)},A.prototype.redShl=function(U){return C(this.red,"redShl works only with red numbers"),this.red.shl(this,U)},A.prototype.redMul=function(U){return C(this.red,"redMul works only with red numbers"),this.red._verify2(this,U),this.red.mul(this,U)},A.prototype.redIMul=function(U){return C(this.red,"redMul works only with red numbers"),this.red._verify2(this,U),this.red.imul(this,U)},A.prototype.redSqr=function(){return C(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},A.prototype.redISqr=function(){return C(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},A.prototype.redSqrt=function(){return C(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},A.prototype.redInvm=function(){return C(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},A.prototype.redNeg=function(){return C(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},A.prototype.redPow=function(U){return C(this.red&&!U.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,U)};var f={k256:null,p224:null,p192:null,p25519:null};function w(U,X){this.name=U,this.p=new A(X,16),this.n=this.p.bitLength(),this.k=new A(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}w.prototype._tmp=function(){var U=new A(null);return U.words=Array(Math.ceil(this.n/13)),U},w.prototype.ireduce=function(U){var X=U,J;do this.split(X,this.tmp),X=this.imulK(X),X=X.iadd(this.tmp),J=X.bitLength();while(J>this.n);var Z=J<this.n?-1:X.ucmp(this.p);if(Z===0)X.words[0]=0,X.length=1;else if(Z>0)X.isub(this.p);else if(X.strip!==void 0)X.strip();else X._strip();return X},w.prototype.split=function(U,X){U.iushrn(this.n,0,X)},w.prototype.imulK=function(U){return U.imul(this.k)};function d(){w.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}F(d,w),d.prototype.split=function(U,X){var J=4194303,Z=Math.min(U.length,9);for(var Y=0;Y<Z;Y++)X.words[Y]=U.words[Y];if(X.length=Z,U.length<=9){U.words[0]=0,U.length=1;return}var I=U.words[9];X.words[X.length++]=I&J;for(Y=10;Y<U.length;Y++){var K=U.words[Y]|0;U.words[Y-10]=(K&J)<<4|I>>>22,I=K}if(I>>>=22,U.words[Y-10]=I,I===0&&U.length>10)U.length-=10;else U.length-=9},d.prototype.imulK=function(U){U.words[U.length]=0,U.words[U.length+1]=0,U.length+=2;var X=0;for(var J=0;J<U.length;J++){var Z=U.words[J]|0;X+=Z*977,U.words[J]=X&67108863,X=Z*64+(X/67108864|0)}if(U.words[U.length-1]===0){if(U.length--,U.words[U.length-1]===0)U.length--}return U};function Y0(){w.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}F(Y0,w);function J0(){w.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}F(J0,w);function A0(){w.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}F(A0,w),A0.prototype.imulK=function(U){var X=0;for(var J=0;J<U.length;J++){var Z=(U.words[J]|0)*19+X,Y=Z&67108863;Z>>>=26,U.words[J]=Y,X=Z}if(X!==0)U.words[U.length++]=X;return U},A._prime=function(U){if(f[U])return f[U];var X;if(U==="k256")X=new d;else if(U==="p224")X=new Y0;else if(U==="p192")X=new J0;else if(U==="p25519")X=new A0;else throw Error("Unknown prime "+U);return f[U]=X,X};function u(U){if(typeof U==="string"){var X=A._prime(U);this.m=X.p,this.prime=X}else C(U.gtn(1),"modulus must be greater than 1"),this.m=U,this.prime=null}u.prototype._verify1=function(U){C(U.negative===0,"red works only with positives"),C(U.red,"red works only with red numbers")},u.prototype._verify2=function(U,X){C((U.negative|X.negative)===0,"red works only with positives"),C(U.red&&U.red===X.red,"red works only with red numbers")},u.prototype.imod=function(U){if(this.prime)return this.prime.ireduce(U)._forceRed(this);return U.umod(this.m)._forceRed(this)},u.prototype.neg=function(U){if(U.isZero())return U.clone();return this.m.sub(U)._forceRed(this)},u.prototype.add=function(U,X){this._verify2(U,X);var J=U.add(X);if(J.cmp(this.m)>=0)J.isub(this.m);return J._forceRed(this)},u.prototype.iadd=function(U,X){this._verify2(U,X);var J=U.iadd(X);if(J.cmp(this.m)>=0)J.isub(this.m);return J},u.prototype.sub=function(U,X){this._verify2(U,X);var J=U.sub(X);if(J.cmpn(0)<0)J.iadd(this.m);return J._forceRed(this)},u.prototype.isub=function(U,X){this._verify2(U,X);var J=U.isub(X);if(J.cmpn(0)<0)J.iadd(this.m);return J},u.prototype.shl=function(U,X){return this._verify1(U),this.imod(U.ushln(X))},u.prototype.imul=function(U,X){return this._verify2(U,X),this.imod(U.imul(X))},u.prototype.mul=function(U,X){return this._verify2(U,X),this.imod(U.mul(X))},u.prototype.isqr=function(U){return this.imul(U,U.clone())},u.prototype.sqr=function(U){return this.mul(U,U)},u.prototype.sqrt=function(U){if(U.isZero())return U.clone();var X=this.m.andln(3);if(C(X%2===1),X===3){var J=this.m.add(new A(1)).iushrn(2);return this.pow(U,J)}var Z=this.m.subn(1),Y=0;while(!Z.isZero()&&Z.andln(1)===0)Y++,Z.iushrn(1);C(!Z.isZero());var I=new A(1).toRed(this),K=I.redNeg(),G=this.m.subn(1).iushrn(1),O=this.m.bitLength();O=new A(2*O*O).toRed(this);while(this.pow(O,G).cmp(K)!==0)O.redIAdd(K);var E=this.pow(O,Z),T=this.pow(U,Z.addn(1).iushrn(1)),D=this.pow(U,Z),v=Y;while(D.cmp(I)!==0){var g=D;for(var p=0;g.cmp(I)!==0;p++)g=g.redSqr();C(p<v);var n=this.pow(E,new A(1).iushln(v-p-1));T=T.redMul(n),E=n.redSqr(),D=D.redMul(E),v=p}return T},u.prototype.invm=function(U){var X=U._invmp(this.m);if(X.negative!==0)return X.negative=0,this.imod(X).redNeg();else return this.imod(X)},u.prototype.pow=function(U,X){if(X.isZero())return new A(1).toRed(this);if(X.cmpn(1)===0)return U.clone();var J=4,Z=Array(1<<J);Z[0]=new A(1).toRed(this),Z[1]=U;for(var Y=2;Y<Z.length;Y++)Z[Y]=this.mul(Z[Y-1],U);var I=Z[0],K=0,G=0,O=X.bitLength()%26;if(O===0)O=26;for(Y=X.length-1;Y>=0;Y--){var E=X.words[Y];for(var T=O-1;T>=0;T--){var D=E>>T&1;if(I!==Z[0])I=this.sqr(I);if(D===0&&K===0){G=0;continue}if(K<<=1,K|=D,G++,G!==J&&(Y!==0||T!==0))continue;I=this.mul(I,Z[K]),G=0,K=0}O=26}return I},u.prototype.convertTo=function(U){var X=U.umod(this.m);return X===U?X.clone():X},u.prototype.convertFrom=function(U){var X=U.clone();return X.red=null,X},A.mont=function(U){return new O0(U)};function O0(U){if(u.call(this,U),this.shift=this.m.bitLength(),this.shift%26!==0)this.shift+=26-this.shift%26;this.r=new A(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}F(O0,u),O0.prototype.convertTo=function(U){return this.imod(U.ushln(this.shift))},O0.prototype.convertFrom=function(U){var X=this.imod(U.mul(this.rinv));return X.red=null,X},O0.prototype.imul=function(U,X){if(U.isZero()||X.isZero())return U.words[0]=0,U.length=1,U;var J=U.imul(X),Z=J.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Y=J.isub(Z).iushrn(this.shift),I=Y;if(Y.cmp(this.m)>=0)I=Y.isub(this.m);else if(Y.cmpn(0)<0)I=Y.iadd(this.m);return I._forceRed(this)},O0.prototype.mul=function(U,X){if(U.isZero()||X.isZero())return new A(0)._forceRed(this);var J=U.mul(X),Z=J.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),Y=J.isub(Z).iushrn(this.shift),I=Y;if(Y.cmp(this.m)>=0)I=Y.isub(this.m);else if(Y.cmpn(0)<0)I=Y.iadd(this.m);return I._forceRed(this)},O0.prototype.invm=function(U){var X=this.imod(U._invmp(this.m).mul(this.r2));return X._forceRed(this)}})(typeof $>"u"||$,Q)}),FY=$0((Q,$)=>{var V=GX(),W=MU().Buffer;function C(F,A){return W.from(F.toRed(V.mont(A.modulus)).redPow(new V(A.publicExponent)).fromRed().toArray())}$.exports=C}),LG=$0((Q,$)=>{(function(V,W){function C(Z,Y){if(!Z)throw Error(Y||"Assertion failed")}function F(Z,Y){Z.super_=Y;var I=function(){};I.prototype=Y.prototype,Z.prototype=new I,Z.prototype.constructor=Z}function A(Z,Y,I){if(A.isBN(Z))return Z;if(this.negative=0,this.words=null,this.length=0,this.red=null,Z!==null){if(Y==="le"||Y==="be")I=Y,Y=10;this._init(Z||0,Y||10,I||"be")}}if(typeof V==="object")V.exports=A;else W.BN=A;A.BN=A,A.wordSize=26;var z;try{if(typeof window<"u"&&typeof window.Buffer<"u")z=window.Buffer;else z=(HU(),h0(WU)).Buffer}catch(Z){}A.isBN=function(Z){if(Z instanceof A)return!0;return Z!==null&&typeof Z==="object"&&Z.constructor.wordSize===A.wordSize&&Array.isArray(Z.words)},A.max=function(Z,Y){if(Z.cmp(Y)>0)return Z;return Y},A.min=function(Z,Y){if(Z.cmp(Y)<0)return Z;return Y},A.prototype._init=function(Z,Y,I){if(typeof Z==="number")return this._initNumber(Z,Y,I);if(typeof Z==="object")return this._initArray(Z,Y,I);if(Y==="hex")Y=16;C(Y===(Y|0)&&Y>=2&&Y<=36),Z=Z.toString().replace(/\s+/g,"");var K=0;if(Z[0]==="-")K++,this.negative=1;if(K<Z.length){if(Y===16)this._parseHex(Z,K,I);else if(this._parseBase(Z,Y,K),I==="le")this._initArray(this.toArray(),Y,I)}},A.prototype._initNumber=function(Z,Y,I){if(Z<0)this.negative=1,Z=-Z;if(Z<67108864)this.words=[Z&67108863],this.length=1;else if(Z<4503599627370496)this.words=[Z&67108863,Z/67108864&67108863],this.length=2;else C(Z<9007199254740992),this.words=[Z&67108863,Z/67108864&67108863,1],this.length=3;if(I!=="le")return;this._initArray(this.toArray(),Y,I)},A.prototype._initArray=function(Z,Y,I){if(C(typeof Z.length==="number"),Z.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(Z.length/3),this.words=Array(this.length);for(var K=0;K<this.length;K++)this.words[K]=0;var G,O,E=0;if(I==="be"){for(K=Z.length-1,G=0;K>=0;K-=3)if(O=Z[K]|Z[K-1]<<8|Z[K-2]<<16,this.words[G]|=O<<E&67108863,this.words[G+1]=O>>>26-E&67108863,E+=24,E>=26)E-=26,G++}else if(I==="le"){for(K=0,G=0;K<Z.length;K+=3)if(O=Z[K]|Z[K+1]<<8|Z[K+2]<<16,this.words[G]|=O<<E&67108863,this.words[G+1]=O>>>26-E&67108863,E+=24,E>=26)E-=26,G++}return this._strip()};function M(Z,Y){var I=Z.charCodeAt(Y);if(I>=48&&I<=57)return I-48;else if(I>=65&&I<=70)return I-55;else if(I>=97&&I<=102)return I-87;else C(!1,"Invalid character in "+Z)}function S(Z,Y,I){var K=M(Z,I);if(I-1>=Y)K|=M(Z,I-1)<<4;return K}A.prototype._parseHex=function(Z,Y,I){this.length=Math.ceil((Z.length-Y)/6),this.words=Array(this.length);for(var K=0;K<this.length;K++)this.words[K]=0;var G=0,O=0,E;if(I==="be")for(K=Z.length-1;K>=Y;K-=2)if(E=S(Z,Y,K)<<G,this.words[O]|=E&67108863,G>=18)G-=18,O+=1,this.words[O]|=E>>>26;else G+=8;else{var T=Z.length-Y;for(K=T%2===0?Y+1:Y;K<Z.length;K+=2)if(E=S(Z,Y,K)<<G,this.words[O]|=E&67108863,G>=18)G-=18,O+=1,this.words[O]|=E>>>26;else G+=8}this._strip()};function R(Z,Y,I,K){var G=0,O=0,E=Math.min(Z.length,I);for(var T=Y;T<E;T++){var D=Z.charCodeAt(T)-48;if(G*=K,D>=49)O=D-49+10;else if(D>=17)O=D-17+10;else O=D;C(D>=0&&O<K,"Invalid character"),G+=O}return G}A.prototype._parseBase=function(Z,Y,I){this.words=[0],this.length=1;for(var K=0,G=1;G<=67108863;G*=Y)K++;K--,G=G/Y|0;var O=Z.length-I,E=O%K,T=Math.min(O,O-E)+I,D=0;for(var v=I;v<T;v+=K)if(D=R(Z,v,v+K,Y),this.imuln(G),this.words[0]+D<67108864)this.words[0]+=D;else this._iaddn(D);if(E!==0){var g=1;D=R(Z,v,Z.length,Y);for(v=0;v<E;v++)g*=Y;if(this.imuln(g),this.words[0]+D<67108864)this.words[0]+=D;else this._iaddn(D)}this._strip()},A.prototype.copy=function(Z){Z.words=Array(this.length);for(var Y=0;Y<this.length;Y++)Z.words[Y]=this.words[Y];Z.length=this.length,Z.negative=this.negative,Z.red=this.red};function L(Z,Y){Z.words=Y.words,Z.length=Y.length,Z.negative=Y.negative,Z.red=Y.red}if(A.prototype._move=function(Z){L(Z,this)},A.prototype.clone=function(){var Z=new A(null);return this.copy(Z),Z},A.prototype._expand=function(Z){while(this.length<Z)this.words[this.length++]=0;return this},A.prototype._strip=function(){while(this.length>1&&this.words[this.length-1]===0)this.length--;return this._normSign()},A.prototype._normSign=function(){if(this.length===1&&this.words[0]===0)this.negative=0;return this},typeof Symbol<"u"&&typeof Symbol.for==="function")try{A.prototype[Symbol.for("nodejs.util.inspect.custom")]=H}catch(Z){A.prototype.inspect=H}else A.prototype.inspect=H;function H(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var q=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],P=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],_=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64000000,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,24300000,28629151,33554432,39135393,45435424,52521875,60466176];if(A.prototype.toString=function(Z,Y){Z=Z||10,Y=Y|0||1;var I;if(Z===16||Z==="hex"){I="";var K=0,G=0;for(var O=0;O<this.length;O++){var E=this.words[O],T=((E<<K|G)&16777215).toString(16);if(G=E>>>24-K&16777215,K+=2,K>=26)K-=26,O--;if(G!==0||O!==this.length-1)I=q[6-T.length]+T+I;else I=T+I}if(G!==0)I=G.toString(16)+I;while(I.length%Y!==0)I="0"+I;if(this.negative!==0)I="-"+I;return I}if(Z===(Z|0)&&Z>=2&&Z<=36){var D=P[Z],v=_[Z];I="";var g=this.clone();g.negative=0;while(!g.isZero()){var p=g.modrn(v).toString(Z);if(g=g.idivn(v),!g.isZero())I=q[D-p.length]+p+I;else I=p+I}if(this.isZero())I="0"+I;while(I.length%Y!==0)I="0"+I;if(this.negative!==0)I="-"+I;return I}C(!1,"Base should be between 2 and 36")},A.prototype.toNumber=function(){var Z=this.words[0];if(this.length===2)Z+=this.words[1]*67108864;else if(this.length===3&&this.words[2]===1)Z+=4503599627370496+this.words[1]*67108864;else if(this.length>2)C(!1,"Number can only safely store up to 53 bits");return this.negative!==0?-Z:Z},A.prototype.toJSON=function(){return this.toString(16,2)},z)A.prototype.toBuffer=function(Z,Y){return this.toArrayLike(z,Z,Y)};A.prototype.toArray=function(Z,Y){return this.toArrayLike(Array,Z,Y)};var k=function(Z,Y){if(Z.allocUnsafe)return Z.allocUnsafe(Y);return new Z(Y)};if(A.prototype.toArrayLike=function(Z,Y,I){this._strip();var K=this.byteLength(),G=I||Math.max(1,K);C(K<=G,"byte array longer than desired length"),C(G>0,"Requested array length <= 0");var O=k(Z,G),E=Y==="le"?"LE":"BE";return this["_toArrayLike"+E](O,K),O},A.prototype._toArrayLikeLE=function(Z,Y){var I=0,K=0;for(var G=0,O=0;G<this.length;G++){var E=this.words[G]<<O|K;if(Z[I++]=E&255,I<Z.length)Z[I++]=E>>8&255;if(I<Z.length)Z[I++]=E>>16&255;if(O===6){if(I<Z.length)Z[I++]=E>>24&255;K=0,O=0}else K=E>>>24,O+=2}if(I<Z.length){Z[I++]=K;while(I<Z.length)Z[I++]=0}},A.prototype._toArrayLikeBE=function(Z,Y){var I=Z.length-1,K=0;for(var G=0,O=0;G<this.length;G++){var E=this.words[G]<<O|K;if(Z[I--]=E&255,I>=0)Z[I--]=E>>8&255;if(I>=0)Z[I--]=E>>16&255;if(O===6){if(I>=0)Z[I--]=E>>24&255;K=0,O=0}else K=E>>>24,O+=2}if(I>=0){Z[I--]=K;while(I>=0)Z[I--]=0}},Math.clz32)A.prototype._countBits=function(Z){return 32-Math.clz32(Z)};else A.prototype._countBits=function(Z){var Y=Z,I=0;if(Y>=4096)I+=13,Y>>>=13;if(Y>=64)I+=7,Y>>>=7;if(Y>=8)I+=4,Y>>>=4;if(Y>=2)I+=2,Y>>>=2;return I+Y};A.prototype._zeroBits=function(Z){if(Z===0)return 26;var Y=Z,I=0;if((Y&8191)===0)I+=13,Y>>>=13;if((Y&127)===0)I+=7,Y>>>=7;if((Y&15)===0)I+=4,Y>>>=4;if((Y&3)===0)I+=2,Y>>>=2;if((Y&1)===0)I++;return I},A.prototype.bitLength=function(){var Z=this.words[this.length-1],Y=this._countBits(Z);return(this.length-1)*26+Y};function B(Z){var Y=Array(Z.bitLength());for(var I=0;I<Y.length;I++){var K=I/26|0,G=I%26;Y[I]=Z.words[K]>>>G&1}return Y}A.prototype.zeroBits=function(){if(this.isZero())return 0;var Z=0;for(var Y=0;Y<this.length;Y++){var I=this._zeroBits(this.words[Y]);if(Z+=I,I!==26)break}return Z},A.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},A.prototype.toTwos=function(Z){if(this.negative!==0)return this.abs().inotn(Z).iaddn(1);return this.clone()},A.prototype.fromTwos=function(Z){if(this.testn(Z-1))return this.notn(Z).iaddn(1).ineg();return this.clone()},A.prototype.isNeg=function(){return this.negative!==0},A.prototype.neg=function(){return this.clone().ineg()},A.prototype.ineg=function(){if(!this.isZero())this.negative^=1;return this},A.prototype.iuor=function(Z){while(this.length<Z.length)this.words[this.length++]=0;for(var Y=0;Y<Z.length;Y++)this.words[Y]=this.words[Y]|Z.words[Y];return this._strip()},A.prototype.ior=function(Z){return C((this.negative|Z.negative)===0),this.iuor(Z)},A.prototype.or=function(Z){if(this.length>Z.length)return this.clone().ior(Z);return Z.clone().ior(this)},A.prototype.uor=function(Z){if(this.length>Z.length)return this.clone().iuor(Z);return Z.clone().iuor(this)},A.prototype.iuand=function(Z){var Y;if(this.length>Z.length)Y=Z;else Y=this;for(var I=0;I<Y.length;I++)this.words[I]=this.words[I]&Z.words[I];return this.length=Y.length,this._strip()},A.prototype.iand=function(Z){return C((this.negative|Z.negative)===0),this.iuand(Z)},A.prototype.and=function(Z){if(this.length>Z.length)return this.clone().iand(Z);return Z.clone().iand(this)},A.prototype.uand=function(Z){if(this.length>Z.length)return this.clone().iuand(Z);return Z.clone().iuand(this)},A.prototype.iuxor=function(Z){var Y,I;if(this.length>Z.length)Y=this,I=Z;else Y=Z,I=this;for(var K=0;K<I.length;K++)this.words[K]=Y.words[K]^I.words[K];if(this!==Y)for(;K<Y.length;K++)this.words[K]=Y.words[K];return this.length=Y.length,this._strip()},A.prototype.ixor=function(Z){return C((this.negative|Z.negative)===0),this.iuxor(Z)},A.prototype.xor=function(Z){if(this.length>Z.length)return this.clone().ixor(Z);return Z.clone().ixor(this)},A.prototype.uxor=function(Z){if(this.length>Z.length)return this.clone().iuxor(Z);return Z.clone().iuxor(this)},A.prototype.inotn=function(Z){C(typeof Z==="number"&&Z>=0);var Y=Math.ceil(Z/26)|0,I=Z%26;if(this._expand(Y),I>0)Y--;for(var K=0;K<Y;K++)this.words[K]=~this.words[K]&67108863;if(I>0)this.words[K]=~this.words[K]&67108863>>26-I;return this._strip()},A.prototype.notn=function(Z){return this.clone().inotn(Z)},A.prototype.setn=function(Z,Y){C(typeof Z==="number"&&Z>=0);var I=Z/26|0,K=Z%26;if(this._expand(I+1),Y)this.words[I]=this.words[I]|1<<K;else this.words[I]=this.words[I]&~(1<<K);return this._strip()},A.prototype.iadd=function(Z){var Y;if(this.negative!==0&&Z.negative===0)return this.negative=0,Y=this.isub(Z),this.negative^=1,this._normSign();else if(this.negative===0&&Z.negative!==0)return Z.negative=0,Y=this.isub(Z),Z.negative=1,Y._normSign();var I,K;if(this.length>Z.length)I=this,K=Z;else I=Z,K=this;var G=0;for(var O=0;O<K.length;O++)Y=(I.words[O]|0)+(K.words[O]|0)+G,this.words[O]=Y&67108863,G=Y>>>26;for(;G!==0&&O<I.length;O++)Y=(I.words[O]|0)+G,this.words[O]=Y&67108863,G=Y>>>26;if(this.length=I.length,G!==0)this.words[this.length]=G,this.length++;else if(I!==this)for(;O<I.length;O++)this.words[O]=I.words[O];return this},A.prototype.add=function(Z){var Y;if(Z.negative!==0&&this.negative===0)return Z.negative=0,Y=this.sub(Z),Z.negative^=1,Y;else if(Z.negative===0&&this.negative!==0)return this.negative=0,Y=Z.sub(this),this.negative=1,Y;if(this.length>Z.length)return this.clone().iadd(Z);return Z.clone().iadd(this)},A.prototype.isub=function(Z){if(Z.negative!==0){Z.negative=0;var Y=this.iadd(Z);return Z.negative=1,Y._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(Z),this.negative=1,this._normSign();var I=this.cmp(Z);if(I===0)return this.negative=0,this.length=1,this.words[0]=0,this;var K,G;if(I>0)K=this,G=Z;else K=Z,G=this;var O=0;for(var E=0;E<G.length;E++)Y=(K.words[E]|0)-(G.words[E]|0)+O,O=Y>>26,this.words[E]=Y&67108863;for(;O!==0&&E<K.length;E++)Y=(K.words[E]|0)+O,O=Y>>26,this.words[E]=Y&67108863;if(O===0&&E<K.length&&K!==this)for(;E<K.length;E++)this.words[E]=K.words[E];if(this.length=Math.max(this.length,E),K!==this)this.negative=1;return this._strip()},A.prototype.sub=function(Z){return this.clone().isub(Z)};function j(Z,Y,I){I.negative=Y.negative^Z.negative;var K=Z.length+Y.length|0;I.length=K,K=K-1|0;var G=Z.words[0]|0,O=Y.words[0]|0,E=G*O,T=E&67108863,D=E/67108864|0;I.words[0]=T;for(var v=1;v<K;v++){var g=D>>>26,p=D&67108863,n=Math.min(v,Y.length-1);for(var V0=Math.max(0,v-Z.length+1);V0<=n;V0++){var r=v-V0|0;G=Z.words[r]|0,O=Y.words[V0]|0,E=G*O+p,g+=E/67108864|0,p=E&67108863}I.words[v]=p|0,D=g|0}if(D!==0)I.words[v]=D|0;else I.length--;return I._strip()}var x=function(Z,Y,I){var K=Z.words,G=Y.words,O=I.words,E=0,T,D,v,g=K[0]|0,p=g&8191,n=g>>>13,V0=K[1]|0,r=V0&8191,l=V0>>>13,X0=K[2]|0,m=X0&8191,i=X0>>>13,g0=K[3]|0,y=g0&8191,h=g0>>>13,Q0=K[4]|0,t=Q0&8191,e=Q0>>>13,F0=K[5]|0,c=F0&8191,o=F0>>>13,N0=K[6]|0,s=N0&8191,Z0=N0>>>13,w0=K[7]|0,C0=w0&8191,K0=w0>>>13,s0=K[8]|0,E0=s0&8191,L0=s0>>>13,e0=K[9]|0,D0=e0&8191,H0=e0>>>13,FU=G[0]|0,R0=FU&8191,k0=FU>>>13,RU=G[1]|0,_0=RU&8191,T0=RU>>>13,DU=G[2]|0,v0=DU&8191,z0=DU>>>13,CU=G[3]|0,j0=CU&8191,B0=CU>>>13,KU=G[4]|0,M0=KU&8191,N=KU>>>13,b=G[5]|0,a=b&8191,U0=b>>>13,f0=G[6]|0,I0=f0&8191,W0=f0>>>13,t0=G[7]|0,q0=t0&8191,x0=t0>>>13,SU=G[8]|0,P0=SU&8191,S0=SU>>>13,r0=G[9]|0,c0=r0&8191,y0=r0>>>13;I.negative=Z.negative^Y.negative,I.length=19,T=Math.imul(p,R0),D=Math.imul(p,k0),D=D+Math.imul(n,R0)|0,v=Math.imul(n,k0);var d0=(E+T|0)+((D&8191)<<13)|0;E=(v+(D>>>13)|0)+(d0>>>26)|0,d0&=67108863,T=Math.imul(r,R0),D=Math.imul(r,k0),D=D+Math.imul(l,R0)|0,v=Math.imul(l,k0),T=T+Math.imul(p,_0)|0,D=D+Math.imul(p,T0)|0,D=D+Math.imul(n,_0)|0,v=v+Math.imul(n,T0)|0;var l0=(E+T|0)+((D&8191)<<13)|0;E=(v+(D>>>13)|0)+(l0>>>26)|0,l0&=67108863,T=Math.imul(m,R0),D=Math.imul(m,k0),D=D+Math.imul(i,R0)|0,v=Math.imul(i,k0),T=T+Math.imul(r,_0)|0,D=D+Math.imul(r,T0)|0,D=D+Math.imul(l,_0)|0,v=v+Math.imul(l,T0)|0,T=T+Math.imul(p,v0)|0,D=D+Math.imul(p,z0)|0,D=D+Math.imul(n,v0)|0,v=v+Math.imul(n,z0)|0;var i0=(E+T|0)+((D&8191)<<13)|0;E=(v+(D>>>13)|0)+(i0>>>26)|0,i0&=67108863,T=Math.imul(y,R0),D=Math.imul(y,k0),D=D+Math.imul(h,R0)|0,v=Math.imul(h,k0),T=T+Math.imul(m,_0)|0,D=D+Math.imul(m,T0)|0,D=D+Math.imul(i,_0)|0,v=v+Math.imul(i,T0)|0,T=T+Math.imul(r,v0)|0,D=D+Math.imul(r,z0)|0,D=D+Math.imul(l,v0)|0,v=v+Math.imul(l,z0)|0,T=T+Math.imul(p,j0)|0,D=D+Math.imul(p,B0)|0,D=D+Math.imul(n,j0)|0,v=v+Math.imul(n,B0)|0;var UU=(E+T|0)+((D&8191)<<13)|0;E=(v+(D>>>13)|0)+(UU>>>26)|0,UU&=67108863,T=Math.imul(t,R0),D=Math.imul(t,k0),D=D+Math.imul(e,R0)|0,v=Math.imul(e,k0),T=T+Math.imul(y,_0)|0,D=D+Math.imul(y,T0)|0,D=D+Math.imul(h,_0)|0,v=v+Math.imul(h,T0)|0,T=T+Math.imul(m,v0)|0,D=D+Math.imul(m,z0)|0,D=D+Math.imul(i,v0)|0,v=v+Math.imul(i,z0)|0,T=T+Math.imul(r,j0)|0,D=D+Math.imul(r,B0)|0,D=D+Math.imul(l,j0)|0,v=v+Math.imul(l,B0)|0,T=T+Math.imul(p,M0)|0,D=D+Math.imul(p,N)|0,D=D+Math.imul(n,M0)|0,v=v+Math.imul(n,N)|0;var OU=(E+T|0)+((D&8191)<<13)|0;E=(v+(D>>>13)|0)+(OU>>>26)|0,OU&=67108863,T=Math.imul(c,R0),D=Math.imul(c,k0),D=D+Math.imul(o,R0)|0,v=Math.imul(o,k0),T=T+Math.imul(t,_0)|0,D=D+Math.imul(t,T0)|0,D=D+Math.imul(e,_0)|0,v=v+Math.imul(e,T0)|0,T=T+Math.imul(y,v0)|0,D=D+Math.imul(y,z0)|0,D=D+Math.imul(h,v0)|0,v=v+Math.imul(h,z0)|0,T=T+Math.imul(m,j0)|0,D=D+Math.imul(m,B0)|0,D=D+Math.imul(i,j0)|0,v=v+Math.imul(i,B0)|0,T=T+Math.imul(r,M0)|0,D=D+Math.imul(r,N)|0,D=D+Math.imul(l,M0)|0,v=v+Math.imul(l,N)|0,T=T+Math.imul(p,a)|0,D=D+Math.imul(p,U0)|0,D=D+Math.imul(n,a)|0,v=v+Math.imul(n,U0)|0;var ZU=(E+T|0)+((D&8191)<<13)|0;E=(v+(D>>>13)|0)+(ZU>>>26)|0,ZU&=67108863,T=Math.imul(s,R0),D=Math.imul(s,k0),D=D+Math.imul(Z0,R0)|0,v=Math.imul(Z0,k0),T=T+Math.imul(c,_0)|0,D=D+Math.imul(c,T0)|0,D=D+Math.imul(o,_0)|0,v=v+Math.imul(o,T0)|0,T=T+Math.imul(t,v0)|0,D=D+Math.imul(t,z0)|0,D=D+Math.imul(e,v0)|0,v=v+Math.imul(e,z0)|0,T=T+Math.imul(y,j0)|0,D=D+Math.imul(y,B0)|0,D=D+Math.imul(h,j0)|0,v=v+Math.imul(h,B0)|0,T=T+Math.imul(m,M0)|0,D=D+Math.imul(m,N)|0,D=D+Math.imul(i,M0)|0,v=v+Math.imul(i,N)|0,T=T+Math.imul(r,a)|0,D=D+Math.imul(r,U0)|0,D=D+Math.imul(l,a)|0,v=v+Math.imul(l,U0)|0,T=T+Math.imul(p,I0)|0,D=D+Math.imul(p,W0)|0,D=D+Math.imul(n,I0)|0,v=v+Math.imul(n,W0)|0;var XU=(E+T|0)+((D&8191)<<13)|0;E=(v+(D>>>13)|0)+(XU>>>26)|0,XU&=67108863,T=Math.imul(C0,R0),D=Math.imul(C0,k0),D=D+Math.imul(K0,R0)|0,v=Math.imul(K0,k0),T=T+Math.imul(s,_0)|0,D=D+Math.imul(s,T0)|0,D=D+Math.imul(Z0,_0)|0,v=v+Math.imul(Z0,T0)|0,T=T+Math.imul(c,v0)|0,D=D+Math.imul(c,z0)|0,D=D+Math.imul(o,v0)|0,v=v+Math.imul(o,z0)|0,T=T+Math.imul(t,j0)|0,D=D+Math.imul(t,B0)|0,D=D+Math.imul(e,j0)|0,v=v+Math.imul(e,B0)|0,T=T+Math.imul(y,M0)|0,D=D+Math.imul(y,N)|0,D=D+Math.imul(h,M0)|0,v=v+Math.imul(h,N)|0,T=T+Math.imul(m,a)|0,D=D+Math.imul(m,U0)|0,D=D+Math.imul(i,a)|0,v=v+Math.imul(i,U0)|0,T=T+Math.imul(r,I0)|0,D=D+Math.imul(r,W0)|0,D=D+Math.imul(l,I0)|0,v=v+Math.imul(l,W0)|0,T=T+Math.imul(p,q0)|0,D=D+Math.imul(p,x0)|0,D=D+Math.imul(n,q0)|0,v=v+Math.imul(n,x0)|0;var QU=(E+T|0)+((D&8191)<<13)|0;E=(v+(D>>>13)|0)+(QU>>>26)|0,QU&=67108863,T=Math.imul(E0,R0),D=Math.imul(E0,k0),D=D+Math.imul(L0,R0)|0,v=Math.imul(L0,k0),T=T+Math.imul(C0,_0)|0,D=D+Math.imul(C0,T0)|0,D=D+Math.imul(K0,_0)|0,v=v+Math.imul(K0,T0)|0,T=T+Math.imul(s,v0)|0,D=D+Math.imul(s,z0)|0,D=D+Math.imul(Z0,v0)|0,v=v+Math.imul(Z0,z0)|0,T=T+Math.imul(c,j0)|0,D=D+Math.imul(c,B0)|0,D=D+Math.imul(o,j0)|0,v=v+Math.imul(o,B0)|0,T=T+Math.imul(t,M0)|0,D=D+Math.imul(t,N)|0,D=D+Math.imul(e,M0)|0,v=v+Math.imul(e,N)|0,T=T+Math.imul(y,a)|0,D=D+Math.imul(y,U0)|0,D=D+Math.imul(h,a)|0,v=v+Math.imul(h,U0)|0,T=T+Math.imul(m,I0)|0,D=D+Math.imul(m,W0)|0,D=D+Math.imul(i,I0)|0,v=v+Math.imul(i,W0)|0,T=T+Math.imul(r,q0)|0,D=D+Math.imul(r,x0)|0,D=D+Math.imul(l,q0)|0,v=v+Math.imul(l,x0)|0,T=T+Math.imul(p,P0)|0,D=D+Math.imul(p,S0)|0,D=D+Math.imul(n,P0)|0,v=v+Math.imul(n,S0)|0;var YU=(E+T|0)+((D&8191)<<13)|0;E=(v+(D>>>13)|0)+(YU>>>26)|0,YU&=67108863,T=Math.imul(D0,R0),D=Math.imul(D0,k0),D=D+Math.imul(H0,R0)|0,v=Math.imul(H0,k0),T=T+Math.imul(E0,_0)|0,D=D+Math.imul(E0,T0)|0,D=D+Math.imul(L0,_0)|0,v=v+Math.imul(L0,T0)|0,T=T+Math.imul(C0,v0)|0,D=D+Math.imul(C0,z0)|0,D=D+Math.imul(K0,v0)|0,v=v+Math.imul(K0,z0)|0,T=T+Math.imul(s,j0)|0,D=D+Math.imul(s,B0)|0,D=D+Math.imul(Z0,j0)|0,v=v+Math.imul(Z0,B0)|0,T=T+Math.imul(c,M0)|0,D=D+Math.imul(c,N)|0,D=D+Math.imul(o,M0)|0,v=v+Math.imul(o,N)|0,T=T+Math.imul(t,a)|0,D=D+Math.imul(t,U0)|0,D=D+Math.imul(e,a)|0,v=v+Math.imul(e,U0)|0,T=T+Math.imul(y,I0)|0,D=D+Math.imul(y,W0)|0,D=D+Math.imul(h,I0)|0,v=v+Math.imul(h,W0)|0,T=T+Math.imul(m,q0)|0,D=D+Math.imul(m,x0)|0,D=D+Math.imul(i,q0)|0,v=v+Math.imul(i,x0)|0,T=T+Math.imul(r,P0)|0,D=D+Math.imul(r,S0)|0,D=D+Math.imul(l,P0)|0,v=v+Math.imul(l,S0)|0,T=T+Math.imul(p,c0)|0,D=D+Math.imul(p,y0)|0,D=D+Math.imul(n,c0)|0,v=v+Math.imul(n,y0)|0;var AU=(E+T|0)+((D&8191)<<13)|0;E=(v+(D>>>13)|0)+(AU>>>26)|0,AU&=67108863,T=Math.imul(D0,_0),D=Math.imul(D0,T0),D=D+Math.imul(H0,_0)|0,v=Math.imul(H0,T0),T=T+Math.imul(E0,v0)|0,D=D+Math.imul(E0,z0)|0,D=D+Math.imul(L0,v0)|0,v=v+Math.imul(L0,z0)|0,T=T+Math.imul(C0,j0)|0,D=D+Math.imul(C0,B0)|0,D=D+Math.imul(K0,j0)|0,v=v+Math.imul(K0,B0)|0,T=T+Math.imul(s,M0)|0,D=D+Math.imul(s,N)|0,D=D+Math.imul(Z0,M0)|0,v=v+Math.imul(Z0,N)|0,T=T+Math.imul(c,a)|0,D=D+Math.imul(c,U0)|0,D=D+Math.imul(o,a)|0,v=v+Math.imul(o,U0)|0,T=T+Math.imul(t,I0)|0,D=D+Math.imul(t,W0)|0,D=D+Math.imul(e,I0)|0,v=v+Math.imul(e,W0)|0,T=T+Math.imul(y,q0)|0,D=D+Math.imul(y,x0)|0,D=D+Math.imul(h,q0)|0,v=v+Math.imul(h,x0)|0,T=T+Math.imul(m,P0)|0,D=D+Math.imul(m,S0)|0,D=D+Math.imul(i,P0)|0,v=v+Math.imul(i,S0)|0,T=T+Math.imul(r,c0)|0,D=D+Math.imul(r,y0)|0,D=D+Math.imul(l,c0)|0,v=v+Math.imul(l,y0)|0;var $U=(E+T|0)+((D&8191)<<13)|0;E=(v+(D>>>13)|0)+($U>>>26)|0,$U&=67108863,T=Math.imul(D0,v0),D=Math.imul(D0,z0),D=D+Math.imul(H0,v0)|0,v=Math.imul(H0,z0),T=T+Math.imul(E0,j0)|0,D=D+Math.imul(E0,B0)|0,D=D+Math.imul(L0,j0)|0,v=v+Math.imul(L0,B0)|0,T=T+Math.imul(C0,M0)|0,D=D+Math.imul(C0,N)|0,D=D+Math.imul(K0,M0)|0,v=v+Math.imul(K0,N)|0,T=T+Math.imul(s,a)|0,D=D+Math.imul(s,U0)|0,D=D+Math.imul(Z0,a)|0,v=v+Math.imul(Z0,U0)|0,T=T+Math.imul(c,I0)|0,D=D+Math.imul(c,W0)|0,D=D+Math.imul(o,I0)|0,v=v+Math.imul(o,W0)|0,T=T+Math.imul(t,q0)|0,D=D+Math.imul(t,x0)|0,D=D+Math.imul(e,q0)|0,v=v+Math.imul(e,x0)|0,T=T+Math.imul(y,P0)|0,D=D+Math.imul(y,S0)|0,D=D+Math.imul(h,P0)|0,v=v+Math.imul(h,S0)|0,T=T+Math.imul(m,c0)|0,D=D+Math.imul(m,y0)|0,D=D+Math.imul(i,c0)|0,v=v+Math.imul(i,y0)|0;var JU=(E+T|0)+((D&8191)<<13)|0;E=(v+(D>>>13)|0)+(JU>>>26)|0,JU&=67108863,T=Math.imul(D0,j0),D=Math.imul(D0,B0),D=D+Math.imul(H0,j0)|0,v=Math.imul(H0,B0),T=T+Math.imul(E0,M0)|0,D=D+Math.imul(E0,N)|0,D=D+Math.imul(L0,M0)|0,v=v+Math.imul(L0,N)|0,T=T+Math.imul(C0,a)|0,D=D+Math.imul(C0,U0)|0,D=D+Math.imul(K0,a)|0,v=v+Math.imul(K0,U0)|0,T=T+Math.imul(s,I0)|0,D=D+Math.imul(s,W0)|0,D=D+Math.imul(Z0,I0)|0,v=v+Math.imul(Z0,W0)|0,T=T+Math.imul(c,q0)|0,D=D+Math.imul(c,x0)|0,D=D+Math.imul(o,q0)|0,v=v+Math.imul(o,x0)|0,T=T+Math.imul(t,P0)|0,D=D+Math.imul(t,S0)|0,D=D+Math.imul(e,P0)|0,v=v+Math.imul(e,S0)|0,T=T+Math.imul(y,c0)|0,D=D+Math.imul(y,y0)|0,D=D+Math.imul(h,c0)|0,v=v+Math.imul(h,y0)|0;var GU=(E+T|0)+((D&8191)<<13)|0;E=(v+(D>>>13)|0)+(GU>>>26)|0,GU&=67108863,T=Math.imul(D0,M0),D=Math.imul(D0,N),D=D+Math.imul(H0,M0)|0,v=Math.imul(H0,N),T=T+Math.imul(E0,a)|0,D=D+Math.imul(E0,U0)|0,D=D+Math.imul(L0,a)|0,v=v+Math.imul(L0,U0)|0,T=T+Math.imul(C0,I0)|0,D=D+Math.imul(C0,W0)|0,D=D+Math.imul(K0,I0)|0,v=v+Math.imul(K0,W0)|0,T=T+Math.imul(s,q0)|0,D=D+Math.imul(s,x0)|0,D=D+Math.imul(Z0,q0)|0,v=v+Math.imul(Z0,x0)|0,T=T+Math.imul(c,P0)|0,D=D+Math.imul(c,S0)|0,D=D+Math.imul(o,P0)|0,v=v+Math.imul(o,S0)|0,T=T+Math.imul(t,c0)|0,D=D+Math.imul(t,y0)|0,D=D+Math.imul(e,c0)|0,v=v+Math.imul(e,y0)|0;var VU=(E+T|0)+((D&8191)<<13)|0;E=(v+(D>>>13)|0)+(VU>>>26)|0,VU&=67108863,T=Math.imul(D0,a),D=Math.imul(D0,U0),D=D+Math.imul(H0,a)|0,v=Math.imul(H0,U0),T=T+Math.imul(E0,I0)|0,D=D+Math.imul(E0,W0)|0,D=D+Math.imul(L0,I0)|0,v=v+Math.imul(L0,W0)|0,T=T+Math.imul(C0,q0)|0,D=D+Math.imul(C0,x0)|0,D=D+Math.imul(K0,q0)|0,v=v+Math.imul(K0,x0)|0,T=T+Math.imul(s,P0)|0,D=D+Math.imul(s,S0)|0,D=D+Math.imul(Z0,P0)|0,v=v+Math.imul(Z0,S0)|0,T=T+Math.imul(c,c0)|0,D=D+Math.imul(c,y0)|0,D=D+Math.imul(o,c0)|0,v=v+Math.imul(o,y0)|0;var EU=(E+T|0)+((D&8191)<<13)|0;E=(v+(D>>>13)|0)+(EU>>>26)|0,EU&=67108863,T=Math.imul(D0,I0),D=Math.imul(D0,W0),D=D+Math.imul(H0,I0)|0,v=Math.imul(H0,W0),T=T+Math.imul(E0,q0)|0,D=D+Math.imul(E0,x0)|0,D=D+Math.imul(L0,q0)|0,v=v+Math.imul(L0,x0)|0,T=T+Math.imul(C0,P0)|0,D=D+Math.imul(C0,S0)|0,D=D+Math.imul(K0,P0)|0,v=v+Math.imul(K0,S0)|0,T=T+Math.imul(s,c0)|0,D=D+Math.imul(s,y0)|0,D=D+Math.imul(Z0,c0)|0,v=v+Math.imul(Z0,y0)|0;var IU=(E+T|0)+((D&8191)<<13)|0;E=(v+(D>>>13)|0)+(IU>>>26)|0,IU&=67108863,T=Math.imul(D0,q0),D=Math.imul(D0,x0),D=D+Math.imul(H0,q0)|0,v=Math.imul(H0,x0),T=T+Math.imul(E0,P0)|0,D=D+Math.imul(E0,S0)|0,D=D+Math.imul(L0,P0)|0,v=v+Math.imul(L0,S0)|0,T=T+Math.imul(C0,c0)|0,D=D+Math.imul(C0,y0)|0,D=D+Math.imul(K0,c0)|0,v=v+Math.imul(K0,y0)|0;var GZ=(E+T|0)+((D&8191)<<13)|0;E=(v+(D>>>13)|0)+(GZ>>>26)|0,GZ&=67108863,T=Math.imul(D0,P0),D=Math.imul(D0,S0),D=D+Math.imul(H0,P0)|0,v=Math.imul(H0,S0),T=T+Math.imul(E0,c0)|0,D=D+Math.imul(E0,y0)|0,D=D+Math.imul(L0,c0)|0,v=v+Math.imul(L0,y0)|0;var VZ=(E+T|0)+((D&8191)<<13)|0;E=(v+(D>>>13)|0)+(VZ>>>26)|0,VZ&=67108863,T=Math.imul(D0,c0),D=Math.imul(D0,y0),D=D+Math.imul(H0,c0)|0,v=Math.imul(H0,y0);var EZ=(E+T|0)+((D&8191)<<13)|0;if(E=(v+(D>>>13)|0)+(EZ>>>26)|0,EZ&=67108863,O[0]=d0,O[1]=l0,O[2]=i0,O[3]=UU,O[4]=OU,O[5]=ZU,O[6]=XU,O[7]=QU,O[8]=YU,O[9]=AU,O[10]=$U,O[11]=JU,O[12]=GU,O[13]=VU,O[14]=EU,O[15]=IU,O[16]=GZ,O[17]=VZ,O[18]=EZ,E!==0)O[19]=E,I.length++;return I};if(!Math.imul)x=j;function f(Z,Y,I){I.negative=Y.negative^Z.negative,I.length=Z.length+Y.length;var K=0,G=0;for(var O=0;O<I.length-1;O++){var E=G;G=0;var T=K&67108863,D=Math.min(O,Y.length-1);for(var v=Math.max(0,O-Z.length+1);v<=D;v++){var g=O-v,p=Z.words[g]|0,n=Y.words[v]|0,V0=p*n,r=V0&67108863;E=E+(V0/67108864|0)|0,r=r+T|0,T=r&67108863,E=E+(r>>>26)|0,G+=E>>>26,E&=67108863}I.words[O]=T,K=E,E=G}if(K!==0)I.words[O]=K;else I.length--;return I._strip()}function w(Z,Y,I){return f(Z,Y,I)}A.prototype.mulTo=function(Z,Y){var I,K=this.length+Z.length;if(this.length===10&&Z.length===10)I=x(this,Z,Y);else if(K<63)I=j(this,Z,Y);else if(K<1024)I=f(this,Z,Y);else I=w(this,Z,Y);return I};function d(Z,Y){this.x=Z,this.y=Y}d.prototype.makeRBT=function(Z){var Y=Array(Z),I=A.prototype._countBits(Z)-1;for(var K=0;K<Z;K++)Y[K]=this.revBin(K,I,Z);return Y},d.prototype.revBin=function(Z,Y,I){if(Z===0||Z===I-1)return Z;var K=0;for(var G=0;G<Y;G++)K|=(Z&1)<<Y-G-1,Z>>=1;return K},d.prototype.permute=function(Z,Y,I,K,G,O){for(var E=0;E<O;E++)K[E]=Y[Z[E]],G[E]=I[Z[E]]},d.prototype.transform=function(Z,Y,I,K,G,O){this.permute(O,Z,Y,I,K,G);for(var E=1;E<G;E<<=1){var T=E<<1,D=Math.cos(2*Math.PI/T),v=Math.sin(2*Math.PI/T);for(var g=0;g<G;g+=T){var p=D,n=v;for(var V0=0;V0<E;V0++){var r=I[g+V0],l=K[g+V0],X0=I[g+V0+E],m=K[g+V0+E],i=p*X0-n*m;if(m=p*m+n*X0,X0=i,I[g+V0]=r+X0,K[g+V0]=l+m,I[g+V0+E]=r-X0,K[g+V0+E]=l-m,V0!==T)i=D*p-v*n,n=D*n+v*p,p=i}}}},d.prototype.guessLen13b=function(Z,Y){var I=Math.max(Y,Z)|1,K=I&1,G=0;for(I=I/2|0;I;I=I>>>1)G++;return 1<<G+1+K},d.prototype.conjugate=function(Z,Y,I){if(I<=1)return;for(var K=0;K<I/2;K++){var G=Z[K];Z[K]=Z[I-K-1],Z[I-K-1]=G,G=Y[K],Y[K]=-Y[I-K-1],Y[I-K-1]=-G}},d.prototype.normalize13b=function(Z,Y){var I=0;for(var K=0;K<Y/2;K++){var G=Math.round(Z[2*K+1]/Y)*8192+Math.round(Z[2*K]/Y)+I;if(Z[K]=G&67108863,G<67108864)I=0;else I=G/67108864|0}return Z},d.prototype.convert13b=function(Z,Y,I,K){var G=0;for(var O=0;O<Y;O++)G=G+(Z[O]|0),I[2*O]=G&8191,G=G>>>13,I[2*O+1]=G&8191,G=G>>>13;for(O=2*Y;O<K;++O)I[O]=0;C(G===0),C((G&-8192)===0)},d.prototype.stub=function(Z){var Y=Array(Z);for(var I=0;I<Z;I++)Y[I]=0;return Y},d.prototype.mulp=function(Z,Y,I){var K=2*this.guessLen13b(Z.length,Y.length),G=this.makeRBT(K),O=this.stub(K),E=Array(K),T=Array(K),D=Array(K),v=Array(K),g=Array(K),p=Array(K),n=I.words;n.length=K,this.convert13b(Z.words,Z.length,E,K),this.convert13b(Y.words,Y.length,v,K),this.transform(E,O,T,D,K,G),this.transform(v,O,g,p,K,G);for(var V0=0;V0<K;V0++){var r=T[V0]*g[V0]-D[V0]*p[V0];D[V0]=T[V0]*p[V0]+D[V0]*g[V0],T[V0]=r}return this.conjugate(T,D,K),this.transform(T,D,n,O,K,G),this.conjugate(n,O,K),this.normalize13b(n,K),I.negative=Z.negative^Y.negative,I.length=Z.length+Y.length,I._strip()},A.prototype.mul=function(Z){var Y=new A(null);return Y.words=Array(this.length+Z.length),this.mulTo(Z,Y)},A.prototype.mulf=function(Z){var Y=new A(null);return Y.words=Array(this.length+Z.length),w(this,Z,Y)},A.prototype.imul=function(Z){return this.clone().mulTo(Z,this)},A.prototype.imuln=function(Z){var Y=Z<0;if(Y)Z=-Z;C(typeof Z==="number"),C(Z<67108864);var I=0;for(var K=0;K<this.length;K++){var G=(this.words[K]|0)*Z,O=(G&67108863)+(I&67108863);I>>=26,I+=G/67108864|0,I+=O>>>26,this.words[K]=O&67108863}if(I!==0)this.words[K]=I,this.length++;return this.length=Z===0?1:this.length,Y?this.ineg():this},A.prototype.muln=function(Z){return this.clone().imuln(Z)},A.prototype.sqr=function(){return this.mul(this)},A.prototype.isqr=function(){return this.imul(this.clone())},A.prototype.pow=function(Z){var Y=B(Z);if(Y.length===0)return new A(1);var I=this;for(var K=0;K<Y.length;K++,I=I.sqr())if(Y[K]!==0)break;if(++K<Y.length)for(var G=I.sqr();K<Y.length;K++,G=G.sqr()){if(Y[K]===0)continue;I=I.mul(G)}return I},A.prototype.iushln=function(Z){C(typeof Z==="number"&&Z>=0);var Y=Z%26,I=(Z-Y)/26,K=67108863>>>26-Y<<26-Y,G;if(Y!==0){var O=0;for(G=0;G<this.length;G++){var E=this.words[G]&K,T=(this.words[G]|0)-E<<Y;this.words[G]=T|O,O=E>>>26-Y}if(O)this.words[G]=O,this.length++}if(I!==0){for(G=this.length-1;G>=0;G--)this.words[G+I]=this.words[G];for(G=0;G<I;G++)this.words[G]=0;this.length+=I}return this._strip()},A.prototype.ishln=function(Z){return C(this.negative===0),this.iushln(Z)},A.prototype.iushrn=function(Z,Y,I){C(typeof Z==="number"&&Z>=0);var K;if(Y)K=(Y-Y%26)/26;else K=0;var G=Z%26,O=Math.min((Z-G)/26,this.length),E=67108863^67108863>>>G<<G,T=I;if(K-=O,K=Math.max(0,K),T){for(var D=0;D<O;D++)T.words[D]=this.words[D];T.length=O}if(O===0);else if(this.length>O){this.length-=O;for(D=0;D<this.length;D++)this.words[D]=this.words[D+O]}else this.words[0]=0,this.length=1;var v=0;for(D=this.length-1;D>=0&&(v!==0||D>=K);D--){var g=this.words[D]|0;this.words[D]=v<<26-G|g>>>G,v=g&E}if(T&&v!==0)T.words[T.length++]=v;if(this.length===0)this.words[0]=0,this.length=1;return this._strip()},A.prototype.ishrn=function(Z,Y,I){return C(this.negative===0),this.iushrn(Z,Y,I)},A.prototype.shln=function(Z){return this.clone().ishln(Z)},A.prototype.ushln=function(Z){return this.clone().iushln(Z)},A.prototype.shrn=function(Z){return this.clone().ishrn(Z)},A.prototype.ushrn=function(Z){return this.clone().iushrn(Z)},A.prototype.testn=function(Z){C(typeof Z==="number"&&Z>=0);var Y=Z%26,I=(Z-Y)/26,K=1<<Y;if(this.length<=I)return!1;var G=this.words[I];return!!(G&K)},A.prototype.imaskn=function(Z){C(typeof Z==="number"&&Z>=0);var Y=Z%26,I=(Z-Y)/26;if(C(this.negative===0,"imaskn works only with positive numbers"),this.length<=I)return this;if(Y!==0)I++;if(this.length=Math.min(I,this.length),Y!==0){var K=67108863^67108863>>>Y<<Y;this.words[this.length-1]&=K}return this._strip()},A.prototype.maskn=function(Z){return this.clone().imaskn(Z)},A.prototype.iaddn=function(Z){if(C(typeof Z==="number"),C(Z<67108864),Z<0)return this.isubn(-Z);if(this.negative!==0){if(this.length===1&&(this.words[0]|0)<=Z)return this.words[0]=Z-(this.words[0]|0),this.negative=0,this;return this.negative=0,this.isubn(Z),this.negative=1,this}return this._iaddn(Z)},A.prototype._iaddn=function(Z){this.words[0]+=Z;for(var Y=0;Y<this.length&&this.words[Y]>=67108864;Y++)if(this.words[Y]-=67108864,Y===this.length-1)this.words[Y+1]=1;else this.words[Y+1]++;return this.length=Math.max(this.length,Y+1),this},A.prototype.isubn=function(Z){if(C(typeof Z==="number"),C(Z<67108864),Z<0)return this.iaddn(-Z);if(this.negative!==0)return this.negative=0,this.iaddn(Z),this.negative=1,this;if(this.words[0]-=Z,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var Y=0;Y<this.length&&this.words[Y]<0;Y++)this.words[Y]+=67108864,this.words[Y+1]-=1;return this._strip()},A.prototype.addn=function(Z){return this.clone().iaddn(Z)},A.prototype.subn=function(Z){return this.clone().isubn(Z)},A.prototype.iabs=function(){return this.negative=0,this},A.prototype.abs=function(){return this.clone().iabs()},A.prototype._ishlnsubmul=function(Z,Y,I){var K=Z.length+I,G;this._expand(K);var O,E=0;for(G=0;G<Z.length;G++){O=(this.words[G+I]|0)+E;var T=(Z.words[G]|0)*Y;O-=T&67108863,E=(O>>26)-(T/67108864|0),this.words[G+I]=O&67108863}for(;G<this.length-I;G++)O=(this.words[G+I]|0)+E,E=O>>26,this.words[G+I]=O&67108863;if(E===0)return this._strip();C(E===-1),E=0;for(G=0;G<this.length;G++)O=-(this.words[G]|0)+E,E=O>>26,this.words[G]=O&67108863;return this.negative=1,this._strip()},A.prototype._wordDiv=function(Z,Y){var I=this.length-Z.length,K=this.clone(),G=Z,O=G.words[G.length-1]|0,E=this._countBits(O);if(I=26-E,I!==0)G=G.ushln(I),K.iushln(I),O=G.words[G.length-1]|0;var T=K.length-G.length,D;if(Y!=="mod"){D=new A(null),D.length=T+1,D.words=Array(D.length);for(var v=0;v<D.length;v++)D.words[v]=0}var g=K.clone()._ishlnsubmul(G,1,T);if(g.negative===0){if(K=g,D)D.words[T]=1}for(var p=T-1;p>=0;p--){var n=(K.words[G.length+p]|0)*67108864+(K.words[G.length+p-1]|0);n=Math.min(n/O|0,67108863),K._ishlnsubmul(G,n,p);while(K.negative!==0)if(n--,K.negative=0,K._ishlnsubmul(G,1,p),!K.isZero())K.negative^=1;if(D)D.words[p]=n}if(D)D._strip();if(K._strip(),Y!=="div"&&I!==0)K.iushrn(I);return{div:D||null,mod:K}},A.prototype.divmod=function(Z,Y,I){if(C(!Z.isZero()),this.isZero())return{div:new A(0),mod:new A(0)};var K,G,O;if(this.negative!==0&&Z.negative===0){if(O=this.neg().divmod(Z,Y),Y!=="mod")K=O.div.neg();if(Y!=="div"){if(G=O.mod.neg(),I&&G.negative!==0)G.iadd(Z)}return{div:K,mod:G}}if(this.negative===0&&Z.negative!==0){if(O=this.divmod(Z.neg(),Y),Y!=="mod")K=O.div.neg();return{div:K,mod:O.mod}}if((this.negative&Z.negative)!==0){if(O=this.neg().divmod(Z.neg(),Y),Y!=="div"){if(G=O.mod.neg(),I&&G.negative!==0)G.isub(Z)}return{div:O.div,mod:G}}if(Z.length>this.length||this.cmp(Z)<0)return{div:new A(0),mod:this};if(Z.length===1){if(Y==="div")return{div:this.divn(Z.words[0]),mod:null};if(Y==="mod")return{div:null,mod:new A(this.modrn(Z.words[0]))};return{div:this.divn(Z.words[0]),mod:new A(this.modrn(Z.words[0]))}}return this._wordDiv(Z,Y)},A.prototype.div=function(Z){return this.divmod(Z,"div",!1).div},A.prototype.mod=function(Z){return this.divmod(Z,"mod",!1).mod},A.prototype.umod=function(Z){return this.divmod(Z,"mod",!0).mod},A.prototype.divRound=function(Z){var Y=this.divmod(Z);if(Y.mod.isZero())return Y.div;var I=Y.div.negative!==0?Y.mod.isub(Z):Y.mod,K=Z.ushrn(1),G=Z.andln(1),O=I.cmp(K);if(O<0||G===1&&O===0)return Y.div;return Y.div.negative!==0?Y.div.isubn(1):Y.div.iaddn(1)},A.prototype.modrn=function(Z){var Y=Z<0;if(Y)Z=-Z;C(Z<=67108863);var I=67108864%Z,K=0;for(var G=this.length-1;G>=0;G--)K=(I*K+(this.words[G]|0))%Z;return Y?-K:K},A.prototype.modn=function(Z){return this.modrn(Z)},A.prototype.idivn=function(Z){var Y=Z<0;if(Y)Z=-Z;C(Z<=67108863);var I=0;for(var K=this.length-1;K>=0;K--){var G=(this.words[K]|0)+I*67108864;this.words[K]=G/Z|0,I=G%Z}return this._strip(),Y?this.ineg():this},A.prototype.divn=function(Z){return this.clone().idivn(Z)},A.prototype.egcd=function(Z){C(Z.negative===0),C(!Z.isZero());var Y=this,I=Z.clone();if(Y.negative!==0)Y=Y.umod(Z);else Y=Y.clone();var K=new A(1),G=new A(0),O=new A(0),E=new A(1),T=0;while(Y.isEven()&&I.isEven())Y.iushrn(1),I.iushrn(1),++T;var D=I.clone(),v=Y.clone();while(!Y.isZero()){for(var g=0,p=1;(Y.words[0]&p)===0&&g<26;++g,p<<=1);if(g>0){Y.iushrn(g);while(g-- >0){if(K.isOdd()||G.isOdd())K.iadd(D),G.isub(v);K.iushrn(1),G.iushrn(1)}}for(var n=0,V0=1;(I.words[0]&V0)===0&&n<26;++n,V0<<=1);if(n>0){I.iushrn(n);while(n-- >0){if(O.isOdd()||E.isOdd())O.iadd(D),E.isub(v);O.iushrn(1),E.iushrn(1)}}if(Y.cmp(I)>=0)Y.isub(I),K.isub(O),G.isub(E);else I.isub(Y),O.isub(K),E.isub(G)}return{a:O,b:E,gcd:I.iushln(T)}},A.prototype._invmp=function(Z){C(Z.negative===0),C(!Z.isZero());var Y=this,I=Z.clone();if(Y.negative!==0)Y=Y.umod(Z);else Y=Y.clone();var K=new A(1),G=new A(0),O=I.clone();while(Y.cmpn(1)>0&&I.cmpn(1)>0){for(var E=0,T=1;(Y.words[0]&T)===0&&E<26;++E,T<<=1);if(E>0){Y.iushrn(E);while(E-- >0){if(K.isOdd())K.iadd(O);K.iushrn(1)}}for(var D=0,v=1;(I.words[0]&v)===0&&D<26;++D,v<<=1);if(D>0){I.iushrn(D);while(D-- >0){if(G.isOdd())G.iadd(O);G.iushrn(1)}}if(Y.cmp(I)>=0)Y.isub(I),K.isub(G);else I.isub(Y),G.isub(K)}var g;if(Y.cmpn(1)===0)g=K;else g=G;if(g.cmpn(0)<0)g.iadd(Z);return g},A.prototype.gcd=function(Z){if(this.isZero())return Z.abs();if(Z.isZero())return this.abs();var Y=this.clone(),I=Z.clone();Y.negative=0,I.negative=0;for(var K=0;Y.isEven()&&I.isEven();K++)Y.iushrn(1),I.iushrn(1);do{while(Y.isEven())Y.iushrn(1);while(I.isEven())I.iushrn(1);var G=Y.cmp(I);if(G<0){var O=Y;Y=I,I=O}else if(G===0||I.cmpn(1)===0)break;Y.isub(I)}while(!0);return I.iushln(K)},A.prototype.invm=function(Z){return this.egcd(Z).a.umod(Z)},A.prototype.isEven=function(){return(this.words[0]&1)===0},A.prototype.isOdd=function(){return(this.words[0]&1)===1},A.prototype.andln=function(Z){return this.words[0]&Z},A.prototype.bincn=function(Z){C(typeof Z==="number");var Y=Z%26,I=(Z-Y)/26,K=1<<Y;if(this.length<=I)return this._expand(I+1),this.words[I]|=K,this;var G=K;for(var O=I;G!==0&&O<this.length;O++){var E=this.words[O]|0;E+=G,G=E>>>26,E&=67108863,this.words[O]=E}if(G!==0)this.words[O]=G,this.length++;return this},A.prototype.isZero=function(){return this.length===1&&this.words[0]===0},A.prototype.cmpn=function(Z){var Y=Z<0;if(this.negative!==0&&!Y)return-1;if(this.negative===0&&Y)return 1;this._strip();var I;if(this.length>1)I=1;else{if(Y)Z=-Z;C(Z<=67108863,"Number is too big");var K=this.words[0]|0;I=K===Z?0:K<Z?-1:1}if(this.negative!==0)return-I|0;return I},A.prototype.cmp=function(Z){if(this.negative!==0&&Z.negative===0)return-1;if(this.negative===0&&Z.negative!==0)return 1;var Y=this.ucmp(Z);if(this.negative!==0)return-Y|0;return Y},A.prototype.ucmp=function(Z){if(this.length>Z.length)return 1;if(this.length<Z.length)return-1;var Y=0;for(var I=this.length-1;I>=0;I--){var K=this.words[I]|0,G=Z.words[I]|0;if(K===G)continue;if(K<G)Y=-1;else if(K>G)Y=1;break}return Y},A.prototype.gtn=function(Z){return this.cmpn(Z)===1},A.prototype.gt=function(Z){return this.cmp(Z)===1},A.prototype.gten=function(Z){return this.cmpn(Z)>=0},A.prototype.gte=function(Z){return this.cmp(Z)>=0},A.prototype.ltn=function(Z){return this.cmpn(Z)===-1},A.prototype.lt=function(Z){return this.cmp(Z)===-1},A.prototype.lten=function(Z){return this.cmpn(Z)<=0},A.prototype.lte=function(Z){return this.cmp(Z)<=0},A.prototype.eqn=function(Z){return this.cmpn(Z)===0},A.prototype.eq=function(Z){return this.cmp(Z)===0},A.red=function(Z){return new X(Z)},A.prototype.toRed=function(Z){return C(!this.red,"Already a number in reduction context"),C(this.negative===0,"red works only with positives"),Z.convertTo(this)._forceRed(Z)},A.prototype.fromRed=function(){return C(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},A.prototype._forceRed=function(Z){return this.red=Z,this},A.prototype.forceRed=function(Z){return C(!this.red,"Already a number in reduction context"),this._forceRed(Z)},A.prototype.redAdd=function(Z){return C(this.red,"redAdd works only with red numbers"),this.red.add(this,Z)},A.prototype.redIAdd=function(Z){return C(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,Z)},A.prototype.redSub=function(Z){return C(this.red,"redSub works only with red numbers"),this.red.sub(this,Z)},A.prototype.redISub=function(Z){return C(this.red,"redISub works only with red numbers"),this.red.isub(this,Z)},A.prototype.redShl=function(Z){return C(this.red,"redShl works only with red numbers"),this.red.shl(this,Z)},A.prototype.redMul=function(Z){return C(this.red,"redMul works only with red numbers"),this.red._verify2(this,Z),this.red.mul(this,Z)},A.prototype.redIMul=function(Z){return C(this.red,"redMul works only with red numbers"),this.red._verify2(this,Z),this.red.imul(this,Z)},A.prototype.redSqr=function(){return C(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},A.prototype.redISqr=function(){return C(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},A.prototype.redSqrt=function(){return C(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},A.prototype.redInvm=function(){return C(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},A.prototype.redNeg=function(){return C(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},A.prototype.redPow=function(Z){return C(this.red&&!Z.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,Z)};var Y0={k256:null,p224:null,p192:null,p25519:null};function J0(Z,Y){this.name=Z,this.p=new A(Y,16),this.n=this.p.bitLength(),this.k=new A(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}J0.prototype._tmp=function(){var Z=new A(null);return Z.words=Array(Math.ceil(this.n/13)),Z},J0.prototype.ireduce=function(Z){var Y=Z,I;do this.split(Y,this.tmp),Y=this.imulK(Y),Y=Y.iadd(this.tmp),I=Y.bitLength();while(I>this.n);var K=I<this.n?-1:Y.ucmp(this.p);if(K===0)Y.words[0]=0,Y.length=1;else if(K>0)Y.isub(this.p);else if(Y.strip!==void 0)Y.strip();else Y._strip();return Y},J0.prototype.split=function(Z,Y){Z.iushrn(this.n,0,Y)},J0.prototype.imulK=function(Z){return Z.imul(this.k)};function A0(){J0.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}F(A0,J0),A0.prototype.split=function(Z,Y){var I=4194303,K=Math.min(Z.length,9);for(var G=0;G<K;G++)Y.words[G]=Z.words[G];if(Y.length=K,Z.length<=9){Z.words[0]=0,Z.length=1;return}var O=Z.words[9];Y.words[Y.length++]=O&I;for(G=10;G<Z.length;G++){var E=Z.words[G]|0;Z.words[G-10]=(E&I)<<4|O>>>22,O=E}if(O>>>=22,Z.words[G-10]=O,O===0&&Z.length>10)Z.length-=10;else Z.length-=9},A0.prototype.imulK=function(Z){Z.words[Z.length]=0,Z.words[Z.length+1]=0,Z.length+=2;var Y=0;for(var I=0;I<Z.length;I++){var K=Z.words[I]|0;Y+=K*977,Z.words[I]=Y&67108863,Y=K*64+(Y/67108864|0)}if(Z.words[Z.length-1]===0){if(Z.length--,Z.words[Z.length-1]===0)Z.length--}return Z};function u(){J0.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}F(u,J0);function O0(){J0.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}F(O0,J0);function U(){J0.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}F(U,J0),U.prototype.imulK=function(Z){var Y=0;for(var I=0;I<Z.length;I++){var K=(Z.words[I]|0)*19+Y,G=K&67108863;K>>>=26,Z.words[I]=G,Y=K}if(Y!==0)Z.words[Z.length++]=Y;return Z},A._prime=function(Z){if(Y0[Z])return Y0[Z];var Y;if(Z==="k256")Y=new A0;else if(Z==="p224")Y=new u;else if(Z==="p192")Y=new O0;else if(Z==="p25519")Y=new U;else throw Error("Unknown prime "+Z);return Y0[Z]=Y,Y};function X(Z){if(typeof Z==="string"){var Y=A._prime(Z);this.m=Y.p,this.prime=Y}else C(Z.gtn(1),"modulus must be greater than 1"),this.m=Z,this.prime=null}X.prototype._verify1=function(Z){C(Z.negative===0,"red works only with positives"),C(Z.red,"red works only with red numbers")},X.prototype._verify2=function(Z,Y){C((Z.negative|Y.negative)===0,"red works only with positives"),C(Z.red&&Z.red===Y.red,"red works only with red numbers")},X.prototype.imod=function(Z){if(this.prime)return this.prime.ireduce(Z)._forceRed(this);return L(Z,Z.umod(this.m)._forceRed(this)),Z},X.prototype.neg=function(Z){if(Z.isZero())return Z.clone();return this.m.sub(Z)._forceRed(this)},X.prototype.add=function(Z,Y){this._verify2(Z,Y);var I=Z.add(Y);if(I.cmp(this.m)>=0)I.isub(this.m);return I._forceRed(this)},X.prototype.iadd=function(Z,Y){this._verify2(Z,Y);var I=Z.iadd(Y);if(I.cmp(this.m)>=0)I.isub(this.m);return I},X.prototype.sub=function(Z,Y){this._verify2(Z,Y);var I=Z.sub(Y);if(I.cmpn(0)<0)I.iadd(this.m);return I._forceRed(this)},X.prototype.isub=function(Z,Y){this._verify2(Z,Y);var I=Z.isub(Y);if(I.cmpn(0)<0)I.iadd(this.m);return I},X.prototype.shl=function(Z,Y){return this._verify1(Z),this.imod(Z.ushln(Y))},X.prototype.imul=function(Z,Y){return this._verify2(Z,Y),this.imod(Z.imul(Y))},X.prototype.mul=function(Z,Y){return this._verify2(Z,Y),this.imod(Z.mul(Y))},X.prototype.isqr=function(Z){return this.imul(Z,Z.clone())},X.prototype.sqr=function(Z){return this.mul(Z,Z)},X.prototype.sqrt=function(Z){if(Z.isZero())return Z.clone();var Y=this.m.andln(3);if(C(Y%2===1),Y===3){var I=this.m.add(new A(1)).iushrn(2);return this.pow(Z,I)}var K=this.m.subn(1),G=0;while(!K.isZero()&&K.andln(1)===0)G++,K.iushrn(1);C(!K.isZero());var O=new A(1).toRed(this),E=O.redNeg(),T=this.m.subn(1).iushrn(1),D=this.m.bitLength();D=new A(2*D*D).toRed(this);while(this.pow(D,T).cmp(E)!==0)D.redIAdd(E);var v=this.pow(D,K),g=this.pow(Z,K.addn(1).iushrn(1)),p=this.pow(Z,K),n=G;while(p.cmp(O)!==0){var V0=p;for(var r=0;V0.cmp(O)!==0;r++)V0=V0.redSqr();C(r<n);var l=this.pow(v,new A(1).iushln(n-r-1));g=g.redMul(l),v=l.redSqr(),p=p.redMul(v),n=r}return g},X.prototype.invm=function(Z){var Y=Z._invmp(this.m);if(Y.negative!==0)return Y.negative=0,this.imod(Y).redNeg();else return this.imod(Y)},X.prototype.pow=function(Z,Y){if(Y.isZero())return new A(1).toRed(this);if(Y.cmpn(1)===0)return Z.clone();var I=4,K=Array(1<<I);K[0]=new A(1).toRed(this),K[1]=Z;for(var G=2;G<K.length;G++)K[G]=this.mul(K[G-1],Z);var O=K[0],E=0,T=0,D=Y.bitLength()%26;if(D===0)D=26;for(G=Y.length-1;G>=0;G--){var v=Y.words[G];for(var g=D-1;g>=0;g--){var p=v>>g&1;if(O!==K[0])O=this.sqr(O);if(p===0&&E===0){T=0;continue}if(E<<=1,E|=p,T++,T!==I&&(G!==0||g!==0))continue;O=this.mul(O,K[E]),T=0,E=0}D=26}return O},X.prototype.convertTo=function(Z){var Y=Z.umod(this.m);return Y===Z?Y.clone():Y},X.prototype.convertFrom=function(Z){var Y=Z.clone();return Y.red=null,Y},A.mont=function(Z){return new J(Z)};function J(Z){if(X.call(this,Z),this.shift=this.m.bitLength(),this.shift%26!==0)this.shift+=26-this.shift%26;this.r=new A(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}F(J,X),J.prototype.convertTo=function(Z){return this.imod(Z.ushln(this.shift))},J.prototype.convertFrom=function(Z){var Y=this.imod(Z.mul(this.rinv));return Y.red=null,Y},J.prototype.imul=function(Z,Y){if(Z.isZero()||Y.isZero())return Z.words[0]=0,Z.length=1,Z;var I=Z.imul(Y),K=I.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),G=I.isub(K).iushrn(this.shift),O=G;if(G.cmp(this.m)>=0)O=G.isub(this.m);else if(G.cmpn(0)<0)O=G.iadd(this.m);return O._forceRed(this)},J.prototype.mul=function(Z,Y){if(Z.isZero()||Y.isZero())return new A(0)._forceRed(this);var I=Z.mul(Y),K=I.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),G=I.isub(K).iushrn(this.shift),O=G;if(G.cmp(this.m)>=0)O=G.isub(this.m);else if(G.cmpn(0)<0)O=G.iadd(this.m);return O._forceRed(this)},J.prototype.invm=function(Z){var Y=this.imod(Z._invmp(this.m).mul(this.r2));return Y._forceRed(this)}})(typeof $>"u"||$,Q)}),RY=$0((Q,$)=>{var V=LG(),W=UZ(),C=MU().Buffer;function F(M){var S=M.modulus.byteLength(),R;do R=new V(W(S));while(R.cmp(M.modulus)>=0||!R.umod(M.prime1)||!R.umod(M.prime2));return R}function A(M){var S=F(M),R=S.toRed(V.mont(M.modulus)).redPow(new V(M.publicExponent)).fromRed();return{blinder:R,unblinder:S.invm(M.modulus)}}function z(M,S){var R=A(S),L=S.modulus.byteLength(),H=new V(M).mul(R.blinder).umod(S.modulus),q=H.toRed(V.mont(S.prime1)),P=H.toRed(V.mont(S.prime2)),_=S.coefficient,k=S.prime1,B=S.prime2,j=q.redPow(S.exponent1).fromRed(),x=P.redPow(S.exponent2).fromRed(),f=j.isub(x).imul(_).umod(k).imul(B);return x.iadd(f).imul(R.unblinder).umod(S.modulus).toArrayLike(C,"be",L)}z.getr=F,$.exports=z}),WG=$0((Q,$)=>{var V=HY(),W=UZ(),C=OZ(),F=DY(),A=SY(),z=GX(),M=FY(),S=RY(),R=MU().Buffer;$.exports=function(P,_,k){var B;if(P.padding)B=P.padding;else if(k)B=1;else B=4;var j=V(P),x;if(B===4)x=L(j,_);else if(B===1)x=H(j,_,k);else if(B===3){if(x=new z(_),x.cmp(j.modulus)>=0)throw Error("data too long for modulus")}else throw Error("unknown padding");if(k)return S(x,j);else return M(x,j)};function L(P,_){var k=P.modulus.byteLength(),B=_.length,j=C("sha1").update(R.alloc(0)).digest(),x=j.length,f=2*x;if(B>k-f-2)throw Error("message too long");var w=R.alloc(k-B-f-2),d=k-x-1,Y0=W(x),J0=A(R.concat([j,w,R.alloc(1,1),_],d),F(Y0,d)),A0=A(Y0,F(J0,x));return new z(R.concat([R.alloc(1),A0,J0],k))}function H(P,_,k){var B=_.length,j=P.modulus.byteLength();if(B>j-11)throw Error("message too long");var x;if(k)x=R.alloc(j-B-3,255);else x=q(j-B-3);return new z(R.concat([R.from([0,k?1:2]),x,R.alloc(1),_],j))}function q(P){var _=R.allocUnsafe(P),k=0,B=W(P*2),j=0,x;while(k<P){if(j===B.length)B=W(P*2),j=0;if(x=B[j++],x)_[k++]=x}return _}}),HG=$0((Q,$)=>{var V=HY(),W=DY(),C=SY(),F=GX(),A=RY(),z=OZ(),M=FY(),S=MU().Buffer;$.exports=function(q,P,_){var k;if(q.padding)k=q.padding;else if(_)k=1;else k=4;var B=V(q),j=B.modulus.byteLength();if(P.length>j||new F(P).cmp(B.modulus)>=0)throw Error("decryption error");var x;if(_)x=M(new F(P),B);else x=A(P,B);var f=S.alloc(j-x.length);if(x=S.concat([f,x],j),k===4)return R(B,x);else if(k===1)return L(B,x,_);else if(k===3)return x;else throw Error("unknown padding")};function R(q,P){var _=q.modulus.byteLength(),k=z("sha1").update(S.alloc(0)).digest(),B=k.length;if(P[0]!==0)throw Error("decryption error");var j=P.slice(1,B+1),x=P.slice(B+1),f=C(j,W(x,B)),w=C(x,W(f,_-B-1));if(H(k,w.slice(0,B)))throw Error("decryption error");var d=B;while(w[d]===0)d++;if(w[d++]!==1)throw Error("decryption error");return w.slice(d)}function L(q,P,_){var k=P.slice(0,2),B=2,j=0;while(P[B++]!==0)if(B>=P.length){j++;break}var x=P.slice(2,B-1);if(k.toString("hex")!=="0002"&&!_||k.toString("hex")!=="0001"&&_)j++;if(x.length<8)j++;if(j)throw Error("decryption error");return P.slice(B)}function H(q,P){q=S.from(q),P=S.from(P);var _=0,k=q.length;if(q.length!==P.length)_++,k=Math.min(q.length,P.length);var B=-1;while(++B<k)_+=q[B]^P[B];return _}}),UX=$0((Q)=>{Q.publicEncrypt=WG(),Q.privateDecrypt=HG(),Q.privateEncrypt=function($,V){return Q.publicEncrypt($,V,!0)},Q.publicDecrypt=function($,V){return Q.privateDecrypt($,V,!0)}}),DG=$0((Q)=>{var $=(jU(),h0(vU));if(typeof $.publicEncrypt!=="function")$=UX();if(Q.publicEncrypt=$.publicEncrypt,Q.privateDecrypt=$.privateDecrypt,typeof $.privateEncrypt!=="function")Q.privateEncrypt=UX().privateEncrypt;else Q.privateEncrypt=$.privateEncrypt;if(typeof $.publicDecrypt!=="function")Q.publicDecrypt=UX().publicDecrypt;else Q.publicDecrypt=$.publicDecrypt}),SG=$0((Q)=>{var $=MU(),V=UZ(),W=$.Buffer,C=$.kMaxLength,F=globalThis.crypto||globalThis.msCrypto,A=Math.pow(2,32)-1;function z(H,q){if(typeof H!=="number"||H!==H)throw TypeError("offset must be a number");if(H>A||H<0)throw TypeError("offset must be a uint32");if(H>C||H>q)throw RangeError("offset out of range")}function M(H,q,P){if(typeof H!=="number"||H!==H)throw TypeError("size must be a number");if(H>A||H<0)throw TypeError("size must be a uint32");if(H+q>P||H>C)throw RangeError("buffer too small")}F&&F.getRandomValues,Q.randomFill=S,Q.randomFillSync=L;function S(H,q,P,_){if(!W.isBuffer(H)&&!(H instanceof globalThis.Uint8Array))throw TypeError('"buf" argument must be a Buffer or Uint8Array');if(typeof q==="function")_=q,q=0,P=H.length;else if(typeof P==="function")_=P,P=H.length-q;else if(typeof _!=="function")throw TypeError('"cb" argument must be a function');return z(q,H.length),M(P,q,H.length),R(H,q,P,_)}function R(H,q,P,_){if(!1)var k,B;if(_){V(P,function(x,f){if(x)return _(x);f.copy(H,q),_(null,H)});return}var j=V(P);return j.copy(H,q),H}function L(H,q,P){if(typeof q>"u")q=0;if(!W.isBuffer(H)&&!(H instanceof globalThis.Uint8Array))throw TypeError('"buf" argument must be a Buffer or Uint8Array');if(z(q,H.length),P===void 0)P=H.length-q;return M(P,q,H.length),R(H,q,P)}}),FG=$0((Q,$)=>{var V=(jU(),h0(vU));if(typeof V.randomFill==="function"&&typeof V.randomFillSync==="function")Q.randomFill=V.randomFill,Q.randomFillSync=V.randomFillSync;else $.exports=SG()}),RG=$0((Q)=>{Q.randomBytes=Q.rng=Q.pseudoRandomBytes=Q.prng=UZ(),Q.createHash=Q.Hash=OZ(),Q.createHmac=Q.Hmac=tQ();var $=o$(),V=Object.keys($),W=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(V);Q.getHashes=function(){return W};var C=AY();Q.pbkdf2=C.pbkdf2,Q.pbkdf2Sync=C.pbkdf2Sync;var F=kJ();Q.Cipher=F.Cipher,Q.createCipher=F.createCipher,Q.Cipheriv=F.Cipheriv,Q.createCipheriv=F.createCipheriv,Q.Decipher=F.Decipher,Q.createDecipher=F.createDecipher,Q.Decipheriv=F.Decipheriv,Q.createDecipheriv=F.createDecipheriv,Q.getCiphers=F.getCiphers,Q.listCiphers=F.listCiphers;var A=_J();Q.DiffieHellmanGroup=A.DiffieHellmanGroup,Q.createDiffieHellmanGroup=A.createDiffieHellmanGroup,Q.getDiffieHellman=A.getDiffieHellman,Q.createDiffieHellman=A.createDiffieHellman,Q.DiffieHellman=A.DiffieHellman;var z=vJ();Q.createSign=z.createSign,Q.Sign=z.Sign,Q.createVerify=z.createVerify,Q.Verify=z.Verify,Q.createECDH=eJ();var M=DG();Q.publicEncrypt=M.publicEncrypt,Q.privateEncrypt=M.privateEncrypt,Q.publicDecrypt=M.publicDecrypt,Q.privateDecrypt=M.privateDecrypt;var S=FG();Q.randomFill=S.randomFill,Q.randomFillSync=S.randomFillSync,Q.createCredentials=function(){throw Error(`sorry, createCredentials is not implemented yet
|
|
14
|
+
})`)}catch(T){Q=function(M){this._initNamed(M)}}return E(Q,K),Q.prototype._initNamed=function(T){K.call(this,T)},new Q(this)},S.prototype._getDecoder=function(K){if(K=K||"der",!this.decoders.hasOwnProperty(K))this.decoders[K]=this._createNamed(I.decoders[K]);return this.decoders[K]},S.prototype.decode=function(K,Q,T){return this._getDecoder(Q).decode(K,T)},S.prototype._getEncoder=function(K){if(K=K||"der",!this.encoders.hasOwnProperty(K))this.encoders[K]=this._createNamed(I.encoders[K]);return this.encoders[K]},S.prototype.encode=function(K,Q,T){return this._getEncoder(Q).encode(K,T)}}),eG=Q0(($)=>{var I=gU();function E(S){this._reporterState={obj:null,path:[],options:S||{},errors:[]}}$.Reporter=E,E.prototype.isError=function(S){return S instanceof L},E.prototype.save=function(){var S=this._reporterState;return{obj:S.obj,pathLen:S.path.length}},E.prototype.restore=function(S){var K=this._reporterState;K.obj=S.obj,K.path=K.path.slice(0,S.pathLen)},E.prototype.enterKey=function(S){return this._reporterState.path.push(S)},E.prototype.exitKey=function(S){var K=this._reporterState;K.path=K.path.slice(0,S-1)},E.prototype.leaveKey=function(S,K,Q){var T=this._reporterState;if(this.exitKey(S),T.obj!==null)T.obj[K]=Q},E.prototype.path=function(){return this._reporterState.path.join("/")},E.prototype.enterObject=function(){var S=this._reporterState,K=S.obj;return S.obj={},K},E.prototype.leaveObject=function(S){var K=this._reporterState,Q=K.obj;return K.obj=S,Q},E.prototype.error=function(S){var K,Q=this._reporterState,T=S instanceof L;if(T)K=S;else K=new L(Q.path.map(function(M){return"["+JSON.stringify(M)+"]"}).join(""),S.message||S,S.stack);if(!Q.options.partial)throw K;if(!T)Q.errors.push(K);return K},E.prototype.wrapResult=function(S){var K=this._reporterState;if(!K.options.partial)return S;return{result:this.isError(S)?null:S,errors:K.errors}};function L(S,K){this.path=S,this.rethrow(K)}I(L,Error),L.prototype.rethrow=function(S){if(this.message=S+" at: "+(this.path||"(shallow)"),Error.captureStackTrace)Error.captureStackTrace(this,L);if(!this.stack)try{throw Error(this.message)}catch(K){this.stack=K.stack}return this}}),BI=Q0(($)=>{var I=gU(),E=cO().Reporter,L=(DU(),l0(RU)).Buffer;function S(Q,T){if(E.call(this,T),!L.isBuffer(Q)){this.error("Input not Buffer");return}this.base=Q,this.offset=0,this.length=Q.length}I(S,E),$.DecoderBuffer=S,S.prototype.save=function(){return{offset:this.offset,reporter:E.prototype.save.call(this)}},S.prototype.restore=function(Q){var T=new S(this.base);return T.offset=Q.offset,T.length=this.offset,this.offset=Q.offset,E.prototype.restore.call(this,Q.reporter),T},S.prototype.isEmpty=function(){return this.offset===this.length},S.prototype.readUInt8=function(Q){if(this.offset+1<=this.length)return this.base.readUInt8(this.offset++,!0);else return this.error(Q||"DecoderBuffer overrun")},S.prototype.skip=function(Q,T){if(!(this.offset+Q<=this.length))return this.error(T||"DecoderBuffer overrun");var M=new S(this.base);return M._reporterState=this._reporterState,M.offset=this.offset,M.length=this.offset+Q,this.offset+=Q,M},S.prototype.raw=function(Q){return this.base.slice(Q?Q.offset:this.offset,this.length)};function K(Q,T){if(Array.isArray(Q))this.length=0,this.value=Q.map(function(M){if(!(M instanceof K))M=new K(M,T);return this.length+=M.length,M},this);else if(typeof Q==="number"){if(!(0<=Q&&Q<=255))return T.error("non-byte EncoderBuffer value");this.value=Q,this.length=1}else if(typeof Q==="string")this.value=Q,this.length=L.byteLength(Q);else if(L.isBuffer(Q))this.value=Q,this.length=Q.length;else return T.error("Unsupported type: "+typeof Q)}$.EncoderBuffer=K,K.prototype.join=function(Q,T){if(!Q)Q=new L(this.length);if(!T)T=0;if(this.length===0)return Q;if(Array.isArray(this.value))this.value.forEach(function(M){M.join(Q,T),T+=M.length});else{if(typeof this.value==="number")Q[T]=this.value;else if(typeof this.value==="string")Q.write(this.value,T);else if(L.isBuffer(this.value))this.value.copy(Q,T);T+=this.length}return Q}}),aG=Q0(($,I)=>{var E=cO().Reporter,L=cO().EncoderBuffer,S=cO().DecoderBuffer,K=UO(),Q=["seq","seqof","set","setof","objid","bool","gentime","utctime","null_","enum","int","objDesc","bitstr","bmpstr","charstr","genstr","graphstr","ia5str","iso646str","numstr","octstr","printstr","t61str","unistr","utf8str","videostr"],T=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(Q),M=["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"];function H(R,D){var q={};if(this._baseState=q,q.enc=R,q.parent=D||null,q.children=null,q.tag=null,q.args=null,q.reverseArgs=null,q.choice=null,q.optional=!1,q.any=!1,q.obj=!1,q.use=null,q.useDecoder=null,q.key=null,q.default=null,q.explicit=null,q.implicit=null,q.contains=null,!q.parent)q.children=[],this._wrap()}I.exports=H;var F=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];H.prototype.clone=function(){var R=this._baseState,D={};F.forEach(function(P){D[P]=R[P]});var q=new this.constructor(D.parent);return q._baseState=D,q},H.prototype._wrap=function(){var R=this._baseState;T.forEach(function(D){this[D]=function(){var q=new this.constructor(this);return R.children.push(q),q[D].apply(q,arguments)}},this)},H.prototype._init=function(R){var D=this._baseState;K(D.parent===null),R.call(this),D.children=D.children.filter(function(q){return q._baseState.parent===this},this),K.equal(D.children.length,1,"Root node can have only one child")},H.prototype._useArgs=function(R){var D=this._baseState,q=R.filter(function(P){return P instanceof this.constructor},this);if(R=R.filter(function(P){return!(P instanceof this.constructor)},this),q.length!==0)K(D.children===null),D.children=q,q.forEach(function(P){P._baseState.parent=this},this);if(R.length!==0)K(D.args===null),D.args=R,D.reverseArgs=R.map(function(P){if(typeof P!=="object"||P.constructor!==Object)return P;var _={};return Object.keys(P).forEach(function(k){if(k==(k|0))k|=0;var B=P[k];_[B]=k}),_})},M.forEach(function(R){H.prototype[R]=function(){var D=this._baseState;throw Error(R+" not implemented for encoding: "+D.enc)}}),Q.forEach(function(R){H.prototype[R]=function(){var D=this._baseState,q=Array.prototype.slice.call(arguments);return K(D.tag===null),D.tag=R,this._useArgs(q),this}}),H.prototype.use=function(R){K(R);var D=this._baseState;return K(D.use===null),D.use=R,this},H.prototype.optional=function(){var R=this._baseState;return R.optional=!0,this},H.prototype.def=function(R){var D=this._baseState;return K(D.default===null),D.default=R,D.optional=!0,this},H.prototype.explicit=function(R){var D=this._baseState;return K(D.explicit===null&&D.implicit===null),D.explicit=R,this},H.prototype.implicit=function(R){var D=this._baseState;return K(D.explicit===null&&D.implicit===null),D.implicit=R,this},H.prototype.obj=function(){var R=this._baseState,D=Array.prototype.slice.call(arguments);if(R.obj=!0,D.length!==0)this._useArgs(D);return this},H.prototype.key=function(R){var D=this._baseState;return K(D.key===null),D.key=R,this},H.prototype.any=function(){var R=this._baseState;return R.any=!0,this},H.prototype.choice=function(R){var D=this._baseState;return K(D.choice===null),D.choice=R,this._useArgs(Object.keys(R).map(function(q){return R[q]})),this},H.prototype.contains=function(R){var D=this._baseState;return K(D.use===null),D.contains=R,this},H.prototype._decode=function(R,D){var q=this._baseState;if(q.parent===null)return R.wrapResult(q.children[0]._decode(R,D));var P=q.default,_=!0,k=null;if(q.key!==null)k=R.enterKey(q.key);if(q.optional){var B=null;if(q.explicit!==null)B=q.explicit;else if(q.implicit!==null)B=q.implicit;else if(q.tag!==null)B=q.tag;if(B===null&&!q.any){var v=R.save();try{if(q.choice===null)this._decodeGeneric(q.tag,R,D);else this._decodeChoice(R,D);_=!0}catch(X0){_=!1}R.restore(v)}else if(_=this._peekTag(R,B,q.any),R.isError(_))return _}var g;if(q.obj&&_)g=R.enterObject();if(_){if(q.explicit!==null){var f=this._decodeTag(R,q.explicit);if(R.isError(f))return f;R=f}var w=R.offset;if(q.use===null&&q.choice===null){if(q.any)var v=R.save();var b=this._decodeTag(R,q.implicit!==null?q.implicit:q.tag,q.any);if(R.isError(b))return b;if(q.any)P=R.raw(v);else R=b}if(D&&D.track&&q.tag!==null)D.track(R.path(),w,R.length,"tagged");if(D&&D.track&&q.tag!==null)D.track(R.path(),R.offset,R.length,"content");if(q.any)P=P;else if(q.choice===null)P=this._decodeGeneric(q.tag,R,D);else P=this._decodeChoice(R,D);if(R.isError(P))return P;if(!q.any&&q.choice===null&&q.children!==null)q.children.forEach(function(X0){X0._decode(R,D)});if(q.contains&&(q.tag==="octstr"||q.tag==="bitstr")){var I0=new S(P);P=this._getUse(q.contains,R._reporterState.obj)._decode(I0,D)}}if(q.obj&&_)P=R.leaveObject(g);if(q.key!==null&&(P!==null||_===!0))R.leaveKey(k,q.key,P);else if(k!==null)R.exitKey(k);return P},H.prototype._decodeGeneric=function(R,D,q){var P=this._baseState;if(R==="seq"||R==="set")return null;if(R==="seqof"||R==="setof")return this._decodeList(D,R,P.args[0],q);else if(/str$/.test(R))return this._decodeStr(D,R,q);else if(R==="objid"&&P.args)return this._decodeObjid(D,P.args[0],P.args[1],q);else if(R==="objid")return this._decodeObjid(D,null,null,q);else if(R==="gentime"||R==="utctime")return this._decodeTime(D,R,q);else if(R==="null_")return this._decodeNull(D,q);else if(R==="bool")return this._decodeBool(D,q);else if(R==="objDesc")return this._decodeStr(D,R,q);else if(R==="int"||R==="enum")return this._decodeInt(D,P.args&&P.args[0],q);if(P.use!==null)return this._getUse(P.use,D._reporterState.obj)._decode(D,q);else return D.error("unknown tag: "+R)},H.prototype._getUse=function(R,D){var q=this._baseState;if(q.useDecoder=this._use(R,D),K(q.useDecoder._baseState.parent===null),q.useDecoder=q.useDecoder._baseState.children[0],q.implicit!==q.useDecoder._baseState.implicit)q.useDecoder=q.useDecoder.clone(),q.useDecoder._baseState.implicit=q.implicit;return q.useDecoder},H.prototype._decodeChoice=function(R,D){var q=this._baseState,P=null,_=!1;if(Object.keys(q.choice).some(function(k){var B=R.save(),v=q.choice[k];try{var g=v._decode(R,D);if(R.isError(g))return!1;P={type:k,value:g},_=!0}catch(f){return R.restore(B),!1}return!0},this),!_)return R.error("Choice not matched");return P},H.prototype._createEncoderBuffer=function(R){return new L(R,this.reporter)},H.prototype._encode=function(R,D,q){var P=this._baseState;if(P.default!==null&&P.default===R)return;var _=this._encodeValue(R,D,q);if(_===void 0)return;if(this._skipDefault(_,D,q))return;return _},H.prototype._encodeValue=function(R,D,q){var P=this._baseState;if(P.parent===null)return P.children[0]._encode(R,D||new E);var v=null;if(this.reporter=D,P.optional&&R===void 0)if(P.default!==null)R=P.default;else return;var _=null,k=!1;if(P.any)v=this._createEncoderBuffer(R);else if(P.choice)v=this._encodeChoice(R,D);else if(P.contains)_=this._getUse(P.contains,q)._encode(R,D),k=!0;else if(P.children)_=P.children.map(function(w){if(w._baseState.tag==="null_")return w._encode(null,D,R);if(w._baseState.key===null)return D.error("Child should have a key");var b=D.enterKey(w._baseState.key);if(typeof R!=="object")return D.error("Child expected, but input is not object");var I0=w._encode(R[w._baseState.key],D,R);return D.leaveKey(b),I0},this).filter(function(w){return w}),_=this._createEncoderBuffer(_);else if(P.tag==="seqof"||P.tag==="setof"){if(!(P.args&&P.args.length===1))return D.error("Too many args for : "+P.tag);if(!Array.isArray(R))return D.error("seqof/setof, but data is not Array");var B=this.clone();B._baseState.implicit=null,_=this._createEncoderBuffer(R.map(function(w){var b=this._baseState;return this._getUse(b.args[0],R)._encode(w,D)},B))}else if(P.use!==null)v=this._getUse(P.use,q)._encode(R,D);else _=this._encodePrimitive(P.tag,R),k=!0;var v;if(!P.any&&P.choice===null){var g=P.implicit!==null?P.implicit:P.tag,f=P.implicit===null?"universal":"context";if(g===null){if(P.use===null)D.error("Tag could be omitted only for .use()")}else if(P.use===null)v=this._encodeComposite(g,k,f,_)}if(P.explicit!==null)v=this._encodeComposite(P.explicit,!1,"context",v);return v},H.prototype._encodeChoice=function(R,D){var q=this._baseState,P=q.choice[R.type];if(!P)K(!1,R.type+" not found in "+JSON.stringify(Object.keys(q.choice)));return P._encode(R.value,D)},H.prototype._encodePrimitive=function(R,D){var q=this._baseState;if(/str$/.test(R))return this._encodeStr(D,R);else if(R==="objid"&&q.args)return this._encodeObjid(D,q.reverseArgs[0],q.args[1]);else if(R==="objid")return this._encodeObjid(D,null,null);else if(R==="gentime"||R==="utctime")return this._encodeTime(D,R);else if(R==="null_")return this._encodeNull();else if(R==="int"||R==="enum")return this._encodeInt(D,q.args&&q.reverseArgs[0]);else if(R==="bool")return this._encodeBool(D);else if(R==="objDesc")return this._encodeStr(D,R);else throw Error("Unsupported tag: "+R)},H.prototype._isNumstr=function(R){return/^[0-9 ]*$/.test(R)},H.prototype._isPrintstr=function(R){return/^[A-Za-z0-9 '\(\)\+,\-\.\/:=\?]*$/.test(R)}}),cO=Q0(($)=>{var I=$;I.Reporter=eG().Reporter,I.DecoderBuffer=BI().DecoderBuffer,I.EncoderBuffer=BI().EncoderBuffer,I.Node=aG()}),iG=Q0(($)=>{var I=rI();$.tagClass={0:"universal",1:"application",2:"context",3:"private"},$.tagClassByName=I._reverse($.tagClass),$.tag={0:"end",1:"bool",2:"int",3:"bitstr",4:"octstr",5:"null_",6:"objid",7:"objDesc",8:"external",9:"real",10:"enum",11:"embed",12:"utf8str",13:"relativeOid",16:"seq",17:"set",18:"numstr",19:"printstr",20:"t61str",21:"videostr",22:"ia5str",23:"utctime",24:"gentime",25:"graphstr",26:"iso646str",27:"genstr",28:"unistr",29:"charstr",30:"bmpstr"},$.tagByName=I._reverse($.tag)}),rI=Q0(($)=>{var I=$;I._reverse=function(E){var L={};return Object.keys(E).forEach(function(S){if((S|0)==S)S=S|0;var K=E[S];L[K]=S}),L},I.der=iG()}),eI=Q0(($,I)=>{var E=gU(),L=dO(),S=L.base,K=L.bignum,Q=L.constants.der;function T(R){this.enc="der",this.name=R.name,this.entity=R,this.tree=new M,this.tree._init(R.body)}I.exports=T,T.prototype.decode=function(R,D){if(!(R instanceof S.DecoderBuffer))R=new S.DecoderBuffer(R,D);return this.tree._decode(R,D)};function M(R){S.Node.call(this,"der",R)}E(M,S.Node),M.prototype._peekTag=function(R,D,q){if(R.isEmpty())return!1;var P=R.save(),_=H(R,'Failed to peek tag: "'+D+'"');if(R.isError(_))return _;return R.restore(P),_.tag===D||_.tagStr===D||_.tagStr+"of"===D||q},M.prototype._decodeTag=function(R,D,q){var P=H(R,'Failed to decode tag of "'+D+'"');if(R.isError(P))return P;var _=F(R,P.primitive,'Failed to get length of "'+D+'"');if(R.isError(_))return _;if(!q&&P.tag!==D&&P.tagStr!==D&&P.tagStr+"of"!==D)return R.error('Failed to match tag: "'+D+'"');if(P.primitive||_!==null)return R.skip(_,'Failed to match body of: "'+D+'"');var k=R.save(),B=this._skipUntilEnd(R,'Failed to skip indefinite length body: "'+this.tag+'"');if(R.isError(B))return B;return _=R.offset-k.offset,R.restore(k),R.skip(_,'Failed to match body of: "'+D+'"')},M.prototype._skipUntilEnd=function(R,D){while(!0){var q=H(R,D);if(R.isError(q))return q;var P=F(R,q.primitive,D);if(R.isError(P))return P;var _;if(q.primitive||P!==null)_=R.skip(P);else _=this._skipUntilEnd(R,D);if(R.isError(_))return _;if(q.tagStr==="end")break}},M.prototype._decodeList=function(R,D,q,P){var _=[];while(!R.isEmpty()){var k=this._peekTag(R,"end");if(R.isError(k))return k;var B=q.decode(R,"der",P);if(R.isError(B)&&k)break;_.push(B)}return _},M.prototype._decodeStr=function(R,D){if(D==="bitstr"){var q=R.readUInt8();if(R.isError(q))return q;return{unused:q,data:R.raw()}}else if(D==="bmpstr"){var P=R.raw();if(P.length%2===1)return R.error("Decoding of string type: bmpstr length mismatch");var _="";for(var k=0;k<P.length/2;k++)_+=String.fromCharCode(P.readUInt16BE(k*2));return _}else if(D==="numstr"){var B=R.raw().toString("ascii");if(!this._isNumstr(B))return R.error("Decoding of string type: numstr unsupported characters");return B}else if(D==="octstr")return R.raw();else if(D==="objDesc")return R.raw();else if(D==="printstr"){var v=R.raw().toString("ascii");if(!this._isPrintstr(v))return R.error("Decoding of string type: printstr unsupported characters");return v}else if(/str$/.test(D))return R.raw().toString();else return R.error("Decoding of string type: "+D+" unsupported")},M.prototype._decodeObjid=function(R,D,q){var P,_=[],k=0;while(!R.isEmpty()){var B=R.readUInt8();if(k<<=7,k|=B&127,(B&128)===0)_.push(k),k=0}if(B&128)_.push(k);var v=_[0]/40|0,g=_[0]%40;if(q)P=_;else P=[v,g].concat(_.slice(1));if(D){var f=D[P.join(" ")];if(f===void 0)f=D[P.join(".")];if(f!==void 0)P=f}return P},M.prototype._decodeTime=function(R,D){var q=R.raw().toString();if(D==="gentime")var P=q.slice(0,4)|0,_=q.slice(4,6)|0,k=q.slice(6,8)|0,B=q.slice(8,10)|0,v=q.slice(10,12)|0,g=q.slice(12,14)|0;else if(D==="utctime"){var P=q.slice(0,2)|0,_=q.slice(2,4)|0,k=q.slice(4,6)|0,B=q.slice(6,8)|0,v=q.slice(8,10)|0,g=q.slice(10,12)|0;if(P<70)P=2000+P;else P=1900+P}else return R.error("Decoding "+D+" time is not supported yet");return Date.UTC(P,_-1,k,B,v,g,0)},M.prototype._decodeNull=function(R){return null},M.prototype._decodeBool=function(R){var D=R.readUInt8();if(R.isError(D))return D;else return D!==0},M.prototype._decodeInt=function(R,D){var q=R.raw(),P=new K(q);if(D)P=D[P.toString(10)]||P;return P},M.prototype._use=function(R,D){if(typeof R==="function")R=R(D);return R._getDecoder("der").tree};function H(R,D){var q=R.readUInt8(D);if(R.isError(q))return q;var P=Q.tagClass[q>>6],_=(q&32)===0;if((q&31)===31){var k=q;q=0;while((k&128)===128){if(k=R.readUInt8(D),R.isError(k))return k;q<<=7,q|=k&127}}else q&=31;var B=Q.tag[q];return{cls:P,primitive:_,tag:q,tagStr:B}}function F(R,D,q){var P=R.readUInt8(q);if(R.isError(P))return P;if(!D&&P===128)return null;if((P&128)===0)return P;var _=P&127;if(_>4)return R.error("length octect is too long");P=0;for(var k=0;k<_;k++){P<<=8;var B=R.readUInt8(q);if(R.isError(B))return B;P|=B}return P}}),UE=Q0(($,I)=>{var E=gU(),L=(DU(),l0(RU)).Buffer,S=eI();function K(Q){S.call(this,Q),this.enc="pem"}E(K,S),I.exports=K,K.prototype.decode=function(Q,T){var M=Q.toString().split(/[\r\n]+/g),H=T.label.toUpperCase(),F=/^-----(BEGIN|END) ([^-]+)-----$/,R=-1,D=-1;for(var q=0;q<M.length;q++){var P=M[q].match(F);if(P===null)continue;if(P[2]!==H)continue;if(R===-1){if(P[1]!=="BEGIN")break;R=q}else{if(P[1]!=="END")break;D=q;break}}if(R===-1||D===-1)throw Error("PEM section not found for: "+H);var _=M.slice(R+1,D).join("");_.replace(/[^a-z0-9\+\/=]+/gi,"");var k=new L(_,"base64");return S.prototype.decode.call(this,k,T)}}),OE=Q0(($)=>{var I=$;I.der=eI(),I.pem=UE()}),aI=Q0(($,I)=>{var E=gU(),L=(DU(),l0(RU)).Buffer,S=dO(),K=S.base,Q=S.constants.der;function T(R){this.enc="der",this.name=R.name,this.entity=R,this.tree=new M,this.tree._init(R.body)}I.exports=T,T.prototype.encode=function(R,D){return this.tree._encode(R,D).join()};function M(R){K.Node.call(this,"der",R)}E(M,K.Node),M.prototype._encodeComposite=function(R,D,q,P){var _=F(R,D,q,this.reporter);if(P.length<128){var v=new L(2);return v[0]=_,v[1]=P.length,this._createEncoderBuffer([v,P])}var k=1;for(var B=P.length;B>=256;B>>=8)k++;var v=new L(2+k);v[0]=_,v[1]=128|k;for(var B=1+k,g=P.length;g>0;B--,g>>=8)v[B]=g&255;return this._createEncoderBuffer([v,P])},M.prototype._encodeStr=function(R,D){if(D==="bitstr")return this._createEncoderBuffer([R.unused|0,R.data]);else if(D==="bmpstr"){var q=new L(R.length*2);for(var P=0;P<R.length;P++)q.writeUInt16BE(R.charCodeAt(P),P*2);return this._createEncoderBuffer(q)}else if(D==="numstr"){if(!this._isNumstr(R))return this.reporter.error("Encoding of string type: numstr supports only digits and space");return this._createEncoderBuffer(R)}else if(D==="printstr"){if(!this._isPrintstr(R))return this.reporter.error("Encoding of string type: printstr supports only latin upper and lower case letters, digits, space, apostrophe, left and rigth parenthesis, plus sign, comma, hyphen, dot, slash, colon, equal sign, question mark");return this._createEncoderBuffer(R)}else if(/str$/.test(D))return this._createEncoderBuffer(R);else if(D==="objDesc")return this._createEncoderBuffer(R);else return this.reporter.error("Encoding of string type: "+D+" unsupported")},M.prototype._encodeObjid=function(R,D,q){if(typeof R==="string"){if(!D)return this.reporter.error("string objid given, but no values map found");if(!D.hasOwnProperty(R))return this.reporter.error("objid not found in values map");R=D[R].split(/[\s\.]+/g);for(var P=0;P<R.length;P++)R[P]|=0}else if(Array.isArray(R)){R=R.slice();for(var P=0;P<R.length;P++)R[P]|=0}if(!Array.isArray(R))return this.reporter.error("objid() should be either array or string, got: "+JSON.stringify(R));if(!q){if(R[1]>=40)return this.reporter.error("Second objid identifier OOB");R.splice(0,2,R[0]*40+R[1])}var _=0;for(var P=0;P<R.length;P++){var k=R[P];for(_++;k>=128;k>>=7)_++}var B=new L(_),v=B.length-1;for(var P=R.length-1;P>=0;P--){var k=R[P];B[v--]=k&127;while((k>>=7)>0)B[v--]=128|k&127}return this._createEncoderBuffer(B)};function H(R){if(R<10)return"0"+R;else return R}M.prototype._encodeTime=function(R,D){var q,P=new Date(R);if(D==="gentime")q=[H(P.getFullYear()),H(P.getUTCMonth()+1),H(P.getUTCDate()),H(P.getUTCHours()),H(P.getUTCMinutes()),H(P.getUTCSeconds()),"Z"].join("");else if(D==="utctime")q=[H(P.getFullYear()%100),H(P.getUTCMonth()+1),H(P.getUTCDate()),H(P.getUTCHours()),H(P.getUTCMinutes()),H(P.getUTCSeconds()),"Z"].join("");else this.reporter.error("Encoding "+D+" time is not supported yet");return this._encodeStr(q,"octstr")},M.prototype._encodeNull=function(){return this._createEncoderBuffer("")},M.prototype._encodeInt=function(R,D){if(typeof R==="string"){if(!D)return this.reporter.error("String int or enum given, but no values map");if(!D.hasOwnProperty(R))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(R));R=D[R]}if(typeof R!=="number"&&!L.isBuffer(R)){var q=R.toArray();if(!R.sign&&q[0]&128)q.unshift(0);R=new L(q)}if(L.isBuffer(R)){var P=R.length;if(R.length===0)P++;var k=new L(P);if(R.copy(k),R.length===0)k[0]=0;return this._createEncoderBuffer(k)}if(R<128)return this._createEncoderBuffer(R);if(R<256)return this._createEncoderBuffer([0,R]);var P=1;for(var _=R;_>=256;_>>=8)P++;var k=Array(P);for(var _=k.length-1;_>=0;_--)k[_]=R&255,R>>=8;if(k[0]&128)k.unshift(0);return this._createEncoderBuffer(new L(k))},M.prototype._encodeBool=function(R){return this._createEncoderBuffer(R?255:0)},M.prototype._use=function(R,D){if(typeof R==="function")R=R(D);return R._getEncoder("der").tree},M.prototype._skipDefault=function(R,D,q){var P=this._baseState,_;if(P.default===null)return!1;var k=R.join();if(P.defaultBuffer===void 0)P.defaultBuffer=this._encodeValue(P.default,D,q).join();if(k.length!==P.defaultBuffer.length)return!1;for(_=0;_<k.length;_++)if(k[_]!==P.defaultBuffer[_])return!1;return!0};function F(R,D,q,P){var _;if(R==="seqof")R="seq";else if(R==="setof")R="set";if(Q.tagByName.hasOwnProperty(R))_=Q.tagByName[R];else if(typeof R==="number"&&(R|0)===R)_=R;else return P.error("Unknown tag: "+R);if(_>=31)return P.error("Multi-octet tag encoding unsupported");if(!D)_|=32;return _|=Q.tagClassByName[q||"universal"]<<6,_}}),ZE=Q0(($,I)=>{var E=gU(),L=aI();function S(K){L.call(this,K),this.enc="pem"}E(S,L),I.exports=S,S.prototype.encode=function(K,Q){var T=L.prototype.encode.call(this,K),M=T.toString("base64"),H=["-----BEGIN "+Q.label+"-----"];for(var F=0;F<M.length;F+=64)H.push(M.slice(F,F+64));return H.push("-----END "+Q.label+"-----"),H.join(`
|
|
15
|
+
`)}}),AE=Q0(($)=>{var I=$;I.der=aI(),I.pem=ZE()}),dO=Q0(($)=>{var I=$;I.bignum=mG(),I.define=rG().define,I.base=cO(),I.constants=rI(),I.decoders=OE(),I.encoders=AE()}),$E=Q0(($,I)=>{var E=dO(),L=E.define("Time",function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})}),S=E.define("AttributeTypeValue",function(){this.seq().obj(this.key("type").objid(),this.key("value").any())}),K=E.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional(),this.key("curve").objid().optional())}),Q=E.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(K),this.key("subjectPublicKey").bitstr())}),T=E.define("RelativeDistinguishedName",function(){this.setof(S)}),M=E.define("RDNSequence",function(){this.seqof(T)}),H=E.define("Name",function(){this.choice({rdnSequence:this.use(M)})}),F=E.define("Validity",function(){this.seq().obj(this.key("notBefore").use(L),this.key("notAfter").use(L))}),R=E.define("Extension",function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())}),D=E.define("TBSCertificate",function(){this.seq().obj(this.key("version").explicit(0).int().optional(),this.key("serialNumber").int(),this.key("signature").use(K),this.key("issuer").use(H),this.key("validity").use(F),this.key("subject").use(H),this.key("subjectPublicKeyInfo").use(Q),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(R).optional())}),q=E.define("X509Certificate",function(){this.seq().obj(this.key("tbsCertificate").use(D),this.key("signatureAlgorithm").use(K),this.key("signatureValue").bitstr())});I.exports=q}),IE=Q0(($)=>{var I=dO();$.certificate=$E();var E=I.define("RSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())});$.RSAPrivateKey=E;var L=I.define("RSAPublicKey",function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())});$.RSAPublicKey=L;var S=I.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())}),K=I.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(S),this.key("subjectPublicKey").bitstr())});$.PublicKey=K;var Q=I.define("PrivateKeyInfo",function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(S),this.key("subjectPrivateKey").octstr())});$.PrivateKey=Q;var T=I.define("EncryptedPrivateKeyInfo",function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())});$.EncryptedPrivateKey=T;var M=I.define("DSAPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())});$.DSAPrivateKey=M,$.DSAparam=I.define("DSAparam",function(){this.int()});var H=I.define("ECParameters",function(){this.choice({namedCurve:this.objid()})}),F=I.define("ECPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(H),this.key("publicKey").optional().explicit(1).bitstr())});$.ECPrivateKey=F,$.signature=I.define("signature",function(){this.seq().obj(this.key("r").int(),this.key("s").int())})}),CE=Q0(($,I)=>{I.exports={"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"}}),QE=Q0(($,I)=>{var E=qU().Buffer,L=UZ().Transform,S=gU();function K(H){L.call(this),this._block=E.allocUnsafe(H),this._blockSize=H,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}S(K,L),K.prototype._transform=function(H,F,R){var D=null;try{this.update(H,F)}catch(q){D=q}R(D)},K.prototype._flush=function(H){var F=null;try{this.push(this.digest())}catch(R){F=R}H(F)};var Q=typeof Uint8Array<"u",T=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u"&&ArrayBuffer.isView&&(E.prototype instanceof Uint8Array||E.TYPED_ARRAY_SUPPORT);function M(H,F){if(H instanceof E)return H;if(typeof H==="string")return E.from(H,F);if(T&&ArrayBuffer.isView(H)){if(H.byteLength===0)return E.alloc(0);var R=E.from(H.buffer,H.byteOffset,H.byteLength);if(R.byteLength===H.byteLength)return R}if(Q&&H instanceof Uint8Array)return E.from(H);if(E.isBuffer(H)&&H.constructor&&typeof H.constructor.isBuffer==="function"&&H.constructor.isBuffer(H))return E.from(H);throw TypeError('The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView.')}K.prototype.update=function(H,F){if(this._finalized)throw Error("Digest already called");H=M(H,F);var R=this._block,D=0;while(this._blockOffset+H.length-D>=this._blockSize){for(var q=this._blockOffset;q<this._blockSize;)R[q++]=H[D++];this._update(),this._blockOffset=0}while(D<H.length)R[this._blockOffset++]=H[D++];for(var P=0,_=H.length*8;_>0;++P)if(this._length[P]+=_,_=this._length[P]/4294967296|0,_>0)this._length[P]-=4294967296*_;return this},K.prototype._update=function(){throw Error("_update is not implemented")},K.prototype.digest=function(H){if(this._finalized)throw Error("Digest already called");this._finalized=!0;var F=this._digest();if(H!==void 0)F=F.toString(H);this._block.fill(0),this._blockOffset=0;for(var R=0;R<4;++R)this._length[R]=0;return F},K.prototype._digest=function(){throw Error("_digest is not implemented")},I.exports=K}),XE=Q0(($,I)=>{var E=gU(),L=QE(),S=qU().Buffer,K=Array(16);function Q(){L.call(this,64),this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878}E(Q,L),Q.prototype._update=function(){var D=K;for(var q=0;q<16;++q)D[q]=this._block.readInt32LE(q*4);var P=this._a,_=this._b,k=this._c,B=this._d;P=M(P,_,k,B,D[0],3614090360,7),B=M(B,P,_,k,D[1],3905402710,12),k=M(k,B,P,_,D[2],606105819,17),_=M(_,k,B,P,D[3],3250441966,22),P=M(P,_,k,B,D[4],4118548399,7),B=M(B,P,_,k,D[5],1200080426,12),k=M(k,B,P,_,D[6],2821735955,17),_=M(_,k,B,P,D[7],4249261313,22),P=M(P,_,k,B,D[8],1770035416,7),B=M(B,P,_,k,D[9],2336552879,12),k=M(k,B,P,_,D[10],4294925233,17),_=M(_,k,B,P,D[11],2304563134,22),P=M(P,_,k,B,D[12],1804603682,7),B=M(B,P,_,k,D[13],4254626195,12),k=M(k,B,P,_,D[14],2792965006,17),_=M(_,k,B,P,D[15],1236535329,22),P=H(P,_,k,B,D[1],4129170786,5),B=H(B,P,_,k,D[6],3225465664,9),k=H(k,B,P,_,D[11],643717713,14),_=H(_,k,B,P,D[0],3921069994,20),P=H(P,_,k,B,D[5],3593408605,5),B=H(B,P,_,k,D[10],38016083,9),k=H(k,B,P,_,D[15],3634488961,14),_=H(_,k,B,P,D[4],3889429448,20),P=H(P,_,k,B,D[9],568446438,5),B=H(B,P,_,k,D[14],3275163606,9),k=H(k,B,P,_,D[3],4107603335,14),_=H(_,k,B,P,D[8],1163531501,20),P=H(P,_,k,B,D[13],2850285829,5),B=H(B,P,_,k,D[2],4243563512,9),k=H(k,B,P,_,D[7],1735328473,14),_=H(_,k,B,P,D[12],2368359562,20),P=F(P,_,k,B,D[5],4294588738,4),B=F(B,P,_,k,D[8],2272392833,11),k=F(k,B,P,_,D[11],1839030562,16),_=F(_,k,B,P,D[14],4259657740,23),P=F(P,_,k,B,D[1],2763975236,4),B=F(B,P,_,k,D[4],1272893353,11),k=F(k,B,P,_,D[7],4139469664,16),_=F(_,k,B,P,D[10],3200236656,23),P=F(P,_,k,B,D[13],681279174,4),B=F(B,P,_,k,D[0],3936430074,11),k=F(k,B,P,_,D[3],3572445317,16),_=F(_,k,B,P,D[6],76029189,23),P=F(P,_,k,B,D[9],3654602809,4),B=F(B,P,_,k,D[12],3873151461,11),k=F(k,B,P,_,D[15],530742520,16),_=F(_,k,B,P,D[2],3299628645,23),P=R(P,_,k,B,D[0],4096336452,6),B=R(B,P,_,k,D[7],1126891415,10),k=R(k,B,P,_,D[14],2878612391,15),_=R(_,k,B,P,D[5],4237533241,21),P=R(P,_,k,B,D[12],1700485571,6),B=R(B,P,_,k,D[3],2399980690,10),k=R(k,B,P,_,D[10],4293915773,15),_=R(_,k,B,P,D[1],2240044497,21),P=R(P,_,k,B,D[8],1873313359,6),B=R(B,P,_,k,D[15],4264355552,10),k=R(k,B,P,_,D[6],2734768916,15),_=R(_,k,B,P,D[13],1309151649,21),P=R(P,_,k,B,D[4],4149444226,6),B=R(B,P,_,k,D[11],3174756917,10),k=R(k,B,P,_,D[2],718787259,15),_=R(_,k,B,P,D[9],3951481745,21),this._a=this._a+P|0,this._b=this._b+_|0,this._c=this._c+k|0,this._d=this._d+B|0},Q.prototype._digest=function(){if(this._block[this._blockOffset++]=128,this._blockOffset>56)this._block.fill(0,this._blockOffset,64),this._update(),this._blockOffset=0;this._block.fill(0,this._blockOffset,56),this._block.writeUInt32LE(this._length[0],56),this._block.writeUInt32LE(this._length[1],60),this._update();var D=S.allocUnsafe(16);return D.writeInt32LE(this._a,0),D.writeInt32LE(this._b,4),D.writeInt32LE(this._c,8),D.writeInt32LE(this._d,12),D};function T(D,q){return D<<q|D>>>32-q}function M(D,q,P,_,k,B,v){return T(D+(q&P|~q&_)+k+B|0,v)+q|0}function H(D,q,P,_,k,B,v){return T(D+(q&_|P&~_)+k+B|0,v)+q|0}function F(D,q,P,_,k,B,v){return T(D+(q^P^_)+k+B|0,v)+q|0}function R(D,q,P,_,k,B,v){return T(D+(P^(q|~_))+k+B|0,v)+q|0}I.exports=Q}),GE=Q0(($,I)=>{var E=qU().Buffer,L=XE();function S(K,Q,T,M){if(!E.isBuffer(K))K=E.from(K,"binary");if(Q){if(!E.isBuffer(Q))Q=E.from(Q,"binary");if(Q.length!==8)throw RangeError("salt should be Buffer with 8 byte length")}var H=T/8,F=E.alloc(H),R=E.alloc(M||0),D=E.alloc(0);while(H>0||M>0){var q=new L;if(q.update(D),q.update(K),Q)q.update(Q);D=q.digest();var P=0;if(H>0){var _=F.length-H;P=Math.min(H,D.length),D.copy(F,_,0,P),H-=P}if(P<D.length&&M>0){var k=R.length-M,B=Math.min(M,D.length-P);D.copy(R,k,P,P+B),M-=B}}return D.fill(0),{key:F,iv:R}}I.exports=S}),iI=Q0(($)=>{var I=(vU(),l0(jU));$.createCipher=$.Cipher=I.createCipher,$.createCipheriv=$.Cipheriv=I.createCipheriv,$.createDecipher=$.Decipher=I.createDecipher,$.createDecipheriv=$.Decipheriv=I.createDecipheriv,$.listCiphers=$.getCiphers=I.getCiphers}),EE=Q0(($,I)=>{var E=/Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r+/=]+)[\n\r]+/m,L=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m,S=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m,K=GE(),Q=iI(),T=qU().Buffer;I.exports=function(M,H){var F=M.toString(),R=F.match(E),D;if(!R){var q=F.match(S);D=T.from(q[2].replace(/[\r\n]/g,""),"base64")}else{var P="aes"+R[1],_=T.from(R[2],"hex"),k=T.from(R[3].replace(/[\r\n]/g,""),"base64"),B=K(H,_.slice(0,8),parseInt(R[1],10)).key,v=[],g=Q.createDecipheriv(P,B,_);v.push(g.update(k)),v.push(g.final()),D=T.concat(v)}var f=F.match(L)[1];return{tag:f,data:D}}}),UC=Q0(($,I)=>{var E=IE(),L=CE(),S=EE(),K=iI(),Q=dI().pbkdf2Sync,T=qU().Buffer;function M(F,R){var D=F.algorithm.decrypt.kde.kdeparams.salt,q=parseInt(F.algorithm.decrypt.kde.kdeparams.iters.toString(),10),P=L[F.algorithm.decrypt.cipher.algo.join(".")],_=F.algorithm.decrypt.cipher.iv,k=F.subjectPrivateKey,B=parseInt(P.split("-")[1],10)/8,v=Q(R,D,q,B,"sha1"),g=K.createDecipheriv(P,v,_),f=[];return f.push(g.update(k)),f.push(g.final()),T.concat(f)}function H(F){var R;if(typeof F==="object"&&!T.isBuffer(F))R=F.passphrase,F=F.key;if(typeof F==="string")F=T.from(F);var D=S(F,R),q=D.tag,P=D.data,_,k;switch(q){case"CERTIFICATE":k=E.certificate.decode(P,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":if(!k)k=E.PublicKey.decode(P,"der");switch(_=k.algorithm.algorithm.join("."),_){case"1.2.840.113549.1.1.1":return E.RSAPublicKey.decode(k.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return k.subjectPrivateKey=k.subjectPublicKey,{type:"ec",data:k};case"1.2.840.10040.4.1":return k.algorithm.params.pub_key=E.DSAparam.decode(k.subjectPublicKey.data,"der"),{type:"dsa",data:k.algorithm.params};default:throw Error("unknown key id "+_)}case"ENCRYPTED PRIVATE KEY":P=E.EncryptedPrivateKey.decode(P,"der"),P=M(P,R);case"PRIVATE KEY":switch(k=E.PrivateKey.decode(P,"der"),_=k.algorithm.algorithm.join("."),_){case"1.2.840.113549.1.1.1":return E.RSAPrivateKey.decode(k.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:k.algorithm.curve,privateKey:E.ECPrivateKey.decode(k.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return k.algorithm.params.priv_key=E.DSAparam.decode(k.subjectPrivateKey,"der"),{type:"dsa",params:k.algorithm.params};default:throw Error("unknown key id "+_)}case"RSA PUBLIC KEY":return E.RSAPublicKey.decode(P,"der");case"RSA PRIVATE KEY":return E.RSAPrivateKey.decode(P,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:E.DSAPrivateKey.decode(P,"der")};case"EC PRIVATE KEY":return P=E.ECPrivateKey.decode(P,"der"),{curve:P.parameters.value,privateKey:P.privateKey};default:throw Error("unknown key type "+q)}}H.signature=E.signature,I.exports=H}),OC=Q0(($,I)=>{var E=GZ(),L=qU().Buffer;I.exports=function(K,Q){var T=L.alloc(0),M=0,H;while(T.length<Q)H=S(M++),T=L.concat([T,E("sha1").update(K).update(H).digest()]);return T.slice(0,Q)};function S(K){var Q=L.allocUnsafe(4);return Q.writeUInt32BE(K,0),Q}}),ZC=Q0(($,I)=>{I.exports=function(E,L){var S=E.length,K=-1;while(++K<S)E[K]^=L[K];return E}}),vA=Q0(($,I)=>{(function(E,L){function S(U,A){if(!U)throw Error(A||"Assertion failed")}function K(U,A){U.super_=A;var X=function(){};X.prototype=A.prototype,U.prototype=new X,U.prototype.constructor=U}function Q(U,A,X){if(Q.isBN(U))return U;if(this.negative=0,this.words=null,this.length=0,this.red=null,U!==null){if(A==="le"||A==="be")X=A,A=10;this._init(U||0,A||10,X||"be")}}if(typeof E==="object")E.exports=Q;else L.BN=Q;Q.BN=Q,Q.wordSize=26;var T;try{if(typeof window<"u"&&typeof window.Buffer<"u")T=window.Buffer;else T=(DU(),l0(RU)).Buffer}catch(U){}Q.isBN=function(U){if(U instanceof Q)return!0;return U!==null&&typeof U==="object"&&U.constructor.wordSize===Q.wordSize&&Array.isArray(U.words)},Q.max=function(U,A){if(U.cmp(A)>0)return U;return A},Q.min=function(U,A){if(U.cmp(A)<0)return U;return A},Q.prototype._init=function(U,A,X){if(typeof U==="number")return this._initNumber(U,A,X);if(typeof U==="object")return this._initArray(U,A,X);if(A==="hex")A=16;S(A===(A|0)&&A>=2&&A<=36),U=U.toString().replace(/\s+/g,"");var Z=0;if(U[0]==="-")Z++,this.negative=1;if(Z<U.length){if(A===16)this._parseHex(U,Z,X);else if(this._parseBase(U,A,Z),X==="le")this._initArray(this.toArray(),A,X)}},Q.prototype._initNumber=function(U,A,X){if(U<0)this.negative=1,U=-U;if(U<67108864)this.words=[U&67108863],this.length=1;else if(U<4503599627370496)this.words=[U&67108863,U/67108864&67108863],this.length=2;else S(U<9007199254740992),this.words=[U&67108863,U/67108864&67108863,1],this.length=3;if(X!=="le")return;this._initArray(this.toArray(),A,X)},Q.prototype._initArray=function(U,A,X){if(S(typeof U.length==="number"),U.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(U.length/3),this.words=Array(this.length);for(var Z=0;Z<this.length;Z++)this.words[Z]=0;var C,Y,V=0;if(X==="be"){for(Z=U.length-1,C=0;Z>=0;Z-=3)if(Y=U[Z]|U[Z-1]<<8|U[Z-2]<<16,this.words[C]|=Y<<V&67108863,this.words[C+1]=Y>>>26-V&67108863,V+=24,V>=26)V-=26,C++}else if(X==="le"){for(Z=0,C=0;Z<U.length;Z+=3)if(Y=U[Z]|U[Z+1]<<8|U[Z+2]<<16,this.words[C]|=Y<<V&67108863,this.words[C+1]=Y>>>26-V&67108863,V+=24,V>=26)V-=26,C++}return this.strip()};function M(U,A){var X=U.charCodeAt(A);if(X>=65&&X<=70)return X-55;else if(X>=97&&X<=102)return X-87;else return X-48&15}function H(U,A,X){var Z=M(U,X);if(X-1>=A)Z|=M(U,X-1)<<4;return Z}Q.prototype._parseHex=function(U,A,X){this.length=Math.ceil((U.length-A)/6),this.words=Array(this.length);for(var Z=0;Z<this.length;Z++)this.words[Z]=0;var C=0,Y=0,V;if(X==="be")for(Z=U.length-1;Z>=A;Z-=2)if(V=H(U,A,Z)<<C,this.words[Y]|=V&67108863,C>=18)C-=18,Y+=1,this.words[Y]|=V>>>26;else C+=8;else{var G=U.length-A;for(Z=G%2===0?A+1:A;Z<U.length;Z+=2)if(V=H(U,A,Z)<<C,this.words[Y]|=V&67108863,C>=18)C-=18,Y+=1,this.words[Y]|=V>>>26;else C+=8}this.strip()};function F(U,A,X,Z){var C=0,Y=Math.min(U.length,X);for(var V=A;V<Y;V++){var G=U.charCodeAt(V)-48;if(C*=Z,G>=49)C+=G-49+10;else if(G>=17)C+=G-17+10;else C+=G}return C}Q.prototype._parseBase=function(U,A,X){this.words=[0],this.length=1;for(var Z=0,C=1;C<=67108863;C*=A)Z++;Z--,C=C/A|0;var Y=U.length-X,V=Y%Z,G=Math.min(Y,Y-V)+X,O=0;for(var J=X;J<G;J+=Z)if(O=F(U,J,J+Z,A),this.imuln(C),this.words[0]+O<67108864)this.words[0]+=O;else this._iaddn(O);if(V!==0){var z=1;O=F(U,J,U.length,A);for(J=0;J<V;J++)z*=A;if(this.imuln(z),this.words[0]+O<67108864)this.words[0]+=O;else this._iaddn(O)}this.strip()},Q.prototype.copy=function(U){U.words=Array(this.length);for(var A=0;A<this.length;A++)U.words[A]=this.words[A];U.length=this.length,U.negative=this.negative,U.red=this.red},Q.prototype.clone=function(){var U=new Q(null);return this.copy(U),U},Q.prototype._expand=function(U){while(this.length<U)this.words[this.length++]=0;return this},Q.prototype.strip=function(){while(this.length>1&&this.words[this.length-1]===0)this.length--;return this._normSign()},Q.prototype._normSign=function(){if(this.length===1&&this.words[0]===0)this.negative=0;return this},Q.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var R=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],D=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],q=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64000000,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,24300000,28629151,33554432,39135393,45435424,52521875,60466176];if(Q.prototype.toString=function(U,A){U=U||10,A=A|0||1;var X;if(U===16||U==="hex"){X="";var Z=0,C=0;for(var Y=0;Y<this.length;Y++){var V=this.words[Y],G=((V<<Z|C)&16777215).toString(16);if(C=V>>>24-Z&16777215,Z+=2,Z>=26)Z-=26,Y--;if(C!==0||Y!==this.length-1)X=R[6-G.length]+G+X;else X=G+X}if(C!==0)X=C.toString(16)+X;while(X.length%A!==0)X="0"+X;if(this.negative!==0)X="-"+X;return X}if(U===(U|0)&&U>=2&&U<=36){var O=D[U],J=q[U];X="";var z=this.clone();z.negative=0;while(!z.isZero()){var W=z.modn(J).toString(U);if(z=z.idivn(J),!z.isZero())X=R[O-W.length]+W+X;else X=W+X}if(this.isZero())X="0"+X;while(X.length%A!==0)X="0"+X;if(this.negative!==0)X="-"+X;return X}S(!1,"Base should be between 2 and 36")},Q.prototype.toNumber=function(){var U=this.words[0];if(this.length===2)U+=this.words[1]*67108864;else if(this.length===3&&this.words[2]===1)U+=4503599627370496+this.words[1]*67108864;else if(this.length>2)S(!1,"Number can only safely store up to 53 bits");return this.negative!==0?-U:U},Q.prototype.toJSON=function(){return this.toString(16)},Q.prototype.toBuffer=function(U,A){return S(typeof T<"u"),this.toArrayLike(T,U,A)},Q.prototype.toArray=function(U,A){return this.toArrayLike(Array,U,A)},Q.prototype.toArrayLike=function(U,A,X){var Z=this.byteLength(),C=X||Math.max(1,Z);S(Z<=C,"byte array longer than desired length"),S(C>0,"Requested array length <= 0"),this.strip();var Y=A==="le",V=new U(C),G,O,J=this.clone();if(!Y){for(O=0;O<C-Z;O++)V[O]=0;for(O=0;!J.isZero();O++)G=J.andln(255),J.iushrn(8),V[C-O-1]=G}else{for(O=0;!J.isZero();O++)G=J.andln(255),J.iushrn(8),V[O]=G;for(;O<C;O++)V[O]=0}return V},Math.clz32)Q.prototype._countBits=function(U){return 32-Math.clz32(U)};else Q.prototype._countBits=function(U){var A=U,X=0;if(A>=4096)X+=13,A>>>=13;if(A>=64)X+=7,A>>>=7;if(A>=8)X+=4,A>>>=4;if(A>=2)X+=2,A>>>=2;return X+A};Q.prototype._zeroBits=function(U){if(U===0)return 26;var A=U,X=0;if((A&8191)===0)X+=13,A>>>=13;if((A&127)===0)X+=7,A>>>=7;if((A&15)===0)X+=4,A>>>=4;if((A&3)===0)X+=2,A>>>=2;if((A&1)===0)X++;return X},Q.prototype.bitLength=function(){var U=this.words[this.length-1],A=this._countBits(U);return(this.length-1)*26+A};function P(U){var A=Array(U.bitLength());for(var X=0;X<A.length;X++){var Z=X/26|0,C=X%26;A[X]=(U.words[Z]&1<<C)>>>C}return A}Q.prototype.zeroBits=function(){if(this.isZero())return 0;var U=0;for(var A=0;A<this.length;A++){var X=this._zeroBits(this.words[A]);if(U+=X,X!==26)break}return U},Q.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},Q.prototype.toTwos=function(U){if(this.negative!==0)return this.abs().inotn(U).iaddn(1);return this.clone()},Q.prototype.fromTwos=function(U){if(this.testn(U-1))return this.notn(U).iaddn(1).ineg();return this.clone()},Q.prototype.isNeg=function(){return this.negative!==0},Q.prototype.neg=function(){return this.clone().ineg()},Q.prototype.ineg=function(){if(!this.isZero())this.negative^=1;return this},Q.prototype.iuor=function(U){while(this.length<U.length)this.words[this.length++]=0;for(var A=0;A<U.length;A++)this.words[A]=this.words[A]|U.words[A];return this.strip()},Q.prototype.ior=function(U){return S((this.negative|U.negative)===0),this.iuor(U)},Q.prototype.or=function(U){if(this.length>U.length)return this.clone().ior(U);return U.clone().ior(this)},Q.prototype.uor=function(U){if(this.length>U.length)return this.clone().iuor(U);return U.clone().iuor(this)},Q.prototype.iuand=function(U){var A;if(this.length>U.length)A=U;else A=this;for(var X=0;X<A.length;X++)this.words[X]=this.words[X]&U.words[X];return this.length=A.length,this.strip()},Q.prototype.iand=function(U){return S((this.negative|U.negative)===0),this.iuand(U)},Q.prototype.and=function(U){if(this.length>U.length)return this.clone().iand(U);return U.clone().iand(this)},Q.prototype.uand=function(U){if(this.length>U.length)return this.clone().iuand(U);return U.clone().iuand(this)},Q.prototype.iuxor=function(U){var A,X;if(this.length>U.length)A=this,X=U;else A=U,X=this;for(var Z=0;Z<X.length;Z++)this.words[Z]=A.words[Z]^X.words[Z];if(this!==A)for(;Z<A.length;Z++)this.words[Z]=A.words[Z];return this.length=A.length,this.strip()},Q.prototype.ixor=function(U){return S((this.negative|U.negative)===0),this.iuxor(U)},Q.prototype.xor=function(U){if(this.length>U.length)return this.clone().ixor(U);return U.clone().ixor(this)},Q.prototype.uxor=function(U){if(this.length>U.length)return this.clone().iuxor(U);return U.clone().iuxor(this)},Q.prototype.inotn=function(U){S(typeof U==="number"&&U>=0);var A=Math.ceil(U/26)|0,X=U%26;if(this._expand(A),X>0)A--;for(var Z=0;Z<A;Z++)this.words[Z]=~this.words[Z]&67108863;if(X>0)this.words[Z]=~this.words[Z]&67108863>>26-X;return this.strip()},Q.prototype.notn=function(U){return this.clone().inotn(U)},Q.prototype.setn=function(U,A){S(typeof U==="number"&&U>=0);var X=U/26|0,Z=U%26;if(this._expand(X+1),A)this.words[X]=this.words[X]|1<<Z;else this.words[X]=this.words[X]&~(1<<Z);return this.strip()},Q.prototype.iadd=function(U){var A;if(this.negative!==0&&U.negative===0)return this.negative=0,A=this.isub(U),this.negative^=1,this._normSign();else if(this.negative===0&&U.negative!==0)return U.negative=0,A=this.isub(U),U.negative=1,A._normSign();var X,Z;if(this.length>U.length)X=this,Z=U;else X=U,Z=this;var C=0;for(var Y=0;Y<Z.length;Y++)A=(X.words[Y]|0)+(Z.words[Y]|0)+C,this.words[Y]=A&67108863,C=A>>>26;for(;C!==0&&Y<X.length;Y++)A=(X.words[Y]|0)+C,this.words[Y]=A&67108863,C=A>>>26;if(this.length=X.length,C!==0)this.words[this.length]=C,this.length++;else if(X!==this)for(;Y<X.length;Y++)this.words[Y]=X.words[Y];return this},Q.prototype.add=function(U){var A;if(U.negative!==0&&this.negative===0)return U.negative=0,A=this.sub(U),U.negative^=1,A;else if(U.negative===0&&this.negative!==0)return this.negative=0,A=U.sub(this),this.negative=1,A;if(this.length>U.length)return this.clone().iadd(U);return U.clone().iadd(this)},Q.prototype.isub=function(U){if(U.negative!==0){U.negative=0;var A=this.iadd(U);return U.negative=1,A._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(U),this.negative=1,this._normSign();var X=this.cmp(U);if(X===0)return this.negative=0,this.length=1,this.words[0]=0,this;var Z,C;if(X>0)Z=this,C=U;else Z=U,C=this;var Y=0;for(var V=0;V<C.length;V++)A=(Z.words[V]|0)-(C.words[V]|0)+Y,Y=A>>26,this.words[V]=A&67108863;for(;Y!==0&&V<Z.length;V++)A=(Z.words[V]|0)+Y,Y=A>>26,this.words[V]=A&67108863;if(Y===0&&V<Z.length&&Z!==this)for(;V<Z.length;V++)this.words[V]=Z.words[V];if(this.length=Math.max(this.length,V),Z!==this)this.negative=1;return this.strip()},Q.prototype.sub=function(U){return this.clone().isub(U)};function _(U,A,X){X.negative=A.negative^U.negative;var Z=U.length+A.length|0;X.length=Z,Z=Z-1|0;var C=U.words[0]|0,Y=A.words[0]|0,V=C*Y,G=V&67108863,O=V/67108864|0;X.words[0]=G;for(var J=1;J<Z;J++){var z=O>>>26,W=O&67108863,j=Math.min(J,A.length-1);for(var N=Math.max(0,J-U.length+1);N<=j;N++){var p=J-N|0;C=U.words[p]|0,Y=A.words[N]|0,V=C*Y+W,z+=V/67108864|0,W=V&67108863}X.words[J]=W|0,O=z|0}if(O!==0)X.words[J]=O|0;else X.length--;return X.strip()}var k=function(U,A,X){var Z=U.words,C=A.words,Y=X.words,V=0,G,O,J,z=Z[0]|0,W=z&8191,j=z>>>13,N=Z[1]|0,p=N&8191,n=N>>>13,E0=Z[2]|0,r=E0&8191,d=E0>>>13,A0=Z[3]|0,t=A0&8191,i=A0>>>13,N0=Z[4]|0,y=N0&8191,h=N0>>>13,$0=Z[5]|0,m=$0&8191,a=$0>>>13,W0=Z[6]|0,c=W0&8191,o=W0>>>13,x0=Z[7]|0,s=x0&8191,Z0=x0>>>13,w0=Z[8]|0,S0=w0&8191,V0=w0>>>13,m0=Z[9]|0,J0=m0&8191,L0=m0>>>13,a0=C[0]|0,K0=a0&8191,D0=a0>>>13,WU=C[1]|0,F0=WU&8191,k0=WU>>>13,FU=C[2]|0,_0=FU&8191,M0=FU>>>13,KU=C[3]|0,j0=KU&8191,z0=KU>>>13,SU=C[4]|0,v0=SU&8191,B0=SU>>>13,VU=C[5]|0,T0=VU&8191,x=VU>>>13,l=C[6]|0,e=l&8191,U0=l>>>13,f0=C[7]|0,Y0=f0&8191,R0=f0>>>13,r0=C[8]|0,q0=r0&8191,g0=r0>>>13,HU=C[9]|0,P0=HU&8191,H0=HU>>>13;X.negative=U.negative^A.negative,X.length=19,G=Math.imul(W,K0),O=Math.imul(W,D0),O=O+Math.imul(j,K0)|0,J=Math.imul(j,D0);var e0=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(e0>>>26)|0,e0&=67108863,G=Math.imul(p,K0),O=Math.imul(p,D0),O=O+Math.imul(n,K0)|0,J=Math.imul(n,D0),G=G+Math.imul(W,F0)|0,O=O+Math.imul(W,k0)|0,O=O+Math.imul(j,F0)|0,J=J+Math.imul(j,k0)|0;var c0=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(c0>>>26)|0,c0&=67108863,G=Math.imul(r,K0),O=Math.imul(r,D0),O=O+Math.imul(d,K0)|0,J=Math.imul(d,D0),G=G+Math.imul(p,F0)|0,O=O+Math.imul(p,k0)|0,O=O+Math.imul(n,F0)|0,J=J+Math.imul(n,k0)|0,G=G+Math.imul(W,_0)|0,O=O+Math.imul(W,M0)|0,O=O+Math.imul(j,_0)|0,J=J+Math.imul(j,M0)|0;var y0=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(y0>>>26)|0,y0&=67108863,G=Math.imul(t,K0),O=Math.imul(t,D0),O=O+Math.imul(i,K0)|0,J=Math.imul(i,D0),G=G+Math.imul(r,F0)|0,O=O+Math.imul(r,k0)|0,O=O+Math.imul(d,F0)|0,J=J+Math.imul(d,k0)|0,G=G+Math.imul(p,_0)|0,O=O+Math.imul(p,M0)|0,O=O+Math.imul(n,_0)|0,J=J+Math.imul(n,M0)|0,G=G+Math.imul(W,j0)|0,O=O+Math.imul(W,z0)|0,O=O+Math.imul(j,j0)|0,J=J+Math.imul(j,z0)|0;var o0=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(o0>>>26)|0,o0&=67108863,G=Math.imul(y,K0),O=Math.imul(y,D0),O=O+Math.imul(h,K0)|0,J=Math.imul(h,D0),G=G+Math.imul(t,F0)|0,O=O+Math.imul(t,k0)|0,O=O+Math.imul(i,F0)|0,J=J+Math.imul(i,k0)|0,G=G+Math.imul(r,_0)|0,O=O+Math.imul(r,M0)|0,O=O+Math.imul(d,_0)|0,J=J+Math.imul(d,M0)|0,G=G+Math.imul(p,j0)|0,O=O+Math.imul(p,z0)|0,O=O+Math.imul(n,j0)|0,J=J+Math.imul(n,z0)|0,G=G+Math.imul(W,v0)|0,O=O+Math.imul(W,B0)|0,O=O+Math.imul(j,v0)|0,J=J+Math.imul(j,B0)|0;var b0=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(b0>>>26)|0,b0&=67108863,G=Math.imul(m,K0),O=Math.imul(m,D0),O=O+Math.imul(a,K0)|0,J=Math.imul(a,D0),G=G+Math.imul(y,F0)|0,O=O+Math.imul(y,k0)|0,O=O+Math.imul(h,F0)|0,J=J+Math.imul(h,k0)|0,G=G+Math.imul(t,_0)|0,O=O+Math.imul(t,M0)|0,O=O+Math.imul(i,_0)|0,J=J+Math.imul(i,M0)|0,G=G+Math.imul(r,j0)|0,O=O+Math.imul(r,z0)|0,O=O+Math.imul(d,j0)|0,J=J+Math.imul(d,z0)|0,G=G+Math.imul(p,v0)|0,O=O+Math.imul(p,B0)|0,O=O+Math.imul(n,v0)|0,J=J+Math.imul(n,B0)|0,G=G+Math.imul(W,T0)|0,O=O+Math.imul(W,x)|0,O=O+Math.imul(j,T0)|0,J=J+Math.imul(j,x)|0;var i0=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(i0>>>26)|0,i0&=67108863,G=Math.imul(c,K0),O=Math.imul(c,D0),O=O+Math.imul(o,K0)|0,J=Math.imul(o,D0),G=G+Math.imul(m,F0)|0,O=O+Math.imul(m,k0)|0,O=O+Math.imul(a,F0)|0,J=J+Math.imul(a,k0)|0,G=G+Math.imul(y,_0)|0,O=O+Math.imul(y,M0)|0,O=O+Math.imul(h,_0)|0,J=J+Math.imul(h,M0)|0,G=G+Math.imul(t,j0)|0,O=O+Math.imul(t,z0)|0,O=O+Math.imul(i,j0)|0,J=J+Math.imul(i,z0)|0,G=G+Math.imul(r,v0)|0,O=O+Math.imul(r,B0)|0,O=O+Math.imul(d,v0)|0,J=J+Math.imul(d,B0)|0,G=G+Math.imul(p,T0)|0,O=O+Math.imul(p,x)|0,O=O+Math.imul(n,T0)|0,J=J+Math.imul(n,x)|0,G=G+Math.imul(W,e)|0,O=O+Math.imul(W,U0)|0,O=O+Math.imul(j,e)|0,J=J+Math.imul(j,U0)|0;var UU=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(UU>>>26)|0,UU&=67108863,G=Math.imul(s,K0),O=Math.imul(s,D0),O=O+Math.imul(Z0,K0)|0,J=Math.imul(Z0,D0),G=G+Math.imul(c,F0)|0,O=O+Math.imul(c,k0)|0,O=O+Math.imul(o,F0)|0,J=J+Math.imul(o,k0)|0,G=G+Math.imul(m,_0)|0,O=O+Math.imul(m,M0)|0,O=O+Math.imul(a,_0)|0,J=J+Math.imul(a,M0)|0,G=G+Math.imul(y,j0)|0,O=O+Math.imul(y,z0)|0,O=O+Math.imul(h,j0)|0,J=J+Math.imul(h,z0)|0,G=G+Math.imul(t,v0)|0,O=O+Math.imul(t,B0)|0,O=O+Math.imul(i,v0)|0,J=J+Math.imul(i,B0)|0,G=G+Math.imul(r,T0)|0,O=O+Math.imul(r,x)|0,O=O+Math.imul(d,T0)|0,J=J+Math.imul(d,x)|0,G=G+Math.imul(p,e)|0,O=O+Math.imul(p,U0)|0,O=O+Math.imul(n,e)|0,J=J+Math.imul(n,U0)|0,G=G+Math.imul(W,Y0)|0,O=O+Math.imul(W,R0)|0,O=O+Math.imul(j,Y0)|0,J=J+Math.imul(j,R0)|0;var OU=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(OU>>>26)|0,OU&=67108863,G=Math.imul(S0,K0),O=Math.imul(S0,D0),O=O+Math.imul(V0,K0)|0,J=Math.imul(V0,D0),G=G+Math.imul(s,F0)|0,O=O+Math.imul(s,k0)|0,O=O+Math.imul(Z0,F0)|0,J=J+Math.imul(Z0,k0)|0,G=G+Math.imul(c,_0)|0,O=O+Math.imul(c,M0)|0,O=O+Math.imul(o,_0)|0,J=J+Math.imul(o,M0)|0,G=G+Math.imul(m,j0)|0,O=O+Math.imul(m,z0)|0,O=O+Math.imul(a,j0)|0,J=J+Math.imul(a,z0)|0,G=G+Math.imul(y,v0)|0,O=O+Math.imul(y,B0)|0,O=O+Math.imul(h,v0)|0,J=J+Math.imul(h,B0)|0,G=G+Math.imul(t,T0)|0,O=O+Math.imul(t,x)|0,O=O+Math.imul(i,T0)|0,J=J+Math.imul(i,x)|0,G=G+Math.imul(r,e)|0,O=O+Math.imul(r,U0)|0,O=O+Math.imul(d,e)|0,J=J+Math.imul(d,U0)|0,G=G+Math.imul(p,Y0)|0,O=O+Math.imul(p,R0)|0,O=O+Math.imul(n,Y0)|0,J=J+Math.imul(n,R0)|0,G=G+Math.imul(W,q0)|0,O=O+Math.imul(W,g0)|0,O=O+Math.imul(j,q0)|0,J=J+Math.imul(j,g0)|0;var ZU=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(ZU>>>26)|0,ZU&=67108863,G=Math.imul(J0,K0),O=Math.imul(J0,D0),O=O+Math.imul(L0,K0)|0,J=Math.imul(L0,D0),G=G+Math.imul(S0,F0)|0,O=O+Math.imul(S0,k0)|0,O=O+Math.imul(V0,F0)|0,J=J+Math.imul(V0,k0)|0,G=G+Math.imul(s,_0)|0,O=O+Math.imul(s,M0)|0,O=O+Math.imul(Z0,_0)|0,J=J+Math.imul(Z0,M0)|0,G=G+Math.imul(c,j0)|0,O=O+Math.imul(c,z0)|0,O=O+Math.imul(o,j0)|0,J=J+Math.imul(o,z0)|0,G=G+Math.imul(m,v0)|0,O=O+Math.imul(m,B0)|0,O=O+Math.imul(a,v0)|0,J=J+Math.imul(a,B0)|0,G=G+Math.imul(y,T0)|0,O=O+Math.imul(y,x)|0,O=O+Math.imul(h,T0)|0,J=J+Math.imul(h,x)|0,G=G+Math.imul(t,e)|0,O=O+Math.imul(t,U0)|0,O=O+Math.imul(i,e)|0,J=J+Math.imul(i,U0)|0,G=G+Math.imul(r,Y0)|0,O=O+Math.imul(r,R0)|0,O=O+Math.imul(d,Y0)|0,J=J+Math.imul(d,R0)|0,G=G+Math.imul(p,q0)|0,O=O+Math.imul(p,g0)|0,O=O+Math.imul(n,q0)|0,J=J+Math.imul(n,g0)|0,G=G+Math.imul(W,P0)|0,O=O+Math.imul(W,H0)|0,O=O+Math.imul(j,P0)|0,J=J+Math.imul(j,H0)|0;var AU=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(AU>>>26)|0,AU&=67108863,G=Math.imul(J0,F0),O=Math.imul(J0,k0),O=O+Math.imul(L0,F0)|0,J=Math.imul(L0,k0),G=G+Math.imul(S0,_0)|0,O=O+Math.imul(S0,M0)|0,O=O+Math.imul(V0,_0)|0,J=J+Math.imul(V0,M0)|0,G=G+Math.imul(s,j0)|0,O=O+Math.imul(s,z0)|0,O=O+Math.imul(Z0,j0)|0,J=J+Math.imul(Z0,z0)|0,G=G+Math.imul(c,v0)|0,O=O+Math.imul(c,B0)|0,O=O+Math.imul(o,v0)|0,J=J+Math.imul(o,B0)|0,G=G+Math.imul(m,T0)|0,O=O+Math.imul(m,x)|0,O=O+Math.imul(a,T0)|0,J=J+Math.imul(a,x)|0,G=G+Math.imul(y,e)|0,O=O+Math.imul(y,U0)|0,O=O+Math.imul(h,e)|0,J=J+Math.imul(h,U0)|0,G=G+Math.imul(t,Y0)|0,O=O+Math.imul(t,R0)|0,O=O+Math.imul(i,Y0)|0,J=J+Math.imul(i,R0)|0,G=G+Math.imul(r,q0)|0,O=O+Math.imul(r,g0)|0,O=O+Math.imul(d,q0)|0,J=J+Math.imul(d,g0)|0,G=G+Math.imul(p,P0)|0,O=O+Math.imul(p,H0)|0,O=O+Math.imul(n,P0)|0,J=J+Math.imul(n,H0)|0;var $U=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+($U>>>26)|0,$U&=67108863,G=Math.imul(J0,_0),O=Math.imul(J0,M0),O=O+Math.imul(L0,_0)|0,J=Math.imul(L0,M0),G=G+Math.imul(S0,j0)|0,O=O+Math.imul(S0,z0)|0,O=O+Math.imul(V0,j0)|0,J=J+Math.imul(V0,z0)|0,G=G+Math.imul(s,v0)|0,O=O+Math.imul(s,B0)|0,O=O+Math.imul(Z0,v0)|0,J=J+Math.imul(Z0,B0)|0,G=G+Math.imul(c,T0)|0,O=O+Math.imul(c,x)|0,O=O+Math.imul(o,T0)|0,J=J+Math.imul(o,x)|0,G=G+Math.imul(m,e)|0,O=O+Math.imul(m,U0)|0,O=O+Math.imul(a,e)|0,J=J+Math.imul(a,U0)|0,G=G+Math.imul(y,Y0)|0,O=O+Math.imul(y,R0)|0,O=O+Math.imul(h,Y0)|0,J=J+Math.imul(h,R0)|0,G=G+Math.imul(t,q0)|0,O=O+Math.imul(t,g0)|0,O=O+Math.imul(i,q0)|0,J=J+Math.imul(i,g0)|0,G=G+Math.imul(r,P0)|0,O=O+Math.imul(r,H0)|0,O=O+Math.imul(d,P0)|0,J=J+Math.imul(d,H0)|0;var IU=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(IU>>>26)|0,IU&=67108863,G=Math.imul(J0,j0),O=Math.imul(J0,z0),O=O+Math.imul(L0,j0)|0,J=Math.imul(L0,z0),G=G+Math.imul(S0,v0)|0,O=O+Math.imul(S0,B0)|0,O=O+Math.imul(V0,v0)|0,J=J+Math.imul(V0,B0)|0,G=G+Math.imul(s,T0)|0,O=O+Math.imul(s,x)|0,O=O+Math.imul(Z0,T0)|0,J=J+Math.imul(Z0,x)|0,G=G+Math.imul(c,e)|0,O=O+Math.imul(c,U0)|0,O=O+Math.imul(o,e)|0,J=J+Math.imul(o,U0)|0,G=G+Math.imul(m,Y0)|0,O=O+Math.imul(m,R0)|0,O=O+Math.imul(a,Y0)|0,J=J+Math.imul(a,R0)|0,G=G+Math.imul(y,q0)|0,O=O+Math.imul(y,g0)|0,O=O+Math.imul(h,q0)|0,J=J+Math.imul(h,g0)|0,G=G+Math.imul(t,P0)|0,O=O+Math.imul(t,H0)|0,O=O+Math.imul(i,P0)|0,J=J+Math.imul(i,H0)|0;var CU=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(CU>>>26)|0,CU&=67108863,G=Math.imul(J0,v0),O=Math.imul(J0,B0),O=O+Math.imul(L0,v0)|0,J=Math.imul(L0,B0),G=G+Math.imul(S0,T0)|0,O=O+Math.imul(S0,x)|0,O=O+Math.imul(V0,T0)|0,J=J+Math.imul(V0,x)|0,G=G+Math.imul(s,e)|0,O=O+Math.imul(s,U0)|0,O=O+Math.imul(Z0,e)|0,J=J+Math.imul(Z0,U0)|0,G=G+Math.imul(c,Y0)|0,O=O+Math.imul(c,R0)|0,O=O+Math.imul(o,Y0)|0,J=J+Math.imul(o,R0)|0,G=G+Math.imul(m,q0)|0,O=O+Math.imul(m,g0)|0,O=O+Math.imul(a,q0)|0,J=J+Math.imul(a,g0)|0,G=G+Math.imul(y,P0)|0,O=O+Math.imul(y,H0)|0,O=O+Math.imul(h,P0)|0,J=J+Math.imul(h,H0)|0;var QU=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(QU>>>26)|0,QU&=67108863,G=Math.imul(J0,T0),O=Math.imul(J0,x),O=O+Math.imul(L0,T0)|0,J=Math.imul(L0,x),G=G+Math.imul(S0,e)|0,O=O+Math.imul(S0,U0)|0,O=O+Math.imul(V0,e)|0,J=J+Math.imul(V0,U0)|0,G=G+Math.imul(s,Y0)|0,O=O+Math.imul(s,R0)|0,O=O+Math.imul(Z0,Y0)|0,J=J+Math.imul(Z0,R0)|0,G=G+Math.imul(c,q0)|0,O=O+Math.imul(c,g0)|0,O=O+Math.imul(o,q0)|0,J=J+Math.imul(o,g0)|0,G=G+Math.imul(m,P0)|0,O=O+Math.imul(m,H0)|0,O=O+Math.imul(a,P0)|0,J=J+Math.imul(a,H0)|0;var XU=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(XU>>>26)|0,XU&=67108863,G=Math.imul(J0,e),O=Math.imul(J0,U0),O=O+Math.imul(L0,e)|0,J=Math.imul(L0,U0),G=G+Math.imul(S0,Y0)|0,O=O+Math.imul(S0,R0)|0,O=O+Math.imul(V0,Y0)|0,J=J+Math.imul(V0,R0)|0,G=G+Math.imul(s,q0)|0,O=O+Math.imul(s,g0)|0,O=O+Math.imul(Z0,q0)|0,J=J+Math.imul(Z0,g0)|0,G=G+Math.imul(c,P0)|0,O=O+Math.imul(c,H0)|0,O=O+Math.imul(o,P0)|0,J=J+Math.imul(o,H0)|0;var GU=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(GU>>>26)|0,GU&=67108863,G=Math.imul(J0,Y0),O=Math.imul(J0,R0),O=O+Math.imul(L0,Y0)|0,J=Math.imul(L0,R0),G=G+Math.imul(S0,q0)|0,O=O+Math.imul(S0,g0)|0,O=O+Math.imul(V0,q0)|0,J=J+Math.imul(V0,g0)|0,G=G+Math.imul(s,P0)|0,O=O+Math.imul(s,H0)|0,O=O+Math.imul(Z0,P0)|0,J=J+Math.imul(Z0,H0)|0;var EU=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(EU>>>26)|0,EU&=67108863,G=Math.imul(J0,q0),O=Math.imul(J0,g0),O=O+Math.imul(L0,q0)|0,J=Math.imul(L0,g0),G=G+Math.imul(S0,P0)|0,O=O+Math.imul(S0,H0)|0,O=O+Math.imul(V0,P0)|0,J=J+Math.imul(V0,H0)|0;var JU=(V+G|0)+((O&8191)<<13)|0;V=(J+(O>>>13)|0)+(JU>>>26)|0,JU&=67108863,G=Math.imul(J0,P0),O=Math.imul(J0,H0),O=O+Math.imul(L0,P0)|0,J=Math.imul(L0,H0);var YU=(V+G|0)+((O&8191)<<13)|0;if(V=(J+(O>>>13)|0)+(YU>>>26)|0,YU&=67108863,Y[0]=e0,Y[1]=c0,Y[2]=y0,Y[3]=o0,Y[4]=b0,Y[5]=i0,Y[6]=UU,Y[7]=OU,Y[8]=ZU,Y[9]=AU,Y[10]=$U,Y[11]=IU,Y[12]=CU,Y[13]=QU,Y[14]=XU,Y[15]=GU,Y[16]=EU,Y[17]=JU,Y[18]=YU,V!==0)Y[19]=V,X.length++;return X};if(!Math.imul)k=_;function B(U,A,X){X.negative=A.negative^U.negative,X.length=U.length+A.length;var Z=0,C=0;for(var Y=0;Y<X.length-1;Y++){var V=C;C=0;var G=Z&67108863,O=Math.min(Y,A.length-1);for(var J=Math.max(0,Y-U.length+1);J<=O;J++){var z=Y-J,W=U.words[z]|0,j=A.words[J]|0,N=W*j,p=N&67108863;V=V+(N/67108864|0)|0,p=p+G|0,G=p&67108863,V=V+(p>>>26)|0,C+=V>>>26,V&=67108863}X.words[Y]=G,Z=V,V=C}if(Z!==0)X.words[Y]=Z;else X.length--;return X.strip()}function v(U,A,X){var Z=new g;return Z.mulp(U,A,X)}Q.prototype.mulTo=function(U,A){var X,Z=this.length+U.length;if(this.length===10&&U.length===10)X=k(this,U,A);else if(Z<63)X=_(this,U,A);else if(Z<1024)X=B(this,U,A);else X=v(this,U,A);return X};function g(U,A){this.x=U,this.y=A}g.prototype.makeRBT=function(U){var A=Array(U),X=Q.prototype._countBits(U)-1;for(var Z=0;Z<U;Z++)A[Z]=this.revBin(Z,X,U);return A},g.prototype.revBin=function(U,A,X){if(U===0||U===X-1)return U;var Z=0;for(var C=0;C<A;C++)Z|=(U&1)<<A-C-1,U>>=1;return Z},g.prototype.permute=function(U,A,X,Z,C,Y){for(var V=0;V<Y;V++)Z[V]=A[U[V]],C[V]=X[U[V]]},g.prototype.transform=function(U,A,X,Z,C,Y){this.permute(Y,U,A,X,Z,C);for(var V=1;V<C;V<<=1){var G=V<<1,O=Math.cos(2*Math.PI/G),J=Math.sin(2*Math.PI/G);for(var z=0;z<C;z+=G){var W=O,j=J;for(var N=0;N<V;N++){var p=X[z+N],n=Z[z+N],E0=X[z+N+V],r=Z[z+N+V],d=W*E0-j*r;if(r=W*r+j*E0,E0=d,X[z+N]=p+E0,Z[z+N]=n+r,X[z+N+V]=p-E0,Z[z+N+V]=n-r,N!==G)d=O*W-J*j,j=O*j+J*W,W=d}}}},g.prototype.guessLen13b=function(U,A){var X=Math.max(A,U)|1,Z=X&1,C=0;for(X=X/2|0;X;X=X>>>1)C++;return 1<<C+1+Z},g.prototype.conjugate=function(U,A,X){if(X<=1)return;for(var Z=0;Z<X/2;Z++){var C=U[Z];U[Z]=U[X-Z-1],U[X-Z-1]=C,C=A[Z],A[Z]=-A[X-Z-1],A[X-Z-1]=-C}},g.prototype.normalize13b=function(U,A){var X=0;for(var Z=0;Z<A/2;Z++){var C=Math.round(U[2*Z+1]/A)*8192+Math.round(U[2*Z]/A)+X;if(U[Z]=C&67108863,C<67108864)X=0;else X=C/67108864|0}return U},g.prototype.convert13b=function(U,A,X,Z){var C=0;for(var Y=0;Y<A;Y++)C=C+(U[Y]|0),X[2*Y]=C&8191,C=C>>>13,X[2*Y+1]=C&8191,C=C>>>13;for(Y=2*A;Y<Z;++Y)X[Y]=0;S(C===0),S((C&-8192)===0)},g.prototype.stub=function(U){var A=Array(U);for(var X=0;X<U;X++)A[X]=0;return A},g.prototype.mulp=function(U,A,X){var Z=2*this.guessLen13b(U.length,A.length),C=this.makeRBT(Z),Y=this.stub(Z),V=Array(Z),G=Array(Z),O=Array(Z),J=Array(Z),z=Array(Z),W=Array(Z),j=X.words;j.length=Z,this.convert13b(U.words,U.length,V,Z),this.convert13b(A.words,A.length,J,Z),this.transform(V,Y,G,O,Z,C),this.transform(J,Y,z,W,Z,C);for(var N=0;N<Z;N++){var p=G[N]*z[N]-O[N]*W[N];O[N]=G[N]*W[N]+O[N]*z[N],G[N]=p}return this.conjugate(G,O,Z),this.transform(G,O,j,Y,Z,C),this.conjugate(j,Y,Z),this.normalize13b(j,Z),X.negative=U.negative^A.negative,X.length=U.length+A.length,X.strip()},Q.prototype.mul=function(U){var A=new Q(null);return A.words=Array(this.length+U.length),this.mulTo(U,A)},Q.prototype.mulf=function(U){var A=new Q(null);return A.words=Array(this.length+U.length),v(this,U,A)},Q.prototype.imul=function(U){return this.clone().mulTo(U,this)},Q.prototype.imuln=function(U){S(typeof U==="number"),S(U<67108864);var A=0;for(var X=0;X<this.length;X++){var Z=(this.words[X]|0)*U,C=(Z&67108863)+(A&67108863);A>>=26,A+=Z/67108864|0,A+=C>>>26,this.words[X]=C&67108863}if(A!==0)this.words[X]=A,this.length++;return this.length=U===0?1:this.length,this},Q.prototype.muln=function(U){return this.clone().imuln(U)},Q.prototype.sqr=function(){return this.mul(this)},Q.prototype.isqr=function(){return this.imul(this.clone())},Q.prototype.pow=function(U){var A=P(U);if(A.length===0)return new Q(1);var X=this;for(var Z=0;Z<A.length;Z++,X=X.sqr())if(A[Z]!==0)break;if(++Z<A.length)for(var C=X.sqr();Z<A.length;Z++,C=C.sqr()){if(A[Z]===0)continue;X=X.mul(C)}return X},Q.prototype.iushln=function(U){S(typeof U==="number"&&U>=0);var A=U%26,X=(U-A)/26,Z=67108863>>>26-A<<26-A,C;if(A!==0){var Y=0;for(C=0;C<this.length;C++){var V=this.words[C]&Z,G=(this.words[C]|0)-V<<A;this.words[C]=G|Y,Y=V>>>26-A}if(Y)this.words[C]=Y,this.length++}if(X!==0){for(C=this.length-1;C>=0;C--)this.words[C+X]=this.words[C];for(C=0;C<X;C++)this.words[C]=0;this.length+=X}return this.strip()},Q.prototype.ishln=function(U){return S(this.negative===0),this.iushln(U)},Q.prototype.iushrn=function(U,A,X){S(typeof U==="number"&&U>=0);var Z;if(A)Z=(A-A%26)/26;else Z=0;var C=U%26,Y=Math.min((U-C)/26,this.length),V=67108863^67108863>>>C<<C,G=X;if(Z-=Y,Z=Math.max(0,Z),G){for(var O=0;O<Y;O++)G.words[O]=this.words[O];G.length=Y}if(Y===0);else if(this.length>Y){this.length-=Y;for(O=0;O<this.length;O++)this.words[O]=this.words[O+Y]}else this.words[0]=0,this.length=1;var J=0;for(O=this.length-1;O>=0&&(J!==0||O>=Z);O--){var z=this.words[O]|0;this.words[O]=J<<26-C|z>>>C,J=z&V}if(G&&J!==0)G.words[G.length++]=J;if(this.length===0)this.words[0]=0,this.length=1;return this.strip()},Q.prototype.ishrn=function(U,A,X){return S(this.negative===0),this.iushrn(U,A,X)},Q.prototype.shln=function(U){return this.clone().ishln(U)},Q.prototype.ushln=function(U){return this.clone().iushln(U)},Q.prototype.shrn=function(U){return this.clone().ishrn(U)},Q.prototype.ushrn=function(U){return this.clone().iushrn(U)},Q.prototype.testn=function(U){S(typeof U==="number"&&U>=0);var A=U%26,X=(U-A)/26,Z=1<<A;if(this.length<=X)return!1;var C=this.words[X];return!!(C&Z)},Q.prototype.imaskn=function(U){S(typeof U==="number"&&U>=0);var A=U%26,X=(U-A)/26;if(S(this.negative===0,"imaskn works only with positive numbers"),this.length<=X)return this;if(A!==0)X++;if(this.length=Math.min(X,this.length),A!==0){var Z=67108863^67108863>>>A<<A;this.words[this.length-1]&=Z}return this.strip()},Q.prototype.maskn=function(U){return this.clone().imaskn(U)},Q.prototype.iaddn=function(U){if(S(typeof U==="number"),S(U<67108864),U<0)return this.isubn(-U);if(this.negative!==0){if(this.length===1&&(this.words[0]|0)<U)return this.words[0]=U-(this.words[0]|0),this.negative=0,this;return this.negative=0,this.isubn(U),this.negative=1,this}return this._iaddn(U)},Q.prototype._iaddn=function(U){this.words[0]+=U;for(var A=0;A<this.length&&this.words[A]>=67108864;A++)if(this.words[A]-=67108864,A===this.length-1)this.words[A+1]=1;else this.words[A+1]++;return this.length=Math.max(this.length,A+1),this},Q.prototype.isubn=function(U){if(S(typeof U==="number"),S(U<67108864),U<0)return this.iaddn(-U);if(this.negative!==0)return this.negative=0,this.iaddn(U),this.negative=1,this;if(this.words[0]-=U,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var A=0;A<this.length&&this.words[A]<0;A++)this.words[A]+=67108864,this.words[A+1]-=1;return this.strip()},Q.prototype.addn=function(U){return this.clone().iaddn(U)},Q.prototype.subn=function(U){return this.clone().isubn(U)},Q.prototype.iabs=function(){return this.negative=0,this},Q.prototype.abs=function(){return this.clone().iabs()},Q.prototype._ishlnsubmul=function(U,A,X){var Z=U.length+X,C;this._expand(Z);var Y,V=0;for(C=0;C<U.length;C++){Y=(this.words[C+X]|0)+V;var G=(U.words[C]|0)*A;Y-=G&67108863,V=(Y>>26)-(G/67108864|0),this.words[C+X]=Y&67108863}for(;C<this.length-X;C++)Y=(this.words[C+X]|0)+V,V=Y>>26,this.words[C+X]=Y&67108863;if(V===0)return this.strip();S(V===-1),V=0;for(C=0;C<this.length;C++)Y=-(this.words[C]|0)+V,V=Y>>26,this.words[C]=Y&67108863;return this.negative=1,this.strip()},Q.prototype._wordDiv=function(U,A){var X=this.length-U.length,Z=this.clone(),C=U,Y=C.words[C.length-1]|0,V=this._countBits(Y);if(X=26-V,X!==0)C=C.ushln(X),Z.iushln(X),Y=C.words[C.length-1]|0;var G=Z.length-C.length,O;if(A!=="mod"){O=new Q(null),O.length=G+1,O.words=Array(O.length);for(var J=0;J<O.length;J++)O.words[J]=0}var z=Z.clone()._ishlnsubmul(C,1,G);if(z.negative===0){if(Z=z,O)O.words[G]=1}for(var W=G-1;W>=0;W--){var j=(Z.words[C.length+W]|0)*67108864+(Z.words[C.length+W-1]|0);j=Math.min(j/Y|0,67108863),Z._ishlnsubmul(C,j,W);while(Z.negative!==0)if(j--,Z.negative=0,Z._ishlnsubmul(C,1,W),!Z.isZero())Z.negative^=1;if(O)O.words[W]=j}if(O)O.strip();if(Z.strip(),A!=="div"&&X!==0)Z.iushrn(X);return{div:O||null,mod:Z}},Q.prototype.divmod=function(U,A,X){if(S(!U.isZero()),this.isZero())return{div:new Q(0),mod:new Q(0)};var Z,C,Y;if(this.negative!==0&&U.negative===0){if(Y=this.neg().divmod(U,A),A!=="mod")Z=Y.div.neg();if(A!=="div"){if(C=Y.mod.neg(),X&&C.negative!==0)C.iadd(U)}return{div:Z,mod:C}}if(this.negative===0&&U.negative!==0){if(Y=this.divmod(U.neg(),A),A!=="mod")Z=Y.div.neg();return{div:Z,mod:Y.mod}}if((this.negative&U.negative)!==0){if(Y=this.neg().divmod(U.neg(),A),A!=="div"){if(C=Y.mod.neg(),X&&C.negative!==0)C.isub(U)}return{div:Y.div,mod:C}}if(U.length>this.length||this.cmp(U)<0)return{div:new Q(0),mod:this};if(U.length===1){if(A==="div")return{div:this.divn(U.words[0]),mod:null};if(A==="mod")return{div:null,mod:new Q(this.modn(U.words[0]))};return{div:this.divn(U.words[0]),mod:new Q(this.modn(U.words[0]))}}return this._wordDiv(U,A)},Q.prototype.div=function(U){return this.divmod(U,"div",!1).div},Q.prototype.mod=function(U){return this.divmod(U,"mod",!1).mod},Q.prototype.umod=function(U){return this.divmod(U,"mod",!0).mod},Q.prototype.divRound=function(U){var A=this.divmod(U);if(A.mod.isZero())return A.div;var X=A.div.negative!==0?A.mod.isub(U):A.mod,Z=U.ushrn(1),C=U.andln(1),Y=X.cmp(Z);if(Y<0||C===1&&Y===0)return A.div;return A.div.negative!==0?A.div.isubn(1):A.div.iaddn(1)},Q.prototype.modn=function(U){S(U<=67108863);var A=67108864%U,X=0;for(var Z=this.length-1;Z>=0;Z--)X=(A*X+(this.words[Z]|0))%U;return X},Q.prototype.idivn=function(U){S(U<=67108863);var A=0;for(var X=this.length-1;X>=0;X--){var Z=(this.words[X]|0)+A*67108864;this.words[X]=Z/U|0,A=Z%U}return this.strip()},Q.prototype.divn=function(U){return this.clone().idivn(U)},Q.prototype.egcd=function(U){S(U.negative===0),S(!U.isZero());var A=this,X=U.clone();if(A.negative!==0)A=A.umod(U);else A=A.clone();var Z=new Q(1),C=new Q(0),Y=new Q(0),V=new Q(1),G=0;while(A.isEven()&&X.isEven())A.iushrn(1),X.iushrn(1),++G;var O=X.clone(),J=A.clone();while(!A.isZero()){for(var z=0,W=1;(A.words[0]&W)===0&&z<26;++z,W<<=1);if(z>0){A.iushrn(z);while(z-- >0){if(Z.isOdd()||C.isOdd())Z.iadd(O),C.isub(J);Z.iushrn(1),C.iushrn(1)}}for(var j=0,N=1;(X.words[0]&N)===0&&j<26;++j,N<<=1);if(j>0){X.iushrn(j);while(j-- >0){if(Y.isOdd()||V.isOdd())Y.iadd(O),V.isub(J);Y.iushrn(1),V.iushrn(1)}}if(A.cmp(X)>=0)A.isub(X),Z.isub(Y),C.isub(V);else X.isub(A),Y.isub(Z),V.isub(C)}return{a:Y,b:V,gcd:X.iushln(G)}},Q.prototype._invmp=function(U){S(U.negative===0),S(!U.isZero());var A=this,X=U.clone();if(A.negative!==0)A=A.umod(U);else A=A.clone();var Z=new Q(1),C=new Q(0),Y=X.clone();while(A.cmpn(1)>0&&X.cmpn(1)>0){for(var V=0,G=1;(A.words[0]&G)===0&&V<26;++V,G<<=1);if(V>0){A.iushrn(V);while(V-- >0){if(Z.isOdd())Z.iadd(Y);Z.iushrn(1)}}for(var O=0,J=1;(X.words[0]&J)===0&&O<26;++O,J<<=1);if(O>0){X.iushrn(O);while(O-- >0){if(C.isOdd())C.iadd(Y);C.iushrn(1)}}if(A.cmp(X)>=0)A.isub(X),Z.isub(C);else X.isub(A),C.isub(Z)}var z;if(A.cmpn(1)===0)z=Z;else z=C;if(z.cmpn(0)<0)z.iadd(U);return z},Q.prototype.gcd=function(U){if(this.isZero())return U.abs();if(U.isZero())return this.abs();var A=this.clone(),X=U.clone();A.negative=0,X.negative=0;for(var Z=0;A.isEven()&&X.isEven();Z++)A.iushrn(1),X.iushrn(1);do{while(A.isEven())A.iushrn(1);while(X.isEven())X.iushrn(1);var C=A.cmp(X);if(C<0){var Y=A;A=X,X=Y}else if(C===0||X.cmpn(1)===0)break;A.isub(X)}while(!0);return X.iushln(Z)},Q.prototype.invm=function(U){return this.egcd(U).a.umod(U)},Q.prototype.isEven=function(){return(this.words[0]&1)===0},Q.prototype.isOdd=function(){return(this.words[0]&1)===1},Q.prototype.andln=function(U){return this.words[0]&U},Q.prototype.bincn=function(U){S(typeof U==="number");var A=U%26,X=(U-A)/26,Z=1<<A;if(this.length<=X)return this._expand(X+1),this.words[X]|=Z,this;var C=Z;for(var Y=X;C!==0&&Y<this.length;Y++){var V=this.words[Y]|0;V+=C,C=V>>>26,V&=67108863,this.words[Y]=V}if(C!==0)this.words[Y]=C,this.length++;return this},Q.prototype.isZero=function(){return this.length===1&&this.words[0]===0},Q.prototype.cmpn=function(U){var A=U<0;if(this.negative!==0&&!A)return-1;if(this.negative===0&&A)return 1;this.strip();var X;if(this.length>1)X=1;else{if(A)U=-U;S(U<=67108863,"Number is too big");var Z=this.words[0]|0;X=Z===U?0:Z<U?-1:1}if(this.negative!==0)return-X|0;return X},Q.prototype.cmp=function(U){if(this.negative!==0&&U.negative===0)return-1;if(this.negative===0&&U.negative!==0)return 1;var A=this.ucmp(U);if(this.negative!==0)return-A|0;return A},Q.prototype.ucmp=function(U){if(this.length>U.length)return 1;if(this.length<U.length)return-1;var A=0;for(var X=this.length-1;X>=0;X--){var Z=this.words[X]|0,C=U.words[X]|0;if(Z===C)continue;if(Z<C)A=-1;else if(Z>C)A=1;break}return A},Q.prototype.gtn=function(U){return this.cmpn(U)===1},Q.prototype.gt=function(U){return this.cmp(U)===1},Q.prototype.gten=function(U){return this.cmpn(U)>=0},Q.prototype.gte=function(U){return this.cmp(U)>=0},Q.prototype.ltn=function(U){return this.cmpn(U)===-1},Q.prototype.lt=function(U){return this.cmp(U)===-1},Q.prototype.lten=function(U){return this.cmpn(U)<=0},Q.prototype.lte=function(U){return this.cmp(U)<=0},Q.prototype.eqn=function(U){return this.cmpn(U)===0},Q.prototype.eq=function(U){return this.cmp(U)===0},Q.red=function(U){return new u(U)},Q.prototype.toRed=function(U){return S(!this.red,"Already a number in reduction context"),S(this.negative===0,"red works only with positives"),U.convertTo(this)._forceRed(U)},Q.prototype.fromRed=function(){return S(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},Q.prototype._forceRed=function(U){return this.red=U,this},Q.prototype.forceRed=function(U){return S(!this.red,"Already a number in reduction context"),this._forceRed(U)},Q.prototype.redAdd=function(U){return S(this.red,"redAdd works only with red numbers"),this.red.add(this,U)},Q.prototype.redIAdd=function(U){return S(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,U)},Q.prototype.redSub=function(U){return S(this.red,"redSub works only with red numbers"),this.red.sub(this,U)},Q.prototype.redISub=function(U){return S(this.red,"redISub works only with red numbers"),this.red.isub(this,U)},Q.prototype.redShl=function(U){return S(this.red,"redShl works only with red numbers"),this.red.shl(this,U)},Q.prototype.redMul=function(U){return S(this.red,"redMul works only with red numbers"),this.red._verify2(this,U),this.red.mul(this,U)},Q.prototype.redIMul=function(U){return S(this.red,"redMul works only with red numbers"),this.red._verify2(this,U),this.red.imul(this,U)},Q.prototype.redSqr=function(){return S(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},Q.prototype.redISqr=function(){return S(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},Q.prototype.redSqrt=function(){return S(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},Q.prototype.redInvm=function(){return S(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},Q.prototype.redNeg=function(){return S(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},Q.prototype.redPow=function(U){return S(this.red&&!U.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,U)};var f={k256:null,p224:null,p192:null,p25519:null};function w(U,A){this.name=U,this.p=new Q(A,16),this.n=this.p.bitLength(),this.k=new Q(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}w.prototype._tmp=function(){var U=new Q(null);return U.words=Array(Math.ceil(this.n/13)),U},w.prototype.ireduce=function(U){var A=U,X;do this.split(A,this.tmp),A=this.imulK(A),A=A.iadd(this.tmp),X=A.bitLength();while(X>this.n);var Z=X<this.n?-1:A.ucmp(this.p);if(Z===0)A.words[0]=0,A.length=1;else if(Z>0)A.isub(this.p);else if(A.strip!==void 0)A.strip();else A._strip();return A},w.prototype.split=function(U,A){U.iushrn(this.n,0,A)},w.prototype.imulK=function(U){return U.imul(this.k)};function b(){w.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}K(b,w),b.prototype.split=function(U,A){var X=4194303,Z=Math.min(U.length,9);for(var C=0;C<Z;C++)A.words[C]=U.words[C];if(A.length=Z,U.length<=9){U.words[0]=0,U.length=1;return}var Y=U.words[9];A.words[A.length++]=Y&X;for(C=10;C<U.length;C++){var V=U.words[C]|0;U.words[C-10]=(V&X)<<4|Y>>>22,Y=V}if(Y>>>=22,U.words[C-10]=Y,Y===0&&U.length>10)U.length-=10;else U.length-=9},b.prototype.imulK=function(U){U.words[U.length]=0,U.words[U.length+1]=0,U.length+=2;var A=0;for(var X=0;X<U.length;X++){var Z=U.words[X]|0;A+=Z*977,U.words[X]=A&67108863,A=Z*64+(A/67108864|0)}if(U.words[U.length-1]===0){if(U.length--,U.words[U.length-1]===0)U.length--}return U};function I0(){w.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}K(I0,w);function X0(){w.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}K(X0,w);function C0(){w.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}K(C0,w),C0.prototype.imulK=function(U){var A=0;for(var X=0;X<U.length;X++){var Z=(U.words[X]|0)*19+A,C=Z&67108863;Z>>>=26,U.words[X]=C,A=Z}if(A!==0)U.words[U.length++]=A;return U},Q._prime=function(U){if(f[U])return f[U];var A;if(U==="k256")A=new b;else if(U==="p224")A=new I0;else if(U==="p192")A=new X0;else if(U==="p25519")A=new C0;else throw Error("Unknown prime "+U);return f[U]=A,A};function u(U){if(typeof U==="string"){var A=Q._prime(U);this.m=A.p,this.prime=A}else S(U.gtn(1),"modulus must be greater than 1"),this.m=U,this.prime=null}u.prototype._verify1=function(U){S(U.negative===0,"red works only with positives"),S(U.red,"red works only with red numbers")},u.prototype._verify2=function(U,A){S((U.negative|A.negative)===0,"red works only with positives"),S(U.red&&U.red===A.red,"red works only with red numbers")},u.prototype.imod=function(U){if(this.prime)return this.prime.ireduce(U)._forceRed(this);return U.umod(this.m)._forceRed(this)},u.prototype.neg=function(U){if(U.isZero())return U.clone();return this.m.sub(U)._forceRed(this)},u.prototype.add=function(U,A){this._verify2(U,A);var X=U.add(A);if(X.cmp(this.m)>=0)X.isub(this.m);return X._forceRed(this)},u.prototype.iadd=function(U,A){this._verify2(U,A);var X=U.iadd(A);if(X.cmp(this.m)>=0)X.isub(this.m);return X},u.prototype.sub=function(U,A){this._verify2(U,A);var X=U.sub(A);if(X.cmpn(0)<0)X.iadd(this.m);return X._forceRed(this)},u.prototype.isub=function(U,A){this._verify2(U,A);var X=U.isub(A);if(X.cmpn(0)<0)X.iadd(this.m);return X},u.prototype.shl=function(U,A){return this._verify1(U),this.imod(U.ushln(A))},u.prototype.imul=function(U,A){return this._verify2(U,A),this.imod(U.imul(A))},u.prototype.mul=function(U,A){return this._verify2(U,A),this.imod(U.mul(A))},u.prototype.isqr=function(U){return this.imul(U,U.clone())},u.prototype.sqr=function(U){return this.mul(U,U)},u.prototype.sqrt=function(U){if(U.isZero())return U.clone();var A=this.m.andln(3);if(S(A%2===1),A===3){var X=this.m.add(new Q(1)).iushrn(2);return this.pow(U,X)}var Z=this.m.subn(1),C=0;while(!Z.isZero()&&Z.andln(1)===0)C++,Z.iushrn(1);S(!Z.isZero());var Y=new Q(1).toRed(this),V=Y.redNeg(),G=this.m.subn(1).iushrn(1),O=this.m.bitLength();O=new Q(2*O*O).toRed(this);while(this.pow(O,G).cmp(V)!==0)O.redIAdd(V);var J=this.pow(O,Z),z=this.pow(U,Z.addn(1).iushrn(1)),W=this.pow(U,Z),j=C;while(W.cmp(Y)!==0){var N=W;for(var p=0;N.cmp(Y)!==0;p++)N=N.redSqr();S(p<j);var n=this.pow(J,new Q(1).iushln(j-p-1));z=z.redMul(n),J=n.redSqr(),W=W.redMul(J),j=p}return z},u.prototype.invm=function(U){var A=U._invmp(this.m);if(A.negative!==0)return A.negative=0,this.imod(A).redNeg();else return this.imod(A)},u.prototype.pow=function(U,A){if(A.isZero())return new Q(1).toRed(this);if(A.cmpn(1)===0)return U.clone();var X=4,Z=Array(1<<X);Z[0]=new Q(1).toRed(this),Z[1]=U;for(var C=2;C<Z.length;C++)Z[C]=this.mul(Z[C-1],U);var Y=Z[0],V=0,G=0,O=A.bitLength()%26;if(O===0)O=26;for(C=A.length-1;C>=0;C--){var J=A.words[C];for(var z=O-1;z>=0;z--){var W=J>>z&1;if(Y!==Z[0])Y=this.sqr(Y);if(W===0&&V===0){G=0;continue}if(V<<=1,V|=W,G++,G!==X&&(C!==0||z!==0))continue;Y=this.mul(Y,Z[V]),G=0,V=0}O=26}return Y},u.prototype.convertTo=function(U){var A=U.umod(this.m);return A===U?A.clone():A},u.prototype.convertFrom=function(U){var A=U.clone();return A.red=null,A},Q.mont=function(U){return new O0(U)};function O0(U){if(u.call(this,U),this.shift=this.m.bitLength(),this.shift%26!==0)this.shift+=26-this.shift%26;this.r=new Q(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}K(O0,u),O0.prototype.convertTo=function(U){return this.imod(U.ushln(this.shift))},O0.prototype.convertFrom=function(U){var A=this.imod(U.mul(this.rinv));return A.red=null,A},O0.prototype.imul=function(U,A){if(U.isZero()||A.isZero())return U.words[0]=0,U.length=1,U;var X=U.imul(A),Z=X.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),C=X.isub(Z).iushrn(this.shift),Y=C;if(C.cmp(this.m)>=0)Y=C.isub(this.m);else if(C.cmpn(0)<0)Y=C.iadd(this.m);return Y._forceRed(this)},O0.prototype.mul=function(U,A){if(U.isZero()||A.isZero())return new Q(0)._forceRed(this);var X=U.mul(A),Z=X.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),C=X.isub(Z).iushrn(this.shift),Y=C;if(C.cmp(this.m)>=0)Y=C.isub(this.m);else if(C.cmpn(0)<0)Y=C.iadd(this.m);return Y._forceRed(this)},O0.prototype.invm=function(U){var A=this.imod(U._invmp(this.m).mul(this.r2));return A._forceRed(this)}})(typeof I>"u"||I,$)}),AC=Q0(($,I)=>{var E=vA(),L=qU().Buffer;function S(K,Q){return L.from(K.toRed(E.mont(Q.modulus)).redPow(new E(Q.publicExponent)).fromRed().toArray())}I.exports=S}),JE=Q0(($,I)=>{(function(E,L){function S(Z,C){if(!Z)throw Error(C||"Assertion failed")}function K(Z,C){Z.super_=C;var Y=function(){};Y.prototype=C.prototype,Z.prototype=new Y,Z.prototype.constructor=Z}function Q(Z,C,Y){if(Q.isBN(Z))return Z;if(this.negative=0,this.words=null,this.length=0,this.red=null,Z!==null){if(C==="le"||C==="be")Y=C,C=10;this._init(Z||0,C||10,Y||"be")}}if(typeof E==="object")E.exports=Q;else L.BN=Q;Q.BN=Q,Q.wordSize=26;var T;try{if(typeof window<"u"&&typeof window.Buffer<"u")T=window.Buffer;else T=(DU(),l0(RU)).Buffer}catch(Z){}Q.isBN=function(Z){if(Z instanceof Q)return!0;return Z!==null&&typeof Z==="object"&&Z.constructor.wordSize===Q.wordSize&&Array.isArray(Z.words)},Q.max=function(Z,C){if(Z.cmp(C)>0)return Z;return C},Q.min=function(Z,C){if(Z.cmp(C)<0)return Z;return C},Q.prototype._init=function(Z,C,Y){if(typeof Z==="number")return this._initNumber(Z,C,Y);if(typeof Z==="object")return this._initArray(Z,C,Y);if(C==="hex")C=16;S(C===(C|0)&&C>=2&&C<=36),Z=Z.toString().replace(/\s+/g,"");var V=0;if(Z[0]==="-")V++,this.negative=1;if(V<Z.length){if(C===16)this._parseHex(Z,V,Y);else if(this._parseBase(Z,C,V),Y==="le")this._initArray(this.toArray(),C,Y)}},Q.prototype._initNumber=function(Z,C,Y){if(Z<0)this.negative=1,Z=-Z;if(Z<67108864)this.words=[Z&67108863],this.length=1;else if(Z<4503599627370496)this.words=[Z&67108863,Z/67108864&67108863],this.length=2;else S(Z<9007199254740992),this.words=[Z&67108863,Z/67108864&67108863,1],this.length=3;if(Y!=="le")return;this._initArray(this.toArray(),C,Y)},Q.prototype._initArray=function(Z,C,Y){if(S(typeof Z.length==="number"),Z.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(Z.length/3),this.words=Array(this.length);for(var V=0;V<this.length;V++)this.words[V]=0;var G,O,J=0;if(Y==="be"){for(V=Z.length-1,G=0;V>=0;V-=3)if(O=Z[V]|Z[V-1]<<8|Z[V-2]<<16,this.words[G]|=O<<J&67108863,this.words[G+1]=O>>>26-J&67108863,J+=24,J>=26)J-=26,G++}else if(Y==="le"){for(V=0,G=0;V<Z.length;V+=3)if(O=Z[V]|Z[V+1]<<8|Z[V+2]<<16,this.words[G]|=O<<J&67108863,this.words[G+1]=O>>>26-J&67108863,J+=24,J>=26)J-=26,G++}return this._strip()};function M(Z,C){var Y=Z.charCodeAt(C);if(Y>=48&&Y<=57)return Y-48;else if(Y>=65&&Y<=70)return Y-55;else if(Y>=97&&Y<=102)return Y-87;else S(!1,"Invalid character in "+Z)}function H(Z,C,Y){var V=M(Z,Y);if(Y-1>=C)V|=M(Z,Y-1)<<4;return V}Q.prototype._parseHex=function(Z,C,Y){this.length=Math.ceil((Z.length-C)/6),this.words=Array(this.length);for(var V=0;V<this.length;V++)this.words[V]=0;var G=0,O=0,J;if(Y==="be")for(V=Z.length-1;V>=C;V-=2)if(J=H(Z,C,V)<<G,this.words[O]|=J&67108863,G>=18)G-=18,O+=1,this.words[O]|=J>>>26;else G+=8;else{var z=Z.length-C;for(V=z%2===0?C+1:C;V<Z.length;V+=2)if(J=H(Z,C,V)<<G,this.words[O]|=J&67108863,G>=18)G-=18,O+=1,this.words[O]|=J>>>26;else G+=8}this._strip()};function F(Z,C,Y,V){var G=0,O=0,J=Math.min(Z.length,Y);for(var z=C;z<J;z++){var W=Z.charCodeAt(z)-48;if(G*=V,W>=49)O=W-49+10;else if(W>=17)O=W-17+10;else O=W;S(W>=0&&O<V,"Invalid character"),G+=O}return G}Q.prototype._parseBase=function(Z,C,Y){this.words=[0],this.length=1;for(var V=0,G=1;G<=67108863;G*=C)V++;V--,G=G/C|0;var O=Z.length-Y,J=O%V,z=Math.min(O,O-J)+Y,W=0;for(var j=Y;j<z;j+=V)if(W=F(Z,j,j+V,C),this.imuln(G),this.words[0]+W<67108864)this.words[0]+=W;else this._iaddn(W);if(J!==0){var N=1;W=F(Z,j,Z.length,C);for(j=0;j<J;j++)N*=C;if(this.imuln(N),this.words[0]+W<67108864)this.words[0]+=W;else this._iaddn(W)}this._strip()},Q.prototype.copy=function(Z){Z.words=Array(this.length);for(var C=0;C<this.length;C++)Z.words[C]=this.words[C];Z.length=this.length,Z.negative=this.negative,Z.red=this.red};function R(Z,C){Z.words=C.words,Z.length=C.length,Z.negative=C.negative,Z.red=C.red}if(Q.prototype._move=function(Z){R(Z,this)},Q.prototype.clone=function(){var Z=new Q(null);return this.copy(Z),Z},Q.prototype._expand=function(Z){while(this.length<Z)this.words[this.length++]=0;return this},Q.prototype._strip=function(){while(this.length>1&&this.words[this.length-1]===0)this.length--;return this._normSign()},Q.prototype._normSign=function(){if(this.length===1&&this.words[0]===0)this.negative=0;return this},typeof Symbol<"u"&&typeof Symbol.for==="function")try{Q.prototype[Symbol.for("nodejs.util.inspect.custom")]=D}catch(Z){Q.prototype.inspect=D}else Q.prototype.inspect=D;function D(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var q=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],P=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],_=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64000000,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,24300000,28629151,33554432,39135393,45435424,52521875,60466176];if(Q.prototype.toString=function(Z,C){Z=Z||10,C=C|0||1;var Y;if(Z===16||Z==="hex"){Y="";var V=0,G=0;for(var O=0;O<this.length;O++){var J=this.words[O],z=((J<<V|G)&16777215).toString(16);if(G=J>>>24-V&16777215,V+=2,V>=26)V-=26,O--;if(G!==0||O!==this.length-1)Y=q[6-z.length]+z+Y;else Y=z+Y}if(G!==0)Y=G.toString(16)+Y;while(Y.length%C!==0)Y="0"+Y;if(this.negative!==0)Y="-"+Y;return Y}if(Z===(Z|0)&&Z>=2&&Z<=36){var W=P[Z],j=_[Z];Y="";var N=this.clone();N.negative=0;while(!N.isZero()){var p=N.modrn(j).toString(Z);if(N=N.idivn(j),!N.isZero())Y=q[W-p.length]+p+Y;else Y=p+Y}if(this.isZero())Y="0"+Y;while(Y.length%C!==0)Y="0"+Y;if(this.negative!==0)Y="-"+Y;return Y}S(!1,"Base should be between 2 and 36")},Q.prototype.toNumber=function(){var Z=this.words[0];if(this.length===2)Z+=this.words[1]*67108864;else if(this.length===3&&this.words[2]===1)Z+=4503599627370496+this.words[1]*67108864;else if(this.length>2)S(!1,"Number can only safely store up to 53 bits");return this.negative!==0?-Z:Z},Q.prototype.toJSON=function(){return this.toString(16,2)},T)Q.prototype.toBuffer=function(Z,C){return this.toArrayLike(T,Z,C)};Q.prototype.toArray=function(Z,C){return this.toArrayLike(Array,Z,C)};var k=function(Z,C){if(Z.allocUnsafe)return Z.allocUnsafe(C);return new Z(C)};if(Q.prototype.toArrayLike=function(Z,C,Y){this._strip();var V=this.byteLength(),G=Y||Math.max(1,V);S(V<=G,"byte array longer than desired length"),S(G>0,"Requested array length <= 0");var O=k(Z,G),J=C==="le"?"LE":"BE";return this["_toArrayLike"+J](O,V),O},Q.prototype._toArrayLikeLE=function(Z,C){var Y=0,V=0;for(var G=0,O=0;G<this.length;G++){var J=this.words[G]<<O|V;if(Z[Y++]=J&255,Y<Z.length)Z[Y++]=J>>8&255;if(Y<Z.length)Z[Y++]=J>>16&255;if(O===6){if(Y<Z.length)Z[Y++]=J>>24&255;V=0,O=0}else V=J>>>24,O+=2}if(Y<Z.length){Z[Y++]=V;while(Y<Z.length)Z[Y++]=0}},Q.prototype._toArrayLikeBE=function(Z,C){var Y=Z.length-1,V=0;for(var G=0,O=0;G<this.length;G++){var J=this.words[G]<<O|V;if(Z[Y--]=J&255,Y>=0)Z[Y--]=J>>8&255;if(Y>=0)Z[Y--]=J>>16&255;if(O===6){if(Y>=0)Z[Y--]=J>>24&255;V=0,O=0}else V=J>>>24,O+=2}if(Y>=0){Z[Y--]=V;while(Y>=0)Z[Y--]=0}},Math.clz32)Q.prototype._countBits=function(Z){return 32-Math.clz32(Z)};else Q.prototype._countBits=function(Z){var C=Z,Y=0;if(C>=4096)Y+=13,C>>>=13;if(C>=64)Y+=7,C>>>=7;if(C>=8)Y+=4,C>>>=4;if(C>=2)Y+=2,C>>>=2;return Y+C};Q.prototype._zeroBits=function(Z){if(Z===0)return 26;var C=Z,Y=0;if((C&8191)===0)Y+=13,C>>>=13;if((C&127)===0)Y+=7,C>>>=7;if((C&15)===0)Y+=4,C>>>=4;if((C&3)===0)Y+=2,C>>>=2;if((C&1)===0)Y++;return Y},Q.prototype.bitLength=function(){var Z=this.words[this.length-1],C=this._countBits(Z);return(this.length-1)*26+C};function B(Z){var C=Array(Z.bitLength());for(var Y=0;Y<C.length;Y++){var V=Y/26|0,G=Y%26;C[Y]=Z.words[V]>>>G&1}return C}Q.prototype.zeroBits=function(){if(this.isZero())return 0;var Z=0;for(var C=0;C<this.length;C++){var Y=this._zeroBits(this.words[C]);if(Z+=Y,Y!==26)break}return Z},Q.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},Q.prototype.toTwos=function(Z){if(this.negative!==0)return this.abs().inotn(Z).iaddn(1);return this.clone()},Q.prototype.fromTwos=function(Z){if(this.testn(Z-1))return this.notn(Z).iaddn(1).ineg();return this.clone()},Q.prototype.isNeg=function(){return this.negative!==0},Q.prototype.neg=function(){return this.clone().ineg()},Q.prototype.ineg=function(){if(!this.isZero())this.negative^=1;return this},Q.prototype.iuor=function(Z){while(this.length<Z.length)this.words[this.length++]=0;for(var C=0;C<Z.length;C++)this.words[C]=this.words[C]|Z.words[C];return this._strip()},Q.prototype.ior=function(Z){return S((this.negative|Z.negative)===0),this.iuor(Z)},Q.prototype.or=function(Z){if(this.length>Z.length)return this.clone().ior(Z);return Z.clone().ior(this)},Q.prototype.uor=function(Z){if(this.length>Z.length)return this.clone().iuor(Z);return Z.clone().iuor(this)},Q.prototype.iuand=function(Z){var C;if(this.length>Z.length)C=Z;else C=this;for(var Y=0;Y<C.length;Y++)this.words[Y]=this.words[Y]&Z.words[Y];return this.length=C.length,this._strip()},Q.prototype.iand=function(Z){return S((this.negative|Z.negative)===0),this.iuand(Z)},Q.prototype.and=function(Z){if(this.length>Z.length)return this.clone().iand(Z);return Z.clone().iand(this)},Q.prototype.uand=function(Z){if(this.length>Z.length)return this.clone().iuand(Z);return Z.clone().iuand(this)},Q.prototype.iuxor=function(Z){var C,Y;if(this.length>Z.length)C=this,Y=Z;else C=Z,Y=this;for(var V=0;V<Y.length;V++)this.words[V]=C.words[V]^Y.words[V];if(this!==C)for(;V<C.length;V++)this.words[V]=C.words[V];return this.length=C.length,this._strip()},Q.prototype.ixor=function(Z){return S((this.negative|Z.negative)===0),this.iuxor(Z)},Q.prototype.xor=function(Z){if(this.length>Z.length)return this.clone().ixor(Z);return Z.clone().ixor(this)},Q.prototype.uxor=function(Z){if(this.length>Z.length)return this.clone().iuxor(Z);return Z.clone().iuxor(this)},Q.prototype.inotn=function(Z){S(typeof Z==="number"&&Z>=0);var C=Math.ceil(Z/26)|0,Y=Z%26;if(this._expand(C),Y>0)C--;for(var V=0;V<C;V++)this.words[V]=~this.words[V]&67108863;if(Y>0)this.words[V]=~this.words[V]&67108863>>26-Y;return this._strip()},Q.prototype.notn=function(Z){return this.clone().inotn(Z)},Q.prototype.setn=function(Z,C){S(typeof Z==="number"&&Z>=0);var Y=Z/26|0,V=Z%26;if(this._expand(Y+1),C)this.words[Y]=this.words[Y]|1<<V;else this.words[Y]=this.words[Y]&~(1<<V);return this._strip()},Q.prototype.iadd=function(Z){var C;if(this.negative!==0&&Z.negative===0)return this.negative=0,C=this.isub(Z),this.negative^=1,this._normSign();else if(this.negative===0&&Z.negative!==0)return Z.negative=0,C=this.isub(Z),Z.negative=1,C._normSign();var Y,V;if(this.length>Z.length)Y=this,V=Z;else Y=Z,V=this;var G=0;for(var O=0;O<V.length;O++)C=(Y.words[O]|0)+(V.words[O]|0)+G,this.words[O]=C&67108863,G=C>>>26;for(;G!==0&&O<Y.length;O++)C=(Y.words[O]|0)+G,this.words[O]=C&67108863,G=C>>>26;if(this.length=Y.length,G!==0)this.words[this.length]=G,this.length++;else if(Y!==this)for(;O<Y.length;O++)this.words[O]=Y.words[O];return this},Q.prototype.add=function(Z){var C;if(Z.negative!==0&&this.negative===0)return Z.negative=0,C=this.sub(Z),Z.negative^=1,C;else if(Z.negative===0&&this.negative!==0)return this.negative=0,C=Z.sub(this),this.negative=1,C;if(this.length>Z.length)return this.clone().iadd(Z);return Z.clone().iadd(this)},Q.prototype.isub=function(Z){if(Z.negative!==0){Z.negative=0;var C=this.iadd(Z);return Z.negative=1,C._normSign()}else if(this.negative!==0)return this.negative=0,this.iadd(Z),this.negative=1,this._normSign();var Y=this.cmp(Z);if(Y===0)return this.negative=0,this.length=1,this.words[0]=0,this;var V,G;if(Y>0)V=this,G=Z;else V=Z,G=this;var O=0;for(var J=0;J<G.length;J++)C=(V.words[J]|0)-(G.words[J]|0)+O,O=C>>26,this.words[J]=C&67108863;for(;O!==0&&J<V.length;J++)C=(V.words[J]|0)+O,O=C>>26,this.words[J]=C&67108863;if(O===0&&J<V.length&&V!==this)for(;J<V.length;J++)this.words[J]=V.words[J];if(this.length=Math.max(this.length,J),V!==this)this.negative=1;return this._strip()},Q.prototype.sub=function(Z){return this.clone().isub(Z)};function v(Z,C,Y){Y.negative=C.negative^Z.negative;var V=Z.length+C.length|0;Y.length=V,V=V-1|0;var G=Z.words[0]|0,O=C.words[0]|0,J=G*O,z=J&67108863,W=J/67108864|0;Y.words[0]=z;for(var j=1;j<V;j++){var N=W>>>26,p=W&67108863,n=Math.min(j,C.length-1);for(var E0=Math.max(0,j-Z.length+1);E0<=n;E0++){var r=j-E0|0;G=Z.words[r]|0,O=C.words[E0]|0,J=G*O+p,N+=J/67108864|0,p=J&67108863}Y.words[j]=p|0,W=N|0}if(W!==0)Y.words[j]=W|0;else Y.length--;return Y._strip()}var g=function(Z,C,Y){var V=Z.words,G=C.words,O=Y.words,J=0,z,W,j,N=V[0]|0,p=N&8191,n=N>>>13,E0=V[1]|0,r=E0&8191,d=E0>>>13,A0=V[2]|0,t=A0&8191,i=A0>>>13,N0=V[3]|0,y=N0&8191,h=N0>>>13,$0=V[4]|0,m=$0&8191,a=$0>>>13,W0=V[5]|0,c=W0&8191,o=W0>>>13,x0=V[6]|0,s=x0&8191,Z0=x0>>>13,w0=V[7]|0,S0=w0&8191,V0=w0>>>13,m0=V[8]|0,J0=m0&8191,L0=m0>>>13,a0=V[9]|0,K0=a0&8191,D0=a0>>>13,WU=G[0]|0,F0=WU&8191,k0=WU>>>13,FU=G[1]|0,_0=FU&8191,M0=FU>>>13,KU=G[2]|0,j0=KU&8191,z0=KU>>>13,SU=G[3]|0,v0=SU&8191,B0=SU>>>13,VU=G[4]|0,T0=VU&8191,x=VU>>>13,l=G[5]|0,e=l&8191,U0=l>>>13,f0=G[6]|0,Y0=f0&8191,R0=f0>>>13,r0=G[7]|0,q0=r0&8191,g0=r0>>>13,HU=G[8]|0,P0=HU&8191,H0=HU>>>13,e0=G[9]|0,c0=e0&8191,y0=e0>>>13;Y.negative=Z.negative^C.negative,Y.length=19,z=Math.imul(p,F0),W=Math.imul(p,k0),W=W+Math.imul(n,F0)|0,j=Math.imul(n,k0);var o0=(J+z|0)+((W&8191)<<13)|0;J=(j+(W>>>13)|0)+(o0>>>26)|0,o0&=67108863,z=Math.imul(r,F0),W=Math.imul(r,k0),W=W+Math.imul(d,F0)|0,j=Math.imul(d,k0),z=z+Math.imul(p,_0)|0,W=W+Math.imul(p,M0)|0,W=W+Math.imul(n,_0)|0,j=j+Math.imul(n,M0)|0;var b0=(J+z|0)+((W&8191)<<13)|0;J=(j+(W>>>13)|0)+(b0>>>26)|0,b0&=67108863,z=Math.imul(t,F0),W=Math.imul(t,k0),W=W+Math.imul(i,F0)|0,j=Math.imul(i,k0),z=z+Math.imul(r,_0)|0,W=W+Math.imul(r,M0)|0,W=W+Math.imul(d,_0)|0,j=j+Math.imul(d,M0)|0,z=z+Math.imul(p,j0)|0,W=W+Math.imul(p,z0)|0,W=W+Math.imul(n,j0)|0,j=j+Math.imul(n,z0)|0;var i0=(J+z|0)+((W&8191)<<13)|0;J=(j+(W>>>13)|0)+(i0>>>26)|0,i0&=67108863,z=Math.imul(y,F0),W=Math.imul(y,k0),W=W+Math.imul(h,F0)|0,j=Math.imul(h,k0),z=z+Math.imul(t,_0)|0,W=W+Math.imul(t,M0)|0,W=W+Math.imul(i,_0)|0,j=j+Math.imul(i,M0)|0,z=z+Math.imul(r,j0)|0,W=W+Math.imul(r,z0)|0,W=W+Math.imul(d,j0)|0,j=j+Math.imul(d,z0)|0,z=z+Math.imul(p,v0)|0,W=W+Math.imul(p,B0)|0,W=W+Math.imul(n,v0)|0,j=j+Math.imul(n,B0)|0;var UU=(J+z|0)+((W&8191)<<13)|0;J=(j+(W>>>13)|0)+(UU>>>26)|0,UU&=67108863,z=Math.imul(m,F0),W=Math.imul(m,k0),W=W+Math.imul(a,F0)|0,j=Math.imul(a,k0),z=z+Math.imul(y,_0)|0,W=W+Math.imul(y,M0)|0,W=W+Math.imul(h,_0)|0,j=j+Math.imul(h,M0)|0,z=z+Math.imul(t,j0)|0,W=W+Math.imul(t,z0)|0,W=W+Math.imul(i,j0)|0,j=j+Math.imul(i,z0)|0,z=z+Math.imul(r,v0)|0,W=W+Math.imul(r,B0)|0,W=W+Math.imul(d,v0)|0,j=j+Math.imul(d,B0)|0,z=z+Math.imul(p,T0)|0,W=W+Math.imul(p,x)|0,W=W+Math.imul(n,T0)|0,j=j+Math.imul(n,x)|0;var OU=(J+z|0)+((W&8191)<<13)|0;J=(j+(W>>>13)|0)+(OU>>>26)|0,OU&=67108863,z=Math.imul(c,F0),W=Math.imul(c,k0),W=W+Math.imul(o,F0)|0,j=Math.imul(o,k0),z=z+Math.imul(m,_0)|0,W=W+Math.imul(m,M0)|0,W=W+Math.imul(a,_0)|0,j=j+Math.imul(a,M0)|0,z=z+Math.imul(y,j0)|0,W=W+Math.imul(y,z0)|0,W=W+Math.imul(h,j0)|0,j=j+Math.imul(h,z0)|0,z=z+Math.imul(t,v0)|0,W=W+Math.imul(t,B0)|0,W=W+Math.imul(i,v0)|0,j=j+Math.imul(i,B0)|0,z=z+Math.imul(r,T0)|0,W=W+Math.imul(r,x)|0,W=W+Math.imul(d,T0)|0,j=j+Math.imul(d,x)|0,z=z+Math.imul(p,e)|0,W=W+Math.imul(p,U0)|0,W=W+Math.imul(n,e)|0,j=j+Math.imul(n,U0)|0;var ZU=(J+z|0)+((W&8191)<<13)|0;J=(j+(W>>>13)|0)+(ZU>>>26)|0,ZU&=67108863,z=Math.imul(s,F0),W=Math.imul(s,k0),W=W+Math.imul(Z0,F0)|0,j=Math.imul(Z0,k0),z=z+Math.imul(c,_0)|0,W=W+Math.imul(c,M0)|0,W=W+Math.imul(o,_0)|0,j=j+Math.imul(o,M0)|0,z=z+Math.imul(m,j0)|0,W=W+Math.imul(m,z0)|0,W=W+Math.imul(a,j0)|0,j=j+Math.imul(a,z0)|0,z=z+Math.imul(y,v0)|0,W=W+Math.imul(y,B0)|0,W=W+Math.imul(h,v0)|0,j=j+Math.imul(h,B0)|0,z=z+Math.imul(t,T0)|0,W=W+Math.imul(t,x)|0,W=W+Math.imul(i,T0)|0,j=j+Math.imul(i,x)|0,z=z+Math.imul(r,e)|0,W=W+Math.imul(r,U0)|0,W=W+Math.imul(d,e)|0,j=j+Math.imul(d,U0)|0,z=z+Math.imul(p,Y0)|0,W=W+Math.imul(p,R0)|0,W=W+Math.imul(n,Y0)|0,j=j+Math.imul(n,R0)|0;var AU=(J+z|0)+((W&8191)<<13)|0;J=(j+(W>>>13)|0)+(AU>>>26)|0,AU&=67108863,z=Math.imul(S0,F0),W=Math.imul(S0,k0),W=W+Math.imul(V0,F0)|0,j=Math.imul(V0,k0),z=z+Math.imul(s,_0)|0,W=W+Math.imul(s,M0)|0,W=W+Math.imul(Z0,_0)|0,j=j+Math.imul(Z0,M0)|0,z=z+Math.imul(c,j0)|0,W=W+Math.imul(c,z0)|0,W=W+Math.imul(o,j0)|0,j=j+Math.imul(o,z0)|0,z=z+Math.imul(m,v0)|0,W=W+Math.imul(m,B0)|0,W=W+Math.imul(a,v0)|0,j=j+Math.imul(a,B0)|0,z=z+Math.imul(y,T0)|0,W=W+Math.imul(y,x)|0,W=W+Math.imul(h,T0)|0,j=j+Math.imul(h,x)|0,z=z+Math.imul(t,e)|0,W=W+Math.imul(t,U0)|0,W=W+Math.imul(i,e)|0,j=j+Math.imul(i,U0)|0,z=z+Math.imul(r,Y0)|0,W=W+Math.imul(r,R0)|0,W=W+Math.imul(d,Y0)|0,j=j+Math.imul(d,R0)|0,z=z+Math.imul(p,q0)|0,W=W+Math.imul(p,g0)|0,W=W+Math.imul(n,q0)|0,j=j+Math.imul(n,g0)|0;var $U=(J+z|0)+((W&8191)<<13)|0;J=(j+(W>>>13)|0)+($U>>>26)|0,$U&=67108863,z=Math.imul(J0,F0),W=Math.imul(J0,k0),W=W+Math.imul(L0,F0)|0,j=Math.imul(L0,k0),z=z+Math.imul(S0,_0)|0,W=W+Math.imul(S0,M0)|0,W=W+Math.imul(V0,_0)|0,j=j+Math.imul(V0,M0)|0,z=z+Math.imul(s,j0)|0,W=W+Math.imul(s,z0)|0,W=W+Math.imul(Z0,j0)|0,j=j+Math.imul(Z0,z0)|0,z=z+Math.imul(c,v0)|0,W=W+Math.imul(c,B0)|0,W=W+Math.imul(o,v0)|0,j=j+Math.imul(o,B0)|0,z=z+Math.imul(m,T0)|0,W=W+Math.imul(m,x)|0,W=W+Math.imul(a,T0)|0,j=j+Math.imul(a,x)|0,z=z+Math.imul(y,e)|0,W=W+Math.imul(y,U0)|0,W=W+Math.imul(h,e)|0,j=j+Math.imul(h,U0)|0,z=z+Math.imul(t,Y0)|0,W=W+Math.imul(t,R0)|0,W=W+Math.imul(i,Y0)|0,j=j+Math.imul(i,R0)|0,z=z+Math.imul(r,q0)|0,W=W+Math.imul(r,g0)|0,W=W+Math.imul(d,q0)|0,j=j+Math.imul(d,g0)|0,z=z+Math.imul(p,P0)|0,W=W+Math.imul(p,H0)|0,W=W+Math.imul(n,P0)|0,j=j+Math.imul(n,H0)|0;var IU=(J+z|0)+((W&8191)<<13)|0;J=(j+(W>>>13)|0)+(IU>>>26)|0,IU&=67108863,z=Math.imul(K0,F0),W=Math.imul(K0,k0),W=W+Math.imul(D0,F0)|0,j=Math.imul(D0,k0),z=z+Math.imul(J0,_0)|0,W=W+Math.imul(J0,M0)|0,W=W+Math.imul(L0,_0)|0,j=j+Math.imul(L0,M0)|0,z=z+Math.imul(S0,j0)|0,W=W+Math.imul(S0,z0)|0,W=W+Math.imul(V0,j0)|0,j=j+Math.imul(V0,z0)|0,z=z+Math.imul(s,v0)|0,W=W+Math.imul(s,B0)|0,W=W+Math.imul(Z0,v0)|0,j=j+Math.imul(Z0,B0)|0,z=z+Math.imul(c,T0)|0,W=W+Math.imul(c,x)|0,W=W+Math.imul(o,T0)|0,j=j+Math.imul(o,x)|0,z=z+Math.imul(m,e)|0,W=W+Math.imul(m,U0)|0,W=W+Math.imul(a,e)|0,j=j+Math.imul(a,U0)|0,z=z+Math.imul(y,Y0)|0,W=W+Math.imul(y,R0)|0,W=W+Math.imul(h,Y0)|0,j=j+Math.imul(h,R0)|0,z=z+Math.imul(t,q0)|0,W=W+Math.imul(t,g0)|0,W=W+Math.imul(i,q0)|0,j=j+Math.imul(i,g0)|0,z=z+Math.imul(r,P0)|0,W=W+Math.imul(r,H0)|0,W=W+Math.imul(d,P0)|0,j=j+Math.imul(d,H0)|0,z=z+Math.imul(p,c0)|0,W=W+Math.imul(p,y0)|0,W=W+Math.imul(n,c0)|0,j=j+Math.imul(n,y0)|0;var CU=(J+z|0)+((W&8191)<<13)|0;J=(j+(W>>>13)|0)+(CU>>>26)|0,CU&=67108863,z=Math.imul(K0,_0),W=Math.imul(K0,M0),W=W+Math.imul(D0,_0)|0,j=Math.imul(D0,M0),z=z+Math.imul(J0,j0)|0,W=W+Math.imul(J0,z0)|0,W=W+Math.imul(L0,j0)|0,j=j+Math.imul(L0,z0)|0,z=z+Math.imul(S0,v0)|0,W=W+Math.imul(S0,B0)|0,W=W+Math.imul(V0,v0)|0,j=j+Math.imul(V0,B0)|0,z=z+Math.imul(s,T0)|0,W=W+Math.imul(s,x)|0,W=W+Math.imul(Z0,T0)|0,j=j+Math.imul(Z0,x)|0,z=z+Math.imul(c,e)|0,W=W+Math.imul(c,U0)|0,W=W+Math.imul(o,e)|0,j=j+Math.imul(o,U0)|0,z=z+Math.imul(m,Y0)|0,W=W+Math.imul(m,R0)|0,W=W+Math.imul(a,Y0)|0,j=j+Math.imul(a,R0)|0,z=z+Math.imul(y,q0)|0,W=W+Math.imul(y,g0)|0,W=W+Math.imul(h,q0)|0,j=j+Math.imul(h,g0)|0,z=z+Math.imul(t,P0)|0,W=W+Math.imul(t,H0)|0,W=W+Math.imul(i,P0)|0,j=j+Math.imul(i,H0)|0,z=z+Math.imul(r,c0)|0,W=W+Math.imul(r,y0)|0,W=W+Math.imul(d,c0)|0,j=j+Math.imul(d,y0)|0;var QU=(J+z|0)+((W&8191)<<13)|0;J=(j+(W>>>13)|0)+(QU>>>26)|0,QU&=67108863,z=Math.imul(K0,j0),W=Math.imul(K0,z0),W=W+Math.imul(D0,j0)|0,j=Math.imul(D0,z0),z=z+Math.imul(J0,v0)|0,W=W+Math.imul(J0,B0)|0,W=W+Math.imul(L0,v0)|0,j=j+Math.imul(L0,B0)|0,z=z+Math.imul(S0,T0)|0,W=W+Math.imul(S0,x)|0,W=W+Math.imul(V0,T0)|0,j=j+Math.imul(V0,x)|0,z=z+Math.imul(s,e)|0,W=W+Math.imul(s,U0)|0,W=W+Math.imul(Z0,e)|0,j=j+Math.imul(Z0,U0)|0,z=z+Math.imul(c,Y0)|0,W=W+Math.imul(c,R0)|0,W=W+Math.imul(o,Y0)|0,j=j+Math.imul(o,R0)|0,z=z+Math.imul(m,q0)|0,W=W+Math.imul(m,g0)|0,W=W+Math.imul(a,q0)|0,j=j+Math.imul(a,g0)|0,z=z+Math.imul(y,P0)|0,W=W+Math.imul(y,H0)|0,W=W+Math.imul(h,P0)|0,j=j+Math.imul(h,H0)|0,z=z+Math.imul(t,c0)|0,W=W+Math.imul(t,y0)|0,W=W+Math.imul(i,c0)|0,j=j+Math.imul(i,y0)|0;var XU=(J+z|0)+((W&8191)<<13)|0;J=(j+(W>>>13)|0)+(XU>>>26)|0,XU&=67108863,z=Math.imul(K0,v0),W=Math.imul(K0,B0),W=W+Math.imul(D0,v0)|0,j=Math.imul(D0,B0),z=z+Math.imul(J0,T0)|0,W=W+Math.imul(J0,x)|0,W=W+Math.imul(L0,T0)|0,j=j+Math.imul(L0,x)|0,z=z+Math.imul(S0,e)|0,W=W+Math.imul(S0,U0)|0,W=W+Math.imul(V0,e)|0,j=j+Math.imul(V0,U0)|0,z=z+Math.imul(s,Y0)|0,W=W+Math.imul(s,R0)|0,W=W+Math.imul(Z0,Y0)|0,j=j+Math.imul(Z0,R0)|0,z=z+Math.imul(c,q0)|0,W=W+Math.imul(c,g0)|0,W=W+Math.imul(o,q0)|0,j=j+Math.imul(o,g0)|0,z=z+Math.imul(m,P0)|0,W=W+Math.imul(m,H0)|0,W=W+Math.imul(a,P0)|0,j=j+Math.imul(a,H0)|0,z=z+Math.imul(y,c0)|0,W=W+Math.imul(y,y0)|0,W=W+Math.imul(h,c0)|0,j=j+Math.imul(h,y0)|0;var GU=(J+z|0)+((W&8191)<<13)|0;J=(j+(W>>>13)|0)+(GU>>>26)|0,GU&=67108863,z=Math.imul(K0,T0),W=Math.imul(K0,x),W=W+Math.imul(D0,T0)|0,j=Math.imul(D0,x),z=z+Math.imul(J0,e)|0,W=W+Math.imul(J0,U0)|0,W=W+Math.imul(L0,e)|0,j=j+Math.imul(L0,U0)|0,z=z+Math.imul(S0,Y0)|0,W=W+Math.imul(S0,R0)|0,W=W+Math.imul(V0,Y0)|0,j=j+Math.imul(V0,R0)|0,z=z+Math.imul(s,q0)|0,W=W+Math.imul(s,g0)|0,W=W+Math.imul(Z0,q0)|0,j=j+Math.imul(Z0,g0)|0,z=z+Math.imul(c,P0)|0,W=W+Math.imul(c,H0)|0,W=W+Math.imul(o,P0)|0,j=j+Math.imul(o,H0)|0,z=z+Math.imul(m,c0)|0,W=W+Math.imul(m,y0)|0,W=W+Math.imul(a,c0)|0,j=j+Math.imul(a,y0)|0;var EU=(J+z|0)+((W&8191)<<13)|0;J=(j+(W>>>13)|0)+(EU>>>26)|0,EU&=67108863,z=Math.imul(K0,e),W=Math.imul(K0,U0),W=W+Math.imul(D0,e)|0,j=Math.imul(D0,U0),z=z+Math.imul(J0,Y0)|0,W=W+Math.imul(J0,R0)|0,W=W+Math.imul(L0,Y0)|0,j=j+Math.imul(L0,R0)|0,z=z+Math.imul(S0,q0)|0,W=W+Math.imul(S0,g0)|0,W=W+Math.imul(V0,q0)|0,j=j+Math.imul(V0,g0)|0,z=z+Math.imul(s,P0)|0,W=W+Math.imul(s,H0)|0,W=W+Math.imul(Z0,P0)|0,j=j+Math.imul(Z0,H0)|0,z=z+Math.imul(c,c0)|0,W=W+Math.imul(c,y0)|0,W=W+Math.imul(o,c0)|0,j=j+Math.imul(o,y0)|0;var JU=(J+z|0)+((W&8191)<<13)|0;J=(j+(W>>>13)|0)+(JU>>>26)|0,JU&=67108863,z=Math.imul(K0,Y0),W=Math.imul(K0,R0),W=W+Math.imul(D0,Y0)|0,j=Math.imul(D0,R0),z=z+Math.imul(J0,q0)|0,W=W+Math.imul(J0,g0)|0,W=W+Math.imul(L0,q0)|0,j=j+Math.imul(L0,g0)|0,z=z+Math.imul(S0,P0)|0,W=W+Math.imul(S0,H0)|0,W=W+Math.imul(V0,P0)|0,j=j+Math.imul(V0,H0)|0,z=z+Math.imul(s,c0)|0,W=W+Math.imul(s,y0)|0,W=W+Math.imul(Z0,c0)|0,j=j+Math.imul(Z0,y0)|0;var YU=(J+z|0)+((W&8191)<<13)|0;J=(j+(W>>>13)|0)+(YU>>>26)|0,YU&=67108863,z=Math.imul(K0,q0),W=Math.imul(K0,g0),W=W+Math.imul(D0,q0)|0,j=Math.imul(D0,g0),z=z+Math.imul(J0,P0)|0,W=W+Math.imul(J0,H0)|0,W=W+Math.imul(L0,P0)|0,j=j+Math.imul(L0,H0)|0,z=z+Math.imul(S0,c0)|0,W=W+Math.imul(S0,y0)|0,W=W+Math.imul(V0,c0)|0,j=j+Math.imul(V0,y0)|0;var MZ=(J+z|0)+((W&8191)<<13)|0;J=(j+(W>>>13)|0)+(MZ>>>26)|0,MZ&=67108863,z=Math.imul(K0,P0),W=Math.imul(K0,H0),W=W+Math.imul(D0,P0)|0,j=Math.imul(D0,H0),z=z+Math.imul(J0,c0)|0,W=W+Math.imul(J0,y0)|0,W=W+Math.imul(L0,c0)|0,j=j+Math.imul(L0,y0)|0;var zZ=(J+z|0)+((W&8191)<<13)|0;J=(j+(W>>>13)|0)+(zZ>>>26)|0,zZ&=67108863,z=Math.imul(K0,c0),W=Math.imul(K0,y0),W=W+Math.imul(D0,c0)|0,j=Math.imul(D0,y0);var TZ=(J+z|0)+((W&8191)<<13)|0;if(J=(j+(W>>>13)|0)+(TZ>>>26)|0,TZ&=67108863,O[0]=o0,O[1]=b0,O[2]=i0,O[3]=UU,O[4]=OU,O[5]=ZU,O[6]=AU,O[7]=$U,O[8]=IU,O[9]=CU,O[10]=QU,O[11]=XU,O[12]=GU,O[13]=EU,O[14]=JU,O[15]=YU,O[16]=MZ,O[17]=zZ,O[18]=TZ,J!==0)O[19]=J,Y.length++;return Y};if(!Math.imul)g=v;function f(Z,C,Y){Y.negative=C.negative^Z.negative,Y.length=Z.length+C.length;var V=0,G=0;for(var O=0;O<Y.length-1;O++){var J=G;G=0;var z=V&67108863,W=Math.min(O,C.length-1);for(var j=Math.max(0,O-Z.length+1);j<=W;j++){var N=O-j,p=Z.words[N]|0,n=C.words[j]|0,E0=p*n,r=E0&67108863;J=J+(E0/67108864|0)|0,r=r+z|0,z=r&67108863,J=J+(r>>>26)|0,G+=J>>>26,J&=67108863}Y.words[O]=z,V=J,J=G}if(V!==0)Y.words[O]=V;else Y.length--;return Y._strip()}function w(Z,C,Y){return f(Z,C,Y)}Q.prototype.mulTo=function(Z,C){var Y,V=this.length+Z.length;if(this.length===10&&Z.length===10)Y=g(this,Z,C);else if(V<63)Y=v(this,Z,C);else if(V<1024)Y=f(this,Z,C);else Y=w(this,Z,C);return Y};function b(Z,C){this.x=Z,this.y=C}b.prototype.makeRBT=function(Z){var C=Array(Z),Y=Q.prototype._countBits(Z)-1;for(var V=0;V<Z;V++)C[V]=this.revBin(V,Y,Z);return C},b.prototype.revBin=function(Z,C,Y){if(Z===0||Z===Y-1)return Z;var V=0;for(var G=0;G<C;G++)V|=(Z&1)<<C-G-1,Z>>=1;return V},b.prototype.permute=function(Z,C,Y,V,G,O){for(var J=0;J<O;J++)V[J]=C[Z[J]],G[J]=Y[Z[J]]},b.prototype.transform=function(Z,C,Y,V,G,O){this.permute(O,Z,C,Y,V,G);for(var J=1;J<G;J<<=1){var z=J<<1,W=Math.cos(2*Math.PI/z),j=Math.sin(2*Math.PI/z);for(var N=0;N<G;N+=z){var p=W,n=j;for(var E0=0;E0<J;E0++){var r=Y[N+E0],d=V[N+E0],A0=Y[N+E0+J],t=V[N+E0+J],i=p*A0-n*t;if(t=p*t+n*A0,A0=i,Y[N+E0]=r+A0,V[N+E0]=d+t,Y[N+E0+J]=r-A0,V[N+E0+J]=d-t,E0!==z)i=W*p-j*n,n=W*n+j*p,p=i}}}},b.prototype.guessLen13b=function(Z,C){var Y=Math.max(C,Z)|1,V=Y&1,G=0;for(Y=Y/2|0;Y;Y=Y>>>1)G++;return 1<<G+1+V},b.prototype.conjugate=function(Z,C,Y){if(Y<=1)return;for(var V=0;V<Y/2;V++){var G=Z[V];Z[V]=Z[Y-V-1],Z[Y-V-1]=G,G=C[V],C[V]=-C[Y-V-1],C[Y-V-1]=-G}},b.prototype.normalize13b=function(Z,C){var Y=0;for(var V=0;V<C/2;V++){var G=Math.round(Z[2*V+1]/C)*8192+Math.round(Z[2*V]/C)+Y;if(Z[V]=G&67108863,G<67108864)Y=0;else Y=G/67108864|0}return Z},b.prototype.convert13b=function(Z,C,Y,V){var G=0;for(var O=0;O<C;O++)G=G+(Z[O]|0),Y[2*O]=G&8191,G=G>>>13,Y[2*O+1]=G&8191,G=G>>>13;for(O=2*C;O<V;++O)Y[O]=0;S(G===0),S((G&-8192)===0)},b.prototype.stub=function(Z){var C=Array(Z);for(var Y=0;Y<Z;Y++)C[Y]=0;return C},b.prototype.mulp=function(Z,C,Y){var V=2*this.guessLen13b(Z.length,C.length),G=this.makeRBT(V),O=this.stub(V),J=Array(V),z=Array(V),W=Array(V),j=Array(V),N=Array(V),p=Array(V),n=Y.words;n.length=V,this.convert13b(Z.words,Z.length,J,V),this.convert13b(C.words,C.length,j,V),this.transform(J,O,z,W,V,G),this.transform(j,O,N,p,V,G);for(var E0=0;E0<V;E0++){var r=z[E0]*N[E0]-W[E0]*p[E0];W[E0]=z[E0]*p[E0]+W[E0]*N[E0],z[E0]=r}return this.conjugate(z,W,V),this.transform(z,W,n,O,V,G),this.conjugate(n,O,V),this.normalize13b(n,V),Y.negative=Z.negative^C.negative,Y.length=Z.length+C.length,Y._strip()},Q.prototype.mul=function(Z){var C=new Q(null);return C.words=Array(this.length+Z.length),this.mulTo(Z,C)},Q.prototype.mulf=function(Z){var C=new Q(null);return C.words=Array(this.length+Z.length),w(this,Z,C)},Q.prototype.imul=function(Z){return this.clone().mulTo(Z,this)},Q.prototype.imuln=function(Z){var C=Z<0;if(C)Z=-Z;S(typeof Z==="number"),S(Z<67108864);var Y=0;for(var V=0;V<this.length;V++){var G=(this.words[V]|0)*Z,O=(G&67108863)+(Y&67108863);Y>>=26,Y+=G/67108864|0,Y+=O>>>26,this.words[V]=O&67108863}if(Y!==0)this.words[V]=Y,this.length++;return this.length=Z===0?1:this.length,C?this.ineg():this},Q.prototype.muln=function(Z){return this.clone().imuln(Z)},Q.prototype.sqr=function(){return this.mul(this)},Q.prototype.isqr=function(){return this.imul(this.clone())},Q.prototype.pow=function(Z){var C=B(Z);if(C.length===0)return new Q(1);var Y=this;for(var V=0;V<C.length;V++,Y=Y.sqr())if(C[V]!==0)break;if(++V<C.length)for(var G=Y.sqr();V<C.length;V++,G=G.sqr()){if(C[V]===0)continue;Y=Y.mul(G)}return Y},Q.prototype.iushln=function(Z){S(typeof Z==="number"&&Z>=0);var C=Z%26,Y=(Z-C)/26,V=67108863>>>26-C<<26-C,G;if(C!==0){var O=0;for(G=0;G<this.length;G++){var J=this.words[G]&V,z=(this.words[G]|0)-J<<C;this.words[G]=z|O,O=J>>>26-C}if(O)this.words[G]=O,this.length++}if(Y!==0){for(G=this.length-1;G>=0;G--)this.words[G+Y]=this.words[G];for(G=0;G<Y;G++)this.words[G]=0;this.length+=Y}return this._strip()},Q.prototype.ishln=function(Z){return S(this.negative===0),this.iushln(Z)},Q.prototype.iushrn=function(Z,C,Y){S(typeof Z==="number"&&Z>=0);var V;if(C)V=(C-C%26)/26;else V=0;var G=Z%26,O=Math.min((Z-G)/26,this.length),J=67108863^67108863>>>G<<G,z=Y;if(V-=O,V=Math.max(0,V),z){for(var W=0;W<O;W++)z.words[W]=this.words[W];z.length=O}if(O===0);else if(this.length>O){this.length-=O;for(W=0;W<this.length;W++)this.words[W]=this.words[W+O]}else this.words[0]=0,this.length=1;var j=0;for(W=this.length-1;W>=0&&(j!==0||W>=V);W--){var N=this.words[W]|0;this.words[W]=j<<26-G|N>>>G,j=N&J}if(z&&j!==0)z.words[z.length++]=j;if(this.length===0)this.words[0]=0,this.length=1;return this._strip()},Q.prototype.ishrn=function(Z,C,Y){return S(this.negative===0),this.iushrn(Z,C,Y)},Q.prototype.shln=function(Z){return this.clone().ishln(Z)},Q.prototype.ushln=function(Z){return this.clone().iushln(Z)},Q.prototype.shrn=function(Z){return this.clone().ishrn(Z)},Q.prototype.ushrn=function(Z){return this.clone().iushrn(Z)},Q.prototype.testn=function(Z){S(typeof Z==="number"&&Z>=0);var C=Z%26,Y=(Z-C)/26,V=1<<C;if(this.length<=Y)return!1;var G=this.words[Y];return!!(G&V)},Q.prototype.imaskn=function(Z){S(typeof Z==="number"&&Z>=0);var C=Z%26,Y=(Z-C)/26;if(S(this.negative===0,"imaskn works only with positive numbers"),this.length<=Y)return this;if(C!==0)Y++;if(this.length=Math.min(Y,this.length),C!==0){var V=67108863^67108863>>>C<<C;this.words[this.length-1]&=V}return this._strip()},Q.prototype.maskn=function(Z){return this.clone().imaskn(Z)},Q.prototype.iaddn=function(Z){if(S(typeof Z==="number"),S(Z<67108864),Z<0)return this.isubn(-Z);if(this.negative!==0){if(this.length===1&&(this.words[0]|0)<=Z)return this.words[0]=Z-(this.words[0]|0),this.negative=0,this;return this.negative=0,this.isubn(Z),this.negative=1,this}return this._iaddn(Z)},Q.prototype._iaddn=function(Z){this.words[0]+=Z;for(var C=0;C<this.length&&this.words[C]>=67108864;C++)if(this.words[C]-=67108864,C===this.length-1)this.words[C+1]=1;else this.words[C+1]++;return this.length=Math.max(this.length,C+1),this},Q.prototype.isubn=function(Z){if(S(typeof Z==="number"),S(Z<67108864),Z<0)return this.iaddn(-Z);if(this.negative!==0)return this.negative=0,this.iaddn(Z),this.negative=1,this;if(this.words[0]-=Z,this.length===1&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var C=0;C<this.length&&this.words[C]<0;C++)this.words[C]+=67108864,this.words[C+1]-=1;return this._strip()},Q.prototype.addn=function(Z){return this.clone().iaddn(Z)},Q.prototype.subn=function(Z){return this.clone().isubn(Z)},Q.prototype.iabs=function(){return this.negative=0,this},Q.prototype.abs=function(){return this.clone().iabs()},Q.prototype._ishlnsubmul=function(Z,C,Y){var V=Z.length+Y,G;this._expand(V);var O,J=0;for(G=0;G<Z.length;G++){O=(this.words[G+Y]|0)+J;var z=(Z.words[G]|0)*C;O-=z&67108863,J=(O>>26)-(z/67108864|0),this.words[G+Y]=O&67108863}for(;G<this.length-Y;G++)O=(this.words[G+Y]|0)+J,J=O>>26,this.words[G+Y]=O&67108863;if(J===0)return this._strip();S(J===-1),J=0;for(G=0;G<this.length;G++)O=-(this.words[G]|0)+J,J=O>>26,this.words[G]=O&67108863;return this.negative=1,this._strip()},Q.prototype._wordDiv=function(Z,C){var Y=this.length-Z.length,V=this.clone(),G=Z,O=G.words[G.length-1]|0,J=this._countBits(O);if(Y=26-J,Y!==0)G=G.ushln(Y),V.iushln(Y),O=G.words[G.length-1]|0;var z=V.length-G.length,W;if(C!=="mod"){W=new Q(null),W.length=z+1,W.words=Array(W.length);for(var j=0;j<W.length;j++)W.words[j]=0}var N=V.clone()._ishlnsubmul(G,1,z);if(N.negative===0){if(V=N,W)W.words[z]=1}for(var p=z-1;p>=0;p--){var n=(V.words[G.length+p]|0)*67108864+(V.words[G.length+p-1]|0);n=Math.min(n/O|0,67108863),V._ishlnsubmul(G,n,p);while(V.negative!==0)if(n--,V.negative=0,V._ishlnsubmul(G,1,p),!V.isZero())V.negative^=1;if(W)W.words[p]=n}if(W)W._strip();if(V._strip(),C!=="div"&&Y!==0)V.iushrn(Y);return{div:W||null,mod:V}},Q.prototype.divmod=function(Z,C,Y){if(S(!Z.isZero()),this.isZero())return{div:new Q(0),mod:new Q(0)};var V,G,O;if(this.negative!==0&&Z.negative===0){if(O=this.neg().divmod(Z,C),C!=="mod")V=O.div.neg();if(C!=="div"){if(G=O.mod.neg(),Y&&G.negative!==0)G.iadd(Z)}return{div:V,mod:G}}if(this.negative===0&&Z.negative!==0){if(O=this.divmod(Z.neg(),C),C!=="mod")V=O.div.neg();return{div:V,mod:O.mod}}if((this.negative&Z.negative)!==0){if(O=this.neg().divmod(Z.neg(),C),C!=="div"){if(G=O.mod.neg(),Y&&G.negative!==0)G.isub(Z)}return{div:O.div,mod:G}}if(Z.length>this.length||this.cmp(Z)<0)return{div:new Q(0),mod:this};if(Z.length===1){if(C==="div")return{div:this.divn(Z.words[0]),mod:null};if(C==="mod")return{div:null,mod:new Q(this.modrn(Z.words[0]))};return{div:this.divn(Z.words[0]),mod:new Q(this.modrn(Z.words[0]))}}return this._wordDiv(Z,C)},Q.prototype.div=function(Z){return this.divmod(Z,"div",!1).div},Q.prototype.mod=function(Z){return this.divmod(Z,"mod",!1).mod},Q.prototype.umod=function(Z){return this.divmod(Z,"mod",!0).mod},Q.prototype.divRound=function(Z){var C=this.divmod(Z);if(C.mod.isZero())return C.div;var Y=C.div.negative!==0?C.mod.isub(Z):C.mod,V=Z.ushrn(1),G=Z.andln(1),O=Y.cmp(V);if(O<0||G===1&&O===0)return C.div;return C.div.negative!==0?C.div.isubn(1):C.div.iaddn(1)},Q.prototype.modrn=function(Z){var C=Z<0;if(C)Z=-Z;S(Z<=67108863);var Y=67108864%Z,V=0;for(var G=this.length-1;G>=0;G--)V=(Y*V+(this.words[G]|0))%Z;return C?-V:V},Q.prototype.modn=function(Z){return this.modrn(Z)},Q.prototype.idivn=function(Z){var C=Z<0;if(C)Z=-Z;S(Z<=67108863);var Y=0;for(var V=this.length-1;V>=0;V--){var G=(this.words[V]|0)+Y*67108864;this.words[V]=G/Z|0,Y=G%Z}return this._strip(),C?this.ineg():this},Q.prototype.divn=function(Z){return this.clone().idivn(Z)},Q.prototype.egcd=function(Z){S(Z.negative===0),S(!Z.isZero());var C=this,Y=Z.clone();if(C.negative!==0)C=C.umod(Z);else C=C.clone();var V=new Q(1),G=new Q(0),O=new Q(0),J=new Q(1),z=0;while(C.isEven()&&Y.isEven())C.iushrn(1),Y.iushrn(1),++z;var W=Y.clone(),j=C.clone();while(!C.isZero()){for(var N=0,p=1;(C.words[0]&p)===0&&N<26;++N,p<<=1);if(N>0){C.iushrn(N);while(N-- >0){if(V.isOdd()||G.isOdd())V.iadd(W),G.isub(j);V.iushrn(1),G.iushrn(1)}}for(var n=0,E0=1;(Y.words[0]&E0)===0&&n<26;++n,E0<<=1);if(n>0){Y.iushrn(n);while(n-- >0){if(O.isOdd()||J.isOdd())O.iadd(W),J.isub(j);O.iushrn(1),J.iushrn(1)}}if(C.cmp(Y)>=0)C.isub(Y),V.isub(O),G.isub(J);else Y.isub(C),O.isub(V),J.isub(G)}return{a:O,b:J,gcd:Y.iushln(z)}},Q.prototype._invmp=function(Z){S(Z.negative===0),S(!Z.isZero());var C=this,Y=Z.clone();if(C.negative!==0)C=C.umod(Z);else C=C.clone();var V=new Q(1),G=new Q(0),O=Y.clone();while(C.cmpn(1)>0&&Y.cmpn(1)>0){for(var J=0,z=1;(C.words[0]&z)===0&&J<26;++J,z<<=1);if(J>0){C.iushrn(J);while(J-- >0){if(V.isOdd())V.iadd(O);V.iushrn(1)}}for(var W=0,j=1;(Y.words[0]&j)===0&&W<26;++W,j<<=1);if(W>0){Y.iushrn(W);while(W-- >0){if(G.isOdd())G.iadd(O);G.iushrn(1)}}if(C.cmp(Y)>=0)C.isub(Y),V.isub(G);else Y.isub(C),G.isub(V)}var N;if(C.cmpn(1)===0)N=V;else N=G;if(N.cmpn(0)<0)N.iadd(Z);return N},Q.prototype.gcd=function(Z){if(this.isZero())return Z.abs();if(Z.isZero())return this.abs();var C=this.clone(),Y=Z.clone();C.negative=0,Y.negative=0;for(var V=0;C.isEven()&&Y.isEven();V++)C.iushrn(1),Y.iushrn(1);do{while(C.isEven())C.iushrn(1);while(Y.isEven())Y.iushrn(1);var G=C.cmp(Y);if(G<0){var O=C;C=Y,Y=O}else if(G===0||Y.cmpn(1)===0)break;C.isub(Y)}while(!0);return Y.iushln(V)},Q.prototype.invm=function(Z){return this.egcd(Z).a.umod(Z)},Q.prototype.isEven=function(){return(this.words[0]&1)===0},Q.prototype.isOdd=function(){return(this.words[0]&1)===1},Q.prototype.andln=function(Z){return this.words[0]&Z},Q.prototype.bincn=function(Z){S(typeof Z==="number");var C=Z%26,Y=(Z-C)/26,V=1<<C;if(this.length<=Y)return this._expand(Y+1),this.words[Y]|=V,this;var G=V;for(var O=Y;G!==0&&O<this.length;O++){var J=this.words[O]|0;J+=G,G=J>>>26,J&=67108863,this.words[O]=J}if(G!==0)this.words[O]=G,this.length++;return this},Q.prototype.isZero=function(){return this.length===1&&this.words[0]===0},Q.prototype.cmpn=function(Z){var C=Z<0;if(this.negative!==0&&!C)return-1;if(this.negative===0&&C)return 1;this._strip();var Y;if(this.length>1)Y=1;else{if(C)Z=-Z;S(Z<=67108863,"Number is too big");var V=this.words[0]|0;Y=V===Z?0:V<Z?-1:1}if(this.negative!==0)return-Y|0;return Y},Q.prototype.cmp=function(Z){if(this.negative!==0&&Z.negative===0)return-1;if(this.negative===0&&Z.negative!==0)return 1;var C=this.ucmp(Z);if(this.negative!==0)return-C|0;return C},Q.prototype.ucmp=function(Z){if(this.length>Z.length)return 1;if(this.length<Z.length)return-1;var C=0;for(var Y=this.length-1;Y>=0;Y--){var V=this.words[Y]|0,G=Z.words[Y]|0;if(V===G)continue;if(V<G)C=-1;else if(V>G)C=1;break}return C},Q.prototype.gtn=function(Z){return this.cmpn(Z)===1},Q.prototype.gt=function(Z){return this.cmp(Z)===1},Q.prototype.gten=function(Z){return this.cmpn(Z)>=0},Q.prototype.gte=function(Z){return this.cmp(Z)>=0},Q.prototype.ltn=function(Z){return this.cmpn(Z)===-1},Q.prototype.lt=function(Z){return this.cmp(Z)===-1},Q.prototype.lten=function(Z){return this.cmpn(Z)<=0},Q.prototype.lte=function(Z){return this.cmp(Z)<=0},Q.prototype.eqn=function(Z){return this.cmpn(Z)===0},Q.prototype.eq=function(Z){return this.cmp(Z)===0},Q.red=function(Z){return new A(Z)},Q.prototype.toRed=function(Z){return S(!this.red,"Already a number in reduction context"),S(this.negative===0,"red works only with positives"),Z.convertTo(this)._forceRed(Z)},Q.prototype.fromRed=function(){return S(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},Q.prototype._forceRed=function(Z){return this.red=Z,this},Q.prototype.forceRed=function(Z){return S(!this.red,"Already a number in reduction context"),this._forceRed(Z)},Q.prototype.redAdd=function(Z){return S(this.red,"redAdd works only with red numbers"),this.red.add(this,Z)},Q.prototype.redIAdd=function(Z){return S(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,Z)},Q.prototype.redSub=function(Z){return S(this.red,"redSub works only with red numbers"),this.red.sub(this,Z)},Q.prototype.redISub=function(Z){return S(this.red,"redISub works only with red numbers"),this.red.isub(this,Z)},Q.prototype.redShl=function(Z){return S(this.red,"redShl works only with red numbers"),this.red.shl(this,Z)},Q.prototype.redMul=function(Z){return S(this.red,"redMul works only with red numbers"),this.red._verify2(this,Z),this.red.mul(this,Z)},Q.prototype.redIMul=function(Z){return S(this.red,"redMul works only with red numbers"),this.red._verify2(this,Z),this.red.imul(this,Z)},Q.prototype.redSqr=function(){return S(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},Q.prototype.redISqr=function(){return S(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},Q.prototype.redSqrt=function(){return S(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},Q.prototype.redInvm=function(){return S(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},Q.prototype.redNeg=function(){return S(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},Q.prototype.redPow=function(Z){return S(this.red&&!Z.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,Z)};var I0={k256:null,p224:null,p192:null,p25519:null};function X0(Z,C){this.name=Z,this.p=new Q(C,16),this.n=this.p.bitLength(),this.k=new Q(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}X0.prototype._tmp=function(){var Z=new Q(null);return Z.words=Array(Math.ceil(this.n/13)),Z},X0.prototype.ireduce=function(Z){var C=Z,Y;do this.split(C,this.tmp),C=this.imulK(C),C=C.iadd(this.tmp),Y=C.bitLength();while(Y>this.n);var V=Y<this.n?-1:C.ucmp(this.p);if(V===0)C.words[0]=0,C.length=1;else if(V>0)C.isub(this.p);else if(C.strip!==void 0)C.strip();else C._strip();return C},X0.prototype.split=function(Z,C){Z.iushrn(this.n,0,C)},X0.prototype.imulK=function(Z){return Z.imul(this.k)};function C0(){X0.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}K(C0,X0),C0.prototype.split=function(Z,C){var Y=4194303,V=Math.min(Z.length,9);for(var G=0;G<V;G++)C.words[G]=Z.words[G];if(C.length=V,Z.length<=9){Z.words[0]=0,Z.length=1;return}var O=Z.words[9];C.words[C.length++]=O&Y;for(G=10;G<Z.length;G++){var J=Z.words[G]|0;Z.words[G-10]=(J&Y)<<4|O>>>22,O=J}if(O>>>=22,Z.words[G-10]=O,O===0&&Z.length>10)Z.length-=10;else Z.length-=9},C0.prototype.imulK=function(Z){Z.words[Z.length]=0,Z.words[Z.length+1]=0,Z.length+=2;var C=0;for(var Y=0;Y<Z.length;Y++){var V=Z.words[Y]|0;C+=V*977,Z.words[Y]=C&67108863,C=V*64+(C/67108864|0)}if(Z.words[Z.length-1]===0){if(Z.length--,Z.words[Z.length-1]===0)Z.length--}return Z};function u(){X0.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}K(u,X0);function O0(){X0.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}K(O0,X0);function U(){X0.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}K(U,X0),U.prototype.imulK=function(Z){var C=0;for(var Y=0;Y<Z.length;Y++){var V=(Z.words[Y]|0)*19+C,G=V&67108863;V>>>=26,Z.words[Y]=G,C=V}if(C!==0)Z.words[Z.length++]=C;return Z},Q._prime=function(Z){if(I0[Z])return I0[Z];var C;if(Z==="k256")C=new C0;else if(Z==="p224")C=new u;else if(Z==="p192")C=new O0;else if(Z==="p25519")C=new U;else throw Error("Unknown prime "+Z);return I0[Z]=C,C};function A(Z){if(typeof Z==="string"){var C=Q._prime(Z);this.m=C.p,this.prime=C}else S(Z.gtn(1),"modulus must be greater than 1"),this.m=Z,this.prime=null}A.prototype._verify1=function(Z){S(Z.negative===0,"red works only with positives"),S(Z.red,"red works only with red numbers")},A.prototype._verify2=function(Z,C){S((Z.negative|C.negative)===0,"red works only with positives"),S(Z.red&&Z.red===C.red,"red works only with red numbers")},A.prototype.imod=function(Z){if(this.prime)return this.prime.ireduce(Z)._forceRed(this);return R(Z,Z.umod(this.m)._forceRed(this)),Z},A.prototype.neg=function(Z){if(Z.isZero())return Z.clone();return this.m.sub(Z)._forceRed(this)},A.prototype.add=function(Z,C){this._verify2(Z,C);var Y=Z.add(C);if(Y.cmp(this.m)>=0)Y.isub(this.m);return Y._forceRed(this)},A.prototype.iadd=function(Z,C){this._verify2(Z,C);var Y=Z.iadd(C);if(Y.cmp(this.m)>=0)Y.isub(this.m);return Y},A.prototype.sub=function(Z,C){this._verify2(Z,C);var Y=Z.sub(C);if(Y.cmpn(0)<0)Y.iadd(this.m);return Y._forceRed(this)},A.prototype.isub=function(Z,C){this._verify2(Z,C);var Y=Z.isub(C);if(Y.cmpn(0)<0)Y.iadd(this.m);return Y},A.prototype.shl=function(Z,C){return this._verify1(Z),this.imod(Z.ushln(C))},A.prototype.imul=function(Z,C){return this._verify2(Z,C),this.imod(Z.imul(C))},A.prototype.mul=function(Z,C){return this._verify2(Z,C),this.imod(Z.mul(C))},A.prototype.isqr=function(Z){return this.imul(Z,Z.clone())},A.prototype.sqr=function(Z){return this.mul(Z,Z)},A.prototype.sqrt=function(Z){if(Z.isZero())return Z.clone();var C=this.m.andln(3);if(S(C%2===1),C===3){var Y=this.m.add(new Q(1)).iushrn(2);return this.pow(Z,Y)}var V=this.m.subn(1),G=0;while(!V.isZero()&&V.andln(1)===0)G++,V.iushrn(1);S(!V.isZero());var O=new Q(1).toRed(this),J=O.redNeg(),z=this.m.subn(1).iushrn(1),W=this.m.bitLength();W=new Q(2*W*W).toRed(this);while(this.pow(W,z).cmp(J)!==0)W.redIAdd(J);var j=this.pow(W,V),N=this.pow(Z,V.addn(1).iushrn(1)),p=this.pow(Z,V),n=G;while(p.cmp(O)!==0){var E0=p;for(var r=0;E0.cmp(O)!==0;r++)E0=E0.redSqr();S(r<n);var d=this.pow(j,new Q(1).iushln(n-r-1));N=N.redMul(d),j=d.redSqr(),p=p.redMul(j),n=r}return N},A.prototype.invm=function(Z){var C=Z._invmp(this.m);if(C.negative!==0)return C.negative=0,this.imod(C).redNeg();else return this.imod(C)},A.prototype.pow=function(Z,C){if(C.isZero())return new Q(1).toRed(this);if(C.cmpn(1)===0)return Z.clone();var Y=4,V=Array(1<<Y);V[0]=new Q(1).toRed(this),V[1]=Z;for(var G=2;G<V.length;G++)V[G]=this.mul(V[G-1],Z);var O=V[0],J=0,z=0,W=C.bitLength()%26;if(W===0)W=26;for(G=C.length-1;G>=0;G--){var j=C.words[G];for(var N=W-1;N>=0;N--){var p=j>>N&1;if(O!==V[0])O=this.sqr(O);if(p===0&&J===0){z=0;continue}if(J<<=1,J|=p,z++,z!==Y&&(G!==0||N!==0))continue;O=this.mul(O,V[J]),z=0,J=0}W=26}return O},A.prototype.convertTo=function(Z){var C=Z.umod(this.m);return C===Z?C.clone():C},A.prototype.convertFrom=function(Z){var C=Z.clone();return C.red=null,C},Q.mont=function(Z){return new X(Z)};function X(Z){if(A.call(this,Z),this.shift=this.m.bitLength(),this.shift%26!==0)this.shift+=26-this.shift%26;this.r=new Q(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}K(X,A),X.prototype.convertTo=function(Z){return this.imod(Z.ushln(this.shift))},X.prototype.convertFrom=function(Z){var C=this.imod(Z.mul(this.rinv));return C.red=null,C},X.prototype.imul=function(Z,C){if(Z.isZero()||C.isZero())return Z.words[0]=0,Z.length=1,Z;var Y=Z.imul(C),V=Y.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),G=Y.isub(V).iushrn(this.shift),O=G;if(G.cmp(this.m)>=0)O=G.isub(this.m);else if(G.cmpn(0)<0)O=G.iadd(this.m);return O._forceRed(this)},X.prototype.mul=function(Z,C){if(Z.isZero()||C.isZero())return new Q(0)._forceRed(this);var Y=Z.mul(C),V=Y.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),G=Y.isub(V).iushrn(this.shift),O=G;if(G.cmp(this.m)>=0)O=G.isub(this.m);else if(G.cmpn(0)<0)O=G.iadd(this.m);return O._forceRed(this)},X.prototype.invm=function(Z){var C=this.imod(Z._invmp(this.m).mul(this.r2));return C._forceRed(this)}})(typeof I>"u"||I,$)}),$C=Q0(($,I)=>{var E=JE(),L=XZ(),S=qU().Buffer;function K(M){var H=M.modulus.byteLength(),F;do F=new E(L(H));while(F.cmp(M.modulus)>=0||!F.umod(M.prime1)||!F.umod(M.prime2));return F}function Q(M){var H=K(M),F=H.toRed(E.mont(M.modulus)).redPow(new E(M.publicExponent)).fromRed();return{blinder:F,unblinder:H.invm(M.modulus)}}function T(M,H){var F=Q(H),R=H.modulus.byteLength(),D=new E(M).mul(F.blinder).umod(H.modulus),q=D.toRed(E.mont(H.prime1)),P=D.toRed(E.mont(H.prime2)),_=H.coefficient,k=H.prime1,B=H.prime2,v=q.redPow(H.exponent1).fromRed(),g=P.redPow(H.exponent2).fromRed(),f=v.isub(g).imul(_).umod(k).imul(B);return g.iadd(f).imul(F.unblinder).umod(H.modulus).toArrayLike(S,"be",R)}T.getr=K,I.exports=T}),YE=Q0(($,I)=>{var E=UC(),L=XZ(),S=GZ(),K=OC(),Q=ZC(),T=vA(),M=AC(),H=$C(),F=qU().Buffer;I.exports=function(P,_,k){var B;if(P.padding)B=P.padding;else if(k)B=1;else B=4;var v=E(P),g;if(B===4)g=R(v,_);else if(B===1)g=D(v,_,k);else if(B===3){if(g=new T(_),g.cmp(v.modulus)>=0)throw Error("data too long for modulus")}else throw Error("unknown padding");if(k)return H(g,v);else return M(g,v)};function R(P,_){var k=P.modulus.byteLength(),B=_.length,v=S("sha1").update(F.alloc(0)).digest(),g=v.length,f=2*g;if(B>k-f-2)throw Error("message too long");var w=F.alloc(k-B-f-2),b=k-g-1,I0=L(g),X0=Q(F.concat([v,w,F.alloc(1,1),_],b),K(I0,b)),C0=Q(I0,K(X0,g));return new T(F.concat([F.alloc(1),C0,X0],k))}function D(P,_,k){var B=_.length,v=P.modulus.byteLength();if(B>v-11)throw Error("message too long");var g;if(k)g=F.alloc(v-B-3,255);else g=q(v-B-3);return new T(F.concat([F.from([0,k?1:2]),g,F.alloc(1),_],v))}function q(P){var _=F.allocUnsafe(P),k=0,B=L(P*2),v=0,g;while(k<P){if(v===B.length)B=L(P*2),v=0;if(g=B[v++],g)_[k++]=g}return _}}),SE=Q0(($,I)=>{var E=UC(),L=OC(),S=ZC(),K=vA(),Q=$C(),T=GZ(),M=AC(),H=qU().Buffer;I.exports=function(q,P,_){var k;if(q.padding)k=q.padding;else if(_)k=1;else k=4;var B=E(q),v=B.modulus.byteLength();if(P.length>v||new K(P).cmp(B.modulus)>=0)throw Error("decryption error");var g;if(_)g=M(new K(P),B);else g=Q(P,B);var f=H.alloc(v-g.length);if(g=H.concat([f,g],v),k===4)return F(B,g);else if(k===1)return R(B,g,_);else if(k===3)return g;else throw Error("unknown padding")};function F(q,P){var _=q.modulus.byteLength(),k=T("sha1").update(H.alloc(0)).digest(),B=k.length;if(P[0]!==0)throw Error("decryption error");var v=P.slice(1,B+1),g=P.slice(B+1),f=S(v,L(g,B)),w=S(g,L(f,_-B-1));if(D(k,w.slice(0,B)))throw Error("decryption error");var b=B;while(w[b]===0)b++;if(w[b++]!==1)throw Error("decryption error");return w.slice(b)}function R(q,P,_){var k=P.slice(0,2),B=2,v=0;while(P[B++]!==0)if(B>=P.length){v++;break}var g=P.slice(2,B-1);if(k.toString("hex")!=="0002"&&!_||k.toString("hex")!=="0001"&&_)v++;if(g.length<8)v++;if(v)throw Error("decryption error");return P.slice(B)}function D(q,P){q=H.from(q),P=H.from(P);var _=0,k=q.length;if(q.length!==P.length)_++,k=Math.min(q.length,P.length);var B=-1;while(++B<k)_+=q[B]^P[B];return _}}),FA=Q0(($)=>{$.publicEncrypt=YE(),$.privateDecrypt=SE(),$.privateEncrypt=function(I,E){return $.publicEncrypt(I,E,!0)},$.publicDecrypt=function(I,E){return $.privateDecrypt(I,E,!0)}}),VE=Q0(($)=>{var I=(vU(),l0(jU));if(typeof I.publicEncrypt!=="function")I=FA();if($.publicEncrypt=I.publicEncrypt,$.privateDecrypt=I.privateDecrypt,typeof I.privateEncrypt!=="function")$.privateEncrypt=FA().privateEncrypt;else $.privateEncrypt=I.privateEncrypt;if(typeof I.publicDecrypt!=="function")$.publicDecrypt=FA().publicDecrypt;else $.publicDecrypt=I.publicDecrypt}),LE=Q0(($)=>{var I=qU(),E=XZ(),L=I.Buffer,S=I.kMaxLength,K=globalThis.crypto||globalThis.msCrypto,Q=Math.pow(2,32)-1;function T(D,q){if(typeof D!=="number"||D!==D)throw TypeError("offset must be a number");if(D>Q||D<0)throw TypeError("offset must be a uint32");if(D>S||D>q)throw RangeError("offset out of range")}function M(D,q,P){if(typeof D!=="number"||D!==D)throw TypeError("size must be a number");if(D>Q||D<0)throw TypeError("size must be a uint32");if(D+q>P||D>S)throw RangeError("buffer too small")}K&&K.getRandomValues,$.randomFill=H,$.randomFillSync=R;function H(D,q,P,_){if(!L.isBuffer(D)&&!(D instanceof globalThis.Uint8Array))throw TypeError('"buf" argument must be a Buffer or Uint8Array');if(typeof q==="function")_=q,q=0,P=D.length;else if(typeof P==="function")_=P,P=D.length-q;else if(typeof _!=="function")throw TypeError('"cb" argument must be a function');return T(q,D.length),M(P,q,D.length),F(D,q,P,_)}function F(D,q,P,_){if(!1)var k,B;if(_){E(P,function(g,f){if(g)return _(g);f.copy(D,q),_(null,D)});return}var v=E(P);return v.copy(D,q),D}function R(D,q,P){if(typeof q>"u")q=0;if(!L.isBuffer(D)&&!(D instanceof globalThis.Uint8Array))throw TypeError('"buf" argument must be a Buffer or Uint8Array');if(T(q,D.length),P===void 0)P=D.length-q;return M(P,q,D.length),F(D,q,P)}}),RE=Q0(($,I)=>{var E=(vU(),l0(jU));if(typeof E.randomFill==="function"&&typeof E.randomFillSync==="function")$.randomFill=E.randomFill,$.randomFillSync=E.randomFillSync;else I.exports=LE()}),DE=Q0(($)=>{$.randomBytes=$.rng=$.pseudoRandomBytes=$.prng=XZ(),$.createHash=$.Hash=GZ(),$.createHmac=$.Hmac=gI();var I=uX(),E=Object.keys(I),L=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(E);$.getHashes=function(){return L};var S=dI();$.pbkdf2=S.pbkdf2,$.pbkdf2Sync=S.pbkdf2Sync;var K=zG();$.Cipher=K.Cipher,$.createCipher=K.createCipher,$.Cipheriv=K.Cipheriv,$.createCipheriv=K.createCipheriv,$.Decipher=K.Decipher,$.createDecipher=K.createDecipher,$.Decipheriv=K.Decipheriv,$.createDecipheriv=K.createDecipheriv,$.getCiphers=K.getCiphers,$.listCiphers=K.listCiphers;var Q=TG();$.DiffieHellmanGroup=Q.DiffieHellmanGroup,$.createDiffieHellmanGroup=Q.createDiffieHellmanGroup,$.getDiffieHellman=Q.getDiffieHellman,$.createDiffieHellman=Q.createDiffieHellman,$.DiffieHellman=Q.DiffieHellman;var T=qG();$.createSign=T.createSign,$.Sign=T.Sign,$.createVerify=T.createVerify,$.Verify=T.Verify,$.createECDH=sG();var M=VE();$.publicEncrypt=M.publicEncrypt,$.privateEncrypt=M.privateEncrypt,$.publicDecrypt=M.publicDecrypt,$.privateDecrypt=M.privateDecrypt;var H=RE();$.randomFill=H.randomFill,$.randomFillSync=H.randomFillSync,$.createCredentials=function(){throw Error(`sorry, createCredentials is not implemented yet
|
|
16
16
|
we accept pull requests
|
|
17
|
-
https://github.com/browserify/crypto-browserify`)}
|
|
18
|
-
`);if(
|
|
19
|
-
`),
|
|
20
|
-
`),values:{healthyContainers:z,unhealthyContainers:A.length-z},data:{reports:A}}}};import{logger as RX}from"@elizaos/core";var CZ="https://www.elizacloud.ai/dashboard/billing",TX=new WeakMap,fY=60000,zX={name:"elizacloud_credits",description:"ElizaCloud credit balance",dynamic:!0,position:91,async get(Q,$,V){let W=Q.getService("CLOUD_AUTH");if(!W?.isAuthenticated())return{text:""};let C=TX.get(Q);if(C&&Date.now()-C.at<fY)return KZ(C.value);let F;try{let{data:A}=await W.getClient().get("/credits/balance");F=A.balance}catch(A){if(RX.warn(`[CloudCredits] Failed to fetch balance: ${A instanceof Error?A.message:A}`),C)return KZ(C.value);return{text:""}}if(TX.set(Q,{value:F,at:Date.now()}),F<1)RX.warn(`[CloudCredits] Low balance: $${F.toFixed(2)}`);return KZ(F)}};function KZ(Q){let $=Q<2,V=Q<0.5,W=`ElizaCloud credits: $${Q.toFixed(2)}`;if(V)W+=` (CRITICAL — top up at ${CZ})`;else if($)W+=` (LOW — top up at ${CZ})`;return{text:W,values:{cloudCredits:Q,cloudCreditsLow:$,cloudCreditsCritical:V,cloudTopUpUrl:CZ}}}var MX=new WeakMap,PX={name:"elizacloud_models",description:"Available AI models from ElizaCloud grouped by provider",dynamic:!0,position:92,async get(Q,$,V){let W=Q.getService("CLOUD_MODEL_REGISTRY");if(!W)return{text:""};let C=MX.get(Q);if(C&&Date.now()-C.at<300000)return qX(C.value);let F=await W.getModelsByProvider();if(Object.keys(F).length===0)return{text:""};return MX.set(Q,{value:F,at:Date.now()}),qX(F)}};function qX(Q){let $=Object.keys(Q).sort(),V=Object.values(Q).reduce((W,C)=>W+C.length,0);return{text:`ElizaCloud: ${V} models (${$.join(", ")})`,values:{cloudModelProviders:$.join(","),cloudModelCount:V}}}import{logger as hU}from"@elizaos/core";import{logger as fO}from"@elizaos/core";function wY(Q){if(typeof process>"u")return;let $=process.env[Q];return $===void 0?void 0:String($)}function u0(Q,$,V){let W=Q.getSetting($);if(W!==void 0&&W!==null)return String(W);return wY($)??V}function tU(){return typeof globalThis<"u"&&typeof globalThis.document<"u"}function kX(Q){return tU()&&!!u0(Q,"ELIZAOS_CLOUD_BROWSER_BASE_URL")}function gU(Q,$=!1){if(tU())return{};let V=$?yY(Q):rU(Q);return V?{Authorization:`Bearer ${V}`}:{}}function PU(Q){let $=u0(Q,"ELIZAOS_CLOUD_BROWSER_BASE_URL");return tU()&&$?$:u0(Q,"ELIZAOS_CLOUD_BASE_URL","https://www.elizacloud.ai/api/v1")}function _X(Q){let $=tU()?u0(Q,"ELIZAOS_CLOUD_BROWSER_EMBEDDING_URL")||u0(Q,"ELIZAOS_CLOUD_BROWSER_BASE_URL"):u0(Q,"ELIZAOS_CLOUD_EMBEDDING_URL");if($)return fO.debug(`[ELIZAOS_CLOUD] Using specific embedding base URL: ${$}`),$;return fO.debug("[ELIZAOS_CLOUD] Falling back to general base URL for embeddings."),PU(Q)}function rU(Q){return u0(Q,"ELIZAOS_CLOUD_API_KEY")}function yY(Q){let $=u0(Q,"ELIZAOS_CLOUD_EMBEDDING_API_KEY");if($)return fO.debug("[ELIZAOS_CLOUD] Using specific embedding API key (present)"),$;return fO.debug("[ELIZAOS_CLOUD] Falling back to general API key for embeddings."),rU(Q)}function wO(Q){return u0(Q,"ELIZAOS_CLOUD_SMALL_MODEL")??u0(Q,"SMALL_MODEL","openai/gpt-5-mini")}function SO(Q){return u0(Q,"ELIZAOS_CLOUD_LARGE_MODEL")??u0(Q,"LARGE_MODEL","anthropic/claude-sonnet-4.5")}function vX(Q){return u0(Q,"ELIZAOS_CLOUD_IMAGE_DESCRIPTION_MODEL","gpt-5-mini")}function jX(Q){return u0(Q,"ELIZAOS_CLOUD_IMAGE_GENERATION_MODEL","google/gemini-2.5-flash-image")??"google/gemini-2.5-flash-image"}function BX(Q){return u0(Q,"ELIZAOS_CLOUD_REASONING_SMALL_MODEL")??u0(Q,"REASONING_SMALL_MODEL","deepseek/deepseek-r1")}function xX(Q){return u0(Q,"ELIZAOS_CLOUD_REASONING_LARGE_MODEL")??u0(Q,"REASONING_LARGE_MODEL","anthropic/claude-opus-4.5")}function NX(Q){return u0(Q,"ELIZAOS_CLOUD_RESEARCH_MODEL")??u0(Q,"RESEARCH_MODEL","o3-deep-research")}function gX(Q){let $=u0(Q,"ELIZAOS_CLOUD_EXPERIMENTAL_TELEMETRY","false");return String($).toLowerCase()==="true"}function fX(Q,$){(async()=>{try{if(!rU($)&&!tU()){hU.warn("ELIZAOS_CLOUD_API_KEY is not set in environment - ElizaOS Cloud functionality will be limited"),hU.info("Get your API key from https://www.elizacloud.ai/dashboard/api-keys");return}try{let V=PU($),W=await fetch(`${V}/models`,{headers:{...gU($)}});if(!W.ok)hU.warn(`ElizaOS Cloud API key validation failed: ${W.statusText}`),hU.warn("ElizaOS Cloud functionality will be limited until a valid API key is provided"),hU.info("Get your API key from https://www.elizacloud.ai/dashboard/api-keys");else hU.log("ElizaOS Cloud API key validated successfully")}catch(V){let W=V instanceof Error?V.message:String(V);hU.warn(`Error validating ElizaOS Cloud API key: ${W}`),hU.warn("ElizaOS Cloud functionality will be limited until a valid API key is provided")}}catch(V){let W=V?.errors?.map((C)=>C.message).join(", ")||(V instanceof Error?V.message:String(V));hU.warn(`ElizaOS Cloud plugin configuration issue: ${W} - You need to configure the ELIZAOS_CLOUD_API_KEY in your environment variables`),hU.info("Get your API key from https://www.elizacloud.ai/dashboard/api-keys")}})()}import{logger as TU,ModelType as pY,VECTOR_DIMS as wX}from"@elizaos/core";import{EventType as cY}from"@elizaos/core";function yU(Q,$,V,W){let C=Number(W.inputTokens||0),F=Number(W.outputTokens||0),A=Number(W.totalTokens!=null?W.totalTokens:C+F);Q.emitEvent(cY.MODEL_USED,{runtime:Q,source:"elizacloud",type:$,tokens:{prompt:C,completion:F,total:A}})}var yO=100;function hY(Q){return{remainingRequests:parseInt(Q.headers.get("x-ratelimit-remaining-requests")||"",10)||void 0,remainingTokens:parseInt(Q.headers.get("x-ratelimit-remaining-tokens")||"",10)||void 0,limitRequests:parseInt(Q.headers.get("x-ratelimit-limit-requests")||"",10)||void 0,limitTokens:parseInt(Q.headers.get("x-ratelimit-limit-tokens")||"",10)||void 0,resetRequests:Q.headers.get("x-ratelimit-reset-requests")||void 0,resetTokens:Q.headers.get("x-ratelimit-reset-tokens")||void 0,retryAfter:parseInt(Q.headers.get("retry-after")||"",10)||void 0}}function yX(Q){let $=u0(Q,"ELIZAOS_CLOUD_EMBEDDING_MODEL","text-embedding-3-small"),V=Number.parseInt(u0(Q,"ELIZAOS_CLOUD_EMBEDDING_DIMENSIONS","1536")||"1536",10);if(!Object.values(wX).includes(V)){let W=`Invalid embedding dimension: ${V}. Must be one of: ${Object.values(wX).join(", ")}`;throw TU.error(W),Error(W)}return{embeddingModelName:$,embeddingDimension:V}}function aU(Q,$){let V=Array(Q).fill(0);return V[0]=$,V}async function LZ(Q,$){let{embeddingDimension:V}=yX(Q);if($===null)return TU.debug("Creating test embedding for initialization"),aU(V,0.1);let W;if(typeof $==="string")W=$;else if(typeof $==="object"&&$.text)W=$.text;else return TU.warn("Invalid input format for embedding"),aU(V,0.2);if(!W.trim())return TU.warn("Empty text for embedding"),aU(V,0.3);return(await cX(Q,[W]))[0]}async function cX(Q,$){let{embeddingModelName:V,embeddingDimension:W}=yX(Q),C=_X(Q);if(!$||$.length===0)return TU.warn("[BatchEmbeddings] Empty texts array"),[];let F=[],A=Array($.length);for(let z=0;z<$.length;z++){let M=$[z]?.trim();if(M)F.push({text:M,originalIndex:z});else A[z]=aU(W,0.3)}if(F.length===0)return TU.warn("[BatchEmbeddings] All texts were empty"),A;for(let z=0;z<F.length;z+=yO){let M=Math.min(z+yO,F.length),S=F.slice(z,M),R=S.map((L)=>L.text);TU.info(`[BatchEmbeddings] Processing batch ${Math.floor(z/yO)+1}/${Math.ceil(F.length/yO)}: ${S.length} texts`);try{let L=await fetch(`${C}/embeddings`,{method:"POST",headers:{...gU(Q,!0),"Content-Type":"application/json"},body:JSON.stringify({model:V,input:R})}),H=hY(L);if(H.remainingRequests!==void 0&&H.remainingRequests<50)TU.warn(`[BatchEmbeddings] Rate limit: ${H.remainingRequests}/${H.limitRequests} requests remaining`);if(L.status===429){let P=H.retryAfter||30;TU.warn(`[BatchEmbeddings] Rate limited, waiting ${P}s...`),await new Promise((B)=>setTimeout(B,P*1000));let _=await fetch(`${C}/embeddings`,{method:"POST",headers:{...gU(Q,!0),"Content-Type":"application/json"},body:JSON.stringify({model:V,input:R})});if(!_.ok){TU.error(`[BatchEmbeddings] Retry failed: ${_.status}`);for(let B of S)A[B.originalIndex]=aU(W,0.4);continue}let k=await _.json();if(k?.data){for(let B of k.data){let j=S[B.index].originalIndex;A[j]=B.embedding}TU.info(`[BatchEmbeddings] Retry successful for ${S.length} embeddings`)}continue}if(!L.ok){TU.error(`[BatchEmbeddings] API error: ${L.status} - ${L.statusText}`);for(let P of S)A[P.originalIndex]=aU(W,0.4);continue}let q=await L.json();if(!q?.data||!Array.isArray(q.data)){TU.error("[BatchEmbeddings] API returned invalid structure");for(let P of S)A[P.originalIndex]=aU(W,0.5);continue}for(let P of q.data){let _=S[P.index].originalIndex;A[_]=P.embedding}if(q.usage){let P={inputTokens:q.usage.prompt_tokens,outputTokens:0,totalTokens:q.usage.total_tokens};yU(Q,pY.TEXT_EMBEDDING,`batch:${S.length}`,P)}TU.debug(`[BatchEmbeddings] Got ${S.length} embeddings (${W}d), remaining: ${H.remainingRequests??"unknown"}`)}catch(L){let H=L instanceof Error?L.message:String(L);TU.error(`[BatchEmbeddings] Error: ${H}`);for(let q of S)A[q.originalIndex]=aU(W,0.6)}}return A}import{logger as kO,ModelType as dA}from"@elizaos/core";import{logger as vQ}from"@elizaos/core";import{JSONParseError as lA}from"ai";function BZ(){return async({text:Q,error:$})=>{try{if($ instanceof lA){let V=Q.replace(/```json\n|\n```|```/g,"");return JSON.parse(V),V}return null}catch(V){let W=V instanceof Error?V.message:String(V);return vQ.warn(`Failed to repair JSON text: ${W}`),null}}}async function jQ(Q){try{let{Readable:$}=await Promise.resolve().then(() => PY(dO(),1)),V=Q.getReader();return new $({async read(){try{let{done:W,value:C}=await V.read();if(W)this.push(null);else this.push(C)}catch(W){this.destroy(W)}},destroy(W,C){V.cancel().finally(()=>C(W))}})}catch($){let V=$ instanceof Error?$.message:String($);throw vQ.error(`Failed to load node:stream module: ${V}`),Error("Cannot convert stream: node:stream module unavailable. This feature requires a Node.js environment.")}}function BQ(Q){let V=Q.match(/title[:\s]+(.+?)(?:\n|$)/i)?.[1]?.trim()||"Image Analysis",W=Q.replace(/title[:\s]+(.+?)(?:\n|$)/i,"").trim();return{title:V,description:W}}async function xZ(Q,$){let V=$.count||1,W=$.size||"1024x1024",C=$.prompt,F=jX(Q);kO.log(`[ELIZAOS_CLOUD] Using IMAGE model: ${F}`);let A=PU(Q),M={"1024x1024":"1:1","1792x1024":"16:9","1024x1792":"9:16"}[W]||"1:1";try{let S=`${A}/generate-image`,R={prompt:C,numImages:V,aspectRatio:M,model:F},L=await fetch(S,{method:"POST",headers:{...gU(Q),"Content-Type":"application/json"},body:JSON.stringify(R)});if(!L.ok){let _=await L.text();throw Error(`Failed to generate image: ${L.status} ${_}`)}return(await L.json()).images.map((_)=>({url:_.url||_.image}))}catch(S){let R=S instanceof Error?S.message:String(S);throw kO.error(`[ELIZAOS_CLOUD] Image generation error: ${R}`),S}}async function NZ(Q,$){let V,W,C=vX(Q);kO.log(`[ELIZAOS_CLOUD] Using IMAGE_DESCRIPTION model: ${C}`);let F=Number.parseInt(u0(Q,"ELIZAOS_CLOUD_IMAGE_DESCRIPTION_MAX_TOKENS","8192")||"8192",10);if(typeof $==="string")V=$,W="Please analyze this image and provide a title and detailed description.";else V=$.imageUrl,W=$.prompt||"Please analyze this image and provide a title and detailed description.";let A=[{role:"user",content:[{type:"text",text:W},{type:"image_url",image_url:{url:V}}]}],z=PU(Q);try{let M={model:C,messages:A,max_tokens:F},S=null;for(let H=0;H<3;H++){if(S=await fetch(`${z}/chat/completions`,{method:"POST",headers:{"Content-Type":"application/json",...gU(Q)},body:JSON.stringify(M)}),S.status===429&&H<2){let q=(H+1)*2000;kO.warn(`[ELIZAOS_CLOUD] Image analysis rate-limited (429), retrying in ${q/1000}s...`),await new Promise((P)=>setTimeout(P,q));continue}break}if(!S||!S.ok){let H=S?.status??0;if(H===402)throw Error("Eliza Cloud credits exhausted — top up at https://www.elizacloud.ai/dashboard/billing");throw Error(`ElizaOS Cloud API error: ${H}`)}let R=await S.json(),L=R.choices?.[0]?.message?.content;if(R.usage)yU(Q,dA.IMAGE_DESCRIPTION,typeof $==="string"?$:$.prompt||"",{inputTokens:R.usage.prompt_tokens,outputTokens:R.usage.completion_tokens,totalTokens:R.usage.total_tokens});if(!L)return{title:"Failed to analyze image",description:"No response from API"};return BQ(L)}catch(M){let S=M instanceof Error?M.message:String(M);return kO.error(`Error analyzing image: ${S}`),{title:"Failed to analyze image",description:`Error: ${S}`}}}import{logger as IO,ModelType as xQ}from"@elizaos/core";import{generateObject as nA,JSONParseError as mA}from"ai";import{createOpenAI as oA}from"@ai-sdk/openai";function oO(Q){let $=PU(Q),V=rU(Q)??(kX(Q)?"eliza-proxy":void 0);return oA({apiKey:V??"",baseURL:$})}var sA=["o1","o3","o4","deepseek-r1","deepseek-reasoner","claude-opus-4.5","claude-opus-4","gpt-5-mini","gpt-5"];function tA(Q){let $=Q.toLowerCase();return sA.some((V)=>$.includes(V))}async function NQ(Q,$,V,W){let C=oO(Q),F=W(Q);IO.log(`[ELIZAOS_CLOUD] Using ${V} model: ${F}`);let A=tA(F);try{let z=C.chat(F),{object:M,usage:S}=await nA({model:z,output:"no-schema",prompt:$.prompt,...A?{}:{temperature:$.temperature??0},experimental_repairText:BZ()});if(S)yU(Q,V,$.prompt,S);return M}catch(z){if(z instanceof mA){IO.error(`[generateObject] Failed to parse JSON: ${z.message}`);let S=await BZ()({text:z.text,error:z});if(S)try{let R=JSON.parse(S);return IO.info("[generateObject] Successfully repaired JSON."),R}catch(R){let L=R instanceof Error?R.message:String(R);throw IO.error(`[generateObject] Failed to parse repaired JSON: ${L}`),R}else throw IO.error("[generateObject] JSON repair failed."),z}else{let M=z instanceof Error?z.message:String(z);throw IO.error(`[generateObject] Error: ${M}`),z}}}async function gZ(Q,$){return NQ(Q,$,xQ.OBJECT_SMALL,wO)}async function fZ(Q,$){return NQ(Q,$,xQ.OBJECT_LARGE,SO)}import{logger as rA,ModelType as aA}from"@elizaos/core";function eA(Q){return Q.filter(($)=>$.url!==void 0).map(($)=>({url:$.url,title:$.title??"",startIndex:$.start_index??0,endIndex:$.end_index??0}))}function iA(Q){let $=[];for(let V of Q)switch(V.type){case"web_search_call":$.push({id:V.id??"",type:"web_search_call",status:V.status??"completed",action:{type:V.action?.type??"search",query:V.action?.query,url:V.action?.url}});break;case"file_search_call":$.push({id:V.id??"",type:"file_search_call",status:V.status??"completed",query:V.query??"",results:V.results?.map((W)=>({fileId:W.file_id,fileName:W.file_name,score:W.score}))});break;case"code_interpreter_call":$.push({id:V.id??"",type:"code_interpreter_call",status:V.status??"completed",code:V.code??"",output:V.output});break;case"mcp_tool_call":$.push({id:V.id??"",type:"mcp_tool_call",status:V.status??"completed",serverLabel:V.server_label??"",toolName:V.tool_name??"",arguments:V.arguments??{},result:V.result});break;case"message":{let W=V.content??[];$.push({type:"message",content:W.filter((C)=>C.type==="output_text").map((C)=>({type:"output_text",text:C.text??"",annotations:eA(C.annotations??[])}))});break}}return $}async function wZ(Q,$){let V=$.model??NX(Q);rA.log(`[ELIZAOS_CLOUD] Using RESEARCH model: ${V}`);let W=PU(Q),C=$.tools??[{type:"web_search_preview"}],F={model:V,input:$.input,tools:C};if($.instructions)F.instructions=$.instructions;if($.background!==void 0)F.background=$.background;if($.maxToolCalls!==void 0)F.max_tool_calls=$.maxToolCalls;if($.reasoningSummary)F.reasoning={summary:$.reasoningSummary};let A=await fetch(`${W}/responses`,{method:"POST",headers:{...gU(Q),"Content-Type":"application/json"},body:JSON.stringify(F)});if(!A.ok){let L=await A.text();throw Error(`Research API error: ${A.status} ${L}`)}let z=await A.json();if(z.usage)yU(Q,aA.RESEARCH,$.input,{inputTokens:z.usage.input_tokens,outputTokens:z.usage.output_tokens,totalTokens:z.usage.total_tokens});let M=iA(z.output),S="",R=[];for(let L of M)if(L.type==="message"){for(let H of L.content)if(H.type==="output_text")S+=H.text,R.push(...H.annotations)}return{id:z.id,text:S,annotations:R,outputItems:M,status:z.status}}import{logger as _E}from"@elizaos/core";async function yZ(Q,$){let V=u0(Q,"ELIZAOS_CLOUD_TTS_MODEL","gpt-5-mini-tts"),W=u0(Q,"ELIZAOS_CLOUD_TTS_VOICE","nova"),C=u0(Q,"ELIZAOS_CLOUD_TTS_INSTRUCTIONS",""),F=PU(Q),A=$.model||V,z=$.voice||W,M=$.instructions??C,S=$.format||"mp3";try{let R=await fetch(`${F}/audio/speech`,{method:"POST",headers:{...gU(Q),"Content-Type":"application/json",...S==="mp3"?{Accept:"audio/mpeg"}:{}},body:JSON.stringify({model:A,voice:z,input:$.text,format:S,...M&&{instructions:M}})});if(!R.ok){let L=await R.text();throw Error(`ElizaOS Cloud TTS error ${R.status}: ${L}`)}if(!R.body)throw Error("ElizaOS Cloud TTS response body is null");if(!tU())return await jQ(R.body);return R.body}catch(R){let L=R instanceof Error?R.message:String(R);throw Error(`Failed to fetch speech from ElizaOS Cloud TTS: ${L}`)}}import{logger as nO,ModelType as lU}from"@elizaos/core";import{generateText as U$,streamText as O$}from"ai";var Z$=["o1","o3","o4","deepseek-r1","deepseek-reasoner","claude-opus-4.5","claude-opus-4","gpt-5-mini","gpt-5"];function X$(Q){let $=Q.toLowerCase();return Z$.some((V)=>$.includes(V))}function Q$(Q,$){switch($){case lU.TEXT_SMALL:return wO(Q);case lU.TEXT_LARGE:return SO(Q);case lU.TEXT_REASONING_SMALL:return BX(Q);case lU.TEXT_REASONING_LARGE:return xX(Q);default:return SO(Q)}}function Y$(Q,$,V){let{prompt:W,stopSequences:C=[]}=V,F=V.maxTokens??8192,A=oO(Q),z=Q$(Q,$),M=gX(Q),S=A.chat(z),R=X$(z)||$===lU.TEXT_REASONING_SMALL||$===lU.TEXT_REASONING_LARGE;return{generateParams:{model:S,prompt:W,system:Q.character.system??void 0,...R?{}:{stopSequences:C},maxOutputTokens:F,experimental_telemetry:{isEnabled:M}},modelName:z,modelType:$,prompt:W}}function A$(Q,$,V,W){nO.debug(`[ELIZAOS_CLOUD] Streaming text with ${$} model`);let C=O$(V);return{textStream:C.textStream,text:Promise.resolve(C.text),usage:Promise.resolve(C.usage).then((F)=>{if(F){yU(Q,$,W,F);let A=F.inputTokens??0,z=F.outputTokens??0;return{promptTokens:A,completionTokens:z,totalTokens:A+z}}return}),finishReason:Promise.resolve(C.finishReason)}}async function mO(Q,$,V){let{generateParams:W,modelName:C,prompt:F}=Y$(Q,$,V);if(nO.debug(`[ELIZAOS_CLOUD] Generating text with ${$} model: ${C}`),V.stream)return A$(Q,$,W,F);nO.log(`[ELIZAOS_CLOUD] Using ${$} model: ${C}`),nO.log(F);let A=await U$(W);if(A.usage)yU(Q,$,F,A.usage);return A.text}async function cZ(Q,$){return mO(Q,lU.TEXT_SMALL,$)}async function pZ(Q,$){return mO(Q,lU.TEXT_LARGE,$)}async function hZ(Q,$){return mO(Q,lU.TEXT_REASONING_SMALL,$)}async function uZ(Q,$){return mO(Q,lU.TEXT_REASONING_LARGE,$)}import{logger as ZO,Service as KV}from"@elizaos/core";import{logger as $$}from"@elizaos/core";class bZ{baseUrl;apiKey;constructor(Q,$){this.baseUrl=Q.replace(/\/+$/,""),this.apiKey=$}setApiKey(Q){this.apiKey=Q}setBaseUrl(Q){this.baseUrl=Q.replace(/\/+$/,"")}getBaseUrl(){return this.baseUrl}getApiKey(){return this.apiKey}buildWsUrl(Q){return`${this.baseUrl.replace(/^http/,"ws")}${Q}`}async get(Q){return this.request("GET",Q)}async post(Q,$){return this.request("POST",Q,$)}async delete(Q){return this.request("DELETE",Q)}async postUnauthenticated(Q,$){return this.request("POST",Q,$,!0)}async request(Q,$,V,W=!1){let C=`${this.baseUrl}${$}`;$$.debug(`[CloudAPI] ${Q} ${C}`);let F={"Content-Type":"application/json",Accept:"application/json"};if(!W&&this.apiKey)F.Authorization=`Bearer ${this.apiKey}`;let A=await fetch(C,{method:Q,headers:F,...V?{body:JSON.stringify(V)}:{}});return this.handleResponse(A)}async handleResponse(Q){if(!(Q.headers.get("content-type")??"").includes("application/json")){if(!Q.ok)throw new DO(Q.status,{success:!1,error:`HTTP ${Q.status}: ${Q.statusText}`});return{success:!0}}let V=await Q.json();if(!Q.ok){let W=V;throw Q.status===402?new IZ(W):new DO(Q.status,W)}return V}}async function LV(){let Q=await Promise.resolve().then(() => (dZ(),lZ)),$=await Promise.resolve().then(() => (jU(),vU)),V=Q.cpus(),W=[Q.hostname(),Q.platform(),Q.arch(),V[0]?.model??"?",V.length,Q.totalmem()].join(":");return $.createHash("sha256").update(W).digest("hex")}function WV(){if(typeof process>"u")return"web";return{darwin:"macos",win32:"windows",linux:"linux"}[process.platform]??"linux"}class QZ extends KV{static serviceType="CLOUD_AUTH";capabilityDescription="ElizaCloud device authentication and session management";client;credentials=null;constructor(Q){super(Q);this.client=new bZ(qU.baseUrl)}static async start(Q){let $=new QZ(Q);return await $.initialize(),$}async stop(){this.credentials=null}async initialize(){let Q=String(this.runtime.getSetting("ELIZAOS_CLOUD_BASE_URL")??qU.baseUrl);this.client.setBaseUrl(Q);let $=this.runtime.getSetting("ELIZAOS_CLOUD_API_KEY");if($){let W=String($);this.client.setApiKey(W),this.credentials={apiKey:W,userId:String(this.runtime.getSetting("ELIZAOS_CLOUD_USER_ID")??""),organizationId:String(this.runtime.getSetting("ELIZAOS_CLOUD_ORG_ID")??""),authenticatedAt:Date.now()},ZO.info("[CloudAuth] Authenticated with saved API key"),this.validateApiKey(W).then((C)=>{if(!C)ZO.warn("[CloudAuth] Saved API key could not be validated (cloud may be unreachable or key revoked) — model calls will use the key anyway")}).catch(()=>{});return}let V=this.runtime.getSetting("ELIZAOS_CLOUD_ENABLED");if(V==="true"||V==="1")try{await this.authenticateWithDevice()}catch(W){let C=W instanceof Error?W.message:String(W);ZO.warn(`[CloudAuth] Device auth failed (cloud may be unreachable): ${C}`),ZO.info("[CloudAuth] Service will start unauthenticated — cloud features disabled until connectivity is restored")}else ZO.info("[CloudAuth] Cloud not enabled (set ELIZAOS_CLOUD_ENABLED=true)")}async validateApiKey(Q){try{return(await fetch(`${this.client.getBaseUrl()}/models`,{headers:{Authorization:`Bearer ${Q}`},signal:AbortSignal.timeout(1e4)})).ok}catch($){let V=$ instanceof Error?$.message:String($);return ZO.warn(`[CloudAuth] Could not reach cloud API to validate key: ${V}`),!1}}async authenticateWithDevice(){let Q=await LV(),$=WV(),V=process.env.ELIZAOS_CLOUD_APP_VERSION??"2.0.0-alpha",W=await Promise.resolve().then(() => (dZ(),lZ));ZO.info(`[CloudAuth] Authenticating device (platform=${$})`);let C=await this.client.postUnauthenticated("/device-auth",{deviceId:Q,platform:$,appVersion:V,deviceName:W.hostname()});this.credentials={apiKey:C.data.apiKey,userId:C.data.userId,organizationId:C.data.organizationId,authenticatedAt:Date.now()},this.client.setApiKey(C.data.apiKey);let F=C.data.isNew?"New account created":"Authenticated";return ZO.info(`[CloudAuth] ${F} (credits: $${C.data.credits.toFixed(2)})`),this.credentials}isAuthenticated(){return this.credentials!==null}getCredentials(){return this.credentials}getApiKey(){return this.credentials?.apiKey??this.client.getApiKey()}getClient(){return this.client}getUserId(){return this.credentials?.userId}getOrganizationId(){return this.credentials?.organizationId}}import{logger as NU,Service as HV}from"@elizaos/core";class YZ extends HV{static serviceType="CLOUD_BACKUP";capabilityDescription="ElizaCloud agent state backup and restore";authService;autoBackups=new Map;maxSnapshots=qU.backup.maxSnapshots;backupIntervalMs=qU.backup.autoBackupIntervalMs;static async start(Q){let $=new YZ(Q);return await $.initialize(),$}async stop(){for(let[,Q]of this.autoBackups)clearInterval(Q.timer);this.autoBackups.clear(),NU.info("[CloudBackup] Service stopped")}async initialize(){let Q=this.runtime.getService("CLOUD_AUTH");if(!Q){NU.warn("[CloudBackup] CloudAuthService not available");return}this.authService=Q,NU.info("[CloudBackup] Service initialized")}async createSnapshot(Q,$="manual",V){let C=await this.authService.getClient().post(`/agent-state/${Q}/snapshot`,{snapshotType:$,metadata:V});NU.info(`[CloudBackup] Created ${$} snapshot for container ${Q} (id=${C.data.id}, size=${DV(C.data.sizeBytes)})`);let F=this.autoBackups.get(Q);if(F)F.lastBackupAt=Date.now();return C.data}async listSnapshots(Q){return(await this.authService.getClient().get(`/agent-state/${Q}/snapshots`)).data}async restoreSnapshot(Q,$){await this.authService.getClient().post(`/agent-state/${Q}/restore`,{snapshotId:$}),NU.info(`[CloudBackup] Restored snapshot ${$} for container ${Q}`)}async getLatestSnapshot(Q){let $=await this.listSnapshots(Q);if($.length===0)return null;return $.sort((V,W)=>new Date(W.created_at).getTime()-new Date(V.created_at).getTime()),$[0]}scheduleAutoBackup(Q,$){if(this.autoBackups.has(Q)){NU.debug(`[CloudBackup] Auto-backup already scheduled for ${Q}`);return}let V=$??this.backupIntervalMs,W=setInterval(()=>{NU.debug(`[CloudBackup] Running auto-backup for container ${Q}`),this.createSnapshot(Q,"auto",{trigger:"scheduled",scheduledIntervalMs:V}).then(()=>this.pruneSnapshots(Q)).catch((C)=>{NU.error(`[CloudBackup] Auto-backup failed for ${Q}: ${C.message}`)})},V);this.autoBackups.set(Q,{containerId:Q,timer:W,lastBackupAt:null}),NU.info(`[CloudBackup] Scheduled auto-backup for ${Q} every ${Math.round(V/60000)} minutes`)}cancelAutoBackup(Q){let $=this.autoBackups.get(Q);if(!$)return;clearInterval($.timer),this.autoBackups.delete(Q),NU.info(`[CloudBackup] Cancelled auto-backup for ${Q}`)}async createPreEvictionSnapshot(Q){return NU.info(`[CloudBackup] Creating pre-eviction snapshot for ${Q}`),this.createSnapshot(Q,"pre-eviction",{trigger:"billing-eviction",createdAt:new Date().toISOString()})}async pruneSnapshots(Q){let W=(await this.listSnapshots(Q)).filter((F)=>F.snapshotType==="auto").sort((F,A)=>new Date(A.created_at).getTime()-new Date(F.created_at).getTime()).slice(this.maxSnapshots);if(W.length===0)return;let C=this.authService.getClient();for(let F of W)await C.delete(`/agent-state/${Q}/snapshots/${F.id}`),NU.debug(`[CloudBackup] Pruned old auto snapshot ${F.id} for ${Q}`);NU.info(`[CloudBackup] Pruned ${W.length} old auto snapshot(s) for ${Q}`)}isAutoBackupScheduled(Q){return this.autoBackups.has(Q)}getLastBackupTime(Q){return this.autoBackups.get(Q)?.lastBackupAt??null}}function DV(Q){if(Q<1024)return`${Q} B`;if(Q<1048576)return`${(Q/1024).toFixed(1)} KB`;if(Q<1073741824)return`${(Q/1048576).toFixed(1)} MB`;return`${(Q/1073741824).toFixed(1)} GB`}import{logger as cU,Service as SV}from"@elizaos/core";import{WebSocket as VX}from"undici";class AZ extends SV{static serviceType="CLOUD_BRIDGE";capabilityDescription="WebSocket bridge to cloud-hosted ElizaOS agents";authService;bridgeConfig=qU.bridge;connections=new Map;static async start(Q){let $=new AZ(Q);return await $.initialize(),$}async stop(){for(let[Q]of this.connections)await this.disconnect(Q);cU.info("[CloudBridge] Service stopped")}async initialize(){let Q=this.runtime.getService("CLOUD_AUTH");if(!Q){cU.warn("[CloudBridge] CloudAuthService not available");return}this.authService=Q,cU.info("[CloudBridge] Service initialized")}async connect(Q){if(this.connections.has(Q)){let $=this.connections.get(Q);if($.state==="connected"||$.state==="connecting"){cU.debug(`[CloudBridge] Already connected/connecting to ${Q}`);return}}await this.establishConnection(Q,0)}async disconnect(Q){let $=this.connections.get(Q);if(!$)return;if($.heartbeatTimer)clearInterval($.heartbeatTimer);if($.reconnectTimer)clearTimeout($.reconnectTimer);for(let[,V]of $.pendingRequests)clearTimeout(V.timeout),V.reject(Error("Bridge disconnected"));if($.pendingRequests.clear(),$.ws.readyState===VX.OPEN||$.ws.readyState===VX.CONNECTING)$.ws.close(1000,"Client disconnect");this.connections.delete(Q),cU.info(`[CloudBridge] Disconnected from ${Q}`)}async establishConnection(Q,$){let V=this.authService.getClient(),W=this.authService.getApiKey(),C=V.buildWsUrl(`/agent-bridge/${Q}`),F=W?`${C}?token=${encodeURIComponent(W)}`:C,A={ws:new VX(F),state:"connecting",connectedAt:null,lastHeartbeat:null,reconnectAttempts:$,heartbeatTimer:null,reconnectTimer:null,handlers:this.connections.get(Q)?.handlers??new Set,pendingRequests:new Map,nextRequestId:1};this.connections.set(Q,A),A.ws.addEventListener("open",()=>{A.state="connected",A.connectedAt=Date.now(),A.reconnectAttempts=0,cU.info(`[CloudBridge] Connected to agent ${Q}`),A.heartbeatTimer=setInterval(()=>{this.sendHeartbeat(Q)},this.bridgeConfig.heartbeatIntervalMs)}),A.ws.addEventListener("message",(z)=>{let M=z.data,S=typeof M==="string"?M:M instanceof Buffer?M.toString("utf-8"):String(M),R=JSON.parse(S);if(R.method==="heartbeat.ack"){A.lastHeartbeat=Date.now();return}if(R.id!==void 0&&!R.method){let L=A.pendingRequests.get(R.id);if(L){if(clearTimeout(L.timeout),A.pendingRequests.delete(R.id),R.error)L.reject(Error(R.error.message));else L.resolve(R.result);return}}for(let L of A.handlers)L(R)}),A.ws.addEventListener("close",(z)=>{if(A.state="disconnected",A.heartbeatTimer)clearInterval(A.heartbeatTimer);if(z.code===1000){cU.info(`[CloudBridge] Clean disconnect from ${Q}`);return}cU.warn(`[CloudBridge] Connection lost to ${Q} (code=${z.code}, reason=${z.reason})`),this.scheduleReconnect(Q,A.reconnectAttempts+1)}),A.ws.addEventListener("error",()=>{cU.error(`[CloudBridge] WebSocket error for ${Q}`)})}scheduleReconnect(Q,$){if($>this.bridgeConfig.maxReconnectAttempts){cU.error(`[CloudBridge] Max reconnect attempts (${this.bridgeConfig.maxReconnectAttempts}) reached for ${Q}`),this.connections.delete(Q);return}let V=this.bridgeConfig.reconnectIntervalMs,W=Math.min(V*2**Math.min($,5),120000),C=Math.floor(Math.random()*1000);cU.info(`[CloudBridge] Reconnecting to ${Q} in ${Math.round((W+C)/1000)}s (attempt ${$})`);let F=this.connections.get(Q);if(F)F.state="reconnecting",F.reconnectTimer=setTimeout(()=>{this.establishConnection(Q,$)},W+C)}sendHeartbeat(Q){let $=this.connections.get(Q);if(!$||$.state!=="connected")return;let V={jsonrpc:"2.0",method:"heartbeat",params:{timestamp:Date.now()}};$.ws.send(JSON.stringify(V))}async sendRequest(Q,$,V,W=60000){let C=this.connections.get(Q);if(!C||C.state!=="connected")throw Error(`Not connected to container ${Q}`);let F=C.nextRequestId++,A={jsonrpc:"2.0",id:F,method:$,params:V};return new Promise((z,M)=>{let S=setTimeout(()=>{C.pendingRequests.delete(F),M(Error(`Request ${$} timed out after ${W}ms`))},W);C.pendingRequests.set(F,{resolve:z,reject:M,timeout:S}),C.ws.send(JSON.stringify(A))})}sendNotification(Q,$,V){let W=this.connections.get(Q);if(!W||W.state!=="connected")throw Error(`Not connected to container ${Q}`);let C={jsonrpc:"2.0",method:$,params:V};W.ws.send(JSON.stringify(C))}async sendChatMessage(Q,$,V,W){return await this.sendRequest(Q,"message.send",{text:$,roomId:V,metadata:W})}async getAgentStatus(Q){return await this.sendRequest(Q,"status.get",{})}async updateAgentConfig(Q,$){await this.sendRequest(Q,"config.update",$)}onMessage(Q,$){let V=this.connections.get(Q);if(!V)V={ws:null,state:"disconnected",connectedAt:null,lastHeartbeat:null,reconnectAttempts:0,heartbeatTimer:null,reconnectTimer:null,handlers:new Set,pendingRequests:new Map,nextRequestId:1},this.connections.set(Q,V);return V.handlers.add($),()=>{V.handlers.delete($)}}getConnectionState(Q){return this.connections.get(Q)?.state??"disconnected"}getConnectionInfo(Q){let $=this.connections.get(Q);if(!$)return null;return{containerId:Q,state:$.state,connectedAt:$.connectedAt,lastHeartbeat:$.lastHeartbeat,reconnectAttempts:$.reconnectAttempts}}getConnectedContainerIds(){let Q=[];for(let[$,V]of this.connections)if(V.state==="connected")Q.push($);return Q}}import{logger as pU,Service as FV}from"@elizaos/core";class $Z extends FV{static serviceType="CLOUD_CONTAINER";capabilityDescription="ElizaCloud container provisioning and lifecycle management";authService;containerDefaults=qU.container;tracked=new Map;static async start(Q){let $=new $Z(Q);return await $.initialize(),$}async stop(){for(let[,Q]of this.tracked){if(Q.pollingTimer)clearTimeout(Q.pollingTimer);if(Q.healthTimer)clearInterval(Q.healthTimer)}this.tracked.clear()}async initialize(){let Q=this.runtime.getService("CLOUD_AUTH");if(!Q){pU.warn("[CloudContainer] CloudAuthService not available, container operations will fail");return}if(this.authService=Q,this.authService.isAuthenticated()){let $=await this.listContainers();for(let V of $){if(this.tracked.set(V.id,{container:V,pollingTimer:null,healthTimer:null}),V.status==="pending"||V.status==="building"||V.status==="deploying")this.startPolling(V.id);if(V.status==="running")this.startHealthMonitoring(V.id)}pU.info(`[CloudContainer] Loaded ${$.length} existing container(s)`)}}getClient(){return this.authService.getClient()}async createContainer(Q){let $=this.getClient(),V=this.containerDefaults,W={name:Q.name,project_name:Q.project_name,description:Q.description,port:Q.port??V.defaultPort,desired_count:Q.desired_count??1,cpu:Q.cpu??V.defaultCpu,memory:Q.memory??V.defaultMemory,environment_vars:Q.environment_vars??{},health_check_path:Q.health_check_path??"/health",ecr_image_uri:Q.ecr_image_uri,ecr_repository_uri:Q.ecr_repository_uri,image_tag:Q.image_tag,architecture:Q.architecture??V.defaultArchitecture},C=await $.post("/containers",W);return this.tracked.set(C.data.id,{container:C.data,pollingTimer:null,healthTimer:null}),this.startPolling(C.data.id),pU.info(`[CloudContainer] Created container "${Q.name}" (id=${C.data.id}, stack=${C.stackName})`),C}async listContainers(){return(await this.getClient().get("/containers")).data}async getContainer(Q){let V=await this.getClient().get(`/containers/${Q}`),W=this.tracked.get(Q);if(W)W.container=V.data;return V.data}async deleteContainer(Q){await this.getClient().delete(`/containers/${Q}`);let V=this.tracked.get(Q);if(V){if(V.pollingTimer)clearTimeout(V.pollingTimer);if(V.healthTimer)clearInterval(V.healthTimer);this.tracked.delete(Q)}pU.info(`[CloudContainer] Deleted container ${Q}`)}startPolling(Q){let $=this.tracked.get(Q);if(!$)return;let V=0,W=120,C=5000,F=30000,A=async()=>{if(V++,V>W){pU.error(`[CloudContainer] Polling timed out for container ${Q} after ${W} attempts`);return}let z=await this.getContainer(Q),M=z.status;if(pU.debug(`[CloudContainer] Poll #${V} for ${Q}: status=${M}`),M==="running"){pU.info(`[CloudContainer] Container ${Q} is now running at ${z.load_balancer_url}`),this.startHealthMonitoring(Q);return}if(M==="failed"||M==="stopped"||M==="suspended"){if(pU.warn(`[CloudContainer] Container ${Q} reached terminal state: ${M}`),z.error_message)pU.error(`[CloudContainer] Error: ${z.error_message}`);return}let S=Math.min(C*2**Math.min(V-1,3),F);$.pollingTimer=setTimeout(A,S)};$.pollingTimer=setTimeout(A,C)}async waitForDeployment(Q,$=900000){let V=Date.now()+$,W=5000,C=30000;while(Date.now()<V){let F=await this.getContainer(Q);if(F.status==="running")return F;if(F.status==="failed")throw Error(`Container deployment failed: ${F.error_message??"unknown error"}`);if(F.status==="stopped"||F.status==="suspended")throw Error(`Container reached terminal state: ${F.status}`);await new Promise((A)=>setTimeout(A,W)),W=Math.min(W*1.5,C)}throw Error(`Container deployment timed out after ${Math.round($/1000)}s`)}startHealthMonitoring(Q){let $=this.tracked.get(Q);if(!$||$.healthTimer)return;let V=60000;$.healthTimer=setInterval(()=>{this.getContainerHealth(Q).then((W)=>{if(!W.data.healthy)pU.warn(`[CloudContainer] Container ${Q} unhealthy: ${W.data.status}`)}).catch((W)=>{pU.error(`[CloudContainer] Health check failed for ${Q}: ${W.message}`)})},V)}async getContainerHealth(Q){return this.getClient().get(`/containers/${Q}/health`)}getTrackedContainers(){return Array.from(this.tracked.values()).map((Q)=>Q.container)}getTrackedContainer(Q){return this.tracked.get(Q)?.container}isContainerRunning(Q){return this.tracked.get(Q)?.container.status==="running"}getContainerUrl(Q){return this.tracked.get(Q)?.container.load_balancer_url??null}}import{logger as EX,Service as RV}from"@elizaos/core";var TY=1800000,TV=[["gpt-","openai"],["o1","openai"],["o3","openai"],["o4","openai"],["dall-e","openai"],["whisper","openai"],["tts","openai"],["claude-","anthropic"],["gemini-","google"],["llama","meta"],["deepseek","deepseek"],["grok","xai"],["kimi","moonshot"]];function zV(Q){if(Q.includes("/"))return Q.split("/")[0];let $=Q.toLowerCase();for(let[V,W]of TV)if($.startsWith(V))return W;return"unknown"}function MV(Q){if(Q.includes("/"))return Q.split("/").slice(1).join("/");return Q}class JZ extends RV{static serviceType="CLOUD_MODEL_REGISTRY";capabilityDescription="Discovers and caches available AI models from ElizaCloud";models=[];byProvider={};lastFetchedAt=0;fetchPromise=null;constructor(Q){super(Q)}static async start(Q){let $=new JZ(Q);return await $.initialize(),$}async stop(){this.models=[],this.byProvider={},this.lastFetchedAt=0}async initialize(){if(!this.runtime.getService("CLOUD_AUTH")?.isAuthenticated()){EX.info("[CloudModelRegistry] Auth not available, will fetch models on first access");return}await this.fetchModels(),this.validateConfiguredModels()}async fetchModels(){if(this.fetchPromise){await this.fetchPromise;return}this.fetchPromise=this.doFetchModels(),await this.fetchPromise,this.fetchPromise=null}async doFetchModels(){let Q=this.runtime.getService("CLOUD_AUTH");if(!Q?.isAuthenticated())return;let W=(await Q.getClient().get("/models")).data??[];this.models=W.map((C)=>({id:C.id,provider:zV(C.id),name:MV(C.id),createdAt:C.created})),this.byProvider={};for(let C of this.models){if(!this.byProvider[C.provider])this.byProvider[C.provider]=[];this.byProvider[C.provider].push(C)}this.lastFetchedAt=Date.now(),EX.info(`[CloudModelRegistry] Loaded ${this.models.length} models from ${Object.keys(this.byProvider).length} providers`)}validateConfiguredModels(){if(this.models.length===0)return;let Q=new Set(this.models.map((W)=>W.id)),$=new Set(this.models.map((W)=>W.name)),V=[{key:"ELIZAOS_CLOUD_SMALL_MODEL",label:"small model"},{key:"ELIZAOS_CLOUD_LARGE_MODEL",label:"large model"},{key:"ELIZAOS_CLOUD_REASONING_SMALL_MODEL",label:"reasoning small model"},{key:"ELIZAOS_CLOUD_REASONING_LARGE_MODEL",label:"reasoning large model"},{key:"ELIZAOS_CLOUD_RESEARCH_MODEL",label:"research model"},{key:"ELIZAOS_CLOUD_EMBEDDING_MODEL",label:"embedding model"},{key:"ELIZAOS_CLOUD_IMAGE_DESCRIPTION_MODEL",label:"image description model"},{key:"ELIZAOS_CLOUD_IMAGE_GENERATION_MODEL",label:"image generation model"},{key:"ELIZAOS_CLOUD_TTS_MODEL",label:"TTS model"},{key:"ELIZAOS_CLOUD_TRANSCRIPTION_MODEL",label:"transcription model"}];for(let{key:W,label:C}of V){let F=this.runtime.getSetting(W);if(F&&typeof F==="string"){if(!(Q.has(F)||$.has(F)))EX.warn(`[CloudModelRegistry] Configured ${C} "${F}" not found in available models. It may still work if the gateway supports it, but check your configuration.`)}}}async getAvailableModels(){if(Date.now()-this.lastFetchedAt>TY)await this.fetchModels();return this.models}async getModelsByProvider(){if(Date.now()-this.lastFetchedAt>TY)await this.fetchModels();return this.byProvider}}function qV(){if(typeof process>"u")return{};return process.env}var m0=qV(),PV={name:"elizaOSCloud",description:"ElizaOS Cloud plugin — Multi-model AI generation, container provisioning, agent bridge, and billing management",config:{ELIZAOS_CLOUD_API_KEY:m0.ELIZAOS_CLOUD_API_KEY??null,ELIZAOS_CLOUD_BASE_URL:m0.ELIZAOS_CLOUD_BASE_URL??null,ELIZAOS_CLOUD_ENABLED:m0.ELIZAOS_CLOUD_ENABLED??null,ELIZAOS_CLOUD_SMALL_MODEL:m0.ELIZAOS_CLOUD_SMALL_MODEL??null,ELIZAOS_CLOUD_LARGE_MODEL:m0.ELIZAOS_CLOUD_LARGE_MODEL??null,SMALL_MODEL:m0.SMALL_MODEL??null,LARGE_MODEL:m0.LARGE_MODEL??null,ELIZAOS_CLOUD_REASONING_SMALL_MODEL:m0.ELIZAOS_CLOUD_REASONING_SMALL_MODEL??null,ELIZAOS_CLOUD_REASONING_LARGE_MODEL:m0.ELIZAOS_CLOUD_REASONING_LARGE_MODEL??null,REASONING_SMALL_MODEL:m0.REASONING_SMALL_MODEL??null,REASONING_LARGE_MODEL:m0.REASONING_LARGE_MODEL??null,ELIZAOS_CLOUD_RESEARCH_MODEL:m0.ELIZAOS_CLOUD_RESEARCH_MODEL??null,RESEARCH_MODEL:m0.RESEARCH_MODEL??null,ELIZAOS_CLOUD_EMBEDDING_MODEL:m0.ELIZAOS_CLOUD_EMBEDDING_MODEL??null,ELIZAOS_CLOUD_EMBEDDING_API_KEY:m0.ELIZAOS_CLOUD_EMBEDDING_API_KEY??null,ELIZAOS_CLOUD_EMBEDDING_URL:m0.ELIZAOS_CLOUD_EMBEDDING_URL??null,ELIZAOS_CLOUD_EMBEDDING_DIMENSIONS:m0.ELIZAOS_CLOUD_EMBEDDING_DIMENSIONS??null,ELIZAOS_CLOUD_IMAGE_DESCRIPTION_MODEL:m0.ELIZAOS_CLOUD_IMAGE_DESCRIPTION_MODEL??null,ELIZAOS_CLOUD_IMAGE_DESCRIPTION_MAX_TOKENS:m0.ELIZAOS_CLOUD_IMAGE_DESCRIPTION_MAX_TOKENS??null,ELIZAOS_CLOUD_IMAGE_GENERATION_MODEL:m0.ELIZAOS_CLOUD_IMAGE_GENERATION_MODEL??null,ELIZAOS_CLOUD_TTS_MODEL:m0.ELIZAOS_CLOUD_TTS_MODEL??null,ELIZAOS_CLOUD_TRANSCRIPTION_MODEL:m0.ELIZAOS_CLOUD_TRANSCRIPTION_MODEL??null,ELIZAOS_CLOUD_EXPERIMENTAL_TELEMETRY:m0.ELIZAOS_CLOUD_EXPERIMENTAL_TELEMETRY??null},async init(Q,$){fX(Q,$)},services:[QZ,JZ,$Z,AZ,YZ],actions:[HX,WX,DX,LX],providers:[SX,zX,FX,PX],models:{[a0.TEXT_EMBEDDING]:LZ,[a0.TEXT_SMALL]:cZ,[a0.TEXT_LARGE]:pZ,[a0.TEXT_REASONING_SMALL]:hZ,[a0.TEXT_REASONING_LARGE]:uZ,[a0.RESEARCH]:wZ,[a0.IMAGE]:xZ,[a0.IMAGE_DESCRIPTION]:NZ,[a0.OBJECT_SMALL]:gZ,[a0.OBJECT_LARGE]:fZ},tests:[{name:"ELIZAOS_CLOUD_plugin_tests",tests:[{name:"ELIZAOS_CLOUD_test_url_and_api_key_validation",fn:async(Q)=>{let $=PU(Q),V=await fetch(`${$}/models`,{headers:{Authorization:`Bearer ${rU(Q)}`}}),W=await V.json();if(BU.log({data:W?.data?.length??"N/A"},"Models Available"),!V.ok)throw Error(`Failed to validate OpenAI API key: ${V.statusText}`)}},{name:"ELIZAOS_CLOUD_test_text_embedding",fn:async(Q)=>{let $=await Q.useModel(a0.TEXT_EMBEDDING,{text:"Hello, world!"});BU.log({embedding:$},"embedding")}},{name:"ELIZAOS_CLOUD_test_text_large",fn:async(Q)=>{let $=await Q.useModel(a0.TEXT_LARGE,{prompt:"What is the nature of reality in 10 words?"});if($.length===0)throw Error("Failed to generate text");BU.log({text:$},"generated with test_text_large")}},{name:"ELIZAOS_CLOUD_test_text_small",fn:async(Q)=>{let $=await Q.useModel(a0.TEXT_SMALL,{prompt:"What is the nature of reality in 10 words?"});if($.length===0)throw Error("Failed to generate text");BU.log({text:$},"generated with test_text_small")}},{name:"ELIZAOS_CLOUD_test_image_generation",fn:async(Q)=>{BU.log("ELIZAOS_CLOUD_test_image_generation");let $=await Q.useModel(a0.IMAGE,{prompt:"A beautiful sunset over a calm ocean",count:1,size:"1024x1024"});BU.log({image:$},"generated with test_image_generation")}},{name:"image-description",fn:async(Q)=>{BU.log("ELIZAOS_CLOUD_test_image_description");let $=await Q.useModel(a0.IMAGE_DESCRIPTION,"https://upload.wikimedia.org/wikipedia/commons/thumb/1/1c/Vitalik_Buterin_TechCrunch_London_2015_%28cropped%29.jpg/537px-Vitalik_Buterin_TechCrunch_London_2015_%28cropped%29.jpg");if($&&typeof $==="object"&&"title"in $&&"description"in $)BU.log({result:$},"Image description");else BU.error(`Invalid image description result format: ${JSON.stringify($)}`)}},{name:"ELIZAOS_CLOUD_test_transcription",fn:async(Q)=>{BU.log("ELIZAOS_CLOUD_test_transcription");let V=await(await fetch("https://upload.wikimedia.org/wikipedia/en/4/40/Chris_Benoit_Voice_Message.ogg")).arrayBuffer(),W=await Q.useModel(a0.TRANSCRIPTION,Buffer.from(new Uint8Array(V)));BU.log({transcription:W},"generated with test_transcription")}},{name:"ELIZAOS_CLOUD_test_text_tokenizer_encode",fn:async(Q)=>{let V=await Q.useModel(a0.TEXT_TOKENIZER_ENCODE,{prompt:"Hello tokenizer encode!",modelType:a0.TEXT_SMALL});if(!Array.isArray(V)||V.length===0)throw Error("Failed to tokenize text: expected non-empty array of tokens");BU.log({tokens:V},"Tokenized output")}},{name:"ELIZAOS_CLOUD_test_text_tokenizer_decode",fn:async(Q)=>{let V=await Q.useModel(a0.TEXT_TOKENIZER_ENCODE,{prompt:"Hello tokenizer decode!",modelType:a0.TEXT_SMALL}),W=await Q.useModel(a0.TEXT_TOKENIZER_DECODE,{tokens:V,modelType:a0.TEXT_SMALL});if(W!=="Hello tokenizer decode!")throw Error(`Decoded text does not match original. Expected "Hello tokenizer decode!", got "${W}"`);BU.log({decodedText:W},"Decoded text")}},{name:"ELIZAOS_CLOUD_test_text_to_speech",fn:async(Q)=>{if(!await yZ(Q,{text:"Hello, this is a test for text-to-speech."}))throw Error("Failed to generate speech");BU.log("Generated speech successfully")}}]}]},kV=PV;export{PV as elizaOSCloudPlugin,kV as default};
|
|
17
|
+
https://github.com/browserify/crypto-browserify`)},$.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6}}),h0=hX(DE(),1),KE=h0.prng,HE=h0.pseudoRandomBytes,WE=h0.rng,FE=h0.randomBytes,ME=h0.Hash,zE=h0.createHash,TE=h0.Hmac,qE=h0.createHmac,PE=h0.getHashes,kE=h0.pbkdf2,_E=h0.pbkdf2Sync,jE=h0.Cipher,vE=h0.createCipher,BE=h0.Cipheriv,gE=h0.createCipheriv,xE=h0.Decipher,NE=h0.createDecipher,fE=h0.Decipheriv,wE=h0.createDecipheriv,yE=h0.getCiphers,cE=h0.listCiphers,pE=h0.DiffieHellmanGroup,hE=h0.createDiffieHellmanGroup,uE=h0.getDiffieHellman,lE=h0.createDiffieHellman,dE=h0.DiffieHellman,bE=h0.createSign,oE=h0.Sign,nE=h0.createVerify,tE=h0.Verify,sE=h0.createECDH,mE=h0.publicEncrypt,rE=h0.privateEncrypt,eE=h0.publicDecrypt,aE=h0.privateDecrypt,iE=h0.randomFill,UJ=h0.randomFillSync,OJ=h0.createCredentials,ZJ=h0.constants,CJ=["p192","p224","p256","p384","p521","curve25519","ed25519","secp256k1","secp224r1","prime256v1","prime192v1","ed25519","secp384r1","secp521r1"];XJ=crypto,GJ=crypto});import{logger as BU,ModelType as t0}from"@elizaos/core";var uA={name:"CHECK_CLOUD_CREDITS",description:"Check ElizaCloud credit balance, container costs, and estimated remaining runtime.",descriptionCompressed:"Check ElizaCloud credits, container costs, remaining runtime.",similes:["check credits","check balance","how much credit","cloud billing"],tags:["cloud","billing"],parameters:[{name:"detailed",description:"Include transaction history",required:!1,schema:{type:"boolean"}}],validate:async($,I,E,L)=>{let K=(typeof I?.content?.text==="string"?I.content.text:"").toLowerCase(),Q=["check","cloud","credits"],T=Q.length>0&&Q.some((k)=>k.length>0&&K.includes(k)),M=/\b(?:check|cloud|credits)\b/i,H=Boolean(K.match(M)),F=String(I?.content?.source??""),R="",D=Boolean(F||E||$?.agentId||$?.getService),q=L&&typeof L==="object"?L:{},P=K.trim().length>0||Object.keys(q).length>0||Boolean(I?.content&&typeof I.content==="object");if(!(T&&H&&D&&P))return!1;let _=async(k)=>{return!!k.getService("CLOUD_AUTH")?.isAuthenticated()};try{return Boolean(await _($))}catch{return!1}},async handler($,I,E,L,S){let K=$.getService("CLOUD_AUTH"),Q=$.getService("CLOUD_CONTAINER"),T=K.getClient(),M=L?.detailed===!0||I.metadata?.detailed===!0,{data:{balance:H}}=await T.get("/credits/balance"),F=Q?.getTrackedContainers().filter((_)=>_.status==="running").length??0,R=F*0.67,D=R>0?H/R:null,q=[`ElizaCloud credits: $${H.toFixed(2)}`,F>0?`Active containers: ${F} ($${R.toFixed(2)}/day) — ~${D?.toFixed(1)} days remaining`:"No active containers."];if(M){let{data:_}=await T.get("/credits/summary");q.push(`Total spent: $${_.totalSpent.toFixed(2)} | Total added: $${_.totalAdded.toFixed(2)}`);for(let k of _.recentTransactions.slice(0,10)){let B=k.amount>=0?"+":"";q.push(` ${B}$${k.amount.toFixed(2)} — ${k.description} (${new Date(k.created_at).toLocaleDateString()})`)}}let P=q.join(`
|
|
18
|
+
`);if(S)await S({text:P,actions:["CHECK_CLOUD_CREDITS"]});return{success:!0,text:P,data:{balance:H,runningContainers:F,dailyCost:R,estimatedDaysRemaining:D}}}};function OO($){let I=$??{},E=I.parameters&&typeof I.parameters==="object"?I.parameters:{};return{...I,...E}}function YO($){let I=OO($).confirmed;return I===!0||I==="true"}function SO($,I){return{success:!1,text:$,data:{requiresConfirmation:!0,preview:$,...I}}}function MC($,I){let E=OO(I);if(E.containerId)return String(E.containerId);let L=$.metadata?.actionParams;return L?.containerId?String(L.containerId):null}var lA={name:"FREEZE_CLOUD_AGENT",description:"Freeze a cloud agent: snapshot state, disconnect bridge, stop container.",descriptionCompressed:"Freeze cloud agent: snapshot, disconnect, stop container.",similes:["freeze agent","hibernate agent","pause agent","stop cloud agent"],tags:["cloud","container","backup"],parameters:[{name:"containerId",description:"ID of the container to freeze",required:!0,schema:{type:"string"}},{name:"confirmed",description:"Must be true to freeze the cloud agent after preview.",required:!1,schema:{type:"boolean",default:!1}}],validate:async($,I,E,L)=>{let K=(typeof I?.content?.text==="string"?I.content.text:"").toLowerCase(),Q=["freeze","cloud"],T=Q.length>0&&Q.some((k)=>k.length>0&&K.includes(k)),M=/\b(?:freeze|cloud)\b/i,H=Boolean(K.match(M)),F=String(I?.content?.source??""),R="",D=Boolean(F||E||$?.agentId||$?.getService),q=L&&typeof L==="object"?L:{},P=K.trim().length>0||Object.keys(q).length>0||Boolean(I?.content&&typeof I.content==="object");if(!(T&&H&&D&&P))return!1;let _=async(k)=>{return!!k.getService("CLOUD_AUTH")?.isAuthenticated()};try{return Boolean(await _($))}catch{return!1}},async handler($,I,E,L,S){let K=$.getService("CLOUD_CONTAINER"),Q=$.getService("CLOUD_BRIDGE"),T=$.getService("CLOUD_BACKUP"),M=MC(I,L);if(!M)return{success:!1,error:"Missing containerId"};let H=await K.getContainer(M);if(H.status!=="running")return{success:!1,error:`Container not running (status: ${H.status})`};let F=["Confirmation required before freezing Eliza Cloud agent:",`Container: ${H.name}`,`ID: ${M}`,"Effects: create snapshot, disconnect bridge, stop container."].join(`
|
|
19
|
+
`);if(!YO(L))return await S?.({text:F,actions:["FREEZE_CLOUD_AGENT"]}),SO(F,{containerId:M,containerName:H.name});let R=async(q)=>{if(S)await S({text:q,actions:["FREEZE_CLOUD_AGENT"]})};await R(`Freezing "${H.name}"... Creating snapshot.`);let D=null;if(T)D=(await T.createSnapshot(M,"manual",{trigger:"user-freeze",containerName:H.name})).id,T.cancelAutoBackup(M);if(Q)await Q.disconnect(M);return await K.deleteContainer(M),await R(`"${H.name}" frozen.${D?` Snapshot: ${D}`:""}`),{success:!0,text:`Agent "${H.name}" frozen`,data:{containerId:M,containerName:H.name,snapshotId:D}}}};import{logger as TC}from"@elizaos/core";import{CloudApiError as tJ,InsufficientCreditsError as sJ}from"@elizaos/cloud-sdk";var PU={enabled:!1,baseUrl:"https://www.elizacloud.ai/api/v1",inferenceMode:"cloud",autoProvision:!1,bridge:{reconnectIntervalMs:3000,maxReconnectAttempts:20,heartbeatIntervalMs:30000},backup:{autoBackupIntervalMs:3600000,maxSnapshots:10},container:{defaultImage:"elizaos/agent:latest",defaultArchitecture:"arm64",defaultCpu:1792,defaultMemory:1792,defaultPort:3000}};var zC=["OPENAI_API_KEY","ANTHROPIC_API_KEY","GROQ_API_KEY","ELIZAOS_CLOUD_API_KEY","NANO_MODEL","MEDIUM_MODEL","SMALL_MODEL","LARGE_MODEL","MEGA_MODEL","RESPONSE_HANDLER_MODEL","ACTION_PLANNER_MODEL","SHOULD_RESPOND_MODEL","PLANNER_MODEL","RESPONSE_MODEL","ELIZAOS_CLOUD_SMALL_MODEL","ELIZAOS_CLOUD_NANO_MODEL","ELIZAOS_CLOUD_MEDIUM_MODEL","ELIZAOS_CLOUD_LARGE_MODEL","ELIZAOS_CLOUD_MEGA_MODEL","ELIZAOS_CLOUD_RESPONSE_HANDLER_MODEL","ELIZAOS_CLOUD_ACTION_PLANNER_MODEL","ELIZAOS_CLOUD_SHOULD_RESPOND_MODEL","ELIZAOS_CLOUD_PLANNER_MODEL","ELIZAOS_CLOUD_RESPONSE_MODEL"];function oO($){let I={};for(let E of zC){let L=$.getSetting(E);if(L)I[E]=String(L)}return I}function qC($,I){let E=OO(I);if(Object.keys(E).length>0)return E;let L=$.metadata;if(L?.actionParams)return L.actionParams;let S=$.content?.text??"",K=S.match(/name[:\s]+["']?([^"',]+)["']?/i)?.[1]?.trim(),Q=S.match(/project[:\s]+["']?([^"',\s]+)["']?/i)?.[1]?.trim();return{name:K,project_name:Q}}var dA={name:"PROVISION_CLOUD_AGENT",description:"Deploy an ElizaOS agent to ElizaCloud. Provisions a container, waits for deployment, connects the bridge, and starts auto-backup.",descriptionCompressed:"Deploy agent to ElizaCloud. Provisions container, connects bridge, starts backup.",similes:["deploy agent to cloud","launch cloud agent","start remote agent","provision container"],tags:["cloud","container","deployment"],parameters:[{name:"name",description:"Human-readable name for the cloud agent",required:!0,schema:{type:"string"}},{name:"project_name",description:"Unique project identifier (lowercase, no spaces)",required:!0,schema:{type:"string"}},{name:"description",description:"Optional description",required:!1,schema:{type:"string"}},{name:"environment_vars",description:"Additional environment variables",required:!1,schema:{type:"object"}},{name:"auto_backup",description:"Enable periodic auto-backup (default: true)",required:!1,schema:{type:"boolean"}},{name:"confirmed",description:"Must be true to provision the cloud agent after preview.",required:!1,schema:{type:"boolean",default:!1}}],validate:async($,I,E,L)=>{let K=(typeof I?.content?.text==="string"?I.content.text:"").toLowerCase(),Q=["provision","cloud"],T=Q.length>0&&Q.some((k)=>k.length>0&&K.includes(k)),M=/\b(?:provision|cloud)\b/i,H=Boolean(K.match(M)),F=String(I?.content?.source??""),R="",D=Boolean(F||E||$?.agentId||$?.getService),q=L&&typeof L==="object"?L:{},P=K.trim().length>0||Object.keys(q).length>0||Boolean(I?.content&&typeof I.content==="object");if(!(T&&H&&D&&P))return!1;let _=async(k)=>{return!!k.getService("CLOUD_AUTH")?.isAuthenticated()};try{return Boolean(await _($))}catch{return!1}},async handler($,I,E,L,S){let K=$.getService("CLOUD_AUTH"),Q=$.getService("CLOUD_CONTAINER"),T=$.getService("CLOUD_BRIDGE"),M=$.getService("CLOUD_BACKUP");if(!K?.isAuthenticated()||!Q)return{success:!1,error:"ElizaCloud not authenticated or container service unavailable"};let H=qC(I,L);if(!H.name||!H.project_name)return{success:!1,error:"Missing required parameters: name and project_name"};let F=H.auto_backup!==!1,R=["Confirmation required before provisioning Eliza Cloud agent:",`Name: ${String(H.name)}`,`Project: ${String(H.project_name)}`,`Auto-backup: ${F?"enabled":"disabled"}`].join(`
|
|
20
|
+
`);if(!YO(L))return await S?.({text:R,actions:["PROVISION_CLOUD_AGENT"]}),SO(R,{name:String(H.name),project_name:String(H.project_name),auto_backup:F});let D=async(v)=>{if(S)await S({text:v,actions:["PROVISION_CLOUD_AGENT"]})};await D(`Provisioning cloud agent "${H.name}"... This typically takes 8-12 minutes.`);let q=PU.container,P={name:H.name,project_name:H.project_name,description:H.description,port:q.defaultPort,cpu:q.defaultCpu,memory:q.defaultMemory,architecture:q.defaultArchitecture,ecr_image_uri:q.defaultImage,environment_vars:{...oO($),...H.environment_vars},health_check_path:"/health"},_=await Q.createContainer(P),k=_.data.id;await D(`Container created (id: ${k}). Credits: -$${_.creditsDeducted.toFixed(2)} ($${_.creditsRemaining.toFixed(2)} remaining).`);let B=await Q.waitForDeployment(k);if(await D(`Container running at ${B.load_balancer_url}`),T)await T.connect(k),TC.info(`[PROVISION] Bridge connected to ${k}`);if(F&&M)M.scheduleAutoBackup(k);return await D(`Agent "${H.name}" deployed.${F?" Auto-backup enabled.":""}`),{success:!0,text:`Cloud agent "${H.name}" deployed`,data:{containerId:k,containerUrl:B.load_balancer_url,status:B.status,creditsDeducted:_.creditsDeducted,creditsRemaining:_.creditsRemaining,bridgeConnected:T?.getConnectionState(k)==="connected",autoBackupEnabled:F}}}};function PC($,I){let E=OO(I);if(Object.keys(E).length>0)return E;return $.metadata?.actionParams??{}}async function kC($,I,E){let S=(await I.listContainers()).filter((Q)=>Q.project_name===E).map((Q)=>Q.id),K=[];for(let Q of S)K.push(...await $.listSnapshots(Q));return K.sort((Q,T)=>new Date(T.created_at).getTime()-new Date(Q.created_at).getTime()),K[0]??null}var bA={name:"RESUME_CLOUD_AGENT",description:"Resume a frozen cloud agent from snapshot. Re-provisions, restores state, reconnects bridge.",descriptionCompressed:"Resume frozen cloud agent from snapshot.",similes:["resume agent","unfreeze agent","restart cloud agent","restore agent"],tags:["cloud","container","restore"],parameters:[{name:"name",description:"Name for the restored agent",required:!0,schema:{type:"string"}},{name:"project_name",description:"Project identifier (must match original)",required:!0,schema:{type:"string"}},{name:"snapshotId",description:"Specific snapshot ID (defaults to latest)",required:!1,schema:{type:"string"}},{name:"environment_vars",description:"Additional environment variables",required:!1,schema:{type:"object"}},{name:"confirmed",description:"Must be true to resume the cloud agent after preview.",required:!1,schema:{type:"boolean",default:!1}}],validate:async($,I,E,L)=>{let K=(typeof I?.content?.text==="string"?I.content.text:"").toLowerCase(),Q=["resume","cloud"],T=Q.length>0&&Q.some((k)=>k.length>0&&K.includes(k)),M=/\b(?:resume|cloud)\b/i,H=Boolean(K.match(M)),F=String(I?.content?.source??""),R="",D=Boolean(F||E||$?.agentId||$?.getService),q=L&&typeof L==="object"?L:{},P=K.trim().length>0||Object.keys(q).length>0||Boolean(I?.content&&typeof I.content==="object");if(!(T&&H&&D&&P))return!1;let _=async(k)=>{return!!k.getService("CLOUD_AUTH")?.isAuthenticated()};try{return Boolean(await _($))}catch{return!1}},async handler($,I,E,L,S){let K=$.getService("CLOUD_CONTAINER"),Q=$.getService("CLOUD_BRIDGE"),T=$.getService("CLOUD_BACKUP"),M=PC(I,L);if(!M.name||!M.project_name)return{success:!1,error:"Missing required parameters: name and project_name"};let H=typeof M.snapshotId==="string"&&M.snapshotId.length>0?M.snapshotId:null,F=["Confirmation required before resuming Eliza Cloud agent:",`Name: ${String(M.name)}`,`Project: ${String(M.project_name)}`,`Snapshot: ${H??"latest available"}`].join(`
|
|
21
|
+
`);if(!YO(L))return await S?.({text:F,actions:["RESUME_CLOUD_AGENT"]}),SO(F,{name:String(M.name),project_name:String(M.project_name),snapshotId:H});let R=async(v)=>{if(S)await S({text:v,actions:["RESUME_CLOUD_AGENT"]})};await R(`Resuming cloud agent "${M.name}"...`);let D=PU.container,q={name:M.name,project_name:M.project_name,port:D.defaultPort,cpu:D.defaultCpu,memory:D.defaultMemory,architecture:D.defaultArchitecture,ecr_image_uri:D.defaultImage,environment_vars:{...oO($),...M.environment_vars},health_check_path:"/health"},P=await K.createContainer(q),_=P.data.id;await R(`Container re-provisioned (${_}). Waiting for infrastructure...`);let k=await K.waitForDeployment(_),B=null;if(T){let v=H??void 0;if(v)await T.restoreSnapshot(_,v),B=v;else{let g=await kC(T,K,M.project_name);if(g)await T.restoreSnapshot(_,g.id),B=g.id}T.scheduleAutoBackup(_)}if(Q)await Q.connect(_);return await R(`Agent "${M.name}" resumed at ${k.load_balancer_url}.`+(B?` Restored snapshot ${B}.`:" No snapshot to restore.")),{success:!0,text:`Cloud agent "${M.name}" resumed`,data:{containerId:_,containerUrl:k.load_balancer_url,restoredSnapshotId:B,creditsDeducted:P.creditsDeducted,creditsRemaining:P.creditsRemaining}}}};var oA={name:"elizacloud_status",description:"ElizaCloud container and connection status",descriptionCompressed:"ElizaCloud container/connection status.",dynamic:!0,position:90,async get($,I,E){if(!$.getService("CLOUD_AUTH")?.isAuthenticated())return{text:"ElizaCloud: Not authenticated",values:{cloudAuthenticated:!1}};let S=$.getService("CLOUD_CONTAINER"),K=$.getService("CLOUD_BRIDGE"),Q=S?.getTrackedContainers()??[],T=K?.getConnectedContainerIds()??[],M=Q.filter((D)=>D.status==="running").length,H=Q.filter((D)=>D.status==="pending"||D.status==="building"||D.status==="deploying").length,F=Q.map((D)=>({id:D.id,name:D.name,status:D.status,url:D.load_balancer_url,billing:D.billing_status,bridged:T.includes(D.id)}));return{text:[`ElizaCloud: ${Q.length} container(s), ${M} running, ${T.length} bridged`,...F.map((D)=>` - ${D.name} [${D.status}]${D.url?` @ ${D.url}`:""}${D.bridged?" (bridged)":""}`)].join(`
|
|
22
|
+
`),values:{cloudAuthenticated:!0,totalContainers:Q.length,runningContainers:M,deployingContainers:H},data:{containers:F}}}};var nA={name:"elizacloud_health",description:"ElizaCloud container health",descriptionCompressed:"ElizaCloud container health.",dynamic:!0,position:92,private:!0,async get($,I,E){if(!$.getService("CLOUD_AUTH")?.isAuthenticated())return{text:""};let K=$.getService("CLOUD_CONTAINER")?.getTrackedContainers().filter((H)=>H.status==="running")??[];if(K.length===0)return{text:"No running containers.",values:{healthyContainers:0}};let Q=K.map((H)=>({id:H.id,name:H.name,healthy:H.status==="running"&&H.billing_status==="active"&&!H.error_message,status:H.status,billing:H.billing_status})),T=Q.filter((H)=>H.healthy).length;return{text:[`Health: ${T}/${Q.length} healthy`,...Q.map((H)=>` - ${H.name}: ${H.healthy?"OK":"UNHEALTHY"} (status=${H.status}, billing=${H.billing})`)].join(`
|
|
23
|
+
`),values:{healthyContainers:T,unhealthyContainers:Q.length-T},data:{reports:Q}}}};import{logger as tA}from"@elizaos/core";var qZ="https://www.elizacloud.ai/dashboard/settings?tab=billing",sA=new WeakMap,_C=60000,mA={name:"elizacloud_credits",description:"ElizaCloud credit balance",descriptionCompressed:"ElizaCloud credit balance.",dynamic:!0,position:91,async get($,I,E){let L=$.getService("CLOUD_AUTH");if(!L?.isAuthenticated())return{text:""};let S=sA.get($);if(S&&Date.now()-S.at<_C)return PZ(S.value);let K;try{let{data:Q}=await L.getClient().get("/credits/balance");K=Q.balance}catch(Q){if(tA.warn(`[CloudCredits] Failed to fetch balance: ${Q instanceof Error?Q.message:Q}`),S)return PZ(S.value);return{text:""}}if(sA.set($,{value:K,at:Date.now()}),K<1)tA.warn(`[CloudCredits] Low balance: $${K.toFixed(2)}`);return PZ(K)}};function PZ($){let I=$<2,E=$<0.5,L=`ElizaCloud credits: $${$.toFixed(2)}`;if(E)L+=` (CRITICAL — top up at ${qZ})`;else if(I)L+=` (LOW — top up at ${qZ})`;return{text:L,values:{cloudCredits:$,cloudCreditsLow:I,cloudCreditsCritical:E,cloudTopUpUrl:qZ}}}var rA=new WeakMap,aA={name:"elizacloud_models",description:"Available AI models from ElizaCloud grouped by provider",descriptionCompressed:"Available AI models from ElizaCloud by provider.",dynamic:!0,position:92,async get($,I,E){let L=$.getService("CLOUD_MODEL_REGISTRY");if(!L)return{text:""};let S=rA.get($);if(S&&Date.now()-S.at<300000)return eA(S.value);let K=await L.getModelsByProvider();if(Object.keys(K).length===0)return{text:""};return rA.set($,{value:K,at:Date.now()}),eA(K)}};function eA($){let I=Object.keys($).sort(),E=Object.values($).reduce((L,S)=>L+S.length,0);return{text:`ElizaCloud: ${E} models (${I.join(", ")})`,values:{cloudModelProviders:I.join(","),cloudModelCount:E}}}import{logger as AO}from"@elizaos/core";import{logger as nO}from"@elizaos/core";function jC($){if(typeof process>"u")return;let I=process.env[$];return I===void 0?void 0:String(I)}function p0($,I,E){let L=$.getSetting(I);if(L!==void 0&&L!==null)return String(L);return jC(I)??E}function bU(){return typeof globalThis<"u"&&typeof globalThis.document<"u"}function iA($){return bU()&&!!p0($,"ELIZAOS_CLOUD_BROWSER_BASE_URL")}function VO($){let I=p0($,"ELIZAOS_CLOUD_BROWSER_BASE_URL");return bU()&&I?I:p0($,"ELIZAOS_CLOUD_BASE_URL","https://www.elizacloud.ai/api/v1")}function U$($){let I=bU()?p0($,"ELIZAOS_CLOUD_BROWSER_EMBEDDING_URL")||p0($,"ELIZAOS_CLOUD_BROWSER_BASE_URL"):p0($,"ELIZAOS_CLOUD_EMBEDDING_URL");if(I)return nO.debug(`[ELIZAOS_CLOUD] Using specific embedding base URL: ${I}`),I;return nO.debug("[ELIZAOS_CLOUD] Falling back to general base URL for embeddings."),VO($)}function ZO($){return p0($,"ELIZAOS_CLOUD_API_KEY")}function O$($){let I=p0($,"ELIZAOS_CLOUD_EMBEDDING_API_KEY");if(I)return nO.debug("[ELIZAOS_CLOUD] Using specific embedding API key (present)"),I;return nO.debug("[ELIZAOS_CLOUD] Falling back to general API key for embeddings."),ZO($)}function LO($){return p0($,"ELIZAOS_CLOUD_SMALL_MODEL")??p0($,"SMALL_MODEL","openai/gpt-5.4-mini")}function kZ($){return p0($,"ELIZAOS_CLOUD_NANO_MODEL")??p0($,"NANO_MODEL")??LO($)}function _Z($){return p0($,"ELIZAOS_CLOUD_MEDIUM_MODEL")??p0($,"MEDIUM_MODEL")??LO($)}function RO($){return p0($,"ELIZAOS_CLOUD_LARGE_MODEL")??p0($,"LARGE_MODEL","anthropic/claude-sonnet-4.6")}function Z$($){return p0($,"ELIZAOS_CLOUD_MEGA_MODEL")??p0($,"MEGA_MODEL")??RO($)}function A$($){return p0($,"ELIZAOS_CLOUD_RESPONSE_HANDLER_MODEL")??p0($,"ELIZAOS_CLOUD_SHOULD_RESPOND_MODEL")??p0($,"RESPONSE_HANDLER_MODEL")??p0($,"SHOULD_RESPOND_MODEL")??kZ($)}function $$($){return p0($,"ELIZAOS_CLOUD_ACTION_PLANNER_MODEL")??p0($,"ELIZAOS_CLOUD_PLANNER_MODEL")??p0($,"ACTION_PLANNER_MODEL")??p0($,"PLANNER_MODEL")??_Z($)}function I$($){return p0($,"ELIZAOS_CLOUD_IMAGE_DESCRIPTION_MODEL","gpt-5.4-mini")}function C$($){return p0($,"ELIZAOS_CLOUD_IMAGE_GENERATION_MODEL","google/gemini-2.5-flash-image")??"google/gemini-2.5-flash-image"}function Q$($){return p0($,"ELIZAOS_CLOUD_RESEARCH_MODEL")??p0($,"RESEARCH_MODEL","o3-deep-research")}function X$($){let I=p0($,"ELIZAOS_CLOUD_EXPERIMENTAL_TELEMETRY","false");return String(I).toLowerCase()==="true"}import{CloudApiClient as vC,ElizaCloudClient as BC}from"@elizaos/cloud-sdk";function jZ($){return $.replace(/\/+$/,"")}function gC($){let I=jZ($);return I.endsWith("/api/v1")?I.slice(0,-7):I}function G$($,I=!1){if(bU())return;return I?O$($):ZO($)}function NU($,I=!1){let E=I?U$($):VO($);return new vC(jZ(E),G$($,I))}function kO($){let I=jZ(VO($));return new BC({apiBaseUrl:I,baseUrl:gC(I),apiKey:G$($)})}function E$($,I){(async()=>{try{if(!ZO(I)&&!bU()){AO.warn("ELIZAOS_CLOUD_API_KEY is not set in environment - ElizaOS Cloud functionality will be limited"),AO.info("Get your API key from https://www.elizacloud.ai/dashboard/api-keys");return}try{await NU(I).get("/models"),AO.log("ElizaOS Cloud API key validated successfully")}catch(E){let L=E instanceof Error?E.message:String(E);AO.warn(`ElizaOS Cloud API key validation failed: ${L}`),AO.warn("ElizaOS Cloud functionality will be limited until a valid API key is provided")}}catch(E){let L=E?.errors?.map((S)=>S.message).join(", ")||(E instanceof Error?E.message:String(E));AO.warn(`ElizaOS Cloud plugin configuration issue: ${L} - You need to configure the ELIZAOS_CLOUD_API_KEY in your environment variables`),AO.info("Get your API key from https://www.elizacloud.ai/dashboard/api-keys")}})()}import{logger as zU,ModelType as NC,VECTOR_DIMS as J$}from"@elizaos/core";import{EventType as xC}from"@elizaos/core";function pU($,I,E,L){let S=Number(L.inputTokens||0),K=Number(L.outputTokens||0),Q=Number(L.totalTokens!=null?L.totalTokens:S+K),T={runtime:$,source:"elizacloud",type:I,tokens:{prompt:S,completion:K,total:Q}};$.emitEvent(xC.MODEL_USED,T)}var tO=100;function fC($){return{remainingRequests:parseInt($.headers.get("x-ratelimit-remaining-requests")||"",10)||void 0,remainingTokens:parseInt($.headers.get("x-ratelimit-remaining-tokens")||"",10)||void 0,limitRequests:parseInt($.headers.get("x-ratelimit-limit-requests")||"",10)||void 0,limitTokens:parseInt($.headers.get("x-ratelimit-limit-tokens")||"",10)||void 0,resetRequests:$.headers.get("x-ratelimit-reset-requests")||void 0,resetTokens:$.headers.get("x-ratelimit-reset-tokens")||void 0,retryAfter:parseInt($.headers.get("retry-after")||"",10)||void 0}}function Y$($){let I=p0($,"ELIZAOS_CLOUD_EMBEDDING_MODEL","text-embedding-3-small"),E=Number.parseInt(p0($,"ELIZAOS_CLOUD_EMBEDDING_DIMENSIONS","1536")||"1536",10);if(!Object.values(J$).includes(E)){let L=`Invalid embedding dimension: ${E}. Must be one of: ${Object.values(J$).join(", ")}`;throw zU.error(L),Error(L)}return{embeddingModelName:I,embeddingDimension:E}}function rU($,I){let E=Array($).fill(0);return E[0]=I,E}async function vZ($,I){let{embeddingDimension:E}=Y$($);if(I===null)return zU.debug("Creating test embedding for initialization"),rU(E,0.1);let L;if(typeof I==="string")L=I;else if(typeof I==="object"&&I.text)L=I.text;else return zU.warn("Invalid input format for embedding"),rU(E,0.2);if(!L.trim())return zU.warn("Empty text for embedding"),rU(E,0.3);return(await S$($,[L]))[0]}async function S$($,I){let{embeddingModelName:E,embeddingDimension:L}=Y$($),S=NU($,!0);if(!I||I.length===0)return zU.warn("[BatchEmbeddings] Empty texts array"),[];let K=[],Q=Array(I.length);for(let T=0;T<I.length;T++){let M=I[T]?.trim();if(M)K.push({text:M,originalIndex:T});else Q[T]=rU(L,0.3)}if(K.length===0)return zU.warn("[BatchEmbeddings] All texts were empty"),Q;for(let T=0;T<K.length;T+=tO){let M=Math.min(T+tO,K.length),H=K.slice(T,M),F=H.map((R)=>R.text);zU.info(`[BatchEmbeddings] Processing batch ${Math.floor(T/tO)+1}/${Math.ceil(K.length/tO)}: ${H.length} texts`);try{let R=await S.requestRaw("POST","/embeddings",{json:{model:E,input:F}}),D=fC(R);if(D.remainingRequests!==void 0&&D.remainingRequests<50)zU.warn(`[BatchEmbeddings] Rate limit: ${D.remainingRequests}/${D.limitRequests} requests remaining`);if(R.status===429){let P=D.retryAfter||30;zU.warn(`[BatchEmbeddings] Rate limited, waiting ${P}s...`),await new Promise((B)=>setTimeout(B,P*1000));let _=await S.requestRaw("POST","/embeddings",{json:{model:E,input:F}});if(!_.ok){zU.error(`[BatchEmbeddings] Retry failed: ${_.status}`);for(let B of H)Q[B.originalIndex]=rU(L,0.4);continue}let k=await _.json();if(k?.data){for(let B of k.data){let v=H[B.index].originalIndex;Q[v]=B.embedding}zU.info(`[BatchEmbeddings] Retry successful for ${H.length} embeddings`)}continue}if(!R.ok){zU.error(`[BatchEmbeddings] API error: ${R.status} - ${R.statusText}`);for(let P of H)Q[P.originalIndex]=rU(L,0.4);continue}let q=await R.json();if(!q?.data||!Array.isArray(q.data)){zU.error("[BatchEmbeddings] API returned invalid structure");for(let P of H)Q[P.originalIndex]=rU(L,0.5);continue}for(let P of q.data){let _=H[P.index].originalIndex;Q[_]=P.embedding}if(q.usage){let P={inputTokens:q.usage.prompt_tokens,outputTokens:0,totalTokens:q.usage.total_tokens};pU($,NC.TEXT_EMBEDDING,`batch:${H.length}`,P)}zU.debug(`[BatchEmbeddings] Got ${H.length} embeddings (${L}d), remaining: ${D.remainingRequests??"unknown"}`)}catch(R){let D=R instanceof Error?R.message:String(R);zU.error(`[BatchEmbeddings] Error: ${D}`);for(let q of H)Q[q.originalIndex]=rU(L,0.6)}}return Q}import{logger as fO,ModelType as pQ}from"@elizaos/core";import{logger as $I}from"@elizaos/core";import{JSONParseError as cQ}from"ai";function II(){return async({text:$,error:I})=>{try{if(I instanceof cQ){let E=$.replace(/```json\n|\n```|```/g,"");return JSON.parse(E),E}return null}catch(E){let L=E instanceof Error?E.message:String(E);return $I.warn(`Failed to repair JSON text: ${L}`),null}}}async function CI($){try{let{Readable:I}=await Promise.resolve().then(() => DC(UZ(),1)),E=$.getReader();return new I({async read(){try{let{done:L,value:S}=await E.read();if(L)this.push(null);else this.push(S)}catch(L){this.destroy(L)}},destroy(L,S){E.cancel().finally(()=>S(L))}})}catch(I){let E=I instanceof Error?I.message:String(I);throw $I.error(`Failed to load node:stream module: ${E}`),Error("Cannot convert stream: node:stream module unavailable. This feature requires a Node.js environment.")}}function QI($){let E=$.match(/title[:\s]+(.+?)(?:\n|$)/i)?.[1]?.trim()||"Image Analysis",L=$.replace(/title[:\s]+(.+?)(?:\n|$)/i,"").trim();return{title:E,description:L}}async function nZ($,I){let E=I.count||1,L=I.size||"1024x1024",S=I.prompt,K=C$($);fO.log(`[ELIZAOS_CLOUD] Using IMAGE model: ${K}`);let T={"1024x1024":"1:1","1792x1024":"16:9","1024x1792":"9:16"}[L]||"1:1";try{let M={prompt:S,numImages:E,aspectRatio:T,model:K};return(await kO($).generateImage(M)).images.map((R)=>({url:R.url||R.image}))}catch(M){let H=M instanceof Error?M.message:String(M);throw fO.error(`[ELIZAOS_CLOUD] Image generation error: ${H}`),M}}async function tZ($,I){let E,L,S=I$($);fO.log(`[ELIZAOS_CLOUD] Using IMAGE_DESCRIPTION model: ${S}`);let K=Number.parseInt(p0($,"ELIZAOS_CLOUD_IMAGE_DESCRIPTION_MAX_TOKENS","8192")||"8192",10);if(typeof I==="string")E=I,L="Please analyze this image and provide a title and detailed description.";else E=I.imageUrl,L=I.prompt||"Please analyze this image and provide a title and detailed description.";let Q=[{role:"user",content:[{type:"text",text:L},{type:"image_url",image_url:{url:E}}]}],T=kO($);try{let M={model:S,messages:Q,max_tokens:K},H=null;for(let D=0;D<3;D++){if(H=await T.routes.postApiV1ChatCompletionsRaw({json:M}),H.status===429&&D<2){let q=(D+1)*2000;fO.warn(`[ELIZAOS_CLOUD] Image analysis rate-limited (429), retrying in ${q/1000}s...`),await new Promise((P)=>setTimeout(P,q));continue}break}if(!H?.ok){let D=H?.status??0;if(D===402)throw Error("Eliza Cloud credits exhausted — top up at https://www.elizacloud.ai/dashboard/settings?tab=billing");throw Error(`ElizaOS Cloud API error: ${D}`)}let F=await H.json(),R=F.choices?.[0]?.message?.content;if(F.usage)pU($,pQ.IMAGE_DESCRIPTION,typeof I==="string"?I:I.prompt||"",{inputTokens:F.usage.prompt_tokens,outputTokens:F.usage.completion_tokens,totalTokens:F.usage.total_tokens});if(!R)return{title:"Failed to analyze image",description:"No response from API"};return QI(R)}catch(M){let H=M instanceof Error?M.message:String(M);return fO.error(`Error analyzing image: ${H}`),{title:"Failed to analyze image",description:`Error: ${H}`}}}import{logger as wO,ModelType as XI}from"@elizaos/core";function WO($){if(!$||typeof $!=="object"||Array.isArray($))return null;return $}function sZ($){if(Array.isArray($))return $;if(typeof $==="string")return[{type:"text",text:$}];return $&&typeof $==="object"?[$]:[]}function mZ($){if(typeof $==="string")return[$];let I=WO($);if(!I)return[];let E=typeof I.text==="string"?I.text:typeof I.output_text==="string"?I.output_text:typeof I.content==="string"?I.content:"",L=typeof I.type==="string"?I.type:void 0;if(E&&(!L||L==="output_text"||L==="text"))return[E];return[]}function hQ($){let I=WO($);if(!I)return[];let E=sZ(I.content);if(E.length>0)return E.flatMap(mZ);let L=WO(I.message);if(L)return sZ(L.content).flatMap(mZ);let S=typeof I.type==="string"?I.type:void 0,K=typeof I.text==="string"?I.text:typeof I.output_text==="string"?I.output_text:"";if(K&&(S==="output_text"||S==="text"))return[K];return[]}function uQ($){let I=WO($);if(!I)return[];if(typeof I.text==="string"&&I.text)return[I.text];let E=WO(I.message);if(!E)return[];return sZ(E.content).flatMap(mZ)}function OZ($){let I=WO($);if(!I)return"";let E=[];if(typeof I.output_text==="string"&&I.output_text)E.push(I.output_text);if(Array.isArray(I.output))E.push(...I.output.flatMap(hQ));if(Array.isArray(I.choices))E.push(...I.choices.flatMap(uQ));return E.join("")}var lQ=["o1","o3","o4","deepseek-r1","deepseek-reasoner","claude-opus-4.7","claude-opus-4-7","gpt-5"];function dQ($){let I=$.toLowerCase();return lQ.some((E)=>I.includes(E))}async function GI($,I,E,L){let S=L($);wO.log(`[ELIZAOS_CLOUD] Using ${E} model: ${S}`);let K=dQ(S),Q=[];if($.character.system)Q.push({role:"system",content:[{type:"input_text",text:$.character.system}]});Q.push({role:"user",content:[{type:"input_text",text:I.prompt}]});let T={model:S,input:Q,max_output_tokens:I.maxTokens??8192,text:{format:{type:"json_object"}}};if(!K&&typeof I.temperature==="number")T.temperature=I.temperature;let M=await NU($).requestRaw("POST","/responses",{json:T}),H=await M.text(),F={};if(H)try{F=JSON.parse(H)}catch(D){wO.error(`[generateObject] Failed to parse Eliza Cloud JSON: ${D instanceof Error?D.message:String(D)}`)}if(!M.ok){let D=typeof F==="object"&&F?F.error:void 0,q=typeof D?.message==="string"&&D.message.trim()?D.message.trim():`elizaOS Cloud error ${M.status}`,P=Error(q);if(P.status=M.status,D)P.error=D;throw P}if(F.usage)pU($,E,I.prompt,{inputTokens:F.usage.input_tokens??0,outputTokens:F.usage.output_tokens??0,totalTokens:F.usage.total_tokens??0});let R=OZ(F);if(!R.trim())throw Error("Object generation returned empty response");R=R.replace(/^[\s]*```(?:json)?\s*\n?/i,"").replace(/\n?```\s*$/i,"").trim();try{return JSON.parse(R)}catch(D){let P=await II()({text:R,error:D});if(P)try{let k=JSON.parse(P);return wO.info("[generateObject] Successfully repaired JSON."),k}catch(k){let B=k instanceof Error?k.message:String(k);throw wO.error(`[generateObject] Failed to parse repaired JSON: ${B}`),k}let _=D instanceof Error?D.message:String(D);throw wO.error(`[generateObject] Failed to parse JSON: ${_}`),D}}async function rZ($,I){return GI($,I,XI.OBJECT_SMALL,LO)}async function eZ($,I){return GI($,I,XI.OBJECT_LARGE,RO)}import{logger as bQ,ModelType as oQ}from"@elizaos/core";function nQ($){if(typeof $!=="string")return $;return[{role:"user",content:[{type:"input_text",text:$}]}]}function tQ($,I){try{let E=JSON.parse(I),L=E.error?.message;if(E.error?.param==="tools.0.type"&&L?.includes('expected "function"'))return Error(`Research API error: ${$} Eliza Cloud /responses rejected deep-research tool types; the provider currently only accepts function tools on this route`)}catch{}return Error(`Research API error: ${$} ${I}`)}function sQ($){return $.filter((I)=>I.url!==void 0).map((I)=>({url:I.url,title:I.title??"",startIndex:I.start_index??0,endIndex:I.end_index??0}))}function mQ($){let I=[];for(let E of $)switch(E.type){case"web_search_call":I.push({id:E.id??"",type:"web_search_call",status:E.status??"completed",action:{type:E.action?.type??"search",query:E.action?.query,url:E.action?.url}});break;case"file_search_call":I.push({id:E.id??"",type:"file_search_call",status:E.status??"completed",query:E.query??"",results:E.results?.map((L)=>({fileId:L.file_id,fileName:L.file_name,score:L.score}))});break;case"code_interpreter_call":I.push({id:E.id??"",type:"code_interpreter_call",status:E.status??"completed",code:E.code??"",output:E.output});break;case"mcp_tool_call":I.push({id:E.id??"",type:"mcp_tool_call",status:E.status??"completed",serverLabel:E.server_label??"",toolName:E.tool_name??"",arguments:E.arguments??{},result:E.result});break;case"message":{let L=E.content??[];I.push({type:"message",content:L.filter((S)=>S.type==="output_text").map((S)=>({type:"output_text",text:S.text??"",annotations:sQ(S.annotations??[])}))});break}}return I}async function aZ($,I){let E=I.model??Q$($);bQ.log(`[ELIZAOS_CLOUD] Using RESEARCH model: ${E}`);let L=I.tools??[{type:"web_search_preview"}],S={model:E,input:nQ(I.input),tools:L};if(I.instructions)S.instructions=I.instructions;if(I.background!==void 0)S.background=I.background;if(I.maxToolCalls!==void 0)S.max_tool_calls=I.maxToolCalls;if(I.reasoningSummary)S.reasoning={summary:I.reasoningSummary};let K=await NU($).requestRaw("POST","/responses",{json:S});if(!K.ok){let F=await K.text();throw tQ(K.status,F)}let Q=await K.json();if(Q.usage)pU($,oQ.RESEARCH,I.input,{inputTokens:Q.usage.input_tokens,outputTokens:Q.usage.output_tokens,totalTokens:Q.usage.total_tokens});let T=mQ(Q.output),M="",H=[];for(let F of T)if(F.type==="message"){for(let R of F.content)if(R.type==="output_text")M+=R.text,H.push(...R.annotations)}return{id:Q.id,text:M,annotations:H,outputItems:T,status:Q.status}}import{logger as aY}from"@elizaos/core";async function iZ($,I){let E=p0($,"ELIZAOS_CLOUD_TTS_MODEL","gpt-5-mini-tts"),L=p0($,"ELIZAOS_CLOUD_TTS_VOICE","nova"),S=I.model||E,K=I.voice||L,Q=I.format||"mp3",T=S.startsWith("elevenlabs/")?S.split("/").slice(1).join("/"):S.startsWith("eleven_")?S:void 0,M=K&&K!=="nova"?K:void 0;try{let H=await kO($).routes.postApiV1VoiceTts({headers:{...Q==="mp3"?{Accept:"audio/mpeg"}:{}},json:{text:I.text,...M?{voiceId:M}:{},...T?{modelId:T}:{}}});if(!H.ok){let F=await H.text();throw Error(`ElizaOS Cloud TTS error ${H.status}: ${F}`)}if(!H.body)throw Error("ElizaOS Cloud TTS response body is null");if(!bU())return await CI(H.body);return H.body}catch(H){let F=H instanceof Error?H.message:String(H);throw Error(`Failed to fetch speech from ElizaOS Cloud TTS: ${F}`)}}import{logger as yO,ModelType as GO}from"@elizaos/core";import{createOpenAI as rQ}from"@ai-sdk/openai";function EI($){let I=VO($),E=ZO($)??(iA($)?"eliza-proxy":void 0);return rQ({apiKey:E??"",baseURL:I})}var JI=GO.TEXT_NANO??"TEXT_NANO",YI=GO.TEXT_MEDIUM??"TEXT_MEDIUM",SI=GO.TEXT_SMALL,VI=GO.TEXT_LARGE,LI=GO.TEXT_MEGA??"TEXT_MEGA",UA=GO.RESPONSE_HANDLER??"RESPONSE_HANDLER",OA=GO.ACTION_PLANNER??"ACTION_PLANNER",eQ=["o1","o3","o4","deepseek-r1","deepseek-reasoner","claude-opus-4.7","claude-opus-4-7","gpt-5"],aQ=["openai/","anthropic/"];function iQ($){let I=[{type:"text",text:$.prompt}];for(let E of $.attachments??[])I.push({type:"file",data:E.data,mediaType:E.mediaType,...E.filename?{filename:E.filename}:{}});return I}function RI($){let I=$.toLowerCase();return eQ.some((E)=>I.includes(E))}function UX($){let I=$.toLowerCase();return!aQ.some((E)=>I.startsWith(E))}function OX($){switch($){case UA:return"should_respond";case OA:return"action_planner";default:return"response"}}function ZX($,I){switch(I){case JI:return kZ($);case YI:return _Z($);case SI:return LO($);case VI:return RO($);case LI:return Z$($);case UA:return A$($);case OA:return $$($);default:return RO($)}}function AX($,I,E){let L=E,{prompt:S}=E,K=E.maxTokens??8192,Q=EI($),T=ZX($,I),M=X$($),H=(L.attachments?.length??0)>0?iQ(L):void 0,F=Q.chat(T),D=!RI(T)&&UX(T)&&Array.isArray(E.stopSequences)&&E.stopSequences.length>0?E.stopSequences:void 0;return{generateParams:{model:F,...H?{messages:[{role:"user",content:H}]}:{prompt:S},system:$.character.system??void 0,...D?{stopSequences:D}:{},maxOutputTokens:K,experimental_telemetry:{isEnabled:M}},modelName:T,modelType:I,prompt:S}}async function EO($,I,E){let{modelName:L,prompt:S}=AX($,I,E);if(yO.debug(`[ELIZAOS_CLOUD] Generating text with ${I} model: ${L}`),E.stream)yO.debug("[ELIZAOS_CLOUD] Streaming text disabled for responses compatibility; falling back to buffered response.");yO.log(`[ELIZAOS_CLOUD] Using ${I} model: ${L}`),yO.log(S);let K=RI(L),Q=[];if($.character.system)Q.push({role:"system",content:[{type:"input_text",text:$.character.system}]});Q.push({role:"user",content:[{type:"input_text",text:S}]});let T={model:L,input:Q,max_output_tokens:E.maxTokens??8192};if(!K&&typeof E.temperature==="number")T.temperature=E.temperature;let M=await NU($).requestRaw("POST","/responses",{headers:{"X-Eliza-Llm-Purpose":OX(I),"X-Eliza-Model-Type":I},json:T}),H=await M.text(),F={};if(H)try{F=JSON.parse(H)}catch(D){yO.error(`[ELIZAOS_CLOUD] Failed to parse responses JSON: ${D instanceof Error?D.message:String(D)}`)}if(!M.ok){let D=typeof F==="object"&&F?F.error:void 0,q=typeof D?.message==="string"&&D.message.trim()?D.message.trim():`elizaOS Cloud error ${M.status}`,P=Error(q);if(P.status=M.status,D)P.error=D;throw P}if(F.usage)pU($,I,S,{inputTokens:F.usage.input_tokens??0,outputTokens:F.usage.output_tokens??0,totalTokens:F.usage.total_tokens??0});let R=OZ(F);if(!R.trim())throw Error("elizaOS Cloud returned no text response");return R}async function ZA($,I){return EO($,SI,I)}async function AA($,I){return EO($,JI,I)}async function $A($,I){return EO($,YI,I)}async function IA($,I){return EO($,VI,I)}async function CA($,I){return EO($,LI,I)}async function QA($,I){return EO($,UA,I)}async function XA($,I){return EO($,OA,I)}import{logger as mU,Service as EJ}from"@elizaos/core";import{resolveApiSecurityConfig as xS,resolveDesktopApiPort as NS}from"@elizaos/shared";import{createRemoteJWKSet as wS,jwtVerify as yS}from"jose";import{CloudApiClient as GA,CloudApiError as _S,ElizaCloudHttpClient as jS,InsufficientCreditsError as vS}from"@elizaos/cloud-sdk";async function JJ(){let $=await Promise.resolve().then(() => (JA(),EA)),I=await Promise.resolve().then(() => (vU(),jU)),E=$.cpus(),L=[$.hostname(),$.platform(),$.arch(),E[0]?.model??"?",E.length,$.totalmem()].join(":");return I.createHash("sha256").update(L).digest("hex")}function YJ(){if(typeof process>"u")return"web";return{darwin:"macos",win32:"windows",linux:"linux"}[process.platform]??"linux"}class YZ extends EJ{static serviceType="CLOUD_AUTH";capabilityDescription="Eliza Cloud device authentication and SSO session helpers";client;credentials=null;constructor($){super($);this.client=new GA(PU.baseUrl)}static async start($){let I=new YZ($);return await I.initialize(),I}async stop(){this.credentials=null}async initialize(){let $=String(this.runtime.getSetting("ELIZAOS_CLOUD_BASE_URL")??PU.baseUrl);this.client.setBaseUrl($);let I=this.runtime.getSetting("ELIZAOS_CLOUD_API_KEY");if(I){let L=String(I);this.client.setApiKey(L),this.credentials={apiKey:L,userId:String(this.runtime.getSetting("ELIZAOS_CLOUD_USER_ID")??""),organizationId:String(this.runtime.getSetting("ELIZAOS_CLOUD_ORG_ID")??this.runtime.getSetting("ELIZA_CLOUD_ORGANIZATION_ID")??""),authenticatedAt:Date.now()},mU.info("[CloudAuth] Authenticated with saved API key"),this.validateApiKey(L).then((S)=>{if(!S)mU.warn("[CloudAuth] Saved API key could not be validated (cloud may be unreachable or key revoked) — model calls will use the key anyway")}).catch(()=>{});return}let E=this.runtime.getSetting("ELIZAOS_CLOUD_ENABLED");if(E==="true"||E==="1")try{await this.authenticateWithDevice()}catch(L){let S=L instanceof Error?L.message:String(L);mU.warn(`[CloudAuth] Device auth failed (cloud may be unreachable): ${S}`),mU.info("[CloudAuth] Service will start unauthenticated — cloud features disabled until connectivity is restored")}else mU.info("[CloudAuth] Cloud not enabled (set ELIZAOS_CLOUD_ENABLED=true)")}async validateApiKey($){try{return await new GA(this.client.getBaseUrl(),$).get("/models",{timeoutMs:1e4}),!0}catch(I){let E=I instanceof Error?I.message:String(I);return mU.warn(`[CloudAuth] Could not reach cloud API to validate key: ${E}`),!1}}async authenticateWithDevice(){let $=await JJ(),I=YJ(),E=process.env.ELIZAOS_CLOUD_APP_VERSION??"2.0.0-alpha",L=await Promise.resolve().then(() => (JA(),EA));mU.info(`[CloudAuth] Authenticating device (platform=${I})`);let S=await this.client.postUnauthenticated("/device-auth",{deviceId:$,platform:I,appVersion:E,deviceName:L.hostname()});this.credentials={apiKey:S.data.apiKey,userId:S.data.userId,organizationId:S.data.organizationId,authenticatedAt:Date.now()},this.client.setApiKey(S.data.apiKey);let K=S.data.isNew?"New account created":"Authenticated";return mU.info(`[CloudAuth] ${K} (credits: $${S.data.credits.toFixed(2)})`),this.credentials}authenticateWithApiKey($){let I=$.apiKey.trim();if(!I)throw Error("Eliza Cloud API key is required");return this.client.setApiKey(I),this.credentials={apiKey:I,userId:$.userId??"",organizationId:$.organizationId??"",authenticatedAt:Date.now()},mU.info("[CloudAuth] Authenticated with API key"),this.credentials}clearAuth(){this.credentials=null,this.client.setApiKey(void 0)}isAuthenticated(){return this.credentials!==null}getCredentials(){return this.credentials}getApiKey(){return this.credentials?.apiKey??this.client.getApiKey()}getClient(){return this.client}getUserId(){return this.credentials?.userId}getOrganizationId(){return this.credentials?.organizationId}}import{logger as xU,Service as SJ}from"@elizaos/core";class SZ extends SJ{static serviceType="CLOUD_BACKUP";capabilityDescription="ElizaCloud agent state backup and restore";authService;autoBackups=new Map;maxSnapshots=PU.backup.maxSnapshots;backupIntervalMs=PU.backup.autoBackupIntervalMs;static async start($){let I=new SZ($);return await I.initialize(),I}async stop(){for(let[,$]of this.autoBackups)clearInterval($.timer);this.autoBackups.clear(),xU.info("[CloudBackup] Service stopped")}async initialize(){let $=this.runtime.getService("CLOUD_AUTH");if(!$){xU.debug("[CloudBackup] CloudAuthService not available");return}this.authService=$,xU.info("[CloudBackup] Service initialized")}async createSnapshot($,I="manual",E){let S=await this.authService.getClient().post(`/agent-state/${$}/snapshot`,{snapshotType:I,metadata:E});xU.info(`[CloudBackup] Created ${I} snapshot for container ${$} (id=${S.data.id}, size=${VJ(S.data.sizeBytes)})`);let K=this.autoBackups.get($);if(K)K.lastBackupAt=Date.now();return S.data}async listSnapshots($){return(await this.authService.getClient().get(`/agent-state/${$}/snapshots`)).data}async restoreSnapshot($,I){await this.authService.getClient().post(`/agent-state/${$}/restore`,{snapshotId:I}),xU.info(`[CloudBackup] Restored snapshot ${I} for container ${$}`)}async getLatestSnapshot($){let I=await this.listSnapshots($);if(I.length===0)return null;return I.sort((E,L)=>new Date(L.created_at).getTime()-new Date(E.created_at).getTime()),I[0]}scheduleAutoBackup($,I){if(this.autoBackups.has($)){xU.debug(`[CloudBackup] Auto-backup already scheduled for ${$}`);return}let E=I??this.backupIntervalMs,L=setInterval(()=>{xU.debug(`[CloudBackup] Running auto-backup for container ${$}`),this.createSnapshot($,"auto",{trigger:"scheduled",scheduledIntervalMs:E}).then(()=>this.pruneSnapshots($)).catch((S)=>{xU.error(`[CloudBackup] Auto-backup failed for ${$}: ${S.message}`)})},E);this.autoBackups.set($,{containerId:$,timer:L,lastBackupAt:null}),xU.info(`[CloudBackup] Scheduled auto-backup for ${$} every ${Math.round(E/60000)} minutes`)}cancelAutoBackup($){let I=this.autoBackups.get($);if(!I)return;clearInterval(I.timer),this.autoBackups.delete($),xU.info(`[CloudBackup] Cancelled auto-backup for ${$}`)}async createPreEvictionSnapshot($){return xU.info(`[CloudBackup] Creating pre-eviction snapshot for ${$}`),this.createSnapshot($,"pre-eviction",{trigger:"billing-eviction",createdAt:new Date().toISOString()})}async pruneSnapshots($){let L=(await this.listSnapshots($)).filter((K)=>K.snapshotType==="auto").sort((K,Q)=>new Date(Q.created_at).getTime()-new Date(K.created_at).getTime()).slice(this.maxSnapshots);if(L.length===0)return;let S=this.authService.getClient();for(let K of L)await S.delete(`/agent-state/${$}/snapshots/${K.id}`),xU.debug(`[CloudBackup] Pruned old auto snapshot ${K.id} for ${$}`);xU.info(`[CloudBackup] Pruned ${L.length} old auto snapshot(s) for ${$}`)}isAutoBackupScheduled($){return this.autoBackups.has($)}getLastBackupTime($){return this.autoBackups.get($)?.lastBackupAt??null}}function VJ($){if($<1024)return`${$} B`;if($<1048576)return`${($/1024).toFixed(1)} KB`;if($<1073741824)return`${($/1048576).toFixed(1)} MB`;return`${($/1073741824).toFixed(1)} GB`}import{logger as IC,Service as LJ}from"@elizaos/core";function RJ(){if(typeof process>"u")return{};return process.env}function VZ($,I){if($&&typeof $.getSetting==="function"){let L=$.getSetting(I);if(typeof L==="string"&&L.length>0)return L}let E=RJ()[I];if(typeof E==="string"&&E.length>0)return E;return null}function DJ($){let I=$.length;while(I>0&&$.charCodeAt(I-1)===47)I-=1;return I===$.length?$:$.slice(0,I)}class LZ extends LJ{static serviceType="CLOUD_BOOTSTRAP";capabilityDescription="Exposes Eliza Cloud bootstrap-token trust anchor (issuer, JWKS URL, revocation list URL, expected container id) to app-core";static async start($){let I=new LZ($),E=VZ($,"ELIZA_CLOUD_ISSUER"),L=VZ($,"ELIZA_CLOUD_CONTAINER_ID");if(E)IC.info(`[CloudBootstrap] Trust anchor configured (issuer=${E}, containerId=${L??"<unset>"})`);else IC.debug("[CloudBootstrap] ELIZA_CLOUD_ISSUER unset — bootstrap-token verification will reject until configured");return I}async stop(){}getExpectedIssuer(){let $=VZ(this.runtime,"ELIZA_CLOUD_ISSUER");if(!$)throw Error("ELIZA_CLOUD_ISSUER is not configured — bootstrap-token verification cannot proceed");return DJ($)}getJwksUrl(){return`${this.getExpectedIssuer()}/.well-known/jwks.json`}getRevocationListUrl(){return`${this.getExpectedIssuer()}/.well-known/revocations.json`}getExpectedContainerId(){return VZ(this.runtime,"ELIZA_CLOUD_CONTAINER_ID")}}import{logger as yU,Service as KJ}from"@elizaos/core";import{WebSocket as BA}from"undici";class RZ extends KJ{static serviceType="CLOUD_BRIDGE";capabilityDescription="WebSocket bridge to cloud-hosted ElizaOS agents";authService;bridgeConfig=PU.bridge;connections=new Map;static async start($){let I=new RZ($);return await I.initialize(),I}async stop(){for(let[$]of this.connections)await this.disconnect($);yU.info("[CloudBridge] Service stopped")}async initialize(){let $=this.runtime.getService("CLOUD_AUTH");if(!$){yU.debug("[CloudBridge] CloudAuthService not available");return}this.authService=$,yU.info("[CloudBridge] Service initialized")}async connect($){let I=this.connections.get($);if(I){if(I.state==="connected"||I.state==="connecting"){yU.debug(`[CloudBridge] Already connected/connecting to ${$}`);return}}await this.establishConnection($,0)}async disconnect($){let I=this.connections.get($);if(!I)return;if(I.heartbeatTimer)clearInterval(I.heartbeatTimer);if(I.reconnectTimer)clearTimeout(I.reconnectTimer);for(let[,E]of I.pendingRequests)clearTimeout(E.timeout),E.reject(Error("Bridge disconnected"));if(I.pendingRequests.clear(),I.ws.readyState===BA.OPEN||I.ws.readyState===BA.CONNECTING)I.ws.close(1000,"Client disconnect");this.connections.delete($),yU.info(`[CloudBridge] Disconnected from ${$}`)}async establishConnection($,I){let E=this.authService.getClient(),L=this.authService.getApiKey(),S=E.buildWsUrl(`/agent-bridge/${$}`),K=L?`${S}?token=${encodeURIComponent(L)}`:S,Q={ws:new BA(K),state:"connecting",connectedAt:null,lastHeartbeat:null,reconnectAttempts:I,heartbeatTimer:null,reconnectTimer:null,handlers:this.connections.get($)?.handlers??new Set,pendingRequests:new Map,nextRequestId:1};this.connections.set($,Q),Q.ws.addEventListener("open",()=>{Q.state="connected",Q.connectedAt=Date.now(),Q.reconnectAttempts=0,yU.info(`[CloudBridge] Connected to agent ${$}`),Q.heartbeatTimer=setInterval(()=>{this.sendHeartbeat($)},this.bridgeConfig.heartbeatIntervalMs)}),Q.ws.addEventListener("message",(T)=>{let M=T.data,H=typeof M==="string"?M:M instanceof Buffer?M.toString("utf-8"):String(M),F=JSON.parse(H);if(F.method==="heartbeat.ack"){Q.lastHeartbeat=Date.now();return}if(F.id!==void 0&&!F.method){let R=Q.pendingRequests.get(F.id);if(R){if(clearTimeout(R.timeout),Q.pendingRequests.delete(F.id),F.error)R.reject(Error(F.error.message));else R.resolve(F.result);return}}for(let R of Q.handlers)R(F)}),Q.ws.addEventListener("close",(T)=>{if(Q.state="disconnected",Q.heartbeatTimer)clearInterval(Q.heartbeatTimer);if(T.code===1000){yU.info(`[CloudBridge] Clean disconnect from ${$}`);return}yU.warn(`[CloudBridge] Connection lost to ${$} (code=${T.code}, reason=${T.reason})`),this.scheduleReconnect($,Q.reconnectAttempts+1)}),Q.ws.addEventListener("error",()=>{yU.error(`[CloudBridge] WebSocket error for ${$}`)})}scheduleReconnect($,I){if(I>this.bridgeConfig.maxReconnectAttempts){yU.error(`[CloudBridge] Max reconnect attempts (${this.bridgeConfig.maxReconnectAttempts}) reached for ${$}`),this.connections.delete($);return}let E=this.bridgeConfig.reconnectIntervalMs,L=Math.min(E*2**Math.min(I,5),120000),S=Math.floor(Math.random()*1000);yU.info(`[CloudBridge] Reconnecting to ${$} in ${Math.round((L+S)/1000)}s (attempt ${I})`);let K=this.connections.get($);if(K)K.state="reconnecting",K.reconnectTimer=setTimeout(()=>{this.establishConnection($,I)},L+S)}sendHeartbeat($){let I=this.connections.get($);if(!I||I.state!=="connected")return;let E={jsonrpc:"2.0",method:"heartbeat",params:{timestamp:Date.now()}};I.ws.send(JSON.stringify(E))}async sendRequest($,I,E,L=60000){let S=this.connections.get($);if(!S||S.state!=="connected")throw Error(`Not connected to container ${$}`);let K=S.nextRequestId++,Q={jsonrpc:"2.0",id:K,method:I,params:E};return new Promise((T,M)=>{let H=setTimeout(()=>{S.pendingRequests.delete(K),M(Error(`Request ${I} timed out after ${L}ms`))},L);S.pendingRequests.set(K,{resolve:T,reject:M,timeout:H}),S.ws.send(JSON.stringify(Q))})}sendNotification($,I,E){let L=this.connections.get($);if(!L||L.state!=="connected")throw Error(`Not connected to container ${$}`);let S={jsonrpc:"2.0",method:I,params:E};L.ws.send(JSON.stringify(S))}async sendChatMessage($,I,E,L){return await this.sendRequest($,"message.send",{text:I,roomId:E,metadata:L})}async getAgentStatus($){return await this.sendRequest($,"status.get",{})}async updateAgentConfig($,I){await this.sendRequest($,"config.update",I)}onMessage($,I){let E=this.connections.get($);if(!E)E={ws:null,state:"disconnected",connectedAt:null,lastHeartbeat:null,reconnectAttempts:0,heartbeatTimer:null,reconnectTimer:null,handlers:new Set,pendingRequests:new Map,nextRequestId:1},this.connections.set($,E);return E.handlers.add(I),()=>{E.handlers.delete(I)}}getConnectionState($){return this.connections.get($)?.state??"disconnected"}getConnectionInfo($){let I=this.connections.get($);if(!I)return null;return{containerId:$,state:I.state,connectedAt:I.connectedAt,lastHeartbeat:I.lastHeartbeat,reconnectAttempts:I.reconnectAttempts}}getConnectedContainerIds(){let $=[];for(let[I,E]of this.connections)if(E.state==="connected")$.push(I);return $}}import{logger as cU,Service as HJ}from"@elizaos/core";class DZ extends HJ{static serviceType="CLOUD_CONTAINER";capabilityDescription="ElizaCloud container provisioning and lifecycle management";authService;containerDefaults=PU.container;tracked=new Map;static async start($){let I=new DZ($);return await I.initialize(),I}async stop(){for(let[,$]of this.tracked){if($.pollingTimer)clearTimeout($.pollingTimer);if($.healthTimer)clearInterval($.healthTimer)}this.tracked.clear()}async initialize(){let $=this.runtime.getService("CLOUD_AUTH");if(!$){cU.debug("[CloudContainer] CloudAuthService not available, container operations will fail");return}if(this.authService=$,this.authService.isAuthenticated()){let I=await this.listContainers();for(let E of I){if(this.tracked.set(E.id,{container:E,pollingTimer:null,healthTimer:null}),E.status==="pending"||E.status==="building"||E.status==="deploying")this.startPolling(E.id);if(E.status==="running")this.startHealthMonitoring(E.id)}cU.info(`[CloudContainer] Loaded ${I.length} existing container(s)`)}}getClient(){return this.authService.getClient()}async createContainer($){let I=this.getClient(),E=this.containerDefaults,L={name:$.name,project_name:$.project_name,description:$.description,port:$.port??E.defaultPort,desired_count:$.desired_count??1,cpu:$.cpu??E.defaultCpu,memory:$.memory??E.defaultMemory,environment_vars:$.environment_vars??{},health_check_path:$.health_check_path??"/health",ecr_image_uri:$.ecr_image_uri,ecr_repository_uri:$.ecr_repository_uri,image_tag:$.image_tag,architecture:$.architecture??E.defaultArchitecture},S=await I.post("/containers",L);return this.tracked.set(S.data.id,{container:S.data,pollingTimer:null,healthTimer:null}),this.startPolling(S.data.id),cU.info(`[CloudContainer] Created container "${$.name}" (id=${S.data.id}, stack=${S.stackName})`),S}async listContainers(){return(await this.getClient().get("/containers")).data}async getContainer($){let E=await this.getClient().get(`/containers/${$}`),L=this.tracked.get($);if(L)L.container=E.data;return E.data}async deleteContainer($){await this.getClient().delete(`/containers/${$}`);let E=this.tracked.get($);if(E){if(E.pollingTimer)clearTimeout(E.pollingTimer);if(E.healthTimer)clearInterval(E.healthTimer);this.tracked.delete($)}cU.info(`[CloudContainer] Deleted container ${$}`)}startPolling($){let I=this.tracked.get($);if(!I)return;let E=0,L=120,S=5000,K=30000,Q=async()=>{if(E++,E>L){cU.error(`[CloudContainer] Polling timed out for container ${$} after ${L} attempts`);return}let T=await this.getContainer($),M=T.status;if(cU.debug(`[CloudContainer] Poll #${E} for ${$}: status=${M}`),M==="running"){cU.info(`[CloudContainer] Container ${$} is now running at ${T.load_balancer_url}`),this.startHealthMonitoring($);return}if(M==="failed"||M==="stopped"||M==="suspended"){if(cU.warn(`[CloudContainer] Container ${$} reached terminal state: ${M}`),T.error_message)cU.error(`[CloudContainer] Error: ${T.error_message}`);return}let H=Math.min(S*2**Math.min(E-1,3),K);I.pollingTimer=setTimeout(Q,H)};I.pollingTimer=setTimeout(Q,S)}async waitForDeployment($,I=900000){let E=Date.now()+I,L=5000,S=30000;while(Date.now()<E){let K=await this.getContainer($);if(K.status==="running")return K;if(K.status==="failed")throw Error(`Container deployment failed: ${K.error_message??"unknown error"}`);if(K.status==="stopped"||K.status==="suspended")throw Error(`Container reached terminal state: ${K.status}`);await new Promise((Q)=>setTimeout(Q,L)),L=Math.min(L*1.5,S)}throw Error(`Container deployment timed out after ${Math.round(I/1000)}s`)}startHealthMonitoring($){let I=this.tracked.get($);if(!I||I.healthTimer)return;let E=60000;I.healthTimer=setInterval(()=>{this.getContainerHealth($).then((L)=>{if(!L.data.healthy)cU.warn(`[CloudContainer] Container ${$} unhealthy: ${L.data.status}`)}).catch((L)=>{cU.error(`[CloudContainer] Health check failed for ${$}: ${L.message}`)})},E)}async getContainerHealth($){return this.getClient().get(`/containers/${$}/health`)}getTrackedContainers(){return Array.from(this.tracked.values()).map(($)=>$.container)}getTrackedContainer($){return this.tracked.get($)?.container}isContainerRunning($){return this.tracked.get($)?.container.status==="running"}getContainerUrl($){return this.tracked.get($)?.container.load_balancer_url??null}}import{ChannelType as gA,ContentType as KZ,createMessageMemory as CC,createUniqueUuid as zO,logger as dU,Service as WJ}from"@elizaos/core";var NA=25000,FJ=NA+5000,MJ=2000,QC=250;function xA($){return new Promise((I)=>setTimeout(I,$))}function fA($){return typeof $==="object"&&$!==null&&!Array.isArray($)}function zJ($){return/^[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i.test($)}function MU($){return typeof $==="string"&&$.trim()?$.trim():void 0}function TJ($){let I=MU($)?.toUpperCase();return I&&I in gA?gA[I]:gA.DM}function qJ(){if(typeof process>"u")return!1;return process.env.ELIZA_CLOUD_PROVISIONED==="1"}function PJ(){return typeof process<"u"&&typeof process.versions?.node==="string"}function XC($){if(!Array.isArray($))return;let I=$.map((E,L)=>{if(!fA(E))return null;let S=MU(E.url);if(!S)return null;let K=MU(E.type)?.toLowerCase();return{id:MU(E.id)??`${L}:${S}`,url:S,source:MU(E.source),title:MU(E.title),description:MU(E.description),text:MU(E.text),contentType:K==="image"?KZ.IMAGE:K==="video"?KZ.VIDEO:K==="audio"?KZ.AUDIO:K==="document"?KZ.DOCUMENT:void 0}}).filter((E)=>E!==null);return I.length>0?I:void 0}function bO($){return fA($)?$:void 0}function GC($){if(!fA($))return;return JSON.parse(JSON.stringify($))}function kJ($,I){let E=bO(I.params),L=bO(E?.sender),S=MU(E?.source)??"eliza_cloud_gateway",K=typeof E?.text==="string"?E.text:"",Q=MU(L?.id)??`${S}:anonymous`,T=MU(L?.username)??Q,M=MU(L?.displayName)??MU(L?.name)??T,H=MU(E?.roomId)??`${S}:${Q}:${String(I.id??Date.now())}:${$.agentId}`;if(!K.trim()&&!XC(E?.attachments)?.length)return null;return{text:K.trim()||" ",roomKey:H,channelType:TJ(E?.channelType),source:S,senderId:Q,senderUserName:T,senderName:M,attachments:XC(E?.attachments),senderMetadata:bO(L?.metadata),transportMetadata:bO(E?.metadata)}}function _J($,I,E){let L=bO(I?.discord),S=MU(L?.guildId);if(S)return`gateway:${$}:guild:${S}`;let K=MU(I?.threadId);if(K)return`gateway:${$}:thread:${K}`;return`gateway:${$}:room:${E}`}class HZ extends Error{constructor(){super("Gateway relay session missing");this.name="SessionMissingError"}}class WZ extends WJ{static serviceType="CLOUD_MANAGED_GATEWAY_RELAY";capabilityDescription="Registers a local Eliza runtime with the cloud managed gateway and handles inbound relay traffic";authService=null;loopPromise=null;currentSessionId=null;stopping=!1;activeAbortController=null;relayStatus="idle";lastSeenAt=null;static async start($){let I=new WZ($);return await I.initialize(),I}async stop(){if(this.stopping=!0,this.relayStatus="stopped",this.activeAbortController?.abort(),this.loopPromise)await this.loopPromise.catch((I)=>{dU.debug(`[CloudManagedGatewayRelay] Ignoring relay loop shutdown error: ${I instanceof Error?I.message:String(I)}`)});let $=this.currentSessionId;if(this.currentSessionId=null,$)await this.disconnectSession($)}async initialize(){if(!PJ()){dU.debug("[CloudManagedGatewayRelay] Skipping gateway relay outside Node.js runtime"),this.relayStatus="stopped";return}if(qJ()){dU.debug("[CloudManagedGatewayRelay] Skipping local relay inside provisioned cloud runtime"),this.relayStatus="stopped";return}if(!this.runtime.messageService){dU.debug("[CloudManagedGatewayRelay] Skipping gateway relay without message service"),this.relayStatus="idle";return}let $=this.runtime.getService("CLOUD_AUTH");if(!$){dU.debug("[CloudManagedGatewayRelay] CloudAuthService not available"),this.relayStatus="idle";return}if(this.authService=$,!this.authService.isAuthenticated()){dU.debug("[CloudManagedGatewayRelay] Skipping gateway relay while cloud auth is inactive"),this.relayStatus="idle";return}this.startRelayLoopIfReady()}getSessionInfo(){let $=this.authService,I=this.stopping||this.relayStatus==="stopped"?"stopped":$?.isAuthenticated()===!1?"idle":this.relayStatus;return{sessionId:this.currentSessionId,organizationId:$?.getOrganizationId()??null,userId:$?.getUserId()??null,agentName:this.getAgentName(),platform:"local-runtime",lastSeenAt:this.lastSeenAt,status:I}}startRelayLoopIfReady(){if(this.loopPromise&&!this.stopping)return!0;let $=this.authService??this.runtime.getService("CLOUD_AUTH");if(!$?.isAuthenticated()||!this.runtime.messageService)return this.relayStatus="idle",!1;return this.authService=$,this.stopping=!1,this.relayStatus="idle",this.loopPromise=this.runLoop(),dU.info("[CloudManagedGatewayRelay] Local gateway relay loop started"),!0}async runLoop(){while(!this.stopping)try{if(!this.currentSessionId){this.currentSessionId=await this.registerSession(),this.relayStatus="registered",this.lastSeenAt=new Date().toISOString();continue}this.relayStatus="polling";let $=await this.pollNextRequest(this.currentSessionId);if(this.lastSeenAt=new Date().toISOString(),!$){this.relayStatus="registered",await xA(QC);continue}let I=await this.handleRequest($.rpc);await this.submitResponse(this.currentSessionId,$.requestId,I),this.relayStatus="registered"}catch($){if(this.stopping)return;if($ instanceof HZ){this.currentSessionId=null,this.relayStatus="idle",await xA(QC);continue}this.relayStatus="error",dU.warn(`[CloudManagedGatewayRelay] Relay loop error: ${$ instanceof Error?$.message:String($)}`),await xA(MJ)}}getAgentName(){return this.runtime.character?.name?.trim()||"Eliza"}getClient(){let $=this.authService?.getClient();if(!$)throw Error("Cloud API client is unavailable");return $}async requestJson($,I){let E=I.timeoutMs??FJ,L=new AbortController,S=setTimeout(()=>L.abort(),E);this.activeAbortController=L;try{let K=await this.getClient().requestRaw(I.method,$,{headers:{Accept:"application/json"},json:I.json,query:I.query,signal:L.signal}),Q=await K.json().catch(()=>({}));return{status:K.status,body:Q}}finally{if(clearTimeout(S),this.activeAbortController===L)this.activeAbortController=null}}async registerSession(){let{status:$,body:I}=await this.requestJson("/eliza/gateway-relay/sessions",{method:"POST",json:{runtimeAgentId:this.runtime.agentId,agentName:this.getAgentName()}});if($>=400||!I?.success||!I.data?.session?.id)throw Error(`Failed to register gateway relay session (status=${$})`);return dU.info(`[CloudManagedGatewayRelay] Registered local runtime for managed gateway (${I.data.session.id})`),I.data.session.id}async disconnectSession($){try{await this.requestJson(`/eliza/gateway-relay/sessions/${encodeURIComponent($)}`,{method:"DELETE",timeoutMs:1e4})}catch(I){dU.debug(`[CloudManagedGatewayRelay] Failed to disconnect relay session ${$}: ${I instanceof Error?I.message:String(I)}`)}}async pollNextRequest($){let{status:I,body:E}=await this.requestJson(`/eliza/gateway-relay/sessions/${encodeURIComponent($)}/next`,{method:"GET",query:{timeoutMs:NA},timeoutMs:NA+5000});if(I===404)throw new HZ;if(I>=400||!E?.success)throw Error(`Failed to poll gateway relay session ${$} (status=${I})`);return E.data?.request??null}async submitResponse($,I,E){let{status:L,body:S}=await this.requestJson(`/eliza/gateway-relay/sessions/${encodeURIComponent($)}/responses`,{method:"POST",json:{requestId:I,response:E}});if(L===404)throw new HZ;if(L>=400||S?.success===!1)throw Error(`Failed to submit gateway relay response (status=${L})`)}async handleRequest($){switch($.method){case"heartbeat":return{jsonrpc:"2.0",id:$.id,result:{timestamp:Date.now()}};case"status.get":return{jsonrpc:"2.0",id:$.id,result:{status:"running",runtimeAgentId:this.runtime.agentId,agentName:this.getAgentName()}};case"message.send":return this.handleMessageSend($);default:return{jsonrpc:"2.0",id:$.id,error:{code:-32601,message:`Unsupported relay method: ${$.method}`}}}}async handleMessageSend($){if(!this.runtime.messageService)return{jsonrpc:"2.0",id:$.id,error:{code:-32603,message:"Message service is not available"}};let I=kJ(this.runtime,$);if(!I)return{jsonrpc:"2.0",id:$.id,error:{code:-32602,message:"Invalid message relay payload"}};let E=zJ(I.roomKey)?I.roomKey:zO(this.runtime,I.roomKey),L=zO(this.runtime,_J(I.source,I.transportMetadata,I.roomKey)),S=zO(this.runtime,`${I.source}:${I.senderId}`),K=zO(this.runtime,`eliza-cloud-gateway:${I.source}`),Q=zO(this.runtime,`${I.source}:${I.roomKey}:${String($.id??Date.now())}:inbound`),T=GC(I.transportMetadata);await this.runtime.ensureConnection({entityId:S,roomId:E,roomName:I.roomKey,worldId:L,worldName:I.source,userName:I.senderUserName,name:I.senderName,source:I.source,channelId:I.roomKey,type:I.channelType,messageServerId:K,metadata:T});let M=CC({id:Q,entityId:S,agentId:this.runtime.agentId,roomId:E,content:{text:I.text,source:I.source,channelType:I.channelType,...I.attachments?{attachments:I.attachments}:{}}});M.metadata={...M.metadata,entityName:I.senderName,entityUserName:I.senderUserName,...I.senderMetadata?{gatewaySender:GC(I.senderMetadata)}:{},...I.transportMetadata?{gatewayMetadata:T}:{}};let H=[],F=async(R)=>{let D=typeof R.text==="string"?R.text:"";if(D.trim())H.push(D);let q=CC({id:zO(this.runtime,`${I.source}:${I.roomKey}:${String($.id??Date.now())}:response:${H.length}`),entityId:this.runtime.agentId,agentId:this.runtime.agentId,roomId:E,content:{...R,text:D,source:I.source,channelType:I.channelType}});return await this.runtime.createMemory(q,"messages"),[q]};try{let R=await this.runtime.messageService.handleMessage(this.runtime,M,F),D=H[H.length-1]??(typeof R.responseContent?.text==="string"?R.responseContent.text:void 0);return{jsonrpc:"2.0",id:$.id,result:{didRespond:R.didRespond,...D?{text:D}:{},runtimeAgentId:this.runtime.agentId}}}catch(R){return{jsonrpc:"2.0",id:$.id,error:{code:-32603,message:R instanceof Error?R.message:String(R)}}}}}import{logger as wA,Service as jJ}from"@elizaos/core";var EC=1800000,vJ=[["gpt-","openai"],["o1","openai"],["o3","openai"],["o4","openai"],["dall-e","openai"],["whisper","openai"],["tts","openai"],["claude-","anthropic"],["gemini-","google"],["llama","meta"],["deepseek","deepseek"],["grok","xai"],["kimi","moonshot"]];function BJ($){if($.includes("/"))return $.split("/")[0];let I=$.toLowerCase();for(let[E,L]of vJ)if(I.startsWith(E))return L;return"unknown"}function gJ($){if($.includes("/"))return $.split("/").slice(1).join("/");return $}class FZ extends jJ{static serviceType="CLOUD_MODEL_REGISTRY";capabilityDescription="Discovers and caches available AI models from ElizaCloud";models=[];byProvider={};lastFetchedAt=0;fetchPromise=null;static async start($){let I=new FZ($);return await I.initialize(),I}async stop(){this.models=[],this.byProvider={},this.lastFetchedAt=0}async initialize(){if(!this.runtime.getService("CLOUD_AUTH")?.isAuthenticated()){wA.info("[CloudModelRegistry] Auth not available, will fetch models on first access");return}await this.fetchModels(),this.validateConfiguredModels()}async fetchModels(){if(this.fetchPromise){await this.fetchPromise;return}this.fetchPromise=this.doFetchModels(),await this.fetchPromise,this.fetchPromise=null}async doFetchModels(){let $=this.runtime.getService("CLOUD_AUTH");if(!$?.isAuthenticated())return;let L=(await $.getClient().get("/models")).data??[];this.models=L.map((S)=>({id:S.id,provider:BJ(S.id),name:gJ(S.id),createdAt:S.created})),this.byProvider={};for(let S of this.models){if(!this.byProvider[S.provider])this.byProvider[S.provider]=[];this.byProvider[S.provider].push(S)}this.lastFetchedAt=Date.now(),wA.info(`[CloudModelRegistry] Loaded ${this.models.length} models from ${Object.keys(this.byProvider).length} providers`)}validateConfiguredModels(){if(this.models.length===0)return;let $=new Set(this.models.map((L)=>L.id)),I=new Set(this.models.map((L)=>L.name)),E=[{key:"ELIZAOS_CLOUD_NANO_MODEL",label:"nano model"},{key:"ELIZAOS_CLOUD_MEDIUM_MODEL",label:"medium model"},{key:"ELIZAOS_CLOUD_SMALL_MODEL",label:"small model"},{key:"ELIZAOS_CLOUD_LARGE_MODEL",label:"large model"},{key:"ELIZAOS_CLOUD_MEGA_MODEL",label:"mega model"},{key:"ELIZAOS_CLOUD_RESPONSE_HANDLER_MODEL",label:"response handler model"},{key:"ELIZAOS_CLOUD_ACTION_PLANNER_MODEL",label:"action planner model"},{key:"ELIZAOS_CLOUD_RESPONSE_MODEL",label:"response model"},{key:"ELIZAOS_CLOUD_RESEARCH_MODEL",label:"research model"},{key:"ELIZAOS_CLOUD_EMBEDDING_MODEL",label:"embedding model"},{key:"ELIZAOS_CLOUD_IMAGE_DESCRIPTION_MODEL",label:"image description model"},{key:"ELIZAOS_CLOUD_IMAGE_GENERATION_MODEL",label:"image generation model"},{key:"ELIZAOS_CLOUD_TTS_MODEL",label:"TTS model"},{key:"ELIZAOS_CLOUD_TRANSCRIPTION_MODEL",label:"transcription model"}];for(let{key:L,label:S}of E){let K=this.runtime.getSetting(L);if(K&&typeof K==="string"){if(!($.has(K)||I.has(K)))wA.warn(`[CloudModelRegistry] Configured ${S} "${K}" not found in available models. It may still work if the gateway supports it, but check your configuration.`)}}}async getAvailableModels(){if(Date.now()-this.lastFetchedAt>EC)await this.fetchModels();return this.models}async getModelsByProvider(){if(Date.now()-this.lastFetchedAt>EC)await this.fetchModels();return this.byProvider}}var xJ=t0.TEXT_NANO??"TEXT_NANO",NJ=t0.TEXT_MEDIUM??"TEXT_MEDIUM",fJ=t0.TEXT_MEGA??"TEXT_MEGA",wJ=t0.RESPONSE_HANDLER??"RESPONSE_HANDLER",yJ=t0.ACTION_PLANNER??"ACTION_PLANNER";function cJ(){if(typeof process>"u")return{};return process.env}var u0=cJ(),pJ={name:"elizaOSCloud",description:"ElizaOS Cloud plugin — Multi-model AI generation, container provisioning, agent bridge, and billing management",config:{ELIZAOS_CLOUD_API_KEY:u0.ELIZAOS_CLOUD_API_KEY??null,ELIZAOS_CLOUD_BASE_URL:u0.ELIZAOS_CLOUD_BASE_URL??null,ELIZAOS_CLOUD_ENABLED:u0.ELIZAOS_CLOUD_ENABLED??null,ELIZAOS_CLOUD_NANO_MODEL:u0.ELIZAOS_CLOUD_NANO_MODEL??null,ELIZAOS_CLOUD_MEDIUM_MODEL:u0.ELIZAOS_CLOUD_MEDIUM_MODEL??null,ELIZAOS_CLOUD_SMALL_MODEL:u0.ELIZAOS_CLOUD_SMALL_MODEL??null,ELIZAOS_CLOUD_LARGE_MODEL:u0.ELIZAOS_CLOUD_LARGE_MODEL??null,ELIZAOS_CLOUD_MEGA_MODEL:u0.ELIZAOS_CLOUD_MEGA_MODEL??null,ELIZAOS_CLOUD_RESPONSE_HANDLER_MODEL:u0.ELIZAOS_CLOUD_RESPONSE_HANDLER_MODEL??null,ELIZAOS_CLOUD_SHOULD_RESPOND_MODEL:u0.ELIZAOS_CLOUD_SHOULD_RESPOND_MODEL??null,ELIZAOS_CLOUD_ACTION_PLANNER_MODEL:u0.ELIZAOS_CLOUD_ACTION_PLANNER_MODEL??null,ELIZAOS_CLOUD_PLANNER_MODEL:u0.ELIZAOS_CLOUD_PLANNER_MODEL??null,ELIZAOS_CLOUD_RESPONSE_MODEL:u0.ELIZAOS_CLOUD_RESPONSE_MODEL??null,NANO_MODEL:u0.NANO_MODEL??null,MEDIUM_MODEL:u0.MEDIUM_MODEL??null,SMALL_MODEL:u0.SMALL_MODEL??null,LARGE_MODEL:u0.LARGE_MODEL??null,MEGA_MODEL:u0.MEGA_MODEL??null,RESPONSE_HANDLER_MODEL:u0.RESPONSE_HANDLER_MODEL??null,SHOULD_RESPOND_MODEL:u0.SHOULD_RESPOND_MODEL??null,ACTION_PLANNER_MODEL:u0.ACTION_PLANNER_MODEL??null,PLANNER_MODEL:u0.PLANNER_MODEL??null,RESPONSE_MODEL:u0.RESPONSE_MODEL??null,ELIZAOS_CLOUD_RESEARCH_MODEL:u0.ELIZAOS_CLOUD_RESEARCH_MODEL??null,RESEARCH_MODEL:u0.RESEARCH_MODEL??null,ELIZAOS_CLOUD_EMBEDDING_MODEL:u0.ELIZAOS_CLOUD_EMBEDDING_MODEL??null,ELIZAOS_CLOUD_EMBEDDING_API_KEY:u0.ELIZAOS_CLOUD_EMBEDDING_API_KEY??null,ELIZAOS_CLOUD_EMBEDDING_URL:u0.ELIZAOS_CLOUD_EMBEDDING_URL??null,ELIZAOS_CLOUD_EMBEDDING_DIMENSIONS:u0.ELIZAOS_CLOUD_EMBEDDING_DIMENSIONS??null,ELIZAOS_CLOUD_IMAGE_DESCRIPTION_MODEL:u0.ELIZAOS_CLOUD_IMAGE_DESCRIPTION_MODEL??null,ELIZAOS_CLOUD_IMAGE_DESCRIPTION_MAX_TOKENS:u0.ELIZAOS_CLOUD_IMAGE_DESCRIPTION_MAX_TOKENS??null,ELIZAOS_CLOUD_IMAGE_GENERATION_MODEL:u0.ELIZAOS_CLOUD_IMAGE_GENERATION_MODEL??null,ELIZAOS_CLOUD_TTS_MODEL:u0.ELIZAOS_CLOUD_TTS_MODEL??null,ELIZAOS_CLOUD_TRANSCRIPTION_MODEL:u0.ELIZAOS_CLOUD_TRANSCRIPTION_MODEL??null,ELIZAOS_CLOUD_EXPERIMENTAL_TELEMETRY:u0.ELIZAOS_CLOUD_EXPERIMENTAL_TELEMETRY??null},async init($,I){E$($,I)},services:[YZ,LZ,WZ,FZ,DZ,RZ,SZ],actions:[dA,lA,bA,uA],providers:[oA,mA,nA,aA],models:{[t0.TEXT_EMBEDDING]:vZ,[xJ]:AA,[NJ]:$A,[t0.TEXT_SMALL]:ZA,[t0.TEXT_LARGE]:IA,[fJ]:CA,[wJ]:QA,[yJ]:XA,[t0.RESEARCH]:aZ,[t0.IMAGE]:nZ,[t0.IMAGE_DESCRIPTION]:tZ,[t0.OBJECT_SMALL]:rZ,[t0.OBJECT_LARGE]:eZ},tests:[{name:"ELIZAOS_CLOUD_plugin_tests",tests:[{name:"ELIZAOS_CLOUD_test_url_and_api_key_validation",fn:async($)=>{let I=await NU($).get("/models");BU.log({data:I.data?.length??"N/A"},"Models Available")}},{name:"ELIZAOS_CLOUD_test_text_embedding",fn:async($)=>{let I=await $.useModel(t0.TEXT_EMBEDDING,{text:"Hello, world!"});BU.log({embedding:I},"embedding")}},{name:"ELIZAOS_CLOUD_test_text_large",fn:async($)=>{let I=await $.useModel(t0.TEXT_LARGE,{prompt:"What is the nature of reality in 10 words?"});if(I.length===0)throw Error("Failed to generate text");BU.log({text:I},"generated with test_text_large")}},{name:"ELIZAOS_CLOUD_test_text_small",fn:async($)=>{let I=await $.useModel(t0.TEXT_SMALL,{prompt:"What is the nature of reality in 10 words?"});if(I.length===0)throw Error("Failed to generate text");BU.log({text:I},"generated with test_text_small")}},{name:"ELIZAOS_CLOUD_test_image_generation",fn:async($)=>{BU.log("ELIZAOS_CLOUD_test_image_generation");let I=await $.useModel(t0.IMAGE,{prompt:"A beautiful sunset over a calm ocean",count:1,size:"1024x1024"});BU.log({image:I},"generated with test_image_generation")}},{name:"image-description",fn:async($)=>{BU.log("ELIZAOS_CLOUD_test_image_description");let I=await $.useModel(t0.IMAGE_DESCRIPTION,"https://upload.wikimedia.org/wikipedia/commons/thumb/1/1c/Vitalik_Buterin_TechCrunch_London_2015_%28cropped%29.jpg/537px-Vitalik_Buterin_TechCrunch_London_2015_%28cropped%29.jpg");if(I&&typeof I==="object"&&"title"in I&&"description"in I)BU.log({result:I},"Image description");else BU.error(`Invalid image description result format: ${JSON.stringify(I)}`)}},{name:"ELIZAOS_CLOUD_test_transcription",fn:async($)=>{BU.log("ELIZAOS_CLOUD_test_transcription");let E=await(await fetch("https://upload.wikimedia.org/wikipedia/en/4/40/Chris_Benoit_Voice_Message.ogg")).arrayBuffer(),L=await $.useModel(t0.TRANSCRIPTION,Buffer.from(new Uint8Array(E)));BU.log({transcription:L},"generated with test_transcription")}},{name:"ELIZAOS_CLOUD_test_text_tokenizer_encode",fn:async($)=>{let E=await $.useModel(t0.TEXT_TOKENIZER_ENCODE,{prompt:"Hello tokenizer encode!",modelType:t0.TEXT_SMALL});if(!Array.isArray(E)||E.length===0)throw Error("Failed to tokenize text: expected non-empty array of tokens");BU.log({tokens:E},"Tokenized output")}},{name:"ELIZAOS_CLOUD_test_text_tokenizer_decode",fn:async($)=>{let E=await $.useModel(t0.TEXT_TOKENIZER_ENCODE,{prompt:"Hello tokenizer decode!",modelType:t0.TEXT_SMALL}),L=await $.useModel(t0.TEXT_TOKENIZER_DECODE,{tokens:E,modelType:t0.TEXT_SMALL});if(L!=="Hello tokenizer decode!")throw Error(`Decoded text does not match original. Expected "Hello tokenizer decode!", got "${L}"`);BU.log({decodedText:L},"Decoded text")}},{name:"ELIZAOS_CLOUD_test_text_to_speech",fn:async($)=>{if(!await iZ($,{text:"Hello, this is a test for text-to-speech."}))throw Error("Failed to generate speech");BU.log("Generated speech successfully")}}]}]},JC=pJ;var PV=JC;export{pJ as elizaOSCloudPlugin,PV as default};
|
|
21
24
|
|
|
22
|
-
//# debugId=
|
|
25
|
+
//# debugId=7EA6E3A1F2E5911964756E2164756E21
|