try{let e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="52c4de6a-4351-45fc-8679-c82c6008ae66",e._sentryDebugIdIdentifier="sentry-dbid-52c4de6a-4351-45fc-8679-c82c6008ae66")}catch(e){}{let e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{};e._sentryModuleMetadata=e._sentryModuleMetadata||{},e._sentryModuleMetadata[new e.Error().stack]=Object.assign({},e._sentryModuleMetadata[new e.Error().stack],{"_sentryBundlerPluginAppKey:anthropic-apps":!0})}"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[42100],{0x22f291c2a:(e,t,r)=>{r.d(t,{IO:()=>hT,P:()=>hj,z6:()=>hI});var i,n=r(0xc6857cab),a=r(0x196b13824).Buffer,s=Object.create,{getPrototypeOf:o,defineProperty:f,getOwnPropertyNames:h,getOwnPropertyDescriptor:u}=Object,d=Object.prototype.hasOwnProperty,c=new WeakMap,p=e=>{var t,r=c.get(e);return r||(r=f({},"__esModule",{value:!0}),(e&&"object"==typeof e||"function"==typeof e)&&h(e).map(i=>!d.call(r,i)&&f(r,i,{get:()=>e[i],enumerable:!(t=u(e,i))||t.enumerable})),c.set(e,r)),r},m=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),g=(e,t)=>{for(var r in t)f(e,r,{get:t[r],enumerable:!0,configurable:!0,set:e=>t[r]=()=>e})},v=(e,t)=>()=>(e&&(t=e(e=0)),t);"u">typeof require?require:"u">typeof Proxy&&new Proxy(function(e){if("u">typeof require)return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')},{get:(e,t)=>("u">typeof require?require:e)[t]});var b={};function y(e){for(var t,r=e.length,i=r%3,n=[],a=0,s=r-i;a>18&63]+et[i>>12&63]+et[i>>6&63]+et[63&i]);return n.join("")}(e,a,a+16383>s?s:a+16383));return 1===i?n.push(et[(t=e[r-1])>>2]+et[t<<4&63]+"=="):2===i&&n.push(et[(t=(e[r-2]<<8)+e[r-1])>>10]+et[t>>4&63]+et[t<<2&63]+"="),n.join("")}function w(e,t,r,i,n){var a,s,o=8*n-i-1,f=(1<>1,u=-7,d=r?n-1:0,c=r?-1:1,p=e[t+d];for(d+=c,a=p&(1<<-u)-1,p>>=-u,u+=o;u>0;a=256*a+e[t+d],d+=c,u-=8);for(s=a&(1<<-u)-1,a>>=-u,u+=i;u>0;s=256*s+e[t+d],d+=c,u-=8);if(0===a)a=1-h;else{if(a===f)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,i),a-=h}return(p?-1:1)*s*Math.pow(2,a-i)}function _(e,t,r,i,n,a){var s,o,f,h=8*a-n-1,u=(1<>1,c=5960464477539062e-23*(23===n),p=i?0:a-1,m=i?1:-1,g=+(t<0||0===t&&1/t<0);for(isNaN(t=Math.abs(t))||t===1/0?(o=+!!isNaN(t),s=u):(s=Math.floor(Math.log(t)/Math.LN2),t*(f=Math.pow(2,-s))<1&&(s--,f*=2),s+d>=1?t+=c/f:t+=c*Math.pow(2,1-d),t*f>=2&&(s++,f/=2),s+d>=u?(o=0,s=u):s+d>=1?(o=(t*f-1)*Math.pow(2,n),s+=d):(o=t*Math.pow(2,d-1)*Math.pow(2,n),s=0));n>=8;e[r+p]=255&o,p+=m,o/=256,n-=8);for(s=s<0;e[r+p]=255&s,p+=m,s/=256,h-=8);e[r+p-m]|=128*g}function M(e){if(e>eM)throw RangeError('The value "'+e+'" is invalid for option "size"');let t=new Uint8Array(e);return Object.setPrototypeOf(t,S.prototype),t}function x(e,t,r){return class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function S(e,t,r){if("number"==typeof e){if("string"==typeof t)throw TypeError('The "string" argument must be of type string. Received type number');return A(e)}return E(e,t,r)}function E(e,t,r){if("string"==typeof e){var i=e,n=t;if(("string"!=typeof n||""===n)&&(n="utf8"),!S.isEncoding(n))throw TypeError("Unknown encoding: "+n);let r=0|T(i,n),a=M(r),s=a.write(i,n);return s!==r&&(a=a.slice(0,s)),a}if(ArrayBuffer.isView(e)){var a=e;if(J(a,Uint8Array)){let e=new Uint8Array(a);return R(e.buffer,e.byteOffset,e.byteLength)}return P(a)}if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(J(e,ArrayBuffer)||e&&J(e.buffer,ArrayBuffer)||"u">typeof SharedArrayBuffer&&(J(e,SharedArrayBuffer)||e&&J(e.buffer,SharedArrayBuffer)))return R(e,t,r);if("number"==typeof e)throw TypeError('The "value" argument must not be of type number. Received type number');let s=e.valueOf&&e.valueOf();if(null!=s&&s!==e)return S.from(s,t,r);let o=function(e){if(S.isBuffer(e)){let t=0|I(e.length),r=M(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||Number.isNaN(e.length)?M(0):P(e):"Buffer"===e.type&&Array.isArray(e.data)?P(e.data):void 0}(e);if(o)return o;if("u">typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return S.from(e[Symbol.toPrimitive]("string"),t,r);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function k(e){if("number"!=typeof e)throw TypeError('"size" argument must be of type number');if(e<0)throw RangeError('The value "'+e+'" is invalid for option "size"')}function A(e){return k(e),M(e<0?0:0|I(e))}function P(e){let t=e.length<0?0:0|I(e.length),r=M(t);for(let i=0;i=eM)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+eM.toString(16)+" bytes");return 0|e}function T(e,t){if(S.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||J(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);let r=e.length,i=arguments.length>2&&!0===arguments[2];if(!i&&0===r)return 0;let n=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return K(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return Q(e).length;default:if(n)return i?-1:K(e).length;t=(""+t).toLowerCase(),n=!0}}function j(e,t,r){let i=!1;if((void 0===t||t<0)&&(t=0),t>this.length||((void 0===r||r>this.length)&&(r=this.length),r<=0||(r>>>=0)<=(t>>>=0)))return"";for(e||(e="utf8");;)switch(e){case"hex":return function(e,t,r){let i=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>i)&&(r=i);let n="";for(let i=t;i0x7fffffff?r=0x7fffffff:r<-0x80000000&&(r=-0x80000000),Number.isNaN(r*=1)&&(r=n?0:e.length-1),r<0&&(r=e.length+r),r>=e.length)if(n)return -1;else r=e.length-1;else if(r<0)if(!n)return -1;else r=0;if("string"==typeof t&&(t=S.from(t,i)),S.isBuffer(t))return 0===t.length?-1:N(e,t,r,i,n);if("number"==typeof t){if(t&=255,"function"==typeof Uint8Array.prototype.indexOf)if(n)return Uint8Array.prototype.indexOf.call(e,t,r);else return Uint8Array.prototype.lastIndexOf.call(e,t,r);return N(e,[t],r,i,n)}throw TypeError("val must be string, number or Buffer")}function N(e,t,r,i,n){let a,s=1,o=e.length,f=t.length;if(void 0!==i&&("ucs2"===(i=String(i).toLowerCase())||"ucs-2"===i||"utf16le"===i||"utf-16le"===i)){if(e.length<2||t.length<2)return -1;s=2,o/=2,f/=2,r/=2}function h(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(n){let i=-1;for(a=r;ao&&(r=o-f),a=r;a>=0;a--){let r=!0;for(let i=0;i239?4:t>223?3:t>191?2:1;if(n+s<=r){let r,i,o,f;switch(s){case 1:t<128&&(a=t);break;case 2:(192&(r=e[n+1]))==128&&(f=(31&t)<<6|63&r)>127&&(a=f);break;case 3:r=e[n+1],i=e[n+2],(192&r)==128&&(192&i)==128&&(f=(15&t)<<12|(63&r)<<6|63&i)>2047&&(f<55296||f>57343)&&(a=f);break;case 4:r=e[n+1],i=e[n+2],o=e[n+3],(192&r)==128&&(192&i)==128&&(192&o)==128&&(f=(15&t)<<18|(63&r)<<12|(63&i)<<6|63&o)>65535&&f<1114112&&(a=f)}}null===a?(a=65533,s=1):a>65535&&(a-=65536,i.push(a>>>10&1023|55296),a=56320|1023&a),i.push(a),n+=s}var a=i;let s=a.length;if(s<=eS)return String.fromCharCode.apply(String,a);let o="",f=0;for(;fr)throw RangeError("Trying to access beyond buffer length")}function $(e,t,r,i,n,a){if(!S.isBuffer(e))throw TypeError('"buffer" argument must be a Buffer instance');if(t>n||te.length)throw RangeError("Index out of range")}function q(e,t,r,i,n){H(t,i,n,e,r,7);let a=Number(t&BigInt(0xffffffff));e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a,a>>=8,e[r++]=a;let s=Number(t>>BigInt(32)&BigInt(0xffffffff));return e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,r}function B(e,t,r,i,n){H(t,i,n,e,r,7);let a=Number(t&BigInt(0xffffffff));e[r+7]=a,a>>=8,e[r+6]=a,a>>=8,e[r+5]=a,a>>=8,e[r+4]=a;let s=Number(t>>BigInt(32)&BigInt(0xffffffff));return e[r+3]=s,s>>=8,e[r+2]=s,s>>=8,e[r+1]=s,s>>=8,e[r]=s,r+8}function F(e,t,r,i,n,a){if(r+i>e.length||r<0)throw RangeError("Index out of range")}function z(e,t,r,i,n){return t*=1,r>>>=0,n||F(e,t,r,4,34028234663852886e22,-34028234663852886e22),_(e,t,r,i,23,4),r+4}function Z(e,t,r,i,n){return t*=1,r>>>=0,n||F(e,t,r,8,17976931348623157e292,-17976931348623157e292),_(e,t,r,i,52,8),r+8}function U(e){let t="",r=e.length,i=+("-"===e[0]);for(;r>=i+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function H(e,t,r,i,n,a){if(e>r||e3?0===t||t===BigInt(0)?`>= 0${i} and < 2${i} ** ${(a+1)*8}${i}`:`>= -(2${i} ** ${(a+1)*8-1}${i}) and < 2 ** ${(a+1)*8-1}${i}`:`>= ${t}${i} and <= ${r}${i}`,new ec("value",n,e)}V(n,"offset"),(void 0===i[n]||void 0===i[n+a])&&W(n,i.length-(a+1))}function V(e,t){if("number"!=typeof e)throw new ed(t,"number",e)}function W(e,t,r){if(Math.floor(e)!==e)throw V(e,r),new ec(r||"offset","an integer",e);if(t<0)throw new el;throw new ec(r||"offset",`>= ${+!!r} and <= ${t}`,e)}function K(e,t){t=t||1/0;let r,i=e.length,n=null,a=[];for(let s=0;s55295&&r<57344){if(!n){if(r>56319||s+1===i){(t-=3)>-1&&a.push(239,191,189);continue}n=r;continue}if(r<56320){(t-=3)>-1&&a.push(239,191,189),n=r;continue}r=(n-55296<<10|r-56320)+65536}else n&&(t-=3)>-1&&a.push(239,191,189);if(n=null,r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else if(r<1114112){if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}else throw Error("Invalid code point")}return a}function Q(e){return function(e){var t,r,i=function(e){var t=e.length;if(t%4>0)throw Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");-1===r&&(r=t);var i=r===t?0:4-r%4;return[r,i]}(e),n=i[0],a=i[1],s=new Uint8Array((n+a)*3/4-a),o=0,f=a>0?n-4:n;for(r=0;r>16&255,s[o++]=t>>8&255,s[o++]=255&t;return 2===a&&(t=er[e.charCodeAt(r)]<<2|er[e.charCodeAt(r+1)]>>4,s[o++]=255&t),1===a&&(t=er[e.charCodeAt(r)]<<10|er[e.charCodeAt(r+1)]<<4|er[e.charCodeAt(r+2)]>>2,s[o++]=t>>8&255,s[o++]=255&t),s}(function(e){if((e=(e=e.split("=")[0]).trim().replace(ep,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function G(e,t,r,i){let n;for(n=0;n=t.length)&&!(n>=e.length);++n)t[n+r]=e[n];return n}function J(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function Y(e){return typeof BigInt>"u"?X:e}function X(){throw Error("BigInt not supported")}function ee(e){return()=>{throw Error(e+" is not implemented for node:buffer browser polyfill")}}g(b,{transcode:()=>eb,resolveObjectURL:()=>eg,kStringMaxLength:()=>ex,kMaxLength:()=>eM,isUtf8:()=>ev,isAscii:()=>eE,default:()=>ey,constants:()=>eu,btoa:()=>es,atob:()=>eo,INSPECT_MAX_BYTES:()=>e_,File:()=>ef,Buffer:()=>S,Blob:()=>eh});var et,er,ei,en,ea,es,eo,ef,eh,eu,el,ed,ec,ep,em,eg,ev,eb,ey,ew="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e_=50,eM=0x7fffffff,ex=0x1fffffe8,eS=4096,eE=e=>{for(let t of e)if(t.charCodeAt(0)>127)return!1;return!0},ek=v(()=>{for(et=[],er=[],ei=0,en=ew.length;ei0x100000000?n=U(String(r)):"bigint"==typeof r&&(n=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(n=U(n)),n+="n"),i+` It must be ${t}. Received ${n}`},RangeError),Object.defineProperty(S.prototype,"parent",{enumerable:!0,get:function(){if(S.isBuffer(this))return this.buffer}}),Object.defineProperty(S.prototype,"offset",{enumerable:!0,get:function(){if(S.isBuffer(this))return this.byteOffset}}),S.poolSize=8192,S.from=function(e,t,r){return E(e,t,r)},Object.setPrototypeOf(S.prototype,Uint8Array.prototype),Object.setPrototypeOf(S,Uint8Array),S.alloc=function(e,t,r){return(k(e),e<=0)?M(e):void 0!==t?"string"==typeof r?M(e).fill(t,r):M(e).fill(t):M(e)},S.allocUnsafe=function(e){return A(e)},S.allocUnsafeSlow=function(e){return A(e)},S.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==S.prototype},S.compare=function(e,t){if(J(e,Uint8Array)&&(e=S.from(e,e.offset,e.byteLength)),J(t,Uint8Array)&&(t=S.from(t,t.offset,t.byteLength)),!S.isBuffer(e)||!S.isBuffer(t))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,i=t.length;for(let n=0,a=Math.min(r,i);ni.length?(S.isBuffer(t)||(t=S.from(t)),t.copy(i,n)):Uint8Array.prototype.set.call(i,t,n);else if(S.isBuffer(t))t.copy(i,n);else throw TypeError('"list" argument must be an Array of Buffers');n+=t.length}return i},S.byteLength=T,S.prototype._isBuffer=!0,S.prototype.swap16=function(){let e=this.length;if(e%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;te_&&(e+=" ... "),""},ea&&(S.prototype[ea]=S.prototype.inspect),S.prototype.compare=function(e,t,r,i,n){if(J(e,Uint8Array)&&(e=S.from(e,e.offset,e.byteLength)),!S.isBuffer(e))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===i&&(i=0),void 0===n&&(n=this.length),t<0||r>e.length||i<0||n>this.length)throw RangeError("out of range index");if(i>=n&&t>=r)return 0;if(i>=n)return -1;if(t>=r)return 1;if(t>>>=0,r>>>=0,i>>>=0,n>>>=0,this===e)return 0;let a=n-i,s=r-t,o=Math.min(a,s),f=this.slice(i,n),h=e.slice(t,r);for(let e=0;e>>=0,isFinite(r))?(r>>>=0,void 0===i&&(i="utf8")):(i=r,r=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let c=this.length-t;if((void 0===r||r>c)&&(r=c),e.length>0&&(r<0||t<0)||t>this.length)throw RangeError("Attempt to write outside buffer bounds");i||(i="utf8");let p=!1;for(;;)switch(i){case"hex":return function(e,t,r,i){let n;r=Number(r)||0;let a=e.length-r;i?(i=Number(i))>a&&(i=a):i=a;let s=t.length;for(i>s/2&&(i=s/2),n=0;n>8,n.push(r%256),n.push(i);return n}(e,this.length-u),this,u,d);default:if(p)throw TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),p=!0}},S.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},S.prototype.slice=function(e,t){let r=this.length;(e=~~e,t=void 0===t?r:~~t,e<0)?(e+=r)<0&&(e=0):e>r&&(e=r),t<0?(t+=r)<0&&(t=0):t>r&&(t=r),t>>=0,t>>>=0,r||L(e,t,this.length);let i=this[e],n=1,a=0;for(;++a>>=0,t>>>=0,r||L(e,t,this.length);let i=this[e+--t],n=1;for(;t>0&&(n*=256);)i+=this[e+--t]*n;return i},S.prototype.readUint8=S.prototype.readUInt8=function(e,t){return e>>>=0,t||L(e,1,this.length),this[e]},S.prototype.readUint16LE=S.prototype.readUInt16LE=function(e,t){return e>>>=0,t||L(e,2,this.length),this[e]|this[e+1]<<8},S.prototype.readUint16BE=S.prototype.readUInt16BE=function(e,t){return e>>>=0,t||L(e,2,this.length),this[e]<<8|this[e+1]},S.prototype.readUint32LE=S.prototype.readUInt32LE=function(e,t){return e>>>=0,t||L(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+0x1000000*this[e+3]},S.prototype.readUint32BE=S.prototype.readUInt32BE=function(e,t){return e>>>=0,t||L(e,4,this.length),0x1000000*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},S.prototype.readBigUInt64LE=Y(function(e){V(e>>>=0,"offset");let t=this[e],r=this[e+7];(void 0===t||void 0===r)&&W(e,this.length-8);let i=t+256*this[++e]+65536*this[++e]+0x1000000*this[++e],n=this[++e]+256*this[++e]+65536*this[++e]+0x1000000*r;return BigInt(i)+(BigInt(n)<>>=0,"offset");let t=this[e],r=this[e+7];(void 0===t||void 0===r)&&W(e,this.length-8);let i=0x1000000*t+65536*this[++e]+256*this[++e]+this[++e],n=0x1000000*this[++e]+65536*this[++e]+256*this[++e]+r;return(BigInt(i)<>>=0,t>>>=0,r||L(e,t,this.length);let i=this[e],n=1,a=0;for(;++a=(n*=128)&&(i-=Math.pow(2,8*t)),i},S.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||L(e,t,this.length);let i=t,n=1,a=this[e+--i];for(;i>0&&(n*=256);)a+=this[e+--i]*n;return a>=(n*=128)&&(a-=Math.pow(2,8*t)),a},S.prototype.readInt8=function(e,t){return(e>>>=0,t||L(e,1,this.length),128&this[e])?-((255-this[e]+1)*1):this[e]},S.prototype.readInt16LE=function(e,t){e>>>=0,t||L(e,2,this.length);let r=this[e]|this[e+1]<<8;return 32768&r?0xffff0000|r:r},S.prototype.readInt16BE=function(e,t){e>>>=0,t||L(e,2,this.length);let r=this[e+1]|this[e]<<8;return 32768&r?0xffff0000|r:r},S.prototype.readInt32LE=function(e,t){return e>>>=0,t||L(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},S.prototype.readInt32BE=function(e,t){return e>>>=0,t||L(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},S.prototype.readBigInt64LE=Y(function(e){V(e>>>=0,"offset");let t=this[e],r=this[e+7];return(void 0===t||void 0===r)&&W(e,this.length-8),(BigInt(this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24))<>>=0,"offset");let t=this[e],r=this[e+7];return(void 0===t||void 0===r)&&W(e,this.length-8),(BigInt((t<<24)+65536*this[++e]+256*this[++e]+this[++e])<>>=0,t||L(e,4,this.length),w(this,e,!0,23,4)},S.prototype.readFloatBE=function(e,t){return e>>>=0,t||L(e,4,this.length),w(this,e,!1,23,4)},S.prototype.readDoubleLE=function(e,t){return e>>>=0,t||L(e,8,this.length),w(this,e,!0,52,8)},S.prototype.readDoubleBE=function(e,t){return e>>>=0,t||L(e,8,this.length),w(this,e,!1,52,8)},S.prototype.writeUintLE=S.prototype.writeUIntLE=function(e,t,r,i){if(e*=1,t>>>=0,r>>>=0,!i){let i=Math.pow(2,8*r)-1;$(this,e,t,r,i,0)}let n=1,a=0;for(this[t]=255&e;++a>>=0,r>>>=0,!i){let i=Math.pow(2,8*r)-1;$(this,e,t,r,i,0)}let n=r-1,a=1;for(this[t+n]=255&e;--n>=0&&(a*=256);)this[t+n]=e/a&255;return t+r},S.prototype.writeUint8=S.prototype.writeUInt8=function(e,t,r){return e*=1,t>>>=0,r||$(this,e,t,1,255,0),this[t]=255&e,t+1},S.prototype.writeUint16LE=S.prototype.writeUInt16LE=function(e,t,r){return e*=1,t>>>=0,r||$(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},S.prototype.writeUint16BE=S.prototype.writeUInt16BE=function(e,t,r){return e*=1,t>>>=0,r||$(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},S.prototype.writeUint32LE=S.prototype.writeUInt32LE=function(e,t,r){return e*=1,t>>>=0,r||$(this,e,t,4,0xffffffff,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},S.prototype.writeUint32BE=S.prototype.writeUInt32BE=function(e,t,r){return e*=1,t>>>=0,r||$(this,e,t,4,0xffffffff,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},S.prototype.writeBigUInt64LE=Y(function(e,t=0){return q(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),S.prototype.writeBigUInt64BE=Y(function(e,t=0){return B(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),S.prototype.writeIntLE=function(e,t,r,i){if(e*=1,t>>>=0,!i){let i=Math.pow(2,8*r-1);$(this,e,t,r,i-1,-i)}let n=0,a=1,s=0;for(this[t]=255&e;++n>>=0,!i){let i=Math.pow(2,8*r-1);$(this,e,t,r,i-1,-i)}let n=r-1,a=1,s=0;for(this[t+n]=255&e;--n>=0&&(a*=256);)e<0&&0===s&&0!==this[t+n+1]&&(s=1),this[t+n]=(e/a|0)-s&255;return t+r},S.prototype.writeInt8=function(e,t,r){return e*=1,t>>>=0,r||$(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},S.prototype.writeInt16LE=function(e,t,r){return e*=1,t>>>=0,r||$(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},S.prototype.writeInt16BE=function(e,t,r){return e*=1,t>>>=0,r||$(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},S.prototype.writeInt32LE=function(e,t,r){return e*=1,t>>>=0,r||$(this,e,t,4,0x7fffffff,-0x80000000),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},S.prototype.writeInt32BE=function(e,t,r){return e*=1,t>>>=0,r||$(this,e,t,4,0x7fffffff,-0x80000000),e<0&&(e=0xffffffff+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},S.prototype.writeBigInt64LE=Y(function(e,t=0){return q(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),S.prototype.writeBigInt64BE=Y(function(e,t=0){return B(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),S.prototype.writeFloatLE=function(e,t,r){return z(this,e,t,!0,r)},S.prototype.writeFloatBE=function(e,t,r){return z(this,e,t,!1,r)},S.prototype.writeDoubleLE=function(e,t,r){return Z(this,e,t,!0,r)},S.prototype.writeDoubleBE=function(e,t,r){return Z(this,e,t,!1,r)},S.prototype.copy=function(e,t,r,i){if(!S.isBuffer(e))throw TypeError("argument should be a Buffer");if(r||(r=0),i||0===i||(i=this.length),t>=e.length&&(t=e.length),t||(t=0),i>0&&i=this.length)throw RangeError("Index out of range");if(i<0)throw RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-t>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(n=t;n=n)return e;switch(e){case"%s":return String(t[i++]);case"%d":return Number(t[i++]);case"%j":try{return JSON.stringify(t[i++])}catch(e){return"[Circular]"}default:return e}}),s=t[i];i"u"||n?.noDeprecation===!0)return e;var r=!1;return function(...i){if(!r){if(n.throwDeprecation)throw Error(t);n.traceDeprecation?console.trace(t):console.error(t),r=!0}return e.apply(this,...i)}}function eI(e,t){var r=e9.styles[t];return r?"\x1b["+e9.colors[r][0]+"m"+e+"\x1b["+e9.colors[r][1]+"m":e}function eT(e,t){return e}function ej(e,t,r){if(e.customInspect&&t&&eW(t.inspect)&&t.inspect!==e9&&!(t.constructor&&t.constructor.prototype===t)){var i,n,a,s,o,f,h=t.inspect(r,e);return eB(h)||(h=ej(e,h,r)),h}var u=function(e,t){if(ez(t))return e.stylize("undefined","undefined");if(eB(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}return eq(t)?e.stylize(""+t,"number"):eD(t)?e.stylize(""+t,"boolean"):eL(t)?e.stylize("null","null"):void 0}(e,t);if(u)return u;var d=Object.keys(t),c=(o={},d.forEach(function(e,t){o[e]=!0}),o);if(e.showHidden&&(d=Object.getOwnPropertyNames(t)),eV(t)&&(d.indexOf("message")>=0||d.indexOf("description")>=0))return eO(t);if(0===d.length){if(eW(t)){var p=t.name?": "+t.name:"";return e.stylize("[Function"+p+"]","special")}if(eZ(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(eH(t))return e.stylize(Date.prototype.toString.call(t),"date");if(eV(t))return eO(t)}var m="",g=!1,v=["{","}"];if(eN(t)&&(g=!0,v=["[","]"]),eW(t)&&(m=" [Function"+(t.name?": "+t.name:"")+"]"),eZ(t)&&(m=" "+RegExp.prototype.toString.call(t)),eH(t)&&(m=" "+Date.prototype.toUTCString.call(t)),eV(t)&&(m=" "+eO(t)),0===d.length&&(!g||0==t.length))return v[0]+m+v[1];if(r<0)if(eZ(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");else return e.stylize("[Object]","special");return e.seen.push(t),f=g?function(e,t,r,i,n){for(var a=[],s=0,o=t.length;s=0&&s++,e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?a[0]+(""===n?"":n+` `)+" "+i.join(`, `)+" "+a[1]:a[0]+n+" "+i.join(", ")+" "+a[1]}function eO(e){return"["+Error.prototype.toString.call(e)+"]"}function eC(e,t,r,i,n,a){var s,o,f;if((f=Object.getOwnPropertyDescriptor(t,n)||{value:t[n]}).get?o=f.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):f.set&&(o=e.stylize("[Setter]","special")),e1(i,n)||(s="["+n+"]"),!o&&(0>e.seen.indexOf(f.value)?(o=eL(r)?ej(e,f.value,null):ej(e,f.value,r-1)).indexOf(` `)>-1&&(o=a?o.split(` `).map(function(e){return" "+e}).join(` `).slice(2):` `+o.split(` `).map(function(e){return" "+e}).join(` `)):o=e.stylize("[Circular]","special")),ez(s)){if(a&&n.match(/^\d+$/))return o;(s=JSON.stringify(""+n)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.slice(1,-1),s=e.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=e.stylize(s,"string"))}return s+": "+o}function eN(e){return Array.isArray(e)}function eD(e){return"boolean"==typeof e}function eL(e){return null===e}function e$(e){return null==e}function eq(e){return"number"==typeof e}function eB(e){return"string"==typeof e}function eF(e){return"symbol"==typeof e}function ez(e){return void 0===e}function eZ(e){return eU(e)&&"[object RegExp]"===eG(e)}function eU(e){return"object"==typeof e&&null!==e}function eH(e){return eU(e)&&"[object Date]"===eG(e)}function eV(e){return eU(e)&&("[object Error]"===eG(e)||e instanceof Error)}function eW(e){return"function"==typeof e}function eK(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||typeof e>"u"}function eQ(e){return e instanceof a}function eG(e){return Object.prototype.toString.call(e)}function eJ(e){return e<10?"0"+e.toString(10):e.toString(10)}function eY(...e){var t,r;console.log("%s - %s",(r=[eJ((t=new Date).getHours()),eJ(t.getMinutes()),eJ(t.getSeconds())].join(":"),[t.getDate(),e5[t.getMonth()],r].join(" ")),eP.apply(null,e))}function eX(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}function e0(e,t){if(!t||!eU(t))return e;for(var r=Object.keys(t),i=r.length;i--;)e[r[i]]=t[r[i]];return e}function e1(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function e2(e,t){if(!e){var r=Error("Promise was rejected with a falsy value");r.reason=e,e=r}return t(e)}function e3(e){if("function"!=typeof e)throw TypeError('The "original" argument must be of type Function');function t(...r){var i=r.pop();if("function"!=typeof i)throw TypeError("The last argument must be of type Function");var a=this,s=function(...e){return i.apply(a,...e)};e.apply(this,r).then(function(e){n.nextTick(s.bind(null,null,e))},function(e){n.nextTick(e2.bind(null,e,s))})}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),Object.defineProperties(t,Object.getOwnPropertyDescriptors(e)),t}g(eA,{types:()=>tr,promisify:()=>e8,log:()=>eY,isUndefined:()=>ez,isSymbol:()=>eF,isString:()=>eB,isRegExp:()=>eZ,isPrimitive:()=>eK,isObject:()=>eU,isNumber:()=>eq,isNullOrUndefined:()=>e$,isNull:()=>eL,isFunction:()=>eW,isError:()=>eV,isDate:()=>eH,isBuffer:()=>eQ,isBoolean:()=>eD,isArray:()=>eN,inspect:()=>e9,inherits:()=>eX,format:()=>eP,deprecate:()=>eR,default:()=>tt,debuglog:()=>e4,callbackifyOnRejected:()=>e2,callbackify:()=>e3,_extend:()=>e0,TextEncoder:()=>e7,TextDecoder:()=>te});var e6,e4,e9,e5,e8,e7,te,tt,tr=()=>{},ti=v(()=>{e6=/%[sdj%]/g,e4=((e={},t={},r)=>(t=RegExp("^"+("u">typeof n&&!1)+"$","i"),r=>(e[r=r.toUpperCase()]||(t.test(r)?e[r]=function(...e){console.error("%s: %s",r,pid,eP.apply(null,...e))}:e[r]=function(){}),e[r])))(),e9=(e=>(e.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]},e.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},e.custom=Symbol.for("nodejs.util.inspect.custom"),e))(function(e,t,...r){var i={seen:[],stylize:eT};return r.length>=1&&(i.depth=r[0]),r.length>=2&&(i.colors=r[1]),eD(t)?i.showHidden=t:t&&e0(i,t),ez(i.showHidden)&&(i.showHidden=!1),ez(i.depth)&&(i.depth=2),ez(i.colors)&&(i.colors=!1),i.colors&&(i.stylize=eI),ej(i,e,i.depth)}),e5=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],e8=(e=>(e.custom=Symbol.for("nodejs.util.promisify.custom"),e))(function(e){if("function"!=typeof e)throw TypeError('The "original" argument must be of type Function');if(kCustomPromisifiedSymbol&&e[kCustomPromisifiedSymbol]){var t=e[kCustomPromisifiedSymbol];if("function"!=typeof t)throw TypeError('The "nodejs.util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,kCustomPromisifiedSymbol,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(...r){var i,n,a=new Promise(function(e,t){i=e,n=t});r.push(function(e,t){e?n(e):i(t)});try{e.apply(this,r)}catch(e){n(e)}return a}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),kCustomPromisifiedSymbol&&Object.defineProperty(t,kCustomPromisifiedSymbol,{value:t,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(t,Object.getOwnPropertyDescriptors(e))}),({TextEncoder:e7,TextDecoder:te}=globalThis),tt={TextEncoder:e7,TextDecoder:te,promisify:e8,log:eY,inherits:eX,_extend:e0,callbackifyOnRejected:e2,callbackify:e3}}),tn={};function ta(e,t){var{_events:r}=e;if(t[0]??=Error("Unhandled error."),!r)throw t[0];var i=r[tM];if(i)for(var n of tA.call(i))n.apply(e,t);var a=r.error;if(!a)throw t[0];for(var n of tA.call(a))n.apply(e,t);return!0}function ts(e,t,r){r.warned=!0;let i=Error(`Possible EventEmitter memory leak detected. ${r.length} ${String(t)} listeners added to [${e.constructor.name}]. Use emitter.setMaxListeners() to increase limit`);i.name="MaxListenersExceededWarning",i.emitter=e,i.type=t,i.count=r.length,console.warn(i)}function to(e,t,...r){this.removeListener(e,t),t.apply(this,r)}function tf(e,t,r){var i=r?.signal;if(tm(i,"options.signal"),i?.aborted)throw new tR(void 0,{cause:i?.reason});let{resolve:n,reject:a,promise:s}=$newPromiseCapability(Promise),o=r=>{e.removeListener(t,f),null!=i&&td(i,"abort",h),a(r)},f=(...t)=>{"function"==typeof e.removeListener&&e.removeListener("error",o),null!=i&&td(i,"abort",h),n(t)};function h(){td(e,t,f),td(e,"error",o),a(new tR(void 0,{cause:i?.reason}))}return tc(e,t,f,{once:!0}),"error"!==t&&"function"==typeof e.once&&e.once("error",o),null!=i&&tc(i,"abort",h,{once:!0}),s}function th(e,t){return e.listeners(t)}function tu(e,...t){var r;if(tg(e,"setMaxListeners",0),t&&(r=t.length))for(let i=0;ii||(null!=r||null!=i)&&Number.isNaN(e)){var n;let a;throw n=`${null!=r?`>= ${r}`:""}${null!=r&&null!=i?" && ":""}${null!=i?`<= ${i}`:""}`,(a=RangeError(`The "${t}" argument is out of range. It must be ${n}. Received ${e}`)).code="ERR_OUT_OF_RANGE",a}}function tv(e){if("function"!=typeof e)throw TypeError("The listener must be a function")}function tb(e){return e?._maxListeners??tT}function ty(e,t){let r;if(void 0===e)throw tp("signal","AbortSignal",e);if(tm(e,"signal"),"function"!=typeof t)throw tp("listener","function",t);return e.aborted?queueMicrotask(()=>t()):(e.addEventListener("abort",t,{__proto__:null,once:!0}),r=()=>{e.removeEventListener("abort",t)}),{__proto__:null,[Symbol.dispose](){r?.()}}}g(tn,{setMaxListeners:()=>tu,once:()=>tf,listenerCount:()=>tl,init:()=>tj,getMaxListeners:()=>tb,getEventListeners:()=>th,default:()=>tI,captureRejectionSymbol:()=>tk,addAbortListener:()=>ty,EventEmitter:()=>tj});var tw,t_,tM,tx,tS,tE,tk,tA,tP,tR,tI,tT=10,tj=function(e){(void 0===this._events||this._events===this.__proto__._events)&&(this._events={__proto__:null},this._eventsCount=0),this._maxListeners??=void 0,(this[t_]=e?.captureRejections?!!e?.captureRejections:tP[t_])&&(this.emit=tC)},tO=function(e,...t){if("error"===e)return ta(this,t);var{_events:r}=this;if(void 0===r)return!1;var i=r[e];if(void 0===i)return!1;let n=i.length>1?i.slice():i;for(let e=0,{length:r}=n;e1?i.slice():i;for(let r=0,{length:i}=n;r(function(e,t,r,i){if("function"==typeof e[tE])e[tE](t,r,...i);else try{e[t_]=!1,e.emit("error",t)}finally{e[t_]=!0}})(e,t,r,i))})}(this,a,e,t)}return!0},tN=v(()=>{tw=Symbol.for,t_=Symbol("kCapture"),tM=tw("events.errorMonitor"),tx=Symbol("events.maxEventTargetListeners"),tS=Symbol("events.maxEventTargetListenersWarned"),tE=tw("nodejs.rejection"),tk=tw("nodejs.rejection"),tA=Array.prototype.slice,(tP=tj.prototype={})._events=void 0,tP._eventsCount=0,tP._maxListeners=void 0,tP.setMaxListeners=function(e){return tg(e,"setMaxListeners",0),this._maxListeners=e,this},tP.constructor=tj,tP.getMaxListeners=function(){return this?._maxListeners??tT},tP.emit=tO,tP.addListener=function(e,t){tv(t);var r=this._events;r?r.newListener&&this.emit("newListener",e,t.listener??t):(r=this._events={__proto__:null},this._eventsCount=0);var i=r[e];if(i){i.push(t);var n=this._maxListeners??tT;n>0&&i.length>n&&!i.warned&&ts(this,e,i)}else r[e]=[t],this._eventsCount++;return this},tP.on=tP.addListener,tP.prependListener=function(e,t){tv(t);var r=this._events;r?r.newListener&&this.emit("newListener",e,t.listener??t):(r=this._events={__proto__:null},this._eventsCount=0);var i=r[e];if(i){i.unshift(t);var n=this._maxListeners??tT;n>0&&i.length>n&&!i.warned&&ts(this,e,i)}else r[e]=[t],this._eventsCount++;return this},tP.once=function(e,t){tv(t);let r=to.bind(this,e,t);return r.listener=t,this.addListener(e,r),this},tP.prependOnceListener=function(e,t){tv(t);let r=to.bind(this,e,t);return r.listener=t,this.prependListener(e,r),this},tP.removeListener=function(e,t){tv(t);var{_events:r}=this;if(!r)return this;var i=r[e];if(!i)return this;var n=i.length;let a=-1;for(let e=n-1;e>=0;e--)if(i[e]===t||i[e].listener===t){a=e;break}return a<0||(0===a?i.shift():i.splice(a,1),0===i.length&&(delete r[e],this._eventsCount--)),this},tP.off=tP.removeListener,tP.removeAllListeners=function(e){var{_events:t}=this;return e&&t?t[e]&&(delete t[e],this._eventsCount--):this._events={__proto__:null},this},tP.listeners=function(e){var{_events:t}=this;if(!t)return[];var r=t[e];return r?r.map(e=>e.listener??e):[]},tP.rawListeners=function(e){var{_events:t}=this;if(!t)return[];var r=t[e];return r?r.slice():[]},tP.listenerCount=function(e){var{_events:t}=this;return t?t[e]?.length??0:0},tP.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]},tP[t_]=!1,tR=class extends Error{constructor(e="The operation was aborted",t){if(void 0!==t&&"object"!=typeof t)throw tp("options","Object",t);super(e,t),this.code="ABORT_ERR",this.name="AbortError"}},Object.defineProperties(tj,{captureRejections:{get:()=>tP[t_],set(e){(function(e,t){if("boolean"!=typeof e)throw tp(t,"boolean",e)})(e,"EventEmitter.captureRejections"),tP[t_]=e},enumerable:!0},defaultMaxListeners:{enumerable:!0,get:()=>tT,set:e=>{tg(e,"defaultMaxListeners",0),tT=e}},kMaxEventTargetListeners:{value:tx,enumerable:!1,configurable:!1,writable:!1},kMaxEventTargetListenersWarned:{value:tS,enumerable:!1,configurable:!1,writable:!1}}),Object.assign(tj,{once:tf,getEventListeners:th,getMaxListeners:tb,setMaxListeners:tu,EventEmitter:tj,usingDomains:!1,captureRejectionSymbol:tk,errorMonitor:tM,addAbortListener:ty,init:tj,listenerCount:tl}),tI=tj}),tD=m((e,t)=>{var r=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),i=r((e,t)=>{class r extends Error{constructor(e){if(!Array.isArray(e))throw TypeError(`Expected input to be an Array, got ${typeof e}`);let t="";for(let r=0;rArray.isArray(e),ArrayPrototypeIncludes:(e,t)=>e.includes(t),ArrayPrototypeIndexOf:(e,t)=>e.indexOf(t),ArrayPrototypeJoin:(e,t)=>e.join(t),ArrayPrototypeMap:(e,t)=>e.map(t),ArrayPrototypePop:(e,t)=>e.pop(t),ArrayPrototypePush:(e,t)=>e.push(t),ArrayPrototypeSlice:(e,t,r)=>e.slice(t,r),Error,FunctionPrototypeCall:(e,t,...r)=>e.call(t,...r),FunctionPrototypeSymbolHasInstance:(e,t)=>Function.prototype[Symbol.hasInstance].call(e,t),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:(e,t)=>Object.defineProperties(e,t),ObjectDefineProperty:(e,t,r)=>Object.defineProperty(e,t,r),ObjectGetOwnPropertyDescriptor:(e,t)=>Object.getOwnPropertyDescriptor(e,t),ObjectKeys:e=>Object.keys(e),ObjectSetPrototypeOf:(e,t)=>Object.setPrototypeOf(e,t),Promise,PromisePrototypeCatch:(e,t)=>e.catch(t),PromisePrototypeThen:(e,t,r)=>e.then(t,r),PromiseReject:e=>Promise.reject(e),PromiseResolve:e=>Promise.resolve(e),ReflectApply:Reflect.apply,RegExpPrototypeTest:(e,t)=>e.test(t),SafeSet:Set,String,StringPrototypeSlice:(e,t,r)=>e.slice(t,r),StringPrototypeToLowerCase:e=>e.toLowerCase(),StringPrototypeToUpperCase:e=>e.toUpperCase(),StringPrototypeTrim:e=>e.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:(e,t,r)=>e.set(t,r),Boolean,Uint8Array}}),n=r((e,t)=>{t.exports={format:(e,...t)=>e.replace(/%([sdifj])/g,function(...[e,r]){let i=t.shift();return"f"===r?i.toFixed(6):"j"===r?JSON.stringify(i):"s"===r&&"object"==typeof i?`${i.constructor!==Object?i.constructor.name:""} {}`.trim():i.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";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"{}"}}}}),a=r((e,t)=>{var{format:r,inspect:a}=n(),{AggregateError:s}=i(),o=globalThis.AggregateError||s,f=Symbol("kIsNodeError"),h=["string","function","number","object","Function","Object","boolean","bigint","symbol"],u=/^([A-Z][a-z0-9]*)+$/,d={};function c(e,t){if(!e)throw new d.ERR_INTERNAL_ASSERTION(t)}function p(e){let t="",r=e.length,i=+("-"===e[0]);for(;r>=i+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function m(e,t,i){i||(i=Error);class n extends i{constructor(...i){super(function(e,t,i){if("function"==typeof t)return c(t.length<=i.length,`Code: ${e}; The provided arguments length (${i.length}) does not match the required ones (${t.length}).`),t(...i);let n=(t.match(/%[dfijoOs]/g)||[]).length;return(c(n===i.length,`Code: ${e}; The provided arguments length (${i.length}) does not match the required ones (${n}).`),0===i.length)?t:r(t,...i)}(e,t,i))}toString(){return`${this.name} [${e}]: ${this.message}`}}Object.defineProperties(n.prototype,{name:{value:i.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${e}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),n.prototype.code=e,n.prototype[f]=!0,d[e]=n}function g(e){let t="__node_internal_"+e.name;return Object.defineProperty(e,"name",{value:t}),e}class v extends Error{constructor(e="The operation was aborted",t){if(void 0!==t&&"object"!=typeof t)throw new d.ERR_INVALID_ARG_TYPE("options","Object",t);super(e,t),this.code="ABORT_ERR",this.name="AbortError"}}m("ERR_ASSERTION","%s",Error),m("ERR_INVALID_ARG_TYPE",(e,t,r)=>{c("string"==typeof e,"'name' must be a string"),Array.isArray(t)||(t=[t]);let i="The ";e.endsWith(" argument")?i+=`${e} `:i+=`"${e}" ${e.includes(".")?"property":"argument"} `,i+="must be ";let n=[],s=[],o=[];for(let e of t)(c("string"==typeof e,"All expected entries have to be of type string"),h.includes(e))?n.push(e.toLowerCase()):u.test(e)?s.push(e):(c("object"!==e,'The value "object" should be written as "Object"'),o.push(e));if(s.length>0){let e=n.indexOf("object");-1!==e&&(n.splice(n,e,1),s.push("Object"))}if(n.length>0){switch(n.length){case 1:i+=`of type ${n[0]}`;break;case 2:i+=`one of type ${n[0]} or ${n[1]}`;break;default:{let e=n.pop();i+=`one of type ${n.join(", ")}, or ${e}`}}(s.length>0||o.length>0)&&(i+=" or ")}if(s.length>0){switch(s.length){case 1:i+=`an instance of ${s[0]}`;break;case 2:i+=`an instance of ${s[0]} or ${s[1]}`;break;default:{let e=s.pop();i+=`an instance of ${s.join(", ")}, or ${e}`}}o.length>0&&(i+=" or ")}switch(o.length){case 0:break;case 1:o[0].toLowerCase()!==o[0]&&(i+="an "),i+=`${o[0]}`;break;case 2:i+=`one of ${o[0]} or ${o[1]}`;break;default:{let e=o.pop();i+=`one of ${o.join(", ")}, or ${e}`}}if(null==r)i+=`. Received ${r}`;else if("function"==typeof r&&r.name)i+=`. Received function ${r.name}`;else if("object"==typeof r){var f;if(null!=(f=r.constructor)&&f.name)i+=`. Received an instance of ${r.constructor.name}`;else{let e=a(r,{depth:-1});i+=`. Received ${e}`}}else{let e=a(r,{colors:!1});e.length>25&&(e=`${e.slice(0,25)}...`),i+=`. Received type ${typeof r} (${e})`}return i},TypeError),m("ERR_INVALID_ARG_VALUE",(e,t,r="is invalid")=>{let i=a(t);return i.length>128&&(i=i.slice(0,128)+"..."),`The ${e.includes(".")?"property":"argument"} '${e}' ${r}. Received ${i}`},TypeError),m("ERR_INVALID_RETURN_VALUE",(e,t,r)=>{var i;let n=null!=r&&null!=(i=r.constructor)&&i.name?`instance of ${r.constructor.name}`:`type ${typeof r}`;return`Expected ${e} to be returned from the "${t}" function but got ${n}.`},TypeError),m("ERR_MISSING_ARGS",(...e)=>{c(e.length>0,"At least one arg needs to be specified");let t,r=e.length;switch(e=(Array.isArray(e)?e:[e]).map(e=>`"${e}"`).join(" or "),r){case 1:t+=`The ${e[0]} argument`;break;case 2:t+=`The ${e[0]} and ${e[1]} arguments`;break;default:{let r=e.pop();t+=`The ${e.join(", ")}, and ${r} arguments`}}return`${t} must be specified`},TypeError),m("ERR_OUT_OF_RANGE",(e,t,r)=>{let i;if(c(t,'Missing "range" argument'),Number.isInteger(r)&&Math.abs(r)>0x100000000)i=p(String(r));else if("bigint"==typeof r){i=String(r);let e=BigInt(2)**BigInt(32);(r>e||r<-e)&&(i=p(i)),i+="n"}else i=a(r);return`The value of "${e}" is out of range. It must be ${t}. Received ${i}`},RangeError),m("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error),m("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error),m("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error),m("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error),m("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error),m("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),m("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error),m("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error),m("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error),m("ERR_STREAM_WRITE_AFTER_END","write after end",Error),m("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError),t.exports={AbortError:v,aggregateTwoErrors:g(function(e,t){if(e&&t&&e!==t){if(Array.isArray(t.errors))return t.errors.push(e),t;let r=new o([t,e],t.message);return r.code=t.code,r}return e||t}),hideStackFrames:g,codes:d}}),s=r((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0});var r=new WeakMap,i=new WeakMap;function n(e){let t=r.get(e);return console.assert(null!=t,"'this' is expected an Event object, but got",e),t}function a(e){if(null!=e.passiveListener){"u">typeof console&&"function"==typeof console.error&&console.error("Unable to preventDefault inside passive event listener invocation.",e.passiveListener);return}e.event.cancelable&&(e.canceled=!0,"function"==typeof e.event.preventDefault&&e.event.preventDefault())}function s(e,t){r.set(this,{eventTarget:e,event:t,eventPhase:2,currentTarget:e,canceled:!1,stopped:!1,immediateStopped:!1,passiveListener:null,timeStamp:t.timeStamp||Date.now()}),Object.defineProperty(this,"isTrusted",{value:!1,enumerable:!0});let i=Object.keys(t);for(let e=0;etypeof window&&"u">typeof window.Event&&(Object.setPrototypeOf(s.prototype,window.Event.prototype),i.set(window.Event.prototype,s));var h=new WeakMap;function u(e){return null!==e&&"object"==typeof e}function d(e){let t=h.get(e);if(null==t)throw TypeError("'this' is expected an EventTarget object, but got another value.");return t}function c(e,t){Object.defineProperty(e,`on${t}`,{get(){let e=d(this).get(t);for(;null!=e;){if(3===e.listenerType)return e.listener;e=e.next}return null},set(e){"function"==typeof e||u(e)||(e=null);let r=d(this),i=null,n=r.get(t);for(;null!=n;)3===n.listenerType?null!==i?i.next=n.next:null!==n.next?r.set(t,n.next):r.delete(t):i=n,n=n.next;if(null!==e){let n={listener:e,listenerType:3,passive:!1,once:!1,next:null};null===i?r.set(t,n):i.next=n}},configurable:!0,enumerable:!0})}function p(e){function t(){m.call(this)}t.prototype=Object.create(m.prototype,{constructor:{value:t,configurable:!0,writable:!0}});for(let r=0;r0){let e=Array(arguments.length);for(let t=0;ttypeof console&&"function"==typeof console.error&&console.error(e)}else 3!==a.listenerType&&"function"==typeof a.listener.handleEvent&&a.listener.handleEvent(h);if(n(h).immediateStopped)break;a=a.next}return f(h,null),n(h).eventPhase=0,n(h).currentTarget=null,!h.defaultPrevented}},Object.defineProperty(m.prototype,"constructor",{value:m,configurable:!0,writable:!0}),"u">typeof window&&"u">typeof window.EventTarget&&Object.setPrototypeOf(m.prototype,window.EventTarget.prototype),e.defineEventAttribute=c,e.EventTarget=m,e.default=m,t.exports=m,t.exports.EventTarget=t.exports.default=m,t.exports.defineEventAttribute=c}),o=r((e,t)=>{Object.defineProperty(e,"__esModule",{value:!0});var r=s();class i extends r.EventTarget{constructor(){throw super(),TypeError("AbortSignal cannot be constructed directly")}get aborted(){let e=n.get(this);if("boolean"!=typeof e)throw TypeError(`Expected 'this' to be an 'AbortSignal' object, but got ${this===null?"null":typeof this}`);return e}}r.defineEventAttribute(i.prototype,"abort");var n=new WeakMap;Object.defineProperties(i.prototype,{aborted:{enumerable:!0}}),"function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag&&Object.defineProperty(i.prototype,Symbol.toStringTag,{configurable:!0,value:"AbortSignal"});class a{constructor(){o.set(this,function(){let e=Object.create(i.prototype);return r.EventTarget.call(e),n.set(e,!1),e}())}get signal(){return f(this)}abort(){var e;e=f(this),!1===n.get(e)&&(n.set(e,!0),e.dispatchEvent({type:"abort"}))}}var o=new WeakMap;function f(e){let t=o.get(e);if(null==t)throw TypeError(`Expected 'this' to be an 'AbortController' object, but got ${null===e?"null":typeof e}`);return t}Object.defineProperties(a.prototype,{signal:{enumerable:!0},abort:{enumerable:!0}}),"function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag&&Object.defineProperty(a.prototype,Symbol.toStringTag,{configurable:!0,value:"AbortController"}),e.AbortController=a,e.AbortSignal=i,e.default=a,t.exports=a,t.exports.AbortController=t.exports.default=a,t.exports.AbortSignal=i}),f=r((e,t)=>{var r=(ek(),p(b)),{format:s,inspect:f}=n(),{codes:{ERR_INVALID_ARG_TYPE:h}}=a(),{kResistStopPropagation:u,AggregateError:d,SymbolDispose:c}=i(),m=globalThis.AbortSignal||o().AbortSignal,g=globalThis.AbortController||o().AbortController,v=Object.getPrototypeOf(async function(){}).constructor,y=globalThis.Blob||r.Blob,w=(e,t)=>{if(void 0!==e&&(null===e||"object"!=typeof e||!("aborted"in e)))throw new h(t,"AbortSignal",e)};t.exports={AggregateError:d,kEmptyObject:Object.freeze({}),once(e){let t=!1;return function(...r){t||(t=!0,e.apply(this,r))}},createDeferredPromise:function(){let e,t;return{promise:new Promise((r,i)=>{e=r,t=i}),resolve:e,reject:t}},promisify:e=>new Promise((t,r)=>{e((e,...i)=>e?r(e):t(...i))}),debuglog:()=>function(){},format:s,inspect:f,types:{isAsyncFunction:e=>e instanceof v,isArrayBufferView:e=>ArrayBuffer.isView(e)},isBlob:"u">typeof y?function(e){return e instanceof y}:function(e){return!1},deprecate:(e,t)=>e,addAbortListener:(tN(),p(tn)).addAbortListener||function(e,t){let r;if(void 0===e)throw new h("signal","AbortSignal",e);return w(e,"signal"),((e,t)=>{if("function"!=typeof e)throw new h(t,"Function",e)})(t,"listener"),e.aborted?queueMicrotask(()=>t()):(e.addEventListener("abort",t,{__proto__:null,once:!0,[u]:!0}),r=()=>{e.removeEventListener("abort",t)}),{__proto__:null,[c](){var e;null==(e=r)||e()}}},AbortSignalAny:m.any||function(e){if(1===e.length)return e[0];let t=new g,r=()=>t.abort();return e.forEach(e=>{w(e,"signals"),e.addEventListener("abort",r,{once:!0})}),t.signal.addEventListener("abort",()=>{e.forEach(e=>e.removeEventListener("abort",r))},{once:!0}),t.signal}},t.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")}),h=r((e,t)=>{var{ArrayIsArray:r,ArrayPrototypeIncludes:n,ArrayPrototypeJoin:s,ArrayPrototypeMap:o,NumberIsInteger:h,NumberIsNaN:u,NumberMAX_SAFE_INTEGER:d,NumberMIN_SAFE_INTEGER:c,NumberParseInt:p,ObjectPrototypeHasOwnProperty:m,RegExpPrototypeExec:g,String:v,StringPrototypeToUpperCase:b,StringPrototypeTrim:y}=i(),{hideStackFrames:w,codes:{ERR_SOCKET_BAD_PORT:_,ERR_INVALID_ARG_TYPE:M,ERR_INVALID_ARG_VALUE:x,ERR_OUT_OF_RANGE:S,ERR_UNKNOWN_SIGNAL:E}}=a(),{normalizeEncoding:k}=f(),{isAsyncFunction:A,isArrayBufferView:P}=f().types,R={},I=/^[0-7]+$/,T=w((e,t,r=c,i=d)=>{if("number"!=typeof e)throw new M(t,"number",e);if(!h(e))throw new S(t,"an integer",e);if(ei)throw new S(t,`>= ${r} && <= ${i}`,e)}),j=w((e,t,r=-0x80000000,i=0x7fffffff)=>{if("number"!=typeof e)throw new M(t,"number",e);if(!h(e))throw new S(t,"an integer",e);if(ei)throw new S(t,`>= ${r} && <= ${i}`,e)}),O=w((e,t,r=!1)=>{if("number"!=typeof e)throw new M(t,"number",e);if(!h(e))throw new S(t,"an integer",e);let i=+!!r;if(e0xffffffff)throw new S(t,`>= ${i} && <= 4294967295`,e)});function C(e,t){if("string"!=typeof e)throw new M(t,"string",e)}var N=w((e,t,r)=>{if(!n(r,e))throw new x(t,e,"must be one of: "+s(o(r,e=>"string"==typeof e?`'${e}'`:v(e)),", "))});function D(e,t){if("boolean"!=typeof e)throw new M(t,"boolean",e)}function L(e,t,r){return null!=e&&m(e,t)?e[t]:r}var $=w((e,t,i=null)=>{let n=L(i,"allowArray",!1),a=L(i,"allowFunction",!1);if(!L(i,"nullable",!1)&&null===e||!n&&r(e)||"object"!=typeof e&&(!a||"function"!=typeof e))throw new M(t,"Object",e)}),q=w((e,t)=>{if(null!=e&&"object"!=typeof e&&"function"!=typeof e)throw new M(t,"a dictionary",e)}),B=w((e,t,i=0)=>{if(!r(e))throw new M(t,"Array",e);if(e.length{if(!P(e))throw new M(t,["Buffer","TypedArray","DataView"],e)}),z=w((e,t)=>{if(void 0!==e&&(null===e||"object"!=typeof e||!("aborted"in e)))throw new M(t,"AbortSignal",e)}),Z=w((e,t)=>{if("function"!=typeof e)throw new M(t,"Function",e)}),U=w((e,t)=>{if("function"!=typeof e||A(e))throw new M(t,"Function",e)}),H=w((e,t)=>{if(void 0!==e)throw new M(t,"undefined",e)}),V=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function W(e,t){if(typeof e>"u"||!g(V,e))throw new x(t,e,'must be an array or string of format "; rel=preload; as=style"')}t.exports={isInt32:function(e){return e===(0|e)},isUint32:function(e){return e===e>>>0},parseFileMode:function(e,t,r){if(typeof e>"u"&&(e=r),"string"==typeof e){if(null===g(I,e))throw new x(t,e,"must be a 32-bit unsigned integer or an octal string");e=p(e,8)}return O(e,t),e},validateArray:B,validateStringArray:function(e,t){B(e,t);for(let r=0;ri||(null!=r||null!=i)&&u(e))throw new S(t,`${null!=r?`>= ${r}`:""}${null!=r&&null!=i?" && ":""}${null!=i?`<= ${i}`:""}`,e)},validateObject:$,validateOneOf:N,validatePlainFunction:U,validatePort:function(e,t="Port",r=!0){if("number"!=typeof e&&"string"!=typeof e||"string"==typeof e&&0===y(e).length||+e!=e>>>0||e>65535||0===e&&!r)throw new _(t,e,r);return 0|e},validateSignalName:function(e,t="signal"){if(C(e,t),void 0===R[e]){if(void 0!==R[b(e)])throw new E(e+" (signals must use all capital letters)");throw new E(e)}},validateString:C,validateUint32:O,validateUndefined:H,validateUnion:function(e,t,r){if(!n(r,e))throw new M(t,`('${s(r,"|")}')`,e)},validateAbortSignal:z,validateLinkHeaderValue:function(e){if("string"==typeof e)return W(e,"hints"),e;if(r(e)){let t=e.length,r="";if(0===t)return r;for(let i=0;i; rel=preload; as=style"')}}}),u=r((e,t)=>{t.exports=globalThis.process}),d=r((e,t)=>{var{SymbolAsyncIterator:r,SymbolIterator:n,SymbolFor:a}=i(),s=a("nodejs.stream.destroyed"),o=a("nodejs.stream.errored"),f=a("nodejs.stream.readable"),h=a("nodejs.stream.writable"),u=a("nodejs.stream.disturbed");function d(e,t=!1){var r;return!!(e&&"function"==typeof e.pipe&&"function"==typeof e.on&&(!t||"function"==typeof e.pause&&"function"==typeof e.resume)&&(!e._writableState||(null==(r=e._readableState)?void 0:r.readable)!==!1)&&(!e._writableState||e._readableState))}function c(e){var t;return!!(e&&"function"==typeof e.write&&"function"==typeof e.on&&(!e._readableState||(null==(t=e._writableState)?void 0:t.writable)!==!1))}function p(e){return e&&(e._readableState||e._writableState||"function"==typeof e.write&&"function"==typeof e.on||"function"==typeof e.pipe&&"function"==typeof e.on)}function m(e){return!!(e&&!p(e)&&"function"==typeof e.pipeThrough&&"function"==typeof e.getReader&&"function"==typeof e.cancel)}function g(e){return!!(e&&!p(e)&&"function"==typeof e.getWriter&&"function"==typeof e.abort)}function v(e){return!!(e&&!p(e)&&"object"==typeof e.readable&&"object"==typeof e.writable)}function b(e){if(!p(e))return null;let{_writableState:t,_readableState:r}=e,i=t||r;return!!(e.destroyed||e[s]||null!=i&&i.destroyed)}function y(e){if(!c(e))return null;if(!0===e.writableEnded)return!0;let t=e._writableState;return(null==t||!t.errored)&&("boolean"!=typeof(null==t?void 0:t.ended)?null:t.ended)}function w(e,t){if(!d(e))return null;let r=e._readableState;return(null==r||!r.errored)&&("boolean"!=typeof(null==r?void 0:r.endEmitted)?null:!!(r.endEmitted||!1===t&&!0===r.ended&&0===r.length))}function _(e){return e&&null!=e[f]?e[f]:"boolean"!=typeof(null==e?void 0:e.readable)?null:!b(e)&&d(e)&&e.readable&&!w(e)}function M(e){return e&&null!=e[h]?e[h]:"boolean"!=typeof(null==e?void 0:e.writable)?null:!b(e)&&c(e)&&e.writable&&!y(e)}function x(e){return"boolean"==typeof e._closed&&"boolean"==typeof e._defaultKeepAlive&&"boolean"==typeof e._removedConnection&&"boolean"==typeof e._removedContLen}function S(e){return"boolean"==typeof e._sent100&&x(e)}t.exports={isDestroyed:b,kIsDestroyed:s,isDisturbed:function(e){var t;return!!(e&&(null!=(t=e[u])?t:e.readableDidRead||e.readableAborted))},kIsDisturbed:u,isErrored:function(e){var t,r,i,n,a,s,f,h,u,d;return!!(e&&(null!=(t=null!=(r=null!=(i=null!=(n=null!=(a=null!=(s=e[o])?s:e.readableErrored)?a:e.writableErrored)?n:null==(f=e._readableState)?void 0:f.errorEmitted)?i:null==(h=e._writableState)?void 0:h.errorEmitted)?r:null==(u=e._readableState)?void 0:u.errored)?t:null==(d=e._writableState)?void 0:d.errored))},kIsErrored:o,isReadable:_,kIsReadable:f,kIsClosedPromise:a("nodejs.webstream.isClosedPromise"),kControllerErrorFunction:a("nodejs.webstream.controllerErrorFunction"),kIsWritable:h,isClosed:function(e){if(!p(e))return null;if("boolean"==typeof e.closed)return e.closed;let{_writableState:t,_readableState:r}=e;return"boolean"==typeof(null==t?void 0:t.closed)||"boolean"==typeof(null==r?void 0:r.closed)?(null==t?void 0:t.closed)||(null==r?void 0:r.closed):"boolean"==typeof e._closed&&x(e)?e._closed:null},isDuplexNodeStream:function(e){return!!(e&&"function"==typeof e.pipe&&e._readableState&&"function"==typeof e.on&&"function"==typeof e.write)},isFinished:function(e,t){return p(e)?!!b(e)||!((null==t?void 0:t.readable)!==!1&&_(e)||(null==t?void 0:t.writable)!==!1&&M(e)):null},isIterable:function(e,t){return null!=e&&(!0===t?"function"==typeof e[r]:!1===t?"function"==typeof e[n]:"function"==typeof e[r]||"function"==typeof e[n])},isReadableNodeStream:d,isReadableStream:m,isReadableEnded:function(e){if(!d(e))return null;if(!0===e.readableEnded)return!0;let t=e._readableState;return!!t&&!t.errored&&("boolean"!=typeof(null==t?void 0:t.ended)?null:t.ended)},isReadableFinished:w,isReadableErrored:function(e){var t,r;return p(e)?e.readableErrored?e.readableErrored:null!=(t=null==(r=e._readableState)?void 0:r.errored)?t:null:null},isNodeStream:p,isWebStream:function(e){return m(e)||g(e)||v(e)},isWritable:M,isWritableNodeStream:c,isWritableStream:g,isWritableEnded:y,isWritableFinished:function(e,t){if(!c(e))return null;if(!0===e.writableFinished)return!0;let r=e._writableState;return(null==r||!r.errored)&&("boolean"!=typeof(null==r?void 0:r.finished)?null:!!(r.finished||!1===t&&!0===r.ended&&0===r.length))},isWritableErrored:function(e){var t,r;return p(e)?e.writableErrored?e.writableErrored:null!=(t=null==(r=e._writableState)?void 0:r.errored)?t:null:null},isServerRequest:function(e){var t;return"boolean"==typeof e._consuming&&"boolean"==typeof e._dumped&&(null==(t=e.req)?void 0:t.upgradeOrConnect)===void 0},isServerResponse:S,willEmitClose:function(e){if(!p(e))return null;let{_writableState:t,_readableState:r}=e,i=t||r;return!i&&S(e)||!!(i&&i.autoDestroy&&i.emitClose&&!1===i.closed)},isTransformStream:v}}),c=r((e,t)=>{var r,n=u(),{AbortError:s,codes:o}=a(),{ERR_INVALID_ARG_TYPE:c,ERR_STREAM_PREMATURE_CLOSE:p}=o,{kEmptyObject:m,once:g}=f(),{validateAbortSignal:v,validateFunction:b,validateObject:y,validateBoolean:w}=h(),{Promise:_,PromisePrototypeThen:M,SymbolDispose:x}=i(),{isClosed:S,isReadable:E,isReadableNodeStream:k,isReadableStream:A,isReadableFinished:P,isReadableErrored:R,isWritable:I,isWritableNodeStream:T,isWritableStream:j,isWritableFinished:O,isWritableErrored:C,isNodeStream:N,willEmitClose:D,kIsClosedPromise:L}=d(),$=()=>{};function q(e,t,i){var a,o;if(2==arguments.length?(i=t,t=m):null==t?t=m:y(t,"options"),b(i,"callback"),v(t.signal,"options.signal"),i=g(i),A(e)||j(e))return function(e,t,i){let a=!1,o=$;if(t.signal)if(o=()=>{a=!0,i.call(e,new s(void 0,{cause:t.signal.reason}))},t.signal.aborted)n.nextTick(o);else{let n=(r=r||f().addAbortListener)(t.signal,o),a=i;i=g((...t)=>{n[x](),a.apply(e,t)})}let h=(...t)=>{a||n.nextTick(()=>i.apply(e,t))};return M(e[L].promise,h,h),$}(e,t,i);if(!N(e))throw new c("stream",["ReadableStream","WritableStream","Stream"],e);let h=null!=(a=t.readable)?a:k(e),u=null!=(o=t.writable)?o:T(e),d=e._writableState,w=e._readableState,_=()=>{e.writable||F()},q=D(e)&&k(e)===h&&T(e)===u,B=O(e,!1),F=()=>{B=!0,e.destroyed&&(q=!1),q&&(!e.readable||h)||(!h||z)&&i.call(e)},z=P(e,!1),Z=()=>{z=!0,e.destroyed&&(q=!1),q&&(!e.writable||u)||(!u||B)&&i.call(e)},U=t=>{i.call(e,t)},H=S(e),V=()=>{H=!0;let t=C(e)||R(e);return t&&"boolean"!=typeof t?i.call(e,t):h&&!z&&k(e,!0)&&!P(e,!1)||u&&!B&&!O(e,!1)?i.call(e,new p):void i.call(e)},W=()=>{H=!0;let t=C(e)||R(e);if(t&&"boolean"!=typeof t)return i.call(e,t);i.call(e)},K=()=>{e.req.on("finish",F)};e.setHeader&&"function"==typeof e.abort?(e.on("complete",F),q||e.on("abort",V),e.req?K():e.on("request",K)):u&&!d&&(e.on("end",_),e.on("close",_)),q||"boolean"!=typeof e.aborted||e.on("aborted",V),e.on("end",Z),e.on("finish",F),!1!==t.error&&e.on("error",U),(e.on("close",V),H)?n.nextTick(V):null!=d&&d.errorEmitted||null!=w&&w.errorEmitted?q||n.nextTick(W):!h&&(!q||E(e))&&(B||!1===I(e))||!u&&(!q||I(e))&&(z||!1===E(e))?n.nextTick(W):w&&e.req&&e.aborted&&n.nextTick(W);let Q=()=>{i=$,e.removeListener("aborted",V),e.removeListener("complete",F),e.removeListener("abort",V),e.removeListener("request",K),e.req&&e.req.removeListener("finish",F),e.removeListener("end",_),e.removeListener("close",_),e.removeListener("finish",F),e.removeListener("end",Z),e.removeListener("error",U),e.removeListener("close",V)};if(t.signal&&!H){let a=()=>{let r=i;Q(),r.call(e,new s(void 0,{cause:t.signal.reason}))};if(t.signal.aborted)n.nextTick(a);else{let n=(r=r||f().addAbortListener)(t.signal,a),s=i;i=g((...t)=>{n[x](),s.apply(e,t)})}}return Q}t.exports=q,t.exports.finished=function(e,t){var r;let i=!1;return null===t&&(t=m),null!=(r=t)&&r.cleanup&&(w(t.cleanup,"cleanup"),i=t.cleanup),new _((r,n)=>{let a=q(e,t,e=>{i&&a(),e?n(e):r()})})}}),m=r((e,t)=>{var r=u(),{aggregateTwoErrors:n,codes:{ERR_MULTIPLE_CALLBACK:s},AbortError:o}=a(),{Symbol:f}=i(),{kIsDestroyed:h,isDestroyed:c,isFinished:p,isServerRequest:m}=d(),g=f("kDestroy"),v=f("kConstruct");function b(e,t,r){e&&(e.stack,t&&!t.errored&&(t.errored=e),r&&!r.errored&&(r.errored=e))}function y(e,t,i){let n=!1;function a(t){if(n)return;n=!0;let{_readableState:a,_writableState:s}=e;b(t,s,a),s&&(s.closed=!0),a&&(a.closed=!0),"function"==typeof i&&i(t),t?r.nextTick(w,e,t):r.nextTick(_,e)}try{e._destroy(t||null,a)}catch(e){a(e)}}function w(e,t){M(e,t),_(e)}function _(e){let{_readableState:t,_writableState:r}=e;r&&(r.closeEmitted=!0),t&&(t.closeEmitted=!0),(null!=r&&r.emitClose||null!=t&&t.emitClose)&&e.emit("close")}function M(e,t){let{_readableState:r,_writableState:i}=e;null!=i&&i.errorEmitted||null!=r&&r.errorEmitted||(i&&(i.errorEmitted=!0),r&&(r.errorEmitted=!0),e.emit("error",t))}function x(e,t,i){let{_readableState:n,_writableState:a}=e;if(null!=a&&a.destroyed||null!=n&&n.destroyed)return this;null!=n&&n.autoDestroy||null!=a&&a.autoDestroy?e.destroy(t):t&&(t.stack,a&&!a.errored&&(a.errored=t),n&&!n.errored&&(n.errored=t),i?r.nextTick(M,e,t):M(e,t))}function S(e){let t=!1;function i(i){if(t)return void x(e,null!=i?i:new s);t=!0;let{_readableState:n,_writableState:a}=e,o=a||n;n&&(n.constructed=!0),a&&(a.constructed=!0),o.destroyed?e.emit(g,i):i?x(e,i,!0):r.nextTick(E,e)}try{e._construct(e=>{r.nextTick(i,e)})}catch(e){r.nextTick(i,e)}}function E(e){e.emit(v)}function k(e){return(null==e?void 0:e.setHeader)&&"function"==typeof e.abort}function A(e){e.emit("close")}function P(e,t){e.emit("error",t),r.nextTick(A,e)}t.exports={construct:function(e,t){if("function"!=typeof e._construct)return;let{_readableState:i,_writableState:n}=e;i&&(i.constructed=!1),n&&(n.constructed=!1),e.once(v,t),e.listenerCount(v)>1||r.nextTick(S,e)},destroyer:function(e,t){!(!e||c(e))&&(t||p(e)||(t=new o),m(e)?(e.socket=null,e.destroy(t)):k(e)?e.abort():k(e.req)?e.req.abort():"function"==typeof e.destroy?e.destroy(t):"function"==typeof e.close?e.close():t?r.nextTick(P,e,t):r.nextTick(A,e),e.destroyed||(e[h]=!0))},destroy:function(e,t){let r=this._readableState,i=this._writableState,a=i||r;return null!=i&&i.destroyed||null!=r&&r.destroyed?"function"==typeof t&&t():(b(e,i,r),i&&(i.destroyed=!0),r&&(r.destroyed=!0),a.constructed?y(this,e,t):this.once(g,function(r){y(this,n(r,e),t)})),this},undestroy:function(){let e=this._readableState,t=this._writableState;e&&(e.constructed=!0,e.closed=!1,e.closeEmitted=!1,e.destroyed=!1,e.errored=null,e.errorEmitted=!1,e.reading=!1,e.ended=!1===e.readable,e.endEmitted=!1===e.readable),t&&(t.constructed=!0,t.destroyed=!1,t.closed=!1,t.closeEmitted=!1,t.errored=null,t.errorEmitted=!1,t.finalCalled=!1,t.prefinished=!1,t.ended=!1===t.writable,t.ending=!1===t.writable,t.finished=!1===t.writable)},errorOrDestroy:x}}),g=r((e,t)=>{var{ArrayIsArray:r,ObjectSetPrototypeOf:n}=i(),{EventEmitter:a}=(tN(),p(tn));function s(e){a.call(this,e)}function o(e,t,i){if("function"==typeof e.prependListener)return e.prependListener(t,i);e._events&&e._events[t]?r(e._events[t])?e._events[t].unshift(i):e._events[t]=[i,e._events[t]]:e.on(t,i)}n(s.prototype,a.prototype),n(s,a),s.prototype.pipe=function(e,t){let r=this;function i(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function n(){r.readable&&r.resume&&r.resume()}r.on("data",i),e.on("drain",n),e._isStdio||t&&!1===t.end||(r.on("end",f),r.on("close",h));let s=!1;function f(){s||(s=!0,e.end())}function h(){s||(s=!0,"function"==typeof e.destroy&&e.destroy())}function u(e){d(),0===a.listenerCount(this,"error")&&this.emit("error",e)}function d(){r.removeListener("data",i),e.removeListener("drain",n),r.removeListener("end",f),r.removeListener("close",h),r.removeListener("error",u),e.removeListener("error",u),r.removeListener("end",d),r.removeListener("close",d),e.removeListener("close",d)}return o(r,"error",u),o(e,"error",u),r.on("end",d),r.on("close",d),e.on("close",d),e.emit("pipe",r),e},t.exports={Stream:s,prependListener:o}}),v=r((e,t)=>{var r,{SymbolDispose:n}=i(),{AbortError:s,codes:o}=a(),{isNodeStream:h,isWebStream:u,kControllerErrorFunction:p}=d(),m=c(),{ERR_INVALID_ARG_TYPE:g}=o;t.exports.addAbortSignal=function(e,r){if(((e,t)=>{if("object"!=typeof e||!("aborted"in e))throw new g(t,"AbortSignal",e)})(e,"signal"),!h(r)&&!u(r))throw new g("stream",["ReadableStream","WritableStream","Stream"],r);return t.exports.addAbortSignalNoValidate(e,r)},t.exports.addAbortSignalNoValidate=function(e,t){if("object"!=typeof e||!("aborted"in e))return t;let i=h(t)?()=>{t.destroy(new s(void 0,{cause:e.reason}))}:()=>{t[p](new s(void 0,{cause:e.reason}))};return e.aborted?i():m(t,(r=r||f().addAbortListener)(e,i)[n]),t}}),y=r((e,t)=>{var{StringPrototypeSlice:r,SymbolIterator:n,TypedArrayPrototypeSet:a,Uint8Array:s}=i(),{Buffer:o}=(ek(),p(b)),{inspect:h}=f();t.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(e){let t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}unshift(e){let t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}shift(){if(0===this.length)return;let e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}clear(){this.head=this.tail=null,this.length=0}join(e){if(0===this.length)return"";let t=this.head,r=""+t.data;for(;null!==(t=t.next);)r+=e+t.data;return r}concat(e){if(0===this.length)return o.alloc(0);let t=o.allocUnsafe(e>>>0),r=this.head,i=0;for(;r;)a(t,r.data,i),i+=r.data.length,r=r.next;return t}consume(e,t){let r=this.head.data;if(ea.length)t+=a,e-=a.length;else{e===a.length?(t+=a,++n,i.next)?this.head=i.next:this.head=this.tail=null:(t+=r(a,0,e),this.head=i,i.data=r(a,e));break}++n}while(null!==(i=i.next));return this.length-=n,t}_getBuffer(e){let t=o.allocUnsafe(e),r=e,i=this.head,n=0;do{let o=i.data;if(e>o.length)a(t,o,r-e),e-=o.length;else{e===o.length?(a(t,o,r-e),++n,i.next)?this.head=i.next:this.head=this.tail=null:(a(t,new s(o.buffer,o.byteOffset,e),r-e),this.head=i,i.data=o.slice(e));break}++n}while(null!==(i=i.next));return this.length-=n,t}[Symbol.for("nodejs.util.inspect.custom")](e,t){return h(this,{...t,depth:0,customInspect:!1})}}}),w=r((e,t)=>{var{MathFloor:r,NumberIsInteger:n}=i(),{validateInteger:s}=h(),{ERR_INVALID_ARG_VALUE:o}=a().codes,f=16384,u=16;function d(e){return e?u:f}t.exports={getHighWaterMark:function(e,t,i,a){let s=null!=t.highWaterMark?t.highWaterMark:a?t[i]:null;if(null!=s){if(!n(s)||s<0)throw new o(a?`options.${i}`:"options.highWaterMark",s);return r(s)}return d(e.objectMode)},getDefaultHighWaterMark:d,setDefaultHighWaterMark:function(e,t){(s(t,"value",0),e)?u=t:f=t}}}),_=r((e,t)=>{var r=(ek(),p(b)),i=r.Buffer;function n(e,t){for(var r in e)t[r]=e[r]}function a(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=r:(n(r,e),e.Buffer=a),a.prototype=Object.create(i.prototype),n(i,a),a.from=function(e,t,r){if("number"==typeof e)throw TypeError("Argument must not be a number");return i(e,t,r)},a.alloc=function(e,t,r){if("number"!=typeof e)throw TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},a.allocUnsafe=function(e){if("number"!=typeof e)throw TypeError("Argument must be a number");return i(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw TypeError("Argument must be a number");return r.SlowBuffer(e)}}),M=r(e=>{var t=_().Buffer,r=t.isEncoding||function(e){switch((e=""+e)&&e.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 i(e){var i;switch(this.encoding=function(e){var i=function(e){var t;if(!e)return"utf8";for(;;)switch(e){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 e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof i&&(t.isEncoding===r||!r(e)))throw Error("Unknown encoding: "+e);return i||e}(e),this.encoding){case"utf16le":this.text=s,this.end=o,i=4;break;case"utf8":this.fillLast=a,i=4;break;case"base64":this.text=f,this.end=h,i=3;break;default:this.write=u,this.end=d;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=t.allocUnsafe(i)}function n(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function a(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if((192&t[0])!=128)return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if((192&t[1])!=128)return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&(192&t[2])!=128)return e.lastNeed=2,"�"}}(this,e,0);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):void(e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length)}function s(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var i=r.charCodeAt(r.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function o(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function f(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):((this.lastNeed=3-r,this.lastTotal=3,1===r)?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function h(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function u(e){return e.toString(this.encoding)}function d(e){return e&&e.length?this.write(e):""}e.StringDecoder=i,i.prototype.write=function(e){var t,r;if(0===e.length)return"";if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0?(a>0&&(e.lastNeed=a-1),a):--i=0?(a>0&&(e.lastNeed=a-2),a):--i=0?(a>0&&(2===a?a=0:e.lastNeed=a-3),a):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var i=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,i),e.toString("utf8",t,i)},i.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}}),x=r((e,t)=>{var r=u(),{PromisePrototypeThen:n,SymbolAsyncIterator:s,SymbolIterator:o}=i(),{Buffer:f}=(ek(),p(b)),{ERR_INVALID_ARG_TYPE:h,ERR_STREAM_NULL_VALUES:d}=a().codes;t.exports=function(e,t,i){let a,u;if("string"==typeof t||t instanceof f)return new e({objectMode:!0,...i,read(){this.push(t),this.push(null)}});if(t&&t[s])u=!0,a=t[s]();else if(t&&t[o])u=!1,a=t[o]();else throw new h("iterable",["Iterable"],t);let c=new e({objectMode:!0,highWaterMark:1,...i}),p=!1;async function m(e){let t=null!=e,r="function"==typeof a.throw;if(t&&r){let{value:t,done:r}=await a.throw(e);if(await t,r)return}if("function"==typeof a.return){let{value:e}=await a.return();await e}}async function g(){for(;;){try{let{value:e,done:t}=u?await a.next():a.next();if(t)c.push(null);else{let t=e&&"function"==typeof e.then?await e:e;if(null===t)throw p=!1,new d;if(c.push(t))continue;p=!1}}catch(e){c.destroy(e)}break}}return c._read=function(){p||(p=!0,g())},c._destroy=function(e,t){n(m(e),()=>r.nextTick(t,e),i=>r.nextTick(t,i||e))},c}}),S=r((e,t)=>{var r,n=u(),{ArrayPrototypeIndexOf:s,NumberIsInteger:o,NumberIsNaN:d,NumberParseInt:_,ObjectDefineProperties:S,ObjectKeys:E,ObjectSetPrototypeOf:k,Promise:P,SafeSet:R,SymbolAsyncDispose:I,SymbolAsyncIterator:T,Symbol:j}=i();t.exports=ea,ea.ReadableState=en;var{EventEmitter:O}=(tN(),p(tn)),{Stream:C,prependListener:N}=g(),{Buffer:D}=(ek(),p(b)),{addAbortSignal:L}=v(),$=c(),q=f().debuglog("stream",e=>{q=e}),B=y(),F=m(),{getHighWaterMark:z,getDefaultHighWaterMark:Z}=w(),{aggregateTwoErrors:U,codes:{ERR_INVALID_ARG_TYPE:H,ERR_METHOD_NOT_IMPLEMENTED:V,ERR_OUT_OF_RANGE:W,ERR_STREAM_PUSH_AFTER_EOF:K,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:Q},AbortError:G}=a(),{validateObject:J}=h(),Y=j("kPaused"),{StringDecoder:X}=M(),ee=x();k(ea.prototype,C.prototype),k(ea,C);var et=()=>{},{errorOrDestroy:er}=F;function ei(e){return{enumerable:!1,get(){return(this.state&e)!=0},set(t){t?this.state|=e:this.state&=~e}}}function en(e,t,r){"boolean"!=typeof r&&(r=t instanceof A()),this.state=6192,e&&e.objectMode&&(this.state|=1),r&&e&&e.readableObjectMode&&(this.state|=1),this.highWaterMark=e?z(this,e,"readableHighWaterMark",r):Z(!1),this.buffer=new B,this.length=0,this.pipes=[],this.flowing=null,this[Y]=null,e&&!1===e.emitClose&&(this.state&=-2049),e&&!1===e.autoDestroy&&(this.state&=-4097),this.errored=null,this.defaultEncoding=e&&e.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,e&&e.encoding&&(this.decoder=new X(e.encoding),this.encoding=e.encoding)}function ea(e){if(!(this instanceof ea))return new ea(e);let t=this instanceof A();this._readableState=new en(e,this,t),e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.construct&&(this._construct=e.construct),e.signal&&!t&&L(e.signal,this)),C.call(this,e),F.construct(this,()=>{this._readableState.needReadable&&el(this,this._readableState)})}function es(e,t,r,i){q("readableAddChunk",t);let n=e._readableState,a;if((1&n.state)==0&&("string"==typeof t?(r=r||n.defaultEncoding,n.encoding!==r&&(i&&n.encoding?t=D.from(t,r).toString(n.encoding):(t=D.from(t,r),r=""))):t instanceof D?r="":C._isUint8Array(t)?(t=C._uint8ArrayToBuffer(t),r=""):null!=t&&(a=new H("chunk",["string","Buffer","Uint8Array"],t))),a)er(e,a);else if(null===t)n.state&=-9,function(e,t){if(q("onEofChunk"),!t.ended){if(t.decoder){let e=t.decoder.end();e&&e.length&&(t.buffer.push(e),t.length+=t.objectMode?1:e.length)}(t.ended=!0,t.sync)?eh(e):(t.needReadable=!1,t.emittedReadable=!0,eu(e))}}(e,n);else if((1&n.state)!=0||t&&t.length>0)if(i)if((4&n.state)!=0)er(e,new Q);else{if(n.destroyed||n.errored)return!1;eo(e,n,t,!0)}else if(n.ended)er(e,new K);else{if(n.destroyed||n.errored)return!1;(n.state&=-9,n.decoder&&!r)?(t=n.decoder.write(t),n.objectMode||0!==t.length)?eo(e,n,t,!1):el(e,n):eo(e,n,t,!1)}else i||(n.state&=-9,el(e,n));return!n.ended&&(n.length0?((65536&t.state)!=0?t.awaitDrainWriters.clear():t.awaitDrainWriters=null,t.dataEmitted=!0,e.emit("data",r)):((t.length+=t.objectMode?1:r.length,i)?t.buffer.unshift(r):t.buffer.push(r),(64&t.state)!=0&&eh(e)),el(e,t)}function ef(e,t){return e<=0||0===t.length&&t.ended?0:(1&t.state)!=0?1:d(e)?t.flowing&&t.length?t.buffer.first().length:t.length:e<=t.length?e:t.ended?t.length:0}function eh(e){let t=e._readableState;q("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(q("emitReadable",t.flowing),t.emittedReadable=!0,n.nextTick(eu,e))}function eu(e){let t=e._readableState;q("emitReadable_",t.destroyed,t.length,t.ended),!t.destroyed&&!t.errored&&(t.length||t.ended)&&(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,eg(e)}function el(e,t){!t.readingMore&&t.constructed&&(t.readingMore=!0,n.nextTick(ed,e,t))}function ed(e,t){for(;!t.reading&&!t.ended&&(t.length0,t.resumeScheduled&&!1===t[Y])?t.flowing=!0:e.listenerCount("data")>0?e.resume():t.readableListening||(t.flowing=null)}function ep(e){q("readable nexttick read 0"),e.read(0)}function em(e,t){q("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),eg(e),t.flowing&&!t.reading&&e.read(0)}function eg(e){let t=e._readableState;for(q("flow",t.flowing);t.flowing&&null!==e.read(););}function ev(e,t){"function"!=typeof e.read&&(e=ea.wrap(e,{objectMode:!0}));let r=eb(e,t);return r.stream=e,r}async function*eb(e,t){let r=et;function i(t){this===e?(r(),r=et):r=t}e.on("readable",i);let n,a=$(e,{writable:!1},e=>{n=e?U(n,e):null,r(),r=et});try{for(;;){let t=e.destroyed?null:e.read();if(null!==t)yield t;else if(n)throw n;else{if(null===n)return;await new P(i)}}}catch(e){throw n=U(n,e)}finally{(n||(null==t?void 0:t.destroyOnReturn)!==!1)&&(void 0===n||e._readableState.autoDestroy)?F.destroyer(e,null):(e.off("readable",i),a())}}function ey(e,t){let r;return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r)}function ew(e){let t=e._readableState;q("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,n.nextTick(e_,t,e))}function e_(e,t){if(q("endReadableNT",e.endEmitted,e.length),!e.errored&&!e.closeEmitted&&!e.endEmitted&&0===e.length){if(e.endEmitted=!0,t.emit("end"),t.writable&&!1===t.allowHalfOpen)n.nextTick(eM,t);else if(e.autoDestroy){let e=t._writableState;(!e||e.autoDestroy&&(e.finished||!1===e.writable))&&t.destroy()}}}function eM(e){!e.writable||e.writableEnded||e.destroyed||e.end()}function ex(){return void 0===r&&(r={}),r}S(en.prototype,{objectMode:ei(1),ended:ei(2),endEmitted:ei(4),reading:ei(8),constructed:ei(16),sync:ei(32),needReadable:ei(64),emittedReadable:ei(128),readableListening:ei(256),resumeScheduled:ei(512),errorEmitted:ei(1024),emitClose:ei(2048),autoDestroy:ei(4096),destroyed:ei(8192),closed:ei(16384),closeEmitted:ei(32768),multiAwaitDrain:ei(65536),readingMore:ei(131072),dataEmitted:ei(262144)}),ea.prototype.destroy=F.destroy,ea.prototype._undestroy=F.undestroy,ea.prototype._destroy=function(e,t){t(e)},ea.prototype[O.captureRejectionSymbol]=function(e){this.destroy(e)},ea.prototype[I]=function(){let e;return this.destroyed||(e=this.readableEnded?null:new G,this.destroy(e)),new P((t,r)=>$(this,i=>i&&i!==e?r(i):t(null)))},ea.prototype.push=function(e,t){return es(this,e,t,!1)},ea.prototype.unshift=function(e,t){return es(this,e,t,!0)},ea.prototype.isPaused=function(){let e=this._readableState;return!0===e[Y]||!1===e.flowing},ea.prototype.setEncoding=function(e){let t=new X(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;let r=this._readableState.buffer,i="";for(let e of r)i+=t.write(e);return r.clear(),""!==i&&r.push(i),this._readableState.length=i.length,this},ea.prototype.read=function(e){let t;(q("read",e),void 0===e)?e=NaN:o(e)||(e=_(e,10));let r=this._readableState,i=e;if(e>r.highWaterMark&&(r.highWaterMark=function(e){if(e>0x40000000)throw new W("size","<= 1GiB",e);return e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,++e}(e)),0!==e&&(r.state&=-129),0===e&&r.needReadable&&((0!==r.highWaterMark?r.length>=r.highWaterMark:r.length>0)||r.ended))return(q("read: emitReadable",r.length,r.ended),0===r.length&&r.ended)?ew(this):eh(this),null;if(0===(e=ef(e,r))&&r.ended)return 0===r.length&&ew(this),null;let n=(64&r.state)!=0;if(q("need readable",n),(0===r.length||r.length-e0?ey(e,r):null)?(r.needReadable=r.length<=r.highWaterMark,e=0):(r.length-=e,r.multiAwaitDrain)?r.awaitDrainWriters.clear():r.awaitDrainWriters=null,0===r.length&&(r.ended||(r.needReadable=!0),i!==e&&r.ended&&ew(this)),null===t||r.errorEmitted||r.closeEmitted||(r.dataEmitted=!0,this.emit("data",t)),t},ea.prototype._read=function(e){throw new V("_read()")},ea.prototype.pipe=function(e,t){let r=this,i=this._readableState;1!==i.pipes.length||i.multiAwaitDrain||(i.multiAwaitDrain=!0,i.awaitDrainWriters=new R(i.awaitDrainWriters?[i.awaitDrainWriters]:[])),i.pipes.push(e),q("pipe count=%d opts=%j",i.pipes.length,t);let a=t&&!1===t.end||e===n.stdout||e===n.stderr?m:s;function s(){q("onend"),e.end()}i.endEmitted?n.nextTick(a):r.once("end",a),e.on("unpipe",function t(n,a){q("onunpipe"),n===r&&a&&!1===a.hasUnpiped&&(a.hasUnpiped=!0,q("cleanup"),e.removeListener("close",c),e.removeListener("finish",p),o&&e.removeListener("drain",o),e.removeListener("error",d),e.removeListener("unpipe",t),r.removeListener("end",s),r.removeListener("end",m),r.removeListener("data",u),f=!0,o&&i.awaitDrainWriters&&(!e._writableState||e._writableState.needDrain)&&o())});let o,f=!1;function h(){var t,n;f||(1===i.pipes.length&&i.pipes[0]===e?(q("false write response, pause",0),i.awaitDrainWriters=e,i.multiAwaitDrain=!1):i.pipes.length>1&&i.pipes.includes(e)&&(q("false write response, pause",i.awaitDrainWriters.size),i.awaitDrainWriters.add(e)),r.pause()),o||(t=r,n=e,o=function(){let e=t._readableState;e.awaitDrainWriters===n?(q("pipeOnDrain",1),e.awaitDrainWriters=null):e.multiAwaitDrain&&(q("pipeOnDrain",e.awaitDrainWriters.size),e.awaitDrainWriters.delete(n)),(!e.awaitDrainWriters||0===e.awaitDrainWriters.size)&&t.listenerCount("data")&&t.resume()},e.on("drain",o))}function u(t){q("ondata");let r=e.write(t);q("dest.write",r),!1===r&&h()}function d(t){if(q("onerror",t),m(),e.removeListener("error",d),0===e.listenerCount("error")){let r=e._writableState||e._readableState;r&&!r.errorEmitted?er(e,t):e.emit("error",t)}}function c(){e.removeListener("finish",p),m()}function p(){q("onfinish"),e.removeListener("close",c),m()}function m(){q("unpipe"),r.unpipe(e)}return r.on("data",u),N(e,"error",d),e.once("close",c),e.once("finish",p),(e.emit("pipe",r),!0===e.writableNeedDrain)?h():i.flowing||(q("pipe resume"),r.resume()),e},ea.prototype.unpipe=function(e){let t=this._readableState;if(0===t.pipes.length)return this;if(!e){let e=t.pipes;t.pipes=[],this.pause();for(let t=0;t0,!1!==i.flowing&&this.resume()):"readable"!==e||i.endEmitted||i.readableListening||((i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,q("on readable",i.length,i.reading),i.length)?eh(this):i.reading||n.nextTick(ep,this)),r},ea.prototype.addListener=ea.prototype.on,ea.prototype.removeListener=function(e,t){let r=C.prototype.removeListener.call(this,e,t);return"readable"===e&&n.nextTick(ec,this),r},ea.prototype.off=ea.prototype.removeListener,ea.prototype.removeAllListeners=function(e){let t=C.prototype.removeAllListeners.apply(this,arguments);return("readable"===e||void 0===e)&&n.nextTick(ec,this),t},ea.prototype.resume=function(){var e,t;let r=this._readableState;return r.flowing||(q("resume"),r.flowing=!r.readableListening,e=this,(t=r).resumeScheduled||(t.resumeScheduled=!0,n.nextTick(em,e,t))),r[Y]=!1,this},ea.prototype.pause=function(){return q("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(q("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[Y]=!0,this},ea.prototype.wrap=function(e){let t=!1;e.on("data",r=>{!this.push(r)&&e.pause&&(t=!0,e.pause())}),e.on("end",()=>{this.push(null)}),e.on("error",e=>{er(this,e)}),e.on("close",()=>{this.destroy()}),e.on("destroy",()=>{this.destroy()}),this._read=()=>{t&&e.resume&&(t=!1,e.resume())};let r=E(e);for(let t=1;t{var r,n=u(),{ArrayPrototypeSlice:s,Error:o,FunctionPrototypeSymbolHasInstance:f,ObjectDefineProperty:h,ObjectDefineProperties:d,ObjectSetPrototypeOf:c,StringPrototypeToLowerCase:y,Symbol:_,SymbolHasInstance:M}=i();t.exports=H,H.WritableState=Z;var{EventEmitter:x}=(tN(),p(tn)),S=g().Stream,{Buffer:E}=(ek(),p(b)),k=m(),{addAbortSignal:P}=v(),{getHighWaterMark:R,getDefaultHighWaterMark:I}=w(),{ERR_INVALID_ARG_TYPE:T,ERR_METHOD_NOT_IMPLEMENTED:j,ERR_MULTIPLE_CALLBACK:O,ERR_STREAM_CANNOT_PIPE:C,ERR_STREAM_DESTROYED:N,ERR_STREAM_ALREADY_FINISHED:D,ERR_STREAM_NULL_VALUES:L,ERR_STREAM_WRITE_AFTER_END:$,ERR_UNKNOWN_ENCODING:q}=a().codes,{errorOrDestroy:B}=k;function F(){}c(H.prototype,S.prototype),c(H,S);var z=_("kOnFinished");function Z(e,t,r){"boolean"!=typeof r&&(r=t instanceof A()),this.objectMode=!!(e&&e.objectMode),r&&(this.objectMode=this.objectMode||!!(e&&e.writableObjectMode)),this.highWaterMark=e?R(this,e,"writableHighWaterMark",r):I(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;let i=!!(e&&!1===e.decodeStrings);this.decodeStrings=!i,this.defaultEncoding=e&&e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=Q.bind(void 0,t),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,U(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!e||!1!==e.emitClose,this.autoDestroy=!e||!1!==e.autoDestroy,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[z]=[]}function U(e){e.buffered=[],e.bufferedIndex=0,e.allBuffers=!0,e.allNoop=!0}function H(e){let t=this instanceof A();if(!t&&!f(H,this))return new H(e);this._writableState=new Z(e,this,t),e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final),"function"==typeof e.construct&&(this._construct=e.construct),e.signal&&P(e.signal,this)),S.call(this,e),k.construct(this,()=>{let e=this._writableState;e.writing||X(this,e),et(this,e)})}function V(e,t,r,i){var a,s,o,f,h;let u,d,c,p=e._writableState;if("function"==typeof r)i=r,r=p.defaultEncoding;else{if(r){if("buffer"!==r&&!E.isEncoding(r))throw new q(r)}else r=p.defaultEncoding;"function"!=typeof i&&(i=F)}if(null===t)throw new L;if(!p.objectMode)if("string"==typeof t)!1!==p.decodeStrings&&(t=E.from(t,r),r="buffer");else if(t instanceof E)r="buffer";else if(S._isUint8Array(t))t=S._uint8ArrayToBuffer(t),r="buffer";else throw new T("chunk",["string","Buffer","Uint8Array"],t);return(p.ending?c=new $:p.destroyed&&(c=new N("write")),c)?(n.nextTick(i,c),B(e,c,!0),c):(p.pendingcb++,a=e,s=p,o=t,f=r,h=i,u=s.objectMode?1:o.length,s.length+=u,(d=s.lengthr.bufferedIndex&&X(e,r),i?null!==r.afterWriteTickInfo&&r.afterWriteTickInfo.cb===a?r.afterWriteTickInfo.count++:(r.afterWriteTickInfo={count:1,cb:a,stream:e,state:r},n.nextTick(G,r.afterWriteTickInfo)):J(e,r,1,a))}function G({stream:e,state:t,count:r,cb:i}){return t.afterWriteTickInfo=null,J(e,t,r,i)}function J(e,t,r,i){for(t.ending||e.destroyed||0!==t.length||!t.needDrain||(t.needDrain=!1,e.emit("drain"));r-- >0;)t.pendingcb--,i();t.destroyed&&Y(t),et(e,t)}function Y(e){var t,r;if(e.writing)return;for(let r=e.bufferedIndex;r1&&e._writev){t.pendingcb-=a-1;let i=t.allNoop?F:e=>{for(let t=o;t256?(r.splice(0,o),t.bufferedIndex=0):t.bufferedIndex=o}t.bufferProcessing=!1}function ee(e){return e.ending&&!e.destroyed&&e.constructed&&0===e.length&&!e.errored&&0===e.buffered.length&&!e.finished&&!e.writing&&!e.errorEmitted&&!e.closeEmitted}function et(e,t,r){ee(t)&&(t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.finalCalled=!0,function(e,t){let r=!1;function i(i){if(r)return void B(e,null!=i?i:O());if(r=!0,t.pendingcb--,i){let r=t[z].splice(0);for(let e=0;e{ee(t)?er(e,t):t.pendingcb--},e,t)):ee(t)&&(t.pendingcb++,er(e,t)))}function er(e,t){t.pendingcb--,t.finished=!0;let r=t[z].splice(0);for(let e=0;e{var r=u(),n=(ek(),p(b)),{isReadable:s,isWritable:h,isIterable:g,isNodeStream:v,isReadableNodeStream:y,isWritableNodeStream:w,isDuplexNodeStream:_,isReadableStream:M,isWritableStream:k}=d(),P=c(),{AbortError:R,codes:{ERR_INVALID_ARG_TYPE:I,ERR_INVALID_RETURN_VALUE:T}}=a(),{destroyer:j}=m(),O=A(),C=S(),N=E(),{createDeferredPromise:D}=f(),L=x(),$=globalThis.Blob||n.Blob,q="u">typeof $?function(e){return e instanceof $}:function(e){return!1},B=globalThis.AbortController||o().AbortController,{FunctionPrototypeCall:F}=i();class z extends O{constructor(e){super(e),(null==e?void 0:e.readable)===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),(null==e?void 0:e.writable)===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}}function Z(e){let t=e.readable&&"function"!=typeof e.readable.read?C.wrap(e.readable):e.readable,r=e.writable,i=!!s(t),n=!!h(r),a,o,f,u,d;function c(e){let t=u;(u=null,t)?t(e):e&&d.destroy(e)}return d=new z({readableObjectMode:!!(null!=t&&t.readableObjectMode),writableObjectMode:!!(null!=r&&r.writableObjectMode),readable:i,writable:n}),n&&(P(r,e=>{n=!1,e&&j(t,e),c(e)}),d._write=function(e,t,i){r.write(e,t)?i():a=i},d._final=function(e){r.end(),o=e},r.on("drain",function(){if(a){let e=a;a=null,e()}}),r.on("finish",function(){if(o){let e=o;o=null,e()}})),i&&(P(t,e=>{i=!1,e&&j(t,e),c(e)}),t.on("readable",function(){if(f){let e=f;f=null,e()}}),t.on("end",function(){d.push(null)}),d._read=function(){for(;;){let e=t.read();if(null===e){f=d._read;return}if(!d.push(e))return}}),d._destroy=function(e,i){e||null===u||(e=new R),(f=null,a=null,o=null,null===u)?i(e):(u=i,j(r,e),j(t,e))},d}t.exports=function e(t,i){if(_(t))return t;if(y(t))return Z({readable:t});if(w(t))return Z({writable:t});if(v(t))return Z({writable:!1,readable:!1});if(M(t))return Z({readable:C.fromWeb(t)});if(k(t))return Z({writable:N.fromWeb(t)});if("function"==typeof t){let{value:e,write:n,final:a,destroy:s}=function(e){let{promise:t,resolve:i}=D(),n=new B,a=n.signal;return{value:e(async function*(){for(;;){let e=t;t=null;let{chunk:n,done:s,cb:o}=await e;if(r.nextTick(o),s)return;if(a.aborted)throw new R(void 0,{cause:a.reason});({promise:t,resolve:i}=D()),yield n}}(),{signal:a}),write(e,t,r){let n=i;i=null,n({chunk:e,done:!1,cb:r})},final(e){let t=i;i=null,t({done:!0,cb:e})},destroy(e,t){n.abort(),t(e)}}}(t);if(g(e))return L(z,e,{objectMode:!0,write:n,final:a,destroy:s});let o=null==e?void 0:e.then;if("function"==typeof o){let t,i=F(o,e,e=>{if(null!=e)throw new T("nully","body",e)},e=>{j(t,e)});return t=new z({objectMode:!0,readable:!1,write:n,final(e){a(async()=>{try{await i,r.nextTick(e,null)}catch(t){r.nextTick(e,t)}})},destroy:s})}throw new T("Iterable, AsyncIterable or AsyncFunction",i,e)}if(q(t))return e(t.arrayBuffer());if(g(t))return L(z,t,{objectMode:!0,writable:!1});if(M(null==t?void 0:t.readable)&&k(null==t?void 0:t.writable))return z.fromWeb(t);if("object"==typeof(null==t?void 0:t.writable)||"object"==typeof(null==t?void 0:t.readable))return Z({readable:null!=t&&t.readable?y(null==t?void 0:t.readable)?null==t?void 0:t.readable:e(t.readable):void 0,writable:null!=t&&t.writable?w(null==t?void 0:t.writable)?null==t?void 0:t.writable:e(t.writable):void 0});let n=null==t?void 0:t.then;if("function"==typeof n){let e;return F(n,t,t=>{null!=t&&e.push(t),e.push(null)},t=>{j(e,t)}),e=new z({objectMode:!0,writable:!1,read(){}})}throw new I(i,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],t)}}),A=r((e,t)=>{var r,n,{ObjectDefineProperties:a,ObjectGetOwnPropertyDescriptor:s,ObjectKeys:o,ObjectSetPrototypeOf:f}=i();t.exports=d;var h=S(),u=E();f(d.prototype,h.prototype),f(d,h);{let e=o(u.prototype);for(let t=0;t{var{ObjectSetPrototypeOf:r,Symbol:n}=i();t.exports=u;var{ERR_METHOD_NOT_IMPLEMENTED:s}=a().codes,o=A(),{getHighWaterMark:f}=w();r(u.prototype,o.prototype),r(u,o);var h=n("kCallback");function u(e){if(!(this instanceof u))return new u(e);let t=e?f(this,e,"readableHighWaterMark",!0):null;0===t&&(e={...e,highWaterMark:null,readableHighWaterMark:t,writableHighWaterMark:e.writableHighWaterMark||0}),o.call(this,e),this._readableState.sync=!1,this[h]=null,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",c)}function d(e){"function"!=typeof this._flush||this.destroyed?(this.push(null),e&&e()):this._flush((t,r)=>{if(t)return void(e?e(t):this.destroy(t));null!=r&&this.push(r),this.push(null),e&&e()})}function c(){this._final!==d&&d.call(this)}u.prototype._final=d,u.prototype._transform=function(e,t,r){throw new s("_transform()")},u.prototype._write=function(e,t,r){let i=this._readableState,n=this._writableState,a=i.length;this._transform(e,t,(e,t)=>{if(e)return void r(e);null!=t&&this.push(t),n.ended||a===i.length||i.length{var{ObjectSetPrototypeOf:r}=i();t.exports=a;var n=P();function a(e){if(!(this instanceof a))return new a(e);n.call(this,e)}r(a.prototype,n.prototype),r(a,n),a.prototype._transform=function(e,t,r){r(null,e)}}),I=r((e,t)=>{var r,n,s,p=u(),{ArrayIsArray:g,Promise:v,SymbolAsyncIterator:b,SymbolDispose:y}=i(),w=c(),{once:_}=f(),M=m(),x=A(),{aggregateTwoErrors:E,codes:{ERR_INVALID_ARG_TYPE:k,ERR_INVALID_RETURN_VALUE:P,ERR_MISSING_ARGS:I,ERR_STREAM_DESTROYED:T,ERR_STREAM_PREMATURE_CLOSE:j},AbortError:O}=a(),{validateFunction:C,validateAbortSignal:N}=h(),{isIterable:D,isReadable:L,isReadableNodeStream:$,isNodeStream:q,isTransformStream:B,isWebStream:F,isReadableStream:z,isReadableFinished:Z}=d(),U=globalThis.AbortController||o().AbortController;function H(e,t,r){let i=!1;return e.on("close",()=>{i=!0}),{destroy:t=>{i||(i=!0,M.destroyer(e,t||new T("pipe")))},cleanup:w(e,{readable:t,writable:r},e=>{i=!e})}}function V(e){if(D(e))return e;if($(e))return W(e);throw new k("val",["Readable","Iterable","AsyncIterable"],e)}async function*W(e){n||(n=S()),yield*n.prototype[b].call(e)}async function K(e,t,r,{end:i}){let n,a=null,s=e=>{if(e&&(n=e),a){let e=a;a=null,e()}},o=()=>new v((e,t)=>{n?t(n):a=()=>{n?t(n):e()}});t.on("drain",s);let f=w(t,{readable:!1},s);try{for await(let r of(t.writableNeedDrain&&await o(),e))t.write(r)||await o();i&&(t.end(),await o()),r()}catch(e){r(n!==e?E(n,e):e)}finally{f(),t.off("drain",s)}}async function Q(e,t,r,{end:i}){B(t)&&(t=t.writable);let n=t.getWriter();try{for await(let t of e)await n.ready,n.write(t).catch(()=>{});await n.ready,i&&await n.close(),r()}catch(e){try{await n.abort(e),r(e)}catch(e){r(e)}}}function G(e,t,i){let n,a;if(1===e.length&&g(e[0])&&(e=e[0]),e.length<2)throw new I("streams");let o=new U,h=o.signal,u=null==i?void 0:i.signal,d=[];function c(){S(new O)}N(u,"options.signal"),s=s||f().addAbortListener,u&&(n=s(u,c));let m,v,b=[],_=0;function M(e){S(e,0==--_)}function S(e,r){var i;if(e&&(!m||"ERR_STREAM_PREMATURE_CLOSE"===m.code)&&(m=e),m||r){for(;b.length;)b.shift()(m);null==(i=n)||i[y](),o.abort(),r&&(m||d.forEach(e=>e()),p.nextTick(t,m,v))}}for(let t=0;t0,f=s||(null==i?void 0:i.end)!==!1,u=t===e.length-1;if(q(n)){let e=function(e){e&&"AbortError"!==e.name&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code&&M(e)};if(f){let{destroy:e,cleanup:t}=H(n,s,o);b.push(e),L(n)&&u&&d.push(t)}n.on("error",e),L(n)&&u&&d.push(()=>{n.removeListener("error",e)})}if(0===t)if("function"==typeof n){if(!D(a=n({signal:h})))throw new P("Iterable, AsyncIterable or Stream","source",a)}else a=D(n)||$(n)||B(n)?n:x.from(n);else if("function"==typeof n){var E,A;if(a=n(a=B(a)?V(null==(E=a)?void 0:E.readable):V(a),{signal:h}),s){if(!D(a,!0))throw new P("AsyncIterable",`transform[${t-1}]`,a)}else{r||(r=R());let e=new r({objectMode:!0}),t=null==(A=a)?void 0:A.then;if("function"==typeof t)_++,t.call(a,t=>{v=t,null!=t&&e.write(t),f&&e.end(),p.nextTick(M)},t=>{e.destroy(t),p.nextTick(M,t)});else if(D(a,!0))_++,K(a,e,M,{end:f});else if(z(a)||B(a)){let t=a.readable||a;_++,K(t,e,M,{end:f})}else throw new P("AsyncIterable or Promise","destination",a);let{destroy:i,cleanup:n}=H(a=e,!1,!0);b.push(i),u&&d.push(n)}}else if(q(n)){if($(a)){_+=2;let e=function(e,t,r,{end:i}){let n=!1;if(t.on("close",()=>{n||r(new j)}),e.pipe(t,{end:!1}),i){let r=function(){n=!0,t.end()};Z(e)?p.nextTick(r):e.once("end",r)}else r();return w(e,{readable:!0,writable:!1},t=>{let i=e._readableState;t&&"ERR_STREAM_PREMATURE_CLOSE"===t.code&&i&&i.ended&&!i.errored&&!i.errorEmitted?e.once("end",r).once("error",r):r(t)}),w(t,{readable:!1,writable:!0},r)}(a,n,M,{end:f});L(n)&&u&&d.push(e)}else if(B(a)||z(a)){let e=a.readable||a;_++,K(e,n,M,{end:f})}else if(D(a))_++,K(a,n,M,{end:f});else throw new k("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],a);a=n}else if(F(n)){if($(a))_++,Q(V(a),n,M,{end:f});else if(z(a)||D(a))_++,Q(a,n,M,{end:f});else if(B(a))_++,Q(a.readable,n,M,{end:f});else throw new k("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],a);a=n}else a=x.from(n)}return(null!=h&&h.aborted||null!=u&&u.aborted)&&p.nextTick(c),a}t.exports={pipelineImpl:G,pipeline:function(...e){return G(e,_((C(e[e.length-1],"streams[stream.length - 1]"),e.pop())))}}}),T=r((e,t)=>{var{pipeline:r}=I(),i=A(),{destroyer:n}=m(),{isNodeStream:s,isReadable:o,isWritable:f,isWebStream:h,isTransformStream:u,isWritableStream:p,isReadableStream:g}=d(),{AbortError:v,codes:{ERR_INVALID_ARG_VALUE:b,ERR_MISSING_ARGS:y}}=a(),w=c();t.exports=function(...e){let t,a,d,c,m;if(0===e.length)throw new y("streams");if(1===e.length)return i.from(e[0]);let _=[...e];if("function"==typeof e[0]&&(e[0]=i.from(e[0])),"function"==typeof e[e.length-1]){let t=e.length-1;e[t]=i.from(e[t])}for(let t=0;t0&&!(f(e[t])||p(e[t])||u(e[t])))throw new b(`streams[${t}]`,_[t],"must be writable")}let M=e[0],x=r(e,function(e){let t=c;(c=null,t)?t(e):e?m.destroy(e):E||S||m.destroy()}),S=!!(f(M)||p(M)||u(M)),E=!!(o(x)||g(x)||u(x));if(m=new i({writableObjectMode:!!(null!=M&&M.writableObjectMode),readableObjectMode:!!(null!=x&&x.readableObjectMode),writable:S,readable:E}),S){if(s(M))m._write=function(e,r,i){M.write(e,r)?i():t=i},m._final=function(e){M.end(),a=e},M.on("drain",function(){if(t){let e=t;t=null,e()}});else if(h(M)){let e=(u(M)?M.writable:M).getWriter();m._write=async function(t,r,i){try{await e.ready,e.write(t).catch(()=>{}),i()}catch(e){i(e)}},m._final=async function(t){try{await e.ready,e.close().catch(()=>{}),a=t}catch(e){t(e)}}}w(u(x)?x.readable:x,()=>{if(a){let e=a;a=null,e()}})}if(E){if(s(x))x.on("readable",function(){if(d){let e=d;d=null,e()}}),x.on("end",function(){m.push(null)}),m._read=function(){for(;;){let e=x.read();if(null===e){d=m._read;return}if(!m.push(e))return}};else if(h(x)){let e=(u(x)?x.readable:x).getReader();m._read=async function(){for(;;)try{let{value:t,done:r}=await e.read();if(!m.push(t))return;if(r)return void m.push(null)}catch{return}}}}return m._destroy=function(e,r){e||null===c||(e=new v),(d=null,t=null,a=null,null===c)?r(e):(c=r,s(x)&&n(x,e))},m}}),j=r((e,t)=>{var r=globalThis.AbortController||o().AbortController,{codes:{ERR_INVALID_ARG_VALUE:n,ERR_INVALID_ARG_TYPE:s,ERR_MISSING_ARGS:u,ERR_OUT_OF_RANGE:p},AbortError:m}=a(),{validateAbortSignal:g,validateInteger:b,validateObject:y}=h(),w=i().Symbol("kWeak"),_=i().Symbol("kResistStopPropagation"),{finished:M}=c(),x=T(),{addAbortSignalNoValidate:S}=v(),{isWritable:E,isNodeStream:k}=d(),{deprecate:A}=f(),{ArrayPrototypePush:P,Boolean:R,MathFloor:I,Number:j,NumberIsNaN:O,Promise:C,PromiseReject:N,PromiseResolve:D,PromisePrototypeThen:L,Symbol:$}=i(),q=$("kEmpty"),B=$("kEof");function F(e,t){if("function"!=typeof e)throw new s("fn",["Function","AsyncFunction"],e);null!=t&&y(t,"options"),(null==t?void 0:t.signal)!=null&&g(t.signal,"options.signal");let r=1;(null==t?void 0:t.concurrency)!=null&&(r=I(t.concurrency));let i=r-1;return(null==t?void 0:t.highWaterMark)!=null&&(i=I(t.highWaterMark)),b(r,"options.concurrency",1),b(i,"options.highWaterMark",0),i+=r,(async function*(){let n=f().AbortSignalAny([null==t?void 0:t.signal].filter(R)),a=this,s=[],o={signal:n},h,u,d=!1,c=0;function p(){d=!0,g()}function g(){c-=1,v()}function v(){u&&!d&&c=i||c>=r)&&await new C(e=>{u=e})}s.push(B)}catch(t){let e=N(t);L(e,g,p),s.push(e)}finally{d=!0,h&&(h(),h=null)}}();try{for(;;){for(;s.length>0;){let e=await s[0];if(e===B)return;if(n.aborted)throw new m;e!==q&&(yield e),s.shift(),v()}await new C(e=>{h=e})}}finally{d=!0,u&&(u(),u=null)}}).call(this)}async function z(e,t){for await(let r of V.call(this,e,t))return!0;return!1}async function Z(e,t){if("function"!=typeof e)throw new s("fn",["Function","AsyncFunction"],e);return!await z.call(this,async(...t)=>!await e(...t),t)}async function U(e,t){for await(let r of V.call(this,e,t))return r}async function H(e,t){if("function"!=typeof e)throw new s("fn",["Function","AsyncFunction"],e);async function r(t,r){return await e(t,r),q}for await(let e of F.call(this,r,t));}function V(e,t){if("function"!=typeof e)throw new s("fn",["Function","AsyncFunction"],e);async function r(t,r){return await e(t,r)?t:q}return F.call(this,r,t)}class W extends u{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}}async function K(e,t,i){var n,a;if("function"!=typeof e)throw new s("reducer",["Function","AsyncFunction"],e);null!=i&&y(i,"options"),(null==i?void 0:i.signal)!=null&&g(i.signal,"options.signal");let o=arguments.length>1;if(null!=i&&null!=(n=i.signal)&&n.aborted){let e=new m(void 0,{cause:i.signal.reason});throw this.once("error",()=>{}),await M(this.destroy(e)),e}let f=new r,h=f.signal;null!=i&&i.signal&&i.signal.addEventListener("abort",()=>f.abort(),{once:!0,[w]:this,[_]:!0});let u=!1;try{for await(let r of this){if(u=!0,null!=i&&null!=(a=i.signal)&&a.aborted)throw new m;o?t=await e(t,r,{signal:h}):(t=r,o=!0)}if(!u&&!o)throw new W}finally{f.abort()}return t}async function Q(e){null!=e&&y(e,"options"),(null==e?void 0:e.signal)!=null&&g(e.signal,"options.signal");let t=[];for await(let i of this){var r;if(null!=e&&null!=(r=e.signal)&&r.aborted)throw new m(void 0,{cause:e.signal.reason});P(t,i)}return t}function G(e){if(O(e=j(e)))return 0;if(e<0)throw new p("number",">= 0",e);return e}t.exports.streamReturningOperators={asIndexedPairs:A(function(e){return null!=e&&y(e,"options"),(null==e?void 0:e.signal)!=null&&g(e.signal,"options.signal"),(async function*(){let t=0;for await(let i of this){var r;if(null!=e&&null!=(r=e.signal)&&r.aborted)throw new m({cause:e.signal.reason});yield[t++,i]}}).call(this)},"readable.asIndexedPairs will be removed in a future version."),drop:function(e,t){return null!=t&&y(t,"options"),(null==t?void 0:t.signal)!=null&&g(t.signal,"options.signal"),e=G(e),(async function*(){var r,i;if(null!=t&&null!=(r=t.signal)&&r.aborted)throw new m;for await(let r of this){if(null!=t&&null!=(i=t.signal)&&i.aborted)throw new m;e--<=0&&(yield r)}}).call(this)},filter:V,flatMap:function(e,t){let r=F.call(this,e,t);return(async function*(){for await(let e of r)yield*e}).call(this)},map:F,take:function(e,t){return null!=t&&y(t,"options"),(null==t?void 0:t.signal)!=null&&g(t.signal,"options.signal"),e=G(e),(async function*(){var r,i;if(null!=t&&null!=(r=t.signal)&&r.aborted)throw new m;for await(let r of this){if(null!=t&&null!=(i=t.signal)&&i.aborted)throw new m;if(e-- >0&&(yield r),e<=0)return}}).call(this)},compose:function(e,t){if(null!=t&&y(t,"options"),(null==t?void 0:t.signal)!=null&&g(t.signal,"options.signal"),k(e)&&!E(e))throw new n("stream",e,"must be writable");let r=x(this,e);return null!=t&&t.signal&&S(t.signal,r),r}},t.exports.promiseReturningOperators={every:Z,forEach:H,reduce:K,toArray:Q,some:z,find:U}}),O=r((e,t)=>{var{ArrayPrototypePop:r,Promise:n}=i(),{isIterable:a,isNodeStream:s,isWebStream:o}=d(),{pipelineImpl:f}=I(),{finished:h}=c();C(),t.exports={finished:h,pipeline:function(...e){return new n((t,i)=>{let n,h,u=e[e.length-1];if(u&&"object"==typeof u&&!s(u)&&!a(u)&&!o(u)){let t=r(e);n=t.signal,h=t.end}f(e,(e,r)=>{e?i(e):t(r)},{signal:n,end:h})})}}}),C=r((e,t)=>{var{Buffer:r}=(ek(),p(b)),{ObjectDefineProperty:n,ObjectKeys:s,ReflectApply:o}=i(),{promisify:{custom:h}}=f(),{streamReturningOperators:u,promiseReturningOperators:y}=j(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:_}}=a(),M=T(),{setDefaultHighWaterMark:x,getDefaultHighWaterMark:k}=w(),{pipeline:C}=I(),{destroyer:N}=m(),D=c(),L=O(),$=d(),q=t.exports=g().Stream;for(let e of(q.isDestroyed=$.isDestroyed,q.isDisturbed=$.isDisturbed,q.isErrored=$.isErrored,q.isReadable=$.isReadable,q.isWritable=$.isWritable,q.Readable=S(),s(u))){let t=function(...e){if(new.target)throw _();return q.Readable.from(o(r,this,e))},r=u[e];n(t,"name",{__proto__:null,value:r.name}),n(t,"length",{__proto__:null,value:r.length}),n(q.Readable.prototype,e,{__proto__:null,value:t,enumerable:!1,configurable:!0,writable:!0})}for(let e of s(y)){let t=function(...e){if(new.target)throw _();return o(r,this,e)},r=y[e];n(t,"name",{__proto__:null,value:r.name}),n(t,"length",{__proto__:null,value:r.length}),n(q.Readable.prototype,e,{__proto__:null,value:t,enumerable:!1,configurable:!0,writable:!0})}q.Writable=E(),q.Duplex=A(),q.Transform=P(),q.PassThrough=R(),q.pipeline=C;var{addAbortSignal:B}=v();q.addAbortSignal=B,q.finished=D,q.destroy=N,q.compose=M,q.setDefaultHighWaterMark=x,q.getDefaultHighWaterMark=k,n(q,"promises",{__proto__:null,configurable:!0,enumerable:!0,get:()=>L}),n(C,h,{__proto__:null,enumerable:!0,get:()=>L.pipeline}),n(D,h,{__proto__:null,enumerable:!0,get:()=>L.finished}),q.Stream=q,q._isUint8Array=function(e){return e instanceof Uint8Array},q._uint8ArrayToBuffer=function(e){return r.from(e.buffer,e.byteOffset,e.byteLength)}});t.exports=r((e,t)=>{tD();{let e=C(),r=O(),i=e.Readable.destroy;t.exports=e.Readable,t.exports._uint8ArrayToBuffer=e._uint8ArrayToBuffer,t.exports._isUint8Array=e._isUint8Array,t.exports.isDisturbed=e.isDisturbed,t.exports.isErrored=e.isErrored,t.exports.isReadable=e.isReadable,t.exports.Readable=e.Readable,t.exports.Writable=e.Writable,t.exports.Duplex=e.Duplex,t.exports.Transform=e.Transform,t.exports.PassThrough=e.PassThrough,t.exports.addAbortSignal=e.addAbortSignal,t.exports.finished=e.finished,t.exports.destroy=e.destroy,t.exports.destroy=i,t.exports.pipeline=e.pipeline,t.exports.compose=e.compose,Object.defineProperty(e,"promises",{configurable:!0,enumerable:!0,get:()=>r}),t.exports.Stream=e.Stream}t.exports.default=t.exports})()}),tL={};function t$(){return iV}g(tL,{webcrypto:()=>iW,rng:()=>ih,randomUUID:()=>iY,randomFillSync:()=>iZ,randomFill:()=>iz,randomBytes:()=>iu,publicEncrypt:()=>i$,publicDecrypt:()=>iB,pseudoRandomBytes:()=>io,prng:()=>is,privateEncrypt:()=>iq,privateDecrypt:()=>iF,pbkdf2Sync:()=>iv,pbkdf2:()=>ig,listCiphers:()=>iA,getRandomValues:()=>iJ,getHashes:()=>im,getDiffieHellman:()=>iI,getCurves:()=>t$,getCiphers:()=>ik,default:()=>iK,createVerify:()=>iN,createSign:()=>iO,createHmac:()=>ip,createHash:()=>id,createECDH:()=>iL,createDiffieHellmanGroup:()=>iR,createDiffieHellman:()=>iT,createDecipheriv:()=>iE,createDecipher:()=>ix,createCredentials:()=>iU,createCipheriv:()=>i_,createCipher:()=>iy,constants:()=>iH,Verify:()=>iD,Sign:()=>iC,Hmac:()=>ic,Hash:()=>il,DiffieHellmanGroup:()=>iP,DiffieHellman:()=>ij,Decipheriv:()=>iS,Decipher:()=>iM,DEFAULT_ENCODING:()=>iG,Cipheriv:()=>iw,Cipher:()=>ib});var tq,tB,tF,tz,tZ,tU,tH,tV,tW,tK,tQ,tG,tJ,tY,tX,t0,t1,t2,t3,t6,t4,t9,t5,t8,t7,re,rt,rr,ri,rn,ra,rs,ro,rf,rh,ru,rl,rd,rc,rp,rm,rg,rv,rb,ry,rw,r_,rM,rx,rS,rE,rk,rA,rP,rR,rI,rT,rj,rO,rC,rN,rD,rL,r$,rq,rB,rF,rz,rZ,rU,rH,rV,rW,rK,rQ,rG,rJ,rY,rX,r0,r1,r2,r3,r6,r4,r9,r5,r8,r7,ie,it,ir,ii,ia,is,io,ih,iu,il,id,ic,ip,im,ig,iv,ib,iy,iw,i_,iM,ix,iS,iE,ik,iA,iP,iR,iI,iT,ij,iO,iC,iN,iD,iL,i$,iq,iB,iF,iz,iZ,iU,iH,iV,iW,iK,iQ=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),iG="buffer",iJ=e=>crypto.getRandomValues(e),iY=()=>crypto.randomUUID(),iX=v(()=>{tq=Object.create,({getPrototypeOf:tB,defineProperty:tF,getOwnPropertyNames:tz}=Object),tZ=Object.prototype.hasOwnProperty,tU=iQ((e,t)=>{t.exports=(iX(),p(tL)).randomBytes}),tH=iQ((e,t)=>{t.exports=(iX(),p(tL)).createHash}),tV=iQ((e,t)=>{t.exports=(iX(),p(tL)).createHmac}),tW=iQ((e,t)=>{t.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"}}}),tK=iQ((e,t)=>{t.exports=function(e,t){if("number"!=typeof e)throw TypeError("Iterations not a number");if(e<0)throw TypeError("Bad iterations");if("number"!=typeof t)throw TypeError("Key length not a number");if(t<0||t>0x3fffffff||t!=t)throw TypeError("Bad key length")}}),tQ=iQ((e,t)=>{t.exports=globalThis.process&&globalThis.process.browser?"utf-8":globalThis.process&&globalThis.process.version?parseInt(n.version.split(".")[0].slice(1),10)>=6?"utf-8":"binary":"utf-8"}),tG=iQ((e,t)=>{var r=(ek(),p(b)),i=r.Buffer;function n(e,t){for(var r in e)t[r]=e[r]}function a(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=r:(n(r,e),e.Buffer=a),a.prototype=Object.create(i.prototype),n(i,a),a.from=function(e,t,r){if("number"==typeof e)throw TypeError("Argument must not be a number");return i(e,t,r)},a.alloc=function(e,t,r){if("number"!=typeof e)throw TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},a.allocUnsafe=function(e){if("number"!=typeof e)throw TypeError("Argument must be a number");return i(e)},a.allocUnsafeSlow=function(e){if("number"!=typeof e)throw TypeError("Argument must be a number");return r.SlowBuffer(e)}}),tJ=iQ((e,t)=>{var r=tG().Buffer;t.exports=function(e,t,i){if(r.isBuffer(e))return e;if("string"==typeof e)return r.from(e,t);if(ArrayBuffer.isView(e))return r.from(e.buffer);throw TypeError(i+" must be a string, a Buffer, a typed array or a DataView")}}),tY=iQ((e,t)=>{var r={md5:16,sha1:20,sha224:28,sha256:32,sha384:48,sha512:64,rmd160:20,ripemd160:20},i=tV(),n=tG().Buffer,a=tK(),s=tQ(),o=tJ();t.exports=function(e,t,f,h,u){a(f,h),e=o(e,s,"Password"),t=o(t,s,"Salt"),u=u||"sha1";var d=n.allocUnsafe(h),c=n.allocUnsafe(t.length+4);t.copy(c,0,0,t.length);for(var p=0,m=r[u],g=Math.ceil(h/m),v=1;v<=g;v++){c.writeUInt32BE(v,t.length);for(var b=i(u,e).update(c).digest(),y=b,w=1;w{var r,i,n=tG().Buffer,a=tK(),s=tQ(),o=tY(),f=tJ(),h=globalThis.crypto&&globalThis.crypto.subtle,u={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"},d=[];function c(){return r||(r=globalThis.process&&globalThis.process.nextTick?globalThis.process.nextTick:globalThis.queueMicrotask?globalThis.queueMicrotask:globalThis.setImmediate?globalThis.setImmediate:globalThis.setTimeout)}function p(e,t,r,i,a){return h.importKey("raw",e,{name:"PBKDF2"},!1,["deriveBits"]).then(function(e){return h.deriveBits({name:"PBKDF2",salt:t,iterations:r,hash:{name:a}},e,i<<3)}).then(function(e){return n.from(e)})}t.exports=function(e,t,r,m,g,v){"function"==typeof g&&(v=g,g=void 0);var b,y,w=u[(g=g||"sha1").toLowerCase()];if(!w||"function"!=typeof globalThis.Promise)return void c()(function(){var i;try{i=o(e,t,r,m,g)}catch(e){return v(e)}v(null,i)});if(a(r,m),e=f(e,s,"Password"),t=f(t,s,"Salt"),"function"!=typeof v)throw Error("No callback provided to pbkdf2");b=(function(e){if(globalThis.process&&!globalThis.process.browser||!h||!h.importKey||!h.deriveBits)return Promise.resolve(!1);if(void 0!==d[e])return d[e];var t=p(i=i||n.alloc(8),i,10,128,e).then(function(){return!0}).catch(function(){return!1});return d[e]=t,t})(w).then(function(i){return i?p(e,t,r,m,w):o(e,t,r,m,g)}),y=v,b.then(function(e){c()(function(){y(null,e)})},function(e){c()(function(){y(e)})})}}),t0=iQ(e=>{var t=(iX(),p(tL)),r=tK(),i=tQ(),n=tJ();t.pbkdf2Sync&&-1!==t.pbkdf2Sync.toString().indexOf("keylen, digest")?(e.pbkdf2Sync=function(e,a,s,o,f){return r(s,o),e=n(e,i,"Password"),a=n(a,i,"Salt"),f=f||"sha1",t.pbkdf2Sync(e,a,s,o,f)},e.pbkdf2=function(e,a,s,o,f,h){if(r(s,o),e=n(e,i,"Password"),a=n(a,i,"Salt"),"function"==typeof f&&(h=f,f="sha1"),"function"!=typeof h)throw Error("No callback provided to pbkdf2");return t.pbkdf2(e,a,s,o,f,h)}):(e.pbkdf2Sync=tY(),e.pbkdf2=tX())}),t1=iQ(e=>{var t=(iX(),p(tL));e.createCipher=e.Cipher=t.createCipher,e.createCipheriv=e.Cipheriv=t.createCipheriv,e.createDecipher=e.Decipher=t.createDecipher,e.createDecipheriv=e.Decipheriv=t.createDecipheriv,e.listCiphers=e.getCiphers=t.getCiphers}),t2=iQ(e=>{var t=(iX(),p(tL));e.DiffieHellmanGroup=t.DiffieHellmanGroup,e.createDiffieHellmanGroup=t.createDiffieHellmanGroup,e.getDiffieHellman=t.getDiffieHellman,e.createDiffieHellman=t.createDiffieHellman,e.DiffieHellman=t.DiffieHellman}),t3=iQ(e=>{var t=(iX(),p(tL));e.createSign=t.createSign,e.Sign=t.Sign,e.createVerify=t.createVerify,e.Verify=t.Verify}),t6=iQ((e,t)=>{t.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 ",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"}}}),t4=iQ((e,t)=>{!function(e,t){function r(e,t){if(!e)throw Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function n(e,t,r){if(n.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&(("le"===t||"be"===t)&&(r=t,t=10),this._init(e||0,t||10,r||"be"))}"object"==typeof e?e.exports=n:t.BN=n,n.BN=n,n.wordSize=26;try{f="u">typeof window&&"u">typeof window.Buffer?window.Buffer:(ek(),p(b)).Buffer}catch(e){}function a(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function s(e,t,r){var i=a(e,r);return r-1>=t&&(i|=a(e,r-1)<<4),i}function o(e,t,r,i){for(var n=0,a=Math.min(e.length,r),s=t;s=49)?n+=o-49+10:o>=17?n+=o-17+10:n+=o}return n}n.isBN=function(e){return e instanceof n||null!==e&&"object"==typeof e&&e.constructor.wordSize===n.wordSize&&Array.isArray(e.words)},n.max=function(e,t){return e.cmp(t)>0?e:t},n.min=function(e,t){return 0>e.cmp(t)?e:t},n.prototype._init=function(e,t,i){if("number"==typeof e)return this._initNumber(e,t,i);if("object"==typeof e)return this._initArray(e,t,i);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var n=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n=0;n-=3)s=e[n]|e[n-1]<<8|e[n-2]<<16,this.words[a]|=s<>>26-o&0x3ffffff,(o+=24)>=26&&(o-=26,a++);else if("le"===i)for(n=0,a=0;n>>26-o&0x3ffffff,(o+=24)>=26&&(o-=26,a++);return this.strip()},n.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=Array(this.length);for(var i=0;i=t;i-=2)(n=s(e,t,i)<=18)?(a-=18,o+=1,this.words[o]|=n>>>26):a+=8;else for(i=(e.length-t)%2==0?t+1:t;i=18)?(a-=18,o+=1,this.words[o]|=n>>>26):a+=8;this.strip()},n.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=0x3ffffff;n*=t)i++;i--,n=n/t|0;for(var a=e.length-r,s=a%i,f=Math.min(a,a-s)+r,h=0,u=r;u1&&0===this.words[this.length-1];)this.length--;return this._normSign()},n.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},n.prototype.inspect=function(){return(this.red?""};var f,h=["","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"],u=[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],d=[0,0,0x2000000,0x290d741,0x1000000,0x2e90edd,0x39aa400,0x267bf47,0x1000000,0x290d741,1e7,0x12959c3,0x222c000,0x3bd7765,7529536,0xadcea1,0x1000000,0x1704f61,0x206fc40,0x2cddcf9,64e6,4084101,5153632,6436343,7962624,9765625,0xb54ba0,0xdaf26b,0x1069c00,0x138f9ad,243e5,0x1b4d89f,0x2000000,0x25528a1,0x2b54a20,0x3216b93,0x39aa400];function c(e,t,r){r.negative=t.negative^e.negative;var i=e.length+t.length|0;r.length=i,i=i-1|0;var n=0|e.words[0],a=0|t.words[0],s=n*a,o=0x3ffffff&s,f=s/0x4000000|0;r.words[0]=o;for(var h=1;h>>26,d=0x3ffffff&f,c=Math.min(h,t.length-1),p=Math.max(0,h-e.length+1);p<=c;p++){var m=h-p|0;u+=(s=(n=0|e.words[m])*(a=0|t.words[p])+d)/0x4000000|0,d=0x3ffffff&s}r.words[h]=0|d,f=0|u}return 0!==f?r.words[h]=0|f:r.length--,r.strip()}(n.prototype.toString=function(e,t){if(t=0|t||1,16===(e=e||10)||"hex"===e){for(var i="",n=0,a=0,s=0;s>>24-n&0xffffff,(n+=2)>=26&&(n-=26,s--),i=0!==a||s!==this.length-1?h[6-f.length]+f+i:f+i}for(0!==a&&(i=a.toString(16)+i);i.length%t!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}if(e===(0|e)&&e>=2&&e<=36){var c=u[e],p=d[e];i="";var m=this.clone();for(m.negative=0;!m.isZero();){var g=m.modn(p).toString(e);i=(m=m.idivn(p)).isZero()?g+i:h[c-g.length]+g+i}for(this.isZero()&&(i="0"+i);i.length%t!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}r(!1,"Base should be between 2 and 36")},n.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=0x4000000*this.words[1]:3===this.length&&1===this.words[2]?e+=0x10000000000000+0x4000000*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},n.prototype.toJSON=function(){return this.toString(16)},n.prototype.toBuffer=function(e,t){return r("u">typeof f),this.toArrayLike(f,e,t)},n.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},n.prototype.toArrayLike=function(e,t,i){var n=this.byteLength(),a=i||Math.max(1,n);r(n<=a,"byte array longer than desired length"),r(a>0,"Requested array length <= 0"),this.strip();var s,o,f=new e(a),h=this.clone();if("le"===t){for(o=0;!h.isZero();o++)s=h.andln(255),h.iushrn(8),f[o]=s;for(;o=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},n.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return(8191&t)==0&&(r+=13,t>>>=13),(127&t)==0&&(r+=7,t>>>=7),(15&t)==0&&(r+=4,t>>>=4),(3&t)==0&&(r+=2,t>>>=2),(1&t)==0&&r++,r},n.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return(this.length-1)*26+t},n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},n.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},n.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},n.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},n.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var i=0;ie.length?this.clone().ixor(e):e.clone().ixor(this)},n.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},n.prototype.inotn=function(e){r("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),i=e%26;this._expand(t),i>0&&t--;for(var n=0;n0&&(this.words[n]=~this.words[n]&0x3ffffff>>26-i),this.strip()},n.prototype.notn=function(e){return this.clone().inotn(e)},n.prototype.setn=function(e,t){r("number"==typeof e&&e>=0);var i=e/26|0,n=e%26;return(this._expand(i+1),t)?this.words[i]=this.words[i]|1<e.length?(r=this,i=e):(r=e,i=this);for(var t,r,i,n=0,a=0;a>>26;for(;0!==n&&a>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;ae.length?this.clone().iadd(e):e.clone().iadd(this)},n.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t,r,i=this.iadd(e);return e.negative=1,i._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(t=this,r=e):(t=e,r=this);for(var a=0,s=0;s>26,this.words[s]=0x3ffffff&i;for(;0!==a&&s>26,this.words[s]=0x3ffffff&i;if(0===a&&s>>13,p=0|s[1],m=8191&p,g=p>>>13,v=0|s[2],b=8191&v,y=v>>>13,w=0|s[3],_=8191&w,M=w>>>13,x=0|s[4],S=8191&x,E=x>>>13,k=0|s[5],A=8191&k,P=k>>>13,R=0|s[6],I=8191&R,T=R>>>13,j=0|s[7],O=8191&j,C=j>>>13,N=0|s[8],D=8191&N,L=N>>>13,$=0|s[9],q=8191&$,B=$>>>13,F=0|o[0],z=8191&F,Z=F>>>13,U=0|o[1],H=8191&U,V=U>>>13,W=0|o[2],K=8191&W,Q=W>>>13,G=0|o[3],J=8191&G,Y=G>>>13,X=0|o[4],ee=8191&X,et=X>>>13,er=0|o[5],ei=8191&er,en=er>>>13,ea=0|o[6],es=8191&ea,eo=ea>>>13,ef=0|o[7],eh=8191&ef,eu=ef>>>13,el=0|o[8],ed=8191&el,ec=el>>>13,ep=0|o[9],em=8191&ep,eg=ep>>>13;r.negative=e.negative^t.negative,r.length=19,i=Math.imul(d,z),n=(n=Math.imul(d,Z))+Math.imul(c,z)|0,a=Math.imul(c,Z);var ev=(h+i|0)+((8191&n)<<13)|0;h=(a+(n>>>13)|0)+(ev>>>26)|0,ev&=0x3ffffff,i=Math.imul(m,z),n=(n=Math.imul(m,Z))+Math.imul(g,z)|0,a=Math.imul(g,Z),i=i+Math.imul(d,H)|0,n=(n=n+Math.imul(d,V)|0)+Math.imul(c,H)|0,a=a+Math.imul(c,V)|0;var eb=(h+i|0)+((8191&n)<<13)|0;h=(a+(n>>>13)|0)+(eb>>>26)|0,eb&=0x3ffffff,i=Math.imul(b,z),n=(n=Math.imul(b,Z))+Math.imul(y,z)|0,a=Math.imul(y,Z),i=i+Math.imul(m,H)|0,n=(n=n+Math.imul(m,V)|0)+Math.imul(g,H)|0,a=a+Math.imul(g,V)|0,i=i+Math.imul(d,K)|0,n=(n=n+Math.imul(d,Q)|0)+Math.imul(c,K)|0,a=a+Math.imul(c,Q)|0;var ey=(h+i|0)+((8191&n)<<13)|0;h=(a+(n>>>13)|0)+(ey>>>26)|0,ey&=0x3ffffff,i=Math.imul(_,z),n=(n=Math.imul(_,Z))+Math.imul(M,z)|0,a=Math.imul(M,Z),i=i+Math.imul(b,H)|0,n=(n=n+Math.imul(b,V)|0)+Math.imul(y,H)|0,a=a+Math.imul(y,V)|0,i=i+Math.imul(m,K)|0,n=(n=n+Math.imul(m,Q)|0)+Math.imul(g,K)|0,a=a+Math.imul(g,Q)|0,i=i+Math.imul(d,J)|0,n=(n=n+Math.imul(d,Y)|0)+Math.imul(c,J)|0,a=a+Math.imul(c,Y)|0;var ew=(h+i|0)+((8191&n)<<13)|0;h=(a+(n>>>13)|0)+(ew>>>26)|0,ew&=0x3ffffff,i=Math.imul(S,z),n=(n=Math.imul(S,Z))+Math.imul(E,z)|0,a=Math.imul(E,Z),i=i+Math.imul(_,H)|0,n=(n=n+Math.imul(_,V)|0)+Math.imul(M,H)|0,a=a+Math.imul(M,V)|0,i=i+Math.imul(b,K)|0,n=(n=n+Math.imul(b,Q)|0)+Math.imul(y,K)|0,a=a+Math.imul(y,Q)|0,i=i+Math.imul(m,J)|0,n=(n=n+Math.imul(m,Y)|0)+Math.imul(g,J)|0,a=a+Math.imul(g,Y)|0,i=i+Math.imul(d,ee)|0,n=(n=n+Math.imul(d,et)|0)+Math.imul(c,ee)|0,a=a+Math.imul(c,et)|0;var e_=(h+i|0)+((8191&n)<<13)|0;h=(a+(n>>>13)|0)+(e_>>>26)|0,e_&=0x3ffffff,i=Math.imul(A,z),n=(n=Math.imul(A,Z))+Math.imul(P,z)|0,a=Math.imul(P,Z),i=i+Math.imul(S,H)|0,n=(n=n+Math.imul(S,V)|0)+Math.imul(E,H)|0,a=a+Math.imul(E,V)|0,i=i+Math.imul(_,K)|0,n=(n=n+Math.imul(_,Q)|0)+Math.imul(M,K)|0,a=a+Math.imul(M,Q)|0,i=i+Math.imul(b,J)|0,n=(n=n+Math.imul(b,Y)|0)+Math.imul(y,J)|0,a=a+Math.imul(y,Y)|0,i=i+Math.imul(m,ee)|0,n=(n=n+Math.imul(m,et)|0)+Math.imul(g,ee)|0,a=a+Math.imul(g,et)|0,i=i+Math.imul(d,ei)|0,n=(n=n+Math.imul(d,en)|0)+Math.imul(c,ei)|0,a=a+Math.imul(c,en)|0;var eM=(h+i|0)+((8191&n)<<13)|0;h=(a+(n>>>13)|0)+(eM>>>26)|0,eM&=0x3ffffff,i=Math.imul(I,z),n=(n=Math.imul(I,Z))+Math.imul(T,z)|0,a=Math.imul(T,Z),i=i+Math.imul(A,H)|0,n=(n=n+Math.imul(A,V)|0)+Math.imul(P,H)|0,a=a+Math.imul(P,V)|0,i=i+Math.imul(S,K)|0,n=(n=n+Math.imul(S,Q)|0)+Math.imul(E,K)|0,a=a+Math.imul(E,Q)|0,i=i+Math.imul(_,J)|0,n=(n=n+Math.imul(_,Y)|0)+Math.imul(M,J)|0,a=a+Math.imul(M,Y)|0,i=i+Math.imul(b,ee)|0,n=(n=n+Math.imul(b,et)|0)+Math.imul(y,ee)|0,a=a+Math.imul(y,et)|0,i=i+Math.imul(m,ei)|0,n=(n=n+Math.imul(m,en)|0)+Math.imul(g,ei)|0,a=a+Math.imul(g,en)|0,i=i+Math.imul(d,es)|0,n=(n=n+Math.imul(d,eo)|0)+Math.imul(c,es)|0,a=a+Math.imul(c,eo)|0;var ex=(h+i|0)+((8191&n)<<13)|0;h=(a+(n>>>13)|0)+(ex>>>26)|0,ex&=0x3ffffff,i=Math.imul(O,z),n=(n=Math.imul(O,Z))+Math.imul(C,z)|0,a=Math.imul(C,Z),i=i+Math.imul(I,H)|0,n=(n=n+Math.imul(I,V)|0)+Math.imul(T,H)|0,a=a+Math.imul(T,V)|0,i=i+Math.imul(A,K)|0,n=(n=n+Math.imul(A,Q)|0)+Math.imul(P,K)|0,a=a+Math.imul(P,Q)|0,i=i+Math.imul(S,J)|0,n=(n=n+Math.imul(S,Y)|0)+Math.imul(E,J)|0,a=a+Math.imul(E,Y)|0,i=i+Math.imul(_,ee)|0,n=(n=n+Math.imul(_,et)|0)+Math.imul(M,ee)|0,a=a+Math.imul(M,et)|0,i=i+Math.imul(b,ei)|0,n=(n=n+Math.imul(b,en)|0)+Math.imul(y,ei)|0,a=a+Math.imul(y,en)|0,i=i+Math.imul(m,es)|0,n=(n=n+Math.imul(m,eo)|0)+Math.imul(g,es)|0,a=a+Math.imul(g,eo)|0,i=i+Math.imul(d,eh)|0,n=(n=n+Math.imul(d,eu)|0)+Math.imul(c,eh)|0,a=a+Math.imul(c,eu)|0;var eS=(h+i|0)+((8191&n)<<13)|0;h=(a+(n>>>13)|0)+(eS>>>26)|0,eS&=0x3ffffff,i=Math.imul(D,z),n=(n=Math.imul(D,Z))+Math.imul(L,z)|0,a=Math.imul(L,Z),i=i+Math.imul(O,H)|0,n=(n=n+Math.imul(O,V)|0)+Math.imul(C,H)|0,a=a+Math.imul(C,V)|0,i=i+Math.imul(I,K)|0,n=(n=n+Math.imul(I,Q)|0)+Math.imul(T,K)|0,a=a+Math.imul(T,Q)|0,i=i+Math.imul(A,J)|0,n=(n=n+Math.imul(A,Y)|0)+Math.imul(P,J)|0,a=a+Math.imul(P,Y)|0,i=i+Math.imul(S,ee)|0,n=(n=n+Math.imul(S,et)|0)+Math.imul(E,ee)|0,a=a+Math.imul(E,et)|0,i=i+Math.imul(_,ei)|0,n=(n=n+Math.imul(_,en)|0)+Math.imul(M,ei)|0,a=a+Math.imul(M,en)|0,i=i+Math.imul(b,es)|0,n=(n=n+Math.imul(b,eo)|0)+Math.imul(y,es)|0,a=a+Math.imul(y,eo)|0,i=i+Math.imul(m,eh)|0,n=(n=n+Math.imul(m,eu)|0)+Math.imul(g,eh)|0,a=a+Math.imul(g,eu)|0,i=i+Math.imul(d,ed)|0,n=(n=n+Math.imul(d,ec)|0)+Math.imul(c,ed)|0,a=a+Math.imul(c,ec)|0;var eE=(h+i|0)+((8191&n)<<13)|0;h=(a+(n>>>13)|0)+(eE>>>26)|0,eE&=0x3ffffff,i=Math.imul(q,z),n=(n=Math.imul(q,Z))+Math.imul(B,z)|0,a=Math.imul(B,Z),i=i+Math.imul(D,H)|0,n=(n=n+Math.imul(D,V)|0)+Math.imul(L,H)|0,a=a+Math.imul(L,V)|0,i=i+Math.imul(O,K)|0,n=(n=n+Math.imul(O,Q)|0)+Math.imul(C,K)|0,a=a+Math.imul(C,Q)|0,i=i+Math.imul(I,J)|0,n=(n=n+Math.imul(I,Y)|0)+Math.imul(T,J)|0,a=a+Math.imul(T,Y)|0,i=i+Math.imul(A,ee)|0,n=(n=n+Math.imul(A,et)|0)+Math.imul(P,ee)|0,a=a+Math.imul(P,et)|0,i=i+Math.imul(S,ei)|0,n=(n=n+Math.imul(S,en)|0)+Math.imul(E,ei)|0,a=a+Math.imul(E,en)|0,i=i+Math.imul(_,es)|0,n=(n=n+Math.imul(_,eo)|0)+Math.imul(M,es)|0,a=a+Math.imul(M,eo)|0,i=i+Math.imul(b,eh)|0,n=(n=n+Math.imul(b,eu)|0)+Math.imul(y,eh)|0,a=a+Math.imul(y,eu)|0,i=i+Math.imul(m,ed)|0,n=(n=n+Math.imul(m,ec)|0)+Math.imul(g,ed)|0,a=a+Math.imul(g,ec)|0,i=i+Math.imul(d,em)|0,n=(n=n+Math.imul(d,eg)|0)+Math.imul(c,em)|0,a=a+Math.imul(c,eg)|0;var ek=(h+i|0)+((8191&n)<<13)|0;h=(a+(n>>>13)|0)+(ek>>>26)|0,ek&=0x3ffffff,i=Math.imul(q,H),n=(n=Math.imul(q,V))+Math.imul(B,H)|0,a=Math.imul(B,V),i=i+Math.imul(D,K)|0,n=(n=n+Math.imul(D,Q)|0)+Math.imul(L,K)|0,a=a+Math.imul(L,Q)|0,i=i+Math.imul(O,J)|0,n=(n=n+Math.imul(O,Y)|0)+Math.imul(C,J)|0,a=a+Math.imul(C,Y)|0,i=i+Math.imul(I,ee)|0,n=(n=n+Math.imul(I,et)|0)+Math.imul(T,ee)|0,a=a+Math.imul(T,et)|0,i=i+Math.imul(A,ei)|0,n=(n=n+Math.imul(A,en)|0)+Math.imul(P,ei)|0,a=a+Math.imul(P,en)|0,i=i+Math.imul(S,es)|0,n=(n=n+Math.imul(S,eo)|0)+Math.imul(E,es)|0,a=a+Math.imul(E,eo)|0,i=i+Math.imul(_,eh)|0,n=(n=n+Math.imul(_,eu)|0)+Math.imul(M,eh)|0,a=a+Math.imul(M,eu)|0,i=i+Math.imul(b,ed)|0,n=(n=n+Math.imul(b,ec)|0)+Math.imul(y,ed)|0,a=a+Math.imul(y,ec)|0,i=i+Math.imul(m,em)|0,n=(n=n+Math.imul(m,eg)|0)+Math.imul(g,em)|0,a=a+Math.imul(g,eg)|0;var eA=(h+i|0)+((8191&n)<<13)|0;h=(a+(n>>>13)|0)+(eA>>>26)|0,eA&=0x3ffffff,i=Math.imul(q,K),n=(n=Math.imul(q,Q))+Math.imul(B,K)|0,a=Math.imul(B,Q),i=i+Math.imul(D,J)|0,n=(n=n+Math.imul(D,Y)|0)+Math.imul(L,J)|0,a=a+Math.imul(L,Y)|0,i=i+Math.imul(O,ee)|0,n=(n=n+Math.imul(O,et)|0)+Math.imul(C,ee)|0,a=a+Math.imul(C,et)|0,i=i+Math.imul(I,ei)|0,n=(n=n+Math.imul(I,en)|0)+Math.imul(T,ei)|0,a=a+Math.imul(T,en)|0,i=i+Math.imul(A,es)|0,n=(n=n+Math.imul(A,eo)|0)+Math.imul(P,es)|0,a=a+Math.imul(P,eo)|0,i=i+Math.imul(S,eh)|0,n=(n=n+Math.imul(S,eu)|0)+Math.imul(E,eh)|0,a=a+Math.imul(E,eu)|0,i=i+Math.imul(_,ed)|0,n=(n=n+Math.imul(_,ec)|0)+Math.imul(M,ed)|0,a=a+Math.imul(M,ec)|0,i=i+Math.imul(b,em)|0,n=(n=n+Math.imul(b,eg)|0)+Math.imul(y,em)|0,a=a+Math.imul(y,eg)|0;var eP=(h+i|0)+((8191&n)<<13)|0;h=(a+(n>>>13)|0)+(eP>>>26)|0,eP&=0x3ffffff,i=Math.imul(q,J),n=(n=Math.imul(q,Y))+Math.imul(B,J)|0,a=Math.imul(B,Y),i=i+Math.imul(D,ee)|0,n=(n=n+Math.imul(D,et)|0)+Math.imul(L,ee)|0,a=a+Math.imul(L,et)|0,i=i+Math.imul(O,ei)|0,n=(n=n+Math.imul(O,en)|0)+Math.imul(C,ei)|0,a=a+Math.imul(C,en)|0,i=i+Math.imul(I,es)|0,n=(n=n+Math.imul(I,eo)|0)+Math.imul(T,es)|0,a=a+Math.imul(T,eo)|0,i=i+Math.imul(A,eh)|0,n=(n=n+Math.imul(A,eu)|0)+Math.imul(P,eh)|0,a=a+Math.imul(P,eu)|0,i=i+Math.imul(S,ed)|0,n=(n=n+Math.imul(S,ec)|0)+Math.imul(E,ed)|0,a=a+Math.imul(E,ec)|0,i=i+Math.imul(_,em)|0,n=(n=n+Math.imul(_,eg)|0)+Math.imul(M,em)|0,a=a+Math.imul(M,eg)|0;var eR=(h+i|0)+((8191&n)<<13)|0;h=(a+(n>>>13)|0)+(eR>>>26)|0,eR&=0x3ffffff,i=Math.imul(q,ee),n=(n=Math.imul(q,et))+Math.imul(B,ee)|0,a=Math.imul(B,et),i=i+Math.imul(D,ei)|0,n=(n=n+Math.imul(D,en)|0)+Math.imul(L,ei)|0,a=a+Math.imul(L,en)|0,i=i+Math.imul(O,es)|0,n=(n=n+Math.imul(O,eo)|0)+Math.imul(C,es)|0,a=a+Math.imul(C,eo)|0,i=i+Math.imul(I,eh)|0,n=(n=n+Math.imul(I,eu)|0)+Math.imul(T,eh)|0,a=a+Math.imul(T,eu)|0,i=i+Math.imul(A,ed)|0,n=(n=n+Math.imul(A,ec)|0)+Math.imul(P,ed)|0,a=a+Math.imul(P,ec)|0,i=i+Math.imul(S,em)|0,n=(n=n+Math.imul(S,eg)|0)+Math.imul(E,em)|0,a=a+Math.imul(E,eg)|0;var eI=(h+i|0)+((8191&n)<<13)|0;h=(a+(n>>>13)|0)+(eI>>>26)|0,eI&=0x3ffffff,i=Math.imul(q,ei),n=(n=Math.imul(q,en))+Math.imul(B,ei)|0,a=Math.imul(B,en),i=i+Math.imul(D,es)|0,n=(n=n+Math.imul(D,eo)|0)+Math.imul(L,es)|0,a=a+Math.imul(L,eo)|0,i=i+Math.imul(O,eh)|0,n=(n=n+Math.imul(O,eu)|0)+Math.imul(C,eh)|0,a=a+Math.imul(C,eu)|0,i=i+Math.imul(I,ed)|0,n=(n=n+Math.imul(I,ec)|0)+Math.imul(T,ed)|0,a=a+Math.imul(T,ec)|0,i=i+Math.imul(A,em)|0,n=(n=n+Math.imul(A,eg)|0)+Math.imul(P,em)|0,a=a+Math.imul(P,eg)|0;var eT=(h+i|0)+((8191&n)<<13)|0;h=(a+(n>>>13)|0)+(eT>>>26)|0,eT&=0x3ffffff,i=Math.imul(q,es),n=(n=Math.imul(q,eo))+Math.imul(B,es)|0,a=Math.imul(B,eo),i=i+Math.imul(D,eh)|0,n=(n=n+Math.imul(D,eu)|0)+Math.imul(L,eh)|0,a=a+Math.imul(L,eu)|0,i=i+Math.imul(O,ed)|0,n=(n=n+Math.imul(O,ec)|0)+Math.imul(C,ed)|0,a=a+Math.imul(C,ec)|0,i=i+Math.imul(I,em)|0,n=(n=n+Math.imul(I,eg)|0)+Math.imul(T,em)|0,a=a+Math.imul(T,eg)|0;var ej=(h+i|0)+((8191&n)<<13)|0;h=(a+(n>>>13)|0)+(ej>>>26)|0,ej&=0x3ffffff,i=Math.imul(q,eh),n=(n=Math.imul(q,eu))+Math.imul(B,eh)|0,a=Math.imul(B,eu),i=i+Math.imul(D,ed)|0,n=(n=n+Math.imul(D,ec)|0)+Math.imul(L,ed)|0,a=a+Math.imul(L,ec)|0,i=i+Math.imul(O,em)|0,n=(n=n+Math.imul(O,eg)|0)+Math.imul(C,em)|0,a=a+Math.imul(C,eg)|0;var eO=(h+i|0)+((8191&n)<<13)|0;h=(a+(n>>>13)|0)+(eO>>>26)|0,eO&=0x3ffffff,i=Math.imul(q,ed),n=(n=Math.imul(q,ec))+Math.imul(B,ed)|0,a=Math.imul(B,ec),i=i+Math.imul(D,em)|0,n=(n=n+Math.imul(D,eg)|0)+Math.imul(L,em)|0,a=a+Math.imul(L,eg)|0;var eC=(h+i|0)+((8191&n)<<13)|0;h=(a+(n>>>13)|0)+(eC>>>26)|0,eC&=0x3ffffff,i=Math.imul(q,em),n=(n=Math.imul(q,eg))+Math.imul(B,em)|0,a=Math.imul(B,eg);var eN=(h+i|0)+((8191&n)<<13)|0;return h=(a+(n>>>13)|0)+(eN>>>26)|0,eN&=0x3ffffff,f[0]=ev,f[1]=eb,f[2]=ey,f[3]=ew,f[4]=e_,f[5]=eM,f[6]=ex,f[7]=eS,f[8]=eE,f[9]=ek,f[10]=eA,f[11]=eP,f[12]=eR,f[13]=eI,f[14]=eT,f[15]=ej,f[16]=eO,f[17]=eC,f[18]=eN,0!==h&&(f[19]=h,r.length++),r};function g(e,t,r){return(new v).mulp(e,t,r)}function v(e,t){this.x=e,this.y=t}Math.imul||(m=c),n.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?m(this,e,t):r<63?c(this,e,t):r<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var i=0,n=0,a=0;a>>26)|0)>>>26,s&=0x3ffffff}r.words[a]=o,i=s,s=n}return 0!==i?r.words[a]=i:r.length--,r.strip()}(this,e,t):g(this,e,t)},v.prototype.makeRBT=function(e){for(var t=Array(e),r=n.prototype._countBits(e)-1,i=0;i>=1;return i},v.prototype.permute=function(e,t,r,i,n,a){for(var s=0;s>>=1)n++;return 1<>>=13,i[2*s+1]=8191&a,a>>>=13;for(s=2*t;s>=26,t+=(n/0x4000000|0)+(a>>>26),this.words[i]=0x3ffffff&a}return 0!==t&&(this.words[i]=t,this.length++),this.length=0===e?1:this.length,this},n.prototype.muln=function(e){return this.clone().imuln(e)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(e){var t=function(e){for(var t=Array(e.bitLength()),r=0;r>>n}return t}(e);if(0===t.length)return new n(1);for(var r=this,i=0;i=0);var t,i=e%26,n=(e-i)/26,a=0x3ffffff>>>26-i<<26-i;if(0!==i){var s=0;for(t=0;t>>26-i}s&&(this.words[t]=s,this.length++)}if(0!==n){for(t=this.length-1;t>=0;t--)this.words[t+n]=this.words[t];for(t=0;t=0);var n=t?(t-t%26)/26:0,a=e%26,s=Math.min((e-a)/26,this.length),o=0x3ffffff^0x3ffffff>>>a<s)for(this.length-=s,f=0;f=0&&(0!==h||f>=n);f--){var u=0|this.words[f];this.words[f]=h<<26-a|u>>>a,h=u&o}return i&&0!==h&&(i.words[i.length++]=h),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},n.prototype.ishrn=function(e,t,i){return r(0===this.negative),this.iushrn(e,t,i)},n.prototype.shln=function(e){return this.clone().ishln(e)},n.prototype.ushln=function(e){return this.clone().iushln(e)},n.prototype.shrn=function(e){return this.clone().ishrn(e)},n.prototype.ushrn=function(e){return this.clone().iushrn(e)},n.prototype.testn=function(e){r("number"==typeof e&&e>=0);var t=e%26,i=(e-t)/26;return!(this.length<=i)&&!!(this.words[i]&1<=0);var t=e%26,i=(e-t)/26;return(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=i)?this:(0!==t&&i++,this.length=Math.min(i,this.length),0!==t&&(this.words[this.length-1]&=0x3ffffff^0x3ffffff>>>t<=0x4000000;t++)(this.words[t]-=0x4000000,t===this.length-1)?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},n.prototype.isubn=function(e){if(r("number"==typeof e),r(e<0x4000000),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(f/0x4000000|0),this.words[n+i]=0x3ffffff&s}for(;n>26,this.words[n+i]=0x3ffffff&s;if(0===o)return this.strip();for(r(-1===o),o=0,n=0;n>26,this.words[n]=0x3ffffff&s;return this.negative=1,this.strip()},n.prototype._wordDiv=function(e,t){var r=this.length-e.length,i=this.clone(),a=e,s=0|a.words[a.length-1];0!=(r=26-this._countBits(s))&&(a=a.ushln(r),i.iushln(r),s=0|a.words[a.length-1]);var o,f=i.length-a.length;if("mod"!==t){(o=new n(null)).length=f+1,o.words=Array(o.length);for(var h=0;h=0;d--){var c=(0|i.words[a.length+d])*0x4000000+(0|i.words[a.length+d-1]);for(c=Math.min(c/s|0,0x3ffffff),i._ishlnsubmul(a,c,d);0!==i.negative;)c--,i.negative=0,i._ishlnsubmul(a,1,d),i.isZero()||(i.negative^=1);o&&(o.words[d]=c)}return o&&o.strip(),i.strip(),"div"!==t&&0!==r&&i.iushrn(r),{div:o||null,mod:i}},n.prototype.divmod=function(e,t,i){var a,s,o;return(r(!e.isZero()),this.isZero())?{div:new n(0),mod:new n(0)}:0!==this.negative&&0===e.negative?(o=this.neg().divmod(e,t),"mod"!==t&&(a=o.div.neg()),"div"!==t&&(s=o.mod.neg(),i&&0!==s.negative)&&s.iadd(e),{div:a,mod:s}):0===this.negative&&0!==e.negative?(o=this.divmod(e.neg(),t),"mod"!==t&&(a=o.div.neg()),{div:a,mod:o.mod}):(this.negative&e.negative)!=0?(o=this.neg().divmod(e.neg(),t),"div"!==t&&(s=o.mod.neg(),i&&0!==s.negative)&&s.isub(e),{div:o.div,mod:s}):e.length>this.length||0>this.cmp(e)?{div:new n(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new n(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new n(this.modn(e.words[0]))}:this._wordDiv(e,t)},n.prototype.div=function(e){return this.divmod(e,"div",!1).div},n.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},n.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},n.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,i=e.ushrn(1),n=e.andln(1),a=r.cmp(i);return a<0||1===n&&0===a?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},n.prototype.modn=function(e){r(e<=0x3ffffff);for(var t=0x4000000%e,i=0,n=this.length-1;n>=0;n--)i=(t*i+(0|this.words[n]))%e;return i},n.prototype.idivn=function(e){r(e<=0x3ffffff);for(var t=0,i=this.length-1;i>=0;i--){var n=(0|this.words[i])+0x4000000*t;this.words[i]=n/e|0,t=n%e}return this.strip()},n.prototype.divn=function(e){return this.clone().idivn(e)},n.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,i=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var a=new n(1),s=new n(0),o=new n(0),f=new n(1),h=0;t.isEven()&&i.isEven();)t.iushrn(1),i.iushrn(1),++h;for(var u=i.clone(),d=t.clone();!t.isZero();){for(var c=0,p=1;(t.words[0]&p)==0&&c<26;++c,p<<=1);if(c>0)for(t.iushrn(c);c-- >0;)(a.isOdd()||s.isOdd())&&(a.iadd(u),s.isub(d)),a.iushrn(1),s.iushrn(1);for(var m=0,g=1;(i.words[0]&g)==0&&m<26;++m,g<<=1);if(m>0)for(i.iushrn(m);m-- >0;)(o.isOdd()||f.isOdd())&&(o.iadd(u),f.isub(d)),o.iushrn(1),f.iushrn(1);t.cmp(i)>=0?(t.isub(i),a.isub(o),s.isub(f)):(i.isub(t),o.isub(a),f.isub(s))}return{a:o,b:f,gcd:i.iushln(h)}},n.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t,i=this,a=e.clone();i=0!==i.negative?i.umod(e):i.clone();for(var s=new n(1),o=new n(0),f=a.clone();i.cmpn(1)>0&&a.cmpn(1)>0;){for(var h=0,u=1;(i.words[0]&u)==0&&h<26;++h,u<<=1);if(h>0)for(i.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(f),s.iushrn(1);for(var d=0,c=1;(a.words[0]&c)==0&&d<26;++d,c<<=1);if(d>0)for(a.iushrn(d);d-- >0;)o.isOdd()&&o.iadd(f),o.iushrn(1);i.cmp(a)>=0?(i.isub(a),s.isub(o)):(a.isub(i),o.isub(s))}return 0>(t=0===i.cmpn(1)?s:o).cmpn(0)&&t.iadd(e),t},n.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var i=0;t.isEven()&&r.isEven();i++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=t.cmp(r);if(n<0){var a=t;t=r,r=a}else if(0===n||0===r.cmpn(1))break;t.isub(r)}return r.iushln(i)},n.prototype.invm=function(e){return this.egcd(e).a.umod(e)},n.prototype.isEven=function(){return(1&this.words[0])==0},n.prototype.isOdd=function(){return(1&this.words[0])==1},n.prototype.andln=function(e){return this.words[0]&e},n.prototype.bincn=function(e){r("number"==typeof e);var t=e%26,i=(e-t)/26,n=1<>>26,o&=0x3ffffff,this.words[s]=o}return 0!==a&&(this.words[s]=a,this.length++),this},n.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},n.prototype.cmpn=function(e){var t,i=e<0;if(0!==this.negative&&!i)return -1;if(0===this.negative&&i)return 1;if(this.strip(),this.length>1)t=1;else{i&&(e=-e),r(e<=0x3ffffff,"Number is too big");var n=0|this.words[0];t=n===e?0:ne.length)return 1;if(this.length=0;r--){var i=0|this.words[r],n=0|e.words[r];if(i!==n){in&&(t=1);break}}return t},n.prototype.gtn=function(e){return 1===this.cmpn(e)},n.prototype.gt=function(e){return 1===this.cmp(e)},n.prototype.gten=function(e){return this.cmpn(e)>=0},n.prototype.gte=function(e){return this.cmp(e)>=0},n.prototype.ltn=function(e){return -1===this.cmpn(e)},n.prototype.lt=function(e){return -1===this.cmp(e)},n.prototype.lten=function(e){return 0>=this.cmpn(e)},n.prototype.lte=function(e){return 0>=this.cmp(e)},n.prototype.eqn=function(e){return 0===this.cmpn(e)},n.prototype.eq=function(e){return 0===this.cmp(e)},n.red=function(e){return new E(e)},n.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},n.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype._forceRed=function(e){return this.red=e,this},n.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},n.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},n.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},n.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},n.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},n.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},n.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},n.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},n.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},n.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},n.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},n.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var y={k256:null,p224:null,p192:null,p25519:null};function w(e,t){this.name=e,this.p=new n(t,16),this.n=this.p.bitLength(),this.k=new n(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function _(){w.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function M(){w.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function x(){w.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function S(){w.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function E(e){if("string"==typeof e){var t=n._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function k(e){E.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new n(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)}w.prototype._tmp=function(){var e=new n(null);return e.words=Array(Math.ceil(this.n/13)),e},w.prototype.ireduce=function(e){var t,r=e;do this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength();while(t>this.n);var i=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},w.prototype.split=function(e,t){e.iushrn(this.n,0,t)},w.prototype.imulK=function(e){return e.imul(this.k)},i(_,w),_.prototype.split=function(e,t){for(var r=Math.min(e.length,9),i=0;i>>22,n=a}(n>>>=22,e.words[i-10]=n,0===n&&e.length>10)?e.length-=10:e.length-=9},_.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=n,t=i}return 0!==t&&(e.words[e.length++]=t),e},n._prime=function(e){var t;if(y[e])return y[e];if("k256"===e)t=new _;else if("p224"===e)t=new M;else if("p192"===e)t=new x;else if("p25519"===e)t=new S;else throw Error("Unknown prime "+e);return y[e]=t,t},E.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},E.prototype._verify2=function(e,t){r((e.negative|t.negative)==0,"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},E.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},E.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},E.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},E.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},E.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return 0>r.cmpn(0)&&r.iadd(this.m),r._forceRed(this)},E.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return 0>r.cmpn(0)&&r.iadd(this.m),r},E.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},E.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},E.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},E.prototype.isqr=function(e){return this.imul(e,e.clone())},E.prototype.sqr=function(e){return this.mul(e,e)},E.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2==1),3===t){var i=this.m.add(new n(1)).iushrn(2);return this.pow(e,i)}for(var a=this.m.subn(1),s=0;!a.isZero()&&0===a.andln(1);)s++,a.iushrn(1);r(!a.isZero());var o=new n(1).toRed(this),f=o.redNeg(),h=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new n(2*u*u).toRed(this);0!==this.pow(u,h).cmp(f);)u.redIAdd(f);for(var d=this.pow(u,a),c=this.pow(e,a.addn(1).iushrn(1)),p=this.pow(e,a),m=s;0!==p.cmp(o);){for(var g=p,v=0;0!==g.cmp(o);v++)g=g.redSqr();r(v=0;i--){for(var h=t.words[i],u=f-1;u>=0;u--){var d=h>>u&1;if(a!==r[0]&&(a=this.sqr(a)),0===d&&0===s){o=0;continue}s<<=1,s|=d,(4==++o||0===i&&0===u)&&(a=this.mul(a,r[s]),o=0,s=0)}f=26}return a},E.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},E.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},n.mont=function(e){return new k(e)},i(k,E),k.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},k.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},k.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),a=n;return n.cmp(this.m)>=0?a=n.isub(this.m):0>n.cmpn(0)&&(a=n.iadd(this.m)),a._forceRed(this)},k.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new n(0)._forceRed(this);var r=e.mul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=r.isub(i).iushrn(this.shift),s=a;return a.cmp(this.m)>=0?s=a.isub(this.m):0>a.cmpn(0)&&(s=a.iadd(this.m)),s._forceRed(this)},k.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(typeof t>"u"||t,e)}),t9=iQ((e,t)=>{function r(e,t){if(!e)throw Error(t||"Assertion failed")}t.exports=r,r.equal=function(e,t,r){if(e!=t)throw Error(r||"Assertion failed: "+e+" != "+t)}}),t5=iQ(e=>{function t(e){return 1===e.length?"0"+e:e}function r(e){for(var r="",i=0;i>8,s=255&n;a?r.push(a,s):r.push(s)}return r},e.zero2=t,e.toHex=r,e.encode=function(e,t){return"hex"===t?r(e):e}}),t8=iQ(e=>{var t=t4(),r=t9(),i=t5();e.assert=r,e.toArray=i.toArray,e.zero2=i.zero2,e.toHex=i.toHex,e.encode=i.encode,e.getNAF=function(e,t,r){var i,n=Array(Math.max(e.bitLength(),r)+1);for(i=0;i(a>>1)-1?(a>>1)-f:f,s.isubn(o)):o=0,n[i]=o,s.iushrn(1)}return n},e.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var i,n=0,a=0;e.cmpn(-n)>0||t.cmpn(-a)>0;){var s,o,f=e.andln(3)+n&3,h=t.andln(3)+a&3;3===f&&(f=-1),3===h&&(h=-1),s=(1&f)==0?0:(3==(i=e.andln(7)+n&7)||5===i)&&2===h?-f:f,r[0].push(s),o=(1&h)==0?0:(3==(i=t.andln(7)+a&7)||5===i)&&2===f?-h:h,r[1].push(o),2*n===s+1&&(n=1-n),2*a===o+1&&(a=1-a),e.iushrn(1),t.iushrn(1)}return r},e.cachedProperty=function(e,t,r){var i="_"+t;e.prototype[t]=function(){return void 0!==this[i]?this[i]:this[i]=r.call(this)}},e.parseBytes=function(t){return"string"==typeof t?e.toArray(t,"hex"):t},e.intFromLE=function(e){return new t(e,"hex","le")}}),t7=iQ((e,t)=>{var r,i;function n(e){this.rand=e}if(t.exports=function(e){return r||(r=new n(null)),r.generate(e)},t.exports.Rand=n,n.prototype.generate=function(e){return this._rand(e)},n.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),r=0;r{var r=t4(),i=t8(),n=i.getNAF,a=i.getJSF,s=i.assert;function o(e,t){this.type=e,this.p=new r(t.p,16),this.red=t.prime?r.red(t.prime):r.mont(this.p),this.zero=new r(0).toRed(this.red),this.one=new r(1).toRed(this.red),this.two=new r(2).toRed(this.red),this.n=t.n&&new r(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=[,,,,],this._wnafT2=[,,,,],this._wnafT3=[,,,,],this._wnafT4=[,,,,],this._bitLength=this.n?this.n.bitLength():0;var i=this.n&&this.p.div(this.n);!i||i.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}function f(e,t){this.curve=e,this.type=t,this.precomputed=null}t.exports=o,o.prototype.point=function(){throw Error("Not implemented")},o.prototype.validate=function(){throw Error("Not implemented")},o.prototype._fixedNafMul=function(e,t){s(e.precomputed);var r=e._getDoubles(),i=n(t,1,this._bitLength),a=(1<=o;u--)f=(f<<1)+i[u];h.push(f)}for(var d=this.jpoint(null,null,null),c=this.jpoint(null,null,null),p=a;p>0;p--){for(o=0;o=0;h--){for(var u=0;h>=0&&0===o[h];h--)u++;if(h>=0&&u++,f=f.dblp(u),h<0)break;var d=o[h];s(0!==d),f="affine"===e.type?d>0?f.mixedAdd(a[d-1>>1]):f.mixedAdd(a[-d-1>>1].neg()):d>0?f.add(a[d-1>>1]):f.add(a[-d-1>>1].neg())}return"affine"===e.type?f.toP():f},o.prototype._wnafMulAdd=function(e,t,r,i,s){var o,f,h,u=this._wnafT1,d=this._wnafT2,c=this._wnafT3,p=0;for(o=0;o=1;o-=2){var g=o-1,v=o;if(1!==u[g]||1!==u[v]){c[g]=n(r[g],u[g],this._bitLength),c[v]=n(r[v],u[v],this._bitLength),p=Math.max(c[g].length,p),p=Math.max(c[v].length,p);continue}var b=[t[g],null,null,t[v]];0===t[g].y.cmp(t[v].y)?(b[1]=t[g].add(t[v]),b[2]=t[g].toJ().mixedAdd(t[v].neg())):0===t[g].y.cmp(t[v].y.redNeg())?(b[1]=t[g].toJ().mixedAdd(t[v]),b[2]=t[g].add(t[v].neg())):(b[1]=t[g].toJ().mixedAdd(t[v]),b[2]=t[g].toJ().mixedAdd(t[v].neg()));var y=[-3,-1,-5,-7,0,7,5,1,3],w=a(r[g],r[v]);for(p=Math.max(w[0].length,p),c[g]=Array(p),c[v]=Array(p),f=0;f=0;o--){for(var E=0;o>=0;){var k=!0;for(f=0;f=0&&E++,x=x.dblp(E),o<0)break;for(f=0;f0?h=d[f][A-1>>1]:A<0&&(h=d[f][-A-1>>1].neg()),x="affine"===h.type?x.mixedAdd(h):x.add(h))}}for(o=0;o=Math.ceil((e.bitLength()+1)/t.step)},f.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],i=this,n=0;n{"function"==typeof Object.create?t.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:t.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}}),rr=iQ((e,t)=>{var r;try{if(ti(),r=p(eA),"function"!=typeof r.inherits)throw"";t.exports=r.inherits}catch(e){t.exports=rt()}}),ri=iQ((e,t)=>{var r=t8(),i=t4(),n=rr(),a=re(),s=r.assert;function o(e){a.call(this,"short",e),this.a=new i(e.a,16).toRed(this.red),this.b=new i(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=[,,,,],this._endoWnafT2=[,,,,]}function f(e,t,r,n){(a.BasePoint.call(this,e,"affine"),null===t&&null===r)?(this.x=null,this.y=null,this.inf=!0):(this.x=new i(t,16),this.y=new i(r,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function h(e,t,r,n){(a.BasePoint.call(this,e,"jacobian"),null===t&&null===r&&null===n)?(this.x=this.curve.one,this.y=this.curve.one,this.z=new i(0)):(this.x=new i(t,16),this.y=new i(r,16),this.z=new i(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}n(o,a),t.exports=o,o.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){if(e.beta)t=new i(e.beta,16).toRed(this.red);else{var t,r,n,a=this._getEndoRoots(this.p);t=(t=0>a[0].cmp(a[1])?a[0]:a[1]).toRed(this.red)}if(e.lambda)r=new i(e.lambda,16);else{var o=this._getEndoRoots(this.n);0===this.g.mul(o[0]).x.cmp(this.g.x.redMul(t))?r=o[0]:(r=o[1],s(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return n=e.basis?e.basis.map(function(e){return{a:new i(e.a,16),b:new i(e.b,16)}}):this._getEndoBasis(r),{beta:t,lambda:r,basis:n}}},o.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:i.mont(e),r=new i(2).toRed(t).redInvm(),n=r.redNeg(),a=new i(3).toRed(t).redNeg().redSqrt().redMul(r);return[n.redAdd(a).fromRed(),n.redSub(a).fromRed()]},o.prototype._getEndoBasis=function(e){for(var t,r,n,a,s,o,f,h,u,d=this.n.ushrn(Math.floor(this.n.bitLength()/2)),c=e,p=this.n.clone(),m=new i(1),g=new i(0),v=new i(0),b=new i(1),y=0;0!==c.cmpn(0);){var w=p.div(c);h=p.sub(w.mul(c)),u=v.sub(w.mul(m));var _=b.sub(w.mul(g));if(!n&&0>h.cmp(d))t=f.neg(),r=m,n=h.neg(),a=u;else if(n&&2==++y)break;f=h,p=c,c=h,v=m,m=u,b=g,g=_}s=h.neg(),o=u;var M=n.sqr().add(a.sqr());return s.sqr().add(o.sqr()).cmp(M)>=0&&(s=t,o=r),n.negative&&(n=n.neg(),a=a.neg()),s.negative&&(s=s.neg(),o=o.neg()),[{a:n,b:a},{a:s,b:o}]},o.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],i=t[1],n=i.b.mul(e).divRound(this.n),a=r.b.neg().mul(e).divRound(this.n),s=n.mul(r.a),o=a.mul(i.a),f=n.mul(r.b),h=a.mul(i.b);return{k1:e.sub(s).sub(o),k2:f.add(h).neg()}},o.prototype.pointFromX=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw Error("invalid point");var a=n.fromRed().isOdd();return(t&&!a||!t&&a)&&(n=n.redNeg()),this.point(e,n)},o.prototype.validate=function(e){if(e.inf)return!0;var{x:t,y:r}=e,i=this.a.redMul(t),n=t.redSqr().redMul(t).redIAdd(i).redIAdd(this.b);return 0===r.redSqr().redISub(n).cmpn(0)},o.prototype._endoWnafMulAdd=function(e,t,r){for(var i=this._endoWnafT1,n=this._endoWnafT2,a=0;a":""},f.prototype.isInfinity=function(){return this.inf},f.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e)||0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),i=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,i)},f.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),i=e.redInvm(),n=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(i),a=n.redSqr().redISub(this.x.redAdd(this.x)),s=n.redMul(this.x.redSub(a)).redISub(this.y);return this.curve.point(a,s)},f.prototype.getX=function(){return this.x.fromRed()},f.prototype.getY=function(){return this.y.fromRed()},f.prototype.mul=function(e){return(e=new i(e,16),this.isInfinity())?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},f.prototype.mulAdd=function(e,t,r){var i=[this,t],n=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n):this.curve._wnafMulAdd(1,i,n,2)},f.prototype.jmulAdd=function(e,t,r){var i=[this,t],n=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(i,n,!0):this.curve._wnafMulAdd(1,i,n,2,!0)},f.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},f.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,i=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(i)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(i)}}}return t},f.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},n(h,a.BasePoint),o.prototype.jpoint=function(e,t,r){return new h(this,e,t,r)},h.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),i=this.y.redMul(t).redMul(e);return this.curve.point(r,i)},h.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},h.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),i=this.x.redMul(t),n=e.x.redMul(r),a=this.y.redMul(t.redMul(e.z)),s=e.y.redMul(r.redMul(this.z)),o=i.redSub(n),f=a.redSub(s);if(0===o.cmpn(0))if(0!==f.cmpn(0))return this.curve.jpoint(null,null,null);else return this.dbl();var h=o.redSqr(),u=h.redMul(o),d=i.redMul(h),c=f.redSqr().redIAdd(u).redISub(d).redISub(d),p=f.redMul(d.redISub(c)).redISub(a.redMul(u)),m=this.z.redMul(e.z).redMul(o);return this.curve.jpoint(c,p,m)},h.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,i=e.x.redMul(t),n=this.y,a=e.y.redMul(t).redMul(this.z),s=r.redSub(i),o=n.redSub(a);if(0===s.cmpn(0))if(0!==o.cmpn(0))return this.curve.jpoint(null,null,null);else return this.dbl();var f=s.redSqr(),h=f.redMul(s),u=r.redMul(f),d=o.redSqr().redIAdd(h).redISub(u).redISub(u),c=o.redMul(u.redISub(d)).redISub(n.redMul(h)),p=this.z.redMul(s);return this.curve.jpoint(d,c,p)},h.prototype.dblp=function(e){if(0===e||this.isInfinity())return this;if(!e)return this.dbl();if(this.curve.zeroA||this.curve.threeA){var t,r=this;for(t=0;t=0)return!1;if(r.redIAdd(n),0===this.x.cmp(r))return!0}},h.prototype.inspect=function(){return this.isInfinity()?"":""},h.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}}),rn=iQ((e,t)=>{var r=t4(),i=rr(),n=re(),a=t8();function s(e){n.call(this,"mont",e),this.a=new r(e.a,16).toRed(this.red),this.b=new r(e.b,16).toRed(this.red),this.i4=new r(4).toRed(this.red).redInvm(),this.two=new r(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function o(e,t,i){(n.BasePoint.call(this,e,"projective"),null===t&&null===i)?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new r(t,16),this.z=new r(i,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}i(s,n),t.exports=s,s.prototype.validate=function(e){var t=e.normalize().x,r=t.redSqr(),i=r.redMul(t).redAdd(r.redMul(this.a)).redAdd(t);return 0===i.redSqrt().redSqr().cmp(i)},i(o,n.BasePoint),s.prototype.decodePoint=function(e,t){return this.point(a.toArray(e,t),1)},s.prototype.point=function(e,t){return new o(this,e,t)},s.prototype.pointFromJSON=function(e){return o.fromJSON(this,e)},o.prototype.precompute=function(){},o.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},o.fromJSON=function(e,t){return new o(e,t[0],t[1]||e.one)},o.prototype.inspect=function(){return this.isInfinity()?"":""},o.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},o.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),r=e.redSub(t),i=e.redMul(t),n=r.redMul(t.redAdd(this.curve.a24.redMul(r)));return this.curve.point(i,n)},o.prototype.add=function(){throw Error("Not supported on Montgomery curve")},o.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),i=this.x.redSub(this.z),n=e.x.redAdd(e.z),a=e.x.redSub(e.z).redMul(r),s=n.redMul(i),o=t.z.redMul(a.redAdd(s).redSqr()),f=t.x.redMul(a.redISub(s).redSqr());return this.curve.point(o,f)},o.prototype.mul=function(e){for(var t=e.clone(),r=this,i=this.curve.point(null,null),n=[];0!==t.cmpn(0);t.iushrn(1))n.push(t.andln(1));for(var a=n.length-1;a>=0;a--)0===n[a]?(r=r.diffAdd(i,this),i=i.dbl()):(i=r.diffAdd(i,this),r=r.dbl());return i},o.prototype.mulAdd=function(){throw Error("Not supported on Montgomery curve")},o.prototype.jumlAdd=function(){throw Error("Not supported on Montgomery curve")},o.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},o.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},o.prototype.getX=function(){return this.normalize(),this.x.fromRed()}}),ra=iQ((e,t)=>{var r=t8(),i=t4(),n=rr(),a=re(),s=r.assert;function o(e){this.twisted=(0|e.a)!=1,this.mOneA=this.twisted&&(0|e.a)==-1,this.extended=this.mOneA,a.call(this,"edwards",e),this.a=new i(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new i(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new i(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),s(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=(0|e.c)==1}function f(e,t,r,n,s){(a.BasePoint.call(this,e,"projective"),null===t&&null===r&&null===n)?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new i(t,16),this.y=new i(r,16),this.z=n?new i(n,16):this.curve.one,this.t=s&&new i(s,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,!this.curve.extended||this.t||(this.t=this.x.redMul(this.y),this.zOne)||(this.t=this.t.redMul(this.z.redInvm())))}n(o,a),t.exports=o,o.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},o.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},o.prototype.jpoint=function(e,t,r,i){return this.point(e,t,r,i)},o.prototype.pointFromX=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=this.c2.redSub(this.a.redMul(r)),a=this.one.redSub(this.c2.redMul(this.d).redMul(r)),s=n.redMul(a.redInvm()),o=s.redSqrt();if(0!==o.redSqr().redSub(s).cmp(this.zero))throw Error("invalid point");var f=o.fromRed().isOdd();return(t&&!f||!t&&f)&&(o=o.redNeg()),this.point(e,o)},o.prototype.pointFromY=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=r.redSub(this.c2),a=r.redMul(this.d).redMul(this.c2).redSub(this.a),s=n.redMul(a.redInvm());if(0===s.cmp(this.zero))if(!t)return this.point(this.zero,e);else throw Error("invalid point");var o=s.redSqrt();if(0!==o.redSqr().redSub(s).cmp(this.zero))throw Error("invalid point");return o.fromRed().isOdd()!==t&&(o=o.redNeg()),this.point(o,e)},o.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),r=e.y.redSqr(),i=t.redMul(this.a).redAdd(r),n=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(r)));return 0===i.cmp(n)},n(f,a.BasePoint),o.prototype.pointFromJSON=function(e){return f.fromJSON(this,e)},o.prototype.point=function(e,t,r,i){return new f(this,e,t,r,i)},f.fromJSON=function(e,t){return new f(e,t[0],t[1],t[2])},f.prototype.inspect=function(){return this.isInfinity()?"":""},f.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},f.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var i=this.curve._mulA(e),n=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),a=i.redAdd(t),s=a.redSub(r),o=i.redSub(t),f=n.redMul(s),h=a.redMul(o),u=n.redMul(o),d=s.redMul(a);return this.curve.point(f,h,d,u)},f.prototype._projDbl=function(){var e,t,r,i,n,a,s=this.x.redAdd(this.y).redSqr(),o=this.x.redSqr(),f=this.y.redSqr();if(this.curve.twisted){var h=(i=this.curve._mulA(o)).redAdd(f);this.zOne?(e=s.redSub(o).redSub(f).redMul(h.redSub(this.curve.two)),t=h.redMul(i.redSub(f)),r=h.redSqr().redSub(h).redSub(h)):(n=this.z.redSqr(),a=h.redSub(n).redISub(n),e=s.redSub(o).redISub(f).redMul(a),t=h.redMul(i.redSub(f)),r=h.redMul(a))}else i=o.redAdd(f),n=this.curve._mulC(this.z).redSqr(),a=i.redSub(n).redSub(n),e=this.curve._mulC(s.redISub(i)).redMul(a),t=this.curve._mulC(i).redMul(o.redISub(f)),r=i.redMul(a);return this.curve.point(e,t,r)},f.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},f.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),i=this.t.redMul(this.curve.dd).redMul(e.t),n=this.z.redMul(e.z.redAdd(e.z)),a=r.redSub(t),s=n.redSub(i),o=n.redAdd(i),f=r.redAdd(t),h=a.redMul(s),u=o.redMul(f),d=a.redMul(f),c=s.redMul(o);return this.curve.point(h,u,c,d)},f.prototype._projAdd=function(e){var t,r,i=this.z.redMul(e.z),n=i.redSqr(),a=this.x.redMul(e.x),s=this.y.redMul(e.y),o=this.curve.d.redMul(a).redMul(s),f=n.redSub(o),h=n.redAdd(o),u=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(a).redISub(s),d=i.redMul(f).redMul(u);return this.curve.twisted?(t=i.redMul(h).redMul(s.redSub(this.curve._mulA(a))),r=f.redMul(h)):(t=i.redMul(h).redMul(s.redSub(a)),r=this.curve._mulC(f).redMul(h)),this.curve.point(d,t,r)},f.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},f.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},f.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},f.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},f.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},f.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},f.prototype.getX=function(){return this.normalize(),this.x.fromRed()},f.prototype.getY=function(){return this.normalize(),this.y.fromRed()},f.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},f.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var r=e.clone(),i=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(i),0===this.x.cmp(t))return!0}},f.prototype.toP=f.prototype.normalize,f.prototype.mixedAdd=f.prototype.add}),rs=iQ(e=>{e.base=re(),e.short=ri(),e.mont=rn(),e.edwards=ra()}),ro=iQ(e=>{var t=t9();function r(e){return(e>>>24|e>>>8&65280|e<<8&0xff0000|(255&e)<<24)>>>0}function i(e){return 1===e.length?"0"+e:e}function n(e){if(7===e.length)return"0"+e;if(6===e.length)return"00"+e;if(5===e.length)return"000"+e;if(4===e.length)return"0000"+e;if(3===e.length)return"00000"+e;else if(2===e.length)return"000000"+e;else if(1===e.length)return"0000000"+e;else return e}e.inherits=rr(),e.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/ig,"")).length%2!=0&&(e="0"+e),n=0;n>6|192:((a=e,s=n,(64512&a.charCodeAt(s))!=55296||s<0||s+1>=a.length?1:(64512&a.charCodeAt(s+1))!=56320)?r[i++]=o>>12|224:(o=65536+((1023&o)<<10)+(1023&e.charCodeAt(++n)),r[i++]=o>>18|240,r[i++]=o>>12&63|128),r[i++]=o>>6&63|128),r[i++]=63&o|128)}else for(n=0;n>>0;return o},e.split32=function(e,t){for(var r=Array(4*e.length),i=0,n=0;i>>24,r[n+1]=a>>>16&255,r[n+2]=a>>>8&255,r[n+3]=255&a):(r[n+3]=a>>>24,r[n+2]=a>>>16&255,r[n+1]=a>>>8&255,r[n]=255&a)}return r},e.rotr32=function(e,t){return e>>>t|e<<32-t},e.rotl32=function(e,t){return e<>>32-t},e.sum32=function(e,t){return e+t>>>0},e.sum32_3=function(e,t,r){return e+t+r>>>0},e.sum32_4=function(e,t,r,i){return e+t+r+i>>>0},e.sum32_5=function(e,t,r,i,n){return e+t+r+i+n>>>0},e.sum64=function(e,t,r,i){var n=e[t],a=i+e[t+1]>>>0;e[t]=+(a>>0,e[t+1]=a},e.sum64_hi=function(e,t,r,i){return+(t+i>>>0>>0},e.sum64_lo=function(e,t,r,i){return t+i>>>0},e.sum64_4_hi=function(e,t,r,i,n,a,s,o){var f,h=t;return e+r+n+s+(f=0+ +((h=h+i>>>0)>>0)>>0)>>0},e.sum64_4_lo=function(e,t,r,i,n,a,s,o){return t+i+a+o>>>0},e.sum64_5_hi=function(e,t,r,i,n,a,s,o,f,h){var u,d=t;return e+r+n+s+f+(u=0+ +((d=d+i>>>0)>>0)>>0)>>0)>>0},e.sum64_5_lo=function(e,t,r,i,n,a,s,o,f,h){return t+i+a+o+h>>>0},e.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},e.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},e.shr64_hi=function(e,t,r){return e>>>r},e.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}}),rf=iQ(e=>{var t=ro(),r=t9();function i(){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}e.BlockHash=i,i.prototype.update=function(e,r){if((e=t.toArray(e,r),this.pending)?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var i=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-i,e.length),0===this.pending.length&&(this.pending=null),e=t.join32(e,0,e.length-i,this.endian);for(var n=0;n>>24&255,i[n++]=e>>>16&255,i[n++]=e>>>8&255,i[n++]=255&e}else for(i[n++]=255&e,i[n++]=e>>>8&255,i[n++]=e>>>16&255,i[n++]=e>>>24&255,i[n++]=0,i[n++]=0,i[n++]=0,i[n++]=0,a=8;a{var t=ro().rotr32;function r(e,t,r){return e&t^e&r^t&r}e.ft_1=function(e,t,i,n){var a;return 0===e?(a=t)&i^~a&n:1===e||3===e?t^i^n:2===e?r(t,i,n):void 0},e.ch32=function(e,t,r){return e&t^~e&r},e.maj32=r,e.p32=function(e,t,r){return e^t^r},e.s0_256=function(e){return t(e,2)^t(e,13)^t(e,22)},e.s1_256=function(e){return t(e,6)^t(e,11)^t(e,25)},e.g0_256=function(e){return t(e,7)^t(e,18)^e>>>3},e.g1_256=function(e){return t(e,17)^t(e,19)^e>>>10}}),ru=iQ((e,t)=>{var r=ro(),i=rf(),n=rh(),a=r.rotl32,s=r.sum32,o=r.sum32_5,f=n.ft_1,h=i.BlockHash,u=[0x5a827999,0x6ed9eba1,0x8f1bbcdc,0xca62c1d6];function d(){if(!(this instanceof d))return new d;h.call(this),this.h=[0x67452301,0xefcdab89,0x98badcfe,0x10325476,0xc3d2e1f0],this.W=Array(80)}r.inherits(d,h),t.exports=d,d.blockSize=512,d.outSize=160,d.hmacStrength=80,d.padLength=64,d.prototype._update=function(e,t){for(var r=this.W,i=0;i<16;i++)r[i]=e[t+i];for(;i{var r=ro(),i=rf(),n=rh(),a=t9(),s=r.sum32,o=r.sum32_4,f=r.sum32_5,h=n.ch32,u=n.maj32,d=n.s0_256,c=n.s1_256,p=n.g0_256,m=n.g1_256,g=i.BlockHash,v=[0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5,0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5,0xd807aa98,0x12835b01,0x243185be,0x550c7dc3,0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174,0xe49b69c1,0xefbe4786,0xfc19dc6,0x240ca1cc,0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da,0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7,0xc6e00bf3,0xd5a79147,0x6ca6351,0x14292967,0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13,0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85,0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc76c51a3,0xd192e819,0xd6990624,0xf40e3585,0x106aa070,0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5,0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3,0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208,0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2];function b(){if(!(this instanceof b))return new b;g.call(this),this.h=[0x6a09e667,0xbb67ae85,0x3c6ef372,0xa54ff53a,0x510e527f,0x9b05688c,0x1f83d9ab,0x5be0cd19],this.k=v,this.W=Array(64)}r.inherits(b,g),t.exports=b,b.blockSize=512,b.outSize=256,b.hmacStrength=192,b.padLength=64,b.prototype._update=function(e,t){for(var r=this.W,i=0;i<16;i++)r[i]=e[t+i];for(;i{var r=ro(),i=rl();function n(){if(!(this instanceof n))return new n;i.call(this),this.h=[0xc1059ed8,0x367cd507,0x3070dd17,0xf70e5939,0xffc00b31,0x68581511,0x64f98fa7,0xbefa4fa4]}r.inherits(n,i),t.exports=n,n.blockSize=512,n.outSize=224,n.hmacStrength=192,n.padLength=64,n.prototype._digest=function(e){return"hex"===e?r.toHex32(this.h.slice(0,7),"big"):r.split32(this.h.slice(0,7),"big")}}),rc=iQ((e,t)=>{var r=ro(),i=rf(),n=t9(),a=r.rotr64_hi,s=r.rotr64_lo,o=r.shr64_hi,f=r.shr64_lo,h=r.sum64,u=r.sum64_hi,d=r.sum64_lo,c=r.sum64_4_hi,p=r.sum64_4_lo,m=r.sum64_5_hi,g=r.sum64_5_lo,v=i.BlockHash,b=[0x428a2f98,0xd728ae22,0x71374491,0x23ef65cd,0xb5c0fbcf,0xec4d3b2f,0xe9b5dba5,0x8189dbbc,0x3956c25b,0xf348b538,0x59f111f1,0xb605d019,0x923f82a4,0xaf194f9b,0xab1c5ed5,0xda6d8118,0xd807aa98,0xa3030242,0x12835b01,0x45706fbe,0x243185be,0x4ee4b28c,0x550c7dc3,0xd5ffb4e2,0x72be5d74,0xf27b896f,0x80deb1fe,0x3b1696b1,0x9bdc06a7,0x25c71235,0xc19bf174,0xcf692694,0xe49b69c1,0x9ef14ad2,0xefbe4786,0x384f25e3,0xfc19dc6,0x8b8cd5b5,0x240ca1cc,0x77ac9c65,0x2de92c6f,0x592b0275,0x4a7484aa,0x6ea6e483,0x5cb0a9dc,0xbd41fbd4,0x76f988da,0x831153b5,0x983e5152,0xee66dfab,0xa831c66d,0x2db43210,0xb00327c8,0x98fb213f,0xbf597fc7,0xbeef0ee4,0xc6e00bf3,0x3da88fc2,0xd5a79147,0x930aa725,0x6ca6351,0xe003826f,0x14292967,0xa0e6e70,0x27b70a85,0x46d22ffc,0x2e1b2138,0x5c26c926,0x4d2c6dfc,0x5ac42aed,0x53380d13,0x9d95b3df,0x650a7354,0x8baf63de,0x766a0abb,0x3c77b2a8,0x81c2c92e,0x47edaee6,0x92722c85,0x1482353b,0xa2bfe8a1,0x4cf10364,0xa81a664b,0xbc423001,0xc24b8b70,0xd0f89791,0xc76c51a3,0x654be30,0xd192e819,0xd6ef5218,0xd6990624,0x5565a910,0xf40e3585,0x5771202a,0x106aa070,0x32bbd1b8,0x19a4c116,0xb8d2d0c8,0x1e376c08,0x5141ab53,0x2748774c,0xdf8eeb99,0x34b0bcb5,0xe19b48a8,0x391c0cb3,0xc5c95a63,0x4ed8aa4a,0xe3418acb,0x5b9cca4f,0x7763e373,0x682e6ff3,0xd6b2b8a3,0x748f82ee,0x5defb2fc,0x78a5636f,0x43172f60,0x84c87814,0xa1f0ab72,0x8cc70208,0x1a6439ec,0x90befffa,0x23631e28,0xa4506ceb,0xde82bde9,0xbef9a3f7,0xb2c67915,0xc67178f2,0xe372532b,0xca273ece,0xea26619c,0xd186b8c7,0x21c0c207,0xeada7dd6,0xcde0eb1e,0xf57d4f7f,0xee6ed178,0x6f067aa,0x72176fba,0xa637dc5,0xa2c898a6,0x113f9804,0xbef90dae,0x1b710b35,0x131c471b,0x28db77f5,0x23047d84,0x32caab7b,0x40c72493,0x3c9ebe0a,0x15c9bebc,0x431d67c4,0x9c100d4c,0x4cc5d4be,0xcb3e42b6,0x597f299c,0xfc657e2a,0x5fcb6fab,0x3ad6faec,0x6c44198c,0x4a475817];function y(){if(!(this instanceof y))return new y;v.call(this),this.h=[0x6a09e667,0xf3bcc908,0xbb67ae85,0x84caa73b,0x3c6ef372,0xfe94f82b,0xa54ff53a,0x5f1d36f1,0x510e527f,0xade682d1,0x9b05688c,0x2b3e6c1f,0x1f83d9ab,0xfb41bd6b,0x5be0cd19,0x137e2179],this.k=b,this.W=Array(160)}r.inherits(y,v),t.exports=y,y.blockSize=1024,y.outSize=512,y.hmacStrength=192,y.padLength=128,y.prototype._prepareBlock=function(e,t){for(var r=this.W,i=0;i<32;i++)r[i]=e[t+i];for(;i{var r=ro(),i=rc();function n(){if(!(this instanceof n))return new n;i.call(this),this.h=[0xcbbb9d5d,0xc1059ed8,0x629a292a,0x367cd507,0x9159015a,0x3070dd17,0x152fecd8,0xf70e5939,0x67332667,0xffc00b31,0x8eb44a87,0x68581511,0xdb0c2e0d,0x64f98fa7,0x47b5481d,0xbefa4fa4]}r.inherits(n,i),t.exports=n,n.blockSize=1024,n.outSize=384,n.hmacStrength=192,n.padLength=128,n.prototype._digest=function(e){return"hex"===e?r.toHex32(this.h.slice(0,12),"big"):r.split32(this.h.slice(0,12),"big")}}),rm=iQ(e=>{e.sha1=ru(),e.sha224=rd(),e.sha256=rl(),e.sha384=rp(),e.sha512=rc()}),rg=iQ(e=>{var t=ro(),r=rf(),i=t.rotl32,n=t.sum32,a=t.sum32_3,s=t.sum32_4,o=r.BlockHash;function f(){if(!(this instanceof f))return new f;o.call(this),this.h=[0x67452301,0xefcdab89,0x98badcfe,0x10325476,0xc3d2e1f0],this.endian="little"}function h(e,t,r,i){return e<=15?t^r^i:e<=31?t&r|~t&i:e<=47?(t|~r)^i:e<=63?t&i|r&~i:t^(r|~i)}t.inherits(f,o),e.ripemd160=f,f.blockSize=512,f.outSize=160,f.hmacStrength=192,f.padLength=64,f.prototype._update=function(e,t){for(var r=this.h[0],o=this.h[1],f=this.h[2],m=this.h[3],g=this.h[4],v=r,b=o,y=f,w=m,_=g,M=0;M<80;M++){var x,S,E=n(i(s(r,h(M,o,f,m),e[u[M]+t],(x=M)<=15?0:x<=31?0x5a827999:x<=47?0x6ed9eba1:x<=63?0x8f1bbcdc:0xa953fd4e),c[M]),g);r=g,g=m,m=i(f,10),f=o,o=E,E=n(i(s(v,h(79-M,b,y,w),e[d[M]+t],(S=M)<=15?0x50a28be6:S<=31?0x5c4dd124:S<=47?0x6d703ef3:0x7a6d76e9*!!(S<=63)),p[M]),_),v=_,_=w,w=i(y,10),y=b,b=E}E=a(this.h[1],f,w),this.h[1]=a(this.h[2],m,_),this.h[2]=a(this.h[3],g,v),this.h[3]=a(this.h[4],r,b),this.h[4]=a(this.h[0],o,y),this.h[0]=E},f.prototype._digest=function(e){return"hex"===e?t.toHex32(this.h,"little"):t.split32(this.h,"little")};var u=[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],d=[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],c=[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],p=[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]}),rv=iQ((e,t)=>{var r=ro(),i=t9();function n(e,t,i){if(!(this instanceof n))return new n(e,t,i);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(r.toArray(t,i))}t.exports=n,n.prototype._init=function(e){e.length>this.blockSize&&(e=new this.Hash().update(e).digest()),i(e.length<=this.blockSize);for(var t=e.length;t{e.utils=ro(),e.common=rf(),e.sha=rm(),e.ripemd=rg(),e.hmac=rv(),e.sha1=e.sha.sha1,e.sha256=e.sha.sha256,e.sha224=e.sha.sha224,e.sha384=e.sha.sha384,e.sha512=e.sha.sha512,e.ripemd160=e.ripemd.ripemd160}),ry=iQ((e,t)=>{t.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"]]}}}),rw=iQ(e=>{var t,r=rb(),i=rs(),n=t8().assert;function a(e){"short"===e.type?this.curve=new i.short(e):"edwards"===e.type?this.curve=new i.edwards(e):this.curve=new i.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,n(this.g.validate(),"Invalid curve"),n(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function s(t,r){Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get:function(){var i=new a(r);return Object.defineProperty(e,t,{configurable:!0,enumerable:!0,value:i}),i}})}e.PresetCurve=a,s("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:r.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),s("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:r.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),s("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:r.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),s("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:r.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"]}),s("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:r.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"]}),s("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:r.sha256,gRed:!1,g:["9"]}),s("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:r.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{t=ry()}catch(e){t=void 0}s("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:r.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",t]})}),r_=iQ((e,t)=>{var r=rb(),i=t5(),n=t9();function a(e){if(!(this instanceof a))return new a(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=i.toArray(e.entropy,e.entropyEnc||"hex"),r=i.toArray(e.nonce,e.nonceEnc||"hex"),s=i.toArray(e.pers,e.persEnc||"hex");n(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,s)}t.exports=a,a.prototype._init=function(e,t,r){var i=e.concat(t).concat(r);this.K=Array(this.outLen/8),this.V=Array(this.outLen/8);for(var n=0;n=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},a.prototype.generate=function(e,t,r,n){if(this._reseed>this.reseedInterval)throw Error("Reseed is required");"string"!=typeof t&&(n=r,r=t,t=null),r&&(r=i.toArray(r,n||"hex"),this._update(r));for(var a=[];a.length{var r=t4(),i=t8().assert;function n(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}t.exports=n,n.fromPublic=function(e,t,r){return t instanceof n?t:new n(e,{pub:t,pubEnc:r})},n.fromPrivate=function(e,t,r){return t instanceof n?t:new n(e,{priv:t,privEnc:r})},n.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},n.prototype.getPublic=function(e,t){return("string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t)?this.pub.encode(t,e):this.pub},n.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},n.prototype._importPrivate=function(e,t){this.priv=new r(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},n.prototype._importPublic=function(e,t){if(e.x||e.y){"mont"===this.ec.curve.type?i(e.x,"Need x coordinate"):("short"===this.ec.curve.type||"edwards"===this.ec.curve.type)&&i(e.x&&e.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(e.x,e.y);return}this.pub=this.ec.curve.decodePoint(e,t)},n.prototype.derive=function(e){return e.validate()||i(e.validate(),"public point not validated"),e.mul(this.priv).getX()},n.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},n.prototype.verify=function(e,t,r){return this.ec.verify(e,t,this,void 0,r)},n.prototype.inspect=function(){return""}}),rx=iQ((e,t)=>{var r=t4(),i=t8(),n=i.assert;function a(e,t){if(e instanceof a)return e;this._importDER(e,t)||((n(e.r&&e.s,"Signature without r or s"),this.r=new r(e.r,16),this.s=new r(e.s,16),void 0===e.recoveryParam)?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function s(){this.place=0}function o(e,t){var r=e[t.place++];if(!(128&r))return r;var i=15&r;if(0===i||i>4||0===e[t.place])return!1;for(var n=0,a=0,s=t.place;a>>=0;return!(n<=127)&&(t.place=s,n)}function f(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}t.exports=a,a.prototype._importDER=function(e,t){e=i.toArray(e,t);var n=new s;if(48!==e[n.place++])return!1;var a=o(e,n);if(!1===a||a+n.place!==e.length||2!==e[n.place++])return!1;var f=o(e,n);if(!1===f||(128&e[n.place])!=0)return!1;var h=e.slice(n.place,f+n.place);if(n.place+=f,2!==e[n.place++])return!1;var u=o(e,n);if(!1===u||e.length!==u+n.place||(128&e[n.place])!=0)return!1;var d=e.slice(n.place,u+n.place);if(0===h[0])if(!(128&h[1]))return!1;else h=h.slice(1);if(0===d[0])if(!(128&d[1]))return!1;else d=d.slice(1);return this.r=new r(h),this.s=new r(d),this.recoveryParam=null,!0},a.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=f(t),r=f(r);!r[0]&&!(128&r[1]);)r=r.slice(1);var n=[2];h(n,t.length),(n=n.concat(t)).push(2),h(n,r.length);var a=n.concat(r),s=[48];return h(s,a.length),s=s.concat(a),i.encode(s,e)}}),rS=iQ((e,t)=>{var r=t4(),i=r_(),n=t8(),a=rw(),s=t7(),o=n.assert,f=rM(),h=rx();function u(e){if(!(this instanceof u))return new u(e);"string"==typeof e&&(o(Object.prototype.hasOwnProperty.call(a,e),"Unknown curve "+e),e=a[e]),e instanceof a.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}t.exports=u,u.prototype.keyPair=function(e){return new f(this,e)},u.prototype.keyFromPrivate=function(e,t){return f.fromPrivate(this,e,t)},u.prototype.keyFromPublic=function(e,t){return f.fromPublic(this,e,t)},u.prototype.genKeyPair=function(e){e||(e={});for(var t=new i({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||s(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),n=this.n.byteLength(),a=this.n.sub(new r(2));;){var o=new r(t.generate(n));if(!(o.cmp(a)>0))return o.iaddn(1),this.keyFromPrivate(o)}},u.prototype._truncateToN=function(e,t,i){if(r.isBN(e)||"number"==typeof e)n=(e=new r(e,16)).byteLength();else if("object"==typeof e)n=e.length,e=new r(e,16);else{var n,a=e.toString();n=a.length+1>>>1,e=new r(a,16)}"number"!=typeof i&&(i=8*n);var s=i-this.n.bitLength();return(s>0&&(e=e.ushrn(s)),!t&&e.cmp(this.n)>=0)?e.sub(this.n):e},u.prototype.sign=function(e,t,n,a){if("object"==typeof n&&(a=n,n=null),a||(a={}),"string"!=typeof e&&"number"!=typeof e&&!r.isBN(e)){o("object"==typeof e&&e&&"number"==typeof e.length,"Expected message to be an array-like, a hex string, or a BN instance"),o(e.length>>>0===e.length);for(var s=0;s=(g=this._truncateToN(g,!0)).cmpn(1)||g.cmp(p)>=0)continue;var v=this.g.mul(g);if(!v.isInfinity()){var b=v.getX(),y=b.umod(this.n);if(0!==y.cmpn(0)){var w=g.invm(this.n).mul(y.mul(t.getPrivate()).iadd(e));if(0!==(w=w.umod(this.n)).cmpn(0)){var _=!!v.getY().isOdd()|2*(0!==b.cmp(y));return a.canonical&&w.cmp(this.nh)>0&&(w=this.n.sub(w),_^=1),new h({r:y,s:w,recoveryParam:_})}}}}},u.prototype.verify=function(e,t,r,i,n){n||(n={}),e=this._truncateToN(e,!1,n.msgBitLength),r=this.keyFromPublic(r,i);var{r:a,s:s}=t=new h(t,"hex");if(0>a.cmpn(1)||a.cmp(this.n)>=0||0>s.cmpn(1)||s.cmp(this.n)>=0)return!1;var o,f=s.invm(this.n),u=f.mul(e).umod(this.n),d=f.mul(a).umod(this.n);return this.curve._maxwellTrick?!(o=this.g.jmulAdd(u,r.getPublic(),d)).isInfinity()&&o.eqXToP(a):!(o=this.g.mulAdd(u,r.getPublic(),d)).isInfinity()&&0===o.getX().umod(this.n).cmp(a)},u.prototype.recoverPubKey=function(e,t,i,n){o((3&i)===i,"The recovery param is more than two bits"),t=new h(t,n);var a=this.n,s=new r(e),f=t.r,u=t.s,d=1&i,c=i>>1;if(f.cmp(this.curve.p.umod(this.curve.n))>=0&&c)throw Error("Unable to find sencond key candinate");f=c?this.curve.pointFromX(f.add(this.curve.n),d):this.curve.pointFromX(f,d);var p=t.r.invm(a),m=a.sub(s).mul(p).umod(a),g=u.mul(p).umod(a);return this.g.mulAdd(m,f,g)},u.prototype.getKeyRecoveryParam=function(e,t,r,i){if(null!==(t=new h(t,i)).recoveryParam)return t.recoveryParam;for(var n,a=0;a<4;a++){try{n=this.recoverPubKey(e,t,a)}catch(e){continue}if(n.eq(r))return a}throw Error("Unable to find valid recovery factor")}}),rE=iQ((e,t)=>{var r=t8(),i=r.assert,n=r.parseBytes,a=r.cachedProperty;function s(e,t){(this.eddsa=e,this._secret=n(t.secret),e.isPoint(t.pub))?this._pub=t.pub:this._pubBytes=n(t.pub)}s.fromPublic=function(e,t){return t instanceof s?t:new s(e,{pub:t})},s.fromSecret=function(e,t){return t instanceof s?t:new s(e,{secret:t})},s.prototype.secret=function(){return this._secret},a(s,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())}),a(s,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())}),a(s,"privBytes",function(){var e=this.eddsa,t=this.hash(),r=e.encodingLength-1,i=t.slice(0,e.encodingLength);return i[0]&=248,i[r]&=127,i[r]|=64,i}),a(s,"priv",function(){return this.eddsa.decodeInt(this.privBytes())}),a(s,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()}),a(s,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)}),s.prototype.sign=function(e){return i(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},s.prototype.verify=function(e,t){return this.eddsa.verify(e,t,this)},s.prototype.getSecret=function(e){return i(this._secret,"KeyPair is public only"),r.encode(this.secret(),e)},s.prototype.getPublic=function(e){return r.encode(this.pubBytes(),e)},t.exports=s}),rk=iQ((e,t)=>{var r=t4(),i=t8(),n=i.assert,a=i.cachedProperty,s=i.parseBytes;function o(e,t){this.eddsa=e,"object"!=typeof t&&(t=s(t)),Array.isArray(t)&&(n(t.length===2*e.encodingLength,"Signature has invalid size"),t={R:t.slice(0,e.encodingLength),S:t.slice(e.encodingLength)}),n(t.R&&t.S,"Signature without R or S"),e.isPoint(t.R)&&(this._R=t.R),t.S instanceof r&&(this._S=t.S),this._Rencoded=Array.isArray(t.R)?t.R:t.Rencoded,this._Sencoded=Array.isArray(t.S)?t.S:t.Sencoded}a(o,"S",function(){return this.eddsa.decodeInt(this.Sencoded())}),a(o,"R",function(){return this.eddsa.decodePoint(this.Rencoded())}),a(o,"Rencoded",function(){return this.eddsa.encodePoint(this.R())}),a(o,"Sencoded",function(){return this.eddsa.encodeInt(this.S())}),o.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},o.prototype.toHex=function(){return i.encode(this.toBytes(),"hex").toUpperCase()},t.exports=o}),rA=iQ((e,t)=>{var r=rb(),i=rw(),n=t8(),a=n.assert,s=n.parseBytes,o=rE(),f=rk();function h(e){if(a("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof h))return new h(e);e=i[e].curve,this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=r.sha512}t.exports=h,h.prototype.sign=function(e,t){e=s(e);var r=this.keyFromSecret(t),i=this.hashInt(r.messagePrefix(),e),n=this.g.mul(i),a=this.encodePoint(n),o=this.hashInt(a,r.pubBytes(),e).mul(r.priv()),f=i.add(o).umod(this.curve.n);return this.makeSignature({R:n,S:f,Rencoded:a})},h.prototype.verify=function(e,t,r){if(e=s(e),(t=this.makeSignature(t)).S().gte(t.eddsa.curve.n)||t.S().isNeg())return!1;var i=this.keyFromPublic(r),n=this.hashInt(t.Rencoded(),i.pubBytes(),e),a=this.g.mul(t.S());return t.R().add(i.pub().mul(n)).eq(a)},h.prototype.hashInt=function(){for(var e=this.hash(),t=0;t{e.version=t6().version,e.utils=t8(),e.rand=t7(),e.curve=rs(),e.curves=rw(),e.ec=rS(),e.eddsa=rA()}),rR=iQ((e,t)=>{!function(e,t){function r(e,t){if(!e)throw Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function n(e,t,r){if(n.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&(("le"===t||"be"===t)&&(r=t,t=10),this._init(e||0,t||10,r||"be"))}"object"==typeof e?e.exports=n:t.BN=n,n.BN=n,n.wordSize=26;try{f="u">typeof window&&"u">typeof window.Buffer?window.Buffer:(ek(),p(b)).Buffer}catch(e){}function a(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function s(e,t,r){var i=a(e,r);return r-1>=t&&(i|=a(e,r-1)<<4),i}function o(e,t,r,i){for(var n=0,a=Math.min(e.length,r),s=t;s=49)?n+=o-49+10:o>=17?n+=o-17+10:n+=o}return n}n.isBN=function(e){return e instanceof n||null!==e&&"object"==typeof e&&e.constructor.wordSize===n.wordSize&&Array.isArray(e.words)},n.max=function(e,t){return e.cmp(t)>0?e:t},n.min=function(e,t){return 0>e.cmp(t)?e:t},n.prototype._init=function(e,t,i){if("number"==typeof e)return this._initNumber(e,t,i);if("object"==typeof e)return this._initArray(e,t,i);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var n=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n=0;n-=3)s=e[n]|e[n-1]<<8|e[n-2]<<16,this.words[a]|=s<>>26-o&0x3ffffff,(o+=24)>=26&&(o-=26,a++);else if("le"===i)for(n=0,a=0;n>>26-o&0x3ffffff,(o+=24)>=26&&(o-=26,a++);return this.strip()},n.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=Array(this.length);for(var i=0;i=t;i-=2)(n=s(e,t,i)<=18)?(a-=18,o+=1,this.words[o]|=n>>>26):a+=8;else for(i=(e.length-t)%2==0?t+1:t;i=18)?(a-=18,o+=1,this.words[o]|=n>>>26):a+=8;this.strip()},n.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=0x3ffffff;n*=t)i++;i--,n=n/t|0;for(var a=e.length-r,s=a%i,f=Math.min(a,a-s)+r,h=0,u=r;u1&&0===this.words[this.length-1];)this.length--;return this._normSign()},n.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},n.prototype.inspect=function(){return(this.red?""};var f,h=["","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"],u=[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],d=[0,0,0x2000000,0x290d741,0x1000000,0x2e90edd,0x39aa400,0x267bf47,0x1000000,0x290d741,1e7,0x12959c3,0x222c000,0x3bd7765,7529536,0xadcea1,0x1000000,0x1704f61,0x206fc40,0x2cddcf9,64e6,4084101,5153632,6436343,7962624,9765625,0xb54ba0,0xdaf26b,0x1069c00,0x138f9ad,243e5,0x1b4d89f,0x2000000,0x25528a1,0x2b54a20,0x3216b93,0x39aa400];function c(e,t,r){r.negative=t.negative^e.negative;var i=e.length+t.length|0;r.length=i,i=i-1|0;var n=0|e.words[0],a=0|t.words[0],s=n*a,o=0x3ffffff&s,f=s/0x4000000|0;r.words[0]=o;for(var h=1;h>>26,d=0x3ffffff&f,c=Math.min(h,t.length-1),p=Math.max(0,h-e.length+1);p<=c;p++){var m=h-p|0;u+=(s=(n=0|e.words[m])*(a=0|t.words[p])+d)/0x4000000|0,d=0x3ffffff&s}r.words[h]=0|d,f=0|u}return 0!==f?r.words[h]=0|f:r.length--,r.strip()}(n.prototype.toString=function(e,t){if(t=0|t||1,16===(e=e||10)||"hex"===e){for(var i="",n=0,a=0,s=0;s>>24-n&0xffffff,(n+=2)>=26&&(n-=26,s--),i=0!==a||s!==this.length-1?h[6-f.length]+f+i:f+i}for(0!==a&&(i=a.toString(16)+i);i.length%t!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}if(e===(0|e)&&e>=2&&e<=36){var c=u[e],p=d[e];i="";var m=this.clone();for(m.negative=0;!m.isZero();){var g=m.modn(p).toString(e);i=(m=m.idivn(p)).isZero()?g+i:h[c-g.length]+g+i}for(this.isZero()&&(i="0"+i);i.length%t!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}r(!1,"Base should be between 2 and 36")},n.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=0x4000000*this.words[1]:3===this.length&&1===this.words[2]?e+=0x10000000000000+0x4000000*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},n.prototype.toJSON=function(){return this.toString(16)},n.prototype.toBuffer=function(e,t){return r("u">typeof f),this.toArrayLike(f,e,t)},n.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},n.prototype.toArrayLike=function(e,t,i){var n=this.byteLength(),a=i||Math.max(1,n);r(n<=a,"byte array longer than desired length"),r(a>0,"Requested array length <= 0"),this.strip();var s,o,f=new e(a),h=this.clone();if("le"===t){for(o=0;!h.isZero();o++)s=h.andln(255),h.iushrn(8),f[o]=s;for(;o=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},n.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return(8191&t)==0&&(r+=13,t>>>=13),(127&t)==0&&(r+=7,t>>>=7),(15&t)==0&&(r+=4,t>>>=4),(3&t)==0&&(r+=2,t>>>=2),(1&t)==0&&r++,r},n.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return(this.length-1)*26+t},n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},n.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},n.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},n.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},n.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var i=0;ie.length?this.clone().ixor(e):e.clone().ixor(this)},n.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},n.prototype.inotn=function(e){r("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),i=e%26;this._expand(t),i>0&&t--;for(var n=0;n0&&(this.words[n]=~this.words[n]&0x3ffffff>>26-i),this.strip()},n.prototype.notn=function(e){return this.clone().inotn(e)},n.prototype.setn=function(e,t){r("number"==typeof e&&e>=0);var i=e/26|0,n=e%26;return(this._expand(i+1),t)?this.words[i]=this.words[i]|1<e.length?(r=this,i=e):(r=e,i=this);for(var t,r,i,n=0,a=0;a>>26;for(;0!==n&&a>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;ae.length?this.clone().iadd(e):e.clone().iadd(this)},n.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t,r,i=this.iadd(e);return e.negative=1,i._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(t=this,r=e):(t=e,r=this);for(var a=0,s=0;s>26,this.words[s]=0x3ffffff&i;for(;0!==a&&s>26,this.words[s]=0x3ffffff&i;if(0===a&&s>>13,p=0|s[1],m=8191&p,g=p>>>13,v=0|s[2],b=8191&v,y=v>>>13,w=0|s[3],_=8191&w,M=w>>>13,x=0|s[4],S=8191&x,E=x>>>13,k=0|s[5],A=8191&k,P=k>>>13,R=0|s[6],I=8191&R,T=R>>>13,j=0|s[7],O=8191&j,C=j>>>13,N=0|s[8],D=8191&N,L=N>>>13,$=0|s[9],q=8191&$,B=$>>>13,F=0|o[0],z=8191&F,Z=F>>>13,U=0|o[1],H=8191&U,V=U>>>13,W=0|o[2],K=8191&W,Q=W>>>13,G=0|o[3],J=8191&G,Y=G>>>13,X=0|o[4],ee=8191&X,et=X>>>13,er=0|o[5],ei=8191&er,en=er>>>13,ea=0|o[6],es=8191&ea,eo=ea>>>13,ef=0|o[7],eh=8191&ef,eu=ef>>>13,el=0|o[8],ed=8191&el,ec=el>>>13,ep=0|o[9],em=8191&ep,eg=ep>>>13;r.negative=e.negative^t.negative,r.length=19,i=Math.imul(d,z),n=(n=Math.imul(d,Z))+Math.imul(c,z)|0,a=Math.imul(c,Z);var ev=(h+i|0)+((8191&n)<<13)|0;h=(a+(n>>>13)|0)+(ev>>>26)|0,ev&=0x3ffffff,i=Math.imul(m,z),n=(n=Math.imul(m,Z))+Math.imul(g,z)|0,a=Math.imul(g,Z),i=i+Math.imul(d,H)|0,n=(n=n+Math.imul(d,V)|0)+Math.imul(c,H)|0,a=a+Math.imul(c,V)|0;var eb=(h+i|0)+((8191&n)<<13)|0;h=(a+(n>>>13)|0)+(eb>>>26)|0,eb&=0x3ffffff,i=Math.imul(b,z),n=(n=Math.imul(b,Z))+Math.imul(y,z)|0,a=Math.imul(y,Z),i=i+Math.imul(m,H)|0,n=(n=n+Math.imul(m,V)|0)+Math.imul(g,H)|0,a=a+Math.imul(g,V)|0,i=i+Math.imul(d,K)|0,n=(n=n+Math.imul(d,Q)|0)+Math.imul(c,K)|0,a=a+Math.imul(c,Q)|0;var ey=(h+i|0)+((8191&n)<<13)|0;h=(a+(n>>>13)|0)+(ey>>>26)|0,ey&=0x3ffffff,i=Math.imul(_,z),n=(n=Math.imul(_,Z))+Math.imul(M,z)|0,a=Math.imul(M,Z),i=i+Math.imul(b,H)|0,n=(n=n+Math.imul(b,V)|0)+Math.imul(y,H)|0,a=a+Math.imul(y,V)|0,i=i+Math.imul(m,K)|0,n=(n=n+Math.imul(m,Q)|0)+Math.imul(g,K)|0,a=a+Math.imul(g,Q)|0,i=i+Math.imul(d,J)|0,n=(n=n+Math.imul(d,Y)|0)+Math.imul(c,J)|0,a=a+Math.imul(c,Y)|0;var ew=(h+i|0)+((8191&n)<<13)|0;h=(a+(n>>>13)|0)+(ew>>>26)|0,ew&=0x3ffffff,i=Math.imul(S,z),n=(n=Math.imul(S,Z))+Math.imul(E,z)|0,a=Math.imul(E,Z),i=i+Math.imul(_,H)|0,n=(n=n+Math.imul(_,V)|0)+Math.imul(M,H)|0,a=a+Math.imul(M,V)|0,i=i+Math.imul(b,K)|0,n=(n=n+Math.imul(b,Q)|0)+Math.imul(y,K)|0,a=a+Math.imul(y,Q)|0,i=i+Math.imul(m,J)|0,n=(n=n+Math.imul(m,Y)|0)+Math.imul(g,J)|0,a=a+Math.imul(g,Y)|0,i=i+Math.imul(d,ee)|0,n=(n=n+Math.imul(d,et)|0)+Math.imul(c,ee)|0,a=a+Math.imul(c,et)|0;var e_=(h+i|0)+((8191&n)<<13)|0;h=(a+(n>>>13)|0)+(e_>>>26)|0,e_&=0x3ffffff,i=Math.imul(A,z),n=(n=Math.imul(A,Z))+Math.imul(P,z)|0,a=Math.imul(P,Z),i=i+Math.imul(S,H)|0,n=(n=n+Math.imul(S,V)|0)+Math.imul(E,H)|0,a=a+Math.imul(E,V)|0,i=i+Math.imul(_,K)|0,n=(n=n+Math.imul(_,Q)|0)+Math.imul(M,K)|0,a=a+Math.imul(M,Q)|0,i=i+Math.imul(b,J)|0,n=(n=n+Math.imul(b,Y)|0)+Math.imul(y,J)|0,a=a+Math.imul(y,Y)|0,i=i+Math.imul(m,ee)|0,n=(n=n+Math.imul(m,et)|0)+Math.imul(g,ee)|0,a=a+Math.imul(g,et)|0,i=i+Math.imul(d,ei)|0,n=(n=n+Math.imul(d,en)|0)+Math.imul(c,ei)|0,a=a+Math.imul(c,en)|0;var eM=(h+i|0)+((8191&n)<<13)|0;h=(a+(n>>>13)|0)+(eM>>>26)|0,eM&=0x3ffffff,i=Math.imul(I,z),n=(n=Math.imul(I,Z))+Math.imul(T,z)|0,a=Math.imul(T,Z),i=i+Math.imul(A,H)|0,n=(n=n+Math.imul(A,V)|0)+Math.imul(P,H)|0,a=a+Math.imul(P,V)|0,i=i+Math.imul(S,K)|0,n=(n=n+Math.imul(S,Q)|0)+Math.imul(E,K)|0,a=a+Math.imul(E,Q)|0,i=i+Math.imul(_,J)|0,n=(n=n+Math.imul(_,Y)|0)+Math.imul(M,J)|0,a=a+Math.imul(M,Y)|0,i=i+Math.imul(b,ee)|0,n=(n=n+Math.imul(b,et)|0)+Math.imul(y,ee)|0,a=a+Math.imul(y,et)|0,i=i+Math.imul(m,ei)|0,n=(n=n+Math.imul(m,en)|0)+Math.imul(g,ei)|0,a=a+Math.imul(g,en)|0,i=i+Math.imul(d,es)|0,n=(n=n+Math.imul(d,eo)|0)+Math.imul(c,es)|0,a=a+Math.imul(c,eo)|0;var ex=(h+i|0)+((8191&n)<<13)|0;h=(a+(n>>>13)|0)+(ex>>>26)|0,ex&=0x3ffffff,i=Math.imul(O,z),n=(n=Math.imul(O,Z))+Math.imul(C,z)|0,a=Math.imul(C,Z),i=i+Math.imul(I,H)|0,n=(n=n+Math.imul(I,V)|0)+Math.imul(T,H)|0,a=a+Math.imul(T,V)|0,i=i+Math.imul(A,K)|0,n=(n=n+Math.imul(A,Q)|0)+Math.imul(P,K)|0,a=a+Math.imul(P,Q)|0,i=i+Math.imul(S,J)|0,n=(n=n+Math.imul(S,Y)|0)+Math.imul(E,J)|0,a=a+Math.imul(E,Y)|0,i=i+Math.imul(_,ee)|0,n=(n=n+Math.imul(_,et)|0)+Math.imul(M,ee)|0,a=a+Math.imul(M,et)|0,i=i+Math.imul(b,ei)|0,n=(n=n+Math.imul(b,en)|0)+Math.imul(y,ei)|0,a=a+Math.imul(y,en)|0,i=i+Math.imul(m,es)|0,n=(n=n+Math.imul(m,eo)|0)+Math.imul(g,es)|0,a=a+Math.imul(g,eo)|0,i=i+Math.imul(d,eh)|0,n=(n=n+Math.imul(d,eu)|0)+Math.imul(c,eh)|0,a=a+Math.imul(c,eu)|0;var eS=(h+i|0)+((8191&n)<<13)|0;h=(a+(n>>>13)|0)+(eS>>>26)|0,eS&=0x3ffffff,i=Math.imul(D,z),n=(n=Math.imul(D,Z))+Math.imul(L,z)|0,a=Math.imul(L,Z),i=i+Math.imul(O,H)|0,n=(n=n+Math.imul(O,V)|0)+Math.imul(C,H)|0,a=a+Math.imul(C,V)|0,i=i+Math.imul(I,K)|0,n=(n=n+Math.imul(I,Q)|0)+Math.imul(T,K)|0,a=a+Math.imul(T,Q)|0,i=i+Math.imul(A,J)|0,n=(n=n+Math.imul(A,Y)|0)+Math.imul(P,J)|0,a=a+Math.imul(P,Y)|0,i=i+Math.imul(S,ee)|0,n=(n=n+Math.imul(S,et)|0)+Math.imul(E,ee)|0,a=a+Math.imul(E,et)|0,i=i+Math.imul(_,ei)|0,n=(n=n+Math.imul(_,en)|0)+Math.imul(M,ei)|0,a=a+Math.imul(M,en)|0,i=i+Math.imul(b,es)|0,n=(n=n+Math.imul(b,eo)|0)+Math.imul(y,es)|0,a=a+Math.imul(y,eo)|0,i=i+Math.imul(m,eh)|0,n=(n=n+Math.imul(m,eu)|0)+Math.imul(g,eh)|0,a=a+Math.imul(g,eu)|0,i=i+Math.imul(d,ed)|0,n=(n=n+Math.imul(d,ec)|0)+Math.imul(c,ed)|0,a=a+Math.imul(c,ec)|0;var eE=(h+i|0)+((8191&n)<<13)|0;h=(a+(n>>>13)|0)+(eE>>>26)|0,eE&=0x3ffffff,i=Math.imul(q,z),n=(n=Math.imul(q,Z))+Math.imul(B,z)|0,a=Math.imul(B,Z),i=i+Math.imul(D,H)|0,n=(n=n+Math.imul(D,V)|0)+Math.imul(L,H)|0,a=a+Math.imul(L,V)|0,i=i+Math.imul(O,K)|0,n=(n=n+Math.imul(O,Q)|0)+Math.imul(C,K)|0,a=a+Math.imul(C,Q)|0,i=i+Math.imul(I,J)|0,n=(n=n+Math.imul(I,Y)|0)+Math.imul(T,J)|0,a=a+Math.imul(T,Y)|0,i=i+Math.imul(A,ee)|0,n=(n=n+Math.imul(A,et)|0)+Math.imul(P,ee)|0,a=a+Math.imul(P,et)|0,i=i+Math.imul(S,ei)|0,n=(n=n+Math.imul(S,en)|0)+Math.imul(E,ei)|0,a=a+Math.imul(E,en)|0,i=i+Math.imul(_,es)|0,n=(n=n+Math.imul(_,eo)|0)+Math.imul(M,es)|0,a=a+Math.imul(M,eo)|0,i=i+Math.imul(b,eh)|0,n=(n=n+Math.imul(b,eu)|0)+Math.imul(y,eh)|0,a=a+Math.imul(y,eu)|0,i=i+Math.imul(m,ed)|0,n=(n=n+Math.imul(m,ec)|0)+Math.imul(g,ed)|0,a=a+Math.imul(g,ec)|0,i=i+Math.imul(d,em)|0,n=(n=n+Math.imul(d,eg)|0)+Math.imul(c,em)|0,a=a+Math.imul(c,eg)|0;var ek=(h+i|0)+((8191&n)<<13)|0;h=(a+(n>>>13)|0)+(ek>>>26)|0,ek&=0x3ffffff,i=Math.imul(q,H),n=(n=Math.imul(q,V))+Math.imul(B,H)|0,a=Math.imul(B,V),i=i+Math.imul(D,K)|0,n=(n=n+Math.imul(D,Q)|0)+Math.imul(L,K)|0,a=a+Math.imul(L,Q)|0,i=i+Math.imul(O,J)|0,n=(n=n+Math.imul(O,Y)|0)+Math.imul(C,J)|0,a=a+Math.imul(C,Y)|0,i=i+Math.imul(I,ee)|0,n=(n=n+Math.imul(I,et)|0)+Math.imul(T,ee)|0,a=a+Math.imul(T,et)|0,i=i+Math.imul(A,ei)|0,n=(n=n+Math.imul(A,en)|0)+Math.imul(P,ei)|0,a=a+Math.imul(P,en)|0,i=i+Math.imul(S,es)|0,n=(n=n+Math.imul(S,eo)|0)+Math.imul(E,es)|0,a=a+Math.imul(E,eo)|0,i=i+Math.imul(_,eh)|0,n=(n=n+Math.imul(_,eu)|0)+Math.imul(M,eh)|0,a=a+Math.imul(M,eu)|0,i=i+Math.imul(b,ed)|0,n=(n=n+Math.imul(b,ec)|0)+Math.imul(y,ed)|0,a=a+Math.imul(y,ec)|0,i=i+Math.imul(m,em)|0,n=(n=n+Math.imul(m,eg)|0)+Math.imul(g,em)|0,a=a+Math.imul(g,eg)|0;var eA=(h+i|0)+((8191&n)<<13)|0;h=(a+(n>>>13)|0)+(eA>>>26)|0,eA&=0x3ffffff,i=Math.imul(q,K),n=(n=Math.imul(q,Q))+Math.imul(B,K)|0,a=Math.imul(B,Q),i=i+Math.imul(D,J)|0,n=(n=n+Math.imul(D,Y)|0)+Math.imul(L,J)|0,a=a+Math.imul(L,Y)|0,i=i+Math.imul(O,ee)|0,n=(n=n+Math.imul(O,et)|0)+Math.imul(C,ee)|0,a=a+Math.imul(C,et)|0,i=i+Math.imul(I,ei)|0,n=(n=n+Math.imul(I,en)|0)+Math.imul(T,ei)|0,a=a+Math.imul(T,en)|0,i=i+Math.imul(A,es)|0,n=(n=n+Math.imul(A,eo)|0)+Math.imul(P,es)|0,a=a+Math.imul(P,eo)|0,i=i+Math.imul(S,eh)|0,n=(n=n+Math.imul(S,eu)|0)+Math.imul(E,eh)|0,a=a+Math.imul(E,eu)|0,i=i+Math.imul(_,ed)|0,n=(n=n+Math.imul(_,ec)|0)+Math.imul(M,ed)|0,a=a+Math.imul(M,ec)|0,i=i+Math.imul(b,em)|0,n=(n=n+Math.imul(b,eg)|0)+Math.imul(y,em)|0,a=a+Math.imul(y,eg)|0;var eP=(h+i|0)+((8191&n)<<13)|0;h=(a+(n>>>13)|0)+(eP>>>26)|0,eP&=0x3ffffff,i=Math.imul(q,J),n=(n=Math.imul(q,Y))+Math.imul(B,J)|0,a=Math.imul(B,Y),i=i+Math.imul(D,ee)|0,n=(n=n+Math.imul(D,et)|0)+Math.imul(L,ee)|0,a=a+Math.imul(L,et)|0,i=i+Math.imul(O,ei)|0,n=(n=n+Math.imul(O,en)|0)+Math.imul(C,ei)|0,a=a+Math.imul(C,en)|0,i=i+Math.imul(I,es)|0,n=(n=n+Math.imul(I,eo)|0)+Math.imul(T,es)|0,a=a+Math.imul(T,eo)|0,i=i+Math.imul(A,eh)|0,n=(n=n+Math.imul(A,eu)|0)+Math.imul(P,eh)|0,a=a+Math.imul(P,eu)|0,i=i+Math.imul(S,ed)|0,n=(n=n+Math.imul(S,ec)|0)+Math.imul(E,ed)|0,a=a+Math.imul(E,ec)|0,i=i+Math.imul(_,em)|0,n=(n=n+Math.imul(_,eg)|0)+Math.imul(M,em)|0,a=a+Math.imul(M,eg)|0;var eR=(h+i|0)+((8191&n)<<13)|0;h=(a+(n>>>13)|0)+(eR>>>26)|0,eR&=0x3ffffff,i=Math.imul(q,ee),n=(n=Math.imul(q,et))+Math.imul(B,ee)|0,a=Math.imul(B,et),i=i+Math.imul(D,ei)|0,n=(n=n+Math.imul(D,en)|0)+Math.imul(L,ei)|0,a=a+Math.imul(L,en)|0,i=i+Math.imul(O,es)|0,n=(n=n+Math.imul(O,eo)|0)+Math.imul(C,es)|0,a=a+Math.imul(C,eo)|0,i=i+Math.imul(I,eh)|0,n=(n=n+Math.imul(I,eu)|0)+Math.imul(T,eh)|0,a=a+Math.imul(T,eu)|0,i=i+Math.imul(A,ed)|0,n=(n=n+Math.imul(A,ec)|0)+Math.imul(P,ed)|0,a=a+Math.imul(P,ec)|0,i=i+Math.imul(S,em)|0,n=(n=n+Math.imul(S,eg)|0)+Math.imul(E,em)|0,a=a+Math.imul(E,eg)|0;var eI=(h+i|0)+((8191&n)<<13)|0;h=(a+(n>>>13)|0)+(eI>>>26)|0,eI&=0x3ffffff,i=Math.imul(q,ei),n=(n=Math.imul(q,en))+Math.imul(B,ei)|0,a=Math.imul(B,en),i=i+Math.imul(D,es)|0,n=(n=n+Math.imul(D,eo)|0)+Math.imul(L,es)|0,a=a+Math.imul(L,eo)|0,i=i+Math.imul(O,eh)|0,n=(n=n+Math.imul(O,eu)|0)+Math.imul(C,eh)|0,a=a+Math.imul(C,eu)|0,i=i+Math.imul(I,ed)|0,n=(n=n+Math.imul(I,ec)|0)+Math.imul(T,ed)|0,a=a+Math.imul(T,ec)|0,i=i+Math.imul(A,em)|0,n=(n=n+Math.imul(A,eg)|0)+Math.imul(P,em)|0,a=a+Math.imul(P,eg)|0;var eT=(h+i|0)+((8191&n)<<13)|0;h=(a+(n>>>13)|0)+(eT>>>26)|0,eT&=0x3ffffff,i=Math.imul(q,es),n=(n=Math.imul(q,eo))+Math.imul(B,es)|0,a=Math.imul(B,eo),i=i+Math.imul(D,eh)|0,n=(n=n+Math.imul(D,eu)|0)+Math.imul(L,eh)|0,a=a+Math.imul(L,eu)|0,i=i+Math.imul(O,ed)|0,n=(n=n+Math.imul(O,ec)|0)+Math.imul(C,ed)|0,a=a+Math.imul(C,ec)|0,i=i+Math.imul(I,em)|0,n=(n=n+Math.imul(I,eg)|0)+Math.imul(T,em)|0,a=a+Math.imul(T,eg)|0;var ej=(h+i|0)+((8191&n)<<13)|0;h=(a+(n>>>13)|0)+(ej>>>26)|0,ej&=0x3ffffff,i=Math.imul(q,eh),n=(n=Math.imul(q,eu))+Math.imul(B,eh)|0,a=Math.imul(B,eu),i=i+Math.imul(D,ed)|0,n=(n=n+Math.imul(D,ec)|0)+Math.imul(L,ed)|0,a=a+Math.imul(L,ec)|0,i=i+Math.imul(O,em)|0,n=(n=n+Math.imul(O,eg)|0)+Math.imul(C,em)|0,a=a+Math.imul(C,eg)|0;var eO=(h+i|0)+((8191&n)<<13)|0;h=(a+(n>>>13)|0)+(eO>>>26)|0,eO&=0x3ffffff,i=Math.imul(q,ed),n=(n=Math.imul(q,ec))+Math.imul(B,ed)|0,a=Math.imul(B,ec),i=i+Math.imul(D,em)|0,n=(n=n+Math.imul(D,eg)|0)+Math.imul(L,em)|0,a=a+Math.imul(L,eg)|0;var eC=(h+i|0)+((8191&n)<<13)|0;h=(a+(n>>>13)|0)+(eC>>>26)|0,eC&=0x3ffffff,i=Math.imul(q,em),n=(n=Math.imul(q,eg))+Math.imul(B,em)|0,a=Math.imul(B,eg);var eN=(h+i|0)+((8191&n)<<13)|0;return h=(a+(n>>>13)|0)+(eN>>>26)|0,eN&=0x3ffffff,f[0]=ev,f[1]=eb,f[2]=ey,f[3]=ew,f[4]=e_,f[5]=eM,f[6]=ex,f[7]=eS,f[8]=eE,f[9]=ek,f[10]=eA,f[11]=eP,f[12]=eR,f[13]=eI,f[14]=eT,f[15]=ej,f[16]=eO,f[17]=eC,f[18]=eN,0!==h&&(f[19]=h,r.length++),r};function g(e,t,r){return(new v).mulp(e,t,r)}function v(e,t){this.x=e,this.y=t}Math.imul||(m=c),n.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?m(this,e,t):r<63?c(this,e,t):r<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var i=0,n=0,a=0;a>>26)|0)>>>26,s&=0x3ffffff}r.words[a]=o,i=s,s=n}return 0!==i?r.words[a]=i:r.length--,r.strip()}(this,e,t):g(this,e,t)},v.prototype.makeRBT=function(e){for(var t=Array(e),r=n.prototype._countBits(e)-1,i=0;i>=1;return i},v.prototype.permute=function(e,t,r,i,n,a){for(var s=0;s>>=1)n++;return 1<>>=13,i[2*s+1]=8191&a,a>>>=13;for(s=2*t;s>=26,t+=(n/0x4000000|0)+(a>>>26),this.words[i]=0x3ffffff&a}return 0!==t&&(this.words[i]=t,this.length++),this.length=0===e?1:this.length,this},n.prototype.muln=function(e){return this.clone().imuln(e)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(e){var t=function(e){for(var t=Array(e.bitLength()),r=0;r>>n}return t}(e);if(0===t.length)return new n(1);for(var r=this,i=0;i=0);var t,i=e%26,n=(e-i)/26,a=0x3ffffff>>>26-i<<26-i;if(0!==i){var s=0;for(t=0;t>>26-i}s&&(this.words[t]=s,this.length++)}if(0!==n){for(t=this.length-1;t>=0;t--)this.words[t+n]=this.words[t];for(t=0;t=0);var n=t?(t-t%26)/26:0,a=e%26,s=Math.min((e-a)/26,this.length),o=0x3ffffff^0x3ffffff>>>a<s)for(this.length-=s,f=0;f=0&&(0!==h||f>=n);f--){var u=0|this.words[f];this.words[f]=h<<26-a|u>>>a,h=u&o}return i&&0!==h&&(i.words[i.length++]=h),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},n.prototype.ishrn=function(e,t,i){return r(0===this.negative),this.iushrn(e,t,i)},n.prototype.shln=function(e){return this.clone().ishln(e)},n.prototype.ushln=function(e){return this.clone().iushln(e)},n.prototype.shrn=function(e){return this.clone().ishrn(e)},n.prototype.ushrn=function(e){return this.clone().iushrn(e)},n.prototype.testn=function(e){r("number"==typeof e&&e>=0);var t=e%26,i=(e-t)/26;return!(this.length<=i)&&!!(this.words[i]&1<=0);var t=e%26,i=(e-t)/26;return(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=i)?this:(0!==t&&i++,this.length=Math.min(i,this.length),0!==t&&(this.words[this.length-1]&=0x3ffffff^0x3ffffff>>>t<=0x4000000;t++)(this.words[t]-=0x4000000,t===this.length-1)?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},n.prototype.isubn=function(e){if(r("number"==typeof e),r(e<0x4000000),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(f/0x4000000|0),this.words[n+i]=0x3ffffff&s}for(;n>26,this.words[n+i]=0x3ffffff&s;if(0===o)return this.strip();for(r(-1===o),o=0,n=0;n>26,this.words[n]=0x3ffffff&s;return this.negative=1,this.strip()},n.prototype._wordDiv=function(e,t){var r=this.length-e.length,i=this.clone(),a=e,s=0|a.words[a.length-1];0!=(r=26-this._countBits(s))&&(a=a.ushln(r),i.iushln(r),s=0|a.words[a.length-1]);var o,f=i.length-a.length;if("mod"!==t){(o=new n(null)).length=f+1,o.words=Array(o.length);for(var h=0;h=0;d--){var c=(0|i.words[a.length+d])*0x4000000+(0|i.words[a.length+d-1]);for(c=Math.min(c/s|0,0x3ffffff),i._ishlnsubmul(a,c,d);0!==i.negative;)c--,i.negative=0,i._ishlnsubmul(a,1,d),i.isZero()||(i.negative^=1);o&&(o.words[d]=c)}return o&&o.strip(),i.strip(),"div"!==t&&0!==r&&i.iushrn(r),{div:o||null,mod:i}},n.prototype.divmod=function(e,t,i){var a,s,o;return(r(!e.isZero()),this.isZero())?{div:new n(0),mod:new n(0)}:0!==this.negative&&0===e.negative?(o=this.neg().divmod(e,t),"mod"!==t&&(a=o.div.neg()),"div"!==t&&(s=o.mod.neg(),i&&0!==s.negative)&&s.iadd(e),{div:a,mod:s}):0===this.negative&&0!==e.negative?(o=this.divmod(e.neg(),t),"mod"!==t&&(a=o.div.neg()),{div:a,mod:o.mod}):(this.negative&e.negative)!=0?(o=this.neg().divmod(e.neg(),t),"div"!==t&&(s=o.mod.neg(),i&&0!==s.negative)&&s.isub(e),{div:o.div,mod:s}):e.length>this.length||0>this.cmp(e)?{div:new n(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new n(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new n(this.modn(e.words[0]))}:this._wordDiv(e,t)},n.prototype.div=function(e){return this.divmod(e,"div",!1).div},n.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},n.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},n.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,i=e.ushrn(1),n=e.andln(1),a=r.cmp(i);return a<0||1===n&&0===a?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},n.prototype.modn=function(e){r(e<=0x3ffffff);for(var t=0x4000000%e,i=0,n=this.length-1;n>=0;n--)i=(t*i+(0|this.words[n]))%e;return i},n.prototype.idivn=function(e){r(e<=0x3ffffff);for(var t=0,i=this.length-1;i>=0;i--){var n=(0|this.words[i])+0x4000000*t;this.words[i]=n/e|0,t=n%e}return this.strip()},n.prototype.divn=function(e){return this.clone().idivn(e)},n.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,i=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var a=new n(1),s=new n(0),o=new n(0),f=new n(1),h=0;t.isEven()&&i.isEven();)t.iushrn(1),i.iushrn(1),++h;for(var u=i.clone(),d=t.clone();!t.isZero();){for(var c=0,p=1;(t.words[0]&p)==0&&c<26;++c,p<<=1);if(c>0)for(t.iushrn(c);c-- >0;)(a.isOdd()||s.isOdd())&&(a.iadd(u),s.isub(d)),a.iushrn(1),s.iushrn(1);for(var m=0,g=1;(i.words[0]&g)==0&&m<26;++m,g<<=1);if(m>0)for(i.iushrn(m);m-- >0;)(o.isOdd()||f.isOdd())&&(o.iadd(u),f.isub(d)),o.iushrn(1),f.iushrn(1);t.cmp(i)>=0?(t.isub(i),a.isub(o),s.isub(f)):(i.isub(t),o.isub(a),f.isub(s))}return{a:o,b:f,gcd:i.iushln(h)}},n.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t,i=this,a=e.clone();i=0!==i.negative?i.umod(e):i.clone();for(var s=new n(1),o=new n(0),f=a.clone();i.cmpn(1)>0&&a.cmpn(1)>0;){for(var h=0,u=1;(i.words[0]&u)==0&&h<26;++h,u<<=1);if(h>0)for(i.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(f),s.iushrn(1);for(var d=0,c=1;(a.words[0]&c)==0&&d<26;++d,c<<=1);if(d>0)for(a.iushrn(d);d-- >0;)o.isOdd()&&o.iadd(f),o.iushrn(1);i.cmp(a)>=0?(i.isub(a),s.isub(o)):(a.isub(i),o.isub(s))}return 0>(t=0===i.cmpn(1)?s:o).cmpn(0)&&t.iadd(e),t},n.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var i=0;t.isEven()&&r.isEven();i++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=t.cmp(r);if(n<0){var a=t;t=r,r=a}else if(0===n||0===r.cmpn(1))break;t.isub(r)}return r.iushln(i)},n.prototype.invm=function(e){return this.egcd(e).a.umod(e)},n.prototype.isEven=function(){return(1&this.words[0])==0},n.prototype.isOdd=function(){return(1&this.words[0])==1},n.prototype.andln=function(e){return this.words[0]&e},n.prototype.bincn=function(e){r("number"==typeof e);var t=e%26,i=(e-t)/26,n=1<>>26,o&=0x3ffffff,this.words[s]=o}return 0!==a&&(this.words[s]=a,this.length++),this},n.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},n.prototype.cmpn=function(e){var t,i=e<0;if(0!==this.negative&&!i)return -1;if(0===this.negative&&i)return 1;if(this.strip(),this.length>1)t=1;else{i&&(e=-e),r(e<=0x3ffffff,"Number is too big");var n=0|this.words[0];t=n===e?0:ne.length)return 1;if(this.length=0;r--){var i=0|this.words[r],n=0|e.words[r];if(i!==n){in&&(t=1);break}}return t},n.prototype.gtn=function(e){return 1===this.cmpn(e)},n.prototype.gt=function(e){return 1===this.cmp(e)},n.prototype.gten=function(e){return this.cmpn(e)>=0},n.prototype.gte=function(e){return this.cmp(e)>=0},n.prototype.ltn=function(e){return -1===this.cmpn(e)},n.prototype.lt=function(e){return -1===this.cmp(e)},n.prototype.lten=function(e){return 0>=this.cmpn(e)},n.prototype.lte=function(e){return 0>=this.cmp(e)},n.prototype.eqn=function(e){return 0===this.cmpn(e)},n.prototype.eq=function(e){return 0===this.cmp(e)},n.red=function(e){return new E(e)},n.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},n.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype._forceRed=function(e){return this.red=e,this},n.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},n.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},n.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},n.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},n.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},n.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},n.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},n.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},n.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},n.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},n.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},n.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var y={k256:null,p224:null,p192:null,p25519:null};function w(e,t){this.name=e,this.p=new n(t,16),this.n=this.p.bitLength(),this.k=new n(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function _(){w.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function M(){w.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function x(){w.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function S(){w.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function E(e){if("string"==typeof e){var t=n._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function k(e){E.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new n(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)}w.prototype._tmp=function(){var e=new n(null);return e.words=Array(Math.ceil(this.n/13)),e},w.prototype.ireduce=function(e){var t,r=e;do this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength();while(t>this.n);var i=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},w.prototype.split=function(e,t){e.iushrn(this.n,0,t)},w.prototype.imulK=function(e){return e.imul(this.k)},i(_,w),_.prototype.split=function(e,t){for(var r=Math.min(e.length,9),i=0;i>>22,n=a}(n>>>=22,e.words[i-10]=n,0===n&&e.length>10)?e.length-=10:e.length-=9},_.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=n,t=i}return 0!==t&&(e.words[e.length++]=t),e},n._prime=function(e){var t;if(y[e])return y[e];if("k256"===e)t=new _;else if("p224"===e)t=new M;else if("p192"===e)t=new x;else if("p25519"===e)t=new S;else throw Error("Unknown prime "+e);return y[e]=t,t},E.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},E.prototype._verify2=function(e,t){r((e.negative|t.negative)==0,"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},E.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},E.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},E.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},E.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},E.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return 0>r.cmpn(0)&&r.iadd(this.m),r._forceRed(this)},E.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return 0>r.cmpn(0)&&r.iadd(this.m),r},E.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},E.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},E.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},E.prototype.isqr=function(e){return this.imul(e,e.clone())},E.prototype.sqr=function(e){return this.mul(e,e)},E.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2==1),3===t){var i=this.m.add(new n(1)).iushrn(2);return this.pow(e,i)}for(var a=this.m.subn(1),s=0;!a.isZero()&&0===a.andln(1);)s++,a.iushrn(1);r(!a.isZero());var o=new n(1).toRed(this),f=o.redNeg(),h=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new n(2*u*u).toRed(this);0!==this.pow(u,h).cmp(f);)u.redIAdd(f);for(var d=this.pow(u,a),c=this.pow(e,a.addn(1).iushrn(1)),p=this.pow(e,a),m=s;0!==p.cmp(o);){for(var g=p,v=0;0!==g.cmp(o);v++)g=g.redSqr();r(v=0;i--){for(var h=t.words[i],u=f-1;u>=0;u--){var d=h>>u&1;if(a!==r[0]&&(a=this.sqr(a)),0===d&&0===s){o=0;continue}s<<=1,s|=d,(4==++o||0===i&&0===u)&&(a=this.mul(a,r[s]),o=0,s=0)}f=26}return a},E.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},E.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},n.mont=function(e){return new k(e)},i(k,E),k.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},k.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},k.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),a=n;return n.cmp(this.m)>=0?a=n.isub(this.m):0>n.cmpn(0)&&(a=n.iadd(this.m)),a._forceRed(this)},k.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new n(0)._forceRed(this);var r=e.mul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=r.isub(i).iushrn(this.shift),s=a;return a.cmp(this.m)>=0?s=a.isub(this.m):0>a.cmpn(0)&&(s=a.iadd(this.m)),s._forceRed(this)},k.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(typeof t>"u"||t,e)}),rI=iQ((e,t)=>{var r=rP(),i=rR();t.exports=function(e){return new s(e)};var n={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}};function s(e){this.curveType=n[e],this.curveType||(this.curveType={name:e}),this.curve=new r.ec(this.curveType.name),this.keys=void 0}function o(e,t,r){Array.isArray(e)||(e=e.toArray());var i=new a(e);if(r&&i.length{t.exports=(iX(),p(tL)).createECDH||rI()}),rj=iQ((e,t)=>{!function(e,t){function r(e,t){if(!e)throw Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function n(e,t,r){if(n.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&(("le"===t||"be"===t)&&(r=t,t=10),this._init(e||0,t||10,r||"be"))}"object"==typeof e?e.exports=n:t.BN=n,n.BN=n,n.wordSize=26;try{f="u">typeof window&&"u">typeof window.Buffer?window.Buffer:(ek(),p(b)).Buffer}catch(e){}function a(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function s(e,t,r){var i=a(e,r);return r-1>=t&&(i|=a(e,r-1)<<4),i}function o(e,t,r,i){for(var n=0,a=Math.min(e.length,r),s=t;s=49)?n+=o-49+10:o>=17?n+=o-17+10:n+=o}return n}n.isBN=function(e){return e instanceof n||null!==e&&"object"==typeof e&&e.constructor.wordSize===n.wordSize&&Array.isArray(e.words)},n.max=function(e,t){return e.cmp(t)>0?e:t},n.min=function(e,t){return 0>e.cmp(t)?e:t},n.prototype._init=function(e,t,i){if("number"==typeof e)return this._initNumber(e,t,i);if("object"==typeof e)return this._initArray(e,t,i);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var n=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n=0;n-=3)s=e[n]|e[n-1]<<8|e[n-2]<<16,this.words[a]|=s<>>26-o&0x3ffffff,(o+=24)>=26&&(o-=26,a++);else if("le"===i)for(n=0,a=0;n>>26-o&0x3ffffff,(o+=24)>=26&&(o-=26,a++);return this.strip()},n.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=Array(this.length);for(var i=0;i=t;i-=2)(n=s(e,t,i)<=18)?(a-=18,o+=1,this.words[o]|=n>>>26):a+=8;else for(i=(e.length-t)%2==0?t+1:t;i=18)?(a-=18,o+=1,this.words[o]|=n>>>26):a+=8;this.strip()},n.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=0x3ffffff;n*=t)i++;i--,n=n/t|0;for(var a=e.length-r,s=a%i,f=Math.min(a,a-s)+r,h=0,u=r;u1&&0===this.words[this.length-1];)this.length--;return this._normSign()},n.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},n.prototype.inspect=function(){return(this.red?""};var f,h=["","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"],u=[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],d=[0,0,0x2000000,0x290d741,0x1000000,0x2e90edd,0x39aa400,0x267bf47,0x1000000,0x290d741,1e7,0x12959c3,0x222c000,0x3bd7765,7529536,0xadcea1,0x1000000,0x1704f61,0x206fc40,0x2cddcf9,64e6,4084101,5153632,6436343,7962624,9765625,0xb54ba0,0xdaf26b,0x1069c00,0x138f9ad,243e5,0x1b4d89f,0x2000000,0x25528a1,0x2b54a20,0x3216b93,0x39aa400];function c(e,t,r){r.negative=t.negative^e.negative;var i=e.length+t.length|0;r.length=i,i=i-1|0;var n=0|e.words[0],a=0|t.words[0],s=n*a,o=0x3ffffff&s,f=s/0x4000000|0;r.words[0]=o;for(var h=1;h>>26,d=0x3ffffff&f,c=Math.min(h,t.length-1),p=Math.max(0,h-e.length+1);p<=c;p++){var m=h-p|0;u+=(s=(n=0|e.words[m])*(a=0|t.words[p])+d)/0x4000000|0,d=0x3ffffff&s}r.words[h]=0|d,f=0|u}return 0!==f?r.words[h]=0|f:r.length--,r.strip()}(n.prototype.toString=function(e,t){if(t=0|t||1,16===(e=e||10)||"hex"===e){for(var i="",n=0,a=0,s=0;s>>24-n&0xffffff,(n+=2)>=26&&(n-=26,s--),i=0!==a||s!==this.length-1?h[6-f.length]+f+i:f+i}for(0!==a&&(i=a.toString(16)+i);i.length%t!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}if(e===(0|e)&&e>=2&&e<=36){var c=u[e],p=d[e];i="";var m=this.clone();for(m.negative=0;!m.isZero();){var g=m.modn(p).toString(e);i=(m=m.idivn(p)).isZero()?g+i:h[c-g.length]+g+i}for(this.isZero()&&(i="0"+i);i.length%t!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}r(!1,"Base should be between 2 and 36")},n.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=0x4000000*this.words[1]:3===this.length&&1===this.words[2]?e+=0x10000000000000+0x4000000*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},n.prototype.toJSON=function(){return this.toString(16)},n.prototype.toBuffer=function(e,t){return r("u">typeof f),this.toArrayLike(f,e,t)},n.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},n.prototype.toArrayLike=function(e,t,i){var n=this.byteLength(),a=i||Math.max(1,n);r(n<=a,"byte array longer than desired length"),r(a>0,"Requested array length <= 0"),this.strip();var s,o,f=new e(a),h=this.clone();if("le"===t){for(o=0;!h.isZero();o++)s=h.andln(255),h.iushrn(8),f[o]=s;for(;o=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},n.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return(8191&t)==0&&(r+=13,t>>>=13),(127&t)==0&&(r+=7,t>>>=7),(15&t)==0&&(r+=4,t>>>=4),(3&t)==0&&(r+=2,t>>>=2),(1&t)==0&&r++,r},n.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return(this.length-1)*26+t},n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},n.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},n.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},n.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},n.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var i=0;ie.length?this.clone().ixor(e):e.clone().ixor(this)},n.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},n.prototype.inotn=function(e){r("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),i=e%26;this._expand(t),i>0&&t--;for(var n=0;n0&&(this.words[n]=~this.words[n]&0x3ffffff>>26-i),this.strip()},n.prototype.notn=function(e){return this.clone().inotn(e)},n.prototype.setn=function(e,t){r("number"==typeof e&&e>=0);var i=e/26|0,n=e%26;return(this._expand(i+1),t)?this.words[i]=this.words[i]|1<e.length?(r=this,i=e):(r=e,i=this);for(var t,r,i,n=0,a=0;a>>26;for(;0!==n&&a>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;ae.length?this.clone().iadd(e):e.clone().iadd(this)},n.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t,r,i=this.iadd(e);return e.negative=1,i._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(t=this,r=e):(t=e,r=this);for(var a=0,s=0;s>26,this.words[s]=0x3ffffff&i;for(;0!==a&&s>26,this.words[s]=0x3ffffff&i;if(0===a&&s>>13,p=0|s[1],m=8191&p,g=p>>>13,v=0|s[2],b=8191&v,y=v>>>13,w=0|s[3],_=8191&w,M=w>>>13,x=0|s[4],S=8191&x,E=x>>>13,k=0|s[5],A=8191&k,P=k>>>13,R=0|s[6],I=8191&R,T=R>>>13,j=0|s[7],O=8191&j,C=j>>>13,N=0|s[8],D=8191&N,L=N>>>13,$=0|s[9],q=8191&$,B=$>>>13,F=0|o[0],z=8191&F,Z=F>>>13,U=0|o[1],H=8191&U,V=U>>>13,W=0|o[2],K=8191&W,Q=W>>>13,G=0|o[3],J=8191&G,Y=G>>>13,X=0|o[4],ee=8191&X,et=X>>>13,er=0|o[5],ei=8191&er,en=er>>>13,ea=0|o[6],es=8191&ea,eo=ea>>>13,ef=0|o[7],eh=8191&ef,eu=ef>>>13,el=0|o[8],ed=8191&el,ec=el>>>13,ep=0|o[9],em=8191&ep,eg=ep>>>13;r.negative=e.negative^t.negative,r.length=19,i=Math.imul(d,z),n=(n=Math.imul(d,Z))+Math.imul(c,z)|0,a=Math.imul(c,Z);var ev=(h+i|0)+((8191&n)<<13)|0;h=(a+(n>>>13)|0)+(ev>>>26)|0,ev&=0x3ffffff,i=Math.imul(m,z),n=(n=Math.imul(m,Z))+Math.imul(g,z)|0,a=Math.imul(g,Z),i=i+Math.imul(d,H)|0,n=(n=n+Math.imul(d,V)|0)+Math.imul(c,H)|0,a=a+Math.imul(c,V)|0;var eb=(h+i|0)+((8191&n)<<13)|0;h=(a+(n>>>13)|0)+(eb>>>26)|0,eb&=0x3ffffff,i=Math.imul(b,z),n=(n=Math.imul(b,Z))+Math.imul(y,z)|0,a=Math.imul(y,Z),i=i+Math.imul(m,H)|0,n=(n=n+Math.imul(m,V)|0)+Math.imul(g,H)|0,a=a+Math.imul(g,V)|0,i=i+Math.imul(d,K)|0,n=(n=n+Math.imul(d,Q)|0)+Math.imul(c,K)|0,a=a+Math.imul(c,Q)|0;var ey=(h+i|0)+((8191&n)<<13)|0;h=(a+(n>>>13)|0)+(ey>>>26)|0,ey&=0x3ffffff,i=Math.imul(_,z),n=(n=Math.imul(_,Z))+Math.imul(M,z)|0,a=Math.imul(M,Z),i=i+Math.imul(b,H)|0,n=(n=n+Math.imul(b,V)|0)+Math.imul(y,H)|0,a=a+Math.imul(y,V)|0,i=i+Math.imul(m,K)|0,n=(n=n+Math.imul(m,Q)|0)+Math.imul(g,K)|0,a=a+Math.imul(g,Q)|0,i=i+Math.imul(d,J)|0,n=(n=n+Math.imul(d,Y)|0)+Math.imul(c,J)|0,a=a+Math.imul(c,Y)|0;var ew=(h+i|0)+((8191&n)<<13)|0;h=(a+(n>>>13)|0)+(ew>>>26)|0,ew&=0x3ffffff,i=Math.imul(S,z),n=(n=Math.imul(S,Z))+Math.imul(E,z)|0,a=Math.imul(E,Z),i=i+Math.imul(_,H)|0,n=(n=n+Math.imul(_,V)|0)+Math.imul(M,H)|0,a=a+Math.imul(M,V)|0,i=i+Math.imul(b,K)|0,n=(n=n+Math.imul(b,Q)|0)+Math.imul(y,K)|0,a=a+Math.imul(y,Q)|0,i=i+Math.imul(m,J)|0,n=(n=n+Math.imul(m,Y)|0)+Math.imul(g,J)|0,a=a+Math.imul(g,Y)|0,i=i+Math.imul(d,ee)|0,n=(n=n+Math.imul(d,et)|0)+Math.imul(c,ee)|0,a=a+Math.imul(c,et)|0;var e_=(h+i|0)+((8191&n)<<13)|0;h=(a+(n>>>13)|0)+(e_>>>26)|0,e_&=0x3ffffff,i=Math.imul(A,z),n=(n=Math.imul(A,Z))+Math.imul(P,z)|0,a=Math.imul(P,Z),i=i+Math.imul(S,H)|0,n=(n=n+Math.imul(S,V)|0)+Math.imul(E,H)|0,a=a+Math.imul(E,V)|0,i=i+Math.imul(_,K)|0,n=(n=n+Math.imul(_,Q)|0)+Math.imul(M,K)|0,a=a+Math.imul(M,Q)|0,i=i+Math.imul(b,J)|0,n=(n=n+Math.imul(b,Y)|0)+Math.imul(y,J)|0,a=a+Math.imul(y,Y)|0,i=i+Math.imul(m,ee)|0,n=(n=n+Math.imul(m,et)|0)+Math.imul(g,ee)|0,a=a+Math.imul(g,et)|0,i=i+Math.imul(d,ei)|0,n=(n=n+Math.imul(d,en)|0)+Math.imul(c,ei)|0,a=a+Math.imul(c,en)|0;var eM=(h+i|0)+((8191&n)<<13)|0;h=(a+(n>>>13)|0)+(eM>>>26)|0,eM&=0x3ffffff,i=Math.imul(I,z),n=(n=Math.imul(I,Z))+Math.imul(T,z)|0,a=Math.imul(T,Z),i=i+Math.imul(A,H)|0,n=(n=n+Math.imul(A,V)|0)+Math.imul(P,H)|0,a=a+Math.imul(P,V)|0,i=i+Math.imul(S,K)|0,n=(n=n+Math.imul(S,Q)|0)+Math.imul(E,K)|0,a=a+Math.imul(E,Q)|0,i=i+Math.imul(_,J)|0,n=(n=n+Math.imul(_,Y)|0)+Math.imul(M,J)|0,a=a+Math.imul(M,Y)|0,i=i+Math.imul(b,ee)|0,n=(n=n+Math.imul(b,et)|0)+Math.imul(y,ee)|0,a=a+Math.imul(y,et)|0,i=i+Math.imul(m,ei)|0,n=(n=n+Math.imul(m,en)|0)+Math.imul(g,ei)|0,a=a+Math.imul(g,en)|0,i=i+Math.imul(d,es)|0,n=(n=n+Math.imul(d,eo)|0)+Math.imul(c,es)|0,a=a+Math.imul(c,eo)|0;var ex=(h+i|0)+((8191&n)<<13)|0;h=(a+(n>>>13)|0)+(ex>>>26)|0,ex&=0x3ffffff,i=Math.imul(O,z),n=(n=Math.imul(O,Z))+Math.imul(C,z)|0,a=Math.imul(C,Z),i=i+Math.imul(I,H)|0,n=(n=n+Math.imul(I,V)|0)+Math.imul(T,H)|0,a=a+Math.imul(T,V)|0,i=i+Math.imul(A,K)|0,n=(n=n+Math.imul(A,Q)|0)+Math.imul(P,K)|0,a=a+Math.imul(P,Q)|0,i=i+Math.imul(S,J)|0,n=(n=n+Math.imul(S,Y)|0)+Math.imul(E,J)|0,a=a+Math.imul(E,Y)|0,i=i+Math.imul(_,ee)|0,n=(n=n+Math.imul(_,et)|0)+Math.imul(M,ee)|0,a=a+Math.imul(M,et)|0,i=i+Math.imul(b,ei)|0,n=(n=n+Math.imul(b,en)|0)+Math.imul(y,ei)|0,a=a+Math.imul(y,en)|0,i=i+Math.imul(m,es)|0,n=(n=n+Math.imul(m,eo)|0)+Math.imul(g,es)|0,a=a+Math.imul(g,eo)|0,i=i+Math.imul(d,eh)|0,n=(n=n+Math.imul(d,eu)|0)+Math.imul(c,eh)|0,a=a+Math.imul(c,eu)|0;var eS=(h+i|0)+((8191&n)<<13)|0;h=(a+(n>>>13)|0)+(eS>>>26)|0,eS&=0x3ffffff,i=Math.imul(D,z),n=(n=Math.imul(D,Z))+Math.imul(L,z)|0,a=Math.imul(L,Z),i=i+Math.imul(O,H)|0,n=(n=n+Math.imul(O,V)|0)+Math.imul(C,H)|0,a=a+Math.imul(C,V)|0,i=i+Math.imul(I,K)|0,n=(n=n+Math.imul(I,Q)|0)+Math.imul(T,K)|0,a=a+Math.imul(T,Q)|0,i=i+Math.imul(A,J)|0,n=(n=n+Math.imul(A,Y)|0)+Math.imul(P,J)|0,a=a+Math.imul(P,Y)|0,i=i+Math.imul(S,ee)|0,n=(n=n+Math.imul(S,et)|0)+Math.imul(E,ee)|0,a=a+Math.imul(E,et)|0,i=i+Math.imul(_,ei)|0,n=(n=n+Math.imul(_,en)|0)+Math.imul(M,ei)|0,a=a+Math.imul(M,en)|0,i=i+Math.imul(b,es)|0,n=(n=n+Math.imul(b,eo)|0)+Math.imul(y,es)|0,a=a+Math.imul(y,eo)|0,i=i+Math.imul(m,eh)|0,n=(n=n+Math.imul(m,eu)|0)+Math.imul(g,eh)|0,a=a+Math.imul(g,eu)|0,i=i+Math.imul(d,ed)|0,n=(n=n+Math.imul(d,ec)|0)+Math.imul(c,ed)|0,a=a+Math.imul(c,ec)|0;var eE=(h+i|0)+((8191&n)<<13)|0;h=(a+(n>>>13)|0)+(eE>>>26)|0,eE&=0x3ffffff,i=Math.imul(q,z),n=(n=Math.imul(q,Z))+Math.imul(B,z)|0,a=Math.imul(B,Z),i=i+Math.imul(D,H)|0,n=(n=n+Math.imul(D,V)|0)+Math.imul(L,H)|0,a=a+Math.imul(L,V)|0,i=i+Math.imul(O,K)|0,n=(n=n+Math.imul(O,Q)|0)+Math.imul(C,K)|0,a=a+Math.imul(C,Q)|0,i=i+Math.imul(I,J)|0,n=(n=n+Math.imul(I,Y)|0)+Math.imul(T,J)|0,a=a+Math.imul(T,Y)|0,i=i+Math.imul(A,ee)|0,n=(n=n+Math.imul(A,et)|0)+Math.imul(P,ee)|0,a=a+Math.imul(P,et)|0,i=i+Math.imul(S,ei)|0,n=(n=n+Math.imul(S,en)|0)+Math.imul(E,ei)|0,a=a+Math.imul(E,en)|0,i=i+Math.imul(_,es)|0,n=(n=n+Math.imul(_,eo)|0)+Math.imul(M,es)|0,a=a+Math.imul(M,eo)|0,i=i+Math.imul(b,eh)|0,n=(n=n+Math.imul(b,eu)|0)+Math.imul(y,eh)|0,a=a+Math.imul(y,eu)|0,i=i+Math.imul(m,ed)|0,n=(n=n+Math.imul(m,ec)|0)+Math.imul(g,ed)|0,a=a+Math.imul(g,ec)|0,i=i+Math.imul(d,em)|0,n=(n=n+Math.imul(d,eg)|0)+Math.imul(c,em)|0,a=a+Math.imul(c,eg)|0;var ek=(h+i|0)+((8191&n)<<13)|0;h=(a+(n>>>13)|0)+(ek>>>26)|0,ek&=0x3ffffff,i=Math.imul(q,H),n=(n=Math.imul(q,V))+Math.imul(B,H)|0,a=Math.imul(B,V),i=i+Math.imul(D,K)|0,n=(n=n+Math.imul(D,Q)|0)+Math.imul(L,K)|0,a=a+Math.imul(L,Q)|0,i=i+Math.imul(O,J)|0,n=(n=n+Math.imul(O,Y)|0)+Math.imul(C,J)|0,a=a+Math.imul(C,Y)|0,i=i+Math.imul(I,ee)|0,n=(n=n+Math.imul(I,et)|0)+Math.imul(T,ee)|0,a=a+Math.imul(T,et)|0,i=i+Math.imul(A,ei)|0,n=(n=n+Math.imul(A,en)|0)+Math.imul(P,ei)|0,a=a+Math.imul(P,en)|0,i=i+Math.imul(S,es)|0,n=(n=n+Math.imul(S,eo)|0)+Math.imul(E,es)|0,a=a+Math.imul(E,eo)|0,i=i+Math.imul(_,eh)|0,n=(n=n+Math.imul(_,eu)|0)+Math.imul(M,eh)|0,a=a+Math.imul(M,eu)|0,i=i+Math.imul(b,ed)|0,n=(n=n+Math.imul(b,ec)|0)+Math.imul(y,ed)|0,a=a+Math.imul(y,ec)|0,i=i+Math.imul(m,em)|0,n=(n=n+Math.imul(m,eg)|0)+Math.imul(g,em)|0,a=a+Math.imul(g,eg)|0;var eA=(h+i|0)+((8191&n)<<13)|0;h=(a+(n>>>13)|0)+(eA>>>26)|0,eA&=0x3ffffff,i=Math.imul(q,K),n=(n=Math.imul(q,Q))+Math.imul(B,K)|0,a=Math.imul(B,Q),i=i+Math.imul(D,J)|0,n=(n=n+Math.imul(D,Y)|0)+Math.imul(L,J)|0,a=a+Math.imul(L,Y)|0,i=i+Math.imul(O,ee)|0,n=(n=n+Math.imul(O,et)|0)+Math.imul(C,ee)|0,a=a+Math.imul(C,et)|0,i=i+Math.imul(I,ei)|0,n=(n=n+Math.imul(I,en)|0)+Math.imul(T,ei)|0,a=a+Math.imul(T,en)|0,i=i+Math.imul(A,es)|0,n=(n=n+Math.imul(A,eo)|0)+Math.imul(P,es)|0,a=a+Math.imul(P,eo)|0,i=i+Math.imul(S,eh)|0,n=(n=n+Math.imul(S,eu)|0)+Math.imul(E,eh)|0,a=a+Math.imul(E,eu)|0,i=i+Math.imul(_,ed)|0,n=(n=n+Math.imul(_,ec)|0)+Math.imul(M,ed)|0,a=a+Math.imul(M,ec)|0,i=i+Math.imul(b,em)|0,n=(n=n+Math.imul(b,eg)|0)+Math.imul(y,em)|0,a=a+Math.imul(y,eg)|0;var eP=(h+i|0)+((8191&n)<<13)|0;h=(a+(n>>>13)|0)+(eP>>>26)|0,eP&=0x3ffffff,i=Math.imul(q,J),n=(n=Math.imul(q,Y))+Math.imul(B,J)|0,a=Math.imul(B,Y),i=i+Math.imul(D,ee)|0,n=(n=n+Math.imul(D,et)|0)+Math.imul(L,ee)|0,a=a+Math.imul(L,et)|0,i=i+Math.imul(O,ei)|0,n=(n=n+Math.imul(O,en)|0)+Math.imul(C,ei)|0,a=a+Math.imul(C,en)|0,i=i+Math.imul(I,es)|0,n=(n=n+Math.imul(I,eo)|0)+Math.imul(T,es)|0,a=a+Math.imul(T,eo)|0,i=i+Math.imul(A,eh)|0,n=(n=n+Math.imul(A,eu)|0)+Math.imul(P,eh)|0,a=a+Math.imul(P,eu)|0,i=i+Math.imul(S,ed)|0,n=(n=n+Math.imul(S,ec)|0)+Math.imul(E,ed)|0,a=a+Math.imul(E,ec)|0,i=i+Math.imul(_,em)|0,n=(n=n+Math.imul(_,eg)|0)+Math.imul(M,em)|0,a=a+Math.imul(M,eg)|0;var eR=(h+i|0)+((8191&n)<<13)|0;h=(a+(n>>>13)|0)+(eR>>>26)|0,eR&=0x3ffffff,i=Math.imul(q,ee),n=(n=Math.imul(q,et))+Math.imul(B,ee)|0,a=Math.imul(B,et),i=i+Math.imul(D,ei)|0,n=(n=n+Math.imul(D,en)|0)+Math.imul(L,ei)|0,a=a+Math.imul(L,en)|0,i=i+Math.imul(O,es)|0,n=(n=n+Math.imul(O,eo)|0)+Math.imul(C,es)|0,a=a+Math.imul(C,eo)|0,i=i+Math.imul(I,eh)|0,n=(n=n+Math.imul(I,eu)|0)+Math.imul(T,eh)|0,a=a+Math.imul(T,eu)|0,i=i+Math.imul(A,ed)|0,n=(n=n+Math.imul(A,ec)|0)+Math.imul(P,ed)|0,a=a+Math.imul(P,ec)|0,i=i+Math.imul(S,em)|0,n=(n=n+Math.imul(S,eg)|0)+Math.imul(E,em)|0,a=a+Math.imul(E,eg)|0;var eI=(h+i|0)+((8191&n)<<13)|0;h=(a+(n>>>13)|0)+(eI>>>26)|0,eI&=0x3ffffff,i=Math.imul(q,ei),n=(n=Math.imul(q,en))+Math.imul(B,ei)|0,a=Math.imul(B,en),i=i+Math.imul(D,es)|0,n=(n=n+Math.imul(D,eo)|0)+Math.imul(L,es)|0,a=a+Math.imul(L,eo)|0,i=i+Math.imul(O,eh)|0,n=(n=n+Math.imul(O,eu)|0)+Math.imul(C,eh)|0,a=a+Math.imul(C,eu)|0,i=i+Math.imul(I,ed)|0,n=(n=n+Math.imul(I,ec)|0)+Math.imul(T,ed)|0,a=a+Math.imul(T,ec)|0,i=i+Math.imul(A,em)|0,n=(n=n+Math.imul(A,eg)|0)+Math.imul(P,em)|0,a=a+Math.imul(P,eg)|0;var eT=(h+i|0)+((8191&n)<<13)|0;h=(a+(n>>>13)|0)+(eT>>>26)|0,eT&=0x3ffffff,i=Math.imul(q,es),n=(n=Math.imul(q,eo))+Math.imul(B,es)|0,a=Math.imul(B,eo),i=i+Math.imul(D,eh)|0,n=(n=n+Math.imul(D,eu)|0)+Math.imul(L,eh)|0,a=a+Math.imul(L,eu)|0,i=i+Math.imul(O,ed)|0,n=(n=n+Math.imul(O,ec)|0)+Math.imul(C,ed)|0,a=a+Math.imul(C,ec)|0,i=i+Math.imul(I,em)|0,n=(n=n+Math.imul(I,eg)|0)+Math.imul(T,em)|0,a=a+Math.imul(T,eg)|0;var ej=(h+i|0)+((8191&n)<<13)|0;h=(a+(n>>>13)|0)+(ej>>>26)|0,ej&=0x3ffffff,i=Math.imul(q,eh),n=(n=Math.imul(q,eu))+Math.imul(B,eh)|0,a=Math.imul(B,eu),i=i+Math.imul(D,ed)|0,n=(n=n+Math.imul(D,ec)|0)+Math.imul(L,ed)|0,a=a+Math.imul(L,ec)|0,i=i+Math.imul(O,em)|0,n=(n=n+Math.imul(O,eg)|0)+Math.imul(C,em)|0,a=a+Math.imul(C,eg)|0;var eO=(h+i|0)+((8191&n)<<13)|0;h=(a+(n>>>13)|0)+(eO>>>26)|0,eO&=0x3ffffff,i=Math.imul(q,ed),n=(n=Math.imul(q,ec))+Math.imul(B,ed)|0,a=Math.imul(B,ec),i=i+Math.imul(D,em)|0,n=(n=n+Math.imul(D,eg)|0)+Math.imul(L,em)|0,a=a+Math.imul(L,eg)|0;var eC=(h+i|0)+((8191&n)<<13)|0;h=(a+(n>>>13)|0)+(eC>>>26)|0,eC&=0x3ffffff,i=Math.imul(q,em),n=(n=Math.imul(q,eg))+Math.imul(B,em)|0,a=Math.imul(B,eg);var eN=(h+i|0)+((8191&n)<<13)|0;return h=(a+(n>>>13)|0)+(eN>>>26)|0,eN&=0x3ffffff,f[0]=ev,f[1]=eb,f[2]=ey,f[3]=ew,f[4]=e_,f[5]=eM,f[6]=ex,f[7]=eS,f[8]=eE,f[9]=ek,f[10]=eA,f[11]=eP,f[12]=eR,f[13]=eI,f[14]=eT,f[15]=ej,f[16]=eO,f[17]=eC,f[18]=eN,0!==h&&(f[19]=h,r.length++),r};function g(e,t,r){return(new v).mulp(e,t,r)}function v(e,t){this.x=e,this.y=t}Math.imul||(m=c),n.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?m(this,e,t):r<63?c(this,e,t):r<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var i=0,n=0,a=0;a>>26)|0)>>>26,s&=0x3ffffff}r.words[a]=o,i=s,s=n}return 0!==i?r.words[a]=i:r.length--,r.strip()}(this,e,t):g(this,e,t)},v.prototype.makeRBT=function(e){for(var t=Array(e),r=n.prototype._countBits(e)-1,i=0;i>=1;return i},v.prototype.permute=function(e,t,r,i,n,a){for(var s=0;s>>=1)n++;return 1<>>=13,i[2*s+1]=8191&a,a>>>=13;for(s=2*t;s>=26,t+=(n/0x4000000|0)+(a>>>26),this.words[i]=0x3ffffff&a}return 0!==t&&(this.words[i]=t,this.length++),this.length=0===e?1:this.length,this},n.prototype.muln=function(e){return this.clone().imuln(e)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(e){var t=function(e){for(var t=Array(e.bitLength()),r=0;r>>n}return t}(e);if(0===t.length)return new n(1);for(var r=this,i=0;i=0);var t,i=e%26,n=(e-i)/26,a=0x3ffffff>>>26-i<<26-i;if(0!==i){var s=0;for(t=0;t>>26-i}s&&(this.words[t]=s,this.length++)}if(0!==n){for(t=this.length-1;t>=0;t--)this.words[t+n]=this.words[t];for(t=0;t=0);var n=t?(t-t%26)/26:0,a=e%26,s=Math.min((e-a)/26,this.length),o=0x3ffffff^0x3ffffff>>>a<s)for(this.length-=s,f=0;f=0&&(0!==h||f>=n);f--){var u=0|this.words[f];this.words[f]=h<<26-a|u>>>a,h=u&o}return i&&0!==h&&(i.words[i.length++]=h),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},n.prototype.ishrn=function(e,t,i){return r(0===this.negative),this.iushrn(e,t,i)},n.prototype.shln=function(e){return this.clone().ishln(e)},n.prototype.ushln=function(e){return this.clone().iushln(e)},n.prototype.shrn=function(e){return this.clone().ishrn(e)},n.prototype.ushrn=function(e){return this.clone().iushrn(e)},n.prototype.testn=function(e){r("number"==typeof e&&e>=0);var t=e%26,i=(e-t)/26;return!(this.length<=i)&&!!(this.words[i]&1<=0);var t=e%26,i=(e-t)/26;return(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=i)?this:(0!==t&&i++,this.length=Math.min(i,this.length),0!==t&&(this.words[this.length-1]&=0x3ffffff^0x3ffffff>>>t<=0x4000000;t++)(this.words[t]-=0x4000000,t===this.length-1)?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},n.prototype.isubn=function(e){if(r("number"==typeof e),r(e<0x4000000),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(f/0x4000000|0),this.words[n+i]=0x3ffffff&s}for(;n>26,this.words[n+i]=0x3ffffff&s;if(0===o)return this.strip();for(r(-1===o),o=0,n=0;n>26,this.words[n]=0x3ffffff&s;return this.negative=1,this.strip()},n.prototype._wordDiv=function(e,t){var r=this.length-e.length,i=this.clone(),a=e,s=0|a.words[a.length-1];0!=(r=26-this._countBits(s))&&(a=a.ushln(r),i.iushln(r),s=0|a.words[a.length-1]);var o,f=i.length-a.length;if("mod"!==t){(o=new n(null)).length=f+1,o.words=Array(o.length);for(var h=0;h=0;d--){var c=(0|i.words[a.length+d])*0x4000000+(0|i.words[a.length+d-1]);for(c=Math.min(c/s|0,0x3ffffff),i._ishlnsubmul(a,c,d);0!==i.negative;)c--,i.negative=0,i._ishlnsubmul(a,1,d),i.isZero()||(i.negative^=1);o&&(o.words[d]=c)}return o&&o.strip(),i.strip(),"div"!==t&&0!==r&&i.iushrn(r),{div:o||null,mod:i}},n.prototype.divmod=function(e,t,i){var a,s,o;return(r(!e.isZero()),this.isZero())?{div:new n(0),mod:new n(0)}:0!==this.negative&&0===e.negative?(o=this.neg().divmod(e,t),"mod"!==t&&(a=o.div.neg()),"div"!==t&&(s=o.mod.neg(),i&&0!==s.negative)&&s.iadd(e),{div:a,mod:s}):0===this.negative&&0!==e.negative?(o=this.divmod(e.neg(),t),"mod"!==t&&(a=o.div.neg()),{div:a,mod:o.mod}):(this.negative&e.negative)!=0?(o=this.neg().divmod(e.neg(),t),"div"!==t&&(s=o.mod.neg(),i&&0!==s.negative)&&s.isub(e),{div:o.div,mod:s}):e.length>this.length||0>this.cmp(e)?{div:new n(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new n(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new n(this.modn(e.words[0]))}:this._wordDiv(e,t)},n.prototype.div=function(e){return this.divmod(e,"div",!1).div},n.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},n.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},n.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,i=e.ushrn(1),n=e.andln(1),a=r.cmp(i);return a<0||1===n&&0===a?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},n.prototype.modn=function(e){r(e<=0x3ffffff);for(var t=0x4000000%e,i=0,n=this.length-1;n>=0;n--)i=(t*i+(0|this.words[n]))%e;return i},n.prototype.idivn=function(e){r(e<=0x3ffffff);for(var t=0,i=this.length-1;i>=0;i--){var n=(0|this.words[i])+0x4000000*t;this.words[i]=n/e|0,t=n%e}return this.strip()},n.prototype.divn=function(e){return this.clone().idivn(e)},n.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,i=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var a=new n(1),s=new n(0),o=new n(0),f=new n(1),h=0;t.isEven()&&i.isEven();)t.iushrn(1),i.iushrn(1),++h;for(var u=i.clone(),d=t.clone();!t.isZero();){for(var c=0,p=1;(t.words[0]&p)==0&&c<26;++c,p<<=1);if(c>0)for(t.iushrn(c);c-- >0;)(a.isOdd()||s.isOdd())&&(a.iadd(u),s.isub(d)),a.iushrn(1),s.iushrn(1);for(var m=0,g=1;(i.words[0]&g)==0&&m<26;++m,g<<=1);if(m>0)for(i.iushrn(m);m-- >0;)(o.isOdd()||f.isOdd())&&(o.iadd(u),f.isub(d)),o.iushrn(1),f.iushrn(1);t.cmp(i)>=0?(t.isub(i),a.isub(o),s.isub(f)):(i.isub(t),o.isub(a),f.isub(s))}return{a:o,b:f,gcd:i.iushln(h)}},n.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t,i=this,a=e.clone();i=0!==i.negative?i.umod(e):i.clone();for(var s=new n(1),o=new n(0),f=a.clone();i.cmpn(1)>0&&a.cmpn(1)>0;){for(var h=0,u=1;(i.words[0]&u)==0&&h<26;++h,u<<=1);if(h>0)for(i.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(f),s.iushrn(1);for(var d=0,c=1;(a.words[0]&c)==0&&d<26;++d,c<<=1);if(d>0)for(a.iushrn(d);d-- >0;)o.isOdd()&&o.iadd(f),o.iushrn(1);i.cmp(a)>=0?(i.isub(a),s.isub(o)):(a.isub(i),o.isub(s))}return 0>(t=0===i.cmpn(1)?s:o).cmpn(0)&&t.iadd(e),t},n.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var i=0;t.isEven()&&r.isEven();i++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=t.cmp(r);if(n<0){var a=t;t=r,r=a}else if(0===n||0===r.cmpn(1))break;t.isub(r)}return r.iushln(i)},n.prototype.invm=function(e){return this.egcd(e).a.umod(e)},n.prototype.isEven=function(){return(1&this.words[0])==0},n.prototype.isOdd=function(){return(1&this.words[0])==1},n.prototype.andln=function(e){return this.words[0]&e},n.prototype.bincn=function(e){r("number"==typeof e);var t=e%26,i=(e-t)/26,n=1<>>26,o&=0x3ffffff,this.words[s]=o}return 0!==a&&(this.words[s]=a,this.length++),this},n.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},n.prototype.cmpn=function(e){var t,i=e<0;if(0!==this.negative&&!i)return -1;if(0===this.negative&&i)return 1;if(this.strip(),this.length>1)t=1;else{i&&(e=-e),r(e<=0x3ffffff,"Number is too big");var n=0|this.words[0];t=n===e?0:ne.length)return 1;if(this.length=0;r--){var i=0|this.words[r],n=0|e.words[r];if(i!==n){in&&(t=1);break}}return t},n.prototype.gtn=function(e){return 1===this.cmpn(e)},n.prototype.gt=function(e){return 1===this.cmp(e)},n.prototype.gten=function(e){return this.cmpn(e)>=0},n.prototype.gte=function(e){return this.cmp(e)>=0},n.prototype.ltn=function(e){return -1===this.cmpn(e)},n.prototype.lt=function(e){return -1===this.cmp(e)},n.prototype.lten=function(e){return 0>=this.cmpn(e)},n.prototype.lte=function(e){return 0>=this.cmp(e)},n.prototype.eqn=function(e){return 0===this.cmpn(e)},n.prototype.eq=function(e){return 0===this.cmp(e)},n.red=function(e){return new E(e)},n.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},n.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype._forceRed=function(e){return this.red=e,this},n.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},n.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},n.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},n.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},n.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},n.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},n.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},n.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},n.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},n.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},n.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},n.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var y={k256:null,p224:null,p192:null,p25519:null};function w(e,t){this.name=e,this.p=new n(t,16),this.n=this.p.bitLength(),this.k=new n(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function _(){w.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function M(){w.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function x(){w.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function S(){w.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function E(e){if("string"==typeof e){var t=n._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function k(e){E.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new n(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)}w.prototype._tmp=function(){var e=new n(null);return e.words=Array(Math.ceil(this.n/13)),e},w.prototype.ireduce=function(e){var t,r=e;do this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength();while(t>this.n);var i=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},w.prototype.split=function(e,t){e.iushrn(this.n,0,t)},w.prototype.imulK=function(e){return e.imul(this.k)},i(_,w),_.prototype.split=function(e,t){for(var r=Math.min(e.length,9),i=0;i>>22,n=a}(n>>>=22,e.words[i-10]=n,0===n&&e.length>10)?e.length-=10:e.length-=9},_.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=n,t=i}return 0!==t&&(e.words[e.length++]=t),e},n._prime=function(e){var t;if(y[e])return y[e];if("k256"===e)t=new _;else if("p224"===e)t=new M;else if("p192"===e)t=new x;else if("p25519"===e)t=new S;else throw Error("Unknown prime "+e);return y[e]=t,t},E.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},E.prototype._verify2=function(e,t){r((e.negative|t.negative)==0,"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},E.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},E.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},E.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},E.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},E.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return 0>r.cmpn(0)&&r.iadd(this.m),r._forceRed(this)},E.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return 0>r.cmpn(0)&&r.iadd(this.m),r},E.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},E.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},E.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},E.prototype.isqr=function(e){return this.imul(e,e.clone())},E.prototype.sqr=function(e){return this.mul(e,e)},E.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2==1),3===t){var i=this.m.add(new n(1)).iushrn(2);return this.pow(e,i)}for(var a=this.m.subn(1),s=0;!a.isZero()&&0===a.andln(1);)s++,a.iushrn(1);r(!a.isZero());var o=new n(1).toRed(this),f=o.redNeg(),h=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new n(2*u*u).toRed(this);0!==this.pow(u,h).cmp(f);)u.redIAdd(f);for(var d=this.pow(u,a),c=this.pow(e,a.addn(1).iushrn(1)),p=this.pow(e,a),m=s;0!==p.cmp(o);){for(var g=p,v=0;0!==g.cmp(o);v++)g=g.redSqr();r(v=0;i--){for(var h=t.words[i],u=f-1;u>=0;u--){var d=h>>u&1;if(a!==r[0]&&(a=this.sqr(a)),0===d&&0===s){o=0;continue}s<<=1,s|=d,(4==++o||0===i&&0===u)&&(a=this.mul(a,r[s]),o=0,s=0)}f=26}return a},E.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},E.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},n.mont=function(e){return new k(e)},i(k,E),k.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},k.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},k.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),a=n;return n.cmp(this.m)>=0?a=n.isub(this.m):0>n.cmpn(0)&&(a=n.iadd(this.m)),a._forceRed(this)},k.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new n(0)._forceRed(this);var r=e.mul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=r.isub(i).iushrn(this.shift),s=a;return a.cmp(this.m)>=0?s=a.isub(this.m):0>a.cmpn(0)&&(s=a.iadd(this.m)),s._forceRed(this)},k.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(typeof t>"u"||t,e)}),rO=iQ(e=>{var t=rV(),r=rr();function i(e,t){this.name=e,this.body=t,this.decoders={},this.encoders={}}e.define=function(e,t){return new i(e,t)},i.prototype._createNamed=function(e){var t;try{t=(()=>{throw Error("Cannot require module vm")})().runInThisContext("(function "+this.name+`(entity) { this._initNamed(entity); })`)}catch(e){t=function(e){this._initNamed(e)}}return r(t,e),t.prototype._initNamed=function(t){e.call(this,t)},new t(this)},i.prototype._getDecoder=function(e){return e=e||"der",this.decoders.hasOwnProperty(e)||(this.decoders[e]=this._createNamed(t.decoders[e])),this.decoders[e]},i.prototype.decode=function(e,t,r){return this._getDecoder(t).decode(e,r)},i.prototype._getEncoder=function(e){return e=e||"der",this.encoders.hasOwnProperty(e)||(this.encoders[e]=this._createNamed(t.encoders[e])),this.encoders[e]},i.prototype.encode=function(e,t,r){return this._getEncoder(t).encode(e,r)}}),rC=iQ(e=>{var t=rr();function r(e){this._reporterState={obj:null,path:[],options:e||{},errors:[]}}function i(e,t){this.path=e,this.rethrow(t)}e.Reporter=r,r.prototype.isError=function(e){return e instanceof i},r.prototype.save=function(){var e=this._reporterState;return{obj:e.obj,pathLen:e.path.length}},r.prototype.restore=function(e){var t=this._reporterState;t.obj=e.obj,t.path=t.path.slice(0,e.pathLen)},r.prototype.enterKey=function(e){return this._reporterState.path.push(e)},r.prototype.exitKey=function(e){var t=this._reporterState;t.path=t.path.slice(0,e-1)},r.prototype.leaveKey=function(e,t,r){var i=this._reporterState;this.exitKey(e),null!==i.obj&&(i.obj[t]=r)},r.prototype.path=function(){return this._reporterState.path.join("/")},r.prototype.enterObject=function(){var e=this._reporterState,t=e.obj;return e.obj={},t},r.prototype.leaveObject=function(e){var t=this._reporterState,r=t.obj;return t.obj=e,r},r.prototype.error=function(e){var t,r=this._reporterState,n=e instanceof i;if(t=n?e:new i(r.path.map(function(e){return"["+JSON.stringify(e)+"]"}).join(""),e.message||e,e.stack),!r.options.partial)throw t;return n||r.errors.push(t),t},r.prototype.wrapResult=function(e){var t=this._reporterState;return t.options.partial?{result:this.isError(e)?null:e,errors:t.errors}:e},t(i,Error),i.prototype.rethrow=function(e){if(this.message=e+" at: "+(this.path||"(shallow)"),Error.captureStackTrace&&Error.captureStackTrace(this,i),!this.stack)try{throw Error(this.message)}catch(e){this.stack=e.stack}return this}}),rN=iQ(e=>{var t=rr(),r=rL().Reporter,i=(ek(),p(b)).Buffer;function n(e,t){if(r.call(this,t),!i.isBuffer(e))return void this.error("Input not Buffer");this.base=e,this.offset=0,this.length=e.length}function a(e,t){if(Array.isArray(e))this.length=0,this.value=e.map(function(e){return e instanceof a||(e=new a(e,t)),this.length+=e.length,e},this);else if("number"==typeof e){if(!(0<=e&&e<=255))return t.error("non-byte EncoderBuffer value");this.value=e,this.length=1}else if("string"==typeof e)this.value=e,this.length=i.byteLength(e);else{if(!i.isBuffer(e))return t.error("Unsupported type: "+typeof e);this.value=e,this.length=e.length}}t(n,r),e.DecoderBuffer=n,n.prototype.save=function(){return{offset:this.offset,reporter:r.prototype.save.call(this)}},n.prototype.restore=function(e){var t=new n(this.base);return t.offset=e.offset,t.length=this.offset,this.offset=e.offset,r.prototype.restore.call(this,e.reporter),t},n.prototype.isEmpty=function(){return this.offset===this.length},n.prototype.readUInt8=function(e){return this.offset+1<=this.length?this.base.readUInt8(this.offset++,!0):this.error(e||"DecoderBuffer overrun")},n.prototype.skip=function(e,t){if(!(this.offset+e<=this.length))return this.error(t||"DecoderBuffer overrun");var r=new n(this.base);return r._reporterState=this._reporterState,r.offset=this.offset,r.length=this.offset+e,this.offset+=e,r},n.prototype.raw=function(e){return this.base.slice(e?e.offset:this.offset,this.length)},e.EncoderBuffer=a,a.prototype.join=function(e,t){return e||(e=new i(this.length)),t||(t=0),0===this.length||(Array.isArray(this.value)?this.value.forEach(function(r){r.join(e,t),t+=r.length}):("number"==typeof this.value?e[t]=this.value:"string"==typeof this.value?e.write(this.value,t):i.isBuffer(this.value)&&this.value.copy(e,t),t+=this.length)),e}}),rD=iQ((e,t)=>{var r=rL().Reporter,i=rL().EncoderBuffer,n=rL().DecoderBuffer,a=t9(),s=["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"],o=["key","obj","use","optional","explicit","implicit","def","choice","any","contains"].concat(s);function f(e,t){var r={};this._baseState=r,r.enc=e,r.parent=t||null,r.children=null,r.tag=null,r.args=null,r.reverseArgs=null,r.choice=null,r.optional=!1,r.any=!1,r.obj=!1,r.use=null,r.useDecoder=null,r.key=null,r.default=null,r.explicit=null,r.implicit=null,r.contains=null,r.parent||(r.children=[],this._wrap())}t.exports=f;var h=["enc","parent","children","tag","args","reverseArgs","choice","optional","any","obj","use","alteredUse","key","default","explicit","implicit","contains"];f.prototype.clone=function(){var e=this._baseState,t={};h.forEach(function(r){t[r]=e[r]});var r=new this.constructor(t.parent);return r._baseState=t,r},f.prototype._wrap=function(){var e=this._baseState;o.forEach(function(t){this[t]=function(){var r=new this.constructor(this);return e.children.push(r),r[t].apply(r,arguments)}},this)},f.prototype._init=function(e){var t=this._baseState;a(null===t.parent),e.call(this),t.children=t.children.filter(function(e){return e._baseState.parent===this},this),a.equal(t.children.length,1,"Root node can have only one child")},f.prototype._useArgs=function(e){var t=this._baseState,r=e.filter(function(e){return e instanceof this.constructor},this);e=e.filter(function(e){return!(e instanceof this.constructor)},this),0!==r.length&&(a(null===t.children),t.children=r,r.forEach(function(e){e._baseState.parent=this},this)),0!==e.length&&(a(null===t.args),t.args=e,t.reverseArgs=e.map(function(e){if("object"!=typeof e||e.constructor!==Object)return e;var t={};return Object.keys(e).forEach(function(r){r==(0|r)&&(r|=0),t[e[r]]=r}),t}))},["_peekTag","_decodeTag","_use","_decodeStr","_decodeObjid","_decodeTime","_decodeNull","_decodeInt","_decodeBool","_decodeList","_encodeComposite","_encodeStr","_encodeObjid","_encodeTime","_encodeNull","_encodeInt","_encodeBool"].forEach(function(e){f.prototype[e]=function(){throw Error(e+" not implemented for encoding: "+this._baseState.enc)}}),s.forEach(function(e){f.prototype[e]=function(){var t=this._baseState,r=Array.prototype.slice.call(arguments);return a(null===t.tag),t.tag=e,this._useArgs(r),this}}),f.prototype.use=function(e){a(e);var t=this._baseState;return a(null===t.use),t.use=e,this},f.prototype.optional=function(){return this._baseState.optional=!0,this},f.prototype.def=function(e){var t=this._baseState;return a(null===t.default),t.default=e,t.optional=!0,this},f.prototype.explicit=function(e){var t=this._baseState;return a(null===t.explicit&&null===t.implicit),t.explicit=e,this},f.prototype.implicit=function(e){var t=this._baseState;return a(null===t.explicit&&null===t.implicit),t.implicit=e,this},f.prototype.obj=function(){var e=this._baseState,t=Array.prototype.slice.call(arguments);return e.obj=!0,0!==t.length&&this._useArgs(t),this},f.prototype.key=function(e){var t=this._baseState;return a(null===t.key),t.key=e,this},f.prototype.any=function(){return this._baseState.any=!0,this},f.prototype.choice=function(e){var t=this._baseState;return a(null===t.choice),t.choice=e,this._useArgs(Object.keys(e).map(function(t){return e[t]})),this},f.prototype.contains=function(e){var t=this._baseState;return a(null===t.use),t.contains=e,this},f.prototype._decode=function(e,t){var r,i=this._baseState;if(null===i.parent)return e.wrapResult(i.children[0]._decode(e,t));var a=i.default,s=!0,o=null;if(null!==i.key&&(o=e.enterKey(i.key)),i.optional){var f=null;if(null!==i.explicit?f=i.explicit:null!==i.implicit?f=i.implicit:null!==i.tag&&(f=i.tag),null!==f||i.any){if(s=this._peekTag(e,f,i.any),e.isError(s))return s}else{var h=e.save();try{null===i.choice?this._decodeGeneric(i.tag,e,t):this._decodeChoice(e,t),s=!0}catch(e){s=!1}e.restore(h)}}if(i.obj&&s&&(r=e.enterObject()),s){if(null!==i.explicit){var u=this._decodeTag(e,i.explicit);if(e.isError(u))return u;e=u}var d=e.offset;if(null===i.use&&null===i.choice){if(i.any)var h=e.save();var c=this._decodeTag(e,null!==i.implicit?i.implicit:i.tag,i.any);if(e.isError(c))return c;i.any?a=e.raw(h):e=c}if(t&&t.track&&null!==i.tag&&t.track(e.path(),d,e.length,"tagged"),t&&t.track&&null!==i.tag&&t.track(e.path(),e.offset,e.length,"content"),i.any||(a=null===i.choice?this._decodeGeneric(i.tag,e,t):this._decodeChoice(e,t)),e.isError(a))return a;if(i.any||null!==i.choice||null===i.children||i.children.forEach(function(r){r._decode(e,t)}),i.contains&&("octstr"===i.tag||"bitstr"===i.tag)){var p=new n(a);a=this._getUse(i.contains,e._reporterState.obj)._decode(p,t)}}return i.obj&&s&&(a=e.leaveObject(r)),null!==i.key&&(null!==a||!0===s)?e.leaveKey(o,i.key,a):null!==o&&e.exitKey(o),a},f.prototype._decodeGeneric=function(e,t,r){var i=this._baseState;if("seq"===e||"set"===e)return null;if("seqof"===e||"setof"===e)return this._decodeList(t,e,i.args[0],r);if(/str$/.test(e))return this._decodeStr(t,e,r);if("objid"===e&&i.args)return this._decodeObjid(t,i.args[0],i.args[1],r);if("objid"===e)return this._decodeObjid(t,null,null,r);if("gentime"===e||"utctime"===e)return this._decodeTime(t,e,r);else if("null_"===e)return this._decodeNull(t,r);else if("bool"===e)return this._decodeBool(t,r);else if("objDesc"===e)return this._decodeStr(t,e,r);else if("int"===e||"enum"===e)return this._decodeInt(t,i.args&&i.args[0],r);return null!==i.use?this._getUse(i.use,t._reporterState.obj)._decode(t,r):t.error("unknown tag: "+e)},f.prototype._getUse=function(e,t){var r=this._baseState;return r.useDecoder=this._use(e,t),a(null===r.useDecoder._baseState.parent),r.useDecoder=r.useDecoder._baseState.children[0],r.implicit!==r.useDecoder._baseState.implicit&&(r.useDecoder=r.useDecoder.clone(),r.useDecoder._baseState.implicit=r.implicit),r.useDecoder},f.prototype._decodeChoice=function(e,t){var r=this._baseState,i=null,n=!1;return(Object.keys(r.choice).some(function(a){var s=e.save(),o=r.choice[a];try{var f=o._decode(e,t);if(e.isError(f))return!1;i={type:a,value:f},n=!0}catch(t){return e.restore(s),!1}return!0},this),n)?i:e.error("Choice not matched")},f.prototype._createEncoderBuffer=function(e){return new i(e,this.reporter)},f.prototype._encode=function(e,t,r){var i=this._baseState;if(null===i.default||i.default!==e){var n=this._encodeValue(e,t,r);if(void 0!==n&&!this._skipDefault(n,t,r))return n}},f.prototype._encodeValue=function(e,t,i){var n,a=this._baseState;if(null===a.parent)return a.children[0]._encode(e,t||new r);var n=null;if(this.reporter=t,a.optional&&void 0===e)if(null===a.default)return;else e=a.default;var s=null,o=!1;if(a.any)n=this._createEncoderBuffer(e);else if(a.choice)n=this._encodeChoice(e,t);else if(a.contains)s=this._getUse(a.contains,i)._encode(e,t),o=!0;else if(a.children)s=a.children.map(function(r){if("null_"===r._baseState.tag)return r._encode(null,t,e);if(null===r._baseState.key)return t.error("Child should have a key");var i=t.enterKey(r._baseState.key);if("object"!=typeof e)return t.error("Child expected, but input is not object");var n=r._encode(e[r._baseState.key],t,e);return t.leaveKey(i),n},this).filter(function(e){return e}),s=this._createEncoderBuffer(s);else if("seqof"===a.tag||"setof"===a.tag){if(!(a.args&&1===a.args.length))return t.error("Too many args for : "+a.tag);if(!Array.isArray(e))return t.error("seqof/setof, but data is not Array");var f=this.clone();f._baseState.implicit=null,s=this._createEncoderBuffer(e.map(function(r){var i=this._baseState;return this._getUse(i.args[0],e)._encode(r,t)},f))}else null!==a.use?n=this._getUse(a.use,i)._encode(e,t):(s=this._encodePrimitive(a.tag,e),o=!0);if(!a.any&&null===a.choice){var h=null!==a.implicit?a.implicit:a.tag,u=null===a.implicit?"universal":"context";null===h?null===a.use&&t.error("Tag could be omitted only for .use()"):null===a.use&&(n=this._encodeComposite(h,o,u,s))}return null!==a.explicit&&(n=this._encodeComposite(a.explicit,!1,"context",n)),n},f.prototype._encodeChoice=function(e,t){var r=this._baseState,i=r.choice[e.type];return i||a(!1,e.type+" not found in "+JSON.stringify(Object.keys(r.choice))),i._encode(e.value,t)},f.prototype._encodePrimitive=function(e,t){var r=this._baseState;if(/str$/.test(e))return this._encodeStr(t,e);if("objid"===e&&r.args)return this._encodeObjid(t,r.reverseArgs[0],r.args[1]);if("objid"===e)return this._encodeObjid(t,null,null);if("gentime"===e||"utctime"===e)return this._encodeTime(t,e);if("null_"===e)return this._encodeNull();else if("int"===e||"enum"===e)return this._encodeInt(t,r.args&&r.reverseArgs[0]);else if("bool"===e)return this._encodeBool(t);else if("objDesc"===e)return this._encodeStr(t,e);else throw Error("Unsupported tag: "+e)},f.prototype._isNumstr=function(e){return/^[0-9 ]*$/.test(e)},f.prototype._isPrintstr=function(e){return/^[A-Za-z0-9 '\(\)\+,\-\.\/:=\?]*$/.test(e)}}),rL=iQ(e=>{e.Reporter=rC().Reporter,e.DecoderBuffer=rN().DecoderBuffer,e.EncoderBuffer=rN().EncoderBuffer,e.Node=rD()}),r$=iQ(e=>{var t=rq();e.tagClass={0:"universal",1:"application",2:"context",3:"private"},e.tagClassByName=t._reverse(e.tagClass),e.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"},e.tagByName=t._reverse(e.tag)}),rq=iQ(e=>{e._reverse=function(e){var t={};return Object.keys(e).forEach(function(r){(0|r)==r&&(r|=0),t[e[r]]=r}),t},e.der=r$()}),rB=iQ((e,t)=>{var r=rr(),i=rV(),n=i.base,a=i.bignum,s=i.constants.der;function o(e){this.enc="der",this.name=e.name,this.entity=e,this.tree=new f,this.tree._init(e.body)}function f(e){n.Node.call(this,"der",e)}function h(e,t){var r=e.readUInt8(t);if(e.isError(r))return r;var i=s.tagClass[r>>6],n=(32&r)==0;if((31&r)==31){var a=r;for(r=0;(128&a)==128;){if(a=e.readUInt8(t),e.isError(a))return a;r<<=7,r|=127&a}}else r&=31;var o=s.tag[r];return{cls:i,primitive:n,tag:r,tagStr:o}}function u(e,t,r){var i=e.readUInt8(r);if(e.isError(i))return i;if(!t&&128===i)return null;if((128&i)==0)return i;var n=127&i;if(n>4)return e.error("length octect is too long");i=0;for(var a=0;a{var r=rr(),i=(ek(),p(b)).Buffer,n=rB();function a(e){n.call(this,e),this.enc="pem"}r(a,n),t.exports=a,a.prototype.decode=function(e,t){for(var r=e.toString().split(/[\r\n]+/g),a=t.label.toUpperCase(),s=/^-----(BEGIN|END) ([^-]+)-----$/,o=-1,f=-1,h=0;h{e.der=rB(),e.pem=rF()}),rZ=iQ((e,t)=>{var r=rr(),i=(ek(),p(b)).Buffer,n=rV(),a=n.base,s=n.constants.der;function o(e){this.enc="der",this.name=e.name,this.entity=e,this.tree=new f,this.tree._init(e.body)}function f(e){a.Node.call(this,"der",e)}function h(e){return e<10?"0"+e:e}t.exports=o,o.prototype.encode=function(e,t){return this.tree._encode(e,t).join()},r(f,a.Node),f.prototype._encodeComposite=function(e,t,r,n){var a=function(e,t,r,i){var n;if("seqof"===e?e="seq":"setof"===e&&(e="set"),s.tagByName.hasOwnProperty(e))n=s.tagByName[e];else{if("number"!=typeof e||(0|e)!==e)return i.error("Unknown tag: "+e);n=e}return n>=31?i.error("Multi-octet tag encoding unsupported"):(t||(n|=32),n|s.tagClassByName[r||"universal"]<<6)}(e,t,r,this.reporter);if(n.length<128){var o=new i(2);return o[0]=a,o[1]=n.length,this._createEncoderBuffer([o,n])}for(var f=1,h=n.length;h>=256;h>>=8)f++;var o=new i(2+f);o[0]=a,o[1]=128|f;for(var h=1+f,u=n.length;u>0;h--,u>>=8)o[h]=255&u;return this._createEncoderBuffer([o,n])},f.prototype._encodeStr=function(e,t){if("bitstr"===t)return this._createEncoderBuffer([0|e.unused,e.data]);if("bmpstr"===t){for(var r=new i(2*e.length),n=0;n=40)return this.reporter.error("Second objid identifier OOB");e.splice(0,2,40*e[0]+e[1])}for(var a=0,n=0;n=128;s>>=7)a++}for(var o=new i(a),f=o.length-1,n=e.length-1;n>=0;n--){var s=e[n];for(o[f--]=127&s;(s>>=7)>0;)o[f--]=128|127&s}return this._createEncoderBuffer(o)},f.prototype._encodeTime=function(e,t){var r,i=new Date(e);return"gentime"===t?r=""+h(i.getFullYear())+h(i.getUTCMonth()+1)+h(i.getUTCDate())+h(i.getUTCHours())+h(i.getUTCMinutes())+h(i.getUTCSeconds())+"Z":"utctime"===t?r=""+h(i.getFullYear()%100)+h(i.getUTCMonth()+1)+h(i.getUTCDate())+h(i.getUTCHours())+h(i.getUTCMinutes())+h(i.getUTCSeconds())+"Z":this.reporter.error("Encoding "+t+" time is not supported yet"),this._encodeStr(r,"octstr")},f.prototype._encodeNull=function(){return this._createEncoderBuffer("")},f.prototype._encodeInt=function(e,t){if("string"==typeof e){if(!t)return this.reporter.error("String int or enum given, but no values map");if(!t.hasOwnProperty(e))return this.reporter.error("Values map doesn't contain: "+JSON.stringify(e));e=t[e]}if("number"!=typeof e&&!i.isBuffer(e)){var r=e.toArray();!e.sign&&128&r[0]&&r.unshift(0),e=new i(r)}if(i.isBuffer(e)){var n=e.length;0===e.length&&n++;var a=new i(n);return e.copy(a),0===e.length&&(a[0]=0),this._createEncoderBuffer(a)}if(e<128)return this._createEncoderBuffer(e);if(e<256)return this._createEncoderBuffer([0,e]);for(var n=1,s=e;s>=256;s>>=8)n++;for(var a=Array(n),s=a.length-1;s>=0;s--)a[s]=255&e,e>>=8;return 128&a[0]&&a.unshift(0),this._createEncoderBuffer(new i(a))},f.prototype._encodeBool=function(e){return this._createEncoderBuffer(255*!!e)},f.prototype._use=function(e,t){return"function"==typeof e&&(e=e(t)),e._getEncoder("der").tree},f.prototype._skipDefault=function(e,t,r){var i,n=this._baseState;if(null===n.default)return!1;var a=e.join();if(void 0===n.defaultBuffer&&(n.defaultBuffer=this._encodeValue(n.default,t,r).join()),a.length!==n.defaultBuffer.length)return!1;for(i=0;i{var r=rr(),i=rZ();function n(e){i.call(this,e),this.enc="pem"}r(n,i),t.exports=n,n.prototype.encode=function(e,t){for(var r=i.prototype.encode.call(this,e).toString("base64"),n=["-----BEGIN "+t.label+"-----"],a=0;a{e.der=rZ(),e.pem=rU()}),rV=iQ(e=>{e.bignum=rj(),e.define=rO().define,e.base=rL(),e.constants=rq(),e.decoders=rz(),e.encoders=rH()}),rW=iQ((e,t)=>{var r=rV(),i=r.define("Time",function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})}),n=r.define("AttributeTypeValue",function(){this.seq().obj(this.key("type").objid(),this.key("value").any())}),a=r.define("AlgorithmIdentifier",function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional(),this.key("curve").objid().optional())}),s=r.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(a),this.key("subjectPublicKey").bitstr())}),o=r.define("RelativeDistinguishedName",function(){this.setof(n)}),f=r.define("RDNSequence",function(){this.seqof(o)}),h=r.define("Name",function(){this.choice({rdnSequence:this.use(f)})}),u=r.define("Validity",function(){this.seq().obj(this.key("notBefore").use(i),this.key("notAfter").use(i))}),d=r.define("Extension",function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())}),c=r.define("TBSCertificate",function(){this.seq().obj(this.key("version").explicit(0).int().optional(),this.key("serialNumber").int(),this.key("signature").use(a),this.key("issuer").use(h),this.key("validity").use(u),this.key("subject").use(h),this.key("subjectPublicKeyInfo").use(s),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(d).optional())});t.exports=r.define("X509Certificate",function(){this.seq().obj(this.key("tbsCertificate").use(c),this.key("signatureAlgorithm").use(a),this.key("signatureValue").bitstr())})}),rK=iQ(e=>{var t=rV();e.certificate=rW(),e.RSAPrivateKey=t.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())}),e.RSAPublicKey=t.define("RSAPublicKey",function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())});var r=t.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())});e.PublicKey=t.define("SubjectPublicKeyInfo",function(){this.seq().obj(this.key("algorithm").use(r),this.key("subjectPublicKey").bitstr())}),e.PrivateKey=t.define("PrivateKeyInfo",function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(r),this.key("subjectPrivateKey").octstr())}),e.EncryptedPrivateKey=t.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())}),e.DSAPrivateKey=t.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())}),e.DSAparam=t.define("DSAparam",function(){this.int()});var i=t.define("ECParameters",function(){this.choice({namedCurve:this.objid()})});e.ECPrivateKey=t.define("ECPrivateKey",function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(i),this.key("publicKey").optional().explicit(1).bitstr())}),e.signature=t.define("signature",function(){this.seq().obj(this.key("r").int(),this.key("s").int())})}),rQ=iQ((e,t)=>{t.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"}}),rG=iQ((e,t)=>{var r=tG().Buffer,i=tD().Transform;function n(e){i.call(this),this._block=r.allocUnsafe(e),this._blockSize=e,this._blockOffset=0,this._length=[0,0,0,0],this._finalized=!1}rr()(n,i),n.prototype._transform=function(e,t,r){var i=null;try{this.update(e,t)}catch(e){i=e}r(i)},n.prototype._flush=function(e){var t=null;try{this.push(this.digest())}catch(e){t=e}e(t)};var a="u">typeof Uint8Array,s="u">typeof ArrayBuffer&&"u">typeof Uint8Array&&ArrayBuffer.isView&&(r.prototype instanceof Uint8Array||r.TYPED_ARRAY_SUPPORT);n.prototype.update=function(e,t){if(this._finalized)throw Error("Digest already called");e=function(e,t){if(e instanceof r)return e;if("string"==typeof e)return r.from(e,t);if(s&&ArrayBuffer.isView(e)){if(0===e.byteLength)return r.alloc(0);var i=r.from(e.buffer,e.byteOffset,e.byteLength);if(i.byteLength===e.byteLength)return i}if(a&&e instanceof Uint8Array||r.isBuffer(e)&&e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e))return r.from(e);throw TypeError('The "data" argument must be of type string or an instance of Buffer, TypedArray, or DataView.')}(e,t);for(var i=this._block,n=0;this._blockOffset+e.length-n>=this._blockSize;){for(var o=this._blockOffset;o0;++f)this._length[f]+=h,(h=this._length[f]/0x100000000|0)>0&&(this._length[f]-=0x100000000*h);return this},n.prototype._update=function(){throw Error("_update is not implemented")},n.prototype.digest=function(e){if(this._finalized)throw Error("Digest already called");this._finalized=!0;var t=this._digest();void 0!==e&&(t=t.toString(e)),this._block.fill(0),this._blockOffset=0;for(var r=0;r<4;++r)this._length[r]=0;return t},n.prototype._digest=function(){throw Error("_digest is not implemented")},t.exports=n}),rJ=iQ((e,t)=>{var r=rr(),i=rG(),n=tG().Buffer,a=Array(16);function s(){i.call(this,64),this._a=0x67452301,this._b=0xefcdab89,this._c=0x98badcfe,this._d=0x10325476}function o(e,t){return e<>>32-t}function f(e,t,r,i,n,a,s){return o(e+(t&r|~t&i)+n+a|0,s)+t|0}function h(e,t,r,i,n,a,s){return o(e+(t&i|r&~i)+n+a|0,s)+t|0}function u(e,t,r,i,n,a,s){return o(e+(t^r^i)+n+a|0,s)+t|0}function d(e,t,r,i,n,a,s){return o(e+(r^(t|~i))+n+a|0,s)+t|0}r(s,i),s.prototype._update=function(){for(var e=0;e<16;++e)a[e]=this._block.readInt32LE(4*e);var t=this._a,r=this._b,i=this._c,n=this._d;t=f(t,r,i,n,a[0],0xd76aa478,7),n=f(n,t,r,i,a[1],0xe8c7b756,12),i=f(i,n,t,r,a[2],0x242070db,17),r=f(r,i,n,t,a[3],0xc1bdceee,22),t=f(t,r,i,n,a[4],0xf57c0faf,7),n=f(n,t,r,i,a[5],0x4787c62a,12),i=f(i,n,t,r,a[6],0xa8304613,17),r=f(r,i,n,t,a[7],0xfd469501,22),t=f(t,r,i,n,a[8],0x698098d8,7),n=f(n,t,r,i,a[9],0x8b44f7af,12),i=f(i,n,t,r,a[10],0xffff5bb1,17),r=f(r,i,n,t,a[11],0x895cd7be,22),t=f(t,r,i,n,a[12],0x6b901122,7),n=f(n,t,r,i,a[13],0xfd987193,12),i=f(i,n,t,r,a[14],0xa679438e,17),r=f(r,i,n,t,a[15],0x49b40821,22),t=h(t,r,i,n,a[1],0xf61e2562,5),n=h(n,t,r,i,a[6],0xc040b340,9),i=h(i,n,t,r,a[11],0x265e5a51,14),r=h(r,i,n,t,a[0],0xe9b6c7aa,20),t=h(t,r,i,n,a[5],0xd62f105d,5),n=h(n,t,r,i,a[10],0x2441453,9),i=h(i,n,t,r,a[15],0xd8a1e681,14),r=h(r,i,n,t,a[4],0xe7d3fbc8,20),t=h(t,r,i,n,a[9],0x21e1cde6,5),n=h(n,t,r,i,a[14],0xc33707d6,9),i=h(i,n,t,r,a[3],0xf4d50d87,14),r=h(r,i,n,t,a[8],0x455a14ed,20),t=h(t,r,i,n,a[13],0xa9e3e905,5),n=h(n,t,r,i,a[2],0xfcefa3f8,9),i=h(i,n,t,r,a[7],0x676f02d9,14),r=h(r,i,n,t,a[12],0x8d2a4c8a,20),t=u(t,r,i,n,a[5],0xfffa3942,4),n=u(n,t,r,i,a[8],0x8771f681,11),i=u(i,n,t,r,a[11],0x6d9d6122,16),r=u(r,i,n,t,a[14],0xfde5380c,23),t=u(t,r,i,n,a[1],0xa4beea44,4),n=u(n,t,r,i,a[4],0x4bdecfa9,11),i=u(i,n,t,r,a[7],0xf6bb4b60,16),r=u(r,i,n,t,a[10],0xbebfbc70,23),t=u(t,r,i,n,a[13],0x289b7ec6,4),n=u(n,t,r,i,a[0],0xeaa127fa,11),i=u(i,n,t,r,a[3],0xd4ef3085,16),r=u(r,i,n,t,a[6],0x4881d05,23),t=u(t,r,i,n,a[9],0xd9d4d039,4),n=u(n,t,r,i,a[12],0xe6db99e5,11),i=u(i,n,t,r,a[15],0x1fa27cf8,16),r=u(r,i,n,t,a[2],0xc4ac5665,23),t=d(t,r,i,n,a[0],0xf4292244,6),n=d(n,t,r,i,a[7],0x432aff97,10),i=d(i,n,t,r,a[14],0xab9423a7,15),r=d(r,i,n,t,a[5],0xfc93a039,21),t=d(t,r,i,n,a[12],0x655b59c3,6),n=d(n,t,r,i,a[3],0x8f0ccc92,10),i=d(i,n,t,r,a[10],0xffeff47d,15),r=d(r,i,n,t,a[1],0x85845dd1,21),t=d(t,r,i,n,a[8],0x6fa87e4f,6),n=d(n,t,r,i,a[15],0xfe2ce6e0,10),i=d(i,n,t,r,a[6],0xa3014314,15),r=d(r,i,n,t,a[13],0x4e0811a1,21),t=d(t,r,i,n,a[4],0xf7537e82,6),n=d(n,t,r,i,a[11],0xbd3af235,10),i=d(i,n,t,r,a[2],0x2ad7d2bb,15),r=d(r,i,n,t,a[9],0xeb86d391,21),this._a=this._a+t|0,this._b=this._b+r|0,this._c=this._c+i|0,this._d=this._d+n|0},s.prototype._digest=function(){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 e=n.allocUnsafe(16);return e.writeInt32LE(this._a,0),e.writeInt32LE(this._b,4),e.writeInt32LE(this._c,8),e.writeInt32LE(this._d,12),e},t.exports=s}),rY=iQ((e,t)=>{var r=tG().Buffer,i=rJ();t.exports=function(e,t,n,a){if(r.isBuffer(e)||(e=r.from(e,"binary")),t&&(r.isBuffer(t)||(t=r.from(t,"binary")),8!==t.length))throw RangeError("salt should be Buffer with 8 byte length");for(var s=n/8,o=r.alloc(s),f=r.alloc(a||0),h=r.alloc(0);s>0||a>0;){var u=new i;u.update(h),u.update(e),t&&u.update(t),h=u.digest();var d=0;if(s>0){var c=o.length-s;d=Math.min(s,h.length),h.copy(o,c,0,d),s-=d}if(d0){var p=f.length-a,m=Math.min(a,h.length-d);h.copy(f,p,d,d+m),a-=m}}return h.fill(0),{key:o,iv:f}}}),rX=iQ(e=>{var t=(iX(),p(tL));e.createCipher=e.Cipher=t.createCipher,e.createCipheriv=e.Cipheriv=t.createCipheriv,e.createDecipher=e.Decipher=t.createDecipher,e.createDecipheriv=e.Decipheriv=t.createDecipheriv,e.listCiphers=e.getCiphers=t.getCiphers}),r0=iQ((e,t)=>{var r=/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,i=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m,n=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m,a=rY(),s=rX(),o=tG().Buffer;t.exports=function(e,t){var f,h=e.toString(),u=h.match(r);if(u){var d="aes"+u[1],c=o.from(u[2],"hex"),p=o.from(u[3].replace(/[\r\n]/g,""),"base64"),m=a(t,c.slice(0,8),parseInt(u[1],10)).key,g=[],v=s.createDecipheriv(d,m,c);g.push(v.update(p)),g.push(v.final()),f=o.concat(g)}else{var b=h.match(n);f=o.from(b[2].replace(/[\r\n]/g,""),"base64")}return{tag:h.match(i)[1],data:f}}}),r1=iQ((e,t)=>{var r=rK(),i=rQ(),n=r0(),a=rX(),s=t0(),o=tG().Buffer;function f(e){"object"!=typeof e||o.isBuffer(e)||(y=e.passphrase,e=e.key),"string"==typeof e&&(e=o.from(e));var t,f,h,u,d,c,p,m,g,v,b,y,w,_,M=n(e,y),x=M.tag,S=M.data;switch(x){case"CERTIFICATE":_=r.certificate.decode(S,"der").tbsCertificate.subjectPublicKeyInfo;case"PUBLIC KEY":switch(!_&&(_=r.PublicKey.decode(S,"der")),w=_.algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return r.RSAPublicKey.decode(_.subjectPublicKey.data,"der");case"1.2.840.10045.2.1":return _.subjectPrivateKey=_.subjectPublicKey,{type:"ec",data:_};case"1.2.840.10040.4.1":return _.algorithm.params.pub_key=r.DSAparam.decode(_.subjectPublicKey.data,"der"),{type:"dsa",data:_.algorithm.params};default:throw Error("unknown key id "+w)}case"ENCRYPTED PRIVATE KEY":t=S=r.EncryptedPrivateKey.decode(S,"der"),f=y,h=t.algorithm.decrypt.kde.kdeparams.salt,u=parseInt(t.algorithm.decrypt.kde.kdeparams.iters.toString(),10),d=i[t.algorithm.decrypt.cipher.algo.join(".")],c=t.algorithm.decrypt.cipher.iv,p=t.subjectPrivateKey,m=parseInt(d.split("-")[1],10)/8,g=s.pbkdf2Sync(f,h,u,m,"sha1"),v=a.createDecipheriv(d,g,c),(b=[]).push(v.update(p)),b.push(v.final()),S=o.concat(b);case"PRIVATE KEY":switch(w=(_=r.PrivateKey.decode(S,"der")).algorithm.algorithm.join(".")){case"1.2.840.113549.1.1.1":return r.RSAPrivateKey.decode(_.subjectPrivateKey,"der");case"1.2.840.10045.2.1":return{curve:_.algorithm.curve,privateKey:r.ECPrivateKey.decode(_.subjectPrivateKey,"der").privateKey};case"1.2.840.10040.4.1":return _.algorithm.params.priv_key=r.DSAparam.decode(_.subjectPrivateKey,"der"),{type:"dsa",params:_.algorithm.params};default:throw Error("unknown key id "+w)}case"RSA PUBLIC KEY":return r.RSAPublicKey.decode(S,"der");case"RSA PRIVATE KEY":return r.RSAPrivateKey.decode(S,"der");case"DSA PRIVATE KEY":return{type:"dsa",params:r.DSAPrivateKey.decode(S,"der")};case"EC PRIVATE KEY":return{curve:(S=r.ECPrivateKey.decode(S,"der")).parameters.value,privateKey:S.privateKey};default:throw Error("unknown key type "+x)}}f.signature=r.signature,t.exports=f}),r2=iQ((e,t)=>{var r=tH(),i=tG().Buffer;t.exports=function(e,t){for(var n,a=i.alloc(0),s=0;a.length{t.exports=function(e,t){for(var r=e.length,i=-1;++i{!function(e,t){function r(e,t){if(!e)throw Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function n(e,t,r){if(n.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&(("le"===t||"be"===t)&&(r=t,t=10),this._init(e||0,t||10,r||"be"))}"object"==typeof e?e.exports=n:t.BN=n,n.BN=n,n.wordSize=26;try{f="u">typeof window&&"u">typeof window.Buffer?window.Buffer:(ek(),p(b)).Buffer}catch(e){}function a(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function s(e,t,r){var i=a(e,r);return r-1>=t&&(i|=a(e,r-1)<<4),i}function o(e,t,r,i){for(var n=0,a=Math.min(e.length,r),s=t;s=49)?n+=o-49+10:o>=17?n+=o-17+10:n+=o}return n}n.isBN=function(e){return e instanceof n||null!==e&&"object"==typeof e&&e.constructor.wordSize===n.wordSize&&Array.isArray(e.words)},n.max=function(e,t){return e.cmp(t)>0?e:t},n.min=function(e,t){return 0>e.cmp(t)?e:t},n.prototype._init=function(e,t,i){if("number"==typeof e)return this._initNumber(e,t,i);if("object"==typeof e)return this._initArray(e,t,i);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var n=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n=0;n-=3)s=e[n]|e[n-1]<<8|e[n-2]<<16,this.words[a]|=s<>>26-o&0x3ffffff,(o+=24)>=26&&(o-=26,a++);else if("le"===i)for(n=0,a=0;n>>26-o&0x3ffffff,(o+=24)>=26&&(o-=26,a++);return this.strip()},n.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=Array(this.length);for(var i=0;i=t;i-=2)(n=s(e,t,i)<=18)?(a-=18,o+=1,this.words[o]|=n>>>26):a+=8;else for(i=(e.length-t)%2==0?t+1:t;i=18)?(a-=18,o+=1,this.words[o]|=n>>>26):a+=8;this.strip()},n.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=0x3ffffff;n*=t)i++;i--,n=n/t|0;for(var a=e.length-r,s=a%i,f=Math.min(a,a-s)+r,h=0,u=r;u1&&0===this.words[this.length-1];)this.length--;return this._normSign()},n.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},n.prototype.inspect=function(){return(this.red?""};var f,h=["","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"],u=[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],d=[0,0,0x2000000,0x290d741,0x1000000,0x2e90edd,0x39aa400,0x267bf47,0x1000000,0x290d741,1e7,0x12959c3,0x222c000,0x3bd7765,7529536,0xadcea1,0x1000000,0x1704f61,0x206fc40,0x2cddcf9,64e6,4084101,5153632,6436343,7962624,9765625,0xb54ba0,0xdaf26b,0x1069c00,0x138f9ad,243e5,0x1b4d89f,0x2000000,0x25528a1,0x2b54a20,0x3216b93,0x39aa400];function c(e,t,r){r.negative=t.negative^e.negative;var i=e.length+t.length|0;r.length=i,i=i-1|0;var n=0|e.words[0],a=0|t.words[0],s=n*a,o=0x3ffffff&s,f=s/0x4000000|0;r.words[0]=o;for(var h=1;h>>26,d=0x3ffffff&f,c=Math.min(h,t.length-1),p=Math.max(0,h-e.length+1);p<=c;p++){var m=h-p|0;u+=(s=(n=0|e.words[m])*(a=0|t.words[p])+d)/0x4000000|0,d=0x3ffffff&s}r.words[h]=0|d,f=0|u}return 0!==f?r.words[h]=0|f:r.length--,r.strip()}(n.prototype.toString=function(e,t){if(t=0|t||1,16===(e=e||10)||"hex"===e){for(var i="",n=0,a=0,s=0;s>>24-n&0xffffff,(n+=2)>=26&&(n-=26,s--),i=0!==a||s!==this.length-1?h[6-f.length]+f+i:f+i}for(0!==a&&(i=a.toString(16)+i);i.length%t!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}if(e===(0|e)&&e>=2&&e<=36){var c=u[e],p=d[e];i="";var m=this.clone();for(m.negative=0;!m.isZero();){var g=m.modn(p).toString(e);i=(m=m.idivn(p)).isZero()?g+i:h[c-g.length]+g+i}for(this.isZero()&&(i="0"+i);i.length%t!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}r(!1,"Base should be between 2 and 36")},n.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=0x4000000*this.words[1]:3===this.length&&1===this.words[2]?e+=0x10000000000000+0x4000000*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},n.prototype.toJSON=function(){return this.toString(16)},n.prototype.toBuffer=function(e,t){return r("u">typeof f),this.toArrayLike(f,e,t)},n.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},n.prototype.toArrayLike=function(e,t,i){var n=this.byteLength(),a=i||Math.max(1,n);r(n<=a,"byte array longer than desired length"),r(a>0,"Requested array length <= 0"),this.strip();var s,o,f=new e(a),h=this.clone();if("le"===t){for(o=0;!h.isZero();o++)s=h.andln(255),h.iushrn(8),f[o]=s;for(;o=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},n.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return(8191&t)==0&&(r+=13,t>>>=13),(127&t)==0&&(r+=7,t>>>=7),(15&t)==0&&(r+=4,t>>>=4),(3&t)==0&&(r+=2,t>>>=2),(1&t)==0&&r++,r},n.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return(this.length-1)*26+t},n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},n.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},n.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},n.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},n.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var i=0;ie.length?this.clone().ixor(e):e.clone().ixor(this)},n.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},n.prototype.inotn=function(e){r("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),i=e%26;this._expand(t),i>0&&t--;for(var n=0;n0&&(this.words[n]=~this.words[n]&0x3ffffff>>26-i),this.strip()},n.prototype.notn=function(e){return this.clone().inotn(e)},n.prototype.setn=function(e,t){r("number"==typeof e&&e>=0);var i=e/26|0,n=e%26;return(this._expand(i+1),t)?this.words[i]=this.words[i]|1<e.length?(r=this,i=e):(r=e,i=this);for(var t,r,i,n=0,a=0;a>>26;for(;0!==n&&a>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;ae.length?this.clone().iadd(e):e.clone().iadd(this)},n.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t,r,i=this.iadd(e);return e.negative=1,i._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(t=this,r=e):(t=e,r=this);for(var a=0,s=0;s>26,this.words[s]=0x3ffffff&i;for(;0!==a&&s>26,this.words[s]=0x3ffffff&i;if(0===a&&s>>13,p=0|s[1],m=8191&p,g=p>>>13,v=0|s[2],b=8191&v,y=v>>>13,w=0|s[3],_=8191&w,M=w>>>13,x=0|s[4],S=8191&x,E=x>>>13,k=0|s[5],A=8191&k,P=k>>>13,R=0|s[6],I=8191&R,T=R>>>13,j=0|s[7],O=8191&j,C=j>>>13,N=0|s[8],D=8191&N,L=N>>>13,$=0|s[9],q=8191&$,B=$>>>13,F=0|o[0],z=8191&F,Z=F>>>13,U=0|o[1],H=8191&U,V=U>>>13,W=0|o[2],K=8191&W,Q=W>>>13,G=0|o[3],J=8191&G,Y=G>>>13,X=0|o[4],ee=8191&X,et=X>>>13,er=0|o[5],ei=8191&er,en=er>>>13,ea=0|o[6],es=8191&ea,eo=ea>>>13,ef=0|o[7],eh=8191&ef,eu=ef>>>13,el=0|o[8],ed=8191&el,ec=el>>>13,ep=0|o[9],em=8191&ep,eg=ep>>>13;r.negative=e.negative^t.negative,r.length=19,i=Math.imul(d,z),n=(n=Math.imul(d,Z))+Math.imul(c,z)|0,a=Math.imul(c,Z);var ev=(h+i|0)+((8191&n)<<13)|0;h=(a+(n>>>13)|0)+(ev>>>26)|0,ev&=0x3ffffff,i=Math.imul(m,z),n=(n=Math.imul(m,Z))+Math.imul(g,z)|0,a=Math.imul(g,Z),i=i+Math.imul(d,H)|0,n=(n=n+Math.imul(d,V)|0)+Math.imul(c,H)|0,a=a+Math.imul(c,V)|0;var eb=(h+i|0)+((8191&n)<<13)|0;h=(a+(n>>>13)|0)+(eb>>>26)|0,eb&=0x3ffffff,i=Math.imul(b,z),n=(n=Math.imul(b,Z))+Math.imul(y,z)|0,a=Math.imul(y,Z),i=i+Math.imul(m,H)|0,n=(n=n+Math.imul(m,V)|0)+Math.imul(g,H)|0,a=a+Math.imul(g,V)|0,i=i+Math.imul(d,K)|0,n=(n=n+Math.imul(d,Q)|0)+Math.imul(c,K)|0,a=a+Math.imul(c,Q)|0;var ey=(h+i|0)+((8191&n)<<13)|0;h=(a+(n>>>13)|0)+(ey>>>26)|0,ey&=0x3ffffff,i=Math.imul(_,z),n=(n=Math.imul(_,Z))+Math.imul(M,z)|0,a=Math.imul(M,Z),i=i+Math.imul(b,H)|0,n=(n=n+Math.imul(b,V)|0)+Math.imul(y,H)|0,a=a+Math.imul(y,V)|0,i=i+Math.imul(m,K)|0,n=(n=n+Math.imul(m,Q)|0)+Math.imul(g,K)|0,a=a+Math.imul(g,Q)|0,i=i+Math.imul(d,J)|0,n=(n=n+Math.imul(d,Y)|0)+Math.imul(c,J)|0,a=a+Math.imul(c,Y)|0;var ew=(h+i|0)+((8191&n)<<13)|0;h=(a+(n>>>13)|0)+(ew>>>26)|0,ew&=0x3ffffff,i=Math.imul(S,z),n=(n=Math.imul(S,Z))+Math.imul(E,z)|0,a=Math.imul(E,Z),i=i+Math.imul(_,H)|0,n=(n=n+Math.imul(_,V)|0)+Math.imul(M,H)|0,a=a+Math.imul(M,V)|0,i=i+Math.imul(b,K)|0,n=(n=n+Math.imul(b,Q)|0)+Math.imul(y,K)|0,a=a+Math.imul(y,Q)|0,i=i+Math.imul(m,J)|0,n=(n=n+Math.imul(m,Y)|0)+Math.imul(g,J)|0,a=a+Math.imul(g,Y)|0,i=i+Math.imul(d,ee)|0,n=(n=n+Math.imul(d,et)|0)+Math.imul(c,ee)|0,a=a+Math.imul(c,et)|0;var e_=(h+i|0)+((8191&n)<<13)|0;h=(a+(n>>>13)|0)+(e_>>>26)|0,e_&=0x3ffffff,i=Math.imul(A,z),n=(n=Math.imul(A,Z))+Math.imul(P,z)|0,a=Math.imul(P,Z),i=i+Math.imul(S,H)|0,n=(n=n+Math.imul(S,V)|0)+Math.imul(E,H)|0,a=a+Math.imul(E,V)|0,i=i+Math.imul(_,K)|0,n=(n=n+Math.imul(_,Q)|0)+Math.imul(M,K)|0,a=a+Math.imul(M,Q)|0,i=i+Math.imul(b,J)|0,n=(n=n+Math.imul(b,Y)|0)+Math.imul(y,J)|0,a=a+Math.imul(y,Y)|0,i=i+Math.imul(m,ee)|0,n=(n=n+Math.imul(m,et)|0)+Math.imul(g,ee)|0,a=a+Math.imul(g,et)|0,i=i+Math.imul(d,ei)|0,n=(n=n+Math.imul(d,en)|0)+Math.imul(c,ei)|0,a=a+Math.imul(c,en)|0;var eM=(h+i|0)+((8191&n)<<13)|0;h=(a+(n>>>13)|0)+(eM>>>26)|0,eM&=0x3ffffff,i=Math.imul(I,z),n=(n=Math.imul(I,Z))+Math.imul(T,z)|0,a=Math.imul(T,Z),i=i+Math.imul(A,H)|0,n=(n=n+Math.imul(A,V)|0)+Math.imul(P,H)|0,a=a+Math.imul(P,V)|0,i=i+Math.imul(S,K)|0,n=(n=n+Math.imul(S,Q)|0)+Math.imul(E,K)|0,a=a+Math.imul(E,Q)|0,i=i+Math.imul(_,J)|0,n=(n=n+Math.imul(_,Y)|0)+Math.imul(M,J)|0,a=a+Math.imul(M,Y)|0,i=i+Math.imul(b,ee)|0,n=(n=n+Math.imul(b,et)|0)+Math.imul(y,ee)|0,a=a+Math.imul(y,et)|0,i=i+Math.imul(m,ei)|0,n=(n=n+Math.imul(m,en)|0)+Math.imul(g,ei)|0,a=a+Math.imul(g,en)|0,i=i+Math.imul(d,es)|0,n=(n=n+Math.imul(d,eo)|0)+Math.imul(c,es)|0,a=a+Math.imul(c,eo)|0;var ex=(h+i|0)+((8191&n)<<13)|0;h=(a+(n>>>13)|0)+(ex>>>26)|0,ex&=0x3ffffff,i=Math.imul(O,z),n=(n=Math.imul(O,Z))+Math.imul(C,z)|0,a=Math.imul(C,Z),i=i+Math.imul(I,H)|0,n=(n=n+Math.imul(I,V)|0)+Math.imul(T,H)|0,a=a+Math.imul(T,V)|0,i=i+Math.imul(A,K)|0,n=(n=n+Math.imul(A,Q)|0)+Math.imul(P,K)|0,a=a+Math.imul(P,Q)|0,i=i+Math.imul(S,J)|0,n=(n=n+Math.imul(S,Y)|0)+Math.imul(E,J)|0,a=a+Math.imul(E,Y)|0,i=i+Math.imul(_,ee)|0,n=(n=n+Math.imul(_,et)|0)+Math.imul(M,ee)|0,a=a+Math.imul(M,et)|0,i=i+Math.imul(b,ei)|0,n=(n=n+Math.imul(b,en)|0)+Math.imul(y,ei)|0,a=a+Math.imul(y,en)|0,i=i+Math.imul(m,es)|0,n=(n=n+Math.imul(m,eo)|0)+Math.imul(g,es)|0,a=a+Math.imul(g,eo)|0,i=i+Math.imul(d,eh)|0,n=(n=n+Math.imul(d,eu)|0)+Math.imul(c,eh)|0,a=a+Math.imul(c,eu)|0;var eS=(h+i|0)+((8191&n)<<13)|0;h=(a+(n>>>13)|0)+(eS>>>26)|0,eS&=0x3ffffff,i=Math.imul(D,z),n=(n=Math.imul(D,Z))+Math.imul(L,z)|0,a=Math.imul(L,Z),i=i+Math.imul(O,H)|0,n=(n=n+Math.imul(O,V)|0)+Math.imul(C,H)|0,a=a+Math.imul(C,V)|0,i=i+Math.imul(I,K)|0,n=(n=n+Math.imul(I,Q)|0)+Math.imul(T,K)|0,a=a+Math.imul(T,Q)|0,i=i+Math.imul(A,J)|0,n=(n=n+Math.imul(A,Y)|0)+Math.imul(P,J)|0,a=a+Math.imul(P,Y)|0,i=i+Math.imul(S,ee)|0,n=(n=n+Math.imul(S,et)|0)+Math.imul(E,ee)|0,a=a+Math.imul(E,et)|0,i=i+Math.imul(_,ei)|0,n=(n=n+Math.imul(_,en)|0)+Math.imul(M,ei)|0,a=a+Math.imul(M,en)|0,i=i+Math.imul(b,es)|0,n=(n=n+Math.imul(b,eo)|0)+Math.imul(y,es)|0,a=a+Math.imul(y,eo)|0,i=i+Math.imul(m,eh)|0,n=(n=n+Math.imul(m,eu)|0)+Math.imul(g,eh)|0,a=a+Math.imul(g,eu)|0,i=i+Math.imul(d,ed)|0,n=(n=n+Math.imul(d,ec)|0)+Math.imul(c,ed)|0,a=a+Math.imul(c,ec)|0;var eE=(h+i|0)+((8191&n)<<13)|0;h=(a+(n>>>13)|0)+(eE>>>26)|0,eE&=0x3ffffff,i=Math.imul(q,z),n=(n=Math.imul(q,Z))+Math.imul(B,z)|0,a=Math.imul(B,Z),i=i+Math.imul(D,H)|0,n=(n=n+Math.imul(D,V)|0)+Math.imul(L,H)|0,a=a+Math.imul(L,V)|0,i=i+Math.imul(O,K)|0,n=(n=n+Math.imul(O,Q)|0)+Math.imul(C,K)|0,a=a+Math.imul(C,Q)|0,i=i+Math.imul(I,J)|0,n=(n=n+Math.imul(I,Y)|0)+Math.imul(T,J)|0,a=a+Math.imul(T,Y)|0,i=i+Math.imul(A,ee)|0,n=(n=n+Math.imul(A,et)|0)+Math.imul(P,ee)|0,a=a+Math.imul(P,et)|0,i=i+Math.imul(S,ei)|0,n=(n=n+Math.imul(S,en)|0)+Math.imul(E,ei)|0,a=a+Math.imul(E,en)|0,i=i+Math.imul(_,es)|0,n=(n=n+Math.imul(_,eo)|0)+Math.imul(M,es)|0,a=a+Math.imul(M,eo)|0,i=i+Math.imul(b,eh)|0,n=(n=n+Math.imul(b,eu)|0)+Math.imul(y,eh)|0,a=a+Math.imul(y,eu)|0,i=i+Math.imul(m,ed)|0,n=(n=n+Math.imul(m,ec)|0)+Math.imul(g,ed)|0,a=a+Math.imul(g,ec)|0,i=i+Math.imul(d,em)|0,n=(n=n+Math.imul(d,eg)|0)+Math.imul(c,em)|0,a=a+Math.imul(c,eg)|0;var ek=(h+i|0)+((8191&n)<<13)|0;h=(a+(n>>>13)|0)+(ek>>>26)|0,ek&=0x3ffffff,i=Math.imul(q,H),n=(n=Math.imul(q,V))+Math.imul(B,H)|0,a=Math.imul(B,V),i=i+Math.imul(D,K)|0,n=(n=n+Math.imul(D,Q)|0)+Math.imul(L,K)|0,a=a+Math.imul(L,Q)|0,i=i+Math.imul(O,J)|0,n=(n=n+Math.imul(O,Y)|0)+Math.imul(C,J)|0,a=a+Math.imul(C,Y)|0,i=i+Math.imul(I,ee)|0,n=(n=n+Math.imul(I,et)|0)+Math.imul(T,ee)|0,a=a+Math.imul(T,et)|0,i=i+Math.imul(A,ei)|0,n=(n=n+Math.imul(A,en)|0)+Math.imul(P,ei)|0,a=a+Math.imul(P,en)|0,i=i+Math.imul(S,es)|0,n=(n=n+Math.imul(S,eo)|0)+Math.imul(E,es)|0,a=a+Math.imul(E,eo)|0,i=i+Math.imul(_,eh)|0,n=(n=n+Math.imul(_,eu)|0)+Math.imul(M,eh)|0,a=a+Math.imul(M,eu)|0,i=i+Math.imul(b,ed)|0,n=(n=n+Math.imul(b,ec)|0)+Math.imul(y,ed)|0,a=a+Math.imul(y,ec)|0,i=i+Math.imul(m,em)|0,n=(n=n+Math.imul(m,eg)|0)+Math.imul(g,em)|0,a=a+Math.imul(g,eg)|0;var eA=(h+i|0)+((8191&n)<<13)|0;h=(a+(n>>>13)|0)+(eA>>>26)|0,eA&=0x3ffffff,i=Math.imul(q,K),n=(n=Math.imul(q,Q))+Math.imul(B,K)|0,a=Math.imul(B,Q),i=i+Math.imul(D,J)|0,n=(n=n+Math.imul(D,Y)|0)+Math.imul(L,J)|0,a=a+Math.imul(L,Y)|0,i=i+Math.imul(O,ee)|0,n=(n=n+Math.imul(O,et)|0)+Math.imul(C,ee)|0,a=a+Math.imul(C,et)|0,i=i+Math.imul(I,ei)|0,n=(n=n+Math.imul(I,en)|0)+Math.imul(T,ei)|0,a=a+Math.imul(T,en)|0,i=i+Math.imul(A,es)|0,n=(n=n+Math.imul(A,eo)|0)+Math.imul(P,es)|0,a=a+Math.imul(P,eo)|0,i=i+Math.imul(S,eh)|0,n=(n=n+Math.imul(S,eu)|0)+Math.imul(E,eh)|0,a=a+Math.imul(E,eu)|0,i=i+Math.imul(_,ed)|0,n=(n=n+Math.imul(_,ec)|0)+Math.imul(M,ed)|0,a=a+Math.imul(M,ec)|0,i=i+Math.imul(b,em)|0,n=(n=n+Math.imul(b,eg)|0)+Math.imul(y,em)|0,a=a+Math.imul(y,eg)|0;var eP=(h+i|0)+((8191&n)<<13)|0;h=(a+(n>>>13)|0)+(eP>>>26)|0,eP&=0x3ffffff,i=Math.imul(q,J),n=(n=Math.imul(q,Y))+Math.imul(B,J)|0,a=Math.imul(B,Y),i=i+Math.imul(D,ee)|0,n=(n=n+Math.imul(D,et)|0)+Math.imul(L,ee)|0,a=a+Math.imul(L,et)|0,i=i+Math.imul(O,ei)|0,n=(n=n+Math.imul(O,en)|0)+Math.imul(C,ei)|0,a=a+Math.imul(C,en)|0,i=i+Math.imul(I,es)|0,n=(n=n+Math.imul(I,eo)|0)+Math.imul(T,es)|0,a=a+Math.imul(T,eo)|0,i=i+Math.imul(A,eh)|0,n=(n=n+Math.imul(A,eu)|0)+Math.imul(P,eh)|0,a=a+Math.imul(P,eu)|0,i=i+Math.imul(S,ed)|0,n=(n=n+Math.imul(S,ec)|0)+Math.imul(E,ed)|0,a=a+Math.imul(E,ec)|0,i=i+Math.imul(_,em)|0,n=(n=n+Math.imul(_,eg)|0)+Math.imul(M,em)|0,a=a+Math.imul(M,eg)|0;var eR=(h+i|0)+((8191&n)<<13)|0;h=(a+(n>>>13)|0)+(eR>>>26)|0,eR&=0x3ffffff,i=Math.imul(q,ee),n=(n=Math.imul(q,et))+Math.imul(B,ee)|0,a=Math.imul(B,et),i=i+Math.imul(D,ei)|0,n=(n=n+Math.imul(D,en)|0)+Math.imul(L,ei)|0,a=a+Math.imul(L,en)|0,i=i+Math.imul(O,es)|0,n=(n=n+Math.imul(O,eo)|0)+Math.imul(C,es)|0,a=a+Math.imul(C,eo)|0,i=i+Math.imul(I,eh)|0,n=(n=n+Math.imul(I,eu)|0)+Math.imul(T,eh)|0,a=a+Math.imul(T,eu)|0,i=i+Math.imul(A,ed)|0,n=(n=n+Math.imul(A,ec)|0)+Math.imul(P,ed)|0,a=a+Math.imul(P,ec)|0,i=i+Math.imul(S,em)|0,n=(n=n+Math.imul(S,eg)|0)+Math.imul(E,em)|0,a=a+Math.imul(E,eg)|0;var eI=(h+i|0)+((8191&n)<<13)|0;h=(a+(n>>>13)|0)+(eI>>>26)|0,eI&=0x3ffffff,i=Math.imul(q,ei),n=(n=Math.imul(q,en))+Math.imul(B,ei)|0,a=Math.imul(B,en),i=i+Math.imul(D,es)|0,n=(n=n+Math.imul(D,eo)|0)+Math.imul(L,es)|0,a=a+Math.imul(L,eo)|0,i=i+Math.imul(O,eh)|0,n=(n=n+Math.imul(O,eu)|0)+Math.imul(C,eh)|0,a=a+Math.imul(C,eu)|0,i=i+Math.imul(I,ed)|0,n=(n=n+Math.imul(I,ec)|0)+Math.imul(T,ed)|0,a=a+Math.imul(T,ec)|0,i=i+Math.imul(A,em)|0,n=(n=n+Math.imul(A,eg)|0)+Math.imul(P,em)|0,a=a+Math.imul(P,eg)|0;var eT=(h+i|0)+((8191&n)<<13)|0;h=(a+(n>>>13)|0)+(eT>>>26)|0,eT&=0x3ffffff,i=Math.imul(q,es),n=(n=Math.imul(q,eo))+Math.imul(B,es)|0,a=Math.imul(B,eo),i=i+Math.imul(D,eh)|0,n=(n=n+Math.imul(D,eu)|0)+Math.imul(L,eh)|0,a=a+Math.imul(L,eu)|0,i=i+Math.imul(O,ed)|0,n=(n=n+Math.imul(O,ec)|0)+Math.imul(C,ed)|0,a=a+Math.imul(C,ec)|0,i=i+Math.imul(I,em)|0,n=(n=n+Math.imul(I,eg)|0)+Math.imul(T,em)|0,a=a+Math.imul(T,eg)|0;var ej=(h+i|0)+((8191&n)<<13)|0;h=(a+(n>>>13)|0)+(ej>>>26)|0,ej&=0x3ffffff,i=Math.imul(q,eh),n=(n=Math.imul(q,eu))+Math.imul(B,eh)|0,a=Math.imul(B,eu),i=i+Math.imul(D,ed)|0,n=(n=n+Math.imul(D,ec)|0)+Math.imul(L,ed)|0,a=a+Math.imul(L,ec)|0,i=i+Math.imul(O,em)|0,n=(n=n+Math.imul(O,eg)|0)+Math.imul(C,em)|0,a=a+Math.imul(C,eg)|0;var eO=(h+i|0)+((8191&n)<<13)|0;h=(a+(n>>>13)|0)+(eO>>>26)|0,eO&=0x3ffffff,i=Math.imul(q,ed),n=(n=Math.imul(q,ec))+Math.imul(B,ed)|0,a=Math.imul(B,ec),i=i+Math.imul(D,em)|0,n=(n=n+Math.imul(D,eg)|0)+Math.imul(L,em)|0,a=a+Math.imul(L,eg)|0;var eC=(h+i|0)+((8191&n)<<13)|0;h=(a+(n>>>13)|0)+(eC>>>26)|0,eC&=0x3ffffff,i=Math.imul(q,em),n=(n=Math.imul(q,eg))+Math.imul(B,em)|0,a=Math.imul(B,eg);var eN=(h+i|0)+((8191&n)<<13)|0;return h=(a+(n>>>13)|0)+(eN>>>26)|0,eN&=0x3ffffff,f[0]=ev,f[1]=eb,f[2]=ey,f[3]=ew,f[4]=e_,f[5]=eM,f[6]=ex,f[7]=eS,f[8]=eE,f[9]=ek,f[10]=eA,f[11]=eP,f[12]=eR,f[13]=eI,f[14]=eT,f[15]=ej,f[16]=eO,f[17]=eC,f[18]=eN,0!==h&&(f[19]=h,r.length++),r};function g(e,t,r){return(new v).mulp(e,t,r)}function v(e,t){this.x=e,this.y=t}Math.imul||(m=c),n.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?m(this,e,t):r<63?c(this,e,t):r<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var i=0,n=0,a=0;a>>26)|0)>>>26,s&=0x3ffffff}r.words[a]=o,i=s,s=n}return 0!==i?r.words[a]=i:r.length--,r.strip()}(this,e,t):g(this,e,t)},v.prototype.makeRBT=function(e){for(var t=Array(e),r=n.prototype._countBits(e)-1,i=0;i>=1;return i},v.prototype.permute=function(e,t,r,i,n,a){for(var s=0;s>>=1)n++;return 1<>>=13,i[2*s+1]=8191&a,a>>>=13;for(s=2*t;s>=26,t+=(n/0x4000000|0)+(a>>>26),this.words[i]=0x3ffffff&a}return 0!==t&&(this.words[i]=t,this.length++),this.length=0===e?1:this.length,this},n.prototype.muln=function(e){return this.clone().imuln(e)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(e){var t=function(e){for(var t=Array(e.bitLength()),r=0;r>>n}return t}(e);if(0===t.length)return new n(1);for(var r=this,i=0;i=0);var t,i=e%26,n=(e-i)/26,a=0x3ffffff>>>26-i<<26-i;if(0!==i){var s=0;for(t=0;t>>26-i}s&&(this.words[t]=s,this.length++)}if(0!==n){for(t=this.length-1;t>=0;t--)this.words[t+n]=this.words[t];for(t=0;t=0);var n=t?(t-t%26)/26:0,a=e%26,s=Math.min((e-a)/26,this.length),o=0x3ffffff^0x3ffffff>>>a<s)for(this.length-=s,f=0;f=0&&(0!==h||f>=n);f--){var u=0|this.words[f];this.words[f]=h<<26-a|u>>>a,h=u&o}return i&&0!==h&&(i.words[i.length++]=h),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},n.prototype.ishrn=function(e,t,i){return r(0===this.negative),this.iushrn(e,t,i)},n.prototype.shln=function(e){return this.clone().ishln(e)},n.prototype.ushln=function(e){return this.clone().iushln(e)},n.prototype.shrn=function(e){return this.clone().ishrn(e)},n.prototype.ushrn=function(e){return this.clone().iushrn(e)},n.prototype.testn=function(e){r("number"==typeof e&&e>=0);var t=e%26,i=(e-t)/26;return!(this.length<=i)&&!!(this.words[i]&1<=0);var t=e%26,i=(e-t)/26;return(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=i)?this:(0!==t&&i++,this.length=Math.min(i,this.length),0!==t&&(this.words[this.length-1]&=0x3ffffff^0x3ffffff>>>t<=0x4000000;t++)(this.words[t]-=0x4000000,t===this.length-1)?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},n.prototype.isubn=function(e){if(r("number"==typeof e),r(e<0x4000000),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(f/0x4000000|0),this.words[n+i]=0x3ffffff&s}for(;n>26,this.words[n+i]=0x3ffffff&s;if(0===o)return this.strip();for(r(-1===o),o=0,n=0;n>26,this.words[n]=0x3ffffff&s;return this.negative=1,this.strip()},n.prototype._wordDiv=function(e,t){var r=this.length-e.length,i=this.clone(),a=e,s=0|a.words[a.length-1];0!=(r=26-this._countBits(s))&&(a=a.ushln(r),i.iushln(r),s=0|a.words[a.length-1]);var o,f=i.length-a.length;if("mod"!==t){(o=new n(null)).length=f+1,o.words=Array(o.length);for(var h=0;h=0;d--){var c=(0|i.words[a.length+d])*0x4000000+(0|i.words[a.length+d-1]);for(c=Math.min(c/s|0,0x3ffffff),i._ishlnsubmul(a,c,d);0!==i.negative;)c--,i.negative=0,i._ishlnsubmul(a,1,d),i.isZero()||(i.negative^=1);o&&(o.words[d]=c)}return o&&o.strip(),i.strip(),"div"!==t&&0!==r&&i.iushrn(r),{div:o||null,mod:i}},n.prototype.divmod=function(e,t,i){var a,s,o;return(r(!e.isZero()),this.isZero())?{div:new n(0),mod:new n(0)}:0!==this.negative&&0===e.negative?(o=this.neg().divmod(e,t),"mod"!==t&&(a=o.div.neg()),"div"!==t&&(s=o.mod.neg(),i&&0!==s.negative)&&s.iadd(e),{div:a,mod:s}):0===this.negative&&0!==e.negative?(o=this.divmod(e.neg(),t),"mod"!==t&&(a=o.div.neg()),{div:a,mod:o.mod}):(this.negative&e.negative)!=0?(o=this.neg().divmod(e.neg(),t),"div"!==t&&(s=o.mod.neg(),i&&0!==s.negative)&&s.isub(e),{div:o.div,mod:s}):e.length>this.length||0>this.cmp(e)?{div:new n(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new n(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new n(this.modn(e.words[0]))}:this._wordDiv(e,t)},n.prototype.div=function(e){return this.divmod(e,"div",!1).div},n.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},n.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},n.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,i=e.ushrn(1),n=e.andln(1),a=r.cmp(i);return a<0||1===n&&0===a?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},n.prototype.modn=function(e){r(e<=0x3ffffff);for(var t=0x4000000%e,i=0,n=this.length-1;n>=0;n--)i=(t*i+(0|this.words[n]))%e;return i},n.prototype.idivn=function(e){r(e<=0x3ffffff);for(var t=0,i=this.length-1;i>=0;i--){var n=(0|this.words[i])+0x4000000*t;this.words[i]=n/e|0,t=n%e}return this.strip()},n.prototype.divn=function(e){return this.clone().idivn(e)},n.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,i=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var a=new n(1),s=new n(0),o=new n(0),f=new n(1),h=0;t.isEven()&&i.isEven();)t.iushrn(1),i.iushrn(1),++h;for(var u=i.clone(),d=t.clone();!t.isZero();){for(var c=0,p=1;(t.words[0]&p)==0&&c<26;++c,p<<=1);if(c>0)for(t.iushrn(c);c-- >0;)(a.isOdd()||s.isOdd())&&(a.iadd(u),s.isub(d)),a.iushrn(1),s.iushrn(1);for(var m=0,g=1;(i.words[0]&g)==0&&m<26;++m,g<<=1);if(m>0)for(i.iushrn(m);m-- >0;)(o.isOdd()||f.isOdd())&&(o.iadd(u),f.isub(d)),o.iushrn(1),f.iushrn(1);t.cmp(i)>=0?(t.isub(i),a.isub(o),s.isub(f)):(i.isub(t),o.isub(a),f.isub(s))}return{a:o,b:f,gcd:i.iushln(h)}},n.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t,i=this,a=e.clone();i=0!==i.negative?i.umod(e):i.clone();for(var s=new n(1),o=new n(0),f=a.clone();i.cmpn(1)>0&&a.cmpn(1)>0;){for(var h=0,u=1;(i.words[0]&u)==0&&h<26;++h,u<<=1);if(h>0)for(i.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(f),s.iushrn(1);for(var d=0,c=1;(a.words[0]&c)==0&&d<26;++d,c<<=1);if(d>0)for(a.iushrn(d);d-- >0;)o.isOdd()&&o.iadd(f),o.iushrn(1);i.cmp(a)>=0?(i.isub(a),s.isub(o)):(a.isub(i),o.isub(s))}return 0>(t=0===i.cmpn(1)?s:o).cmpn(0)&&t.iadd(e),t},n.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var i=0;t.isEven()&&r.isEven();i++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=t.cmp(r);if(n<0){var a=t;t=r,r=a}else if(0===n||0===r.cmpn(1))break;t.isub(r)}return r.iushln(i)},n.prototype.invm=function(e){return this.egcd(e).a.umod(e)},n.prototype.isEven=function(){return(1&this.words[0])==0},n.prototype.isOdd=function(){return(1&this.words[0])==1},n.prototype.andln=function(e){return this.words[0]&e},n.prototype.bincn=function(e){r("number"==typeof e);var t=e%26,i=(e-t)/26,n=1<>>26,o&=0x3ffffff,this.words[s]=o}return 0!==a&&(this.words[s]=a,this.length++),this},n.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},n.prototype.cmpn=function(e){var t,i=e<0;if(0!==this.negative&&!i)return -1;if(0===this.negative&&i)return 1;if(this.strip(),this.length>1)t=1;else{i&&(e=-e),r(e<=0x3ffffff,"Number is too big");var n=0|this.words[0];t=n===e?0:ne.length)return 1;if(this.length=0;r--){var i=0|this.words[r],n=0|e.words[r];if(i!==n){in&&(t=1);break}}return t},n.prototype.gtn=function(e){return 1===this.cmpn(e)},n.prototype.gt=function(e){return 1===this.cmp(e)},n.prototype.gten=function(e){return this.cmpn(e)>=0},n.prototype.gte=function(e){return this.cmp(e)>=0},n.prototype.ltn=function(e){return -1===this.cmpn(e)},n.prototype.lt=function(e){return -1===this.cmp(e)},n.prototype.lten=function(e){return 0>=this.cmpn(e)},n.prototype.lte=function(e){return 0>=this.cmp(e)},n.prototype.eqn=function(e){return 0===this.cmpn(e)},n.prototype.eq=function(e){return 0===this.cmp(e)},n.red=function(e){return new E(e)},n.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},n.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype._forceRed=function(e){return this.red=e,this},n.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},n.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},n.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},n.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},n.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},n.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},n.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},n.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},n.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},n.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},n.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},n.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var y={k256:null,p224:null,p192:null,p25519:null};function w(e,t){this.name=e,this.p=new n(t,16),this.n=this.p.bitLength(),this.k=new n(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function _(){w.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function M(){w.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function x(){w.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function S(){w.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function E(e){if("string"==typeof e){var t=n._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function k(e){E.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new n(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)}w.prototype._tmp=function(){var e=new n(null);return e.words=Array(Math.ceil(this.n/13)),e},w.prototype.ireduce=function(e){var t,r=e;do this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength();while(t>this.n);var i=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},w.prototype.split=function(e,t){e.iushrn(this.n,0,t)},w.prototype.imulK=function(e){return e.imul(this.k)},i(_,w),_.prototype.split=function(e,t){for(var r=Math.min(e.length,9),i=0;i>>22,n=a}(n>>>=22,e.words[i-10]=n,0===n&&e.length>10)?e.length-=10:e.length-=9},_.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=n,t=i}return 0!==t&&(e.words[e.length++]=t),e},n._prime=function(e){var t;if(y[e])return y[e];if("k256"===e)t=new _;else if("p224"===e)t=new M;else if("p192"===e)t=new x;else if("p25519"===e)t=new S;else throw Error("Unknown prime "+e);return y[e]=t,t},E.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},E.prototype._verify2=function(e,t){r((e.negative|t.negative)==0,"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},E.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},E.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},E.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},E.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},E.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return 0>r.cmpn(0)&&r.iadd(this.m),r._forceRed(this)},E.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return 0>r.cmpn(0)&&r.iadd(this.m),r},E.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},E.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},E.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},E.prototype.isqr=function(e){return this.imul(e,e.clone())},E.prototype.sqr=function(e){return this.mul(e,e)},E.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2==1),3===t){var i=this.m.add(new n(1)).iushrn(2);return this.pow(e,i)}for(var a=this.m.subn(1),s=0;!a.isZero()&&0===a.andln(1);)s++,a.iushrn(1);r(!a.isZero());var o=new n(1).toRed(this),f=o.redNeg(),h=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new n(2*u*u).toRed(this);0!==this.pow(u,h).cmp(f);)u.redIAdd(f);for(var d=this.pow(u,a),c=this.pow(e,a.addn(1).iushrn(1)),p=this.pow(e,a),m=s;0!==p.cmp(o);){for(var g=p,v=0;0!==g.cmp(o);v++)g=g.redSqr();r(v=0;i--){for(var h=t.words[i],u=f-1;u>=0;u--){var d=h>>u&1;if(a!==r[0]&&(a=this.sqr(a)),0===d&&0===s){o=0;continue}s<<=1,s|=d,(4==++o||0===i&&0===u)&&(a=this.mul(a,r[s]),o=0,s=0)}f=26}return a},E.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},E.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},n.mont=function(e){return new k(e)},i(k,E),k.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},k.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},k.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),a=n;return n.cmp(this.m)>=0?a=n.isub(this.m):0>n.cmpn(0)&&(a=n.iadd(this.m)),a._forceRed(this)},k.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new n(0)._forceRed(this);var r=e.mul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=r.isub(i).iushrn(this.shift),s=a;return a.cmp(this.m)>=0?s=a.isub(this.m):0>a.cmpn(0)&&(s=a.iadd(this.m)),s._forceRed(this)},k.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(typeof t>"u"||t,e)}),r4=iQ((e,t)=>{var r=r6(),i=tG().Buffer;t.exports=function(e,t){return i.from(e.toRed(r.mont(t.modulus)).redPow(new r(t.publicExponent)).fromRed().toArray())}}),r9=iQ((e,t)=>{!function(e,t){function r(e,t){if(!e)throw Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function n(e,t,r){if(n.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&(("le"===t||"be"===t)&&(r=t,t=10),this._init(e||0,t||10,r||"be"))}"object"==typeof e?e.exports=n:t.BN=n,n.BN=n,n.wordSize=26;try{u="u">typeof window&&"u">typeof window.Buffer?window.Buffer:(ek(),p(b)).Buffer}catch(e){}function a(e,t){var i=e.charCodeAt(t);return i>=48&&i<=57?i-48:i>=65&&i<=70?i-55:i>=97&&i<=102?i-87:void r(!1,"Invalid character in "+e)}function s(e,t,r){var i=a(e,r);return r-1>=t&&(i|=a(e,r-1)<<4),i}function o(e,t,i,n){for(var a=0,s=0,o=Math.min(e.length,i),f=t;f=49?h-49+10:h>=17?h-17+10:h,r(h>=0&&s0?e:t},n.min=function(e,t){return 0>e.cmp(t)?e:t},n.prototype._init=function(e,t,i){if("number"==typeof e)return this._initNumber(e,t,i);if("object"==typeof e)return this._initArray(e,t,i);"hex"===t&&(t=16),r(t===(0|t)&&t>=2&&t<=36);var n=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(n++,this.negative=1),n=0;n-=3)s=e[n]|e[n-1]<<8|e[n-2]<<16,this.words[a]|=s<>>26-o&0x3ffffff,(o+=24)>=26&&(o-=26,a++);else if("le"===i)for(n=0,a=0;n>>26-o&0x3ffffff,(o+=24)>=26&&(o-=26,a++);return this._strip()},n.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=Array(this.length);for(var i=0;i=t;i-=2)(n=s(e,t,i)<=18)?(a-=18,o+=1,this.words[o]|=n>>>26):a+=8;else for(i=(e.length-t)%2==0?t+1:t;i=18)?(a-=18,o+=1,this.words[o]|=n>>>26):a+=8;this._strip()},n.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var i=0,n=1;n<=0x3ffffff;n*=t)i++;i--,n=n/t|0;for(var a=e.length-r,s=a%i,f=Math.min(a,a-s)+r,h=0,u=r;u1&&0===this.words[this.length-1];)this.length--;return this._normSign()},n.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"u">typeof Symbol&&"function"==typeof Symbol.for)try{n.prototype[Symbol.for("nodejs.util.inspect.custom")]=h}catch(e){n.prototype.inspect=h}else n.prototype.inspect=h;function h(){return(this.red?""}var u,d=["","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"],c=[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],m=[0,0,0x2000000,0x290d741,0x1000000,0x2e90edd,0x39aa400,0x267bf47,0x1000000,0x290d741,1e7,0x12959c3,0x222c000,0x3bd7765,7529536,0xadcea1,0x1000000,0x1704f61,0x206fc40,0x2cddcf9,64e6,4084101,5153632,6436343,7962624,9765625,0xb54ba0,0xdaf26b,0x1069c00,0x138f9ad,243e5,0x1b4d89f,0x2000000,0x25528a1,0x2b54a20,0x3216b93,0x39aa400];function g(e,t,r){r.negative=t.negative^e.negative;var i=e.length+t.length|0;r.length=i,i=i-1|0;var n=0|e.words[0],a=0|t.words[0],s=n*a,o=0x3ffffff&s,f=s/0x4000000|0;r.words[0]=o;for(var h=1;h>>26,d=0x3ffffff&f,c=Math.min(h,t.length-1),p=Math.max(0,h-e.length+1);p<=c;p++){var m=h-p|0;u+=(s=(n=0|e.words[m])*(a=0|t.words[p])+d)/0x4000000|0,d=0x3ffffff&s}r.words[h]=0|d,f=0|u}return 0!==f?r.words[h]=0|f:r.length--,r._strip()}n.prototype.toString=function(e,t){if(t=0|t||1,16===(e=e||10)||"hex"===e){for(var i="",n=0,a=0,s=0;s>>24-n&0xffffff,(n+=2)>=26&&(n-=26,s--),i=0!==a||s!==this.length-1?d[6-f.length]+f+i:f+i}for(0!==a&&(i=a.toString(16)+i);i.length%t!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}if(e===(0|e)&&e>=2&&e<=36){var h=c[e],u=m[e];i="";var p=this.clone();for(p.negative=0;!p.isZero();){var g=p.modrn(u).toString(e);i=(p=p.idivn(u)).isZero()?g+i:d[h-g.length]+g+i}for(this.isZero()&&(i="0"+i);i.length%t!=0;)i="0"+i;return 0!==this.negative&&(i="-"+i),i}r(!1,"Base should be between 2 and 36")},n.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=0x4000000*this.words[1]:3===this.length&&1===this.words[2]?e+=0x10000000000000+0x4000000*this.words[1]:this.length>2&&r(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},n.prototype.toJSON=function(){return this.toString(16,2)},u&&(n.prototype.toBuffer=function(e,t){return this.toArrayLike(u,e,t)}),n.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},(n.prototype.toArrayLike=function(e,t,i){this._strip();var n=this.byteLength(),a=i||Math.max(1,n);r(n<=a,"byte array longer than desired length"),r(a>0,"Requested array length <= 0");var s=e.allocUnsafe?e.allocUnsafe(a):new e(a);return this["_toArrayLike"+("le"===t?"LE":"BE")](s,n),s},n.prototype._toArrayLikeLE=function(e,t){for(var r=0,i=0,n=0,a=0;n>8&255),r>16&255),6===a?(r>24&255),i=0,a=0):(i=s>>>24,a+=2)}if(r=0&&(e[r--]=s>>8&255),r>=0&&(e[r--]=s>>16&255),6===a?(r>=0&&(e[r--]=s>>24&255),i=0,a=0):(i=s>>>24,a+=2)}if(r>=0)for(e[r--]=i;r>=0;)e[r--]=0},Math.clz32)?n.prototype._countBits=function(e){return 32-Math.clz32(e)}:n.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},n.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return(8191&t)==0&&(r+=13,t>>>=13),(127&t)==0&&(r+=7,t>>>=7),(15&t)==0&&(r+=4,t>>>=4),(3&t)==0&&(r+=2,t>>>=2),(1&t)==0&&r++,r},n.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return(this.length-1)*26+t},n.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;te.length?this.clone().ior(e):e.clone().ior(this)},n.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},n.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;re.length?this.clone().iand(e):e.clone().iand(this)},n.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},n.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var i=0;ie.length?this.clone().ixor(e):e.clone().ixor(this)},n.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},n.prototype.inotn=function(e){r("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),i=e%26;this._expand(t),i>0&&t--;for(var n=0;n0&&(this.words[n]=~this.words[n]&0x3ffffff>>26-i),this._strip()},n.prototype.notn=function(e){return this.clone().inotn(e)},n.prototype.setn=function(e,t){r("number"==typeof e&&e>=0);var i=e/26|0,n=e%26;return(this._expand(i+1),t)?this.words[i]=this.words[i]|1<e.length?(r=this,i=e):(r=e,i=this);for(var t,r,i,n=0,a=0;a>>26;for(;0!==n&&a>>26;if(this.length=r.length,0!==n)this.words[this.length]=n,this.length++;else if(r!==this)for(;ae.length?this.clone().iadd(e):e.clone().iadd(this)},n.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t,r,i=this.iadd(e);return e.negative=1,i._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n=this.cmp(e);if(0===n)return this.negative=0,this.length=1,this.words[0]=0,this;n>0?(t=this,r=e):(t=e,r=this);for(var a=0,s=0;s>26,this.words[s]=0x3ffffff&i;for(;0!==a&&s>26,this.words[s]=0x3ffffff&i;if(0===a&&s>>13,p=0|s[1],m=8191&p,g=p>>>13,v=0|s[2],b=8191&v,y=v>>>13,w=0|s[3],_=8191&w,M=w>>>13,x=0|s[4],S=8191&x,E=x>>>13,k=0|s[5],A=8191&k,P=k>>>13,R=0|s[6],I=8191&R,T=R>>>13,j=0|s[7],O=8191&j,C=j>>>13,N=0|s[8],D=8191&N,L=N>>>13,$=0|s[9],q=8191&$,B=$>>>13,F=0|o[0],z=8191&F,Z=F>>>13,U=0|o[1],H=8191&U,V=U>>>13,W=0|o[2],K=8191&W,Q=W>>>13,G=0|o[3],J=8191&G,Y=G>>>13,X=0|o[4],ee=8191&X,et=X>>>13,er=0|o[5],ei=8191&er,en=er>>>13,ea=0|o[6],es=8191&ea,eo=ea>>>13,ef=0|o[7],eh=8191&ef,eu=ef>>>13,el=0|o[8],ed=8191&el,ec=el>>>13,ep=0|o[9],em=8191&ep,eg=ep>>>13;r.negative=e.negative^t.negative,r.length=19,i=Math.imul(d,z),n=(n=Math.imul(d,Z))+Math.imul(c,z)|0,a=Math.imul(c,Z);var ev=(h+i|0)+((8191&n)<<13)|0;h=(a+(n>>>13)|0)+(ev>>>26)|0,ev&=0x3ffffff,i=Math.imul(m,z),n=(n=Math.imul(m,Z))+Math.imul(g,z)|0,a=Math.imul(g,Z),i=i+Math.imul(d,H)|0,n=(n=n+Math.imul(d,V)|0)+Math.imul(c,H)|0,a=a+Math.imul(c,V)|0;var eb=(h+i|0)+((8191&n)<<13)|0;h=(a+(n>>>13)|0)+(eb>>>26)|0,eb&=0x3ffffff,i=Math.imul(b,z),n=(n=Math.imul(b,Z))+Math.imul(y,z)|0,a=Math.imul(y,Z),i=i+Math.imul(m,H)|0,n=(n=n+Math.imul(m,V)|0)+Math.imul(g,H)|0,a=a+Math.imul(g,V)|0,i=i+Math.imul(d,K)|0,n=(n=n+Math.imul(d,Q)|0)+Math.imul(c,K)|0,a=a+Math.imul(c,Q)|0;var ey=(h+i|0)+((8191&n)<<13)|0;h=(a+(n>>>13)|0)+(ey>>>26)|0,ey&=0x3ffffff,i=Math.imul(_,z),n=(n=Math.imul(_,Z))+Math.imul(M,z)|0,a=Math.imul(M,Z),i=i+Math.imul(b,H)|0,n=(n=n+Math.imul(b,V)|0)+Math.imul(y,H)|0,a=a+Math.imul(y,V)|0,i=i+Math.imul(m,K)|0,n=(n=n+Math.imul(m,Q)|0)+Math.imul(g,K)|0,a=a+Math.imul(g,Q)|0,i=i+Math.imul(d,J)|0,n=(n=n+Math.imul(d,Y)|0)+Math.imul(c,J)|0,a=a+Math.imul(c,Y)|0;var ew=(h+i|0)+((8191&n)<<13)|0;h=(a+(n>>>13)|0)+(ew>>>26)|0,ew&=0x3ffffff,i=Math.imul(S,z),n=(n=Math.imul(S,Z))+Math.imul(E,z)|0,a=Math.imul(E,Z),i=i+Math.imul(_,H)|0,n=(n=n+Math.imul(_,V)|0)+Math.imul(M,H)|0,a=a+Math.imul(M,V)|0,i=i+Math.imul(b,K)|0,n=(n=n+Math.imul(b,Q)|0)+Math.imul(y,K)|0,a=a+Math.imul(y,Q)|0,i=i+Math.imul(m,J)|0,n=(n=n+Math.imul(m,Y)|0)+Math.imul(g,J)|0,a=a+Math.imul(g,Y)|0,i=i+Math.imul(d,ee)|0,n=(n=n+Math.imul(d,et)|0)+Math.imul(c,ee)|0,a=a+Math.imul(c,et)|0;var e_=(h+i|0)+((8191&n)<<13)|0;h=(a+(n>>>13)|0)+(e_>>>26)|0,e_&=0x3ffffff,i=Math.imul(A,z),n=(n=Math.imul(A,Z))+Math.imul(P,z)|0,a=Math.imul(P,Z),i=i+Math.imul(S,H)|0,n=(n=n+Math.imul(S,V)|0)+Math.imul(E,H)|0,a=a+Math.imul(E,V)|0,i=i+Math.imul(_,K)|0,n=(n=n+Math.imul(_,Q)|0)+Math.imul(M,K)|0,a=a+Math.imul(M,Q)|0,i=i+Math.imul(b,J)|0,n=(n=n+Math.imul(b,Y)|0)+Math.imul(y,J)|0,a=a+Math.imul(y,Y)|0,i=i+Math.imul(m,ee)|0,n=(n=n+Math.imul(m,et)|0)+Math.imul(g,ee)|0,a=a+Math.imul(g,et)|0,i=i+Math.imul(d,ei)|0,n=(n=n+Math.imul(d,en)|0)+Math.imul(c,ei)|0,a=a+Math.imul(c,en)|0;var eM=(h+i|0)+((8191&n)<<13)|0;h=(a+(n>>>13)|0)+(eM>>>26)|0,eM&=0x3ffffff,i=Math.imul(I,z),n=(n=Math.imul(I,Z))+Math.imul(T,z)|0,a=Math.imul(T,Z),i=i+Math.imul(A,H)|0,n=(n=n+Math.imul(A,V)|0)+Math.imul(P,H)|0,a=a+Math.imul(P,V)|0,i=i+Math.imul(S,K)|0,n=(n=n+Math.imul(S,Q)|0)+Math.imul(E,K)|0,a=a+Math.imul(E,Q)|0,i=i+Math.imul(_,J)|0,n=(n=n+Math.imul(_,Y)|0)+Math.imul(M,J)|0,a=a+Math.imul(M,Y)|0,i=i+Math.imul(b,ee)|0,n=(n=n+Math.imul(b,et)|0)+Math.imul(y,ee)|0,a=a+Math.imul(y,et)|0,i=i+Math.imul(m,ei)|0,n=(n=n+Math.imul(m,en)|0)+Math.imul(g,ei)|0,a=a+Math.imul(g,en)|0,i=i+Math.imul(d,es)|0,n=(n=n+Math.imul(d,eo)|0)+Math.imul(c,es)|0,a=a+Math.imul(c,eo)|0;var ex=(h+i|0)+((8191&n)<<13)|0;h=(a+(n>>>13)|0)+(ex>>>26)|0,ex&=0x3ffffff,i=Math.imul(O,z),n=(n=Math.imul(O,Z))+Math.imul(C,z)|0,a=Math.imul(C,Z),i=i+Math.imul(I,H)|0,n=(n=n+Math.imul(I,V)|0)+Math.imul(T,H)|0,a=a+Math.imul(T,V)|0,i=i+Math.imul(A,K)|0,n=(n=n+Math.imul(A,Q)|0)+Math.imul(P,K)|0,a=a+Math.imul(P,Q)|0,i=i+Math.imul(S,J)|0,n=(n=n+Math.imul(S,Y)|0)+Math.imul(E,J)|0,a=a+Math.imul(E,Y)|0,i=i+Math.imul(_,ee)|0,n=(n=n+Math.imul(_,et)|0)+Math.imul(M,ee)|0,a=a+Math.imul(M,et)|0,i=i+Math.imul(b,ei)|0,n=(n=n+Math.imul(b,en)|0)+Math.imul(y,ei)|0,a=a+Math.imul(y,en)|0,i=i+Math.imul(m,es)|0,n=(n=n+Math.imul(m,eo)|0)+Math.imul(g,es)|0,a=a+Math.imul(g,eo)|0,i=i+Math.imul(d,eh)|0,n=(n=n+Math.imul(d,eu)|0)+Math.imul(c,eh)|0,a=a+Math.imul(c,eu)|0;var eS=(h+i|0)+((8191&n)<<13)|0;h=(a+(n>>>13)|0)+(eS>>>26)|0,eS&=0x3ffffff,i=Math.imul(D,z),n=(n=Math.imul(D,Z))+Math.imul(L,z)|0,a=Math.imul(L,Z),i=i+Math.imul(O,H)|0,n=(n=n+Math.imul(O,V)|0)+Math.imul(C,H)|0,a=a+Math.imul(C,V)|0,i=i+Math.imul(I,K)|0,n=(n=n+Math.imul(I,Q)|0)+Math.imul(T,K)|0,a=a+Math.imul(T,Q)|0,i=i+Math.imul(A,J)|0,n=(n=n+Math.imul(A,Y)|0)+Math.imul(P,J)|0,a=a+Math.imul(P,Y)|0,i=i+Math.imul(S,ee)|0,n=(n=n+Math.imul(S,et)|0)+Math.imul(E,ee)|0,a=a+Math.imul(E,et)|0,i=i+Math.imul(_,ei)|0,n=(n=n+Math.imul(_,en)|0)+Math.imul(M,ei)|0,a=a+Math.imul(M,en)|0,i=i+Math.imul(b,es)|0,n=(n=n+Math.imul(b,eo)|0)+Math.imul(y,es)|0,a=a+Math.imul(y,eo)|0,i=i+Math.imul(m,eh)|0,n=(n=n+Math.imul(m,eu)|0)+Math.imul(g,eh)|0,a=a+Math.imul(g,eu)|0,i=i+Math.imul(d,ed)|0,n=(n=n+Math.imul(d,ec)|0)+Math.imul(c,ed)|0,a=a+Math.imul(c,ec)|0;var eE=(h+i|0)+((8191&n)<<13)|0;h=(a+(n>>>13)|0)+(eE>>>26)|0,eE&=0x3ffffff,i=Math.imul(q,z),n=(n=Math.imul(q,Z))+Math.imul(B,z)|0,a=Math.imul(B,Z),i=i+Math.imul(D,H)|0,n=(n=n+Math.imul(D,V)|0)+Math.imul(L,H)|0,a=a+Math.imul(L,V)|0,i=i+Math.imul(O,K)|0,n=(n=n+Math.imul(O,Q)|0)+Math.imul(C,K)|0,a=a+Math.imul(C,Q)|0,i=i+Math.imul(I,J)|0,n=(n=n+Math.imul(I,Y)|0)+Math.imul(T,J)|0,a=a+Math.imul(T,Y)|0,i=i+Math.imul(A,ee)|0,n=(n=n+Math.imul(A,et)|0)+Math.imul(P,ee)|0,a=a+Math.imul(P,et)|0,i=i+Math.imul(S,ei)|0,n=(n=n+Math.imul(S,en)|0)+Math.imul(E,ei)|0,a=a+Math.imul(E,en)|0,i=i+Math.imul(_,es)|0,n=(n=n+Math.imul(_,eo)|0)+Math.imul(M,es)|0,a=a+Math.imul(M,eo)|0,i=i+Math.imul(b,eh)|0,n=(n=n+Math.imul(b,eu)|0)+Math.imul(y,eh)|0,a=a+Math.imul(y,eu)|0,i=i+Math.imul(m,ed)|0,n=(n=n+Math.imul(m,ec)|0)+Math.imul(g,ed)|0,a=a+Math.imul(g,ec)|0,i=i+Math.imul(d,em)|0,n=(n=n+Math.imul(d,eg)|0)+Math.imul(c,em)|0,a=a+Math.imul(c,eg)|0;var ek=(h+i|0)+((8191&n)<<13)|0;h=(a+(n>>>13)|0)+(ek>>>26)|0,ek&=0x3ffffff,i=Math.imul(q,H),n=(n=Math.imul(q,V))+Math.imul(B,H)|0,a=Math.imul(B,V),i=i+Math.imul(D,K)|0,n=(n=n+Math.imul(D,Q)|0)+Math.imul(L,K)|0,a=a+Math.imul(L,Q)|0,i=i+Math.imul(O,J)|0,n=(n=n+Math.imul(O,Y)|0)+Math.imul(C,J)|0,a=a+Math.imul(C,Y)|0,i=i+Math.imul(I,ee)|0,n=(n=n+Math.imul(I,et)|0)+Math.imul(T,ee)|0,a=a+Math.imul(T,et)|0,i=i+Math.imul(A,ei)|0,n=(n=n+Math.imul(A,en)|0)+Math.imul(P,ei)|0,a=a+Math.imul(P,en)|0,i=i+Math.imul(S,es)|0,n=(n=n+Math.imul(S,eo)|0)+Math.imul(E,es)|0,a=a+Math.imul(E,eo)|0,i=i+Math.imul(_,eh)|0,n=(n=n+Math.imul(_,eu)|0)+Math.imul(M,eh)|0,a=a+Math.imul(M,eu)|0,i=i+Math.imul(b,ed)|0,n=(n=n+Math.imul(b,ec)|0)+Math.imul(y,ed)|0,a=a+Math.imul(y,ec)|0,i=i+Math.imul(m,em)|0,n=(n=n+Math.imul(m,eg)|0)+Math.imul(g,em)|0,a=a+Math.imul(g,eg)|0;var eA=(h+i|0)+((8191&n)<<13)|0;h=(a+(n>>>13)|0)+(eA>>>26)|0,eA&=0x3ffffff,i=Math.imul(q,K),n=(n=Math.imul(q,Q))+Math.imul(B,K)|0,a=Math.imul(B,Q),i=i+Math.imul(D,J)|0,n=(n=n+Math.imul(D,Y)|0)+Math.imul(L,J)|0,a=a+Math.imul(L,Y)|0,i=i+Math.imul(O,ee)|0,n=(n=n+Math.imul(O,et)|0)+Math.imul(C,ee)|0,a=a+Math.imul(C,et)|0,i=i+Math.imul(I,ei)|0,n=(n=n+Math.imul(I,en)|0)+Math.imul(T,ei)|0,a=a+Math.imul(T,en)|0,i=i+Math.imul(A,es)|0,n=(n=n+Math.imul(A,eo)|0)+Math.imul(P,es)|0,a=a+Math.imul(P,eo)|0,i=i+Math.imul(S,eh)|0,n=(n=n+Math.imul(S,eu)|0)+Math.imul(E,eh)|0,a=a+Math.imul(E,eu)|0,i=i+Math.imul(_,ed)|0,n=(n=n+Math.imul(_,ec)|0)+Math.imul(M,ed)|0,a=a+Math.imul(M,ec)|0,i=i+Math.imul(b,em)|0,n=(n=n+Math.imul(b,eg)|0)+Math.imul(y,em)|0,a=a+Math.imul(y,eg)|0;var eP=(h+i|0)+((8191&n)<<13)|0;h=(a+(n>>>13)|0)+(eP>>>26)|0,eP&=0x3ffffff,i=Math.imul(q,J),n=(n=Math.imul(q,Y))+Math.imul(B,J)|0,a=Math.imul(B,Y),i=i+Math.imul(D,ee)|0,n=(n=n+Math.imul(D,et)|0)+Math.imul(L,ee)|0,a=a+Math.imul(L,et)|0,i=i+Math.imul(O,ei)|0,n=(n=n+Math.imul(O,en)|0)+Math.imul(C,ei)|0,a=a+Math.imul(C,en)|0,i=i+Math.imul(I,es)|0,n=(n=n+Math.imul(I,eo)|0)+Math.imul(T,es)|0,a=a+Math.imul(T,eo)|0,i=i+Math.imul(A,eh)|0,n=(n=n+Math.imul(A,eu)|0)+Math.imul(P,eh)|0,a=a+Math.imul(P,eu)|0,i=i+Math.imul(S,ed)|0,n=(n=n+Math.imul(S,ec)|0)+Math.imul(E,ed)|0,a=a+Math.imul(E,ec)|0,i=i+Math.imul(_,em)|0,n=(n=n+Math.imul(_,eg)|0)+Math.imul(M,em)|0,a=a+Math.imul(M,eg)|0;var eR=(h+i|0)+((8191&n)<<13)|0;h=(a+(n>>>13)|0)+(eR>>>26)|0,eR&=0x3ffffff,i=Math.imul(q,ee),n=(n=Math.imul(q,et))+Math.imul(B,ee)|0,a=Math.imul(B,et),i=i+Math.imul(D,ei)|0,n=(n=n+Math.imul(D,en)|0)+Math.imul(L,ei)|0,a=a+Math.imul(L,en)|0,i=i+Math.imul(O,es)|0,n=(n=n+Math.imul(O,eo)|0)+Math.imul(C,es)|0,a=a+Math.imul(C,eo)|0,i=i+Math.imul(I,eh)|0,n=(n=n+Math.imul(I,eu)|0)+Math.imul(T,eh)|0,a=a+Math.imul(T,eu)|0,i=i+Math.imul(A,ed)|0,n=(n=n+Math.imul(A,ec)|0)+Math.imul(P,ed)|0,a=a+Math.imul(P,ec)|0,i=i+Math.imul(S,em)|0,n=(n=n+Math.imul(S,eg)|0)+Math.imul(E,em)|0,a=a+Math.imul(E,eg)|0;var eI=(h+i|0)+((8191&n)<<13)|0;h=(a+(n>>>13)|0)+(eI>>>26)|0,eI&=0x3ffffff,i=Math.imul(q,ei),n=(n=Math.imul(q,en))+Math.imul(B,ei)|0,a=Math.imul(B,en),i=i+Math.imul(D,es)|0,n=(n=n+Math.imul(D,eo)|0)+Math.imul(L,es)|0,a=a+Math.imul(L,eo)|0,i=i+Math.imul(O,eh)|0,n=(n=n+Math.imul(O,eu)|0)+Math.imul(C,eh)|0,a=a+Math.imul(C,eu)|0,i=i+Math.imul(I,ed)|0,n=(n=n+Math.imul(I,ec)|0)+Math.imul(T,ed)|0,a=a+Math.imul(T,ec)|0,i=i+Math.imul(A,em)|0,n=(n=n+Math.imul(A,eg)|0)+Math.imul(P,em)|0,a=a+Math.imul(P,eg)|0;var eT=(h+i|0)+((8191&n)<<13)|0;h=(a+(n>>>13)|0)+(eT>>>26)|0,eT&=0x3ffffff,i=Math.imul(q,es),n=(n=Math.imul(q,eo))+Math.imul(B,es)|0,a=Math.imul(B,eo),i=i+Math.imul(D,eh)|0,n=(n=n+Math.imul(D,eu)|0)+Math.imul(L,eh)|0,a=a+Math.imul(L,eu)|0,i=i+Math.imul(O,ed)|0,n=(n=n+Math.imul(O,ec)|0)+Math.imul(C,ed)|0,a=a+Math.imul(C,ec)|0,i=i+Math.imul(I,em)|0,n=(n=n+Math.imul(I,eg)|0)+Math.imul(T,em)|0,a=a+Math.imul(T,eg)|0;var ej=(h+i|0)+((8191&n)<<13)|0;h=(a+(n>>>13)|0)+(ej>>>26)|0,ej&=0x3ffffff,i=Math.imul(q,eh),n=(n=Math.imul(q,eu))+Math.imul(B,eh)|0,a=Math.imul(B,eu),i=i+Math.imul(D,ed)|0,n=(n=n+Math.imul(D,ec)|0)+Math.imul(L,ed)|0,a=a+Math.imul(L,ec)|0,i=i+Math.imul(O,em)|0,n=(n=n+Math.imul(O,eg)|0)+Math.imul(C,em)|0,a=a+Math.imul(C,eg)|0;var eO=(h+i|0)+((8191&n)<<13)|0;h=(a+(n>>>13)|0)+(eO>>>26)|0,eO&=0x3ffffff,i=Math.imul(q,ed),n=(n=Math.imul(q,ec))+Math.imul(B,ed)|0,a=Math.imul(B,ec),i=i+Math.imul(D,em)|0,n=(n=n+Math.imul(D,eg)|0)+Math.imul(L,em)|0,a=a+Math.imul(L,eg)|0;var eC=(h+i|0)+((8191&n)<<13)|0;h=(a+(n>>>13)|0)+(eC>>>26)|0,eC&=0x3ffffff,i=Math.imul(q,em),n=(n=Math.imul(q,eg))+Math.imul(B,em)|0,a=Math.imul(B,eg);var eN=(h+i|0)+((8191&n)<<13)|0;return h=(a+(n>>>13)|0)+(eN>>>26)|0,eN&=0x3ffffff,f[0]=ev,f[1]=eb,f[2]=ey,f[3]=ew,f[4]=e_,f[5]=eM,f[6]=ex,f[7]=eS,f[8]=eE,f[9]=ek,f[10]=eA,f[11]=eP,f[12]=eR,f[13]=eI,f[14]=eT,f[15]=ej,f[16]=eO,f[17]=eC,f[18]=eN,0!==h&&(f[19]=h,r.length++),r};function y(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var i=0,n=0,a=0;a>>26)|0)>>>26,s&=0x3ffffff}r.words[a]=o,i=s,s=n}return 0!==i?r.words[a]=i:r.length--,r._strip()}function w(e,t){this.x=e,this.y=t}Math.imul||(v=g),n.prototype.mulTo=function(e,t){var r,i=this.length+e.length;return 10===this.length&&10===e.length?r=v(this,e,t):i<63?r=g(this,e,t):r=y(this,e,t),r},w.prototype.makeRBT=function(e){for(var t=Array(e),r=n.prototype._countBits(e)-1,i=0;i>=1;return i},w.prototype.permute=function(e,t,r,i,n,a){for(var s=0;s>>=1)n++;return 1<>>=13,i[2*s+1]=8191&a,a>>>=13;for(s=2*t;s>=26,i+=(a/0x4000000|0)+(s>>>26),this.words[n]=0x3ffffff&s}return 0!==i&&(this.words[n]=i,this.length++),this.length=0===e?1:this.length,t?this.ineg():this},n.prototype.muln=function(e){return this.clone().imuln(e)},n.prototype.sqr=function(){return this.mul(this)},n.prototype.isqr=function(){return this.imul(this.clone())},n.prototype.pow=function(e){var t=function(e){for(var t=Array(e.bitLength()),r=0;r>>n&1}return t}(e);if(0===t.length)return new n(1);for(var r=this,i=0;i=0);var t,i=e%26,n=(e-i)/26,a=0x3ffffff>>>26-i<<26-i;if(0!==i){var s=0;for(t=0;t>>26-i}s&&(this.words[t]=s,this.length++)}if(0!==n){for(t=this.length-1;t>=0;t--)this.words[t+n]=this.words[t];for(t=0;t=0);var n=t?(t-t%26)/26:0,a=e%26,s=Math.min((e-a)/26,this.length),o=0x3ffffff^0x3ffffff>>>a<s)for(this.length-=s,f=0;f=0&&(0!==h||f>=n);f--){var u=0|this.words[f];this.words[f]=h<<26-a|u>>>a,h=u&o}return i&&0!==h&&(i.words[i.length++]=h),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},n.prototype.ishrn=function(e,t,i){return r(0===this.negative),this.iushrn(e,t,i)},n.prototype.shln=function(e){return this.clone().ishln(e)},n.prototype.ushln=function(e){return this.clone().iushln(e)},n.prototype.shrn=function(e){return this.clone().ishrn(e)},n.prototype.ushrn=function(e){return this.clone().iushrn(e)},n.prototype.testn=function(e){r("number"==typeof e&&e>=0);var t=e%26,i=(e-t)/26;return!(this.length<=i)&&!!(this.words[i]&1<=0);var t=e%26,i=(e-t)/26;return(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=i)?this:(0!==t&&i++,this.length=Math.min(i,this.length),0!==t&&(this.words[this.length-1]&=0x3ffffff^0x3ffffff>>>t<=0x4000000;t++)(this.words[t]-=0x4000000,t===this.length-1)?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},n.prototype.isubn=function(e){if(r("number"==typeof e),r(e<0x4000000),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t>26)-(f/0x4000000|0),this.words[n+i]=0x3ffffff&s}for(;n>26,this.words[n+i]=0x3ffffff&s;if(0===o)return this._strip();for(r(-1===o),o=0,n=0;n>26,this.words[n]=0x3ffffff&s;return this.negative=1,this._strip()},n.prototype._wordDiv=function(e,t){var r=this.length-e.length,i=this.clone(),a=e,s=0|a.words[a.length-1];0!=(r=26-this._countBits(s))&&(a=a.ushln(r),i.iushln(r),s=0|a.words[a.length-1]);var o,f=i.length-a.length;if("mod"!==t){(o=new n(null)).length=f+1,o.words=Array(o.length);for(var h=0;h=0;d--){var c=(0|i.words[a.length+d])*0x4000000+(0|i.words[a.length+d-1]);for(c=Math.min(c/s|0,0x3ffffff),i._ishlnsubmul(a,c,d);0!==i.negative;)c--,i.negative=0,i._ishlnsubmul(a,1,d),i.isZero()||(i.negative^=1);o&&(o.words[d]=c)}return o&&o._strip(),i._strip(),"div"!==t&&0!==r&&i.iushrn(r),{div:o||null,mod:i}},n.prototype.divmod=function(e,t,i){var a,s,o;return(r(!e.isZero()),this.isZero())?{div:new n(0),mod:new n(0)}:0!==this.negative&&0===e.negative?(o=this.neg().divmod(e,t),"mod"!==t&&(a=o.div.neg()),"div"!==t&&(s=o.mod.neg(),i&&0!==s.negative)&&s.iadd(e),{div:a,mod:s}):0===this.negative&&0!==e.negative?(o=this.divmod(e.neg(),t),"mod"!==t&&(a=o.div.neg()),{div:a,mod:o.mod}):(this.negative&e.negative)!=0?(o=this.neg().divmod(e.neg(),t),"div"!==t&&(s=o.mod.neg(),i&&0!==s.negative)&&s.isub(e),{div:o.div,mod:s}):e.length>this.length||0>this.cmp(e)?{div:new n(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new n(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new n(this.modrn(e.words[0]))}:this._wordDiv(e,t)},n.prototype.div=function(e){return this.divmod(e,"div",!1).div},n.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},n.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},n.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,i=e.ushrn(1),n=e.andln(1),a=r.cmp(i);return a<0||1===n&&0===a?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},n.prototype.modrn=function(e){var t=e<0;t&&(e=-e),r(e<=0x3ffffff);for(var i=0x4000000%e,n=0,a=this.length-1;a>=0;a--)n=(i*n+(0|this.words[a]))%e;return t?-n:n},n.prototype.modn=function(e){return this.modrn(e)},n.prototype.idivn=function(e){var t=e<0;t&&(e=-e),r(e<=0x3ffffff);for(var i=0,n=this.length-1;n>=0;n--){var a=(0|this.words[n])+0x4000000*i;this.words[n]=a/e|0,i=a%e}return this._strip(),t?this.ineg():this},n.prototype.divn=function(e){return this.clone().idivn(e)},n.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,i=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var a=new n(1),s=new n(0),o=new n(0),f=new n(1),h=0;t.isEven()&&i.isEven();)t.iushrn(1),i.iushrn(1),++h;for(var u=i.clone(),d=t.clone();!t.isZero();){for(var c=0,p=1;(t.words[0]&p)==0&&c<26;++c,p<<=1);if(c>0)for(t.iushrn(c);c-- >0;)(a.isOdd()||s.isOdd())&&(a.iadd(u),s.isub(d)),a.iushrn(1),s.iushrn(1);for(var m=0,g=1;(i.words[0]&g)==0&&m<26;++m,g<<=1);if(m>0)for(i.iushrn(m);m-- >0;)(o.isOdd()||f.isOdd())&&(o.iadd(u),f.isub(d)),o.iushrn(1),f.iushrn(1);t.cmp(i)>=0?(t.isub(i),a.isub(o),s.isub(f)):(i.isub(t),o.isub(a),f.isub(s))}return{a:o,b:f,gcd:i.iushln(h)}},n.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t,i=this,a=e.clone();i=0!==i.negative?i.umod(e):i.clone();for(var s=new n(1),o=new n(0),f=a.clone();i.cmpn(1)>0&&a.cmpn(1)>0;){for(var h=0,u=1;(i.words[0]&u)==0&&h<26;++h,u<<=1);if(h>0)for(i.iushrn(h);h-- >0;)s.isOdd()&&s.iadd(f),s.iushrn(1);for(var d=0,c=1;(a.words[0]&c)==0&&d<26;++d,c<<=1);if(d>0)for(a.iushrn(d);d-- >0;)o.isOdd()&&o.iadd(f),o.iushrn(1);i.cmp(a)>=0?(i.isub(a),s.isub(o)):(a.isub(i),o.isub(s))}return 0>(t=0===i.cmpn(1)?s:o).cmpn(0)&&t.iadd(e),t},n.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var i=0;t.isEven()&&r.isEven();i++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var n=t.cmp(r);if(n<0){var a=t;t=r,r=a}else if(0===n||0===r.cmpn(1))break;t.isub(r)}return r.iushln(i)},n.prototype.invm=function(e){return this.egcd(e).a.umod(e)},n.prototype.isEven=function(){return(1&this.words[0])==0},n.prototype.isOdd=function(){return(1&this.words[0])==1},n.prototype.andln=function(e){return this.words[0]&e},n.prototype.bincn=function(e){r("number"==typeof e);var t=e%26,i=(e-t)/26,n=1<>>26,o&=0x3ffffff,this.words[s]=o}return 0!==a&&(this.words[s]=a,this.length++),this},n.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},n.prototype.cmpn=function(e){var t,i=e<0;if(0!==this.negative&&!i)return -1;if(0===this.negative&&i)return 1;if(this._strip(),this.length>1)t=1;else{i&&(e=-e),r(e<=0x3ffffff,"Number is too big");var n=0|this.words[0];t=n===e?0:ne.length)return 1;if(this.length=0;r--){var i=0|this.words[r],n=0|e.words[r];if(i!==n){in&&(t=1);break}}return t},n.prototype.gtn=function(e){return 1===this.cmpn(e)},n.prototype.gt=function(e){return 1===this.cmp(e)},n.prototype.gten=function(e){return this.cmpn(e)>=0},n.prototype.gte=function(e){return this.cmp(e)>=0},n.prototype.ltn=function(e){return -1===this.cmpn(e)},n.prototype.lt=function(e){return -1===this.cmp(e)},n.prototype.lten=function(e){return 0>=this.cmpn(e)},n.prototype.lte=function(e){return 0>=this.cmp(e)},n.prototype.eqn=function(e){return 0===this.cmpn(e)},n.prototype.eq=function(e){return 0===this.cmp(e)},n.red=function(e){return new A(e)},n.prototype.toRed=function(e){return r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},n.prototype.fromRed=function(){return r(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},n.prototype._forceRed=function(e){return this.red=e,this},n.prototype.forceRed=function(e){return r(!this.red,"Already a number in reduction context"),this._forceRed(e)},n.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},n.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},n.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},n.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},n.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},n.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},n.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},n.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},n.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},n.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},n.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},n.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},n.prototype.redPow=function(e){return r(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var _={k256:null,p224:null,p192:null,p25519:null};function M(e,t){this.name=e,this.p=new n(t,16),this.n=this.p.bitLength(),this.k=new n(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function x(){M.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function S(){M.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function E(){M.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function k(){M.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function A(e){if("string"==typeof e){var t=n._prime(e);this.m=t.p,this.prime=t}else r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function P(e){A.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new n(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)}M.prototype._tmp=function(){var e=new n(null);return e.words=Array(Math.ceil(this.n/13)),e},M.prototype.ireduce=function(e){var t,r=e;do this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength();while(t>this.n);var i=t0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},M.prototype.split=function(e,t){e.iushrn(this.n,0,t)},M.prototype.imulK=function(e){return e.imul(this.k)},i(x,M),x.prototype.split=function(e,t){for(var r=Math.min(e.length,9),i=0;i>>22,n=a}(n>>>=22,e.words[i-10]=n,0===n&&e.length>10)?e.length-=10:e.length-=9},x.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r>>=26,e.words[r]=n,t=i}return 0!==t&&(e.words[e.length++]=t),e},n._prime=function(e){var t;if(_[e])return _[e];if("k256"===e)t=new x;else if("p224"===e)t=new S;else if("p192"===e)t=new E;else if("p25519"===e)t=new k;else throw Error("Unknown prime "+e);return _[e]=t,t},A.prototype._verify1=function(e){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},A.prototype._verify2=function(e,t){r((e.negative|t.negative)==0,"red works only with positives"),r(e.red&&e.red===t.red,"red works only with red numbers")},A.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(f(e,e.umod(this.m)._forceRed(this)),e)},A.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},A.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},A.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},A.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return 0>r.cmpn(0)&&r.iadd(this.m),r._forceRed(this)},A.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return 0>r.cmpn(0)&&r.iadd(this.m),r},A.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},A.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},A.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},A.prototype.isqr=function(e){return this.imul(e,e.clone())},A.prototype.sqr=function(e){return this.mul(e,e)},A.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(r(t%2==1),3===t){var i=this.m.add(new n(1)).iushrn(2);return this.pow(e,i)}for(var a=this.m.subn(1),s=0;!a.isZero()&&0===a.andln(1);)s++,a.iushrn(1);r(!a.isZero());var o=new n(1).toRed(this),f=o.redNeg(),h=this.m.subn(1).iushrn(1),u=this.m.bitLength();for(u=new n(2*u*u).toRed(this);0!==this.pow(u,h).cmp(f);)u.redIAdd(f);for(var d=this.pow(u,a),c=this.pow(e,a.addn(1).iushrn(1)),p=this.pow(e,a),m=s;0!==p.cmp(o);){for(var g=p,v=0;0!==g.cmp(o);v++)g=g.redSqr();r(v=0;i--){for(var h=t.words[i],u=f-1;u>=0;u--){var d=h>>u&1;if(a!==r[0]&&(a=this.sqr(a)),0===d&&0===s){o=0;continue}s<<=1,s|=d,(4==++o||0===i&&0===u)&&(a=this.mul(a,r[s]),o=0,s=0)}f=26}return a},A.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},A.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},n.mont=function(e){return new P(e)},i(P,A),P.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},P.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},P.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),n=r.isub(i).iushrn(this.shift),a=n;return n.cmp(this.m)>=0?a=n.isub(this.m):0>n.cmpn(0)&&(a=n.iadd(this.m)),a._forceRed(this)},P.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new n(0)._forceRed(this);var r=e.mul(t),i=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=r.isub(i).iushrn(this.shift),s=a;return a.cmp(this.m)>=0?s=a.isub(this.m):0>a.cmpn(0)&&(s=a.iadd(this.m)),s._forceRed(this)},P.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(typeof t>"u"||t,e)}),r5=iQ((e,t)=>{var r=r9(),i=tU(),n=tG().Buffer;function a(e){var t,n=e.modulus.byteLength();do t=new r(i(n));while(t.cmp(e.modulus)>=0||!t.umod(e.prime1)||!t.umod(e.prime2));return t}function s(e,t){var i,s={blinder:(i=a(t)).toRed(r.mont(t.modulus)).redPow(new r(t.publicExponent)).fromRed(),unblinder:i.invm(t.modulus)},o=t.modulus.byteLength(),f=new r(e).mul(s.blinder).umod(t.modulus),h=f.toRed(r.mont(t.prime1)),u=f.toRed(r.mont(t.prime2)),d=t.coefficient,c=t.prime1,p=t.prime2,m=h.redPow(t.exponent1).fromRed(),g=u.redPow(t.exponent2).fromRed(),v=m.isub(g).imul(d).umod(c).imul(p);return g.iadd(v).imul(s.unblinder).umod(t.modulus).toArrayLike(n,"be",o)}s.getr=a,t.exports=s}),r8=iQ((e,t)=>{var r=r1(),i=tU(),n=tH(),a=r2(),s=r3(),o=r6(),f=r4(),h=r5(),u=tG().Buffer;t.exports=function(e,t,d){var c,p=e.padding?e.padding:d?1:4,m=r(e);if(4===p)c=function(e,t){var r=e.modulus.byteLength(),f=t.length,h=n("sha1").update(u.alloc(0)).digest(),d=h.length,c=2*d;if(f>r-c-2)throw Error("message too long");var p=u.alloc(r-f-c-2),m=r-d-1,g=i(d),v=s(u.concat([h,p,u.alloc(1,1),t],m),a(g,m)),b=s(g,a(v,d));return new o(u.concat([u.alloc(1),b,v],r))}(m,t);else if(1===p)c=function(e,t,r){var n,a=t.length,s=e.modulus.byteLength();if(a>s-11)throw Error("message too long");return n=r?u.alloc(s-a-3,255):function(e){for(var t,r=u.allocUnsafe(e),n=0,a=i(2*e),s=0;n=0)throw Error("data too long for modulus")}else throw Error("unknown padding");return d?h(c,m):f(c,m)}}),r7=iQ((e,t)=>{var r=r1(),i=r2(),n=r3(),a=r6(),s=r5(),o=tH(),f=r4(),h=tG().Buffer;t.exports=function(e,t,u){var d,c=e.padding?e.padding:u?1:4,p=r(e),m=p.modulus.byteLength();if(t.length>m||new a(t).cmp(p.modulus)>=0)throw Error("decryption error");d=u?f(new a(t),p):s(t,p);var g=h.alloc(m-d.length);if(d=h.concat([g,d],m),4===c)return function(e,t){var r=e.modulus.byteLength(),a=o("sha1").update(h.alloc(0)).digest(),s=a.length;if(0!==t[0])throw Error("decryption error");var f=t.slice(1,s+1),u=t.slice(s+1),d=n(f,i(u,s)),c=n(u,i(d,r-s-1));if(function(e,t){e=h.from(e),t=h.from(t);var r=0,i=e.length;e.length!==t.length&&(r++,i=Math.min(e.length,t.length));for(var n=-1;++n=v.length){_++;break}var M=v.slice(2,w-1);if(("0002"!==y.toString("hex")&&!b||"0001"!==y.toString("hex")&&b)&&_++,M.length<8&&_++,_)throw Error("decryption error");return v.slice(w)}if(3===c)return d;throw Error("unknown padding")}}),ie=iQ(e=>{e.publicEncrypt=r8(),e.privateDecrypt=r7(),e.privateEncrypt=function(t,r){return e.publicEncrypt(t,r,!0)},e.publicDecrypt=function(t,r){return e.privateDecrypt(t,r,!0)}}),it=iQ(e=>{var t=(iX(),p(tL));"function"!=typeof t.publicEncrypt&&(t=ie()),(e.publicEncrypt=t.publicEncrypt,e.privateDecrypt=t.privateDecrypt,"function"!=typeof t.privateEncrypt)?e.privateEncrypt=ie().privateEncrypt:e.privateEncrypt=t.privateEncrypt,"function"!=typeof t.publicDecrypt?e.publicDecrypt=ie().publicDecrypt:e.publicDecrypt=t.publicDecrypt}),ir=iQ(e=>{var t=tG(),r=tU(),i=t.Buffer,n=t.kMaxLength,a=globalThis.crypto||globalThis.msCrypto;function s(e,t){if("number"!=typeof e||e!=e)throw TypeError("offset must be a number");if(e>0xffffffff||e<0)throw TypeError("offset must be a uint32");if(e>n||e>t)throw RangeError("offset out of range")}function o(e,t,r){if("number"!=typeof e||e!=e)throw TypeError("size must be a number");if(e>0xffffffff||e<0)throw TypeError("size must be a uint32");if(e+t>r||e>n)throw RangeError("buffer too small")}function f(e,t,i,n){return n?void r(i,function(r,i){if(r)return n(r);i.copy(e,t),n(null,e)}):(r(i).copy(e,t),e)}a&&a.getRandomValues,e.randomFill=function(e,t,r,n){if(!i.isBuffer(e)&&!(e instanceof globalThis.Uint8Array))throw TypeError('"buf" argument must be a Buffer or Uint8Array');if("function"==typeof t)n=t,t=0,r=e.length;else if("function"==typeof r)n=r,r=e.length-t;else if("function"!=typeof n)throw TypeError('"cb" argument must be a function');return s(t,e.length),o(r,t,e.length),f(e,t,r,n)},e.randomFillSync=function(e,t,r){if(typeof t>"u"&&(t=0),!i.isBuffer(e)&&!(e instanceof globalThis.Uint8Array))throw TypeError('"buf" argument must be a Buffer or Uint8Array');return s(t,e.length),void 0===r&&(r=e.length-t),o(r,t,e.length),f(e,t,r)}}),ii=iQ((e,t)=>{var r=(iX(),p(tL));"function"==typeof r.randomFill&&"function"==typeof r.randomFillSync?(e.randomFill=r.randomFill,e.randomFillSync=r.randomFillSync):t.exports=ir()}),is=(ia=((e,t,r)=>{r=null!=e?tq(tB(e)):{};let i=!t&&e&&e.__esModule?r:tF(r,"default",{value:e,enumerable:!0});for(let t of tz(e))tZ.call(i,t)||tF(i,t,{get:()=>e[t],enumerable:!0});return i})(iQ(e=>{e.randomBytes=e.rng=e.pseudoRandomBytes=e.prng=tU(),e.createHash=e.Hash=tH(),e.createHmac=e.Hmac=tV();var t=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(Object.keys(tW()));e.getHashes=function(){return t};var r=t0();e.pbkdf2=r.pbkdf2,e.pbkdf2Sync=r.pbkdf2Sync;var i=t1();e.Cipher=i.Cipher,e.createCipher=i.createCipher,e.Cipheriv=i.Cipheriv,e.createCipheriv=i.createCipheriv,e.Decipher=i.Decipher,e.createDecipher=i.createDecipher,e.Decipheriv=i.Decipheriv,e.createDecipheriv=i.createDecipheriv,e.getCiphers=i.getCiphers,e.listCiphers=i.listCiphers;var n=t2();e.DiffieHellmanGroup=n.DiffieHellmanGroup,e.createDiffieHellmanGroup=n.createDiffieHellmanGroup,e.getDiffieHellman=n.getDiffieHellman,e.createDiffieHellman=n.createDiffieHellman,e.DiffieHellman=n.DiffieHellman;var a=t3();e.createSign=a.createSign,e.Sign=a.Sign,e.createVerify=a.createVerify,e.Verify=a.Verify,e.createECDH=rT();var s=it();e.publicEncrypt=s.publicEncrypt,e.privateEncrypt=s.privateEncrypt,e.publicDecrypt=s.publicDecrypt,e.privateDecrypt=s.privateDecrypt;var o=ii();e.randomFill=o.randomFill,e.randomFillSync=o.randomFillSync,e.createCredentials=function(){throw Error(`sorry, createCredentials is not implemented yet we accept pull requests https://github.com/browserify/crypto-browserify`)},e.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6}})(),1)).prng,io=ia.pseudoRandomBytes,ih=ia.rng,iu=ia.randomBytes,il=ia.Hash,id=ia.createHash,ic=ia.Hmac,ip=ia.createHmac,im=ia.getHashes,ig=ia.pbkdf2,iv=ia.pbkdf2Sync,ib=ia.Cipher,iy=ia.createCipher,iw=ia.Cipheriv,i_=ia.createCipheriv,iM=ia.Decipher,ix=ia.createDecipher,iS=ia.Decipheriv,iE=ia.createDecipheriv,ik=ia.getCiphers,iA=ia.listCiphers,iP=ia.DiffieHellmanGroup,iR=ia.createDiffieHellmanGroup,iI=ia.getDiffieHellman,iT=ia.createDiffieHellman,ij=ia.DiffieHellman,iO=ia.createSign,iC=ia.Sign,iN=ia.createVerify,iD=ia.Verify,iL=ia.createECDH,i$=ia.publicEncrypt,iq=ia.privateEncrypt,iB=ia.publicDecrypt,iF=ia.privateDecrypt,iz=ia.randomFill,iZ=ia.randomFillSync,iU=ia.createCredentials,iH=ia.constants,iV=["p192","p224","p256","p384","p521","curve25519","ed25519","secp256k1","secp224r1","prime256v1","prime192v1","ed25519","secp384r1","secp521r1"],iW=crypto,iK=crypto}),i0=m((e,t)=>{!function(r,i){"object"==typeof e&&"u">typeof t?i(e):"function"==typeof define&&define.amd?define(["exports"],i):i(r.URI=r.URI||{})}(e,function(e){function t(){for(var e=arguments.length,t=Array(e),r=0;r1))return t[0];t[0]=t[0].slice(0,-1);for(var i=t.length-1,n=1;n= 0x80 (not a basic code point)","invalid-input":"Invalid input"},p=Math.floor,m=String.fromCharCode;function g(e){throw RangeError(c[e])}function v(e,t){var r=e.split("@"),i="";return r.length>1&&(i=r[0]+"@",e=r[1]),i+(function(e,t){for(var r=[],i=e.length;i--;)r[i]=t(e[i]);return r})((e=e.replace(d,".")).split("."),t).join(".")}var b=function(e,t){return e+22+75*(e<26)-((0!=t)<<5)},y=function(e,t,r){var i=0;for(e=r?p(e/700):e>>1,e+=p(e/t);e>455;i+=36)e=p(e/35);return p(i+36*e/(e+38))},w=function(e){var t=[],r=e.length,i=0,n=128,a=72,s=e.lastIndexOf("-");s<0&&(s=0);for(var o=0;o=128&&g("not-basic"),t.push(e.charCodeAt(o));for(var f=s>0?s+1:0;f=r&&g("invalid-input");var c,m=(c=e.charCodeAt(f++))-48<10?c-22:c-65<26?c-65:c-97<26?c-97:36;(m>=36||m>p((0x7fffffff-i)/u))&&g("overflow"),i+=m*u;var v=d<=a?1:d>=a+26?26:d-a;if(mp(0x7fffffff/b)&&g("overflow"),u*=b}var w=t.length+1;a=y(i-h,w,0==h),p(i/w)>0x7fffffff-n&&g("overflow"),n+=p(i/w),i%=w,t.splice(i++,0,n)}return String.fromCodePoint.apply(String,t)},_=function(e){var t=[],r=(e=function(e){for(var t=[],r=0,i=e.length;r=55296&&n<=56319&&r=i&&kp((0x7fffffff-n)/A)&&g("overflow"),n+=(w-i)*A,i=w;var P=!0,R=!1,I=void 0;try{for(var T,j=e[Symbol.iterator]();!(P=(T=j.next()).done);P=!0){var O=T.value;if(O0x7fffffff&&g("overflow"),O==i){for(var C=n,N=36;;N+=36){var D=N<=a?1:N>=a+26?26:N-a;if(C>6|192).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase():"%"+(t>>12|224).toString(16).toUpperCase()+"%"+(t>>6&63|128).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase()}function k(e){for(var t="",r=0,i=e.length;r=194&&n<224?(i-r>=6?t+=String.fromCharCode((31&n)<<6|63&parseInt(e.substr(r+4,2),16)):t+=e.substr(r,6),r+=6):n>=224?(i-r>=9?t+=String.fromCharCode((15&n)<<12|(63&parseInt(e.substr(r+4,2),16))<<6|63&parseInt(e.substr(r+7,2),16)):t+=e.substr(r,9),r+=9):(t+=e.substr(r,3),r+=3)}return t}function A(e,t){function r(e){var r=k(e);return r.match(t.UNRESERVED)?r:e}return e.scheme&&(e.scheme=String(e.scheme).replace(t.PCT_ENCODED,r).toLowerCase().replace(t.NOT_SCHEME,"")),void 0!==e.userinfo&&(e.userinfo=String(e.userinfo).replace(t.PCT_ENCODED,r).replace(t.NOT_USERINFO,E).replace(t.PCT_ENCODED,n)),void 0!==e.host&&(e.host=String(e.host).replace(t.PCT_ENCODED,r).toLowerCase().replace(t.NOT_HOST,E).replace(t.PCT_ENCODED,n)),void 0!==e.path&&(e.path=String(e.path).replace(t.PCT_ENCODED,r).replace(e.scheme?t.NOT_PATH:t.NOT_PATH_NOSCHEME,E).replace(t.PCT_ENCODED,n)),void 0!==e.query&&(e.query=String(e.query).replace(t.PCT_ENCODED,r).replace(t.NOT_QUERY,E).replace(t.PCT_ENCODED,n)),void 0!==e.fragment&&(e.fragment=String(e.fragment).replace(t.PCT_ENCODED,r).replace(t.NOT_FRAGMENT,E).replace(t.PCT_ENCODED,n)),e}function P(e){return e.replace(/^0*(.*)/,"$1")||"0"}function R(e,t){var r=f(e.match(t.IPV4ADDRESS)||[],2)[1];return r?r.split(".").map(P).join("."):e}function I(e,t){var r=f(e.match(t.IPV6ADDRESS)||[],3),i=r[1],n=r[2];if(!i)return e;for(var a=f(i.toLowerCase().split("::").reverse(),2),s=a[0],o=a[1],h=o?o.split(":").map(P):[],u=s.split(":").map(P),d=t.IPV4ADDRESS.test(u[u.length-1]),c=d?7:8,p=u.length-c,m=Array(c),g=0;g1){var y=m.slice(0,v.index),w=m.slice(v.index+v.length);b=y.join(":")+"::"+w.join(":")}else b=m.join(":");return n&&(b+="%"+n),b}var T=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,j=void 0==="".match(/(){0}/)[1];function O(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={},i=!1!==t.iri?o:s;"suffix"===t.reference&&(e=(t.scheme?t.scheme+":":"")+"//"+e);var n=e.match(T);if(n){j?(r.scheme=n[1],r.userinfo=n[3],r.host=n[4],r.port=parseInt(n[5],10),r.path=n[6]||"",r.query=n[7],r.fragment=n[8],isNaN(r.port)&&(r.port=n[5])):(r.scheme=n[1]||void 0,r.userinfo=-1!==e.indexOf("@")?n[3]:void 0,r.host=-1!==e.indexOf("//")?n[4]:void 0,r.port=parseInt(n[5],10),r.path=n[6]||"",r.query=-1!==e.indexOf("?")?n[7]:void 0,r.fragment=-1!==e.indexOf("#")?n[8]:void 0,isNaN(r.port)&&(r.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?n[4]:void 0)),r.host&&(r.host=I(R(r.host,i),i)),void 0!==r.scheme||void 0!==r.userinfo||void 0!==r.host||void 0!==r.port||r.path||void 0!==r.query?void 0===r.scheme?r.reference="relative":void 0===r.fragment?r.reference="absolute":r.reference="uri":r.reference="same-document",t.reference&&"suffix"!==t.reference&&t.reference!==r.reference&&(r.error=r.error||"URI is not a "+t.reference+" reference.");var a=S[(t.scheme||r.scheme||"").toLowerCase()];if(t.unicodeSupport||a&&a.unicodeSupport)A(r,i);else{if(r.host&&(t.domainHost||a&&a.domainHost))try{r.host=M(r.host.replace(i.PCT_ENCODED,k).toLowerCase())}catch(e){r.error=r.error||"Host's domain name can not be converted to ASCII via punycode: "+e}A(r,s)}a&&a.parse&&a.parse(r,t)}else r.error=r.error||"URI can not be parsed.";return r}var C=/^\.\.?\//,N=/^\/\.(\/|$)/,D=/^\/\.\.(\/|$)/,L=/^\/?(?:.|\n)*?(?=\/|$)/;function $(e){for(var t=[];e.length;)if(e.match(C))e=e.replace(C,"");else if(e.match(N))e=e.replace(N,"/");else if(e.match(D))e=e.replace(D,"/"),t.pop();else if("."===e||".."===e)e="";else{var r=e.match(L);if(r){var i=r[0];e=e.slice(i.length),t.push(i)}else throw Error("Unexpected dot segment condition")}return t.join("")}function q(e){var t,r,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=i.iri?o:s,a=[],f=S[(i.scheme||e.scheme||"").toLowerCase()];if(f&&f.serialize&&f.serialize(e,i),e.host){if(n.IPV6ADDRESS.test(e.host));else if(i.domainHost||f&&f.domainHost)try{e.host=i.iri?x(e.host):M(e.host.replace(n.PCT_ENCODED,k).toLowerCase())}catch(t){e.error=e.error||"Host's domain name can not be converted to "+(i.iri?"Unicode":"ASCII")+" via punycode: "+t}}A(e,n),"suffix"!==i.reference&&e.scheme&&(a.push(e.scheme),a.push(":"));var h=(t=!1!==i.iri?o:s,r=[],void 0!==e.userinfo&&(r.push(e.userinfo),r.push("@")),void 0!==e.host&&r.push(I(R(String(e.host),t),t).replace(t.IPV6ADDRESS,function(e,t,r){return"["+t+(r?"%25"+r:"")+"]"})),("number"==typeof e.port||"string"==typeof e.port)&&(r.push(":"),r.push(String(e.port))),r.length?r.join(""):void 0);if(void 0!==h&&("suffix"!==i.reference&&a.push("//"),a.push(h),e.path&&"/"!==e.path.charAt(0)&&a.push("/")),void 0!==e.path){var u=e.path;i.absolutePath||f&&f.absolutePath||(u=$(u)),void 0===h&&(u=u.replace(/^\/\//,"/%2F")),a.push(u)}return void 0!==e.query&&(a.push("?"),a.push(e.query)),void 0!==e.fragment&&(a.push("#"),a.push(e.fragment)),a.join("")}function B(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments[3],n={};return i||(e=O(q(e,r),r),t=O(q(t,r),r)),!(r=r||{}).tolerant&&t.scheme?(n.scheme=t.scheme,n.userinfo=t.userinfo,n.host=t.host,n.port=t.port,n.path=$(t.path||""),n.query=t.query):(void 0!==t.userinfo||void 0!==t.host||void 0!==t.port?(n.userinfo=t.userinfo,n.host=t.host,n.port=t.port,n.path=$(t.path||""),n.query=t.query):(t.path?("/"===t.path.charAt(0)?n.path=$(t.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?n.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:n.path=t.path:n.path="/"+t.path,n.path=$(n.path)),n.query=t.query):(n.path=e.path,void 0!==t.query)?n.query=t.query:n.query=e.query,n.userinfo=e.userinfo,n.host=e.host,n.port=e.port),n.scheme=e.scheme),n.fragment=t.fragment,n}function F(e,t){return e&&e.toString().replace(t&&t.iri?o.PCT_ENCODED:s.PCT_ENCODED,k)}var z={scheme:"http",domainHost:!0,parse:function(e,t){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e},serialize:function(e,t){var r="https"===String(e.scheme).toLowerCase();return(e.port===(r?443:80)||""===e.port)&&(e.port=void 0),e.path||(e.path="/"),e}},Z={scheme:"https",domainHost:z.domainHost,parse:z.parse,serialize:z.serialize};function U(e){return"boolean"==typeof e.secure?e.secure:"wss"===String(e.scheme).toLowerCase()}var H={scheme:"ws",domainHost:!0,parse:function(e,t){return e.secure=U(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e},serialize:function(e,t){if((e.port===(U(e)?443:80)||""===e.port)&&(e.port=void 0),"boolean"==typeof e.secure&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){var r=f(e.resourceName.split("?"),2),i=r[0],n=r[1];e.path=i&&"/"!==i?i:void 0,e.query=n,e.resourceName=void 0}return e.fragment=void 0,e}},V={scheme:"wss",domainHost:H.domainHost,parse:H.parse,serialize:H.serialize},W={},K="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",Q="[0-9A-Fa-f]",G=r(r("%[EFef]"+Q+"%"+Q+Q+"%"+Q+Q)+"|"+r("%[89A-Fa-f]"+Q+"%"+Q+Q)+"|"+r("%"+Q+Q)),J=t("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]'),Y=RegExp(K,"g"),X=RegExp(G,"g"),ee=RegExp(t("[^]","[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]","[\\.]",'[\\"]',J),"g"),et=RegExp(t("[^]",K,"[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]"),"g");function er(e){var t=k(e);return t.match(Y)?t:e}var ei={scheme:"mailto",parse:function(e,t){var r=e.to=e.path?e.path.split(","):[];if(e.path=void 0,e.query){for(var i=!1,n={},a=e.query.split("&"),s=0,o=a.length;s{t.exports=function e(t,r){if(t===r)return!0;if(t&&r&&"object"==typeof t&&"object"==typeof r){if(t.constructor!==r.constructor)return!1;if(Array.isArray(t)){if((i=t.length)!=r.length)return!1;for(n=i;0!=n--;)if(!e(t[n],r[n]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if((i=(a=Object.keys(t)).length)!==Object.keys(r).length)return!1;for(n=i;0!=n--;)if(!Object.prototype.hasOwnProperty.call(r,a[n]))return!1;for(n=i;0!=n--;){var i,n,a,s=a[n];if(!e(t[s],r[s]))return!1}return!0}return t!=t&&r!=r}}),i2=m((e,t)=>{t.exports=function(e){for(var t,r=0,i=e.length,n=0;n=55296&&t<=56319&&n{function r(e,t,r,i){var n=i?" !== ":" === ",a=i?" || ":" && ",s=i?"!":"",o=i?"":"!";switch(e){case"null":return t+n+"null";case"array":return s+"Array.isArray("+t+")";case"object":return"("+s+t+a+"typeof "+t+n+'"object"'+a+o+"Array.isArray("+t+"))";case"integer":return"(typeof "+t+n+'"number"'+a+o+"("+t+" % 1)"+a+t+n+t+(r?a+s+"isFinite("+t+")":"")+")";case"number":return"(typeof "+t+n+'"'+e+'"'+(r?a+s+"isFinite("+t+")":"")+")";default:return"typeof "+t+n+'"'+e+'"'}}t.exports={copy:function(e,t){for(var r in t=t||{},e)t[r]=e[r];return t},checkDataType:r,checkDataTypes:function(e,t,i){if(1===e.length)return r(e[0],t,i,!0);var a="",s=n(e);for(var o in s.array&&s.object&&(a=(s.null?"(":"(!"+t+" || ")+("typeof "+t)+' !== "object")',delete s.null,delete s.array,delete s.object),s.number&&delete s.integer,s)a+=(a?" && ":"")+r(o,t,i,!0);return a},coerceToTypes:function(e,t){if(Array.isArray(t)){for(var r=[],n=0;n=t)throw Error("Cannot access property/index "+i+" levels up, current level is "+t);return r[t-i]}if(i>t)throw Error("Cannot access data "+i+" levels up, current level is "+t);if(a="data"+(t-i||""),!n)return a}for(var i,n,a,s,f=a,h=n.split("/"),c=0;c{var r=i3();t.exports=function(e){r.copy(e,this)}}),i4=m((e,t)=>{var r=t.exports=function(e,t,i){"function"==typeof t&&(i=t,t={});var n="function"==typeof(i=t.cb||i)?i:i.pre||function(){};!function e(t,i,n,a,s,o,f,h,u,d){if(a&&"object"==typeof a&&!Array.isArray(a)){for(var c in i(a,s,o,f,h,u,d),a){var p=a[c];if(Array.isArray(p)){if(c in r.arrayKeywords)for(var m=0;m{var r=i0(),i=i1(),n=i3(),a=i6(),s=i4();function o(e,t,r){var i=this._refs[r];if("string"==typeof i)if(!this._refs[i])return o.call(this,e,t,i);else i=this._refs[i];if((i=i||this._schemas[r])instanceof a)return p(i.schema,this._opts.inlineRefs)?i.schema:i.validate||this._compile(i);var n,s,h,u=f.call(this,t,r);return u&&(n=u.schema,t=u.root,h=u.baseId),n instanceof a?s=n.validate||e.call(this,n.schema,t,void 0,h):void 0!==n&&(s=p(n,this._opts.inlineRefs)?n:e.call(this,n,t,void 0,h)),s}function f(e,t){var i=r.parse(t),n=g(i),s=m(this._getId(e.schema));if(0===Object.keys(e.schema).length||n!==s){var o=b(n),f=this._refs[o];if("string"==typeof f)return h.call(this,e,f,i);if(f instanceof a)f.validate||this._compile(f),e=f;else{if(!((f=this._schemas[o])instanceof a))return;if(f.validate||this._compile(f),o==b(t))return{schema:f,root:e,baseId:s};e=f}if(!e.schema)return;s=m(this._getId(e.schema))}return d.call(this,i,s,e.schema,e)}function h(e,t,r){var i=f.call(this,e,t);if(i){var{schema:n,baseId:a}=i;e=i.root;var s=this._getId(n);return s&&(a=y(a,s)),d.call(this,r,a,n,e)}}t.exports=o,o.normalizeId=b,o.fullPath=m,o.url=y,o.ids=function(e){var t=b(this._getId(e)),a={"":t},o={"":m(t,!1)},f={},h=this;return s(e,{allKeys:!0},function(e,t,s,u,d,c,p){if(""!==t){var m=h._getId(e),g=a[u],v=o[u]+"/"+d;if(void 0!==p&&(v+="/"+("number"==typeof p?p:n.escapeFragment(p))),"string"==typeof m){m=g=b(g?r.resolve(g,m):m);var y=h._refs[m];if("string"==typeof y&&(y=h._refs[y]),y&&y.schema){if(!i(e,y.schema))throw Error('id "'+m+'" resolves to more than one schema')}else if(m!=b(v))if("#"==m[0]){if(f[m]&&!i(e,f[m]))throw Error('id "'+m+'" resolves to more than one schema');f[m]=e}else h._refs[m]=v}a[t]=g,o[t]=v}}),f},o.inlineRef=p,o.schema=f;var u=n.toHash(["properties","patternProperties","enum","dependencies","definitions"]);function d(e,t,r,i){if(e.fragment=e.fragment||"","/"==e.fragment.slice(0,1)){for(var a=e.fragment.split("/"),s=1;s{var r=i9();function i(e,t,n){this.message=n||i.message(e,t),this.missingRef=r.url(e,t),this.missingSchema=r.normalizeId(r.fullPath(this.missingRef))}function n(e){return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e}t.exports={Validation:n(function(e){this.message="validation failed",this.errors=e,this.ajv=this.validation=!0}),MissingRef:n(i)},i.message=function(e,t){return"can't resolve reference "+t+" from id "+e}}),i8=m((e,t)=>{t.exports=function(e,t){t||(t={}),"function"==typeof t&&(t={cmp:t});var r,i="boolean"==typeof t.cycles&&t.cycles,n=t.cmp&&(r=t.cmp,function(e){return function(t,i){return r({key:t,value:e[t]},{key:i,value:e[i]})}}),a=[];return function e(t){if(t&&t.toJSON&&"function"==typeof t.toJSON&&(t=t.toJSON()),void 0!==t){if("number"==typeof t)return isFinite(t)?""+t:"null";if("object"!=typeof t)return JSON.stringify(t);if(Array.isArray(t)){for(r=0,s="[";r{t.exports=function(e,t,r){var i="",n=!0===e.schema.$async,a=e.util.schemaHasRulesExcept(e.schema,e.RULES.all,"$ref"),s=e.self._getId(e.schema);if(e.opts.strictKeywords){var o=e.util.schemaUnknownRules(e.schema,e.RULES.keywords);if(o){var f="unknown keyword: "+o;if("log"===e.opts.strictKeywords)e.logger.warn(f);else throw Error(f)}}if(e.isTop&&(i+=" var validate = ",n&&(e.async=!0,i+="async "),i+="function(data, dataPath, parentData, parentDataProperty, rootData) { 'use strict'; ",s&&(e.opts.sourceCode||e.opts.processCode)&&(i+=" /*# sourceURL="+s+" */ ")),"boolean"==typeof e.schema||!(a||e.schema.$ref)){var h,t="false schema",u=e.level,d=e.dataLevel,c=e.schema[t],p=e.schemaPath+e.util.getProperty(t),m=e.errSchemaPath+"/"+t,g=!e.opts.allErrors,v="data"+(d||""),b="valid"+u;if(!1===e.schema){e.isTop?g=!0:i+=" var "+b+" = false; ";var y=y||[];(y.push(i),i="",!1!==e.createErrors)?(i+=" { keyword: '"+(h||"false schema")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(m)+" , params: {} ",!1!==e.opts.messages&&(i+=" , message: 'boolean schema is false' "),e.opts.verbose&&(i+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+v+" "),i+=" } "):i+=" {} ";var w=i;(i=y.pop(),!e.compositeRule&&g)?e.async?i+=" throw new ValidationError(["+w+"]); ":i+=" validate.errors = ["+w+"]; return false; ":i+=" var err = "+w+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else e.isTop?n?i+=" return data; ":i+=" validate.errors = null; return true; ":i+=" var "+b+" = true; ";return e.isTop&&(i+=" }; return validate; "),i}if(e.isTop){var _=e.isTop,u=e.level=0,d=e.dataLevel=0,v="data";if(e.rootId=e.resolve.fullPath(e.self._getId(e.root.schema)),e.baseId=e.baseId||e.rootId,delete e.isTop,e.dataPathArr=[""],void 0!==e.schema.default&&e.opts.useDefaults&&e.opts.strictDefaults){var M="default is ignored in the schema root";if("log"===e.opts.strictDefaults)e.logger.warn(M);else throw Error(M)}i+=" var vErrors = null; ",i+=" var errors = 0; ",i+=" if (rootData === undefined) rootData = data; "}else{var{level:u,dataLevel:d}=e,v="data"+(d||"");if(s&&(e.baseId=e.resolve.url(e.baseId,s)),n&&!e.async)throw Error("async schema in sync schema");i+=" var errs_"+u+" = errors;"}var h,b="valid"+u,g=!e.opts.allErrors,x="",S="",E=e.schema.type,k=Array.isArray(E);if(E&&e.opts.nullable&&!0===e.schema.nullable&&(k?-1==E.indexOf("null")&&(E=E.concat("null")):"null"!=E&&(E=[E,"null"],k=!0)),k&&1==E.length&&(E=E[0],k=!1),e.schema.$ref&&a)if("fail"==e.opts.extendRefs)throw Error('$ref: validation keywords used in schema at path "'+e.errSchemaPath+'" (see option extendRefs)');else!0!==e.opts.extendRefs&&(a=!1,e.logger.warn('$ref: keywords ignored in schema at path "'+e.errSchemaPath+'"'));if(e.schema.$comment&&e.opts.$comment&&(i+=" "+e.RULES.all.$comment.code(e,"$comment")),E){if(e.opts.coerceTypes)var A=e.util.coerceToTypes(e.opts.coerceTypes,E);var P=e.RULES.types[E];if(A||k||!0===P||P&&!ee(P)){var p=e.schemaPath+".type",m=e.errSchemaPath+"/type",p=e.schemaPath+".type",m=e.errSchemaPath+"/type",R=k?"checkDataTypes":"checkDataType";if(i+=" if ("+e.util[R](E,v,e.opts.strictNumbers,!0)+") { ",A){var I="dataType"+u,T="coerced"+u;i+=" var "+I+" = typeof "+v+"; var "+T+" = undefined; ","array"==e.opts.coerceTypes&&(i+=" if ("+I+" == 'object' && Array.isArray("+v+") && "+v+".length == 1) { "+v+" = "+v+"[0]; "+I+" = typeof "+v+"; if ("+e.util.checkDataType(e.schema.type,v,e.opts.strictNumbers)+") "+T+" = "+v+"; } "),i+=" if ("+T+" !== undefined) ; ";var j=A;if(j)for(var O,C=-1,N=j.length-1;C{var r=i9(),i=i3(),n=i5(),a=i8(),s=i7(),o=i.ucs2length,f=i1(),h=n.Validation;function u(e,t,r){var i=c.call(this,e,t,r);return i>=0?{index:i,compiling:!0}:(i=this._compilations.length,this._compilations[i]={schema:e,root:t,baseId:r},{index:i,compiling:!1})}function d(e,t,r){var i=c.call(this,e,t,r);i>=0&&this._compilations.splice(i,1)}function c(e,t,r){for(var i=0;i{var r=t.exports=function(){this._cache={}};r.prototype.put=function(e,t){this._cache[e]=t},r.prototype.get=function(e){return this._cache[e]},r.prototype.del=function(e){delete this._cache[e]},r.prototype.clear=function(){this._cache={}}}),nr=m((e,t)=>{var r=i3(),i=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,n=[0,31,28,31,30,31,30,31,31,30,31,30,31],a=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i,s=/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,o=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,f=/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,h=/^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i,u=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,d=/^(?:\/(?:[^~/]|~0|~1)*)*$/,c=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,p=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;function m(e){return e="full"==e?"full":"fast",r.copy(m[e])}function g(e){var t,r=e.match(i);if(!r)return!1;var a=+r[1],s=+r[2],o=+r[3];return s>=1&&s<=12&&o>=1&&o<=(2==s&&(t=a)%4==0&&(t%100!=0||t%400==0)?29:n[s])}function v(e,t){var r=e.match(a);if(!r)return!1;var i=r[1],n=r[2],s=r[3],o=r[5];return(i<=23&&n<=59&&s<=59||23==i&&59==n&&60==s)&&(!t||o)}t.exports=m,m.fast={date:/^\d\d\d\d-[0-1]\d-[0-3]\d$/,time:/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,"date-time":/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,"uri-template":f,url:h,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,hostname:s,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:_,uuid:u,"json-pointer":d,"json-pointer-uri-fragment":c,"relative-json-pointer":p},m.full={date:g,time:v,"date-time":function(e){var t=e.split(b);return 2==t.length&&g(t[0])&&v(t[1],!0)},uri:function(e){return y.test(e)&&o.test(e)},"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":f,url:h,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:s,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:_,uuid:u,"json-pointer":d,"json-pointer-uri-fragment":c,"relative-json-pointer":p};var b=/t|\s/i,y=/\/|:/,w=/[^\\]\\Z/;function _(e){if(w.test(e))return!1;try{return new RegExp(e),!0}catch(e){return!1}}}),ni=m((e,t)=>{t.exports=function(e,t,r){var i,n,a=" ",s=e.level,o=e.dataLevel,f=e.schema[t],h=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,d="data"+(o||""),c="valid"+s;if("#"==f||"#/"==f)e.isRoot?(i=e.async,n="validate"):(i=!0===e.root.schema.$async,n="root.refVal[0]");else{var p=e.resolveRef(e.baseId,f,e.isRoot);if(void 0===p){var m=e.MissingRefError.message(e.baseId,f);if("fail"==e.opts.missingRefs){e.logger.error(m);var g=g||[];(g.push(a),a="",!1!==e.createErrors)?(a+=" { keyword: '$ref' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(h)+" , params: { ref: '"+e.util.escapeQuotes(f)+"' } ",!1!==e.opts.messages&&(a+=" , message: 'can\\'t resolve reference "+e.util.escapeQuotes(f)+"' "),e.opts.verbose&&(a+=" , schema: "+e.util.toQuotedString(f)+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),a+=" } "):a+=" {} ";var v=a;(a=g.pop(),!e.compositeRule&&u)?e.async?a+=" throw new ValidationError(["+v+"]); ":a+=" validate.errors = ["+v+"]; return false; ":a+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",u&&(a+=" if (false) { ")}else if("ignore"==e.opts.missingRefs)e.logger.warn(m),u&&(a+=" if (true) { ");else throw new e.MissingRefError(e.baseId,f,m)}else if(p.inline){var b=e.util.copy(e);b.level++;var y="valid"+b.level;b.schema=p.schema,b.schemaPath="",b.errSchemaPath=f,a+=" "+e.validate(b).replace(/validate\.schema/g,p.code)+" ",u&&(a+=" if ("+y+") { ")}else i=!0===p.$async||e.async&&!1!==p.$async,n=p.code}if(n){var g=g||[];(g.push(a),a="",e.opts.passContext)?a+=" "+n+".call(this, ":a+=" "+n+"( ",a+=" "+d+", (dataPath || '')",'""'!=e.errorPath&&(a+=" + "+e.errorPath);var w=o?e.dataPathArr[o]:"parentDataProperty",_=a+=" , "+(o?"data"+(o-1||""):"parentData")+" , "+w+", rootData) ";if(a=g.pop(),i){if(!e.async)throw Error("async schema referenced by sync schema");u&&(a+=" var "+c+"; "),a+=" try { await "+_+"; ",u&&(a+=" "+c+" = true; "),a+=" } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; ",u&&(a+=" "+c+" = false; "),a+=" } ",u&&(a+=" if ("+c+") { ")}else a+=" if (!"+_+") { if (vErrors === null) vErrors = "+n+".errors; else vErrors = vErrors.concat("+n+".errors); errors = vErrors.length; } ",u&&(a+=" else { ")}return a}}),nn=m((e,t)=>{t.exports=function(e,t,r){var i=" ",n=e.schema[t],a=e.schemaPath+e.util.getProperty(t),s=e.errSchemaPath+"/"+t,o=!e.opts.allErrors,f=e.util.copy(e),h="";f.level++;var u="valid"+f.level,d=f.baseId,c=!0;if(n)for(var p,m=-1,g=n.length-1;m0||!1===p:e.util.schemaHasRules(p,e.RULES.all))&&(c=!1,f.schema=p,f.schemaPath=a+"["+m+"]",f.errSchemaPath=s+"/"+m,i+=" "+e.validate(f)+" ",f.baseId=d,o)&&(i+=" if ("+u+") { ",h+="}");return o&&(c?i+=" if (true) { ":i+=" "+h.slice(0,-1)+" "),i}}),na=m((e,t)=>{t.exports=function(e,t,r){var i=" ",n=e.level,a=e.dataLevel,s=e.schema[t],o=e.schemaPath+e.util.getProperty(t),f=e.errSchemaPath+"/"+t,h=!e.opts.allErrors,u="valid"+n,d="errs__"+n,c=e.util.copy(e),p="";c.level++;var m="valid"+c.level;if(s.every(function(t){return e.opts.strictKeywords?"object"==typeof t&&Object.keys(t).length>0||!1===t:e.util.schemaHasRules(t,e.RULES.all)})){var g=c.baseId;i+=" var "+d+" = errors; var "+u+" = false; ";var v=e.compositeRule;if(e.compositeRule=c.compositeRule=!0,s)for(var b=-1,y=s.length-1;b{t.exports=function(e,t,r){var i=" ",n=e.schema[t],a=e.errSchemaPath+"/"+t,s=(e.opts.allErrors,e.util.toQuotedString(n));return!0===e.opts.$comment?i+=" console.log("+s+");":"function"==typeof e.opts.$comment&&(i+=" self._opts.$comment("+s+", "+e.util.toQuotedString(a)+", validate.root.schema);"),i}}),no=m((e,t)=>{t.exports=function(e,t,r){var i=" ",n=e.level,a=e.dataLevel,s=e.schema[t],o=e.schemaPath+e.util.getProperty(t),f=e.errSchemaPath+"/"+t,h=!e.opts.allErrors,u="data"+(a||""),d="valid"+n,c=e.opts.$data&&s&&s.$data;c&&(i+=" var schema"+n+" = "+e.util.getData(s.$data,a,e.dataPathArr)+"; "),c||(i+=" var schema"+n+" = validate.schema"+o+";"),i+="var "+d+" = equal("+u+", schema"+n+"); if (!"+d+") { ";var p=p||[];(p.push(i),i="",!1!==e.createErrors)?(i+=" { keyword: 'const' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { allowedValue: schema"+n+" } ",!1!==e.opts.messages&&(i+=" , message: 'should be equal to constant' "),e.opts.verbose&&(i+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),i+=" } "):i+=" {} ";var m=i;return(i=p.pop(),!e.compositeRule&&h)?e.async?i+=" throw new ValidationError(["+m+"]); ":i+=" validate.errors = ["+m+"]; return false; ":i+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" }",h&&(i+=" else { "),i}}),nf=m((e,t)=>{t.exports=function(e,t,r){var i=" ",n=e.level,a=e.dataLevel,s=e.schema[t],o=e.schemaPath+e.util.getProperty(t),f=e.errSchemaPath+"/"+t,h=!e.opts.allErrors,u="data"+(a||""),d="errs__"+n,c=e.util.copy(e);c.level++;var p="valid"+c.level,m="i"+n,g=c.dataLevel=e.dataLevel+1,v="data"+g,b=e.baseId,y=e.opts.strictKeywords?"object"==typeof s&&Object.keys(s).length>0||!1===s:e.util.schemaHasRules(s,e.RULES.all);if(i+="var "+d+" = errors;var valid"+n+";",y){var w=e.compositeRule;e.compositeRule=c.compositeRule=!0,c.schema=s,c.schemaPath=o,c.errSchemaPath=f,i+=" var "+p+" = false; for (var "+m+" = 0; "+m+" < "+u+".length; "+m+"++) { ",c.errorPath=e.util.getPathExpr(e.errorPath,m,e.opts.jsonPointers,!0);var _=u+"["+m+"]";c.dataPathArr[g]=m;var M=e.validate(c);(c.baseId=b,2>e.util.varOccurences(M,v))?i+=" "+e.util.varReplace(M,v,_)+" ":i+=" var "+v+" = "+_+"; "+M+" ",i+=" if ("+p+") break; } ",e.compositeRule=c.compositeRule=w,i+=" if (!"+p+") {"}else i+=" if ("+u+".length == 0) {";var x=x||[];(x.push(i),i="",!1!==e.createErrors)?(i+=" { keyword: 'contains' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: {} ",!1!==e.opts.messages&&(i+=" , message: 'should contain a valid item' "),e.opts.verbose&&(i+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),i+=" } "):i+=" {} ";var S=i;return(i=x.pop(),!e.compositeRule&&h)?e.async?i+=" throw new ValidationError(["+S+"]); ":i+=" validate.errors = ["+S+"]; return false; ":i+=" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } else { ",y&&(i+=" errors = "+d+"; if (vErrors !== null) { if ("+d+") vErrors.length = "+d+"; else vErrors = null; } "),e.opts.allErrors&&(i+=" } "),i}}),nh=m((e,t)=>{t.exports=function(e,t,r){var i=" ",n=e.level,a=e.dataLevel,s=e.schema[t],o=e.schemaPath+e.util.getProperty(t),f=e.errSchemaPath+"/"+t,h=!e.opts.allErrors,u="data"+(a||""),d="errs__"+n,c=e.util.copy(e),p="";c.level++;var m="valid"+c.level,g={},v={},b=e.opts.ownProperties;for(M in s)if("__proto__"!=M){var y=s[M],w=Array.isArray(y)?v:g;w[M]=y}i+="var "+d+" = errors;";var _=e.errorPath;for(var M in i+="var missing"+n+";",v)if((w=v[M]).length){if(i+=" if ( "+u+e.util.getProperty(M)+" !== undefined ",b&&(i+=" && Object.prototype.hasOwnProperty.call("+u+", '"+e.util.escapeQuotes(M)+"') "),h){i+=" && ( ";var x=w;if(x)for(var S,E=-1,k=x.length-1;E0||!1===y:e.util.schemaHasRules(y,e.RULES.all))&&(i+=" "+m+" = true; if ( "+u+e.util.getProperty(M)+" !== undefined ",b&&(i+=" && Object.prototype.hasOwnProperty.call("+u+", '"+e.util.escapeQuotes(M)+"') "),i+=") { ",c.schema=y,c.schemaPath=o+e.util.getProperty(M),c.errSchemaPath=f+"/"+e.util.escapeFragment(M),i+=" "+e.validate(c)+" ",c.baseId=D,i+=" } ",h&&(i+=" if ("+m+") { ",p+="}"))}return h&&(i+=" "+p+" if ("+d+" == errors) {"),i}}),nu=m((e,t)=>{t.exports=function(e,t,r){var i=" ",n=e.level,a=e.dataLevel,s=e.schema[t],o=e.schemaPath+e.util.getProperty(t),f=e.errSchemaPath+"/"+t,h=!e.opts.allErrors,u="data"+(a||""),d="valid"+n,c=e.opts.$data&&s&&s.$data;c&&(i+=" var schema"+n+" = "+e.util.getData(s.$data,a,e.dataPathArr)+"; ");var p="i"+n,m="schema"+n;c||(i+=" var "+m+" = validate.schema"+o+";"),i+="var "+d+";",c&&(i+=" if (schema"+n+" === undefined) "+d+" = true; else if (!Array.isArray(schema"+n+")) "+d+" = false; else {"),i+=""+d+" = false;for (var "+p+"=0; "+p+"<"+m+".length; "+p+"++) if (equal("+u+", "+m+"["+p+"])) { "+d+" = true; break; }",c&&(i+=" } "),i+=" if (!"+d+") { ";var g=g||[];(g.push(i),i="",!1!==e.createErrors)?(i+=" { keyword: 'enum' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { allowedValues: schema"+n+" } ",!1!==e.opts.messages&&(i+=" , message: 'should be equal to one of the allowed values' "),e.opts.verbose&&(i+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),i+=" } "):i+=" {} ";var v=i;return(i=g.pop(),!e.compositeRule&&h)?e.async?i+=" throw new ValidationError(["+v+"]); ":i+=" validate.errors = ["+v+"]; return false; ":i+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" }",h&&(i+=" else { "),i}}),nl=m((e,t)=>{t.exports=function(e,t,r){var i=" ",n=e.level,a=e.dataLevel,s=e.schema[t],o=e.schemaPath+e.util.getProperty(t),f=e.errSchemaPath+"/"+t,h=!e.opts.allErrors,u="data"+(a||"");if(!1===e.opts.format)return h&&(i+=" if (true) { "),i;var d,c=e.opts.$data&&s&&s.$data;c?(i+=" var schema"+n+" = "+e.util.getData(s.$data,a,e.dataPathArr)+"; ",d="schema"+n):d=s;var p=e.opts.unknownFormats,m=Array.isArray(p);if(c){var g="format"+n,v="isObject"+n,b="formatType"+n;i+=" var "+g+" = formats["+d+"]; var "+v+" = typeof "+g+" == 'object' && !("+g+" instanceof RegExp) && "+g+".validate; var "+b+" = "+v+" && "+g+".type || 'string'; if ("+v+") { ",e.async&&(i+=" var async"+n+" = "+g+".async; "),i+=" "+g+" = "+g+".validate; } if ( ",c&&(i+=" ("+d+" !== undefined && typeof "+d+" != 'string') || "),i+=" (","ignore"!=p&&(i+=" ("+d+" && !"+g+" ",m&&(i+=" && self._opts.unknownFormats.indexOf("+d+") == -1 "),i+=") || "),(i+=" ("+g+" && "+b+" == '"+r+"' && !(typeof "+g+" == 'function' ? ",e.async)?i+=" (async"+n+" ? await "+g+"("+u+") : "+g+"("+u+")) ":i+=" "+g+"("+u+") ",i+=" : "+g+".test("+u+"))))) {"}else{var g=e.formats[s];if(!g)if("ignore"==p)return e.logger.warn('unknown format "'+s+'" ignored in schema at path "'+e.errSchemaPath+'"'),h&&(i+=" if (true) { "),i;else if(m&&p.indexOf(s)>=0)return h&&(i+=" if (true) { "),i;else throw Error('unknown format "'+s+'" is used in schema at path "'+e.errSchemaPath+'"');var v="object"==typeof g&&!(g instanceof RegExp)&&g.validate,b=v&&g.type||"string";if(v){var y=!0===g.async;g=g.validate}if(b!=r)return h&&(i+=" if (true) { "),i;if(y){if(!e.async)throw Error("async format in sync schema");var w="formats"+e.util.getProperty(s)+".validate";i+=" if (!(await "+w+"("+u+"))) { "}else{i+=" if (! ";var w="formats"+e.util.getProperty(s);v&&(w+=".validate"),"function"==typeof g?i+=" "+w+"("+u+") ":i+=" "+w+".test("+u+") ",i+=") { "}}var _=_||[];(_.push(i),i="",!1!==e.createErrors)?((i+=" { keyword: 'format' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { format: ",c)?i+=""+d:i+=""+e.util.toQuotedString(s),i+=" } ",!1!==e.opts.messages&&((i+=" , message: 'should match format \"",c)?i+="' + "+d+" + '":i+=""+e.util.escapeQuotes(s),i+="\"' "),e.opts.verbose&&((i+=" , schema: ",c)?i+="validate.schema"+o:i+=""+e.util.toQuotedString(s),i+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),i+=" } "):i+=" {} ";var M=i;return(i=_.pop(),!e.compositeRule&&h)?e.async?i+=" throw new ValidationError(["+M+"]); ":i+=" validate.errors = ["+M+"]; return false; ":i+=" var err = "+M+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } ",h&&(i+=" else { "),i}}),nd=m((e,t)=>{t.exports=function(e,t,r){var i=" ",n=e.level,a=e.dataLevel,s=e.schema[t],o=e.schemaPath+e.util.getProperty(t),f=e.errSchemaPath+"/"+t,h=!e.opts.allErrors,u="valid"+n,d="errs__"+n,c=e.util.copy(e);c.level++;var p="valid"+c.level,m=e.schema.then,g=e.schema.else,v=void 0!==m&&(e.opts.strictKeywords?"object"==typeof m&&Object.keys(m).length>0||!1===m:e.util.schemaHasRules(m,e.RULES.all)),b=void 0!==g&&(e.opts.strictKeywords?"object"==typeof g&&Object.keys(g).length>0||!1===g:e.util.schemaHasRules(g,e.RULES.all)),y=c.baseId;if(v||b){c.createErrors=!1,c.schema=s,c.schemaPath=o,c.errSchemaPath=f,i+=" var "+d+" = errors; var "+u+" = true; ";var w,_=e.compositeRule;(e.compositeRule=c.compositeRule=!0,i+=" "+e.validate(c)+" ",c.baseId=y,c.createErrors=!0,i+=" errors = "+d+"; if (vErrors !== null) { if ("+d+") vErrors.length = "+d+"; else vErrors = null; } ",e.compositeRule=c.compositeRule=_,v)?((i+=" if ("+p+") { ",c.schema=e.schema.then,c.schemaPath=e.schemaPath+".then",c.errSchemaPath=e.errSchemaPath+"/then",i+=" "+e.validate(c)+" ",c.baseId=y,i+=" "+u+" = "+p+"; ",v&&b)?i+=" var "+(w="ifClause"+n)+" = 'then'; ":w="'then'",i+=" } ",b&&(i+=" else { ")):i+=" if (!"+p+") { ",b&&((c.schema=e.schema.else,c.schemaPath=e.schemaPath+".else",c.errSchemaPath=e.errSchemaPath+"/else",i+=" "+e.validate(c)+" ",c.baseId=y,i+=" "+u+" = "+p+"; ",v&&b)?i+=" var "+(w="ifClause"+n)+" = 'else'; ":w="'else'",i+=" } "),(i+=" if (!"+u+") { var err = ",!1!==e.createErrors)?(i+=" { keyword: 'if' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { failingKeyword: "+w+" } ",!1!==e.opts.messages&&(i+=" , message: 'should match \"' + "+w+" + '\" schema' "),e.opts.verbose&&(i+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: data"+(a||"")+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&h&&(e.async?i+=" throw new ValidationError(vErrors); ":i+=" validate.errors = vErrors; return false; "),i+=" } ",h&&(i+=" else { ")}else h&&(i+=" if (true) { ");return i}}),nc=m((e,t)=>{t.exports=function(e,t,r){var i=" ",n=e.level,a=e.dataLevel,s=e.schema[t],o=e.schemaPath+e.util.getProperty(t),f=e.errSchemaPath+"/"+t,h=!e.opts.allErrors,u="data"+(a||""),d="valid"+n,c="errs__"+n,p=e.util.copy(e),m="";p.level++;var g="valid"+p.level,v="i"+n,b=p.dataLevel=e.dataLevel+1,y="data"+b,w=e.baseId;if(i+="var "+c+" = errors;var "+d+";",Array.isArray(s)){var _=e.schema.additionalItems;if(!1===_){i+=" "+d+" = "+u+".length <= "+s.length+"; ";var M=f;f=e.errSchemaPath+"/additionalItems",i+=" if (!"+d+") { ";var x=x||[];(x.push(i),i="",!1!==e.createErrors)?(i+=" { keyword: 'additionalItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { limit: "+s.length+" } ",!1!==e.opts.messages&&(i+=" , message: 'should NOT have more than "+s.length+" items' "),e.opts.verbose&&(i+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),i+=" } "):i+=" {} ";var S=i;(i=x.pop(),!e.compositeRule&&h)?e.async?i+=" throw new ValidationError(["+S+"]); ":i+=" validate.errors = ["+S+"]; return false; ":i+=" var err = "+S+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } ",f=M,h&&(m+="}",i+=" else { ")}if(s){for(var E,k=-1,A=s.length-1;k0||!1===E:e.util.schemaHasRules(E,e.RULES.all)){i+=" "+g+" = true; if ("+u+".length > "+k+") { ";var P=u+"["+k+"]";p.schema=E,p.schemaPath=o+"["+k+"]",p.errSchemaPath=f+"/"+k,p.errorPath=e.util.getPathExpr(e.errorPath,k,e.opts.jsonPointers,!0),p.dataPathArr[b]=k;var R=e.validate(p);(p.baseId=w,2>e.util.varOccurences(R,y))?i+=" "+e.util.varReplace(R,y,P)+" ":i+=" var "+y+" = "+P+"; "+R+" ",i+=" } ",h&&(i+=" if ("+g+") { ",m+="}")}}if("object"==typeof _&&(e.opts.strictKeywords?"object"==typeof _&&Object.keys(_).length>0||!1===_:e.util.schemaHasRules(_,e.RULES.all))){p.schema=_,p.schemaPath=e.schemaPath+".additionalItems",p.errSchemaPath=e.errSchemaPath+"/additionalItems",i+=" "+g+" = true; if ("+u+".length > "+s.length+") { for (var "+v+" = "+s.length+"; "+v+" < "+u+".length; "+v+"++) { ",p.errorPath=e.util.getPathExpr(e.errorPath,v,e.opts.jsonPointers,!0);var P=u+"["+v+"]";p.dataPathArr[b]=v;var R=e.validate(p);(p.baseId=w,2>e.util.varOccurences(R,y))?i+=" "+e.util.varReplace(R,y,P)+" ":i+=" var "+y+" = "+P+"; "+R+" ",h&&(i+=" if (!"+g+") break; "),i+=" } } ",h&&(i+=" if ("+g+") { ",m+="}")}}else if(e.opts.strictKeywords?"object"==typeof s&&Object.keys(s).length>0||!1===s:e.util.schemaHasRules(s,e.RULES.all)){p.schema=s,p.schemaPath=o,p.errSchemaPath=f,i+=" for (var "+v+" = 0; "+v+" < "+u+".length; "+v+"++) { ",p.errorPath=e.util.getPathExpr(e.errorPath,v,e.opts.jsonPointers,!0);var P=u+"["+v+"]";p.dataPathArr[b]=v;var R=e.validate(p);(p.baseId=w,2>e.util.varOccurences(R,y))?i+=" "+e.util.varReplace(R,y,P)+" ":i+=" var "+y+" = "+P+"; "+R+" ",h&&(i+=" if (!"+g+") break; "),i+=" }"}return h&&(i+=" "+m+" if ("+c+" == errors) {"),i}}),np=m((e,t)=>{t.exports=function(e,t,r){var i,n,a=" ",s=e.level,o=e.dataLevel,f=e.schema[t],h=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,d=!e.opts.allErrors,c="data"+(o||""),p=e.opts.$data&&f&&f.$data;p?(a+=" var schema"+s+" = "+e.util.getData(f.$data,o,e.dataPathArr)+"; ",n="schema"+s):n=f;var m="maximum"==t,g=m?"exclusiveMaximum":"exclusiveMinimum",v=e.schema[g],b=e.opts.$data&&v&&v.$data,y=m?"<":">",w=m?">":"<",i=void 0;if(!(p||"number"==typeof f||void 0===f))throw Error(t+" must be number");if(!(b||void 0===v||"number"==typeof v||"boolean"==typeof v))throw Error(g+" must be number or boolean");if(b){var _=e.util.getData(v.$data,o,e.dataPathArr),M="exclusive"+s,x="exclType"+s,S="exclIsNumber"+s,E="op"+s,k="' + "+E+" + '";a+=" var schemaExcl"+s+" = "+_+"; ",a+=" var "+M+"; var "+x+" = typeof "+(_="schemaExcl"+s)+"; if ("+x+" != 'boolean' && "+x+" != 'undefined' && "+x+" != 'number') { ";var i=g,A=A||[];(A.push(a),a="",!1!==e.createErrors)?(a+=" { keyword: '"+(i||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: {} ",!1!==e.opts.messages&&(a+=" , message: '"+g+" should be boolean' "),e.opts.verbose&&(a+=" , schema: validate.schema"+h+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ";var P=a;(a=A.pop(),!e.compositeRule&&d)?e.async?a+=" throw new ValidationError(["+P+"]); ":a+=" validate.errors = ["+P+"]; return false; ":a+=" var err = "+P+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } else if ( ",p&&(a+=" ("+n+" !== undefined && typeof "+n+" != 'number') || "),a+=" "+x+" == 'number' ? ( ("+M+" = "+n+" === undefined || "+_+" "+y+"= "+n+") ? "+c+" "+w+"= "+_+" : "+c+" "+w+" "+n+" ) : ( ("+M+" = "+_+" === true) ? "+c+" "+w+"= "+n+" : "+c+" "+w+" "+n+" ) || "+c+" !== "+c+") { var op"+s+" = "+M+" ? '"+y+"' : '"+y+"='; ",void 0===f&&(i=g,u=e.errSchemaPath+"/"+g,n=_,p=b)}else{var S="number"==typeof v,k=y;if(S&&p){var E="'"+k+"'";a+=" if ( ",p&&(a+=" ("+n+" !== undefined && typeof "+n+" != 'number') || "),a+=" ( "+n+" === undefined || "+v+" "+y+"= "+n+" ? "+c+" "+w+"= "+v+" : "+c+" "+w+" "+n+" ) || "+c+" !== "+c+") { "}else{S&&void 0===f?(M=!0,i=g,u=e.errSchemaPath+"/"+g,n=v,w+="="):(S&&(n=Math[m?"min":"max"](v,f)),v===(!S||n)?(M=!0,i=g,u=e.errSchemaPath+"/"+g,w+="="):(M=!1,k+="="));var E="'"+k+"'";a+=" if ( ",p&&(a+=" ("+n+" !== undefined && typeof "+n+" != 'number') || "),a+=" "+c+" "+w+" "+n+" || "+c+" !== "+c+") { "}}i=i||t;var A=A||[];(A.push(a),a="",!1!==e.createErrors)?(a+=" { keyword: '"+(i||"_limit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { comparison: "+E+", limit: "+n+", exclusive: "+M+" } ",!1!==e.opts.messages&&((a+=" , message: 'should be "+k+" ",p)?a+="' + "+n:a+=""+n+"'"),e.opts.verbose&&((a+=" , schema: ",p)?a+="validate.schema"+h:a+=""+f,a+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ";var P=a;return(a=A.pop(),!e.compositeRule&&d)?e.async?a+=" throw new ValidationError(["+P+"]); ":a+=" validate.errors = ["+P+"]; return false; ":a+=" var err = "+P+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+=" } ",d&&(a+=" else { "),a}}),nm=m((e,t)=>{t.exports=function(e,t,r){var i,n,a=" ",s=e.level,o=e.dataLevel,f=e.schema[t],h=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,d=!e.opts.allErrors,c="data"+(o||""),p=e.opts.$data&&f&&f.$data;if(p?(a+=" var schema"+s+" = "+e.util.getData(f.$data,o,e.dataPathArr)+"; ",n="schema"+s):n=f,!(p||"number"==typeof f))throw Error(t+" must be number");var m="maxItems"==t?">":"<";a+="if ( ",p&&(a+=" ("+n+" !== undefined && typeof "+n+" != 'number') || "),a+=" "+c+".length "+m+" "+n+") { ";var i=t,g=g||[];(g.push(a),a="",!1!==e.createErrors)?(a+=" { keyword: '"+(i||"_limitItems")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+n+" } ",!1!==e.opts.messages&&((a+=" , message: 'should NOT have ","maxItems"==t)?a+="more":a+="fewer",(a+=" than ",p)?a+="' + "+n+" + '":a+=""+f,a+=" items' "),e.opts.verbose&&((a+=" , schema: ",p)?a+="validate.schema"+h:a+=""+f,a+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ";var v=a;return(a=g.pop(),!e.compositeRule&&d)?e.async?a+=" throw new ValidationError(["+v+"]); ":a+=" validate.errors = ["+v+"]; return false; ":a+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+="} ",d&&(a+=" else { "),a}}),ng=m((e,t)=>{t.exports=function(e,t,r){var i,n,a=" ",s=e.level,o=e.dataLevel,f=e.schema[t],h=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,d=!e.opts.allErrors,c="data"+(o||""),p=e.opts.$data&&f&&f.$data;if(p?(a+=" var schema"+s+" = "+e.util.getData(f.$data,o,e.dataPathArr)+"; ",n="schema"+s):n=f,!(p||"number"==typeof f))throw Error(t+" must be number");var m="maxLength"==t?">":"<";a+="if ( ",p&&(a+=" ("+n+" !== undefined && typeof "+n+" != 'number') || "),!1===e.opts.unicode?a+=" "+c+".length ":a+=" ucs2length("+c+") ",a+=" "+m+" "+n+") { ";var i=t,g=g||[];(g.push(a),a="",!1!==e.createErrors)?(a+=" { keyword: '"+(i||"_limitLength")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+n+" } ",!1!==e.opts.messages&&((a+=" , message: 'should NOT be ","maxLength"==t)?a+="longer":a+="shorter",(a+=" than ",p)?a+="' + "+n+" + '":a+=""+f,a+=" characters' "),e.opts.verbose&&((a+=" , schema: ",p)?a+="validate.schema"+h:a+=""+f,a+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ";var v=a;return(a=g.pop(),!e.compositeRule&&d)?e.async?a+=" throw new ValidationError(["+v+"]); ":a+=" validate.errors = ["+v+"]; return false; ":a+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+="} ",d&&(a+=" else { "),a}}),nv=m((e,t)=>{t.exports=function(e,t,r){var i,n,a=" ",s=e.level,o=e.dataLevel,f=e.schema[t],h=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,d=!e.opts.allErrors,c="data"+(o||""),p=e.opts.$data&&f&&f.$data;if(p?(a+=" var schema"+s+" = "+e.util.getData(f.$data,o,e.dataPathArr)+"; ",n="schema"+s):n=f,!(p||"number"==typeof f))throw Error(t+" must be number");var m="maxProperties"==t?">":"<";a+="if ( ",p&&(a+=" ("+n+" !== undefined && typeof "+n+" != 'number') || "),a+=" Object.keys("+c+").length "+m+" "+n+") { ";var i=t,g=g||[];(g.push(a),a="",!1!==e.createErrors)?(a+=" { keyword: '"+(i||"_limitProperties")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+n+" } ",!1!==e.opts.messages&&((a+=" , message: 'should NOT have ","maxProperties"==t)?a+="more":a+="fewer",(a+=" than ",p)?a+="' + "+n+" + '":a+=""+f,a+=" properties' "),e.opts.verbose&&((a+=" , schema: ",p)?a+="validate.schema"+h:a+=""+f,a+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ";var v=a;return(a=g.pop(),!e.compositeRule&&d)?e.async?a+=" throw new ValidationError(["+v+"]); ":a+=" validate.errors = ["+v+"]; return false; ":a+=" var err = "+v+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",a+="} ",d&&(a+=" else { "),a}}),nb=m((e,t)=>{t.exports=function(e,t,r){var i,n=" ",a=e.level,s=e.dataLevel,o=e.schema[t],f=e.schemaPath+e.util.getProperty(t),h=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,d="data"+(s||""),c=e.opts.$data&&o&&o.$data;if(c?(n+=" var schema"+a+" = "+e.util.getData(o.$data,s,e.dataPathArr)+"; ",i="schema"+a):i=o,!(c||"number"==typeof o))throw Error(t+" must be number");n+="var division"+a+";if (",c&&(n+=" "+i+" !== undefined && ( typeof "+i+" != 'number' || "),(n+=" (division"+a+" = "+d+" / "+i+", ",e.opts.multipleOfPrecision)?n+=" Math.abs(Math.round(division"+a+") - division"+a+") > 1e-"+e.opts.multipleOfPrecision+" ":n+=" division"+a+" !== parseInt(division"+a+") ",n+=" ) ",c&&(n+=" ) "),n+=" ) { ";var p=p||[];(p.push(n),n="",!1!==e.createErrors)?(n+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(h)+" , params: { multipleOf: "+i+" } ",!1!==e.opts.messages&&((n+=" , message: 'should be multiple of ",c)?n+="' + "+i:n+=""+i+"'"),e.opts.verbose&&((n+=" , schema: ",c)?n+="validate.schema"+f:n+=""+o,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),n+=" } "):n+=" {} ";var m=n;return(n=p.pop(),!e.compositeRule&&u)?e.async?n+=" throw new ValidationError(["+m+"]); ":n+=" validate.errors = ["+m+"]; return false; ":n+=" var err = "+m+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",u&&(n+=" else { "),n}}),ny=m((e,t)=>{t.exports=function(e,t,r){var i=" ",n=e.level,a=e.dataLevel,s=e.schema[t],o=e.schemaPath+e.util.getProperty(t),f=e.errSchemaPath+"/"+t,h=!e.opts.allErrors,u="data"+(a||""),d="errs__"+n,c=e.util.copy(e);c.level++;var p="valid"+c.level;if(e.opts.strictKeywords?"object"==typeof s&&Object.keys(s).length>0||!1===s:e.util.schemaHasRules(s,e.RULES.all)){c.schema=s,c.schemaPath=o,c.errSchemaPath=f,i+=" var "+d+" = errors; ";var m,g=e.compositeRule;e.compositeRule=c.compositeRule=!0,c.createErrors=!1,c.opts.allErrors&&(m=c.opts.allErrors,c.opts.allErrors=!1),i+=" "+e.validate(c)+" ",c.createErrors=!0,m&&(c.opts.allErrors=m),e.compositeRule=c.compositeRule=g,i+=" if ("+p+") { ";var v=v||[];(v.push(i),i="",!1!==e.createErrors)?(i+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: {} ",!1!==e.opts.messages&&(i+=" , message: 'should NOT be valid' "),e.opts.verbose&&(i+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),i+=" } "):i+=" {} ";var b=i;(i=v.pop(),!e.compositeRule&&h)?e.async?i+=" throw new ValidationError(["+b+"]); ":i+=" validate.errors = ["+b+"]; return false; ":i+=" var err = "+b+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } else { errors = "+d+"; if (vErrors !== null) { if ("+d+") vErrors.length = "+d+"; else vErrors = null; } ",e.opts.allErrors&&(i+=" } ")}else(i+=" var err = ",!1!==e.createErrors)?(i+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: {} ",!1!==e.opts.messages&&(i+=" , message: 'should NOT be valid' "),e.opts.verbose&&(i+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",h&&(i+=" if (false) { ");return i}}),nw=m((e,t)=>{t.exports=function(e,t,r){var i=" ",n=e.level,a=e.dataLevel,s=e.schema[t],o=e.schemaPath+e.util.getProperty(t),f=e.errSchemaPath+"/"+t,h=!e.opts.allErrors,u="valid"+n,d="errs__"+n,c=e.util.copy(e),p="";c.level++;var m="valid"+c.level,g=c.baseId,v="prevValid"+n,b="passingSchemas"+n;i+="var "+d+" = errors , "+v+" = false , "+u+" = false , "+b+" = null; ";var y=e.compositeRule;if(e.compositeRule=c.compositeRule=!0,s)for(var w,_=-1,M=s.length-1;_0||!1===w:e.util.schemaHasRules(w,e.RULES.all))?(c.schema=w,c.schemaPath=o+"["+_+"]",c.errSchemaPath=f+"/"+_,i+=" "+e.validate(c)+" ",c.baseId=g):i+=" var "+m+" = true; ",_&&(i+=" if ("+m+" && "+v+") { "+u+" = false; "+b+" = ["+b+", "+_+"]; } else { ",p+="}"),i+=" if ("+m+") { "+u+" = "+v+" = true; "+b+" = "+_+"; }";return(e.compositeRule=c.compositeRule=y,i+=""+p+"if (!"+u+") { var err = ",!1!==e.createErrors)?(i+=" { keyword: 'oneOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { passingSchemas: "+b+" } ",!1!==e.opts.messages&&(i+=" , message: 'should match exactly one schema in oneOf' "),e.opts.verbose&&(i+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: data"+(a||"")+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&h&&(e.async?i+=" throw new ValidationError(vErrors); ":i+=" validate.errors = vErrors; return false; "),i+="} else { errors = "+d+"; if (vErrors !== null) { if ("+d+") vErrors.length = "+d+"; else vErrors = null; }",e.opts.allErrors&&(i+=" } "),i}}),n_=m((e,t)=>{t.exports=function(e,t,r){var i,n=" ",a=e.level,s=e.dataLevel,o=e.schema[t],f=e.schemaPath+e.util.getProperty(t),h=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,d="data"+(s||""),c=e.opts.$data&&o&&o.$data;c?(n+=" var schema"+a+" = "+e.util.getData(o.$data,s,e.dataPathArr)+"; ",i="schema"+a):i=o;var p=c?"(new RegExp("+i+"))":e.usePattern(o);n+="if ( ",c&&(n+=" ("+i+" !== undefined && typeof "+i+" != 'string') || "),n+=" !"+p+".test("+d+") ) { ";var m=m||[];(m.push(n),n="",!1!==e.createErrors)?((n+=" { keyword: 'pattern' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(h)+" , params: { pattern: ",c)?n+=""+i:n+=""+e.util.toQuotedString(o),n+=" } ",!1!==e.opts.messages&&((n+=" , message: 'should match pattern \"",c)?n+="' + "+i+" + '":n+=""+e.util.escapeQuotes(o),n+="\"' "),e.opts.verbose&&((n+=" , schema: ",c)?n+="validate.schema"+f:n+=""+e.util.toQuotedString(o),n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),n+=" } "):n+=" {} ";var g=n;return(n=m.pop(),!e.compositeRule&&u)?e.async?n+=" throw new ValidationError(["+g+"]); ":n+=" validate.errors = ["+g+"]; return false; ":n+=" var err = "+g+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+="} ",u&&(n+=" else { "),n}}),nM=m((e,t)=>{t.exports=function(e,t,r){var i=" ",n=e.level,a=e.dataLevel,s=e.schema[t],o=e.schemaPath+e.util.getProperty(t),f=e.errSchemaPath+"/"+t,h=!e.opts.allErrors,u="data"+(a||""),d="errs__"+n,c=e.util.copy(e),p="";c.level++;var m="valid"+c.level,g="key"+n,v="idx"+n,b=c.dataLevel=e.dataLevel+1,y="data"+b,w="dataProperties"+n,_=Object.keys(s||{}).filter(O),M=e.schema.patternProperties||{},x=Object.keys(M).filter(O),S=e.schema.additionalProperties,E=_.length||x.length,k=!1===S,A="object"==typeof S&&Object.keys(S).length,P=e.opts.removeAdditional,R=e.opts.ownProperties,I=e.baseId,T=e.schema.required;if(T&&!(e.opts.$data&&T.$data)&&T.length8)i+=" || validate.schema"+o+".hasOwnProperty("+g+") ";else if(_)for(var C,N=-1,D=_.length-1;Ne.util.varOccurences(W,y))?i+=" "+e.util.varReplace(W,y,V)+" ":i+=" var "+y+" = "+V+"; "+W+" ",i+=" if (!"+m+") { errors = "+d+"; if (validate.errors !== null) { if (errors) validate.errors.length = errors; else validate.errors = null; } delete "+u+"["+g+"]; } ",e.compositeRule=c.compositeRule=H}else{c.schema=S,c.schemaPath=e.schemaPath+".additionalProperties",c.errSchemaPath=e.errSchemaPath+"/additionalProperties",c.errorPath=e.opts._errorDataPathProperty?e.errorPath:e.util.getPathExpr(e.errorPath,g,e.opts.jsonPointers);var V=u+"["+g+"]";c.dataPathArr[b]=g;var W=e.validate(c);(c.baseId=I,2>e.util.varOccurences(W,y))?i+=" "+e.util.varReplace(W,y,V)+" ":i+=" var "+y+" = "+V+"; "+W+" ",h&&(i+=" if (!"+m+") break; ")}e.errorPath=B}E&&(i+=" } "),i+=" } ",h&&(i+=" if ("+m+") { ",p+="}")}var K=e.opts.useDefaults&&!e.compositeRule;if(_.length&&_)for(var C,Q=-1,G=_.length-1;Q0||!1===J:e.util.schemaHasRules(J,e.RULES.all)){var Y=e.util.getProperty(C),V=u+Y,X=K&&void 0!==J.default;c.schema=J,c.schemaPath=o+Y,c.errSchemaPath=f+"/"+e.util.escapeFragment(C),c.errorPath=e.util.getPath(e.errorPath,C,e.opts.jsonPointers),c.dataPathArr[b]=e.util.toQuotedString(C);var W=e.validate(c);if(c.baseId=I,2>e.util.varOccurences(W,y)){W=e.util.varReplace(W,y,V);var ee=V}else{var ee=y;i+=" var "+y+" = "+V+"; "}if(X)i+=" "+W+" ";else{if(j&&j[C]){i+=" if ( "+ee+" === undefined ",R&&(i+=" || ! Object.prototype.hasOwnProperty.call("+u+", '"+e.util.escapeQuotes(C)+"') "),i+=") { "+m+" = false; ";var B=e.errorPath,z=f,et=e.util.escapeQuotes(C);e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(B,C,e.opts.jsonPointers)),f=e.errSchemaPath+"/required";var Z=Z||[];(Z.push(i),i="",!1!==e.createErrors)?(i+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { missingProperty: '"+et+"' } ",!1!==e.opts.messages&&((i+=" , message: '",e.opts._errorDataPathProperty)?i+="is a required property":i+="should have required property \\'"+et+"\\'",i+="' "),e.opts.verbose&&(i+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),i+=" } "):i+=" {} ";var U=i;(i=Z.pop(),!e.compositeRule&&h)?e.async?i+=" throw new ValidationError(["+U+"]); ":i+=" validate.errors = ["+U+"]; return false; ":i+=" var err = "+U+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",f=z,e.errorPath=B,i+=" } else { "}else h?(i+=" if ( "+ee+" === undefined ",R&&(i+=" || ! Object.prototype.hasOwnProperty.call("+u+", '"+e.util.escapeQuotes(C)+"') "),i+=") { "+m+" = true; } else { "):(i+=" if ("+ee+" !== undefined ",R&&(i+=" && Object.prototype.hasOwnProperty.call("+u+", '"+e.util.escapeQuotes(C)+"') "),i+=" ) { ");i+=" "+W+" } "}}h&&(i+=" if ("+m+") { ",p+="}")}if(x.length&&x)for(var L,er=-1,ei=x.length-1;er0||!1===J:e.util.schemaHasRules(J,e.RULES.all)){(c.schema=J,c.schemaPath=e.schemaPath+".patternProperties"+e.util.getProperty(L),c.errSchemaPath=e.errSchemaPath+"/patternProperties/"+e.util.escapeFragment(L),R)?i+=" "+w+" = "+w+" || Object.keys("+u+"); for (var "+v+"=0; "+v+"<"+w+".length; "+v+"++) { var "+g+" = "+w+"["+v+"]; ":i+=" for (var "+g+" in "+u+") { ",i+=" if ("+e.usePattern(L)+".test("+g+")) { ",c.errorPath=e.util.getPathExpr(e.errorPath,g,e.opts.jsonPointers);var V=u+"["+g+"]";c.dataPathArr[b]=g;var W=e.validate(c);(c.baseId=I,2>e.util.varOccurences(W,y))?i+=" "+e.util.varReplace(W,y,V)+" ":i+=" var "+y+" = "+V+"; "+W+" ",h&&(i+=" if (!"+m+") break; "),i+=" } ",h&&(i+=" else "+m+" = true; "),i+=" } ",h&&(i+=" if ("+m+") { ",p+="}")}}return h&&(i+=" "+p+" if ("+d+" == errors) {"),i}}),nx=m((e,t)=>{t.exports=function(e,t,r){var i=" ",n=e.level,a=e.dataLevel,s=e.schema[t],o=e.schemaPath+e.util.getProperty(t),f=e.errSchemaPath+"/"+t,h=!e.opts.allErrors,u="data"+(a||""),d="errs__"+n,c=e.util.copy(e);c.level++;var p="valid"+c.level;if(i+="var "+d+" = errors;",e.opts.strictKeywords?"object"==typeof s&&Object.keys(s).length>0||!1===s:e.util.schemaHasRules(s,e.RULES.all)){c.schema=s,c.schemaPath=o,c.errSchemaPath=f;var m="key"+n,g="idx"+n,v="i"+n,b="' + "+m+" + '",y="data"+(c.dataLevel=e.dataLevel+1),w="dataProperties"+n,_=e.opts.ownProperties,M=e.baseId;_&&(i+=" var "+w+" = undefined; "),_?i+=" "+w+" = "+w+" || Object.keys("+u+"); for (var "+g+"=0; "+g+"<"+w+".length; "+g+"++) { var "+m+" = "+w+"["+g+"]; ":i+=" for (var "+m+" in "+u+") { ",i+=" var startErrs"+n+" = errors; ";var x=e.compositeRule;e.compositeRule=c.compositeRule=!0;var S=e.validate(c);(c.baseId=M,2>e.util.varOccurences(S,y))?i+=" "+e.util.varReplace(S,y,m)+" ":i+=" var "+y+" = "+m+"; "+S+" ",(e.compositeRule=c.compositeRule=x,i+=" if (!"+p+") { for (var "+v+"=startErrs"+n+"; "+v+"{t.exports=function(e,t,r){var i=" ",n=e.level,a=e.dataLevel,s=e.schema[t],o=e.schemaPath+e.util.getProperty(t),f=e.errSchemaPath+"/"+t,h=!e.opts.allErrors,u="data"+(a||""),d="valid"+n,c=e.opts.$data&&s&&s.$data;c&&(i+=" var schema"+n+" = "+e.util.getData(s.$data,a,e.dataPathArr)+"; ");var p="schema"+n;if(!c)if(s.length0||!1===y:e.util.schemaHasRules(y,e.RULES.all))||(m[m.length]=g)}}else var m=s;if(c||m.length){var w=e.errorPath,_=c||m.length>=e.opts.loopRequired,M=e.opts.ownProperties;if(h)if(i+=" var missing"+n+"; ",_){c||(i+=" var "+p+" = validate.schema"+o+"; ");var x="i"+n,S="schema"+n+"["+x+"]",E="' + "+S+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(w,S,e.opts.jsonPointers)),i+=" var "+d+" = true; ",c&&(i+=" if (schema"+n+" === undefined) "+d+" = true; else if (!Array.isArray(schema"+n+")) "+d+" = false; else {"),i+=" for (var "+x+" = 0; "+x+" < "+p+".length; "+x+"++) { "+d+" = "+u+"["+p+"["+x+"]] !== undefined ",M&&(i+=" && Object.prototype.hasOwnProperty.call("+u+", "+p+"["+x+"]) "),i+="; if (!"+d+") break; } ",c&&(i+=" } "),i+=" if (!"+d+") { ";var k=k||[];(k.push(i),i="",!1!==e.createErrors)?(i+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(f)+" , params: { missingProperty: '"+E+"' } ",!1!==e.opts.messages&&((i+=" , message: '",e.opts._errorDataPathProperty)?i+="is a required property":i+="should have required property \\'"+E+"\\'",i+="' "),e.opts.verbose&&(i+=" , schema: validate.schema"+o+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+u+" "),i+=" } "):i+=" {} ";var A=i;(i=k.pop(),!e.compositeRule&&h)?e.async?i+=" throw new ValidationError(["+A+"]); ":i+=" validate.errors = ["+A+"]; return false; ":i+=" var err = "+A+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } else { "}else{i+=" if ( ";var P=m;if(P)for(var R,x=-1,I=P.length-1;x{t.exports=function(e,t,r){var i,n=" ",a=e.level,s=e.dataLevel,o=e.schema[t],f=e.schemaPath+e.util.getProperty(t),h=e.errSchemaPath+"/"+t,u=!e.opts.allErrors,d="data"+(s||""),c="valid"+a,p=e.opts.$data&&o&&o.$data;if(p?(n+=" var schema"+a+" = "+e.util.getData(o.$data,s,e.dataPathArr)+"; ",i="schema"+a):i=o,(o||p)&&!1!==e.opts.uniqueItems){p&&(n+=" var "+c+"; if ("+i+" === false || "+i+" === undefined) "+c+" = true; else if (typeof "+i+" != 'boolean') "+c+" = false; else { "),n+=" var i = "+d+".length , "+c+" = true , j; if (i > 1) { ";var m=e.schema.items&&e.schema.items.type,g=Array.isArray(m);!m||"object"==m||"array"==m||g&&(m.indexOf("object")>=0||m.indexOf("array")>=0)?n+=" outer: for (;i--;) { for (j = i; j--;) { if (equal("+d+"[i], "+d+"[j])) { "+c+" = false; break outer; } } } ":(n+=" var itemIndices = {}, item; for (;i--;) { var item = "+d+"[i]; ",n+=" if ("+e.util["checkDataType"+(g?"s":"")](m,"item",e.opts.strictNumbers,!0)+") continue; ",g&&(n+=" if (typeof item == 'string') item = '\"' + item; "),n+=" if (typeof itemIndices[item] == 'number') { "+c+" = false; j = itemIndices[item]; break; } itemIndices[item] = i; } "),n+=" } ",p&&(n+=" } "),n+=" if (!"+c+") { ";var v=v||[];(v.push(n),n="",!1!==e.createErrors)?(n+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(h)+" , params: { i: i, j: j } ",!1!==e.opts.messages&&(n+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "),e.opts.verbose&&((n+=" , schema: ",p)?n+="validate.schema"+f:n+=""+o,n+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),n+=" } "):n+=" {} ";var b=n;(n=v.pop(),!e.compositeRule&&u)?e.async?n+=" throw new ValidationError(["+b+"]); ":n+=" validate.errors = ["+b+"]; return false; ":n+=" var err = "+b+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",n+=" } ",u&&(n+=" else { ")}else u&&(n+=" if (true) { ");return n}}),nk=m((e,t)=>{t.exports={$ref:ni(),allOf:nn(),anyOf:na(),$comment:ns(),const:no(),contains:nf(),dependencies:nh(),enum:nu(),format:nl(),if:nd(),items:nc(),maximum:np(),minimum:np(),maxItems:nm(),minItems:nm(),maxLength:ng(),minLength:ng(),maxProperties:nv(),minProperties:nv(),multipleOf:nb(),not:ny(),oneOf:nw(),pattern:n_(),properties:nM(),propertyNames:nx(),required:nS(),uniqueItems:nE(),validate:i7()}}),nA=m((e,t)=>{var r=nk(),i=i3().toHash;t.exports=function(){var e=[{type:"number",rules:[{maximum:["exclusiveMaximum"]},{minimum:["exclusiveMinimum"]},"multipleOf","format"]},{type:"string",rules:["maxLength","minLength","pattern","format"]},{type:"array",rules:["maxItems","minItems","items","contains","uniqueItems"]},{type:"object",rules:["maxProperties","minProperties","required","dependencies","propertyNames",{properties:["additionalProperties","patternProperties"]}]},{rules:["$ref","const","enum","not","anyOf","oneOf","allOf","if"]}],t=["type","$comment"];return e.all=i(t),e.types=i(["number","integer","string","array","object","boolean","null"]),e.forEach(function(i){i.rules=i.rules.map(function(i){if("object"==typeof i){var n,a=Object.keys(i)[0];n=i[a],i=a,n.forEach(function(r){t.push(r),e.all[r]=!0})}return t.push(i),e.all[i]={keyword:i,code:r[i],implements:n}}),e.all.$comment={keyword:"$comment",code:r.$comment},i.type&&(e.types[i.type]=i)}),e.keywords=i(t.concat(["$schema","$id","id","$data","$async","title","description","default","definitions","examples","readOnly","writeOnly","contentMediaType","contentEncoding","additionalItems","then","else"])),e.custom={},e}}),nP=m((e,t)=>{var r=["multipleOf","maximum","exclusiveMaximum","minimum","exclusiveMinimum","maxLength","minLength","pattern","additionalItems","maxItems","minItems","uniqueItems","maxProperties","minProperties","required","additionalProperties","enum","format","const"];t.exports=function(e,t){for(var i=0;i{var r=i5().MissingRef;t.exports=function e(t,i,n){var a=this;if("function"!=typeof this._opts.loadSchema)throw Error("options.loadSchema should be a function");"function"==typeof i&&(n=i,i=void 0);var s=o(t).then(function(){var e=a._addSchema(t,void 0,i);return e.validate||function e(t){try{return a._compile(t)}catch(d){if(d instanceof r){var n=d,s=n.missingSchema;if(u(s))throw Error("Schema "+s+" is loaded but "+n.missingRef+" cannot be resolved");var f=a._loadingSchemas[s];return f||(f=a._loadingSchemas[s]=a._opts.loadSchema(s)).then(h,h),f.then(function(e){if(!u(s))return o(e).then(function(){u(s)||a.addSchema(e,s,void 0,i)})}).then(function(){return e(t)});function h(){delete a._loadingSchemas[s]}function u(e){return a._refs[e]||a._schemas[e]}}throw d}}(e)});return n&&s.then(function(e){n(null,e)},n),s;function o(t){var r=t.$schema;return r&&!a.getSchema(r)?e.call(a,{$ref:r},!0):Promise.resolve()}}}),nI=m((e,t)=>{t.exports=function(e,t,r){var i,n,a=" ",s=e.level,o=e.dataLevel,f=e.schema[t],h=e.schemaPath+e.util.getProperty(t),u=e.errSchemaPath+"/"+t,d=!e.opts.allErrors,c="data"+(o||""),p="valid"+s,m="errs__"+s,g=e.opts.$data&&f&&f.$data;g?(a+=" var schema"+s+" = "+e.util.getData(f.$data,o,e.dataPathArr)+"; ",n="schema"+s):n=f;var v,b,y,w,_,M="definition"+s,x=this.definition,S="";if(g&&x.$data){_="keywordValidate"+s;var E=x.validateSchema;a+=" var "+M+" = RULES.custom['"+t+"'].definition; var "+_+" = "+M+".validate;"}else{if(!(w=e.useCustomRule(this,f,e.schema,e)))return;n="validate.schema"+h,_=w.code,v=x.compile,b=x.inline,y=x.macro}var k=_+".errors",A="i"+s,P="ruleErr"+s,R=x.async;if(R&&!e.async)throw Error("async keyword in sync schema");if(b||y||(a+=""+k+" = null;"),a+="var "+m+" = errors;var "+p+";",g&&x.$data&&(S+="}",a+=" if ("+n+" === undefined) { "+p+" = true; } else { ",E)&&(S+="}",a+=" "+p+" = "+M+".validateSchema("+n+"); if ("+p+") { "),b)x.statements?a+=" "+w.validate+" ":a+=" "+p+" = "+w.validate+"; ";else if(y){var I=e.util.copy(e),S="";I.level++;var T="valid"+I.level;I.schema=w.validate,I.schemaPath="";var j=e.compositeRule;e.compositeRule=I.compositeRule=!0;var O=e.validate(I).replace(/validate\.schema/g,_);e.compositeRule=I.compositeRule=j,a+=" "+O}else{var C=C||[];(C.push(a),a=" "+_+".call( ",e.opts.passContext)?a+="this":a+="self",v||!1===x.schema?a+=" , "+c+" ":a+=" , "+n+" , "+c+" , validate.schema"+e.schemaPath+" ",a+=" , (dataPath || '')",'""'!=e.errorPath&&(a+=" + "+e.errorPath);var N=o?"data"+(o-1||""):"parentData",D=o?e.dataPathArr[o]:"parentDataProperty",L=a+=" , "+N+" , "+D+" , rootData ) ";(a=C.pop(),!1===x.errors)?(a+=" "+p+" = ",R&&(a+="await "),a+=""+L+"; "):R?a+=" var "+(k="customErrors"+s)+" = null; try { "+p+" = await "+L+"; } catch (e) { "+p+" = false; if (e instanceof ValidationError) "+k+" = e.errors; else throw e; } ":a+=" "+k+" = null; "+p+" = "+L+"; "}if(x.modifying&&(a+=" if ("+N+") "+c+" = "+N+"["+D+"];"),a+=""+S,x.valid)d&&(a+=" if (true) { ");else{(a+=" if ( ",void 0===x.valid)?(a+=" !",y)?a+=""+T:a+=""+p:a+=" "+!x.valid+" ",a+=") { ",i=this.keyword;var C=C||[];C.push(a),a="";var C=C||[];(C.push(a),a="",!1!==e.createErrors)?(a+=" { keyword: '"+(i||"custom")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { keyword: '"+this.keyword+"' } ",!1!==e.opts.messages&&(a+=" , message: 'should pass \""+this.keyword+"\" keyword validation' "),e.opts.verbose&&(a+=" , schema: validate.schema"+h+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+c+" "),a+=" } "):a+=" {} ";var $=a;(a=C.pop(),!e.compositeRule&&d)?e.async?a+=" throw new ValidationError(["+$+"]); ":a+=" validate.errors = ["+$+"]; return false; ":a+=" var err = "+$+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";var q=a;(a=C.pop(),b)?x.errors?"full"!=x.errors&&(a+=" for (var "+A+"="+m+"; "+A+"{t.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}}),nj=m((e,t)=>{var r=nT();t.exports={$id:"https://github.com/ajv-validator/ajv/blob/master/lib/definition_schema.js",definitions:{simpleTypes:r.definitions.simpleTypes},type:"object",dependencies:{schema:["validate"],$data:["validate"],statements:["inline"],valid:{not:{required:["macro"]}}},properties:{type:r.properties.type,schema:{type:"boolean"},statements:{type:"boolean"},dependencies:{type:"array",items:{type:"string"}},metaSchema:{type:"object"},modifying:{type:"boolean"},valid:{type:"boolean"},$data:{type:"boolean"},async:{type:"boolean"},errors:{anyOf:[{type:"boolean"},{const:"full"}]}}}}),nO=m((e,t)=>{var r=/^[a-z_$][a-z0-9_$-]*$/i,i=nI(),n=nj();function a(e,t){a.errors=null;var r=this._validateKeyword=this._validateKeyword||this.compile(n,!0);if(r(e))return!0;if(a.errors=r.errors,!t)return!1;throw Error("custom keyword definition is invalid: "+this.errorsText(r.errors))}t.exports={add:function(e,t){var n=this.RULES;if(n.keywords[e])throw Error("Keyword "+e+" is already defined");if(!r.test(e))throw Error("Keyword "+e+" is not a valid identifier");if(t){this.validateKeyword(t,!0);var a=t.type;if(Array.isArray(a))for(var s=0;s{t.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON Schema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}}),nN=m((e,t)=>{var r=ne(),i=i9(),n=nt(),a=i6(),s=i8(),o=nr(),f=nA(),h=nP(),u=i3();t.exports=v,v.prototype.validate=function(e,t){if("string"==typeof e){if(!(r=this.getSchema(e)))throw Error('no schema with key or ref "'+e+'"')}else{var r,i=this._addSchema(e);r=i.validate||this._compile(i)}var n=r(t);return!0!==r.$async&&(this.errors=r.errors),n},v.prototype.compile=function(e,t){var r=this._addSchema(e,void 0,t);return r.validate||this._compile(r)},v.prototype.addSchema=function(e,t,r,n){if(Array.isArray(e)){for(var a=0;a{this.readyResolve=e,this.readyReject=t}),this.initialize()}initialize(){try{let{url:e}=this.options,t=new URL(e);if(!t.protocol.startsWith("ws"))throw Error("WebSocket URL must use ws:// or wss:// protocol");this.ws=new globalThis.WebSocket(t.toString());let r=setTimeout(()=>{if(!this.ready){this.ws?.close();let e=Error("WebSocket connection timeout after 5000ms");this.exitError=e,this.readyReject&&this.readyReject(e)}},5e3);this.ws.onopen=()=>{if(clearTimeout(r),this.ready=!0,this.readyResolve&&this.readyResolve(),this.options.authMessage&&this.ws)try{this.ws.send(JSON.stringify(this.options.authMessage)+` `)}catch{}this.keepAliveTimer=setInterval(()=>{if(this.ws&&this.ws.readyState===globalThis.WebSocket.OPEN)try{this.ws.send(JSON.stringify({type:"keep_alive"})+` `)}catch{}},5e4)},this.ws.onerror=e=>{clearTimeout(r),this.ready=!1;let t=Error("WebSocket connection error");this.exitError=t,this.readyReject&&this.readyReject(t),this.messageReject&&(this.messageReject(t),this.messageReject=void 0,this.messageResolve=void 0)},this.ws.onclose=e=>{this.ready=!1,this.closed=!0,this.keepAliveTimer&&(clearInterval(this.keepAliveTimer),this.keepAliveTimer=void 0),1e3!==e.code&&1001!==e.code&&(this.exitError=Error(`WebSocket closed abnormally with code ${e.code}: ${e.reason}`)),this.messageResolve&&(this.messageResolve({done:!0,value:void 0}),this.messageResolve=void 0,this.messageReject=void 0)},this.ws.onmessage=e=>{for(let t of e.data.split(` `))if(t.trim())try{let e=JSON.parse(t);this.enqueueMessage(e)}catch(e){}},this.abortController&&((this.abortHandler=()=>{this.close(),this.exitError=new nD("WebSocket connection aborted by user")},this.abortController.signal.aborted)?this.abortHandler():this.abortController.signal.addEventListener("abort",this.abortHandler))}catch(e){throw this.ready=!1,this.exitError=e,this.readyReject&&this.readyReject(e),e}}enqueueMessage(e){this.messageResolve?(this.messageResolve({done:!1,value:e}),this.messageResolve=void 0,this.messageReject=void 0):this.messageQueue.push(e)}async write(e){if(this.abortController.signal.aborted)throw new nD("Operation aborted");if(this.ready||await this.readyPromise,!this.ready||!this.ws||this.ws.readyState!==globalThis.WebSocket.OPEN)throw Error("WebSocketTransport is not ready for writing");this.ws.send(e)}close(){this.abortHandler&&this.abortController&&(this.abortController.signal.removeEventListener("abort",this.abortHandler),this.abortHandler=void 0),this.keepAliveTimer&&(clearInterval(this.keepAliveTimer),this.keepAliveTimer=void 0),this.ws&&this.ws.readyState===globalThis.WebSocket.OPEN&&this.ws.close(1e3,"Normal closure"),this.ready=!1,this.closed=!0}isReady(){return this.ready&&this.ws?.readyState===globalThis.WebSocket.OPEN}endInput(){}async *readMessages(){for(;!this.closed||this.messageQueue.length>0;){if(this.messageQueue.length>0){yield this.messageQueue.shift();continue}if(this.closed)break;let e=await new Promise((e,t)=>this.messageQueue.length>0?void e({done:!1,value:this.messageQueue.shift()}):this.closed?void e({done:!0,value:void 0}):void(this.messageResolve=e,this.messageReject=t));if(e.done)break;yield e.value}if(this.exitError)throw this.exitError}}class n${returned;queue=[];readResolve;readReject;isDone=!1;hasError;started=!1;constructor(e){this.returned=e}[Symbol.asyncIterator](){if(this.started)throw Error("Stream can only be iterated once");return this.started=!0,this}next(){return this.queue.length>0?Promise.resolve({done:!1,value:this.queue.shift()}):this.isDone?Promise.resolve({done:!0,value:void 0}):this.hasError?Promise.reject(this.hasError):new Promise((e,t)=>{this.readResolve=e,this.readReject=t})}enqueue(e){if(this.readResolve){let t=this.readResolve;this.readResolve=void 0,this.readReject=void 0,t({done:!1,value:e})}else this.queue.push(e)}done(){if(this.isDone=!0,this.readResolve){let e=this.readResolve;this.readResolve=void 0,this.readReject=void 0,e({done:!0,value:void 0})}}error(e){if(this.hasError=e,this.readReject){let t=this.readReject;this.readResolve=void 0,this.readReject=void 0,t(e)}}return(){return this.isDone=!0,this.returned&&this.returned(),Promise.resolve({done:!0,value:void 0})}}class nq{sendMcpMessage;isClosed=!1;constructor(e){this.sendMcpMessage=e}onclose;onerror;onmessage;async start(){}async send(e){if(this.isClosed)throw Error("Transport is closed");this.sendMcpMessage(e)}async close(){this.isClosed||(this.isClosed=!0,this.onclose?.())}}var nB="object"==typeof global&&global&&global.Object===Object&&global,nF="object"==typeof self&&self&&self.Object===Object&&self,nz=nB||nF||Function("return this")(),nZ=nz.Symbol,nU=Object.prototype,nH=nU.hasOwnProperty,nV=nU.toString,nW=nZ?nZ.toStringTag:void 0,nK=function(e){var t=nH.call(e,nW),r=e[nW];try{e[nW]=void 0;var i=!0}catch(e){}var n=nV.call(e);return i&&(t?e[nW]=r:delete e[nW]),n},nQ=Object.prototype.toString,nG=nZ?nZ.toStringTag:void 0,nJ=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":nG&&nG in Object(e)?nK(e):nQ.call(e)},nY=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},nX=function(e){if(!nY(e))return!1;var t=nJ(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},n0=nz["__core-js_shared__"],n1=function(){var e=/[^.]+$/.exec(n0&&n0.keys&&n0.keys.IE_PROTO||"");return e?"Symbol(src)_1."+e:""}(),n2=Function.prototype.toString,n3=function(e){if(null!=e){try{return n2.call(e)}catch(e){}try{return e+""}catch(e){}}return""},n6=/^\[object .+?Constructor\]$/,n4=Object.prototype,n9=Function.prototype.toString,n5=n4.hasOwnProperty,n8=RegExp("^"+n9.call(n5).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),n7=function(e){return!!nY(e)&&(!n1||!(n1 in e))&&(nX(e)?n8:n6).test(n3(e))},ae=function(e,t){var r=null==e?void 0:e[t];return n7(r)?r:void 0},at=ae(Object,"create"),ar=Object.prototype.hasOwnProperty,ai=Object.prototype.hasOwnProperty;function an(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t-1},ao.prototype.set=function(e,t){var r=this.__data__,i=aa(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this};var af=ae(nz,"Map"),ah=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e},au=function(e,t){var r=e.__data__;return ah(t)?r["string"==typeof t?"string":"hash"]:r.map};function al(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t{if(!e||""===e.trim())return null;let t=e.split(",").map(e=>e.trim()).filter(Boolean);if(0===t.length)return null;let r=t.some(e=>e.startsWith("!")),i=t.some(e=>!e.startsWith("!"));if(r&&i)return null;let n=t.map(e=>e.replace(/^!/,"").toLowerCase());return{include:r?[]:n,exclude:r?n:[],isExclusive:r}}),ap=()=>({}),{stat:am,open:ag}=()=>({}),av={cwd:()=>n.cwd(),existsSync:e=>ap.existsSync(e),stat:async e=>am(e),statSync:e=>ap.statSync(e),readFileSync:(e,t)=>ap.readFileSync(e,{encoding:t.encoding}),readFileBytesSync:e=>ap.readFileSync(e),readSync(e,t){let r;try{r=ap.openSync(e,"r");let i=a.alloc(t.length),n=ap.readSync(r,i,0,t.length,0);return{buffer:i,bytesRead:n}}finally{r&&ap.closeSync(r)}},writeFileSync(e,t,r){let i;if(!r.flush){let i={encoding:r.encoding};void 0!==r.mode&&(i.mode=r.mode),ap.writeFileSync(e,t,i);return}try{let n=void 0!==r.mode?r.mode:void 0;i=ap.openSync(e,"w",n),ap.writeFileSync(i,t,{encoding:r.encoding}),ap.fsyncSync(i)}finally{i&&ap.closeSync(i)}},appendFileSync(e,t){ap.appendFileSync(e,t)},copyFileSync(e,t){ap.copyFileSync(e,t)},unlinkSync(e){ap.unlinkSync(e)},renameSync(e,t){ap.renameSync(e,t)},linkSync(e,t){ap.linkSync(e,t)},symlinkSync(e,t){ap.symlinkSync(e,t)},readlinkSync:e=>ap.readlinkSync(e),realpathSync:e=>ap.realpathSync(e),mkdirSync(e){ap.existsSync(e)||ap.mkdirSync(e,{recursive:!0,mode:448})},readdirSync:e=>ap.readdirSync(e,{withFileTypes:!0}),readdirStringSync:e=>ap.readdirSync(e),isDirEmptySync(e){return 0===this.readdirSync(e).length},rmdirSync(e){ap.rmdirSync(e)},rmSync(e,t){ap.rmSync(e,t)},createWriteStream:e=>ap.createWriteStream(e)};function ab(e){if("string"!=typeof e)throw TypeError("Path must be a string. Received "+JSON.stringify(e))}function ay(e,t){for(var r,i="",n=0,a=-1,s=0,o=0;o<=e.length;++o){if(o2){var f=i.lastIndexOf("/");if(f!==i.length-1){-1===f?(i="",n=0):n=(i=i.slice(0,f)).length-1-i.lastIndexOf("/"),a=o,s=0;continue}}else if(2===i.length||1===i.length){i="",n=0,a=o,s=0;continue}}t&&(i.length>0?i+="/..":i="..",n=2)}else i.length>0?i+="/"+e.slice(a+1,o):i=e.slice(a+1,o),n=o-a-1;a=o,s=0}else 46===r&&-1!==s?++s:s=-1}return i}function aw(){for(var e,t,r="",i=!1,a=arguments.length-1;a>=-1&&!i;a--)a>=0?e=arguments[a]:(void 0===t&&(t=n.cwd()),e=t),ab(e),0!==e.length&&(r=e+"/"+r,i=47===e.charCodeAt(0));if(r=ay(r,!i),i)if(r.length>0)return"/"+r;else return"/";return r.length>0?r:"."}function a_(e){if(ab(e),0===e.length)return".";var t=47===e.charCodeAt(0),r=47===e.charCodeAt(e.length-1);return(0!==(e=ay(e,!t)).length||t||(e="."),e.length>0&&r&&(e+="/"),t)?"/"+e:e}function aM(){if(0==arguments.length)return".";for(var e,t=0;t0&&(void 0===e?e=r:e+="/"+r)}return void 0===e?".":a_(e)}function ax(e){if(ab(e),0===e.length)return".";for(var t=e.charCodeAt(0),r=47===t,i=-1,n=!0,a=e.length-1;a>=1;--a)if(47===(t=e.charCodeAt(a))){if(!n){i=a;break}}else n=!1;return -1===i?r?"/":".":r&&1===i?"//":e.slice(0,i)}function aS(e){return!!e&&("boolean"==typeof e?e:["1","true","yes","on"].includes(e.toLowerCase().trim()))}(e=>e.posix=e)({resolve:aw,normalize:a_,isAbsolute:function(e){return ab(e),e.length>0&&47===e.charCodeAt(0)},join:aM,relative:function(e,t){if(ab(e),ab(t),e===t||(e=aw(e))===(t=aw(t)))return"";for(var r=1;ro){if(47===t.charCodeAt(a+h))return t.slice(a+h+1);else if(0===h)return t.slice(a+h)}else n>o&&(47===e.charCodeAt(r+h)?f=h:0===h&&(f=0));break}var u=e.charCodeAt(r+h);if(u!==t.charCodeAt(a+h))break;47===u&&(f=h)}var d="";for(h=r+f+1;h<=i;++h)(h===i||47===e.charCodeAt(h))&&(0===d.length?d+="..":d+="/..");return d.length>0?d+t.slice(a+f):(a+=f,47===t.charCodeAt(a)&&++a,t.slice(a))},_makeLong:function(e){return e},dirname:ax,basename:function(e,t){if(void 0!==t&&"string"!=typeof t)throw TypeError('"ext" argument must be a string');ab(e);var r,i=0,n=-1,a=!0;if(void 0!==t&&t.length>0&&t.length<=e.length){if(t.length===e.length&&t===e)return"";var s=t.length-1,o=-1;for(r=e.length-1;r>=0;--r){var f=e.charCodeAt(r);if(47===f){if(!a){i=r+1;break}}else -1===o&&(a=!1,o=r+1),s>=0&&(f===t.charCodeAt(s)?-1==--s&&(n=r):(s=-1,n=o))}return i===n?n=o:-1===n&&(n=e.length),e.slice(i,n)}for(r=e.length-1;r>=0;--r)if(47===e.charCodeAt(r)){if(!a){i=r+1;break}}else -1===n&&(a=!1,n=r+1);return -1===n?"":e.slice(i,n)},extname:function(e){ab(e);for(var t=-1,r=0,i=-1,n=!0,a=0,s=e.length-1;s>=0;--s){var o=e.charCodeAt(s);if(47===o){if(!n){r=s+1;break}continue}-1===i&&(n=!1,i=s+1),46===o?-1===t?t=s:1!==a&&(a=1):-1!==t&&(a=-1)}return -1===t||-1===i||0===a||1===a&&t===i-1&&t===r+1?"":e.slice(t,i)},format:function(e){var t,r;if(null===e||"object"!=typeof e)throw TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return t=e.dir||e.root,r=e.base||(e.name||"")+(e.ext||""),t?t===e.root?t+r:t+"/"+r:r},parse:function(e){ab(e);var t={root:"",dir:"",base:"",ext:"",name:""};if(0===e.length)return t;var r,i=e.charCodeAt(0),n=47===i;n?(t.root="/",r=1):r=0;for(var a=-1,s=0,o=-1,f=!0,h=e.length-1,u=0;h>=r;--h){if(47===(i=e.charCodeAt(h))){if(!f){s=h+1;break}continue}-1===o&&(f=!1,o=h+1),46===i?-1===a?a=h:1!==u&&(u=1):-1!==a&&(u=-1)}return -1===a||-1===o||0===u||1===u&&a===o-1&&a===s+1?-1!==o&&(0===s&&n?t.base=t.name=e.slice(1,o):t.base=t.name=e.slice(s,o)):(0===s&&n?(t.name=e.slice(1,a),t.base=e.slice(1,o)):(t.name=e.slice(s,a),t.base=e.slice(s,o)),t.ext=e.slice(a,o)),s>0?t.dir=e.slice(0,s-1):n&&(t.dir="/"),t},sep:"/",delimiter:":",win32:null,posix:null});var aE=function(){return"/"};iX();var ak={originalCwd:aE(),totalCostUSD:0,totalAPIDuration:0,totalAPIDurationWithoutRetries:0,totalToolDuration:0,startTime:Date.now(),lastInteractionTime:Date.now(),totalLinesAdded:0,totalLinesRemoved:0,hasUnknownModelCost:!1,cwd:aE(),modelUsage:{},mainLoopModelOverride:void 0,maxRateLimitFallbackActive:!1,initialMainLoopModel:null,modelStrings:null,isNonInteractiveSession:!0,isInteractive:!1,clientType:"cli",sessionIngressToken:void 0,oauthTokenFromFd:void 0,apiKeyFromFd:void 0,flagSettingsPath:void 0,allowedSettingSources:["userSettings","projectSettings","localSettings","flagSettings","policySettings"],meter:null,sessionCounter:null,locCounter:null,prCounter:null,commitCounter:null,costCounter:null,tokenCounter:null,codeEditToolDecisionCounter:null,activeTimeCounter:null,sessionId:iY(),loggerProvider:null,eventLogger:null,meterProvider:null,tracerProvider:null,agentColorMap:new Map,agentColorIndex:0,envVarValidators:[{name:"BASH_MAX_OUTPUT_LENGTH",default:3e4,validate:e=>{if(!e)return{effective:3e4,status:"valid"};let t=parseInt(e,10);return isNaN(t)||t<=0?{effective:3e4,status:"invalid",message:`Invalid value "${e}" (using default: 30000)`}:t>15e4?{effective:15e4,status:"capped",message:`Capped from ${t} to 150000`}:{effective:t,status:"valid"}}},{name:"CLAUDE_CODE_MAX_OUTPUT_TOKENS",default:32e3,validate:e=>{if(!e)return{effective:32e3,status:"valid"};let t=parseInt(e,10);return isNaN(t)||t<=0?{effective:32e3,status:"invalid",message:`Invalid value "${e}" (using default: 32000)`}:t>32e3?{effective:32e3,status:"capped",message:`Capped from ${t} to 32000`}:{effective:t,status:"valid"}}}],lastAPIRequest:null,inMemoryErrorLog:[],inlinePlugins:[]};ad(()=>aS(n.env.DEBUG)||aS(n.env.DEBUG_SDK)||n.argv.includes("--debug")||n.argv.includes("-d")||aP()||n.argv.some(e=>e.startsWith("--debug=")));var aA=ad(()=>{let e=n.argv.find(e=>e.startsWith("--debug="));return e?ac(e.substring(8)):null}),aP=ad(()=>n.argv.includes("--debug-to-stderr")||n.argv.includes("-d2e"));function aR(e,{level:t}={level:"debug"}){if(!function(e){var t;if(typeof n>"u"||typeof n.versions>"u"||typeof n.versions.node>"u")return!1;let r=aA();return!r||(t=function(e){let t=[],r=e.match(/^MCP server ["']([^"']+)["']/);if(r&&r[1])t.push("mcp"),t.push(r[1].toLowerCase());else{let r=e.match(/^([^:[]+):/);r&&r[1]&&t.push(r[1].trim().toLowerCase())}let i=e.match(/^\[([^\]]+)]/);i&&i[1]&&t.push(i[1].trim().toLowerCase()),e.toLowerCase().includes("statsig event:")&&t.push("statsig");let n=e.match(/:\s*([^:]+?)(?:\s+(?:type|mode|status|event))?:/);if(n&&n[1]){let e=n[1].trim().toLowerCase();e.length<30&&!e.includes(" ")&&t.push(e)}return Array.from(new Set(t))}(e),!r||0!==t.length&&(r.isExclusive?!t.some(e=>r.exclude.includes(e)):t.some(e=>r.include.includes(e))))}(e))return;let r=`[${t.toUpperCase()}] ${e.trim()} `;if(aP())return void function(e){for(let t=0;t{try{let e=aI(),t=ax(e),r=aM(t,"latest");if(av.existsSync(t)||av.mkdirSync(t),av.existsSync(r))try{av.unlinkSync(r)}catch{}av.symlinkSync(e,r)}catch{}});class aj{transport;isSingleUserTurn;canUseTool;hooks;abortController;pendingControlResponses=new Map;cleanupPerformed=!1;sdkMessages;inputStream=new n$;initialization;cancelControllers=new Map;hookCallbacks=new Map;nextCallbackId=0;sdkMcpTransports=new Map;pendingMcpResponses=new Map;firstResultReceivedPromise;firstResultReceivedResolve;constructor(e,t,r,i,n,a=new Map){for(let[s,o]of(this.transport=e,this.isSingleUserTurn=t,this.canUseTool=r,this.hooks=i,this.abortController=n,a)){let e=new nq(e=>this.sendMcpServerMessageToCli(s,e));this.sdkMcpTransports.set(s,e),o.connect(e)}this.sdkMessages=this.readSdkMessages(),this.firstResultReceivedPromise=new Promise(e=>{this.firstResultReceivedResolve=e}),this.readMessages(),this.initialization=this.initialize(),this.initialization.catch(()=>{})}setError(e){this.inputStream.error(e)}cleanup(e){if(!this.cleanupPerformed){this.cleanupPerformed=!0;try{(this.transport.close(),this.pendingControlResponses.clear(),this.pendingMcpResponses.clear(),e)?this.inputStream.error(e):this.inputStream.done()}catch(e){}}}next(...[e]){return this.sdkMessages.next(e)}return(e){return this.sdkMessages.return(e)}throw(e){return this.sdkMessages.throw(e)}[Symbol.asyncIterator](){return this.sdkMessages}[Symbol.asyncDispose](){return this.sdkMessages[Symbol.asyncDispose]()}async readMessages(){try{for await(let e of this.transport.readMessages()){if("control_response"===e.type){let t=this.pendingControlResponses.get(e.response.request_id);t&&t(e.response);continue}if("control_request"===e.type){this.handleControlRequest(e);continue}if("control_cancel_request"===e.type){this.handleControlCancelRequest(e);continue}else if("keep_alive"===e.type)continue;"result"===e.type&&(this.firstResultReceivedResolve&&this.firstResultReceivedResolve(),this.isSingleUserTurn&&this.transport.endInput()),this.inputStream.enqueue(e)}this.inputStream.done(),this.cleanup()}catch(e){this.inputStream.error(e),this.cleanup(e)}}async handleControlRequest(e){let t=new AbortController;this.cancelControllers.set(e.request_id,t);try{let r=await this.processControlRequest(e,t.signal),i={type:"control_response",response:{subtype:"success",request_id:e.request_id,response:r}};await Promise.resolve(this.transport.write(JSON.stringify(i)+` `))}catch(r){let t={type:"control_response",response:{subtype:"error",request_id:e.request_id,error:r.message||String(r)}};await Promise.resolve(this.transport.write(JSON.stringify(t)+` `))}finally{this.cancelControllers.delete(e.request_id)}}handleControlCancelRequest(e){let t=this.cancelControllers.get(e.request_id);t&&(t.abort(),this.cancelControllers.delete(e.request_id))}async processControlRequest(e,t){if("can_use_tool"===e.request.subtype){if(!this.canUseTool)throw Error("canUseTool callback is not provided.");return this.canUseTool(e.request.tool_name,e.request.input,{signal:t,suggestions:e.request.permission_suggestions,toolUseID:e.request.tool_use_id})}if("hook_callback"===e.request.subtype)return await this.handleHookCallbacks(e.request.callback_id,e.request.input,e.request.tool_use_id,t);if("mcp_message"===e.request.subtype){let t=e.request,r=this.sdkMcpTransports.get(t.server_name);if(!r)throw Error(`SDK MCP server not found: ${t.server_name}`);return"method"in t.message&&"id"in t.message&&null!==t.message.id?{mcp_response:await this.handleMcpControlRequest(t.server_name,t,r)}:(r.onmessage&&r.onmessage(t.message),{mcp_response:{jsonrpc:"2.0",result:{},id:0}})}throw Error("Unsupported control request subtype: "+e.request.subtype)}async *readSdkMessages(){for await(let e of this.inputStream)yield e}async initialize(){let e;if(this.hooks)for(let[t,r]of(e={},Object.entries(this.hooks)))r.length>0&&(e[t]=r.map(e=>{let t=[];for(let r of e.hooks){let e=`hook_${this.nextCallbackId++}`;this.hookCallbacks.set(e,r),t.push(e)}return{matcher:e.matcher,hookCallbackIds:t}}));let t={subtype:"initialize",hooks:e,sdkMcpServers:this.sdkMcpTransports.size>0?Array.from(this.sdkMcpTransports.keys()):void 0};return(await this.request(t)).response}async interrupt(){await this.request({subtype:"interrupt"})}async setPermissionMode(e){await this.request({subtype:"set_permission_mode",mode:e})}async setModel(e){await this.request({subtype:"set_model",model:e})}async setMaxThinkingTokens(e){await this.request({subtype:"set_max_thinking_tokens",max_thinking_tokens:e})}async processPendingPermissionRequests(e){for(let t of e)"can_use_tool"===t.request.subtype&&this.handleControlRequest(t).catch(()=>{})}request(e){let t=Math.random().toString(36).substring(2,15),r={request_id:t,type:"control_request",request:e};return new Promise((e,i)=>{this.pendingControlResponses.set(t,t=>{"success"===t.subtype?e(t):(i(Error(t.error)),t.pending_permission_requests&&this.processPendingPermissionRequests(t.pending_permission_requests))}),Promise.resolve(this.transport.write(JSON.stringify(r)+` `))})}async supportedCommands(){return(await this.initialization).commands}async supportedModels(){return(await this.initialization).models}async mcpServerStatus(){return(await this.request({subtype:"mcp_status"})).response.mcpServers}async accountInfo(){return(await this.initialization).account}async streamInput(e){aR("[Query.streamInput] Starting to process input stream"),aR(`[Query.streamInput] this.sdkMcpTransports.size = ${this.sdkMcpTransports.size}`);try{let t=0;for await(let r of e){if(t++,aR(`[Query.streamInput] Processing message ${t}: ${r.type}`),this.abortController?.signal.aborted)break;await Promise.resolve(this.transport.write(JSON.stringify(r)+` `))}if(aR(`[Query.streamInput] Finished processing ${t} messages from input stream`),aR(`[Query.streamInput] About to check MCP servers. this.sdkMcpTransports.size = ${this.sdkMcpTransports.size}`),this.sdkMcpTransports.size>0&&this.firstResultReceivedPromise){let e;aR("[Query.streamInput] Entering Promise.race to wait for result"),await Promise.race([this.firstResultReceivedPromise.then(()=>{aR("[Query.streamInput] Received first result, closing input stream"),e&&clearTimeout(e)}),new Promise(t=>{e=setTimeout(()=>{aR("[Query.streamInput] Timed out waiting for first result, closing input stream"),t()},1e4)})]),e&&clearTimeout(e)}aR("[Query] Calling transport.endInput() to close stdin to CLI process"),this.transport.endInput()}catch(e){if(!(e instanceof nD))throw e}}handleHookCallbacks(e,t,r,i){let n=this.hookCallbacks.get(e);if(!n)throw Error(`No hook callback found for ID: ${e}`);return n(t,r,{signal:i})}sendMcpServerMessageToCli(e,t){if("id"in t&&null!==t.id&&void 0!==t.id){let r=`${e}:${t.id}`,i=this.pendingMcpResponses.get(r);if(i){i.resolve(t),this.pendingMcpResponses.delete(r);return}}throw Error("No pending request found")}handleMcpControlRequest(e,t,r){let i="id"in t.message?t.message.id:null,n=`${e}:${i}`;return new Promise((e,i)=>{let a=()=>{this.pendingMcpResponses.delete(n)};if(this.pendingMcpResponses.set(n,{resolve:t=>{a(),e(t)},reject:e=>{a(),i(e)}}),r.onmessage)r.onmessage(t.message);else{a(),i(Error("No message handler registered"));return}})}}var aO={};g(aO,{void:()=>oh,util:()=>a6,unknown:()=>oo,union:()=>oc,undefined:()=>on,tuple:()=>og,transformer:()=>ok,symbol:()=>oi,string:()=>s5,strictObject:()=>od,setErrorMap:()=>aF,set:()=>oy,record:()=>ov,quotelessJson:()=>aL,promise:()=>oE,preprocess:()=>oR,pipeline:()=>oI,ostring:()=>oT,optional:()=>oA,onumber:()=>oj,oboolean:()=>oO,objectUtil:()=>a4,object:()=>ol,number:()=>s8,nullable:()=>oP,null:()=>oa,never:()=>of,nativeEnum:()=>oS,nan:()=>s7,map:()=>ob,makeIssue:()=>aZ,literal:()=>oM,lazy:()=>o_,late:()=>s6,isValid:()=>aY,isDirty:()=>aJ,isAsync:()=>aX,isAborted:()=>aG,intersection:()=>om,instanceof:()=>s9,getParsedType:()=>aN,getErrorMap:()=>az,function:()=>ow,enum:()=>ox,effect:()=>ok,discriminatedUnion:()=>op,defaultErrorMap:()=>aq,datetimeRegex:()=>sm,date:()=>or,custom:()=>s2,coerce:()=>oC,boolean:()=>ot,bigint:()=>oe,array:()=>ou,any:()=>os,addIssueToContext:()=>aH,ZodVoid:()=>sA,ZodUnknown:()=>sE,ZodUnion:()=>sI,ZodUndefined:()=>sM,ZodType:()=>a3,ZodTuple:()=>sC,ZodTransformer:()=>sH,ZodSymbol:()=>s_,ZodString:()=>sg,ZodSet:()=>sL,ZodSchema:()=>a3,ZodRecord:()=>sN,ZodReadonly:()=>s0,ZodPromise:()=>sU,ZodPipeline:()=>sX,ZodParsedType:()=>aC,ZodOptional:()=>sV,ZodObject:()=>sR,ZodNumber:()=>sv,ZodNullable:()=>sW,ZodNull:()=>sx,ZodNever:()=>sk,ZodNativeEnum:()=>sZ,ZodNaN:()=>sG,ZodMap:()=>sD,ZodLiteral:()=>sB,ZodLazy:()=>sq,ZodIssueCode:()=>aD,ZodIntersection:()=>sO,ZodFunction:()=>s$,ZodFirstPartyTypeKind:()=>s3,ZodError:()=>a$,ZodEnum:()=>sz,ZodEffects:()=>sH,ZodDiscriminatedUnion:()=>sj,ZodDefault:()=>sK,ZodDate:()=>sw,ZodCatch:()=>sQ,ZodBranded:()=>sY,ZodBoolean:()=>sy,ZodBigInt:()=>sb,ZodArray:()=>sP,ZodAny:()=>sS,Schema:()=>a3,ParseStatus:()=>aV,OK:()=>aQ,NEVER:()=>oN,INVALID:()=>aW,EMPTY_PATH:()=>aU,DIRTY:()=>aK,BRAND:()=>sJ}),function(e){e.assertEqual=e=>{},e.assertIs=function(e){},e.assertNever=function(e){throw Error()},e.arrayToEnum=e=>{let t={};for(let r of e)t[r]=r;return t},e.getValidEnumValues=t=>{let r=e.objectKeys(t).filter(e=>"number"!=typeof t[t[e]]),i={};for(let e of r)i[e]=t[e];return e.objectValues(i)},e.objectValues=t=>e.objectKeys(t).map(function(e){return t[e]}),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{let t=[];for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return t},e.find=(e,t)=>{for(let r of e)if(t(r))return r},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&Number.isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,t=" | "){return e.map(e=>"string"==typeof e?`'${e}'`:e).join(t)},e.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t}(a6||(a6={})),(a4||(a4={})).mergeShapes=(e,t)=>({...e,...t});var aC=a6.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),aN=e=>{switch(typeof e){case"undefined":return aC.undefined;case"string":return aC.string;case"number":return Number.isNaN(e)?aC.nan:aC.number;case"boolean":return aC.boolean;case"function":return aC.function;case"bigint":return aC.bigint;case"symbol":return aC.symbol;case"object":if(Array.isArray(e))return aC.array;if(null===e)return aC.null;if(e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch)return aC.promise;if("u">typeof Map&&e instanceof Map)return aC.map;if("u">typeof Set&&e instanceof Set)return aC.set;if("u">typeof Date&&e instanceof Date)return aC.date;return aC.object;default:return aC.unknown}},aD=a6.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),aL=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:");class a$ extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};let t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){let t=e||function(e){return e.message},r={_errors:[]},i=e=>{for(let n of e.issues)if("invalid_union"===n.code)n.unionErrors.map(i);else if("invalid_return_type"===n.code)i(n.returnTypeError);else if("invalid_arguments"===n.code)i(n.argumentsError);else if(0===n.path.length)r._errors.push(t(n));else{let e=r,i=0;for(;ie.message){let t={},r=[];for(let i of this.issues)if(i.path.length>0){let r=i.path[0];t[r]=t[r]||[],t[r].push(e(i))}else r.push(e(i));return{formErrors:r,fieldErrors:t}}get formErrors(){return this.flatten()}}a$.create=e=>new a$(e);var aq=(e,t)=>{let r;switch(e.code){case aD.invalid_type:r=e.received===aC.undefined?"Required":`Expected ${e.expected}, received ${e.received}`;break;case aD.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,a6.jsonStringifyReplacer)}`;break;case aD.unrecognized_keys:r=`Unrecognized key(s) in object: ${a6.joinValues(e.keys,", ")}`;break;case aD.invalid_union:r="Invalid input";break;case aD.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${a6.joinValues(e.options)}`;break;case aD.invalid_enum_value:r=`Invalid enum value. Expected ${a6.joinValues(e.options)}, received '${e.received}'`;break;case aD.invalid_arguments:r="Invalid function arguments";break;case aD.invalid_return_type:r="Invalid function return type";break;case aD.invalid_date:r="Invalid date";break;case aD.invalid_string:"object"==typeof e.validation?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,"number"==typeof e.validation.position&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:a6.assertNever(e.validation):r="regex"!==e.validation?`Invalid ${e.validation}`:"Invalid";break;case aD.too_small:r="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:"number"===e.type||"bigint"===e.type?`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:"date"===e.type?`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:"Invalid input";break;case aD.too_big:r="array"===e.type?`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:"string"===e.type?`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:"number"===e.type?`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"bigint"===e.type?`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:"date"===e.type?`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:"Invalid input";break;case aD.custom:r="Invalid input";break;case aD.invalid_intersection_types:r="Intersection results could not be merged";break;case aD.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case aD.not_finite:r="Number must be finite";break;default:r=t.defaultError,a6.assertNever(e)}return{message:r}},aB=aq;function aF(e){aB=e}function az(){return aB}var aZ=e=>{let{data:t,path:r,errorMaps:i,issueData:n}=e,a=[...r,...n.path||[]],s={...n,path:a};if(void 0!==n.message)return{...n,path:a,message:n.message};let o="";for(let e of i.filter(e=>!!e).slice().reverse())o=e(s,{data:t,defaultError:o}).message;return{...n,path:a,message:o}},aU=[];function aH(e,t){let r=aB,i=aZ({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===aq?void 0:aq].filter(e=>!!e)});e.common.issues.push(i)}class aV{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){let r=[];for(let i of t){if("aborted"===i.status)return aW;"dirty"===i.status&&e.dirty(),r.push(i.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,t){let r=[];for(let e of t){let t=await e.key,i=await e.value;r.push({key:t,value:i})}return aV.mergeObjectSync(e,r)}static mergeObjectSync(e,t){let r={};for(let i of t){let{key:t,value:n}=i;if("aborted"===t.status||"aborted"===n.status)return aW;"dirty"===t.status&&e.dirty(),"dirty"===n.status&&e.dirty(),"__proto__"!==t.value&&("u">typeof n.value||i.alwaysSet)&&(r[t.value]=n.value)}return{status:e.value,value:r}}}var aW=Object.freeze({status:"aborted"}),aK=e=>({status:"dirty",value:e}),aQ=e=>({status:"valid",value:e}),aG=e=>"aborted"===e.status,aJ=e=>"dirty"===e.status,aY=e=>"valid"===e.status,aX=e=>"u">typeof Promise&&e instanceof Promise;!function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:e?.message}(a9||(a9={}));class a0{constructor(e,t,r,i){this._cachedPath=[],this.parent=e,this.data=t,this._path=r,this._key=i}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}var a1=(e,t)=>{if(aY(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let t=new a$(e.common.issues);return this._error=t,this._error}}};function a2(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:i,description:n}=e;if(t&&(r||i))throw Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:n}:{errorMap:(t,n)=>{let{message:a}=e;return"invalid_enum_value"===t.code?{message:a??n.defaultError}:typeof n.data>"u"?{message:a??i??n.defaultError}:"invalid_type"!==t.code?{message:n.defaultError}:{message:a??r??n.defaultError}},description:n}}class a3{get description(){return this._def.description}_getType(e){return aN(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:aN(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new aV,ctx:{common:e.parent.common,data:e.data,parsedType:aN(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let t=this._parse(e);if(aX(t))throw Error("Synchronous parse encountered promise.");return t}_parseAsync(e){return Promise.resolve(this._parse(e))}parse(e,t){let r=this.safeParse(e,t);if(r.success)return r.data;throw r.error}safeParse(e,t){let r={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:aN(e)},i=this._parseSync({data:e,path:r.path,parent:r});return a1(r,i)}"~validate"(e){let t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:aN(e)};if(!this["~standard"].async)try{let r=this._parseSync({data:e,path:[],parent:t});return aY(r)?{value:r.value}:{issues:t.common.issues}}catch(e){e?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(e=>aY(e)?{value:e.value}:{issues:t.common.issues})}async parseAsync(e,t){let r=await this.safeParseAsync(e,t);if(r.success)return r.data;throw r.error}async safeParseAsync(e,t){let r={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:aN(e)},i=this._parse({data:e,path:r.path,parent:r});return a1(r,await (aX(i)?i:Promise.resolve(i)))}refine(e,t){return this._refinement((r,i)=>{let n=e(r),a=()=>i.addIssue({code:aD.custom,..."string"==typeof t||typeof t>"u"?{message:t}:"function"==typeof t?t(r):t});return"u">typeof Promise&&n instanceof Promise?n.then(e=>!!e||(a(),!1)):!!n||(a(),!1)})}refinement(e,t){return this._refinement((r,i)=>!!e(r)||(i.addIssue("function"==typeof t?t(r,i):t),!1))}_refinement(e){return new sH({schema:this,typeName:s3.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:e=>this["~validate"](e)}}optional(){return sV.create(this,this._def)}nullable(){return sW.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return sP.create(this)}promise(){return sU.create(this,this._def)}or(e){return sI.create([this,e],this._def)}and(e){return sO.create(this,e,this._def)}transform(e){return new sH({...a2(this._def),schema:this,typeName:s3.ZodEffects,effect:{type:"transform",transform:e}})}default(e){return new sK({...a2(this._def),innerType:this,defaultValue:"function"==typeof e?e:()=>e,typeName:s3.ZodDefault})}brand(){return new sY({typeName:s3.ZodBranded,type:this,...a2(this._def)})}catch(e){return new sQ({...a2(this._def),innerType:this,catchValue:"function"==typeof e?e:()=>e,typeName:s3.ZodCatch})}describe(e){return new this.constructor({...this._def,description:e})}pipe(e){return sX.create(this,e)}readonly(){return s0.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}var a6,a4,a9,a5,a8=/^c[^\s-]{8,}$/i,a7=/^[0-9a-z]+$/,se=/^[0-9A-HJKMNP-TV-Z]{26}$/i,st=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,sr=/^[a-z0-9_-]{21}$/i,si=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,sn=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,sa=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,ss=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,so=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,sf=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,sh=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,su=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,sl=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,sd="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",sc=RegExp(`^${sd}$`);function sp(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`);let r=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${r}`}function sm(e){let t=`${sd}T${sp(e)}`,r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,RegExp(`^${t}$`)}class sg extends a3{_parse(e){var t,r,i,n;if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==aC.string){let t=this._getOrReturnCtx(e);return aH(t,{code:aD.invalid_type,expected:aC.string,received:t.parsedType}),aW}let a=new aV,s;for(let o of this._def.checks)if("min"===o.kind)e.data.lengtho.value&&(aH(s=this._getOrReturnCtx(e,s),{code:aD.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),a.dirty());else if("length"===o.kind){let t=e.data.length>o.value,r=e.data.lengthe.test(t),{validation:t,code:aD.invalid_string,...a9.errToObj(r)})}_addCheck(e){return new sg({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...a9.errToObj(e)})}url(e){return this._addCheck({kind:"url",...a9.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...a9.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...a9.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...a9.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...a9.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...a9.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...a9.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...a9.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...a9.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...a9.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...a9.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...a9.errToObj(e)})}datetime(e){return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...a9.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return"string"==typeof e?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...a9.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...a9.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,...a9.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,...a9.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,...a9.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,...a9.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,...a9.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,...a9.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,...a9.errToObj(t)})}nonempty(e){return this.min(1,a9.errToObj(e))}trim(){return new sg({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new sg({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new sg({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>"datetime"===e.kind)}get isDate(){return!!this._def.checks.find(e=>"date"===e.kind)}get isTime(){return!!this._def.checks.find(e=>"time"===e.kind)}get isDuration(){return!!this._def.checks.find(e=>"duration"===e.kind)}get isEmail(){return!!this._def.checks.find(e=>"email"===e.kind)}get isURL(){return!!this._def.checks.find(e=>"url"===e.kind)}get isEmoji(){return!!this._def.checks.find(e=>"emoji"===e.kind)}get isUUID(){return!!this._def.checks.find(e=>"uuid"===e.kind)}get isNANOID(){return!!this._def.checks.find(e=>"nanoid"===e.kind)}get isCUID(){return!!this._def.checks.find(e=>"cuid"===e.kind)}get isCUID2(){return!!this._def.checks.find(e=>"cuid2"===e.kind)}get isULID(){return!!this._def.checks.find(e=>"ulid"===e.kind)}get isIP(){return!!this._def.checks.find(e=>"ip"===e.kind)}get isCIDR(){return!!this._def.checks.find(e=>"cidr"===e.kind)}get isBase64(){return!!this._def.checks.find(e=>"base64"===e.kind)}get isBase64url(){return!!this._def.checks.find(e=>"base64url"===e.kind)}get minLength(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.valuenew sg({checks:[],typeName:s3.ZodString,coerce:e?.coerce??!1,...a2(e)});class sv extends a3{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==aC.number){let t=this._getOrReturnCtx(e);return aH(t,{code:aD.invalid_type,expected:aC.number,received:t.parsedType}),aW}let t,r=new aV;for(let i of this._def.checks)"int"===i.kind?a6.isInteger(e.data)||(aH(t=this._getOrReturnCtx(e,t),{code:aD.invalid_type,expected:"integer",received:"float",message:i.message}),r.dirty()):"min"===i.kind?(i.inclusive?e.datai.value:e.data>=i.value)&&(aH(t=this._getOrReturnCtx(e,t),{code:aD.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),r.dirty()):"multipleOf"===i.kind?0!==function(e,t){let r=(e.toString().split(".")[1]||"").length,i=(t.toString().split(".")[1]||"").length,n=r>i?r:i;return Number.parseInt(e.toFixed(n).replace(".",""))%Number.parseInt(t.toFixed(n).replace(".",""))/10**n}(e.data,i.value)&&(aH(t=this._getOrReturnCtx(e,t),{code:aD.not_multiple_of,multipleOf:i.value,message:i.message}),r.dirty()):"finite"===i.kind?Number.isFinite(e.data)||(aH(t=this._getOrReturnCtx(e,t),{code:aD.not_finite,message:i.message}),r.dirty()):a6.assertNever(i);return{status:r.value,value:e.data}}gte(e,t){return this.setLimit("min",e,!0,a9.toString(t))}gt(e,t){return this.setLimit("min",e,!1,a9.toString(t))}lte(e,t){return this.setLimit("max",e,!0,a9.toString(t))}lt(e,t){return this.setLimit("max",e,!1,a9.toString(t))}setLimit(e,t,r,i){return new sv({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:a9.toString(i)}]})}_addCheck(e){return new sv({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:a9.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:a9.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:a9.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:a9.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:a9.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:a9.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:a9.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:a9.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:a9.toString(e)})}get minValue(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.value"int"===e.kind||"multipleOf"===e.kind&&a6.isInteger(e.value))}get isFinite(){let e=null,t=null;for(let r of this._def.checks)if("finite"===r.kind||"int"===r.kind||"multipleOf"===r.kind)return!0;else"min"===r.kind?(null===t||r.value>t)&&(t=r.value):"max"===r.kind&&(null===e||r.valuenew sv({checks:[],typeName:s3.ZodNumber,coerce:e?.coerce||!1,...a2(e)});class sb extends a3{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==aC.bigint)return this._getInvalidInput(e);let t,r=new aV;for(let i of this._def.checks)"min"===i.kind?(i.inclusive?e.datai.value:e.data>=i.value)&&(aH(t=this._getOrReturnCtx(e,t),{code:aD.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),r.dirty()):"multipleOf"===i.kind?e.data%i.value!==BigInt(0)&&(aH(t=this._getOrReturnCtx(e,t),{code:aD.not_multiple_of,multipleOf:i.value,message:i.message}),r.dirty()):a6.assertNever(i);return{status:r.value,value:e.data}}_getInvalidInput(e){let t=this._getOrReturnCtx(e);return aH(t,{code:aD.invalid_type,expected:aC.bigint,received:t.parsedType}),aW}gte(e,t){return this.setLimit("min",e,!0,a9.toString(t))}gt(e,t){return this.setLimit("min",e,!1,a9.toString(t))}lte(e,t){return this.setLimit("max",e,!0,a9.toString(t))}lt(e,t){return this.setLimit("max",e,!1,a9.toString(t))}setLimit(e,t,r,i){return new sb({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:r,message:a9.toString(i)}]})}_addCheck(e){return new sb({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:a9.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:a9.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:a9.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:a9.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:a9.toString(t)})}get minValue(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.valuenew sb({checks:[],typeName:s3.ZodBigInt,coerce:e?.coerce??!1,...a2(e)});class sy extends a3{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==aC.boolean){let t=this._getOrReturnCtx(e);return aH(t,{code:aD.invalid_type,expected:aC.boolean,received:t.parsedType}),aW}return aQ(e.data)}}sy.create=e=>new sy({typeName:s3.ZodBoolean,coerce:e?.coerce||!1,...a2(e)});class sw extends a3{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==aC.date){let t=this._getOrReturnCtx(e);return aH(t,{code:aD.invalid_type,expected:aC.date,received:t.parsedType}),aW}if(Number.isNaN(e.data.getTime()))return aH(this._getOrReturnCtx(e),{code:aD.invalid_date}),aW;let t=new aV,r;for(let i of this._def.checks)"min"===i.kind?e.data.getTime()i.value&&(aH(r=this._getOrReturnCtx(e,r),{code:aD.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),t.dirty()):a6.assertNever(i);return{status:t.value,value:new Date(e.data.getTime())}}_addCheck(e){return new sw({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:a9.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:a9.toString(t)})}get minDate(){let e=null;for(let t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(let t of this._def.checks)"max"===t.kind&&(null===e||t.valuenew sw({checks:[],coerce:e?.coerce||!1,typeName:s3.ZodDate,...a2(e)});class s_ extends a3{_parse(e){if(this._getType(e)!==aC.symbol){let t=this._getOrReturnCtx(e);return aH(t,{code:aD.invalid_type,expected:aC.symbol,received:t.parsedType}),aW}return aQ(e.data)}}s_.create=e=>new s_({typeName:s3.ZodSymbol,...a2(e)});class sM extends a3{_parse(e){if(this._getType(e)!==aC.undefined){let t=this._getOrReturnCtx(e);return aH(t,{code:aD.invalid_type,expected:aC.undefined,received:t.parsedType}),aW}return aQ(e.data)}}sM.create=e=>new sM({typeName:s3.ZodUndefined,...a2(e)});class sx extends a3{_parse(e){if(this._getType(e)!==aC.null){let t=this._getOrReturnCtx(e);return aH(t,{code:aD.invalid_type,expected:aC.null,received:t.parsedType}),aW}return aQ(e.data)}}sx.create=e=>new sx({typeName:s3.ZodNull,...a2(e)});class sS extends a3{constructor(){super(...arguments),this._any=!0}_parse(e){return aQ(e.data)}}sS.create=e=>new sS({typeName:s3.ZodAny,...a2(e)});class sE extends a3{constructor(){super(...arguments),this._unknown=!0}_parse(e){return aQ(e.data)}}sE.create=e=>new sE({typeName:s3.ZodUnknown,...a2(e)});class sk extends a3{_parse(e){let t=this._getOrReturnCtx(e);return aH(t,{code:aD.invalid_type,expected:aC.never,received:t.parsedType}),aW}}sk.create=e=>new sk({typeName:s3.ZodNever,...a2(e)});class sA extends a3{_parse(e){if(this._getType(e)!==aC.undefined){let t=this._getOrReturnCtx(e);return aH(t,{code:aD.invalid_type,expected:aC.void,received:t.parsedType}),aW}return aQ(e.data)}}sA.create=e=>new sA({typeName:s3.ZodVoid,...a2(e)});class sP extends a3{_parse(e){let{ctx:t,status:r}=this._processInputParams(e),i=this._def;if(t.parsedType!==aC.array)return aH(t,{code:aD.invalid_type,expected:aC.array,received:t.parsedType}),aW;if(null!==i.exactLength){let e=t.data.length>i.exactLength.value,n=t.data.lengthi.maxLength.value&&(aH(t,{code:aD.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),r.dirty()),t.common.async)return Promise.all([...t.data].map((e,r)=>i.type._parseAsync(new a0(t,e,t.path,r)))).then(e=>aV.mergeArray(r,e));let n=[...t.data].map((e,r)=>i.type._parseSync(new a0(t,e,t.path,r)));return aV.mergeArray(r,n)}get element(){return this._def.type}min(e,t){return new sP({...this._def,minLength:{value:e,message:a9.toString(t)}})}max(e,t){return new sP({...this._def,maxLength:{value:e,message:a9.toString(t)}})}length(e,t){return new sP({...this._def,exactLength:{value:e,message:a9.toString(t)}})}nonempty(e){return this.min(1,e)}}sP.create=(e,t)=>new sP({type:e,minLength:null,maxLength:null,exactLength:null,typeName:s3.ZodArray,...a2(t)});class sR extends a3{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;let e=this._def.shape(),t=a6.objectKeys(e);return this._cached={shape:e,keys:t},this._cached}_parse(e){if(this._getType(e)!==aC.object){let t=this._getOrReturnCtx(e);return aH(t,{code:aD.invalid_type,expected:aC.object,received:t.parsedType}),aW}let{status:t,ctx:r}=this._processInputParams(e),{shape:i,keys:n}=this._getCached(),a=[];if(!(this._def.catchall instanceof sk&&"strip"===this._def.unknownKeys))for(let e in r.data)n.includes(e)||a.push(e);let s=[];for(let e of n){let t=i[e],n=r.data[e];s.push({key:{status:"valid",value:e},value:t._parse(new a0(r,n,r.path,e)),alwaysSet:e in r.data})}if(this._def.catchall instanceof sk){let e=this._def.unknownKeys;if("passthrough"===e)for(let e of a)s.push({key:{status:"valid",value:e},value:{status:"valid",value:r.data[e]}});else if("strict"===e)a.length>0&&(aH(r,{code:aD.unrecognized_keys,keys:a}),t.dirty());else if("strip"===e);else throw Error("Internal ZodObject error: invalid unknownKeys value.")}else{let e=this._def.catchall;for(let t of a){let i=r.data[t];s.push({key:{status:"valid",value:t},value:e._parse(new a0(r,i,r.path,t)),alwaysSet:t in r.data})}}return r.common.async?Promise.resolve().then(async()=>{let e=[];for(let t of s){let r=await t.key,i=await t.value;e.push({key:r,value:i,alwaysSet:t.alwaysSet})}return e}).then(e=>aV.mergeObjectSync(t,e)):aV.mergeObjectSync(t,s)}get shape(){return this._def.shape()}strict(e){return a9.errToObj,new sR({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,r)=>{let i=this._def.errorMap?.(t,r).message??r.defaultError;return"unrecognized_keys"===t.code?{message:a9.errToObj(e).message??i}:{message:i}}}:{}})}strip(){return new sR({...this._def,unknownKeys:"strip"})}passthrough(){return new sR({...this._def,unknownKeys:"passthrough"})}extend(e){return new sR({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new sR({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:s3.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new sR({...this._def,catchall:e})}pick(e){let t={};for(let r of a6.objectKeys(e))e[r]&&this.shape[r]&&(t[r]=this.shape[r]);return new sR({...this._def,shape:()=>t})}omit(e){let t={};for(let r of a6.objectKeys(this.shape))e[r]||(t[r]=this.shape[r]);return new sR({...this._def,shape:()=>t})}deepPartial(){return function e(t){if(t instanceof sR){let r={};for(let i in t.shape){let n=t.shape[i];r[i]=sV.create(e(n))}return new sR({...t._def,shape:()=>r})}if(t instanceof sP)return new sP({...t._def,type:e(t.element)});if(t instanceof sV)return sV.create(e(t.unwrap()));if(t instanceof sW)return sW.create(e(t.unwrap()));if(t instanceof sC)return sC.create(t.items.map(t=>e(t)));else return t}(this)}partial(e){let t={};for(let r of a6.objectKeys(this.shape)){let i=this.shape[r];e&&!e[r]?t[r]=i:t[r]=i.optional()}return new sR({...this._def,shape:()=>t})}required(e){let t={};for(let r of a6.objectKeys(this.shape))if(e&&!e[r])t[r]=this.shape[r];else{let e=this.shape[r];for(;e instanceof sV;)e=e._def.innerType;t[r]=e}return new sR({...this._def,shape:()=>t})}keyof(){return sF(a6.objectKeys(this.shape))}}sR.create=(e,t)=>new sR({shape:()=>e,unknownKeys:"strip",catchall:sk.create(),typeName:s3.ZodObject,...a2(t)}),sR.strictCreate=(e,t)=>new sR({shape:()=>e,unknownKeys:"strict",catchall:sk.create(),typeName:s3.ZodObject,...a2(t)}),sR.lazycreate=(e,t)=>new sR({shape:e,unknownKeys:"strip",catchall:sk.create(),typeName:s3.ZodObject,...a2(t)});class sI extends a3{_parse(e){let{ctx:t}=this._processInputParams(e),r=this._def.options;if(t.common.async)return Promise.all(r.map(async e=>{let r={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:r}),ctx:r}})).then(function(e){for(let t of e)if("valid"===t.result.status)return t.result;for(let r of e)if("dirty"===r.result.status)return t.common.issues.push(...r.ctx.common.issues),r.result;let r=e.map(e=>new a$(e.ctx.common.issues));return aH(t,{code:aD.invalid_union,unionErrors:r}),aW});{let e,i=[];for(let n of r){let r={...t,common:{...t.common,issues:[]},parent:null},a=n._parseSync({data:t.data,path:t.path,parent:r});if("valid"===a.status)return a;"dirty"!==a.status||e||(e={result:a,ctx:r}),r.common.issues.length&&i.push(r.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;let n=i.map(e=>new a$(e));return aH(t,{code:aD.invalid_union,unionErrors:n}),aW}}get options(){return this._def.options}}sI.create=(e,t)=>new sI({options:e,typeName:s3.ZodUnion,...a2(t)});var sT=e=>{if(e instanceof sq)return sT(e.schema);if(e instanceof sH)return sT(e.innerType());if(e instanceof sB)return[e.value];if(e instanceof sz)return e.options;if(e instanceof sZ)return a6.objectValues(e.enum);else if(e instanceof sK)return sT(e._def.innerType);else if(e instanceof sM)return[void 0];else if(e instanceof sx)return[null];else if(e instanceof sV)return[void 0,...sT(e.unwrap())];else if(e instanceof sW)return[null,...sT(e.unwrap())];else if(e instanceof sY)return sT(e.unwrap());else if(e instanceof s0)return sT(e.unwrap());else if(e instanceof sQ)return sT(e._def.innerType);else return[]};class sj extends a3{_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==aC.object)return aH(t,{code:aD.invalid_type,expected:aC.object,received:t.parsedType}),aW;let r=this.discriminator,i=t.data[r],n=this.optionsMap.get(i);return n?t.common.async?n._parseAsync({data:t.data,path:t.path,parent:t}):n._parseSync({data:t.data,path:t.path,parent:t}):(aH(t,{code:aD.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),aW)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,r){let i=new Map;for(let r of t){let t=sT(r.shape[e]);if(!t.length)throw Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let n of t){if(i.has(n))throw Error(`Discriminator property ${String(e)} has duplicate value ${String(n)}`);i.set(n,r)}}return new sj({typeName:s3.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:i,...a2(r)})}}class sO extends a3{_parse(e){let{status:t,ctx:r}=this._processInputParams(e),i=(e,i)=>{if(aG(e)||aG(i))return aW;let n=function e(t,r){let i=aN(t),n=aN(r);if(t===r)return{valid:!0,data:t};if(i===aC.object&&n===aC.object){let i=a6.objectKeys(r),n=a6.objectKeys(t).filter(e=>-1!==i.indexOf(e)),a={...t,...r};for(let i of n){let n=e(t[i],r[i]);if(!n.valid)return{valid:!1};a[i]=n.data}return{valid:!0,data:a}}if(i===aC.array&&n===aC.array){if(t.length!==r.length)return{valid:!1};let i=[];for(let n=0;ni(e,t)):i(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}}sO.create=(e,t,r)=>new sO({left:e,right:t,typeName:s3.ZodIntersection,...a2(r)});class sC extends a3{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==aC.array)return aH(r,{code:aD.invalid_type,expected:aC.array,received:r.parsedType}),aW;if(r.data.lengththis._def.items.length&&(aH(r,{code:aD.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());let i=[...r.data].map((e,t)=>{let i=this._def.items[t]||this._def.rest;return i?i._parse(new a0(r,e,r.path,t)):null}).filter(e=>!!e);return r.common.async?Promise.all(i).then(e=>aV.mergeArray(t,e)):aV.mergeArray(t,i)}get items(){return this._def.items}rest(e){return new sC({...this._def,rest:e})}}sC.create=(e,t)=>{if(!Array.isArray(e))throw Error("You must pass an array of schemas to z.tuple([ ... ])");return new sC({items:e,typeName:s3.ZodTuple,rest:null,...a2(t)})};class sN extends a3{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==aC.object)return aH(r,{code:aD.invalid_type,expected:aC.object,received:r.parsedType}),aW;let i=[],n=this._def.keyType,a=this._def.valueType;for(let e in r.data)i.push({key:n._parse(new a0(r,e,r.path,e)),value:a._parse(new a0(r,r.data[e],r.path,e)),alwaysSet:e in r.data});return r.common.async?aV.mergeObjectAsync(t,i):aV.mergeObjectSync(t,i)}get element(){return this._def.valueType}static create(e,t,r){return new sN(t instanceof a3?{keyType:e,valueType:t,typeName:s3.ZodRecord,...a2(r)}:{keyType:sg.create(),valueType:e,typeName:s3.ZodRecord,...a2(t)})}}class sD extends a3{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==aC.map)return aH(r,{code:aD.invalid_type,expected:aC.map,received:r.parsedType}),aW;let i=this._def.keyType,n=this._def.valueType,a=[...r.data.entries()].map(([e,t],a)=>({key:i._parse(new a0(r,e,r.path,[a,"key"])),value:n._parse(new a0(r,t,r.path,[a,"value"]))}));if(r.common.async){let e=new Map;return Promise.resolve().then(async()=>{for(let r of a){let i=await r.key,n=await r.value;if("aborted"===i.status||"aborted"===n.status)return aW;("dirty"===i.status||"dirty"===n.status)&&t.dirty(),e.set(i.value,n.value)}return{status:t.value,value:e}})}{let e=new Map;for(let r of a){let{key:i,value:n}=r;if("aborted"===i.status||"aborted"===n.status)return aW;("dirty"===i.status||"dirty"===n.status)&&t.dirty(),e.set(i.value,n.value)}return{status:t.value,value:e}}}}sD.create=(e,t,r)=>new sD({valueType:t,keyType:e,typeName:s3.ZodMap,...a2(r)});class sL extends a3{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.parsedType!==aC.set)return aH(r,{code:aD.invalid_type,expected:aC.set,received:r.parsedType}),aW;let i=this._def;null!==i.minSize&&r.data.sizei.maxSize.value&&(aH(r,{code:aD.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),t.dirty());let n=this._def.valueType;function a(e){let r=new Set;for(let i of e){if("aborted"===i.status)return aW;"dirty"===i.status&&t.dirty(),r.add(i.value)}return{status:t.value,value:r}}let s=[...r.data.values()].map((e,t)=>n._parse(new a0(r,e,r.path,t)));return r.common.async?Promise.all(s).then(e=>a(e)):a(s)}min(e,t){return new sL({...this._def,minSize:{value:e,message:a9.toString(t)}})}max(e,t){return new sL({...this._def,maxSize:{value:e,message:a9.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}sL.create=(e,t)=>new sL({valueType:e,minSize:null,maxSize:null,typeName:s3.ZodSet,...a2(t)});class s$ extends a3{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:t}=this._processInputParams(e);if(t.parsedType!==aC.function)return aH(t,{code:aD.invalid_type,expected:aC.function,received:t.parsedType}),aW;function r(e,r){return aZ({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,aB,aq].filter(e=>!!e),issueData:{code:aD.invalid_arguments,argumentsError:r}})}function i(e,r){return aZ({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,aB,aq].filter(e=>!!e),issueData:{code:aD.invalid_return_type,returnTypeError:r}})}let n={errorMap:t.common.contextualErrorMap},a=t.data;if(this._def.returns instanceof sU){let e=this;return aQ(async function(...t){let s=new a$([]),o=await e._def.args.parseAsync(t,n).catch(e=>{throw s.addIssue(r(t,e)),s}),f=await Reflect.apply(a,this,o);return await e._def.returns._def.type.parseAsync(f,n).catch(e=>{throw s.addIssue(i(f,e)),s})})}{let e=this;return aQ(function(...t){let s=e._def.args.safeParse(t,n);if(!s.success)throw new a$([r(t,s.error)]);let o=Reflect.apply(a,this,s.data),f=e._def.returns.safeParse(o,n);if(!f.success)throw new a$([i(o,f.error)]);return f.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new s$({...this._def,args:sC.create(e).rest(sE.create())})}returns(e){return new s$({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,r){return new s$({args:e||sC.create([]).rest(sE.create()),returns:t||sE.create(),typeName:s3.ZodFunction,...a2(r)})}}class sq extends a3{get schema(){return this._def.getter()}_parse(e){let{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}sq.create=(e,t)=>new sq({getter:e,typeName:s3.ZodLazy,...a2(t)});class sB extends a3{_parse(e){if(e.data!==this._def.value){let t=this._getOrReturnCtx(e);return aH(t,{received:t.data,code:aD.invalid_literal,expected:this._def.value}),aW}return{status:"valid",value:e.data}}get value(){return this._def.value}}function sF(e,t){return new sz({values:e,typeName:s3.ZodEnum,...a2(t)})}sB.create=(e,t)=>new sB({value:e,typeName:s3.ZodLiteral,...a2(t)});class sz extends a3{_parse(e){if("string"!=typeof e.data){let t=this._getOrReturnCtx(e),r=this._def.values;return aH(t,{expected:a6.joinValues(r),received:t.parsedType,code:aD.invalid_type}),aW}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let t=this._getOrReturnCtx(e),r=this._def.values;return aH(t,{received:t.data,code:aD.invalid_enum_value,options:r}),aW}return aQ(e.data)}get options(){return this._def.values}get enum(){let e={};for(let t of this._def.values)e[t]=t;return e}get Values(){let e={};for(let t of this._def.values)e[t]=t;return e}get Enum(){let e={};for(let t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return sz.create(e,{...this._def,...t})}exclude(e,t=this._def){return sz.create(this.options.filter(t=>!e.includes(t)),{...this._def,...t})}}sz.create=sF;class sZ extends a3{_parse(e){let t=a6.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==aC.string&&r.parsedType!==aC.number){let e=a6.objectValues(t);return aH(r,{expected:a6.joinValues(e),received:r.parsedType,code:aD.invalid_type}),aW}if(this._cache||(this._cache=new Set(a6.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let e=a6.objectValues(t);return aH(r,{received:r.data,code:aD.invalid_enum_value,options:e}),aW}return aQ(e.data)}get enum(){return this._def.values}}sZ.create=(e,t)=>new sZ({values:e,typeName:s3.ZodNativeEnum,...a2(t)});class sU extends a3{unwrap(){return this._def.type}_parse(e){let{ctx:t}=this._processInputParams(e);return t.parsedType!==aC.promise&&!1===t.common.async?(aH(t,{code:aD.invalid_type,expected:aC.promise,received:t.parsedType}),aW):aQ((t.parsedType===aC.promise?t.data:Promise.resolve(t.data)).then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}}sU.create=(e,t)=>new sU({type:e,typeName:s3.ZodPromise,...a2(t)});class sH extends a3{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===s3.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:t,ctx:r}=this._processInputParams(e),i=this._def.effect||null,n={addIssue:e=>{(aH(r,e),e.fatal)?t.abort():t.dirty()},get path(){return r.path}};if(n.addIssue=n.addIssue.bind(n),"preprocess"===i.type){let e=i.transform(r.data,n);if(r.common.async)return Promise.resolve(e).then(async e=>{if("aborted"===t.value)return aW;let i=await this._def.schema._parseAsync({data:e,path:r.path,parent:r});return"aborted"===i.status?aW:"dirty"===i.status||"dirty"===t.value?aK(i.value):i});{if("aborted"===t.value)return aW;let i=this._def.schema._parseSync({data:e,path:r.path,parent:r});return"aborted"===i.status?aW:"dirty"===i.status||"dirty"===t.value?aK(i.value):i}}if("refinement"===i.type){let e=e=>{let t=i.refinement(e,n);if(r.common.async)return Promise.resolve(t);if(t instanceof Promise)throw Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1!==r.common.async)return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(r=>"aborted"===r.status?aW:("dirty"===r.status&&t.dirty(),e(r.value).then(()=>({status:t.value,value:r.value}))));{let i=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===i.status?aW:("dirty"===i.status&&t.dirty(),e(i.value),{status:t.value,value:i.value})}}if("transform"===i.type)if(!1!==r.common.async)return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(e=>aY(e)?Promise.resolve(i.transform(e.value,n)).then(e=>({status:t.value,value:e})):aW);else{let e=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!aY(e))return aW;let a=i.transform(e.value,n);if(a instanceof Promise)throw Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:t.value,value:a}}a6.assertNever(i)}}sH.create=(e,t,r)=>new sH({schema:e,typeName:s3.ZodEffects,effect:t,...a2(r)}),sH.createWithPreprocess=(e,t,r)=>new sH({schema:t,effect:{type:"preprocess",transform:e},typeName:s3.ZodEffects,...a2(r)});class sV extends a3{_parse(e){return this._getType(e)===aC.undefined?aQ(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}sV.create=(e,t)=>new sV({innerType:e,typeName:s3.ZodOptional,...a2(t)});class sW extends a3{_parse(e){return this._getType(e)===aC.null?aQ(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}sW.create=(e,t)=>new sW({innerType:e,typeName:s3.ZodNullable,...a2(t)});class sK extends a3{_parse(e){let{ctx:t}=this._processInputParams(e),r=t.data;return t.parsedType===aC.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}sK.create=(e,t)=>new sK({innerType:e,typeName:s3.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...a2(t)});class sQ extends a3{_parse(e){let{ctx:t}=this._processInputParams(e),r={...t,common:{...t.common,issues:[]}},i=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return aX(i)?i.then(e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new a$(r.common.issues)},input:r.data})})):{status:"valid",value:"valid"===i.status?i.value:this._def.catchValue({get error(){return new a$(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}}sQ.create=(e,t)=>new sQ({innerType:e,typeName:s3.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...a2(t)});class sG extends a3{_parse(e){if(this._getType(e)!==aC.nan){let t=this._getOrReturnCtx(e);return aH(t,{code:aD.invalid_type,expected:aC.nan,received:t.parsedType}),aW}return{status:"valid",value:e.data}}}sG.create=e=>new sG({typeName:s3.ZodNaN,...a2(e)});var sJ=Symbol("zod_brand");class sY extends a3{_parse(e){let{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}}class sX extends a3{_parse(e){let{status:t,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{let e=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?aW:"dirty"===e.status?(t.dirty(),aK(e.value)):this._def.out._parseAsync({data:e.value,path:r.path,parent:r})})();{let e=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return"aborted"===e.status?aW:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:r.path,parent:r})}}static create(e,t){return new sX({in:e,out:t,typeName:s3.ZodPipeline})}}class s0 extends a3{_parse(e){let t=this._def.innerType._parse(e),r=e=>(aY(e)&&(e.value=Object.freeze(e.value)),e);return aX(t)?t.then(e=>r(e)):r(t)}unwrap(){return this._def.innerType}}function s1(e,t){let r="function"==typeof e?e(t):"string"==typeof e?{message:e}:e;return"string"==typeof r?{message:r}:r}function s2(e,t={},r){return e?sS.create().superRefine((i,n)=>{let a=e(i);if(a instanceof Promise)return a.then(e=>{if(!e){let e=s1(t,i),a=e.fatal??r??!0;n.addIssue({code:"custom",...e,fatal:a})}});if(!a){let e=s1(t,i),a=e.fatal??r??!0;n.addIssue({code:"custom",...e,fatal:a})}}):sS.create()}s0.create=(e,t)=>new s0({innerType:e,typeName:s3.ZodReadonly,...a2(t)});var s3,s6={object:sR.lazycreate};!function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"}(s3||(s3={}));var s4,s9=(e,t={message:`Input not instance of ${e.name}`})=>s2(t=>t instanceof e,t),s5=sg.create,s8=sv.create,s7=sG.create,oe=sb.create,ot=sy.create,or=sw.create,oi=s_.create,on=sM.create,oa=sx.create,os=sS.create,oo=sE.create,of=sk.create,oh=sA.create,ou=sP.create,ol=sR.create,od=sR.strictCreate,oc=sI.create,op=sj.create,om=sO.create,og=sC.create,ov=sN.create,ob=sD.create,oy=sL.create,ow=s$.create,o_=sq.create,oM=sB.create,ox=sz.create,oS=sZ.create,oE=sU.create,ok=sH.create,oA=sV.create,oP=sW.create,oR=sH.createWithPreprocess,oI=sX.create,oT=()=>s5().optional(),oj=()=>s8().optional(),oO=()=>ot().optional(),oC={string:e=>sg.create({...e,coerce:!0}),number:e=>sv.create({...e,coerce:!0}),boolean:e=>sy.create({...e,coerce:!0}),bigint:e=>sb.create({...e,coerce:!0}),date:e=>sw.create({...e,coerce:!0})},oN=aW,oD="2025-06-18",oL=[oD,"2025-03-26","2024-11-05","2024-10-07"],o$=aO.union([aO.string(),aO.number().int()]),oq=aO.string(),oB=aO.object({progressToken:aO.optional(o$)}).passthrough(),oF=aO.object({_meta:aO.optional(oB)}).passthrough(),oz=aO.object({method:aO.string(),params:aO.optional(oF)}),oZ=aO.object({_meta:aO.optional(aO.object({}).passthrough())}).passthrough(),oU=aO.object({method:aO.string(),params:aO.optional(oZ)}),oH=aO.object({_meta:aO.optional(aO.object({}).passthrough())}).passthrough(),oV=aO.union([aO.string(),aO.number().int()]),oW=aO.object({jsonrpc:aO.literal("2.0"),id:oV}).merge(oz).strict(),oK=aO.object({jsonrpc:aO.literal("2.0")}).merge(oU).strict(),oQ=aO.object({jsonrpc:aO.literal("2.0"),id:oV,result:oH}).strict(),oG=e=>oQ.safeParse(e).success;!function(e){e[e.ConnectionClosed=-32e3]="ConnectionClosed",e[e.RequestTimeout=-32001]="RequestTimeout",e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError"}(s4||(s4={}));var oJ=aO.object({jsonrpc:aO.literal("2.0"),id:oV,error:aO.object({code:aO.number().int(),message:aO.string(),data:aO.optional(aO.unknown())})}).strict(),oY=(aO.union([oW,oK,oQ,oJ]),oH.strict()),oX=oU.extend({method:aO.literal("notifications/cancelled"),params:oZ.extend({requestId:oV,reason:aO.string().optional()})}),o0=aO.object({name:aO.string(),title:aO.optional(aO.string())}).passthrough(),o1=o0.extend({version:aO.string()}),o2=aO.object({experimental:aO.optional(aO.object({}).passthrough()),sampling:aO.optional(aO.object({}).passthrough()),elicitation:aO.optional(aO.object({}).passthrough()),roots:aO.optional(aO.object({listChanged:aO.optional(aO.boolean())}).passthrough())}).passthrough(),o3=oz.extend({method:aO.literal("initialize"),params:oF.extend({protocolVersion:aO.string(),capabilities:o2,clientInfo:o1})}),o6=aO.object({experimental:aO.optional(aO.object({}).passthrough()),logging:aO.optional(aO.object({}).passthrough()),completions:aO.optional(aO.object({}).passthrough()),prompts:aO.optional(aO.object({listChanged:aO.optional(aO.boolean())}).passthrough()),resources:aO.optional(aO.object({subscribe:aO.optional(aO.boolean()),listChanged:aO.optional(aO.boolean())}).passthrough()),tools:aO.optional(aO.object({listChanged:aO.optional(aO.boolean())}).passthrough())}).passthrough(),o4=oH.extend({protocolVersion:aO.string(),capabilities:o6,serverInfo:o1,instructions:aO.optional(aO.string())}),o9=oU.extend({method:aO.literal("notifications/initialized")}),o5=oz.extend({method:aO.literal("ping")}),o8=aO.object({progress:aO.number(),total:aO.optional(aO.number()),message:aO.optional(aO.string())}).passthrough(),o7=oU.extend({method:aO.literal("notifications/progress"),params:oZ.merge(o8).extend({progressToken:o$})}),fe=oz.extend({params:oF.extend({cursor:aO.optional(oq)}).optional()}),ft=oH.extend({nextCursor:aO.optional(oq)}),fr=aO.object({uri:aO.string(),mimeType:aO.optional(aO.string()),_meta:aO.optional(aO.object({}).passthrough())}).passthrough(),fi=fr.extend({text:aO.string()}),fn=aO.string().refine(e=>{try{return atob(e),!0}catch(e){return!1}},{message:"Invalid Base64 string"}),fa=fr.extend({blob:fn}),fs=o0.extend({uri:aO.string(),description:aO.optional(aO.string()),mimeType:aO.optional(aO.string()),_meta:aO.optional(aO.object({}).passthrough())}),fo=o0.extend({uriTemplate:aO.string(),description:aO.optional(aO.string()),mimeType:aO.optional(aO.string()),_meta:aO.optional(aO.object({}).passthrough())}),ff=fe.extend({method:aO.literal("resources/list")}),fh=ft.extend({resources:aO.array(fs)}),fu=fe.extend({method:aO.literal("resources/templates/list")}),fl=ft.extend({resourceTemplates:aO.array(fo)}),fd=oz.extend({method:aO.literal("resources/read"),params:oF.extend({uri:aO.string()})}),fc=oH.extend({contents:aO.array(aO.union([fi,fa]))}),fp=oU.extend({method:aO.literal("notifications/resources/list_changed")}),fm=oz.extend({method:aO.literal("resources/subscribe"),params:oF.extend({uri:aO.string()})}),fg=oz.extend({method:aO.literal("resources/unsubscribe"),params:oF.extend({uri:aO.string()})}),fv=oU.extend({method:aO.literal("notifications/resources/updated"),params:oZ.extend({uri:aO.string()})}),fb=aO.object({name:aO.string(),description:aO.optional(aO.string()),required:aO.optional(aO.boolean())}).passthrough(),fy=o0.extend({description:aO.optional(aO.string()),arguments:aO.optional(aO.array(fb)),_meta:aO.optional(aO.object({}).passthrough())}),fw=fe.extend({method:aO.literal("prompts/list")}),f_=ft.extend({prompts:aO.array(fy)}),fM=oz.extend({method:aO.literal("prompts/get"),params:oF.extend({name:aO.string(),arguments:aO.optional(aO.record(aO.string()))})}),fx=aO.object({type:aO.literal("text"),text:aO.string(),_meta:aO.optional(aO.object({}).passthrough())}).passthrough(),fS=aO.object({type:aO.literal("image"),data:fn,mimeType:aO.string(),_meta:aO.optional(aO.object({}).passthrough())}).passthrough(),fE=aO.object({type:aO.literal("audio"),data:fn,mimeType:aO.string(),_meta:aO.optional(aO.object({}).passthrough())}).passthrough(),fk=aO.object({type:aO.literal("resource"),resource:aO.union([fi,fa]),_meta:aO.optional(aO.object({}).passthrough())}).passthrough(),fA=fs.extend({type:aO.literal("resource_link")}),fP=aO.union([fx,fS,fE,fA,fk]),fR=aO.object({role:aO.enum(["user","assistant"]),content:fP}).passthrough(),fI=oH.extend({description:aO.optional(aO.string()),messages:aO.array(fR)}),fT=oU.extend({method:aO.literal("notifications/prompts/list_changed")}),fj=aO.object({title:aO.optional(aO.string()),readOnlyHint:aO.optional(aO.boolean()),destructiveHint:aO.optional(aO.boolean()),idempotentHint:aO.optional(aO.boolean()),openWorldHint:aO.optional(aO.boolean())}).passthrough(),fO=o0.extend({description:aO.optional(aO.string()),inputSchema:aO.object({type:aO.literal("object"),properties:aO.optional(aO.object({}).passthrough()),required:aO.optional(aO.array(aO.string()))}).passthrough(),outputSchema:aO.optional(aO.object({type:aO.literal("object"),properties:aO.optional(aO.object({}).passthrough()),required:aO.optional(aO.array(aO.string()))}).passthrough()),annotations:aO.optional(fj),_meta:aO.optional(aO.object({}).passthrough())}),fC=fe.extend({method:aO.literal("tools/list")}),fN=ft.extend({tools:aO.array(fO)}),fD=oH.extend({content:aO.array(fP).default([]),structuredContent:aO.object({}).passthrough().optional(),isError:aO.optional(aO.boolean())}),fL=(fD.or(oH.extend({toolResult:aO.unknown()})),oz.extend({method:aO.literal("tools/call"),params:oF.extend({name:aO.string(),arguments:aO.optional(aO.record(aO.unknown()))})})),f$=oU.extend({method:aO.literal("notifications/tools/list_changed")}),fq=aO.enum(["debug","info","notice","warning","error","critical","alert","emergency"]),fB=oz.extend({method:aO.literal("logging/setLevel"),params:oF.extend({level:fq})}),fF=oU.extend({method:aO.literal("notifications/message"),params:oZ.extend({level:fq,logger:aO.optional(aO.string()),data:aO.unknown()})}),fz=aO.object({name:aO.string().optional()}).passthrough(),fZ=aO.object({hints:aO.optional(aO.array(fz)),costPriority:aO.optional(aO.number().min(0).max(1)),speedPriority:aO.optional(aO.number().min(0).max(1)),intelligencePriority:aO.optional(aO.number().min(0).max(1))}).passthrough(),fU=aO.object({role:aO.enum(["user","assistant"]),content:aO.union([fx,fS,fE])}).passthrough(),fH=oz.extend({method:aO.literal("sampling/createMessage"),params:oF.extend({messages:aO.array(fU),systemPrompt:aO.optional(aO.string()),includeContext:aO.optional(aO.enum(["none","thisServer","allServers"])),temperature:aO.optional(aO.number()),maxTokens:aO.number().int(),stopSequences:aO.optional(aO.array(aO.string())),metadata:aO.optional(aO.object({}).passthrough()),modelPreferences:aO.optional(fZ)})}),fV=oH.extend({model:aO.string(),stopReason:aO.optional(aO.enum(["endTurn","stopSequence","maxTokens"]).or(aO.string())),role:aO.enum(["user","assistant"]),content:aO.discriminatedUnion("type",[fx,fS,fE])}),fW=aO.object({type:aO.literal("boolean"),title:aO.optional(aO.string()),description:aO.optional(aO.string()),default:aO.optional(aO.boolean())}).passthrough(),fK=aO.object({type:aO.literal("string"),title:aO.optional(aO.string()),description:aO.optional(aO.string()),minLength:aO.optional(aO.number()),maxLength:aO.optional(aO.number()),format:aO.optional(aO.enum(["email","uri","date","date-time"]))}).passthrough(),fQ=aO.object({type:aO.enum(["number","integer"]),title:aO.optional(aO.string()),description:aO.optional(aO.string()),minimum:aO.optional(aO.number()),maximum:aO.optional(aO.number())}).passthrough(),fG=aO.object({type:aO.literal("string"),title:aO.optional(aO.string()),description:aO.optional(aO.string()),enum:aO.array(aO.string()),enumNames:aO.optional(aO.array(aO.string()))}).passthrough(),fJ=aO.union([fW,fK,fQ,fG]),fY=oz.extend({method:aO.literal("elicitation/create"),params:oF.extend({message:aO.string(),requestedSchema:aO.object({type:aO.literal("object"),properties:aO.record(aO.string(),fJ),required:aO.optional(aO.array(aO.string()))}).passthrough()})}),fX=oH.extend({action:aO.enum(["accept","decline","cancel"]),content:aO.optional(aO.record(aO.string(),aO.unknown()))}),f0=aO.object({type:aO.literal("ref/resource"),uri:aO.string()}).passthrough(),f1=aO.object({type:aO.literal("ref/prompt"),name:aO.string()}).passthrough(),f2=oz.extend({method:aO.literal("completion/complete"),params:oF.extend({ref:aO.union([f1,f0]),argument:aO.object({name:aO.string(),value:aO.string()}).passthrough(),context:aO.optional(aO.object({arguments:aO.optional(aO.record(aO.string(),aO.string()))}))})}),f3=oH.extend({completion:aO.object({values:aO.array(aO.string()).max(100),total:aO.optional(aO.number().int()),hasMore:aO.optional(aO.boolean())}).passthrough()}),f6=aO.object({uri:aO.string().startsWith("file://"),name:aO.optional(aO.string()),_meta:aO.optional(aO.object({}).passthrough())}).passthrough(),f4=oz.extend({method:aO.literal("roots/list")}),f9=oH.extend({roots:aO.array(f6)}),f5=oU.extend({method:aO.literal("notifications/roots/list_changed")});aO.union([o5,o3,f2,fB,fM,fw,ff,fu,fd,fm,fg,fL,fC]),aO.union([oX,o7,o9,f5]),aO.union([oY,fV,fX,f9]),aO.union([o5,fH,fY,f4]),aO.union([oX,o7,fF,fv,fp,f$,fT]),aO.union([oY,o4,f3,fI,f_,fh,fl,fc,fD,fN]);class f8 extends Error{constructor(e,t,r){super(`MCP error ${e}: ${t}`),this.code=e,this.data=r,this.name="McpError"}}class f7{constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this.setNotificationHandler(oX,e=>{let t=this._requestHandlerAbortControllers.get(e.params.requestId);null==t||t.abort(e.params.reason)}),this.setNotificationHandler(o7,e=>{this._onprogress(e)}),this.setRequestHandler(o5,e=>({}))}_setupTimeout(e,t,r,i,n=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(i,t),startTime:Date.now(),timeout:t,maxTotalTimeout:r,resetTimeoutOnProgress:n,onTimeout:i})}_resetTimeout(e){let t=this._timeoutInfo.get(e);if(!t)return!1;let r=Date.now()-t.startTime;if(t.maxTotalTimeout&&r>=t.maxTotalTimeout)throw this._timeoutInfo.delete(e),new f8(s4.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:t.maxTotalTimeout,totalElapsed:r});return clearTimeout(t.timeoutId),t.timeoutId=setTimeout(t.onTimeout,t.timeout),!0}_cleanupTimeout(e){let t=this._timeoutInfo.get(e);t&&(clearTimeout(t.timeoutId),this._timeoutInfo.delete(e))}async connect(e){var t,r,i;this._transport=e;let n=null==(t=this.transport)?void 0:t.onclose;this._transport.onclose=()=>{null==n||n(),this._onclose()};let a=null==(r=this.transport)?void 0:r.onerror;this._transport.onerror=e=>{null==a||a(e),this._onerror(e)};let s=null==(i=this._transport)?void 0:i.onmessage;this._transport.onmessage=(e,t)=>{if(null==s||s(e,t),oG(e)||oJ.safeParse(e).success)this._onresponse(e);else if(oW.safeParse(e).success)this._onrequest(e,t);else oK.safeParse(e).success?this._onnotification(e):this._onerror(Error(`Unknown message type: ${JSON.stringify(e)}`))},await this._transport.start()}_onclose(){var e;let t=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._pendingDebouncedNotifications.clear(),this._transport=void 0,null==(e=this.onclose)||e.call(this);let r=new f8(s4.ConnectionClosed,"Connection closed");for(let e of t.values())e(r)}_onerror(e){var t;null==(t=this.onerror)||t.call(this,e)}_onnotification(e){var t;let r=null!=(t=this._notificationHandlers.get(e.method))?t:this.fallbackNotificationHandler;void 0!==r&&Promise.resolve().then(()=>r(e)).catch(e=>this._onerror(Error(`Uncaught error in notification handler: ${e}`)))}_onrequest(e,t){var r,i;let n=null!=(r=this._requestHandlers.get(e.method))?r:this.fallbackRequestHandler,a=this._transport;if(void 0===n){null==a||a.send({jsonrpc:"2.0",id:e.id,error:{code:s4.MethodNotFound,message:"Method not found"}}).catch(e=>this._onerror(Error(`Failed to send an error response: ${e}`)));return}let s=new AbortController;this._requestHandlerAbortControllers.set(e.id,s);let o={signal:s.signal,sessionId:null==a?void 0:a.sessionId,_meta:null==(i=e.params)?void 0:i._meta,sendNotification:t=>this.notification(t,{relatedRequestId:e.id}),sendRequest:(t,r,i)=>this.request(t,r,{...i,relatedRequestId:e.id}),authInfo:null==t?void 0:t.authInfo,requestId:e.id,requestInfo:null==t?void 0:t.requestInfo};Promise.resolve().then(()=>n(e,o)).then(t=>{if(!s.signal.aborted)return null==a?void 0:a.send({result:t,jsonrpc:"2.0",id:e.id})},t=>{var r;if(!s.signal.aborted)return null==a?void 0:a.send({jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(t.code)?t.code:s4.InternalError,message:null!=(r=t.message)?r:"Internal error"}})}).catch(e=>this._onerror(Error(`Failed to send response: ${e}`))).finally(()=>{this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){let{progressToken:t,...r}=e.params,i=Number(t),n=this._progressHandlers.get(i);if(!n)return void this._onerror(Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));let a=this._responseHandlers.get(i),s=this._timeoutInfo.get(i);if(s&&a&&s.resetTimeoutOnProgress)try{this._resetTimeout(i)}catch(e){a(e);return}n(r)}_onresponse(e){let t=Number(e.id),r=this._responseHandlers.get(t);if(void 0===r)return void this._onerror(Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));r((this._responseHandlers.delete(t),this._progressHandlers.delete(t),this._cleanupTimeout(t),oG(e))?e:new f8(e.error.code,e.error.message,e.error.data))}get transport(){return this._transport}async close(){var e;await (null==(e=this._transport)?void 0:e.close())}request(e,t,r){let{relatedRequestId:i,resumptionToken:n,onresumptiontoken:a}=null!=r?r:{};return new Promise((s,o)=>{var f,h,u,d,c,p;if(!this._transport)return void o(Error("Not connected"));(null==(f=this._options)?void 0:f.enforceStrictCapabilities)===!0&&this.assertCapabilityForMethod(e.method),null==(h=null==r?void 0:r.signal)||h.throwIfAborted();let m=this._requestMessageId++,g={...e,jsonrpc:"2.0",id:m};(null==r?void 0:r.onprogress)&&(this._progressHandlers.set(m,r.onprogress),g.params={...e.params,_meta:{...(null==(u=e.params)?void 0:u._meta)||{},progressToken:m}});let v=e=>{var t;this._responseHandlers.delete(m),this._progressHandlers.delete(m),this._cleanupTimeout(m),null==(t=this._transport)||t.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:m,reason:String(e)}},{relatedRequestId:i,resumptionToken:n,onresumptiontoken:a}).catch(e=>this._onerror(Error(`Failed to send cancellation: ${e}`))),o(e)};this._responseHandlers.set(m,e=>{var i;if(null==(i=null==r?void 0:r.signal)||!i.aborted){if(e instanceof Error)return o(e);try{let r=t.parse(e.result);s(r)}catch(e){o(e)}}}),null==(d=null==r?void 0:r.signal)||d.addEventListener("abort",()=>{var e;v(null==(e=null==r?void 0:r.signal)?void 0:e.reason)});let b=null!=(c=null==r?void 0:r.timeout)?c:6e4;this._setupTimeout(m,b,null==r?void 0:r.maxTotalTimeout,()=>v(new f8(s4.RequestTimeout,"Request timed out",{timeout:b})),null!=(p=null==r?void 0:r.resetTimeoutOnProgress)&&p),this._transport.send(g,{relatedRequestId:i,resumptionToken:n,onresumptiontoken:a}).catch(e=>{this._cleanupTimeout(m),o(e)})})}async notification(e,t){var r,i;if(!this._transport)throw Error("Not connected");if(this.assertNotificationCapability(e.method),(null!=(i=null==(r=this._options)?void 0:r.debouncedNotificationMethods)?i:[]).includes(e.method)&&!e.params&&!(null==t?void 0:t.relatedRequestId)){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{var r;if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let i={...e,jsonrpc:"2.0"};null==(r=this._transport)||r.send(i,t).catch(e=>this._onerror(e))});return}let n={...e,jsonrpc:"2.0"};await this._transport.send(n,t)}setRequestHandler(e,t){let r=e.shape.method.value;this.assertRequestHandlerCapability(r),this._requestHandlers.set(r,(r,i)=>Promise.resolve(t(e.parse(r),i)))}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,t){this._notificationHandlers.set(e.shape.method.value,r=>Promise.resolve(t(e.parse(r))))}removeNotificationHandler(e){this._notificationHandlers.delete(e)}}var he=((e,t,r)=>{r=null!=e?s(o(e)):{};let i=!t&&e&&e.__esModule?r:f(r,"default",{value:e,enumerable:!0});for(let t of h(e))d.call(i,t)||f(i,t,{get:()=>e[t],enumerable:!0});return i})(nN(),1);class ht extends f7{constructor(e,t){var r;super(t),this._serverInfo=e,this._capabilities=null!=(r=null==t?void 0:t.capabilities)?r:{},this._instructions=null==t?void 0:t.instructions,this.setRequestHandler(o3,e=>this._oninitialize(e)),this.setNotificationHandler(o9,()=>{var e;return null==(e=this.oninitialized)?void 0:e.call(this)})}registerCapabilities(e){var t;if(this.transport)throw Error("Cannot register capabilities after connecting to transport");this._capabilities=(t=this._capabilities,Object.entries(e).reduce((e,[t,r])=>(r&&"object"==typeof r?e[t]=e[t]?{...e[t],...r}:r:e[t]=r,e),{...t}))}assertCapabilityForMethod(e){var t,r,i;switch(e){case"sampling/createMessage":if(!(null==(t=this._clientCapabilities)?void 0:t.sampling))throw Error(`Client does not support sampling (required for ${e})`);break;case"elicitation/create":if(!(null==(r=this._clientCapabilities)?void 0:r.elicitation))throw Error(`Client does not support elicitation (required for ${e})`);break;case"roots/list":if(!(null==(i=this._clientCapabilities)?void 0:i.roots))throw Error(`Client does not support listing roots (required for ${e})`)}}assertNotificationCapability(e){switch(e){case"notifications/message":if(!this._capabilities.logging)throw Error(`Server does not support logging (required for ${e})`);break;case"notifications/resources/updated":case"notifications/resources/list_changed":if(!this._capabilities.resources)throw Error(`Server does not support notifying about resources (required for ${e})`);break;case"notifications/tools/list_changed":if(!this._capabilities.tools)throw Error(`Server does not support notifying of tool list changes (required for ${e})`);break;case"notifications/prompts/list_changed":if(!this._capabilities.prompts)throw Error(`Server does not support notifying of prompt list changes (required for ${e})`)}}assertRequestHandlerCapability(e){switch(e){case"sampling/createMessage":if(!this._capabilities.sampling)throw Error(`Server does not support sampling (required for ${e})`);break;case"logging/setLevel":if(!this._capabilities.logging)throw Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!this._capabilities.prompts)throw Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":if(!this._capabilities.resources)throw Error(`Server does not support resources (required for ${e})`);break;case"tools/call":case"tools/list":if(!this._capabilities.tools)throw Error(`Server does not support tools (required for ${e})`)}}async _oninitialize(e){let t=e.params.protocolVersion;return this._clientCapabilities=e.params.capabilities,this._clientVersion=e.params.clientInfo,{protocolVersion:oL.includes(t)?t:oD,capabilities:this.getCapabilities(),serverInfo:this._serverInfo,...this._instructions&&{instructions:this._instructions}}}getClientCapabilities(){return this._clientCapabilities}getClientVersion(){return this._clientVersion}getCapabilities(){return this._capabilities}async ping(){return this.request({method:"ping"},oY)}async createMessage(e,t){return this.request({method:"sampling/createMessage",params:e},fV,t)}async elicitInput(e,t){let r=await this.request({method:"elicitation/create",params:e},fX,t);if("accept"===r.action&&r.content)try{let t=new he.default,i=t.compile(e.requestedSchema);if(!i(r.content))throw new f8(s4.InvalidParams,`Elicitation response content does not match requested schema: ${t.errorsText(i.errors)}`)}catch(e){if(e instanceof f8)throw e;throw new f8(s4.InternalError,`Error validating elicitation response: ${e}`)}return r}async listRoots(e,t){return this.request({method:"roots/list",params:e},f9,t)}async sendLoggingMessage(e){return this.notification({method:"notifications/message",params:e})}async sendResourceUpdated(e){return this.notification({method:"notifications/resources/updated",params:e})}async sendResourceListChanged(){return this.notification({method:"notifications/resources/list_changed"})}async sendToolListChanged(){return this.notification({method:"notifications/tools/list_changed"})}async sendPromptListChanged(){return this.notification({method:"notifications/prompts/list_changed"})}}var hr=Symbol("Let zodToJsonSchema decide on which parser to use"),hi={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref"};function hn(e,t,r,i){i?.errorMessages&&r&&(e.errorMessage={...e.errorMessage,[t]:r})}function ha(e,t,r,i,n){e[t]=r,hn(e,t,i,n)}function hs(e,t){return hb(e.type._def,t)}var ho=void 0,hf={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(void 0===ho&&(ho=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),ho),ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function hh(e,t){let r={type:"string"};if(e.checks)for(let i of e.checks)switch(i.kind){case"min":ha(r,"minLength","number"==typeof r.minLength?Math.max(r.minLength,i.value):i.value,i.message,t);break;case"max":ha(r,"maxLength","number"==typeof r.maxLength?Math.min(r.maxLength,i.value):i.value,i.message,t);break;case"email":switch(t.emailStrategy){case"format:email":hd(r,"email",i.message,t);break;case"format:idn-email":hd(r,"idn-email",i.message,t);break;case"pattern:zod":hc(r,hf.email,i.message,t)}break;case"url":hd(r,"uri",i.message,t);break;case"uuid":hd(r,"uuid",i.message,t);break;case"regex":hc(r,i.regex,i.message,t);break;case"cuid":hc(r,hf.cuid,i.message,t);break;case"cuid2":hc(r,hf.cuid2,i.message,t);break;case"startsWith":hc(r,RegExp(`^${hu(i.value,t)}`),i.message,t);break;case"endsWith":hc(r,RegExp(`${hu(i.value,t)}$`),i.message,t);break;case"datetime":hd(r,"date-time",i.message,t);break;case"date":hd(r,"date",i.message,t);break;case"time":hd(r,"time",i.message,t);break;case"duration":hd(r,"duration",i.message,t);break;case"length":ha(r,"minLength","number"==typeof r.minLength?Math.max(r.minLength,i.value):i.value,i.message,t),ha(r,"maxLength","number"==typeof r.maxLength?Math.min(r.maxLength,i.value):i.value,i.message,t);break;case"includes":hc(r,RegExp(hu(i.value,t)),i.message,t);break;case"ip":"v6"!==i.version&&hd(r,"ipv4",i.message,t),"v4"!==i.version&&hd(r,"ipv6",i.message,t);break;case"base64url":hc(r,hf.base64url,i.message,t);break;case"jwt":hc(r,hf.jwt,i.message,t);break;case"cidr":"v6"!==i.version&&hc(r,hf.ipv4Cidr,i.message,t),"v4"!==i.version&&hc(r,hf.ipv6Cidr,i.message,t);break;case"emoji":hc(r,hf.emoji(),i.message,t);break;case"ulid":hc(r,hf.ulid,i.message,t);break;case"base64":switch(t.base64Strategy){case"format:binary":hd(r,"binary",i.message,t);break;case"contentEncoding:base64":ha(r,"contentEncoding","base64",i.message,t);break;case"pattern:zod":hc(r,hf.base64,i.message,t)}break;case"nanoid":hc(r,hf.nanoid,i.message,t)}return r}function hu(e,t){return"escape"===t.patternStrategy?function(e){let t="";for(let r=0;re.format)?(e.anyOf||(e.anyOf=[]),e.format&&(e.anyOf.push({format:e.format,...e.errorMessage&&i.errorMessages&&{errorMessage:{format:e.errorMessage.format}}}),delete e.format,e.errorMessage&&(delete e.errorMessage.format,0===Object.keys(e.errorMessage).length))&&delete e.errorMessage,e.anyOf.push({format:t,...r&&i.errorMessages&&{errorMessage:{format:r}}})):ha(e,"format",t,r,i)}function hc(e,t,r,i){e.pattern||e.allOf?.some(e=>e.pattern)?(e.allOf||(e.allOf=[]),e.pattern&&(e.allOf.push({pattern:e.pattern,...e.errorMessage&&i.errorMessages&&{errorMessage:{pattern:e.errorMessage.pattern}}}),delete e.pattern,e.errorMessage&&(delete e.errorMessage.pattern,0===Object.keys(e.errorMessage).length))&&delete e.errorMessage,e.allOf.push({pattern:hp(t,i),...r&&i.errorMessages&&{errorMessage:{pattern:r}}})):ha(e,"pattern",hp(t,i),r,i)}function hp(e,t){if(!t.applyRegexFlags||!e.flags)return e.source;let r={i:e.flags.includes("i"),m:e.flags.includes("m"),s:e.flags.includes("s")},i=r.i?e.source.toLowerCase():e.source,n="",a=!1,s=!1,o=!1;for(let e=0;e({...r,[i]:hb(e.valueType._def,{...t,currentPath:[...t.currentPath,"properties",i]})??{}}),{}),additionalProperties:t.rejectedAdditionalProperties};let r={type:"object",additionalProperties:hb(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]})??t.allowedAdditionalProperties};if("openApi3"===t.target)return r;if(e.keyType?._def.typeName===s3.ZodString&&e.keyType._def.checks?.length){let{type:i,...n}=hh(e.keyType._def,t);return{...r,propertyNames:n}}if(e.keyType?._def.typeName===s3.ZodEnum)return{...r,propertyNames:{enum:e.keyType._def.values}};if(e.keyType?._def.typeName===s3.ZodBranded&&e.keyType._def.type._def.typeName===s3.ZodString&&e.keyType._def.type._def.checks?.length){let{type:i,...n}=hs(e.keyType._def,t);return{...r,propertyNames:n}}return r}var hg={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"},hv=(e,t)=>{let r=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((e,r)=>hb(e._def,{...t,currentPath:[...t.currentPath,"anyOf",`${r}`]})).filter(e=>!!e&&(!t.strictUnions||"object"==typeof e&&Object.keys(e).length>0));return r.length?{anyOf:r}:void 0};function hb(e,t,r=!1){let i=t.seen.get(e);if(t.override){let n=t.override?.(e,t,i,r);if(n!==hr)return n}if(i&&!r){let e=hy(i,t);if(void 0!==e)return e}let n={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,n);let a=((e,t,r)=>{switch(t){case s3.ZodString:return hh(e,r);case s3.ZodNumber:var i,n,a,s,o,f,h,u,d,c,p,m,g,v,b,y,w,_=e,M=r;let x={type:"number"};if(!_.checks)return x;for(let e of _.checks)switch(e.kind){case"int":x.type="integer",hn(x,"type",e.message,M);break;case"min":"jsonSchema7"===M.target?e.inclusive?ha(x,"minimum",e.value,e.message,M):ha(x,"exclusiveMinimum",e.value,e.message,M):(e.inclusive||(x.exclusiveMinimum=!0),ha(x,"minimum",e.value,e.message,M));break;case"max":"jsonSchema7"===M.target?e.inclusive?ha(x,"maximum",e.value,e.message,M):ha(x,"exclusiveMaximum",e.value,e.message,M):(e.inclusive||(x.exclusiveMaximum=!0),ha(x,"maximum",e.value,e.message,M));break;case"multipleOf":ha(x,"multipleOf",e.value,e.message,M)}return x;case s3.ZodObject:return function(e,t){let r="openAi"===t.target,i={type:"object",properties:{}},n=[],a=e.shape();for(let e in a){let s=a[e];if(void 0===s||void 0===s._def)continue;let o=function(e){try{return e.isOptional()}catch{return!0}}(s);o&&r&&(s instanceof sV&&(s=s._def.innerType),s.isNullable()||(s=s.nullable()),o=!1);let f=hb(s._def,{...t,currentPath:[...t.currentPath,"properties",e],propertyPath:[...t.currentPath,"properties",e]});void 0!==f&&(i.properties[e]=f,o||n.push(e))}n.length&&(i.required=n);let s=function(e,t){if("ZodNever"!==e.catchall._def.typeName)return hb(e.catchall._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]});switch(e.unknownKeys){case"passthrough":return t.allowedAdditionalProperties;case"strict":return t.rejectedAdditionalProperties;case"strip":return"strict"===t.removeAdditionalStrategy?t.allowedAdditionalProperties:t.rejectedAdditionalProperties}}(e,t);return void 0!==s&&(i.additionalProperties=s),i}(e,r);case s3.ZodBigInt:var S=e,E=r;let k={type:"integer",format:"int64"};if(!S.checks)return k;for(let e of S.checks)switch(e.kind){case"min":"jsonSchema7"===E.target?e.inclusive?ha(k,"minimum",e.value,e.message,E):ha(k,"exclusiveMinimum",e.value,e.message,E):(e.inclusive||(k.exclusiveMinimum=!0),ha(k,"minimum",e.value,e.message,E));break;case"max":"jsonSchema7"===E.target?e.inclusive?ha(k,"maximum",e.value,e.message,E):ha(k,"exclusiveMaximum",e.value,e.message,E):(e.inclusive||(k.exclusiveMaximum=!0),ha(k,"maximum",e.value,e.message,E));break;case"multipleOf":ha(k,"multipleOf",e.value,e.message,E)}return k;case s3.ZodBoolean:return{type:"boolean"};case s3.ZodDate:return function e(t,r,i){let n=i??r.dateStrategy;if(Array.isArray(n))return{anyOf:n.map((i,n)=>e(t,r,i))};switch(n){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":var a=t,s=r;let o={type:"integer",format:"unix-time"};if("openApi3"===s.target)return o;for(let e of a.checks)switch(e.kind){case"min":ha(o,"minimum",e.value,e.message,s);break;case"max":ha(o,"maximum",e.value,e.message,s)}return o}}(e,r);case s3.ZodUndefined:return{not:{}};case s3.ZodNull:return"openApi3"===r.target?{enum:["null"],nullable:!0}:{type:"null"};case s3.ZodArray:let A;return i=e,n=r,A={type:"array"},i.type?._def&&i.type?._def?.typeName!==s3.ZodAny&&(A.items=hb(i.type._def,{...n,currentPath:[...n.currentPath,"items"]})),i.minLength&&ha(A,"minItems",i.minLength.value,i.minLength.message,n),i.maxLength&&ha(A,"maxItems",i.maxLength.value,i.maxLength.message,n),i.exactLength&&(ha(A,"minItems",i.exactLength.value,i.exactLength.message,n),ha(A,"maxItems",i.exactLength.value,i.exactLength.message,n)),A;case s3.ZodUnion:case s3.ZodDiscriminatedUnion:var P=e,R=r;if("openApi3"===R.target)return hv(P,R);let I=P.options instanceof Map?Array.from(P.options.values()):P.options;if(I.every(e=>e._def.typeName in hg&&(!e._def.checks||!e._def.checks.length))){let e=I.reduce((e,t)=>{let r=hg[t._def.typeName];return r&&!e.includes(r)?[...e,r]:e},[]);return{type:e.length>1?e:e[0]}}if(I.every(e=>"ZodLiteral"===e._def.typeName&&!e.description)){let e=I.reduce((e,t)=>{let r=typeof t._def.value;switch(r){case"string":case"number":case"boolean":return[...e,r];case"bigint":return[...e,"integer"];case"object":if(null===t._def.value)return[...e,"null"];default:return e}},[]);if(e.length===I.length){let t=e.filter((e,t,r)=>r.indexOf(e)===t);return{type:t.length>1?t:t[0],enum:I.reduce((e,t)=>e.includes(t._def.value)?e:[...e,t._def.value],[])}}}else if(I.every(e=>"ZodEnum"===e._def.typeName))return{type:"string",enum:I.reduce((e,t)=>[...e,...t._def.values.filter(t=>!e.includes(t))],[])};return hv(P,R);case s3.ZodIntersection:let T,j,O;return a=e,s=r,T=[hb(a.left._def,{...s,currentPath:[...s.currentPath,"allOf","0"]}),hb(a.right._def,{...s,currentPath:[...s.currentPath,"allOf","1"]})].filter(e=>!!e),j="jsonSchema2019-09"===s.target?{unevaluatedProperties:!1}:void 0,O=[],T.forEach(e=>{if((!("type"in e)||"string"!==e.type)&&"allOf"in e)O.push(...e.allOf),void 0===e.unevaluatedProperties&&(j=void 0);else{let t=e;if("additionalProperties"in e&&!1===e.additionalProperties){let{additionalProperties:r,...i}=e;t=i}else j=void 0;O.push(t)}}),O.length?{allOf:O,...j}:void 0;case s3.ZodTuple:return o=e,f=r,o.rest?{type:"array",minItems:o.items.length,items:o.items.map((e,t)=>hb(e._def,{...f,currentPath:[...f.currentPath,"items",`${t}`]})).reduce((e,t)=>void 0===t?e:[...e,t],[]),additionalItems:hb(o.rest._def,{...f,currentPath:[...f.currentPath,"additionalItems"]})}:{type:"array",minItems:o.items.length,maxItems:o.items.length,items:o.items.map((e,t)=>hb(e._def,{...f,currentPath:[...f.currentPath,"items",`${t}`]})).reduce((e,t)=>void 0===t?e:[...e,t],[])};case s3.ZodRecord:return hm(e,r);case s3.ZodLiteral:let C;return h=e,u=r,"bigint"!=(C=typeof h.value)&&"number"!==C&&"boolean"!==C&&"string"!==C?{type:Array.isArray(h.value)?"array":"object"}:"openApi3"===u.target?{type:"bigint"===C?"integer":C,enum:[h.value]}:{type:"bigint"===C?"integer":C,const:h.value};case s3.ZodEnum:return{type:"string",enum:Array.from(e.values)};case s3.ZodNativeEnum:let N,D,L;return N=(d=e).values,{type:1===(L=Array.from(new Set((D=Object.keys(d.values).filter(e=>"number"!=typeof N[N[e]]).map(e=>N[e])).map(e=>typeof e)))).length?"string"===L[0]?"string":"number":["string","number"],enum:D};case s3.ZodNullable:var $=e,q=r;if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes($.innerType._def.typeName)&&(!$.innerType._def.checks||!$.innerType._def.checks.length))return"openApi3"===q.target?{type:hg[$.innerType._def.typeName],nullable:!0}:{type:[hg[$.innerType._def.typeName],"null"]};if("openApi3"===q.target){let e=hb($.innerType._def,{...q,currentPath:[...q.currentPath]});return e&&"$ref"in e?{allOf:[e],nullable:!0}:e&&{...e,nullable:!0}}let B=hb($.innerType._def,{...q,currentPath:[...q.currentPath,"anyOf","0"]});return B&&{anyOf:[B,{type:"null"}]};case s3.ZodOptional:var F=e,z=r;if(z.currentPath.toString()===z.propertyPath?.toString())return hb(F.innerType._def,z);let Z=hb(F.innerType._def,{...z,currentPath:[...z.currentPath,"anyOf","1"]});return Z?{anyOf:[{not:{}},Z]}:{};case s3.ZodMap:return c=e,"record"===(p=r).mapStrategy?hm(c,p):{type:"array",maxItems:125,items:{type:"array",items:[hb(c.keyType._def,{...p,currentPath:[...p.currentPath,"items","items","0"]})||{},hb(c.valueType._def,{...p,currentPath:[...p.currentPath,"items","items","1"]})||{}],minItems:2,maxItems:2}};case s3.ZodSet:let U;return m=e,g=r,U={type:"array",uniqueItems:!0,items:hb(m.valueType._def,{...g,currentPath:[...g.currentPath,"items"]})},m.minSize&&ha(U,"minItems",m.minSize.value,m.minSize.message,g),m.maxSize&&ha(U,"maxItems",m.maxSize.value,m.maxSize.message,g),U;case s3.ZodLazy:return()=>e.getter()._def;case s3.ZodPromise:return hb(e.type._def,r);case s3.ZodNaN:case s3.ZodNever:return{not:{}};case s3.ZodEffects:return v=e,"input"===(b=r).effectStrategy?hb(v.schema._def,b):{};case s3.ZodAny:case s3.ZodUnknown:return{};case s3.ZodDefault:return y=e,w=r,{...hb(y.innerType._def,w),default:y.defaultValue()};case s3.ZodBranded:return hs(e,r);case s3.ZodReadonly:case s3.ZodCatch:return hb(e.innerType._def,r);case s3.ZodPipeline:var H=e,V=r;if("input"===V.pipeStrategy)return hb(H.in._def,V);if("output"===V.pipeStrategy)return hb(H.out._def,V);let W=hb(H.in._def,{...V,currentPath:[...V.currentPath,"allOf","0"]}),K=hb(H.out._def,{...V,currentPath:[...V.currentPath,"allOf",W?"1":"0"]});return{allOf:[W,K].filter(e=>void 0!==e)};case s3.ZodFunction:case s3.ZodVoid:case s3.ZodSymbol:default:return}})(e,e.typeName,t),s="function"==typeof a?hb(a(),t):a;if(s&&h_(e,t,s),t.postProcess){let r=t.postProcess(s,e,t);return n.jsonSchema=s,r}return n.jsonSchema=s,s}var hy=(e,t)=>{switch(t.$refStrategy){case"root":return{$ref:e.path.join("/")};case"relative":return{$ref:hw(t.currentPath,e.path)};case"none":case"seen":if(e.path.lengtht.currentPath[r]===e))return console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`),{};return"seen"===t.$refStrategy?{}:void 0}},hw=(e,t)=>{let r=0;for(;r(e.description&&(r.description=e.description,t.markdownDescription)&&(r.markdownDescription=e.description),r),hM=(e,t)=>{let r=(e=>{let t=(e=>"string"==typeof e?{...hi,name:e}:{...hi,...e})(e),r=void 0!==t.name?[...t.basePath,t.definitionPath,t.name]:t.basePath;return{...t,currentPath:r,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map(([e,r])=>[r._def,{def:r._def,path:[...t.basePath,t.definitionPath,e],jsonSchema:void 0}]))}})(t),i="object"==typeof t&&t.definitions?Object.entries(t.definitions).reduce((e,[t,i])=>({...e,[t]:hb(i._def,{...r,currentPath:[...r.basePath,r.definitionPath,t]},!0)??{}}),{}):void 0,n="string"==typeof t?t:t?.nameStrategy==="title"?void 0:t?.name,a=hb(e._def,void 0===n?r:{...r,currentPath:[...r.basePath,r.definitionPath,n]},!1)??{},s="object"==typeof t&&void 0!==t.name&&"title"===t.nameStrategy?t.name:void 0;void 0!==s&&(a.title=s);let o=void 0===n?i?{...a,[r.definitionPath]:i}:a:{$ref:[..."relative"===r.$refStrategy?[]:r.basePath,r.definitionPath,n].join("/"),[r.definitionPath]:{...i,[n]:a}};return"jsonSchema7"===r.target?o.$schema="http://json-schema.org/draft-07/schema#":("jsonSchema2019-09"===r.target||"openAi"===r.target)&&(o.$schema="https://json-schema.org/draft/2019-09/schema#"),"openAi"===r.target&&("anyOf"in o||"oneOf"in o||"allOf"in o||"type"in o&&Array.isArray(o.type))&&console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property."),o};(i||(i={})).Completable="McpCompletable";class hx extends a3{_parse(e){let{ctx:t}=this._processInputParams(e),r=t.data;return this._def.type._parse({data:r,path:t.path,parent:t})}unwrap(){return this._def.type}}hx.create=(e,t)=>new hx({type:e,typeName:i.Completable,complete:t.complete,...function(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:i,description:n}=e;if(t&&(r||i))throw Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');return t?{errorMap:t,description:n}:{errorMap:(t,n)=>{var a,s;let{message:o}=e;return"invalid_enum_value"===t.code?{message:null!=o?o:n.defaultError}:typeof n.data>"u"?{message:null!=(a=null!=o?o:i)?a:n.defaultError}:"invalid_type"!==t.code?{message:n.defaultError}:{message:null!=(s=null!=o?o:r)?s:n.defaultError}},description:n}}(t)});class hS{constructor(e,t){this._registeredResources={},this._registeredResourceTemplates={},this._registeredTools={},this._registeredPrompts={},this._toolHandlersInitialized=!1,this._completionHandlerInitialized=!1,this._resourceHandlersInitialized=!1,this._promptHandlersInitialized=!1,this.server=new ht(e,t)}async connect(e){return await this.server.connect(e)}async close(){await this.server.close()}setToolRequestHandlers(){this._toolHandlersInitialized||(this.server.assertCanSetRequestHandler(fC.shape.method.value),this.server.assertCanSetRequestHandler(fL.shape.method.value),this.server.registerCapabilities({tools:{listChanged:!0}}),this.server.setRequestHandler(fC,()=>({tools:Object.entries(this._registeredTools).filter(([,e])=>e.enabled).map(([e,t])=>{let r={name:e,title:t.title,description:t.description,inputSchema:t.inputSchema?hM(t.inputSchema,{strictUnions:!0}):hE,annotations:t.annotations};return t.outputSchema&&(r.outputSchema=hM(t.outputSchema,{strictUnions:!0})),r})})),this.server.setRequestHandler(fL,async(e,t)=>{let r,i=this._registeredTools[e.params.name];if(!i)throw new f8(s4.InvalidParams,`Tool ${e.params.name} not found`);if(!i.enabled)throw new f8(s4.InvalidParams,`Tool ${e.params.name} disabled`);if(i.inputSchema){let n=await i.inputSchema.safeParseAsync(e.params.arguments);if(!n.success)throw new f8(s4.InvalidParams,`Invalid arguments for tool ${e.params.name}: ${n.error.message}`);let a=n.data,s=i.callback;try{r=await Promise.resolve(s(a,t))}catch(e){r={content:[{type:"text",text:e instanceof Error?e.message:String(e)}],isError:!0}}}else{let e=i.callback;try{r=await Promise.resolve(e(t))}catch(e){r={content:[{type:"text",text:e instanceof Error?e.message:String(e)}],isError:!0}}}if(i.outputSchema&&!r.isError){if(!r.structuredContent)throw new f8(s4.InvalidParams,`Tool ${e.params.name} has an output schema but no structured content was provided`);let t=await i.outputSchema.safeParseAsync(r.structuredContent);if(!t.success)throw new f8(s4.InvalidParams,`Invalid structured content for tool ${e.params.name}: ${t.error.message}`)}return r}),this._toolHandlersInitialized=!0)}setCompletionRequestHandler(){this._completionHandlerInitialized||(this.server.assertCanSetRequestHandler(f2.shape.method.value),this.server.registerCapabilities({completions:{}}),this.server.setRequestHandler(f2,async e=>{switch(e.params.ref.type){case"ref/prompt":return this.handlePromptCompletion(e,e.params.ref);case"ref/resource":return this.handleResourceCompletion(e,e.params.ref);default:throw new f8(s4.InvalidParams,`Invalid completion reference: ${e.params.ref}`)}}),this._completionHandlerInitialized=!0)}async handlePromptCompletion(e,t){let r=this._registeredPrompts[t.name];if(!r)throw new f8(s4.InvalidParams,`Prompt ${t.name} not found`);if(!r.enabled)throw new f8(s4.InvalidParams,`Prompt ${t.name} disabled`);if(!r.argsSchema)return hR;let i=r.argsSchema.shape[e.params.argument.name];return i instanceof hx?hP(await i._def.complete(e.params.argument.value,e.params.context)):hR}async handleResourceCompletion(e,t){let r=Object.values(this._registeredResourceTemplates).find(e=>e.resourceTemplate.uriTemplate.toString()===t.uri);if(!r){if(this._registeredResources[t.uri])return hR;throw new f8(s4.InvalidParams,`Resource template ${e.params.ref.uri} not found`)}let i=r.resourceTemplate.completeCallback(e.params.argument.name);return i?hP(await i(e.params.argument.value,e.params.context)):hR}setResourceRequestHandlers(){this._resourceHandlersInitialized||(this.server.assertCanSetRequestHandler(ff.shape.method.value),this.server.assertCanSetRequestHandler(fu.shape.method.value),this.server.assertCanSetRequestHandler(fd.shape.method.value),this.server.registerCapabilities({resources:{listChanged:!0}}),this.server.setRequestHandler(ff,async(e,t)=>{let r=Object.entries(this._registeredResources).filter(([e,t])=>t.enabled).map(([e,t])=>({uri:e,name:t.name,...t.metadata})),i=[];for(let e of Object.values(this._registeredResourceTemplates))if(e.resourceTemplate.listCallback)for(let r of(await e.resourceTemplate.listCallback(t)).resources)i.push({...e.metadata,...r});return{resources:[...r,...i]}}),this.server.setRequestHandler(fu,async()=>({resourceTemplates:Object.entries(this._registeredResourceTemplates).map(([e,t])=>({name:e,uriTemplate:t.resourceTemplate.uriTemplate.toString(),...t.metadata}))})),this.server.setRequestHandler(fd,async(e,t)=>{let r=new URL(e.params.uri),i=this._registeredResources[r.toString()];if(i){if(!i.enabled)throw new f8(s4.InvalidParams,`Resource ${r} disabled`);return i.readCallback(r,t)}for(let e of Object.values(this._registeredResourceTemplates)){let i=e.resourceTemplate.uriTemplate.match(r.toString());if(i)return e.readCallback(r,i,t)}throw new f8(s4.InvalidParams,`Resource ${r} not found`)}),this.setCompletionRequestHandler(),this._resourceHandlersInitialized=!0)}setPromptRequestHandlers(){this._promptHandlersInitialized||(this.server.assertCanSetRequestHandler(fw.shape.method.value),this.server.assertCanSetRequestHandler(fM.shape.method.value),this.server.registerCapabilities({prompts:{listChanged:!0}}),this.server.setRequestHandler(fw,()=>({prompts:Object.entries(this._registeredPrompts).filter(([,e])=>e.enabled).map(([e,t])=>({name:e,title:t.title,description:t.description,arguments:t.argsSchema?Object.entries(t.argsSchema.shape).map(([e,t])=>({name:e,description:t.description,required:!t.isOptional()})):void 0}))})),this.server.setRequestHandler(fM,async(e,t)=>{let r=this._registeredPrompts[e.params.name];if(!r)throw new f8(s4.InvalidParams,`Prompt ${e.params.name} not found`);if(!r.enabled)throw new f8(s4.InvalidParams,`Prompt ${e.params.name} disabled`);if(r.argsSchema){let i=await r.argsSchema.safeParseAsync(e.params.arguments);if(!i.success)throw new f8(s4.InvalidParams,`Invalid arguments for prompt ${e.params.name}: ${i.error.message}`);let n=i.data,a=r.callback;return await Promise.resolve(a(n,t))}{let e=r.callback;return await Promise.resolve(e(t))}}),this.setCompletionRequestHandler(),this._promptHandlersInitialized=!0)}resource(e,t,...r){let i;"object"==typeof r[0]&&(i=r.shift());let n=r[0];if("string"==typeof t){if(this._registeredResources[t])throw Error(`Resource ${t} is already registered`);let r=this._createRegisteredResource(e,void 0,t,i,n);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),r}{if(this._registeredResourceTemplates[e])throw Error(`Resource template ${e} is already registered`);let r=this._createRegisteredResourceTemplate(e,void 0,t,i,n);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),r}}registerResource(e,t,r,i){if("string"==typeof t){if(this._registeredResources[t])throw Error(`Resource ${t} is already registered`);let n=this._createRegisteredResource(e,r.title,t,r,i);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),n}{if(this._registeredResourceTemplates[e])throw Error(`Resource template ${e} is already registered`);let n=this._createRegisteredResourceTemplate(e,r.title,t,r,i);return this.setResourceRequestHandlers(),this.sendResourceListChanged(),n}}_createRegisteredResource(e,t,r,i,n){let a={name:e,title:t,metadata:i,readCallback:n,enabled:!0,disable:()=>a.update({enabled:!1}),enable:()=>a.update({enabled:!0}),remove:()=>a.update({uri:null}),update:e=>{"u">typeof e.uri&&e.uri!==r&&(delete this._registeredResources[r],e.uri)&&(this._registeredResources[e.uri]=a),"u">typeof e.name&&(a.name=e.name),"u">typeof e.title&&(a.title=e.title),"u">typeof e.metadata&&(a.metadata=e.metadata),"u">typeof e.callback&&(a.readCallback=e.callback),"u">typeof e.enabled&&(a.enabled=e.enabled),this.sendResourceListChanged()}};return this._registeredResources[r]=a,a}_createRegisteredResourceTemplate(e,t,r,i,n){let a={resourceTemplate:r,title:t,metadata:i,readCallback:n,enabled:!0,disable:()=>a.update({enabled:!1}),enable:()=>a.update({enabled:!0}),remove:()=>a.update({name:null}),update:t=>{"u">typeof t.name&&t.name!==e&&(delete this._registeredResourceTemplates[e],t.name)&&(this._registeredResourceTemplates[t.name]=a),"u">typeof t.title&&(a.title=t.title),"u">typeof t.template&&(a.resourceTemplate=t.template),"u">typeof t.metadata&&(a.metadata=t.metadata),"u">typeof t.callback&&(a.readCallback=t.callback),"u">typeof t.enabled&&(a.enabled=t.enabled),this.sendResourceListChanged()}};return this._registeredResourceTemplates[e]=a,a}_createRegisteredPrompt(e,t,r,i,n){let a={title:t,description:r,argsSchema:void 0===i?void 0:aO.object(i),callback:n,enabled:!0,disable:()=>a.update({enabled:!1}),enable:()=>a.update({enabled:!0}),remove:()=>a.update({name:null}),update:t=>{"u">typeof t.name&&t.name!==e&&(delete this._registeredPrompts[e],t.name)&&(this._registeredPrompts[t.name]=a),"u">typeof t.title&&(a.title=t.title),"u">typeof t.description&&(a.description=t.description),"u">typeof t.argsSchema&&(a.argsSchema=aO.object(t.argsSchema)),"u">typeof t.callback&&(a.callback=t.callback),"u">typeof t.enabled&&(a.enabled=t.enabled),this.sendPromptListChanged()}};return this._registeredPrompts[e]=a,a}_createRegisteredTool(e,t,r,i,n,a,s){let o={title:t,description:r,inputSchema:void 0===i?void 0:aO.object(i),outputSchema:void 0===n?void 0:aO.object(n),annotations:a,callback:s,enabled:!0,disable:()=>o.update({enabled:!1}),enable:()=>o.update({enabled:!0}),remove:()=>o.update({name:null}),update:t=>{"u">typeof t.name&&t.name!==e&&(delete this._registeredTools[e],t.name)&&(this._registeredTools[t.name]=o),"u">typeof t.title&&(o.title=t.title),"u">typeof t.description&&(o.description=t.description),"u">typeof t.paramsSchema&&(o.inputSchema=aO.object(t.paramsSchema)),"u">typeof t.callback&&(o.callback=t.callback),"u">typeof t.annotations&&(o.annotations=t.annotations),"u">typeof t.enabled&&(o.enabled=t.enabled),this.sendToolListChanged()}};return this._registeredTools[e]=o,this.setToolRequestHandlers(),this.sendToolListChanged(),o}tool(e,...t){let r,i,n,a;if(this._registeredTools[e])throw Error(`Tool ${e} is already registered`);if("string"==typeof t[0]&&(r=t.shift()),t.length>1){let e=t[0];hk(e)?(i=t.shift(),t.length>1&&"object"==typeof t[0]&&null!==t[0]&&!hk(t[0])&&(a=t.shift())):"object"==typeof e&&null!==e&&(a=t.shift())}let s=t[0];return this._createRegisteredTool(e,void 0,r,i,n,a,s)}registerTool(e,t,r){if(this._registeredTools[e])throw Error(`Tool ${e} is already registered`);let{title:i,description:n,inputSchema:a,outputSchema:s,annotations:o}=t;return this._createRegisteredTool(e,i,n,a,s,o,r)}prompt(e,...t){let r,i;if(this._registeredPrompts[e])throw Error(`Prompt ${e} is already registered`);"string"==typeof t[0]&&(r=t.shift()),t.length>1&&(i=t.shift());let n=t[0],a=this._createRegisteredPrompt(e,void 0,r,i,n);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),a}registerPrompt(e,t,r){if(this._registeredPrompts[e])throw Error(`Prompt ${e} is already registered`);let{title:i,description:n,argsSchema:a}=t,s=this._createRegisteredPrompt(e,i,n,a,r);return this.setPromptRequestHandlers(),this.sendPromptListChanged(),s}isConnected(){return void 0!==this.server.transport}sendResourceListChanged(){this.isConnected()&&this.server.sendResourceListChanged()}sendToolListChanged(){this.isConnected()&&this.server.sendToolListChanged()}sendPromptListChanged(){this.isConnected()&&this.server.sendPromptListChanged()}}var hE={type:"object",properties:{}};function hk(e){return"object"==typeof e&&null!==e&&(0===Object.keys(e).length||Object.values(e).some(hA))}function hA(e){return null!==e&&"object"==typeof e&&"parse"in e&&"function"==typeof e.parse&&"safeParse"in e&&"function"==typeof e.safeParse}function hP(e){return{completion:{values:e.slice(0,100),total:e.length,hasMore:e.length>100}}}var hR={completion:{values:[],hasMore:!1}};function hI(e,t,r,i){return{name:e,description:t,inputSchema:r,handler:i}}function hT(e){let t=new hS({name:e.name,version:e.version??"1.0.0"},{capabilities:{tools:e.tools?{}:void 0}});return e.tools&&e.tools.forEach(e=>{t.tool(e.name,e.description,e.inputSchema,e.handler)}),{type:"sdk",name:e.name,instance:t}}function hj(e){let t=e.abortController||new AbortController,r=new Map;if(e.mcpServers)for(let[t,i]of Object.entries(e.mcpServers))if("sdk"===i.type&&i.instance)r.set(t,i.instance);else throw Error("Browser SDK only supports SDK MCP servers for now");let i=new aj(new nL({url:e.websocket.url,headers:e.websocket.headers,authMessage:e.websocket.authMessage,abortController:t}),!0,e.canUseTool,e.hooks,t,r);return i.streamInput(e.prompt),i}}}]);