mirror of
https://github.com/logos-messaging/examples.waku.org.git
synced 2026-01-09 08:13:11 +00:00
3 lines
1014 KiB
JavaScript
3 lines
1014 KiB
JavaScript
/*! For license information please see main.75745ffb.js.LICENSE.txt */
|
|
(function(){var __webpack_modules__={193:function(e){"use strict";e.exports=function(e,t){var r=new Array(arguments.length-1),n=0,i=2,o=!0;for(;i<arguments.length;)r[n++]=arguments[i++];return new Promise((function(i,a){r[n]=function(e){if(o)if(o=!1,e)a(e);else{for(var t=new Array(arguments.length-1),r=0;r<t.length;)t[r++]=arguments[r];i.apply(null,t)}};try{e.apply(t||null,r)}catch(s){o&&(o=!1,a(s))}}))}},3211:function(e,t){"use strict";var r=t;r.length=function(e){var t=e.length;if(!t)return 0;for(var r=0;--t%4>1&&"="===e.charAt(t);)++r;return Math.ceil(3*e.length)/4-r};for(var n=new Array(64),i=new Array(123),o=0;o<64;)i[n[o]=o<26?o+65:o<52?o+71:o<62?o-4:o-59|43]=o++;r.encode=function(e,t,r){for(var i,o=null,a=[],s=0,u=0;t<r;){var c=e[t++];switch(u){case 0:a[s++]=n[c>>2],i=(3&c)<<4,u=1;break;case 1:a[s++]=n[i|c>>4],i=(15&c)<<2,u=2;break;case 2:a[s++]=n[i|c>>6],a[s++]=n[63&c],u=0}s>8191&&((o||(o=[])).push(String.fromCharCode.apply(String,a)),s=0)}return u&&(a[s++]=n[i],a[s++]=61,1===u&&(a[s++]=61)),o?(s&&o.push(String.fromCharCode.apply(String,a.slice(0,s))),o.join("")):String.fromCharCode.apply(String,a.slice(0,s))};var a="invalid encoding";r.decode=function(e,t,r){for(var n,o=r,s=0,u=0;u<e.length;){var c=e.charCodeAt(u++);if(61===c&&s>1)break;if(void 0===(c=i[c]))throw Error(a);switch(s){case 0:n=c,s=1;break;case 1:t[r++]=n<<2|(48&c)>>4,n=c,s=2;break;case 2:t[r++]=(15&n)<<4|(60&c)>>2,n=c,s=3;break;case 3:t[r++]=(3&n)<<6|c,s=0}}if(1===s)throw Error(a);return r-o},r.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}},7988:function(e){"use strict";function t(e,r){"string"===typeof e&&(r=e,e=void 0);var n=[];function i(e){if("string"!==typeof e){var r=o();if(t.verbose&&console.log("codegen: "+r),r="return "+r,e){for(var a=Object.keys(e),s=new Array(a.length+1),u=new Array(a.length),c=0;c<a.length;)s[c]=a[c],u[c]=e[a[c++]];return s[c]=r,Function.apply(null,s).apply(null,u)}return Function(r)()}for(var l=new Array(arguments.length-1),f=0;f<l.length;)l[f]=arguments[++f];if(f=0,e=e.replace(/%([%dfijs])/g,(function(e,t){var r=l[f++];switch(t){case"d":case"f":return String(Number(r));case"i":return String(Math.floor(r));case"j":return JSON.stringify(r);case"s":return String(r)}return"%"})),f!==l.length)throw Error("parameter count mismatch");return n.push(e),i}function o(t){return"function "+(t||r||"")+"("+(e&&e.join(",")||"")+"){\n "+n.join("\n ")+"\n}"}return i.toString=o,i}e.exports=t,t.verbose=!1},2968:function(e){"use strict";function t(){this._listeners={}}e.exports=t,t.prototype.on=function(e,t,r){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:r||this}),this},t.prototype.off=function(e,t){if(void 0===e)this._listeners={};else if(void 0===t)this._listeners[e]=[];else for(var r=this._listeners[e],n=0;n<r.length;)r[n].fn===t?r.splice(n,1):++n;return this},t.prototype.emit=function(e){var t=this._listeners[e];if(t){for(var r=[],n=1;n<arguments.length;)r.push(arguments[n++]);for(n=0;n<t.length;)t[n].fn.apply(t[n++].ctx,r)}return this}},7855:function(e,t,r){"use strict";e.exports=o;var n=r(193),i=r(861)("fs");function o(e,t,r){return"function"===typeof t?(r=t,t={}):t||(t={}),r?!t.xhr&&i&&i.readFile?i.readFile(e,(function(n,i){return n&&"undefined"!==typeof XMLHttpRequest?o.xhr(e,t,r):n?r(n):r(null,t.binary?i:i.toString("utf8"))})):o.xhr(e,t,r):n(o,this,e,t)}o.xhr=function(e,t,r){var n=new XMLHttpRequest;n.onreadystatechange=function(){if(4===n.readyState){if(0!==n.status&&200!==n.status)return r(Error("status "+n.status));if(t.binary){var e=n.response;if(!e){e=[];for(var i=0;i<n.responseText.length;++i)e.push(255&n.responseText.charCodeAt(i))}return r(null,"undefined"!==typeof Uint8Array?new Uint8Array(e):e)}return r(null,n.responseText)}},t.binary&&("overrideMimeType"in n&&n.overrideMimeType("text/plain; charset=x-user-defined"),n.responseType="arraybuffer"),n.open("GET",e),n.send()}},1916:function(e){"use strict";function t(e){return"undefined"!==typeof Float32Array?function(){var t=new Float32Array([-0]),r=new Uint8Array(t.buffer),n=128===r[3];function i(e,n,i){t[0]=e,n[i]=r[0],n[i+1]=r[1],n[i+2]=r[2],n[i+3]=r[3]}function o(e,n,i){t[0]=e,n[i]=r[3],n[i+1]=r[2],n[i+2]=r[1],n[i+3]=r[0]}function a(e,n){return r[0]=e[n],r[1]=e[n+1],r[2]=e[n+2],r[3]=e[n+3],t[0]}function s(e,n){return r[3]=e[n],r[2]=e[n+1],r[1]=e[n+2],r[0]=e[n+3],t[0]}e.writeFloatLE=n?i:o,e.writeFloatBE=n?o:i,e.readFloatLE=n?a:s,e.readFloatBE=n?s:a}():function(){function t(e,t,r,n){var i=t<0?1:0;if(i&&(t=-t),0===t)e(1/t>0?0:2147483648,r,n);else if(isNaN(t))e(2143289344,r,n);else if(t>34028234663852886e22)e((i<<31|2139095040)>>>0,r,n);else if(t<11754943508222875e-54)e((i<<31|Math.round(t/1401298464324817e-60))>>>0,r,n);else{var o=Math.floor(Math.log(t)/Math.LN2);e((i<<31|o+127<<23|8388607&Math.round(t*Math.pow(2,-o)*8388608))>>>0,r,n)}}function a(e,t,r){var n=e(t,r),i=2*(n>>31)+1,o=n>>>23&255,a=8388607&n;return 255===o?a?NaN:i*(1/0):0===o?1401298464324817e-60*i*a:i*Math.pow(2,o-150)*(a+8388608)}e.writeFloatLE=t.bind(null,r),e.writeFloatBE=t.bind(null,n),e.readFloatLE=a.bind(null,i),e.readFloatBE=a.bind(null,o)}(),"undefined"!==typeof Float64Array?function(){var t=new Float64Array([-0]),r=new Uint8Array(t.buffer),n=128===r[7];function i(e,n,i){t[0]=e,n[i]=r[0],n[i+1]=r[1],n[i+2]=r[2],n[i+3]=r[3],n[i+4]=r[4],n[i+5]=r[5],n[i+6]=r[6],n[i+7]=r[7]}function o(e,n,i){t[0]=e,n[i]=r[7],n[i+1]=r[6],n[i+2]=r[5],n[i+3]=r[4],n[i+4]=r[3],n[i+5]=r[2],n[i+6]=r[1],n[i+7]=r[0]}function a(e,n){return r[0]=e[n],r[1]=e[n+1],r[2]=e[n+2],r[3]=e[n+3],r[4]=e[n+4],r[5]=e[n+5],r[6]=e[n+6],r[7]=e[n+7],t[0]}function s(e,n){return r[7]=e[n],r[6]=e[n+1],r[5]=e[n+2],r[4]=e[n+3],r[3]=e[n+4],r[2]=e[n+5],r[1]=e[n+6],r[0]=e[n+7],t[0]}e.writeDoubleLE=n?i:o,e.writeDoubleBE=n?o:i,e.readDoubleLE=n?a:s,e.readDoubleBE=n?s:a}():function(){function t(e,t,r,n,i,o){var a=n<0?1:0;if(a&&(n=-n),0===n)e(0,i,o+t),e(1/n>0?0:2147483648,i,o+r);else if(isNaN(n))e(0,i,o+t),e(2146959360,i,o+r);else if(n>17976931348623157e292)e(0,i,o+t),e((a<<31|2146435072)>>>0,i,o+r);else{var s;if(n<22250738585072014e-324)e((s=n/5e-324)>>>0,i,o+t),e((a<<31|s/4294967296)>>>0,i,o+r);else{var u=Math.floor(Math.log(n)/Math.LN2);1024===u&&(u=1023),e(4503599627370496*(s=n*Math.pow(2,-u))>>>0,i,o+t),e((a<<31|u+1023<<20|1048576*s&1048575)>>>0,i,o+r)}}}function a(e,t,r,n,i){var o=e(n,i+t),a=e(n,i+r),s=2*(a>>31)+1,u=a>>>20&2047,c=4294967296*(1048575&a)+o;return 2047===u?c?NaN:s*(1/0):0===u?5e-324*s*c:s*Math.pow(2,u-1075)*(c+4503599627370496)}e.writeDoubleLE=t.bind(null,r,0,4),e.writeDoubleBE=t.bind(null,n,4,0),e.readDoubleLE=a.bind(null,i,0,4),e.readDoubleBE=a.bind(null,o,4,0)}(),e}function r(e,t,r){t[r]=255&e,t[r+1]=e>>>8&255,t[r+2]=e>>>16&255,t[r+3]=e>>>24}function n(e,t,r){t[r]=e>>>24,t[r+1]=e>>>16&255,t[r+2]=e>>>8&255,t[r+3]=255&e}function i(e,t){return(e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)>>>0}function o(e,t){return(e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3])>>>0}e.exports=t(t)},861:function(module){"use strict";function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(e){}return null}module.exports=inquire},5310:function(e,t){"use strict";var r=t,n=r.isAbsolute=function(e){return/^(?:\/|\w+:)/.test(e)},i=r.normalize=function(e){var t=(e=e.replace(/\\/g,"/").replace(/\/{2,}/g,"/")).split("/"),r=n(e),i="";r&&(i=t.shift()+"/");for(var o=0;o<t.length;)".."===t[o]?o>0&&".."!==t[o-1]?t.splice(--o,2):r?t.splice(o,1):++o:"."===t[o]?t.splice(o,1):++o;return i+t.join("/")};r.resolve=function(e,t,r){return r||(t=i(t)),n(t)?t:(r||(e=i(e)),(e=e.replace(/(?:\/|^)[^/]+$/,"")).length?i(e+"/"+t):t)}},2888:function(e){"use strict";e.exports=function(e,t,r){var n=r||8192,i=n>>>1,o=null,a=n;return function(r){if(r<1||r>i)return e(r);a+r>n&&(o=e(n),a=0);var s=t.call(o,a,a+=r);return 7&a&&(a=1+(7|a)),s}}},1748:function(e,t){"use strict";var r=t;r.length=function(e){for(var t=0,r=0,n=0;n<e.length;++n)(r=e.charCodeAt(n))<128?t+=1:r<2048?t+=2:55296===(64512&r)&&56320===(64512&e.charCodeAt(n+1))?(++n,t+=4):t+=3;return t},r.read=function(e,t,r){if(r-t<1)return"";for(var n,i=null,o=[],a=0;t<r;)(n=e[t++])<128?o[a++]=n:n>191&&n<224?o[a++]=(31&n)<<6|63&e[t++]:n>239&&n<365?(n=((7&n)<<18|(63&e[t++])<<12|(63&e[t++])<<6|63&e[t++])-65536,o[a++]=55296+(n>>10),o[a++]=56320+(1023&n)):o[a++]=(15&n)<<12|(63&e[t++])<<6|63&e[t++],a>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,o)),a=0);return i?(a&&i.push(String.fromCharCode.apply(String,o.slice(0,a))),i.join("")):String.fromCharCode.apply(String,o.slice(0,a))},r.write=function(e,t,r){for(var n,i,o=r,a=0;a<e.length;++a)(n=e.charCodeAt(a))<128?t[r++]=n:n<2048?(t[r++]=n>>6|192,t[r++]=63&n|128):55296===(64512&n)&&56320===(64512&(i=e.charCodeAt(a+1)))?(n=65536+((1023&n)<<10)+(1023&i),++a,t[r++]=n>>18|240,t[r++]=n>>12&63|128,t[r++]=n>>6&63|128,t[r++]=63&n|128):(t[r++]=n>>12|224,t[r++]=n>>6&63|128,t[r++]=63&n|128);return r-o}},2571:function(e){"use strict";for(var t="qpzry9x8gf2tvdw0s3jn54khce6mua7l",r={},n=0;n<t.length;n++){var i=t.charAt(n);if(void 0!==r[i])throw new TypeError(i+" is ambiguous");r[i]=n}function o(e){var t=e>>25;return(33554431&e)<<5^996825010&-(t>>0&1)^642813549&-(t>>1&1)^513874426&-(t>>2&1)^1027748829&-(t>>3&1)^705979059&-(t>>4&1)}function a(e){for(var t=1,r=0;r<e.length;++r){var n=e.charCodeAt(r);if(n<33||n>126)return"Invalid prefix ("+e+")";t=o(t)^n>>5}for(t=o(t),r=0;r<e.length;++r){var i=e.charCodeAt(r);t=o(t)^31&i}return t}function s(e,t){if(t=t||90,e.length<8)return e+" too short";if(e.length>t)return"Exceeds length limit";var n=e.toLowerCase(),i=e.toUpperCase();if(e!==n&&e!==i)return"Mixed-case string "+e;var s=(e=n).lastIndexOf("1");if(-1===s)return"No separator character for "+e;if(0===s)return"Missing prefix for "+e;var u=e.slice(0,s),c=e.slice(s+1);if(c.length<6)return"Data too short";var l=a(u);if("string"===typeof l)return l;for(var f=[],h=0;h<c.length;++h){var d=c.charAt(h),p=r[d];if(void 0===p)return"Unknown character "+d;l=o(l)^p,h+6>=c.length||f.push(p)}return 1!==l?"Invalid checksum for "+e:{prefix:u,words:f}}function u(e,t,r,n){for(var i=0,o=0,a=(1<<r)-1,s=[],u=0;u<e.length;++u)for(i=i<<t|e[u],o+=t;o>=r;)o-=r,s.push(i>>o&a);if(n)o>0&&s.push(i<<r-o&a);else{if(o>=t)return"Excess padding";if(i<<r-o&a)return"Non-zero padding"}return s}e.exports={decodeUnsafe:function(){var e=s.apply(null,arguments);if("object"===typeof e)return e},decode:function(e){var t=s.apply(null,arguments);if("object"===typeof t)return t;throw new Error(t)},encode:function(e,r,n){if(n=n||90,e.length+7+r.length>n)throw new TypeError("Exceeds length limit");var i=a(e=e.toLowerCase());if("string"===typeof i)throw new Error(i);for(var s=e+"1",u=0;u<r.length;++u){var c=r[u];if(c>>5!==0)throw new Error("Non 5-bit word");i=o(i)^c,s+=t.charAt(c)}for(u=0;u<6;++u)i=o(i);for(i^=1,u=0;u<6;++u){s+=t.charAt(i>>5*(5-u)&31)}return s},toWordsUnsafe:function(e){var t=u(e,8,5,!0);if(Array.isArray(t))return t},toWords:function(e){var t=u(e,8,5,!0);if(Array.isArray(t))return t;throw new Error(t)},fromWordsUnsafe:function(e){var t=u(e,5,8,!1);if(Array.isArray(t))return t},fromWords:function(e){var t=u(e,5,8,!1);if(Array.isArray(t))return t;throw new Error(t)}}},9867:function(e,t,r){!function(e,t){"use strict";function n(e,t){if(!e)throw new 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 o(e,t,r){if(o.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"))}var a;"object"===typeof e?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{a="undefined"!==typeof window&&"undefined"!==typeof window.Buffer?window.Buffer:r(9391).Buffer}catch(C){}function s(e,t){var r=e.charCodeAt(t);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void n(!1,"Invalid character in "+e)}function u(e,t,r){var n=s(e,r);return r-1>=t&&(n|=s(e,r-1)<<4),n}function c(e,t,r,i){for(var o=0,a=0,s=Math.min(e.length,r),u=t;u<s;u++){var c=e.charCodeAt(u)-48;o*=i,a=c>=49?c-49+10:c>=17?c-17+10:c,n(c>=0&&a<i,"Invalid character"),o+=a}return o}function l(e,t){e.words=t.words,e.length=t.length,e.negative=t.negative,e.red=t.red}if(o.isBN=function(e){return e instanceof o||null!==e&&"object"===typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,r){if("number"===typeof e)return this._initNumber(e,t,r);if("object"===typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<e.length&&(16===t?this._parseHex(e,i,r):(this._parseBase(e,t,i),"le"===r&&this._initArray(this.toArray(),t,r)))},o.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},o.prototype._initArray=function(e,t,r){if(n("number"===typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,a,s=0;if("be"===r)for(i=e.length-1,o=0;i>=0;i-=3)a=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);else if("le"===r)for(i=0,o=0;i<e.length;i+=3)a=e[i]|e[i+1]<<8|e[i+2]<<16,this.words[o]|=a<<s&67108863,this.words[o+1]=a>>>26-s&67108863,(s+=24)>=26&&(s-=26,o++);return this._strip()},o.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,o=0,a=0;if("be"===r)for(n=e.length-1;n>=t;n-=2)i=u(e,t,n)<<o,this.words[a]|=67108863&i,o>=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;else for(n=(e.length-t)%2===0?t+1:t;n<e.length;n+=2)i=u(e,t,n)<<o,this.words[a]|=67108863&i,o>=18?(o-=18,a+=1,this.words[a]|=i>>>26):o+=8;this._strip()},o.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,a=o%n,s=Math.min(o,o-a)+r,u=0,l=r;l<s;l+=n)u=c(e,l,l+n,t),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==a){var f=1;for(u=c(e,l,e.length,t),l=0;l<a;l++)f*=t;this.imuln(f),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this._strip()},o.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},o.prototype._move=function(e){l(e,this)},o.prototype.clone=function(){var e=new o(null);return this.copy(e),e},o.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},o.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!==typeof Symbol&&"function"===typeof Symbol.for)try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=f}catch(C){o.prototype.inspect=f}else o.prototype.inspect=f;function f(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var 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"],d=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],p=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];o.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,o=0,a=0;a<this.length;a++){var s=this.words[a],u=(16777215&(s<<i|o)).toString(16);o=s>>>24-i&16777215,(i+=2)>=26&&(i-=26,a--),r=0!==o||a!==this.length-1?h[6-u.length]+u+r:u+r}for(0!==o&&(r=o.toString(16)+r);r.length%t!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var c=d[e],l=p[e];r="";var f=this.clone();for(f.negative=0;!f.isZero();){var v=f.modrn(l).toString(e);r=(f=f.idivn(l)).isZero()?v+r:h[c-v.length]+v+r}for(this.isZero()&&(r="0"+r);r.length%t!==0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16,2)},a&&(o.prototype.toBuffer=function(e,t){return this.toArrayLike(a,e,t)}),o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)};function v(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],a=i*o,s=67108863&a,u=a/67108864|0;r.words[0]=s;for(var c=1;c<n;c++){for(var l=u>>>26,f=67108863&u,h=Math.min(c,t.length-1),d=Math.max(0,c-e.length+1);d<=h;d++){var p=c-d|0;l+=(a=(i=0|e.words[p])*(o=0|t.words[d])+f)/67108864|0,f=67108863&a}r.words[c]=0|f,u=0|l}return 0!==u?r.words[c]=0|u:r.length--,r._strip()}o.prototype.toArrayLike=function(e,t,r){this._strip();var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0");var a=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,o);return this["_toArrayLike"+("le"===t?"LE":"BE")](a,i),a},o.prototype._toArrayLikeLE=function(e,t){for(var r=0,n=0,i=0,o=0;i<this.length;i++){var a=this.words[i]<<o|n;e[r++]=255&a,r<e.length&&(e[r++]=a>>8&255),r<e.length&&(e[r++]=a>>16&255),6===o?(r<e.length&&(e[r++]=a>>24&255),n=0,o=0):(n=a>>>24,o+=2)}if(r<e.length)for(e[r++]=n;r<e.length;)e[r++]=0},o.prototype._toArrayLikeBE=function(e,t){for(var r=e.length-1,n=0,i=0,o=0;i<this.length;i++){var a=this.words[i]<<o|n;e[r--]=255&a,r>=0&&(e[r--]=a>>8&255),r>=0&&(e[r--]=a>>16&255),6===o?(r>=0&&(e[r--]=a>>24&255),n=0,o=0):(n=a>>>24,o+=2)}if(r>=0)for(e[r--]=n;r>=0;)e[r--]=0},Math.clz32?o.prototype._countBits=function(e){return 32-Math.clz32(e)}:o.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},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0===(8191&t)&&(r+=13,t>>>=13),0===(127&t)&&(r+=7,t>>>=7),0===(15&t)&&(r+=4,t>>>=4),0===(3&t)&&(r+=2,t>>>=2),0===(1&t)&&r++,r},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},o.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this._strip()},o.prototype.ior=function(e){return n(0===(this.negative|e.negative)),this.iuor(e)},o.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this._strip()},o.prototype.iand=function(e){return n(0===(this.negative|e.negative)),this.iuand(e)},o.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;n<r.length;n++)this.words[n]=t.words[n]^r.words[n];if(this!==t)for(;n<t.length;n++)this.words[n]=t.words[n];return this.length=t.length,this._strip()},o.prototype.ixor=function(e){return n(0===(this.negative|e.negative)),this.iuxor(e)},o.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){n("number"===typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i<t;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this._strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){n("number"===typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<<i:this.words[r]&~(1<<i),this._strip()},o.prototype.iadd=function(e){var t,r,n;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o<n.length;o++)t=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&t,i=t>>>26;for(;0!==i&&o<r.length;o++)t=(0|r.words[o])+i,this.words[o]=67108863&t,i=t>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,a=0;a<n.length;a++)o=(t=(0|r.words[a])-(0|n.words[a])+o)>>26,this.words[a]=67108863&t;for(;0!==o&&a<r.length;a++)o=(t=(0|r.words[a])+o)>>26,this.words[a]=67108863&t;if(0===o&&a<r.length&&r!==this)for(;a<r.length;a++)this.words[a]=r.words[a];return this.length=Math.max(this.length,a),r!==this&&(this.negative=1),this._strip()},o.prototype.sub=function(e){return this.clone().isub(e)};var g=function(e,t,r){var n,i,o,a=e.words,s=t.words,u=r.words,c=0,l=0|a[0],f=8191&l,h=l>>>13,d=0|a[1],p=8191&d,v=d>>>13,g=0|a[2],y=8191&g,m=g>>>13,b=0|a[3],w=8191&b,k=b>>>13,E=0|a[4],x=8191&E,S=E>>>13,_=0|a[5],A=8191&_,I=_>>>13,C=0|a[6],T=8191&C,P=C>>>13,R=0|a[7],B=8191&R,M=R>>>13,N=0|a[8],O=8191&N,D=N>>>13,L=0|a[9],U=8191&L,F=L>>>13,z=0|s[0],Z=8191&z,j=z>>>13,q=0|s[1],K=8191&q,V=q>>>13,H=0|s[2],G=8191&H,W=H>>>13,Q=0|s[3],J=8191&Q,Y=Q>>>13,X=0|s[4],$=8191&X,ee=X>>>13,te=0|s[5],re=8191&te,ne=te>>>13,ie=0|s[6],oe=8191&ie,ae=ie>>>13,se=0|s[7],ue=8191&se,ce=se>>>13,le=0|s[8],fe=8191&le,he=le>>>13,de=0|s[9],pe=8191&de,ve=de>>>13;r.negative=e.negative^t.negative,r.length=19;var ge=(c+(n=Math.imul(f,Z))|0)+((8191&(i=(i=Math.imul(f,j))+Math.imul(h,Z)|0))<<13)|0;c=((o=Math.imul(h,j))+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(p,Z),i=(i=Math.imul(p,j))+Math.imul(v,Z)|0,o=Math.imul(v,j);var ye=(c+(n=n+Math.imul(f,K)|0)|0)+((8191&(i=(i=i+Math.imul(f,V)|0)+Math.imul(h,K)|0))<<13)|0;c=((o=o+Math.imul(h,V)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(y,Z),i=(i=Math.imul(y,j))+Math.imul(m,Z)|0,o=Math.imul(m,j),n=n+Math.imul(p,K)|0,i=(i=i+Math.imul(p,V)|0)+Math.imul(v,K)|0,o=o+Math.imul(v,V)|0;var me=(c+(n=n+Math.imul(f,G)|0)|0)+((8191&(i=(i=i+Math.imul(f,W)|0)+Math.imul(h,G)|0))<<13)|0;c=((o=o+Math.imul(h,W)|0)+(i>>>13)|0)+(me>>>26)|0,me&=67108863,n=Math.imul(w,Z),i=(i=Math.imul(w,j))+Math.imul(k,Z)|0,o=Math.imul(k,j),n=n+Math.imul(y,K)|0,i=(i=i+Math.imul(y,V)|0)+Math.imul(m,K)|0,o=o+Math.imul(m,V)|0,n=n+Math.imul(p,G)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(v,G)|0,o=o+Math.imul(v,W)|0;var be=(c+(n=n+Math.imul(f,J)|0)|0)+((8191&(i=(i=i+Math.imul(f,Y)|0)+Math.imul(h,J)|0))<<13)|0;c=((o=o+Math.imul(h,Y)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(x,Z),i=(i=Math.imul(x,j))+Math.imul(S,Z)|0,o=Math.imul(S,j),n=n+Math.imul(w,K)|0,i=(i=i+Math.imul(w,V)|0)+Math.imul(k,K)|0,o=o+Math.imul(k,V)|0,n=n+Math.imul(y,G)|0,i=(i=i+Math.imul(y,W)|0)+Math.imul(m,G)|0,o=o+Math.imul(m,W)|0,n=n+Math.imul(p,J)|0,i=(i=i+Math.imul(p,Y)|0)+Math.imul(v,J)|0,o=o+Math.imul(v,Y)|0;var we=(c+(n=n+Math.imul(f,$)|0)|0)+((8191&(i=(i=i+Math.imul(f,ee)|0)+Math.imul(h,$)|0))<<13)|0;c=((o=o+Math.imul(h,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(A,Z),i=(i=Math.imul(A,j))+Math.imul(I,Z)|0,o=Math.imul(I,j),n=n+Math.imul(x,K)|0,i=(i=i+Math.imul(x,V)|0)+Math.imul(S,K)|0,o=o+Math.imul(S,V)|0,n=n+Math.imul(w,G)|0,i=(i=i+Math.imul(w,W)|0)+Math.imul(k,G)|0,o=o+Math.imul(k,W)|0,n=n+Math.imul(y,J)|0,i=(i=i+Math.imul(y,Y)|0)+Math.imul(m,J)|0,o=o+Math.imul(m,Y)|0,n=n+Math.imul(p,$)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(v,$)|0,o=o+Math.imul(v,ee)|0;var ke=(c+(n=n+Math.imul(f,re)|0)|0)+((8191&(i=(i=i+Math.imul(f,ne)|0)+Math.imul(h,re)|0))<<13)|0;c=((o=o+Math.imul(h,ne)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(T,Z),i=(i=Math.imul(T,j))+Math.imul(P,Z)|0,o=Math.imul(P,j),n=n+Math.imul(A,K)|0,i=(i=i+Math.imul(A,V)|0)+Math.imul(I,K)|0,o=o+Math.imul(I,V)|0,n=n+Math.imul(x,G)|0,i=(i=i+Math.imul(x,W)|0)+Math.imul(S,G)|0,o=o+Math.imul(S,W)|0,n=n+Math.imul(w,J)|0,i=(i=i+Math.imul(w,Y)|0)+Math.imul(k,J)|0,o=o+Math.imul(k,Y)|0,n=n+Math.imul(y,$)|0,i=(i=i+Math.imul(y,ee)|0)+Math.imul(m,$)|0,o=o+Math.imul(m,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(v,re)|0,o=o+Math.imul(v,ne)|0;var Ee=(c+(n=n+Math.imul(f,oe)|0)|0)+((8191&(i=(i=i+Math.imul(f,ae)|0)+Math.imul(h,oe)|0))<<13)|0;c=((o=o+Math.imul(h,ae)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(B,Z),i=(i=Math.imul(B,j))+Math.imul(M,Z)|0,o=Math.imul(M,j),n=n+Math.imul(T,K)|0,i=(i=i+Math.imul(T,V)|0)+Math.imul(P,K)|0,o=o+Math.imul(P,V)|0,n=n+Math.imul(A,G)|0,i=(i=i+Math.imul(A,W)|0)+Math.imul(I,G)|0,o=o+Math.imul(I,W)|0,n=n+Math.imul(x,J)|0,i=(i=i+Math.imul(x,Y)|0)+Math.imul(S,J)|0,o=o+Math.imul(S,Y)|0,n=n+Math.imul(w,$)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(k,$)|0,o=o+Math.imul(k,ee)|0,n=n+Math.imul(y,re)|0,i=(i=i+Math.imul(y,ne)|0)+Math.imul(m,re)|0,o=o+Math.imul(m,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,ae)|0)+Math.imul(v,oe)|0,o=o+Math.imul(v,ae)|0;var xe=(c+(n=n+Math.imul(f,ue)|0)|0)+((8191&(i=(i=i+Math.imul(f,ce)|0)+Math.imul(h,ue)|0))<<13)|0;c=((o=o+Math.imul(h,ce)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(O,Z),i=(i=Math.imul(O,j))+Math.imul(D,Z)|0,o=Math.imul(D,j),n=n+Math.imul(B,K)|0,i=(i=i+Math.imul(B,V)|0)+Math.imul(M,K)|0,o=o+Math.imul(M,V)|0,n=n+Math.imul(T,G)|0,i=(i=i+Math.imul(T,W)|0)+Math.imul(P,G)|0,o=o+Math.imul(P,W)|0,n=n+Math.imul(A,J)|0,i=(i=i+Math.imul(A,Y)|0)+Math.imul(I,J)|0,o=o+Math.imul(I,Y)|0,n=n+Math.imul(x,$)|0,i=(i=i+Math.imul(x,ee)|0)+Math.imul(S,$)|0,o=o+Math.imul(S,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(k,re)|0,o=o+Math.imul(k,ne)|0,n=n+Math.imul(y,oe)|0,i=(i=i+Math.imul(y,ae)|0)+Math.imul(m,oe)|0,o=o+Math.imul(m,ae)|0,n=n+Math.imul(p,ue)|0,i=(i=i+Math.imul(p,ce)|0)+Math.imul(v,ue)|0,o=o+Math.imul(v,ce)|0;var Se=(c+(n=n+Math.imul(f,fe)|0)|0)+((8191&(i=(i=i+Math.imul(f,he)|0)+Math.imul(h,fe)|0))<<13)|0;c=((o=o+Math.imul(h,he)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(U,Z),i=(i=Math.imul(U,j))+Math.imul(F,Z)|0,o=Math.imul(F,j),n=n+Math.imul(O,K)|0,i=(i=i+Math.imul(O,V)|0)+Math.imul(D,K)|0,o=o+Math.imul(D,V)|0,n=n+Math.imul(B,G)|0,i=(i=i+Math.imul(B,W)|0)+Math.imul(M,G)|0,o=o+Math.imul(M,W)|0,n=n+Math.imul(T,J)|0,i=(i=i+Math.imul(T,Y)|0)+Math.imul(P,J)|0,o=o+Math.imul(P,Y)|0,n=n+Math.imul(A,$)|0,i=(i=i+Math.imul(A,ee)|0)+Math.imul(I,$)|0,o=o+Math.imul(I,ee)|0,n=n+Math.imul(x,re)|0,i=(i=i+Math.imul(x,ne)|0)+Math.imul(S,re)|0,o=o+Math.imul(S,ne)|0,n=n+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,ae)|0)+Math.imul(k,oe)|0,o=o+Math.imul(k,ae)|0,n=n+Math.imul(y,ue)|0,i=(i=i+Math.imul(y,ce)|0)+Math.imul(m,ue)|0,o=o+Math.imul(m,ce)|0,n=n+Math.imul(p,fe)|0,i=(i=i+Math.imul(p,he)|0)+Math.imul(v,fe)|0,o=o+Math.imul(v,he)|0;var _e=(c+(n=n+Math.imul(f,pe)|0)|0)+((8191&(i=(i=i+Math.imul(f,ve)|0)+Math.imul(h,pe)|0))<<13)|0;c=((o=o+Math.imul(h,ve)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(U,K),i=(i=Math.imul(U,V))+Math.imul(F,K)|0,o=Math.imul(F,V),n=n+Math.imul(O,G)|0,i=(i=i+Math.imul(O,W)|0)+Math.imul(D,G)|0,o=o+Math.imul(D,W)|0,n=n+Math.imul(B,J)|0,i=(i=i+Math.imul(B,Y)|0)+Math.imul(M,J)|0,o=o+Math.imul(M,Y)|0,n=n+Math.imul(T,$)|0,i=(i=i+Math.imul(T,ee)|0)+Math.imul(P,$)|0,o=o+Math.imul(P,ee)|0,n=n+Math.imul(A,re)|0,i=(i=i+Math.imul(A,ne)|0)+Math.imul(I,re)|0,o=o+Math.imul(I,ne)|0,n=n+Math.imul(x,oe)|0,i=(i=i+Math.imul(x,ae)|0)+Math.imul(S,oe)|0,o=o+Math.imul(S,ae)|0,n=n+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,ce)|0)+Math.imul(k,ue)|0,o=o+Math.imul(k,ce)|0,n=n+Math.imul(y,fe)|0,i=(i=i+Math.imul(y,he)|0)+Math.imul(m,fe)|0,o=o+Math.imul(m,he)|0;var Ae=(c+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,ve)|0)+Math.imul(v,pe)|0))<<13)|0;c=((o=o+Math.imul(v,ve)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(U,G),i=(i=Math.imul(U,W))+Math.imul(F,G)|0,o=Math.imul(F,W),n=n+Math.imul(O,J)|0,i=(i=i+Math.imul(O,Y)|0)+Math.imul(D,J)|0,o=o+Math.imul(D,Y)|0,n=n+Math.imul(B,$)|0,i=(i=i+Math.imul(B,ee)|0)+Math.imul(M,$)|0,o=o+Math.imul(M,ee)|0,n=n+Math.imul(T,re)|0,i=(i=i+Math.imul(T,ne)|0)+Math.imul(P,re)|0,o=o+Math.imul(P,ne)|0,n=n+Math.imul(A,oe)|0,i=(i=i+Math.imul(A,ae)|0)+Math.imul(I,oe)|0,o=o+Math.imul(I,ae)|0,n=n+Math.imul(x,ue)|0,i=(i=i+Math.imul(x,ce)|0)+Math.imul(S,ue)|0,o=o+Math.imul(S,ce)|0,n=n+Math.imul(w,fe)|0,i=(i=i+Math.imul(w,he)|0)+Math.imul(k,fe)|0,o=o+Math.imul(k,he)|0;var Ie=(c+(n=n+Math.imul(y,pe)|0)|0)+((8191&(i=(i=i+Math.imul(y,ve)|0)+Math.imul(m,pe)|0))<<13)|0;c=((o=o+Math.imul(m,ve)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(U,J),i=(i=Math.imul(U,Y))+Math.imul(F,J)|0,o=Math.imul(F,Y),n=n+Math.imul(O,$)|0,i=(i=i+Math.imul(O,ee)|0)+Math.imul(D,$)|0,o=o+Math.imul(D,ee)|0,n=n+Math.imul(B,re)|0,i=(i=i+Math.imul(B,ne)|0)+Math.imul(M,re)|0,o=o+Math.imul(M,ne)|0,n=n+Math.imul(T,oe)|0,i=(i=i+Math.imul(T,ae)|0)+Math.imul(P,oe)|0,o=o+Math.imul(P,ae)|0,n=n+Math.imul(A,ue)|0,i=(i=i+Math.imul(A,ce)|0)+Math.imul(I,ue)|0,o=o+Math.imul(I,ce)|0,n=n+Math.imul(x,fe)|0,i=(i=i+Math.imul(x,he)|0)+Math.imul(S,fe)|0,o=o+Math.imul(S,he)|0;var Ce=(c+(n=n+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,ve)|0)+Math.imul(k,pe)|0))<<13)|0;c=((o=o+Math.imul(k,ve)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(U,$),i=(i=Math.imul(U,ee))+Math.imul(F,$)|0,o=Math.imul(F,ee),n=n+Math.imul(O,re)|0,i=(i=i+Math.imul(O,ne)|0)+Math.imul(D,re)|0,o=o+Math.imul(D,ne)|0,n=n+Math.imul(B,oe)|0,i=(i=i+Math.imul(B,ae)|0)+Math.imul(M,oe)|0,o=o+Math.imul(M,ae)|0,n=n+Math.imul(T,ue)|0,i=(i=i+Math.imul(T,ce)|0)+Math.imul(P,ue)|0,o=o+Math.imul(P,ce)|0,n=n+Math.imul(A,fe)|0,i=(i=i+Math.imul(A,he)|0)+Math.imul(I,fe)|0,o=o+Math.imul(I,he)|0;var Te=(c+(n=n+Math.imul(x,pe)|0)|0)+((8191&(i=(i=i+Math.imul(x,ve)|0)+Math.imul(S,pe)|0))<<13)|0;c=((o=o+Math.imul(S,ve)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(U,re),i=(i=Math.imul(U,ne))+Math.imul(F,re)|0,o=Math.imul(F,ne),n=n+Math.imul(O,oe)|0,i=(i=i+Math.imul(O,ae)|0)+Math.imul(D,oe)|0,o=o+Math.imul(D,ae)|0,n=n+Math.imul(B,ue)|0,i=(i=i+Math.imul(B,ce)|0)+Math.imul(M,ue)|0,o=o+Math.imul(M,ce)|0,n=n+Math.imul(T,fe)|0,i=(i=i+Math.imul(T,he)|0)+Math.imul(P,fe)|0,o=o+Math.imul(P,he)|0;var Pe=(c+(n=n+Math.imul(A,pe)|0)|0)+((8191&(i=(i=i+Math.imul(A,ve)|0)+Math.imul(I,pe)|0))<<13)|0;c=((o=o+Math.imul(I,ve)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(U,oe),i=(i=Math.imul(U,ae))+Math.imul(F,oe)|0,o=Math.imul(F,ae),n=n+Math.imul(O,ue)|0,i=(i=i+Math.imul(O,ce)|0)+Math.imul(D,ue)|0,o=o+Math.imul(D,ce)|0,n=n+Math.imul(B,fe)|0,i=(i=i+Math.imul(B,he)|0)+Math.imul(M,fe)|0,o=o+Math.imul(M,he)|0;var Re=(c+(n=n+Math.imul(T,pe)|0)|0)+((8191&(i=(i=i+Math.imul(T,ve)|0)+Math.imul(P,pe)|0))<<13)|0;c=((o=o+Math.imul(P,ve)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(U,ue),i=(i=Math.imul(U,ce))+Math.imul(F,ue)|0,o=Math.imul(F,ce),n=n+Math.imul(O,fe)|0,i=(i=i+Math.imul(O,he)|0)+Math.imul(D,fe)|0,o=o+Math.imul(D,he)|0;var Be=(c+(n=n+Math.imul(B,pe)|0)|0)+((8191&(i=(i=i+Math.imul(B,ve)|0)+Math.imul(M,pe)|0))<<13)|0;c=((o=o+Math.imul(M,ve)|0)+(i>>>13)|0)+(Be>>>26)|0,Be&=67108863,n=Math.imul(U,fe),i=(i=Math.imul(U,he))+Math.imul(F,fe)|0,o=Math.imul(F,he);var Me=(c+(n=n+Math.imul(O,pe)|0)|0)+((8191&(i=(i=i+Math.imul(O,ve)|0)+Math.imul(D,pe)|0))<<13)|0;c=((o=o+Math.imul(D,ve)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863;var Ne=(c+(n=Math.imul(U,pe))|0)+((8191&(i=(i=Math.imul(U,ve))+Math.imul(F,pe)|0))<<13)|0;return c=((o=Math.imul(F,ve))+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,u[0]=ge,u[1]=ye,u[2]=me,u[3]=be,u[4]=we,u[5]=ke,u[6]=Ee,u[7]=xe,u[8]=Se,u[9]=_e,u[10]=Ae,u[11]=Ie,u[12]=Ce,u[13]=Te,u[14]=Pe,u[15]=Re,u[16]=Be,u[17]=Me,u[18]=Ne,0!==c&&(u[19]=c,r.length++),r};function y(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var a=i;i=0;for(var s=67108863&n,u=Math.min(o,t.length-1),c=Math.max(0,o-e.length+1);c<=u;c++){var l=o-c,f=(0|e.words[l])*(0|t.words[c]),h=67108863&f;s=67108863&(h=h+s|0),i+=(a=(a=a+(f/67108864|0)|0)+(h>>>26)|0)>>>26,a&=67108863}r.words[o]=s,n=a,a=i}return 0!==n?r.words[o]=n:r.length--,r._strip()}function m(e,t,r){return y(e,t,r)}function b(e,t){this.x=e,this.y=t}Math.imul||(g=v),o.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?g(this,e,t):r<63?v(this,e,t):r<1024?y(this,e,t):m(this,e,t)},b.prototype.makeRBT=function(e){for(var t=new Array(e),r=o.prototype._countBits(e)-1,n=0;n<e;n++)t[n]=this.revBin(n,r,e);return t},b.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var n=0,i=0;i<t;i++)n|=(1&e)<<t-i-1,e>>=1;return n},b.prototype.permute=function(e,t,r,n,i,o){for(var a=0;a<o;a++)n[a]=t[e[a]],i[a]=r[e[a]]},b.prototype.transform=function(e,t,r,n,i,o){this.permute(o,e,t,r,n,i);for(var a=1;a<i;a<<=1)for(var s=a<<1,u=Math.cos(2*Math.PI/s),c=Math.sin(2*Math.PI/s),l=0;l<i;l+=s)for(var f=u,h=c,d=0;d<a;d++){var p=r[l+d],v=n[l+d],g=r[l+d+a],y=n[l+d+a],m=f*g-h*y;y=f*y+h*g,g=m,r[l+d]=p+g,n[l+d]=v+y,r[l+d+a]=p-g,n[l+d+a]=v-y,d!==s&&(m=u*f-c*h,h=u*h+c*f,f=m)}},b.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},b.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=e[n];e[n]=e[r-n-1],e[r-n-1]=i,i=t[n],t[n]=-t[r-n-1],t[r-n-1]=-i}},b.prototype.normalize13b=function(e,t){for(var r=0,n=0;n<t/2;n++){var i=8192*Math.round(e[2*n+1]/t)+Math.round(e[2*n]/t)+r;e[n]=67108863&i,r=i<67108864?0:i/67108864|0}return e},b.prototype.convert13b=function(e,t,r,i){for(var o=0,a=0;a<t;a++)o+=0|e[a],r[2*a]=8191&o,o>>>=13,r[2*a+1]=8191&o,o>>>=13;for(a=2*t;a<i;++a)r[a]=0;n(0===o),n(0===(-8192&o))},b.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},b.prototype.mulp=function(e,t,r){var n=2*this.guessLen13b(e.length,t.length),i=this.makeRBT(n),o=this.stub(n),a=new Array(n),s=new Array(n),u=new Array(n),c=new Array(n),l=new Array(n),f=new Array(n),h=r.words;h.length=n,this.convert13b(e.words,e.length,a,n),this.convert13b(t.words,t.length,c,n),this.transform(a,o,s,u,n,i),this.transform(c,o,l,f,n,i);for(var d=0;d<n;d++){var p=s[d]*l[d]-u[d]*f[d];u[d]=s[d]*f[d]+u[d]*l[d],s[d]=p}return this.conjugate(s,u,n),this.transform(s,u,h,o,n,i),this.conjugate(h,o,n),this.normalize13b(h,n),r.negative=e.negative^t.negative,r.length=e.length+t.length,r._strip()},o.prototype.mul=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},o.prototype.mulf=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),m(this,e,t)},o.prototype.imul=function(e){return this.clone().mulTo(e,this)},o.prototype.imuln=function(e){var t=e<0;t&&(e=-e),n("number"===typeof e),n(e<67108864);for(var r=0,i=0;i<this.length;i++){var o=(0|this.words[i])*e,a=(67108863&o)+(67108863&r);r>>=26,r+=o/67108864|0,r+=a>>>26,this.words[i]=67108863&a}return 0!==r&&(this.words[i]=r,this.length++),t?this.ineg():this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var n=r/26|0,i=r%26;t[r]=e.words[n]>>>i&1}return t}(e);if(0===t.length)return new o(1);for(var r=this,n=0;n<t.length&&0===t[n];n++,r=r.sqr());if(++n<t.length)for(var i=r.sqr();n<t.length;n++,i=i.sqr())0!==t[n]&&(r=r.mul(i));return r},o.prototype.iushln=function(e){n("number"===typeof e&&e>=0);var t,r=e%26,i=(e-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var a=0;for(t=0;t<this.length;t++){var s=this.words[t]&o,u=(0|this.words[t])-s<<r;this.words[t]=u|a,a=s>>>26-r}a&&(this.words[t]=a,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t<i;t++)this.words[t]=0;this.length+=i}return this._strip()},o.prototype.ishln=function(e){return n(0===this.negative),this.iushln(e)},o.prototype.iushrn=function(e,t,r){var i;n("number"===typeof e&&e>=0),i=t?(t-t%26)/26:0;var o=e%26,a=Math.min((e-o)/26,this.length),s=67108863^67108863>>>o<<o,u=r;if(i-=a,i=Math.max(0,i),u){for(var c=0;c<a;c++)u.words[c]=this.words[c];u.length=a}if(0===a);else if(this.length>a)for(this.length-=a,c=0;c<this.length;c++)this.words[c]=this.words[c+a];else this.words[0]=0,this.length=1;var l=0;for(c=this.length-1;c>=0&&(0!==l||c>=i);c--){var f=0|this.words[c];this.words[c]=l<<26-o|f>>>o,l=f&s}return u&&0!==l&&(u.words[u.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},o.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){n("number"===typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<<t;return!(this.length<=r)&&!!(this.words[r]&i)},o.prototype.imaskn=function(e){n("number"===typeof e&&e>=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<<t;this.words[this.length-1]&=i}return this._strip()},o.prototype.maskn=function(e){return this.clone().imaskn(e)},o.prototype.iaddn=function(e){return n("number"===typeof e),n(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<=e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},o.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(n("number"===typeof e),n(e<67108864),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<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this._strip()},o.prototype.addn=function(e){return this.clone().iaddn(e)},o.prototype.subn=function(e){return this.clone().isubn(e)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(e,t,r){var i,o,a=e.length+r;this._expand(a);var s=0;for(i=0;i<e.length;i++){o=(0|this.words[i+r])+s;var u=(0|e.words[i])*t;s=((o-=67108863&u)>>26)-(u/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)s=(o=(0|this.words[i+r])+s)>>26,this.words[i+r]=67108863&o;if(0===s)return this._strip();for(n(-1===s),s=0,i=0;i<this.length;i++)s=(o=-(0|this.words[i])+s)>>26,this.words[i]=67108863&o;return this.negative=1,this._strip()},o.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,a=0|i.words[i.length-1];0!==(r=26-this._countBits(a))&&(i=i.ushln(r),n.iushln(r),a=0|i.words[i.length-1]);var s,u=n.length-i.length;if("mod"!==t){(s=new o(null)).length=u+1,s.words=new Array(s.length);for(var c=0;c<s.length;c++)s.words[c]=0}var l=n.clone()._ishlnsubmul(i,1,u);0===l.negative&&(n=l,s&&(s.words[u]=1));for(var f=u-1;f>=0;f--){var h=67108864*(0|n.words[i.length+f])+(0|n.words[i.length+f-1]);for(h=Math.min(h/a|0,67108863),n._ishlnsubmul(i,h,f);0!==n.negative;)h--,n.negative=0,n._ishlnsubmul(i,1,f),n.isZero()||(n.negative^=1);s&&(s.words[f]=h)}return s&&s._strip(),n._strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},o.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(i=s.div.neg()),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.iadd(e)),{div:i,mod:a}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(i=s.div.neg()),{div:i,mod:s.mod}):0!==(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(a=s.mod.neg(),r&&0!==a.negative&&a.isub(e)),{div:s.div,mod:a}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modrn(e.words[0]))}:this._wordDiv(e,t);var i,a,s},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.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,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modrn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=(1<<26)%e,i=0,o=this.length-1;o>=0;o--)i=(r*i+(0|this.words[o]))%e;return t?-i:i},o.prototype.modn=function(e){return this.modrn(e)},o.prototype.idivn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+67108864*r;this.words[i]=o/e|0,r=o%e}return this._strip(),t?this.ineg():this},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),a=new o(0),s=new o(0),u=new o(1),c=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++c;for(var l=r.clone(),f=t.clone();!t.isZero();){for(var h=0,d=1;0===(t.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(t.iushrn(h);h-- >0;)(i.isOdd()||a.isOdd())&&(i.iadd(l),a.isub(f)),i.iushrn(1),a.iushrn(1);for(var p=0,v=1;0===(r.words[0]&v)&&p<26;++p,v<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(l),u.isub(f)),s.iushrn(1),u.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(s),a.isub(u)):(r.isub(t),s.isub(i),u.isub(a))}return{a:s,b:u,gcd:r.iushln(c)}},o.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,a=new o(1),s=new o(0),u=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var c=0,l=1;0===(t.words[0]&l)&&c<26;++c,l<<=1);if(c>0)for(t.iushrn(c);c-- >0;)a.isOdd()&&a.iadd(u),a.iushrn(1);for(var f=0,h=1;0===(r.words[0]&h)&&f<26;++f,h<<=1);if(f>0)for(r.iushrn(f);f-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);t.cmp(r)>=0?(t.isub(r),a.isub(s)):(r.isub(t),s.isub(a))}return(i=0===t.cmpn(1)?a:s).cmpn(0)<0&&i.iadd(e),i},o.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 n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0===(1&this.words[0])},o.prototype.isOdd=function(){return 1===(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){n("number"===typeof e);var t=e%26,r=(e-t)/26,i=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var o=i,a=r;0!==o&&a<this.length;a++){var s=0|this.words[a];o=(s+=o)>>>26,s&=67108863,this.words[a]=s}return 0!==o&&(this.words[a]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:i<e?-1:1}return 0!==this.negative?0|-t:t},o.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},o.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){n<i?t=-1:n>i&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new A(e)},o.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var w={k256:null,p224:null,p192:null,p25519:null};function k(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function E(){k.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function x(){k.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function S(){k.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function _(){k.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function A(e){if("string"===typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function I(e){A.call(this,e),this.shift=this.m.bitLength(),this.shift%26!==0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}k.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},k.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 n=t<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},k.prototype.split=function(e,t){e.iushrn(this.n,0,t)},k.prototype.imulK=function(e){return e.imul(this.k)},i(E,k),E.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),i=0;i<n;i++)t.words[i]=e.words[i];if(t.length=n,e.length<=9)return e.words[0]=0,void(e.length=1);var o=e.words[9];for(t.words[t.length++]=o&r,i=10;i<e.length;i++){var a=0|e.words[i];e.words[i-10]=(a&r)<<4|o>>>22,o=a}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},E.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<e.length;r++){var n=0|e.words[r];t+=977*n,e.words[r]=67108863&t,t=64*n+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},i(x,k),i(S,k),i(_,k),_.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var n=19*(0|e.words[r])+t,i=67108863&n;n>>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(w[e])return w[e];var t;if("k256"===e)t=new E;else if("p224"===e)t=new x;else if("p192"===e)t=new S;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new _}return w[e]=t,t},A.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},A.prototype._verify2=function(e,t){n(0===(e.negative|t.negative),"red works only with positives"),n(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):(l(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 r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},A.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<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(n(t%2===1),3===t){var r=this.m.add(new o(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),a=0;!i.isZero()&&0===i.andln(1);)a++,i.iushrn(1);n(!i.isZero());var s=new o(1).toRed(this),u=s.redNeg(),c=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,c).cmp(u);)l.redIAdd(u);for(var f=this.pow(l,i),h=this.pow(e,i.addn(1).iushrn(1)),d=this.pow(e,i),p=a;0!==d.cmp(s);){for(var v=d,g=0;0!==v.cmp(s);g++)v=v.redSqr();n(g<p);var y=this.pow(f,new o(1).iushln(p-g-1));h=h.redMul(y),f=y.redSqr(),d=d.redMul(f),p=g}return h},A.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},A.prototype.pow=function(e,t){if(t.isZero())return new o(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=e;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],e);var i=r[0],a=0,s=0,u=t.bitLength()%26;for(0===u&&(u=26),n=t.length-1;n>=0;n--){for(var c=t.words[n],l=u-1;l>=0;l--){var f=c>>l&1;i!==r[0]&&(i=this.sqr(i)),0!==f||0!==a?(a<<=1,a|=f,(4===++s||0===n&&0===l)&&(i=this.mul(i,r[a]),s=0,a=0)):s=0}u=26}return i},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},o.mont=function(e){return new I(e)},i(I,A),I.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},I.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},I.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},I.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},I.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},5467:function(e,t,r){t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;var r="color: "+this.color;t.splice(1,0,r,"color: inherit");var n=0,i=0;t[0].replace(/%[a-zA-Z%]/g,(function(e){"%%"!==e&&(n++,"%c"===e&&(i=n))})),t.splice(i,0,r)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(r){}},t.load=function(){var e;try{e=t.storage.getItem("debug")}catch(r){}!e&&"undefined"!==typeof process&&"env"in process&&(e={NODE_ENV:"production",PUBLIC_URL:"/rln-react-ts",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0}.DEBUG);return e},t.useColors=function(){if("undefined"!==typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!==typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!==typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!==typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!==typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!==typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=function(){var e=!1;return function(){e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}}(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||function(){},e.exports=r(3760)(t),e.exports.formatters.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}},3760:function(e,t,r){var n=r(9616).default;e.exports=function(e){function t(e){var r,n,o,a=null;function s(){for(var e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];if(s.enabled){var o=s,a=Number(new Date),u=a-(r||a);o.diff=u,o.prev=r,o.curr=a,r=a,n[0]=t.coerce(n[0]),"string"!==typeof n[0]&&n.unshift("%O");var c=0;n[0]=n[0].replace(/%([a-zA-Z%])/g,(function(e,r){if("%%"===e)return"%";c++;var i=t.formatters[r];if("function"===typeof i){var a=n[c];e=i.call(o,a),n.splice(c,1),c--}return e})),t.formatArgs.call(o,n);var l=o.log||t.log;l.apply(o,n)}}return s.namespace=e,s.useColors=t.useColors(),s.color=t.selectColor(e),s.extend=i,s.destroy=t.destroy,Object.defineProperty(s,"enabled",{enumerable:!0,configurable:!1,get:function(){return null!==a?a:(n!==t.namespaces&&(n=t.namespaces,o=t.enabled(e)),o)},set:function(e){a=e}}),"function"===typeof t.init&&t.init(s),s}function i(e,r){var n=t(this.namespace+("undefined"===typeof r?":":r)+e);return n.log=this.log,n}function o(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){if(e instanceof Error)return e.stack||e.message;return e},t.disable=function(){var e=[].concat(n(t.names.map(o)),n(t.skips.map(o).map((function(e){return"-"+e})))).join(",");return t.enable(""),e},t.enable=function(e){var r;t.save(e),t.namespaces=e,t.names=[],t.skips=[];var n=("string"===typeof e?e:"").split(/[\s,]+/),i=n.length;for(r=0;r<i;r++)n[r]&&("-"===(e=n[r].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.slice(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;var r,n;for(r=0,n=t.skips.length;r<n;r++)if(t.skips[r].test(e))return!1;for(r=0,n=t.names.length;r<n;r++)if(t.names[r].test(e))return!0;return!1},t.humanize=r(3962),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach((function(r){t[r]=e[r]})),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){for(var r=0,n=0;n<e.length;n++)r=(r<<5)-r+e.charCodeAt(n),r|=0;return t.colors[Math.abs(r)%t.colors.length]},t.enable(t.load()),t}},6167:function(e){"use strict";function t(e,t){t=t||{};this._head=0,this._tail=0,this._capacity=t.capacity,this._capacityMask=3,this._list=new Array(4),Array.isArray(e)&&this._fromArray(e)}t.prototype.peekAt=function(e){var t=e;if(t===(0|t)){var r=this.size();if(!(t>=r||t<-r))return t<0&&(t+=r),t=this._head+t&this._capacityMask,this._list[t]}},t.prototype.get=function(e){return this.peekAt(e)},t.prototype.peek=function(){if(this._head!==this._tail)return this._list[this._head]},t.prototype.peekFront=function(){return this.peek()},t.prototype.peekBack=function(){return this.peekAt(-1)},Object.defineProperty(t.prototype,"length",{get:function(){return this.size()}}),t.prototype.size=function(){return this._head===this._tail?0:this._head<this._tail?this._tail-this._head:this._capacityMask+1-(this._head-this._tail)},t.prototype.unshift=function(e){if(void 0===e)return this.size();var t=this._list.length;return this._head=this._head-1+t&this._capacityMask,this._list[this._head]=e,this._tail===this._head&&this._growArray(),this._capacity&&this.size()>this._capacity&&this.pop(),this._head<this._tail?this._tail-this._head:this._capacityMask+1-(this._head-this._tail)},t.prototype.shift=function(){var e=this._head;if(e!==this._tail){var t=this._list[e];return this._list[e]=void 0,this._head=e+1&this._capacityMask,e<2&&this._tail>1e4&&this._tail<=this._list.length>>>2&&this._shrinkArray(),t}},t.prototype.push=function(e){if(void 0===e)return this.size();var t=this._tail;return this._list[t]=e,this._tail=t+1&this._capacityMask,this._tail===this._head&&this._growArray(),this._capacity&&this.size()>this._capacity&&this.shift(),this._head<this._tail?this._tail-this._head:this._capacityMask+1-(this._head-this._tail)},t.prototype.pop=function(){var e=this._tail;if(e!==this._head){var t=this._list.length;this._tail=e-1+t&this._capacityMask;var r=this._list[this._tail];return this._list[this._tail]=void 0,this._head<2&&e>1e4&&e<=t>>>2&&this._shrinkArray(),r}},t.prototype.removeOne=function(e){var t=e;if(t===(0|t)&&this._head!==this._tail){var r=this.size(),n=this._list.length;if(!(t>=r||t<-r)){t<0&&(t+=r),t=this._head+t&this._capacityMask;var i,o=this._list[t];if(e<r/2){for(i=e;i>0;i--)this._list[t]=this._list[t=t-1+n&this._capacityMask];this._list[t]=void 0,this._head=this._head+1+n&this._capacityMask}else{for(i=r-1-e;i>0;i--)this._list[t]=this._list[t=t+1+n&this._capacityMask];this._list[t]=void 0,this._tail=this._tail-1+n&this._capacityMask}return o}}},t.prototype.remove=function(e,t){var r,n=e,i=t;if(n===(0|n)&&this._head!==this._tail){var o=this.size(),a=this._list.length;if(!(n>=o||n<-o||t<1)){if(n<0&&(n+=o),1===t||!t)return(r=new Array(1))[0]=this.removeOne(n),r;if(0===n&&n+t>=o)return r=this.toArray(),this.clear(),r;var s;for(n+t>o&&(t=o-n),r=new Array(t),s=0;s<t;s++)r[s]=this._list[this._head+n+s&this._capacityMask];if(n=this._head+n&this._capacityMask,e+t===o){for(this._tail=this._tail-t+a&this._capacityMask,s=t;s>0;s--)this._list[n=n+1+a&this._capacityMask]=void 0;return r}if(0===e){for(this._head=this._head+t+a&this._capacityMask,s=t-1;s>0;s--)this._list[n=n+1+a&this._capacityMask]=void 0;return r}if(n<o/2){for(this._head=this._head+e+t+a&this._capacityMask,s=e;s>0;s--)this.unshift(this._list[n=n-1+a&this._capacityMask]);for(n=this._head-1+a&this._capacityMask;i>0;)this._list[n=n-1+a&this._capacityMask]=void 0,i--;e<0&&(this._tail=n)}else{for(this._tail=n,n=n+t+a&this._capacityMask,s=o-(t+e);s>0;s--)this.push(this._list[n++]);for(n=this._tail;i>0;)this._list[n=n+1+a&this._capacityMask]=void 0,i--}return this._head<2&&this._tail>1e4&&this._tail<=a>>>2&&this._shrinkArray(),r}}},t.prototype.splice=function(e,t){var r=e;if(r===(0|r)){var n=this.size();if(r<0&&(r+=n),!(r>n)){if(arguments.length>2){var i,o,a,s=arguments.length,u=this._list.length,c=2;if(!n||r<n/2){for(o=new Array(r),i=0;i<r;i++)o[i]=this._list[this._head+i&this._capacityMask];for(0===t?(a=[],r>0&&(this._head=this._head+r+u&this._capacityMask)):(a=this.remove(r,t),this._head=this._head+r+u&this._capacityMask);s>c;)this.unshift(arguments[--s]);for(i=r;i>0;i--)this.unshift(o[i-1])}else{var l=(o=new Array(n-(r+t))).length;for(i=0;i<l;i++)o[i]=this._list[this._head+r+t+i&this._capacityMask];for(0===t?(a=[],r!=n&&(this._tail=this._head+r+u&this._capacityMask)):(a=this.remove(r,t),this._tail=this._tail-l+u&this._capacityMask);c<s;)this.push(arguments[c++]);for(i=0;i<l;i++)this.push(o[i])}return a}return this.remove(r,t)}}},t.prototype.clear=function(){this._head=0,this._tail=0},t.prototype.isEmpty=function(){return this._head===this._tail},t.prototype.toArray=function(){return this._copyArray(!1)},t.prototype._fromArray=function(e){for(var t=0;t<e.length;t++)this.push(e[t])},t.prototype._copyArray=function(e){var t,r=[],n=this._list,i=n.length;if(e||this._head>this._tail){for(t=this._head;t<i;t++)r.push(n[t]);for(t=0;t<this._tail;t++)r.push(n[t])}else for(t=this._head;t<this._tail;t++)r.push(n[t]);return r},t.prototype._growArray=function(){this._head&&(this._list=this._copyArray(!0),this._head=0),this._tail=this._list.length,this._list.length<<=1,this._capacityMask=this._capacityMask<<1|1},t.prototype._shrinkArray=function(){this._list.length>>>=1,this._capacityMask>>>=1},e.exports=t},5697:function(e){"use strict";function t(e,t){for(var r in t)Object.defineProperty(e,r,{value:t[r],enumerable:!0,configurable:!0});return e}e.exports=function(e,r,n){if(!e||"string"===typeof e)throw new TypeError("Please pass an Error to err-code");n||(n={}),"object"===typeof r&&(n=r,r=""),r&&(n.code=r);try{return t(e,n)}catch(o){n.message=e.message,n.stack=e.stack;var i=function(){};return i.prototype=Object.create(Object.getPrototypeOf(e)),t(new i,n)}}},693:function(e,t,r){var n=r(361).default,i=r(6117).default;e.exports=function(){"use strict";function e(t){if(n(this,e),!(t>0)||0!==(t-1&t))throw new Error("Max size for a FixedFIFO should be a power of two");this.buffer=new Array(t),this.mask=t-1,this.top=0,this.btm=0,this.next=null}return i(e,[{key:"push",value:function(e){return void 0===this.buffer[this.top]&&(this.buffer[this.top]=e,this.top=this.top+1&this.mask,!0)}},{key:"shift",value:function(){var e=this.buffer[this.btm];if(void 0!==e)return this.buffer[this.btm]=void 0,this.btm=this.btm+1&this.mask,e}},{key:"peek",value:function(){return this.buffer[this.btm]}},{key:"isEmpty",value:function(){return void 0===this.buffer[this.btm]}}]),e}()},1207:function(e,t,r){var n=r(361).default,i=r(6117).default,o=r(693);e.exports=function(){"use strict";function e(t){n(this,e),this.hwm=t||16,this.head=new o(this.hwm),this.tail=this.head}return i(e,[{key:"push",value:function(e){if(!this.head.push(e)){var t=this.head;this.head=t.next=new o(2*this.head.buffer.length),this.head.push(e)}}},{key:"shift",value:function(){var e=this.tail.shift();if(void 0===e&&this.tail.next){var t=this.tail.next;return this.tail.next=null,this.tail=t,this.tail.shift()}return e}},{key:"peek",value:function(){return this.tail.peek()}},{key:"isEmpty",value:function(){return this.head.isEmpty()}}]),e}()},7185:function(e,t,r){var n=t;n.utils=r(5542),n.common=r(1725),n.sha=r(3402),n.ripemd=r(6015),n.hmac=r(3859),n.sha1=n.sha.sha1,n.sha256=n.sha.sha256,n.sha224=n.sha.sha224,n.sha384=n.sha.sha384,n.sha512=n.sha.sha512,n.ripemd160=n.ripemd.ripemd160},1725:function(e,t,r){"use strict";var n=r(5542),i=r(6082);function o(){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}t.BlockHash=o,o.prototype.update=function(e,t){if(e=n.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var r=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=n.join32(e,0,e.length-r,this.endian);for(var i=0;i<e.length;i+=this._delta32)this._update(e,i,i+this._delta32)}return this},o.prototype.digest=function(e){return this.update(this._pad()),i(null===this.pending),this._digest(e)},o.prototype._pad=function(){var e=this.pendingTotal,t=this._delta8,r=t-(e+this.padLength)%t,n=new Array(r+this.padLength);n[0]=128;for(var i=1;i<r;i++)n[i]=0;if(e<<=3,"big"===this.endian){for(var o=8;o<this.padLength;o++)n[i++]=0;n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=e>>>24&255,n[i++]=e>>>16&255,n[i++]=e>>>8&255,n[i++]=255&e}else for(n[i++]=255&e,n[i++]=e>>>8&255,n[i++]=e>>>16&255,n[i++]=e>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,o=8;o<this.padLength;o++)n[i++]=0;return n}},3859:function(e,t,r){"use strict";var n=r(5542),i=r(6082);function o(e,t,r){if(!(this instanceof o))return new o(e,t,r);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(n.toArray(t,r))}e.exports=o,o.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<this.blockSize;t++)e.push(0);for(t=0;t<e.length;t++)e[t]^=54;for(this.inner=(new this.Hash).update(e),t=0;t<e.length;t++)e[t]^=106;this.outer=(new this.Hash).update(e)},o.prototype.update=function(e,t){return this.inner.update(e,t),this},o.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)}},6015:function(e,t,r){"use strict";var n=r(5542),i=r(1725),o=n.rotl32,a=n.sum32,s=n.sum32_3,u=n.sum32_4,c=i.BlockHash;function l(){if(!(this instanceof l))return new l;c.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function f(e,t,r,n){return e<=15?t^r^n:e<=31?t&r|~t&n:e<=47?(t|~r)^n:e<=63?t&n|r&~n:t^(r|~n)}function h(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function d(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}n.inherits(l,c),t.ripemd160=l,l.blockSize=512,l.outSize=160,l.hmacStrength=192,l.padLength=64,l.prototype._update=function(e,t){for(var r=this.h[0],n=this.h[1],i=this.h[2],c=this.h[3],l=this.h[4],m=r,b=n,w=i,k=c,E=l,x=0;x<80;x++){var S=a(o(u(r,f(x,n,i,c),e[p[x]+t],h(x)),g[x]),l);r=l,l=c,c=o(i,10),i=n,n=S,S=a(o(u(m,f(79-x,b,w,k),e[v[x]+t],d(x)),y[x]),E),m=E,E=k,k=o(w,10),w=b,b=S}S=s(this.h[1],i,k),this.h[1]=s(this.h[2],c,E),this.h[2]=s(this.h[3],l,m),this.h[3]=s(this.h[4],r,b),this.h[4]=s(this.h[0],n,w),this.h[0]=S},l.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"little"):n.split32(this.h,"little")};var p=[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],v=[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],g=[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],y=[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]},3402:function(e,t,r){"use strict";t.sha1=r(9481),t.sha224=r(8496),t.sha256=r(6489),t.sha384=r(3015),t.sha512=r(5233)},9481:function(e,t,r){"use strict";var n=r(5542),i=r(1725),o=r(9958),a=n.rotl32,s=n.sum32,u=n.sum32_5,c=o.ft_1,l=i.BlockHash,f=[1518500249,1859775393,2400959708,3395469782];function h(){if(!(this instanceof h))return new h;l.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}n.inherits(h,l),e.exports=h,h.blockSize=512,h.outSize=160,h.hmacStrength=80,h.padLength=64,h.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n<r.length;n++)r[n]=a(r[n-3]^r[n-8]^r[n-14]^r[n-16],1);var i=this.h[0],o=this.h[1],l=this.h[2],h=this.h[3],d=this.h[4];for(n=0;n<r.length;n++){var p=~~(n/20),v=u(a(i,5),c(p,o,l,h),d,r[n],f[p]);d=h,h=l,l=a(o,30),o=i,i=v}this.h[0]=s(this.h[0],i),this.h[1]=s(this.h[1],o),this.h[2]=s(this.h[2],l),this.h[3]=s(this.h[3],h),this.h[4]=s(this.h[4],d)},h.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},8496:function(e,t,r){"use strict";var n=r(5542),i=r(6489);function o(){if(!(this instanceof o))return new o;i.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}n.inherits(o,i),e.exports=o,o.blockSize=512,o.outSize=224,o.hmacStrength=192,o.padLength=64,o.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h.slice(0,7),"big"):n.split32(this.h.slice(0,7),"big")}},6489:function(e,t,r){"use strict";var n=r(5542),i=r(1725),o=r(9958),a=r(6082),s=n.sum32,u=n.sum32_4,c=n.sum32_5,l=o.ch32,f=o.maj32,h=o.s0_256,d=o.s1_256,p=o.g0_256,v=o.g1_256,g=i.BlockHash,y=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function m(){if(!(this instanceof m))return new m;g.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=y,this.W=new Array(64)}n.inherits(m,g),e.exports=m,m.blockSize=512,m.outSize=256,m.hmacStrength=192,m.padLength=64,m.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n<r.length;n++)r[n]=u(v(r[n-2]),r[n-7],p(r[n-15]),r[n-16]);var i=this.h[0],o=this.h[1],g=this.h[2],y=this.h[3],m=this.h[4],b=this.h[5],w=this.h[6],k=this.h[7];for(a(this.k.length===r.length),n=0;n<r.length;n++){var E=c(k,d(m),l(m,b,w),this.k[n],r[n]),x=s(h(i),f(i,o,g));k=w,w=b,b=m,m=s(y,E),y=g,g=o,o=i,i=s(E,x)}this.h[0]=s(this.h[0],i),this.h[1]=s(this.h[1],o),this.h[2]=s(this.h[2],g),this.h[3]=s(this.h[3],y),this.h[4]=s(this.h[4],m),this.h[5]=s(this.h[5],b),this.h[6]=s(this.h[6],w),this.h[7]=s(this.h[7],k)},m.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},3015:function(e,t,r){"use strict";var n=r(5542),i=r(5233);function o(){if(!(this instanceof o))return new o;i.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}n.inherits(o,i),e.exports=o,o.blockSize=1024,o.outSize=384,o.hmacStrength=192,o.padLength=128,o.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h.slice(0,12),"big"):n.split32(this.h.slice(0,12),"big")}},5233:function(e,t,r){"use strict";var n=r(5542),i=r(1725),o=r(6082),a=n.rotr64_hi,s=n.rotr64_lo,u=n.shr64_hi,c=n.shr64_lo,l=n.sum64,f=n.sum64_hi,h=n.sum64_lo,d=n.sum64_4_hi,p=n.sum64_4_lo,v=n.sum64_5_hi,g=n.sum64_5_lo,y=i.BlockHash,m=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function b(){if(!(this instanceof b))return new b;y.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=m,this.W=new Array(160)}function w(e,t,r,n,i){var o=e&r^~e&i;return o<0&&(o+=4294967296),o}function k(e,t,r,n,i,o){var a=t&n^~t&o;return a<0&&(a+=4294967296),a}function E(e,t,r,n,i){var o=e&r^e&i^r&i;return o<0&&(o+=4294967296),o}function x(e,t,r,n,i,o){var a=t&n^t&o^n&o;return a<0&&(a+=4294967296),a}function S(e,t){var r=a(e,t,28)^a(t,e,2)^a(t,e,7);return r<0&&(r+=4294967296),r}function _(e,t){var r=s(e,t,28)^s(t,e,2)^s(t,e,7);return r<0&&(r+=4294967296),r}function A(e,t){var r=a(e,t,14)^a(e,t,18)^a(t,e,9);return r<0&&(r+=4294967296),r}function I(e,t){var r=s(e,t,14)^s(e,t,18)^s(t,e,9);return r<0&&(r+=4294967296),r}function C(e,t){var r=a(e,t,1)^a(e,t,8)^u(e,t,7);return r<0&&(r+=4294967296),r}function T(e,t){var r=s(e,t,1)^s(e,t,8)^c(e,t,7);return r<0&&(r+=4294967296),r}function P(e,t){var r=a(e,t,19)^a(t,e,29)^u(e,t,6);return r<0&&(r+=4294967296),r}function R(e,t){var r=s(e,t,19)^s(t,e,29)^c(e,t,6);return r<0&&(r+=4294967296),r}n.inherits(b,y),e.exports=b,b.blockSize=1024,b.outSize=512,b.hmacStrength=192,b.padLength=128,b.prototype._prepareBlock=function(e,t){for(var r=this.W,n=0;n<32;n++)r[n]=e[t+n];for(;n<r.length;n+=2){var i=P(r[n-4],r[n-3]),o=R(r[n-4],r[n-3]),a=r[n-14],s=r[n-13],u=C(r[n-30],r[n-29]),c=T(r[n-30],r[n-29]),l=r[n-32],f=r[n-31];r[n]=d(i,o,a,s,u,c,l,f),r[n+1]=p(i,o,a,s,u,c,l,f)}},b.prototype._update=function(e,t){this._prepareBlock(e,t);var r=this.W,n=this.h[0],i=this.h[1],a=this.h[2],s=this.h[3],u=this.h[4],c=this.h[5],d=this.h[6],p=this.h[7],y=this.h[8],m=this.h[9],b=this.h[10],C=this.h[11],T=this.h[12],P=this.h[13],R=this.h[14],B=this.h[15];o(this.k.length===r.length);for(var M=0;M<r.length;M+=2){var N=R,O=B,D=A(y,m),L=I(y,m),U=w(y,m,b,C,T),F=k(y,m,b,C,T,P),z=this.k[M],Z=this.k[M+1],j=r[M],q=r[M+1],K=v(N,O,D,L,U,F,z,Z,j,q),V=g(N,O,D,L,U,F,z,Z,j,q);N=S(n,i),O=_(n,i),D=E(n,i,a,s,u),L=x(n,i,a,s,u,c);var H=f(N,O,D,L),G=h(N,O,D,L);R=T,B=P,T=b,P=C,b=y,C=m,y=f(d,p,K,V),m=h(p,p,K,V),d=u,p=c,u=a,c=s,a=n,s=i,n=f(K,V,H,G),i=h(K,V,H,G)}l(this.h,0,n,i),l(this.h,2,a,s),l(this.h,4,u,c),l(this.h,6,d,p),l(this.h,8,y,m),l(this.h,10,b,C),l(this.h,12,T,P),l(this.h,14,R,B)},b.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},9958:function(e,t,r){"use strict";var n=r(5542).rotr32;function i(e,t,r){return e&t^~e&r}function o(e,t,r){return e&t^e&r^t&r}function a(e,t,r){return e^t^r}t.ft_1=function(e,t,r,n){return 0===e?i(t,r,n):1===e||3===e?a(t,r,n):2===e?o(t,r,n):void 0},t.ch32=i,t.maj32=o,t.p32=a,t.s0_256=function(e){return n(e,2)^n(e,13)^n(e,22)},t.s1_256=function(e){return n(e,6)^n(e,11)^n(e,25)},t.g0_256=function(e){return n(e,7)^n(e,18)^e>>>3},t.g1_256=function(e){return n(e,17)^n(e,19)^e>>>10}},5542:function(e,t,r){"use strict";var n=r(6082),i=r(7022);function o(e,t){return 55296===(64512&e.charCodeAt(t))&&(!(t<0||t+1>=e.length)&&56320===(64512&e.charCodeAt(t+1)))}function a(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function s(e){return 1===e.length?"0"+e:e}function u(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}t.inherits=i,t.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]+/gi,"")).length%2!==0&&(e="0"+e),i=0;i<e.length;i+=2)r.push(parseInt(e[i]+e[i+1],16))}else for(var n=0,i=0;i<e.length;i++){var a=e.charCodeAt(i);a<128?r[n++]=a:a<2048?(r[n++]=a>>6|192,r[n++]=63&a|128):o(e,i)?(a=65536+((1023&a)<<10)+(1023&e.charCodeAt(++i)),r[n++]=a>>18|240,r[n++]=a>>12&63|128,r[n++]=a>>6&63|128,r[n++]=63&a|128):(r[n++]=a>>12|224,r[n++]=a>>6&63|128,r[n++]=63&a|128)}else for(i=0;i<e.length;i++)r[i]=0|e[i];return r},t.toHex=function(e){for(var t="",r=0;r<e.length;r++)t+=s(e[r].toString(16));return t},t.htonl=a,t.toHex32=function(e,t){for(var r="",n=0;n<e.length;n++){var i=e[n];"little"===t&&(i=a(i)),r+=u(i.toString(16))}return r},t.zero2=s,t.zero8=u,t.join32=function(e,t,r,i){var o=r-t;n(o%4===0);for(var a=new Array(o/4),s=0,u=t;s<a.length;s++,u+=4){var c;c="big"===i?e[u]<<24|e[u+1]<<16|e[u+2]<<8|e[u+3]:e[u+3]<<24|e[u+2]<<16|e[u+1]<<8|e[u],a[s]=c>>>0}return a},t.split32=function(e,t){for(var r=new Array(4*e.length),n=0,i=0;n<e.length;n++,i+=4){var o=e[n];"big"===t?(r[i]=o>>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=255&o):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=255&o)}return r},t.rotr32=function(e,t){return e>>>t|e<<32-t},t.rotl32=function(e,t){return e<<t|e>>>32-t},t.sum32=function(e,t){return e+t>>>0},t.sum32_3=function(e,t,r){return e+t+r>>>0},t.sum32_4=function(e,t,r,n){return e+t+r+n>>>0},t.sum32_5=function(e,t,r,n,i){return e+t+r+n+i>>>0},t.sum64=function(e,t,r,n){var i=e[t],o=n+e[t+1]>>>0,a=(o<n?1:0)+r+i;e[t]=a>>>0,e[t+1]=o},t.sum64_hi=function(e,t,r,n){return(t+n>>>0<t?1:0)+e+r>>>0},t.sum64_lo=function(e,t,r,n){return t+n>>>0},t.sum64_4_hi=function(e,t,r,n,i,o,a,s){var u=0,c=t;return u+=(c=c+n>>>0)<t?1:0,u+=(c=c+o>>>0)<o?1:0,e+r+i+a+(u+=(c=c+s>>>0)<s?1:0)>>>0},t.sum64_4_lo=function(e,t,r,n,i,o,a,s){return t+n+o+s>>>0},t.sum64_5_hi=function(e,t,r,n,i,o,a,s,u,c){var l=0,f=t;return l+=(f=f+n>>>0)<t?1:0,l+=(f=f+o>>>0)<o?1:0,l+=(f=f+s>>>0)<s?1:0,e+r+i+a+u+(l+=(f=f+c>>>0)<c?1:0)>>>0},t.sum64_5_lo=function(e,t,r,n,i,o,a,s,u,c){return t+n+o+s+c>>>0},t.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},t.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},t.shr64_hi=function(e,t,r){return e>>>r},t.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0}},2990:function(e,t,r){"use strict";var n=r(6782),i={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},o={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},a={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},s={};function u(e){return n.isMemo(e)?a:s[e.$$typeof]||i}s[n.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},s[n.Memo]=a;var c=Object.defineProperty,l=Object.getOwnPropertyNames,f=Object.getOwnPropertySymbols,h=Object.getOwnPropertyDescriptor,d=Object.getPrototypeOf,p=Object.prototype;e.exports=function e(t,r,n){if("string"!==typeof r){if(p){var i=d(r);i&&i!==p&&e(t,i,n)}var a=l(r);f&&(a=a.concat(f(r)));for(var s=u(t),v=u(r),g=0;g<a.length;++g){var y=a[g];if(!o[y]&&(!n||!n[y])&&(!v||!v[y])&&(!s||!s[y])){var m=h(r,y);try{c(t,y,m)}catch(b){}}}}return t}},7022:function(e){"function"===typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},8873:function(e,t,r){"use strict";var n=r(1267).default,i=r(601).default,o=r(7201).default,a=function(){var e=i(n().mark((function e(t){var r,i,a,s,u,c,l;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=[],i=!1,a=!1,e.prev=3,u=o(t);case 5:return e.next=7,u.next();case 7:if(!(i=!(c=e.sent).done)){e.next=13;break}l=c.value,r.push(l);case 10:i=!1,e.next=5;break;case 13:e.next=19;break;case 15:e.prev=15,e.t0=e.catch(3),a=!0,s=e.t0;case 19:if(e.prev=19,e.prev=20,!i||null==u.return){e.next=24;break}return e.next=24,u.return();case 24:if(e.prev=24,!a){e.next=27;break}throw s;case 27:return e.finish(24);case 28:return e.finish(19);case 29:return e.abrupt("return",r);case 30:case"end":return e.stop()}}),e,null,[[3,15,19,29],[20,,24,28]])})));return function(t){return e.apply(this,arguments)}}();e.exports=a},8315:function(e,t,r){"use strict";var n=r(1267).default,i=r(601).default,o=r(1630).default,a=r(7825).default,s=r(5311).default,u=r(7201).default,c=r(2550),l=function(){var e=o(n().mark((function e(){var t,r,o,l,f=arguments;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(t=f.length,r=new Array(t),o=0;o<t;o++)r[o]=f[o];return l=c(),setTimeout(i(n().mark((function e(){return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Promise.all(r.map(function(){var e=i(n().mark((function e(t){var r,i,o,a,s,c;return n().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=!1,i=!1,e.prev=2,a=u(t);case 4:return e.next=6,a.next();case 6:if(!(r=!(s=e.sent).done)){e.next=12;break}c=s.value,l.push(c);case 9:r=!1,e.next=4;break;case 12:e.next=18;break;case 14:e.prev=14,e.t0=e.catch(2),i=!0,o=e.t0;case 18:if(e.prev=18,e.prev=19,!r||null==a.return){e.next=23;break}return e.next=23,a.return();case 23:if(e.prev=23,!i){e.next=26;break}throw o;case 26:return e.finish(23);case 27:return e.finish(18);case 28:case"end":return e.stop()}}),e,null,[[2,14,18,28],[19,,23,27]])})));return function(t){return e.apply(this,arguments)}}()));case 3:l.end(),e.next=9;break;case 6:e.prev=6,e.t0=e.catch(0),l.end(e.t0);case 9:case"end":return e.stop()}}),e,null,[[0,6]])}))),0),e.delegateYield(s(u(l),a),"t0",4);case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();e.exports=l},2550:function(e,t,r){var n=r(314).default,i=r(1207);e.exports=function(e){var t,r,o;"function"===typeof(e=e||{})?(o=e,e={}):o=e.onEnd;var a,s,u,c=new i,l=function(e){return s?s(e):(c.push(e),a)},f=function(e){return u?a:l({done:!1,value:e})},h=function(e){return u?a:(u=!0,e?function(e){return c=new i,s?s({error:e}):(c.push({error:e}),a)}(e):l({done:!0}))};if(n(t={},Symbol.asyncIterator,(function(){return this})),n(t,"next",(function(){if(!c.isEmpty()){if(e.writev){for(var t,r=[];!c.isEmpty();){if((t=c.shift()).error)throw t.error;r.push(t.value)}return{done:t.done,value:r}}var n=c.shift();if(n.error)throw n.error;return n}return u?{done:!0}:new Promise((function(t,r){s=function(n){return s=null,n.error?r(n.error):e.writev&&!n.done?t({done:n.done,value:[n.value]}):t(n),a}}))})),n(t,"return",(function(){return c=new i,h(),{done:!0}})),n(t,"throw",(function(e){return h(e),{done:!0}})),n(t,"push",f),n(t,"end",h),a=t,!o)return a;var d=a;return n(r={},Symbol.asyncIterator,(function(){return this})),n(r,"next",(function(){return d.next()})),n(r,"throw",(function(e){return d.throw(e),o&&(o(e),o=null),{done:!0}})),n(r,"return",(function(){return d.return(),o&&(o(),o=null),{done:!0}})),n(r,"push",f),n(r,"end",(function(e){return d.end(e),o&&(o(e),o=null),a})),a=r}},6984:function(e,t,r){var n;!function(){"use strict";var i="input is invalid type",o="object"===typeof window,a=o?window:{};a.JS_SHA3_NO_WINDOW&&(o=!1);var s=!o&&"object"===typeof self;!a.JS_SHA3_NO_NODE_JS&&"object"===typeof process&&process.versions&&process.versions.node?a=r.g:s&&(a=self);var u=!a.JS_SHA3_NO_COMMON_JS&&e.exports,c=r.amdO,l=!a.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!==typeof ArrayBuffer,f="0123456789abcdef".split(""),h=[4,1024,262144,67108864],d=[0,8,16,24],p=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],v=[224,256,384,512],g=[128,256],y=["hex","buffer","arrayBuffer","array","digest"],m={128:168,256:136};!a.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!l||!a.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"===typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});for(var b=function(e,t,r){return function(n){return new N(e,t,e).update(n)[r]()}},w=function(e,t,r){return function(n,i){return new N(e,t,i).update(n)[r]()}},k=function(e,t,r){return function(t,n,i,o){return A["cshake"+e].update(t,n,i,o)[r]()}},E=function(e,t,r){return function(t,n,i,o){return A["kmac"+e].update(t,n,i,o)[r]()}},x=function(e,t,r,n){for(var i=0;i<y.length;++i){var o=y[i];e[o]=t(r,n,o)}return e},S=function(e,t){var r=b(e,t,"hex");return r.create=function(){return new N(e,t,e)},r.update=function(e){return r.create().update(e)},x(r,b,e,t)},_=[{name:"keccak",padding:[1,256,65536,16777216],bits:v,createMethod:S},{name:"sha3",padding:[6,1536,393216,100663296],bits:v,createMethod:S},{name:"shake",padding:[31,7936,2031616,520093696],bits:g,createMethod:function(e,t){var r=w(e,t,"hex");return r.create=function(r){return new N(e,t,r)},r.update=function(e,t){return r.create(t).update(e)},x(r,w,e,t)}},{name:"cshake",padding:h,bits:g,createMethod:function(e,t){var r=m[e],n=k(e,0,"hex");return n.create=function(n,i,o){return i||o?new N(e,t,n).bytepad([i,o],r):A["shake"+e].create(n)},n.update=function(e,t,r,i){return n.create(t,r,i).update(e)},x(n,k,e,t)}},{name:"kmac",padding:h,bits:g,createMethod:function(e,t){var r=m[e],n=E(e,0,"hex");return n.create=function(n,i,o){return new O(e,t,i).bytepad(["KMAC",o],r).bytepad([n],r)},n.update=function(e,t,r,i){return n.create(e,r,i).update(t)},x(n,E,e,t)}}],A={},I=[],C=0;C<_.length;++C)for(var T=_[C],P=T.bits,R=0;R<P.length;++R){var B=T.name+"_"+P[R];if(I.push(B),A[B]=T.createMethod(P[R],T.padding),"sha3"!==T.name){var M=T.name+P[R];I.push(M),A[M]=A[B]}}function N(e,t,r){this.blocks=[],this.s=[],this.padding=t,this.outputBits=r,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(e<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var n=0;n<50;++n)this.s[n]=0}function O(e,t,r){N.call(this,e,t,r)}N.prototype.update=function(e){if(this.finalized)throw new Error("finalize already called");var t,r=typeof e;if("string"!==r){if("object"!==r)throw new Error(i);if(null===e)throw new Error(i);if(l&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!Array.isArray(e)&&(!l||!ArrayBuffer.isView(e)))throw new Error(i);t=!0}for(var n,o,a=this.blocks,s=this.byteCount,u=e.length,c=this.blockCount,f=0,h=this.s;f<u;){if(this.reset)for(this.reset=!1,a[0]=this.block,n=1;n<c+1;++n)a[n]=0;if(t)for(n=this.start;f<u&&n<s;++f)a[n>>2]|=e[f]<<d[3&n++];else for(n=this.start;f<u&&n<s;++f)(o=e.charCodeAt(f))<128?a[n>>2]|=o<<d[3&n++]:o<2048?(a[n>>2]|=(192|o>>6)<<d[3&n++],a[n>>2]|=(128|63&o)<<d[3&n++]):o<55296||o>=57344?(a[n>>2]|=(224|o>>12)<<d[3&n++],a[n>>2]|=(128|o>>6&63)<<d[3&n++],a[n>>2]|=(128|63&o)<<d[3&n++]):(o=65536+((1023&o)<<10|1023&e.charCodeAt(++f)),a[n>>2]|=(240|o>>18)<<d[3&n++],a[n>>2]|=(128|o>>12&63)<<d[3&n++],a[n>>2]|=(128|o>>6&63)<<d[3&n++],a[n>>2]|=(128|63&o)<<d[3&n++]);if(this.lastByteIndex=n,n>=s){for(this.start=n-s,this.block=a[c],n=0;n<c;++n)h[n]^=a[n];D(h),this.reset=!0}else this.start=n}return this},N.prototype.encode=function(e,t){var r=255&e,n=1,i=[r];for(r=255&(e>>=8);r>0;)i.unshift(r),r=255&(e>>=8),++n;return t?i.push(n):i.unshift(n),this.update(i),i.length},N.prototype.encodeString=function(e){var t,r=typeof e;if("string"!==r){if("object"!==r)throw new Error(i);if(null===e)throw new Error(i);if(l&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!Array.isArray(e)&&(!l||!ArrayBuffer.isView(e)))throw new Error(i);t=!0}var n=0,o=e.length;if(t)n=o;else for(var a=0;a<e.length;++a){var s=e.charCodeAt(a);s<128?n+=1:s<2048?n+=2:s<55296||s>=57344?n+=3:(s=65536+((1023&s)<<10|1023&e.charCodeAt(++a)),n+=4)}return n+=this.encode(8*n),this.update(e),n},N.prototype.bytepad=function(e,t){for(var r=this.encode(t),n=0;n<e.length;++n)r+=this.encodeString(e[n]);var i=t-r%t,o=[];return o.length=i,this.update(o),this},N.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex,r=this.blockCount,n=this.s;if(e[t>>2]|=this.padding[3&t],this.lastByteIndex===this.byteCount)for(e[0]=e[r],t=1;t<r+1;++t)e[t]=0;for(e[r-1]|=2147483648,t=0;t<r;++t)n[t]^=e[t];D(n)}},N.prototype.toString=N.prototype.hex=function(){this.finalize();for(var e,t=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,a=0,s="";a<n;){for(o=0;o<t&&a<n;++o,++a)e=r[o],s+=f[e>>4&15]+f[15&e]+f[e>>12&15]+f[e>>8&15]+f[e>>20&15]+f[e>>16&15]+f[e>>28&15]+f[e>>24&15];a%t===0&&(D(r),o=0)}return i&&(e=r[o],s+=f[e>>4&15]+f[15&e],i>1&&(s+=f[e>>12&15]+f[e>>8&15]),i>2&&(s+=f[e>>20&15]+f[e>>16&15])),s},N.prototype.arrayBuffer=function(){this.finalize();var e,t=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,a=0,s=this.outputBits>>3;e=i?new ArrayBuffer(n+1<<2):new ArrayBuffer(s);for(var u=new Uint32Array(e);a<n;){for(o=0;o<t&&a<n;++o,++a)u[a]=r[o];a%t===0&&D(r)}return i&&(u[o]=r[o],e=e.slice(0,s)),e},N.prototype.buffer=N.prototype.arrayBuffer,N.prototype.digest=N.prototype.array=function(){this.finalize();for(var e,t,r=this.blockCount,n=this.s,i=this.outputBlocks,o=this.extraBytes,a=0,s=0,u=[];s<i;){for(a=0;a<r&&s<i;++a,++s)e=s<<2,t=n[a],u[e]=255&t,u[e+1]=t>>8&255,u[e+2]=t>>16&255,u[e+3]=t>>24&255;s%r===0&&D(n)}return o&&(e=s<<2,t=n[a],u[e]=255&t,o>1&&(u[e+1]=t>>8&255),o>2&&(u[e+2]=t>>16&255)),u},O.prototype=new N,O.prototype.finalize=function(){return this.encode(this.outputBits,!0),N.prototype.finalize.call(this)};var D=function(e){var t,r,n,i,o,a,s,u,c,l,f,h,d,v,g,y,m,b,w,k,E,x,S,_,A,I,C,T,P,R,B,M,N,O,D,L,U,F,z,Z,j,q,K,V,H,G,W,Q,J,Y,X,$,ee,te,re,ne,ie,oe,ae,se,ue,ce,le;for(n=0;n<48;n+=2)i=e[0]^e[10]^e[20]^e[30]^e[40],o=e[1]^e[11]^e[21]^e[31]^e[41],a=e[2]^e[12]^e[22]^e[32]^e[42],s=e[3]^e[13]^e[23]^e[33]^e[43],u=e[4]^e[14]^e[24]^e[34]^e[44],c=e[5]^e[15]^e[25]^e[35]^e[45],l=e[6]^e[16]^e[26]^e[36]^e[46],f=e[7]^e[17]^e[27]^e[37]^e[47],t=(h=e[8]^e[18]^e[28]^e[38]^e[48])^(a<<1|s>>>31),r=(d=e[9]^e[19]^e[29]^e[39]^e[49])^(s<<1|a>>>31),e[0]^=t,e[1]^=r,e[10]^=t,e[11]^=r,e[20]^=t,e[21]^=r,e[30]^=t,e[31]^=r,e[40]^=t,e[41]^=r,t=i^(u<<1|c>>>31),r=o^(c<<1|u>>>31),e[2]^=t,e[3]^=r,e[12]^=t,e[13]^=r,e[22]^=t,e[23]^=r,e[32]^=t,e[33]^=r,e[42]^=t,e[43]^=r,t=a^(l<<1|f>>>31),r=s^(f<<1|l>>>31),e[4]^=t,e[5]^=r,e[14]^=t,e[15]^=r,e[24]^=t,e[25]^=r,e[34]^=t,e[35]^=r,e[44]^=t,e[45]^=r,t=u^(h<<1|d>>>31),r=c^(d<<1|h>>>31),e[6]^=t,e[7]^=r,e[16]^=t,e[17]^=r,e[26]^=t,e[27]^=r,e[36]^=t,e[37]^=r,e[46]^=t,e[47]^=r,t=l^(i<<1|o>>>31),r=f^(o<<1|i>>>31),e[8]^=t,e[9]^=r,e[18]^=t,e[19]^=r,e[28]^=t,e[29]^=r,e[38]^=t,e[39]^=r,e[48]^=t,e[49]^=r,v=e[0],g=e[1],G=e[11]<<4|e[10]>>>28,W=e[10]<<4|e[11]>>>28,T=e[20]<<3|e[21]>>>29,P=e[21]<<3|e[20]>>>29,se=e[31]<<9|e[30]>>>23,ue=e[30]<<9|e[31]>>>23,q=e[40]<<18|e[41]>>>14,K=e[41]<<18|e[40]>>>14,O=e[2]<<1|e[3]>>>31,D=e[3]<<1|e[2]>>>31,y=e[13]<<12|e[12]>>>20,m=e[12]<<12|e[13]>>>20,Q=e[22]<<10|e[23]>>>22,J=e[23]<<10|e[22]>>>22,R=e[33]<<13|e[32]>>>19,B=e[32]<<13|e[33]>>>19,ce=e[42]<<2|e[43]>>>30,le=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,re=e[4]<<30|e[5]>>>2,L=e[14]<<6|e[15]>>>26,U=e[15]<<6|e[14]>>>26,b=e[25]<<11|e[24]>>>21,w=e[24]<<11|e[25]>>>21,Y=e[34]<<15|e[35]>>>17,X=e[35]<<15|e[34]>>>17,M=e[45]<<29|e[44]>>>3,N=e[44]<<29|e[45]>>>3,_=e[6]<<28|e[7]>>>4,A=e[7]<<28|e[6]>>>4,ne=e[17]<<23|e[16]>>>9,ie=e[16]<<23|e[17]>>>9,F=e[26]<<25|e[27]>>>7,z=e[27]<<25|e[26]>>>7,k=e[36]<<21|e[37]>>>11,E=e[37]<<21|e[36]>>>11,$=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,V=e[8]<<27|e[9]>>>5,H=e[9]<<27|e[8]>>>5,I=e[18]<<20|e[19]>>>12,C=e[19]<<20|e[18]>>>12,oe=e[29]<<7|e[28]>>>25,ae=e[28]<<7|e[29]>>>25,Z=e[38]<<8|e[39]>>>24,j=e[39]<<8|e[38]>>>24,x=e[48]<<14|e[49]>>>18,S=e[49]<<14|e[48]>>>18,e[0]=v^~y&b,e[1]=g^~m&w,e[10]=_^~I&T,e[11]=A^~C&P,e[20]=O^~L&F,e[21]=D^~U&z,e[30]=V^~G&Q,e[31]=H^~W&J,e[40]=te^~ne&oe,e[41]=re^~ie&ae,e[2]=y^~b&k,e[3]=m^~w&E,e[12]=I^~T&R,e[13]=C^~P&B,e[22]=L^~F&Z,e[23]=U^~z&j,e[32]=G^~Q&Y,e[33]=W^~J&X,e[42]=ne^~oe&se,e[43]=ie^~ae&ue,e[4]=b^~k&x,e[5]=w^~E&S,e[14]=T^~R&M,e[15]=P^~B&N,e[24]=F^~Z&q,e[25]=z^~j&K,e[34]=Q^~Y&$,e[35]=J^~X&ee,e[44]=oe^~se&ce,e[45]=ae^~ue&le,e[6]=k^~x&v,e[7]=E^~S&g,e[16]=R^~M&_,e[17]=B^~N&A,e[26]=Z^~q&O,e[27]=j^~K&D,e[36]=Y^~$&V,e[37]=X^~ee&H,e[46]=se^~ce&te,e[47]=ue^~le&re,e[8]=x^~v&y,e[9]=S^~g&m,e[18]=M^~_&I,e[19]=N^~A&C,e[28]=q^~O&L,e[29]=K^~D&U,e[38]=$^~V&G,e[39]=ee^~H&W,e[48]=ce^~te&ne,e[49]=le^~re&ie,e[0]^=p[n],e[1]^=p[n+1]};if(u)e.exports=A;else{for(C=0;C<I.length;++C)a[I[C]]=A[I[C]];c&&(void 0===(n=function(){return A}.call(t,r,t,e))||(e.exports=n))}}()},6082:function(e){function t(e,t){if(!e)throw new Error(t||"Assertion failed")}e.exports=t,t.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)}},3962:function(e){var t=1e3,r=60*t,n=60*r,i=24*n,o=7*i,a=365.25*i;function s(e,t,r,n){var i=t>=1.5*r;return Math.round(e/r)+" "+n+(i?"s":"")}e.exports=function(e,u){u=u||{};var c=typeof e;if("string"===c&&e.length>0)return function(e){if((e=String(e)).length>100)return;var s=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(!s)return;var u=parseFloat(s[1]);switch((s[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return u*a;case"weeks":case"week":case"w":return u*o;case"days":case"day":case"d":return u*i;case"hours":case"hour":case"hrs":case"hr":case"h":return u*n;case"minutes":case"minute":case"mins":case"min":case"m":return u*r;case"seconds":case"second":case"secs":case"sec":case"s":return u*t;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return u;default:return}}(e);if("number"===c&&isFinite(e))return u.long?function(e){var o=Math.abs(e);if(o>=i)return s(e,o,i,"day");if(o>=n)return s(e,o,n,"hour");if(o>=r)return s(e,o,r,"minute");if(o>=t)return s(e,o,t,"second");return e+" ms"}(e):function(e){var o=Math.abs(e);if(o>=i)return Math.round(e/i)+"d";if(o>=n)return Math.round(e/n)+"h";if(o>=r)return Math.round(e/r)+"m";if(o>=t)return Math.round(e/t)+"s";return e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))}},9521:function(e,t,r){var n=r(3299);function i(e,t){n.cipher.registerAlgorithm(e,(function(){return new n.aes.Algorithm(e,t)}))}r(6894),r(2156),r(9327),e.exports=n.aes=n.aes||{},n.aes.startEncrypting=function(e,t,r,n){var i=p({key:e,output:r,decrypt:!1,mode:n});return i.start(t),i},n.aes.createEncryptionCipher=function(e,t){return p({key:e,output:null,decrypt:!1,mode:t})},n.aes.startDecrypting=function(e,t,r,n){var i=p({key:e,output:r,decrypt:!0,mode:n});return i.start(t),i},n.aes.createDecryptionCipher=function(e,t){return p({key:e,output:null,decrypt:!0,mode:t})},n.aes.Algorithm=function(e,t){l||f();var r=this;r.name=e,r.mode=new t({blockSize:16,cipher:{encrypt:function(e,t){return d(r._w,e,t,!1)},decrypt:function(e,t){return d(r._w,e,t,!0)}}}),r._init=!1},n.aes.Algorithm.prototype.initialize=function(e){if(!this._init){var t,r=e.key;if("string"!==typeof r||16!==r.length&&24!==r.length&&32!==r.length){if(n.util.isArray(r)&&(16===r.length||24===r.length||32===r.length)){t=r,r=n.util.createBuffer();for(var i=0;i<t.length;++i)r.putByte(t[i])}}else r=n.util.createBuffer(r);if(!n.util.isArray(r)){t=r,r=[];var o=t.length();if(16===o||24===o||32===o){o>>>=2;for(i=0;i<o;++i)r.push(t.getInt32())}}if(!n.util.isArray(r)||4!==r.length&&6!==r.length&&8!==r.length)throw new Error("Invalid key parameter.");var a=this.mode.name,s=-1!==["CFB","OFB","CTR","GCM"].indexOf(a);this._w=h(r,e.decrypt&&!s),this._init=!0}},n.aes._expandKey=function(e,t){return l||f(),h(e,t)},n.aes._updateBlock=d,i("AES-ECB",n.cipher.modes.ecb),i("AES-CBC",n.cipher.modes.cbc),i("AES-CFB",n.cipher.modes.cfb),i("AES-OFB",n.cipher.modes.ofb),i("AES-CTR",n.cipher.modes.ctr),i("AES-GCM",n.cipher.modes.gcm);var o,a,s,u,c,l=!1;function f(){l=!0,s=[0,1,2,4,8,16,32,64,128,27,54];for(var e=new Array(256),t=0;t<128;++t)e[t]=t<<1,e[t+128]=t+128<<1^283;o=new Array(256),a=new Array(256),u=new Array(4),c=new Array(4);for(t=0;t<4;++t)u[t]=new Array(256),c[t]=new Array(256);var r,n,i,f,h,d,p,v=0,g=0;for(t=0;t<256;++t){f=(f=g^g<<1^g<<2^g<<3^g<<4)>>8^255&f^99,o[v]=f,a[f]=v,d=(h=e[f])<<24^f<<16^f<<8^f^h,p=((r=e[v])^(n=e[r])^(i=e[n]))<<24^(v^i)<<16^(v^n^i)<<8^v^r^i;for(var y=0;y<4;++y)u[y][v]=d,c[y][f]=p,d=d<<24|d>>>8,p=p<<24|p>>>8;0===v?v=g=1:(v=r^e[e[e[r^i]]],g^=e[e[g]])}}function h(e,t){for(var r,n=e.slice(0),i=1,a=n.length,u=4*(a+6+1),l=a;l<u;++l)r=n[l-1],l%a===0?(r=o[r>>>16&255]<<24^o[r>>>8&255]<<16^o[255&r]<<8^o[r>>>24]^s[i]<<24,i++):a>6&&l%a===4&&(r=o[r>>>24]<<24^o[r>>>16&255]<<16^o[r>>>8&255]<<8^o[255&r]),n[l]=n[l-a]^r;if(t){for(var f,h=c[0],d=c[1],p=c[2],v=c[3],g=n.slice(0),y=(l=0,(u=n.length)-4);l<u;l+=4,y-=4)if(0===l||l===u-4)g[l]=n[y],g[l+1]=n[y+3],g[l+2]=n[y+2],g[l+3]=n[y+1];else for(var m=0;m<4;++m)f=n[y+m],g[l+(3&-m)]=h[o[f>>>24]]^d[o[f>>>16&255]]^p[o[f>>>8&255]]^v[o[255&f]];n=g}return n}function d(e,t,r,n){var i,s,l,f,h,d,p,v,g,y,m,b,w=e.length/4-1;n?(i=c[0],s=c[1],l=c[2],f=c[3],h=a):(i=u[0],s=u[1],l=u[2],f=u[3],h=o),d=t[0]^e[0],p=t[n?3:1]^e[1],v=t[2]^e[2],g=t[n?1:3]^e[3];for(var k=3,E=1;E<w;++E)y=i[d>>>24]^s[p>>>16&255]^l[v>>>8&255]^f[255&g]^e[++k],m=i[p>>>24]^s[v>>>16&255]^l[g>>>8&255]^f[255&d]^e[++k],b=i[v>>>24]^s[g>>>16&255]^l[d>>>8&255]^f[255&p]^e[++k],g=i[g>>>24]^s[d>>>16&255]^l[p>>>8&255]^f[255&v]^e[++k],d=y,p=m,v=b;r[0]=h[d>>>24]<<24^h[p>>>16&255]<<16^h[v>>>8&255]<<8^h[255&g]^e[++k],r[n?3:1]=h[p>>>24]<<24^h[v>>>16&255]<<16^h[g>>>8&255]<<8^h[255&d]^e[++k],r[2]=h[v>>>24]<<24^h[g>>>16&255]<<16^h[d>>>8&255]<<8^h[255&p]^e[++k],r[n?1:3]=h[g>>>24]<<24^h[d>>>16&255]<<16^h[p>>>8&255]<<8^h[255&v]^e[++k]}function p(e){var t,r="AES-"+((e=e||{}).mode||"CBC").toUpperCase(),i=(t=e.decrypt?n.cipher.createDecipher(r,e.key):n.cipher.createCipher(r,e.key)).start;return t.start=function(e,r){var o=null;r instanceof n.util.ByteBuffer&&(o=r,r={}),(r=r||{}).output=o,r.iv=e,i.call(t,r)},t}},5406:function(e,t,r){var n=r(3299);r(9327),r(2458);var i=e.exports=n.asn1=n.asn1||{};function o(e,t,r){if(r>t){var n=new Error("Too few bytes to parse DER.");throw n.available=e.length(),n.remaining=t,n.requested=r,n}}i.Class={UNIVERSAL:0,APPLICATION:64,CONTEXT_SPECIFIC:128,PRIVATE:192},i.Type={NONE:0,BOOLEAN:1,INTEGER:2,BITSTRING:3,OCTETSTRING:4,NULL:5,OID:6,ODESC:7,EXTERNAL:8,REAL:9,ENUMERATED:10,EMBEDDED:11,UTF8:12,ROID:13,SEQUENCE:16,SET:17,PRINTABLESTRING:19,IA5STRING:22,UTCTIME:23,GENERALIZEDTIME:24,BMPSTRING:30},i.create=function(e,t,r,o,a){if(n.util.isArray(o)){for(var s=[],u=0;u<o.length;++u)void 0!==o[u]&&s.push(o[u]);o=s}var c={tagClass:e,type:t,constructed:r,composed:r||n.util.isArray(o),value:o};return a&&"bitStringContents"in a&&(c.bitStringContents=a.bitStringContents,c.original=i.copy(c)),c},i.copy=function(e,t){var r;if(n.util.isArray(e)){r=[];for(var o=0;o<e.length;++o)r.push(i.copy(e[o],t));return r}return"string"===typeof e?e:(r={tagClass:e.tagClass,type:e.type,constructed:e.constructed,composed:e.composed,value:i.copy(e.value,t)},t&&!t.excludeBitStringContents&&(r.bitStringContents=e.bitStringContents),r)},i.equals=function(e,t,r){if(n.util.isArray(e)){if(!n.util.isArray(t))return!1;if(e.length!==t.length)return!1;for(var o=0;o<e.length;++o)if(!i.equals(e[o],t[o]))return!1;return!0}if(typeof e!==typeof t)return!1;if("string"===typeof e)return e===t;var a=e.tagClass===t.tagClass&&e.type===t.type&&e.constructed===t.constructed&&e.composed===t.composed&&i.equals(e.value,t.value);return r&&r.includeBitStringContents&&(a=a&&e.bitStringContents===t.bitStringContents),a},i.getBerValueLength=function(e){var t=e.getByte();if(128!==t)return 128&t?e.getInt((127&t)<<3):t};function a(e,t,r,n){var s;o(e,t,2);var u=e.getByte();t--;var c=192&u,l=31&u;s=e.length();var f,h,d=function(e,t){var r=e.getByte();if(t--,128!==r){var n;if(128&r){var i=127&r;o(e,t,i),n=e.getInt(i<<3)}else n=r;if(n<0)throw new Error("Negative length: "+n);return n}}(e,t);if(t-=s-e.length(),void 0!==d&&d>t){if(n.strict){var p=new Error("Too few bytes to read ASN.1 value.");throw p.available=e.length(),p.remaining=t,p.requested=d,p}d=t}var v=32===(32&u);if(v)if(f=[],void 0===d)for(;;){if(o(e,t,2),e.bytes(2)===String.fromCharCode(0,0)){e.getBytes(2),t-=2;break}s=e.length(),f.push(a(e,t,r+1,n)),t-=s-e.length()}else for(;d>0;)s=e.length(),f.push(a(e,d,r+1,n)),t-=s-e.length(),d-=s-e.length();if(void 0===f&&c===i.Class.UNIVERSAL&&l===i.Type.BITSTRING&&(h=e.bytes(d)),void 0===f&&n.decodeBitStrings&&c===i.Class.UNIVERSAL&&l===i.Type.BITSTRING&&d>1){var g=e.read,y=t,m=0;if(l===i.Type.BITSTRING&&(o(e,t,1),m=e.getByte(),t--),0===m)try{s=e.length();var b=a(e,t,r+1,{strict:!0,decodeBitStrings:!0}),w=s-e.length();t-=w,l==i.Type.BITSTRING&&w++;var k=b.tagClass;w!==d||k!==i.Class.UNIVERSAL&&k!==i.Class.CONTEXT_SPECIFIC||(f=[b])}catch(x){}void 0===f&&(e.read=g,t=y)}if(void 0===f){if(void 0===d){if(n.strict)throw new Error("Non-constructed ASN.1 object of indefinite length.");d=t}if(l===i.Type.BMPSTRING)for(f="";d>0;d-=2)o(e,t,2),f+=String.fromCharCode(e.getInt16()),t-=2;else f=e.getBytes(d),t-=d}var E=void 0===h?null:{bitStringContents:h};return i.create(c,l,v,f,E)}i.fromDer=function(e,t){void 0===t&&(t={strict:!0,parseAllBytes:!0,decodeBitStrings:!0}),"boolean"===typeof t&&(t={strict:t,parseAllBytes:!0,decodeBitStrings:!0}),"strict"in t||(t.strict=!0),"parseAllBytes"in t||(t.parseAllBytes=!0),"decodeBitStrings"in t||(t.decodeBitStrings=!0),"string"===typeof e&&(e=n.util.createBuffer(e));var r=e.length(),i=a(e,e.length(),0,t);if(t.parseAllBytes&&0!==e.length()){var o=new Error("Unparsed DER bytes remain after ASN.1 parsing.");throw o.byteCount=r,o.remaining=e.length(),o}return i},i.toDer=function(e){var t=n.util.createBuffer(),r=e.tagClass|e.type,o=n.util.createBuffer(),a=!1;if("bitStringContents"in e&&(a=!0,e.original&&(a=i.equals(e,e.original))),a)o.putBytes(e.bitStringContents);else if(e.composed){e.constructed?r|=32:o.putByte(0);for(var s=0;s<e.value.length;++s)void 0!==e.value[s]&&o.putBuffer(i.toDer(e.value[s]))}else if(e.type===i.Type.BMPSTRING)for(s=0;s<e.value.length;++s)o.putInt16(e.value.charCodeAt(s));else e.type===i.Type.INTEGER&&e.value.length>1&&(0===e.value.charCodeAt(0)&&0===(128&e.value.charCodeAt(1))||255===e.value.charCodeAt(0)&&128===(128&e.value.charCodeAt(1)))?o.putBytes(e.value.substr(1)):o.putBytes(e.value);if(t.putByte(r),o.length()<=127)t.putByte(127&o.length());else{var u=o.length(),c="";do{c+=String.fromCharCode(255&u),u>>>=8}while(u>0);t.putByte(128|c.length);for(s=c.length-1;s>=0;--s)t.putByte(c.charCodeAt(s))}return t.putBuffer(o),t},i.oidToDer=function(e){var t,r,i,o,a=e.split("."),s=n.util.createBuffer();s.putByte(40*parseInt(a[0],10)+parseInt(a[1],10));for(var u=2;u<a.length;++u){t=!0,r=[],i=parseInt(a[u],10);do{o=127&i,i>>>=7,t||(o|=128),r.push(o),t=!1}while(i>0);for(var c=r.length-1;c>=0;--c)s.putByte(r[c])}return s},i.derToOid=function(e){var t;"string"===typeof e&&(e=n.util.createBuffer(e));var r=e.getByte();t=Math.floor(r/40)+"."+r%40;for(var i=0;e.length()>0;)i<<=7,128&(r=e.getByte())?i+=127&r:(t+="."+(i+r),i=0);return t},i.utcTimeToDate=function(e){var t=new Date,r=parseInt(e.substr(0,2),10);r=r>=50?1900+r:2e3+r;var n=parseInt(e.substr(2,2),10)-1,i=parseInt(e.substr(4,2),10),o=parseInt(e.substr(6,2),10),a=parseInt(e.substr(8,2),10),s=0;if(e.length>11){var u=e.charAt(10),c=10;"+"!==u&&"-"!==u&&(s=parseInt(e.substr(10,2),10),c+=2)}if(t.setUTCFullYear(r,n,i),t.setUTCHours(o,a,s,0),c&&("+"===(u=e.charAt(c))||"-"===u)){var l=60*parseInt(e.substr(c+1,2),10)+parseInt(e.substr(c+4,2),10);l*=6e4,"+"===u?t.setTime(+t-l):t.setTime(+t+l)}return t},i.generalizedTimeToDate=function(e){var t=new Date,r=parseInt(e.substr(0,4),10),n=parseInt(e.substr(4,2),10)-1,i=parseInt(e.substr(6,2),10),o=parseInt(e.substr(8,2),10),a=parseInt(e.substr(10,2),10),s=parseInt(e.substr(12,2),10),u=0,c=0,l=!1;"Z"===e.charAt(e.length-1)&&(l=!0);var f=e.length-5,h=e.charAt(f);"+"!==h&&"-"!==h||(c=60*parseInt(e.substr(f+1,2),10)+parseInt(e.substr(f+4,2),10),c*=6e4,"+"===h&&(c*=-1),l=!0);return"."===e.charAt(14)&&(u=1e3*parseFloat(e.substr(14),10)),l?(t.setUTCFullYear(r,n,i),t.setUTCHours(o,a,s,u),t.setTime(+t+c)):(t.setFullYear(r,n,i),t.setHours(o,a,s,u)),t},i.dateToUtcTime=function(e){if("string"===typeof e)return e;var t="",r=[];r.push((""+e.getUTCFullYear()).substr(2)),r.push(""+(e.getUTCMonth()+1)),r.push(""+e.getUTCDate()),r.push(""+e.getUTCHours()),r.push(""+e.getUTCMinutes()),r.push(""+e.getUTCSeconds());for(var n=0;n<r.length;++n)r[n].length<2&&(t+="0"),t+=r[n];return t+="Z"},i.dateToGeneralizedTime=function(e){if("string"===typeof e)return e;var t="",r=[];r.push(""+e.getUTCFullYear()),r.push(""+(e.getUTCMonth()+1)),r.push(""+e.getUTCDate()),r.push(""+e.getUTCHours()),r.push(""+e.getUTCMinutes()),r.push(""+e.getUTCSeconds());for(var n=0;n<r.length;++n)r[n].length<2&&(t+="0"),t+=r[n];return t+="Z"},i.integerToDer=function(e){var t=n.util.createBuffer();if(e>=-128&&e<128)return t.putSignedInt(e,8);if(e>=-32768&&e<32768)return t.putSignedInt(e,16);if(e>=-8388608&&e<8388608)return t.putSignedInt(e,24);if(e>=-2147483648&&e<2147483648)return t.putSignedInt(e,32);var r=new Error("Integer too large; max is 32-bits.");throw r.integer=e,r},i.derToInteger=function(e){"string"===typeof e&&(e=n.util.createBuffer(e));var t=8*e.length();if(t>32)throw new Error("Integer too large; max is 32-bits.");return e.getSignedInt(t)},i.validate=function(e,t,r,o){var a=!1;if(e.tagClass!==t.tagClass&&"undefined"!==typeof t.tagClass||e.type!==t.type&&"undefined"!==typeof t.type)o&&(e.tagClass!==t.tagClass&&o.push("["+t.name+'] Expected tag class "'+t.tagClass+'", got "'+e.tagClass+'"'),e.type!==t.type&&o.push("["+t.name+'] Expected type "'+t.type+'", got "'+e.type+'"'));else if(e.constructed===t.constructed||"undefined"===typeof t.constructed){if(a=!0,t.value&&n.util.isArray(t.value))for(var s=0,u=0;a&&u<t.value.length;++u)a=t.value[u].optional||!1,e.value[s]&&((a=i.validate(e.value[s],t.value[u],r,o))?++s:t.value[u].optional&&(a=!0)),!a&&o&&o.push("["+t.name+'] Tag class "'+t.tagClass+'", type "'+t.type+'" expected value length "'+t.value.length+'", got "'+e.value.length+'"');if(a&&r)if(t.capture&&(r[t.capture]=e.value),t.captureAsn1&&(r[t.captureAsn1]=e),t.captureBitStringContents&&"bitStringContents"in e&&(r[t.captureBitStringContents]=e.bitStringContents),t.captureBitStringValue&&"bitStringContents"in e)if(e.bitStringContents.length<2)r[t.captureBitStringValue]="";else{if(0!==e.bitStringContents.charCodeAt(0))throw new Error("captureBitStringValue only supported for zero unused bits");r[t.captureBitStringValue]=e.bitStringContents.slice(1)}}else o&&o.push("["+t.name+'] Expected constructed "'+t.constructed+'", got "'+e.constructed+'"');return a};var s=/[^\\u0000-\\u00ff]/;i.prettyPrint=function(e,t,r){var o="";r=r||2,(t=t||0)>0&&(o+="\n");for(var a="",u=0;u<t*r;++u)a+=" ";switch(o+=a+"Tag: ",e.tagClass){case i.Class.UNIVERSAL:o+="Universal:";break;case i.Class.APPLICATION:o+="Application:";break;case i.Class.CONTEXT_SPECIFIC:o+="Context-Specific:";break;case i.Class.PRIVATE:o+="Private:"}if(e.tagClass===i.Class.UNIVERSAL)switch(o+=e.type,e.type){case i.Type.NONE:o+=" (None)";break;case i.Type.BOOLEAN:o+=" (Boolean)";break;case i.Type.INTEGER:o+=" (Integer)";break;case i.Type.BITSTRING:o+=" (Bit string)";break;case i.Type.OCTETSTRING:o+=" (Octet string)";break;case i.Type.NULL:o+=" (Null)";break;case i.Type.OID:o+=" (Object Identifier)";break;case i.Type.ODESC:o+=" (Object Descriptor)";break;case i.Type.EXTERNAL:o+=" (External or Instance of)";break;case i.Type.REAL:o+=" (Real)";break;case i.Type.ENUMERATED:o+=" (Enumerated)";break;case i.Type.EMBEDDED:o+=" (Embedded PDV)";break;case i.Type.UTF8:o+=" (UTF8)";break;case i.Type.ROID:o+=" (Relative Object Identifier)";break;case i.Type.SEQUENCE:o+=" (Sequence)";break;case i.Type.SET:o+=" (Set)";break;case i.Type.PRINTABLESTRING:o+=" (Printable String)";break;case i.Type.IA5String:o+=" (IA5String (ASCII))";break;case i.Type.UTCTIME:o+=" (UTC time)";break;case i.Type.GENERALIZEDTIME:o+=" (Generalized time)";break;case i.Type.BMPSTRING:o+=" (BMP String)"}else o+=e.type;if(o+="\n",o+=a+"Constructed: "+e.constructed+"\n",e.composed){var c=0,l="";for(u=0;u<e.value.length;++u)void 0!==e.value[u]&&(c+=1,l+=i.prettyPrint(e.value[u],t+1,r),u+1<e.value.length&&(l+=","));o+=a+"Sub values: "+c+l}else{if(o+=a+"Value: ",e.type===i.Type.OID){var f=i.derToOid(e.value);o+=f,n.pki&&n.pki.oids&&f in n.pki.oids&&(o+=" ("+n.pki.oids[f]+") ")}if(e.type===i.Type.INTEGER)try{o+=i.derToInteger(e.value)}catch(d){o+="0x"+n.util.bytesToHex(e.value)}else if(e.type===i.Type.BITSTRING){if(e.value.length>1?o+="0x"+n.util.bytesToHex(e.value.slice(1)):o+="(none)",e.value.length>0){var h=e.value.charCodeAt(0);1==h?o+=" (1 unused bit shown)":h>1&&(o+=" ("+h+" unused bits shown)")}}else if(e.type===i.Type.OCTETSTRING)s.test(e.value)||(o+="("+e.value+") "),o+="0x"+n.util.bytesToHex(e.value);else if(e.type===i.Type.UTF8)try{o+=n.util.decodeUtf8(e.value)}catch(p){if("URI malformed"!==p.message)throw p;o+="0x"+n.util.bytesToHex(e.value)+" (malformed UTF8)"}else e.type===i.Type.PRINTABLESTRING||e.type===i.Type.IA5String?o+=e.value:s.test(e.value)?o+="0x"+n.util.bytesToHex(e.value):0===e.value.length?o+="[null]":o+=e.value}return o}},8270:function(e){var t={};e.exports=t;var r={};t.encode=function(e,t,r){if("string"!==typeof t)throw new TypeError('"alphabet" must be a string.');if(void 0!==r&&"number"!==typeof r)throw new TypeError('"maxline" must be a number.');var n="";if(e instanceof Uint8Array){var i=0,o=t.length,a=t.charAt(0),s=[0];for(i=0;i<e.length;++i){for(var u=0,c=e[i];u<s.length;++u)c+=s[u]<<8,s[u]=c%o,c=c/o|0;for(;c>0;)s.push(c%o),c=c/o|0}for(i=0;0===e[i]&&i<e.length-1;++i)n+=a;for(i=s.length-1;i>=0;--i)n+=t[s[i]]}else n=function(e,t){var r=0,n=t.length,i=t.charAt(0),o=[0];for(r=0;r<e.length();++r){for(var a=0,s=e.at(r);a<o.length;++a)s+=o[a]<<8,o[a]=s%n,s=s/n|0;for(;s>0;)o.push(s%n),s=s/n|0}var u="";for(r=0;0===e.at(r)&&r<e.length()-1;++r)u+=i;for(r=o.length-1;r>=0;--r)u+=t[o[r]];return u}(e,t);if(r){var l=new RegExp(".{1,"+r+"}","g");n=n.match(l).join("\r\n")}return n},t.decode=function(e,t){if("string"!==typeof e)throw new TypeError('"input" must be a string.');if("string"!==typeof t)throw new TypeError('"alphabet" must be a string.');var n=r[t];if(!n){n=r[t]=[];for(var i=0;i<t.length;++i)n[t.charCodeAt(i)]=i}e=e.replace(/\s/g,"");var o=t.length,a=t.charAt(0),s=[0];for(i=0;i<e.length;i++){var u=n[e.charCodeAt(i)];if(void 0===u)return;for(var c=0,l=u;c<s.length;++c)l+=s[c]*o,s[c]=255&l,l>>=8;for(;l>0;)s.push(255&l),l>>=8}for(var f=0;e[f]===a&&f<e.length-1;++f)s.push(0);return"undefined"!==typeof Buffer?Buffer.from(s.reverse()):new Uint8Array(s.reverse())}},6894:function(e,t,r){var n=r(3299);r(9327),e.exports=n.cipher=n.cipher||{},n.cipher.algorithms=n.cipher.algorithms||{},n.cipher.createCipher=function(e,t){var r=e;if("string"===typeof r&&(r=n.cipher.getAlgorithm(r))&&(r=r()),!r)throw new Error("Unsupported algorithm: "+e);return new n.cipher.BlockCipher({algorithm:r,key:t,decrypt:!1})},n.cipher.createDecipher=function(e,t){var r=e;if("string"===typeof r&&(r=n.cipher.getAlgorithm(r))&&(r=r()),!r)throw new Error("Unsupported algorithm: "+e);return new n.cipher.BlockCipher({algorithm:r,key:t,decrypt:!0})},n.cipher.registerAlgorithm=function(e,t){e=e.toUpperCase(),n.cipher.algorithms[e]=t},n.cipher.getAlgorithm=function(e){return(e=e.toUpperCase())in n.cipher.algorithms?n.cipher.algorithms[e]:null};var i=n.cipher.BlockCipher=function(e){this.algorithm=e.algorithm,this.mode=this.algorithm.mode,this.blockSize=this.mode.blockSize,this._finish=!1,this._input=null,this.output=null,this._op=e.decrypt?this.mode.decrypt:this.mode.encrypt,this._decrypt=e.decrypt,this.algorithm.initialize(e)};i.prototype.start=function(e){e=e||{};var t={};for(var r in e)t[r]=e[r];t.decrypt=this._decrypt,this._finish=!1,this._input=n.util.createBuffer(),this.output=e.output||n.util.createBuffer(),this.mode.start(t)},i.prototype.update=function(e){for(e&&this._input.putBuffer(e);!this._op.call(this.mode,this._input,this.output,this._finish)&&!this._finish;);this._input.compact()},i.prototype.finish=function(e){!e||"ECB"!==this.mode.name&&"CBC"!==this.mode.name||(this.mode.pad=function(t){return e(this.blockSize,t,!1)},this.mode.unpad=function(t){return e(this.blockSize,t,!0)});var t={};return t.decrypt=this._decrypt,t.overflow=this._input.length()%this.blockSize,!(!this._decrypt&&this.mode.pad&&!this.mode.pad(this._input,t))&&(this._finish=!0,this.update(),!(this._decrypt&&this.mode.unpad&&!this.mode.unpad(this.output,t))&&!(this.mode.afterFinish&&!this.mode.afterFinish(this.output,t)))}},2156:function(e,t,r){var n=r(3299);r(9327),n.cipher=n.cipher||{};var i=e.exports=n.cipher.modes=n.cipher.modes||{};function o(e,t){if("string"===typeof e&&(e=n.util.createBuffer(e)),n.util.isArray(e)&&e.length>4){var r=e;e=n.util.createBuffer();for(var i=0;i<r.length;++i)e.putByte(r[i])}if(e.length()<t)throw new Error("Invalid IV length; got "+e.length()+" bytes and expected "+t+" bytes.");if(!n.util.isArray(e)){var o=[],a=t/4;for(i=0;i<a;++i)o.push(e.getInt32());e=o}return e}function a(e){e[e.length-1]=e[e.length-1]+1&4294967295}function s(e){return[e/4294967296|0,4294967295&e]}i.ecb=function(e){e=e||{},this.name="ECB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)},i.ecb.prototype.start=function(e){},i.ecb.prototype.encrypt=function(e,t,r){if(e.length()<this.blockSize&&!(r&&e.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=e.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(n=0;n<this._ints;++n)t.putInt32(this._outBlock[n])},i.ecb.prototype.decrypt=function(e,t,r){if(e.length()<this.blockSize&&!(r&&e.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=e.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(n=0;n<this._ints;++n)t.putInt32(this._outBlock[n])},i.ecb.prototype.pad=function(e,t){var r=e.length()===this.blockSize?this.blockSize:this.blockSize-e.length();return e.fillWithByte(r,r),!0},i.ecb.prototype.unpad=function(e,t){if(t.overflow>0)return!1;var r=e.length(),n=e.at(r-1);return!(n>this.blockSize<<2)&&(e.truncate(n),!0)},i.cbc=function(e){e=e||{},this.name="CBC",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints)},i.cbc.prototype.start=function(e){if(null===e.iv){if(!this._prev)throw new Error("Invalid IV parameter.");this._iv=this._prev.slice(0)}else{if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=o(e.iv,this.blockSize),this._prev=this._iv.slice(0)}},i.cbc.prototype.encrypt=function(e,t,r){if(e.length()<this.blockSize&&!(r&&e.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=this._prev[n]^e.getInt32();this.cipher.encrypt(this._inBlock,this._outBlock);for(n=0;n<this._ints;++n)t.putInt32(this._outBlock[n]);this._prev=this._outBlock},i.cbc.prototype.decrypt=function(e,t,r){if(e.length()<this.blockSize&&!(r&&e.length()>0))return!0;for(var n=0;n<this._ints;++n)this._inBlock[n]=e.getInt32();this.cipher.decrypt(this._inBlock,this._outBlock);for(n=0;n<this._ints;++n)t.putInt32(this._prev[n]^this._outBlock[n]);this._prev=this._inBlock.slice(0)},i.cbc.prototype.pad=function(e,t){var r=e.length()===this.blockSize?this.blockSize:this.blockSize-e.length();return e.fillWithByte(r,r),!0},i.cbc.prototype.unpad=function(e,t){if(t.overflow>0)return!1;var r=e.length(),n=e.at(r-1);return!(n>this.blockSize<<2)&&(e.truncate(n),!0)},i.cfb=function(e){e=e||{},this.name="CFB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialBlock=new Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0},i.cfb.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=o(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},i.cfb.prototype.encrypt=function(e,t,r){var n=e.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i<this._ints;++i)this._inBlock[i]=e.getInt32()^this._outBlock[i],t.putInt32(this._inBlock[i]);else{var o=(this.blockSize-n)%this.blockSize;o>0&&(o=this.blockSize-o),this._partialOutput.clear();for(i=0;i<this._ints;++i)this._partialBlock[i]=e.getInt32()^this._outBlock[i],this._partialOutput.putInt32(this._partialBlock[i]);if(o>0)e.read-=this.blockSize;else for(i=0;i<this._ints;++i)this._inBlock[i]=this._partialBlock[i];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),o>0&&!r)return t.putBytes(this._partialOutput.getBytes(o-this._partialBytes)),this._partialBytes=o,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}},i.cfb.prototype.decrypt=function(e,t,r){var n=e.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i<this._ints;++i)this._inBlock[i]=e.getInt32(),t.putInt32(this._inBlock[i]^this._outBlock[i]);else{var o=(this.blockSize-n)%this.blockSize;o>0&&(o=this.blockSize-o),this._partialOutput.clear();for(i=0;i<this._ints;++i)this._partialBlock[i]=e.getInt32(),this._partialOutput.putInt32(this._partialBlock[i]^this._outBlock[i]);if(o>0)e.read-=this.blockSize;else for(i=0;i<this._ints;++i)this._inBlock[i]=this._partialBlock[i];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),o>0&&!r)return t.putBytes(this._partialOutput.getBytes(o-this._partialBytes)),this._partialBytes=o,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}},i.ofb=function(e){e=e||{},this.name="OFB",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0},i.ofb.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=o(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},i.ofb.prototype.encrypt=function(e,t,r){var n=e.length();if(0===e.length())return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i<this._ints;++i)t.putInt32(e.getInt32()^this._outBlock[i]),this._inBlock[i]=this._outBlock[i];else{var o=(this.blockSize-n)%this.blockSize;o>0&&(o=this.blockSize-o),this._partialOutput.clear();for(i=0;i<this._ints;++i)this._partialOutput.putInt32(e.getInt32()^this._outBlock[i]);if(o>0)e.read-=this.blockSize;else for(i=0;i<this._ints;++i)this._inBlock[i]=this._outBlock[i];if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),o>0&&!r)return t.putBytes(this._partialOutput.getBytes(o-this._partialBytes)),this._partialBytes=o,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}},i.ofb.prototype.decrypt=i.ofb.prototype.encrypt,i.ctr=function(e){e=e||{},this.name="CTR",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=null,this._outBlock=new Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0},i.ctr.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");this._iv=o(e.iv,this.blockSize),this._inBlock=this._iv.slice(0),this._partialBytes=0},i.ctr.prototype.encrypt=function(e,t,r){var n=e.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize)for(var i=0;i<this._ints;++i)t.putInt32(e.getInt32()^this._outBlock[i]);else{var o=(this.blockSize-n)%this.blockSize;o>0&&(o=this.blockSize-o),this._partialOutput.clear();for(i=0;i<this._ints;++i)this._partialOutput.putInt32(e.getInt32()^this._outBlock[i]);if(o>0&&(e.read-=this.blockSize),this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),o>0&&!r)return t.putBytes(this._partialOutput.getBytes(o-this._partialBytes)),this._partialBytes=o,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}a(this._inBlock)},i.ctr.prototype.decrypt=i.ctr.prototype.encrypt,i.gcm=function(e){e=e||{},this.name="GCM",this.cipher=e.cipher,this.blockSize=e.blockSize||16,this._ints=this.blockSize/4,this._inBlock=new Array(this._ints),this._outBlock=new Array(this._ints),this._partialOutput=n.util.createBuffer(),this._partialBytes=0,this._R=3774873600},i.gcm.prototype.start=function(e){if(!("iv"in e))throw new Error("Invalid IV parameter.");var t,r=n.util.createBuffer(e.iv);if(this._cipherLength=0,t="additionalData"in e?n.util.createBuffer(e.additionalData):n.util.createBuffer(),this._tagLength="tagLength"in e?e.tagLength:128,this._tag=null,e.decrypt&&(this._tag=n.util.createBuffer(e.tag).getBytes(),this._tag.length!==this._tagLength/8))throw new Error("Authentication tag does not match tag length.");this._hashBlock=new Array(this._ints),this.tag=null,this._hashSubkey=new Array(this._ints),this.cipher.encrypt([0,0,0,0],this._hashSubkey),this.componentBits=4,this._m=this.generateHashTable(this._hashSubkey,this.componentBits);var i=r.length();if(12===i)this._j0=[r.getInt32(),r.getInt32(),r.getInt32(),1];else{for(this._j0=[0,0,0,0];r.length()>0;)this._j0=this.ghash(this._hashSubkey,this._j0,[r.getInt32(),r.getInt32(),r.getInt32(),r.getInt32()]);this._j0=this.ghash(this._hashSubkey,this._j0,[0,0].concat(s(8*i)))}this._inBlock=this._j0.slice(0),a(this._inBlock),this._partialBytes=0,t=n.util.createBuffer(t),this._aDataLength=s(8*t.length());var o=t.length()%this.blockSize;for(o&&t.fillWithByte(0,this.blockSize-o),this._s=[0,0,0,0];t.length()>0;)this._s=this.ghash(this._hashSubkey,this._s,[t.getInt32(),t.getInt32(),t.getInt32(),t.getInt32()])},i.gcm.prototype.encrypt=function(e,t,r){var n=e.length();if(0===n)return!0;if(this.cipher.encrypt(this._inBlock,this._outBlock),0===this._partialBytes&&n>=this.blockSize){for(var i=0;i<this._ints;++i)t.putInt32(this._outBlock[i]^=e.getInt32());this._cipherLength+=this.blockSize}else{var o=(this.blockSize-n)%this.blockSize;o>0&&(o=this.blockSize-o),this._partialOutput.clear();for(i=0;i<this._ints;++i)this._partialOutput.putInt32(e.getInt32()^this._outBlock[i]);if(o<=0||r){if(r){var s=n%this.blockSize;this._cipherLength+=s,this._partialOutput.truncate(this.blockSize-s)}else this._cipherLength+=this.blockSize;for(i=0;i<this._ints;++i)this._outBlock[i]=this._partialOutput.getInt32();this._partialOutput.read-=this.blockSize}if(this._partialBytes>0&&this._partialOutput.getBytes(this._partialBytes),o>0&&!r)return e.read-=this.blockSize,t.putBytes(this._partialOutput.getBytes(o-this._partialBytes)),this._partialBytes=o,!0;t.putBytes(this._partialOutput.getBytes(n-this._partialBytes)),this._partialBytes=0}this._s=this.ghash(this._hashSubkey,this._s,this._outBlock),a(this._inBlock)},i.gcm.prototype.decrypt=function(e,t,r){var n=e.length();if(n<this.blockSize&&!(r&&n>0))return!0;this.cipher.encrypt(this._inBlock,this._outBlock),a(this._inBlock),this._hashBlock[0]=e.getInt32(),this._hashBlock[1]=e.getInt32(),this._hashBlock[2]=e.getInt32(),this._hashBlock[3]=e.getInt32(),this._s=this.ghash(this._hashSubkey,this._s,this._hashBlock);for(var i=0;i<this._ints;++i)t.putInt32(this._outBlock[i]^this._hashBlock[i]);n<this.blockSize?this._cipherLength+=n%this.blockSize:this._cipherLength+=this.blockSize},i.gcm.prototype.afterFinish=function(e,t){var r=!0;t.decrypt&&t.overflow&&e.truncate(this.blockSize-t.overflow),this.tag=n.util.createBuffer();var i=this._aDataLength.concat(s(8*this._cipherLength));this._s=this.ghash(this._hashSubkey,this._s,i);var o=[];this.cipher.encrypt(this._j0,o);for(var a=0;a<this._ints;++a)this.tag.putInt32(this._s[a]^o[a]);return this.tag.truncate(this.tag.length()%(this._tagLength/8)),t.decrypt&&this.tag.bytes()!==this._tag&&(r=!1),r},i.gcm.prototype.multiply=function(e,t){for(var r=[0,0,0,0],n=t.slice(0),i=0;i<128;++i){e[i/32|0]&1<<31-i%32&&(r[0]^=n[0],r[1]^=n[1],r[2]^=n[2],r[3]^=n[3]),this.pow(n,n)}return r},i.gcm.prototype.pow=function(e,t){for(var r=1&e[3],n=3;n>0;--n)t[n]=e[n]>>>1|(1&e[n-1])<<31;t[0]=e[0]>>>1,r&&(t[0]^=this._R)},i.gcm.prototype.tableMultiply=function(e){for(var t=[0,0,0,0],r=0;r<32;++r){var n=e[r/8|0]>>>4*(7-r%8)&15,i=this._m[r][n];t[0]^=i[0],t[1]^=i[1],t[2]^=i[2],t[3]^=i[3]}return t},i.gcm.prototype.ghash=function(e,t,r){return t[0]^=r[0],t[1]^=r[1],t[2]^=r[2],t[3]^=r[3],this.tableMultiply(t)},i.gcm.prototype.generateHashTable=function(e,t){for(var r=8/t,n=4*r,i=16*r,o=new Array(i),a=0;a<i;++a){var s=[0,0,0,0],u=(n-1-a%n)*t;s[a/n|0]=1<<t-1<<u,o[a]=this.generateSubHashTable(this.multiply(s,e),t)}return o},i.gcm.prototype.generateSubHashTable=function(e,t){var r=1<<t,n=r>>>1,i=new Array(r);i[n]=e.slice(0);for(var o=n>>>1;o>0;)this.pow(i[2*o],i[o]=[]),o>>=1;for(o=2;o<n;){for(var a=1;a<o;++a){var s=i[o],u=i[a];i[o+a]=[s[0]^u[0],s[1]^u[1],s[2]^u[2],s[3]^u[3]]}o*=2}for(i[0]=[0,0,0,0],o=n+1;o<r;++o){var c=i[o^n];i[o]=[e[0]^c[0],e[1]^c[1],e[2]^c[2],e[3]^c[3]]}return i}},1854:function(e,t,r){var n=r(3299);function i(e,t){n.cipher.registerAlgorithm(e,(function(){return new n.des.Algorithm(e,t)}))}r(6894),r(2156),r(9327),e.exports=n.des=n.des||{},n.des.startEncrypting=function(e,t,r,n){var i=p({key:e,output:r,decrypt:!1,mode:n||(null===t?"ECB":"CBC")});return i.start(t),i},n.des.createEncryptionCipher=function(e,t){return p({key:e,output:null,decrypt:!1,mode:t})},n.des.startDecrypting=function(e,t,r,n){var i=p({key:e,output:r,decrypt:!0,mode:n||(null===t?"ECB":"CBC")});return i.start(t),i},n.des.createDecryptionCipher=function(e,t){return p({key:e,output:null,decrypt:!0,mode:t})},n.des.Algorithm=function(e,t){var r=this;r.name=e,r.mode=new t({blockSize:8,cipher:{encrypt:function(e,t){return d(r._keys,e,t,!1)},decrypt:function(e,t){return d(r._keys,e,t,!0)}}}),r._init=!1},n.des.Algorithm.prototype.initialize=function(e){if(!this._init){var t=n.util.createBuffer(e.key);if(0===this.name.indexOf("3DES")&&24!==t.length())throw new Error("Invalid Triple-DES key size: "+8*t.length());this._keys=function(e){for(var t,r=[0,4,536870912,536870916,65536,65540,536936448,536936452,512,516,536871424,536871428,66048,66052,536936960,536936964],n=[0,1,1048576,1048577,67108864,67108865,68157440,68157441,256,257,1048832,1048833,67109120,67109121,68157696,68157697],i=[0,8,2048,2056,16777216,16777224,16779264,16779272,0,8,2048,2056,16777216,16777224,16779264,16779272],o=[0,2097152,134217728,136314880,8192,2105344,134225920,136323072,131072,2228224,134348800,136445952,139264,2236416,134356992,136454144],a=[0,262144,16,262160,0,262144,16,262160,4096,266240,4112,266256,4096,266240,4112,266256],s=[0,1024,32,1056,0,1024,32,1056,33554432,33555456,33554464,33555488,33554432,33555456,33554464,33555488],u=[0,268435456,524288,268959744,2,268435458,524290,268959746,0,268435456,524288,268959744,2,268435458,524290,268959746],c=[0,65536,2048,67584,536870912,536936448,536872960,536938496,131072,196608,133120,198656,537001984,537067520,537004032,537069568],l=[0,262144,0,262144,2,262146,2,262146,33554432,33816576,33554432,33816576,33554434,33816578,33554434,33816578],f=[0,268435456,8,268435464,0,268435456,8,268435464,1024,268436480,1032,268436488,1024,268436480,1032,268436488],h=[0,32,0,32,1048576,1048608,1048576,1048608,8192,8224,8192,8224,1056768,1056800,1056768,1056800],d=[0,16777216,512,16777728,2097152,18874368,2097664,18874880,67108864,83886080,67109376,83886592,69206016,85983232,69206528,85983744],p=[0,4096,134217728,134221824,524288,528384,134742016,134746112,16,4112,134217744,134221840,524304,528400,134742032,134746128],v=[0,4,256,260,0,4,256,260,1,5,257,261,1,5,257,261],g=e.length()>8?3:1,y=[],m=[0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,0],b=0,w=0;w<g;w++){var k=e.getInt32(),E=e.getInt32();k^=(t=252645135&(k>>>4^E))<<4,k^=t=65535&((E^=t)>>>-16^k),k^=(t=858993459&(k>>>2^(E^=t<<-16)))<<2,k^=t=65535&((E^=t)>>>-16^k),k^=(t=1431655765&(k>>>1^(E^=t<<-16)))<<1,k^=t=16711935&((E^=t)>>>8^k),t=(k^=(t=1431655765&(k>>>1^(E^=t<<8)))<<1)<<8|(E^=t)>>>20&240,k=E<<24|E<<8&16711680|E>>>8&65280|E>>>24&240,E=t;for(var x=0;x<m.length;++x){m[x]?(k=k<<2|k>>>26,E=E<<2|E>>>26):(k=k<<1|k>>>27,E=E<<1|E>>>27),E&=-15;var S=r[(k&=-15)>>>28]|n[k>>>24&15]|i[k>>>20&15]|o[k>>>16&15]|a[k>>>12&15]|s[k>>>8&15]|u[k>>>4&15],_=c[E>>>28]|l[E>>>24&15]|f[E>>>20&15]|h[E>>>16&15]|d[E>>>12&15]|p[E>>>8&15]|v[E>>>4&15];t=65535&(_>>>16^S),y[b++]=S^t,y[b++]=_^t<<16}}return y}(t),this._init=!0}},i("DES-ECB",n.cipher.modes.ecb),i("DES-CBC",n.cipher.modes.cbc),i("DES-CFB",n.cipher.modes.cfb),i("DES-OFB",n.cipher.modes.ofb),i("DES-CTR",n.cipher.modes.ctr),i("3DES-ECB",n.cipher.modes.ecb),i("3DES-CBC",n.cipher.modes.cbc),i("3DES-CFB",n.cipher.modes.cfb),i("3DES-OFB",n.cipher.modes.ofb),i("3DES-CTR",n.cipher.modes.ctr);var o=[16843776,0,65536,16843780,16842756,66564,4,65536,1024,16843776,16843780,1024,16778244,16842756,16777216,4,1028,16778240,16778240,66560,66560,16842752,16842752,16778244,65540,16777220,16777220,65540,0,1028,66564,16777216,65536,16843780,4,16842752,16843776,16777216,16777216,1024,16842756,65536,66560,16777220,1024,4,16778244,66564,16843780,65540,16842752,16778244,16777220,1028,66564,16843776,1028,16778240,16778240,0,65540,66560,0,16842756],a=[-2146402272,-2147450880,32768,1081376,1048576,32,-2146435040,-2147450848,-2147483616,-2146402272,-2146402304,-2147483648,-2147450880,1048576,32,-2146435040,1081344,1048608,-2147450848,0,-2147483648,32768,1081376,-2146435072,1048608,-2147483616,0,1081344,32800,-2146402304,-2146435072,32800,0,1081376,-2146435040,1048576,-2147450848,-2146435072,-2146402304,32768,-2146435072,-2147450880,32,-2146402272,1081376,32,32768,-2147483648,32800,-2146402304,1048576,-2147483616,1048608,-2147450848,-2147483616,1048608,1081344,0,-2147450880,32800,-2147483648,-2146435040,-2146402272,1081344],s=[520,134349312,0,134348808,134218240,0,131592,134218240,131080,134217736,134217736,131072,134349320,131080,134348800,520,134217728,8,134349312,512,131584,134348800,134348808,131592,134218248,131584,131072,134218248,8,134349320,512,134217728,134349312,134217728,131080,520,131072,134349312,134218240,0,512,131080,134349320,134218240,134217736,512,0,134348808,134218248,131072,134217728,134349320,8,131592,131584,134217736,134348800,134218248,520,134348800,131592,8,134348808,131584],u=[8396801,8321,8321,128,8396928,8388737,8388609,8193,0,8396800,8396800,8396929,129,0,8388736,8388609,1,8192,8388608,8396801,128,8388608,8193,8320,8388737,1,8320,8388736,8192,8396928,8396929,129,8388736,8388609,8396800,8396929,129,0,0,8396800,8320,8388736,8388737,1,8396801,8321,8321,128,8396929,129,1,8192,8388609,8193,8396928,8388737,8193,8320,8388608,8396801,128,8388608,8192,8396928],c=[256,34078976,34078720,1107296512,524288,256,1073741824,34078720,1074266368,524288,33554688,1074266368,1107296512,1107820544,524544,1073741824,33554432,1074266112,1074266112,0,1073742080,1107820800,1107820800,33554688,1107820544,1073742080,0,1107296256,34078976,33554432,1107296256,524544,524288,1107296512,256,33554432,1073741824,34078720,1107296512,1074266368,33554688,1073741824,1107820544,34078976,1074266368,256,33554432,1107820544,1107820800,524544,1107296256,1107820800,34078720,0,1074266112,1107296256,524544,33554688,1073742080,524288,0,1074266112,34078976,1073742080],l=[536870928,541065216,16384,541081616,541065216,16,541081616,4194304,536887296,4210704,4194304,536870928,4194320,536887296,536870912,16400,0,4194320,536887312,16384,4210688,536887312,16,541065232,541065232,0,4210704,541081600,16400,4210688,541081600,536870912,536887296,16,541065232,4210688,541081616,4194304,16400,536870928,4194304,536887296,536870912,16400,536870928,541081616,4210688,541065216,4210704,541081600,0,541065232,16,16384,541065216,4210704,16384,4194320,536887312,0,541081600,536870912,4194320,536887312],f=[2097152,69206018,67110914,0,2048,67110914,2099202,69208064,69208066,2097152,0,67108866,2,67108864,69206018,2050,67110912,2099202,2097154,67110912,67108866,69206016,69208064,2097154,69206016,2048,2050,69208066,2099200,2,67108864,2099200,67108864,2099200,2097152,67110914,67110914,69206018,69206018,2,2097154,67108864,67110912,2097152,69208064,2050,2099202,69208064,2050,67108866,69208066,69206016,2099200,0,2,69208066,0,2099202,69206016,2048,67108866,67110912,2048,2097154],h=[268439616,4096,262144,268701760,268435456,268439616,64,268435456,262208,268697600,268701760,266240,268701696,266304,4096,64,268697600,268435520,268439552,4160,266240,262208,268697664,268701696,4160,0,0,268697664,268435520,268439552,266304,262144,266304,262144,268701696,4096,64,268697664,4096,266304,268439552,64,268435520,268697600,268697664,268435456,262144,268439616,0,268701760,262208,268435520,268697600,268439552,268439616,0,268701760,266240,266240,4160,4160,262208,268435456,268701696];function d(e,t,r,n){var i,d,p=32===e.length?3:9;i=3===p?n?[30,-2,-2]:[0,32,2]:n?[94,62,-2,32,64,2,30,-2,-2]:[0,32,2,62,30,-2,64,96,2];var v=t[0],g=t[1];v^=(d=252645135&(v>>>4^g))<<4,v^=(d=65535&(v>>>16^(g^=d)))<<16,v^=d=858993459&((g^=d)>>>2^v),v^=d=16711935&((g^=d<<2)>>>8^v),v=(v^=(d=1431655765&(v>>>1^(g^=d<<8)))<<1)<<1|v>>>31,g=(g^=d)<<1|g>>>31;for(var y=0;y<p;y+=3){for(var m=i[y+1],b=i[y+2],w=i[y];w!=m;w+=b){var k=g^e[w],E=(g>>>4|g<<28)^e[w+1];d=v,v=g,g=d^(a[k>>>24&63]|u[k>>>16&63]|l[k>>>8&63]|h[63&k]|o[E>>>24&63]|s[E>>>16&63]|c[E>>>8&63]|f[63&E])}d=v,v=g,g=d}g=g>>>1|g<<31,g^=d=1431655765&((v=v>>>1|v<<31)>>>1^g),g^=(d=16711935&(g>>>8^(v^=d<<1)))<<8,g^=(d=858993459&(g>>>2^(v^=d)))<<2,g^=d=65535&((v^=d)>>>16^g),g^=d=252645135&((v^=d<<16)>>>4^g),v^=d<<4,r[0]=v,r[1]=g}function p(e){var t,r="DES-"+((e=e||{}).mode||"CBC").toUpperCase(),i=(t=e.decrypt?n.cipher.createDecipher(r,e.key):n.cipher.createCipher(r,e.key)).start;return t.start=function(e,r){var o=null;r instanceof n.util.ByteBuffer&&(o=r,r={}),(r=r||{}).output=o,r.iv=e,i.call(t,r)},t}},3299:function(e){e.exports={options:{usePureJavaScript:!1}}},2589:function(e,t,r){var n=r(3299);r(4744),r(9327),(e.exports=n.hmac=n.hmac||{}).create=function(){var e=null,t=null,r=null,i=null,o={start:function(o,a){if(null!==o)if("string"===typeof o){if(!((o=o.toLowerCase())in n.md.algorithms))throw new Error('Unknown hash algorithm "'+o+'"');t=n.md.algorithms[o].create()}else t=o;if(null===a)a=e;else{if("string"===typeof a)a=n.util.createBuffer(a);else if(n.util.isArray(a)){var s=a;a=n.util.createBuffer();for(var u=0;u<s.length;++u)a.putByte(s[u])}var c=a.length();c>t.blockLength&&(t.start(),t.update(a.bytes()),a=t.digest()),r=n.util.createBuffer(),i=n.util.createBuffer(),c=a.length();for(u=0;u<c;++u){s=a.at(u);r.putByte(54^s),i.putByte(92^s)}if(c<t.blockLength)for(s=t.blockLength-c,u=0;u<s;++u)r.putByte(54),i.putByte(92);e=a,r=r.bytes(),i=i.bytes()}t.start(),t.update(r)},update:function(e){t.update(e)},getMac:function(){var e=t.digest().bytes();return t.start(),t.update(i),t.update(e),t.digest()}};return o.digest=o.getMac,o}},8580:function(e,t,r){var n,i=r(3299);e.exports=i.jsbn=i.jsbn||{};function o(e,t,r){this.data=[],null!=e&&("number"==typeof e?this.fromNumber(e,t,r):null==t&&"string"!=typeof e?this.fromString(e,256):this.fromString(e,t))}function a(){return new o(null)}function s(e,t,r,n,i,o){for(var a=16383&t,s=t>>14;--o>=0;){var u=16383&this.data[e],c=this.data[e++]>>14,l=s*u+c*a;i=((u=a*u+((16383&l)<<14)+r.data[n]+i)>>28)+(l>>14)+s*c,r.data[n++]=268435455&u}return i}i.jsbn.BigInteger=o,"undefined"===typeof navigator?(o.prototype.am=s,n=28):"Microsoft Internet Explorer"==navigator.appName?(o.prototype.am=function(e,t,r,n,i,o){for(var a=32767&t,s=t>>15;--o>=0;){var u=32767&this.data[e],c=this.data[e++]>>15,l=s*u+c*a;i=((u=a*u+((32767&l)<<15)+r.data[n]+(1073741823&i))>>>30)+(l>>>15)+s*c+(i>>>30),r.data[n++]=1073741823&u}return i},n=30):"Netscape"!=navigator.appName?(o.prototype.am=function(e,t,r,n,i,o){for(;--o>=0;){var a=t*this.data[e++]+r.data[n]+i;i=Math.floor(a/67108864),r.data[n++]=67108863&a}return i},n=26):(o.prototype.am=s,n=28),o.prototype.DB=n,o.prototype.DM=(1<<n)-1,o.prototype.DV=1<<n;o.prototype.FV=Math.pow(2,52),o.prototype.F1=52-n,o.prototype.F2=2*n-52;var u,c,l=new Array;for(u="0".charCodeAt(0),c=0;c<=9;++c)l[u++]=c;for(u="a".charCodeAt(0),c=10;c<36;++c)l[u++]=c;for(u="A".charCodeAt(0),c=10;c<36;++c)l[u++]=c;function f(e){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(e)}function h(e,t){var r=l[e.charCodeAt(t)];return null==r?-1:r}function d(e){var t=a();return t.fromInt(e),t}function p(e){var t,r=1;return 0!=(t=e>>>16)&&(e=t,r+=16),0!=(t=e>>8)&&(e=t,r+=8),0!=(t=e>>4)&&(e=t,r+=4),0!=(t=e>>2)&&(e=t,r+=2),0!=(t=e>>1)&&(e=t,r+=1),r}function v(e){this.m=e}function g(e){this.m=e,this.mp=e.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<e.DB-15)-1,this.mt2=2*e.t}function y(e,t){return e&t}function m(e,t){return e|t}function b(e,t){return e^t}function w(e,t){return e&~t}function k(e){if(0==e)return-1;var t=0;return 0==(65535&e)&&(e>>=16,t+=16),0==(255&e)&&(e>>=8,t+=8),0==(15&e)&&(e>>=4,t+=4),0==(3&e)&&(e>>=2,t+=2),0==(1&e)&&++t,t}function E(e){for(var t=0;0!=e;)e&=e-1,++t;return t}function x(){}function S(e){return e}function _(e){this.r2=a(),this.q3=a(),o.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e),this.m=e}v.prototype.convert=function(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e},v.prototype.revert=function(e){return e},v.prototype.reduce=function(e){e.divRemTo(this.m,null,e)},v.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},v.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},g.prototype.convert=function(e){var t=a();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(o.ZERO)>0&&this.m.subTo(t,t),t},g.prototype.revert=function(e){var t=a();return e.copyTo(t),this.reduce(t),t},g.prototype.reduce=function(e){for(;e.t<=this.mt2;)e.data[e.t++]=0;for(var t=0;t<this.m.t;++t){var r=32767&e.data[t],n=r*this.mpl+((r*this.mph+(e.data[t]>>15)*this.mpl&this.um)<<15)&e.DM;for(r=t+this.m.t,e.data[r]+=this.m.am(0,n,e,t,0,this.m.t);e.data[r]>=e.DV;)e.data[r]-=e.DV,e.data[++r]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)},g.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},g.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},o.prototype.copyTo=function(e){for(var t=this.t-1;t>=0;--t)e.data[t]=this.data[t];e.t=this.t,e.s=this.s},o.prototype.fromInt=function(e){this.t=1,this.s=e<0?-1:0,e>0?this.data[0]=e:e<-1?this.data[0]=e+this.DV:this.t=0},o.prototype.fromString=function(e,t){var r;if(16==t)r=4;else if(8==t)r=3;else if(256==t)r=8;else if(2==t)r=1;else if(32==t)r=5;else{if(4!=t)return void this.fromRadix(e,t);r=2}this.t=0,this.s=0;for(var n=e.length,i=!1,a=0;--n>=0;){var s=8==r?255&e[n]:h(e,n);s<0?"-"==e.charAt(n)&&(i=!0):(i=!1,0==a?this.data[this.t++]=s:a+r>this.DB?(this.data[this.t-1]|=(s&(1<<this.DB-a)-1)<<a,this.data[this.t++]=s>>this.DB-a):this.data[this.t-1]|=s<<a,(a+=r)>=this.DB&&(a-=this.DB))}8==r&&0!=(128&e[0])&&(this.s=-1,a>0&&(this.data[this.t-1]|=(1<<this.DB-a)-1<<a)),this.clamp(),i&&o.ZERO.subTo(this,this)},o.prototype.clamp=function(){for(var e=this.s&this.DM;this.t>0&&this.data[this.t-1]==e;)--this.t},o.prototype.dlShiftTo=function(e,t){var r;for(r=this.t-1;r>=0;--r)t.data[r+e]=this.data[r];for(r=e-1;r>=0;--r)t.data[r]=0;t.t=this.t+e,t.s=this.s},o.prototype.drShiftTo=function(e,t){for(var r=e;r<this.t;++r)t.data[r-e]=this.data[r];t.t=Math.max(this.t-e,0),t.s=this.s},o.prototype.lShiftTo=function(e,t){var r,n=e%this.DB,i=this.DB-n,o=(1<<i)-1,a=Math.floor(e/this.DB),s=this.s<<n&this.DM;for(r=this.t-1;r>=0;--r)t.data[r+a+1]=this.data[r]>>i|s,s=(this.data[r]&o)<<n;for(r=a-1;r>=0;--r)t.data[r]=0;t.data[a]=s,t.t=this.t+a+1,t.s=this.s,t.clamp()},o.prototype.rShiftTo=function(e,t){t.s=this.s;var r=Math.floor(e/this.DB);if(r>=this.t)t.t=0;else{var n=e%this.DB,i=this.DB-n,o=(1<<n)-1;t.data[0]=this.data[r]>>n;for(var a=r+1;a<this.t;++a)t.data[a-r-1]|=(this.data[a]&o)<<i,t.data[a-r]=this.data[a]>>n;n>0&&(t.data[this.t-r-1]|=(this.s&o)<<i),t.t=this.t-r,t.clamp()}},o.prototype.subTo=function(e,t){for(var r=0,n=0,i=Math.min(e.t,this.t);r<i;)n+=this.data[r]-e.data[r],t.data[r++]=n&this.DM,n>>=this.DB;if(e.t<this.t){for(n-=e.s;r<this.t;)n+=this.data[r],t.data[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<e.t;)n-=e.data[r],t.data[r++]=n&this.DM,n>>=this.DB;n-=e.s}t.s=n<0?-1:0,n<-1?t.data[r++]=this.DV+n:n>0&&(t.data[r++]=n),t.t=r,t.clamp()},o.prototype.multiplyTo=function(e,t){var r=this.abs(),n=e.abs(),i=r.t;for(t.t=i+n.t;--i>=0;)t.data[i]=0;for(i=0;i<n.t;++i)t.data[i+r.t]=r.am(0,n.data[i],t,i,0,r.t);t.s=0,t.clamp(),this.s!=e.s&&o.ZERO.subTo(t,t)},o.prototype.squareTo=function(e){for(var t=this.abs(),r=e.t=2*t.t;--r>=0;)e.data[r]=0;for(r=0;r<t.t-1;++r){var n=t.am(r,t.data[r],e,2*r,0,1);(e.data[r+t.t]+=t.am(r+1,2*t.data[r],e,2*r+1,n,t.t-r-1))>=t.DV&&(e.data[r+t.t]-=t.DV,e.data[r+t.t+1]=1)}e.t>0&&(e.data[e.t-1]+=t.am(r,t.data[r],e,2*r,0,1)),e.s=0,e.clamp()},o.prototype.divRemTo=function(e,t,r){var n=e.abs();if(!(n.t<=0)){var i=this.abs();if(i.t<n.t)return null!=t&&t.fromInt(0),void(null!=r&&this.copyTo(r));null==r&&(r=a());var s=a(),u=this.s,c=e.s,l=this.DB-p(n.data[n.t-1]);l>0?(n.lShiftTo(l,s),i.lShiftTo(l,r)):(n.copyTo(s),i.copyTo(r));var f=s.t,h=s.data[f-1];if(0!=h){var d=h*(1<<this.F1)+(f>1?s.data[f-2]>>this.F2:0),v=this.FV/d,g=(1<<this.F1)/d,y=1<<this.F2,m=r.t,b=m-f,w=null==t?a():t;for(s.dlShiftTo(b,w),r.compareTo(w)>=0&&(r.data[r.t++]=1,r.subTo(w,r)),o.ONE.dlShiftTo(f,w),w.subTo(s,s);s.t<f;)s.data[s.t++]=0;for(;--b>=0;){var k=r.data[--m]==h?this.DM:Math.floor(r.data[m]*v+(r.data[m-1]+y)*g);if((r.data[m]+=s.am(0,k,r,b,0,f))<k)for(s.dlShiftTo(b,w),r.subTo(w,r);r.data[m]<--k;)r.subTo(w,r)}null!=t&&(r.drShiftTo(f,t),u!=c&&o.ZERO.subTo(t,t)),r.t=f,r.clamp(),l>0&&r.rShiftTo(l,r),u<0&&o.ZERO.subTo(r,r)}}},o.prototype.invDigit=function(){if(this.t<1)return 0;var e=this.data[0];if(0==(1&e))return 0;var t=3&e;return(t=(t=(t=(t=t*(2-(15&e)*t)&15)*(2-(255&e)*t)&255)*(2-((65535&e)*t&65535))&65535)*(2-e*t%this.DV)%this.DV)>0?this.DV-t:-t},o.prototype.isEven=function(){return 0==(this.t>0?1&this.data[0]:this.s)},o.prototype.exp=function(e,t){if(e>4294967295||e<1)return o.ONE;var r=a(),n=a(),i=t.convert(this),s=p(e)-1;for(i.copyTo(r);--s>=0;)if(t.sqrTo(r,n),(e&1<<s)>0)t.mulTo(n,i,r);else{var u=r;r=n,n=u}return t.revert(r)},o.prototype.toString=function(e){if(this.s<0)return"-"+this.negate().toString(e);var t;if(16==e)t=4;else if(8==e)t=3;else if(2==e)t=1;else if(32==e)t=5;else{if(4!=e)return this.toRadix(e);t=2}var r,n=(1<<t)-1,i=!1,o="",a=this.t,s=this.DB-a*this.DB%t;if(a-- >0)for(s<this.DB&&(r=this.data[a]>>s)>0&&(i=!0,o=f(r));a>=0;)s<t?(r=(this.data[a]&(1<<s)-1)<<t-s,r|=this.data[--a]>>(s+=this.DB-t)):(r=this.data[a]>>(s-=t)&n,s<=0&&(s+=this.DB,--a)),r>0&&(i=!0),i&&(o+=f(r));return i?o:"0"},o.prototype.negate=function(){var e=a();return o.ZERO.subTo(this,e),e},o.prototype.abs=function(){return this.s<0?this.negate():this},o.prototype.compareTo=function(e){var t=this.s-e.s;if(0!=t)return t;var r=this.t;if(0!=(t=r-e.t))return this.s<0?-t:t;for(;--r>=0;)if(0!=(t=this.data[r]-e.data[r]))return t;return 0},o.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+p(this.data[this.t-1]^this.s&this.DM)},o.prototype.mod=function(e){var t=a();return this.abs().divRemTo(e,null,t),this.s<0&&t.compareTo(o.ZERO)>0&&e.subTo(t,t),t},o.prototype.modPowInt=function(e,t){var r;return r=e<256||t.isEven()?new v(t):new g(t),this.exp(e,r)},o.ZERO=d(0),o.ONE=d(1),x.prototype.convert=S,x.prototype.revert=S,x.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r)},x.prototype.sqrTo=function(e,t){e.squareTo(t)},_.prototype.convert=function(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=a();return e.copyTo(t),this.reduce(t),t},_.prototype.revert=function(e){return e},_.prototype.reduce=function(e){for(e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);e.compareTo(this.r2)<0;)e.dAddOffset(1,this.m.t+1);for(e.subTo(this.r2,e);e.compareTo(this.m)>=0;)e.subTo(this.m,e)},_.prototype.mulTo=function(e,t,r){e.multiplyTo(t,r),this.reduce(r)},_.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)};var A=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509],I=(1<<26)/A[A.length-1];o.prototype.chunkSize=function(e){return Math.floor(Math.LN2*this.DB/Math.log(e))},o.prototype.toRadix=function(e){if(null==e&&(e=10),0==this.signum()||e<2||e>36)return"0";var t=this.chunkSize(e),r=Math.pow(e,t),n=d(r),i=a(),o=a(),s="";for(this.divRemTo(n,i,o);i.signum()>0;)s=(r+o.intValue()).toString(e).substr(1)+s,i.divRemTo(n,i,o);return o.intValue().toString(e)+s},o.prototype.fromRadix=function(e,t){this.fromInt(0),null==t&&(t=10);for(var r=this.chunkSize(t),n=Math.pow(t,r),i=!1,a=0,s=0,u=0;u<e.length;++u){var c=h(e,u);c<0?"-"==e.charAt(u)&&0==this.signum()&&(i=!0):(s=t*s+c,++a>=r&&(this.dMultiply(n),this.dAddOffset(s,0),a=0,s=0))}a>0&&(this.dMultiply(Math.pow(t,a)),this.dAddOffset(s,0)),i&&o.ZERO.subTo(this,this)},o.prototype.fromNumber=function(e,t,r){if("number"==typeof t)if(e<2)this.fromInt(1);else for(this.fromNumber(e,r),this.testBit(e-1)||this.bitwiseTo(o.ONE.shiftLeft(e-1),m,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(t);)this.dAddOffset(2,0),this.bitLength()>e&&this.subTo(o.ONE.shiftLeft(e-1),this);else{var n=new Array,i=7&e;n.length=1+(e>>3),t.nextBytes(n),i>0?n[0]&=(1<<i)-1:n[0]=0,this.fromString(n,256)}},o.prototype.bitwiseTo=function(e,t,r){var n,i,o=Math.min(e.t,this.t);for(n=0;n<o;++n)r.data[n]=t(this.data[n],e.data[n]);if(e.t<this.t){for(i=e.s&this.DM,n=o;n<this.t;++n)r.data[n]=t(this.data[n],i);r.t=this.t}else{for(i=this.s&this.DM,n=o;n<e.t;++n)r.data[n]=t(i,e.data[n]);r.t=e.t}r.s=t(this.s,e.s),r.clamp()},o.prototype.changeBit=function(e,t){var r=o.ONE.shiftLeft(e);return this.bitwiseTo(r,t,r),r},o.prototype.addTo=function(e,t){for(var r=0,n=0,i=Math.min(e.t,this.t);r<i;)n+=this.data[r]+e.data[r],t.data[r++]=n&this.DM,n>>=this.DB;if(e.t<this.t){for(n+=e.s;r<this.t;)n+=this.data[r],t.data[r++]=n&this.DM,n>>=this.DB;n+=this.s}else{for(n+=this.s;r<e.t;)n+=e.data[r],t.data[r++]=n&this.DM,n>>=this.DB;n+=e.s}t.s=n<0?-1:0,n>0?t.data[r++]=n:n<-1&&(t.data[r++]=this.DV+n),t.t=r,t.clamp()},o.prototype.dMultiply=function(e){this.data[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()},o.prototype.dAddOffset=function(e,t){if(0!=e){for(;this.t<=t;)this.data[this.t++]=0;for(this.data[t]+=e;this.data[t]>=this.DV;)this.data[t]-=this.DV,++t>=this.t&&(this.data[this.t++]=0),++this.data[t]}},o.prototype.multiplyLowerTo=function(e,t,r){var n,i=Math.min(this.t+e.t,t);for(r.s=0,r.t=i;i>0;)r.data[--i]=0;for(n=r.t-this.t;i<n;++i)r.data[i+this.t]=this.am(0,e.data[i],r,i,0,this.t);for(n=Math.min(e.t,t);i<n;++i)this.am(0,e.data[i],r,i,0,t-i);r.clamp()},o.prototype.multiplyUpperTo=function(e,t,r){--t;var n=r.t=this.t+e.t-t;for(r.s=0;--n>=0;)r.data[n]=0;for(n=Math.max(t-this.t,0);n<e.t;++n)r.data[this.t+n-t]=this.am(t-n,e.data[n],r,0,0,this.t+n-t);r.clamp(),r.drShiftTo(1,r)},o.prototype.modInt=function(e){if(e<=0)return 0;var t=this.DV%e,r=this.s<0?e-1:0;if(this.t>0)if(0==t)r=this.data[0]%e;else for(var n=this.t-1;n>=0;--n)r=(t*r+this.data[n])%e;return r},o.prototype.millerRabin=function(e){var t=this.subtract(o.ONE),r=t.getLowestSetBit();if(r<=0)return!1;for(var n,i=t.shiftRight(r),a={nextBytes:function(e){for(var t=0;t<e.length;++t)e[t]=Math.floor(256*Math.random())}},s=0;s<e;++s){do{n=new o(this.bitLength(),a)}while(n.compareTo(o.ONE)<=0||n.compareTo(t)>=0);var u=n.modPow(i,this);if(0!=u.compareTo(o.ONE)&&0!=u.compareTo(t)){for(var c=1;c++<r&&0!=u.compareTo(t);)if(0==(u=u.modPowInt(2,this)).compareTo(o.ONE))return!1;if(0!=u.compareTo(t))return!1}}return!0},o.prototype.clone=function(){var e=a();return this.copyTo(e),e},o.prototype.intValue=function(){if(this.s<0){if(1==this.t)return this.data[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this.data[0];if(0==this.t)return 0}return(this.data[1]&(1<<32-this.DB)-1)<<this.DB|this.data[0]},o.prototype.byteValue=function(){return 0==this.t?this.s:this.data[0]<<24>>24},o.prototype.shortValue=function(){return 0==this.t?this.s:this.data[0]<<16>>16},o.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this.data[0]<=0?0:1},o.prototype.toByteArray=function(){var e=this.t,t=new Array;t[0]=this.s;var r,n=this.DB-e*this.DB%8,i=0;if(e-- >0)for(n<this.DB&&(r=this.data[e]>>n)!=(this.s&this.DM)>>n&&(t[i++]=r|this.s<<this.DB-n);e>=0;)n<8?(r=(this.data[e]&(1<<n)-1)<<8-n,r|=this.data[--e]>>(n+=this.DB-8)):(r=this.data[e]>>(n-=8)&255,n<=0&&(n+=this.DB,--e)),0!=(128&r)&&(r|=-256),0==i&&(128&this.s)!=(128&r)&&++i,(i>0||r!=this.s)&&(t[i++]=r);return t},o.prototype.equals=function(e){return 0==this.compareTo(e)},o.prototype.min=function(e){return this.compareTo(e)<0?this:e},o.prototype.max=function(e){return this.compareTo(e)>0?this:e},o.prototype.and=function(e){var t=a();return this.bitwiseTo(e,y,t),t},o.prototype.or=function(e){var t=a();return this.bitwiseTo(e,m,t),t},o.prototype.xor=function(e){var t=a();return this.bitwiseTo(e,b,t),t},o.prototype.andNot=function(e){var t=a();return this.bitwiseTo(e,w,t),t},o.prototype.not=function(){for(var e=a(),t=0;t<this.t;++t)e.data[t]=this.DM&~this.data[t];return e.t=this.t,e.s=~this.s,e},o.prototype.shiftLeft=function(e){var t=a();return e<0?this.rShiftTo(-e,t):this.lShiftTo(e,t),t},o.prototype.shiftRight=function(e){var t=a();return e<0?this.lShiftTo(-e,t):this.rShiftTo(e,t),t},o.prototype.getLowestSetBit=function(){for(var e=0;e<this.t;++e)if(0!=this.data[e])return e*this.DB+k(this.data[e]);return this.s<0?this.t*this.DB:-1},o.prototype.bitCount=function(){for(var e=0,t=this.s&this.DM,r=0;r<this.t;++r)e+=E(this.data[r]^t);return e},o.prototype.testBit=function(e){var t=Math.floor(e/this.DB);return t>=this.t?0!=this.s:0!=(this.data[t]&1<<e%this.DB)},o.prototype.setBit=function(e){return this.changeBit(e,m)},o.prototype.clearBit=function(e){return this.changeBit(e,w)},o.prototype.flipBit=function(e){return this.changeBit(e,b)},o.prototype.add=function(e){var t=a();return this.addTo(e,t),t},o.prototype.subtract=function(e){var t=a();return this.subTo(e,t),t},o.prototype.multiply=function(e){var t=a();return this.multiplyTo(e,t),t},o.prototype.divide=function(e){var t=a();return this.divRemTo(e,t,null),t},o.prototype.remainder=function(e){var t=a();return this.divRemTo(e,null,t),t},o.prototype.divideAndRemainder=function(e){var t=a(),r=a();return this.divRemTo(e,t,r),new Array(t,r)},o.prototype.modPow=function(e,t){var r,n,i=e.bitLength(),o=d(1);if(i<=0)return o;r=i<18?1:i<48?3:i<144?4:i<768?5:6,n=i<8?new v(t):t.isEven()?new _(t):new g(t);var s=new Array,u=3,c=r-1,l=(1<<r)-1;if(s[1]=n.convert(this),r>1){var f=a();for(n.sqrTo(s[1],f);u<=l;)s[u]=a(),n.mulTo(f,s[u-2],s[u]),u+=2}var h,y,m=e.t-1,b=!0,w=a();for(i=p(e.data[m])-1;m>=0;){for(i>=c?h=e.data[m]>>i-c&l:(h=(e.data[m]&(1<<i+1)-1)<<c-i,m>0&&(h|=e.data[m-1]>>this.DB+i-c)),u=r;0==(1&h);)h>>=1,--u;if((i-=u)<0&&(i+=this.DB,--m),b)s[h].copyTo(o),b=!1;else{for(;u>1;)n.sqrTo(o,w),n.sqrTo(w,o),u-=2;u>0?n.sqrTo(o,w):(y=o,o=w,w=y),n.mulTo(w,s[h],o)}for(;m>=0&&0==(e.data[m]&1<<i);)n.sqrTo(o,w),y=o,o=w,w=y,--i<0&&(i=this.DB-1,--m)}return n.revert(o)},o.prototype.modInverse=function(e){var t=e.isEven();if(this.isEven()&&t||0==e.signum())return o.ZERO;for(var r=e.clone(),n=this.clone(),i=d(1),a=d(0),s=d(0),u=d(1);0!=r.signum();){for(;r.isEven();)r.rShiftTo(1,r),t?(i.isEven()&&a.isEven()||(i.addTo(this,i),a.subTo(e,a)),i.rShiftTo(1,i)):a.isEven()||a.subTo(e,a),a.rShiftTo(1,a);for(;n.isEven();)n.rShiftTo(1,n),t?(s.isEven()&&u.isEven()||(s.addTo(this,s),u.subTo(e,u)),s.rShiftTo(1,s)):u.isEven()||u.subTo(e,u),u.rShiftTo(1,u);r.compareTo(n)>=0?(r.subTo(n,r),t&&i.subTo(s,i),a.subTo(u,a)):(n.subTo(r,n),t&&s.subTo(i,s),u.subTo(a,u))}return 0!=n.compareTo(o.ONE)?o.ZERO:u.compareTo(e)>=0?u.subtract(e):u.signum()<0?(u.addTo(e,u),u.signum()<0?u.add(e):u):u},o.prototype.pow=function(e){return this.exp(e,new x)},o.prototype.gcd=function(e){var t=this.s<0?this.negate():this.clone(),r=e.s<0?e.negate():e.clone();if(t.compareTo(r)<0){var n=t;t=r,r=n}var i=t.getLowestSetBit(),o=r.getLowestSetBit();if(o<0)return t;for(i<o&&(o=i),o>0&&(t.rShiftTo(o,t),r.rShiftTo(o,r));t.signum()>0;)(i=t.getLowestSetBit())>0&&t.rShiftTo(i,t),(i=r.getLowestSetBit())>0&&r.rShiftTo(i,r),t.compareTo(r)>=0?(t.subTo(r,t),t.rShiftTo(1,t)):(r.subTo(t,r),r.rShiftTo(1,r));return o>0&&r.lShiftTo(o,r),r},o.prototype.isProbablePrime=function(e){var t,r=this.abs();if(1==r.t&&r.data[0]<=A[A.length-1]){for(t=0;t<A.length;++t)if(r.data[0]==A[t])return!0;return!1}if(r.isEven())return!1;for(t=1;t<A.length;){for(var n=A[t],i=t+1;i<A.length&&n<I;)n*=A[i++];for(n=r.modInt(n);t<i;)if(n%A[t++]==0)return!1}return r.millerRabin(e)}},4744:function(e,t,r){var n=r(3299);e.exports=n.md=n.md||{},n.md.algorithms=n.md.algorithms||{}},2458:function(e,t,r){var n=r(3299);n.pki=n.pki||{};var i=e.exports=n.pki.oids=n.oids=n.oids||{};function o(e,t){i[e]=t,i[t]=e}function a(e,t){i[e]=t}o("1.2.840.113549.1.1.1","rsaEncryption"),o("1.2.840.113549.1.1.4","md5WithRSAEncryption"),o("1.2.840.113549.1.1.5","sha1WithRSAEncryption"),o("1.2.840.113549.1.1.7","RSAES-OAEP"),o("1.2.840.113549.1.1.8","mgf1"),o("1.2.840.113549.1.1.9","pSpecified"),o("1.2.840.113549.1.1.10","RSASSA-PSS"),o("1.2.840.113549.1.1.11","sha256WithRSAEncryption"),o("1.2.840.113549.1.1.12","sha384WithRSAEncryption"),o("1.2.840.113549.1.1.13","sha512WithRSAEncryption"),o("1.3.101.112","EdDSA25519"),o("1.2.840.10040.4.3","dsa-with-sha1"),o("1.3.14.3.2.7","desCBC"),o("1.3.14.3.2.26","sha1"),o("1.3.14.3.2.29","sha1WithRSASignature"),o("2.16.840.1.101.3.4.2.1","sha256"),o("2.16.840.1.101.3.4.2.2","sha384"),o("2.16.840.1.101.3.4.2.3","sha512"),o("2.16.840.1.101.3.4.2.4","sha224"),o("2.16.840.1.101.3.4.2.5","sha512-224"),o("2.16.840.1.101.3.4.2.6","sha512-256"),o("1.2.840.113549.2.2","md2"),o("1.2.840.113549.2.5","md5"),o("1.2.840.113549.1.7.1","data"),o("1.2.840.113549.1.7.2","signedData"),o("1.2.840.113549.1.7.3","envelopedData"),o("1.2.840.113549.1.7.4","signedAndEnvelopedData"),o("1.2.840.113549.1.7.5","digestedData"),o("1.2.840.113549.1.7.6","encryptedData"),o("1.2.840.113549.1.9.1","emailAddress"),o("1.2.840.113549.1.9.2","unstructuredName"),o("1.2.840.113549.1.9.3","contentType"),o("1.2.840.113549.1.9.4","messageDigest"),o("1.2.840.113549.1.9.5","signingTime"),o("1.2.840.113549.1.9.6","counterSignature"),o("1.2.840.113549.1.9.7","challengePassword"),o("1.2.840.113549.1.9.8","unstructuredAddress"),o("1.2.840.113549.1.9.14","extensionRequest"),o("1.2.840.113549.1.9.20","friendlyName"),o("1.2.840.113549.1.9.21","localKeyId"),o("1.2.840.113549.1.9.22.1","x509Certificate"),o("1.2.840.113549.1.12.10.1.1","keyBag"),o("1.2.840.113549.1.12.10.1.2","pkcs8ShroudedKeyBag"),o("1.2.840.113549.1.12.10.1.3","certBag"),o("1.2.840.113549.1.12.10.1.4","crlBag"),o("1.2.840.113549.1.12.10.1.5","secretBag"),o("1.2.840.113549.1.12.10.1.6","safeContentsBag"),o("1.2.840.113549.1.5.13","pkcs5PBES2"),o("1.2.840.113549.1.5.12","pkcs5PBKDF2"),o("1.2.840.113549.1.12.1.1","pbeWithSHAAnd128BitRC4"),o("1.2.840.113549.1.12.1.2","pbeWithSHAAnd40BitRC4"),o("1.2.840.113549.1.12.1.3","pbeWithSHAAnd3-KeyTripleDES-CBC"),o("1.2.840.113549.1.12.1.4","pbeWithSHAAnd2-KeyTripleDES-CBC"),o("1.2.840.113549.1.12.1.5","pbeWithSHAAnd128BitRC2-CBC"),o("1.2.840.113549.1.12.1.6","pbewithSHAAnd40BitRC2-CBC"),o("1.2.840.113549.2.7","hmacWithSHA1"),o("1.2.840.113549.2.8","hmacWithSHA224"),o("1.2.840.113549.2.9","hmacWithSHA256"),o("1.2.840.113549.2.10","hmacWithSHA384"),o("1.2.840.113549.2.11","hmacWithSHA512"),o("1.2.840.113549.3.7","des-EDE3-CBC"),o("2.16.840.1.101.3.4.1.2","aes128-CBC"),o("2.16.840.1.101.3.4.1.22","aes192-CBC"),o("2.16.840.1.101.3.4.1.42","aes256-CBC"),o("2.5.4.3","commonName"),o("2.5.4.4","surname"),o("2.5.4.5","serialNumber"),o("2.5.4.6","countryName"),o("2.5.4.7","localityName"),o("2.5.4.8","stateOrProvinceName"),o("2.5.4.9","streetAddress"),o("2.5.4.10","organizationName"),o("2.5.4.11","organizationalUnitName"),o("2.5.4.12","title"),o("2.5.4.13","description"),o("2.5.4.15","businessCategory"),o("2.5.4.17","postalCode"),o("2.5.4.42","givenName"),o("1.3.6.1.4.1.311.60.2.1.2","jurisdictionOfIncorporationStateOrProvinceName"),o("1.3.6.1.4.1.311.60.2.1.3","jurisdictionOfIncorporationCountryName"),o("2.16.840.1.113730.1.1","nsCertType"),o("2.16.840.1.113730.1.13","nsComment"),a("2.5.29.1","authorityKeyIdentifier"),a("2.5.29.2","keyAttributes"),a("2.5.29.3","certificatePolicies"),a("2.5.29.4","keyUsageRestriction"),a("2.5.29.5","policyMapping"),a("2.5.29.6","subtreesConstraint"),a("2.5.29.7","subjectAltName"),a("2.5.29.8","issuerAltName"),a("2.5.29.9","subjectDirectoryAttributes"),a("2.5.29.10","basicConstraints"),a("2.5.29.11","nameConstraints"),a("2.5.29.12","policyConstraints"),a("2.5.29.13","basicConstraints"),o("2.5.29.14","subjectKeyIdentifier"),o("2.5.29.15","keyUsage"),a("2.5.29.16","privateKeyUsagePeriod"),o("2.5.29.17","subjectAltName"),o("2.5.29.18","issuerAltName"),o("2.5.29.19","basicConstraints"),a("2.5.29.20","cRLNumber"),a("2.5.29.21","cRLReason"),a("2.5.29.22","expirationDate"),a("2.5.29.23","instructionCode"),a("2.5.29.24","invalidityDate"),a("2.5.29.25","cRLDistributionPoints"),a("2.5.29.26","issuingDistributionPoint"),a("2.5.29.27","deltaCRLIndicator"),a("2.5.29.28","issuingDistributionPoint"),a("2.5.29.29","certificateIssuer"),a("2.5.29.30","nameConstraints"),o("2.5.29.31","cRLDistributionPoints"),o("2.5.29.32","certificatePolicies"),a("2.5.29.33","policyMappings"),a("2.5.29.34","policyConstraints"),o("2.5.29.35","authorityKeyIdentifier"),a("2.5.29.36","policyConstraints"),o("2.5.29.37","extKeyUsage"),a("2.5.29.46","freshestCRL"),a("2.5.29.54","inhibitAnyPolicy"),o("1.3.6.1.4.1.11129.2.4.2","timestampList"),o("1.3.6.1.5.5.7.1.1","authorityInfoAccess"),o("1.3.6.1.5.5.7.3.1","serverAuth"),o("1.3.6.1.5.5.7.3.2","clientAuth"),o("1.3.6.1.5.5.7.3.3","codeSigning"),o("1.3.6.1.5.5.7.3.4","emailProtection"),o("1.3.6.1.5.5.7.3.8","timeStamping")},4392:function(e,t,r){var n=r(3299);if(r(9521),r(5406),r(1854),r(4744),r(2458),r(3611),r(1919),r(8217),r(9932),r(4199),r(9327),"undefined"===typeof i)var i=n.jsbn.BigInteger;var o=n.asn1,a=n.pki=n.pki||{};e.exports=a.pbe=n.pbe=n.pbe||{};var s=a.oids,u={name:"EncryptedPrivateKeyInfo",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"EncryptedPrivateKeyInfo.encryptionAlgorithm",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:o.Class.UNIVERSAL,type:o.Type.OID,constructed:!1,capture:"encryptionOid"},{name:"AlgorithmIdentifier.parameters",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,captureAsn1:"encryptionParams"}]},{name:"EncryptedPrivateKeyInfo.encryptedData",tagClass:o.Class.UNIVERSAL,type:o.Type.OCTETSTRING,constructed:!1,capture:"encryptedData"}]},c={name:"PBES2Algorithms",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.keyDerivationFunc.oid",tagClass:o.Class.UNIVERSAL,type:o.Type.OID,constructed:!1,capture:"kdfOid"},{name:"PBES2Algorithms.params",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.params.salt",tagClass:o.Class.UNIVERSAL,type:o.Type.OCTETSTRING,constructed:!1,capture:"kdfSalt"},{name:"PBES2Algorithms.params.iterationCount",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"kdfIterationCount"},{name:"PBES2Algorithms.params.keyLength",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,optional:!0,capture:"keyLength"},{name:"PBES2Algorithms.params.prf",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,optional:!0,value:[{name:"PBES2Algorithms.params.prf.algorithm",tagClass:o.Class.UNIVERSAL,type:o.Type.OID,constructed:!1,capture:"prfOid"}]}]}]},{name:"PBES2Algorithms.encryptionScheme",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"PBES2Algorithms.encryptionScheme.oid",tagClass:o.Class.UNIVERSAL,type:o.Type.OID,constructed:!1,capture:"encOid"},{name:"PBES2Algorithms.encryptionScheme.iv",tagClass:o.Class.UNIVERSAL,type:o.Type.OCTETSTRING,constructed:!1,capture:"encIv"}]}]},l={name:"pkcs-12PbeParams",tagClass:o.Class.UNIVERSAL,type:o.Type.SEQUENCE,constructed:!0,value:[{name:"pkcs-12PbeParams.salt",tagClass:o.Class.UNIVERSAL,type:o.Type.OCTETSTRING,constructed:!1,capture:"salt"},{name:"pkcs-12PbeParams.iterations",tagClass:o.Class.UNIVERSAL,type:o.Type.INTEGER,constructed:!1,capture:"iterations"}]};function f(e,t){return e.start().update(t).digest().getBytes()}function h(e){var t;if(e){if(!(t=a.oids[o.derToOid(e)])){var r=new Error("Unsupported PRF OID.");throw r.oid=e,r.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],r}}else t="hmacWithSHA1";return d(t)}function d(e){var t=n.md;switch(e){case"hmacWithSHA224":t=n.md.sha512;case"hmacWithSHA1":case"hmacWithSHA256":case"hmacWithSHA384":case"hmacWithSHA512":e=e.substr(8).toLowerCase();break;default:var r=new Error("Unsupported PRF algorithm.");throw r.algorithm=e,r.supported=["hmacWithSHA1","hmacWithSHA224","hmacWithSHA256","hmacWithSHA384","hmacWithSHA512"],r}if(!t||!(e in t))throw new Error("Unknown hash algorithm: "+e);return t[e].create()}a.encryptPrivateKeyInfo=function(e,t,r){(r=r||{}).saltSize=r.saltSize||8,r.count=r.count||2048,r.algorithm=r.algorithm||"aes128",r.prfAlgorithm=r.prfAlgorithm||"sha1";var i,u,c,l=n.random.getBytesSync(r.saltSize),f=r.count,h=o.integerToDer(f);if(0===r.algorithm.indexOf("aes")||"des"===r.algorithm){var p,v,g;switch(r.algorithm){case"aes128":i=16,p=16,v=s["aes128-CBC"],g=n.aes.createEncryptionCipher;break;case"aes192":i=24,p=16,v=s["aes192-CBC"],g=n.aes.createEncryptionCipher;break;case"aes256":i=32,p=16,v=s["aes256-CBC"],g=n.aes.createEncryptionCipher;break;case"des":i=8,p=8,v=s.desCBC,g=n.des.createEncryptionCipher;break;default:throw(E=new Error("Cannot encrypt private key. Unknown encryption algorithm.")).algorithm=r.algorithm,E}var y="hmacWith"+r.prfAlgorithm.toUpperCase(),m=d(y),b=n.pkcs5.pbkdf2(t,l,f,i,m),w=n.random.getBytesSync(p);(x=g(b)).start(w),x.update(o.toDer(e)),x.finish(),c=x.output.getBytes();var k=function(e,t,r,i){var s=o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.OCTETSTRING,!1,e),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,t.getBytes())]);"hmacWithSHA1"!==i&&s.value.push(o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,n.util.hexToBytes(r.toString(16))),o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.OID,!1,o.oidToDer(a.oids[i]).getBytes()),o.create(o.Class.UNIVERSAL,o.Type.NULL,!1,"")]));return s}(l,h,i,y);u=o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.OID,!1,o.oidToDer(s.pkcs5PBES2).getBytes()),o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.OID,!1,o.oidToDer(s.pkcs5PBKDF2).getBytes()),k]),o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.OID,!1,o.oidToDer(v).getBytes()),o.create(o.Class.UNIVERSAL,o.Type.OCTETSTRING,!1,w)])])])}else{var E;if("3des"!==r.algorithm)throw(E=new Error("Cannot encrypt private key. Unknown encryption algorithm.")).algorithm=r.algorithm,E;i=24;var x,S=new n.util.ByteBuffer(l);b=a.pbe.generatePkcs12Key(t,S,1,f,i),w=a.pbe.generatePkcs12Key(t,S,2,f,i);(x=n.des.createEncryptionCipher(b)).start(w),x.update(o.toDer(e)),x.finish(),c=x.output.getBytes(),u=o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.OID,!1,o.oidToDer(s["pbeWithSHAAnd3-KeyTripleDES-CBC"]).getBytes()),o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[o.create(o.Class.UNIVERSAL,o.Type.OCTETSTRING,!1,l),o.create(o.Class.UNIVERSAL,o.Type.INTEGER,!1,h.getBytes())])])}return o.create(o.Class.UNIVERSAL,o.Type.SEQUENCE,!0,[u,o.create(o.Class.UNIVERSAL,o.Type.OCTETSTRING,!1,c)])},a.decryptPrivateKeyInfo=function(e,t){var r=null,i={},s=[];if(!o.validate(e,u,i,s)){var c=new Error("Cannot read encrypted private key. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");throw c.errors=s,c}var l=o.derToOid(i.encryptionOid),f=a.pbe.getCipher(l,i.encryptionParams,t),h=n.util.createBuffer(i.encryptedData);return f.update(h),f.finish()&&(r=o.fromDer(f.output)),r},a.encryptedPrivateKeyToPem=function(e,t){var r={type:"ENCRYPTED PRIVATE KEY",body:o.toDer(e).getBytes()};return n.pem.encode(r,{maxline:t})},a.encryptedPrivateKeyFromPem=function(e){var t=n.pem.decode(e)[0];if("ENCRYPTED PRIVATE KEY"!==t.type){var r=new Error('Could not convert encrypted private key from PEM; PEM header type is "ENCRYPTED PRIVATE KEY".');throw r.headerType=t.type,r}if(t.procType&&"ENCRYPTED"===t.procType.type)throw new Error("Could not convert encrypted private key from PEM; PEM is encrypted.");return o.fromDer(t.body)},a.encryptRsaPrivateKey=function(e,t,r){if(!(r=r||{}).legacy){var i=a.wrapRsaPrivateKey(a.privateKeyToAsn1(e));return i=a.encryptPrivateKeyInfo(i,t,r),a.encryptedPrivateKeyToPem(i)}var s,u,c,l;switch(r.algorithm){case"aes128":s="AES-128-CBC",c=16,u=n.random.getBytesSync(16),l=n.aes.createEncryptionCipher;break;case"aes192":s="AES-192-CBC",c=24,u=n.random.getBytesSync(16),l=n.aes.createEncryptionCipher;break;case"aes256":s="AES-256-CBC",c=32,u=n.random.getBytesSync(16),l=n.aes.createEncryptionCipher;break;case"3des":s="DES-EDE3-CBC",c=24,u=n.random.getBytesSync(8),l=n.des.createEncryptionCipher;break;case"des":s="DES-CBC",c=8,u=n.random.getBytesSync(8),l=n.des.createEncryptionCipher;break;default:var f=new Error('Could not encrypt RSA private key; unsupported encryption algorithm "'+r.algorithm+'".');throw f.algorithm=r.algorithm,f}var h=l(n.pbe.opensslDeriveBytes(t,u.substr(0,8),c));h.start(u),h.update(o.toDer(a.privateKeyToAsn1(e))),h.finish();var d={type:"RSA PRIVATE KEY",procType:{version:"4",type:"ENCRYPTED"},dekInfo:{algorithm:s,parameters:n.util.bytesToHex(u).toUpperCase()},body:h.output.getBytes()};return n.pem.encode(d)},a.decryptRsaPrivateKey=function(e,t){var r=null,i=n.pem.decode(e)[0];if("ENCRYPTED PRIVATE KEY"!==i.type&&"PRIVATE KEY"!==i.type&&"RSA PRIVATE KEY"!==i.type)throw(c=new Error('Could not convert private key from PEM; PEM header type is not "ENCRYPTED PRIVATE KEY", "PRIVATE KEY", or "RSA PRIVATE KEY".')).headerType=c,c;if(i.procType&&"ENCRYPTED"===i.procType.type){var s,u;switch(i.dekInfo.algorithm){case"DES-CBC":s=8,u=n.des.createDecryptionCipher;break;case"DES-EDE3-CBC":s=24,u=n.des.createDecryptionCipher;break;case"AES-128-CBC":s=16,u=n.aes.createDecryptionCipher;break;case"AES-192-CBC":s=24,u=n.aes.createDecryptionCipher;break;case"AES-256-CBC":s=32,u=n.aes.createDecryptionCipher;break;case"RC2-40-CBC":s=5,u=function(e){return n.rc2.createDecryptionCipher(e,40)};break;case"RC2-64-CBC":s=8,u=function(e){return n.rc2.createDecryptionCipher(e,64)};break;case"RC2-128-CBC":s=16,u=function(e){return n.rc2.createDecryptionCipher(e,128)};break;default:var c;throw(c=new Error('Could not decrypt private key; unsupported encryption algorithm "'+i.dekInfo.algorithm+'".')).algorithm=i.dekInfo.algorithm,c}var l=n.util.hexToBytes(i.dekInfo.parameters),f=u(n.pbe.opensslDeriveBytes(t,l.substr(0,8),s));if(f.start(l),f.update(n.util.createBuffer(i.body)),!f.finish())return r;r=f.output.getBytes()}else r=i.body;return null!==(r="ENCRYPTED PRIVATE KEY"===i.type?a.decryptPrivateKeyInfo(o.fromDer(r),t):o.fromDer(r))&&(r=a.privateKeyFromAsn1(r)),r},a.pbe.generatePkcs12Key=function(e,t,r,i,o,a){var s,u;if("undefined"===typeof a||null===a){if(!("sha1"in n.md))throw new Error('"sha1" hash algorithm unavailable.');a=n.md.sha1.create()}var c=a.digestLength,l=a.blockLength,f=new n.util.ByteBuffer,h=new n.util.ByteBuffer;if(null!==e&&void 0!==e){for(u=0;u<e.length;u++)h.putInt16(e.charCodeAt(u));h.putInt16(0)}var d=h.length(),p=t.length(),v=new n.util.ByteBuffer;v.fillWithByte(r,l);var g=l*Math.ceil(p/l),y=new n.util.ByteBuffer;for(u=0;u<g;u++)y.putByte(t.at(u%p));var m=l*Math.ceil(d/l),b=new n.util.ByteBuffer;for(u=0;u<m;u++)b.putByte(h.at(u%d));var w=y;w.putBuffer(b);for(var k=Math.ceil(o/c),E=1;E<=k;E++){var x=new n.util.ByteBuffer;x.putBytes(v.bytes()),x.putBytes(w.bytes());for(var S=0;S<i;S++)a.start(),a.update(x.getBytes()),x=a.digest();var _=new n.util.ByteBuffer;for(u=0;u<l;u++)_.putByte(x.at(u%c));var A=Math.ceil(p/l)+Math.ceil(d/l),I=new n.util.ByteBuffer;for(s=0;s<A;s++){var C=new n.util.ByteBuffer(w.getBytes(l)),T=511;for(u=_.length()-1;u>=0;u--)T>>=8,T+=_.at(u)+C.at(u),C.setAt(u,255&T);I.putBuffer(C)}w=I,f.putBuffer(x)}return f.truncate(f.length()-o),f},a.pbe.getCipher=function(e,t,r){switch(e){case a.oids.pkcs5PBES2:return a.pbe.getCipherForPBES2(e,t,r);case a.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:case a.oids["pbewithSHAAnd40BitRC2-CBC"]:return a.pbe.getCipherForPKCS12PBE(e,t,r);default:var n=new Error("Cannot read encrypted PBE data block. Unsupported OID.");throw n.oid=e,n.supportedOids=["pkcs5PBES2","pbeWithSHAAnd3-KeyTripleDES-CBC","pbewithSHAAnd40BitRC2-CBC"],n}},a.pbe.getCipherForPBES2=function(e,t,r){var i,s={},u=[];if(!o.validate(t,c,s,u))throw(i=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.")).errors=u,i;if((e=o.derToOid(s.kdfOid))!==a.oids.pkcs5PBKDF2)throw(i=new Error("Cannot read encrypted private key. Unsupported key derivation function OID.")).oid=e,i.supportedOids=["pkcs5PBKDF2"],i;if((e=o.derToOid(s.encOid))!==a.oids["aes128-CBC"]&&e!==a.oids["aes192-CBC"]&&e!==a.oids["aes256-CBC"]&&e!==a.oids["des-EDE3-CBC"]&&e!==a.oids.desCBC)throw(i=new Error("Cannot read encrypted private key. Unsupported encryption scheme OID.")).oid=e,i.supportedOids=["aes128-CBC","aes192-CBC","aes256-CBC","des-EDE3-CBC","desCBC"],i;var l,f,d=s.kdfSalt,p=n.util.createBuffer(s.kdfIterationCount);switch(p=p.getInt(p.length()<<3),a.oids[e]){case"aes128-CBC":l=16,f=n.aes.createDecryptionCipher;break;case"aes192-CBC":l=24,f=n.aes.createDecryptionCipher;break;case"aes256-CBC":l=32,f=n.aes.createDecryptionCipher;break;case"des-EDE3-CBC":l=24,f=n.des.createDecryptionCipher;break;case"desCBC":l=8,f=n.des.createDecryptionCipher}var v=h(s.prfOid),g=n.pkcs5.pbkdf2(r,d,p,l,v),y=s.encIv,m=f(g);return m.start(y),m},a.pbe.getCipherForPKCS12PBE=function(e,t,r){var i={},s=[];if(!o.validate(t,l,i,s))throw(v=new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.")).errors=s,v;var u,c,f,d=n.util.createBuffer(i.salt),p=n.util.createBuffer(i.iterations);switch(p=p.getInt(p.length()<<3),e){case a.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:u=24,c=8,f=n.des.startDecrypting;break;case a.oids["pbewithSHAAnd40BitRC2-CBC"]:u=5,c=8,f=function(e,t){var r=n.rc2.createDecryptionCipher(e,40);return r.start(t,null),r};break;default:var v;throw(v=new Error("Cannot read PKCS #12 PBE data block. Unsupported OID.")).oid=e,v}var g=h(i.prfOid),y=a.pbe.generatePkcs12Key(r,d,1,p,u,g);return g.start(),f(y,a.pbe.generatePkcs12Key(r,d,2,p,c,g))},a.pbe.opensslDeriveBytes=function(e,t,r,i){if("undefined"===typeof i||null===i){if(!("md5"in n.md))throw new Error('"md5" hash algorithm unavailable.');i=n.md.md5.create()}null===t&&(t="");for(var o=[f(i,e+t)],a=16,s=1;a<r;++s,a+=16)o.push(f(i,o[s-1]+e+t));return o.join("").substr(0,r)}},3611:function(e,t,r){var n=r(3299);r(2589),r(4744),r(9327);var i,o=n.pkcs5=n.pkcs5||{};n.util.isNodejs&&!n.options.usePureJavaScript&&(i=r(9437)),e.exports=n.pbkdf2=o.pbkdf2=function(e,t,r,o,a,s){if("function"===typeof a&&(s=a,a=null),n.util.isNodejs&&!n.options.usePureJavaScript&&i.pbkdf2&&(null===a||"object"!==typeof a)&&(i.pbkdf2Sync.length>4||!a||"sha1"===a))return"string"!==typeof a&&(a="sha1"),e=Buffer.from(e,"binary"),t=Buffer.from(t,"binary"),s?4===i.pbkdf2Sync.length?i.pbkdf2(e,t,r,o,(function(e,t){if(e)return s(e);s(null,t.toString("binary"))})):i.pbkdf2(e,t,r,o,a,(function(e,t){if(e)return s(e);s(null,t.toString("binary"))})):4===i.pbkdf2Sync.length?i.pbkdf2Sync(e,t,r,o).toString("binary"):i.pbkdf2Sync(e,t,r,o,a).toString("binary");if("undefined"!==typeof a&&null!==a||(a="sha1"),"string"===typeof a){if(!(a in n.md.algorithms))throw new Error("Unknown hash algorithm: "+a);a=n.md[a].create()}var u=a.digestLength;if(o>4294967295*u){var c=new Error("Derived key is too long.");if(s)return s(c);throw c}var l=Math.ceil(o/u),f=o-(l-1)*u,h=n.hmac.create();h.start(a,e);var d,p,v,g="";if(!s){for(var y=1;y<=l;++y){h.start(null,null),h.update(t),h.update(n.util.int32ToBytes(y)),d=v=h.digest().getBytes();for(var m=2;m<=r;++m)h.start(null,null),h.update(v),p=h.digest().getBytes(),d=n.util.xorBytes(d,p,u),v=p;g+=y<l?d:d.substr(0,f)}return g}y=1;function b(){if(y>l)return s(null,g);h.start(null,null),h.update(t),h.update(n.util.int32ToBytes(y)),d=v=h.digest().getBytes(),m=2,w()}function w(){if(m<=r)return h.start(null,null),h.update(v),p=h.digest().getBytes(),d=n.util.xorBytes(d,p,u),v=p,++m,n.util.setImmediate(w);g+=y<l?d:d.substr(0,f),++y,b()}b()}},1919:function(e,t,r){var n=r(3299);r(9327);var i=e.exports=n.pem=n.pem||{};function o(e){for(var t=e.name+": ",r=[],n=function(e,t){return" "+t},i=0;i<e.values.length;++i)r.push(e.values[i].replace(/^(\S+\r\n)/,n));t+=r.join(",")+"\r\n";var o=0,a=-1;for(i=0;i<t.length;++i,++o)if(o>65&&-1!==a){var s=t[a];","===s?(++a,t=t.substr(0,a)+"\r\n "+t.substr(a)):t=t.substr(0,a)+"\r\n"+s+t.substr(a+1),o=i-a-1,a=-1,++i}else" "!==t[i]&&"\t"!==t[i]&&","!==t[i]||(a=i);return t}function a(e){return e.replace(/^\s+/,"")}i.encode=function(e,t){t=t||{};var r,i="-----BEGIN "+e.type+"-----\r\n";if(e.procType&&(i+=o(r={name:"Proc-Type",values:[String(e.procType.version),e.procType.type]})),e.contentDomain&&(i+=o(r={name:"Content-Domain",values:[e.contentDomain]})),e.dekInfo&&(r={name:"DEK-Info",values:[e.dekInfo.algorithm]},e.dekInfo.parameters&&r.values.push(e.dekInfo.parameters),i+=o(r)),e.headers)for(var a=0;a<e.headers.length;++a)i+=o(e.headers[a]);return e.procType&&(i+="\r\n"),i+=n.util.encode64(e.body,t.maxline||64)+"\r\n",i+="-----END "+e.type+"-----\r\n"},i.decode=function(e){for(var t,r=[],i=/\s*-----BEGIN ([A-Z0-9- ]+)-----\r?\n?([\x21-\x7e\s]+?(?:\r?\n\r?\n))?([:A-Za-z0-9+\/=\s]+?)-----END \1-----/g,o=/([\x21-\x7e]+):\s*([\x21-\x7e\s^:]+)/,s=/\r?\n/;t=i.exec(e);){var u=t[1];"NEW CERTIFICATE REQUEST"===u&&(u="CERTIFICATE REQUEST");var c={type:u,procType:null,contentDomain:null,dekInfo:null,headers:[],body:n.util.decode64(t[3])};if(r.push(c),t[2]){for(var l=t[2].split(s),f=0;t&&f<l.length;){for(var h=l[f].replace(/\s+$/,""),d=f+1;d<l.length;++d){var p=l[d];if(!/\s/.test(p[0]))break;h+=p,f=d}if(t=h.match(o)){for(var v={name:t[1],values:[]},g=t[2].split(","),y=0;y<g.length;++y)v.values.push(a(g[y]));if(c.procType)if(c.contentDomain||"Content-Domain"!==v.name)if(c.dekInfo||"DEK-Info"!==v.name)c.headers.push(v);else{if(0===v.values.length)throw new Error('Invalid PEM formatted message. The "DEK-Info" header must have at least one subfield.');c.dekInfo={algorithm:g[0],parameters:g[1]||null}}else c.contentDomain=g[0]||"";else{if("Proc-Type"!==v.name)throw new Error('Invalid PEM formatted message. The first encapsulated header must be "Proc-Type".');if(2!==v.values.length)throw new Error('Invalid PEM formatted message. The "Proc-Type" header must have two subfields.');c.procType={version:g[0],type:g[1]}}}++f}if("ENCRYPTED"===c.procType&&!c.dekInfo)throw new Error('Invalid PEM formatted message. The "DEK-Info" header must be present if "Proc-Type" is "ENCRYPTED".')}}if(0===r.length)throw new Error("Invalid PEM formatted message.");return r}},236:function(e,t,r){var n=r(3299);r(9327),r(8217),r(5458);var i=e.exports=n.pkcs1=n.pkcs1||{};function o(e,t,r){r||(r=n.md.sha1.create());for(var i="",o=Math.ceil(t/r.digestLength),a=0;a<o;++a){var s=String.fromCharCode(a>>24&255,a>>16&255,a>>8&255,255&a);r.start(),r.update(e+s),i+=r.digest().getBytes()}return i.substring(0,t)}i.encode_rsa_oaep=function(e,t,r){var i,a,s,u;"string"===typeof r?(i=r,a=arguments[3]||void 0,s=arguments[4]||void 0):r&&(i=r.label||void 0,a=r.seed||void 0,s=r.md||void 0,r.mgf1&&r.mgf1.md&&(u=r.mgf1.md)),s?s.start():s=n.md.sha1.create(),u||(u=s);var c=Math.ceil(e.n.bitLength()/8),l=c-2*s.digestLength-2;if(t.length>l)throw(g=new Error("RSAES-OAEP input message length is too long.")).length=t.length,g.maxLength=l,g;i||(i=""),s.update(i,"raw");for(var f=s.digest(),h="",d=l-t.length,p=0;p<d;p++)h+="\0";var v=f.getBytes()+h+"\x01"+t;if(a){if(a.length!==s.digestLength){var g;throw(g=new Error("Invalid RSAES-OAEP seed. The seed length must match the digest length.")).seedLength=a.length,g.digestLength=s.digestLength,g}}else a=n.random.getBytes(s.digestLength);var y=o(a,c-s.digestLength-1,u),m=n.util.xorBytes(v,y,v.length),b=o(m,s.digestLength,u),w=n.util.xorBytes(a,b,a.length);return"\0"+w+m},i.decode_rsa_oaep=function(e,t,r){var i,a,s;"string"===typeof r?(i=r,a=arguments[3]||void 0):r&&(i=r.label||void 0,a=r.md||void 0,r.mgf1&&r.mgf1.md&&(s=r.mgf1.md));var u=Math.ceil(e.n.bitLength()/8);if(t.length!==u)throw(m=new Error("RSAES-OAEP encoded message length is invalid.")).length=t.length,m.expectedLength=u,m;if(void 0===a?a=n.md.sha1.create():a.start(),s||(s=a),u<2*a.digestLength+2)throw new Error("RSAES-OAEP key is too short for the hash function.");i||(i=""),a.update(i,"raw");for(var c=a.digest().getBytes(),l=t.charAt(0),f=t.substring(1,a.digestLength+1),h=t.substring(1+a.digestLength),d=o(h,a.digestLength,s),p=n.util.xorBytes(f,d,f.length),v=o(p,u-a.digestLength-1,s),g=n.util.xorBytes(h,v,h.length),y=g.substring(0,a.digestLength),m="\0"!==l,b=0;b<a.digestLength;++b)m|=c.charAt(b)!==y.charAt(b);for(var w=1,k=a.digestLength,E=a.digestLength;E<g.length;E++){var x=g.charCodeAt(E),S=1&x^1,_=w?65534:0;m|=x&_,k+=w&=S}if(m||1!==g.charCodeAt(k))throw new Error("Invalid RSAES-OAEP padding.");return g.substring(k+1)}},869:function(e,t,r){var n=r(3299);r(9327),r(8580),r(8217),function(){if(n.prime)e.exports=n.prime;else{var t=e.exports=n.prime=n.prime||{},r=n.jsbn.BigInteger,i=[6,4,2,4,2,4,6,2],o=new r(null);o.fromInt(30);var a=function(e,t){return e|t};t.generateProbablePrime=function(e,t,i){"function"===typeof t&&(i=t,t={});var o=(t=t||{}).algorithm||"PRIMEINC";"string"===typeof o&&(o={name:o}),o.options=o.options||{};var a=t.prng||n.random,u={nextBytes:function(e){for(var t=a.getBytesSync(e.length),r=0;r<e.length;++r)e[r]=t.charCodeAt(r)}};if("PRIMEINC"===o.name)return function(e,t,i,o){if("workers"in i)return function(e,t,i,o){if("undefined"===typeof Worker)return s(e,t,i,o);var a=c(e,t),u=i.workers,l=i.workLoad||100,f=30*l/8,h=i.workerScript||"forge/prime.worker.js";if(-1===u)return n.util.estimateCores((function(e,t){e&&(t=2),u=t-1,d()}));function d(){u=Math.max(1,u);for(var n=[],i=0;i<u;++i)n[i]=new Worker(h);for(i=0;i<u;++i)n[i].addEventListener("message",d);var s=!1;function d(i){if(!s){0;var u=i.data;if(u.found){for(var h=0;h<n.length;++h)n[h].terminate();return s=!0,o(null,new r(u.prime,16))}a.bitLength()>e&&(a=c(e,t));var d=a.toString(16);i.target.postMessage({hex:d,workLoad:l}),a.dAddOffset(f,0)}}}d()}(e,t,i,o);return s(e,t,i,o)}(e,u,o.options,i);throw new Error("Invalid prime generation algorithm: "+o.name)}}function s(e,t,r,n){var i=c(e,t),o=function(e){return e<=100?27:e<=150?18:e<=200?15:e<=250?12:e<=300?9:e<=350?8:e<=400?7:e<=500?6:e<=600?5:e<=800?4:e<=1250?3:2}(i.bitLength());"millerRabinTests"in r&&(o=r.millerRabinTests);var a=10;"maxBlockTime"in r&&(a=r.maxBlockTime),u(i,e,t,0,o,a,n)}function u(e,t,r,o,a,s,l){var f=+new Date;do{if(e.bitLength()>t&&(e=c(t,r)),e.isProbablePrime(a))return l(null,e);e.dAddOffset(i[o++%8],0)}while(s<0||+new Date-f<s);n.util.setImmediate((function(){u(e,t,r,o,a,s,l)}))}function c(e,t){var n=new r(e,t),i=e-1;return n.testBit(i)||n.bitwiseTo(r.ONE.shiftLeft(i),a,n),n.dAddOffset(31-n.mod(o).byteValue(),0),n}}()},6422:function(e,t,r){var n=r(3299);r(9327);var i=null;!n.util.isNodejs||n.options.usePureJavaScript||process.versions["node-webkit"]||(i=r(9437)),(e.exports=n.prng=n.prng||{}).create=function(e){for(var t={plugin:e,key:null,seed:null,time:null,reseeds:0,generated:0,keyBytes:""},r=e.md,o=new Array(32),a=0;a<32;++a)o[a]=r.create();function s(){if(t.pools[0].messageLength>=32)return u();var e=32-t.pools[0].messageLength<<5;t.collect(t.seedFileSync(e)),u()}function u(){t.reseeds=4294967295===t.reseeds?0:t.reseeds+1;var e=t.plugin.md.create();e.update(t.keyBytes);for(var r=1,n=0;n<32;++n)t.reseeds%r===0&&(e.update(t.pools[n].digest().getBytes()),t.pools[n].start()),r<<=1;t.keyBytes=e.digest().getBytes(),e.start(),e.update(t.keyBytes);var i=e.digest().getBytes();t.key=t.plugin.formatKey(t.keyBytes),t.seed=t.plugin.formatSeed(i),t.generated=0}function c(e){var t=null,r=n.util.globalScope,i=r.crypto||r.msCrypto;i&&i.getRandomValues&&(t=function(e){return i.getRandomValues(e)});var o=n.util.createBuffer();if(t)for(;o.length()<e;){var a=Math.max(1,Math.min(e-o.length(),65536)/4),s=new Uint32Array(Math.floor(a));try{t(s);for(var u=0;u<s.length;++u)o.putInt32(s[u])}catch(d){if(!("undefined"!==typeof QuotaExceededError&&d instanceof QuotaExceededError))throw d}}if(o.length()<e)for(var c,l,f,h=Math.floor(65536*Math.random());o.length()<e;){l=16807*(65535&h),l+=(32767&(c=16807*(h>>16)))<<16,h=4294967295&(l=(2147483647&(l+=c>>15))+(l>>31));for(u=0;u<3;++u)f=h>>>(u<<3),f^=Math.floor(256*Math.random()),o.putByte(255&f)}return o.getBytes(e)}return t.pools=o,t.pool=0,t.generate=function(e,r){if(!r)return t.generateSync(e);var i=t.plugin.cipher,o=t.plugin.increment,a=t.plugin.formatKey,s=t.plugin.formatSeed,c=n.util.createBuffer();t.key=null,function l(f){if(f)return r(f);if(c.length()>=e)return r(null,c.getBytes(e));t.generated>1048575&&(t.key=null);if(null===t.key)return n.util.nextTick((function(){!function(e){if(t.pools[0].messageLength>=32)return u(),e();var r=32-t.pools[0].messageLength<<5;t.seedFile(r,(function(r,n){if(r)return e(r);t.collect(n),u(),e()}))}(l)}));var h=i(t.key,t.seed);t.generated+=h.length,c.putBytes(h),t.key=a(i(t.key,o(t.seed))),t.seed=s(i(t.key,t.seed)),n.util.setImmediate(l)}()},t.generateSync=function(e){var r=t.plugin.cipher,i=t.plugin.increment,o=t.plugin.formatKey,a=t.plugin.formatSeed;t.key=null;for(var u=n.util.createBuffer();u.length()<e;){t.generated>1048575&&(t.key=null),null===t.key&&s();var c=r(t.key,t.seed);t.generated+=c.length,u.putBytes(c),t.key=o(r(t.key,i(t.seed))),t.seed=a(r(t.key,t.seed))}return u.getBytes(e)},i?(t.seedFile=function(e,t){i.randomBytes(e,(function(e,r){if(e)return t(e);t(null,r.toString())}))},t.seedFileSync=function(e){return i.randomBytes(e).toString()}):(t.seedFile=function(e,t){try{t(null,c(e))}catch(r){t(r)}},t.seedFileSync=c),t.collect=function(e){for(var r=e.length,n=0;n<r;++n)t.pools[t.pool].update(e.substr(n,1)),t.pool=31===t.pool?0:t.pool+1},t.collectInt=function(e,r){for(var n="",i=0;i<r;i+=8)n+=String.fromCharCode(e>>i&255);t.collect(n)},t.registerWorker=function(e){if(e===self)t.seedFile=function(e,t){self.addEventListener("message",(function e(r){var n=r.data;n.forge&&n.forge.prng&&(self.removeEventListener("message",e),t(n.forge.prng.err,n.forge.prng.bytes))})),self.postMessage({forge:{prng:{needed:e}}})};else{e.addEventListener("message",(function(r){var n=r.data;n.forge&&n.forge.prng&&t.seedFile(n.forge.prng.needed,(function(t,r){e.postMessage({forge:{prng:{err:t,bytes:r}}})}))}))}},t}},8217:function(e,t,r){var n=r(3299);r(9521),r(8282),r(6422),r(9327),n.random&&n.random.getBytes?e.exports=n.random:function(t){var r={},i=new Array(4),o=n.util.createBuffer();function a(){var e=n.prng.create(r);return e.getBytes=function(t,r){return e.generate(t,r)},e.getBytesSync=function(t){return e.generate(t)},e}r.formatKey=function(e){var t=n.util.createBuffer(e);return(e=new Array(4))[0]=t.getInt32(),e[1]=t.getInt32(),e[2]=t.getInt32(),e[3]=t.getInt32(),n.aes._expandKey(e,!1)},r.formatSeed=function(e){var t=n.util.createBuffer(e);return(e=new Array(4))[0]=t.getInt32(),e[1]=t.getInt32(),e[2]=t.getInt32(),e[3]=t.getInt32(),e},r.cipher=function(e,t){return n.aes._updateBlock(e,t,i,!1),o.putInt32(i[0]),o.putInt32(i[1]),o.putInt32(i[2]),o.putInt32(i[3]),o.getBytes()},r.increment=function(e){return++e[3],e},r.md=n.md.sha256;var s=a(),u=null,c=n.util.globalScope,l=c.crypto||c.msCrypto;if(l&&l.getRandomValues&&(u=function(e){return l.getRandomValues(e)}),n.options.usePureJavaScript||!n.util.isNodejs&&!u){if("undefined"===typeof window||window.document,s.collectInt(+new Date,32),"undefined"!==typeof navigator){var f="";for(var h in navigator)try{"string"==typeof navigator[h]&&(f+=navigator[h])}catch(d){}s.collect(f),f=null}t&&(t().mousemove((function(e){s.collectInt(e.clientX,16),s.collectInt(e.clientY,16)})),t().keypress((function(e){s.collectInt(e.charCode,8)})))}if(n.random)for(var h in s)n.random[h]=s[h];else n.random=s;n.random.createInstance=a,e.exports=n.random}("undefined"!==typeof jQuery?jQuery:null)},9932:function(e,t,r){var n=r(3299);r(9327);var i=[217,120,249,196,25,221,181,237,40,233,253,121,74,160,216,157,198,126,55,131,43,118,83,142,98,76,100,136,68,139,251,162,23,154,89,245,135,179,79,19,97,69,109,141,9,129,125,50,189,143,64,235,134,183,123,11,240,149,33,34,92,107,78,130,84,214,101,147,206,96,178,28,115,86,192,20,167,140,241,220,18,117,202,31,59,190,228,209,66,61,212,48,163,60,182,38,111,191,14,218,70,105,7,87,39,242,29,155,188,148,67,3,248,17,199,246,144,239,62,231,6,195,213,47,200,102,30,215,8,232,234,222,128,82,238,247,132,170,114,172,53,77,106,42,150,26,210,113,90,21,73,116,75,159,208,94,4,24,164,236,194,224,65,110,15,81,203,204,36,145,175,80,161,244,112,57,153,124,58,133,35,184,180,122,252,2,54,91,37,85,151,49,45,93,250,152,227,138,146,174,5,223,41,16,103,108,186,201,211,0,230,207,225,158,168,44,99,22,1,63,88,226,137,169,13,56,52,27,171,51,255,176,187,72,12,95,185,177,205,46,197,243,219,71,229,165,156,119,10,166,32,104,254,127,193,173],o=[1,2,3,5],a=function(e,t){return e<<t&65535|(65535&e)>>16-t},s=function(e,t){return(65535&e)>>t|e<<16-t&65535};e.exports=n.rc2=n.rc2||{},n.rc2.expandKey=function(e,t){"string"===typeof e&&(e=n.util.createBuffer(e)),t=t||128;var r,o=e,a=e.length(),s=t,u=Math.ceil(s/8),c=255>>(7&s);for(r=a;r<128;r++)o.putByte(i[o.at(r-1)+o.at(r-a)&255]);for(o.setAt(128-u,i[o.at(128-u)&c]),r=127-u;r>=0;r--)o.setAt(r,i[o.at(r+1)^o.at(r+u)]);return o};var u=function(e,t,r){var i,u,c,l,f=!1,h=null,d=null,p=null,v=[];for(e=n.rc2.expandKey(e,t),c=0;c<64;c++)v.push(e.getInt16Le());r?(i=function(e){for(c=0;c<4;c++)e[c]+=v[l]+(e[(c+3)%4]&e[(c+2)%4])+(~e[(c+3)%4]&e[(c+1)%4]),e[c]=a(e[c],o[c]),l++},u=function(e){for(c=0;c<4;c++)e[c]+=v[63&e[(c+3)%4]]}):(i=function(e){for(c=3;c>=0;c--)e[c]=s(e[c],o[c]),e[c]-=v[l]+(e[(c+3)%4]&e[(c+2)%4])+(~e[(c+3)%4]&e[(c+1)%4]),l--},u=function(e){for(c=3;c>=0;c--)e[c]-=v[63&e[(c+3)%4]]});var g=function(e){var t=[];for(c=0;c<4;c++){var n=h.getInt16Le();null!==p&&(r?n^=p.getInt16Le():p.putInt16Le(n)),t.push(65535&n)}l=r?0:63;for(var i=0;i<e.length;i++)for(var o=0;o<e[i][0];o++)e[i][1](t);for(c=0;c<4;c++)null!==p&&(r?p.putInt16Le(t[c]):t[c]^=p.getInt16Le()),d.putInt16Le(t[c])},y=null;return y={start:function(e,t){e&&"string"===typeof e&&(e=n.util.createBuffer(e)),f=!1,h=n.util.createBuffer(),d=t||new n.util.createBuffer,p=e,y.output=d},update:function(e){for(f||h.putBuffer(e);h.length()>=8;)g([[5,i],[1,u],[6,i],[1,u],[5,i]])},finish:function(e){var t=!0;if(r)if(e)t=e(8,h,!r);else{var n=8===h.length()?8:8-h.length();h.fillWithByte(n,n)}if(t&&(f=!0,y.update()),!r&&(t=0===h.length()))if(e)t=e(8,d,!r);else{var i=d.length(),o=d.at(i-1);o>i?t=!1:d.truncate(o)}return t}}};n.rc2.startEncrypting=function(e,t,r){var i=n.rc2.createEncryptionCipher(e,128);return i.start(t,r),i},n.rc2.createEncryptionCipher=function(e,t){return u(e,t,!0)},n.rc2.startDecrypting=function(e,t,r){var i=n.rc2.createDecryptionCipher(e,128);return i.start(t,r),i},n.rc2.createDecryptionCipher=function(e,t){return u(e,t,!1)}},4199:function(e,t,r){var n=r(3299);if(r(5406),r(8580),r(2458),r(236),r(869),r(8217),r(9327),"undefined"===typeof i)var i=n.jsbn.BigInteger;var o=n.util.isNodejs?r(9437):null,a=n.asn1,s=n.util;n.pki=n.pki||{},e.exports=n.pki.rsa=n.rsa=n.rsa||{};var u=n.pki,c=[6,4,2,4,2,4,6,2],l={name:"PrivateKeyInfo",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"PrivateKeyInfo.version",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"PrivateKeyInfo.privateKeyAlgorithm",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:a.Class.UNIVERSAL,type:a.Type.OID,constructed:!1,capture:"privateKeyOid"}]},{name:"PrivateKeyInfo",tagClass:a.Class.UNIVERSAL,type:a.Type.OCTETSTRING,constructed:!1,capture:"privateKey"}]},f={name:"RSAPrivateKey",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPrivateKey.version",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyVersion"},{name:"RSAPrivateKey.modulus",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyModulus"},{name:"RSAPrivateKey.publicExponent",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyPublicExponent"},{name:"RSAPrivateKey.privateExponent",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyPrivateExponent"},{name:"RSAPrivateKey.prime1",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyPrime1"},{name:"RSAPrivateKey.prime2",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyPrime2"},{name:"RSAPrivateKey.exponent1",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyExponent1"},{name:"RSAPrivateKey.exponent2",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyExponent2"},{name:"RSAPrivateKey.coefficient",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"privateKeyCoefficient"}]},h={name:"RSAPublicKey",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"RSAPublicKey.modulus",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"publicKeyModulus"},{name:"RSAPublicKey.exponent",tagClass:a.Class.UNIVERSAL,type:a.Type.INTEGER,constructed:!1,capture:"publicKeyExponent"}]},d=n.pki.rsa.publicKeyValidator={name:"SubjectPublicKeyInfo",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,captureAsn1:"subjectPublicKeyInfo",value:[{name:"SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"AlgorithmIdentifier.algorithm",tagClass:a.Class.UNIVERSAL,type:a.Type.OID,constructed:!1,capture:"publicKeyOid"}]},{name:"SubjectPublicKeyInfo.subjectPublicKey",tagClass:a.Class.UNIVERSAL,type:a.Type.BITSTRING,constructed:!1,value:[{name:"SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,optional:!0,captureAsn1:"rsaPublicKey"}]}]},p={name:"DigestInfo",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm",tagClass:a.Class.UNIVERSAL,type:a.Type.SEQUENCE,constructed:!0,value:[{name:"DigestInfo.DigestAlgorithm.algorithmIdentifier",tagClass:a.Class.UNIVERSAL,type:a.Type.OID,constructed:!1,capture:"algorithmIdentifier"},{name:"DigestInfo.DigestAlgorithm.parameters",tagClass:a.Class.UNIVERSAL,type:a.Type.NULL,capture:"parameters",optional:!0,constructed:!1}]},{name:"DigestInfo.digest",tagClass:a.Class.UNIVERSAL,type:a.Type.OCTETSTRING,constructed:!1,capture:"digest"}]},v=function(e){var t;if(!(e.algorithm in u.oids)){var r=new Error("Unknown message digest algorithm.");throw r.algorithm=e.algorithm,r}t=u.oids[e.algorithm];var n=a.oidToDer(t).getBytes(),i=a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[]),o=a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[]);o.value.push(a.create(a.Class.UNIVERSAL,a.Type.OID,!1,n)),o.value.push(a.create(a.Class.UNIVERSAL,a.Type.NULL,!1,""));var s=a.create(a.Class.UNIVERSAL,a.Type.OCTETSTRING,!1,e.digest().getBytes());return i.value.push(o),i.value.push(s),a.toDer(i).getBytes()},g=function(e,t,r){if(r)return e.modPow(t.e,t.n);if(!t.p||!t.q)return e.modPow(t.d,t.n);var o;t.dP||(t.dP=t.d.mod(t.p.subtract(i.ONE))),t.dQ||(t.dQ=t.d.mod(t.q.subtract(i.ONE))),t.qInv||(t.qInv=t.q.modInverse(t.p));do{o=new i(n.util.bytesToHex(n.random.getBytes(t.n.bitLength()/8)),16)}while(o.compareTo(t.n)>=0||!o.gcd(t.n).equals(i.ONE));for(var a=(e=e.multiply(o.modPow(t.e,t.n)).mod(t.n)).mod(t.p).modPow(t.dP,t.p),s=e.mod(t.q).modPow(t.dQ,t.q);a.compareTo(s)<0;)a=a.add(t.p);var u=a.subtract(s).multiply(t.qInv).mod(t.p).multiply(t.q).add(s);return u=u.multiply(o.modInverse(t.n)).mod(t.n)};function y(e,t,r){var i=n.util.createBuffer(),o=Math.ceil(t.n.bitLength()/8);if(e.length>o-11){var a=new Error("Message is too long for PKCS#1 v1.5 padding.");throw a.length=e.length,a.max=o-11,a}i.putByte(0),i.putByte(r);var s,u=o-3-e.length;if(0===r||1===r){s=0===r?0:255;for(var c=0;c<u;++c)i.putByte(s)}else for(;u>0;){var l=0,f=n.random.getBytes(u);for(c=0;c<u;++c)0===(s=f.charCodeAt(c))?++l:i.putByte(s);u=l}return i.putByte(0),i.putBytes(e),i}function m(e,t,r,i){var o=Math.ceil(t.n.bitLength()/8),a=n.util.createBuffer(e),s=a.getByte(),u=a.getByte();if(0!==s||r&&0!==u&&1!==u||!r&&2!=u||r&&0===u&&"undefined"===typeof i)throw new Error("Encryption block is invalid.");var c=0;if(0===u){c=o-3-i;for(var l=0;l<c;++l)if(0!==a.getByte())throw new Error("Encryption block is invalid.")}else if(1===u)for(c=0;a.length()>1;){if(255!==a.getByte()){--a.read;break}++c}else if(2===u)for(c=0;a.length()>1;){if(0===a.getByte()){--a.read;break}++c}if(0!==a.getByte()||c!==o-3-a.length())throw new Error("Encryption block is invalid.");return a.getBytes()}function b(e,t,r){"function"===typeof t&&(r=t,t={});var o={algorithm:{name:(t=t||{}).algorithm||"PRIMEINC",options:{workers:t.workers||2,workLoad:t.workLoad||100,workerScript:t.workerScript}}};function a(){s(e.pBits,(function(t,n){return t?r(t):(e.p=n,null!==e.q?c(t,e.q):void s(e.qBits,c))}))}function s(e,t){n.prime.generateProbablePrime(e,o,t)}function c(t,n){if(t)return r(t);if(e.q=n,e.p.compareTo(e.q)<0){var o=e.p;e.p=e.q,e.q=o}if(0!==e.p.subtract(i.ONE).gcd(e.e).compareTo(i.ONE))return e.p=null,void a();if(0!==e.q.subtract(i.ONE).gcd(e.e).compareTo(i.ONE))return e.q=null,void s(e.qBits,c);if(e.p1=e.p.subtract(i.ONE),e.q1=e.q.subtract(i.ONE),e.phi=e.p1.multiply(e.q1),0!==e.phi.gcd(e.e).compareTo(i.ONE))return e.p=e.q=null,void a();if(e.n=e.p.multiply(e.q),e.n.bitLength()!==e.bits)return e.q=null,void s(e.qBits,c);var l=e.e.modInverse(e.phi);e.keys={privateKey:u.rsa.setPrivateKey(e.n,e.e,l,e.p,e.q,l.mod(e.p1),l.mod(e.q1),e.q.modInverse(e.p)),publicKey:u.rsa.setPublicKey(e.n,e.e)},r(null,e.keys)}"prng"in t&&(o.prng=t.prng),a()}function w(e){var t=e.toString(16);t[0]>="8"&&(t="00"+t);var r=n.util.hexToBytes(t);return r.length>1&&(0===r.charCodeAt(0)&&0===(128&r.charCodeAt(1))||255===r.charCodeAt(0)&&128===(128&r.charCodeAt(1)))?r.substr(1):r}function k(e){return e<=100?27:e<=150?18:e<=200?15:e<=250?12:e<=300?9:e<=350?8:e<=400?7:e<=500?6:e<=600?5:e<=800?4:e<=1250?3:2}function E(e){return n.util.isNodejs&&"function"===typeof o[e]}function x(e){return"undefined"!==typeof s.globalScope&&"object"===typeof s.globalScope.crypto&&"object"===typeof s.globalScope.crypto.subtle&&"function"===typeof s.globalScope.crypto.subtle[e]}function S(e){return"undefined"!==typeof s.globalScope&&"object"===typeof s.globalScope.msCrypto&&"object"===typeof s.globalScope.msCrypto.subtle&&"function"===typeof s.globalScope.msCrypto.subtle[e]}function _(e){for(var t=n.util.hexToBytes(e.toString(16)),r=new Uint8Array(t.length),i=0;i<t.length;++i)r[i]=t.charCodeAt(i);return r}u.rsa.encrypt=function(e,t,r){var o,a=r,s=Math.ceil(t.n.bitLength()/8);!1!==r&&!0!==r?(a=2===r,o=y(e,t,r)):(o=n.util.createBuffer()).putBytes(e);for(var u=new i(o.toHex(),16),c=g(u,t,a).toString(16),l=n.util.createBuffer(),f=s-Math.ceil(c.length/2);f>0;)l.putByte(0),--f;return l.putBytes(n.util.hexToBytes(c)),l.getBytes()},u.rsa.decrypt=function(e,t,r,o){var a=Math.ceil(t.n.bitLength()/8);if(e.length!==a){var s=new Error("Encrypted message length is invalid.");throw s.length=e.length,s.expected=a,s}var u=new i(n.util.createBuffer(e).toHex(),16);if(u.compareTo(t.n)>=0)throw new Error("Encrypted message is invalid.");for(var c=g(u,t,r).toString(16),l=n.util.createBuffer(),f=a-Math.ceil(c.length/2);f>0;)l.putByte(0),--f;return l.putBytes(n.util.hexToBytes(c)),!1!==o?m(l.getBytes(),t,r):l.getBytes()},u.rsa.createKeyPairGenerationState=function(e,t,r){"string"===typeof e&&(e=parseInt(e,10)),e=e||2048;var o,a=(r=r||{}).prng||n.random,s={nextBytes:function(e){for(var t=a.getBytesSync(e.length),r=0;r<e.length;++r)e[r]=t.charCodeAt(r)}},u=r.algorithm||"PRIMEINC";if("PRIMEINC"!==u)throw new Error("Invalid key generation algorithm: "+u);return(o={algorithm:u,state:0,bits:e,rng:s,eInt:t||65537,e:new i(null),p:null,q:null,qBits:e>>1,pBits:e-(e>>1),pqState:0,num:null,keys:null}).e.fromInt(o.eInt),o},u.rsa.stepKeyPairGenerationState=function(e,t){"algorithm"in e||(e.algorithm="PRIMEINC");var r=new i(null);r.fromInt(30);for(var n,o=0,a=function(e,t){return e|t},s=+new Date,l=0;null===e.keys&&(t<=0||l<t);){if(0===e.state){var f=null===e.p?e.pBits:e.qBits,h=f-1;0===e.pqState?(e.num=new i(f,e.rng),e.num.testBit(h)||e.num.bitwiseTo(i.ONE.shiftLeft(h),a,e.num),e.num.dAddOffset(31-e.num.mod(r).byteValue(),0),o=0,++e.pqState):1===e.pqState?e.num.bitLength()>f?e.pqState=0:e.num.isProbablePrime(k(e.num.bitLength()))?++e.pqState:e.num.dAddOffset(c[o++%8],0):2===e.pqState?e.pqState=0===e.num.subtract(i.ONE).gcd(e.e).compareTo(i.ONE)?3:0:3===e.pqState&&(e.pqState=0,null===e.p?e.p=e.num:e.q=e.num,null!==e.p&&null!==e.q&&++e.state,e.num=null)}else if(1===e.state)e.p.compareTo(e.q)<0&&(e.num=e.p,e.p=e.q,e.q=e.num),++e.state;else if(2===e.state)e.p1=e.p.subtract(i.ONE),e.q1=e.q.subtract(i.ONE),e.phi=e.p1.multiply(e.q1),++e.state;else if(3===e.state)0===e.phi.gcd(e.e).compareTo(i.ONE)?++e.state:(e.p=null,e.q=null,e.state=0);else if(4===e.state)e.n=e.p.multiply(e.q),e.n.bitLength()===e.bits?++e.state:(e.q=null,e.state=0);else if(5===e.state){var d=e.e.modInverse(e.phi);e.keys={privateKey:u.rsa.setPrivateKey(e.n,e.e,d,e.p,e.q,d.mod(e.p1),d.mod(e.q1),e.q.modInverse(e.p)),publicKey:u.rsa.setPublicKey(e.n,e.e)}}l+=(n=+new Date)-s,s=n}return null!==e.keys},u.rsa.generateKeyPair=function(e,t,r,i){if(1===arguments.length?"object"===typeof e?(r=e,e=void 0):"function"===typeof e&&(i=e,e=void 0):2===arguments.length?"number"===typeof e?"function"===typeof t?(i=t,t=void 0):"number"!==typeof t&&(r=t,t=void 0):(r=e,i=t,e=void 0,t=void 0):3===arguments.length&&("number"===typeof t?"function"===typeof r&&(i=r,r=void 0):(i=r,r=t,t=void 0)),r=r||{},void 0===e&&(e=r.bits||2048),void 0===t&&(t=r.e||65537),!n.options.usePureJavaScript&&!r.prng&&e>=256&&e<=16384&&(65537===t||3===t))if(i){if(E("generateKeyPair"))return o.generateKeyPair("rsa",{modulusLength:e,publicExponent:t,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}},(function(e,t,r){if(e)return i(e);i(null,{privateKey:u.privateKeyFromPem(r),publicKey:u.publicKeyFromPem(t)})}));if(x("generateKey")&&x("exportKey"))return s.globalScope.crypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:_(t),hash:{name:"SHA-256"}},!0,["sign","verify"]).then((function(e){return s.globalScope.crypto.subtle.exportKey("pkcs8",e.privateKey)})).then(void 0,(function(e){i(e)})).then((function(e){if(e){var t=u.privateKeyFromAsn1(a.fromDer(n.util.createBuffer(e)));i(null,{privateKey:t,publicKey:u.setRsaPublicKey(t.n,t.e)})}}));if(S("generateKey")&&S("exportKey")){var c=s.globalScope.msCrypto.subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:e,publicExponent:_(t),hash:{name:"SHA-256"}},!0,["sign","verify"]);return c.oncomplete=function(e){var t=e.target.result,r=s.globalScope.msCrypto.subtle.exportKey("pkcs8",t.privateKey);r.oncomplete=function(e){var t=e.target.result,r=u.privateKeyFromAsn1(a.fromDer(n.util.createBuffer(t)));i(null,{privateKey:r,publicKey:u.setRsaPublicKey(r.n,r.e)})},r.onerror=function(e){i(e)}},void(c.onerror=function(e){i(e)})}}else if(E("generateKeyPairSync")){var l=o.generateKeyPairSync("rsa",{modulusLength:e,publicExponent:t,publicKeyEncoding:{type:"spki",format:"pem"},privateKeyEncoding:{type:"pkcs8",format:"pem"}});return{privateKey:u.privateKeyFromPem(l.privateKey),publicKey:u.publicKeyFromPem(l.publicKey)}}var f=u.rsa.createKeyPairGenerationState(e,t,r);if(!i)return u.rsa.stepKeyPairGenerationState(f,0),f.keys;b(f,r,i)},u.setRsaPublicKey=u.rsa.setPublicKey=function(e,t){var r={n:e,e:t,encrypt:function(e,t,i){if("string"===typeof t?t=t.toUpperCase():void 0===t&&(t="RSAES-PKCS1-V1_5"),"RSAES-PKCS1-V1_5"===t)t={encode:function(e,t,r){return y(e,t,2).getBytes()}};else if("RSA-OAEP"===t||"RSAES-OAEP"===t)t={encode:function(e,t){return n.pkcs1.encode_rsa_oaep(t,e,i)}};else if(-1!==["RAW","NONE","NULL",null].indexOf(t))t={encode:function(e){return e}};else if("string"===typeof t)throw new Error('Unsupported encryption scheme: "'+t+'".');var o=t.encode(e,r,!0);return u.rsa.encrypt(o,r,!0)},verify:function(e,t,i,o){"string"===typeof i?i=i.toUpperCase():void 0===i&&(i="RSASSA-PKCS1-V1_5"),void 0===o&&(o={_parseAllDigestBytes:!0}),"_parseAllDigestBytes"in o||(o._parseAllDigestBytes=!0),"RSASSA-PKCS1-V1_5"===i?i={verify:function(e,t){t=m(t,r,!0);var i=a.fromDer(t,{parseAllBytes:o._parseAllDigestBytes}),s={},u=[];if(!a.validate(i,p,s,u))throw(c=new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value.")).errors=u,c;var c,l=a.derToOid(s.algorithmIdentifier);if(l!==n.oids.md2&&l!==n.oids.md5&&l!==n.oids.sha1&&l!==n.oids.sha224&&l!==n.oids.sha256&&l!==n.oids.sha384&&l!==n.oids.sha512&&l!==n.oids["sha512-224"]&&l!==n.oids["sha512-256"])throw(c=new Error("Unknown RSASSA-PKCS1-v1_5 DigestAlgorithm identifier.")).oid=l,c;if((l===n.oids.md2||l===n.oids.md5)&&!("parameters"in s))throw new Error("ASN.1 object does not contain a valid RSASSA-PKCS1-v1_5 DigestInfo value. Missing algorithm identifer NULL parameters.");return e===s.digest}}:"NONE"!==i&&"NULL"!==i&&null!==i||(i={verify:function(e,t){return e===(t=m(t,r,!0))}});var s=u.rsa.decrypt(t,r,!0,!1);return i.verify(e,s,r.n.bitLength())}};return r},u.setRsaPrivateKey=u.rsa.setPrivateKey=function(e,t,r,i,o,a,s,c){var l={n:e,e:t,d:r,p:i,q:o,dP:a,dQ:s,qInv:c,decrypt:function(e,t,r){"string"===typeof t?t=t.toUpperCase():void 0===t&&(t="RSAES-PKCS1-V1_5");var i=u.rsa.decrypt(e,l,!1,!1);if("RSAES-PKCS1-V1_5"===t)t={decode:m};else if("RSA-OAEP"===t||"RSAES-OAEP"===t)t={decode:function(e,t){return n.pkcs1.decode_rsa_oaep(t,e,r)}};else{if(-1===["RAW","NONE","NULL",null].indexOf(t))throw new Error('Unsupported encryption scheme: "'+t+'".');t={decode:function(e){return e}}}return t.decode(i,l,!1)},sign:function(e,t){var r=!1;"string"===typeof t&&(t=t.toUpperCase()),void 0===t||"RSASSA-PKCS1-V1_5"===t?(t={encode:v},r=1):"NONE"!==t&&"NULL"!==t&&null!==t||(t={encode:function(){return e}},r=1);var n=t.encode(e,l.n.bitLength());return u.rsa.encrypt(n,l,r)}};return l},u.wrapRsaPrivateKey=function(e){return a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,a.integerToDer(0).getBytes()),a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(u.oids.rsaEncryption).getBytes()),a.create(a.Class.UNIVERSAL,a.Type.NULL,!1,"")]),a.create(a.Class.UNIVERSAL,a.Type.OCTETSTRING,!1,a.toDer(e).getBytes())])},u.privateKeyFromAsn1=function(e){var t,r,o,s,c,h,d,p,v={},g=[];if(a.validate(e,l,v,g)&&(e=a.fromDer(n.util.createBuffer(v.privateKey))),v={},g=[],!a.validate(e,f,v,g)){var y=new Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey.");throw y.errors=g,y}return t=n.util.createBuffer(v.privateKeyModulus).toHex(),r=n.util.createBuffer(v.privateKeyPublicExponent).toHex(),o=n.util.createBuffer(v.privateKeyPrivateExponent).toHex(),s=n.util.createBuffer(v.privateKeyPrime1).toHex(),c=n.util.createBuffer(v.privateKeyPrime2).toHex(),h=n.util.createBuffer(v.privateKeyExponent1).toHex(),d=n.util.createBuffer(v.privateKeyExponent2).toHex(),p=n.util.createBuffer(v.privateKeyCoefficient).toHex(),u.setRsaPrivateKey(new i(t,16),new i(r,16),new i(o,16),new i(s,16),new i(c,16),new i(h,16),new i(d,16),new i(p,16))},u.privateKeyToAsn1=u.privateKeyToRSAPrivateKey=function(e){return a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,a.integerToDer(0).getBytes()),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,w(e.n)),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,w(e.e)),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,w(e.d)),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,w(e.p)),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,w(e.q)),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,w(e.dP)),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,w(e.dQ)),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,w(e.qInv))])},u.publicKeyFromAsn1=function(e){var t={},r=[];if(a.validate(e,d,t,r)){var o,s=a.derToOid(t.publicKeyOid);if(s!==u.oids.rsaEncryption)throw(o=new Error("Cannot read public key. Unknown OID.")).oid=s,o;e=t.rsaPublicKey}if(r=[],!a.validate(e,h,t,r))throw(o=new Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey.")).errors=r,o;var c=n.util.createBuffer(t.publicKeyModulus).toHex(),l=n.util.createBuffer(t.publicKeyExponent).toHex();return u.setRsaPublicKey(new i(c,16),new i(l,16))},u.publicKeyToAsn1=u.publicKeyToSubjectPublicKeyInfo=function(e){return a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.OID,!1,a.oidToDer(u.oids.rsaEncryption).getBytes()),a.create(a.Class.UNIVERSAL,a.Type.NULL,!1,"")]),a.create(a.Class.UNIVERSAL,a.Type.BITSTRING,!1,[u.publicKeyToRSAPublicKey(e)])])},u.publicKeyToRSAPublicKey=function(e){return a.create(a.Class.UNIVERSAL,a.Type.SEQUENCE,!0,[a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,w(e.n)),a.create(a.Class.UNIVERSAL,a.Type.INTEGER,!1,w(e.e))])}},5458:function(e,t,r){var n=r(3299);r(4744),r(9327);var i=e.exports=n.sha1=n.sha1||{};n.md.sha1=n.md.algorithms.sha1=i,i.create=function(){a||(o=String.fromCharCode(128),o+=n.util.fillString(String.fromCharCode(0),64),a=!0);var e=null,t=n.util.createBuffer(),r=new Array(80),i={algorithm:"sha1",blockLength:64,digestLength:20,messageLength:0,fullMessageLength:null,messageLengthSize:8,start:function(){i.messageLength=0,i.fullMessageLength=i.messageLength64=[];for(var r=i.messageLengthSize/4,o=0;o<r;++o)i.fullMessageLength.push(0);return t=n.util.createBuffer(),e={h0:1732584193,h1:4023233417,h2:2562383102,h3:271733878,h4:3285377520},i}};return i.start(),i.update=function(o,a){"utf8"===a&&(o=n.util.encodeUtf8(o));var u=o.length;i.messageLength+=u,u=[u/4294967296>>>0,u>>>0];for(var c=i.fullMessageLength.length-1;c>=0;--c)i.fullMessageLength[c]+=u[1],u[1]=u[0]+(i.fullMessageLength[c]/4294967296>>>0),i.fullMessageLength[c]=i.fullMessageLength[c]>>>0,u[0]=u[1]/4294967296>>>0;return t.putBytes(o),s(e,r,t),(t.read>2048||0===t.length())&&t.compact(),i},i.digest=function(){var a=n.util.createBuffer();a.putBytes(t.bytes());var u,c=i.fullMessageLength[i.fullMessageLength.length-1]+i.messageLengthSize&i.blockLength-1;a.putBytes(o.substr(0,i.blockLength-c));for(var l=8*i.fullMessageLength[0],f=0;f<i.fullMessageLength.length-1;++f)l+=(u=8*i.fullMessageLength[f+1])/4294967296>>>0,a.putInt32(l>>>0),l=u>>>0;a.putInt32(l);var h={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4};s(h,r,a);var d=n.util.createBuffer();return d.putInt32(h.h0),d.putInt32(h.h1),d.putInt32(h.h2),d.putInt32(h.h3),d.putInt32(h.h4),d},i};var o=null,a=!1;function s(e,t,r){for(var n,i,o,a,s,u,c,l=r.length();l>=64;){for(i=e.h0,o=e.h1,a=e.h2,s=e.h3,u=e.h4,c=0;c<16;++c)n=r.getInt32(),t[c]=n,n=(i<<5|i>>>27)+(s^o&(a^s))+u+1518500249+n,u=s,s=a,a=(o<<30|o>>>2)>>>0,o=i,i=n;for(;c<20;++c)n=(n=t[c-3]^t[c-8]^t[c-14]^t[c-16])<<1|n>>>31,t[c]=n,n=(i<<5|i>>>27)+(s^o&(a^s))+u+1518500249+n,u=s,s=a,a=(o<<30|o>>>2)>>>0,o=i,i=n;for(;c<32;++c)n=(n=t[c-3]^t[c-8]^t[c-14]^t[c-16])<<1|n>>>31,t[c]=n,n=(i<<5|i>>>27)+(o^a^s)+u+1859775393+n,u=s,s=a,a=(o<<30|o>>>2)>>>0,o=i,i=n;for(;c<40;++c)n=(n=t[c-6]^t[c-16]^t[c-28]^t[c-32])<<2|n>>>30,t[c]=n,n=(i<<5|i>>>27)+(o^a^s)+u+1859775393+n,u=s,s=a,a=(o<<30|o>>>2)>>>0,o=i,i=n;for(;c<60;++c)n=(n=t[c-6]^t[c-16]^t[c-28]^t[c-32])<<2|n>>>30,t[c]=n,n=(i<<5|i>>>27)+(o&a|s&(o^a))+u+2400959708+n,u=s,s=a,a=(o<<30|o>>>2)>>>0,o=i,i=n;for(;c<80;++c)n=(n=t[c-6]^t[c-16]^t[c-28]^t[c-32])<<2|n>>>30,t[c]=n,n=(i<<5|i>>>27)+(o^a^s)+u+3395469782+n,u=s,s=a,a=(o<<30|o>>>2)>>>0,o=i,i=n;e.h0=e.h0+i|0,e.h1=e.h1+o|0,e.h2=e.h2+a|0,e.h3=e.h3+s|0,e.h4=e.h4+u|0,l-=64}}},8282:function(e,t,r){var n=r(3299);r(4744),r(9327);var i=e.exports=n.sha256=n.sha256||{};n.md.sha256=n.md.algorithms.sha256=i,i.create=function(){a||(o=String.fromCharCode(128),o+=n.util.fillString(String.fromCharCode(0),64),s=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],a=!0);var e=null,t=n.util.createBuffer(),r=new Array(64),i={algorithm:"sha256",blockLength:64,digestLength:32,messageLength:0,fullMessageLength:null,messageLengthSize:8,start:function(){i.messageLength=0,i.fullMessageLength=i.messageLength64=[];for(var r=i.messageLengthSize/4,o=0;o<r;++o)i.fullMessageLength.push(0);return t=n.util.createBuffer(),e={h0:1779033703,h1:3144134277,h2:1013904242,h3:2773480762,h4:1359893119,h5:2600822924,h6:528734635,h7:1541459225},i}};return i.start(),i.update=function(o,a){"utf8"===a&&(o=n.util.encodeUtf8(o));var s=o.length;i.messageLength+=s,s=[s/4294967296>>>0,s>>>0];for(var c=i.fullMessageLength.length-1;c>=0;--c)i.fullMessageLength[c]+=s[1],s[1]=s[0]+(i.fullMessageLength[c]/4294967296>>>0),i.fullMessageLength[c]=i.fullMessageLength[c]>>>0,s[0]=s[1]/4294967296>>>0;return t.putBytes(o),u(e,r,t),(t.read>2048||0===t.length())&&t.compact(),i},i.digest=function(){var a=n.util.createBuffer();a.putBytes(t.bytes());var s,c=i.fullMessageLength[i.fullMessageLength.length-1]+i.messageLengthSize&i.blockLength-1;a.putBytes(o.substr(0,i.blockLength-c));for(var l=8*i.fullMessageLength[0],f=0;f<i.fullMessageLength.length-1;++f)l+=(s=8*i.fullMessageLength[f+1])/4294967296>>>0,a.putInt32(l>>>0),l=s>>>0;a.putInt32(l);var h={h0:e.h0,h1:e.h1,h2:e.h2,h3:e.h3,h4:e.h4,h5:e.h5,h6:e.h6,h7:e.h7};u(h,r,a);var d=n.util.createBuffer();return d.putInt32(h.h0),d.putInt32(h.h1),d.putInt32(h.h2),d.putInt32(h.h3),d.putInt32(h.h4),d.putInt32(h.h5),d.putInt32(h.h6),d.putInt32(h.h7),d},i};var o=null,a=!1,s=null;function u(e,t,r){for(var n,i,o,a,u,c,l,f,h,d,p,v,g,y=r.length();y>=64;){for(u=0;u<16;++u)t[u]=r.getInt32();for(;u<64;++u)n=((n=t[u-2])>>>17|n<<15)^(n>>>19|n<<13)^n>>>10,i=((i=t[u-15])>>>7|i<<25)^(i>>>18|i<<14)^i>>>3,t[u]=n+t[u-7]+i+t[u-16]|0;for(c=e.h0,l=e.h1,f=e.h2,h=e.h3,d=e.h4,p=e.h5,v=e.h6,g=e.h7,u=0;u<64;++u)o=(c>>>2|c<<30)^(c>>>13|c<<19)^(c>>>22|c<<10),a=c&l|f&(c^l),n=g+((d>>>6|d<<26)^(d>>>11|d<<21)^(d>>>25|d<<7))+(v^d&(p^v))+s[u]+t[u],g=v,v=p,p=d,d=h+n>>>0,h=f,f=l,l=c,c=n+(i=o+a)>>>0;e.h0=e.h0+c|0,e.h1=e.h1+l|0,e.h2=e.h2+f|0,e.h3=e.h3+h|0,e.h4=e.h4+d|0,e.h5=e.h5+p|0,e.h6=e.h6+v|0,e.h7=e.h7+g|0,y-=64}}},6237:function(e,t,r){var n=r(3299);r(4744),r(9327);var i=e.exports=n.sha512=n.sha512||{};n.md.sha512=n.md.algorithms.sha512=i;var o=n.sha384=n.sha512.sha384=n.sha512.sha384||{};o.create=function(){return i.create("SHA-384")},n.md.sha384=n.md.algorithms.sha384=o,n.sha512.sha256=n.sha512.sha256||{create:function(){return i.create("SHA-512/256")}},n.md["sha512/256"]=n.md.algorithms["sha512/256"]=n.sha512.sha256,n.sha512.sha224=n.sha512.sha224||{create:function(){return i.create("SHA-512/224")}},n.md["sha512/224"]=n.md.algorithms["sha512/224"]=n.sha512.sha224,i.create=function(e){if(s||(a=String.fromCharCode(128),a+=n.util.fillString(String.fromCharCode(0),128),u=[[1116352408,3609767458],[1899447441,602891725],[3049323471,3964484399],[3921009573,2173295548],[961987163,4081628472],[1508970993,3053834265],[2453635748,2937671579],[2870763221,3664609560],[3624381080,2734883394],[310598401,1164996542],[607225278,1323610764],[1426881987,3590304994],[1925078388,4068182383],[2162078206,991336113],[2614888103,633803317],[3248222580,3479774868],[3835390401,2666613458],[4022224774,944711139],[264347078,2341262773],[604807628,2007800933],[770255983,1495990901],[1249150122,1856431235],[1555081692,3175218132],[1996064986,2198950837],[2554220882,3999719339],[2821834349,766784016],[2952996808,2566594879],[3210313671,3203337956],[3336571891,1034457026],[3584528711,2466948901],[113926993,3758326383],[338241895,168717936],[666307205,1188179964],[773529912,1546045734],[1294757372,1522805485],[1396182291,2643833823],[1695183700,2343527390],[1986661051,1014477480],[2177026350,1206759142],[2456956037,344077627],[2730485921,1290863460],[2820302411,3158454273],[3259730800,3505952657],[3345764771,106217008],[3516065817,3606008344],[3600352804,1432725776],[4094571909,1467031594],[275423344,851169720],[430227734,3100823752],[506948616,1363258195],[659060556,3750685593],[883997877,3785050280],[958139571,3318307427],[1322822218,3812723403],[1537002063,2003034995],[1747873779,3602036899],[1955562222,1575990012],[2024104815,1125592928],[2227730452,2716904306],[2361852424,442776044],[2428436474,593698344],[2756734187,3733110249],[3204031479,2999351573],[3329325298,3815920427],[3391569614,3928383900],[3515267271,566280711],[3940187606,3454069534],[4118630271,4000239992],[116418474,1914138554],[174292421,2731055270],[289380356,3203993006],[460393269,320620315],[685471733,587496836],[852142971,1086792851],[1017036298,365543100],[1126000580,2618297676],[1288033470,3409855158],[1501505948,4234509866],[1607167915,987167468],[1816402316,1246189591]],(c={})["SHA-512"]=[[1779033703,4089235720],[3144134277,2227873595],[1013904242,4271175723],[2773480762,1595750129],[1359893119,2917565137],[2600822924,725511199],[528734635,4215389547],[1541459225,327033209]],c["SHA-384"]=[[3418070365,3238371032],[1654270250,914150663],[2438529370,812702999],[355462360,4144912697],[1731405415,4290775857],[2394180231,1750603025],[3675008525,1694076839],[1203062813,3204075428]],c["SHA-512/256"]=[[573645204,4230739756],[2673172387,3360449730],[596883563,1867755857],[2520282905,1497426621],[2519219938,2827943907],[3193839141,1401305490],[721525244,746961066],[246885852,2177182882]],c["SHA-512/224"]=[[2352822216,424955298],[1944164710,2312950998],[502970286,855612546],[1738396948,1479516111],[258812777,2077511080],[2011393907,79989058],[1067287976,1780299464],[286451373,2446758561]],s=!0),"undefined"===typeof e&&(e="SHA-512"),!(e in c))throw new Error("Invalid SHA-512 algorithm: "+e);for(var t=c[e],r=null,i=n.util.createBuffer(),o=new Array(80),f=0;f<80;++f)o[f]=new Array(2);var h=64;switch(e){case"SHA-384":h=48;break;case"SHA-512/256":h=32;break;case"SHA-512/224":h=28}var d={algorithm:e.replace("-","").toLowerCase(),blockLength:128,digestLength:h,messageLength:0,fullMessageLength:null,messageLengthSize:16,start:function(){d.messageLength=0,d.fullMessageLength=d.messageLength128=[];for(var e=d.messageLengthSize/4,o=0;o<e;++o)d.fullMessageLength.push(0);i=n.util.createBuffer(),r=new Array(t.length);for(o=0;o<t.length;++o)r[o]=t[o].slice(0);return d}};return d.start(),d.update=function(e,t){"utf8"===t&&(e=n.util.encodeUtf8(e));var a=e.length;d.messageLength+=a,a=[a/4294967296>>>0,a>>>0];for(var s=d.fullMessageLength.length-1;s>=0;--s)d.fullMessageLength[s]+=a[1],a[1]=a[0]+(d.fullMessageLength[s]/4294967296>>>0),d.fullMessageLength[s]=d.fullMessageLength[s]>>>0,a[0]=a[1]/4294967296>>>0;return i.putBytes(e),l(r,o,i),(i.read>2048||0===i.length())&&i.compact(),d},d.digest=function(){var t=n.util.createBuffer();t.putBytes(i.bytes());var s,u=d.fullMessageLength[d.fullMessageLength.length-1]+d.messageLengthSize&d.blockLength-1;t.putBytes(a.substr(0,d.blockLength-u));for(var c=8*d.fullMessageLength[0],f=0;f<d.fullMessageLength.length-1;++f)c+=(s=8*d.fullMessageLength[f+1])/4294967296>>>0,t.putInt32(c>>>0),c=s>>>0;t.putInt32(c);var h=new Array(r.length);for(f=0;f<r.length;++f)h[f]=r[f].slice(0);l(h,o,t);var p,v=n.util.createBuffer();p="SHA-512"===e?h.length:"SHA-384"===e?h.length-2:h.length-4;for(f=0;f<p;++f)v.putInt32(h[f][0]),f===p-1&&"SHA-512/224"===e||v.putInt32(h[f][1]);return v},d};var a=null,s=!1,u=null,c=null;function l(e,t,r){for(var n,i,o,a,s,c,l,f,h,d,p,v,g,y,m,b,w,k,E,x,S,_,A,I,C,T,P,R,B,M,N,O,D,L=r.length();L>=128;){for(P=0;P<16;++P)t[P][0]=r.getInt32()>>>0,t[P][1]=r.getInt32()>>>0;for(;P<80;++P)n=(((R=(M=t[P-2])[0])>>>19|(B=M[1])<<13)^(B>>>29|R<<3)^R>>>6)>>>0,i=((R<<13|B>>>19)^(B<<3|R>>>29)^(R<<26|B>>>6))>>>0,o=(((R=(O=t[P-15])[0])>>>1|(B=O[1])<<31)^(R>>>8|B<<24)^R>>>7)>>>0,a=((R<<31|B>>>1)^(R<<24|B>>>8)^(R<<25|B>>>7))>>>0,N=t[P-7],D=t[P-16],B=i+N[1]+a+D[1],t[P][0]=n+N[0]+o+D[0]+(B/4294967296>>>0)>>>0,t[P][1]=B>>>0;for(p=e[0][0],v=e[0][1],g=e[1][0],y=e[1][1],m=e[2][0],b=e[2][1],w=e[3][0],k=e[3][1],E=e[4][0],x=e[4][1],S=e[5][0],_=e[5][1],A=e[6][0],I=e[6][1],C=e[7][0],T=e[7][1],P=0;P<80;++P)l=((E>>>14|x<<18)^(E>>>18|x<<14)^(x>>>9|E<<23))>>>0,f=(A^E&(S^A))>>>0,s=((p>>>28|v<<4)^(v>>>2|p<<30)^(v>>>7|p<<25))>>>0,c=((p<<4|v>>>28)^(v<<30|p>>>2)^(v<<25|p>>>7))>>>0,h=(p&g|m&(p^g))>>>0,d=(v&y|b&(v^y))>>>0,B=T+(((E<<18|x>>>14)^(E<<14|x>>>18)^(x<<23|E>>>9))>>>0)+((I^x&(_^I))>>>0)+u[P][1]+t[P][1],n=C+l+f+u[P][0]+t[P][0]+(B/4294967296>>>0)>>>0,i=B>>>0,o=s+h+((B=c+d)/4294967296>>>0)>>>0,a=B>>>0,C=A,T=I,A=S,I=_,S=E,_=x,E=w+n+((B=k+i)/4294967296>>>0)>>>0,x=B>>>0,w=m,k=b,m=g,b=y,g=p,y=v,p=n+o+((B=i+a)/4294967296>>>0)>>>0,v=B>>>0;B=e[0][1]+v,e[0][0]=e[0][0]+p+(B/4294967296>>>0)>>>0,e[0][1]=B>>>0,B=e[1][1]+y,e[1][0]=e[1][0]+g+(B/4294967296>>>0)>>>0,e[1][1]=B>>>0,B=e[2][1]+b,e[2][0]=e[2][0]+m+(B/4294967296>>>0)>>>0,e[2][1]=B>>>0,B=e[3][1]+k,e[3][0]=e[3][0]+w+(B/4294967296>>>0)>>>0,e[3][1]=B>>>0,B=e[4][1]+x,e[4][0]=e[4][0]+E+(B/4294967296>>>0)>>>0,e[4][1]=B>>>0,B=e[5][1]+_,e[5][0]=e[5][0]+S+(B/4294967296>>>0)>>>0,e[5][1]=B>>>0,B=e[6][1]+I,e[6][0]=e[6][0]+A+(B/4294967296>>>0)>>>0,e[6][1]=B>>>0,B=e[7][1]+T,e[7][0]=e[7][0]+C+(B/4294967296>>>0)>>>0,e[7][1]=B>>>0,L-=128}}},9327:function(e,t,r){var n=r(3299),i=r(8270),o=e.exports=n.util=n.util||{};function a(e){if(8!==e&&16!==e&&24!==e&&32!==e)throw new Error("Only 8, 16, 24, or 32 bits supported: "+e)}function s(e){if(this.data="",this.read=0,"string"===typeof e)this.data=e;else if(o.isArrayBuffer(e)||o.isArrayBufferView(e))if("undefined"!==typeof Buffer&&e instanceof Buffer)this.data=e.toString("binary");else{var t=new Uint8Array(e);try{this.data=String.fromCharCode.apply(null,t)}catch(n){for(var r=0;r<t.length;++r)this.putByte(t[r])}}else(e instanceof s||"object"===typeof e&&"string"===typeof e.data&&"number"===typeof e.read)&&(this.data=e.data,this.read=e.read);this._constructedStringLength=0}!function(){if("undefined"!==typeof process&&process.nextTick&&!process.browser)return o.nextTick=process.nextTick,void("function"===typeof setImmediate?o.setImmediate=setImmediate:o.setImmediate=o.nextTick);if("function"===typeof setImmediate)return o.setImmediate=function(){return setImmediate.apply(void 0,arguments)},void(o.nextTick=function(e){return setImmediate(e)});if(o.setImmediate=function(e){setTimeout(e,0)},"undefined"!==typeof window&&"function"===typeof window.postMessage){var e="forge.setImmediate",t=[];o.setImmediate=function(r){t.push(r),1===t.length&&window.postMessage(e,"*")},window.addEventListener("message",(function(r){if(r.source===window&&r.data===e){r.stopPropagation();var n=t.slice();t.length=0,n.forEach((function(e){e()}))}}),!0)}if("undefined"!==typeof MutationObserver){var r=Date.now(),n=!0,i=document.createElement("div");t=[];new MutationObserver((function(){var e=t.slice();t.length=0,e.forEach((function(e){e()}))})).observe(i,{attributes:!0});var a=o.setImmediate;o.setImmediate=function(e){Date.now()-r>15?(r=Date.now(),a(e)):(t.push(e),1===t.length&&i.setAttribute("a",n=!n))}}o.nextTick=o.setImmediate}(),o.isNodejs="undefined"!==typeof process&&process.versions&&process.versions.node,o.globalScope=o.isNodejs?r.g:"undefined"===typeof self?window:self,o.isArray=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},o.isArrayBuffer=function(e){return"undefined"!==typeof ArrayBuffer&&e instanceof ArrayBuffer},o.isArrayBufferView=function(e){return e&&o.isArrayBuffer(e.buffer)&&void 0!==e.byteLength},o.ByteBuffer=s,o.ByteStringBuffer=s;o.ByteStringBuffer.prototype._optimizeConstructedString=function(e){this._constructedStringLength+=e,this._constructedStringLength>4096&&(this.data.substr(0,1),this._constructedStringLength=0)},o.ByteStringBuffer.prototype.length=function(){return this.data.length-this.read},o.ByteStringBuffer.prototype.isEmpty=function(){return this.length()<=0},o.ByteStringBuffer.prototype.putByte=function(e){return this.putBytes(String.fromCharCode(e))},o.ByteStringBuffer.prototype.fillWithByte=function(e,t){e=String.fromCharCode(e);for(var r=this.data;t>0;)1&t&&(r+=e),(t>>>=1)>0&&(e+=e);return this.data=r,this._optimizeConstructedString(t),this},o.ByteStringBuffer.prototype.putBytes=function(e){return this.data+=e,this._optimizeConstructedString(e.length),this},o.ByteStringBuffer.prototype.putString=function(e){return this.putBytes(o.encodeUtf8(e))},o.ByteStringBuffer.prototype.putInt16=function(e){return this.putBytes(String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},o.ByteStringBuffer.prototype.putInt24=function(e){return this.putBytes(String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},o.ByteStringBuffer.prototype.putInt32=function(e){return this.putBytes(String.fromCharCode(e>>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e))},o.ByteStringBuffer.prototype.putInt16Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255))},o.ByteStringBuffer.prototype.putInt24Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255))},o.ByteStringBuffer.prototype.putInt32Le=function(e){return this.putBytes(String.fromCharCode(255&e)+String.fromCharCode(e>>8&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>24&255))},o.ByteStringBuffer.prototype.putInt=function(e,t){a(t);var r="";do{t-=8,r+=String.fromCharCode(e>>t&255)}while(t>0);return this.putBytes(r)},o.ByteStringBuffer.prototype.putSignedInt=function(e,t){return e<0&&(e+=2<<t-1),this.putInt(e,t)},o.ByteStringBuffer.prototype.putBuffer=function(e){return this.putBytes(e.getBytes())},o.ByteStringBuffer.prototype.getByte=function(){return this.data.charCodeAt(this.read++)},o.ByteStringBuffer.prototype.getInt16=function(){var e=this.data.charCodeAt(this.read)<<8^this.data.charCodeAt(this.read+1);return this.read+=2,e},o.ByteStringBuffer.prototype.getInt24=function(){var e=this.data.charCodeAt(this.read)<<16^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2);return this.read+=3,e},o.ByteStringBuffer.prototype.getInt32=function(){var e=this.data.charCodeAt(this.read)<<24^this.data.charCodeAt(this.read+1)<<16^this.data.charCodeAt(this.read+2)<<8^this.data.charCodeAt(this.read+3);return this.read+=4,e},o.ByteStringBuffer.prototype.getInt16Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8;return this.read+=2,e},o.ByteStringBuffer.prototype.getInt24Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16;return this.read+=3,e},o.ByteStringBuffer.prototype.getInt32Le=function(){var e=this.data.charCodeAt(this.read)^this.data.charCodeAt(this.read+1)<<8^this.data.charCodeAt(this.read+2)<<16^this.data.charCodeAt(this.read+3)<<24;return this.read+=4,e},o.ByteStringBuffer.prototype.getInt=function(e){a(e);var t=0;do{t=(t<<8)+this.data.charCodeAt(this.read++),e-=8}while(e>0);return t},o.ByteStringBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),r=2<<e-2;return t>=r&&(t-=r<<1),t},o.ByteStringBuffer.prototype.getBytes=function(e){var t;return e?(e=Math.min(this.length(),e),t=this.data.slice(this.read,this.read+e),this.read+=e):0===e?t="":(t=0===this.read?this.data:this.data.slice(this.read),this.clear()),t},o.ByteStringBuffer.prototype.bytes=function(e){return"undefined"===typeof e?this.data.slice(this.read):this.data.slice(this.read,this.read+e)},o.ByteStringBuffer.prototype.at=function(e){return this.data.charCodeAt(this.read+e)},o.ByteStringBuffer.prototype.setAt=function(e,t){return this.data=this.data.substr(0,this.read+e)+String.fromCharCode(t)+this.data.substr(this.read+e+1),this},o.ByteStringBuffer.prototype.last=function(){return this.data.charCodeAt(this.data.length-1)},o.ByteStringBuffer.prototype.copy=function(){var e=o.createBuffer(this.data);return e.read=this.read,e},o.ByteStringBuffer.prototype.compact=function(){return this.read>0&&(this.data=this.data.slice(this.read),this.read=0),this},o.ByteStringBuffer.prototype.clear=function(){return this.data="",this.read=0,this},o.ByteStringBuffer.prototype.truncate=function(e){var t=Math.max(0,this.length()-e);return this.data=this.data.substr(this.read,t),this.read=0,this},o.ByteStringBuffer.prototype.toHex=function(){for(var e="",t=this.read;t<this.data.length;++t){var r=this.data.charCodeAt(t);r<16&&(e+="0"),e+=r.toString(16)}return e},o.ByteStringBuffer.prototype.toString=function(){return o.decodeUtf8(this.bytes())},o.DataBuffer=function(e,t){t=t||{},this.read=t.readOffset||0,this.growSize=t.growSize||1024;var r=o.isArrayBuffer(e),n=o.isArrayBufferView(e);if(r||n)return this.data=r?new DataView(e):new DataView(e.buffer,e.byteOffset,e.byteLength),void(this.write="writeOffset"in t?t.writeOffset:this.data.byteLength);this.data=new DataView(new ArrayBuffer(0)),this.write=0,null!==e&&void 0!==e&&this.putBytes(e),"writeOffset"in t&&(this.write=t.writeOffset)},o.DataBuffer.prototype.length=function(){return this.write-this.read},o.DataBuffer.prototype.isEmpty=function(){return this.length()<=0},o.DataBuffer.prototype.accommodate=function(e,t){if(this.length()>=e)return this;t=Math.max(t||this.growSize,e);var r=new Uint8Array(this.data.buffer,this.data.byteOffset,this.data.byteLength),n=new Uint8Array(this.length()+t);return n.set(r),this.data=new DataView(n.buffer),this},o.DataBuffer.prototype.putByte=function(e){return this.accommodate(1),this.data.setUint8(this.write++,e),this},o.DataBuffer.prototype.fillWithByte=function(e,t){this.accommodate(t);for(var r=0;r<t;++r)this.data.setUint8(e);return this},o.DataBuffer.prototype.putBytes=function(e,t){if(o.isArrayBufferView(e)){var r=(n=new Uint8Array(e.buffer,e.byteOffset,e.byteLength)).byteLength-n.byteOffset;return this.accommodate(r),new Uint8Array(this.data.buffer,this.write).set(n),this.write+=r,this}if(o.isArrayBuffer(e)){var n=new Uint8Array(e);return this.accommodate(n.byteLength),new Uint8Array(this.data.buffer).set(n,this.write),this.write+=n.byteLength,this}if(e instanceof o.DataBuffer||"object"===typeof e&&"number"===typeof e.read&&"number"===typeof e.write&&o.isArrayBufferView(e.data)){n=new Uint8Array(e.data.byteLength,e.read,e.length());return this.accommodate(n.byteLength),new Uint8Array(e.data.byteLength,this.write).set(n),this.write+=n.byteLength,this}if(e instanceof o.ByteStringBuffer&&(e=e.data,t="binary"),t=t||"binary","string"===typeof e){var i;if("hex"===t)return this.accommodate(Math.ceil(e.length/2)),i=new Uint8Array(this.data.buffer,this.write),this.write+=o.binary.hex.decode(e,i,this.write),this;if("base64"===t)return this.accommodate(3*Math.ceil(e.length/4)),i=new Uint8Array(this.data.buffer,this.write),this.write+=o.binary.base64.decode(e,i,this.write),this;if("utf8"===t&&(e=o.encodeUtf8(e),t="binary"),"binary"===t||"raw"===t)return this.accommodate(e.length),i=new Uint8Array(this.data.buffer,this.write),this.write+=o.binary.raw.decode(i),this;if("utf16"===t)return this.accommodate(2*e.length),i=new Uint16Array(this.data.buffer,this.write),this.write+=o.text.utf16.encode(i),this;throw new Error("Invalid encoding: "+t)}throw Error("Invalid parameter: "+e)},o.DataBuffer.prototype.putBuffer=function(e){return this.putBytes(e),e.clear(),this},o.DataBuffer.prototype.putString=function(e){return this.putBytes(e,"utf16")},o.DataBuffer.prototype.putInt16=function(e){return this.accommodate(2),this.data.setInt16(this.write,e),this.write+=2,this},o.DataBuffer.prototype.putInt24=function(e){return this.accommodate(3),this.data.setInt16(this.write,e>>8&65535),this.data.setInt8(this.write,e>>16&255),this.write+=3,this},o.DataBuffer.prototype.putInt32=function(e){return this.accommodate(4),this.data.setInt32(this.write,e),this.write+=4,this},o.DataBuffer.prototype.putInt16Le=function(e){return this.accommodate(2),this.data.setInt16(this.write,e,!0),this.write+=2,this},o.DataBuffer.prototype.putInt24Le=function(e){return this.accommodate(3),this.data.setInt8(this.write,e>>16&255),this.data.setInt16(this.write,e>>8&65535,!0),this.write+=3,this},o.DataBuffer.prototype.putInt32Le=function(e){return this.accommodate(4),this.data.setInt32(this.write,e,!0),this.write+=4,this},o.DataBuffer.prototype.putInt=function(e,t){a(t),this.accommodate(t/8);do{t-=8,this.data.setInt8(this.write++,e>>t&255)}while(t>0);return this},o.DataBuffer.prototype.putSignedInt=function(e,t){return a(t),this.accommodate(t/8),e<0&&(e+=2<<t-1),this.putInt(e,t)},o.DataBuffer.prototype.getByte=function(){return this.data.getInt8(this.read++)},o.DataBuffer.prototype.getInt16=function(){var e=this.data.getInt16(this.read);return this.read+=2,e},o.DataBuffer.prototype.getInt24=function(){var e=this.data.getInt16(this.read)<<8^this.data.getInt8(this.read+2);return this.read+=3,e},o.DataBuffer.prototype.getInt32=function(){var e=this.data.getInt32(this.read);return this.read+=4,e},o.DataBuffer.prototype.getInt16Le=function(){var e=this.data.getInt16(this.read,!0);return this.read+=2,e},o.DataBuffer.prototype.getInt24Le=function(){var e=this.data.getInt8(this.read)^this.data.getInt16(this.read+1,!0)<<8;return this.read+=3,e},o.DataBuffer.prototype.getInt32Le=function(){var e=this.data.getInt32(this.read,!0);return this.read+=4,e},o.DataBuffer.prototype.getInt=function(e){a(e);var t=0;do{t=(t<<8)+this.data.getInt8(this.read++),e-=8}while(e>0);return t},o.DataBuffer.prototype.getSignedInt=function(e){var t=this.getInt(e),r=2<<e-2;return t>=r&&(t-=r<<1),t},o.DataBuffer.prototype.getBytes=function(e){var t;return e?(e=Math.min(this.length(),e),t=this.data.slice(this.read,this.read+e),this.read+=e):0===e?t="":(t=0===this.read?this.data:this.data.slice(this.read),this.clear()),t},o.DataBuffer.prototype.bytes=function(e){return"undefined"===typeof e?this.data.slice(this.read):this.data.slice(this.read,this.read+e)},o.DataBuffer.prototype.at=function(e){return this.data.getUint8(this.read+e)},o.DataBuffer.prototype.setAt=function(e,t){return this.data.setUint8(e,t),this},o.DataBuffer.prototype.last=function(){return this.data.getUint8(this.write-1)},o.DataBuffer.prototype.copy=function(){return new o.DataBuffer(this)},o.DataBuffer.prototype.compact=function(){if(this.read>0){var e=new Uint8Array(this.data.buffer,this.read),t=new Uint8Array(e.byteLength);t.set(e),this.data=new DataView(t),this.write-=this.read,this.read=0}return this},o.DataBuffer.prototype.clear=function(){return this.data=new DataView(new ArrayBuffer(0)),this.read=this.write=0,this},o.DataBuffer.prototype.truncate=function(e){return this.write=Math.max(0,this.length()-e),this.read=Math.min(this.read,this.write),this},o.DataBuffer.prototype.toHex=function(){for(var e="",t=this.read;t<this.data.byteLength;++t){var r=this.data.getUint8(t);r<16&&(e+="0"),e+=r.toString(16)}return e},o.DataBuffer.prototype.toString=function(e){var t=new Uint8Array(this.data,this.read,this.length());if("binary"===(e=e||"utf8")||"raw"===e)return o.binary.raw.encode(t);if("hex"===e)return o.binary.hex.encode(t);if("base64"===e)return o.binary.base64.encode(t);if("utf8"===e)return o.text.utf8.decode(t);if("utf16"===e)return o.text.utf16.decode(t);throw new Error("Invalid encoding: "+e)},o.createBuffer=function(e,t){return t=t||"raw",void 0!==e&&"utf8"===t&&(e=o.encodeUtf8(e)),new o.ByteBuffer(e)},o.fillString=function(e,t){for(var r="";t>0;)1&t&&(r+=e),(t>>>=1)>0&&(e+=e);return r},o.xorBytes=function(e,t,r){for(var n="",i="",o="",a=0,s=0;r>0;--r,++a)i=e.charCodeAt(a)^t.charCodeAt(a),s>=10&&(n+=o,o="",s=0),o+=String.fromCharCode(i),++s;return n+=o},o.hexToBytes=function(e){var t="",r=0;for(!0&e.length&&(r=1,t+=String.fromCharCode(parseInt(e[0],16)));r<e.length;r+=2)t+=String.fromCharCode(parseInt(e.substr(r,2),16));return t},o.bytesToHex=function(e){return o.createBuffer(e).toHex()},o.int32ToBytes=function(e){return String.fromCharCode(e>>24&255)+String.fromCharCode(e>>16&255)+String.fromCharCode(e>>8&255)+String.fromCharCode(255&e)};var u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",c=[62,-1,-1,-1,63,52,53,54,55,56,57,58,59,60,61,-1,-1,-1,64,-1,-1,-1,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,-1,-1,-1,-1,-1,-1,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51],l="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";o.encode64=function(e,t){for(var r,n,i,o="",a="",s=0;s<e.length;)r=e.charCodeAt(s++),n=e.charCodeAt(s++),i=e.charCodeAt(s++),o+=u.charAt(r>>2),o+=u.charAt((3&r)<<4|n>>4),isNaN(n)?o+="==":(o+=u.charAt((15&n)<<2|i>>6),o+=isNaN(i)?"=":u.charAt(63&i)),t&&o.length>t&&(a+=o.substr(0,t)+"\r\n",o=o.substr(t));return a+=o},o.decode64=function(e){e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var t,r,n,i,o="",a=0;a<e.length;)t=c[e.charCodeAt(a++)-43],r=c[e.charCodeAt(a++)-43],n=c[e.charCodeAt(a++)-43],i=c[e.charCodeAt(a++)-43],o+=String.fromCharCode(t<<2|r>>4),64!==n&&(o+=String.fromCharCode((15&r)<<4|n>>2),64!==i&&(o+=String.fromCharCode((3&n)<<6|i)));return o},o.encodeUtf8=function(e){return unescape(encodeURIComponent(e))},o.decodeUtf8=function(e){return decodeURIComponent(escape(e))},o.binary={raw:{},hex:{},base64:{},base58:{},baseN:{encode:i.encode,decode:i.decode}},o.binary.raw.encode=function(e){return String.fromCharCode.apply(null,e)},o.binary.raw.decode=function(e,t,r){var n=t;n||(n=new Uint8Array(e.length));for(var i=r=r||0,o=0;o<e.length;++o)n[i++]=e.charCodeAt(o);return t?i-r:n},o.binary.hex.encode=o.bytesToHex,o.binary.hex.decode=function(e,t,r){var n=t;n||(n=new Uint8Array(Math.ceil(e.length/2)));var i=0,o=r=r||0;for(1&e.length&&(i=1,n[o++]=parseInt(e[0],16));i<e.length;i+=2)n[o++]=parseInt(e.substr(i,2),16);return t?o-r:n},o.binary.base64.encode=function(e,t){for(var r,n,i,o="",a="",s=0;s<e.byteLength;)r=e[s++],n=e[s++],i=e[s++],o+=u.charAt(r>>2),o+=u.charAt((3&r)<<4|n>>4),isNaN(n)?o+="==":(o+=u.charAt((15&n)<<2|i>>6),o+=isNaN(i)?"=":u.charAt(63&i)),t&&o.length>t&&(a+=o.substr(0,t)+"\r\n",o=o.substr(t));return a+=o},o.binary.base64.decode=function(e,t,r){var n,i,o,a,s=t;s||(s=new Uint8Array(3*Math.ceil(e.length/4))),e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"");for(var u=0,l=r=r||0;u<e.length;)n=c[e.charCodeAt(u++)-43],i=c[e.charCodeAt(u++)-43],o=c[e.charCodeAt(u++)-43],a=c[e.charCodeAt(u++)-43],s[l++]=n<<2|i>>4,64!==o&&(s[l++]=(15&i)<<4|o>>2,64!==a&&(s[l++]=(3&o)<<6|a));return t?l-r:s.subarray(0,l)},o.binary.base58.encode=function(e,t){return o.binary.baseN.encode(e,l,t)},o.binary.base58.decode=function(e,t){return o.binary.baseN.decode(e,l,t)},o.text={utf8:{},utf16:{}},o.text.utf8.encode=function(e,t,r){e=o.encodeUtf8(e);var n=t;n||(n=new Uint8Array(e.length));for(var i=r=r||0,a=0;a<e.length;++a)n[i++]=e.charCodeAt(a);return t?i-r:n},o.text.utf8.decode=function(e){return o.decodeUtf8(String.fromCharCode.apply(null,e))},o.text.utf16.encode=function(e,t,r){var n=t;n||(n=new Uint8Array(2*e.length));for(var i=new Uint16Array(n.buffer),o=r=r||0,a=r,s=0;s<e.length;++s)i[a++]=e.charCodeAt(s),o+=2;return t?o-r:n},o.text.utf16.decode=function(e){return String.fromCharCode.apply(null,new Uint16Array(e.buffer))},o.deflate=function(e,t,r){if(t=o.decode64(e.deflate(o.encode64(t)).rval),r){var n=2;32&t.charCodeAt(1)&&(n=6),t=t.substring(n,t.length-4)}return t},o.inflate=function(e,t,r){var n=e.inflate(o.encode64(t)).rval;return null===n?null:o.decode64(n)};var f=function(e,t,r){if(!e)throw new Error("WebStorage not available.");var n;if(null===r?n=e.removeItem(t):(r=o.encode64(JSON.stringify(r)),n=e.setItem(t,r)),"undefined"!==typeof n&&!0!==n.rval){var i=new Error(n.error.message);throw i.id=n.error.id,i.name=n.error.name,i}},h=function(e,t){if(!e)throw new Error("WebStorage not available.");var r=e.getItem(t);if(e.init)if(null===r.rval){if(r.error){var n=new Error(r.error.message);throw n.id=r.error.id,n.name=r.error.name,n}r=null}else r=r.rval;return null!==r&&(r=JSON.parse(o.decode64(r))),r},d=function(e,t,r,n){var i=h(e,t);null===i&&(i={}),i[r]=n,f(e,t,i)},p=function(e,t,r){var n=h(e,t);return null!==n&&(n=r in n?n[r]:null),n},v=function(e,t,r){var n=h(e,t);if(null!==n&&r in n){delete n[r];var i=!0;for(var o in n){i=!1;break}i&&(n=null),f(e,t,n)}},g=function(e,t){f(e,t,null)},y=function(e,t,r){var n,i=null;"undefined"===typeof r&&(r=["web","flash"]);var o=!1,a=null;for(var s in r){n=r[s];try{if("flash"===n||"both"===n){if(null===t[0])throw new Error("Flash local storage not available.");i=e.apply(this,t),o="flash"===n}"web"!==n&&"both"!==n||(t[0]=localStorage,i=e.apply(this,t),o=!0)}catch(u){a=u}if(o)break}if(!o)throw a;return i};o.setItem=function(e,t,r,n,i){y(d,arguments,i)},o.getItem=function(e,t,r,n){return y(p,arguments,n)},o.removeItem=function(e,t,r,n){y(v,arguments,n)},o.clearItems=function(e,t,r){y(g,arguments,r)},o.isEmpty=function(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0},o.format=function(e){for(var t,r,n=/%./g,i=0,o=[],a=0;t=n.exec(e);){(r=e.substring(a,n.lastIndex-2)).length>0&&o.push(r),a=n.lastIndex;var s=t[0][1];switch(s){case"s":case"o":i<arguments.length?o.push(arguments[1+i++]):o.push("<?>");break;case"%":o.push("%");break;default:o.push("<%"+s+"?>")}}return o.push(e.substring(a)),o.join("")},o.formatNumber=function(e,t,r,n){var i=e,o=isNaN(t=Math.abs(t))?2:t,a=void 0===r?",":r,s=void 0===n?".":n,u=i<0?"-":"",c=parseInt(i=Math.abs(+i||0).toFixed(o),10)+"",l=c.length>3?c.length%3:0;return u+(l?c.substr(0,l)+s:"")+c.substr(l).replace(/(\d{3})(?=\d)/g,"$1"+s)+(o?a+Math.abs(i-c).toFixed(o).slice(2):"")},o.formatSize=function(e){return e=e>=1073741824?o.formatNumber(e/1073741824,2,".","")+" GiB":e>=1048576?o.formatNumber(e/1048576,2,".","")+" MiB":e>=1024?o.formatNumber(e/1024,0)+" KiB":o.formatNumber(e,0)+" bytes"},o.bytesFromIP=function(e){return-1!==e.indexOf(".")?o.bytesFromIPv4(e):-1!==e.indexOf(":")?o.bytesFromIPv6(e):null},o.bytesFromIPv4=function(e){if(4!==(e=e.split(".")).length)return null;for(var t=o.createBuffer(),r=0;r<e.length;++r){var n=parseInt(e[r],10);if(isNaN(n))return null;t.putByte(n)}return t.getBytes()},o.bytesFromIPv6=function(e){for(var t=0,r=2*(8-(e=e.split(":").filter((function(e){return 0===e.length&&++t,!0}))).length+t),n=o.createBuffer(),i=0;i<8;++i)if(e[i]&&0!==e[i].length){var a=o.hexToBytes(e[i]);a.length<2&&n.putByte(0),n.putBytes(a)}else n.fillWithByte(0,r),r=0;return n.getBytes()},o.bytesToIP=function(e){return 4===e.length?o.bytesToIPv4(e):16===e.length?o.bytesToIPv6(e):null},o.bytesToIPv4=function(e){if(4!==e.length)return null;for(var t=[],r=0;r<e.length;++r)t.push(e.charCodeAt(r));return t.join(".")},o.bytesToIPv6=function(e){if(16!==e.length)return null;for(var t=[],r=[],n=0,i=0;i<e.length;i+=2){for(var a=o.bytesToHex(e[i]+e[i+1]);"0"===a[0]&&"0"!==a;)a=a.substr(1);if("0"===a){var s=r[r.length-1],u=t.length;s&&u===s.end+1?(s.end=u,s.end-s.start>r[n].end-r[n].start&&(n=r.length-1)):r.push({start:u,end:u})}t.push(a)}if(r.length>0){var c=r[n];c.end-c.start>0&&(t.splice(c.start,c.end-c.start+1,""),0===c.start&&t.unshift(""),7===c.end&&t.push(""))}return t.join(":")},o.estimateCores=function(e,t){if("function"===typeof e&&(t=e,e={}),e=e||{},"cores"in o&&!e.update)return t(null,o.cores);if("undefined"!==typeof navigator&&"hardwareConcurrency"in navigator&&navigator.hardwareConcurrency>0)return o.cores=navigator.hardwareConcurrency,t(null,o.cores);if("undefined"===typeof Worker)return o.cores=1,t(null,o.cores);if("undefined"===typeof Blob)return o.cores=2,t(null,o.cores);var r=URL.createObjectURL(new Blob(["(",function(){self.addEventListener("message",(function(e){for(var t=Date.now(),r=t+4;Date.now()<r;);self.postMessage({st:t,et:r})}))}.toString(),")()"],{type:"application/javascript"}));!function e(n,i,a){if(0===i){var s=Math.floor(n.reduce((function(e,t){return e+t}),0)/n.length);return o.cores=Math.max(1,s),URL.revokeObjectURL(r),t(null,o.cores)}!function(e,t){for(var n=[],i=[],o=0;o<e;++o){var a=new Worker(r);a.addEventListener("message",(function(r){if(i.push(r.data),i.length===e){for(var o=0;o<e;++o)n[o].terminate();t(null,i)}})),n.push(a)}for(o=0;o<e;++o)n[o].postMessage(o)}(a,(function(t,r){n.push(function(e,t){for(var r=[],n=0;n<e;++n)for(var i=t[n],o=r[n]=[],a=0;a<e;++a)if(n!==a){var s=t[a];(i.st>s.st&&i.st<s.et||s.st>i.st&&s.st<i.et)&&o.push(a)}return r.reduce((function(e,t){return Math.max(e,t.length)}),0)}(a,r)),e(n,i-1,a)}))}([],5,16)}},2989:function(e,t,r){"use strict";e.exports=r(3340)},4788:function(e){"use strict";e.exports=n;var t,r=/\/|\./;function n(e,t){r.test(e)||(e="google/protobuf/"+e+".proto",t={nested:{google:{nested:{protobuf:{nested:t}}}}}),n[e]=t}n("any",{Any:{fields:{type_url:{type:"string",id:1},value:{type:"bytes",id:2}}}}),n("duration",{Duration:t={fields:{seconds:{type:"int64",id:1},nanos:{type:"int32",id:2}}}}),n("timestamp",{Timestamp:t}),n("empty",{Empty:{fields:{}}}),n("struct",{Struct:{fields:{fields:{keyType:"string",type:"Value",id:1}}},Value:{oneofs:{kind:{oneof:["nullValue","numberValue","stringValue","boolValue","structValue","listValue"]}},fields:{nullValue:{type:"NullValue",id:1},numberValue:{type:"double",id:2},stringValue:{type:"string",id:3},boolValue:{type:"bool",id:4},structValue:{type:"Struct",id:5},listValue:{type:"ListValue",id:6}}},NullValue:{values:{NULL_VALUE:0}},ListValue:{fields:{values:{rule:"repeated",type:"Value",id:1}}}}),n("wrappers",{DoubleValue:{fields:{value:{type:"double",id:1}}},FloatValue:{fields:{value:{type:"float",id:1}}},Int64Value:{fields:{value:{type:"int64",id:1}}},UInt64Value:{fields:{value:{type:"uint64",id:1}}},Int32Value:{fields:{value:{type:"int32",id:1}}},UInt32Value:{fields:{value:{type:"uint32",id:1}}},BoolValue:{fields:{value:{type:"bool",id:1}}},StringValue:{fields:{value:{type:"string",id:1}}},BytesValue:{fields:{value:{type:"bytes",id:1}}}}),n("field_mask",{FieldMask:{fields:{paths:{rule:"repeated",type:"string",id:1}}}}),n.get=function(e){return n[e]||null}},1605:function(e,t,r){"use strict";var n=t,i=r(986),o=r(6021);function a(e,t,r,n){var o=!1;if(t.resolvedType)if(t.resolvedType instanceof i){e("switch(d%s){",n);for(var a=t.resolvedType.values,s=Object.keys(a),u=0;u<s.length;++u)a[s[u]]!==t.typeDefault||o||(e("default:")('if(typeof(d%s)==="number"){m%s=d%s;break}',n,n,n),t.repeated||e("break"),o=!0),e("case%j:",s[u])("case %i:",a[s[u]])("m%s=%j",n,a[s[u]])("break");e("}")}else e('if(typeof d%s!=="object")',n)("throw TypeError(%j)",t.fullName+": object expected")("m%s=types[%i].fromObject(d%s)",n,r,n);else{var c=!1;switch(t.type){case"double":case"float":e("m%s=Number(d%s)",n,n);break;case"uint32":case"fixed32":e("m%s=d%s>>>0",n,n);break;case"int32":case"sint32":case"sfixed32":e("m%s=d%s|0",n,n);break;case"uint64":c=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":e("if(util.Long)")("(m%s=util.Long.fromValue(d%s)).unsigned=%j",n,n,c)('else if(typeof d%s==="string")',n)("m%s=parseInt(d%s,10)",n,n)('else if(typeof d%s==="number")',n)("m%s=d%s",n,n)('else if(typeof d%s==="object")',n)("m%s=new util.LongBits(d%s.low>>>0,d%s.high>>>0).toNumber(%s)",n,n,n,c?"true":"");break;case"bytes":e('if(typeof d%s==="string")',n)("util.base64.decode(d%s,m%s=util.newBuffer(util.base64.length(d%s)),0)",n,n,n)("else if(d%s.length >= 0)",n)("m%s=d%s",n,n);break;case"string":e("m%s=String(d%s)",n,n);break;case"bool":e("m%s=Boolean(d%s)",n,n)}}return e}function s(e,t,r,n){if(t.resolvedType)t.resolvedType instanceof i?e("d%s=o.enums===String?(types[%i].values[m%s]===undefined?m%s:types[%i].values[m%s]):m%s",n,r,n,n,r,n,n):e("d%s=types[%i].toObject(m%s,o)",n,r,n);else{var o=!1;switch(t.type){case"double":case"float":e("d%s=o.json&&!isFinite(m%s)?String(m%s):m%s",n,n,n,n);break;case"uint64":o=!0;case"int64":case"sint64":case"fixed64":case"sfixed64":e('if(typeof m%s==="number")',n)("d%s=o.longs===String?String(m%s):m%s",n,n,n)("else")("d%s=o.longs===String?util.Long.prototype.toString.call(m%s):o.longs===Number?new util.LongBits(m%s.low>>>0,m%s.high>>>0).toNumber(%s):m%s",n,n,n,n,o?"true":"",n);break;case"bytes":e("d%s=o.bytes===String?util.base64.encode(m%s,0,m%s.length):o.bytes===Array?Array.prototype.slice.call(m%s):m%s",n,n,n,n,n);break;default:e("d%s=m%s",n,n)}}return e}n.fromObject=function(e){var t=e.fieldsArray,r=o.codegen(["d"],e.name+"$fromObject")("if(d instanceof this.ctor)")("return d");if(!t.length)return r("return new this.ctor");r("var m=new this.ctor");for(var n=0;n<t.length;++n){var s=t[n].resolve(),u=o.safeProp(s.name);s.map?(r("if(d%s){",u)('if(typeof d%s!=="object")',u)("throw TypeError(%j)",s.fullName+": object expected")("m%s={}",u)("for(var ks=Object.keys(d%s),i=0;i<ks.length;++i){",u),a(r,s,n,u+"[ks[i]]")("}")("}")):s.repeated?(r("if(d%s){",u)("if(!Array.isArray(d%s))",u)("throw TypeError(%j)",s.fullName+": array expected")("m%s=[]",u)("for(var i=0;i<d%s.length;++i){",u),a(r,s,n,u+"[i]")("}")("}")):(s.resolvedType instanceof i||r("if(d%s!=null){",u),a(r,s,n,u),s.resolvedType instanceof i||r("}"))}return r("return m")},n.toObject=function(e){var t=e.fieldsArray.slice().sort(o.compareFieldsById);if(!t.length)return o.codegen()("return {}");for(var r=o.codegen(["m","o"],e.name+"$toObject")("if(!o)")("o={}")("var d={}"),n=[],a=[],u=[],c=0;c<t.length;++c)t[c].partOf||(t[c].resolve().repeated?n:t[c].map?a:u).push(t[c]);if(n.length){for(r("if(o.arrays||o.defaults){"),c=0;c<n.length;++c)r("d%s=[]",o.safeProp(n[c].name));r("}")}if(a.length){for(r("if(o.objects||o.defaults){"),c=0;c<a.length;++c)r("d%s={}",o.safeProp(a[c].name));r("}")}if(u.length){for(r("if(o.defaults){"),c=0;c<u.length;++c){var l=u[c],f=o.safeProp(l.name);if(l.resolvedType instanceof i)r("d%s=o.enums===String?%j:%j",f,l.resolvedType.valuesById[l.typeDefault],l.typeDefault);else if(l.long)r("if(util.Long){")("var n=new util.Long(%i,%i,%j)",l.typeDefault.low,l.typeDefault.high,l.typeDefault.unsigned)("d%s=o.longs===String?n.toString():o.longs===Number?n.toNumber():n",f)("}else")("d%s=o.longs===String?%j:%i",f,l.typeDefault.toString(),l.typeDefault.toNumber());else if(l.bytes){var h="["+Array.prototype.slice.call(l.typeDefault).join(",")+"]";r("if(o.bytes===String)d%s=%j",f,String.fromCharCode.apply(String,l.typeDefault))("else{")("d%s=%s",f,h)("if(o.bytes!==Array)d%s=util.newBuffer(d%s)",f,f)("}")}else r("d%s=%j",f,l.typeDefault)}r("}")}var d=!1;for(c=0;c<t.length;++c){l=t[c];var p=e._fieldsArray.indexOf(l);f=o.safeProp(l.name);l.map?(d||(d=!0,r("var ks2")),r("if(m%s&&(ks2=Object.keys(m%s)).length){",f,f)("d%s={}",f)("for(var j=0;j<ks2.length;++j){"),s(r,l,p,f+"[ks2[j]]")("}")):l.repeated?(r("if(m%s&&m%s.length){",f,f)("d%s=[]",f)("for(var j=0;j<m%s.length;++j){",f),s(r,l,p,f+"[j]")("}")):(r("if(m%s!=null&&m.hasOwnProperty(%j)){",f,l.name),s(r,l,p,f),l.partOf&&r("if(o.oneofs)")("d%s=%j",o.safeProp(l.partOf.name),l.name)),r("}")}return r("return d")}},297:function(e,t,r){"use strict";e.exports=function(e){var t=o.codegen(["r","l"],e.name+"$decode")("if(!(r instanceof Reader))")("r=Reader.create(r)")("var c=l===undefined?r.len:r.pos+l,m=new this.ctor"+(e.fieldsArray.filter((function(e){return e.map})).length?",k,value":""))("while(r.pos<c){")("var t=r.uint32()");e.group&&t("if((t&7)===4)")("break");t("switch(t>>>3){");for(var r=0;r<e.fieldsArray.length;++r){var s=e._fieldsArray[r].resolve(),u=s.resolvedType instanceof n?"int32":s.type,c="m"+o.safeProp(s.name);t("case %i: {",s.id),s.map?(t("if(%s===util.emptyObject)",c)("%s={}",c)("var c2 = r.uint32()+r.pos"),void 0!==i.defaults[s.keyType]?t("k=%j",i.defaults[s.keyType]):t("k=null"),void 0!==i.defaults[u]?t("value=%j",i.defaults[u]):t("value=null"),t("while(r.pos<c2){")("var tag2=r.uint32()")("switch(tag2>>>3){")("case 1: k=r.%s(); break",s.keyType)("case 2:"),void 0===i.basic[u]?t("value=types[%i].decode(r,r.uint32())",r):t("value=r.%s()",u),t("break")("default:")("r.skipType(tag2&7)")("break")("}")("}"),void 0!==i.long[s.keyType]?t('%s[typeof k==="object"?util.longToHash(k):k]=value',c):t("%s[k]=value",c)):s.repeated?(t("if(!(%s&&%s.length))",c,c)("%s=[]",c),void 0!==i.packed[u]&&t("if((t&7)===2){")("var c2=r.uint32()+r.pos")("while(r.pos<c2)")("%s.push(r.%s())",c,u)("}else"),void 0===i.basic[u]?t(s.resolvedType.group?"%s.push(types[%i].decode(r))":"%s.push(types[%i].decode(r,r.uint32()))",c,r):t("%s.push(r.%s())",c,u)):void 0===i.basic[u]?t(s.resolvedType.group?"%s=types[%i].decode(r)":"%s=types[%i].decode(r,r.uint32())",c,r):t("%s=r.%s()",c,u),t("break")("}")}for(t("default:")("r.skipType(t&7)")("break")("}")("}"),r=0;r<e._fieldsArray.length;++r){var l=e._fieldsArray[r];l.required&&t("if(!m.hasOwnProperty(%j))",l.name)("throw util.ProtocolError(%j,{instance:m})",a(l))}return t("return m")};var n=r(986),i=r(3372),o=r(6021);function a(e){return"missing required '"+e.name+"'"}},2402:function(e,t,r){"use strict";e.exports=function(e){for(var t,r=o.codegen(["m","w"],e.name+"$encode")("if(!w)")("w=Writer.create()"),s=e.fieldsArray.slice().sort(o.compareFieldsById),u=0;u<s.length;++u){var c=s[u].resolve(),l=e._fieldsArray.indexOf(c),f=c.resolvedType instanceof n?"int32":c.type,h=i.basic[f];t="m"+o.safeProp(c.name),c.map?(r("if(%s!=null&&Object.hasOwnProperty.call(m,%j)){",t,c.name)("for(var ks=Object.keys(%s),i=0;i<ks.length;++i){",t)("w.uint32(%i).fork().uint32(%i).%s(ks[i])",(c.id<<3|2)>>>0,8|i.mapKey[c.keyType],c.keyType),void 0===h?r("types[%i].encode(%s[ks[i]],w.uint32(18).fork()).ldelim().ldelim()",l,t):r(".uint32(%i).%s(%s[ks[i]]).ldelim()",16|h,f,t),r("}")("}")):c.repeated?(r("if(%s!=null&&%s.length){",t,t),c.packed&&void 0!==i.packed[f]?r("w.uint32(%i).fork()",(c.id<<3|2)>>>0)("for(var i=0;i<%s.length;++i)",t)("w.%s(%s[i])",f,t)("w.ldelim()"):(r("for(var i=0;i<%s.length;++i)",t),void 0===h?a(r,c,l,t+"[i]"):r("w.uint32(%i).%s(%s[i])",(c.id<<3|h)>>>0,f,t)),r("}")):(c.optional&&r("if(%s!=null&&Object.hasOwnProperty.call(m,%j))",t,c.name),void 0===h?a(r,c,l,t):r("w.uint32(%i).%s(%s)",(c.id<<3|h)>>>0,f,t))}return r("return w")};var n=r(986),i=r(3372),o=r(6021);function a(e,t,r,n){return t.resolvedType.group?e("types[%i].encode(%s,w.uint32(%i)).uint32(%i)",r,n,(t.id<<3|3)>>>0,(t.id<<3|4)>>>0):e("types[%i].encode(%s,w.uint32(%i).fork()).ldelim()",r,n,(t.id<<3|2)>>>0)}},986:function(e,t,r){"use strict";e.exports=a;var n=r(3594);((a.prototype=Object.create(n.prototype)).constructor=a).className="Enum";var i=r(7905),o=r(6021);function a(e,t,r,i,o,a){if(n.call(this,e,r),t&&"object"!==typeof t)throw TypeError("values must be an object");if(this.valuesById={},this.values=Object.create(this.valuesById),this.comment=i,this.comments=o||{},this.valuesOptions=a,this.reserved=void 0,t)for(var s=Object.keys(t),u=0;u<s.length;++u)"number"===typeof t[s[u]]&&(this.valuesById[this.values[s[u]]=t[s[u]]]=s[u])}a.fromJSON=function(e,t){var r=new a(e,t.values,t.options,t.comment,t.comments);return r.reserved=t.reserved,r},a.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return o.toObject(["options",this.options,"valuesOptions",this.valuesOptions,"values",this.values,"reserved",this.reserved&&this.reserved.length?this.reserved:void 0,"comment",t?this.comment:void 0,"comments",t?this.comments:void 0])},a.prototype.add=function(e,t,r,n){if(!o.isString(e))throw TypeError("name must be a string");if(!o.isInteger(t))throw TypeError("id must be an integer");if(void 0!==this.values[e])throw Error("duplicate name '"+e+"' in "+this);if(this.isReservedId(t))throw Error("id "+t+" is reserved in "+this);if(this.isReservedName(e))throw Error("name '"+e+"' is reserved in "+this);if(void 0!==this.valuesById[t]){if(!this.options||!this.options.allow_alias)throw Error("duplicate id "+t+" in "+this);this.values[e]=t}else this.valuesById[this.values[e]=t]=e;return n&&(void 0===this.valuesOptions&&(this.valuesOptions={}),this.valuesOptions[e]=n||null),this.comments[e]=r||null,this},a.prototype.remove=function(e){if(!o.isString(e))throw TypeError("name must be a string");var t=this.values[e];if(null==t)throw Error("name '"+e+"' does not exist in "+this);return delete this.valuesById[t],delete this.values[e],delete this.comments[e],this.valuesOptions&&delete this.valuesOptions[e],this},a.prototype.isReservedId=function(e){return i.isReservedId(this.reserved,e)},a.prototype.isReservedName=function(e){return i.isReservedName(this.reserved,e)}},229:function(e,t,r){"use strict";e.exports=c;var n=r(3594);((c.prototype=Object.create(n.prototype)).constructor=c).className="Field";var i,o=r(986),a=r(3372),s=r(6021),u=/^required|optional|repeated$/;function c(e,t,r,i,o,c,l){if(s.isObject(i)?(l=o,c=i,i=o=void 0):s.isObject(o)&&(l=c,c=o,o=void 0),n.call(this,e,c),!s.isInteger(t)||t<0)throw TypeError("id must be a non-negative integer");if(!s.isString(r))throw TypeError("type must be a string");if(void 0!==i&&!u.test(i=i.toString().toLowerCase()))throw TypeError("rule must be a string rule");if(void 0!==o&&!s.isString(o))throw TypeError("extend must be a string");"proto3_optional"===i&&(i="optional"),this.rule=i&&"optional"!==i?i:void 0,this.type=r,this.id=t,this.extend=o||void 0,this.required="required"===i,this.optional=!this.required,this.repeated="repeated"===i,this.map=!1,this.message=null,this.partOf=null,this.typeDefault=null,this.defaultValue=null,this.long=!!s.Long&&void 0!==a.long[r],this.bytes="bytes"===r,this.resolvedType=null,this.extensionField=null,this.declaringField=null,this._packed=null,this.comment=l}c.fromJSON=function(e,t){return new c(e,t.id,t.type,t.rule,t.extend,t.options,t.comment)},Object.defineProperty(c.prototype,"packed",{get:function(){return null===this._packed&&(this._packed=!1!==this.getOption("packed")),this._packed}}),c.prototype.setOption=function(e,t,r){return"packed"===e&&(this._packed=null),n.prototype.setOption.call(this,e,t,r)},c.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return s.toObject(["rule","optional"!==this.rule&&this.rule||void 0,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",t?this.comment:void 0])},c.prototype.resolve=function(){if(this.resolved)return this;if(void 0===(this.typeDefault=a.defaults[this.type])?(this.resolvedType=(this.declaringField?this.declaringField.parent:this.parent).lookupTypeOrEnum(this.type),this.resolvedType instanceof i?this.typeDefault=null:this.typeDefault=this.resolvedType.values[Object.keys(this.resolvedType.values)[0]]):this.options&&this.options.proto3_optional&&(this.typeDefault=null),this.options&&null!=this.options.default&&(this.typeDefault=this.options.default,this.resolvedType instanceof o&&"string"===typeof this.typeDefault&&(this.typeDefault=this.resolvedType.values[this.typeDefault])),this.options&&(!0!==this.options.packed&&(void 0===this.options.packed||!this.resolvedType||this.resolvedType instanceof o)||delete this.options.packed,Object.keys(this.options).length||(this.options=void 0)),this.long)this.typeDefault=s.Long.fromNumber(this.typeDefault,"u"===this.type.charAt(0)),Object.freeze&&Object.freeze(this.typeDefault);else if(this.bytes&&"string"===typeof this.typeDefault){var e;s.base64.test(this.typeDefault)?s.base64.decode(this.typeDefault,e=s.newBuffer(s.base64.length(this.typeDefault)),0):s.utf8.write(this.typeDefault,e=s.newBuffer(s.utf8.length(this.typeDefault)),0),this.typeDefault=e}return this.map?this.defaultValue=s.emptyObject:this.repeated?this.defaultValue=s.emptyArray:this.defaultValue=this.typeDefault,this.parent instanceof i&&(this.parent.ctor.prototype[this.name]=this.defaultValue),n.prototype.resolve.call(this)},c.d=function(e,t,r,n){return"function"===typeof t?t=s.decorateType(t).name:t&&"object"===typeof t&&(t=s.decorateEnum(t).name),function(i,o){s.decorateType(i.constructor).add(new c(o,e,t,r,{default:n}))}},c._configure=function(e){i=e}},5852:function(e,t,r){"use strict";var n=e.exports=r(6264);n.build="light",n.load=function(e,t,r){return"function"===typeof t?(r=t,t=new n.Root):t||(t=new n.Root),t.load(e,r)},n.loadSync=function(e,t){return t||(t=new n.Root),t.loadSync(e)},n.encoder=r(2402),n.decoder=r(297),n.verifier=r(8507),n.converter=r(1605),n.ReflectionObject=r(3594),n.Namespace=r(7905),n.Root=r(9894),n.Enum=r(986),n.Type=r(5174),n.Field=r(229),n.OneOf=r(2698),n.MapField=r(7600),n.Service=r(2867),n.Method=r(7405),n.Message=r(7537),n.wrappers=r(3218),n.types=r(3372),n.util=r(6021),n.ReflectionObject._configure(n.Root),n.Namespace._configure(n.Type,n.Service,n.Enum),n.Root._configure(n.Type),n.Field._configure(n.Type)},6264:function(e,t,r){"use strict";var n=t;function i(){n.util._configure(),n.Writer._configure(n.BufferWriter),n.Reader._configure(n.BufferReader)}n.build="minimal",n.Writer=r(3471),n.BufferWriter=r(2549),n.Reader=r(9430),n.BufferReader=r(5393),n.util=r(8335),n.rpc=r(3776),n.roots=r(1552),n.configure=i,i()},3340:function(e,t,r){"use strict";var n=e.exports=r(5852);n.build="full",n.tokenize=r(5003),n.parse=r(5317),n.common=r(4788),n.Root._configure(n.Type,n.parse,n.common)},7600:function(e,t,r){"use strict";e.exports=a;var n=r(229);((a.prototype=Object.create(n.prototype)).constructor=a).className="MapField";var i=r(3372),o=r(6021);function a(e,t,r,i,a,s){if(n.call(this,e,t,i,void 0,void 0,a,s),!o.isString(r))throw TypeError("keyType must be a string");this.keyType=r,this.resolvedKeyType=null,this.map=!0}a.fromJSON=function(e,t){return new a(e,t.id,t.keyType,t.type,t.options,t.comment)},a.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return o.toObject(["keyType",this.keyType,"type",this.type,"id",this.id,"extend",this.extend,"options",this.options,"comment",t?this.comment:void 0])},a.prototype.resolve=function(){if(this.resolved)return this;if(void 0===i.mapKey[this.keyType])throw Error("invalid key type: "+this.keyType);return n.prototype.resolve.call(this)},a.d=function(e,t,r){return"function"===typeof r?r=o.decorateType(r).name:r&&"object"===typeof r&&(r=o.decorateEnum(r).name),function(n,i){o.decorateType(n.constructor).add(new a(i,e,t,r))}}},7537:function(e,t,r){"use strict";e.exports=i;var n=r(8335);function i(e){if(e)for(var t=Object.keys(e),r=0;r<t.length;++r)this[t[r]]=e[t[r]]}i.create=function(e){return this.$type.create(e)},i.encode=function(e,t){return this.$type.encode(e,t)},i.encodeDelimited=function(e,t){return this.$type.encodeDelimited(e,t)},i.decode=function(e){return this.$type.decode(e)},i.decodeDelimited=function(e){return this.$type.decodeDelimited(e)},i.verify=function(e){return this.$type.verify(e)},i.fromObject=function(e){return this.$type.fromObject(e)},i.toObject=function(e,t){return this.$type.toObject(e,t)},i.prototype.toJSON=function(){return this.$type.toObject(this,n.toJSONOptions)}},7405:function(e,t,r){"use strict";e.exports=o;var n=r(3594);((o.prototype=Object.create(n.prototype)).constructor=o).className="Method";var i=r(6021);function o(e,t,r,o,a,s,u,c,l){if(i.isObject(a)?(u=a,a=s=void 0):i.isObject(s)&&(u=s,s=void 0),void 0!==t&&!i.isString(t))throw TypeError("type must be a string");if(!i.isString(r))throw TypeError("requestType must be a string");if(!i.isString(o))throw TypeError("responseType must be a string");n.call(this,e,u),this.type=t||"rpc",this.requestType=r,this.requestStream=!!a||void 0,this.responseType=o,this.responseStream=!!s||void 0,this.resolvedRequestType=null,this.resolvedResponseType=null,this.comment=c,this.parsedOptions=l}o.fromJSON=function(e,t){return new o(e,t.type,t.requestType,t.responseType,t.requestStream,t.responseStream,t.options,t.comment,t.parsedOptions)},o.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return i.toObject(["type","rpc"!==this.type&&this.type||void 0,"requestType",this.requestType,"requestStream",this.requestStream,"responseType",this.responseType,"responseStream",this.responseStream,"options",this.options,"comment",t?this.comment:void 0,"parsedOptions",this.parsedOptions])},o.prototype.resolve=function(){return this.resolved?this:(this.resolvedRequestType=this.parent.lookupType(this.requestType),this.resolvedResponseType=this.parent.lookupType(this.responseType),n.prototype.resolve.call(this))}},7905:function(e,t,r){"use strict";e.exports=f;var n=r(3594);((f.prototype=Object.create(n.prototype)).constructor=f).className="Namespace";var i,o,a,s=r(229),u=r(6021),c=r(2698);function l(e,t){if(e&&e.length){for(var r={},n=0;n<e.length;++n)r[e[n].name]=e[n].toJSON(t);return r}}function f(e,t){n.call(this,e,t),this.nested=void 0,this._nestedArray=null}function h(e){return e._nestedArray=null,e}f.fromJSON=function(e,t){return new f(e,t.options).addJSON(t.nested)},f.arrayToJSON=l,f.isReservedId=function(e,t){if(e)for(var r=0;r<e.length;++r)if("string"!==typeof e[r]&&e[r][0]<=t&&e[r][1]>t)return!0;return!1},f.isReservedName=function(e,t){if(e)for(var r=0;r<e.length;++r)if(e[r]===t)return!0;return!1},Object.defineProperty(f.prototype,"nestedArray",{get:function(){return this._nestedArray||(this._nestedArray=u.toArray(this.nested))}}),f.prototype.toJSON=function(e){return u.toObject(["options",this.options,"nested",l(this.nestedArray,e)])},f.prototype.addJSON=function(e){if(e)for(var t,r=Object.keys(e),n=0;n<r.length;++n)t=e[r[n]],this.add((void 0!==t.fields?i.fromJSON:void 0!==t.values?a.fromJSON:void 0!==t.methods?o.fromJSON:void 0!==t.id?s.fromJSON:f.fromJSON)(r[n],t));return this},f.prototype.get=function(e){return this.nested&&this.nested[e]||null},f.prototype.getEnum=function(e){if(this.nested&&this.nested[e]instanceof a)return this.nested[e].values;throw Error("no such enum: "+e)},f.prototype.add=function(e){if(!(e instanceof s&&void 0!==e.extend||e instanceof i||e instanceof c||e instanceof a||e instanceof o||e instanceof f))throw TypeError("object must be a valid nested object");if(this.nested){var t=this.get(e.name);if(t){if(!(t instanceof f&&e instanceof f)||t instanceof i||t instanceof o)throw Error("duplicate name '"+e.name+"' in "+this);for(var r=t.nestedArray,n=0;n<r.length;++n)e.add(r[n]);this.remove(t),this.nested||(this.nested={}),e.setOptions(t.options,!0)}}else this.nested={};return this.nested[e.name]=e,e.onAdd(this),h(this)},f.prototype.remove=function(e){if(!(e instanceof n))throw TypeError("object must be a ReflectionObject");if(e.parent!==this)throw Error(e+" is not a member of "+this);return delete this.nested[e.name],Object.keys(this.nested).length||(this.nested=void 0),e.onRemove(this),h(this)},f.prototype.define=function(e,t){if(u.isString(e))e=e.split(".");else if(!Array.isArray(e))throw TypeError("illegal path");if(e&&e.length&&""===e[0])throw Error("path must be relative");for(var r=this;e.length>0;){var n=e.shift();if(r.nested&&r.nested[n]){if(!((r=r.nested[n])instanceof f))throw Error("path conflicts with non-namespace objects")}else r.add(r=new f(n))}return t&&r.addJSON(t),r},f.prototype.resolveAll=function(){for(var e=this.nestedArray,t=0;t<e.length;)e[t]instanceof f?e[t++].resolveAll():e[t++].resolve();return this.resolve()},f.prototype.lookup=function(e,t,r){if("boolean"===typeof t?(r=t,t=void 0):t&&!Array.isArray(t)&&(t=[t]),u.isString(e)&&e.length){if("."===e)return this.root;e=e.split(".")}else if(!e.length)return this;if(""===e[0])return this.root.lookup(e.slice(1),t);var n=this.get(e[0]);if(n){if(1===e.length){if(!t||t.indexOf(n.constructor)>-1)return n}else if(n instanceof f&&(n=n.lookup(e.slice(1),t,!0)))return n}else for(var i=0;i<this.nestedArray.length;++i)if(this._nestedArray[i]instanceof f&&(n=this._nestedArray[i].lookup(e,t,!0)))return n;return null===this.parent||r?null:this.parent.lookup(e,t)},f.prototype.lookupType=function(e){var t=this.lookup(e,[i]);if(!t)throw Error("no such type: "+e);return t},f.prototype.lookupEnum=function(e){var t=this.lookup(e,[a]);if(!t)throw Error("no such Enum '"+e+"' in "+this);return t},f.prototype.lookupTypeOrEnum=function(e){var t=this.lookup(e,[i,a]);if(!t)throw Error("no such Type or Enum '"+e+"' in "+this);return t},f.prototype.lookupService=function(e){var t=this.lookup(e,[o]);if(!t)throw Error("no such Service '"+e+"' in "+this);return t},f._configure=function(e,t,r){i=e,o=t,a=r}},3594:function(e,t,r){"use strict";e.exports=o,o.className="ReflectionObject";var n,i=r(6021);function o(e,t){if(!i.isString(e))throw TypeError("name must be a string");if(t&&!i.isObject(t))throw TypeError("options must be an object");this.options=t,this.parsedOptions=null,this.name=e,this.parent=null,this.resolved=!1,this.comment=null,this.filename=null}Object.defineProperties(o.prototype,{root:{get:function(){for(var e=this;null!==e.parent;)e=e.parent;return e}},fullName:{get:function(){for(var e=[this.name],t=this.parent;t;)e.unshift(t.name),t=t.parent;return e.join(".")}}}),o.prototype.toJSON=function(){throw Error()},o.prototype.onAdd=function(e){this.parent&&this.parent!==e&&this.parent.remove(this),this.parent=e,this.resolved=!1;var t=e.root;t instanceof n&&t._handleAdd(this)},o.prototype.onRemove=function(e){var t=e.root;t instanceof n&&t._handleRemove(this),this.parent=null,this.resolved=!1},o.prototype.resolve=function(){return this.resolved||this.root instanceof n&&(this.resolved=!0),this},o.prototype.getOption=function(e){if(this.options)return this.options[e]},o.prototype.setOption=function(e,t,r){return r&&this.options&&void 0!==this.options[e]||((this.options||(this.options={}))[e]=t),this},o.prototype.setParsedOption=function(e,t,r){this.parsedOptions||(this.parsedOptions=[]);var n=this.parsedOptions;if(r){var o=n.find((function(t){return Object.prototype.hasOwnProperty.call(t,e)}));if(o){var a=o[e];i.setProperty(a,r,t)}else(o={})[e]=i.setProperty({},r,t),n.push(o)}else{var s={};s[e]=t,n.push(s)}return this},o.prototype.setOptions=function(e,t){if(e)for(var r=Object.keys(e),n=0;n<r.length;++n)this.setOption(r[n],e[r[n]],t);return this},o.prototype.toString=function(){var e=this.constructor.className,t=this.fullName;return t.length?e+" "+t:e},o._configure=function(e){n=e}},2698:function(e,t,r){"use strict";e.exports=a;var n=r(3594);((a.prototype=Object.create(n.prototype)).constructor=a).className="OneOf";var i=r(229),o=r(6021);function a(e,t,r,i){if(Array.isArray(t)||(r=t,t=void 0),n.call(this,e,r),void 0!==t&&!Array.isArray(t))throw TypeError("fieldNames must be an Array");this.oneof=t||[],this.fieldsArray=[],this.comment=i}function s(e){if(e.parent)for(var t=0;t<e.fieldsArray.length;++t)e.fieldsArray[t].parent||e.parent.add(e.fieldsArray[t])}a.fromJSON=function(e,t){return new a(e,t.oneof,t.options,t.comment)},a.prototype.toJSON=function(e){var t=!!e&&Boolean(e.keepComments);return o.toObject(["options",this.options,"oneof",this.oneof,"comment",t?this.comment:void 0])},a.prototype.add=function(e){if(!(e instanceof i))throw TypeError("field must be a Field");return e.parent&&e.parent!==this.parent&&e.parent.remove(e),this.oneof.push(e.name),this.fieldsArray.push(e),e.partOf=this,s(this),this},a.prototype.remove=function(e){if(!(e instanceof i))throw TypeError("field must be a Field");var t=this.fieldsArray.indexOf(e);if(t<0)throw Error(e+" is not a member of "+this);return this.fieldsArray.splice(t,1),(t=this.oneof.indexOf(e.name))>-1&&this.oneof.splice(t,1),e.partOf=null,this},a.prototype.onAdd=function(e){n.prototype.onAdd.call(this,e);for(var t=0;t<this.oneof.length;++t){var r=e.get(this.oneof[t]);r&&!r.partOf&&(r.partOf=this,this.fieldsArray.push(r))}s(this)},a.prototype.onRemove=function(e){for(var t,r=0;r<this.fieldsArray.length;++r)(t=this.fieldsArray[r]).parent&&t.parent.remove(t);n.prototype.onRemove.call(this,e)},a.d=function(){for(var e=new Array(arguments.length),t=0;t<arguments.length;)e[t]=arguments[t++];return function(t,r){o.decorateType(t.constructor).add(new a(r,e)),Object.defineProperty(t,r,{get:o.oneOfGetter(e),set:o.oneOfSetter(e)})}}},5317:function(e,t,r){"use strict";e.exports=S,S.filename=null,S.defaults={keepCase:!1};var n=r(5003),i=r(9894),o=r(5174),a=r(229),s=r(7600),u=r(2698),c=r(986),l=r(2867),f=r(7405),h=r(3372),d=r(6021),p=/^[1-9][0-9]*$/,v=/^-?[1-9][0-9]*$/,g=/^0[x][0-9a-fA-F]+$/,y=/^-?0[x][0-9a-fA-F]+$/,m=/^0[0-7]+$/,b=/^-?0[0-7]+$/,w=/^(?![eE])[0-9]*(?:\.[0-9]*)?(?:[eE][+-]?[0-9]+)?$/,k=/^[a-zA-Z_][a-zA-Z_0-9]*$/,E=/^(?:\.?[a-zA-Z_][a-zA-Z_0-9]*)(?:\.[a-zA-Z_][a-zA-Z_0-9]*)*$/,x=/^(?:\.[a-zA-Z_][a-zA-Z_0-9]*)+$/;function S(e,t,r){t instanceof i||(r=t,t=new i),r||(r=S.defaults);var _,A,I,C,T,P=r.preferTrailingComment||!1,R=n(e,r.alternateCommentMode||!1),B=R.next,M=R.push,N=R.peek,O=R.skip,D=R.cmnt,L=!0,U=!1,F=t,z=r.keepCase?function(e){return e}:d.camelCase;function Z(e,t,r){var n=S.filename;return r||(S.filename=null),Error("illegal "+(t||"token")+" '"+e+"' ("+(n?n+", ":"")+"line "+R.line+")")}function j(){var e,t=[];do{if('"'!==(e=B())&&"'"!==e)throw Z(e);t.push(B()),O(e),e=N()}while('"'===e||"'"===e);return t.join("")}function q(e){var t=B();switch(t){case"'":case'"':return M(t),j();case"true":case"TRUE":return!0;case"false":case"FALSE":return!1}try{return function(e,t){var r=1;"-"===e.charAt(0)&&(r=-1,e=e.substring(1));switch(e){case"inf":case"INF":case"Inf":return r*(1/0);case"nan":case"NAN":case"Nan":case"NaN":return NaN;case"0":return 0}if(p.test(e))return r*parseInt(e,10);if(g.test(e))return r*parseInt(e,16);if(m.test(e))return r*parseInt(e,8);if(w.test(e))return r*parseFloat(e);throw Z(e,"number",t)}(t,!0)}catch(r){if(e&&E.test(t))return t;throw Z(t,"value")}}function K(e,t){var r,n;do{!t||'"'!==(r=N())&&"'"!==r?e.push([n=V(B()),O("to",!0)?V(B()):n]):e.push(j())}while(O(",",!0));O(";")}function V(e,t){switch(e){case"max":case"MAX":case"Max":return 536870911;case"0":return 0}if(!t&&"-"===e.charAt(0))throw Z(e,"id");if(v.test(e))return parseInt(e,10);if(y.test(e))return parseInt(e,16);if(b.test(e))return parseInt(e,8);throw Z(e,"id")}function H(){if(void 0!==_)throw Z("package");if(_=B(),!E.test(_))throw Z(_,"name");F=F.define(_),O(";")}function G(){var e,t=N();switch(t){case"weak":e=I||(I=[]),B();break;case"public":B();default:e=A||(A=[])}t=j(),O(";"),e.push(t)}function W(){if(O("="),C=j(),!(U="proto3"===C)&&"proto2"!==C)throw Z(C,"syntax");O(";")}function Q(e,t){switch(t){case"option":return ee(e,t),O(";"),!0;case"message":return Y(e,t),!0;case"enum":return $(e,t),!0;case"service":return function(e,t){if(!k.test(t=B()))throw Z(t,"service name");var r=new l(t);J(r,(function(e){if(!Q(r,e)){if("rpc"!==e)throw Z(e);!function(e,t){var r=D(),n=t;if(!k.test(t=B()))throw Z(t,"name");var i,o,a,s,u=t;O("("),O("stream",!0)&&(o=!0);if(!E.test(t=B()))throw Z(t);i=t,O(")"),O("returns"),O("("),O("stream",!0)&&(s=!0);if(!E.test(t=B()))throw Z(t);a=t,O(")");var c=new f(u,n,i,a,o,s);c.comment=r,J(c,(function(e){if("option"!==e)throw Z(e);ee(c,e),O(";")})),e.add(c)}(r,e)}})),e.add(r)}(e,t),!0;case"extend":return function(e,t){if(!E.test(t=B()))throw Z(t,"reference");var r=t;J(null,(function(t){switch(t){case"required":case"repeated":X(e,t,r);break;case"optional":X(e,U?"proto3_optional":"optional",r);break;default:if(!U||!E.test(t))throw Z(t);M(t),X(e,"optional",r)}}))}(e,t),!0}return!1}function J(e,t,r){var n=R.line;if(e&&("string"!==typeof e.comment&&(e.comment=D()),e.filename=S.filename),O("{",!0)){for(var i;"}"!==(i=B());)t(i);O(";",!0)}else r&&r(),O(";"),e&&("string"!==typeof e.comment||P)&&(e.comment=D(n)||e.comment)}function Y(e,t){if(!k.test(t=B()))throw Z(t,"type name");var r=new o(t);J(r,(function(e){if(!Q(r,e))switch(e){case"map":!function(e){O("<");var t=B();if(void 0===h.mapKey[t])throw Z(t,"type");O(",");var r=B();if(!E.test(r))throw Z(r,"type");O(">");var n=B();if(!k.test(n))throw Z(n,"name");O("=");var i=new s(z(n),V(B()),t,r);J(i,(function(e){if("option"!==e)throw Z(e);ee(i,e),O(";")}),(function(){ne(i)})),e.add(i)}(r);break;case"required":case"repeated":X(r,e);break;case"optional":X(r,U?"proto3_optional":"optional");break;case"oneof":!function(e,t){if(!k.test(t=B()))throw Z(t,"name");var r=new u(z(t));J(r,(function(e){"option"===e?(ee(r,e),O(";")):(M(e),X(r,"optional"))})),e.add(r)}(r,e);break;case"extensions":K(r.extensions||(r.extensions=[]));break;case"reserved":K(r.reserved||(r.reserved=[]),!0);break;default:if(!U||!E.test(e))throw Z(e);M(e),X(r,"optional")}})),e.add(r)}function X(e,t,r){var n=B();if("group"!==n){if(!E.test(n))throw Z(n,"type");var i=B();if(!k.test(i))throw Z(i,"name");i=z(i),O("=");var s=new a(i,V(B()),n,t,r);if(J(s,(function(e){if("option"!==e)throw Z(e);ee(s,e),O(";")}),(function(){ne(s)})),"proto3_optional"===t){var c=new u("_"+i);s.setOption("proto3_optional",!0),c.add(s),e.add(c)}else e.add(s);U||!s.repeated||void 0===h.packed[n]&&void 0!==h.basic[n]||s.setOption("packed",!1,!0)}else!function(e,t){var r=B();if(!k.test(r))throw Z(r,"name");var n=d.lcFirst(r);r===n&&(r=d.ucFirst(r));O("=");var i=V(B()),s=new o(r);s.group=!0;var u=new a(n,i,r,t);u.filename=S.filename,J(s,(function(e){switch(e){case"option":ee(s,e),O(";");break;case"required":case"repeated":X(s,e);break;case"optional":X(s,U?"proto3_optional":"optional");break;case"message":Y(s,e);break;case"enum":$(s,e);break;default:throw Z(e)}})),e.add(s).add(u)}(e,t)}function $(e,t){if(!k.test(t=B()))throw Z(t,"name");var r=new c(t);J(r,(function(e){switch(e){case"option":ee(r,e),O(";");break;case"reserved":K(r.reserved||(r.reserved=[]),!0);break;default:!function(e,t){if(!k.test(t))throw Z(t,"name");O("=");var r=V(B(),!0),n={options:void 0,setOption:function(e,t){void 0===this.options&&(this.options={}),this.options[e]=t}};J(n,(function(e){if("option"!==e)throw Z(e);ee(n,e),O(";")}),(function(){ne(n)})),e.add(t,r,n.comment,n.options)}(r,e)}})),e.add(r)}function ee(e,t){var r=O("(",!0);if(!E.test(t=B()))throw Z(t,"name");var n,i=t,o=i;r&&(O(")"),o=i="("+i+")",t=N(),x.test(t)&&(n=t.slice(1),i+=t,B())),O("="),function(e,t,r,n){e.setParsedOption&&e.setParsedOption(t,r,n)}(e,o,te(e,i),n)}function te(e,t){if(O("{",!0)){for(var r={};!O("}",!0);){if(!k.test(T=B()))throw Z(T,"name");var n,i=T;if(O(":",!0),"{"===N())n=te(e,t+"."+T);else if("["===N()){var o;if(n=[],O("[",!0)){do{o=q(!0),n.push(o)}while(O(",",!0));O("]"),"undefined"!==typeof o&&re(e,t+"."+T,o)}}else n=q(!0),re(e,t+"."+T,n);var a=r[i];a&&(n=[].concat(a).concat(n)),r[i]=n,O(",",!0),O(";",!0)}return r}var s=q(!0);return re(e,t,s),s}function re(e,t,r){e.setOption&&e.setOption(t,r)}function ne(e){if(O("[",!0)){do{ee(e,"option")}while(O(",",!0));O("]")}return e}for(;null!==(T=B());)switch(T){case"package":if(!L)throw Z(T);H();break;case"import":if(!L)throw Z(T);G();break;case"syntax":if(!L)throw Z(T);W();break;case"option":ee(F,T),O(";");break;default:if(Q(F,T)){L=!1;continue}throw Z(T)}return S.filename=null,{package:_,imports:A,weakImports:I,syntax:C,root:t}}},9430:function(e,t,r){"use strict";e.exports=u;var n,i=r(8335),o=i.LongBits,a=i.utf8;function s(e,t){return RangeError("index out of range: "+e.pos+" + "+(t||1)+" > "+e.len)}function u(e){this.buf=e,this.pos=0,this.len=e.length}var c="undefined"!==typeof Uint8Array?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new u(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new u(e);throw Error("illegal buffer")},l=function(){return i.Buffer?function(e){return(u.create=function(e){return i.Buffer.isBuffer(e)?new n(e):c(e)})(e)}:c};function f(){var e=new o(0,0),t=0;if(!(this.len-this.pos>4)){for(;t<3;++t){if(this.pos>=this.len)throw s(this);if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e}return e.lo=(e.lo|(127&this.buf[this.pos++])<<7*t)>>>0,e}for(;t<4;++t)if(e.lo=(e.lo|(127&this.buf[this.pos])<<7*t)>>>0,this.buf[this.pos++]<128)return e;if(e.lo=(e.lo|(127&this.buf[this.pos])<<28)>>>0,e.hi=(e.hi|(127&this.buf[this.pos])>>4)>>>0,this.buf[this.pos++]<128)return e;if(t=0,this.len-this.pos>4){for(;t<5;++t)if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}else for(;t<5;++t){if(this.pos>=this.len)throw s(this);if(e.hi=(e.hi|(127&this.buf[this.pos])<<7*t+3)>>>0,this.buf[this.pos++]<128)return e}throw Error("invalid varint encoding")}function h(e,t){return(e[t-4]|e[t-3]<<8|e[t-2]<<16|e[t-1]<<24)>>>0}function d(){if(this.pos+8>this.len)throw s(this,8);return new o(h(this.buf,this.pos+=4),h(this.buf,this.pos+=4))}u.create=l(),u.prototype._slice=i.Array.prototype.subarray||i.Array.prototype.slice,u.prototype.uint32=function(){var e=4294967295;return function(){if(e=(127&this.buf[this.pos])>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(127&this.buf[this.pos])<<7)>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(127&this.buf[this.pos])<<14)>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(127&this.buf[this.pos])<<21)>>>0,this.buf[this.pos++]<128)return e;if(e=(e|(15&this.buf[this.pos])<<28)>>>0,this.buf[this.pos++]<128)return e;if((this.pos+=5)>this.len)throw this.pos=this.len,s(this,10);return e}}(),u.prototype.int32=function(){return 0|this.uint32()},u.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(1&e)|0},u.prototype.bool=function(){return 0!==this.uint32()},u.prototype.fixed32=function(){if(this.pos+4>this.len)throw s(this,4);return h(this.buf,this.pos+=4)},u.prototype.sfixed32=function(){if(this.pos+4>this.len)throw s(this,4);return 0|h(this.buf,this.pos+=4)},u.prototype.float=function(){if(this.pos+4>this.len)throw s(this,4);var e=i.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e},u.prototype.double=function(){if(this.pos+8>this.len)throw s(this,4);var e=i.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e},u.prototype.bytes=function(){var e=this.uint32(),t=this.pos,r=this.pos+e;if(r>this.len)throw s(this,e);return this.pos+=e,Array.isArray(this.buf)?this.buf.slice(t,r):t===r?new this.buf.constructor(0):this._slice.call(this.buf,t,r)},u.prototype.string=function(){var e=this.bytes();return a.read(e,0,e.length)},u.prototype.skip=function(e){if("number"===typeof e){if(this.pos+e>this.len)throw s(this,e);this.pos+=e}else do{if(this.pos>=this.len)throw s(this)}while(128&this.buf[this.pos++]);return this},u.prototype.skipType=function(e){switch(e){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;4!==(e=7&this.uint32());)this.skipType(e);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+e+" at offset "+this.pos)}return this},u._configure=function(e){n=e,u.create=l(),n._configure();var t=i.Long?"toLong":"toNumber";i.merge(u.prototype,{int64:function(){return f.call(this)[t](!1)},uint64:function(){return f.call(this)[t](!0)},sint64:function(){return f.call(this).zzDecode()[t](!1)},fixed64:function(){return d.call(this)[t](!0)},sfixed64:function(){return d.call(this)[t](!1)}})}},5393:function(e,t,r){"use strict";e.exports=o;var n=r(9430);(o.prototype=Object.create(n.prototype)).constructor=o;var i=r(8335);function o(e){n.call(this,e)}o._configure=function(){i.Buffer&&(o.prototype._slice=i.Buffer.prototype.slice)},o.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+e,this.len))},o._configure()},9894:function(e,t,r){"use strict";e.exports=f;var n=r(7905);((f.prototype=Object.create(n.prototype)).constructor=f).className="Root";var i,o,a,s=r(229),u=r(986),c=r(2698),l=r(6021);function f(e){n.call(this,"",e),this.deferred=[],this.files=[]}function h(){}f.fromJSON=function(e,t){return t||(t=new f),e.options&&t.setOptions(e.options),t.addJSON(e.nested)},f.prototype.resolvePath=l.path.resolve,f.prototype.fetch=l.fetch,f.prototype.load=function e(t,r,n){"function"===typeof r&&(n=r,r=void 0);var i=this;if(!n)return l.asPromise(e,i,t,r);var s=n===h;function u(e,t){if(n){var r=n;if(n=null,s)throw e;r(e,t)}}function c(e){var t=e.lastIndexOf("google/protobuf/");if(t>-1){var r=e.substring(t);if(r in a)return r}return null}function f(e,t){try{if(l.isString(t)&&"{"===t.charAt(0)&&(t=JSON.parse(t)),l.isString(t)){o.filename=e;var n,a=o(t,i,r),f=0;if(a.imports)for(;f<a.imports.length;++f)(n=c(a.imports[f])||i.resolvePath(e,a.imports[f]))&&d(n);if(a.weakImports)for(f=0;f<a.weakImports.length;++f)(n=c(a.weakImports[f])||i.resolvePath(e,a.weakImports[f]))&&d(n,!0)}else i.setOptions(t.options).addJSON(t.nested)}catch(h){u(h)}s||p||u(null,i)}function d(e,t){if(!(i.files.indexOf(e)>-1))if(i.files.push(e),e in a)s?f(e,a[e]):(++p,setTimeout((function(){--p,f(e,a[e])})));else if(s){var r;try{r=l.fs.readFileSync(e).toString("utf8")}catch(o){return void(t||u(o))}f(e,r)}else++p,i.fetch(e,(function(r,o){--p,n&&(r?t?p||u(null,i):u(r):f(e,o))}))}var p=0;l.isString(t)&&(t=[t]);for(var v,g=0;g<t.length;++g)(v=i.resolvePath("",t[g]))&&d(v);if(s)return i;p||u(null,i)},f.prototype.loadSync=function(e,t){if(!l.isNode)throw Error("not supported");return this.load(e,t,h)},f.prototype.resolveAll=function(){if(this.deferred.length)throw Error("unresolvable extensions: "+this.deferred.map((function(e){return"'extend "+e.extend+"' in "+e.parent.fullName})).join(", "));return n.prototype.resolveAll.call(this)};var d=/^[A-Z]/;function p(e,t){var r=t.parent.lookup(t.extend);if(r){var n=new s(t.fullName,t.id,t.type,t.rule,void 0,t.options);return n.declaringField=t,t.extensionField=n,r.add(n),!0}return!1}f.prototype._handleAdd=function(e){if(e instanceof s)void 0===e.extend||e.extensionField||p(0,e)||this.deferred.push(e);else if(e instanceof u)d.test(e.name)&&(e.parent[e.name]=e.values);else if(!(e instanceof c)){if(e instanceof i)for(var t=0;t<this.deferred.length;)p(0,this.deferred[t])?this.deferred.splice(t,1):++t;for(var r=0;r<e.nestedArray.length;++r)this._handleAdd(e._nestedArray[r]);d.test(e.name)&&(e.parent[e.name]=e)}},f.prototype._handleRemove=function(e){if(e instanceof s){if(void 0!==e.extend)if(e.extensionField)e.extensionField.parent.remove(e.extensionField),e.extensionField=null;else{var t=this.deferred.indexOf(e);t>-1&&this.deferred.splice(t,1)}}else if(e instanceof u)d.test(e.name)&&delete e.parent[e.name];else if(e instanceof n){for(var r=0;r<e.nestedArray.length;++r)this._handleRemove(e._nestedArray[r]);d.test(e.name)&&delete e.parent[e.name]}},f._configure=function(e,t,r){i=e,o=t,a=r}},1552:function(e){"use strict";e.exports={}},3776:function(e,t,r){"use strict";t.Service=r(3052)},3052:function(e,t,r){"use strict";e.exports=i;var n=r(8335);function i(e,t,r){if("function"!==typeof e)throw TypeError("rpcImpl must be a function");n.EventEmitter.call(this),this.rpcImpl=e,this.requestDelimited=Boolean(t),this.responseDelimited=Boolean(r)}(i.prototype=Object.create(n.EventEmitter.prototype)).constructor=i,i.prototype.rpcCall=function e(t,r,i,o,a){if(!o)throw TypeError("request must be specified");var s=this;if(!a)return n.asPromise(e,s,t,r,i,o);if(s.rpcImpl)try{return s.rpcImpl(t,r[s.requestDelimited?"encodeDelimited":"encode"](o).finish(),(function(e,r){if(e)return s.emit("error",e,t),a(e);if(null!==r){if(!(r instanceof i))try{r=i[s.responseDelimited?"decodeDelimited":"decode"](r)}catch(e){return s.emit("error",e,t),a(e)}return s.emit("data",r,t),a(null,r)}s.end(!0)}))}catch(u){return s.emit("error",u,t),void setTimeout((function(){a(u)}),0)}else setTimeout((function(){a(Error("already ended"))}),0)},i.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}},2867:function(e,t,r){"use strict";e.exports=s;var n=r(7905);((s.prototype=Object.create(n.prototype)).constructor=s).className="Service";var i=r(7405),o=r(6021),a=r(3776);function s(e,t){n.call(this,e,t),this.methods={},this._methodsArray=null}function u(e){return e._methodsArray=null,e}s.fromJSON=function(e,t){var r=new s(e,t.options);if(t.methods)for(var n=Object.keys(t.methods),o=0;o<n.length;++o)r.add(i.fromJSON(n[o],t.methods[n[o]]));return t.nested&&r.addJSON(t.nested),r.comment=t.comment,r},s.prototype.toJSON=function(e){var t=n.prototype.toJSON.call(this,e),r=!!e&&Boolean(e.keepComments);return o.toObject(["options",t&&t.options||void 0,"methods",n.arrayToJSON(this.methodsArray,e)||{},"nested",t&&t.nested||void 0,"comment",r?this.comment:void 0])},Object.defineProperty(s.prototype,"methodsArray",{get:function(){return this._methodsArray||(this._methodsArray=o.toArray(this.methods))}}),s.prototype.get=function(e){return this.methods[e]||n.prototype.get.call(this,e)},s.prototype.resolveAll=function(){for(var e=this.methodsArray,t=0;t<e.length;++t)e[t].resolve();return n.prototype.resolve.call(this)},s.prototype.add=function(e){if(this.get(e.name))throw Error("duplicate name '"+e.name+"' in "+this);return e instanceof i?(this.methods[e.name]=e,e.parent=this,u(this)):n.prototype.add.call(this,e)},s.prototype.remove=function(e){if(e instanceof i){if(this.methods[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.methods[e.name],e.parent=null,u(this)}return n.prototype.remove.call(this,e)},s.prototype.create=function(e,t,r){for(var n,i=new a.Service(e,t,r),s=0;s<this.methodsArray.length;++s){var u=o.lcFirst((n=this._methodsArray[s]).resolve().name).replace(/[^$\w_]/g,"");i[u]=o.codegen(["r","c"],o.isReserved(u)?u+"_":u)("return this.rpcCall(m,q,s,r,c)")({m:n,q:n.resolvedRequestType.ctor,s:n.resolvedResponseType.ctor})}return i}},5003:function(e){"use strict";e.exports=f;var t=/[\s{}=;:[\],'"()<>]/g,r=/(?:"([^"\\]*(?:\\.[^"\\]*)*)")/g,n=/(?:'([^'\\]*(?:\\.[^'\\]*)*)')/g,i=/^ *[*/]+ */,o=/^\s*\*?\/*/,a=/\n/g,s=/\s/,u=/\\(.?)/g,c={0:"\0",r:"\r",n:"\n",t:"\t"};function l(e){return e.replace(u,(function(e,t){switch(t){case"\\":case"":return t;default:return c[t]||""}}))}function f(e,u){e=e.toString();var c=0,f=e.length,h=1,d=0,p={},v=[],g=null;function y(e){return Error("illegal "+e+" (line "+h+")")}function m(t){return e.charAt(t)}function b(t,r,n){var s,c={type:e.charAt(t++),lineEmpty:!1,leading:n},l=t-(u?2:3);do{if(--l<0||"\n"===(s=e.charAt(l))){c.lineEmpty=!0;break}}while(" "===s||"\t"===s);for(var f=e.substring(t,r).split(a),v=0;v<f.length;++v)f[v]=f[v].replace(u?o:i,"").trim();c.text=f.join("\n").trim(),p[h]=c,d=h}function w(t){var r=k(t),n=e.substring(t,r);return/^\s*\/{1,2}/.test(n)}function k(e){for(var t=e;t<f&&"\n"!==m(t);)t++;return t}function E(){if(v.length>0)return v.shift();if(g)return function(){var t="'"===g?n:r;t.lastIndex=c-1;var i=t.exec(e);if(!i)throw y("string");return c=t.lastIndex,x(g),g=null,l(i[1])}();var i,o,a,d,p,E=0===c;do{if(c===f)return null;for(i=!1;s.test(a=m(c));)if("\n"===a&&(E=!0,++h),++c===f)return null;if("/"===m(c)){if(++c===f)throw y("comment");if("/"===m(c))if(u){if(d=c,p=!1,w(c)){p=!0;do{if((c=k(c))===f)break;if(c++,!E)break}while(w(c))}else c=Math.min(f,k(c)+1);p&&(b(d,c,E),E=!0),h++,i=!0}else{for(p="/"===m(d=c+1);"\n"!==m(++c);)if(c===f)return null;++c,p&&(b(d,c-1,E),E=!0),++h,i=!0}else{if("*"!==(a=m(c)))return"/";d=c+1,p=u||"*"===m(d);do{if("\n"===a&&++h,++c===f)throw y("comment");o=a,a=m(c)}while("*"!==o||"/"!==a);++c,p&&(b(d,c-2,E),E=!0),i=!0}}}while(i);var S=c;if(t.lastIndex=0,!t.test(m(S++)))for(;S<f&&!t.test(m(S));)++S;var _=e.substring(c,c=S);return'"'!==_&&"'"!==_||(g=_),_}function x(e){v.push(e)}function S(){if(!v.length){var e=E();if(null===e)return null;x(e)}return v[0]}return Object.defineProperty({next:E,peek:S,push:x,skip:function(e,t){var r=S();if(r===e)return E(),!0;if(!t)throw y("token '"+r+"', '"+e+"' expected");return!1},cmnt:function(e){var t,r=null;return void 0===e?(t=p[h-1],delete p[h-1],t&&(u||"*"===t.type||t.lineEmpty)&&(r=t.leading?t.text:null)):(d<e&&S(),t=p[e],delete p[e],!t||t.lineEmpty||!u&&"/"!==t.type||(r=t.leading?null:t.text)),r}},"line",{get:function(){return h}})}f.unescape=l},5174:function(e,t,r){"use strict";e.exports=m;var n=r(7905);((m.prototype=Object.create(n.prototype)).constructor=m).className="Type";var i=r(986),o=r(2698),a=r(229),s=r(7600),u=r(2867),c=r(7537),l=r(9430),f=r(3471),h=r(6021),d=r(2402),p=r(297),v=r(8507),g=r(1605),y=r(3218);function m(e,t){n.call(this,e,t),this.fields={},this.oneofs=void 0,this.extensions=void 0,this.reserved=void 0,this.group=void 0,this._fieldsById=null,this._fieldsArray=null,this._oneofsArray=null,this._ctor=null}function b(e){return e._fieldsById=e._fieldsArray=e._oneofsArray=null,delete e.encode,delete e.decode,delete e.verify,e}Object.defineProperties(m.prototype,{fieldsById:{get:function(){if(this._fieldsById)return this._fieldsById;this._fieldsById={};for(var e=Object.keys(this.fields),t=0;t<e.length;++t){var r=this.fields[e[t]],n=r.id;if(this._fieldsById[n])throw Error("duplicate id "+n+" in "+this);this._fieldsById[n]=r}return this._fieldsById}},fieldsArray:{get:function(){return this._fieldsArray||(this._fieldsArray=h.toArray(this.fields))}},oneofsArray:{get:function(){return this._oneofsArray||(this._oneofsArray=h.toArray(this.oneofs))}},ctor:{get:function(){return this._ctor||(this.ctor=m.generateConstructor(this)())},set:function(e){var t=e.prototype;t instanceof c||((e.prototype=new c).constructor=e,h.merge(e.prototype,t)),e.$type=e.prototype.$type=this,h.merge(e,c,!0),this._ctor=e;for(var r=0;r<this.fieldsArray.length;++r)this._fieldsArray[r].resolve();var n={};for(r=0;r<this.oneofsArray.length;++r)n[this._oneofsArray[r].resolve().name]={get:h.oneOfGetter(this._oneofsArray[r].oneof),set:h.oneOfSetter(this._oneofsArray[r].oneof)};r&&Object.defineProperties(e.prototype,n)}}}),m.generateConstructor=function(e){for(var t,r=h.codegen(["p"],e.name),n=0;n<e.fieldsArray.length;++n)(t=e._fieldsArray[n]).map?r("this%s={}",h.safeProp(t.name)):t.repeated&&r("this%s=[]",h.safeProp(t.name));return r("if(p)for(var ks=Object.keys(p),i=0;i<ks.length;++i)if(p[ks[i]]!=null)")("this[ks[i]]=p[ks[i]]")},m.fromJSON=function(e,t){var r=new m(e,t.options);r.extensions=t.extensions,r.reserved=t.reserved;for(var c=Object.keys(t.fields),l=0;l<c.length;++l)r.add(("undefined"!==typeof t.fields[c[l]].keyType?s.fromJSON:a.fromJSON)(c[l],t.fields[c[l]]));if(t.oneofs)for(c=Object.keys(t.oneofs),l=0;l<c.length;++l)r.add(o.fromJSON(c[l],t.oneofs[c[l]]));if(t.nested)for(c=Object.keys(t.nested),l=0;l<c.length;++l){var f=t.nested[c[l]];r.add((void 0!==f.id?a.fromJSON:void 0!==f.fields?m.fromJSON:void 0!==f.values?i.fromJSON:void 0!==f.methods?u.fromJSON:n.fromJSON)(c[l],f))}return t.extensions&&t.extensions.length&&(r.extensions=t.extensions),t.reserved&&t.reserved.length&&(r.reserved=t.reserved),t.group&&(r.group=!0),t.comment&&(r.comment=t.comment),r},m.prototype.toJSON=function(e){var t=n.prototype.toJSON.call(this,e),r=!!e&&Boolean(e.keepComments);return h.toObject(["options",t&&t.options||void 0,"oneofs",n.arrayToJSON(this.oneofsArray,e),"fields",n.arrayToJSON(this.fieldsArray.filter((function(e){return!e.declaringField})),e)||{},"extensions",this.extensions&&this.extensions.length?this.extensions:void 0,"reserved",this.reserved&&this.reserved.length?this.reserved:void 0,"group",this.group||void 0,"nested",t&&t.nested||void 0,"comment",r?this.comment:void 0])},m.prototype.resolveAll=function(){for(var e=this.fieldsArray,t=0;t<e.length;)e[t++].resolve();var r=this.oneofsArray;for(t=0;t<r.length;)r[t++].resolve();return n.prototype.resolveAll.call(this)},m.prototype.get=function(e){return this.fields[e]||this.oneofs&&this.oneofs[e]||this.nested&&this.nested[e]||null},m.prototype.add=function(e){if(this.get(e.name))throw Error("duplicate name '"+e.name+"' in "+this);if(e instanceof a&&void 0===e.extend){if(this._fieldsById?this._fieldsById[e.id]:this.fieldsById[e.id])throw Error("duplicate id "+e.id+" in "+this);if(this.isReservedId(e.id))throw Error("id "+e.id+" is reserved in "+this);if(this.isReservedName(e.name))throw Error("name '"+e.name+"' is reserved in "+this);return e.parent&&e.parent.remove(e),this.fields[e.name]=e,e.message=this,e.onAdd(this),b(this)}return e instanceof o?(this.oneofs||(this.oneofs={}),this.oneofs[e.name]=e,e.onAdd(this),b(this)):n.prototype.add.call(this,e)},m.prototype.remove=function(e){if(e instanceof a&&void 0===e.extend){if(!this.fields||this.fields[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.fields[e.name],e.parent=null,e.onRemove(this),b(this)}if(e instanceof o){if(!this.oneofs||this.oneofs[e.name]!==e)throw Error(e+" is not a member of "+this);return delete this.oneofs[e.name],e.parent=null,e.onRemove(this),b(this)}return n.prototype.remove.call(this,e)},m.prototype.isReservedId=function(e){return n.isReservedId(this.reserved,e)},m.prototype.isReservedName=function(e){return n.isReservedName(this.reserved,e)},m.prototype.create=function(e){return new this.ctor(e)},m.prototype.setup=function(){for(var e=this.fullName,t=[],r=0;r<this.fieldsArray.length;++r)t.push(this._fieldsArray[r].resolve().resolvedType);this.encode=d(this)({Writer:f,types:t,util:h}),this.decode=p(this)({Reader:l,types:t,util:h}),this.verify=v(this)({types:t,util:h}),this.fromObject=g.fromObject(this)({types:t,util:h}),this.toObject=g.toObject(this)({types:t,util:h});var n=y[e];if(n){var i=Object.create(this);i.fromObject=this.fromObject,this.fromObject=n.fromObject.bind(i),i.toObject=this.toObject,this.toObject=n.toObject.bind(i)}return this},m.prototype.encode=function(e,t){return this.setup().encode(e,t)},m.prototype.encodeDelimited=function(e,t){return this.encode(e,t&&t.len?t.fork():t).ldelim()},m.prototype.decode=function(e,t){return this.setup().decode(e,t)},m.prototype.decodeDelimited=function(e){return e instanceof l||(e=l.create(e)),this.decode(e,e.uint32())},m.prototype.verify=function(e){return this.setup().verify(e)},m.prototype.fromObject=function(e){return this.setup().fromObject(e)},m.prototype.toObject=function(e,t){return this.setup().toObject(e,t)},m.d=function(e){return function(t){h.decorateType(t,e)}}},3372:function(e,t,r){"use strict";var n=t,i=r(6021),o=["double","float","int32","uint32","sint32","fixed32","sfixed32","int64","uint64","sint64","fixed64","sfixed64","bool","string","bytes"];function a(e,t){var r=0,n={};for(t|=0;r<e.length;)n[o[r+t]]=e[r++];return n}n.basic=a([1,5,0,0,0,5,5,0,0,0,1,1,0,2,2]),n.defaults=a([0,0,0,0,0,0,0,0,0,0,0,0,!1,"",i.emptyArray,null]),n.long=a([0,0,0,1,1],7),n.mapKey=a([0,0,0,5,5,0,0,0,1,1,0,2],2),n.packed=a([1,5,0,0,0,5,5,0,0,0,1,1,0])},6021:function(e,t,r){"use strict";var n,i,o=e.exports=r(8335),a=r(1552);o.codegen=r(7988),o.fetch=r(7855),o.path=r(5310),o.fs=o.inquire("fs"),o.toArray=function(e){if(e){for(var t=Object.keys(e),r=new Array(t.length),n=0;n<t.length;)r[n]=e[t[n++]];return r}return[]},o.toObject=function(e){for(var t={},r=0;r<e.length;){var n=e[r++],i=e[r++];void 0!==i&&(t[n]=i)}return t};var s=/\\/g,u=/"/g;o.isReserved=function(e){return/^(?:do|if|in|for|let|new|try|var|case|else|enum|eval|false|null|this|true|void|with|break|catch|class|const|super|throw|while|yield|delete|export|import|public|return|static|switch|typeof|default|extends|finally|package|private|continue|debugger|function|arguments|interface|protected|implements|instanceof)$/.test(e)},o.safeProp=function(e){return!/^[$\w_]+$/.test(e)||o.isReserved(e)?'["'+e.replace(s,"\\\\").replace(u,'\\"')+'"]':"."+e},o.ucFirst=function(e){return e.charAt(0).toUpperCase()+e.substring(1)};var c=/_([a-z])/g;o.camelCase=function(e){return e.substring(0,1)+e.substring(1).replace(c,(function(e,t){return t.toUpperCase()}))},o.compareFieldsById=function(e,t){return e.id-t.id},o.decorateType=function(e,t){if(e.$type)return t&&e.$type.name!==t&&(o.decorateRoot.remove(e.$type),e.$type.name=t,o.decorateRoot.add(e.$type)),e.$type;n||(n=r(5174));var i=new n(t||e.name);return o.decorateRoot.add(i),i.ctor=e,Object.defineProperty(e,"$type",{value:i,enumerable:!1}),Object.defineProperty(e.prototype,"$type",{value:i,enumerable:!1}),i};var l=0;o.decorateEnum=function(e){if(e.$type)return e.$type;i||(i=r(986));var t=new i("Enum"+l++,e);return o.decorateRoot.add(t),Object.defineProperty(e,"$type",{value:t,enumerable:!1}),t},o.setProperty=function(e,t,r){if("object"!==typeof e)throw TypeError("dst must be an object");if(!t)throw TypeError("path must be specified");return function e(t,r,n){var i=r.shift();if("__proto__"===i)return t;if(r.length>0)t[i]=e(t[i]||{},r,n);else{var o=t[i];o&&(n=[].concat(o).concat(n)),t[i]=n}return t}(e,t=t.split("."),r)},Object.defineProperty(o,"decorateRoot",{get:function(){return a.decorated||(a.decorated=new(r(9894)))}})},8564:function(e,t,r){"use strict";e.exports=i;var n=r(8335);function i(e,t){this.lo=e>>>0,this.hi=t>>>0}var o=i.zero=new i(0,0);o.toNumber=function(){return 0},o.zzEncode=o.zzDecode=function(){return this},o.length=function(){return 1};var a=i.zeroHash="\0\0\0\0\0\0\0\0";i.fromNumber=function(e){if(0===e)return o;var t=e<0;t&&(e=-e);var r=e>>>0,n=(e-r)/4294967296>>>0;return t&&(n=~n>>>0,r=~r>>>0,++r>4294967295&&(r=0,++n>4294967295&&(n=0))),new i(r,n)},i.from=function(e){if("number"===typeof e)return i.fromNumber(e);if(n.isString(e)){if(!n.Long)return i.fromNumber(parseInt(e,10));e=n.Long.fromString(e)}return e.low||e.high?new i(e.low>>>0,e.high>>>0):o},i.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=1+~this.lo>>>0,r=~this.hi>>>0;return t||(r=r+1>>>0),-(t+4294967296*r)}return this.lo+4294967296*this.hi},i.prototype.toLong=function(e){return n.Long?new n.Long(0|this.lo,0|this.hi,Boolean(e)):{low:0|this.lo,high:0|this.hi,unsigned:Boolean(e)}};var s=String.prototype.charCodeAt;i.fromHash=function(e){return e===a?o:new i((s.call(e,0)|s.call(e,1)<<8|s.call(e,2)<<16|s.call(e,3)<<24)>>>0,(s.call(e,4)|s.call(e,5)<<8|s.call(e,6)<<16|s.call(e,7)<<24)>>>0)},i.prototype.toHash=function(){return String.fromCharCode(255&this.lo,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,255&this.hi,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)},i.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this},i.prototype.zzDecode=function(){var e=-(1&this.lo);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this},i.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,r=this.hi>>>24;return 0===r?0===t?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:r<128?9:10}},8335:function(e,t,r){"use strict";var n=t;function i(e,t,r){for(var n=Object.keys(t),i=0;i<n.length;++i)void 0!==e[n[i]]&&r||(e[n[i]]=t[n[i]]);return e}function o(e){function t(e,r){if(!(this instanceof t))return new t(e,r);Object.defineProperty(this,"message",{get:function(){return e}}),Error.captureStackTrace?Error.captureStackTrace(this,t):Object.defineProperty(this,"stack",{value:(new Error).stack||""}),r&&i(this,r)}return t.prototype=Object.create(Error.prototype,{constructor:{value:t,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return e},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),t}n.asPromise=r(193),n.base64=r(3211),n.EventEmitter=r(2968),n.float=r(1916),n.inquire=r(861),n.utf8=r(1748),n.pool=r(2888),n.LongBits=r(8564),n.isNode=Boolean("undefined"!==typeof r.g&&r.g&&r.g.process&&r.g.process.versions&&r.g.process.versions.node),n.global=n.isNode&&r.g||"undefined"!==typeof window&&window||"undefined"!==typeof self&&self||this,n.emptyArray=Object.freeze?Object.freeze([]):[],n.emptyObject=Object.freeze?Object.freeze({}):{},n.isInteger=Number.isInteger||function(e){return"number"===typeof e&&isFinite(e)&&Math.floor(e)===e},n.isString=function(e){return"string"===typeof e||e instanceof String},n.isObject=function(e){return e&&"object"===typeof e},n.isset=n.isSet=function(e,t){var r=e[t];return!(null==r||!e.hasOwnProperty(t))&&("object"!==typeof r||(Array.isArray(r)?r.length:Object.keys(r).length)>0)},n.Buffer=function(){try{var e=n.inquire("buffer").Buffer;return e.prototype.utf8Write?e:null}catch(t){return null}}(),n._Buffer_from=null,n._Buffer_allocUnsafe=null,n.newBuffer=function(e){return"number"===typeof e?n.Buffer?n._Buffer_allocUnsafe(e):new n.Array(e):n.Buffer?n._Buffer_from(e):"undefined"===typeof Uint8Array?e:new Uint8Array(e)},n.Array="undefined"!==typeof Uint8Array?Uint8Array:Array,n.Long=n.global.dcodeIO&&n.global.dcodeIO.Long||n.global.Long||n.inquire("long"),n.key2Re=/^true|false|0|1$/,n.key32Re=/^-?(?:0|[1-9][0-9]*)$/,n.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/,n.longToHash=function(e){return e?n.LongBits.from(e).toHash():n.LongBits.zeroHash},n.longFromHash=function(e,t){var r=n.LongBits.fromHash(e);return n.Long?n.Long.fromBits(r.lo,r.hi,t):r.toNumber(Boolean(t))},n.merge=i,n.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)},n.newError=o,n.ProtocolError=o("ProtocolError"),n.oneOfGetter=function(e){for(var t={},r=0;r<e.length;++r)t[e[r]]=1;return function(){for(var e=Object.keys(this),r=e.length-1;r>-1;--r)if(1===t[e[r]]&&void 0!==this[e[r]]&&null!==this[e[r]])return e[r]}},n.oneOfSetter=function(e){return function(t){for(var r=0;r<e.length;++r)e[r]!==t&&delete this[e[r]]}},n.toJSONOptions={longs:String,enums:String,bytes:String,json:!0},n._configure=function(){var e=n.Buffer;e?(n._Buffer_from=e.from!==Uint8Array.from&&e.from||function(t,r){return new e(t,r)},n._Buffer_allocUnsafe=e.allocUnsafe||function(t){return new e(t)}):n._Buffer_from=n._Buffer_allocUnsafe=null}},8507:function(e,t,r){"use strict";e.exports=function(e){var t=i.codegen(["m"],e.name+"$verify")('if(typeof m!=="object"||m===null)')("return%j","object expected"),r=e.oneofsArray,n={};r.length&&t("var p={}");for(var u=0;u<e.fieldsArray.length;++u){var c=e._fieldsArray[u].resolve(),l="m"+i.safeProp(c.name);if(c.optional&&t("if(%s!=null&&m.hasOwnProperty(%j)){",l,c.name),c.map)t("if(!util.isObject(%s))",l)("return%j",o(c,"object"))("var k=Object.keys(%s)",l)("for(var i=0;i<k.length;++i){"),s(t,c,"k[i]"),a(t,c,u,l+"[k[i]]")("}");else if(c.repeated)t("if(!Array.isArray(%s))",l)("return%j",o(c,"array"))("for(var i=0;i<%s.length;++i){",l),a(t,c,u,l+"[i]")("}");else{if(c.partOf){var f=i.safeProp(c.partOf.name);1===n[c.partOf.name]&&t("if(p%s===1)",f)("return%j",c.partOf.name+": multiple values"),n[c.partOf.name]=1,t("p%s=1",f)}a(t,c,u,l)}c.optional&&t("}")}return t("return null")};var n=r(986),i=r(6021);function o(e,t){return e.name+": "+t+(e.repeated&&"array"!==t?"[]":e.map&&"object"!==t?"{k:"+e.keyType+"}":"")+" expected"}function a(e,t,r,i){if(t.resolvedType)if(t.resolvedType instanceof n){e("switch(%s){",i)("default:")("return%j",o(t,"enum value"));for(var a=Object.keys(t.resolvedType.values),s=0;s<a.length;++s)e("case %i:",t.resolvedType.values[a[s]]);e("break")("}")}else e("{")("var e=types[%i].verify(%s);",r,i)("if(e)")("return%j+e",t.name+".")("}");else switch(t.type){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":e("if(!util.isInteger(%s))",i)("return%j",o(t,"integer"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":e("if(!util.isInteger(%s)&&!(%s&&util.isInteger(%s.low)&&util.isInteger(%s.high)))",i,i,i,i)("return%j",o(t,"integer|Long"));break;case"float":case"double":e('if(typeof %s!=="number")',i)("return%j",o(t,"number"));break;case"bool":e('if(typeof %s!=="boolean")',i)("return%j",o(t,"boolean"));break;case"string":e("if(!util.isString(%s))",i)("return%j",o(t,"string"));break;case"bytes":e('if(!(%s&&typeof %s.length==="number"||util.isString(%s)))',i,i,i)("return%j",o(t,"buffer"))}return e}function s(e,t,r){switch(t.keyType){case"int32":case"uint32":case"sint32":case"fixed32":case"sfixed32":e("if(!util.key32Re.test(%s))",r)("return%j",o(t,"integer key"));break;case"int64":case"uint64":case"sint64":case"fixed64":case"sfixed64":e("if(!util.key64Re.test(%s))",r)("return%j",o(t,"integer|Long key"));break;case"bool":e("if(!util.key2Re.test(%s))",r)("return%j",o(t,"boolean key"))}return e}},3218:function(e,t,r){"use strict";var n=t,i=r(7537);n[".google.protobuf.Any"]={fromObject:function(e){if(e&&e["@type"]){var t=e["@type"].substring(e["@type"].lastIndexOf("/")+1),r=this.lookup(t);if(r){var n="."===e["@type"].charAt(0)?e["@type"].slice(1):e["@type"];return-1===n.indexOf("/")&&(n="/"+n),this.create({type_url:n,value:r.encode(r.fromObject(e)).finish()})}}return this.fromObject(e)},toObject:function(e,t){var r="",n="";if(t&&t.json&&e.type_url&&e.value){n=e.type_url.substring(e.type_url.lastIndexOf("/")+1),r=e.type_url.substring(0,e.type_url.lastIndexOf("/")+1);var o=this.lookup(n);o&&(e=o.decode(e.value))}if(!(e instanceof this.ctor)&&e instanceof i){var a=e.$type.toObject(e,t);return""===r&&(r="type.googleapis.com/"),n=r+("."===e.$type.fullName[0]?e.$type.fullName.slice(1):e.$type.fullName),a["@type"]=n,a}return this.toObject(e,t)}}},3471:function(e,t,r){"use strict";e.exports=f;var n,i=r(8335),o=i.LongBits,a=i.base64,s=i.utf8;function u(e,t,r){this.fn=e,this.len=t,this.next=void 0,this.val=r}function c(){}function l(e){this.head=e.head,this.tail=e.tail,this.len=e.len,this.next=e.states}function f(){this.len=0,this.head=new u(c,0,0),this.tail=this.head,this.states=null}var h=function(){return i.Buffer?function(){return(f.create=function(){return new n})()}:function(){return new f}};function d(e,t,r){t[r]=255&e}function p(e,t){this.len=e,this.next=void 0,this.val=t}function v(e,t,r){for(;e.hi;)t[r++]=127&e.lo|128,e.lo=(e.lo>>>7|e.hi<<25)>>>0,e.hi>>>=7;for(;e.lo>127;)t[r++]=127&e.lo|128,e.lo=e.lo>>>7;t[r++]=e.lo}function g(e,t,r){t[r]=255&e,t[r+1]=e>>>8&255,t[r+2]=e>>>16&255,t[r+3]=e>>>24}f.create=h(),f.alloc=function(e){return new i.Array(e)},i.Array!==Array&&(f.alloc=i.pool(f.alloc,i.Array.prototype.subarray)),f.prototype._push=function(e,t,r){return this.tail=this.tail.next=new u(e,t,r),this.len+=t,this},p.prototype=Object.create(u.prototype),p.prototype.fn=function(e,t,r){for(;e>127;)t[r++]=127&e|128,e>>>=7;t[r]=e},f.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new p((e>>>=0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this},f.prototype.int32=function(e){return e<0?this._push(v,10,o.fromNumber(e)):this.uint32(e)},f.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)},f.prototype.uint64=function(e){var t=o.from(e);return this._push(v,t.length(),t)},f.prototype.int64=f.prototype.uint64,f.prototype.sint64=function(e){var t=o.from(e).zzEncode();return this._push(v,t.length(),t)},f.prototype.bool=function(e){return this._push(d,1,e?1:0)},f.prototype.fixed32=function(e){return this._push(g,4,e>>>0)},f.prototype.sfixed32=f.prototype.fixed32,f.prototype.fixed64=function(e){var t=o.from(e);return this._push(g,4,t.lo)._push(g,4,t.hi)},f.prototype.sfixed64=f.prototype.fixed64,f.prototype.float=function(e){return this._push(i.float.writeFloatLE,4,e)},f.prototype.double=function(e){return this._push(i.float.writeDoubleLE,8,e)};var y=i.Array.prototype.set?function(e,t,r){t.set(e,r)}:function(e,t,r){for(var n=0;n<e.length;++n)t[r+n]=e[n]};f.prototype.bytes=function(e){var t=e.length>>>0;if(!t)return this._push(d,1,0);if(i.isString(e)){var r=f.alloc(t=a.length(e));a.decode(e,r,0),e=r}return this.uint32(t)._push(y,t,e)},f.prototype.string=function(e){var t=s.length(e);return t?this.uint32(t)._push(s.write,t,e):this._push(d,1,0)},f.prototype.fork=function(){return this.states=new l(this),this.head=this.tail=new u(c,0,0),this.len=0,this},f.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new u(c,0,0),this.len=0),this},f.prototype.ldelim=function(){var e=this.head,t=this.tail,r=this.len;return this.reset().uint32(r),r&&(this.tail.next=e.next,this.tail=t,this.len+=r),this},f.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),r=0;e;)e.fn(e.val,t,r),r+=e.len,e=e.next;return t},f._configure=function(e){n=e,f.create=h(),n._configure()}},2549:function(e,t,r){"use strict";e.exports=o;var n=r(3471);(o.prototype=Object.create(n.prototype)).constructor=o;var i=r(8335);function o(){n.call(this)}function a(e,t,r){e.length<40?i.utf8.write(e,t,r):t.utf8Write?t.utf8Write(e,r):t.write(e,r)}o._configure=function(){o.alloc=i._Buffer_allocUnsafe,o.writeBytesBuffer=i.Buffer&&i.Buffer.prototype instanceof Uint8Array&&"set"===i.Buffer.prototype.set.name?function(e,t,r){t.set(e,r)}:function(e,t,r){if(e.copy)e.copy(t,r,0,e.length);else for(var n=0;n<e.length;)t[r++]=e[n++]}},o.prototype.bytes=function(e){i.isString(e)&&(e=i._Buffer_from(e,"base64"));var t=e.length>>>0;return this.uint32(t),t&&this._push(o.writeBytesBuffer,t,e),this},o.prototype.string=function(e){var t=i.Buffer.byteLength(e);return this.uint32(t),t&&this._push(a,t,e),this},o._configure()},3355:function(e,t,r){"use strict";var n=r(5151),i=r(4711);function o(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r<arguments.length;r++)t+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var a=new Set,s={};function u(e,t){c(e,t),c(e+"Capture",t)}function c(e,t){for(s[e]=t,e=0;e<t.length;e++)a.add(t[e])}var l=!("undefined"===typeof window||"undefined"===typeof window.document||"undefined"===typeof window.document.createElement),f=Object.prototype.hasOwnProperty,h=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,d={},p={};function v(e,t,r,n,i,o,a){this.acceptsBooleans=2===t||3===t||4===t,this.attributeName=n,this.attributeNamespace=i,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=o,this.removeEmptyString=a}var g={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach((function(e){g[e]=new v(e,0,!1,e,null,!1,!1)})),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach((function(e){var t=e[0];g[t]=new v(t,1,!1,e[1],null,!1,!1)})),["contentEditable","draggable","spellCheck","value"].forEach((function(e){g[e]=new v(e,2,!1,e.toLowerCase(),null,!1,!1)})),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach((function(e){g[e]=new v(e,2,!1,e,null,!1,!1)})),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach((function(e){g[e]=new v(e,3,!1,e.toLowerCase(),null,!1,!1)})),["checked","multiple","muted","selected"].forEach((function(e){g[e]=new v(e,3,!0,e,null,!1,!1)})),["capture","download"].forEach((function(e){g[e]=new v(e,4,!1,e,null,!1,!1)})),["cols","rows","size","span"].forEach((function(e){g[e]=new v(e,6,!1,e,null,!1,!1)})),["rowSpan","start"].forEach((function(e){g[e]=new v(e,5,!1,e.toLowerCase(),null,!1,!1)}));var y=/[\-:]([a-z])/g;function m(e){return e[1].toUpperCase()}function b(e,t,r,n){var i=g.hasOwnProperty(t)?g[t]:null;(null!==i?0!==i.type:n||!(2<t.length)||"o"!==t[0]&&"O"!==t[0]||"n"!==t[1]&&"N"!==t[1])&&(function(e,t,r,n){if(null===t||"undefined"===typeof t||function(e,t,r,n){if(null!==r&&0===r.type)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return!n&&(null!==r?!r.acceptsBooleans:"data-"!==(e=e.toLowerCase().slice(0,5))&&"aria-"!==e);default:return!1}}(e,t,r,n))return!0;if(n)return!1;if(null!==r)switch(r.type){case 3:return!t;case 4:return!1===t;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}(t,r,i,n)&&(r=null),n||null===i?function(e){return!!f.call(p,e)||!f.call(d,e)&&(h.test(e)?p[e]=!0:(d[e]=!0,!1))}(t)&&(null===r?e.removeAttribute(t):e.setAttribute(t,""+r)):i.mustUseProperty?e[i.propertyName]=null===r?3!==i.type&&"":r:(t=i.attributeName,n=i.attributeNamespace,null===r?e.removeAttribute(t):(r=3===(i=i.type)||4===i&&!0===r?"":""+r,n?e.setAttributeNS(n,t,r):e.setAttribute(t,r))))}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach((function(e){var t=e.replace(y,m);g[t]=new v(t,1,!1,e,null,!1,!1)})),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach((function(e){var t=e.replace(y,m);g[t]=new v(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)})),["xml:base","xml:lang","xml:space"].forEach((function(e){var t=e.replace(y,m);g[t]=new v(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)})),["tabIndex","crossOrigin"].forEach((function(e){g[e]=new v(e,1,!1,e.toLowerCase(),null,!1,!1)})),g.xlinkHref=new v("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach((function(e){g[e]=new v(e,1,!1,e.toLowerCase(),null,!0,!0)}));var w=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,k=Symbol.for("react.element"),E=Symbol.for("react.portal"),x=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),_=Symbol.for("react.profiler"),A=Symbol.for("react.provider"),I=Symbol.for("react.context"),C=Symbol.for("react.forward_ref"),T=Symbol.for("react.suspense"),P=Symbol.for("react.suspense_list"),R=Symbol.for("react.memo"),B=Symbol.for("react.lazy");Symbol.for("react.scope"),Symbol.for("react.debug_trace_mode");var M=Symbol.for("react.offscreen");Symbol.for("react.legacy_hidden"),Symbol.for("react.cache"),Symbol.for("react.tracing_marker");var N=Symbol.iterator;function O(e){return null===e||"object"!==typeof e?null:"function"===typeof(e=N&&e[N]||e["@@iterator"])?e:null}var D,L=Object.assign;function U(e){if(void 0===D)try{throw Error()}catch(r){var t=r.stack.trim().match(/\n( *(at )?)/);D=t&&t[1]||""}return"\n"+D+e}var F=!1;function z(e,t){if(!e||F)return"";F=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),"object"===typeof Reflect&&Reflect.construct){try{Reflect.construct(t,[])}catch(c){var n=c}Reflect.construct(e,[],t)}else{try{t.call()}catch(c){n=c}e.call(t.prototype)}else{try{throw Error()}catch(c){n=c}e()}}catch(c){if(c&&n&&"string"===typeof c.stack){for(var i=c.stack.split("\n"),o=n.stack.split("\n"),a=i.length-1,s=o.length-1;1<=a&&0<=s&&i[a]!==o[s];)s--;for(;1<=a&&0<=s;a--,s--)if(i[a]!==o[s]){if(1!==a||1!==s)do{if(a--,0>--s||i[a]!==o[s]){var u="\n"+i[a].replace(" at new "," at ");return e.displayName&&u.includes("<anonymous>")&&(u=u.replace("<anonymous>",e.displayName)),u}}while(1<=a&&0<=s);break}}}finally{F=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?U(e):""}function Z(e){switch(e.tag){case 5:return U(e.type);case 16:return U("Lazy");case 13:return U("Suspense");case 19:return U("SuspenseList");case 0:case 2:case 15:return e=z(e.type,!1);case 11:return e=z(e.type.render,!1);case 1:return e=z(e.type,!0);default:return""}}function j(e){if(null==e)return null;if("function"===typeof e)return e.displayName||e.name||null;if("string"===typeof e)return e;switch(e){case x:return"Fragment";case E:return"Portal";case _:return"Profiler";case S:return"StrictMode";case T:return"Suspense";case P:return"SuspenseList"}if("object"===typeof e)switch(e.$$typeof){case I:return(e.displayName||"Context")+".Consumer";case A:return(e._context.displayName||"Context")+".Provider";case C:var t=e.render;return(e=e.displayName)||(e=""!==(e=t.displayName||t.name||"")?"ForwardRef("+e+")":"ForwardRef"),e;case R:return null!==(t=e.displayName||null)?t:j(e.type)||"Memo";case B:t=e._payload,e=e._init;try{return j(e(t))}catch(r){}}return null}function q(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=(e=t.render).displayName||e.name||"",t.displayName||(""!==e?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return j(t);case 8:return t===S?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if("function"===typeof t)return t.displayName||t.name||null;if("string"===typeof t)return t}return null}function K(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":case"object":return e;default:return""}}function V(e){var t=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===t||"radio"===t)}function H(e){e._valueTracker||(e._valueTracker=function(e){var t=V(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&"undefined"!==typeof r&&"function"===typeof r.get&&"function"===typeof r.set){var i=r.get,o=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=""+e,o.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=""+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}(e))}function G(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=V(e)?e.checked?"true":"false":e.value),(e=n)!==r&&(t.setValue(e),!0)}function W(e){if("undefined"===typeof(e=e||("undefined"!==typeof document?document:void 0)))return null;try{return e.activeElement||e.body}catch(t){return e.body}}function Q(e,t){var r=t.checked;return L({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=r?r:e._wrapperState.initialChecked})}function J(e,t){var r=null==t.defaultValue?"":t.defaultValue,n=null!=t.checked?t.checked:t.defaultChecked;r=K(null!=t.value?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:"checkbox"===t.type||"radio"===t.type?null!=t.checked:null!=t.value}}function Y(e,t){null!=(t=t.checked)&&b(e,"checked",t,!1)}function X(e,t){Y(e,t);var r=K(t.value),n=t.type;if(null!=r)"number"===n?(0===r&&""===e.value||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if("submit"===n||"reset"===n)return void e.removeAttribute("value");t.hasOwnProperty("value")?ee(e,t.type,r):t.hasOwnProperty("defaultValue")&&ee(e,t.type,K(t.defaultValue)),null==t.checked&&null!=t.defaultChecked&&(e.defaultChecked=!!t.defaultChecked)}function $(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!("submit"!==n&&"reset"!==n||void 0!==t.value&&null!==t.value))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}""!==(r=e.name)&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,""!==r&&(e.name=r)}function ee(e,t,r){"number"===t&&W(e.ownerDocument)===e||(null==r?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var te=Array.isArray;function re(e,t,r,n){if(e=e.options,t){t={};for(var i=0;i<r.length;i++)t["$"+r[i]]=!0;for(r=0;r<e.length;r++)i=t.hasOwnProperty("$"+e[r].value),e[r].selected!==i&&(e[r].selected=i),i&&n&&(e[r].defaultSelected=!0)}else{for(r=""+K(r),t=null,i=0;i<e.length;i++){if(e[i].value===r)return e[i].selected=!0,void(n&&(e[i].defaultSelected=!0));null!==t||e[i].disabled||(t=e[i])}null!==t&&(t.selected=!0)}}function ne(e,t){if(null!=t.dangerouslySetInnerHTML)throw Error(o(91));return L({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function ie(e,t){var r=t.value;if(null==r){if(r=t.children,t=t.defaultValue,null!=r){if(null!=t)throw Error(o(92));if(te(r)){if(1<r.length)throw Error(o(93));r=r[0]}t=r}null==t&&(t=""),r=t}e._wrapperState={initialValue:K(r)}}function oe(e,t){var r=K(t.value),n=K(t.defaultValue);null!=r&&((r=""+r)!==e.value&&(e.value=r),null==t.defaultValue&&e.defaultValue!==r&&(e.defaultValue=r)),null!=n&&(e.defaultValue=""+n)}function ae(e){var t=e.textContent;t===e._wrapperState.initialValue&&""!==t&&null!==t&&(e.value=t)}function se(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function ue(e,t){return null==e||"http://www.w3.org/1999/xhtml"===e?se(t):"http://www.w3.org/2000/svg"===e&&"foreignObject"===t?"http://www.w3.org/1999/xhtml":e}var ce,le,fe=(le=function(e,t){if("http://www.w3.org/2000/svg"!==e.namespaceURI||"innerHTML"in e)e.innerHTML=t;else{for((ce=ce||document.createElement("div")).innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=ce.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}},"undefined"!==typeof MSApp&&MSApp.execUnsafeLocalFunction?function(e,t,r,n){MSApp.execUnsafeLocalFunction((function(){return le(e,t)}))}:le);function he(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&3===r.nodeType)return void(r.nodeValue=t)}e.textContent=t}var de={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},pe=["Webkit","ms","Moz","O"];function ve(e,t,r){return null==t||"boolean"===typeof t||""===t?"":r||"number"!==typeof t||0===t||de.hasOwnProperty(e)&&de[e]?(""+t).trim():t+"px"}function ge(e,t){for(var r in e=e.style,t)if(t.hasOwnProperty(r)){var n=0===r.indexOf("--"),i=ve(r,t[r],n);"float"===r&&(r="cssFloat"),n?e.setProperty(r,i):e[r]=i}}Object.keys(de).forEach((function(e){pe.forEach((function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),de[t]=de[e]}))}));var ye=L({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function me(e,t){if(t){if(ye[e]&&(null!=t.children||null!=t.dangerouslySetInnerHTML))throw Error(o(137,e));if(null!=t.dangerouslySetInnerHTML){if(null!=t.children)throw Error(o(60));if("object"!==typeof t.dangerouslySetInnerHTML||!("__html"in t.dangerouslySetInnerHTML))throw Error(o(61))}if(null!=t.style&&"object"!==typeof t.style)throw Error(o(62))}}function be(e,t){if(-1===e.indexOf("-"))return"string"===typeof t.is;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var we=null;function ke(e){return(e=e.target||e.srcElement||window).correspondingUseElement&&(e=e.correspondingUseElement),3===e.nodeType?e.parentNode:e}var Ee=null,xe=null,Se=null;function _e(e){if(e=bi(e)){if("function"!==typeof Ee)throw Error(o(280));var t=e.stateNode;t&&(t=ki(t),Ee(e.stateNode,e.type,t))}}function Ae(e){xe?Se?Se.push(e):Se=[e]:xe=e}function Ie(){if(xe){var e=xe,t=Se;if(Se=xe=null,_e(e),t)for(e=0;e<t.length;e++)_e(t[e])}}function Ce(e,t){return e(t)}function Te(){}var Pe=!1;function Re(e,t,r){if(Pe)return e(t,r);Pe=!0;try{return Ce(e,t,r)}finally{Pe=!1,(null!==xe||null!==Se)&&(Te(),Ie())}}function Be(e,t){var r=e.stateNode;if(null===r)return null;var n=ki(r);if(null===n)return null;r=n[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(n=!("button"===(e=e.type)||"input"===e||"select"===e||"textarea"===e)),e=!n;break e;default:e=!1}if(e)return null;if(r&&"function"!==typeof r)throw Error(o(231,t,typeof r));return r}var Me=!1;if(l)try{var Ne={};Object.defineProperty(Ne,"passive",{get:function(){Me=!0}}),window.addEventListener("test",Ne,Ne),window.removeEventListener("test",Ne,Ne)}catch(le){Me=!1}function Oe(e,t,r,n,i,o,a,s,u){var c=Array.prototype.slice.call(arguments,3);try{t.apply(r,c)}catch(l){this.onError(l)}}var De=!1,Le=null,Ue=!1,Fe=null,ze={onError:function(e){De=!0,Le=e}};function Ze(e,t,r,n,i,o,a,s,u){De=!1,Le=null,Oe.apply(ze,arguments)}function je(e){var t=e,r=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do{0!==(4098&(t=e).flags)&&(r=t.return),e=t.return}while(e)}return 3===t.tag?r:null}function qe(e){if(13===e.tag){var t=e.memoizedState;if(null===t&&(null!==(e=e.alternate)&&(t=e.memoizedState)),null!==t)return t.dehydrated}return null}function Ke(e){if(je(e)!==e)throw Error(o(188))}function Ve(e){return null!==(e=function(e){var t=e.alternate;if(!t){if(null===(t=je(e)))throw Error(o(188));return t!==e?null:e}for(var r=e,n=t;;){var i=r.return;if(null===i)break;var a=i.alternate;if(null===a){if(null!==(n=i.return)){r=n;continue}break}if(i.child===a.child){for(a=i.child;a;){if(a===r)return Ke(i),e;if(a===n)return Ke(i),t;a=a.sibling}throw Error(o(188))}if(r.return!==n.return)r=i,n=a;else{for(var s=!1,u=i.child;u;){if(u===r){s=!0,r=i,n=a;break}if(u===n){s=!0,n=i,r=a;break}u=u.sibling}if(!s){for(u=a.child;u;){if(u===r){s=!0,r=a,n=i;break}if(u===n){s=!0,n=a,r=i;break}u=u.sibling}if(!s)throw Error(o(189))}}if(r.alternate!==n)throw Error(o(190))}if(3!==r.tag)throw Error(o(188));return r.stateNode.current===r?e:t}(e))?He(e):null}function He(e){if(5===e.tag||6===e.tag)return e;for(e=e.child;null!==e;){var t=He(e);if(null!==t)return t;e=e.sibling}return null}var Ge=i.unstable_scheduleCallback,We=i.unstable_cancelCallback,Qe=i.unstable_shouldYield,Je=i.unstable_requestPaint,Ye=i.unstable_now,Xe=i.unstable_getCurrentPriorityLevel,$e=i.unstable_ImmediatePriority,et=i.unstable_UserBlockingPriority,tt=i.unstable_NormalPriority,rt=i.unstable_LowPriority,nt=i.unstable_IdlePriority,it=null,ot=null;var at=Math.clz32?Math.clz32:function(e){return 0===(e>>>=0)?32:31-(st(e)/ut|0)|0},st=Math.log,ut=Math.LN2;var ct=64,lt=4194304;function ft(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return 4194240&e;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return 130023424&e;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function ht(e,t){var r=e.pendingLanes;if(0===r)return 0;var n=0,i=e.suspendedLanes,o=e.pingedLanes,a=268435455&r;if(0!==a){var s=a&~i;0!==s?n=ft(s):0!==(o&=a)&&(n=ft(o))}else 0!==(a=r&~i)?n=ft(a):0!==o&&(n=ft(o));if(0===n)return 0;if(0!==t&&t!==n&&0===(t&i)&&((i=n&-n)>=(o=t&-t)||16===i&&0!==(4194240&o)))return t;if(0!==(4&n)&&(n|=16&r),0!==(t=e.entangledLanes))for(e=e.entanglements,t&=n;0<t;)i=1<<(r=31-at(t)),n|=e[r],t&=~i;return n}function dt(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;default:return-1}}function pt(e){return 0!==(e=-1073741825&e.pendingLanes)?e:1073741824&e?1073741824:0}function vt(){var e=ct;return 0===(4194240&(ct<<=1))&&(ct=64),e}function gt(e){for(var t=[],r=0;31>r;r++)t.push(e);return t}function yt(e,t,r){e.pendingLanes|=t,536870912!==t&&(e.suspendedLanes=0,e.pingedLanes=0),(e=e.eventTimes)[t=31-at(t)]=r}function mt(e,t){var r=e.entangledLanes|=t;for(e=e.entanglements;r;){var n=31-at(r),i=1<<n;i&t|e[n]&t&&(e[n]|=t),r&=~i}}var bt=0;function wt(e){return 1<(e&=-e)?4<e?0!==(268435455&e)?16:536870912:4:1}var kt,Et,xt,St,_t,At=!1,It=[],Ct=null,Tt=null,Pt=null,Rt=new Map,Bt=new Map,Mt=[],Nt="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function Ot(e,t){switch(e){case"focusin":case"focusout":Ct=null;break;case"dragenter":case"dragleave":Tt=null;break;case"mouseover":case"mouseout":Pt=null;break;case"pointerover":case"pointerout":Rt.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Bt.delete(t.pointerId)}}function Dt(e,t,r,n,i,o){return null===e||e.nativeEvent!==o?(e={blockedOn:t,domEventName:r,eventSystemFlags:n,nativeEvent:o,targetContainers:[i]},null!==t&&(null!==(t=bi(t))&&Et(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,null!==i&&-1===t.indexOf(i)&&t.push(i),e)}function Lt(e){var t=mi(e.target);if(null!==t){var r=je(t);if(null!==r)if(13===(t=r.tag)){if(null!==(t=qe(r)))return e.blockedOn=t,void _t(e.priority,(function(){xt(r)}))}else if(3===t&&r.stateNode.current.memoizedState.isDehydrated)return void(e.blockedOn=3===r.tag?r.stateNode.containerInfo:null)}e.blockedOn=null}function Ut(e){if(null!==e.blockedOn)return!1;for(var t=e.targetContainers;0<t.length;){var r=Qt(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(null!==r)return null!==(t=bi(r))&&Et(t),e.blockedOn=r,!1;var n=new(r=e.nativeEvent).constructor(r.type,r);we=n,r.target.dispatchEvent(n),we=null,t.shift()}return!0}function Ft(e,t,r){Ut(e)&&r.delete(t)}function zt(){At=!1,null!==Ct&&Ut(Ct)&&(Ct=null),null!==Tt&&Ut(Tt)&&(Tt=null),null!==Pt&&Ut(Pt)&&(Pt=null),Rt.forEach(Ft),Bt.forEach(Ft)}function Zt(e,t){e.blockedOn===t&&(e.blockedOn=null,At||(At=!0,i.unstable_scheduleCallback(i.unstable_NormalPriority,zt)))}function jt(e){function t(t){return Zt(t,e)}if(0<It.length){Zt(It[0],e);for(var r=1;r<It.length;r++){var n=It[r];n.blockedOn===e&&(n.blockedOn=null)}}for(null!==Ct&&Zt(Ct,e),null!==Tt&&Zt(Tt,e),null!==Pt&&Zt(Pt,e),Rt.forEach(t),Bt.forEach(t),r=0;r<Mt.length;r++)(n=Mt[r]).blockedOn===e&&(n.blockedOn=null);for(;0<Mt.length&&null===(r=Mt[0]).blockedOn;)Lt(r),null===r.blockedOn&&Mt.shift()}var qt=w.ReactCurrentBatchConfig,Kt=!0;function Vt(e,t,r,n){var i=bt,o=qt.transition;qt.transition=null;try{bt=1,Gt(e,t,r,n)}finally{bt=i,qt.transition=o}}function Ht(e,t,r,n){var i=bt,o=qt.transition;qt.transition=null;try{bt=4,Gt(e,t,r,n)}finally{bt=i,qt.transition=o}}function Gt(e,t,r,n){if(Kt){var i=Qt(e,t,r,n);if(null===i)Kn(e,t,n,Wt,r),Ot(e,n);else if(function(e,t,r,n,i){switch(t){case"focusin":return Ct=Dt(Ct,e,t,r,n,i),!0;case"dragenter":return Tt=Dt(Tt,e,t,r,n,i),!0;case"mouseover":return Pt=Dt(Pt,e,t,r,n,i),!0;case"pointerover":var o=i.pointerId;return Rt.set(o,Dt(Rt.get(o)||null,e,t,r,n,i)),!0;case"gotpointercapture":return o=i.pointerId,Bt.set(o,Dt(Bt.get(o)||null,e,t,r,n,i)),!0}return!1}(i,e,t,r,n))n.stopPropagation();else if(Ot(e,n),4&t&&-1<Nt.indexOf(e)){for(;null!==i;){var o=bi(i);if(null!==o&&kt(o),null===(o=Qt(e,t,r,n))&&Kn(e,t,n,Wt,r),o===i)break;i=o}null!==i&&n.stopPropagation()}else Kn(e,t,n,null,r)}}var Wt=null;function Qt(e,t,r,n){if(Wt=null,null!==(e=mi(e=ke(n))))if(null===(t=je(e)))e=null;else if(13===(r=t.tag)){if(null!==(e=qe(t)))return e;e=null}else if(3===r){if(t.stateNode.current.memoizedState.isDehydrated)return 3===t.tag?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return Wt=e,null}function Jt(e){switch(e){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Xe()){case $e:return 1;case et:return 4;case tt:case rt:return 16;case nt:return 536870912;default:return 16}default:return 16}}var Yt=null,Xt=null,$t=null;function er(){if($t)return $t;var e,t,r=Xt,n=r.length,i="value"in Yt?Yt.value:Yt.textContent,o=i.length;for(e=0;e<n&&r[e]===i[e];e++);var a=n-e;for(t=1;t<=a&&r[n-t]===i[o-t];t++);return $t=i.slice(e,1<t?1-t:void 0)}function tr(e){var t=e.keyCode;return"charCode"in e?0===(e=e.charCode)&&13===t&&(e=13):e=t,10===e&&(e=13),32<=e||13===e?e:0}function rr(){return!0}function nr(){return!1}function ir(e){function t(t,r,n,i,o){for(var a in this._reactName=t,this._targetInst=n,this.type=r,this.nativeEvent=i,this.target=o,this.currentTarget=null,e)e.hasOwnProperty(a)&&(t=e[a],this[a]=t?t(i):i[a]);return this.isDefaultPrevented=(null!=i.defaultPrevented?i.defaultPrevented:!1===i.returnValue)?rr:nr,this.isPropagationStopped=nr,this}return L(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():"unknown"!==typeof e.returnValue&&(e.returnValue=!1),this.isDefaultPrevented=rr)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():"unknown"!==typeof e.cancelBubble&&(e.cancelBubble=!0),this.isPropagationStopped=rr)},persist:function(){},isPersistent:rr}),t}var or,ar,sr,ur={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},cr=ir(ur),lr=L({},ur,{view:0,detail:0}),fr=ir(lr),hr=L({},lr,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Sr,button:0,buttons:0,relatedTarget:function(e){return void 0===e.relatedTarget?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==sr&&(sr&&"mousemove"===e.type?(or=e.screenX-sr.screenX,ar=e.screenY-sr.screenY):ar=or=0,sr=e),or)},movementY:function(e){return"movementY"in e?e.movementY:ar}}),dr=ir(hr),pr=ir(L({},hr,{dataTransfer:0})),vr=ir(L({},lr,{relatedTarget:0})),gr=ir(L({},ur,{animationName:0,elapsedTime:0,pseudoElement:0})),yr=L({},ur,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),mr=ir(yr),br=ir(L({},ur,{data:0})),wr={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},kr={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Er={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function xr(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):!!(e=Er[e])&&!!t[e]}function Sr(){return xr}var _r=L({},lr,{key:function(e){if(e.key){var t=wr[e.key]||e.key;if("Unidentified"!==t)return t}return"keypress"===e.type?13===(e=tr(e))?"Enter":String.fromCharCode(e):"keydown"===e.type||"keyup"===e.type?kr[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Sr,charCode:function(e){return"keypress"===e.type?tr(e):0},keyCode:function(e){return"keydown"===e.type||"keyup"===e.type?e.keyCode:0},which:function(e){return"keypress"===e.type?tr(e):"keydown"===e.type||"keyup"===e.type?e.keyCode:0}}),Ar=ir(_r),Ir=ir(L({},hr,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Cr=ir(L({},lr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Sr})),Tr=ir(L({},ur,{propertyName:0,elapsedTime:0,pseudoElement:0})),Pr=L({},hr,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Rr=ir(Pr),Br=[9,13,27,32],Mr=l&&"CompositionEvent"in window,Nr=null;l&&"documentMode"in document&&(Nr=document.documentMode);var Or=l&&"TextEvent"in window&&!Nr,Dr=l&&(!Mr||Nr&&8<Nr&&11>=Nr),Lr=String.fromCharCode(32),Ur=!1;function Fr(e,t){switch(e){case"keyup":return-1!==Br.indexOf(t.keyCode);case"keydown":return 229!==t.keyCode;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function zr(e){return"object"===typeof(e=e.detail)&&"data"in e?e.data:null}var Zr=!1;var jr={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function qr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return"input"===t?!!jr[e.type]:"textarea"===t}function Kr(e,t,r,n){Ae(n),0<(t=Hn(t,"onChange")).length&&(r=new cr("onChange","change",null,r,n),e.push({event:r,listeners:t}))}var Vr=null,Hr=null;function Gr(e){Un(e,0)}function Wr(e){if(G(wi(e)))return e}function Qr(e,t){if("change"===e)return t}var Jr=!1;if(l){var Yr;if(l){var Xr="oninput"in document;if(!Xr){var $r=document.createElement("div");$r.setAttribute("oninput","return;"),Xr="function"===typeof $r.oninput}Yr=Xr}else Yr=!1;Jr=Yr&&(!document.documentMode||9<document.documentMode)}function en(){Vr&&(Vr.detachEvent("onpropertychange",tn),Hr=Vr=null)}function tn(e){if("value"===e.propertyName&&Wr(Hr)){var t=[];Kr(t,Hr,e,ke(e)),Re(Gr,t)}}function rn(e,t,r){"focusin"===e?(en(),Hr=r,(Vr=t).attachEvent("onpropertychange",tn)):"focusout"===e&&en()}function nn(e){if("selectionchange"===e||"keyup"===e||"keydown"===e)return Wr(Hr)}function on(e,t){if("click"===e)return Wr(t)}function an(e,t){if("input"===e||"change"===e)return Wr(t)}var sn="function"===typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e===1/t)||e!==e&&t!==t};function un(e,t){if(sn(e,t))return!0;if("object"!==typeof e||null===e||"object"!==typeof t||null===t)return!1;var r=Object.keys(e),n=Object.keys(t);if(r.length!==n.length)return!1;for(n=0;n<r.length;n++){var i=r[n];if(!f.call(t,i)||!sn(e[i],t[i]))return!1}return!0}function cn(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function ln(e,t){var r,n=cn(e);for(e=0;n;){if(3===n.nodeType){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=cn(n)}}function fn(e,t){return!(!e||!t)&&(e===t||(!e||3!==e.nodeType)&&(t&&3===t.nodeType?fn(e,t.parentNode):"contains"in e?e.contains(t):!!e.compareDocumentPosition&&!!(16&e.compareDocumentPosition(t))))}function hn(){for(var e=window,t=W();t instanceof e.HTMLIFrameElement;){try{var r="string"===typeof t.contentWindow.location.href}catch(n){r=!1}if(!r)break;t=W((e=t.contentWindow).document)}return t}function dn(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&("text"===e.type||"search"===e.type||"tel"===e.type||"url"===e.type||"password"===e.type)||"textarea"===t||"true"===e.contentEditable)}function pn(e){var t=hn(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&fn(r.ownerDocument.documentElement,r)){if(null!==n&&dn(r))if(t=n.start,void 0===(e=n.end)&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if((e=(t=r.ownerDocument||document)&&t.defaultView||window).getSelection){e=e.getSelection();var i=r.textContent.length,o=Math.min(n.start,i);n=void 0===n.end?o:Math.min(n.end,i),!e.extend&&o>n&&(i=n,n=o,o=i),i=ln(r,o);var a=ln(r,n);i&&a&&(1!==e.rangeCount||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==a.node||e.focusOffset!==a.offset)&&((t=t.createRange()).setStart(i.node,i.offset),e.removeAllRanges(),o>n?(e.addRange(t),e.extend(a.node,a.offset)):(t.setEnd(a.node,a.offset),e.addRange(t)))}for(t=[],e=r;e=e.parentNode;)1===e.nodeType&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for("function"===typeof r.focus&&r.focus(),r=0;r<t.length;r++)(e=t[r]).element.scrollLeft=e.left,e.element.scrollTop=e.top}}var vn=l&&"documentMode"in document&&11>=document.documentMode,gn=null,yn=null,mn=null,bn=!1;function wn(e,t,r){var n=r.window===r?r.document:9===r.nodeType?r:r.ownerDocument;bn||null==gn||gn!==W(n)||("selectionStart"in(n=gn)&&dn(n)?n={start:n.selectionStart,end:n.selectionEnd}:n={anchorNode:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection()).anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset},mn&&un(mn,n)||(mn=n,0<(n=Hn(yn,"onSelect")).length&&(t=new cr("onSelect","select",null,t,r),e.push({event:t,listeners:n}),t.target=gn)))}function kn(e,t){var r={};return r[e.toLowerCase()]=t.toLowerCase(),r["Webkit"+e]="webkit"+t,r["Moz"+e]="moz"+t,r}var En={animationend:kn("Animation","AnimationEnd"),animationiteration:kn("Animation","AnimationIteration"),animationstart:kn("Animation","AnimationStart"),transitionend:kn("Transition","TransitionEnd")},xn={},Sn={};function _n(e){if(xn[e])return xn[e];if(!En[e])return e;var t,r=En[e];for(t in r)if(r.hasOwnProperty(t)&&t in Sn)return xn[e]=r[t];return e}l&&(Sn=document.createElement("div").style,"AnimationEvent"in window||(delete En.animationend.animation,delete En.animationiteration.animation,delete En.animationstart.animation),"TransitionEvent"in window||delete En.transitionend.transition);var An=_n("animationend"),In=_n("animationiteration"),Cn=_n("animationstart"),Tn=_n("transitionend"),Pn=new Map,Rn="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Bn(e,t){Pn.set(e,t),u(t,[e])}for(var Mn=0;Mn<Rn.length;Mn++){var Nn=Rn[Mn];Bn(Nn.toLowerCase(),"on"+(Nn[0].toUpperCase()+Nn.slice(1)))}Bn(An,"onAnimationEnd"),Bn(In,"onAnimationIteration"),Bn(Cn,"onAnimationStart"),Bn("dblclick","onDoubleClick"),Bn("focusin","onFocus"),Bn("focusout","onBlur"),Bn(Tn,"onTransitionEnd"),c("onMouseEnter",["mouseout","mouseover"]),c("onMouseLeave",["mouseout","mouseover"]),c("onPointerEnter",["pointerout","pointerover"]),c("onPointerLeave",["pointerout","pointerover"]),u("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),u("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),u("onBeforeInput",["compositionend","keypress","textInput","paste"]),u("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),u("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),u("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var On="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Dn=new Set("cancel close invalid load scroll toggle".split(" ").concat(On));function Ln(e,t,r){var n=e.type||"unknown-event";e.currentTarget=r,function(e,t,r,n,i,a,s,u,c){if(Ze.apply(this,arguments),De){if(!De)throw Error(o(198));var l=Le;De=!1,Le=null,Ue||(Ue=!0,Fe=l)}}(n,t,void 0,e),e.currentTarget=null}function Un(e,t){t=0!==(4&t);for(var r=0;r<e.length;r++){var n=e[r],i=n.event;n=n.listeners;e:{var o=void 0;if(t)for(var a=n.length-1;0<=a;a--){var s=n[a],u=s.instance,c=s.currentTarget;if(s=s.listener,u!==o&&i.isPropagationStopped())break e;Ln(i,s,c),o=u}else for(a=0;a<n.length;a++){if(u=(s=n[a]).instance,c=s.currentTarget,s=s.listener,u!==o&&i.isPropagationStopped())break e;Ln(i,s,c),o=u}}}if(Ue)throw e=Fe,Ue=!1,Fe=null,e}function Fn(e,t){var r=t[vi];void 0===r&&(r=t[vi]=new Set);var n=e+"__bubble";r.has(n)||(qn(t,e,2,!1),r.add(n))}function zn(e,t,r){var n=0;t&&(n|=4),qn(r,e,n,t)}var Zn="_reactListening"+Math.random().toString(36).slice(2);function jn(e){if(!e[Zn]){e[Zn]=!0,a.forEach((function(t){"selectionchange"!==t&&(Dn.has(t)||zn(t,!1,e),zn(t,!0,e))}));var t=9===e.nodeType?e:e.ownerDocument;null===t||t[Zn]||(t[Zn]=!0,zn("selectionchange",!1,t))}}function qn(e,t,r,n){switch(Jt(t)){case 1:var i=Vt;break;case 4:i=Ht;break;default:i=Gt}r=i.bind(null,t,r,e),i=void 0,!Me||"touchstart"!==t&&"touchmove"!==t&&"wheel"!==t||(i=!0),n?void 0!==i?e.addEventListener(t,r,{capture:!0,passive:i}):e.addEventListener(t,r,!0):void 0!==i?e.addEventListener(t,r,{passive:i}):e.addEventListener(t,r,!1)}function Kn(e,t,r,n,i){var o=n;if(0===(1&t)&&0===(2&t)&&null!==n)e:for(;;){if(null===n)return;var a=n.tag;if(3===a||4===a){var s=n.stateNode.containerInfo;if(s===i||8===s.nodeType&&s.parentNode===i)break;if(4===a)for(a=n.return;null!==a;){var u=a.tag;if((3===u||4===u)&&((u=a.stateNode.containerInfo)===i||8===u.nodeType&&u.parentNode===i))return;a=a.return}for(;null!==s;){if(null===(a=mi(s)))return;if(5===(u=a.tag)||6===u){n=o=a;continue e}s=s.parentNode}}n=n.return}Re((function(){var n=o,i=ke(r),a=[];e:{var s=Pn.get(e);if(void 0!==s){var u=cr,c=e;switch(e){case"keypress":if(0===tr(r))break e;case"keydown":case"keyup":u=Ar;break;case"focusin":c="focus",u=vr;break;case"focusout":c="blur",u=vr;break;case"beforeblur":case"afterblur":u=vr;break;case"click":if(2===r.button)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":u=dr;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":u=pr;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":u=Cr;break;case An:case In:case Cn:u=gr;break;case Tn:u=Tr;break;case"scroll":u=fr;break;case"wheel":u=Rr;break;case"copy":case"cut":case"paste":u=mr;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":u=Ir}var l=0!==(4&t),f=!l&&"scroll"===e,h=l?null!==s?s+"Capture":null:s;l=[];for(var d,p=n;null!==p;){var v=(d=p).stateNode;if(5===d.tag&&null!==v&&(d=v,null!==h&&(null!=(v=Be(p,h))&&l.push(Vn(p,v,d)))),f)break;p=p.return}0<l.length&&(s=new u(s,c,null,r,i),a.push({event:s,listeners:l}))}}if(0===(7&t)){if(u="mouseout"===e||"pointerout"===e,(!(s="mouseover"===e||"pointerover"===e)||r===we||!(c=r.relatedTarget||r.fromElement)||!mi(c)&&!c[pi])&&(u||s)&&(s=i.window===i?i:(s=i.ownerDocument)?s.defaultView||s.parentWindow:window,u?(u=n,null!==(c=(c=r.relatedTarget||r.toElement)?mi(c):null)&&(c!==(f=je(c))||5!==c.tag&&6!==c.tag)&&(c=null)):(u=null,c=n),u!==c)){if(l=dr,v="onMouseLeave",h="onMouseEnter",p="mouse","pointerout"!==e&&"pointerover"!==e||(l=Ir,v="onPointerLeave",h="onPointerEnter",p="pointer"),f=null==u?s:wi(u),d=null==c?s:wi(c),(s=new l(v,p+"leave",u,r,i)).target=f,s.relatedTarget=d,v=null,mi(i)===n&&((l=new l(h,p+"enter",c,r,i)).target=d,l.relatedTarget=f,v=l),f=v,u&&c)e:{for(h=c,p=0,d=l=u;d;d=Gn(d))p++;for(d=0,v=h;v;v=Gn(v))d++;for(;0<p-d;)l=Gn(l),p--;for(;0<d-p;)h=Gn(h),d--;for(;p--;){if(l===h||null!==h&&l===h.alternate)break e;l=Gn(l),h=Gn(h)}l=null}else l=null;null!==u&&Wn(a,s,u,l,!1),null!==c&&null!==f&&Wn(a,f,c,l,!0)}if("select"===(u=(s=n?wi(n):window).nodeName&&s.nodeName.toLowerCase())||"input"===u&&"file"===s.type)var g=Qr;else if(qr(s))if(Jr)g=an;else{g=nn;var y=rn}else(u=s.nodeName)&&"input"===u.toLowerCase()&&("checkbox"===s.type||"radio"===s.type)&&(g=on);switch(g&&(g=g(e,n))?Kr(a,g,r,i):(y&&y(e,s,n),"focusout"===e&&(y=s._wrapperState)&&y.controlled&&"number"===s.type&&ee(s,"number",s.value)),y=n?wi(n):window,e){case"focusin":(qr(y)||"true"===y.contentEditable)&&(gn=y,yn=n,mn=null);break;case"focusout":mn=yn=gn=null;break;case"mousedown":bn=!0;break;case"contextmenu":case"mouseup":case"dragend":bn=!1,wn(a,r,i);break;case"selectionchange":if(vn)break;case"keydown":case"keyup":wn(a,r,i)}var m;if(Mr)e:{switch(e){case"compositionstart":var b="onCompositionStart";break e;case"compositionend":b="onCompositionEnd";break e;case"compositionupdate":b="onCompositionUpdate";break e}b=void 0}else Zr?Fr(e,r)&&(b="onCompositionEnd"):"keydown"===e&&229===r.keyCode&&(b="onCompositionStart");b&&(Dr&&"ko"!==r.locale&&(Zr||"onCompositionStart"!==b?"onCompositionEnd"===b&&Zr&&(m=er()):(Xt="value"in(Yt=i)?Yt.value:Yt.textContent,Zr=!0)),0<(y=Hn(n,b)).length&&(b=new br(b,e,null,r,i),a.push({event:b,listeners:y}),m?b.data=m:null!==(m=zr(r))&&(b.data=m))),(m=Or?function(e,t){switch(e){case"compositionend":return zr(t);case"keypress":return 32!==t.which?null:(Ur=!0,Lr);case"textInput":return(e=t.data)===Lr&&Ur?null:e;default:return null}}(e,r):function(e,t){if(Zr)return"compositionend"===e||!Mr&&Fr(e,t)?(e=er(),$t=Xt=Yt=null,Zr=!1,e):null;switch(e){case"paste":default:return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Dr&&"ko"!==t.locale?null:t.data}}(e,r))&&(0<(n=Hn(n,"onBeforeInput")).length&&(i=new br("onBeforeInput","beforeinput",null,r,i),a.push({event:i,listeners:n}),i.data=m))}Un(a,t)}))}function Vn(e,t,r){return{instance:e,listener:t,currentTarget:r}}function Hn(e,t){for(var r=t+"Capture",n=[];null!==e;){var i=e,o=i.stateNode;5===i.tag&&null!==o&&(i=o,null!=(o=Be(e,r))&&n.unshift(Vn(e,o,i)),null!=(o=Be(e,t))&&n.push(Vn(e,o,i))),e=e.return}return n}function Gn(e){if(null===e)return null;do{e=e.return}while(e&&5!==e.tag);return e||null}function Wn(e,t,r,n,i){for(var o=t._reactName,a=[];null!==r&&r!==n;){var s=r,u=s.alternate,c=s.stateNode;if(null!==u&&u===n)break;5===s.tag&&null!==c&&(s=c,i?null!=(u=Be(r,o))&&a.unshift(Vn(r,u,s)):i||null!=(u=Be(r,o))&&a.push(Vn(r,u,s))),r=r.return}0!==a.length&&e.push({event:t,listeners:a})}var Qn=/\r\n?/g,Jn=/\u0000|\uFFFD/g;function Yn(e){return("string"===typeof e?e:""+e).replace(Qn,"\n").replace(Jn,"")}function Xn(e,t,r){if(t=Yn(t),Yn(e)!==t&&r)throw Error(o(425))}function $n(){}var ei=null,ti=null;function ri(e,t){return"textarea"===e||"noscript"===e||"string"===typeof t.children||"number"===typeof t.children||"object"===typeof t.dangerouslySetInnerHTML&&null!==t.dangerouslySetInnerHTML&&null!=t.dangerouslySetInnerHTML.__html}var ni="function"===typeof setTimeout?setTimeout:void 0,ii="function"===typeof clearTimeout?clearTimeout:void 0,oi="function"===typeof Promise?Promise:void 0,ai="function"===typeof queueMicrotask?queueMicrotask:"undefined"!==typeof oi?function(e){return oi.resolve(null).then(e).catch(si)}:ni;function si(e){setTimeout((function(){throw e}))}function ui(e,t){var r=t,n=0;do{var i=r.nextSibling;if(e.removeChild(r),i&&8===i.nodeType)if("/$"===(r=i.data)){if(0===n)return e.removeChild(i),void jt(t);n--}else"$"!==r&&"$?"!==r&&"$!"!==r||n++;r=i}while(r);jt(t)}function ci(e){for(;null!=e;e=e.nextSibling){var t=e.nodeType;if(1===t||3===t)break;if(8===t){if("$"===(t=e.data)||"$!"===t||"$?"===t)break;if("/$"===t)return null}}return e}function li(e){e=e.previousSibling;for(var t=0;e;){if(8===e.nodeType){var r=e.data;if("$"===r||"$!"===r||"$?"===r){if(0===t)return e;t--}else"/$"===r&&t++}e=e.previousSibling}return null}var fi=Math.random().toString(36).slice(2),hi="__reactFiber$"+fi,di="__reactProps$"+fi,pi="__reactContainer$"+fi,vi="__reactEvents$"+fi,gi="__reactListeners$"+fi,yi="__reactHandles$"+fi;function mi(e){var t=e[hi];if(t)return t;for(var r=e.parentNode;r;){if(t=r[pi]||r[hi]){if(r=t.alternate,null!==t.child||null!==r&&null!==r.child)for(e=li(e);null!==e;){if(r=e[hi])return r;e=li(e)}return t}r=(e=r).parentNode}return null}function bi(e){return!(e=e[hi]||e[pi])||5!==e.tag&&6!==e.tag&&13!==e.tag&&3!==e.tag?null:e}function wi(e){if(5===e.tag||6===e.tag)return e.stateNode;throw Error(o(33))}function ki(e){return e[di]||null}var Ei=[],xi=-1;function Si(e){return{current:e}}function _i(e){0>xi||(e.current=Ei[xi],Ei[xi]=null,xi--)}function Ai(e,t){xi++,Ei[xi]=e.current,e.current=t}var Ii={},Ci=Si(Ii),Ti=Si(!1),Pi=Ii;function Ri(e,t){var r=e.type.contextTypes;if(!r)return Ii;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var i,o={};for(i in r)o[i]=t[i];return n&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=o),o}function Bi(e){return null!==(e=e.childContextTypes)&&void 0!==e}function Mi(){_i(Ti),_i(Ci)}function Ni(e,t,r){if(Ci.current!==Ii)throw Error(o(168));Ai(Ci,t),Ai(Ti,r)}function Oi(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,"function"!==typeof n.getChildContext)return r;for(var i in n=n.getChildContext())if(!(i in t))throw Error(o(108,q(e)||"Unknown",i));return L({},r,n)}function Di(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ii,Pi=Ci.current,Ai(Ci,e),Ai(Ti,Ti.current),!0}function Li(e,t,r){var n=e.stateNode;if(!n)throw Error(o(169));r?(e=Oi(e,t,Pi),n.__reactInternalMemoizedMergedChildContext=e,_i(Ti),_i(Ci),Ai(Ci,e)):_i(Ti),Ai(Ti,r)}var Ui=null,Fi=!1,zi=!1;function Zi(e){null===Ui?Ui=[e]:Ui.push(e)}function ji(){if(!zi&&null!==Ui){zi=!0;var e=0,t=bt;try{var r=Ui;for(bt=1;e<r.length;e++){var n=r[e];do{n=n(!0)}while(null!==n)}Ui=null,Fi=!1}catch(i){throw null!==Ui&&(Ui=Ui.slice(e+1)),Ge($e,ji),i}finally{bt=t,zi=!1}}return null}var qi=[],Ki=0,Vi=null,Hi=0,Gi=[],Wi=0,Qi=null,Ji=1,Yi="";function Xi(e,t){qi[Ki++]=Hi,qi[Ki++]=Vi,Vi=e,Hi=t}function $i(e,t,r){Gi[Wi++]=Ji,Gi[Wi++]=Yi,Gi[Wi++]=Qi,Qi=e;var n=Ji;e=Yi;var i=32-at(n)-1;n&=~(1<<i),r+=1;var o=32-at(t)+i;if(30<o){var a=i-i%5;o=(n&(1<<a)-1).toString(32),n>>=a,i-=a,Ji=1<<32-at(t)+i|r<<i|n,Yi=o+e}else Ji=1<<o|r<<i|n,Yi=e}function eo(e){null!==e.return&&(Xi(e,1),$i(e,1,0))}function to(e){for(;e===Vi;)Vi=qi[--Ki],qi[Ki]=null,Hi=qi[--Ki],qi[Ki]=null;for(;e===Qi;)Qi=Gi[--Wi],Gi[Wi]=null,Yi=Gi[--Wi],Gi[Wi]=null,Ji=Gi[--Wi],Gi[Wi]=null}var ro=null,no=null,io=!1,oo=null;function ao(e,t){var r=Rc(5,null,null,0);r.elementType="DELETED",r.stateNode=t,r.return=e,null===(t=e.deletions)?(e.deletions=[r],e.flags|=16):t.push(r)}function so(e,t){switch(e.tag){case 5:var r=e.type;return null!==(t=1!==t.nodeType||r.toLowerCase()!==t.nodeName.toLowerCase()?null:t)&&(e.stateNode=t,ro=e,no=ci(t.firstChild),!0);case 6:return null!==(t=""===e.pendingProps||3!==t.nodeType?null:t)&&(e.stateNode=t,ro=e,no=null,!0);case 13:return null!==(t=8!==t.nodeType?null:t)&&(r=null!==Qi?{id:Ji,overflow:Yi}:null,e.memoizedState={dehydrated:t,treeContext:r,retryLane:1073741824},(r=Rc(18,null,null,0)).stateNode=t,r.return=e,e.child=r,ro=e,no=null,!0);default:return!1}}function uo(e){return 0!==(1&e.mode)&&0===(128&e.flags)}function co(e){if(io){var t=no;if(t){var r=t;if(!so(e,t)){if(uo(e))throw Error(o(418));t=ci(r.nextSibling);var n=ro;t&&so(e,t)?ao(n,r):(e.flags=-4097&e.flags|2,io=!1,ro=e)}}else{if(uo(e))throw Error(o(418));e.flags=-4097&e.flags|2,io=!1,ro=e}}}function lo(e){for(e=e.return;null!==e&&5!==e.tag&&3!==e.tag&&13!==e.tag;)e=e.return;ro=e}function fo(e){if(e!==ro)return!1;if(!io)return lo(e),io=!0,!1;var t;if((t=3!==e.tag)&&!(t=5!==e.tag)&&(t="head"!==(t=e.type)&&"body"!==t&&!ri(e.type,e.memoizedProps)),t&&(t=no)){if(uo(e))throw ho(),Error(o(418));for(;t;)ao(e,t),t=ci(t.nextSibling)}if(lo(e),13===e.tag){if(!(e=null!==(e=e.memoizedState)?e.dehydrated:null))throw Error(o(317));e:{for(e=e.nextSibling,t=0;e;){if(8===e.nodeType){var r=e.data;if("/$"===r){if(0===t){no=ci(e.nextSibling);break e}t--}else"$"!==r&&"$!"!==r&&"$?"!==r||t++}e=e.nextSibling}no=null}}else no=ro?ci(e.stateNode.nextSibling):null;return!0}function ho(){for(var e=no;e;)e=ci(e.nextSibling)}function po(){no=ro=null,io=!1}function vo(e){null===oo?oo=[e]:oo.push(e)}var go=w.ReactCurrentBatchConfig;function yo(e,t){if(e&&e.defaultProps){for(var r in t=L({},t),e=e.defaultProps)void 0===t[r]&&(t[r]=e[r]);return t}return t}var mo=Si(null),bo=null,wo=null,ko=null;function Eo(){ko=wo=bo=null}function xo(e){var t=mo.current;_i(mo),e._currentValue=t}function So(e,t,r){for(;null!==e;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,null!==n&&(n.childLanes|=t)):null!==n&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===r)break;e=e.return}}function _o(e,t){bo=e,ko=wo=null,null!==(e=e.dependencies)&&null!==e.firstContext&&(0!==(e.lanes&t)&&(ws=!0),e.firstContext=null)}function Ao(e){var t=e._currentValue;if(ko!==e)if(e={context:e,memoizedValue:t,next:null},null===wo){if(null===bo)throw Error(o(308));wo=e,bo.dependencies={lanes:0,firstContext:e}}else wo=wo.next=e;return t}var Io=null;function Co(e){null===Io?Io=[e]:Io.push(e)}function To(e,t,r,n){var i=t.interleaved;return null===i?(r.next=r,Co(t)):(r.next=i.next,i.next=r),t.interleaved=r,Po(e,n)}function Po(e,t){e.lanes|=t;var r=e.alternate;for(null!==r&&(r.lanes|=t),r=e,e=e.return;null!==e;)e.childLanes|=t,null!==(r=e.alternate)&&(r.childLanes|=t),r=e,e=e.return;return 3===r.tag?r.stateNode:null}var Ro=!1;function Bo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Mo(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function No(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function Oo(e,t,r){var n=e.updateQueue;if(null===n)return null;if(n=n.shared,0!==(2&Cu)){var i=n.pending;return null===i?t.next=t:(t.next=i.next,i.next=t),n.pending=t,Po(e,r)}return null===(i=n.interleaved)?(t.next=t,Co(n)):(t.next=i.next,i.next=t),n.interleaved=t,Po(e,r)}function Do(e,t,r){if(null!==(t=t.updateQueue)&&(t=t.shared,0!==(4194240&r))){var n=t.lanes;r|=n&=e.pendingLanes,t.lanes=r,mt(e,r)}}function Lo(e,t){var r=e.updateQueue,n=e.alternate;if(null!==n&&r===(n=n.updateQueue)){var i=null,o=null;if(null!==(r=r.firstBaseUpdate)){do{var a={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};null===o?i=o=a:o=o.next=a,r=r.next}while(null!==r);null===o?i=o=t:o=o.next=t}else i=o=t;return r={baseState:n.baseState,firstBaseUpdate:i,lastBaseUpdate:o,shared:n.shared,effects:n.effects},void(e.updateQueue=r)}null===(e=r.lastBaseUpdate)?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function Uo(e,t,r,n){var i=e.updateQueue;Ro=!1;var o=i.firstBaseUpdate,a=i.lastBaseUpdate,s=i.shared.pending;if(null!==s){i.shared.pending=null;var u=s,c=u.next;u.next=null,null===a?o=c:a.next=c,a=u;var l=e.alternate;null!==l&&((s=(l=l.updateQueue).lastBaseUpdate)!==a&&(null===s?l.firstBaseUpdate=c:s.next=c,l.lastBaseUpdate=u))}if(null!==o){var f=i.baseState;for(a=0,l=c=u=null,s=o;;){var h=s.lane,d=s.eventTime;if((n&h)===h){null!==l&&(l=l.next={eventTime:d,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var p=e,v=s;switch(h=t,d=r,v.tag){case 1:if("function"===typeof(p=v.payload)){f=p.call(d,f,h);break e}f=p;break e;case 3:p.flags=-65537&p.flags|128;case 0:if(null===(h="function"===typeof(p=v.payload)?p.call(d,f,h):p)||void 0===h)break e;f=L({},f,h);break e;case 2:Ro=!0}}null!==s.callback&&0!==s.lane&&(e.flags|=64,null===(h=i.effects)?i.effects=[s]:h.push(s))}else d={eventTime:d,lane:h,tag:s.tag,payload:s.payload,callback:s.callback,next:null},null===l?(c=l=d,u=f):l=l.next=d,a|=h;if(null===(s=s.next)){if(null===(s=i.shared.pending))break;s=(h=s).next,h.next=null,i.lastBaseUpdate=h,i.shared.pending=null}}if(null===l&&(u=f),i.baseState=u,i.firstBaseUpdate=c,i.lastBaseUpdate=l,null!==(t=i.shared.interleaved)){i=t;do{a|=i.lane,i=i.next}while(i!==t)}else null===o&&(i.shared.lanes=0);Du|=a,e.lanes=a,e.memoizedState=f}}function Fo(e,t,r){if(e=t.effects,t.effects=null,null!==e)for(t=0;t<e.length;t++){var n=e[t],i=n.callback;if(null!==i){if(n.callback=null,n=r,"function"!==typeof i)throw Error(o(191,i));i.call(n)}}}var zo=(new n.Component).refs;function Zo(e,t,r,n){r=null===(r=r(n,t=e.memoizedState))||void 0===r?t:L({},t,r),e.memoizedState=r,0===e.lanes&&(e.updateQueue.baseState=r)}var jo={isMounted:function(e){return!!(e=e._reactInternals)&&je(e)===e},enqueueSetState:function(e,t,r){e=e._reactInternals;var n=ec(),i=tc(e),o=No(n,i);o.payload=t,void 0!==r&&null!==r&&(o.callback=r),null!==(t=Oo(e,o,i))&&(rc(t,e,i,n),Do(t,e,i))},enqueueReplaceState:function(e,t,r){e=e._reactInternals;var n=ec(),i=tc(e),o=No(n,i);o.tag=1,o.payload=t,void 0!==r&&null!==r&&(o.callback=r),null!==(t=Oo(e,o,i))&&(rc(t,e,i,n),Do(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var r=ec(),n=tc(e),i=No(r,n);i.tag=2,void 0!==t&&null!==t&&(i.callback=t),null!==(t=Oo(e,i,n))&&(rc(t,e,n,r),Do(t,e,n))}};function qo(e,t,r,n,i,o,a){return"function"===typeof(e=e.stateNode).shouldComponentUpdate?e.shouldComponentUpdate(n,o,a):!t.prototype||!t.prototype.isPureReactComponent||(!un(r,n)||!un(i,o))}function Ko(e,t,r){var n=!1,i=Ii,o=t.contextType;return"object"===typeof o&&null!==o?o=Ao(o):(i=Bi(t)?Pi:Ci.current,o=(n=null!==(n=t.contextTypes)&&void 0!==n)?Ri(e,i):Ii),t=new t(r,o),e.memoizedState=null!==t.state&&void 0!==t.state?t.state:null,t.updater=jo,e.stateNode=t,t._reactInternals=e,n&&((e=e.stateNode).__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=o),t}function Vo(e,t,r,n){e=t.state,"function"===typeof t.componentWillReceiveProps&&t.componentWillReceiveProps(r,n),"function"===typeof t.UNSAFE_componentWillReceiveProps&&t.UNSAFE_componentWillReceiveProps(r,n),t.state!==e&&jo.enqueueReplaceState(t,t.state,null)}function Ho(e,t,r,n){var i=e.stateNode;i.props=r,i.state=e.memoizedState,i.refs=zo,Bo(e);var o=t.contextType;"object"===typeof o&&null!==o?i.context=Ao(o):(o=Bi(t)?Pi:Ci.current,i.context=Ri(e,o)),i.state=e.memoizedState,"function"===typeof(o=t.getDerivedStateFromProps)&&(Zo(e,t,o,r),i.state=e.memoizedState),"function"===typeof t.getDerivedStateFromProps||"function"===typeof i.getSnapshotBeforeUpdate||"function"!==typeof i.UNSAFE_componentWillMount&&"function"!==typeof i.componentWillMount||(t=i.state,"function"===typeof i.componentWillMount&&i.componentWillMount(),"function"===typeof i.UNSAFE_componentWillMount&&i.UNSAFE_componentWillMount(),t!==i.state&&jo.enqueueReplaceState(i,i.state,null),Uo(e,r,i,n),i.state=e.memoizedState),"function"===typeof i.componentDidMount&&(e.flags|=4194308)}function Go(e,t,r){if(null!==(e=r.ref)&&"function"!==typeof e&&"object"!==typeof e){if(r._owner){if(r=r._owner){if(1!==r.tag)throw Error(o(309));var n=r.stateNode}if(!n)throw Error(o(147,e));var i=n,a=""+e;return null!==t&&null!==t.ref&&"function"===typeof t.ref&&t.ref._stringRef===a?t.ref:(t=function(e){var t=i.refs;t===zo&&(t=i.refs={}),null===e?delete t[a]:t[a]=e},t._stringRef=a,t)}if("string"!==typeof e)throw Error(o(284));if(!r._owner)throw Error(o(290,e))}return e}function Wo(e,t){throw e=Object.prototype.toString.call(t),Error(o(31,"[object Object]"===e?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function Qo(e){return(0,e._init)(e._payload)}function Jo(e){function t(t,r){if(e){var n=t.deletions;null===n?(t.deletions=[r],t.flags|=16):n.push(r)}}function r(r,n){if(!e)return null;for(;null!==n;)t(r,n),n=n.sibling;return null}function n(e,t){for(e=new Map;null!==t;)null!==t.key?e.set(t.key,t):e.set(t.index,t),t=t.sibling;return e}function i(e,t){return(e=Mc(e,t)).index=0,e.sibling=null,e}function a(t,r,n){return t.index=n,e?null!==(n=t.alternate)?(n=n.index)<r?(t.flags|=2,r):n:(t.flags|=2,r):(t.flags|=1048576,r)}function s(t){return e&&null===t.alternate&&(t.flags|=2),t}function u(e,t,r,n){return null===t||6!==t.tag?((t=Lc(r,e.mode,n)).return=e,t):((t=i(t,r)).return=e,t)}function c(e,t,r,n){var o=r.type;return o===x?f(e,t,r.props.children,n,r.key):null!==t&&(t.elementType===o||"object"===typeof o&&null!==o&&o.$$typeof===B&&Qo(o)===t.type)?((n=i(t,r.props)).ref=Go(e,t,r),n.return=e,n):((n=Nc(r.type,r.key,r.props,null,e.mode,n)).ref=Go(e,t,r),n.return=e,n)}function l(e,t,r,n){return null===t||4!==t.tag||t.stateNode.containerInfo!==r.containerInfo||t.stateNode.implementation!==r.implementation?((t=Uc(r,e.mode,n)).return=e,t):((t=i(t,r.children||[])).return=e,t)}function f(e,t,r,n,o){return null===t||7!==t.tag?((t=Oc(r,e.mode,n,o)).return=e,t):((t=i(t,r)).return=e,t)}function h(e,t,r){if("string"===typeof t&&""!==t||"number"===typeof t)return(t=Lc(""+t,e.mode,r)).return=e,t;if("object"===typeof t&&null!==t){switch(t.$$typeof){case k:return(r=Nc(t.type,t.key,t.props,null,e.mode,r)).ref=Go(e,null,t),r.return=e,r;case E:return(t=Uc(t,e.mode,r)).return=e,t;case B:return h(e,(0,t._init)(t._payload),r)}if(te(t)||O(t))return(t=Oc(t,e.mode,r,null)).return=e,t;Wo(e,t)}return null}function d(e,t,r,n){var i=null!==t?t.key:null;if("string"===typeof r&&""!==r||"number"===typeof r)return null!==i?null:u(e,t,""+r,n);if("object"===typeof r&&null!==r){switch(r.$$typeof){case k:return r.key===i?c(e,t,r,n):null;case E:return r.key===i?l(e,t,r,n):null;case B:return d(e,t,(i=r._init)(r._payload),n)}if(te(r)||O(r))return null!==i?null:f(e,t,r,n,null);Wo(e,r)}return null}function p(e,t,r,n,i){if("string"===typeof n&&""!==n||"number"===typeof n)return u(t,e=e.get(r)||null,""+n,i);if("object"===typeof n&&null!==n){switch(n.$$typeof){case k:return c(t,e=e.get(null===n.key?r:n.key)||null,n,i);case E:return l(t,e=e.get(null===n.key?r:n.key)||null,n,i);case B:return p(e,t,r,(0,n._init)(n._payload),i)}if(te(n)||O(n))return f(t,e=e.get(r)||null,n,i,null);Wo(t,n)}return null}function v(i,o,s,u){for(var c=null,l=null,f=o,v=o=0,g=null;null!==f&&v<s.length;v++){f.index>v?(g=f,f=null):g=f.sibling;var y=d(i,f,s[v],u);if(null===y){null===f&&(f=g);break}e&&f&&null===y.alternate&&t(i,f),o=a(y,o,v),null===l?c=y:l.sibling=y,l=y,f=g}if(v===s.length)return r(i,f),io&&Xi(i,v),c;if(null===f){for(;v<s.length;v++)null!==(f=h(i,s[v],u))&&(o=a(f,o,v),null===l?c=f:l.sibling=f,l=f);return io&&Xi(i,v),c}for(f=n(i,f);v<s.length;v++)null!==(g=p(f,i,v,s[v],u))&&(e&&null!==g.alternate&&f.delete(null===g.key?v:g.key),o=a(g,o,v),null===l?c=g:l.sibling=g,l=g);return e&&f.forEach((function(e){return t(i,e)})),io&&Xi(i,v),c}function g(i,s,u,c){var l=O(u);if("function"!==typeof l)throw Error(o(150));if(null==(u=l.call(u)))throw Error(o(151));for(var f=l=null,v=s,g=s=0,y=null,m=u.next();null!==v&&!m.done;g++,m=u.next()){v.index>g?(y=v,v=null):y=v.sibling;var b=d(i,v,m.value,c);if(null===b){null===v&&(v=y);break}e&&v&&null===b.alternate&&t(i,v),s=a(b,s,g),null===f?l=b:f.sibling=b,f=b,v=y}if(m.done)return r(i,v),io&&Xi(i,g),l;if(null===v){for(;!m.done;g++,m=u.next())null!==(m=h(i,m.value,c))&&(s=a(m,s,g),null===f?l=m:f.sibling=m,f=m);return io&&Xi(i,g),l}for(v=n(i,v);!m.done;g++,m=u.next())null!==(m=p(v,i,g,m.value,c))&&(e&&null!==m.alternate&&v.delete(null===m.key?g:m.key),s=a(m,s,g),null===f?l=m:f.sibling=m,f=m);return e&&v.forEach((function(e){return t(i,e)})),io&&Xi(i,g),l}return function e(n,o,a,u){if("object"===typeof a&&null!==a&&a.type===x&&null===a.key&&(a=a.props.children),"object"===typeof a&&null!==a){switch(a.$$typeof){case k:e:{for(var c=a.key,l=o;null!==l;){if(l.key===c){if((c=a.type)===x){if(7===l.tag){r(n,l.sibling),(o=i(l,a.props.children)).return=n,n=o;break e}}else if(l.elementType===c||"object"===typeof c&&null!==c&&c.$$typeof===B&&Qo(c)===l.type){r(n,l.sibling),(o=i(l,a.props)).ref=Go(n,l,a),o.return=n,n=o;break e}r(n,l);break}t(n,l),l=l.sibling}a.type===x?((o=Oc(a.props.children,n.mode,u,a.key)).return=n,n=o):((u=Nc(a.type,a.key,a.props,null,n.mode,u)).ref=Go(n,o,a),u.return=n,n=u)}return s(n);case E:e:{for(l=a.key;null!==o;){if(o.key===l){if(4===o.tag&&o.stateNode.containerInfo===a.containerInfo&&o.stateNode.implementation===a.implementation){r(n,o.sibling),(o=i(o,a.children||[])).return=n,n=o;break e}r(n,o);break}t(n,o),o=o.sibling}(o=Uc(a,n.mode,u)).return=n,n=o}return s(n);case B:return e(n,o,(l=a._init)(a._payload),u)}if(te(a))return v(n,o,a,u);if(O(a))return g(n,o,a,u);Wo(n,a)}return"string"===typeof a&&""!==a||"number"===typeof a?(a=""+a,null!==o&&6===o.tag?(r(n,o.sibling),(o=i(o,a)).return=n,n=o):(r(n,o),(o=Lc(a,n.mode,u)).return=n,n=o),s(n)):r(n,o)}}var Yo=Jo(!0),Xo=Jo(!1),$o={},ea=Si($o),ta=Si($o),ra=Si($o);function na(e){if(e===$o)throw Error(o(174));return e}function ia(e,t){switch(Ai(ra,t),Ai(ta,e),Ai(ea,$o),e=t.nodeType){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:ue(null,"");break;default:t=ue(t=(e=8===e?t.parentNode:t).namespaceURI||null,e=e.tagName)}_i(ea),Ai(ea,t)}function oa(){_i(ea),_i(ta),_i(ra)}function aa(e){na(ra.current);var t=na(ea.current),r=ue(t,e.type);t!==r&&(Ai(ta,e),Ai(ea,r))}function sa(e){ta.current===e&&(_i(ea),_i(ta))}var ua=Si(0);function ca(e){for(var t=e;null!==t;){if(13===t.tag){var r=t.memoizedState;if(null!==r&&(null===(r=r.dehydrated)||"$?"===r.data||"$!"===r.data))return t}else if(19===t.tag&&void 0!==t.memoizedProps.revealOrder){if(0!==(128&t.flags))return t}else if(null!==t.child){t.child.return=t,t=t.child;continue}if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var la=[];function fa(){for(var e=0;e<la.length;e++)la[e]._workInProgressVersionPrimary=null;la.length=0}var ha=w.ReactCurrentDispatcher,da=w.ReactCurrentBatchConfig,pa=0,va=null,ga=null,ya=null,ma=!1,ba=!1,wa=0,ka=0;function Ea(){throw Error(o(321))}function xa(e,t){if(null===t)return!1;for(var r=0;r<t.length&&r<e.length;r++)if(!sn(e[r],t[r]))return!1;return!0}function Sa(e,t,r,n,i,a){if(pa=a,va=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,ha.current=null===e||null===e.memoizedState?ss:us,e=r(n,i),ba){a=0;do{if(ba=!1,wa=0,25<=a)throw Error(o(301));a+=1,ya=ga=null,t.updateQueue=null,ha.current=cs,e=r(n,i)}while(ba)}if(ha.current=as,t=null!==ga&&null!==ga.next,pa=0,ya=ga=va=null,ma=!1,t)throw Error(o(300));return e}function _a(){var e=0!==wa;return wa=0,e}function Aa(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return null===ya?va.memoizedState=ya=e:ya=ya.next=e,ya}function Ia(){if(null===ga){var e=va.alternate;e=null!==e?e.memoizedState:null}else e=ga.next;var t=null===ya?va.memoizedState:ya.next;if(null!==t)ya=t,ga=e;else{if(null===e)throw Error(o(310));e={memoizedState:(ga=e).memoizedState,baseState:ga.baseState,baseQueue:ga.baseQueue,queue:ga.queue,next:null},null===ya?va.memoizedState=ya=e:ya=ya.next=e}return ya}function Ca(e,t){return"function"===typeof t?t(e):t}function Ta(e){var t=Ia(),r=t.queue;if(null===r)throw Error(o(311));r.lastRenderedReducer=e;var n=ga,i=n.baseQueue,a=r.pending;if(null!==a){if(null!==i){var s=i.next;i.next=a.next,a.next=s}n.baseQueue=i=a,r.pending=null}if(null!==i){a=i.next,n=n.baseState;var u=s=null,c=null,l=a;do{var f=l.lane;if((pa&f)===f)null!==c&&(c=c.next={lane:0,action:l.action,hasEagerState:l.hasEagerState,eagerState:l.eagerState,next:null}),n=l.hasEagerState?l.eagerState:e(n,l.action);else{var h={lane:f,action:l.action,hasEagerState:l.hasEagerState,eagerState:l.eagerState,next:null};null===c?(u=c=h,s=n):c=c.next=h,va.lanes|=f,Du|=f}l=l.next}while(null!==l&&l!==a);null===c?s=n:c.next=u,sn(n,t.memoizedState)||(ws=!0),t.memoizedState=n,t.baseState=s,t.baseQueue=c,r.lastRenderedState=n}if(null!==(e=r.interleaved)){i=e;do{a=i.lane,va.lanes|=a,Du|=a,i=i.next}while(i!==e)}else null===i&&(r.lanes=0);return[t.memoizedState,r.dispatch]}function Pa(e){var t=Ia(),r=t.queue;if(null===r)throw Error(o(311));r.lastRenderedReducer=e;var n=r.dispatch,i=r.pending,a=t.memoizedState;if(null!==i){r.pending=null;var s=i=i.next;do{a=e(a,s.action),s=s.next}while(s!==i);sn(a,t.memoizedState)||(ws=!0),t.memoizedState=a,null===t.baseQueue&&(t.baseState=a),r.lastRenderedState=a}return[a,n]}function Ra(){}function Ba(e,t){var r=va,n=Ia(),i=t(),a=!sn(n.memoizedState,i);if(a&&(n.memoizedState=i,ws=!0),n=n.queue,Ka(Oa.bind(null,r,n,e),[e]),n.getSnapshot!==t||a||null!==ya&&1&ya.memoizedState.tag){if(r.flags|=2048,Fa(9,Na.bind(null,r,n,i,t),void 0,null),null===Tu)throw Error(o(349));0!==(30&pa)||Ma(r,t,i)}return i}function Ma(e,t,r){e.flags|=16384,e={getSnapshot:t,value:r},null===(t=va.updateQueue)?(t={lastEffect:null,stores:null},va.updateQueue=t,t.stores=[e]):null===(r=t.stores)?t.stores=[e]:r.push(e)}function Na(e,t,r,n){t.value=r,t.getSnapshot=n,Da(t)&&La(e)}function Oa(e,t,r){return r((function(){Da(t)&&La(e)}))}function Da(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!sn(e,r)}catch(n){return!0}}function La(e){var t=Po(e,1);null!==t&&rc(t,e,1,-1)}function Ua(e){var t=Aa();return"function"===typeof e&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ca,lastRenderedState:e},t.queue=e,e=e.dispatch=rs.bind(null,va,e),[t.memoizedState,e]}function Fa(e,t,r,n){return e={tag:e,create:t,destroy:r,deps:n,next:null},null===(t=va.updateQueue)?(t={lastEffect:null,stores:null},va.updateQueue=t,t.lastEffect=e.next=e):null===(r=t.lastEffect)?t.lastEffect=e.next=e:(n=r.next,r.next=e,e.next=n,t.lastEffect=e),e}function za(){return Ia().memoizedState}function Za(e,t,r,n){var i=Aa();va.flags|=e,i.memoizedState=Fa(1|t,r,void 0,void 0===n?null:n)}function ja(e,t,r,n){var i=Ia();n=void 0===n?null:n;var o=void 0;if(null!==ga){var a=ga.memoizedState;if(o=a.destroy,null!==n&&xa(n,a.deps))return void(i.memoizedState=Fa(t,r,o,n))}va.flags|=e,i.memoizedState=Fa(1|t,r,o,n)}function qa(e,t){return Za(8390656,8,e,t)}function Ka(e,t){return ja(2048,8,e,t)}function Va(e,t){return ja(4,2,e,t)}function Ha(e,t){return ja(4,4,e,t)}function Ga(e,t){return"function"===typeof t?(e=e(),t(e),function(){t(null)}):null!==t&&void 0!==t?(e=e(),t.current=e,function(){t.current=null}):void 0}function Wa(e,t,r){return r=null!==r&&void 0!==r?r.concat([e]):null,ja(4,4,Ga.bind(null,t,e),r)}function Qa(){}function Ja(e,t){var r=Ia();t=void 0===t?null:t;var n=r.memoizedState;return null!==n&&null!==t&&xa(t,n[1])?n[0]:(r.memoizedState=[e,t],e)}function Ya(e,t){var r=Ia();t=void 0===t?null:t;var n=r.memoizedState;return null!==n&&null!==t&&xa(t,n[1])?n[0]:(e=e(),r.memoizedState=[e,t],e)}function Xa(e,t,r){return 0===(21&pa)?(e.baseState&&(e.baseState=!1,ws=!0),e.memoizedState=r):(sn(r,t)||(r=vt(),va.lanes|=r,Du|=r,e.baseState=!0),t)}function $a(e,t){var r=bt;bt=0!==r&&4>r?r:4,e(!0);var n=da.transition;da.transition={};try{e(!1),t()}finally{bt=r,da.transition=n}}function es(){return Ia().memoizedState}function ts(e,t,r){var n=tc(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},ns(e))is(t,r);else if(null!==(r=To(e,t,r,n))){rc(r,e,n,ec()),os(r,t,n)}}function rs(e,t,r){var n=tc(e),i={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(ns(e))is(t,i);else{var o=e.alternate;if(0===e.lanes&&(null===o||0===o.lanes)&&null!==(o=t.lastRenderedReducer))try{var a=t.lastRenderedState,s=o(a,r);if(i.hasEagerState=!0,i.eagerState=s,sn(s,a)){var u=t.interleaved;return null===u?(i.next=i,Co(t)):(i.next=u.next,u.next=i),void(t.interleaved=i)}}catch(c){}null!==(r=To(e,t,i,n))&&(rc(r,e,n,i=ec()),os(r,t,n))}}function ns(e){var t=e.alternate;return e===va||null!==t&&t===va}function is(e,t){ba=ma=!0;var r=e.pending;null===r?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function os(e,t,r){if(0!==(4194240&r)){var n=t.lanes;r|=n&=e.pendingLanes,t.lanes=r,mt(e,r)}}var as={readContext:Ao,useCallback:Ea,useContext:Ea,useEffect:Ea,useImperativeHandle:Ea,useInsertionEffect:Ea,useLayoutEffect:Ea,useMemo:Ea,useReducer:Ea,useRef:Ea,useState:Ea,useDebugValue:Ea,useDeferredValue:Ea,useTransition:Ea,useMutableSource:Ea,useSyncExternalStore:Ea,useId:Ea,unstable_isNewReconciler:!1},ss={readContext:Ao,useCallback:function(e,t){return Aa().memoizedState=[e,void 0===t?null:t],e},useContext:Ao,useEffect:qa,useImperativeHandle:function(e,t,r){return r=null!==r&&void 0!==r?r.concat([e]):null,Za(4194308,4,Ga.bind(null,t,e),r)},useLayoutEffect:function(e,t){return Za(4194308,4,e,t)},useInsertionEffect:function(e,t){return Za(4,2,e,t)},useMemo:function(e,t){var r=Aa();return t=void 0===t?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=Aa();return t=void 0!==r?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=ts.bind(null,va,e),[n.memoizedState,e]},useRef:function(e){return e={current:e},Aa().memoizedState=e},useState:Ua,useDebugValue:Qa,useDeferredValue:function(e){return Aa().memoizedState=e},useTransition:function(){var e=Ua(!1),t=e[0];return e=$a.bind(null,e[1]),Aa().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=va,i=Aa();if(io){if(void 0===r)throw Error(o(407));r=r()}else{if(r=t(),null===Tu)throw Error(o(349));0!==(30&pa)||Ma(n,t,r)}i.memoizedState=r;var a={value:r,getSnapshot:t};return i.queue=a,qa(Oa.bind(null,n,a,e),[e]),n.flags|=2048,Fa(9,Na.bind(null,n,a,r,t),void 0,null),r},useId:function(){var e=Aa(),t=Tu.identifierPrefix;if(io){var r=Yi;t=":"+t+"R"+(r=(Ji&~(1<<32-at(Ji)-1)).toString(32)+r),0<(r=wa++)&&(t+="H"+r.toString(32)),t+=":"}else t=":"+t+"r"+(r=ka++).toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},us={readContext:Ao,useCallback:Ja,useContext:Ao,useEffect:Ka,useImperativeHandle:Wa,useInsertionEffect:Va,useLayoutEffect:Ha,useMemo:Ya,useReducer:Ta,useRef:za,useState:function(){return Ta(Ca)},useDebugValue:Qa,useDeferredValue:function(e){return Xa(Ia(),ga.memoizedState,e)},useTransition:function(){return[Ta(Ca)[0],Ia().memoizedState]},useMutableSource:Ra,useSyncExternalStore:Ba,useId:es,unstable_isNewReconciler:!1},cs={readContext:Ao,useCallback:Ja,useContext:Ao,useEffect:Ka,useImperativeHandle:Wa,useInsertionEffect:Va,useLayoutEffect:Ha,useMemo:Ya,useReducer:Pa,useRef:za,useState:function(){return Pa(Ca)},useDebugValue:Qa,useDeferredValue:function(e){var t=Ia();return null===ga?t.memoizedState=e:Xa(t,ga.memoizedState,e)},useTransition:function(){return[Pa(Ca)[0],Ia().memoizedState]},useMutableSource:Ra,useSyncExternalStore:Ba,useId:es,unstable_isNewReconciler:!1};function ls(e,t){try{var r="",n=t;do{r+=Z(n),n=n.return}while(n);var i=r}catch(o){i="\nError generating stack: "+o.message+"\n"+o.stack}return{value:e,source:t,stack:i,digest:null}}function fs(e,t,r){return{value:e,source:null,stack:null!=r?r:null,digest:null!=t?t:null}}function hs(e,t){try{console.error(t.value)}catch(r){setTimeout((function(){throw r}))}}var ds="function"===typeof WeakMap?WeakMap:Map;function ps(e,t,r){(r=No(-1,r)).tag=3,r.payload={element:null};var n=t.value;return r.callback=function(){Ku||(Ku=!0,Vu=n),hs(0,t)},r}function vs(e,t,r){(r=No(-1,r)).tag=3;var n=e.type.getDerivedStateFromError;if("function"===typeof n){var i=t.value;r.payload=function(){return n(i)},r.callback=function(){hs(0,t)}}var o=e.stateNode;return null!==o&&"function"===typeof o.componentDidCatch&&(r.callback=function(){hs(0,t),"function"!==typeof n&&(null===Hu?Hu=new Set([this]):Hu.add(this));var e=t.stack;this.componentDidCatch(t.value,{componentStack:null!==e?e:""})}),r}function gs(e,t,r){var n=e.pingCache;if(null===n){n=e.pingCache=new ds;var i=new Set;n.set(t,i)}else void 0===(i=n.get(t))&&(i=new Set,n.set(t,i));i.has(r)||(i.add(r),e=_c.bind(null,e,t,r),t.then(e,e))}function ys(e){do{var t;if((t=13===e.tag)&&(t=null===(t=e.memoizedState)||null!==t.dehydrated),t)return e;e=e.return}while(null!==e);return null}function ms(e,t,r,n,i){return 0===(1&e.mode)?(e===t?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,1===r.tag&&(null===r.alternate?r.tag=17:((t=No(-1,1)).tag=2,Oo(r,t,1))),r.lanes|=1),e):(e.flags|=65536,e.lanes=i,e)}var bs=w.ReactCurrentOwner,ws=!1;function ks(e,t,r,n){t.child=null===e?Xo(t,null,r,n):Yo(t,e.child,r,n)}function Es(e,t,r,n,i){r=r.render;var o=t.ref;return _o(t,i),n=Sa(e,t,r,n,o,i),r=_a(),null===e||ws?(io&&r&&eo(t),t.flags|=1,ks(e,t,n,i),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Ks(e,t,i))}function xs(e,t,r,n,i){if(null===e){var o=r.type;return"function"!==typeof o||Bc(o)||void 0!==o.defaultProps||null!==r.compare||void 0!==r.defaultProps?((e=Nc(r.type,null,n,t,t.mode,i)).ref=t.ref,e.return=t,t.child=e):(t.tag=15,t.type=o,Ss(e,t,o,n,i))}if(o=e.child,0===(e.lanes&i)){var a=o.memoizedProps;if((r=null!==(r=r.compare)?r:un)(a,n)&&e.ref===t.ref)return Ks(e,t,i)}return t.flags|=1,(e=Mc(o,n)).ref=t.ref,e.return=t,t.child=e}function Ss(e,t,r,n,i){if(null!==e){var o=e.memoizedProps;if(un(o,n)&&e.ref===t.ref){if(ws=!1,t.pendingProps=n=o,0===(e.lanes&i))return t.lanes=e.lanes,Ks(e,t,i);0!==(131072&e.flags)&&(ws=!0)}}return Is(e,t,r,n,i)}function _s(e,t,r){var n=t.pendingProps,i=n.children,o=null!==e?e.memoizedState:null;if("hidden"===n.mode)if(0===(1&t.mode))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ai(Mu,Bu),Bu|=r;else{if(0===(1073741824&r))return e=null!==o?o.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,Ai(Mu,Bu),Bu|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=null!==o?o.baseLanes:r,Ai(Mu,Bu),Bu|=n}else null!==o?(n=o.baseLanes|r,t.memoizedState=null):n=r,Ai(Mu,Bu),Bu|=n;return ks(e,t,i,r),t.child}function As(e,t){var r=t.ref;(null===e&&null!==r||null!==e&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function Is(e,t,r,n,i){var o=Bi(r)?Pi:Ci.current;return o=Ri(t,o),_o(t,i),r=Sa(e,t,r,n,o,i),n=_a(),null===e||ws?(io&&n&&eo(t),t.flags|=1,ks(e,t,r,i),t.child):(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,Ks(e,t,i))}function Cs(e,t,r,n,i){if(Bi(r)){var o=!0;Di(t)}else o=!1;if(_o(t,i),null===t.stateNode)qs(e,t),Ko(t,r,n),Ho(t,r,n,i),n=!0;else if(null===e){var a=t.stateNode,s=t.memoizedProps;a.props=s;var u=a.context,c=r.contextType;"object"===typeof c&&null!==c?c=Ao(c):c=Ri(t,c=Bi(r)?Pi:Ci.current);var l=r.getDerivedStateFromProps,f="function"===typeof l||"function"===typeof a.getSnapshotBeforeUpdate;f||"function"!==typeof a.UNSAFE_componentWillReceiveProps&&"function"!==typeof a.componentWillReceiveProps||(s!==n||u!==c)&&Vo(t,a,n,c),Ro=!1;var h=t.memoizedState;a.state=h,Uo(t,n,a,i),u=t.memoizedState,s!==n||h!==u||Ti.current||Ro?("function"===typeof l&&(Zo(t,r,l,n),u=t.memoizedState),(s=Ro||qo(t,r,s,n,h,u,c))?(f||"function"!==typeof a.UNSAFE_componentWillMount&&"function"!==typeof a.componentWillMount||("function"===typeof a.componentWillMount&&a.componentWillMount(),"function"===typeof a.UNSAFE_componentWillMount&&a.UNSAFE_componentWillMount()),"function"===typeof a.componentDidMount&&(t.flags|=4194308)):("function"===typeof a.componentDidMount&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=u),a.props=n,a.state=u,a.context=c,n=s):("function"===typeof a.componentDidMount&&(t.flags|=4194308),n=!1)}else{a=t.stateNode,Mo(e,t),s=t.memoizedProps,c=t.type===t.elementType?s:yo(t.type,s),a.props=c,f=t.pendingProps,h=a.context,"object"===typeof(u=r.contextType)&&null!==u?u=Ao(u):u=Ri(t,u=Bi(r)?Pi:Ci.current);var d=r.getDerivedStateFromProps;(l="function"===typeof d||"function"===typeof a.getSnapshotBeforeUpdate)||"function"!==typeof a.UNSAFE_componentWillReceiveProps&&"function"!==typeof a.componentWillReceiveProps||(s!==f||h!==u)&&Vo(t,a,n,u),Ro=!1,h=t.memoizedState,a.state=h,Uo(t,n,a,i);var p=t.memoizedState;s!==f||h!==p||Ti.current||Ro?("function"===typeof d&&(Zo(t,r,d,n),p=t.memoizedState),(c=Ro||qo(t,r,c,n,h,p,u)||!1)?(l||"function"!==typeof a.UNSAFE_componentWillUpdate&&"function"!==typeof a.componentWillUpdate||("function"===typeof a.componentWillUpdate&&a.componentWillUpdate(n,p,u),"function"===typeof a.UNSAFE_componentWillUpdate&&a.UNSAFE_componentWillUpdate(n,p,u)),"function"===typeof a.componentDidUpdate&&(t.flags|=4),"function"===typeof a.getSnapshotBeforeUpdate&&(t.flags|=1024)):("function"!==typeof a.componentDidUpdate||s===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),"function"!==typeof a.getSnapshotBeforeUpdate||s===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=p),a.props=n,a.state=p,a.context=u,n=c):("function"!==typeof a.componentDidUpdate||s===e.memoizedProps&&h===e.memoizedState||(t.flags|=4),"function"!==typeof a.getSnapshotBeforeUpdate||s===e.memoizedProps&&h===e.memoizedState||(t.flags|=1024),n=!1)}return Ts(e,t,r,n,o,i)}function Ts(e,t,r,n,i,o){As(e,t);var a=0!==(128&t.flags);if(!n&&!a)return i&&Li(t,r,!1),Ks(e,t,o);n=t.stateNode,bs.current=t;var s=a&&"function"!==typeof r.getDerivedStateFromError?null:n.render();return t.flags|=1,null!==e&&a?(t.child=Yo(t,e.child,null,o),t.child=Yo(t,null,s,o)):ks(e,t,s,o),t.memoizedState=n.state,i&&Li(t,r,!0),t.child}function Ps(e){var t=e.stateNode;t.pendingContext?Ni(0,t.pendingContext,t.pendingContext!==t.context):t.context&&Ni(0,t.context,!1),ia(e,t.containerInfo)}function Rs(e,t,r,n,i){return po(),vo(i),t.flags|=256,ks(e,t,r,n),t.child}var Bs,Ms,Ns,Os={dehydrated:null,treeContext:null,retryLane:0};function Ds(e){return{baseLanes:e,cachePool:null,transitions:null}}function Ls(e,t,r){var n,i=t.pendingProps,a=ua.current,s=!1,u=0!==(128&t.flags);if((n=u)||(n=(null===e||null!==e.memoizedState)&&0!==(2&a)),n?(s=!0,t.flags&=-129):null!==e&&null===e.memoizedState||(a|=1),Ai(ua,1&a),null===e)return co(t),null!==(e=t.memoizedState)&&null!==(e=e.dehydrated)?(0===(1&t.mode)?t.lanes=1:"$!"===e.data?t.lanes=8:t.lanes=1073741824,null):(u=i.children,e=i.fallback,s?(i=t.mode,s=t.child,u={mode:"hidden",children:u},0===(1&i)&&null!==s?(s.childLanes=0,s.pendingProps=u):s=Dc(u,i,0,null),e=Oc(e,i,r,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=Ds(r),t.memoizedState=Os,e):Us(t,u));if(null!==(a=e.memoizedState)&&null!==(n=a.dehydrated))return function(e,t,r,n,i,a,s){if(r)return 256&t.flags?(t.flags&=-257,Fs(e,t,s,n=fs(Error(o(422))))):null!==t.memoizedState?(t.child=e.child,t.flags|=128,null):(a=n.fallback,i=t.mode,n=Dc({mode:"visible",children:n.children},i,0,null),(a=Oc(a,i,s,null)).flags|=2,n.return=t,a.return=t,n.sibling=a,t.child=n,0!==(1&t.mode)&&Yo(t,e.child,null,s),t.child.memoizedState=Ds(s),t.memoizedState=Os,a);if(0===(1&t.mode))return Fs(e,t,s,null);if("$!"===i.data){if(n=i.nextSibling&&i.nextSibling.dataset)var u=n.dgst;return n=u,Fs(e,t,s,n=fs(a=Error(o(419)),n,void 0))}if(u=0!==(s&e.childLanes),ws||u){if(null!==(n=Tu)){switch(s&-s){case 4:i=2;break;case 16:i=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}0!==(i=0!==(i&(n.suspendedLanes|s))?0:i)&&i!==a.retryLane&&(a.retryLane=i,Po(e,i),rc(n,e,i,-1))}return vc(),Fs(e,t,s,n=fs(Error(o(421))))}return"$?"===i.data?(t.flags|=128,t.child=e.child,t=Ic.bind(null,e),i._reactRetry=t,null):(e=a.treeContext,no=ci(i.nextSibling),ro=t,io=!0,oo=null,null!==e&&(Gi[Wi++]=Ji,Gi[Wi++]=Yi,Gi[Wi++]=Qi,Ji=e.id,Yi=e.overflow,Qi=t),(t=Us(t,n.children)).flags|=4096,t)}(e,t,u,i,n,a,r);if(s){s=i.fallback,u=t.mode,n=(a=e.child).sibling;var c={mode:"hidden",children:i.children};return 0===(1&u)&&t.child!==a?((i=t.child).childLanes=0,i.pendingProps=c,t.deletions=null):(i=Mc(a,c)).subtreeFlags=14680064&a.subtreeFlags,null!==n?s=Mc(n,s):(s=Oc(s,u,r,null)).flags|=2,s.return=t,i.return=t,i.sibling=s,t.child=i,i=s,s=t.child,u=null===(u=e.child.memoizedState)?Ds(r):{baseLanes:u.baseLanes|r,cachePool:null,transitions:u.transitions},s.memoizedState=u,s.childLanes=e.childLanes&~r,t.memoizedState=Os,i}return e=(s=e.child).sibling,i=Mc(s,{mode:"visible",children:i.children}),0===(1&t.mode)&&(i.lanes=r),i.return=t,i.sibling=null,null!==e&&(null===(r=t.deletions)?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=i,t.memoizedState=null,i}function Us(e,t){return(t=Dc({mode:"visible",children:t},e.mode,0,null)).return=e,e.child=t}function Fs(e,t,r,n){return null!==n&&vo(n),Yo(t,e.child,null,r),(e=Us(t,t.pendingProps.children)).flags|=2,t.memoizedState=null,e}function zs(e,t,r){e.lanes|=t;var n=e.alternate;null!==n&&(n.lanes|=t),So(e.return,t,r)}function Zs(e,t,r,n,i){var o=e.memoizedState;null===o?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:i}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=n,o.tail=r,o.tailMode=i)}function js(e,t,r){var n=t.pendingProps,i=n.revealOrder,o=n.tail;if(ks(e,t,n.children,r),0!==(2&(n=ua.current)))n=1&n|2,t.flags|=128;else{if(null!==e&&0!==(128&e.flags))e:for(e=t.child;null!==e;){if(13===e.tag)null!==e.memoizedState&&zs(e,r,t);else if(19===e.tag)zs(e,r,t);else if(null!==e.child){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;null===e.sibling;){if(null===e.return||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}n&=1}if(Ai(ua,n),0===(1&t.mode))t.memoizedState=null;else switch(i){case"forwards":for(r=t.child,i=null;null!==r;)null!==(e=r.alternate)&&null===ca(e)&&(i=r),r=r.sibling;null===(r=i)?(i=t.child,t.child=null):(i=r.sibling,r.sibling=null),Zs(t,!1,i,r,o);break;case"backwards":for(r=null,i=t.child,t.child=null;null!==i;){if(null!==(e=i.alternate)&&null===ca(e)){t.child=i;break}e=i.sibling,i.sibling=r,r=i,i=e}Zs(t,!0,r,null,o);break;case"together":Zs(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function qs(e,t){0===(1&t.mode)&&null!==e&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Ks(e,t,r){if(null!==e&&(t.dependencies=e.dependencies),Du|=t.lanes,0===(r&t.childLanes))return null;if(null!==e&&t.child!==e.child)throw Error(o(153));if(null!==t.child){for(r=Mc(e=t.child,e.pendingProps),t.child=r,r.return=t;null!==e.sibling;)e=e.sibling,(r=r.sibling=Mc(e,e.pendingProps)).return=t;r.sibling=null}return t.child}function Vs(e,t){if(!io)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;null!==t;)null!==t.alternate&&(r=t),t=t.sibling;null===r?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var n=null;null!==r;)null!==r.alternate&&(n=r),r=r.sibling;null===n?t||null===e.tail?e.tail=null:e.tail.sibling=null:n.sibling=null}}function Hs(e){var t=null!==e.alternate&&e.alternate.child===e.child,r=0,n=0;if(t)for(var i=e.child;null!==i;)r|=i.lanes|i.childLanes,n|=14680064&i.subtreeFlags,n|=14680064&i.flags,i.return=e,i=i.sibling;else for(i=e.child;null!==i;)r|=i.lanes|i.childLanes,n|=i.subtreeFlags,n|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=n,e.childLanes=r,t}function Gs(e,t,r){var n=t.pendingProps;switch(to(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Hs(t),null;case 1:case 17:return Bi(t.type)&&Mi(),Hs(t),null;case 3:return n=t.stateNode,oa(),_i(Ti),_i(Ci),fa(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),null!==e&&null!==e.child||(fo(t)?t.flags|=4:null===e||e.memoizedState.isDehydrated&&0===(256&t.flags)||(t.flags|=1024,null!==oo&&(ac(oo),oo=null))),Hs(t),null;case 5:sa(t);var i=na(ra.current);if(r=t.type,null!==e&&null!=t.stateNode)Ms(e,t,r,n),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!n){if(null===t.stateNode)throw Error(o(166));return Hs(t),null}if(e=na(ea.current),fo(t)){n=t.stateNode,r=t.type;var a=t.memoizedProps;switch(n[hi]=t,n[di]=a,e=0!==(1&t.mode),r){case"dialog":Fn("cancel",n),Fn("close",n);break;case"iframe":case"object":case"embed":Fn("load",n);break;case"video":case"audio":for(i=0;i<On.length;i++)Fn(On[i],n);break;case"source":Fn("error",n);break;case"img":case"image":case"link":Fn("error",n),Fn("load",n);break;case"details":Fn("toggle",n);break;case"input":J(n,a),Fn("invalid",n);break;case"select":n._wrapperState={wasMultiple:!!a.multiple},Fn("invalid",n);break;case"textarea":ie(n,a),Fn("invalid",n)}for(var u in me(r,a),i=null,a)if(a.hasOwnProperty(u)){var c=a[u];"children"===u?"string"===typeof c?n.textContent!==c&&(!0!==a.suppressHydrationWarning&&Xn(n.textContent,c,e),i=["children",c]):"number"===typeof c&&n.textContent!==""+c&&(!0!==a.suppressHydrationWarning&&Xn(n.textContent,c,e),i=["children",""+c]):s.hasOwnProperty(u)&&null!=c&&"onScroll"===u&&Fn("scroll",n)}switch(r){case"input":H(n),$(n,a,!0);break;case"textarea":H(n),ae(n);break;case"select":case"option":break;default:"function"===typeof a.onClick&&(n.onclick=$n)}n=i,t.updateQueue=n,null!==n&&(t.flags|=4)}else{u=9===i.nodeType?i:i.ownerDocument,"http://www.w3.org/1999/xhtml"===e&&(e=se(r)),"http://www.w3.org/1999/xhtml"===e?"script"===r?((e=u.createElement("div")).innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):"string"===typeof n.is?e=u.createElement(r,{is:n.is}):(e=u.createElement(r),"select"===r&&(u=e,n.multiple?u.multiple=!0:n.size&&(u.size=n.size))):e=u.createElementNS(e,r),e[hi]=t,e[di]=n,Bs(e,t),t.stateNode=e;e:{switch(u=be(r,n),r){case"dialog":Fn("cancel",e),Fn("close",e),i=n;break;case"iframe":case"object":case"embed":Fn("load",e),i=n;break;case"video":case"audio":for(i=0;i<On.length;i++)Fn(On[i],e);i=n;break;case"source":Fn("error",e),i=n;break;case"img":case"image":case"link":Fn("error",e),Fn("load",e),i=n;break;case"details":Fn("toggle",e),i=n;break;case"input":J(e,n),i=Q(e,n),Fn("invalid",e);break;case"option":default:i=n;break;case"select":e._wrapperState={wasMultiple:!!n.multiple},i=L({},n,{value:void 0}),Fn("invalid",e);break;case"textarea":ie(e,n),i=ne(e,n),Fn("invalid",e)}for(a in me(r,i),c=i)if(c.hasOwnProperty(a)){var l=c[a];"style"===a?ge(e,l):"dangerouslySetInnerHTML"===a?null!=(l=l?l.__html:void 0)&&fe(e,l):"children"===a?"string"===typeof l?("textarea"!==r||""!==l)&&he(e,l):"number"===typeof l&&he(e,""+l):"suppressContentEditableWarning"!==a&&"suppressHydrationWarning"!==a&&"autoFocus"!==a&&(s.hasOwnProperty(a)?null!=l&&"onScroll"===a&&Fn("scroll",e):null!=l&&b(e,a,l,u))}switch(r){case"input":H(e),$(e,n,!1);break;case"textarea":H(e),ae(e);break;case"option":null!=n.value&&e.setAttribute("value",""+K(n.value));break;case"select":e.multiple=!!n.multiple,null!=(a=n.value)?re(e,!!n.multiple,a,!1):null!=n.defaultValue&&re(e,!!n.multiple,n.defaultValue,!0);break;default:"function"===typeof i.onClick&&(e.onclick=$n)}switch(r){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}}n&&(t.flags|=4)}null!==t.ref&&(t.flags|=512,t.flags|=2097152)}return Hs(t),null;case 6:if(e&&null!=t.stateNode)Ns(0,t,e.memoizedProps,n);else{if("string"!==typeof n&&null===t.stateNode)throw Error(o(166));if(r=na(ra.current),na(ea.current),fo(t)){if(n=t.stateNode,r=t.memoizedProps,n[hi]=t,(a=n.nodeValue!==r)&&null!==(e=ro))switch(e.tag){case 3:Xn(n.nodeValue,r,0!==(1&e.mode));break;case 5:!0!==e.memoizedProps.suppressHydrationWarning&&Xn(n.nodeValue,r,0!==(1&e.mode))}a&&(t.flags|=4)}else(n=(9===r.nodeType?r:r.ownerDocument).createTextNode(n))[hi]=t,t.stateNode=n}return Hs(t),null;case 13:if(_i(ua),n=t.memoizedState,null===e||null!==e.memoizedState&&null!==e.memoizedState.dehydrated){if(io&&null!==no&&0!==(1&t.mode)&&0===(128&t.flags))ho(),po(),t.flags|=98560,a=!1;else if(a=fo(t),null!==n&&null!==n.dehydrated){if(null===e){if(!a)throw Error(o(318));if(!(a=null!==(a=t.memoizedState)?a.dehydrated:null))throw Error(o(317));a[hi]=t}else po(),0===(128&t.flags)&&(t.memoizedState=null),t.flags|=4;Hs(t),a=!1}else null!==oo&&(ac(oo),oo=null),a=!0;if(!a)return 65536&t.flags?t:null}return 0!==(128&t.flags)?(t.lanes=r,t):((n=null!==n)!==(null!==e&&null!==e.memoizedState)&&n&&(t.child.flags|=8192,0!==(1&t.mode)&&(null===e||0!==(1&ua.current)?0===Nu&&(Nu=3):vc())),null!==t.updateQueue&&(t.flags|=4),Hs(t),null);case 4:return oa(),null===e&&jn(t.stateNode.containerInfo),Hs(t),null;case 10:return xo(t.type._context),Hs(t),null;case 19:if(_i(ua),null===(a=t.memoizedState))return Hs(t),null;if(n=0!==(128&t.flags),null===(u=a.rendering))if(n)Vs(a,!1);else{if(0!==Nu||null!==e&&0!==(128&e.flags))for(e=t.child;null!==e;){if(null!==(u=ca(e))){for(t.flags|=128,Vs(a,!1),null!==(n=u.updateQueue)&&(t.updateQueue=n,t.flags|=4),t.subtreeFlags=0,n=r,r=t.child;null!==r;)e=n,(a=r).flags&=14680066,null===(u=a.alternate)?(a.childLanes=0,a.lanes=e,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=u.childLanes,a.lanes=u.lanes,a.child=u.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=u.memoizedProps,a.memoizedState=u.memoizedState,a.updateQueue=u.updateQueue,a.type=u.type,e=u.dependencies,a.dependencies=null===e?null:{lanes:e.lanes,firstContext:e.firstContext}),r=r.sibling;return Ai(ua,1&ua.current|2),t.child}e=e.sibling}null!==a.tail&&Ye()>ju&&(t.flags|=128,n=!0,Vs(a,!1),t.lanes=4194304)}else{if(!n)if(null!==(e=ca(u))){if(t.flags|=128,n=!0,null!==(r=e.updateQueue)&&(t.updateQueue=r,t.flags|=4),Vs(a,!0),null===a.tail&&"hidden"===a.tailMode&&!u.alternate&&!io)return Hs(t),null}else 2*Ye()-a.renderingStartTime>ju&&1073741824!==r&&(t.flags|=128,n=!0,Vs(a,!1),t.lanes=4194304);a.isBackwards?(u.sibling=t.child,t.child=u):(null!==(r=a.last)?r.sibling=u:t.child=u,a.last=u)}return null!==a.tail?(t=a.tail,a.rendering=t,a.tail=t.sibling,a.renderingStartTime=Ye(),t.sibling=null,r=ua.current,Ai(ua,n?1&r|2:1&r),t):(Hs(t),null);case 22:case 23:return fc(),n=null!==t.memoizedState,null!==e&&null!==e.memoizedState!==n&&(t.flags|=8192),n&&0!==(1&t.mode)?0!==(1073741824&Bu)&&(Hs(t),6&t.subtreeFlags&&(t.flags|=8192)):Hs(t),null;case 24:case 25:return null}throw Error(o(156,t.tag))}function Ws(e,t){switch(to(t),t.tag){case 1:return Bi(t.type)&&Mi(),65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 3:return oa(),_i(Ti),_i(Ci),fa(),0!==(65536&(e=t.flags))&&0===(128&e)?(t.flags=-65537&e|128,t):null;case 5:return sa(t),null;case 13:if(_i(ua),null!==(e=t.memoizedState)&&null!==e.dehydrated){if(null===t.alternate)throw Error(o(340));po()}return 65536&(e=t.flags)?(t.flags=-65537&e|128,t):null;case 19:return _i(ua),null;case 4:return oa(),null;case 10:return xo(t.type._context),null;case 22:case 23:return fc(),null;default:return null}}Bs=function(e,t){for(var r=t.child;null!==r;){if(5===r.tag||6===r.tag)e.appendChild(r.stateNode);else if(4!==r.tag&&null!==r.child){r.child.return=r,r=r.child;continue}if(r===t)break;for(;null===r.sibling;){if(null===r.return||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}},Ms=function(e,t,r,n){var i=e.memoizedProps;if(i!==n){e=t.stateNode,na(ea.current);var o,a=null;switch(r){case"input":i=Q(e,i),n=Q(e,n),a=[];break;case"select":i=L({},i,{value:void 0}),n=L({},n,{value:void 0}),a=[];break;case"textarea":i=ne(e,i),n=ne(e,n),a=[];break;default:"function"!==typeof i.onClick&&"function"===typeof n.onClick&&(e.onclick=$n)}for(l in me(r,n),r=null,i)if(!n.hasOwnProperty(l)&&i.hasOwnProperty(l)&&null!=i[l])if("style"===l){var u=i[l];for(o in u)u.hasOwnProperty(o)&&(r||(r={}),r[o]="")}else"dangerouslySetInnerHTML"!==l&&"children"!==l&&"suppressContentEditableWarning"!==l&&"suppressHydrationWarning"!==l&&"autoFocus"!==l&&(s.hasOwnProperty(l)?a||(a=[]):(a=a||[]).push(l,null));for(l in n){var c=n[l];if(u=null!=i?i[l]:void 0,n.hasOwnProperty(l)&&c!==u&&(null!=c||null!=u))if("style"===l)if(u){for(o in u)!u.hasOwnProperty(o)||c&&c.hasOwnProperty(o)||(r||(r={}),r[o]="");for(o in c)c.hasOwnProperty(o)&&u[o]!==c[o]&&(r||(r={}),r[o]=c[o])}else r||(a||(a=[]),a.push(l,r)),r=c;else"dangerouslySetInnerHTML"===l?(c=c?c.__html:void 0,u=u?u.__html:void 0,null!=c&&u!==c&&(a=a||[]).push(l,c)):"children"===l?"string"!==typeof c&&"number"!==typeof c||(a=a||[]).push(l,""+c):"suppressContentEditableWarning"!==l&&"suppressHydrationWarning"!==l&&(s.hasOwnProperty(l)?(null!=c&&"onScroll"===l&&Fn("scroll",e),a||u===c||(a=[])):(a=a||[]).push(l,c))}r&&(a=a||[]).push("style",r);var l=a;(t.updateQueue=l)&&(t.flags|=4)}},Ns=function(e,t,r,n){r!==n&&(t.flags|=4)};var Qs=!1,Js=!1,Ys="function"===typeof WeakSet?WeakSet:Set,Xs=null;function $s(e,t){var r=e.ref;if(null!==r)if("function"===typeof r)try{r(null)}catch(n){Sc(e,t,n)}else r.current=null}function eu(e,t,r){try{r()}catch(n){Sc(e,t,n)}}var tu=!1;function ru(e,t,r){var n=t.updateQueue;if(null!==(n=null!==n?n.lastEffect:null)){var i=n=n.next;do{if((i.tag&e)===e){var o=i.destroy;i.destroy=void 0,void 0!==o&&eu(t,r,o)}i=i.next}while(i!==n)}}function nu(e,t){if(null!==(t=null!==(t=t.updateQueue)?t.lastEffect:null)){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function iu(e){var t=e.ref;if(null!==t){var r=e.stateNode;e.tag,e=r,"function"===typeof t?t(e):t.current=e}}function ou(e){var t=e.alternate;null!==t&&(e.alternate=null,ou(t)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag&&(null!==(t=e.stateNode)&&(delete t[hi],delete t[di],delete t[vi],delete t[gi],delete t[yi])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function au(e){return 5===e.tag||3===e.tag||4===e.tag}function su(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||au(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(2&e.flags)continue e;if(null===e.child||4===e.tag)continue e;e.child.return=e,e=e.child}if(!(2&e.flags))return e.stateNode}}function uu(e,t,r){var n=e.tag;if(5===n||6===n)e=e.stateNode,t?8===r.nodeType?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(8===r.nodeType?(t=r.parentNode).insertBefore(e,r):(t=r).appendChild(e),null!==(r=r._reactRootContainer)&&void 0!==r||null!==t.onclick||(t.onclick=$n));else if(4!==n&&null!==(e=e.child))for(uu(e,t,r),e=e.sibling;null!==e;)uu(e,t,r),e=e.sibling}function cu(e,t,r){var n=e.tag;if(5===n||6===n)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(4!==n&&null!==(e=e.child))for(cu(e,t,r),e=e.sibling;null!==e;)cu(e,t,r),e=e.sibling}var lu=null,fu=!1;function hu(e,t,r){for(r=r.child;null!==r;)du(e,t,r),r=r.sibling}function du(e,t,r){if(ot&&"function"===typeof ot.onCommitFiberUnmount)try{ot.onCommitFiberUnmount(it,r)}catch(s){}switch(r.tag){case 5:Js||$s(r,t);case 6:var n=lu,i=fu;lu=null,hu(e,t,r),fu=i,null!==(lu=n)&&(fu?(e=lu,r=r.stateNode,8===e.nodeType?e.parentNode.removeChild(r):e.removeChild(r)):lu.removeChild(r.stateNode));break;case 18:null!==lu&&(fu?(e=lu,r=r.stateNode,8===e.nodeType?ui(e.parentNode,r):1===e.nodeType&&ui(e,r),jt(e)):ui(lu,r.stateNode));break;case 4:n=lu,i=fu,lu=r.stateNode.containerInfo,fu=!0,hu(e,t,r),lu=n,fu=i;break;case 0:case 11:case 14:case 15:if(!Js&&(null!==(n=r.updateQueue)&&null!==(n=n.lastEffect))){i=n=n.next;do{var o=i,a=o.destroy;o=o.tag,void 0!==a&&(0!==(2&o)||0!==(4&o))&&eu(r,t,a),i=i.next}while(i!==n)}hu(e,t,r);break;case 1:if(!Js&&($s(r,t),"function"===typeof(n=r.stateNode).componentWillUnmount))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(s){Sc(r,t,s)}hu(e,t,r);break;case 21:hu(e,t,r);break;case 22:1&r.mode?(Js=(n=Js)||null!==r.memoizedState,hu(e,t,r),Js=n):hu(e,t,r);break;default:hu(e,t,r)}}function pu(e){var t=e.updateQueue;if(null!==t){e.updateQueue=null;var r=e.stateNode;null===r&&(r=e.stateNode=new Ys),t.forEach((function(t){var n=Cc.bind(null,e,t);r.has(t)||(r.add(t),t.then(n,n))}))}}function vu(e,t){var r=t.deletions;if(null!==r)for(var n=0;n<r.length;n++){var i=r[n];try{var a=e,s=t,u=s;e:for(;null!==u;){switch(u.tag){case 5:lu=u.stateNode,fu=!1;break e;case 3:case 4:lu=u.stateNode.containerInfo,fu=!0;break e}u=u.return}if(null===lu)throw Error(o(160));du(a,s,i),lu=null,fu=!1;var c=i.alternate;null!==c&&(c.return=null),i.return=null}catch(l){Sc(i,t,l)}}if(12854&t.subtreeFlags)for(t=t.child;null!==t;)gu(t,e),t=t.sibling}function gu(e,t){var r=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(vu(t,e),yu(e),4&n){try{ru(3,e,e.return),nu(3,e)}catch(g){Sc(e,e.return,g)}try{ru(5,e,e.return)}catch(g){Sc(e,e.return,g)}}break;case 1:vu(t,e),yu(e),512&n&&null!==r&&$s(r,r.return);break;case 5:if(vu(t,e),yu(e),512&n&&null!==r&&$s(r,r.return),32&e.flags){var i=e.stateNode;try{he(i,"")}catch(g){Sc(e,e.return,g)}}if(4&n&&null!=(i=e.stateNode)){var a=e.memoizedProps,s=null!==r?r.memoizedProps:a,u=e.type,c=e.updateQueue;if(e.updateQueue=null,null!==c)try{"input"===u&&"radio"===a.type&&null!=a.name&&Y(i,a),be(u,s);var l=be(u,a);for(s=0;s<c.length;s+=2){var f=c[s],h=c[s+1];"style"===f?ge(i,h):"dangerouslySetInnerHTML"===f?fe(i,h):"children"===f?he(i,h):b(i,f,h,l)}switch(u){case"input":X(i,a);break;case"textarea":oe(i,a);break;case"select":var d=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!a.multiple;var p=a.value;null!=p?re(i,!!a.multiple,p,!1):d!==!!a.multiple&&(null!=a.defaultValue?re(i,!!a.multiple,a.defaultValue,!0):re(i,!!a.multiple,a.multiple?[]:"",!1))}i[di]=a}catch(g){Sc(e,e.return,g)}}break;case 6:if(vu(t,e),yu(e),4&n){if(null===e.stateNode)throw Error(o(162));i=e.stateNode,a=e.memoizedProps;try{i.nodeValue=a}catch(g){Sc(e,e.return,g)}}break;case 3:if(vu(t,e),yu(e),4&n&&null!==r&&r.memoizedState.isDehydrated)try{jt(t.containerInfo)}catch(g){Sc(e,e.return,g)}break;case 4:default:vu(t,e),yu(e);break;case 13:vu(t,e),yu(e),8192&(i=e.child).flags&&(a=null!==i.memoizedState,i.stateNode.isHidden=a,!a||null!==i.alternate&&null!==i.alternate.memoizedState||(Zu=Ye())),4&n&&pu(e);break;case 22:if(f=null!==r&&null!==r.memoizedState,1&e.mode?(Js=(l=Js)||f,vu(t,e),Js=l):vu(t,e),yu(e),8192&n){if(l=null!==e.memoizedState,(e.stateNode.isHidden=l)&&!f&&0!==(1&e.mode))for(Xs=e,f=e.child;null!==f;){for(h=Xs=f;null!==Xs;){switch(p=(d=Xs).child,d.tag){case 0:case 11:case 14:case 15:ru(4,d,d.return);break;case 1:$s(d,d.return);var v=d.stateNode;if("function"===typeof v.componentWillUnmount){n=d,r=d.return;try{t=n,v.props=t.memoizedProps,v.state=t.memoizedState,v.componentWillUnmount()}catch(g){Sc(n,r,g)}}break;case 5:$s(d,d.return);break;case 22:if(null!==d.memoizedState){ku(h);continue}}null!==p?(p.return=d,Xs=p):ku(h)}f=f.sibling}e:for(f=null,h=e;;){if(5===h.tag){if(null===f){f=h;try{i=h.stateNode,l?"function"===typeof(a=i.style).setProperty?a.setProperty("display","none","important"):a.display="none":(u=h.stateNode,s=void 0!==(c=h.memoizedProps.style)&&null!==c&&c.hasOwnProperty("display")?c.display:null,u.style.display=ve("display",s))}catch(g){Sc(e,e.return,g)}}}else if(6===h.tag){if(null===f)try{h.stateNode.nodeValue=l?"":h.memoizedProps}catch(g){Sc(e,e.return,g)}}else if((22!==h.tag&&23!==h.tag||null===h.memoizedState||h===e)&&null!==h.child){h.child.return=h,h=h.child;continue}if(h===e)break e;for(;null===h.sibling;){if(null===h.return||h.return===e)break e;f===h&&(f=null),h=h.return}f===h&&(f=null),h.sibling.return=h.return,h=h.sibling}}break;case 19:vu(t,e),yu(e),4&n&&pu(e);case 21:}}function yu(e){var t=e.flags;if(2&t){try{e:{for(var r=e.return;null!==r;){if(au(r)){var n=r;break e}r=r.return}throw Error(o(160))}switch(n.tag){case 5:var i=n.stateNode;32&n.flags&&(he(i,""),n.flags&=-33),cu(e,su(e),i);break;case 3:case 4:var a=n.stateNode.containerInfo;uu(e,su(e),a);break;default:throw Error(o(161))}}catch(s){Sc(e,e.return,s)}e.flags&=-3}4096&t&&(e.flags&=-4097)}function mu(e,t,r){Xs=e,bu(e,t,r)}function bu(e,t,r){for(var n=0!==(1&e.mode);null!==Xs;){var i=Xs,o=i.child;if(22===i.tag&&n){var a=null!==i.memoizedState||Qs;if(!a){var s=i.alternate,u=null!==s&&null!==s.memoizedState||Js;s=Qs;var c=Js;if(Qs=a,(Js=u)&&!c)for(Xs=i;null!==Xs;)u=(a=Xs).child,22===a.tag&&null!==a.memoizedState?Eu(i):null!==u?(u.return=a,Xs=u):Eu(i);for(;null!==o;)Xs=o,bu(o,t,r),o=o.sibling;Xs=i,Qs=s,Js=c}wu(e)}else 0!==(8772&i.subtreeFlags)&&null!==o?(o.return=i,Xs=o):wu(e)}}function wu(e){for(;null!==Xs;){var t=Xs;if(0!==(8772&t.flags)){var r=t.alternate;try{if(0!==(8772&t.flags))switch(t.tag){case 0:case 11:case 15:Js||nu(5,t);break;case 1:var n=t.stateNode;if(4&t.flags&&!Js)if(null===r)n.componentDidMount();else{var i=t.elementType===t.type?r.memoizedProps:yo(t.type,r.memoizedProps);n.componentDidUpdate(i,r.memoizedState,n.__reactInternalSnapshotBeforeUpdate)}var a=t.updateQueue;null!==a&&Fo(t,a,n);break;case 3:var s=t.updateQueue;if(null!==s){if(r=null,null!==t.child)switch(t.child.tag){case 5:case 1:r=t.child.stateNode}Fo(t,s,r)}break;case 5:var u=t.stateNode;if(null===r&&4&t.flags){r=u;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&r.focus();break;case"img":c.src&&(r.src=c.src)}}break;case 6:case 4:case 12:case 19:case 17:case 21:case 22:case 23:case 25:break;case 13:if(null===t.memoizedState){var l=t.alternate;if(null!==l){var f=l.memoizedState;if(null!==f){var h=f.dehydrated;null!==h&&jt(h)}}}break;default:throw Error(o(163))}Js||512&t.flags&&iu(t)}catch(d){Sc(t,t.return,d)}}if(t===e){Xs=null;break}if(null!==(r=t.sibling)){r.return=t.return,Xs=r;break}Xs=t.return}}function ku(e){for(;null!==Xs;){var t=Xs;if(t===e){Xs=null;break}var r=t.sibling;if(null!==r){r.return=t.return,Xs=r;break}Xs=t.return}}function Eu(e){for(;null!==Xs;){var t=Xs;try{switch(t.tag){case 0:case 11:case 15:var r=t.return;try{nu(4,t)}catch(u){Sc(t,r,u)}break;case 1:var n=t.stateNode;if("function"===typeof n.componentDidMount){var i=t.return;try{n.componentDidMount()}catch(u){Sc(t,i,u)}}var o=t.return;try{iu(t)}catch(u){Sc(t,o,u)}break;case 5:var a=t.return;try{iu(t)}catch(u){Sc(t,a,u)}}}catch(u){Sc(t,t.return,u)}if(t===e){Xs=null;break}var s=t.sibling;if(null!==s){s.return=t.return,Xs=s;break}Xs=t.return}}var xu,Su=Math.ceil,_u=w.ReactCurrentDispatcher,Au=w.ReactCurrentOwner,Iu=w.ReactCurrentBatchConfig,Cu=0,Tu=null,Pu=null,Ru=0,Bu=0,Mu=Si(0),Nu=0,Ou=null,Du=0,Lu=0,Uu=0,Fu=null,zu=null,Zu=0,ju=1/0,qu=null,Ku=!1,Vu=null,Hu=null,Gu=!1,Wu=null,Qu=0,Ju=0,Yu=null,Xu=-1,$u=0;function ec(){return 0!==(6&Cu)?Ye():-1!==Xu?Xu:Xu=Ye()}function tc(e){return 0===(1&e.mode)?1:0!==(2&Cu)&&0!==Ru?Ru&-Ru:null!==go.transition?(0===$u&&($u=vt()),$u):0!==(e=bt)?e:e=void 0===(e=window.event)?16:Jt(e.type)}function rc(e,t,r,n){if(50<Ju)throw Ju=0,Yu=null,Error(o(185));yt(e,r,n),0!==(2&Cu)&&e===Tu||(e===Tu&&(0===(2&Cu)&&(Lu|=r),4===Nu&&sc(e,Ru)),nc(e,n),1===r&&0===Cu&&0===(1&t.mode)&&(ju=Ye()+500,Fi&&ji()))}function nc(e,t){var r=e.callbackNode;!function(e,t){for(var r=e.suspendedLanes,n=e.pingedLanes,i=e.expirationTimes,o=e.pendingLanes;0<o;){var a=31-at(o),s=1<<a,u=i[a];-1===u?0!==(s&r)&&0===(s&n)||(i[a]=dt(s,t)):u<=t&&(e.expiredLanes|=s),o&=~s}}(e,t);var n=ht(e,e===Tu?Ru:0);if(0===n)null!==r&&We(r),e.callbackNode=null,e.callbackPriority=0;else if(t=n&-n,e.callbackPriority!==t){if(null!=r&&We(r),1===t)0===e.tag?function(e){Fi=!0,Zi(e)}(uc.bind(null,e)):Zi(uc.bind(null,e)),ai((function(){0===(6&Cu)&&ji()})),r=null;else{switch(wt(n)){case 1:r=$e;break;case 4:r=et;break;case 16:default:r=tt;break;case 536870912:r=nt}r=Tc(r,ic.bind(null,e))}e.callbackPriority=t,e.callbackNode=r}}function ic(e,t){if(Xu=-1,$u=0,0!==(6&Cu))throw Error(o(327));var r=e.callbackNode;if(Ec()&&e.callbackNode!==r)return null;var n=ht(e,e===Tu?Ru:0);if(0===n)return null;if(0!==(30&n)||0!==(n&e.expiredLanes)||t)t=gc(e,n);else{t=n;var i=Cu;Cu|=2;var a=pc();for(Tu===e&&Ru===t||(qu=null,ju=Ye()+500,hc(e,t));;)try{mc();break}catch(u){dc(e,u)}Eo(),_u.current=a,Cu=i,null!==Pu?t=0:(Tu=null,Ru=0,t=Nu)}if(0!==t){if(2===t&&(0!==(i=pt(e))&&(n=i,t=oc(e,i))),1===t)throw r=Ou,hc(e,0),sc(e,n),nc(e,Ye()),r;if(6===t)sc(e,n);else{if(i=e.current.alternate,0===(30&n)&&!function(e){for(var t=e;;){if(16384&t.flags){var r=t.updateQueue;if(null!==r&&null!==(r=r.stores))for(var n=0;n<r.length;n++){var i=r[n],o=i.getSnapshot;i=i.value;try{if(!sn(o(),i))return!1}catch(s){return!1}}}if(r=t.child,16384&t.subtreeFlags&&null!==r)r.return=t,t=r;else{if(t===e)break;for(;null===t.sibling;){if(null===t.return||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}(i)&&(2===(t=gc(e,n))&&(0!==(a=pt(e))&&(n=a,t=oc(e,a))),1===t))throw r=Ou,hc(e,0),sc(e,n),nc(e,Ye()),r;switch(e.finishedWork=i,e.finishedLanes=n,t){case 0:case 1:throw Error(o(345));case 2:case 5:kc(e,zu,qu);break;case 3:if(sc(e,n),(130023424&n)===n&&10<(t=Zu+500-Ye())){if(0!==ht(e,0))break;if(((i=e.suspendedLanes)&n)!==n){ec(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=ni(kc.bind(null,e,zu,qu),t);break}kc(e,zu,qu);break;case 4:if(sc(e,n),(4194240&n)===n)break;for(t=e.eventTimes,i=-1;0<n;){var s=31-at(n);a=1<<s,(s=t[s])>i&&(i=s),n&=~a}if(n=i,10<(n=(120>(n=Ye()-n)?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*Su(n/1960))-n)){e.timeoutHandle=ni(kc.bind(null,e,zu,qu),n);break}kc(e,zu,qu);break;default:throw Error(o(329))}}}return nc(e,Ye()),e.callbackNode===r?ic.bind(null,e):null}function oc(e,t){var r=Fu;return e.current.memoizedState.isDehydrated&&(hc(e,t).flags|=256),2!==(e=gc(e,t))&&(t=zu,zu=r,null!==t&&ac(t)),e}function ac(e){null===zu?zu=e:zu.push.apply(zu,e)}function sc(e,t){for(t&=~Uu,t&=~Lu,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var r=31-at(t),n=1<<r;e[r]=-1,t&=~n}}function uc(e){if(0!==(6&Cu))throw Error(o(327));Ec();var t=ht(e,0);if(0===(1&t))return nc(e,Ye()),null;var r=gc(e,t);if(0!==e.tag&&2===r){var n=pt(e);0!==n&&(t=n,r=oc(e,n))}if(1===r)throw r=Ou,hc(e,0),sc(e,t),nc(e,Ye()),r;if(6===r)throw Error(o(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,kc(e,zu,qu),nc(e,Ye()),null}function cc(e,t){var r=Cu;Cu|=1;try{return e(t)}finally{0===(Cu=r)&&(ju=Ye()+500,Fi&&ji())}}function lc(e){null!==Wu&&0===Wu.tag&&0===(6&Cu)&&Ec();var t=Cu;Cu|=1;var r=Iu.transition,n=bt;try{if(Iu.transition=null,bt=1,e)return e()}finally{bt=n,Iu.transition=r,0===(6&(Cu=t))&&ji()}}function fc(){Bu=Mu.current,_i(Mu)}function hc(e,t){e.finishedWork=null,e.finishedLanes=0;var r=e.timeoutHandle;if(-1!==r&&(e.timeoutHandle=-1,ii(r)),null!==Pu)for(r=Pu.return;null!==r;){var n=r;switch(to(n),n.tag){case 1:null!==(n=n.type.childContextTypes)&&void 0!==n&&Mi();break;case 3:oa(),_i(Ti),_i(Ci),fa();break;case 5:sa(n);break;case 4:oa();break;case 13:case 19:_i(ua);break;case 10:xo(n.type._context);break;case 22:case 23:fc()}r=r.return}if(Tu=e,Pu=e=Mc(e.current,null),Ru=Bu=t,Nu=0,Ou=null,Uu=Lu=Du=0,zu=Fu=null,null!==Io){for(t=0;t<Io.length;t++)if(null!==(n=(r=Io[t]).interleaved)){r.interleaved=null;var i=n.next,o=r.pending;if(null!==o){var a=o.next;o.next=i,n.next=a}r.pending=n}Io=null}return e}function dc(e,t){for(;;){var r=Pu;try{if(Eo(),ha.current=as,ma){for(var n=va.memoizedState;null!==n;){var i=n.queue;null!==i&&(i.pending=null),n=n.next}ma=!1}if(pa=0,ya=ga=va=null,ba=!1,wa=0,Au.current=null,null===r||null===r.return){Nu=1,Ou=t,Pu=null;break}e:{var a=e,s=r.return,u=r,c=t;if(t=Ru,u.flags|=32768,null!==c&&"object"===typeof c&&"function"===typeof c.then){var l=c,f=u,h=f.tag;if(0===(1&f.mode)&&(0===h||11===h||15===h)){var d=f.alternate;d?(f.updateQueue=d.updateQueue,f.memoizedState=d.memoizedState,f.lanes=d.lanes):(f.updateQueue=null,f.memoizedState=null)}var p=ys(s);if(null!==p){p.flags&=-257,ms(p,s,u,0,t),1&p.mode&&gs(a,l,t),c=l;var v=(t=p).updateQueue;if(null===v){var g=new Set;g.add(c),t.updateQueue=g}else v.add(c);break e}if(0===(1&t)){gs(a,l,t),vc();break e}c=Error(o(426))}else if(io&&1&u.mode){var y=ys(s);if(null!==y){0===(65536&y.flags)&&(y.flags|=256),ms(y,s,u,0,t),vo(ls(c,u));break e}}a=c=ls(c,u),4!==Nu&&(Nu=2),null===Fu?Fu=[a]:Fu.push(a),a=s;do{switch(a.tag){case 3:a.flags|=65536,t&=-t,a.lanes|=t,Lo(a,ps(0,c,t));break e;case 1:u=c;var m=a.type,b=a.stateNode;if(0===(128&a.flags)&&("function"===typeof m.getDerivedStateFromError||null!==b&&"function"===typeof b.componentDidCatch&&(null===Hu||!Hu.has(b)))){a.flags|=65536,t&=-t,a.lanes|=t,Lo(a,vs(a,u,t));break e}}a=a.return}while(null!==a)}wc(r)}catch(w){t=w,Pu===r&&null!==r&&(Pu=r=r.return);continue}break}}function pc(){var e=_u.current;return _u.current=as,null===e?as:e}function vc(){0!==Nu&&3!==Nu&&2!==Nu||(Nu=4),null===Tu||0===(268435455&Du)&&0===(268435455&Lu)||sc(Tu,Ru)}function gc(e,t){var r=Cu;Cu|=2;var n=pc();for(Tu===e&&Ru===t||(qu=null,hc(e,t));;)try{yc();break}catch(i){dc(e,i)}if(Eo(),Cu=r,_u.current=n,null!==Pu)throw Error(o(261));return Tu=null,Ru=0,Nu}function yc(){for(;null!==Pu;)bc(Pu)}function mc(){for(;null!==Pu&&!Qe();)bc(Pu)}function bc(e){var t=xu(e.alternate,e,Bu);e.memoizedProps=e.pendingProps,null===t?wc(e):Pu=t,Au.current=null}function wc(e){var t=e;do{var r=t.alternate;if(e=t.return,0===(32768&t.flags)){if(null!==(r=Gs(r,t,Bu)))return void(Pu=r)}else{if(null!==(r=Ws(r,t)))return r.flags&=32767,void(Pu=r);if(null===e)return Nu=6,void(Pu=null);e.flags|=32768,e.subtreeFlags=0,e.deletions=null}if(null!==(t=t.sibling))return void(Pu=t);Pu=t=e}while(null!==t);0===Nu&&(Nu=5)}function kc(e,t,r){var n=bt,i=Iu.transition;try{Iu.transition=null,bt=1,function(e,t,r,n){do{Ec()}while(null!==Wu);if(0!==(6&Cu))throw Error(o(327));r=e.finishedWork;var i=e.finishedLanes;if(null===r)return null;if(e.finishedWork=null,e.finishedLanes=0,r===e.current)throw Error(o(177));e.callbackNode=null,e.callbackPriority=0;var a=r.lanes|r.childLanes;if(function(e,t){var r=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var n=e.eventTimes;for(e=e.expirationTimes;0<r;){var i=31-at(r),o=1<<i;t[i]=0,n[i]=-1,e[i]=-1,r&=~o}}(e,a),e===Tu&&(Pu=Tu=null,Ru=0),0===(2064&r.subtreeFlags)&&0===(2064&r.flags)||Gu||(Gu=!0,Tc(tt,(function(){return Ec(),null}))),a=0!==(15990&r.flags),0!==(15990&r.subtreeFlags)||a){a=Iu.transition,Iu.transition=null;var s=bt;bt=1;var u=Cu;Cu|=4,Au.current=null,function(e,t){if(ei=Kt,dn(e=hn())){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{var n=(r=(r=e.ownerDocument)&&r.defaultView||window).getSelection&&r.getSelection();if(n&&0!==n.rangeCount){r=n.anchorNode;var i=n.anchorOffset,a=n.focusNode;n=n.focusOffset;try{r.nodeType,a.nodeType}catch(k){r=null;break e}var s=0,u=-1,c=-1,l=0,f=0,h=e,d=null;t:for(;;){for(var p;h!==r||0!==i&&3!==h.nodeType||(u=s+i),h!==a||0!==n&&3!==h.nodeType||(c=s+n),3===h.nodeType&&(s+=h.nodeValue.length),null!==(p=h.firstChild);)d=h,h=p;for(;;){if(h===e)break t;if(d===r&&++l===i&&(u=s),d===a&&++f===n&&(c=s),null!==(p=h.nextSibling))break;d=(h=d).parentNode}h=p}r=-1===u||-1===c?null:{start:u,end:c}}else r=null}r=r||{start:0,end:0}}else r=null;for(ti={focusedElem:e,selectionRange:r},Kt=!1,Xs=t;null!==Xs;)if(e=(t=Xs).child,0!==(1028&t.subtreeFlags)&&null!==e)e.return=t,Xs=e;else for(;null!==Xs;){t=Xs;try{var v=t.alternate;if(0!==(1024&t.flags))switch(t.tag){case 0:case 11:case 15:case 5:case 6:case 4:case 17:break;case 1:if(null!==v){var g=v.memoizedProps,y=v.memoizedState,m=t.stateNode,b=m.getSnapshotBeforeUpdate(t.elementType===t.type?g:yo(t.type,g),y);m.__reactInternalSnapshotBeforeUpdate=b}break;case 3:var w=t.stateNode.containerInfo;1===w.nodeType?w.textContent="":9===w.nodeType&&w.documentElement&&w.removeChild(w.documentElement);break;default:throw Error(o(163))}}catch(k){Sc(t,t.return,k)}if(null!==(e=t.sibling)){e.return=t.return,Xs=e;break}Xs=t.return}v=tu,tu=!1}(e,r),gu(r,e),pn(ti),Kt=!!ei,ti=ei=null,e.current=r,mu(r,e,i),Je(),Cu=u,bt=s,Iu.transition=a}else e.current=r;if(Gu&&(Gu=!1,Wu=e,Qu=i),0===(a=e.pendingLanes)&&(Hu=null),function(e){if(ot&&"function"===typeof ot.onCommitFiberRoot)try{ot.onCommitFiberRoot(it,e,void 0,128===(128&e.current.flags))}catch(t){}}(r.stateNode),nc(e,Ye()),null!==t)for(n=e.onRecoverableError,r=0;r<t.length;r++)n((i=t[r]).value,{componentStack:i.stack,digest:i.digest});if(Ku)throw Ku=!1,e=Vu,Vu=null,e;0!==(1&Qu)&&0!==e.tag&&Ec(),0!==(1&(a=e.pendingLanes))?e===Yu?Ju++:(Ju=0,Yu=e):Ju=0,ji()}(e,t,r,n)}finally{Iu.transition=i,bt=n}return null}function Ec(){if(null!==Wu){var e=wt(Qu),t=Iu.transition,r=bt;try{if(Iu.transition=null,bt=16>e?16:e,null===Wu)var n=!1;else{if(e=Wu,Wu=null,Qu=0,0!==(6&Cu))throw Error(o(331));var i=Cu;for(Cu|=4,Xs=e.current;null!==Xs;){var a=Xs,s=a.child;if(0!==(16&Xs.flags)){var u=a.deletions;if(null!==u){for(var c=0;c<u.length;c++){var l=u[c];for(Xs=l;null!==Xs;){var f=Xs;switch(f.tag){case 0:case 11:case 15:ru(8,f,a)}var h=f.child;if(null!==h)h.return=f,Xs=h;else for(;null!==Xs;){var d=(f=Xs).sibling,p=f.return;if(ou(f),f===l){Xs=null;break}if(null!==d){d.return=p,Xs=d;break}Xs=p}}}var v=a.alternate;if(null!==v){var g=v.child;if(null!==g){v.child=null;do{var y=g.sibling;g.sibling=null,g=y}while(null!==g)}}Xs=a}}if(0!==(2064&a.subtreeFlags)&&null!==s)s.return=a,Xs=s;else e:for(;null!==Xs;){if(0!==(2048&(a=Xs).flags))switch(a.tag){case 0:case 11:case 15:ru(9,a,a.return)}var m=a.sibling;if(null!==m){m.return=a.return,Xs=m;break e}Xs=a.return}}var b=e.current;for(Xs=b;null!==Xs;){var w=(s=Xs).child;if(0!==(2064&s.subtreeFlags)&&null!==w)w.return=s,Xs=w;else e:for(s=b;null!==Xs;){if(0!==(2048&(u=Xs).flags))try{switch(u.tag){case 0:case 11:case 15:nu(9,u)}}catch(E){Sc(u,u.return,E)}if(u===s){Xs=null;break e}var k=u.sibling;if(null!==k){k.return=u.return,Xs=k;break e}Xs=u.return}}if(Cu=i,ji(),ot&&"function"===typeof ot.onPostCommitFiberRoot)try{ot.onPostCommitFiberRoot(it,e)}catch(E){}n=!0}return n}finally{bt=r,Iu.transition=t}}return!1}function xc(e,t,r){e=Oo(e,t=ps(0,t=ls(r,t),1),1),t=ec(),null!==e&&(yt(e,1,t),nc(e,t))}function Sc(e,t,r){if(3===e.tag)xc(e,e,r);else for(;null!==t;){if(3===t.tag){xc(t,e,r);break}if(1===t.tag){var n=t.stateNode;if("function"===typeof t.type.getDerivedStateFromError||"function"===typeof n.componentDidCatch&&(null===Hu||!Hu.has(n))){t=Oo(t,e=vs(t,e=ls(r,e),1),1),e=ec(),null!==t&&(yt(t,1,e),nc(t,e));break}}t=t.return}}function _c(e,t,r){var n=e.pingCache;null!==n&&n.delete(t),t=ec(),e.pingedLanes|=e.suspendedLanes&r,Tu===e&&(Ru&r)===r&&(4===Nu||3===Nu&&(130023424&Ru)===Ru&&500>Ye()-Zu?hc(e,0):Uu|=r),nc(e,t)}function Ac(e,t){0===t&&(0===(1&e.mode)?t=1:(t=lt,0===(130023424&(lt<<=1))&&(lt=4194304)));var r=ec();null!==(e=Po(e,t))&&(yt(e,t,r),nc(e,r))}function Ic(e){var t=e.memoizedState,r=0;null!==t&&(r=t.retryLane),Ac(e,r)}function Cc(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,i=e.memoizedState;null!==i&&(r=i.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(o(314))}null!==n&&n.delete(t),Ac(e,r)}function Tc(e,t){return Ge(e,t)}function Pc(e,t,r,n){this.tag=e,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Rc(e,t,r,n){return new Pc(e,t,r,n)}function Bc(e){return!(!(e=e.prototype)||!e.isReactComponent)}function Mc(e,t){var r=e.alternate;return null===r?((r=Rc(e.tag,t,e.key,e.mode)).elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=14680064&e.flags,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=null===t?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function Nc(e,t,r,n,i,a){var s=2;if(n=e,"function"===typeof e)Bc(e)&&(s=1);else if("string"===typeof e)s=5;else e:switch(e){case x:return Oc(r.children,i,a,t);case S:s=8,i|=8;break;case _:return(e=Rc(12,r,t,2|i)).elementType=_,e.lanes=a,e;case T:return(e=Rc(13,r,t,i)).elementType=T,e.lanes=a,e;case P:return(e=Rc(19,r,t,i)).elementType=P,e.lanes=a,e;case M:return Dc(r,i,a,t);default:if("object"===typeof e&&null!==e)switch(e.$$typeof){case A:s=10;break e;case I:s=9;break e;case C:s=11;break e;case R:s=14;break e;case B:s=16,n=null;break e}throw Error(o(130,null==e?e:typeof e,""))}return(t=Rc(s,r,t,i)).elementType=e,t.type=n,t.lanes=a,t}function Oc(e,t,r,n){return(e=Rc(7,e,n,t)).lanes=r,e}function Dc(e,t,r,n){return(e=Rc(22,e,n,t)).elementType=M,e.lanes=r,e.stateNode={isHidden:!1},e}function Lc(e,t,r){return(e=Rc(6,e,null,t)).lanes=r,e}function Uc(e,t,r){return(t=Rc(4,null!==e.children?e.children:[],e.key,t)).lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function Fc(e,t,r,n,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=gt(0),this.expirationTimes=gt(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=gt(0),this.identifierPrefix=n,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function zc(e,t,r,n,i,o,a,s,u){return e=new Fc(e,t,r,s,u),1===t?(t=1,!0===o&&(t|=8)):t=0,o=Rc(3,null,null,t),e.current=o,o.stateNode=e,o.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},Bo(o),e}function Zc(e,t,r){var n=3<arguments.length&&void 0!==arguments[3]?arguments[3]:null;return{$$typeof:E,key:null==n?null:""+n,children:e,containerInfo:t,implementation:r}}function jc(e){if(!e)return Ii;e:{if(je(e=e._reactInternals)!==e||1!==e.tag)throw Error(o(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Bi(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(null!==t);throw Error(o(171))}if(1===e.tag){var r=e.type;if(Bi(r))return Oi(e,r,t)}return t}function qc(e,t,r,n,i,o,a,s,u){return(e=zc(r,n,!0,e,0,o,0,s,u)).context=jc(null),r=e.current,(o=No(n=ec(),i=tc(r))).callback=void 0!==t&&null!==t?t:null,Oo(r,o,i),e.current.lanes=i,yt(e,i,n),nc(e,n),e}function Kc(e,t,r,n){var i=t.current,o=ec(),a=tc(i);return r=jc(r),null===t.context?t.context=r:t.pendingContext=r,(t=No(o,a)).payload={element:e},null!==(n=void 0===n?null:n)&&(t.callback=n),null!==(e=Oo(i,t,a))&&(rc(e,i,a,o),Do(e,i,a)),a}function Vc(e){return(e=e.current).child?(e.child.tag,e.child.stateNode):null}function Hc(e,t){if(null!==(e=e.memoizedState)&&null!==e.dehydrated){var r=e.retryLane;e.retryLane=0!==r&&r<t?r:t}}function Gc(e,t){Hc(e,t),(e=e.alternate)&&Hc(e,t)}xu=function(e,t,r){if(null!==e)if(e.memoizedProps!==t.pendingProps||Ti.current)ws=!0;else{if(0===(e.lanes&r)&&0===(128&t.flags))return ws=!1,function(e,t,r){switch(t.tag){case 3:Ps(t),po();break;case 5:aa(t);break;case 1:Bi(t.type)&&Di(t);break;case 4:ia(t,t.stateNode.containerInfo);break;case 10:var n=t.type._context,i=t.memoizedProps.value;Ai(mo,n._currentValue),n._currentValue=i;break;case 13:if(null!==(n=t.memoizedState))return null!==n.dehydrated?(Ai(ua,1&ua.current),t.flags|=128,null):0!==(r&t.child.childLanes)?Ls(e,t,r):(Ai(ua,1&ua.current),null!==(e=Ks(e,t,r))?e.sibling:null);Ai(ua,1&ua.current);break;case 19:if(n=0!==(r&t.childLanes),0!==(128&e.flags)){if(n)return js(e,t,r);t.flags|=128}if(null!==(i=t.memoizedState)&&(i.rendering=null,i.tail=null,i.lastEffect=null),Ai(ua,ua.current),n)break;return null;case 22:case 23:return t.lanes=0,_s(e,t,r)}return Ks(e,t,r)}(e,t,r);ws=0!==(131072&e.flags)}else ws=!1,io&&0!==(1048576&t.flags)&&$i(t,Hi,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;qs(e,t),e=t.pendingProps;var i=Ri(t,Ci.current);_o(t,r),i=Sa(null,t,n,e,i,r);var a=_a();return t.flags|=1,"object"===typeof i&&null!==i&&"function"===typeof i.render&&void 0===i.$$typeof?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Bi(n)?(a=!0,Di(t)):a=!1,t.memoizedState=null!==i.state&&void 0!==i.state?i.state:null,Bo(t),i.updater=jo,t.stateNode=i,i._reactInternals=t,Ho(t,n,e,r),t=Ts(null,t,n,!0,a,r)):(t.tag=0,io&&a&&eo(t),ks(null,t,i,r),t=t.child),t;case 16:n=t.elementType;e:{switch(qs(e,t),e=t.pendingProps,n=(i=n._init)(n._payload),t.type=n,i=t.tag=function(e){if("function"===typeof e)return Bc(e)?1:0;if(void 0!==e&&null!==e){if((e=e.$$typeof)===C)return 11;if(e===R)return 14}return 2}(n),e=yo(n,e),i){case 0:t=Is(null,t,n,e,r);break e;case 1:t=Cs(null,t,n,e,r);break e;case 11:t=Es(null,t,n,e,r);break e;case 14:t=xs(null,t,n,yo(n.type,e),r);break e}throw Error(o(306,n,""))}return t;case 0:return n=t.type,i=t.pendingProps,Is(e,t,n,i=t.elementType===n?i:yo(n,i),r);case 1:return n=t.type,i=t.pendingProps,Cs(e,t,n,i=t.elementType===n?i:yo(n,i),r);case 3:e:{if(Ps(t),null===e)throw Error(o(387));n=t.pendingProps,i=(a=t.memoizedState).element,Mo(e,t),Uo(t,n,null,r);var s=t.memoizedState;if(n=s.element,a.isDehydrated){if(a={element:n,isDehydrated:!1,cache:s.cache,pendingSuspenseBoundaries:s.pendingSuspenseBoundaries,transitions:s.transitions},t.updateQueue.baseState=a,t.memoizedState=a,256&t.flags){t=Rs(e,t,n,r,i=ls(Error(o(423)),t));break e}if(n!==i){t=Rs(e,t,n,r,i=ls(Error(o(424)),t));break e}for(no=ci(t.stateNode.containerInfo.firstChild),ro=t,io=!0,oo=null,r=Xo(t,null,n,r),t.child=r;r;)r.flags=-3&r.flags|4096,r=r.sibling}else{if(po(),n===i){t=Ks(e,t,r);break e}ks(e,t,n,r)}t=t.child}return t;case 5:return aa(t),null===e&&co(t),n=t.type,i=t.pendingProps,a=null!==e?e.memoizedProps:null,s=i.children,ri(n,i)?s=null:null!==a&&ri(n,a)&&(t.flags|=32),As(e,t),ks(e,t,s,r),t.child;case 6:return null===e&&co(t),null;case 13:return Ls(e,t,r);case 4:return ia(t,t.stateNode.containerInfo),n=t.pendingProps,null===e?t.child=Yo(t,null,n,r):ks(e,t,n,r),t.child;case 11:return n=t.type,i=t.pendingProps,Es(e,t,n,i=t.elementType===n?i:yo(n,i),r);case 7:return ks(e,t,t.pendingProps,r),t.child;case 8:case 12:return ks(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,i=t.pendingProps,a=t.memoizedProps,s=i.value,Ai(mo,n._currentValue),n._currentValue=s,null!==a)if(sn(a.value,s)){if(a.children===i.children&&!Ti.current){t=Ks(e,t,r);break e}}else for(null!==(a=t.child)&&(a.return=t);null!==a;){var u=a.dependencies;if(null!==u){s=a.child;for(var c=u.firstContext;null!==c;){if(c.context===n){if(1===a.tag){(c=No(-1,r&-r)).tag=2;var l=a.updateQueue;if(null!==l){var f=(l=l.shared).pending;null===f?c.next=c:(c.next=f.next,f.next=c),l.pending=c}}a.lanes|=r,null!==(c=a.alternate)&&(c.lanes|=r),So(a.return,r,t),u.lanes|=r;break}c=c.next}}else if(10===a.tag)s=a.type===t.type?null:a.child;else if(18===a.tag){if(null===(s=a.return))throw Error(o(341));s.lanes|=r,null!==(u=s.alternate)&&(u.lanes|=r),So(s,r,t),s=a.sibling}else s=a.child;if(null!==s)s.return=a;else for(s=a;null!==s;){if(s===t){s=null;break}if(null!==(a=s.sibling)){a.return=s.return,s=a;break}s=s.return}a=s}ks(e,t,i.children,r),t=t.child}return t;case 9:return i=t.type,n=t.pendingProps.children,_o(t,r),n=n(i=Ao(i)),t.flags|=1,ks(e,t,n,r),t.child;case 14:return i=yo(n=t.type,t.pendingProps),xs(e,t,n,i=yo(n.type,i),r);case 15:return Ss(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,i=t.pendingProps,i=t.elementType===n?i:yo(n,i),qs(e,t),t.tag=1,Bi(n)?(e=!0,Di(t)):e=!1,_o(t,r),Ko(t,n,i),Ho(t,n,i,r),Ts(null,t,n,!0,e,r);case 19:return js(e,t,r);case 22:return _s(e,t,r)}throw Error(o(156,t.tag))};var Wc="function"===typeof reportError?reportError:function(e){console.error(e)};function Qc(e){this._internalRoot=e}function Jc(e){this._internalRoot=e}function Yc(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType)}function Xc(e){return!(!e||1!==e.nodeType&&9!==e.nodeType&&11!==e.nodeType&&(8!==e.nodeType||" react-mount-point-unstable "!==e.nodeValue))}function $c(){}function el(e,t,r,n,i){var o=r._reactRootContainer;if(o){var a=o;if("function"===typeof i){var s=i;i=function(){var e=Vc(a);s.call(e)}}Kc(t,a,e,i)}else a=function(e,t,r,n,i){if(i){if("function"===typeof n){var o=n;n=function(){var e=Vc(a);o.call(e)}}var a=qc(t,n,e,0,null,!1,0,"",$c);return e._reactRootContainer=a,e[pi]=a.current,jn(8===e.nodeType?e.parentNode:e),lc(),a}for(;i=e.lastChild;)e.removeChild(i);if("function"===typeof n){var s=n;n=function(){var e=Vc(u);s.call(e)}}var u=zc(e,0,!1,null,0,!1,0,"",$c);return e._reactRootContainer=u,e[pi]=u.current,jn(8===e.nodeType?e.parentNode:e),lc((function(){Kc(t,u,r,n)})),u}(r,t,e,i,n);return Vc(a)}Jc.prototype.render=Qc.prototype.render=function(e){var t=this._internalRoot;if(null===t)throw Error(o(409));Kc(e,t,null,null)},Jc.prototype.unmount=Qc.prototype.unmount=function(){var e=this._internalRoot;if(null!==e){this._internalRoot=null;var t=e.containerInfo;lc((function(){Kc(null,e,null,null)})),t[pi]=null}},Jc.prototype.unstable_scheduleHydration=function(e){if(e){var t=St();e={blockedOn:null,target:e,priority:t};for(var r=0;r<Mt.length&&0!==t&&t<Mt[r].priority;r++);Mt.splice(r,0,e),0===r&&Lt(e)}},kt=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var r=ft(t.pendingLanes);0!==r&&(mt(t,1|r),nc(t,Ye()),0===(6&Cu)&&(ju=Ye()+500,ji()))}break;case 13:lc((function(){var t=Po(e,1);if(null!==t){var r=ec();rc(t,e,1,r)}})),Gc(e,1)}},Et=function(e){if(13===e.tag){var t=Po(e,134217728);if(null!==t)rc(t,e,134217728,ec());Gc(e,134217728)}},xt=function(e){if(13===e.tag){var t=tc(e),r=Po(e,t);if(null!==r)rc(r,e,t,ec());Gc(e,t)}},St=function(){return bt},_t=function(e,t){var r=bt;try{return bt=e,t()}finally{bt=r}},Ee=function(e,t,r){switch(t){case"input":if(X(e,r),t=r.name,"radio"===r.type&&null!=t){for(r=e;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<r.length;t++){var n=r[t];if(n!==e&&n.form===e.form){var i=ki(n);if(!i)throw Error(o(90));G(n),X(n,i)}}}break;case"textarea":oe(e,r);break;case"select":null!=(t=r.value)&&re(e,!!r.multiple,t,!1)}},Ce=cc,Te=lc;var tl={usingClientEntryPoint:!1,Events:[bi,wi,ki,Ae,Ie,cc]},rl={findFiberByHostInstance:mi,bundleType:0,version:"18.2.0",rendererPackageName:"react-dom"},nl={bundleType:rl.bundleType,version:rl.version,rendererPackageName:rl.rendererPackageName,rendererConfig:rl.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:w.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return null===(e=Ve(e))?null:e.stateNode},findFiberByHostInstance:rl.findFiberByHostInstance||function(){return null},findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.2.0-next-9e3b772b8-20220608"};if("undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__){var il=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!il.isDisabled&&il.supportsFiber)try{it=il.inject(nl),ot=il}catch(le){}}t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=tl,t.createPortal=function(e,t){var r=2<arguments.length&&void 0!==arguments[2]?arguments[2]:null;if(!Yc(t))throw Error(o(200));return Zc(e,t,null,r)},t.createRoot=function(e,t){if(!Yc(e))throw Error(o(299));var r=!1,n="",i=Wc;return null!==t&&void 0!==t&&(!0===t.unstable_strictMode&&(r=!0),void 0!==t.identifierPrefix&&(n=t.identifierPrefix),void 0!==t.onRecoverableError&&(i=t.onRecoverableError)),t=zc(e,1,!1,null,0,r,0,n,i),e[pi]=t.current,jn(8===e.nodeType?e.parentNode:e),new Qc(t)},t.findDOMNode=function(e){if(null==e)return null;if(1===e.nodeType)return e;var t=e._reactInternals;if(void 0===t){if("function"===typeof e.render)throw Error(o(188));throw e=Object.keys(e).join(","),Error(o(268,e))}return e=null===(e=Ve(t))?null:e.stateNode},t.flushSync=function(e){return lc(e)},t.hydrate=function(e,t,r){if(!Xc(t))throw Error(o(200));return el(null,e,t,!0,r)},t.hydrateRoot=function(e,t,r){if(!Yc(e))throw Error(o(405));var n=null!=r&&r.hydratedSources||null,i=!1,a="",s=Wc;if(null!==r&&void 0!==r&&(!0===r.unstable_strictMode&&(i=!0),void 0!==r.identifierPrefix&&(a=r.identifierPrefix),void 0!==r.onRecoverableError&&(s=r.onRecoverableError)),t=qc(t,null,e,1,null!=r?r:null,i,0,a,s),e[pi]=t.current,jn(e),n)for(e=0;e<n.length;e++)i=(i=(r=n[e])._getVersion)(r._source),null==t.mutableSourceEagerHydrationData?t.mutableSourceEagerHydrationData=[r,i]:t.mutableSourceEagerHydrationData.push(r,i);return new Jc(t)},t.render=function(e,t,r){if(!Xc(t))throw Error(o(200));return el(null,e,t,!1,r)},t.unmountComponentAtNode=function(e){if(!Xc(e))throw Error(o(40));return!!e._reactRootContainer&&(lc((function(){el(null,null,e,!1,(function(){e._reactRootContainer=null,e[pi]=null}))})),!0)},t.unstable_batchedUpdates=cc,t.unstable_renderSubtreeIntoContainer=function(e,t,r,n){if(!Xc(r))throw Error(o(200));if(null==e||void 0===e._reactInternals)throw Error(o(38));return el(e,t,r,!1,n)},t.version="18.2.0-next-9e3b772b8-20220608"},7874:function(e,t,r){"use strict";var n=r(3341);t.createRoot=n.createRoot,t.hydrateRoot=n.hydrateRoot},3341:function(e,t,r){"use strict";!function e(){if("undefined"!==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"===typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE)try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}(),e.exports=r(3355)},3826:function(e,t){"use strict";var r="function"===typeof Symbol&&Symbol.for,n=r?Symbol.for("react.element"):60103,i=r?Symbol.for("react.portal"):60106,o=r?Symbol.for("react.fragment"):60107,a=r?Symbol.for("react.strict_mode"):60108,s=r?Symbol.for("react.profiler"):60114,u=r?Symbol.for("react.provider"):60109,c=r?Symbol.for("react.context"):60110,l=r?Symbol.for("react.async_mode"):60111,f=r?Symbol.for("react.concurrent_mode"):60111,h=r?Symbol.for("react.forward_ref"):60112,d=r?Symbol.for("react.suspense"):60113,p=r?Symbol.for("react.suspense_list"):60120,v=r?Symbol.for("react.memo"):60115,g=r?Symbol.for("react.lazy"):60116,y=r?Symbol.for("react.block"):60121,m=r?Symbol.for("react.fundamental"):60117,b=r?Symbol.for("react.responder"):60118,w=r?Symbol.for("react.scope"):60119;function k(e){if("object"===typeof e&&null!==e){var t=e.$$typeof;switch(t){case n:switch(e=e.type){case l:case f:case o:case s:case a:case d:return e;default:switch(e=e&&e.$$typeof){case c:case h:case g:case v:case u:return e;default:return t}}case i:return t}}}function E(e){return k(e)===f}t.AsyncMode=l,t.ConcurrentMode=f,t.ContextConsumer=c,t.ContextProvider=u,t.Element=n,t.ForwardRef=h,t.Fragment=o,t.Lazy=g,t.Memo=v,t.Portal=i,t.Profiler=s,t.StrictMode=a,t.Suspense=d,t.isAsyncMode=function(e){return E(e)||k(e)===l},t.isConcurrentMode=E,t.isContextConsumer=function(e){return k(e)===c},t.isContextProvider=function(e){return k(e)===u},t.isElement=function(e){return"object"===typeof e&&null!==e&&e.$$typeof===n},t.isForwardRef=function(e){return k(e)===h},t.isFragment=function(e){return k(e)===o},t.isLazy=function(e){return k(e)===g},t.isMemo=function(e){return k(e)===v},t.isPortal=function(e){return k(e)===i},t.isProfiler=function(e){return k(e)===s},t.isStrictMode=function(e){return k(e)===a},t.isSuspense=function(e){return k(e)===d},t.isValidElementType=function(e){return"string"===typeof e||"function"===typeof e||e===o||e===f||e===s||e===a||e===d||e===p||"object"===typeof e&&null!==e&&(e.$$typeof===g||e.$$typeof===v||e.$$typeof===u||e.$$typeof===c||e.$$typeof===h||e.$$typeof===m||e.$$typeof===b||e.$$typeof===w||e.$$typeof===y)},t.typeOf=k},6782:function(e,t,r){"use strict";e.exports=r(3826)},250:function(e,t,r){"use strict";var n=r(5151),i=Symbol.for("react.element"),o=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,s=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,u={key:!0,ref:!0,__self:!0,__source:!0};function c(e,t,r){var n,o={},c=null,l=null;for(n in void 0!==r&&(c=""+r),void 0!==t.key&&(c=""+t.key),void 0!==t.ref&&(l=t.ref),t)a.call(t,n)&&!u.hasOwnProperty(n)&&(o[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps)void 0===o[n]&&(o[n]=t[n]);return{$$typeof:i,type:e,key:c,ref:l,props:o,_owner:s.current}}t.jsx=c,t.jsxs=c},8411:function(e,t){"use strict";var r=Symbol.for("react.element"),n=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),s=Symbol.for("react.provider"),u=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),l=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),d=Symbol.iterator;var p={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},v=Object.assign,g={};function y(e,t,r){this.props=e,this.context=t,this.refs=g,this.updater=r||p}function m(){}function b(e,t,r){this.props=e,this.context=t,this.refs=g,this.updater=r||p}y.prototype.isReactComponent={},y.prototype.setState=function(e,t){if("object"!==typeof e&&"function"!==typeof e&&null!=e)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")},y.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},m.prototype=y.prototype;var w=b.prototype=new m;w.constructor=b,v(w,y.prototype),w.isPureReactComponent=!0;var k=Array.isArray,E=Object.prototype.hasOwnProperty,x={current:null},S={key:!0,ref:!0,__self:!0,__source:!0};function _(e,t,n){var i,o={},a=null,s=null;if(null!=t)for(i in void 0!==t.ref&&(s=t.ref),void 0!==t.key&&(a=""+t.key),t)E.call(t,i)&&!S.hasOwnProperty(i)&&(o[i]=t[i]);var u=arguments.length-2;if(1===u)o.children=n;else if(1<u){for(var c=Array(u),l=0;l<u;l++)c[l]=arguments[l+2];o.children=c}if(e&&e.defaultProps)for(i in u=e.defaultProps)void 0===o[i]&&(o[i]=u[i]);return{$$typeof:r,type:e,key:a,ref:s,props:o,_owner:x.current}}function A(e){return"object"===typeof e&&null!==e&&e.$$typeof===r}var I=/\/+/g;function C(e,t){return"object"===typeof e&&null!==e&&null!=e.key?function(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,(function(e){return t[e]}))}(""+e.key):t.toString(36)}function T(e,t,i,o,a){var s=typeof e;"undefined"!==s&&"boolean"!==s||(e=null);var u=!1;if(null===e)u=!0;else switch(s){case"string":case"number":u=!0;break;case"object":switch(e.$$typeof){case r:case n:u=!0}}if(u)return a=a(u=e),e=""===o?"."+C(u,0):o,k(a)?(i="",null!=e&&(i=e.replace(I,"$&/")+"/"),T(a,t,i,"",(function(e){return e}))):null!=a&&(A(a)&&(a=function(e,t){return{$$typeof:r,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}(a,i+(!a.key||u&&u.key===a.key?"":(""+a.key).replace(I,"$&/")+"/")+e)),t.push(a)),1;if(u=0,o=""===o?".":o+":",k(e))for(var c=0;c<e.length;c++){var l=o+C(s=e[c],c);u+=T(s,t,i,l,a)}else if(l=function(e){return null===e||"object"!==typeof e?null:"function"===typeof(e=d&&e[d]||e["@@iterator"])?e:null}(e),"function"===typeof l)for(e=l.call(e),c=0;!(s=e.next()).done;)u+=T(s=s.value,t,i,l=o+C(s,c++),a);else if("object"===s)throw t=String(e),Error("Objects are not valid as a React child (found: "+("[object Object]"===t?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return u}function P(e,t,r){if(null==e)return e;var n=[],i=0;return T(e,n,"","",(function(e){return t.call(r,e,i++)})),n}function R(e){if(-1===e._status){var t=e._result;(t=t()).then((function(t){0!==e._status&&-1!==e._status||(e._status=1,e._result=t)}),(function(t){0!==e._status&&-1!==e._status||(e._status=2,e._result=t)})),-1===e._status&&(e._status=0,e._result=t)}if(1===e._status)return e._result.default;throw e._result}var B={current:null},M={transition:null},N={ReactCurrentDispatcher:B,ReactCurrentBatchConfig:M,ReactCurrentOwner:x};t.Children={map:P,forEach:function(e,t,r){P(e,(function(){t.apply(this,arguments)}),r)},count:function(e){var t=0;return P(e,(function(){t++})),t},toArray:function(e){return P(e,(function(e){return e}))||[]},only:function(e){if(!A(e))throw Error("React.Children.only expected to receive a single React element child.");return e}},t.Component=y,t.Fragment=i,t.Profiler=a,t.PureComponent=b,t.StrictMode=o,t.Suspense=l,t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=N,t.cloneElement=function(e,t,n){if(null===e||void 0===e)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var i=v({},e.props),o=e.key,a=e.ref,s=e._owner;if(null!=t){if(void 0!==t.ref&&(a=t.ref,s=x.current),void 0!==t.key&&(o=""+t.key),e.type&&e.type.defaultProps)var u=e.type.defaultProps;for(c in t)E.call(t,c)&&!S.hasOwnProperty(c)&&(i[c]=void 0===t[c]&&void 0!==u?u[c]:t[c])}var c=arguments.length-2;if(1===c)i.children=n;else if(1<c){u=Array(c);for(var l=0;l<c;l++)u[l]=arguments[l+2];i.children=u}return{$$typeof:r,type:e.type,key:o,ref:a,props:i,_owner:s}},t.createContext=function(e){return(e={$$typeof:u,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null}).Provider={$$typeof:s,_context:e},e.Consumer=e},t.createElement=_,t.createFactory=function(e){var t=_.bind(null,e);return t.type=e,t},t.createRef=function(){return{current:null}},t.forwardRef=function(e){return{$$typeof:c,render:e}},t.isValidElement=A,t.lazy=function(e){return{$$typeof:h,_payload:{_status:-1,_result:e},_init:R}},t.memo=function(e,t){return{$$typeof:f,type:e,compare:void 0===t?null:t}},t.startTransition=function(e){var t=M.transition;M.transition={};try{e()}finally{M.transition=t}},t.unstable_act=function(){throw Error("act(...) is not supported in production builds of React.")},t.useCallback=function(e,t){return B.current.useCallback(e,t)},t.useContext=function(e){return B.current.useContext(e)},t.useDebugValue=function(){},t.useDeferredValue=function(e){return B.current.useDeferredValue(e)},t.useEffect=function(e,t){return B.current.useEffect(e,t)},t.useId=function(){return B.current.useId()},t.useImperativeHandle=function(e,t,r){return B.current.useImperativeHandle(e,t,r)},t.useInsertionEffect=function(e,t){return B.current.useInsertionEffect(e,t)},t.useLayoutEffect=function(e,t){return B.current.useLayoutEffect(e,t)},t.useMemo=function(e,t){return B.current.useMemo(e,t)},t.useReducer=function(e,t,r){return B.current.useReducer(e,t,r)},t.useRef=function(e){return B.current.useRef(e)},t.useState=function(e){return B.current.useState(e)},t.useSyncExternalStore=function(e,t,r){return B.current.useSyncExternalStore(e,t,r)},t.useTransition=function(){return B.current.useTransition()},t.version="18.2.0"},5151:function(e,t,r){"use strict";e.exports=r(8411)},2075:function(e,t,r){"use strict";e.exports=r(250)},1623:function(e,t){"use strict";function r(e,t){var r=e.length;e.push(t);e:for(;0<r;){var n=r-1>>>1,i=e[n];if(!(0<o(i,t)))break e;e[n]=t,e[r]=i,r=n}}function n(e){return 0===e.length?null:e[0]}function i(e){if(0===e.length)return null;var t=e[0],r=e.pop();if(r!==t){e[0]=r;e:for(var n=0,i=e.length,a=i>>>1;n<a;){var s=2*(n+1)-1,u=e[s],c=s+1,l=e[c];if(0>o(u,r))c<i&&0>o(l,u)?(e[n]=l,e[c]=r,n=c):(e[n]=u,e[s]=r,n=s);else{if(!(c<i&&0>o(l,r)))break e;e[n]=l,e[c]=r,n=c}}}return t}function o(e,t){var r=e.sortIndex-t.sortIndex;return 0!==r?r:e.id-t.id}if("object"===typeof performance&&"function"===typeof performance.now){var a=performance;t.unstable_now=function(){return a.now()}}else{var s=Date,u=s.now();t.unstable_now=function(){return s.now()-u}}var c=[],l=[],f=1,h=null,d=3,p=!1,v=!1,g=!1,y="function"===typeof setTimeout?setTimeout:null,m="function"===typeof clearTimeout?clearTimeout:null,b="undefined"!==typeof setImmediate?setImmediate:null;function w(e){for(var t=n(l);null!==t;){if(null===t.callback)i(l);else{if(!(t.startTime<=e))break;i(l),t.sortIndex=t.expirationTime,r(c,t)}t=n(l)}}function k(e){if(g=!1,w(e),!v)if(null!==n(c))v=!0,M(E);else{var t=n(l);null!==t&&N(k,t.startTime-e)}}function E(e,r){v=!1,g&&(g=!1,m(A),A=-1),p=!0;var o=d;try{for(w(r),h=n(c);null!==h&&(!(h.expirationTime>r)||e&&!T());){var a=h.callback;if("function"===typeof a){h.callback=null,d=h.priorityLevel;var s=a(h.expirationTime<=r);r=t.unstable_now(),"function"===typeof s?h.callback=s:h===n(c)&&i(c),w(r)}else i(c);h=n(c)}if(null!==h)var u=!0;else{var f=n(l);null!==f&&N(k,f.startTime-r),u=!1}return u}finally{h=null,d=o,p=!1}}"undefined"!==typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var x,S=!1,_=null,A=-1,I=5,C=-1;function T(){return!(t.unstable_now()-C<I)}function P(){if(null!==_){var e=t.unstable_now();C=e;var r=!0;try{r=_(!0,e)}finally{r?x():(S=!1,_=null)}}else S=!1}if("function"===typeof b)x=function(){b(P)};else if("undefined"!==typeof MessageChannel){var R=new MessageChannel,B=R.port2;R.port1.onmessage=P,x=function(){B.postMessage(null)}}else x=function(){y(P,0)};function M(e){_=e,S||(S=!0,x())}function N(e,r){A=y((function(){e(t.unstable_now())}),r)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(e){e.callback=null},t.unstable_continueExecution=function(){v||p||(v=!0,M(E))},t.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):I=0<e?Math.floor(1e3/e):5},t.unstable_getCurrentPriorityLevel=function(){return d},t.unstable_getFirstCallbackNode=function(){return n(c)},t.unstable_next=function(e){switch(d){case 1:case 2:case 3:var t=3;break;default:t=d}var r=d;d=t;try{return e()}finally{d=r}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var r=d;d=e;try{return t()}finally{d=r}},t.unstable_scheduleCallback=function(e,i,o){var a=t.unstable_now();switch("object"===typeof o&&null!==o?o="number"===typeof(o=o.delay)&&0<o?a+o:a:o=a,e){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return e={id:f++,callback:i,priorityLevel:e,startTime:o,expirationTime:s=o+s,sortIndex:-1},o>a?(e.sortIndex=o,r(l,e),null===n(c)&&e===n(l)&&(g?(m(A),A=-1):g=!0,N(k,o-a))):(e.sortIndex=s,r(c,e),v||p||(v=!0,M(E))),e},t.unstable_shouldYield=T,t.unstable_wrapCallback=function(e){var t=d;return function(){var r=d;d=t;try{return e.apply(this,arguments)}finally{d=r}}}},4711:function(e,t,r){"use strict";e.exports=r(1623)},514:function(e){e.exports=function e(t,r){var n,i=0,o=0,a=r=r||0,s=t.length;do{if(a>=s||o>49)throw e.bytes=0,new RangeError("Could not decode varint");n=t[a++],i+=o<28?(127&n)<<o:(127&n)*Math.pow(2,o),o+=7}while(n>=128);return e.bytes=a-r,i}},6334:function(e){e.exports=function e(r,n,i){if(Number.MAX_SAFE_INTEGER&&r>Number.MAX_SAFE_INTEGER)throw e.bytes=0,new RangeError("Could not encode varint");n=n||[];var o=i=i||0;for(;r>=t;)n[i++]=255&r|128,r/=128;for(;-128&r;)n[i++]=255&r|128,r>>>=7;return n[i]=0|r,e.bytes=i-o+1,n};var t=Math.pow(2,31)},8705:function(e,t,r){e.exports={encode:r(6334),decode:r(514),encodingLength:r(1410)}},1410:function(e){var t=Math.pow(2,7),r=Math.pow(2,14),n=Math.pow(2,21),i=Math.pow(2,28),o=Math.pow(2,35),a=Math.pow(2,42),s=Math.pow(2,49),u=Math.pow(2,56),c=Math.pow(2,63);e.exports=function(e){return e<t?1:e<r?2:e<n?3:e<i?4:e<o?5:e<a?6:e<s?7:e<u?8:e<c?9:10}},9572:function(){},4490:function(){},9391:function(){},5083:function(){},9437:function(){},5455:function(e,t,r){var n=r(1409);function i(e){var t,r;function i(t,r){try{var a=e[t](r),s=a.value,u=s instanceof n;Promise.resolve(u?s.v:s).then((function(r){if(u){var n="return"===t?"return":"next";if(!s.k||r.done)return i(n,r);r=e[n](r).value}o(a.done?"return":"normal",r)}),(function(e){i("throw",e)}))}catch(c){o("throw",c)}}function o(e,n){switch(e){case"return":t.resolve({value:n,done:!0});break;case"throw":t.reject(n);break;default:t.resolve({value:n,done:!1})}(t=t.next)?i(t.key,t.arg):r=null}this._invoke=function(e,n){return new Promise((function(o,a){var s={key:e,arg:n,resolve:o,reject:a,next:null};r?r=r.next=s:(t=r=s,i(e,n))}))},"function"!=typeof e.return&&(this.return=void 0)}i.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},i.prototype.next=function(e){return this._invoke("next",e)},i.prototype.throw=function(e){return this._invoke("throw",e)},i.prototype.return=function(e){return this._invoke("return",e)},e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports},1409:function(e){e.exports=function(e,t){this.v=e,this.k=t},e.exports.__esModule=!0,e.exports.default=e.exports},3921:function(e){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n},e.exports.__esModule=!0,e.exports.default=e.exports},4111:function(e,t,r){var n=r(3921);e.exports=function(e){if(Array.isArray(e))return n(e)},e.exports.__esModule=!0,e.exports.default=e.exports},5311:function(e,t,r){var n=r(1409);e.exports=function(e){var t={},r=!1;function i(t,i){return r=!0,i=new Promise((function(r){r(e[t](i))})),{done:!1,value:new n(i,1)}}return t["undefined"!=typeof Symbol&&Symbol.iterator||"@@iterator"]=function(){return this},t.next=function(e){return r?(r=!1,e):i("next",e)},"function"==typeof e.throw&&(t.throw=function(e){if(r)throw r=!1,e;return i("throw",e)}),"function"==typeof e.return&&(t.return=function(e){return r?(r=!1,e):i("return",e)}),t},e.exports.__esModule=!0,e.exports.default=e.exports},7201:function(e){function t(e){function r(e){if(Object(e)!==e)return Promise.reject(new TypeError(e+" is not an object."));var t=e.done;return Promise.resolve(e.value).then((function(e){return{value:e,done:t}}))}return t=function(e){this.s=e,this.n=e.next},t.prototype={s:null,n:null,next:function(){return r(this.n.apply(this.s,arguments))},return:function(e){var t=this.s.return;return void 0===t?Promise.resolve({value:e,done:!0}):r(t.apply(this.s,arguments))},throw:function(e){var t=this.s.return;return void 0===t?Promise.reject(e):r(t.apply(this.s,arguments))}},new t(e)}e.exports=function(e){var r,n,i,o=2;for("undefined"!=typeof Symbol&&(n=Symbol.asyncIterator,i=Symbol.iterator);o--;){if(n&&null!=(r=e[n]))return r.call(e);if(i&&null!=(r=e[i]))return new t(r.call(e));n="@@asyncIterator",i="@@iterator"}throw new TypeError("Object is not async iterable")},e.exports.__esModule=!0,e.exports.default=e.exports},601:function(e){function t(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(c){return void r(c)}s.done?t(u):Promise.resolve(u).then(n,i)}e.exports=function(e){return function(){var r=this,n=arguments;return new Promise((function(i,o){var a=e.apply(r,n);function s(e){t(a,i,o,s,u,"next",e)}function u(e){t(a,i,o,s,u,"throw",e)}s(void 0)}))}},e.exports.__esModule=!0,e.exports.default=e.exports},7825:function(e,t,r){var n=r(1409);e.exports=function(e){return new n(e,0)},e.exports.__esModule=!0,e.exports.default=e.exports},361:function(e){e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.__esModule=!0,e.exports.default=e.exports},6117:function(e){function t(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}e.exports=function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e},e.exports.__esModule=!0,e.exports.default=e.exports},314:function(e){e.exports=function(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},e.exports.__esModule=!0,e.exports.default=e.exports},4871:function(e){e.exports=function(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.__esModule=!0,e.exports.default=e.exports},8316:function(e){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports},1267:function(e,t,r){var n=r(7583).default;function i(){"use strict";e.exports=i=function(){return t},e.exports.__esModule=!0,e.exports.default=e.exports;var t={},r=Object.prototype,o=r.hasOwnProperty,a="function"==typeof Symbol?Symbol:{},s=a.iterator||"@@iterator",u=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{l({},"")}catch(T){l=function(e,t,r){return e[t]=r}}function f(e,t,r,n){var i=t&&t.prototype instanceof p?t:p,o=Object.create(i.prototype),a=new A(n||[]);return o._invoke=function(e,t,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return C()}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var s=x(a,r);if(s){if(s===d)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=h(e,t,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===d)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}(e,r,a),o}function h(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(T){return{type:"throw",arg:T}}}t.wrap=f;var d={};function p(){}function v(){}function g(){}var y={};l(y,s,(function(){return this}));var m=Object.getPrototypeOf,b=m&&m(m(I([])));b&&b!==r&&o.call(b,s)&&(y=b);var w=g.prototype=p.prototype=Object.create(y);function k(e){["next","throw","return"].forEach((function(t){l(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,t){function r(i,a,s,u){var c=h(e[i],e,a);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==n(f)&&o.call(f,"__await")?t.resolve(f.__await).then((function(e){r("next",e,s,u)}),(function(e){r("throw",e,s,u)})):t.resolve(f).then((function(e){l.value=e,s(l)}),(function(e){return r("throw",e,s,u)}))}u(c.arg)}var i;this._invoke=function(e,n){function o(){return new t((function(t,i){r(e,n,t,i)}))}return i=i?i.then(o,o):o()}}function x(e,t){var r=e.iterator[t.method];if(void 0===r){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,x(e,t),"throw"===t.method))return d;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return d}var n=h(r,e.iterator,t.arg);if("throw"===n.type)return t.method="throw",t.arg=n.arg,t.delegate=null,d;var i=n.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,d):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,d)}function S(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function _(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function A(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(S,this),this.reset(!0)}function I(e){if(e){var t=e[s];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,n=function t(){for(;++r<e.length;)if(o.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return n.next=n}}return{next:C}}function C(){return{value:void 0,done:!0}}return v.prototype=g,l(w,"constructor",g),l(g,"constructor",v),v.displayName=l(g,c,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===v||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,l(e,c,"GeneratorFunction")),e.prototype=Object.create(w),e},t.awrap=function(e){return{__await:e}},k(E.prototype),l(E.prototype,u,(function(){return this})),t.AsyncIterator=E,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var a=new E(f(e,r,n,i),o);return t.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},k(w),l(w,c,"Generator"),l(w,s,(function(){return this})),l(w,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},t.values=I,A.prototype={constructor:A,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(_),!e)for(var t in this)"t"===t.charAt(0)&&o.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(r,n){return a.type="throw",a.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var s=o.call(i,"catchLoc"),u=o.call(i,"finallyLoc");if(s&&u){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(s){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var i=n;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=e,a.arg=t,i?(this.method="next",this.next=i.finallyLoc,d):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),d},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),_(r),d}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;_(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:I(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),d}},t}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports},9616:function(e,t,r){var n=r(4111),i=r(4871),o=r(6063),a=r(8316);e.exports=function(e){return n(e)||i(e)||o(e)||a()},e.exports.__esModule=!0,e.exports.default=e.exports},7583:function(e){function t(r){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},6063:function(e,t,r){var n=r(3921);e.exports=function(e,t){if(e){if("string"===typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}},e.exports.__esModule=!0,e.exports.default=e.exports},1630:function(e,t,r){var n=r(5455);e.exports=function(e){return function(){return new n(e.apply(this,arguments))}},e.exports.__esModule=!0,e.exports.default=e.exports},7324:function(e,t,r){"use strict";function n(e,t,r,n,i,o,a){try{var s=e[o](a),u=s.value}catch(c){return void r(c)}s.done?t(u):Promise.resolve(u).then(n,i)}function i(e){return function(){var t=this,r=arguments;return new Promise((function(i,o){var a=e.apply(t,r);function s(e){n(a,i,o,s,u,"next",e)}function u(e){n(a,i,o,s,u,"throw",e)}s(void 0)}))}}r.d(t,{Z:function(){return i}})},1584:function(e,t,r){"use strict";function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}r.d(t,{Z:function(){return n}})},6568:function(e,t,r){"use strict";function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function i(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}r.d(t,{Z:function(){return i}})},6097:function(e,t,r){"use strict";r.d(t,{Z:function(){return i}});var n=r(2022);function i(){i=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",s=o.asyncIterator||"@@asyncIterator",u=o.toStringTag||"@@toStringTag";function c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(C){c=function(e,t,r){return e[t]=r}}function l(e,t,r,n){var i=t&&t.prototype instanceof d?t:d,o=Object.create(i.prototype),a=new _(n||[]);return o._invoke=function(e,t,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return I()}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var s=E(a,r);if(s){if(s===h)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var u=f(e,t,r);if("normal"===u.type){if(n=r.done?"completed":"suspendedYield",u.arg===h)continue;return{value:u.arg,done:r.done}}"throw"===u.type&&(n="completed",r.method="throw",r.arg=u.arg)}}}(e,r,a),o}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(C){return{type:"throw",arg:C}}}e.wrap=l;var h={};function d(){}function p(){}function v(){}var g={};c(g,a,(function(){return this}));var y=Object.getPrototypeOf,m=y&&y(y(A([])));m&&m!==t&&r.call(m,a)&&(g=m);var b=v.prototype=d.prototype=Object.create(g);function w(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function k(e,t){function i(o,a,s,u){var c=f(e[o],e,a);if("throw"!==c.type){var l=c.arg,h=l.value;return h&&"object"==(0,n.Z)(h)&&r.call(h,"__await")?t.resolve(h.__await).then((function(e){i("next",e,s,u)}),(function(e){i("throw",e,s,u)})):t.resolve(h).then((function(e){l.value=e,s(l)}),(function(e){return i("throw",e,s,u)}))}u(c.arg)}var o;this._invoke=function(e,r){function n(){return new t((function(t,n){i(e,r,t,n)}))}return o=o?o.then(n,n):n()}}function E(e,t){var r=e.iterator[t.method];if(void 0===r){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,E(e,t),"throw"===t.method))return h;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var n=f(r,e.iterator,t.arg);if("throw"===n.type)return t.method="throw",t.arg=n.arg,t.delegate=null,h;var i=n.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,h):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,h)}function x(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function S(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function _(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(x,this),this.reset(!0)}function A(e){if(e){var t=e[a];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,i=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return i.next=i}}return{next:I}}function I(){return{value:void 0,done:!0}}return p.prototype=v,c(b,"constructor",v),c(v,"constructor",p),p.displayName=c(v,u,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===p||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,v):(e.__proto__=v,c(e,u,"GeneratorFunction")),e.prototype=Object.create(b),e},e.awrap=function(e){return{__await:e}},w(k.prototype),c(k.prototype,s,(function(){return this})),e.AsyncIterator=k,e.async=function(t,r,n,i,o){void 0===o&&(o=Promise);var a=new k(l(t,r,n,i),o);return e.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},w(b),c(b,u,"Generator"),c(b,a,(function(){return this})),c(b,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},e.values=A,_.prototype={constructor:_,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(S),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return a.type="throw",a.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),u=r.call(o,"finallyLoc");if(s&&u){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,h):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),h},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),S(r),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;S(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:A(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),h}},e}},2022:function(e,t,r){"use strict";function n(e){return n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},n(e)}r.d(t,{Z:function(){return n}})}},__webpack_module_cache__={};function __webpack_require__(e){var t=__webpack_module_cache__[e];if(void 0!==t)return t.exports;var r=__webpack_module_cache__[e]={id:e,loaded:!1,exports:{}};return __webpack_modules__[e].call(r.exports,r,r.exports,__webpack_require__),r.loaded=!0,r.exports}__webpack_require__.m=__webpack_modules__,__webpack_require__.amdO={},__webpack_require__.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return __webpack_require__.d(t,{a:t}),t},function(){var e,t=Object.getPrototypeOf?function(e){return Object.getPrototypeOf(e)}:function(e){return e.__proto__};__webpack_require__.t=function(r,n){if(1&n&&(r=this(r)),8&n)return r;if("object"===typeof r&&r){if(4&n&&r.__esModule)return r;if(16&n&&"function"===typeof r.then)return r}var i=Object.create(null);__webpack_require__.r(i);var o={};e=e||[null,t({}),t([]),t(t)];for(var a=2&n&&r;"object"==typeof a&&!~e.indexOf(a);a=t(a))Object.getOwnPropertyNames(a).forEach((function(e){o[e]=function(){return r[e]}}));return o.default=function(){return r},__webpack_require__.d(i,o),i}}(),__webpack_require__.d=function(e,t){for(var r in t)__webpack_require__.o(t,r)&&!__webpack_require__.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},__webpack_require__.f={},__webpack_require__.e=function(e){return Promise.all(Object.keys(__webpack_require__.f).reduce((function(t,r){return __webpack_require__.f[r](e,t),t}),[]))},__webpack_require__.u=function(e){return"static/js/"+e+".b375a52d.chunk.js"},__webpack_require__.miniCssF=function(e){},__webpack_require__.g=function(){if("object"===typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"===typeof window)return window}}(),__webpack_require__.hmd=function(e){return(e=Object.create(e)).children||(e.children=[]),Object.defineProperty(e,"exports",{enumerable:!0,set:function(){throw new Error("ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: "+e.id)}}),e},__webpack_require__.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},function(){var e={},t="rln-reactts:";__webpack_require__.l=function(r,n,i,o){if(e[r])e[r].push(n);else{var a,s;if(void 0!==i)for(var u=document.getElementsByTagName("script"),c=0;c<u.length;c++){var l=u[c];if(l.getAttribute("src")==r||l.getAttribute("data-webpack")==t+i){a=l;break}}a||(s=!0,(a=document.createElement("script")).charset="utf-8",a.timeout=120,__webpack_require__.nc&&a.setAttribute("nonce",__webpack_require__.nc),a.setAttribute("data-webpack",t+i),a.src=r),e[r]=[n];var f=function(t,n){a.onerror=a.onload=null,clearTimeout(h);var i=e[r];if(delete e[r],a.parentNode&&a.parentNode.removeChild(a),i&&i.forEach((function(e){return e(n)})),t)return t(n)},h=setTimeout(f.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=f.bind(null,a.onerror),a.onload=f.bind(null,a.onload),s&&document.head.appendChild(a)}}}(),__webpack_require__.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},__webpack_require__.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e},__webpack_require__.p="/rln-react-ts/",function(){__webpack_require__.b=document.baseURI||self.location.href;var e={179:0};__webpack_require__.f.j=function(t,r){var n=__webpack_require__.o(e,t)?e[t]:void 0;if(0!==n)if(n)r.push(n[2]);else{var i=new Promise((function(r,i){n=e[t]=[r,i]}));r.push(n[2]=i);var o=__webpack_require__.p+__webpack_require__.u(t),a=new Error;__webpack_require__.l(o,(function(r){if(__webpack_require__.o(e,t)&&(0!==(n=e[t])&&(e[t]=void 0),n)){var i=r&&("load"===r.type?"missing":r.type),o=r&&r.target&&r.target.src;a.message="Loading chunk "+t+" failed.\n("+i+": "+o+")",a.name="ChunkLoadError",a.type=i,a.request=o,n[1](a)}}),"chunk-"+t,t)}};var t=function(t,r){var n,i,o=r[0],a=r[1],s=r[2],u=0;if(o.some((function(t){return 0!==e[t]}))){for(n in a)__webpack_require__.o(a,n)&&(__webpack_require__.m[n]=a[n]);if(s)s(__webpack_require__)}for(t&&t(r);u<o.length;u++)i=o[u],__webpack_require__.o(e,i)&&e[i]&&e[i][0](),e[i]=0},r=self.webpackChunkrln_reactts=self.webpackChunkrln_reactts||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))}();var __webpack_exports__={};!function(){"use strict";var e={};__webpack_require__.r(e),__webpack_require__.d(e,{identity:function(){return ft}});var t={};__webpack_require__.r(t),__webpack_require__.d(t,{base2:function(){return ht}});var r={};__webpack_require__.r(r),__webpack_require__.d(r,{base8:function(){return dt}});var n={};__webpack_require__.r(n),__webpack_require__.d(n,{base10:function(){return pt}});var i={};__webpack_require__.r(i),__webpack_require__.d(i,{base16:function(){return vt},base16upper:function(){return gt}});var o={};__webpack_require__.r(o),__webpack_require__.d(o,{base32:function(){return yt},base32hex:function(){return kt},base32hexpad:function(){return xt},base32hexpadupper:function(){return St},base32hexupper:function(){return Et},base32pad:function(){return bt},base32padupper:function(){return wt},base32upper:function(){return mt},base32z:function(){return _t}});var a={};__webpack_require__.r(a),__webpack_require__.d(a,{base36:function(){return At},base36upper:function(){return It}});var s={};__webpack_require__.r(s),__webpack_require__.d(s,{base58btc:function(){return Ct},base58flickr:function(){return Tt}});var u={};__webpack_require__.r(u),__webpack_require__.d(u,{base64:function(){return Pt},base64pad:function(){return Rt},base64url:function(){return Bt},base64urlpad:function(){return Mt}});var c={};__webpack_require__.r(c),__webpack_require__.d(c,{base256emoji:function(){return Lt}});var l={};__webpack_require__.r(l),__webpack_require__.d(l,{sha256:function(){return ar},sha512:function(){return sr}});var f={};__webpack_require__.r(f),__webpack_require__.d(f,{identity:function(){return cr}});var h={};__webpack_require__.r(h),__webpack_require__.d(h,{code:function(){return fr},decode:function(){return dr},encode:function(){return hr},name:function(){return lr}});var d={};__webpack_require__.r(d),__webpack_require__.d(d,{code:function(){return yr},decode:function(){return br},encode:function(){return mr},name:function(){return gr}});var p={};__webpack_require__.r(p),__webpack_require__.d(p,{decode:function(){return On},encode:function(){return Bn}});var v={};__webpack_require__.r(v),__webpack_require__.d(v,{RsaPrivateKey:function(){return uo},RsaPublicKey:function(){return so},fromJwk:function(){return ho},generateKeyPair:function(){return vo},unmarshalRsaPrivateKey:function(){return co},unmarshalRsaPublicKey:function(){return fo}});var g={};__webpack_require__.r(g),__webpack_require__.d(g,{Ed25519PrivateKey:function(){return Ra},Ed25519PublicKey:function(){return Pa},generateKeyPair:function(){return Na},generateKeyPairFromSeed:function(){return Da},unmarshalEd25519PrivateKey:function(){return Ba},unmarshalEd25519PublicKey:function(){return Ma}});var y={};__webpack_require__.r(y),__webpack_require__.d(y,{Secp256k1PrivateKey:function(){return Ha},Secp256k1PublicKey:function(){return Va},generateKeyPair:function(){return Qa},unmarshalSecp256k1PrivateKey:function(){return Ga},unmarshalSecp256k1PublicKey:function(){return Wa}});var m=__webpack_require__(5151),b=__webpack_require__.t(m,2),w=__webpack_require__(7874),k=__webpack_require__(6097),E=__webpack_require__(7324);function x(e){if(Array.isArray(e))return e}function S(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function _(e,t){if(e){if("string"===typeof e)return S(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?S(e,t):void 0}}function A(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function I(e,t){return x(e)||function(e,t){var r=null==e?null:"undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o=[],a=!0,s=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);a=!0);}catch(u){s=!0,i=u}finally{try{a||null==r.return||r.return()}finally{if(s)throw i}}return o}}(e,t)||_(e,t)||A()}function C(){return T.apply(this,arguments)}function T(){return(T=(0,E.Z)((0,k.Z)().mark((function e(){var t;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,__webpack_require__.e(440).then(__webpack_require__.bind(__webpack_require__,440));case 2:return t=e.sent,e.next=5,t.create();case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var P;!function(e){e.V2Beta3="/vac/waku/store/2.0.0-beta3",e.V2Beta4="/vac/waku/store/2.0.0-beta4"}(P||(P={}));var R=__webpack_require__(5083);function B(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function M(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function N(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?M(Object(r),!0).forEach((function(t){B(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):M(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var O=__webpack_require__(6568),D=__webpack_require__(1584);function L(e,t){return L=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},L(e,t)}function U(e,t){if("function"!==typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&L(e,t)}function F(e){return F=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},F(e)}function z(){if("undefined"===typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"===typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}var Z=__webpack_require__(2022);function j(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function q(e,t){if(t&&("object"===(0,Z.Z)(t)||"function"===typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return j(e)}function K(e){var t=z();return function(){var r,n=F(e);if(t){var i=F(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return q(this,r)}}function V(e,t,r){return V=z()?Reflect.construct.bind():function(e,t,r){var n=[null];n.push.apply(n,t);var i=new(Function.bind.apply(e,n));return r&&L(i,r.prototype),i},V.apply(null,arguments)}function H(e){var t="function"===typeof Map?new Map:void 0;return H=function(e){if(null===e||(r=e,-1===Function.toString.call(r).indexOf("[native code]")))return e;var r;if("function"!==typeof e)throw new TypeError("Super expression must either be null or a function");if("undefined"!==typeof t){if(t.has(e))return t.get(e);t.set(e,n)}function n(){return V(e,arguments,F(this).constructor)}return n.prototype=Object.create(e.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),L(n,e)},H(e)}var G=__webpack_require__(4490),W=__webpack_require__.t(G,2),Q=BigInt(0),J=BigInt(1),Y=BigInt(2),X=BigInt(3),$=BigInt(8),ee=Object.freeze({a:Q,b:BigInt(7),P:BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffefffffc2f"),n:BigInt("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),h:J,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee")});function te(e){var t=ee.a,r=ee.b,n=Ee(e*e),i=Ee(n*e);return Ee(i+t*e+r)}var re=ee.a===Q,ne=function(e){U(r,e);var t=K(r);function r(e){return(0,D.Z)(this,r),t.call(this,e)}return(0,O.Z)(r)}(H(Error)),ie=function(){function e(t,r,n){(0,D.Z)(this,e),this.x=t,this.y=r,this.z=n}return(0,O.Z)(e,[{key:"equals",value:function(t){if(!(t instanceof e))throw new TypeError("JacobianPoint expected");var r=this.x,n=this.y,i=this.z,o=t.x,a=t.y,s=t.z,u=Ee(i*i),c=Ee(s*s),l=Ee(r*c),f=Ee(o*u),h=Ee(Ee(n*s)*c),d=Ee(Ee(a*i)*u);return l===f&&h===d}},{key:"negate",value:function(){return new e(this.x,Ee(-this.y),this.z)}},{key:"double",value:function(){var t=this.x,r=this.y,n=this.z,i=Ee(t*t),o=Ee(r*r),a=Ee(o*o),s=t+o,u=Ee(Y*(Ee(s*s)-i-a)),c=Ee(X*i),l=Ee(c*c),f=Ee(l-Y*u);return new e(f,Ee(c*(u-f)-$*a),Ee(Y*r*n))}},{key:"add",value:function(t){if(!(t instanceof e))throw new TypeError("JacobianPoint expected");var r=this.x,n=this.y,i=this.z,o=t.x,a=t.y,s=t.z;if(o===Q||a===Q)return this;if(r===Q||n===Q)return t;var u=Ee(i*i),c=Ee(s*s),l=Ee(r*c),f=Ee(o*u),h=Ee(Ee(n*s)*c),d=Ee(Ee(a*i)*u),p=Ee(f-l),v=Ee(d-h);if(p===Q)return v===Q?this.double():e.ZERO;var g=Ee(p*p),y=Ee(p*g),m=Ee(l*g),b=Ee(v*v-y-Y*m);return new e(b,Ee(v*(m-b)-h*y),Ee(i*s*p))}},{key:"subtract",value:function(e){return this.add(e.negate())}},{key:"multiplyUnsafe",value:function(t){var r=e.ZERO;if("bigint"===typeof t&&t===Q)return r;var n=ke(t);if(n===J)return this;if(!re){for(var i=r,o=this;n>Q;)n&J&&(i=i.add(o)),o=o.double(),n>>=J;return i}for(var a=Te(n),s=a.k1neg,u=a.k1,c=a.k2neg,l=a.k2,f=r,h=r,d=this;u>Q||l>Q;)u&J&&(f=f.add(d)),l&J&&(h=h.add(d)),d=d.double(),u>>=J,l>>=J;return s&&(f=f.negate()),c&&(h=h.negate()),h=new e(Ee(h.x*ee.beta),h.y,h.z),f.add(h)}},{key:"precomputeWindow",value:function(e){for(var t=re?128/e+1:256/e+1,r=[],n=this,i=n,o=0;o<t;o++){i=n,r.push(i);for(var a=1;a<Math.pow(2,e-1);a++)i=i.add(n),r.push(i);n=i.double()}return r}},{key:"wNAF",value:function(t,r){!r&&this.equals(e.BASE)&&(r=ae.BASE);var n=r&&r._WINDOW_SIZE||1;if(256%n)throw new Error("Point#wNAF: Invalid precomputation window, must be power of 2");var i=r&&oe.get(r);i||(i=this.precomputeWindow(n),r&&1!==n&&(i=e.normalizeZ(i),oe.set(r,i)));for(var o=e.ZERO,a=e.ZERO,s=1+(re?128/n:256/n),u=Math.pow(2,n-1),c=BigInt(Math.pow(2,n)-1),l=Math.pow(2,n),f=BigInt(n),h=0;h<s;h++){var d=h*u,p=Number(t&c);if(t>>=f,p>u&&(p-=l,t+=J),0===p){var v=i[d];h%2&&(v=v.negate()),a=a.add(v)}else{var g=i[d+Math.abs(p)-1];p<0&&(g=g.negate()),o=o.add(g)}}return{p:o,f:a}}},{key:"multiply",value:function(t,r){var n,i,o=ke(t);if(re){var a=Te(o),s=a.k1neg,u=a.k1,c=a.k2neg,l=a.k2,f=this.wNAF(u,r),h=f.p,d=f.f,p=this.wNAF(l,r),v=p.p,g=p.f;s&&(h=h.negate()),c&&(v=v.negate()),v=new e(Ee(v.x*ee.beta),v.y,v.z),n=h.add(v),i=d.add(g)}else{var y=this.wNAF(o,r);n=y.p,i=y.f}return e.normalizeZ([n,i])[0]}},{key:"toAffine",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Se(this.z),t=this.x,r=this.y,n=this.z,i=e,o=Ee(i*i),a=Ee(o*i),s=Ee(t*o),u=Ee(r*a),c=Ee(n*i);if(c!==J)throw new Error("invZ was invalid");return new ae(s,u)}}],[{key:"fromAffine",value:function(t){if(!(t instanceof ae))throw new TypeError("JacobianPoint#fromAffine: expected Point");return new e(t.x,t.y,J)}},{key:"toAffineBatch",value:function(e){var t=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ee.P,r=new Array(e.length),n=e.reduce((function(e,n,i){return n===Q?e:(r[i]=e,Ee(e*n,t))}),J),i=Se(n,t);return e.reduceRight((function(e,n,i){return n===Q?e:(r[i]=Ee(e*r[i],t),Ee(e*n,t))}),i),r}(e.map((function(e){return e.z})));return e.map((function(e,r){return e.toAffine(t[r])}))}},{key:"normalizeZ",value:function(t){return e.toAffineBatch(t).map(e.fromAffine)}}]),e}();ie.BASE=new ie(ee.Gx,ee.Gy,J),ie.ZERO=new ie(Q,J,Q);var oe=new WeakMap,ae=function(){function e(t,r){(0,D.Z)(this,e),this.x=t,this.y=r}return(0,O.Z)(e,[{key:"_setWindowSize",value:function(e){this._WINDOW_SIZE=e,oe.delete(this)}},{key:"hasEvenY",value:function(){return this.y%Y===Q}},{key:"toRawBytes",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return me(this.toHex(e))}},{key:"toHex",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=pe(this.x);if(e){var r=this.hasEvenY()?"02":"03";return"".concat(r).concat(t)}return"04".concat(t).concat(pe(this.y))}},{key:"toHexX",value:function(){return this.toHex(!0).slice(2)}},{key:"toRawX",value:function(){return this.toRawBytes(!0).slice(1)}},{key:"assertValidity",value:function(){var e="Point is not on elliptic curve",t=this.x,r=this.y;if(!Me(t)||!Me(r))throw new Error(e);var n=Ee(r*r);if(Ee(n-te(t))!==Q)throw new Error(e)}},{key:"equals",value:function(e){return this.x===e.x&&this.y===e.y}},{key:"negate",value:function(){return new e(this.x,Ee(-this.y))}},{key:"double",value:function(){return ie.fromAffine(this).double().toAffine()}},{key:"add",value:function(e){return ie.fromAffine(this).add(ie.fromAffine(e)).toAffine()}},{key:"subtract",value:function(e){return this.add(e.negate())}},{key:"multiply",value:function(e){return ie.fromAffine(this).multiply(e,this).toAffine()}},{key:"multiplyAndAddUnsafe",value:function(t,r,n){var i=ie.fromAffine(this),o=r===Q||r===J||this!==e.BASE?i.multiplyUnsafe(r):i.multiply(r),a=ie.fromAffine(t).multiplyUnsafe(n),s=o.add(a);return s.equals(ie.ZERO)?void 0:s.toAffine()}}],[{key:"fromCompressedHex",value:function(t){var r=32===t.length,n=be(r?t:t.subarray(1));if(!Me(n))throw new Error("Point is not on curve");var i=function(e){var t=ee.P,r=BigInt(6),n=BigInt(11),i=BigInt(22),o=BigInt(23),a=BigInt(44),s=BigInt(88),u=e*e*e%t,c=u*u*e%t,l=xe(c,X)*c%t,f=xe(l,X)*c%t,h=xe(f,Y)*u%t,d=xe(h,n)*h%t,p=xe(d,i)*d%t,v=xe(p,a)*p%t,g=xe(v,s)*v%t,y=xe(g,a)*p%t,m=xe(y,X)*c%t,b=xe(m,o)*d%t,w=xe(b,r)*u%t;return xe(w,Y)}(te(n)),o=(i&J)===J;r?o&&(i=Ee(-i)):1===(1&t[0])!==o&&(i=Ee(-i));var a=new e(n,i);return a.assertValidity(),a}},{key:"fromUncompressedHex",value:function(t){var r=new e(be(t.subarray(1,33)),be(t.subarray(33,65)));return r.assertValidity(),r}},{key:"fromHex",value:function(e){var t=we(e),r=t.length,n=t[0];if(32===r||33===r&&(2===n||3===n))return this.fromCompressedHex(t);if(65===r&&4===n)return this.fromUncompressedHex(t);throw new Error("Point.fromHex: received invalid point. Expected 32-33 compressed bytes or 65 uncompressed bytes, not ".concat(r))}},{key:"fromPrivateKey",value:function(t){return e.BASE.multiply(Oe(t))}},{key:"fromSignature",value:function(t,r,n){var i=Pe(t=we(t)),o=Le(r),a=o.r,s=o.s;if(0!==n&&1!==n)throw new Error("Cannot recover signature: invalid recovery bit");var u=1&n?"03":"02",c=e.fromHex(u+pe(a)),l=ee.n,f=Se(a,l),h=Ee(-i*f,l),d=Ee(s*f,l),p=e.BASE.multiplyAndAddUnsafe(c,h,d);if(!p)throw new Error("Cannot recover signature: point at infinify");return p.assertValidity(),p}}]),e}();function se(e){return Number.parseInt(e[0],16)>=8?"00"+e:e}function ue(e){if(e.length<2||2!==e[0])throw new Error("Invalid signature integer tag: ".concat(he(e)));var t=e[1],r=e.subarray(2,t+2);if(!t||r.length!==t)throw new Error("Invalid signature integer: wrong length");if(0===r[0]&&r[1]<=127)throw new Error("Invalid signature integer: trailing length");return{data:be(r),left:e.subarray(t+2)}}ae.BASE=new ae(ee.Gx,ee.Gy),ae.ZERO=new ae(Q,Q);var ce=function(){function e(t,r){(0,D.Z)(this,e),this.r=t,this.s=r,this.assertValidity()}return(0,O.Z)(e,[{key:"assertValidity",value:function(){var e=this.r,t=this.s;if(!Be(e))throw new Error("Invalid Signature: r must be 0 < r < n");if(!Be(t))throw new Error("Invalid Signature: s must be 0 < s < n")}},{key:"hasHighS",value:function(){var e=ee.n>>J;return this.s>e}},{key:"normalizeS",value:function(){return this.hasHighS()?new e(this.r,ee.n-this.s):this}},{key:"toDERRawBytes",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];return me(this.toDERHex(e))}},{key:"toDERHex",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=se(ge(this.s));if(e)return t;var r=se(ge(this.r)),n=ge(r.length/2),i=ge(t.length/2),o=ge(r.length/2+t.length/2+4);return"30".concat(o,"02").concat(n).concat(r,"02").concat(i).concat(t)}},{key:"toRawBytes",value:function(){return this.toDERRawBytes()}},{key:"toHex",value:function(){return this.toDERHex()}},{key:"toCompactRawBytes",value:function(){return me(this.toCompactHex())}},{key:"toCompactHex",value:function(){return pe(this.r)+pe(this.s)}}],[{key:"fromCompact",value:function(t){var r=t instanceof Uint8Array,n="Signature.fromCompact";if("string"!==typeof t&&!r)throw new TypeError("".concat(n,": Expected string or Uint8Array"));var i=r?he(t):t;if(128!==i.length)throw new Error("".concat(n,": Expected 64-byte hex"));return new e(ye(i.slice(0,64)),ye(i.slice(64,128)))}},{key:"fromDER",value:function(t){var r=t instanceof Uint8Array;if("string"!==typeof t&&!r)throw new TypeError("Signature.fromDER: Expected string or Uint8Array");var n=function(e){if(e.length<2||48!=e[0])throw new Error("Invalid signature tag: ".concat(he(e)));if(e[1]!==e.length-2)throw new Error("Invalid signature: incorrect length");var t=ue(e.subarray(2)),r=t.data,n=ue(t.left),i=n.data,o=n.left;if(o.length)throw new Error("Invalid signature: left bytes after parsing: ".concat(he(o)));return{r:r,s:i}}(r?t:me(t));return new e(n.r,n.s)}},{key:"fromHex",value:function(e){return this.fromDER(e)}}]),e}();function le(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];if(!t.every((function(e){return e instanceof Uint8Array})))throw new Error("Uint8Array list expected");if(1===t.length)return t[0];for(var n=t.reduce((function(e,t){return e+t.length}),0),i=new Uint8Array(n),o=0,a=0;o<t.length;o++){var s=t[o];i.set(s,a),a+=s.length}return i}var fe=Array.from({length:256},(function(e,t){return t.toString(16).padStart(2,"0")}));function he(e){if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array");for(var t="",r=0;r<e.length;r++)t+=fe[e[r]];return t}var de=BigInt("0x10000000000000000000000000000000000000000000000000000000000000000");function pe(e){if("bigint"!==typeof e)throw new Error("Expected bigint");if(!(Q<=e&&e<de))throw new Error("Expected number < 2^256");return e.toString(16).padStart(64,"0")}function ve(e){var t=me(pe(e));if(32!==t.length)throw new Error("Error: expected 32 bytes");return t}function ge(e){var t=e.toString(16);return 1&t.length?"0".concat(t):t}function ye(e){if("string"!==typeof e)throw new TypeError("hexToNumber: expected string, got "+typeof e);return BigInt("0x".concat(e))}function me(e){if("string"!==typeof e)throw new TypeError("hexToBytes: expected string, got "+typeof e);if(e.length%2)throw new Error("hexToBytes: received invalid unpadded hex"+e.length);for(var t=new Uint8Array(e.length/2),r=0;r<t.length;r++){var n=2*r,i=e.slice(n,n+2),o=Number.parseInt(i,16);if(Number.isNaN(o)||o<0)throw new Error("Invalid byte sequence");t[r]=o}return t}function be(e){return ye(he(e))}function we(e){return e instanceof Uint8Array?Uint8Array.from(e):me(e)}function ke(e){if("number"===typeof e&&Number.isSafeInteger(e)&&e>0)return BigInt(e);if("bigint"===typeof e&&Be(e))return e;throw new TypeError("Expected valid private scalar: 0 < scalar < curve.n")}function Ee(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ee.P,r=e%t;return r>=Q?r:t+r}function xe(e,t){for(var r=ee.P,n=e;t-- >Q;)n*=n,n%=r;return n}function Se(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ee.P;if(e===Q||t<=Q)throw new Error("invert: expected positive integers, got n=".concat(e," mod=").concat(t));for(var r=Ee(e,t),n=t,i=Q,o=J,a=J,s=Q;r!==Q;){var u=n/r,c=n%r,l=i-a*u,f=o-s*u;n=r,r=c,i=a,o=s,a=l,s=f}var h=n;if(h!==J)throw new Error("invert: does not exist");return Ee(i,t)}var _e,Ae,Ie=function(e,t){return(e+t/Y)/t},Ce={a1:BigInt("0x3086d221a7d46bcde86c90e49284eb15"),b1:-J*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),a2:BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),b2:BigInt("0x3086d221a7d46bcde86c90e49284eb15"),POW_2_128:BigInt("0x100000000000000000000000000000000")};function Te(e){var t=ee.n,r=Ce.a1,n=Ce.b1,i=Ce.a2,o=Ce.b2,a=Ce.POW_2_128,s=Ie(o*e,t),u=Ie(-n*e,t),c=Ee(e-s*r-u*i,t),l=Ee(-s*n-u*o,t),f=c>a,h=l>a;if(f&&(c=t-c),h&&(l=t-l),c>a||l>a)throw new Error("splitScalarEndo: Endomorphism failed, k="+e);return{k1neg:f,k1:c,k2neg:h,k2:l}}function Pe(e){var t=ee.n,r=8*e.length-256,n=be(e);return r>0&&(n>>=BigInt(r)),n>=t&&(n-=t),n}var Re=function(){function e(){(0,D.Z)(this,e),this.v=new Uint8Array(32).fill(1),this.k=new Uint8Array(32).fill(0),this.counter=0}return(0,O.Z)(e,[{key:"hmac",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return Je.hmacSha256.apply(Je,[this.k].concat(t))}},{key:"hmacSync",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return Ae.apply(void 0,[this.k].concat(t))}},{key:"checkSync",value:function(){if("function"!==typeof Ae)throw new ne("hmacSha256Sync needs to be set")}},{key:"incr",value:function(){if(this.counter>=1e3)throw new Error("Tried 1,000 k values for sign(), all were invalid");this.counter+=1}},{key:"reseed",value:function(){var e=(0,E.Z)((0,k.Z)().mark((function e(){var t,r=arguments;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=r.length>0&&void 0!==r[0]?r[0]:new Uint8Array,e.next=3,this.hmac(this.v,Uint8Array.from([0]),t);case 3:return this.k=e.sent,e.next=6,this.hmac(this.v);case 6:if(this.v=e.sent,0!==t.length){e.next=9;break}return e.abrupt("return");case 9:return e.next=11,this.hmac(this.v,Uint8Array.from([1]),t);case 11:return this.k=e.sent,e.next=14,this.hmac(this.v);case 14:this.v=e.sent;case 15:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"reseedSync",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Uint8Array;this.checkSync(),this.k=this.hmacSync(this.v,Uint8Array.from([0]),e),this.v=this.hmacSync(this.v),0!==e.length&&(this.k=this.hmacSync(this.v,Uint8Array.from([1]),e),this.v=this.hmacSync(this.v))}},{key:"generate",value:function(){var e=(0,E.Z)((0,k.Z)().mark((function e(){return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.incr(),e.next=3,this.hmac(this.v);case 3:return this.v=e.sent,e.abrupt("return",this.v);case 5:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"generateSync",value:function(){return this.checkSync(),this.incr(),this.v=this.hmacSync(this.v),this.v}}]),e}();function Be(e){return Q<e&&e<ee.n}function Me(e){return Q<e&&e<ee.P}function Ne(e,t,r){var n=be(e);if(Be(n)){var i=ee.n,o=ae.BASE.multiply(n),a=Ee(o.x,i);if(a!==Q){var s=Ee(Se(n,i)*Ee(t+r*a,i),i);if(s!==Q){var u=new ce(a,s);return{sig:u,recovery:(o.x===u.r?0:2)|Number(o.y&J)}}}}}function Oe(e){var t;if("bigint"===typeof e)t=e;else if("number"===typeof e&&Number.isSafeInteger(e)&&e>0)t=BigInt(e);else if("string"===typeof e){if(64!==e.length)throw new Error("Expected 32 bytes of private key");t=ye(e)}else{if(!(e instanceof Uint8Array))throw new TypeError("Expected valid private key");if(32!==e.length)throw new Error("Expected 32 bytes of private key");t=be(e)}if(!Be(t))throw new Error("Expected private key: 0 < key < n");return t}function De(e){return e instanceof ae?(e.assertValidity(),e):ae.fromHex(e)}function Le(e){if(e instanceof ce)return e.assertValidity(),e;try{return ce.fromDER(e)}catch(t){return ce.fromCompact(e)}}function Ue(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return ae.fromPrivateKey(e).toRawBytes(t)}function Fe(e){return be(e.length>32?e.slice(0,32):e)}function ze(e){var t=Fe(e),r=Ee(t,ee.n);return Ze(r<Q?t:r)}function Ze(e){return ve(e)}function je(e,t,r){if(null==e)throw new Error('sign: expected valid message hash, not "'.concat(e,'"'));var n=we(e),i=Oe(t),o=[Ze(i),ze(n)];if(null!=r){!0===r&&(r=Je.randomBytes(32));var a=we(r);if(32!==a.length)throw new Error("sign: Expected 32 bytes of extra data");o.push(a)}return{seed:le.apply(void 0,o),m:Fe(n),d:i}}function qe(e,t){var r=e.sig,n=e.recovery,i=Object.assign({canonical:!0,der:!0},t),o=i.canonical,a=i.der,s=i.recovered;o&&r.hasHighS()&&(r=r.normalizeS(),n^=1);var u=a?r.toDERRawBytes():r.toCompactRawBytes();return s?[u,n]:u}function Ke(e,t){return Ve.apply(this,arguments)}function Ve(){return Ve=(0,E.Z)((0,k.Z)().mark((function e(t,r){var n,i,o,a,s,u,c,l=arguments;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=l.length>2&&void 0!==l[2]?l[2]:{},i=je(t,r,n.extraEntropy),o=i.seed,a=i.m,s=i.d,c=new Re,e.next=5,c.reseed(o);case 5:return e.t0=Ne,e.next=8,c.generate();case 8:if(e.t1=e.sent,e.t2=a,e.t3=s,u=(0,e.t0)(e.t1,e.t2,e.t3)){e.next=16;break}return e.next=14,c.reseed();case 14:e.next=5;break;case 16:return e.abrupt("return",qe(u,n));case 17:case"end":return e.stop()}}),e)}))),Ve.apply(this,arguments)}var He={strict:!0};function Ge(e,t,r){var n,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:He;try{n=Le(e),t=we(t)}catch(g){return!1}var o=n,a=o.r,s=o.s;if(i.strict&&n.hasHighS())return!1;var u,c=Pe(t);try{u=De(r)}catch(g){return!1}var l=ee.n,f=Se(s,l),h=Ee(c*f,l),d=Ee(a*f,l),p=ae.BASE.multiplyAndAddUnsafe(u,h,d);if(!p)return!1;var v=Ee(p.x,l);return v===a}ae.BASE._setWindowSize(8);var We={node:W,web:"object"===typeof self&&"crypto"in self?self.crypto:void 0},Qe={},Je={bytesToHex:he,hexToBytes:me,concatBytes:le,mod:Ee,invert:Se,isValidPrivateKey:function(e){try{return Oe(e),!0}catch(t){return!1}},_bigintTo32Bytes:ve,_normalizePrivateKey:Oe,hashToPrivateKey:function(e){if((e=we(e)).length<40||e.length>1024)throw new Error("Expected 40-1024 bytes of private key as per FIPS 186");return ve(Ee(be(e),ee.n-J)+J)},randomBytes:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:32;if(We.web)return We.web.getRandomValues(new Uint8Array(e));if(We.node){var t=We.node.randomBytes;return Uint8Array.from(t(e))}throw new Error("The environment doesn't have randomBytes function")},randomPrivateKey:function(){return Je.hashToPrivateKey(Je.randomBytes(40))},sha256:function(){var e=(0,E.Z)((0,k.Z)().mark((function e(){var t,r,n,i,o,a,s=arguments;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(t=s.length,r=new Array(t),n=0;n<t;n++)r[n]=s[n];if(!We.web){e.next=8;break}return e.next=4,We.web.subtle.digest("SHA-256",le.apply(void 0,r));case 4:return i=e.sent,e.abrupt("return",new Uint8Array(i));case 8:if(!We.node){e.next=15;break}return o=We.node.createHash,a=o("sha256"),r.forEach((function(e){return a.update(e)})),e.abrupt("return",Uint8Array.from(a.digest()));case 15:throw new Error("The environment doesn't have sha256 function");case 16:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),hmacSha256:function(){var e=(0,E.Z)((0,k.Z)().mark((function e(t){var r,n,i,o,a,s,u,c,l=arguments;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(r=l.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=l[i];if(!We.web){e.next=12;break}return e.next=4,We.web.subtle.importKey("raw",t,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]);case 4:return o=e.sent,a=le.apply(void 0,n),e.next=8,We.web.subtle.sign("HMAC",o,a);case 8:return s=e.sent,e.abrupt("return",new Uint8Array(s));case 12:if(!We.node){e.next=19;break}return u=We.node.createHmac,c=u("sha256",t),n.forEach((function(e){return c.update(e)})),e.abrupt("return",Uint8Array.from(c.digest()));case 19:throw new Error("The environment doesn't have hmac-sha256 function");case 20:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),sha256Sync:void 0,hmacSha256Sync:void 0,taggedHash:function(){var e=(0,E.Z)((0,k.Z)().mark((function e(t){var r,n,i,o,a,s=arguments;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(void 0!==(r=Qe[t])){e.next=7;break}return e.next=4,Je.sha256(Uint8Array.from(t,(function(e){return e.charCodeAt(0)})));case 4:n=e.sent,r=le(n,n),Qe[t]=r;case 7:for(i=s.length,o=new Array(i>1?i-1:0),a=1;a<i;a++)o[a-1]=s[a];return e.abrupt("return",Je.sha256.apply(Je,[r].concat(o)));case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),taggedHashSync:function(e){if("function"!==typeof _e)throw new ne("sha256Sync is undefined, you need to set it");var t=Qe[e];if(void 0===t){var r=_e(Uint8Array.from(e,(function(e){return e.charCodeAt(0)})));t=le(r,r),Qe[e]=t}for(var n=arguments.length,i=new Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];return _e.apply(void 0,[t].concat(i))},precompute:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:ae.BASE,r=t===ae.BASE?t:new ae(t.x,t.y);return r._setWindowSize(e),r.multiply(X),r}};Object.defineProperties(Je,{sha256Sync:{configurable:!1,get:function(){return _e},set:function(e){_e||(_e=e)}},hmacSha256Sync:{configurable:!1,get:function(){return Ae},set:function(e){Ae||(Ae=e)}}});var Ye=__webpack_require__(6984),Xe=__webpack_require__.n(Ye);function $e(e,t){var r="undefined"!==typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=_(e))||t&&e&&"number"===typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}var et=function(e,t){if(e.length>=255)throw new TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var i=0;i<e.length;i++){var o=e.charAt(i),a=o.charCodeAt(0);if(255!==r[a])throw new TypeError(o+" is ambiguous");r[a]=i}var s=e.length,u=e.charAt(0),c=Math.log(s)/Math.log(256),l=Math.log(256)/Math.log(s);function f(e){if("string"!==typeof e)throw new TypeError("Expected String");if(0===e.length)return new Uint8Array;var t=0;if(" "!==e[t]){for(var n=0,i=0;e[t]===u;)n++,t++;for(var o=(e.length-t)*c+1>>>0,a=new Uint8Array(o);e[t];){var l=r[e.charCodeAt(t)];if(255===l)return;for(var f=0,h=o-1;(0!==l||f<i)&&-1!==h;h--,f++)l+=s*a[h]>>>0,a[h]=l%256>>>0,l=l/256>>>0;if(0!==l)throw new Error("Non-zero carry");i=f,t++}if(" "!==e[t]){for(var d=o-i;d!==o&&0===a[d];)d++;for(var p=new Uint8Array(n+(o-d)),v=n;d!==o;)p[v++]=a[d++];return p}}}return{encode:function(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw new TypeError("Expected Uint8Array");if(0===t.length)return"";for(var r=0,n=0,i=0,o=t.length;i!==o&&0===t[i];)i++,r++;for(var a=(o-i)*l+1>>>0,c=new Uint8Array(a);i!==o;){for(var f=t[i],h=0,d=a-1;(0!==f||h<n)&&-1!==d;d--,h++)f+=256*c[d]>>>0,c[d]=f%s>>>0,f=f/s>>>0;if(0!==f)throw new Error("Non-zero carry");n=h,i++}for(var p=a-n;p!==a&&0===c[p];)p++;for(var v=u.repeat(r);p<a;++p)v+=e.charAt(c[p]);return v},decodeUnsafe:f,decode:function(e){var r=f(e);if(r)return r;throw new Error("Non-".concat(t," character"))}}},tt=et,rt=(new Uint8Array(0),function(e){if(e instanceof Uint8Array&&"Uint8Array"===e.constructor.name)return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Unknown type, must be binary type")}),nt=function(){function e(t,r,n){(0,D.Z)(this,e),this.name=t,this.prefix=r,this.baseEncode=n}return(0,O.Z)(e,[{key:"encode",value:function(e){if(e instanceof Uint8Array)return"".concat(this.prefix).concat(this.baseEncode(e));throw Error("Unknown type, must be binary type")}}]),e}(),it=function(){function e(t,r,n){if((0,D.Z)(this,e),this.name=t,this.prefix=r,void 0===r.codePointAt(0))throw new Error("Invalid prefix character");this.prefixCodePoint=r.codePointAt(0),this.baseDecode=n}return(0,O.Z)(e,[{key:"decode",value:function(e){if("string"===typeof e){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error("Unable to decode multibase string ".concat(JSON.stringify(e),", ").concat(this.name," decoder only supports inputs prefixed with ").concat(this.prefix));return this.baseDecode(e.slice(this.prefix.length))}throw Error("Can only multibase decode strings")}},{key:"or",value:function(e){return at(this,e)}}]),e}(),ot=function(){function e(t){(0,D.Z)(this,e),this.decoders=t}return(0,O.Z)(e,[{key:"or",value:function(e){return at(this,e)}},{key:"decode",value:function(e){var t=e[0],r=this.decoders[t];if(r)return r.decode(e);throw RangeError("Unable to decode multibase string ".concat(JSON.stringify(e),", only inputs prefixed with ").concat(Object.keys(this.decoders)," are supported"))}}]),e}(),at=function(e,t){return new ot(N(N({},e.decoders||B({},e.prefix,e)),t.decoders||B({},t.prefix,t)))},st=function(){function e(t,r,n,i){(0,D.Z)(this,e),this.name=t,this.prefix=r,this.baseEncode=n,this.baseDecode=i,this.encoder=new nt(t,r,n),this.decoder=new it(t,r,i)}return(0,O.Z)(e,[{key:"encode",value:function(e){return this.encoder.encode(e)}},{key:"decode",value:function(e){return this.decoder.decode(e)}}]),e}(),ut=function(e){var t=e.name,r=e.prefix,n=e.encode,i=e.decode;return new st(t,r,n,i)},ct=function(e){var t=e.prefix,r=e.name,n=e.alphabet,i=tt(n,r),o=i.encode,a=i.decode;return ut({prefix:t,name:r,encode:o,decode:function(e){return rt(a(e))}})},lt=function(e){var t=e.name,r=e.prefix,n=e.bitsPerChar,i=e.alphabet;return ut({prefix:r,name:t,encode:function(e){return function(e,t,r){for(var n="="===t[t.length-1],i=(1<<r)-1,o="",a=0,s=0,u=0;u<e.length;++u)for(s=s<<8|e[u],a+=8;a>r;)o+=t[i&s>>(a-=r)];if(a&&(o+=t[i&s<<r-a]),n)for(;o.length*r&7;)o+="=";return o}(e,i,n)},decode:function(e){return function(e,t,r,n){for(var i={},o=0;o<t.length;++o)i[t[o]]=o;for(var a=e.length;"="===e[a-1];)--a;for(var s=new Uint8Array(a*r/8|0),u=0,c=0,l=0,f=0;f<a;++f){var h=i[e[f]];if(void 0===h)throw new SyntaxError("Non-".concat(n," character"));c=c<<r|h,(u+=r)>=8&&(u-=8,s[l++]=255&c>>u)}if(u>=r||255&c<<8-u)throw new SyntaxError("Unexpected end of data");return s}(e,i,n,t)}})},ft=ut({prefix:"\0",name:"identity",encode:function(e){return t=e,(new TextDecoder).decode(t);var t},decode:function(e){return function(e){return(new TextEncoder).encode(e)}(e)}}),ht=lt({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),dt=lt({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),pt=ct({prefix:"9",name:"base10",alphabet:"0123456789"}),vt=lt({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),gt=lt({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),yt=lt({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),mt=lt({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),bt=lt({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),wt=lt({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),kt=lt({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),Et=lt({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),xt=lt({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),St=lt({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),_t=lt({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),At=ct({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),It=ct({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),Ct=ct({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),Tt=ct({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),Pt=lt({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),Rt=lt({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),Bt=lt({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),Mt=lt({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),Nt=Array.from("\ud83d\ude80\ud83e\ude90\u2604\ud83d\udef0\ud83c\udf0c\ud83c\udf11\ud83c\udf12\ud83c\udf13\ud83c\udf14\ud83c\udf15\ud83c\udf16\ud83c\udf17\ud83c\udf18\ud83c\udf0d\ud83c\udf0f\ud83c\udf0e\ud83d\udc09\u2600\ud83d\udcbb\ud83d\udda5\ud83d\udcbe\ud83d\udcbf\ud83d\ude02\u2764\ud83d\ude0d\ud83e\udd23\ud83d\ude0a\ud83d\ude4f\ud83d\udc95\ud83d\ude2d\ud83d\ude18\ud83d\udc4d\ud83d\ude05\ud83d\udc4f\ud83d\ude01\ud83d\udd25\ud83e\udd70\ud83d\udc94\ud83d\udc96\ud83d\udc99\ud83d\ude22\ud83e\udd14\ud83d\ude06\ud83d\ude44\ud83d\udcaa\ud83d\ude09\u263a\ud83d\udc4c\ud83e\udd17\ud83d\udc9c\ud83d\ude14\ud83d\ude0e\ud83d\ude07\ud83c\udf39\ud83e\udd26\ud83c\udf89\ud83d\udc9e\u270c\u2728\ud83e\udd37\ud83d\ude31\ud83d\ude0c\ud83c\udf38\ud83d\ude4c\ud83d\ude0b\ud83d\udc97\ud83d\udc9a\ud83d\ude0f\ud83d\udc9b\ud83d\ude42\ud83d\udc93\ud83e\udd29\ud83d\ude04\ud83d\ude00\ud83d\udda4\ud83d\ude03\ud83d\udcaf\ud83d\ude48\ud83d\udc47\ud83c\udfb6\ud83d\ude12\ud83e\udd2d\u2763\ud83d\ude1c\ud83d\udc8b\ud83d\udc40\ud83d\ude2a\ud83d\ude11\ud83d\udca5\ud83d\ude4b\ud83d\ude1e\ud83d\ude29\ud83d\ude21\ud83e\udd2a\ud83d\udc4a\ud83e\udd73\ud83d\ude25\ud83e\udd24\ud83d\udc49\ud83d\udc83\ud83d\ude33\u270b\ud83d\ude1a\ud83d\ude1d\ud83d\ude34\ud83c\udf1f\ud83d\ude2c\ud83d\ude43\ud83c\udf40\ud83c\udf37\ud83d\ude3b\ud83d\ude13\u2b50\u2705\ud83e\udd7a\ud83c\udf08\ud83d\ude08\ud83e\udd18\ud83d\udca6\u2714\ud83d\ude23\ud83c\udfc3\ud83d\udc90\u2639\ud83c\udf8a\ud83d\udc98\ud83d\ude20\u261d\ud83d\ude15\ud83c\udf3a\ud83c\udf82\ud83c\udf3b\ud83d\ude10\ud83d\udd95\ud83d\udc9d\ud83d\ude4a\ud83d\ude39\ud83d\udde3\ud83d\udcab\ud83d\udc80\ud83d\udc51\ud83c\udfb5\ud83e\udd1e\ud83d\ude1b\ud83d\udd34\ud83d\ude24\ud83c\udf3c\ud83d\ude2b\u26bd\ud83e\udd19\u2615\ud83c\udfc6\ud83e\udd2b\ud83d\udc48\ud83d\ude2e\ud83d\ude46\ud83c\udf7b\ud83c\udf43\ud83d\udc36\ud83d\udc81\ud83d\ude32\ud83c\udf3f\ud83e\udde1\ud83c\udf81\u26a1\ud83c\udf1e\ud83c\udf88\u274c\u270a\ud83d\udc4b\ud83d\ude30\ud83e\udd28\ud83d\ude36\ud83e\udd1d\ud83d\udeb6\ud83d\udcb0\ud83c\udf53\ud83d\udca2\ud83e\udd1f\ud83d\ude41\ud83d\udea8\ud83d\udca8\ud83e\udd2c\u2708\ud83c\udf80\ud83c\udf7a\ud83e\udd13\ud83d\ude19\ud83d\udc9f\ud83c\udf31\ud83d\ude16\ud83d\udc76\ud83e\udd74\u25b6\u27a1\u2753\ud83d\udc8e\ud83d\udcb8\u2b07\ud83d\ude28\ud83c\udf1a\ud83e\udd8b\ud83d\ude37\ud83d\udd7a\u26a0\ud83d\ude45\ud83d\ude1f\ud83d\ude35\ud83d\udc4e\ud83e\udd32\ud83e\udd20\ud83e\udd27\ud83d\udccc\ud83d\udd35\ud83d\udc85\ud83e\uddd0\ud83d\udc3e\ud83c\udf52\ud83d\ude17\ud83e\udd11\ud83c\udf0a\ud83e\udd2f\ud83d\udc37\u260e\ud83d\udca7\ud83d\ude2f\ud83d\udc86\ud83d\udc46\ud83c\udfa4\ud83d\ude47\ud83c\udf51\u2744\ud83c\udf34\ud83d\udca3\ud83d\udc38\ud83d\udc8c\ud83d\udccd\ud83e\udd40\ud83e\udd22\ud83d\udc45\ud83d\udca1\ud83d\udca9\ud83d\udc50\ud83d\udcf8\ud83d\udc7b\ud83e\udd10\ud83e\udd2e\ud83c\udfbc\ud83e\udd75\ud83d\udea9\ud83c\udf4e\ud83c\udf4a\ud83d\udc7c\ud83d\udc8d\ud83d\udce3\ud83e\udd42"),Ot=Nt.reduce((function(e,t,r){return e[r]=t,e}),[]),Dt=Nt.reduce((function(e,t,r){return e[t.codePointAt(0)]=r,e}),[]);var Lt=ut({prefix:"\ud83d\ude80",name:"base256emoji",encode:function(e){return e.reduce((function(e,t){return e+=Ot[t]}),"")},decode:function(e){var t,r=[],n=$e(e);try{for(n.s();!(t=n.n()).done;){var i=t.value,o=Dt[i.codePointAt(0)];if(void 0===o)throw new Error("Non-base256emoji character: ".concat(i));r.push(o)}}catch(a){n.e(a)}finally{n.f()}return new Uint8Array(r)}}),Ut=function e(t,r,n){r=r||[];var i=n=n||0;for(;t>=Ft;)r[n++]=255&t|128,t/=128;for(;-128&t;)r[n++]=255&t|128,t>>>=7;return r[n]=0|t,e.bytes=n-i+1,r},Ft=Math.pow(2,31);var zt=function e(t,r){var n,i=0,o=0,a=r=r||0,s=t.length;do{if(a>=s)throw e.bytes=0,new RangeError("Could not decode varint");n=t[a++],i+=o<28?(127&n)<<o:(127&n)*Math.pow(2,o),o+=7}while(n>=128);return e.bytes=a-r,i};var Zt=Math.pow(2,7),jt=Math.pow(2,14),qt=Math.pow(2,21),Kt=Math.pow(2,28),Vt=Math.pow(2,35),Ht=Math.pow(2,42),Gt=Math.pow(2,49),Wt=Math.pow(2,56),Qt=Math.pow(2,63),Jt={encode:Ut,decode:zt,encodingLength:function(e){return e<Zt?1:e<jt?2:e<qt?3:e<Kt?4:e<Vt?5:e<Ht?6:e<Gt?7:e<Wt?8:e<Qt?9:10}},Yt=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=Jt.decode(e,t);return[r,Jt.decode.bytes]},Xt=function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;return Jt.encode(e,t,r),t},$t=function(e){return Jt.encodingLength(e)},er=function(e,t){var r=t.byteLength,n=$t(e),i=n+$t(r),o=new Uint8Array(i+r);return Xt(e,o,0),Xt(r,o,n),o.set(t,i),new rr(e,r,t,o)},tr=function(e){var t=rt(e),r=I(Yt(t),2),n=r[0],i=r[1],o=I(Yt(t.subarray(i)),2),a=o[0],s=o[1],u=t.subarray(i+s);if(u.byteLength!==a)throw new Error("Incorrect length");return new rr(n,a,u,t)},rr=(0,O.Z)((function e(t,r,n,i){(0,D.Z)(this,e),this.code=t,this.size=r,this.digest=n,this.bytes=i})),nr=function(e){var t=e.name,r=e.code,n=e.encode;return new ir(t,r,n)},ir=function(){function e(t,r,n){(0,D.Z)(this,e),this.name=t,this.code=r,this.encode=n}return(0,O.Z)(e,[{key:"digest",value:function(e){var t=this;if(e instanceof Uint8Array){var r=this.encode(e);return r instanceof Uint8Array?er(this.code,r):r.then((function(e){return er(t.code,e)}))}throw Error("Unknown type, must be binary type")}}]),e}(),or=function(e){return function(){var t=(0,E.Z)((0,k.Z)().mark((function t(r){return(0,k.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.t0=Uint8Array,t.next=3,crypto.subtle.digest(e,r);case 3:return t.t1=t.sent,t.abrupt("return",new t.t0(t.t1));case 5:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}()},ar=nr({name:"sha2-256",code:18,encode:or("SHA-256")}),sr=nr({name:"sha2-512",code:19,encode:or("SHA-512")}),ur=rt,cr={code:0,name:"identity",encode:ur,digest:function(e){return er(0,ur(e))}},lr="raw",fr=85,hr=function(e){return rt(e)},dr=function(e){return rt(e)},pr=new TextEncoder,vr=new TextDecoder,gr="json",yr=512,mr=function(e){return pr.encode(JSON.stringify(e))},br=function(e){return JSON.parse(vr.decode(e))},wr=function(e,t){function r(e,t,n,i){(0,D.Z)(this,r),this.code=t,this.version=e,this.multihash=n,this.bytes=i,this.byteOffset=i.byteOffset,this.byteLength=i.byteLength,this.asCID=this,this._baseCache=new Map,Object.defineProperties(this,{byteOffset:Tr,byteLength:Tr,code:Cr,version:Cr,multihash:Cr,bytes:Cr,_baseCache:Tr,asCID:Tr})}return(0,O.Z)(r,[{key:"toV0",value:function(){if(0===this.version)return this;var e=this.code,t=this.multihash;if(e!==Sr)throw new Error("Cannot convert a non dag-pb CID to CIDv0");if(t.code!==_r)throw new Error("Cannot convert non sha2-256 multihash CID to CIDv0");return r.createV0(t)}},{key:"toV1",value:function(){switch(this.version){case 0:var e=this.multihash,t=e.code,n=e.digest,i=er(t,n);return r.createV1(this.code,i);case 1:return this;default:throw Error("Can not convert CID version ".concat(this.version," to version 0. This is a bug please report"))}}},{key:"equals",value:function(e){return e&&this.code===e.code&&this.version===e.version&&(t=this.multihash,r=e.multihash,t===r||t.code===r.code&&t.size===r.size&&function(e,t){if(e===t)return!0;if(e.byteLength!==t.byteLength)return!1;for(var r=0;r<e.byteLength;r++)if(e[r]!==t[r])return!1;return!0}(t.bytes,r.bytes));var t,r}},{key:"toString",value:function(e){var t=this.bytes,r=this.version,n=this._baseCache;return 0===r?Er(t,n,e||Ct.encoder):xr(t,n,e||yt.encoder)}},{key:"toJSON",value:function(){return{code:this.code,version:this.version,hash:this.multihash.bytes}}},{key:e,get:function(){return"CID"}},{key:t,value:function(){return"CID("+this.toString()+")"}},{key:"toBaseEncodedString",get:function(){throw new Error("Deprecated, use .toString()")}},{key:"codec",get:function(){throw new Error('"codec" property is deprecated, use integer "code" property instead')}},{key:"buffer",get:function(){throw new Error("Deprecated .buffer property, use .bytes to get Uint8Array instead")}},{key:"multibaseName",get:function(){throw new Error('"multibaseName" property is deprecated')}},{key:"prefix",get:function(){throw new Error('"prefix" property is deprecated')}}],[{key:"isCID",value:function(e){return Pr(/^0\.0/,Rr),!(!e||!e[Ir]&&e.asCID!==e)}},{key:"asCID",value:function(e){if(e instanceof r)return e;if(null!=e&&e.asCID===e){var t=e.version,n=e.code,i=e.multihash;return new r(t,n,i,e.bytes||Ar(t,n,i.bytes))}if(null!=e&&!0===e[Ir]){var o=e.version,a=e.multihash,s=e.code,u=tr(a);return r.create(o,s,u)}return null}},{key:"create",value:function(e,t,n){if("number"!==typeof t)throw new Error("String codecs are no longer supported");switch(e){case 0:if(t!==Sr)throw new Error("Version 0 CID must use dag-pb (code: ".concat(Sr,") block encoding"));return new r(e,t,n,n.bytes);case 1:return new r(e,t,n,Ar(e,t,n.bytes));default:throw new Error("Invalid version")}}},{key:"createV0",value:function(e){return r.create(0,Sr,e)}},{key:"createV1",value:function(e,t){return r.create(1,e,t)}},{key:"decode",value:function(e){var t=I(r.decodeFirst(e),2),n=t[0];if(t[1].length)throw new Error("Incorrect length");return n}},{key:"decodeFirst",value:function(e){var t=r.inspectBytes(e),n=t.size-t.multihashSize,i=rt(e.subarray(n,n+t.multihashSize));if(i.byteLength!==t.multihashSize)throw new Error("Incorrect length");var o=i.subarray(t.multihashSize-t.digestSize),a=new rr(t.multihashCode,t.digestSize,o,i);return[0===t.version?r.createV0(a):r.createV1(t.codec,a),e.subarray(t.size)]}},{key:"inspectBytes",value:function(e){var t=0,r=function(){var r=I(Yt(e.subarray(t)),2),n=r[0],i=r[1];return t+=i,n},n=r(),i=Sr;if(18===n?(n=0,t=0):1===n&&(i=r()),0!==n&&1!==n)throw new RangeError("Invalid CID version ".concat(n));var o=t,a=r(),s=r(),u=t+s;return{version:n,codec:i,multihashCode:a,digestSize:s,multihashSize:u-o,size:u}}},{key:"parse",value:function(e,t){var n=I(kr(e,t),2),i=n[0],o=n[1],a=r.decode(o);return a._baseCache.set(i,e),a}}]),r}(Symbol.toStringTag,Symbol.for("nodejs.util.inspect.custom")),kr=function(e,t){switch(e[0]){case"Q":var r=t||Ct;return[Ct.prefix,r.decode("".concat(Ct.prefix).concat(e))];case Ct.prefix:var n=t||Ct;return[Ct.prefix,n.decode(e)];case yt.prefix:var i=t||yt;return[yt.prefix,i.decode(e)];default:if(null==t)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[e[0],t.decode(e)]}},Er=function(e,t,r){var n=r.prefix;if(n!==Ct.prefix)throw Error("Cannot string encode V0 in ".concat(r.name," encoding"));var i=t.get(n);if(null==i){var o=r.encode(e).slice(1);return t.set(n,o),o}return i},xr=function(e,t,r){var n=r.prefix,i=t.get(n);if(null==i){var o=r.encode(e);return t.set(n,o),o}return i},Sr=112,_r=18,Ar=function(e,t,r){var n=$t(e),i=n+$t(t),o=new Uint8Array(i+r.byteLength);return Xt(e,o,0),Xt(t,o,n),o.set(r,i),o},Ir=Symbol.for("@ipld/js-cid/CID"),Cr={writable:!1,configurable:!1,enumerable:!0},Tr={writable:!1,enumerable:!1,configurable:!1},Pr=function(e,t){if(!e.test("0.0.0-dev"))throw new Error(t);console.warn(t)},Rr="CID.isCID(v) is deprecated and will be removed in the next major release.\nFollowing code pattern:\n\nif (CID.isCID(value)) {\n doSomethingWithCID(value)\n}\n\nIs replaced with:\n\nconst cid = CID.asCID(value)\nif (cid) {\n // Make sure to use cid instead of value\n doSomethingWithCID(cid)\n}\n",Br=N(N(N(N(N(N(N(N(N(N({},e),t),r),n),i),o),a),s),u),c);N(N({},l),f);function Mr(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return null!=globalThis.Buffer&&null!=globalThis.Buffer.alloc?globalThis.Buffer.alloc(e):new Uint8Array(e)}function Nr(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return null!=globalThis.Buffer&&null!=globalThis.Buffer.allocUnsafe?globalThis.Buffer.allocUnsafe(e):new Uint8Array(e)}function Or(e,t,r,n){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:r},decoder:{decode:n}}}var Dr=Or("utf8","u",(function(e){return"u"+new TextDecoder("utf8").decode(e)}),(function(e){return(new TextEncoder).encode(e.substring(1))})),Lr=Or("ascii","a",(function(e){for(var t="a",r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t}),(function(e){for(var t=Nr((e=e.substring(1)).length),r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t})),Ur=N({utf8:Dr,"utf-8":Dr,hex:Br.base16,latin1:Lr,ascii:Lr,binary:Lr},Br);function Fr(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"utf8",r=Ur[t];if(!r)throw new Error('Unsupported encoding "'.concat(t,'"'));return"utf8"!==t&&"utf-8"!==t||null==globalThis.Buffer||null==globalThis.Buffer.from?r.decoder.decode("".concat(r.prefix).concat(e)):globalThis.Buffer.from(e,"utf8")}function zr(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"utf8",r=Ur[t];if(!r)throw new Error('Unsupported encoding "'.concat(t,'"'));return"utf8"!==t&&"utf-8"!==t||null==globalThis.Buffer||null==globalThis.Buffer.from?r.encoder.encode(e).substring(1):globalThis.Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("utf8")}function Zr(e){return"string"===typeof e?Fr(e.replace(/^0x/i,"").toLowerCase(),"base16"):e}var jr=function(e){return zr(e,"base16")},qr=function(e){return zr(e,"utf8")},Kr=function(e){return Fr(e,"utf8")};"object"===typeof self&&"crypto"in self&&self.crypto;var Vr=Je.randomBytes;Je.sha256;function Hr(e){return new Uint8Array(Ye.keccak256.arrayBuffer(e))}function Gr(e){return 64===e.length&&(e=function(e,t){var r,n=null!==t&&void 0!==t?t:e.reduce((function(e,t){return e+t.length}),0),i=new Uint8Array(n),o=0,a=$e(e);try{for(a.s();!(r=a.n()).done;){var s=r.value;i.set(s,o),o+=s.length}}catch(u){a.e(u)}finally{a.f()}return i}([new Uint8Array([4]),e],65)),ae.fromHex(e).toRawBytes(!0)}function Wr(e,t,r){try{return Ge(ce.fromCompact(e.slice(0,64)),t,r)}catch(n){return!1}}function Qr(e){if("undefined"!==typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function Jr(e){return function(e){if(Array.isArray(e))return S(e)}(e)||Qr(e)||_(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Yr(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=F(e)););return e}function Xr(){return Xr="undefined"!==typeof Reflect&&Reflect.get?Reflect.get.bind():function(e,t,r){var n=Yr(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}},Xr.apply(this,arguments)}var $r=!1,en=!1,tn={debug:1,default:2,info:2,warning:3,error:4,off:5},rn=tn.default,nn=null;var on,an,sn=function(){try{var e=[];if(["NFD","NFC","NFKD","NFKC"].forEach((function(t){try{if("test"!=="test".normalize(t))throw new Error("bad normalize")}catch(r){e.push(t)}})),e.length)throw new Error("missing "+e.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(t){return t.message}return null}();!function(e){e.DEBUG="DEBUG",e.INFO="INFO",e.WARNING="WARNING",e.ERROR="ERROR",e.OFF="OFF"}(on||(on={})),function(e){e.UNKNOWN_ERROR="UNKNOWN_ERROR",e.NOT_IMPLEMENTED="NOT_IMPLEMENTED",e.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",e.NETWORK_ERROR="NETWORK_ERROR",e.SERVER_ERROR="SERVER_ERROR",e.TIMEOUT="TIMEOUT",e.BUFFER_OVERRUN="BUFFER_OVERRUN",e.NUMERIC_FAULT="NUMERIC_FAULT",e.MISSING_NEW="MISSING_NEW",e.INVALID_ARGUMENT="INVALID_ARGUMENT",e.MISSING_ARGUMENT="MISSING_ARGUMENT",e.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",e.CALL_EXCEPTION="CALL_EXCEPTION",e.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",e.NONCE_EXPIRED="NONCE_EXPIRED",e.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",e.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",e.TRANSACTION_REPLACED="TRANSACTION_REPLACED",e.ACTION_REJECTED="ACTION_REJECTED"}(an||(an={}));var un="0123456789abcdef",cn=function(){function e(t){(0,D.Z)(this,e),Object.defineProperty(this,"version",{enumerable:!0,value:t,writable:!1})}return(0,O.Z)(e,[{key:"_log",value:function(e,t){var r=e.toLowerCase();null==tn[r]&&this.throwArgumentError("invalid log level name","logLevel",e),rn>tn[r]||console.log.apply(console,t)}},{key:"debug",value:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];this._log(e.levels.DEBUG,r)}},{key:"info",value:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];this._log(e.levels.INFO,r)}},{key:"warn",value:function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];this._log(e.levels.WARNING,r)}},{key:"makeError",value:function(t,r,n){if(en)return this.makeError("censored error",r,{});r||(r=e.errors.UNKNOWN_ERROR),n||(n={});var i=[];Object.keys(n).forEach((function(e){var t=n[e];try{if(t instanceof Uint8Array){for(var r="",o=0;o<t.length;o++)r+=un[t[o]>>4],r+=un[15&t[o]];i.push(e+"=Uint8Array(0x"+r+")")}else i.push(e+"="+JSON.stringify(t))}catch(u){i.push(e+"="+JSON.stringify(n[e].toString()))}})),i.push("code=".concat(r)),i.push("version=".concat(this.version));var o=t,a="";switch(r){case an.NUMERIC_FAULT:a="NUMERIC_FAULT";var s=t;switch(s){case"overflow":case"underflow":case"division-by-zero":a+="-"+s;break;case"negative-power":case"negative-width":a+="-unsupported";break;case"unbound-bitwise-result":a+="-unbound-result"}break;case an.CALL_EXCEPTION:case an.INSUFFICIENT_FUNDS:case an.MISSING_NEW:case an.NONCE_EXPIRED:case an.REPLACEMENT_UNDERPRICED:case an.TRANSACTION_REPLACED:case an.UNPREDICTABLE_GAS_LIMIT:a=r}a&&(t+=" [ See: https://links.ethers.org/v5-errors-"+a+" ]"),i.length&&(t+=" ("+i.join(", ")+")");var u=new Error(t);return u.reason=o,u.code=r,Object.keys(n).forEach((function(e){u[e]=n[e]})),u}},{key:"throwError",value:function(e,t,r){throw this.makeError(e,t,r)}},{key:"throwArgumentError",value:function(t,r,n){return this.throwError(t,e.errors.INVALID_ARGUMENT,{argument:r,value:n})}},{key:"assert",value:function(e,t,r,n){e||this.throwError(t,r,n)}},{key:"assertArgument",value:function(e,t,r,n){e||this.throwArgumentError(t,r,n)}},{key:"checkNormalize",value:function(t){null==t&&(t="platform missing String.prototype.normalize"),sn&&this.throwError("platform missing String.prototype.normalize",e.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:sn})}},{key:"checkSafeUint53",value:function(t,r){"number"===typeof t&&(null==r&&(r="value not safe"),(t<0||t>=9007199254740991)&&this.throwError(r,e.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:t}),t%1&&this.throwError(r,e.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:t}))}},{key:"checkArgumentCount",value:function(t,r,n){n=n?": "+n:"",t<r&&this.throwError("missing argument"+n,e.errors.MISSING_ARGUMENT,{count:t,expectedCount:r}),t>r&&this.throwError("too many arguments"+n,e.errors.UNEXPECTED_ARGUMENT,{count:t,expectedCount:r})}},{key:"checkNew",value:function(t,r){t!==Object&&null!=t||this.throwError("missing new",e.errors.MISSING_NEW,{name:r.name})}},{key:"checkAbstract",value:function(t,r){t===r?this.throwError("cannot instantiate abstract class "+JSON.stringify(r.name)+" directly; use a sub-class",e.errors.UNSUPPORTED_OPERATION,{name:t.name,operation:"new"}):t!==Object&&null!=t||this.throwError("missing new",e.errors.MISSING_NEW,{name:r.name})}}],[{key:"globalLogger",value:function(){return nn||(nn=new e("logger/5.7.0")),nn}},{key:"setCensorship",value:function(t,r){if(!t&&r&&this.globalLogger().throwError("cannot permanently disable censorship",e.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),$r){if(!t)return;this.globalLogger().throwError("error censorship permanent",e.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}en=!!t,$r=!!r}},{key:"setLogLevel",value:function(t){var r=tn[t.toLowerCase()];null!=r?rn=r:e.globalLogger().warn("invalid log level - "+t)}},{key:"from",value:function(t){return new e(t)}}]),e}();cn.errors=an,cn.levels=on;var ln=new cn("bytes/5.7.0");function fn(e){return!!e.toHexString}function hn(e){return e.slice||(e.slice=function(){var t=Array.prototype.slice.call(arguments);return hn(new Uint8Array(Array.prototype.slice.apply(e,t)))}),e}function dn(e){return bn(e)&&!(e.length%2)||vn(e)}function pn(e){return"number"===typeof e&&e==e&&e%1===0}function vn(e){if(null==e)return!1;if(e.constructor===Uint8Array)return!0;if("string"===typeof e)return!1;if(!pn(e.length)||e.length<0)return!1;for(var t=0;t<e.length;t++){var r=e[t];if(!pn(r)||r<0||r>=256)return!1}return!0}function gn(e,t){if(t||(t={}),"number"===typeof e){ln.checkSafeUint53(e,"invalid arrayify value");for(var r=[];e;)r.unshift(255&e),e=parseInt(String(e/256));return 0===r.length&&r.push(0),hn(new Uint8Array(r))}if(t.allowMissingPrefix&&"string"===typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),fn(e)&&(e=e.toHexString()),bn(e)){var n=e.substring(2);n.length%2&&("left"===t.hexPad?n="0"+n:"right"===t.hexPad?n+="0":ln.throwArgumentError("hex data is odd-length","value",e));for(var i=[],o=0;o<n.length;o+=2)i.push(parseInt(n.substring(o,o+2),16));return hn(new Uint8Array(i))}return vn(e)?hn(new Uint8Array(e)):ln.throwArgumentError("invalid arrayify value","value",e)}function yn(e){var t=e.map((function(e){return gn(e)})),r=t.reduce((function(e,t){return e+t.length}),0),n=new Uint8Array(r);return t.reduce((function(e,t){return n.set(t,e),e+t.length}),0),hn(n)}function mn(e){var t=gn(e);if(0===t.length)return t;for(var r=0;r<t.length&&0===t[r];)r++;return r&&(t=t.slice(r)),t}function bn(e,t){return!("string"!==typeof e||!e.match(/^0x[0-9A-Fa-f]*$/))&&(!t||e.length===2+2*t)}var wn="0123456789abcdef";function kn(e,t){if(t||(t={}),"number"===typeof e){ln.checkSafeUint53(e,"invalid hexlify value");for(var r="";e;)r=wn[15&e]+r,e=Math.floor(e/16);return r.length?(r.length%2&&(r="0"+r),"0x"+r):"0x00"}if("bigint"===typeof e)return(e=e.toString(16)).length%2?"0x0"+e:"0x"+e;if(t.allowMissingPrefix&&"string"===typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),fn(e))return e.toHexString();if(bn(e))return e.length%2&&("left"===t.hexPad?e="0x0"+e.substring(2):"right"===t.hexPad?e+="0":ln.throwArgumentError("hex data is odd-length","value",e)),e.toLowerCase();if(vn(e)){for(var n="0x",i=0;i<e.length;i++){var o=e[i];n+=wn[(240&o)>>4]+wn[15&o]}return n}return ln.throwArgumentError("invalid hexlify value","value",e)}function En(e){if("string"!==typeof e)e=kn(e);else if(!bn(e)||e.length%2)return null;return(e.length-2)/2}function xn(e,t,r){return"string"!==typeof e?e=kn(e):(!bn(e)||e.length%2)&&ln.throwArgumentError("invalid hexData","value",e),t=2+2*t,null!=r?"0x"+e.substring(t,2+2*r):"0x"+e.substring(t)}function Sn(e){var t="0x";return e.forEach((function(e){t+=kn(e).substring(2)})),t}function _n(e){var t=function(e){"string"!==typeof e&&(e=kn(e));bn(e)||ln.throwArgumentError("invalid hex string","value",e);e=e.substring(2);var t=0;for(;t<e.length&&"0"===e[t];)t++;return"0x"+e.substring(t)}(kn(e,{hexPad:"left"}));return"0x"===t?"0x0":t}function An(e,t){for("string"!==typeof e?e=kn(e):bn(e)||ln.throwArgumentError("invalid hex string","value",e),e.length>2*t+2&&ln.throwArgumentError("value out of range","value",arguments[1]);e.length<2*t+2;)e="0x0"+e.substring(2);return e}function In(e){var t={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(dn(e)){var r=gn(e);64===r.length?(t.v=27+(r[32]>>7),r[32]&=127,t.r=kn(r.slice(0,32)),t.s=kn(r.slice(32,64))):65===r.length?(t.r=kn(r.slice(0,32)),t.s=kn(r.slice(32,64)),t.v=r[64]):ln.throwArgumentError("invalid signature string","signature",e),t.v<27&&(0===t.v||1===t.v?t.v+=27:ln.throwArgumentError("signature invalid v byte","signature",e)),t.recoveryParam=1-t.v%2,t.recoveryParam&&(r[32]|=128),t._vs=kn(r.slice(32,64))}else{if(t.r=e.r,t.s=e.s,t.v=e.v,t.recoveryParam=e.recoveryParam,t._vs=e._vs,null!=t._vs){var n=function(e,t){(e=gn(e)).length>t&&ln.throwArgumentError("value out of range","value",arguments[0]);var r=new Uint8Array(t);return r.set(e,t-e.length),hn(r)}(gn(t._vs),32);t._vs=kn(n);var i=n[0]>=128?1:0;null==t.recoveryParam?t.recoveryParam=i:t.recoveryParam!==i&&ln.throwArgumentError("signature recoveryParam mismatch _vs","signature",e),n[0]&=127;var o=kn(n);null==t.s?t.s=o:t.s!==o&&ln.throwArgumentError("signature v mismatch _vs","signature",e)}if(null==t.recoveryParam)null==t.v?ln.throwArgumentError("signature missing v and recoveryParam","signature",e):0===t.v||1===t.v?t.recoveryParam=t.v:t.recoveryParam=1-t.v%2;else if(null==t.v)t.v=27+t.recoveryParam;else{var a=0===t.v||1===t.v?t.v:1-t.v%2;t.recoveryParam!==a&&ln.throwArgumentError("signature recoveryParam mismatch v","signature",e)}null!=t.r&&bn(t.r)?t.r=An(t.r,32):ln.throwArgumentError("signature missing or invalid r","signature",e),null!=t.s&&bn(t.s)?t.s=An(t.s,32):ln.throwArgumentError("signature missing or invalid s","signature",e);var s=gn(t.s);s[0]>=128&&ln.throwArgumentError("signature s out of range","signature",e),t.recoveryParam&&(s[0]|=128);var u=kn(s);t._vs&&(bn(t._vs)||ln.throwArgumentError("signature invalid _vs","signature",e),t._vs=An(t._vs,32)),null==t._vs?t._vs=u:t._vs!==u&&ln.throwArgumentError("signature _vs mismatch v and s","signature",e)}return t.yParityAndS=t._vs,t.compact=t.r+t.yParityAndS.substring(2),t}var Cn=new cn("rlp/5.7.0");function Tn(e){for(var t=[];e;)t.unshift(255&e),e>>=8;return t}function Pn(e,t,r){for(var n=0,i=0;i<r;i++)n=256*n+e[t+i];return n}function Rn(e){if(Array.isArray(e)){var t=[];if(e.forEach((function(e){t=t.concat(Rn(e))})),t.length<=55)return t.unshift(192+t.length),t;var r=Tn(t.length);return r.unshift(247+r.length),r.concat(t)}dn(e)||Cn.throwArgumentError("RLP object must be BytesLike","object",e);var n=Array.prototype.slice.call(gn(e));if(1===n.length&&n[0]<=127)return n;if(n.length<=55)return n.unshift(128+n.length),n;var i=Tn(n.length);return i.unshift(183+i.length),i.concat(n)}function Bn(e){return kn(Rn(e))}function Mn(e,t,r,n){for(var i=[];r<t+1+n;){var o=Nn(e,r);i.push(o.result),(r+=o.consumed)>t+1+n&&Cn.throwError("child data too short",cn.errors.BUFFER_OVERRUN,{})}return{consumed:1+n,result:i}}function Nn(e,t){if(0===e.length&&Cn.throwError("data too short",cn.errors.BUFFER_OVERRUN,{}),e[t]>=248){var r=e[t]-247;t+1+r>e.length&&Cn.throwError("data short segment too short",cn.errors.BUFFER_OVERRUN,{});var n=Pn(e,t+1,r);return t+1+r+n>e.length&&Cn.throwError("data long segment too short",cn.errors.BUFFER_OVERRUN,{}),Mn(e,t,t+1+r,r+n)}if(e[t]>=192){var i=e[t]-192;return t+1+i>e.length&&Cn.throwError("data array too short",cn.errors.BUFFER_OVERRUN,{}),Mn(e,t,t+1,i)}if(e[t]>=184){var o=e[t]-183;t+1+o>e.length&&Cn.throwError("data array too short",cn.errors.BUFFER_OVERRUN,{});var a=Pn(e,t+1,o);return t+1+o+a>e.length&&Cn.throwError("data array too short",cn.errors.BUFFER_OVERRUN,{}),{consumed:1+o+a,result:kn(e.slice(t+1+o,t+1+o+a))}}if(e[t]>=128){var s=e[t]-128;return t+1+s>e.length&&Cn.throwError("data too short",cn.errors.BUFFER_OVERRUN,{}),{consumed:1+s,result:kn(e.slice(t+1,t+1+s))}}return{consumed:1,result:kn(e[t])}}function On(e){var t=gn(e),r=Nn(t,0);return r.consumed!==t.length&&Cn.throwArgumentError("invalid rlp data","data",e),r.result}var Dn="[a-fA-F\\d:]",Ln=function(e){return e&&e.includeBoundaries?"(?:(?<=\\s|^)(?=".concat(Dn,")|(?<=").concat(Dn,")(?=\\s|$))"):""},Un="(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}",Fn="[a-fA-F\\d]{1,4}",zn="\n(?:\n(?:".concat(Fn,":){7}(?:").concat(Fn,"|:)| // 1:2:3:4:5:6:7:: 1:2:3:4:5:6:7:8\n(?:").concat(Fn,":){6}(?:").concat(Un,"|:").concat(Fn,"|:)| // 1:2:3:4:5:6:: 1:2:3:4:5:6::8 1:2:3:4:5:6::8 1:2:3:4:5:6::1.2.3.4\n(?:").concat(Fn,":){5}(?::").concat(Un,"|(?::").concat(Fn,"){1,2}|:)| // 1:2:3:4:5:: 1:2:3:4:5::7:8 1:2:3:4:5::8 1:2:3:4:5::7:1.2.3.4\n(?:").concat(Fn,":){4}(?:(?::").concat(Fn,"){0,1}:").concat(Un,"|(?::").concat(Fn,"){1,3}|:)| // 1:2:3:4:: 1:2:3:4::6:7:8 1:2:3:4::8 1:2:3:4::6:7:1.2.3.4\n(?:").concat(Fn,":){3}(?:(?::").concat(Fn,"){0,2}:").concat(Un,"|(?::").concat(Fn,"){1,4}|:)| // 1:2:3:: 1:2:3::5:6:7:8 1:2:3::8 1:2:3::5:6:7:1.2.3.4\n(?:").concat(Fn,":){2}(?:(?::").concat(Fn,"){0,3}:").concat(Un,"|(?::").concat(Fn,"){1,5}|:)| // 1:2:: 1:2::4:5:6:7:8 1:2::8 1:2::4:5:6:7:1.2.3.4\n(?:").concat(Fn,":){1}(?:(?::").concat(Fn,"){0,4}:").concat(Un,"|(?::").concat(Fn,"){1,6}|:)| // 1:: 1::3:4:5:6:7:8 1::8 1::3:4:5:6:7:1.2.3.4\n(?::(?:(?::").concat(Fn,"){0,5}:").concat(Un,"|(?::").concat(Fn,"){1,7}|:)) // ::2:3:4:5:6:7:8 ::2:3:4:5:6:7:8 ::8 ::1.2.3.4\n)(?:%[0-9a-zA-Z]{1,})? // %eth0 %1\n").replace(/\s*\/\/.*$/gm,"").replace(/\n/g,"").trim(),Zn=new RegExp("(?:^".concat(Un,"$)|(?:^").concat(zn,"$)")),jn=new RegExp("^".concat(Un,"$")),qn=new RegExp("^".concat(zn,"$")),Kn=function(e){return e&&e.exact?Zn:new RegExp("(?:".concat(Ln(e)).concat(Un).concat(Ln(e),")|(?:").concat(Ln(e)).concat(zn).concat(Ln(e),")"),"g")};Kn.v4=function(e){return e&&e.exact?jn:new RegExp("".concat(Ln(e)).concat(Un).concat(Ln(e)),"g")},Kn.v6=function(e){return e&&e.exact?qn:new RegExp("".concat(Ln(e)).concat(zn).concat(Ln(e)),"g")};var Vn=Kn;function Hn(e){var t=function(){return e.apply(void 0,arguments)};return Object.defineProperty(t,"name",{value:"functionTimeout(".concat(e.name||"<anonymous>",")"),configurable:!0}),t}var Gn=Object.prototype.toString;function Wn(e){return"[object RegExp]"===Gn.call(e)}var Qn={global:"g",ignoreCase:"i",multiline:"m",dotAll:"s",sticky:"y",unicode:"u"};function Jn(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!Wn(e))throw new TypeError("Expected a RegExp instance");var r=Object.keys(Qn).map((function(r){return("boolean"===typeof t[r]?t[r]:e[r])?Qn[r]:""})).join(""),n=new RegExp(t.source||e.source,r);return n.lastIndex="number"===typeof t.lastIndex?t.lastIndex:e.lastIndex,n}function Yn(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};r.timeout;try{return Hn((function(){return Jn(e).test(t)}))()}catch(n){throw n}}var Xn={timeout:400};function $n(e){return Yn(Vn({exact:!0}),e.slice(0,45),Xn)}function ei(e){return Yn(Vn.v6({exact:!0}),e.slice(0,45),Xn)}function ti(e){return Yn(Vn.v4({exact:!0}),e.slice(0,15),Xn)}var ri=ti,ni=ei,ii=function e(t){var r,n=0;if(t=t.trim(),ri(t))r=new Uint8Array(n+4),t.split(/\./g).forEach((function(e){r[n++]=255&parseInt(e,10)}));else if(ni(t)){var i,o=t.split(":",8);for(i=0;i<o.length;i++){var a=void 0;ri(o[i])&&(a=e(o[i]),o[i]=zr(a.slice(0,2),"base16")),null!=a&&++i<8&&o.splice(i,0,zr(a.slice(2,4),"base16"))}if(""===o[0])for(;o.length<8;)o.unshift("0");else if(""===o[o.length-1])for(;o.length<8;)o.push("0");else if(o.length<8){for(i=0;i<o.length&&""!==o[i];i++);var s=[i,1];for(i=9-o.length;i>0;i--)s.push("0");o.splice.apply(o,s)}for(r=new Uint8Array(n+16),i=0;i<o.length;i++){var u=parseInt(o[i],16);r[n++]=u>>8&255,r[n++]=255&u}}if(null==r)throw new Error('invalid ip address "'.concat(t,'"'));return r},oi=-1,ai={},si={};function ui(e,t,r,n,i){return{code:e,size:t,name:r,resolvable:Boolean(n),path:Boolean(i)}}function ci(e){if("number"===typeof e){if(null!=si[e])return si[e];throw new Error("no protocol with code: ".concat(e))}if("string"===typeof e){if(null!=ai[e])return ai[e];throw new Error("no protocol with name: ".concat(e))}throw new Error("invalid protocol id type: ".concat(typeof e))}[[4,32,"ip4"],[6,16,"tcp"],[33,16,"dccp"],[41,128,"ip6"],[42,oi,"ip6zone"],[53,oi,"dns",!0],[54,oi,"dns4",!0],[55,oi,"dns6",!0],[56,oi,"dnsaddr",!0],[132,16,"sctp"],[273,16,"udp"],[275,0,"p2p-webrtc-star"],[276,0,"p2p-webrtc-direct"],[277,0,"p2p-stardust"],[280,0,"webrtc"],[290,0,"p2p-circuit"],[301,0,"udt"],[302,0,"utp"],[400,oi,"unix",!1,!0],[421,oi,"ipfs"],[421,oi,"p2p"],[443,0,"https"],[444,96,"onion"],[445,296,"onion3"],[446,oi,"garlic64"],[460,0,"quic"],[465,0,"webtransport"],[466,oi,"certhash"],[477,0,"ws"],[478,0,"wss"],[479,0,"p2p-websocket-star"],[480,0,"http"],[777,oi,"memory"]].forEach((function(e){var t=ui.apply(void 0,Jr(e));si[t.code]=t,ai[t.name]=t}));var li=__webpack_require__(8705);function fi(e,t){t||(t=e.reduce((function(e,t){return e+t.length}),0));var r,n=Nr(t),i=0,o=$e(e);try{for(o.s();!(r=o.n()).done;){var a=r.value;n.set(a,i),i+=a.length}}catch(s){o.e(s)}finally{o.f()}return n}function hi(e,t){switch(ci(e).code){case 4:case 41:return function(e){var t=function(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2?arguments[2]:void 0;r=~~r,n=null!==(t=n)&&void 0!==t?t:e.length-r;var i=[],o="",a=new DataView(e.buffer);if(4===n){for(var s=0;s<n;s++)i.push(e[r+s]);o=i.join(".")}else if(16===n){for(var u=0;u<n;u+=2)i.push(a.getUint16(r+u).toString(16));o=(o=(o=i.join(":")).replace(/(^|:)0(:0)*:0(:|$)/,"$1::$3")).replace(/:{3,4}/,"::")}return o}(e,0,e.length);if(null==t)throw new Error("ipBuff is required");if(!$n(t))throw new Error('invalid ip address "'.concat(t,'"'));return t}(t);case 6:case 273:case 33:case 132:return mi(t).toString();case 53:case 54:case 55:case 56:case 400:case 777:return function(e){var t=li.decode(e);if((e=e.slice(li.decode.bytes)).length!==t)throw new Error("inconsistent lengths");return zr(e)}(t);case 421:return function(e){var t=li.decode(e),r=e.slice(li.decode.bytes);if(r.length!==t)throw new Error("inconsistent lengths");return zr(r,"base58btc")}(t);case 444:case 445:return bi(t);case 466:return function(e){var t=li.decode(e),r=e.slice(li.decode.bytes);if(r.length!==t)throw new Error("inconsistent lengths");return"u"+zr(r,"base64url")}(t);default:return zr(t,"base16")}}function di(e,t){switch(ci(e).code){case 4:case 41:return gi(t);case 6:case 273:case 33:case 132:return yi(parseInt(t,10));case 53:case 54:case 55:case 56:case 400:case 777:return function(e){var t=Fr(e),r=Uint8Array.from(li.encode(t.length));return fi([r,t],r.length+t.length)}(t);case 421:return function(e){var t;t="Q"===e[0]||"1"===e[0]?tr(Ct.decode("z".concat(e))).bytes:wr.parse(e).multihash.bytes;var r=Uint8Array.from(li.encode(t.length));return fi([r,t],r.length+t.length)}(t);case 444:return function(e){var t=e.split(":");if(2!==t.length)throw new Error("failed to parse onion addr: [\"'".concat(t.join('", "'),"'\"]' does not contain a port number"));if(16!==t[0].length)throw new Error("failed to parse onion addr: ".concat(t[0]," not a Tor onion address."));var r=yt.decode("b"+t[0]),n=parseInt(t[1],10);if(n<1||n>65536)throw new Error("Port number is not in range(1, 65536)");var i=yi(n);return fi([r,i],r.length+i.length)}(t);case 445:return function(e){var t=e.split(":");if(2!==t.length)throw new Error("failed to parse onion addr: [\"'".concat(t.join('", "'),"'\"]' does not contain a port number"));if(56!==t[0].length)throw new Error("failed to parse onion addr: ".concat(t[0]," not a Tor onion3 address."));var r=yt.decode("b".concat(t[0])),n=parseInt(t[1],10);if(n<1||n>65536)throw new Error("Port number is not in range(1, 65536)");var i=yi(n);return fi([r,i],r.length+i.length)}(t);case 466:return function(e){var t=vi.decode(e),r=Uint8Array.from(li.encode(t.length));return fi([r,t],r.length+t.length)}(t);default:return Fr(t,"base16")}}var pi=Object.values(Br).map((function(e){return e.decoder})),vi=function(){var e=pi[0].or(pi[1]);return pi.slice(2).forEach((function(t){return e=e.or(t)})),e}();function gi(e){if(!$n(e))throw new Error('invalid ip address "'.concat(e,'"'));return ii(e)}function yi(e){var t=new ArrayBuffer(2);return new DataView(t).setUint16(0,e),new Uint8Array(t)}function mi(e){return new DataView(e.buffer).getUint16(e.byteOffset)}function bi(e){var t=e.slice(0,e.length-2),r=e.slice(e.length-2),n=zr(t,"base32"),i=mi(r);return"".concat(n,":").concat(i)}var wi=__webpack_require__(5467),ki="Invalid record id",Ei=__webpack_require__(2989),xi=Ei.Reader;function Si(e,t){var r=xi.create(e instanceof Uint8Array?e:e.subarray());return t.decode(r)}["uint64","int64","sint64","fixed64","sfixed64"].forEach((function(e){var t=xi.prototype[e];xi.prototype[e]=function(){return BigInt(t.call(this).toString())}}));var _i,Ai,Ii,Ci,Ti,Pi=Ei.Writer;function Ri(e,t){var r=Pi.create();return t.encode(e,r,{lengthDelimited:!1}),r.finish()}function Bi(e,t,r,n){return{name:e,type:t,encode:r,decode:n}}function Mi(e){function t(t){if(null==e[t.toString()])throw new Error("Invalid enum value");return e[t]}return Bi("enum",_i.VARINT,(function(e,r){var n=t(e);r.int32(n)}),(function(e){return t(e.uint32())}))}function Ni(e,t){return Bi("message",_i.LENGTH_DELIMITED,e,t)}["uint64","int64","sint64","fixed64","sfixed64"].forEach((function(e){var t=Pi.prototype[e];Pi.prototype[e]=function(e){return t.call(this,e.toString())}})),function(e){e[e.VARINT=0]="VARINT",e[e.BIT64=1]="BIT64",e[e.LENGTH_DELIMITED=2]="LENGTH_DELIMITED",e[e.START_GROUP=3]="START_GROUP",e[e.END_GROUP=4]="END_GROUP",e[e.BIT32=5]="BIT32"}(_i||(_i={})),function(e){e.RSA="RSA",e.Ed25519="Ed25519",e.Secp256k1="Secp256k1"}(Ai||(Ai={})),function(e){e[e.RSA=0]="RSA",e[e.Ed25519=1]="Ed25519",e[e.Secp256k1=2]="Secp256k1"}(Ii||(Ii={})),function(e){e.codec=function(){return Mi(Ii)}}(Ai||(Ai={})),function(e){var t;e.codec=function(){return null==t&&(t=Ni((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!1!==r.lengthDelimited&&t.fork(),null==e.Type)throw new Error('Protocol error: required field "Type" was not found in object');if(t.uint32(8),Ai.codec().encode(e.Type,t),null==e.Data)throw new Error('Protocol error: required field "Data" was not found in object');t.uint32(18),t.bytes(e.Data),!1!==r.lengthDelimited&&t.ldelim()}),(function(e,t){for(var r={Type:Ai.RSA,Data:new Uint8Array(0)},n=null==t?e.len:e.pos+t;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.Type=Ai.codec().decode(e);break;case 2:r.Data=e.bytes();break;default:e.skipType(7&i)}}if(null==r.Type)throw new Error('Protocol error: value for required field "Type" was not found in protobuf');if(null==r.Data)throw new Error('Protocol error: value for required field "Data" was not found in protobuf');return r}))),t},e.encode=function(t){return Ri(t,e.codec())},e.decode=function(t){return Si(t,e.codec())}}(Ci||(Ci={})),function(e){var t;e.codec=function(){return null==t&&(t=Ni((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!1!==r.lengthDelimited&&t.fork(),null==e.Type)throw new Error('Protocol error: required field "Type" was not found in object');if(t.uint32(8),Ai.codec().encode(e.Type,t),null==e.Data)throw new Error('Protocol error: required field "Data" was not found in object');t.uint32(18),t.bytes(e.Data),!1!==r.lengthDelimited&&t.ldelim()}),(function(e,t){for(var r={Type:Ai.RSA,Data:new Uint8Array(0)},n=null==t?e.len:e.pos+t;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.Type=Ai.codec().decode(e);break;case 2:r.Data=e.bytes();break;default:e.skipType(7&i)}}if(null==r.Type)throw new Error('Protocol error: value for required field "Type" was not found in protobuf');if(null==r.Data)throw new Error('Protocol error: value for required field "Data" was not found in protobuf');return r}))),t},e.encode=function(t){return Ri(t,e.codec())},e.decode=function(t){return Si(t,e.codec())}}(Ti||(Ti={}));__webpack_require__(5406),__webpack_require__(4392);var Oi=__webpack_require__(3299),Di=__webpack_require__(5697),Li=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:globalThis,t=e.crypto;if(null==t||null==t.subtle)throw Object.assign(new Error("Missing Web Crypto API. The most likely cause of this error is that this page is being accessed from an insecure context (i.e. not HTTPS). For more information and possible resolutions see https://github.com/libp2p/js-libp2p-crypto/blob/master/README.md#web-crypto-api"),{code:"ERR_MISSING_WEB_CRYPTO"});return t};__webpack_require__(9327),__webpack_require__(8580);function Ui(e,t){var r=Uint8Array.from(e.abs().toByteArray());if(r=0===r[0]?r.slice(1):r,null!=t){if(r.length>t)throw new Error("byte array longer than desired length");r=fi([new Uint8Array(t-r.length),r])}return zr(r,"base64url")}function Fi(e){var t=function(e,t){var r=Fr(e,"base64urlpad");if(null!=t){if(r.length>t)throw new Error("byte array longer than desired length");r=fi([new Uint8Array(t-r.length),r])}return r}(e);return new Oi.jsbn.BigInteger(zr(t,"base16"),16)}var zi={"P-256":256,"P-384":384,"P-521":521};Object.keys(zi).join(" / ");function Zi(e){var t,r,n,i,o,a,s=null!==(t=null===e||void 0===e?void 0:e.algorithm)&&void 0!==t?t:"AES-GCM",u=null!==(r=null===e||void 0===e?void 0:e.keyLength)&&void 0!==r?r:16,c=null!==(n=null===e||void 0===e?void 0:e.nonceLength)&&void 0!==n?n:12,l=null!==(i=null===e||void 0===e?void 0:e.digest)&&void 0!==i?i:"SHA-256",f=null!==(o=null===e||void 0===e?void 0:e.saltLength)&&void 0!==o?o:16,h=null!==(a=null===e||void 0===e?void 0:e.iterations)&&void 0!==a?a:32767,d=Li();function p(){return(p=(0,E.Z)((0,k.Z)().mark((function e(t,r){var n,i,o,a,p,v,g;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=d.getRandomValues(new Uint8Array(f)),i=d.getRandomValues(new Uint8Array(c)),o={name:s,iv:i},"string"===typeof r&&(r=Fr(r)),a={name:"PBKDF2",salt:n,iterations:h,hash:{name:l}},e.next=7,d.subtle.importKey("raw",r,{name:"PBKDF2"},!1,["deriveKey","deriveBits"]);case 7:return p=e.sent,e.next=10,d.subtle.deriveKey(a,p,{name:s,length:u},!0,["encrypt"]);case 10:return v=e.sent,e.next=13,d.subtle.encrypt(o,v,t);case 13:return g=e.sent,e.abrupt("return",fi([n,o.iv,new Uint8Array(g)]));case 15:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function v(){return(v=(0,E.Z)((0,k.Z)().mark((function e(t,r){var n,i,o,a,p,v,g,y;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.slice(0,f),i=t.slice(f,f+c),o=t.slice(f+c),a={name:s,iv:i},"string"===typeof r&&(r=Fr(r)),p={name:"PBKDF2",salt:n,iterations:h,hash:{name:l}},e.next=8,d.subtle.importKey("raw",r,{name:"PBKDF2"},!1,["deriveKey","deriveBits"]);case 8:return v=e.sent,e.next=11,d.subtle.deriveKey(p,v,{name:s,length:u},!0,["decrypt"]);case 11:return g=e.sent,e.next=14,d.subtle.decrypt(a,g,o);case 14:return y=e.sent,e.abrupt("return",new Uint8Array(y));case 16:case"end":return e.stop()}}),e)})))).apply(this,arguments)}u*=8;var g={encrypt:function(e,t){return p.apply(this,arguments)},decrypt:function(e,t){return v.apply(this,arguments)}};return g}function ji(e,t){if(e===t)return!0;if(e.byteLength!==t.byteLength)return!1;for(var r=0;r<e.byteLength;r++)if(e[r]!==t[r])return!1;return!0}__webpack_require__(6237);function qi(e){if(isNaN(e)||e<=0)throw Di(new Error("random bytes length must be a Number bigger than 0"),"ERR_INVALID_LENGTH");return Je.randomBytes(e)}__webpack_require__(4199);function Ki(e){var t=Oi.asn1.fromDer(zr(e,"ascii")),r=Oi.pki.privateKeyFromAsn1(t);return{kty:"RSA",n:Ui(r.n),e:Ui(r.e),d:Ui(r.d),p:Ui(r.p),q:Ui(r.q),dp:Ui(r.dP),dq:Ui(r.dQ),qi:Ui(r.qInv),alg:"RS256"}}function Vi(e,t){return t.map((function(t){return Fi(e[t])}))}function Hi(e){return Gi.apply(this,arguments)}function Gi(){return Gi=(0,E.Z)((0,k.Z)().mark((function e(t){var r,n;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Li().subtle.generateKey({name:"RSASSA-PKCS1-v1_5",modulusLength:t,publicExponent:new Uint8Array([1,0,1]),hash:{name:"SHA-256"}},!0,["sign","verify"]);case 2:return r=e.sent,e.next=5,eo(r);case 5:return n=e.sent,e.abrupt("return",{privateKey:n[0],publicKey:n[1]});case 7:case"end":return e.stop()}}),e)}))),Gi.apply(this,arguments)}function Wi(e){return Qi.apply(this,arguments)}function Qi(){return Qi=(0,E.Z)((0,k.Z)().mark((function e(t){var r,n,i;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Li().subtle.importKey("jwk",t,{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!0,["sign"]);case 2:return r=e.sent,e.t0=r,e.next=6,ro(t);case 6:return e.t1=e.sent,n=[e.t0,e.t1],e.next=10,eo({privateKey:n[0],publicKey:n[1]});case 10:return i=e.sent,e.abrupt("return",{privateKey:i[0],publicKey:i[1]});case 12:case"end":return e.stop()}}),e)}))),Qi.apply(this,arguments)}function Ji(e,t){return Yi.apply(this,arguments)}function Yi(){return Yi=(0,E.Z)((0,k.Z)().mark((function e(t,r){var n,i;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Li().subtle.importKey("jwk",t,{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!1,["sign"]);case 2:return n=e.sent,e.next=5,Li().subtle.sign({name:"RSASSA-PKCS1-v1_5"},n,Uint8Array.from(r));case 5:return i=e.sent,e.abrupt("return",new Uint8Array(i,0,i.byteLength));case 7:case"end":return e.stop()}}),e)}))),Yi.apply(this,arguments)}function Xi(e,t,r){return $i.apply(this,arguments)}function $i(){return $i=(0,E.Z)((0,k.Z)().mark((function e(t,r,n){var i;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Li().subtle.importKey("jwk",t,{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!1,["verify"]);case 2:return i=e.sent,e.next=5,Li().subtle.verify({name:"RSASSA-PKCS1-v1_5"},i,r,n);case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e)}))),$i.apply(this,arguments)}function eo(e){return to.apply(this,arguments)}function to(){return(to=(0,E.Z)((0,k.Z)().mark((function e(t){return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=t.privateKey&&null!=t.publicKey){e.next=2;break}throw Di(new Error("Private and public key are required"),"ERR_INVALID_PARAMETERS");case 2:return e.next=4,Promise.all([Li().subtle.exportKey("jwk",t.privateKey),Li().subtle.exportKey("jwk",t.publicKey)]);case 4:return e.abrupt("return",e.sent);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ro(e){return no.apply(this,arguments)}function no(){return(no=(0,E.Z)((0,k.Z)().mark((function e(t){return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Li().subtle.importKey("jwk",{kty:t.kty,n:t.n,e:t.e},{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}},!0,["verify"]);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function io(e,t,r,n){var i=t?function(e){var t;return(t=Oi.pki).setRsaPublicKey.apply(t,Jr(Vi(e,["n","e"])))}(e):function(e){var t;return(t=Oi.pki).setRsaPrivateKey.apply(t,Jr(Vi(e,["n","e","d","p","q","dp","dq","qi"])))}(e);return Fr(n(zr(Uint8Array.from(r),"ascii"),i),"ascii")}function oo(e,t){return ao.apply(this,arguments)}function ao(){return(ao=(0,E.Z)((0,k.Z)().mark((function e(t,r){var n,i;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=Zi(),e.next=3,n.encrypt(t,r);case 3:return i=e.sent,e.abrupt("return",Pt.encode(i));case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var so=function(){function e(t){(0,D.Z)(this,e),this._key=t}return(0,O.Z)(e,[{key:"verify",value:function(){var e=(0,E.Z)((0,k.Z)().mark((function e(t,r){return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Xi(this._key,r,t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(t,r){return e.apply(this,arguments)}}()},{key:"marshal",value:function(){return function(e){if(null==e.n||null==e.e)throw Di(new Error("JWK was missing components"),"ERR_INVALID_PARAMETERS");var t=Oi.pki.publicKeyToAsn1({n:Fi(e.n),e:Fi(e.e)});return Fr(Oi.asn1.toDer(t).getBytes(),"ascii")}(this._key)}},{key:"bytes",get:function(){return Ci.encode({Type:Ai.RSA,Data:this.marshal()}).subarray()}},{key:"encrypt",value:function(e){return function(e,t){return io(e,!0,t,(function(e,t){return t.encrypt(e)}))}(this._key,e)}},{key:"equals",value:function(e){return ji(this.bytes,e.bytes)}},{key:"hash",value:function(){var e=(0,E.Z)((0,k.Z)().mark((function e(){var t,r;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ar.digest(this.bytes);case 2:return t=e.sent,r=t.bytes,e.abrupt("return",r);case 5:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()}]),e}(),uo=function(){function e(t,r){(0,D.Z)(this,e),this._key=t,this._publicKey=r}return(0,O.Z)(e,[{key:"genSecret",value:function(){return qi(16)}},{key:"sign",value:function(){var e=(0,E.Z)((0,k.Z)().mark((function e(t){return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ji(this._key,t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"public",get:function(){if(null==this._publicKey)throw Di(new Error("public key not provided"),"ERR_PUBKEY_NOT_PROVIDED");return new so(this._publicKey)}},{key:"decrypt",value:function(e){return function(e,t){return io(e,!1,t,(function(e,t){return t.decrypt(e)}))}(this._key,e)}},{key:"marshal",value:function(){return function(e){if(null==e.n||null==e.e||null==e.d||null==e.p||null==e.q||null==e.dp||null==e.dq||null==e.qi)throw Di(new Error("JWK was missing components"),"ERR_INVALID_PARAMETERS");var t=Oi.pki.privateKeyToAsn1({n:Fi(e.n),e:Fi(e.e),d:Fi(e.d),p:Fi(e.p),q:Fi(e.q),dP:Fi(e.dp),dQ:Fi(e.dq),qInv:Fi(e.qi)});return Fr(Oi.asn1.toDer(t).getBytes(),"ascii")}(this._key)}},{key:"bytes",get:function(){return Ti.encode({Type:Ai.RSA,Data:this.marshal()}).subarray()}},{key:"equals",value:function(e){return ji(this.bytes,e.bytes)}},{key:"hash",value:function(){var e=(0,E.Z)((0,k.Z)().mark((function e(){var t,r;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ar.digest(this.bytes);case 2:return t=e.sent,r=t.bytes,e.abrupt("return",r);case 5:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"id",value:function(){var e=(0,E.Z)((0,k.Z)().mark((function e(){var t;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.public.hash();case 2:return t=e.sent,e.abrupt("return",zr(t,"base58btc"));case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"export",value:function(){var e=(0,E.Z)((0,k.Z)().mark((function e(t){var r,n,i,o,a,s=arguments;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("pkcs-8"!==(r=s.length>1&&void 0!==s[1]?s[1]:"pkcs-8")){e.next=9;break}return n=new Oi.util.ByteBuffer(this.marshal()),i=Oi.asn1.fromDer(n),o=Oi.pki.privateKeyFromAsn1(i),a={algorithm:"aes256",count:1e4,saltSize:16,prfAlgorithm:"sha512"},e.abrupt("return",Oi.pki.encryptRsaPrivateKey(o,t,a));case 9:if("libp2p-key"!==r){e.next=15;break}return e.next=12,oo(this.bytes,t);case 12:return e.abrupt("return",e.sent);case 15:throw Di(new Error("export format '".concat(r,"' is not supported")),"ERR_INVALID_EXPORT_FORMAT");case 16:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()}]),e}();function co(e){return lo.apply(this,arguments)}function lo(){return(lo=(0,E.Z)((0,k.Z)().mark((function e(t){var r,n;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=Ki(t),e.next=3,Wi(r);case 3:return n=e.sent,e.abrupt("return",new uo(n.privateKey,n.publicKey));case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function fo(e){var t=function(e){var t=Oi.asn1.fromDer(zr(e,"ascii")),r=Oi.pki.publicKeyFromAsn1(t);return{kty:"RSA",n:Ui(r.n),e:Ui(r.e)}}(e);return new so(t)}function ho(e){return po.apply(this,arguments)}function po(){return(po=(0,E.Z)((0,k.Z)().mark((function e(t){var r;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Wi(t);case 2:return r=e.sent,e.abrupt("return",new uo(r.privateKey,r.publicKey));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function vo(e){return go.apply(this,arguments)}function go(){return go=(0,E.Z)((0,k.Z)().mark((function e(t){var r;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Hi(t);case 2:return r=e.sent,e.abrupt("return",new uo(r.privateKey,r.publicKey));case 4:case"end":return e.stop()}}),e)}))),go.apply(this,arguments)}var yo=__webpack_require__(9572),mo=__webpack_require__.t(yo,2),bo=BigInt(0),wo=BigInt(1),ko=BigInt(2),Eo=BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),xo=Object.freeze({a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),P:BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),l:Eo,n:Eo,h:BigInt(8),Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960")}),So=BigInt("0x10000000000000000000000000000000000000000000000000000000000000000"),_o=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752"),Ao=(BigInt("6853475219497561581579357271197624642482790079785650197046958215289687604742"),BigInt("25063068953384623474111414158702152701244531502492656460079210482610430750235")),Io=BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578"),Co=BigInt("1159843021668779879193775521855586647937357759715417654439879720876111806838"),To=BigInt("40440834346308536858101042469323190826248399146238708352240133220865137265952"),Po=function(){function e(t,r,n,i){(0,D.Z)(this,e),this.x=t,this.y=r,this.z=n,this.t=i}return(0,O.Z)(e,[{key:"equals",value:function(e){Ro(e);var t=this.x,r=this.y,n=this.z,i=e.x,o=e.y,a=e.z,s=Qo(t*a),u=Qo(i*n),c=Qo(r*a),l=Qo(o*n);return s===u&&c===l}},{key:"negate",value:function(){return new e(Qo(-this.x),this.y,this.z,Qo(-this.t))}},{key:"double",value:function(){var t=this.x,r=this.y,n=this.z,i=xo.a,o=Qo(t*t),a=Qo(r*r),s=Qo(ko*Qo(n*n)),u=Qo(i*o),c=t+r,l=Qo(Qo(c*c)-o-a),f=u+a,h=f-s,d=u-a,p=Qo(l*h),v=Qo(f*d),g=Qo(l*d);return new e(p,v,Qo(h*f),g)}},{key:"add",value:function(t){Ro(t);var r=this.x,n=this.y,i=this.z,o=this.t,a=t.x,s=t.y,u=t.z,c=t.t,l=Qo((n-r)*(s+a)),f=Qo((n+r)*(s-a)),h=Qo(f-l);if(h===bo)return this.double();var d=Qo(i*ko*c),p=Qo(o*ko*u),v=p+d,g=f+l,y=p-d,m=Qo(v*h),b=Qo(g*y),w=Qo(v*y);return new e(m,b,Qo(h*g),w)}},{key:"subtract",value:function(e){return this.add(e.negate())}},{key:"precomputeWindow",value:function(e){for(var t=1+256/e,r=[],n=this,i=n,o=0;o<t;o++){i=n,r.push(i);for(var a=1;a<Math.pow(2,e-1);a++)i=i.add(n),r.push(i);n=i.double()}return r}},{key:"wNAF",value:function(t,r){!r&&this.equals(e.BASE)&&(r=Do.BASE);var n=r&&r._WINDOW_SIZE||1;if(256%n)throw new Error("Point#wNAF: Invalid precomputation window, must be power of 2");var i=r&&Oo.get(r);i||(i=this.precomputeWindow(n),r&&1!==n&&(i=e.normalizeZ(i),Oo.set(r,i)));for(var o=e.ZERO,a=e.ZERO,s=1+256/n,u=Math.pow(2,n-1),c=BigInt(Math.pow(2,n)-1),l=Math.pow(2,n),f=BigInt(n),h=0;h<s;h++){var d=h*u,p=Number(t&c);if(t>>=f,p>u&&(p-=l,t+=wo),0===p){var v=i[d];h%2&&(v=v.negate()),a=a.add(v)}else{var g=i[d+Math.abs(p)-1];p<0&&(g=g.negate()),o=o.add(g)}}return e.normalizeZ([o,a])[0]}},{key:"multiply",value:function(e,t){return this.wNAF(na(e,xo.l),t)}},{key:"multiplyUnsafe",value:function(t){var r=na(t,xo.l,!1),n=e.BASE,i=e.ZERO;if(r===bo)return i;if(this.equals(i)||r===wo)return this;if(this.equals(n))return this.wNAF(r);for(var o=i,a=this;r>bo;)r&wo&&(o=o.add(a)),a=a.double(),r>>=wo;return o}},{key:"isSmallOrder",value:function(){return this.multiplyUnsafe(xo.h).equals(e.ZERO)}},{key:"isTorsionFree",value:function(){return this.multiplyUnsafe(xo.l).equals(e.ZERO)}},{key:"toAffine",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Jo(this.z),t=this.x,r=this.y,n=this.z,i=Qo(t*e),o=Qo(r*e),a=Qo(n*e);if(a!==wo)throw new Error("invZ was invalid");return new Do(i,o)}},{key:"fromRistrettoBytes",value:function(){Mo()}},{key:"toRistrettoBytes",value:function(){Mo()}},{key:"fromRistrettoHash",value:function(){Mo()}}],[{key:"fromAffine",value:function(t){if(!(t instanceof Do))throw new TypeError("ExtendedPoint#fromAffine: expected Point");return t.equals(Do.ZERO)?e.ZERO:new e(t.x,t.y,wo,Qo(t.x*t.y))}},{key:"toAffineBatch",value:function(e){var t=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:xo.P,r=new Array(e.length),n=e.reduce((function(e,n,i){return n===bo?e:(r[i]=e,Qo(e*n,t))}),wo),i=Jo(n,t);return e.reduceRight((function(e,n,i){return n===bo?e:(r[i]=Qo(e*r[i],t),Qo(e*n,t))}),i),r}(e.map((function(e){return e.z})));return e.map((function(e,r){return e.toAffine(t[r])}))}},{key:"normalizeZ",value:function(e){return this.toAffineBatch(e).map(this.fromAffine)}}]),e}();function Ro(e){if(!(e instanceof Po))throw new TypeError("ExtendedPoint expected")}function Bo(e){if(!(e instanceof No))throw new TypeError("RistrettoPoint expected")}function Mo(){throw new Error("Legacy method: switch to RistrettoPoint")}Po.BASE=new Po(xo.Gx,xo.Gy,wo,Qo(xo.Gx*xo.Gy)),Po.ZERO=new Po(bo,wo,wo,bo);var No=function(){function e(t){(0,D.Z)(this,e),this.ep=t}return(0,O.Z)(e,[{key:"toRawBytes",value:function(){var e,t=this.ep,r=t.x,n=t.y,i=t.z,o=t.t,a=Qo(Qo(i+n)*Qo(i-n)),s=Qo(r*n),u=Qo(s*s),c=ea(Qo(a*u)).value,l=Qo(c*a),f=Qo(c*s),h=Qo(l*f*o);if(Ko(o*h)){var d=Qo(n*_o),p=Qo(r*_o);r=d,n=p,e=Qo(l*Io)}else e=f;Ko(r*h)&&(n=Qo(-n));var v=Qo((i-n)*e);return Ko(v)&&(v=Qo(-v)),qo(v)}},{key:"toHex",value:function(){return zo(this.toRawBytes())}},{key:"toString",value:function(){return this.toHex()}},{key:"equals",value:function(e){Bo(e);var t=this.ep,r=e.ep,n=Qo(t.x*r.y)===Qo(t.y*r.x),i=Qo(t.y*r.y)===Qo(t.x*r.x);return n||i}},{key:"add",value:function(t){return Bo(t),new e(this.ep.add(t.ep))}},{key:"subtract",value:function(t){return Bo(t),new e(this.ep.subtract(t.ep))}},{key:"multiply",value:function(t){return new e(this.ep.multiply(t))}},{key:"multiplyUnsafe",value:function(t){return new e(this.ep.multiplyUnsafe(t))}}],[{key:"calcElligatorRistrettoMap",value:function(e){var t=xo.d,r=Qo(_o*e*e),n=Qo((r+wo)*Co),i=BigInt(-1),o=Qo((i-t*r)*Qo(r+t)),a=$o(n,o),s=a.isValid,u=a.value,c=Qo(u*e);Ko(c)||(c=Qo(-c)),s||(u=c),s||(i=r);var l=Qo(i*(r-wo)*To-o),f=u*u,h=Qo((u+u)*o),d=Qo(l*Ao),p=Qo(wo-f),v=Qo(wo+f);return new Po(Qo(h*v),Qo(p*d),Qo(d*v),Qo(h*p))}},{key:"hashToCurve",value:function(t){var r=Wo((t=ra(t,64)).slice(0,32)),n=this.calcElligatorRistrettoMap(r),i=Wo(t.slice(32,64)),o=this.calcElligatorRistrettoMap(i);return new e(n.add(o))}},{key:"fromHex",value:function(t){t=ra(t,32);var r=xo.a,n=xo.d,i="RistrettoPoint.fromHex: the hex is not valid encoding of RistrettoPoint",o=Wo(t);if(!function(e,t){if(e.length!==t.length)return!1;for(var r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}(qo(o),t)||Ko(o))throw new Error(i);var a=Qo(o*o),s=Qo(wo+r*a),u=Qo(wo-r*a),c=Qo(s*s),l=Qo(u*u),f=Qo(r*n*c-l),h=ea(Qo(f*l)),d=h.isValid,p=h.value,v=Qo(p*u),g=Qo(p*v*f),y=Qo((o+o)*v);Ko(y)&&(y=Qo(-y));var m=Qo(s*g),b=Qo(y*m);if(!d||Ko(b)||m===bo)throw new Error(i);return new e(new Po(y,m,wo,b))}}]),e}();No.BASE=new No(Po.BASE),No.ZERO=new No(Po.ZERO);var Oo=new WeakMap,Do=function(){function e(t,r){(0,D.Z)(this,e),this.x=t,this.y=r}return(0,O.Z)(e,[{key:"_setWindowSize",value:function(e){this._WINDOW_SIZE=e,Oo.delete(this)}},{key:"toRawBytes",value:function(){var e=qo(this.y);return e[31]|=this.x&wo?128:0,e}},{key:"toHex",value:function(){return zo(this.toRawBytes())}},{key:"toX25519",value:function(){var e=this.y;return qo(Qo((wo+e)*Jo(wo-e)))}},{key:"isTorsionFree",value:function(){return Po.fromAffine(this).isTorsionFree()}},{key:"equals",value:function(e){return this.x===e.x&&this.y===e.y}},{key:"negate",value:function(){return new e(Qo(-this.x),this.y)}},{key:"add",value:function(e){return Po.fromAffine(this).add(Po.fromAffine(e)).toAffine()}},{key:"subtract",value:function(e){return this.add(e.negate())}},{key:"multiply",value:function(e){return Po.fromAffine(this).multiply(e,this).toAffine()}}],[{key:"fromHex",value:function(t){var r=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=xo.d,i=xo.P,o=(t=ra(t,32)).slice();o[31]=-129&t[31];var a=Vo(o);if(r&&a>=i)throw new Error("Expected 0 < hex < P");if(!r&&a>=So)throw new Error("Expected 0 < hex < 2**256");var s=Qo(a*a),u=Qo(s-wo),c=Qo(n*s+wo),l=$o(u,c),f=l.isValid,h=l.value;if(!f)throw new Error("Point.fromHex: invalid y coordinate");var d=(h&wo)===wo,p=0!==(128&t[31]);return p!==d&&(h=Qo(-h)),new e(h,a)}},{key:"fromPrivateKey",value:function(){var e=(0,E.Z)((0,k.Z)().mark((function e(t){return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,sa(t);case 2:return e.abrupt("return",e.sent.point);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()}]),e}();Do.BASE=new Do(xo.Gx,xo.Gy),Do.ZERO=new Do(bo,wo);var Lo=function(){function e(t,r){(0,D.Z)(this,e),this.r=t,this.s=r,this.assertValidity()}return(0,O.Z)(e,[{key:"assertValidity",value:function(){var e=this.r,t=this.s;if(!(e instanceof Do))throw new Error("Expected Point instance");return na(t,xo.l,!1),this}},{key:"toRawBytes",value:function(){var e=new Uint8Array(64);return e.set(this.r.toRawBytes()),e.set(qo(this.s),32),e}},{key:"toHex",value:function(){return zo(this.toRawBytes())}}],[{key:"fromHex",value:function(t){var r=ra(t,64);return new e(Do.fromHex(r.slice(0,32),!1),Vo(r.slice(32,64)))}}]),e}();function Uo(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];if(!t.every((function(e){return e instanceof Uint8Array})))throw new Error("Expected Uint8Array list");if(1===t.length)return t[0];for(var n=t.reduce((function(e,t){return e+t.length}),0),i=new Uint8Array(n),o=0,a=0;o<t.length;o++){var s=t[o];i.set(s,a),a+=s.length}return i}var Fo=Array.from({length:256},(function(e,t){return t.toString(16).padStart(2,"0")}));function zo(e){if(!(e instanceof Uint8Array))throw new Error("Uint8Array expected");for(var t="",r=0;r<e.length;r++)t+=Fo[e[r]];return t}function Zo(e){if("string"!==typeof e)throw new TypeError("hexToBytes: expected string, got "+typeof e);if(e.length%2)throw new Error("hexToBytes: received invalid unpadded hex");for(var t=new Uint8Array(e.length/2),r=0;r<t.length;r++){var n=2*r,i=e.slice(n,n+2),o=Number.parseInt(i,16);if(Number.isNaN(o)||o<0)throw new Error("Invalid byte sequence");t[r]=o}return t}function jo(e){return Zo(e.toString(16).padStart(64,"0"))}function qo(e){return jo(e).reverse()}function Ko(e){return(Qo(e)&wo)===wo}function Vo(e){if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array");return BigInt("0x"+zo(Uint8Array.from(e).reverse()))}var Ho,Go=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function Wo(e){return Qo(Vo(e)&Go)}function Qo(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:xo.P,r=e%t;return r>=bo?r:t+r}function Jo(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:xo.P;if(e===bo||t<=bo)throw new Error("invert: expected positive integers, got n=".concat(e," mod=").concat(t));for(var r=Qo(e,t),n=t,i=bo,o=wo,a=wo,s=bo;r!==bo;){var u=n/r,c=n%r,l=i-a*u,f=o-s*u;n=r,r=c,i=a,o=s,a=l,s=f}var h=n;if(h!==wo)throw new Error("invert: does not exist");return Qo(i,t)}function Yo(e,t){for(var r=xo.P,n=e;t-- >bo;)n*=n,n%=r;return n}function Xo(e){var t=xo.P,r=BigInt(5),n=BigInt(10),i=BigInt(20),o=BigInt(40),a=BigInt(80),s=e*e%t*e%t,u=Yo(s,ko)*s%t,c=Yo(u,wo)*e%t,l=Yo(c,r)*c%t,f=Yo(l,n)*l%t,h=Yo(f,i)*f%t,d=Yo(h,o)*h%t,p=Yo(d,a)*d%t,v=Yo(p,a)*d%t,g=Yo(v,n)*l%t;return{pow_p_5_8:Yo(g,ko)*e%t,b2:s}}function $o(e,t){var r=Qo(t*t*t),n=Qo(r*r*t),i=Qo(e*r*Xo(e*n).pow_p_5_8),o=Qo(t*i*i),a=i,s=Qo(i*_o),u=o===e,c=o===Qo(-e),l=o===Qo(-e*_o);return u&&(i=a),(c||l)&&(i=s),Ko(i)&&(i=Qo(-i)),{isValid:u||c,value:i}}function ea(e){return $o(wo,e)}function ta(e){return Qo(Vo(e),xo.l)}function ra(e,t){var r=e instanceof Uint8Array?Uint8Array.from(e):Zo(e);if("number"===typeof t&&r.length!==t)throw new Error("Expected ".concat(t," bytes"));return r}function na(e,t){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(!t)throw new TypeError("Specify max value");if("number"===typeof e&&Number.isSafeInteger(e)&&(e=BigInt(e)),"bigint"===typeof e&&e<t)if(r){if(bo<e)return e}else if(bo<=e)return e;throw new TypeError("Expected valid scalar: 0 < scalar < max")}function ia(e){return e[0]&=248,e[31]&=127,e[31]|=64,e}function oa(e){if(32!==(e="bigint"===typeof e||"number"===typeof e?jo(na(e,So)):ra(e)).length)throw new Error("Expected 32 bytes");return e}function aa(e){var t=ia(e.slice(0,32)),r=e.slice(32,64),n=ta(t),i=Do.BASE.multiply(n),o=i.toRawBytes();return{head:t,prefix:r,scalar:n,point:i,pointBytes:o}}function sa(e){return ua.apply(this,arguments)}function ua(){return ua=(0,E.Z)((0,k.Z)().mark((function e(t){return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=aa,e.next=3,ma.sha512(oa(t));case 3:return e.t1=e.sent,e.abrupt("return",(0,e.t0)(e.t1));case 5:case"end":return e.stop()}}),e)}))),ua.apply(this,arguments)}function ca(e){return la.apply(this,arguments)}function la(){return(la=(0,E.Z)((0,k.Z)().mark((function e(t){return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,sa(t);case 2:return e.abrupt("return",e.sent.pointBytes);case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function fa(e,t){return ha.apply(this,arguments)}function ha(){return ha=(0,E.Z)((0,k.Z)().mark((function e(t,r){var n,i,o,a,s,u,c,l;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=ra(t),e.next=3,sa(r);case 3:return n=e.sent,i=n.prefix,o=n.scalar,a=n.pointBytes,e.t0=ta,e.next=10,ma.sha512(i,t);case 10:return e.t1=e.sent,s=(0,e.t0)(e.t1),u=Do.BASE.multiply(s),e.t2=ta,e.next=16,ma.sha512(u.toRawBytes(),a,t);case 16:return e.t3=e.sent,c=(0,e.t2)(e.t3),l=Qo(s+c*o,xo.l),e.abrupt("return",new Lo(u,l).toRawBytes());case 20:case"end":return e.stop()}}),e)}))),ha.apply(this,arguments)}function da(e,t,r){t=ra(t),r instanceof Do||(r=Do.fromHex(r,!1));var n=e instanceof Lo?e.assertValidity():Lo.fromHex(e),i=n.r,o=n.s;return{r:i,s:o,SB:Po.BASE.multiplyUnsafe(o),pub:r,msg:t}}function pa(e,t,r,n){var i=ta(n),o=Po.fromAffine(e).multiplyUnsafe(i);return Po.fromAffine(t).add(o).subtract(r).multiplyUnsafe(xo.h).equals(Po.ZERO)}function va(e,t,r){return ga.apply(this,arguments)}function ga(){return ga=(0,E.Z)((0,k.Z)().mark((function e(t,r,n){var i,o,a,s,u,c;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=da(t,r,n),o=i.r,a=i.SB,s=i.msg,u=i.pub,e.next=3,ma.sha512(o.toRawBytes(),u.toRawBytes(),s);case 3:return c=e.sent,e.abrupt("return",pa(u,o,a,c));case 5:case"end":return e.stop()}}),e)}))),ga.apply(this,arguments)}Do.BASE._setWindowSize(8);var ya={node:mo,web:"object"===typeof self&&"crypto"in self?self.crypto:void 0},ma={bytesToHex:zo,hexToBytes:Zo,concatBytes:Uo,getExtendedPublicKey:sa,mod:Qo,invert:Jo,TORSION_SUBGROUP:["0100000000000000000000000000000000000000000000000000000000000000","c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac037a","0000000000000000000000000000000000000000000000000000000000000080","26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc05","ecffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f","26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc85","0000000000000000000000000000000000000000000000000000000000000000","c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac03fa"],hashToPrivateScalar:function(e){if((e=ra(e)).length<40||e.length>1024)throw new Error("Expected 40-1024 bytes of private key as per FIPS 186");return Qo(Vo(e),xo.l-wo)+wo},randomBytes:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:32;if(ya.web)return ya.web.getRandomValues(new Uint8Array(e));if(ya.node){var t=ya.node.randomBytes;return new Uint8Array(t(e).buffer)}throw new Error("The environment doesn't have randomBytes function")},randomPrivateKey:function(){return ma.randomBytes(32)},sha512:function(){var e=(0,E.Z)((0,k.Z)().mark((function e(){var t,r,n=arguments;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=Uo.apply(void 0,n),!ya.web){e.next=8;break}return e.next=4,ya.web.subtle.digest("SHA-512",t.buffer);case 4:return r=e.sent,e.abrupt("return",new Uint8Array(r));case 8:if(!ya.node){e.next=12;break}return e.abrupt("return",Uint8Array.from(ya.node.createHash("sha512").update(t).digest()));case 12:throw new Error("The environment doesn't have sha512 function");case 13:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),precompute:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Do.BASE,r=t.equals(Do.BASE)?t:new Do(t.x,t.y);return r._setWindowSize(e),r.multiply(ko),r},sha512Sync:void 0};Object.defineProperties(ma,{sha512Sync:{configurable:!1,get:function(){return Ho},set:function(e){Ho||(Ho=e)}}});var ba=64,wa=32;function ka(){return Ea.apply(this,arguments)}function Ea(){return(Ea=(0,E.Z)((0,k.Z)().mark((function e(){var t,r,n;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=ma.randomPrivateKey(),e.next=3,ca(t);case 3:return r=e.sent,n=Ta(t,r),e.abrupt("return",{privateKey:n,publicKey:r});case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function xa(e){return Sa.apply(this,arguments)}function Sa(){return(Sa=(0,E.Z)((0,k.Z)().mark((function e(t){var r,n,i;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.length===wa){e.next=4;break}throw new TypeError('"seed" must be 32 bytes in length.');case 4:if(t instanceof Uint8Array){e.next=6;break}throw new TypeError('"seed" must be a node.js Buffer, or Uint8Array.');case 6:return r=t,e.next=9,ca(r);case 9:return n=e.sent,i=Ta(r,n),e.abrupt("return",{privateKey:i,publicKey:n});case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function _a(e,t){return Aa.apply(this,arguments)}function Aa(){return(Aa=(0,E.Z)((0,k.Z)().mark((function e(t,r){var n;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.slice(0,wa),e.next=3,fa(r,n);case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ia(e,t,r){return Ca.apply(this,arguments)}function Ca(){return(Ca=(0,E.Z)((0,k.Z)().mark((function e(t,r,n){return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,va(r,n,t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ta(e,t){for(var r=new Uint8Array(ba),n=0;n<wa;n++)r[n]=e[n],r[wa+n]=t[n];return r}var Pa=function(){function e(t){(0,D.Z)(this,e),this._key=Ua(t,32)}return(0,O.Z)(e,[{key:"verify",value:function(){var e=(0,E.Z)((0,k.Z)().mark((function e(t,r){return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Ia(this._key,r,t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(t,r){return e.apply(this,arguments)}}()},{key:"marshal",value:function(){return this._key}},{key:"bytes",get:function(){return Ci.encode({Type:Ai.Ed25519,Data:this.marshal()}).subarray()}},{key:"equals",value:function(e){return ji(this.bytes,e.bytes)}},{key:"hash",value:function(){var e=(0,E.Z)((0,k.Z)().mark((function e(){var t,r;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ar.digest(this.bytes);case 2:return t=e.sent,r=t.bytes,e.abrupt("return",r);case 5:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()}]),e}(),Ra=function(){function e(t,r){(0,D.Z)(this,e),this._key=Ua(t,ba),this._publicKey=Ua(r,32)}return(0,O.Z)(e,[{key:"sign",value:function(){var e=(0,E.Z)((0,k.Z)().mark((function e(t){return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,_a(this._key,t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"public",get:function(){return new Pa(this._publicKey)}},{key:"marshal",value:function(){return this._key}},{key:"bytes",get:function(){return Ti.encode({Type:Ai.Ed25519,Data:this.marshal()}).subarray()}},{key:"equals",value:function(e){return ji(this.bytes,e.bytes)}},{key:"hash",value:function(){var e=(0,E.Z)((0,k.Z)().mark((function e(){var t,r;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ar.digest(this.bytes);case 2:return t=e.sent,r=t.bytes,e.abrupt("return",r);case 5:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"id",value:function(){var e=(0,E.Z)((0,k.Z)().mark((function e(){var t;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,cr.digest(this.public.bytes);case 2:return t=e.sent,e.abrupt("return",Ct.encode(t.bytes).substring(1));case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"export",value:function(){var e=(0,E.Z)((0,k.Z)().mark((function e(t){var r,n=arguments;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("libp2p-key"!==(r=n.length>1&&void 0!==n[1]?n[1]:"libp2p-key")){e.next=7;break}return e.next=4,oo(this.bytes,t);case 4:return e.abrupt("return",e.sent);case 7:throw Di(new Error("export format '".concat(r,"' is not supported")),"ERR_INVALID_EXPORT_FORMAT");case 8:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()}]),e}();function Ba(e){if(e.length>ba){var t=(e=Ua(e,96)).slice(0,ba),r=e.slice(ba,e.length);return new Ra(t,r)}var n=(e=Ua(e,ba)).slice(0,ba),i=e.slice(32);return new Ra(n,i)}function Ma(e){return e=Ua(e,32),new Pa(e)}function Na(){return Oa.apply(this,arguments)}function Oa(){return(Oa=(0,E.Z)((0,k.Z)().mark((function e(){var t,r,n;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ka();case 2:return t=e.sent,r=t.privateKey,n=t.publicKey,e.abrupt("return",new Ra(r,n));case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Da(e){return La.apply(this,arguments)}function La(){return(La=(0,E.Z)((0,k.Z)().mark((function e(t){var r,n,i;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,xa(t);case 2:return r=e.sent,n=r.privateKey,i=r.publicKey,e.abrupt("return",new Ra(n,i));case 6:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Ua(e,t){var r;if((e=Uint8Array.from(null!==(r=e)&&void 0!==r?r:[])).length!==t)throw Di(new Error("Key must be a Uint8Array of length ".concat(t,", got ").concat(e.length)),"ERR_INVALID_KEY_TYPE");return e}function Fa(){return Je.randomPrivateKey()}function za(e,t){return Za.apply(this,arguments)}function Za(){return Za=(0,E.Z)((0,k.Z)().mark((function e(t,r){var n,i;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ar.digest(r);case 2:return n=e.sent,i=n.digest,e.prev=4,e.next=7,Ke(i,t);case 7:return e.abrupt("return",e.sent);case 10:throw e.prev=10,e.t0=e.catch(4),Di(e.t0,"ERR_INVALID_INPUT");case 13:case"end":return e.stop()}}),e,null,[[4,10]])}))),Za.apply(this,arguments)}function ja(e,t,r){return qa.apply(this,arguments)}function qa(){return qa=(0,E.Z)((0,k.Z)().mark((function e(t,r,n){var i,o;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,ar.digest(n);case 3:return i=e.sent,o=i.digest,e.abrupt("return",Ge(r,o,t));case 8:throw e.prev=8,e.t0=e.catch(0),Di(e.t0,"ERR_INVALID_INPUT");case 11:case"end":return e.stop()}}),e,null,[[0,8]])}))),qa.apply(this,arguments)}function Ka(e){try{ae.fromHex(e)}catch(t){throw Di(t,"ERR_INVALID_PUBLIC_KEY")}}var Va=function(){function e(t){(0,D.Z)(this,e),Ka(t),this._key=t}return(0,O.Z)(e,[{key:"verify",value:function(){var e=(0,E.Z)((0,k.Z)().mark((function e(t,r){return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ja(this._key,r,t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(t,r){return e.apply(this,arguments)}}()},{key:"marshal",value:function(){return function(e){return ae.fromHex(e).toRawBytes(!0)}(this._key)}},{key:"bytes",get:function(){return Ci.encode({Type:Ai.Secp256k1,Data:this.marshal()}).subarray()}},{key:"equals",value:function(e){return ji(this.bytes,e.bytes)}},{key:"hash",value:function(){var e=(0,E.Z)((0,k.Z)().mark((function e(){var t,r;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ar.digest(this.bytes);case 2:return t=e.sent,r=t.bytes,e.abrupt("return",r);case 5:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()}]),e}(),Ha=function(){function e(t,r){(0,D.Z)(this,e),this._key=t,this._publicKey=null!==r&&void 0!==r?r:function(e){try{return Ue(e,!0)}catch(t){throw Di(t,"ERR_INVALID_PRIVATE_KEY")}}(t),function(e){try{Ue(e,!0)}catch(t){throw Di(t,"ERR_INVALID_PRIVATE_KEY")}}(this._key),Ka(this._publicKey)}return(0,O.Z)(e,[{key:"sign",value:function(){var e=(0,E.Z)((0,k.Z)().mark((function e(t){return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,za(this._key,t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"public",get:function(){return new Va(this._publicKey)}},{key:"marshal",value:function(){return this._key}},{key:"bytes",get:function(){return Ti.encode({Type:Ai.Secp256k1,Data:this.marshal()}).subarray()}},{key:"equals",value:function(e){return ji(this.bytes,e.bytes)}},{key:"hash",value:function(){var e=(0,E.Z)((0,k.Z)().mark((function e(){var t,r;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ar.digest(this.bytes);case 2:return t=e.sent,r=t.bytes,e.abrupt("return",r);case 5:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"id",value:function(){var e=(0,E.Z)((0,k.Z)().mark((function e(){var t;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.public.hash();case 2:return t=e.sent,e.abrupt("return",zr(t,"base58btc"));case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"export",value:function(){var e=(0,E.Z)((0,k.Z)().mark((function e(t){var r,n=arguments;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("libp2p-key"!==(r=n.length>1&&void 0!==n[1]?n[1]:"libp2p-key")){e.next=7;break}return e.next=4,oo(this.bytes,t);case 4:return e.abrupt("return",e.sent);case 7:throw Di(new Error("export format '".concat(r,"' is not supported")),"ERR_INVALID_EXPORT_FORMAT");case 8:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()}]),e}();function Ga(e){return new Ha(e)}function Wa(e){return new Va(e)}function Qa(){return Ja.apply(this,arguments)}function Ja(){return(Ja=(0,E.Z)((0,k.Z)().mark((function e(){var t;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Fa();case 2:return t=e.sent,e.abrupt("return",new Ha(t));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var Ya={rsa:v,ed25519:g,secp256k1:y};function Xa(e){var t=Object.keys(Ya).join(" / ");return Di(new Error("invalid or unsupported key type ".concat(e,". Must be ").concat(t)),"ERR_UNSUPPORTED_KEY_TYPE")}function $a(e){if("rsa"===(e=e.toLowerCase())||"ed25519"===e||"secp256k1"===e)return Ya[e];throw Xa(e)}function es(e){var t=Ci.decode(e),r=t.Data;switch(t.Type){case Ai.RSA:return Ya.rsa.unmarshalRsaPublicKey(r);case Ai.Ed25519:return Ya.ed25519.unmarshalEd25519PublicKey(r);case Ai.Secp256k1:return Ya.secp256k1.unmarshalSecp256k1PublicKey(r);default:throw Xa(t.Type)}}function ts(e,t){var r;return $a(t=(null!==(r=t)&&void 0!==r?r:"rsa").toLowerCase()),e.bytes}function rs(e){return ns.apply(this,arguments)}function ns(){return(ns=(0,E.Z)((0,k.Z)().mark((function e(t){var r,n;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=Ti.decode(t),n=r.Data,e.t0=r.Type,e.next=e.t0===Ai.RSA?5:e.t0===Ai.Ed25519?8:e.t0===Ai.Secp256k1?9:10;break;case 5:return e.next=7,Ya.rsa.unmarshalRsaPrivateKey(n);case 7:return e.abrupt("return",e.sent);case 8:return e.abrupt("return",Ya.ed25519.unmarshalEd25519PrivateKey(n));case 9:return e.abrupt("return",Ya.secp256k1.unmarshalSecp256k1PrivateKey(n));case 10:throw Xa(r.Type);case 11:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var is=Symbol.for("@libp2p/peer-id");var os,as=Object.values(Br).map((function(e){return e.decoder})).reduce((function(e,t){return e.or(t)}),Br.identity.decoder),ss=function(e){function t(e){(0,D.Z)(this,t),this.type=e.type,this.multihash=e.multihash,this.privateKey=e.privateKey,Object.defineProperty(this,"string",{enumerable:!1,writable:!0})}return(0,O.Z)(t,[{key:e,get:function(){return"PeerId(".concat(this.toString(),")")}},{key:is,get:function(){return!0}},{key:"toString",value:function(){return null==this.string&&(this.string=Ct.encode(this.multihash.bytes).slice(1)),this.string}},{key:"toCID",value:function(){return wr.createV1(114,this.multihash)}},{key:"toBytes",value:function(){return this.multihash.bytes}},{key:"toJSON",value:function(){return this.toString()}},{key:"equals",value:function(e){var t;if(e instanceof Uint8Array)return ji(this.multihash.bytes,e);if("string"===typeof e)return fs(e).equals(this);if(null!=(null===e||void 0===e||null===(t=e.multihash)||void 0===t?void 0:t.bytes))return ji(this.multihash.bytes,e.multihash.bytes);throw new Error("not valid Id")}}]),t}(Symbol.toStringTag),us=function(e){U(r,e);var t=K(r);function r(e){var n;return(0,D.Z)(this,r),(n=t.call(this,N(N({},e),{},{type:"RSA"}))).type="RSA",n.publicKey=e.publicKey,n}return(0,O.Z)(r)}(ss),cs=function(e){U(r,e);var t=K(r);function r(e){var n;return(0,D.Z)(this,r),(n=t.call(this,N(N({},e),{},{type:"Ed25519"}))).type="Ed25519",n.publicKey=e.multihash.digest,n}return(0,O.Z)(r)}(ss),ls=function(e){U(r,e);var t=K(r);function r(e){var n;return(0,D.Z)(this,r),(n=t.call(this,N(N({},e),{},{type:"secp256k1"}))).type="secp256k1",n.publicKey=e.multihash.digest,n}return(0,O.Z)(r)}(ss);function fs(e,t){var r;if(t=null!==(r=t)&&void 0!==r?r:as,"1"===e.charAt(0)||"Q"===e.charAt(0)){var n=tr(Ct.decode("z".concat(e)));return e.startsWith("12D")?new cs({multihash:n}):e.startsWith("16U")?new ls({multihash:n}):new us({multihash:n})}return hs(as.decode(e))}function hs(e){try{var t=tr(e);if(t.code===cr.code){if(36===t.digest.length)return new cs({multihash:t});if(37===t.digest.length)return new ls({multihash:t})}if(t.code===ar.code)return new us({multihash:t})}catch(r){return function(e){if(null==e||null==e.multihash||null==e.version||1===e.version&&114!==e.code)throw new Error("Supplied PeerID CID is invalid");var t=e.multihash;if(t.code===ar.code)return new us({multihash:e.multihash});if(t.code===cr.code){if(36===t.digest.length)return new cs({multihash:e.multihash});if(37===t.digest.length)return new ls({multihash:e.multihash})}throw new Error("Supplied PeerID CID is invalid")}(wr.decode(e))}throw new Error("Supplied PeerID CID is invalid")}function ds(e,t){return ps.apply(this,arguments)}function ps(){return(ps=(0,E.Z)((0,k.Z)().mark((function e(t,r){return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(36!==t.length){e.next=2;break}return e.abrupt("return",new cs({multihash:er(cr.code,t),privateKey:r}));case 2:if(37!==t.length){e.next=4;break}return e.abrupt("return",new ls({multihash:er(cr.code,t),privateKey:r}));case 4:return e.t0=us,e.next=7,ar.digest(t);case 7:return e.t1=e.sent,e.t2=t,e.t3=r,e.t4={multihash:e.t1,publicKey:e.t2,privateKey:e.t3},e.abrupt("return",new e.t0(e.t4));case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}!function(e){e[e.rsa=0]="rsa",e[e.ed25519=1]="ed25519",e[e.secp256k1=2]="secp256k1"}(os||(os={}));var vs=function(){function e(t,r){(0,D.Z)(this,e);var n=r;if(n&&(n=Gr(n)),(this._privateKey=t)&&!this.privateKeyVerify())throw new Error("Invalid private key");if((this._publicKey=n)&&!this.publicKeyVerify())throw new Error("Invalid public key");this.type=os.secp256k1}return(0,O.Z)(e,[{key:"privateKeyVerify",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._privateKey;return!e||Je.isValidPrivateKey(e)}},{key:"publicKeyVerify",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this._publicKey;if(e)try{return ae.fromHex(e),!0}catch(t){return!1}return!0}},{key:"privateKey",get:function(){if(!this._privateKey)throw new Error;return this._privateKey}},{key:"publicKey",get:function(){if(!this._publicKey)throw new Error;return this._publicKey}},{key:"hasPrivateKey",value:function(){return!!this._privateKey}}],[{key:"generate",value:function(){var t=(0,E.Z)((0,k.Z)().mark((function t(){var r,n;return(0,k.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=Vr(32),n=Ue(r),t.abrupt("return",new e(r,n));case 3:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}()}]),e}(),gs="Keypair type not implemented";function ys(e,t,r){if(e===os.secp256k1)return new vs(t,r);throw new Error(gs)}function ms(e){return bs.apply(this,arguments)}function bs(){return(bs=(0,E.Z)((0,k.Z)().mark((function e(t){var r,n;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=t.type,e.next=e.t0===os.secp256k1?3:6;break;case 3:return r=new Ya.secp256k1.Secp256k1PublicKey(t.publicKey),n=t.hasPrivateKey()?new Ya.secp256k1.Secp256k1PrivateKey(t.privateKey):void 0,e.abrupt("return",ds(r.bytes,null===n||void 0===n?void 0:n.bytes));case 6:throw new Error(gs);case 7:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ws(e){return ks.apply(this,arguments)}function ks(){return(ks=(0,E.Z)((0,k.Z)().mark((function e(t){var r,n,i;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=t.type,e.next="RSA"===e.t0?3:"Ed25519"===e.t0?5:"secp256k1"===e.t0?7:9;break;case 3:return r=os.rsa,e.abrupt("break",10);case 5:return r=os.ed25519,e.abrupt("break",10);case 7:return r=os.secp256k1,e.abrupt("break",10);case 9:throw new Error("Unsupported peer id type");case 10:if(n=t.publicKey?es(t.publicKey):void 0,!t.privateKey){e.next=17;break}return e.next=14,rs(t.privateKey);case 14:e.t1=e.sent,e.next=18;break;case 17:e.t1=void 0;case 18:return i=e.t1,e.abrupt("return",ys(r,null===i||void 0===i?void 0:i.marshal(),null===n||void 0===n?void 0:n.marshal()));case 20:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Es(e){return e.map((function(e){var t=Bs(e);return null!=e[1]?[t.code,hi(t.code,e[1])]:[t.code]}))}function xs(e){return Cs(fi(e.map((function(e){var t=Bs(e),r=Uint8Array.from(li.encode(t.code));return e.length>1&&null!=e[1]&&(r=fi([r,e[1]])),r}))))}function Ss(e,t){return e.size>0?e.size/8:0===e.size?0:li.decode(t)+li.decode.bytes}function _s(e){for(var t=[],r=0;r<e.length;){var n=li.decode(e,r),i=li.decode.bytes,o=Ss(ci(n),e.slice(r+i));if(0!==o){var a=e.slice(r+i,r+i+o);if((r+=o+i)>e.length)throw Rs("Invalid address Uint8Array: "+zr(e,"base16"));t.push([n,a])}else t.push([n]),r+=i}return t}function As(e){return function(e){var t=[];return e.map((function(e){var r=Bs(e);return t.push(r.name),e.length>1&&null!=e[1]&&t.push(e[1]),null})),Ps(t.join("/"))}(Es(_s(e)))}function Is(e){var t=function(e){var t=[],r=e.split("/").slice(1);if(1===r.length&&""===r[0])return[];for(var n=0;n<r.length;n++){var i=r[n],o=ci(i);if(0!==o.size){if(++n>=r.length)throw Rs("invalid address: "+e);if(!0===o.path){t.push([i,Ps(r.slice(n).join("/"))]);break}t.push([i,r[n]])}else t.push([i])}return t}(e=Ps(e));return xs(t.map((function(e){Array.isArray(e)||(e=[e]);var t=Bs(e);return e.length>1?[t.code,di(t.code,e[1])]:[t.code]})))}function Cs(e){var t=Ts(e);if(null!=t)throw t;return Uint8Array.from(e)}function Ts(e){try{_s(e)}catch(t){return t}}function Ps(e){return"/"+e.trim().split("/").filter((function(e){return e})).join("/")}function Rs(e){return new Error("Error parsing address: "+e)}function Bs(e){return ci(e[0])}var Ms=Symbol.for("nodejs.util.inspect.custom"),Ns=[ci("dns").code,ci("dns4").code,ci("dns6").code,ci("dnsaddr").code],Os=[ci("p2p").code,ci("ipfs").code],Ds=new Map,Ls=Symbol.for("@multiformats/js-multiaddr/multiaddr"),Us=function(){function e(t){if((0,D.Z)(this,e),null==t&&(t=""),Object.defineProperty(this,Ls,{value:!0}),t instanceof Uint8Array)this.bytes=Cs(t);else if("string"===typeof t){if(t.length>0&&"/"!==t.charAt(0))throw new Error('multiaddr "'.concat(t,'" must start with a "/"'));this.bytes=Is(t)}else{if(!e.isMultiaddr(t))throw new Error("addr must be a string, Buffer, or another Multiaddr");this.bytes=Cs(t.bytes)}}return(0,O.Z)(e,[{key:"toString",value:function(){return As(this.bytes)}},{key:"toJSON",value:function(){return this.toString()}},{key:"toOptions",value:function(){var e,t,r=this.protoCodes(),n=this.toString().split("/").slice(1);if(n.length>2)Ns.includes(r[0])&&Os.includes(r[1])?(e=ci("tcp").name,t=443):(e=ci(n[2]).name,t=parseInt(n[3]));else{if(!Ns.includes(r[0]))throw new Error('multiaddr must have a valid format: "/{ip4, ip6, dns4, dns6, dnsaddr}/{address}/{tcp, udp}/{port}".');e=ci("tcp").name,t=443}return{family:41===r[0]||55===r[0]?6:4,host:n[1],transport:e,port:t}}},{key:"protos",value:function(){return this.protoCodes().map((function(e){return Object.assign({},ci(e))}))}},{key:"protoCodes",value:function(){for(var e=[],t=this.bytes,r=0;r<t.length;){var n=li.decode(t,r),i=li.decode.bytes;r+=Ss(ci(n),t.slice(r+i))+i,e.push(n)}return e}},{key:"protoNames",value:function(){return this.protos().map((function(e){return e.name}))}},{key:"tuples",value:function(){return _s(this.bytes)}},{key:"stringTuples",value:function(){return Es(_s(this.bytes))}},{key:"encapsulate",value:function(t){return t=new e(t),new e(this.toString()+t.toString())}},{key:"decapsulate",value:function(t){var r=t.toString(),n=this.toString(),i=n.lastIndexOf(r);if(i<0)throw new Error("Address ".concat(this.toString()," does not contain subaddress: ").concat(t.toString()));return new e(n.slice(0,i))}},{key:"decapsulateCode",value:function(t){for(var r=this.tuples(),n=r.length-1;n>=0;n--)if(r[n][0]===t)return new e(xs(r.slice(0,n)));return this}},{key:"getPeerId",value:function(){try{var e=this.stringTuples().filter((function(e){return e[0]===ai.ipfs.code})),t=e.pop();if(null!=(null===t||void 0===t?void 0:t[1])){var r=t[1];return"Q"===r[0]||"1"===r[0]?zr(Ct.decode("z".concat(r)),"base58btc"):zr(wr.parse(r).multihash.bytes,"base58btc")}return null}catch(n){return null}}},{key:"getPath",value:function(){var e=null;try{null==(e=this.stringTuples().filter((function(e){return!0===ci(e[0]).path}))[0][1])&&(e=null)}catch(t){e=null}return e}},{key:"equals",value:function(e){return ji(this.bytes,e.bytes)}},{key:"resolve",value:function(){var t=(0,E.Z)((0,k.Z)().mark((function t(r){var n,i,o;return(0,k.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null!=(n=this.protos().find((function(e){return e.resolvable})))){t.next=3;break}return t.abrupt("return",[this]);case 3:if(null!=(i=Ds.get(n.name))){t.next=6;break}throw Di(new Error("no available resolver for ".concat(n.name)),"ERR_NO_AVAILABLE_RESOLVER");case 6:return t.next=8,i(this,r);case 8:return o=t.sent,t.abrupt("return",o.map((function(t){return new e(t)})));case 10:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}()},{key:"nodeAddress",value:function(){var e=this.toOptions();if("tcp"!==e.transport&&"udp"!==e.transport)throw new Error('multiaddr must have a valid format - no protocol with name: "'.concat(e.transport,'". Must have a valid transport protocol: "{tcp, udp}"'));return{family:e.family,address:e.host,port:e.port}}},{key:"isThinWaistAddress",value:function(e){var t=(null!==e&&void 0!==e?e:this).protos();return 2===t.length&&((4===t[0].code||41===t[0].code)&&(6===t[1].code||273===t[1].code))}},{key:Ms,value:function(){return"<Multiaddr "+zr(this.bytes,"base16")+" - "+As(this.bytes)+">"}},{key:"inspect",value:function(){return"<Multiaddr "+zr(this.bytes,"base16")+" - "+As(this.bytes)+">"}}],[{key:"fromNodeAddress",value:function(t,r){if(null==t)throw new Error("requires node address object");if(null==r)throw new Error("requires transport protocol");var n;switch(t.family){case 4:n="ip4";break;case 6:n="ip6";break;default:throw Error("Invalid addr family, should be 4 or 6.")}return new e("/"+[n,t.address,r,t.port].join("/"))}},{key:"isName",value:function(t){return!!e.isMultiaddr(t)&&t.protos().some((function(e){return e.resolvable}))}},{key:"isMultiaddr",value:function(e){return Boolean(null===e||void 0===e?void 0:e[Ls])}}]),e}();function Fs(e,t){return zs.apply(this,arguments)}function zs(){return(zs=(0,E.Z)((0,k.Z)().mark((function e(t,r){return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",Ke(Hr(r),t,{der:!1}));case 1:case"end":return e.stop()}}),e)})))).apply(this,arguments)}Us.resolvers=Ds;var Zs,js,qs=wi("waku:enr"),Ks=function(e){U(r,e);var t=K(r);function r(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:BigInt(1),o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return(0,D.Z)(this,r),(e=t.call(this,Object.entries(n))).seq=i,e.signature=o,e}return(0,O.Z)(r,[{key:"set",value:function(e,t){return this.signature=null,this.seq++,Xr(F(r.prototype),"set",this).call(this,e,t)}},{key:"id",get:function(){var e=this.get("id");if(!e)throw new Error("id not found.");return qr(e)}},{key:"keypairType",get:function(){if("v4"===this.id)return os.secp256k1;throw new Error(ki)}},{key:"publicKey",get:function(){if("v4"===this.id)return this.get("secp256k1");throw new Error(ki)}},{key:"keypair",get:function(){if(this.publicKey){var e=this.publicKey;return ys(this.keypairType,void 0,e)}}},{key:"nodeId",get:function(){if("v4"===this.id)return this.publicKey?function(e){var t=ae.fromHex(e).toRawBytes(!1);return jr(Hr(t.slice(1)))}(this.publicKey):void 0;throw new Error(ki)}},{key:"ip",get:function(){var e=this.get("ip");return e?hi("ip4",e):void 0},set:function(e){e?this.set("ip",di("ip4",e)):this.delete("ip")}},{key:"tcp",get:function(){var e=this.get("tcp");return e?Number(hi("tcp",e)):void 0},set:function(e){void 0===e?this.delete("tcp"):this.set("tcp",di("tcp",e.toString(10)))}},{key:"udp",get:function(){var e=this.get("udp");return e?Number(hi("udp",e)):void 0},set:function(e){void 0===e?this.delete("udp"):this.set("udp",di("udp",e.toString(10)))}},{key:"ip6",get:function(){var e=this.get("ip6");return e?hi("ip6",e):void 0},set:function(e){e?this.set("ip6",di("ip6",e)):this.delete("ip6")}},{key:"tcp6",get:function(){var e=this.get("tcp6");return e?Number(hi("tcp",e)):void 0},set:function(e){void 0===e?this.delete("tcp6"):this.set("tcp6",di("tcp",e.toString(10)))}},{key:"udp6",get:function(){var e=this.get("udp6");return e?Number(hi("udp",e)):void 0},set:function(e){void 0===e?this.delete("udp6"):this.set("udp6",di("udp",e.toString(10)))}},{key:"multiaddrs",get:function(){var e=this.get("multiaddrs");if(e)return function(e){for(var t=[],r=0;r<e.length;){var n=new DataView(e.buffer,r,2).getUint16(0);r+=2;var i=e.slice(r,r+n);r+=n;var o=new Us(i);t.push(o)}return t}(e)},set:function(e){if(void 0===e)this.delete("multiaddrs");else{var t=function(e){var t=e.reduce((function(e,t){return e+2+t.bytes.length}),0),r=new Uint8Array(t),n=new DataView(r.buffer),i=0;return e.forEach((function(e){if(e.getPeerId())throw new Error("`multiaddr` field MUST not contain peer id");n.setUint16(i,e.bytes.length),i+=2,r.set(e.bytes,i),i+=e.bytes.length})),r}(e);this.set("multiaddrs",t)}}},{key:"getLocationMultiaddr",value:function(e){if("udp"===e)return this.getLocationMultiaddr("udp4")||this.getLocationMultiaddr("udp6");if("tcp"===e)return this.getLocationMultiaddr("tcp4")||this.getLocationMultiaddr("tcp6");var t=e.endsWith("6"),r=this.get(t?"ip6":"ip");if(r){var n,i,o=e.startsWith("udp"),a=e.startsWith("tcp");if(o)n="udp",i=t?this.get("udp6"):this.get("udp");else{if(!a)return;n="tcp",i=t?this.get("tcp6"):this.get("tcp")}if(i)return function(e,t,r,n){var i=new Us("/"+e+"/"+hi(e,r));return i.encapsulate(new Us("/"+t+"/"+hi(t,n)))}(t?"ip6":"ip4",n,r,i)}}},{key:"setLocationMultiaddr",value:function(e){var t=e.protoNames();if(2!==t.length&&"udp"!==t[1]&&"tcp"!==t[1])throw new Error("Invalid multiaddr");var r=e.tuples();if(!r[0][1]||!r[1][1])throw new Error("Invalid multiaddr");4===r[0][0]?(this.set("ip",r[0][1]),this.set(t[1],r[1][1])):(this.set("ip6",r[0][1]),this.set(t[1]+"6",r[1][1]))}},{key:"getFullMultiaddr",value:function(e){if(this.peerId){var t=this.getLocationMultiaddr(e);if(t)return t.encapsulate("/p2p/".concat(this.peerId.toString()))}}},{key:"getFullMultiaddrs",value:function(){if(this.peerId&&this.multiaddrs){var e=this.peerId;return this.multiaddrs.map((function(t){return t.encapsulate("/p2p/".concat(e.toString()))}))}return[]}},{key:"waku2",get:function(){var e=this.get("waku2");if(e)return function(e){var t={relay:!1,store:!1,filter:!1,lightPush:!1};return e%2&&(t.relay=!0),(e>>=1)%2&&(t.store=!0),(e>>=1)%2&&(t.filter=!0),(e>>=1)%2&&(t.lightPush=!0),t}(e[0])},set:function(e){if(void 0===e)this.delete("waku2");else{var t=function(e){var t=0;return e.lightPush&&(t+=1),t<<=1,e.filter&&(t+=1),t<<=1,e.store&&(t+=1),t<<=1,e.relay&&(t+=1),t}(e);this.set("waku2",new Uint8Array([t]))}}},{key:"verify",value:function(e,t){if(!this.get("id")||"v4"!==this.id)throw new Error(ki);if(!this.publicKey)throw new Error("Failed to verify ENR: No public key");return Wr(t,Hr(e),this.publicKey)}},{key:"sign",value:function(){var e=(0,E.Z)((0,k.Z)().mark((function e(t,r){return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=this.id,e.next="v4"===e.t0?3:7;break;case 3:return e.next=5,Fs(r,t);case 5:return this.signature=e.sent,e.abrupt("break",8);case 7:throw new Error(ki);case 8:return e.abrupt("return",this.signature);case 9:case"end":return e.stop()}}),e,this)})));return function(t,r){return e.apply(this,arguments)}}()},{key:"encodeToValues",value:function(){var e=(0,E.Z)((0,k.Z)().mark((function e(t){var r,n=this;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if((r=Array.from(this.keys()).sort((function(e,t){return e.localeCompare(t)})).map((function(e){return[e,n.get(e)]})).map((function(e){var t=I(e,2),r=t[0],n=t[1];return[Kr(r),n]})).flat()).unshift(new Uint8Array([Number(this.seq)])),!t){e.next=10;break}return e.t0=r,e.next=6,this.sign(Zr(Bn(r)),t);case 6:e.t1=e.sent,e.t0.unshift.call(e.t0,e.t1),e.next=13;break;case 10:if(this.signature){e.next=12;break}throw new Error("No valid signature found");case 12:r.unshift(this.signature);case 13:return e.abrupt("return",r);case 14:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"encode",value:function(){var e=(0,E.Z)((0,k.Z)().mark((function e(t){var r;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=Zr,e.t1=p,e.next=4,this.encodeToValues(t);case 4:if(e.t2=e.sent,e.t3=e.t1.encode.call(e.t1,e.t2),!((r=(0,e.t0)(e.t3)).length>=300)){e.next=9;break}throw new Error("ENR must be less than 300 bytes");case 9:return e.abrupt("return",r);case 10:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"encodeTxt",value:function(){var e=(0,E.Z)((0,k.Z)().mark((function e(t){return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=r.RECORD_PREFIX,e.t1=zr,e.next=4,this.encode(t);case 4:return e.t2=e.sent,e.t3=(0,e.t1)(e.t2,"base64url"),e.abrupt("return",e.t0+e.t3);case 7:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()}],[{key:"create",value:function(){var e=(0,E.Z)((0,k.Z)().mark((function e(){var t,n,i,o,a,s,u=arguments;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=u.length>0&&void 0!==u[0]?u[0]:{},n=u.length>1&&void 0!==u[1]?u[1]:BigInt(1),i=u.length>2&&void 0!==u[2]?u[2]:null,o=new r(t,n,i),e.prev=4,!(a=o.publicKey)){e.next=11;break}return s=ys(o.keypairType,void 0,a),e.next=10,ms(s);case 10:o.peerId=e.sent;case 11:e.next=16;break;case 13:e.prev=13,e.t0=e.catch(4),qs("Could not calculate peer id for ENR",e.t0);case 16:return e.abrupt("return",o);case 17:case"end":return e.stop()}}),e,null,[[4,13]])})));return function(){return e.apply(this,arguments)}}()},{key:"createV4",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return 33!==e.length&&(e=Gr(e)),r.create(N(N({},t),{},{id:Kr("v4"),secp256k1:e}))}},{key:"createFromPeerId",value:function(){var e=(0,E.Z)((0,k.Z)().mark((function e(t){var n,i,o=arguments;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=o.length>1&&void 0!==o[1]?o[1]:{},e.next=3,ws(t);case 3:i=e.sent,e.t0=i.type,e.next=e.t0===os.secp256k1?7:8;break;case 7:return e.abrupt("return",r.createV4(i.publicKey,n));case 8:throw new Error;case 9:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"decodeFromValues",value:function(){var e=(0,E.Z)((0,k.Z)().mark((function e(t){var n,i,o,a,s,u,c,l,f;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(Array.isArray(t)){e.next=2;break}throw new Error("Decoded ENR must be an array");case 2:if(t.length%2===0){e.next=4;break}throw new Error("Decoded ENR must have an even number of elements");case 4:if(n=x(h=t)||Qr(h)||_(h)||A(),i=n[0],o=n[1],a=n.slice(2),i&&!Array.isArray(i)){e.next=7;break}throw new Error("Decoded ENR invalid signature: must be a byte array");case 7:if(o&&!Array.isArray(o)){e.next=9;break}throw new Error("Decoded ENR invalid sequence number: must be a byte array");case 9:for(s={},u=0;u<a.length;u+=2)try{s[qr(a[u])]=a[u+1]}catch(d){qs("Failed to decode ENR key to UTF-8, skipping it",a[u],d)}return c="0x"+(o.length?jr(o):"00"),e.next=14,r.create(s,BigInt(c),i);case 14:if(l=e.sent,f=Zr(Bn([o].concat(Jr(a)))),l.verify(f,i)){e.next=18;break}throw new Error("Unable to verify ENR signature");case 18:return e.abrupt("return",l);case 19:case"end":return e.stop()}var h}),e)})));return function(t){return e.apply(this,arguments)}}()},{key:"decode",value:function(e){var t=On(e).map(Zr);return r.decodeFromValues(t)}},{key:"decodeTxt",value:function(e){if(!e.startsWith(this.RECORD_PREFIX))throw new Error("\"string encoded ENR must start with '".concat(this.RECORD_PREFIX,"'"));return r.decode(Fr(e.slice(4),"base64url"))}}]),r}(H(Map));Ks.RECORD_PREFIX="enr:",function(e){var t;e.codec=function(){return null==t&&(t=Ni((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};!1!==r.lengthDelimited&&t.fork(),null!=e.payload&&(t.uint32(10),t.bytes(e.payload)),null!=e.contentTopic&&(t.uint32(18),t.string(e.contentTopic)),null!=e.version&&(t.uint32(24),t.uint32(e.version)),null!=e.timestampDeprecated&&(t.uint32(33),t.double(e.timestampDeprecated)),null!=e.timestamp&&(t.uint32(80),t.sint64(e.timestamp)),!1!==r.lengthDelimited&&t.ldelim()}),(function(e,t){for(var r={},n=null==t?e.len:e.pos+t;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.payload=e.bytes();break;case 2:r.contentTopic=e.string();break;case 3:r.version=e.uint32();break;case 4:r.timestampDeprecated=e.double();break;case 10:r.timestamp=e.sint64();break;default:e.skipType(7&i)}}return r}))),t},e.encode=function(t){return Ri(t,e.codec())},e.decode=function(t){return Si(t,e.codec())}}(Zs||(Zs={})),function(e){var t;e.codec=function(){return null==t&&(t=Ni((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};!1!==r.lengthDelimited&&t.fork(),null!=e.contentTopic&&(t.uint32(18),t.string(e.contentTopic)),!1!==r.lengthDelimited&&t.ldelim()}),(function(e,t){for(var r={},n=null==t?e.len:e.pos+t;e.pos<n;){var i=e.uint32();if(i>>>3===2)r.contentTopic=e.string();else e.skipType(7&i)}return r}))),t},e.encode=function(t){return Ri(t,e.codec())},e.decode=function(t){return Si(t,e.codec())}}(js||(js={}));__webpack_require__(8873);function Vs(e,t){this.v=e,this.k=t}function Hs(e){var t,r;function n(t,r){try{var o=e[t](r),a=o.value,s=a instanceof Vs;Promise.resolve(s?a.v:a).then((function(r){if(s){var u="return"===t?"return":"next";if(!a.k||r.done)return n(u,r);r=e[u](r).value}i(o.done?"return":"normal",r)}),(function(e){n("throw",e)}))}catch(u){i("throw",u)}}function i(e,i){switch(e){case"return":t.resolve({value:i,done:!0});break;case"throw":t.reject(i);break;default:t.resolve({value:i,done:!1})}(t=t.next)?n(t.key,t.arg):r=null}this._invoke=function(e,i){return new Promise((function(o,a){var s={key:e,arg:i,resolve:o,reject:a,next:null};r?r=r.next=s:(t=r=s,n(e,i))}))},"function"!=typeof e.return&&(this.return=void 0)}function Gs(e){return function(){return new Hs(e.apply(this,arguments))}}function Ws(e){return new Vs(e,0)}function Qs(e){var t={},r=!1;function n(t,n){return r=!0,{done:!1,value:new Vs(n=new Promise((function(r){r(e[t](n))})),1)}}return t["undefined"!=typeof Symbol&&Symbol.iterator||"@@iterator"]=function(){return this},t.next=function(e){return r?(r=!1,e):n("next",e)},"function"==typeof e.throw&&(t.throw=function(e){if(r)throw r=!1,e;return n("throw",e)}),"function"==typeof e.return&&(t.return=function(e){return r?(r=!1,e):n("return",e)}),t}function Js(e){var t,r,n,i=2;for("undefined"!=typeof Symbol&&(r=Symbol.asyncIterator,n=Symbol.iterator);i--;){if(r&&null!=(t=e[r]))return t.call(e);if(n&&null!=(t=e[n]))return new Ys(t.call(e));r="@@asyncIterator",n="@@iterator"}throw new TypeError("Object is not async iterable")}function Ys(e){function t(e){if(Object(e)!==e)return Promise.reject(new TypeError(e+" is not an object."));var t=e.done;return Promise.resolve(e.value).then((function(e){return{value:e,done:t}}))}return Ys=function(e){this.s=e,this.n=e.next},Ys.prototype={s:null,n:null,next:function(){return t(this.n.apply(this.s,arguments))},return:function(e){var r=this.s.return;return void 0===r?Promise.resolve({value:e,done:!0}):t(r.apply(this.s,arguments))},throw:function(e){var r=this.s.return;return void 0===r?Promise.reject(e):t(r.apply(this.s,arguments))}},new Ys(e)}Hs.prototype["function"==typeof Symbol&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},Hs.prototype.next=function(e){return this._invoke("next",e)},Hs.prototype.throw=function(e){return this._invoke("throw",e)},Hs.prototype.return=function(e){return this._invoke("return",e)};var Xs=Symbol.for("@achingbrain/uint8arraylist");function $s(e,t){if(null==t||t<0)throw new RangeError("index is out of bounds");var r,n=0,i=$e(e);try{for(i.s();!(r=i.n()).done;){var o=r.value,a=n+o.byteLength;if(t<a)return{buf:o,index:t-n};n=a}}catch(s){i.e(s)}finally{i.f()}throw new RangeError("index is out of bounds")}function eu(e){return Boolean(null===e||void 0===e?void 0:e[Xs])}var tu=function(e){function t(){(0,D.Z)(this,t),Object.defineProperty(this,Xs,{value:!0}),this.bufs=[],this.length=0;for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];r.length>0&&this.appendAll(r)}return(0,O.Z)(t,[{key:e,value:(0,k.Z)().mark((function e(){return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.delegateYield(this.bufs,"t0",1);case 1:case"end":return e.stop()}}),e,this)}))},{key:"byteLength",get:function(){return this.length}},{key:"append",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];this.appendAll(t)}},{key:"appendAll",value:function(e){var t,r=0,n=$e(e);try{for(n.s();!(t=n.n()).done;){var i=t.value;if(i instanceof Uint8Array)r+=i.byteLength,this.bufs.push(i);else{if(!eu(i))throw new Error("Could not append value, must be an Uint8Array or a Uint8ArrayList");var o;r+=i.byteLength,(o=this.bufs).push.apply(o,Jr(i.bufs))}}}catch(a){n.e(a)}finally{n.f()}this.length+=r}},{key:"prepend",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];this.prependAll(t)}},{key:"prependAll",value:function(e){var t,r=0,n=$e(e.reverse());try{for(n.s();!(t=n.n()).done;){var i=t.value;if(i instanceof Uint8Array)r+=i.byteLength,this.bufs.unshift(i);else{if(!eu(i))throw new Error("Could not prepend value, must be an Uint8Array or a Uint8ArrayList");var o;r+=i.byteLength,(o=this.bufs).unshift.apply(o,Jr(i.bufs))}}}catch(a){n.e(a)}finally{n.f()}this.length+=r}},{key:"get",value:function(e){var t=$s(this.bufs,e);return t.buf[t.index]}},{key:"set",value:function(e,t){var r=$s(this.bufs,e);r.buf[r.index]=t}},{key:"write",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(e instanceof Uint8Array)for(var r=0;r<e.length;r++)this.set(t+r,e[r]);else{if(!eu(e))throw new Error("Could not write value, must be an Uint8Array or a Uint8ArrayList");for(var n=0;n<e.length;n++)this.set(t+n,e.get(n))}}},{key:"consume",value:function(e){if(e=Math.trunc(e),!(Number.isNaN(e)||e<=0))for(;this.bufs.length>0;){if(!(e>=this.bufs[0].byteLength)){this.bufs[0]=this.bufs[0].subarray(e),this.length-=e;break}e-=this.bufs[0].byteLength,this.length-=this.bufs[0].byteLength,this.bufs.shift()}}},{key:"slice",value:function(e,t){var r=this._subList(e,t);return fi(r.bufs,r.length)}},{key:"subarray",value:function(e,t){var r=this._subList(e,t),n=r.bufs,i=r.length;return 1===n.length?n[0]:fi(n,i)}},{key:"sublist",value:function(e,r){var n=this._subList(e,r),i=n.bufs,o=n.length,a=new t;return a.length=o,a.bufs=i,a}},{key:"_subList",value:function(e,t){var r,n;if(e=null!==(r=e)&&void 0!==r?r:0,t=null!==(n=t)&&void 0!==n?n:this.length,e<0&&(e=this.length+e),t<0&&(t=this.length+t),e<0||t>this.length)throw new RangeError("index is out of bounds");if(e===t)return{bufs:[],length:0};if(0===e&&t===this.length)return{bufs:Jr(this.bufs),length:this.length};for(var i=[],o=0,a=0;a<this.bufs.length;a++){var s=this.bufs[a],u=o,c=u+s.byteLength;if(o=c,!(e>=c)){var l=e>=u&&e<c,f=t>u&&t<=c;if(l&&f){if(e===u&&t===c){i.push(s);break}var h=e-u;i.push(s.subarray(h,h+(t-e)));break}if(l){if(0===e){i.push(s);continue}i.push(s.subarray(e-u))}else{if(f){if(t===c){i.push(s);break}i.push(s.subarray(0,t-u));break}i.push(s)}}}return{bufs:i,length:t-e}}},{key:"getInt8",value:function(e){var t=this.subarray(e,e+1);return new DataView(t.buffer,t.byteOffset,t.byteLength).getInt8(0)}},{key:"setInt8",value:function(e,t){var r=Nr(1);new DataView(r.buffer,r.byteOffset,r.byteLength).setInt8(0,t),this.write(r,e)}},{key:"getInt16",value:function(e,t){var r=this.subarray(e,e+2);return new DataView(r.buffer,r.byteOffset,r.byteLength).getInt16(0,t)}},{key:"setInt16",value:function(e,t,r){var n=Mr(2);new DataView(n.buffer,n.byteOffset,n.byteLength).setInt16(0,t,r),this.write(n,e)}},{key:"getInt32",value:function(e,t){var r=this.subarray(e,e+4);return new DataView(r.buffer,r.byteOffset,r.byteLength).getInt32(0,t)}},{key:"setInt32",value:function(e,t,r){var n=Mr(4);new DataView(n.buffer,n.byteOffset,n.byteLength).setInt32(0,t,r),this.write(n,e)}},{key:"getBigInt64",value:function(e,t){var r=this.subarray(e,e+8);return new DataView(r.buffer,r.byteOffset,r.byteLength).getBigInt64(0,t)}},{key:"setBigInt64",value:function(e,t,r){var n=Mr(8);new DataView(n.buffer,n.byteOffset,n.byteLength).setBigInt64(0,t,r),this.write(n,e)}},{key:"getUint8",value:function(e){var t=this.subarray(e,e+1);return new DataView(t.buffer,t.byteOffset,t.byteLength).getUint8(0)}},{key:"setUint8",value:function(e,t){var r=Nr(1);new DataView(r.buffer,r.byteOffset,r.byteLength).setUint8(0,t),this.write(r,e)}},{key:"getUint16",value:function(e,t){var r=this.subarray(e,e+2);return new DataView(r.buffer,r.byteOffset,r.byteLength).getUint16(0,t)}},{key:"setUint16",value:function(e,t,r){var n=Mr(2);new DataView(n.buffer,n.byteOffset,n.byteLength).setUint16(0,t,r),this.write(n,e)}},{key:"getUint32",value:function(e,t){var r=this.subarray(e,e+4);return new DataView(r.buffer,r.byteOffset,r.byteLength).getUint32(0,t)}},{key:"setUint32",value:function(e,t,r){var n=Mr(4);new DataView(n.buffer,n.byteOffset,n.byteLength).setUint32(0,t,r),this.write(n,e)}},{key:"getBigUint64",value:function(e,t){var r=this.subarray(e,e+8);return new DataView(r.buffer,r.byteOffset,r.byteLength).getBigUint64(0,t)}},{key:"setBigUint64",value:function(e,t,r){var n=Mr(8);new DataView(n.buffer,n.byteOffset,n.byteLength).setBigUint64(0,t,r),this.write(n,e)}},{key:"getFloat32",value:function(e,t){var r=this.subarray(e,e+4);return new DataView(r.buffer,r.byteOffset,r.byteLength).getFloat32(0,t)}},{key:"setFloat32",value:function(e,t,r){var n=Mr(4);new DataView(n.buffer,n.byteOffset,n.byteLength).setFloat32(0,t,r),this.write(n,e)}},{key:"getFloat64",value:function(e,t){var r=this.subarray(e,e+8);return new DataView(r.buffer,r.byteOffset,r.byteLength).getFloat64(0,t)}},{key:"setFloat64",value:function(e,t,r){var n=Mr(8);new DataView(n.buffer,n.byteOffset,n.byteLength).setFloat64(0,t,r),this.write(n,e)}},{key:"equals",value:function(e){if(null==e)return!1;if(!(e instanceof t))return!1;if(e.bufs.length!==this.bufs.length)return!1;for(var r=0;r<this.bufs.length;r++)if(!ji(this.bufs[r],e.bufs[r]))return!1;return!0}}],[{key:"fromUint8Arrays",value:function(e,r){var n=new t;return n.bufs=e,null==r&&(r=e.reduce((function(e,t){return e+t.byteLength}),0)),n.length=r,n}}]),t}(Symbol.iterator);function ru(e){return e instanceof Uint8Array?{get:function(t){return e[t]},set:function(t,r){e[t]=r}}:{get:function(t){return e.get(t)},set:function(t,r){e.set(t,r)}}}var nu=4294967296,iu=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;(0,D.Z)(this,e),this.hi=t,this.lo=r}return(0,O.Z)(e,[{key:"toBigInt",value:function(e){if(!0===e)return BigInt(this.lo>>>0)+(BigInt(this.hi>>>0)<<32n);if(this.hi>>>31!==0){var t=1+~this.lo>>>0,r=~this.hi>>>0;return 0===t&&(r=r+1>>>0),-(BigInt(t)+(BigInt(r)<<32n))}return BigInt(this.lo>>>0)+(BigInt(this.hi>>>0)<<32n)}},{key:"toNumber",value:function(e){return Number(this.toBigInt(e))}},{key:"zzDecode",value:function(){var t=-(1&this.lo),r=((this.lo>>>1|this.hi<<31)^t)>>>0;return new e((this.hi>>>1^t)>>>0,r)}},{key:"zzEncode",value:function(){var t=this.hi>>31;return new e(((this.hi<<1|this.lo>>>31)^t)>>>0,(this.lo<<1^t)>>>0)}},{key:"toBytes",value:function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=ru(e);this.hi>0;)r.set(t++,127&this.lo|128),this.lo=(this.lo>>>7|this.hi<<25)>>>0,this.hi>>>=7;for(;this.lo>127;)r.set(t++,127&this.lo|128),this.lo=this.lo>>>7;r.set(t++,this.lo)}}],[{key:"fromBigInt",value:function(t){if(0n===t)return new e;var r=t<0;r&&(t=-t);var n=0|Number(t>>32n),i=0|Number(t-(BigInt(n)<<32n));return r&&(n=~n>>>0,i=~i>>>0,++i>nu&&(i=0,++n>nu&&(n=0))),new e(n,i)}},{key:"fromNumber",value:function(t){if(0===t)return new e;var r=t<0;r&&(t=-t);var n=t>>>0,i=(t-n)/4294967296>>>0;return r&&(i=~i>>>0,n=~n>>>0,++n>4294967295&&(n=0,++i>4294967295&&(i=0))),new e(i,n)}},{key:"fromBytes",value:function(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=ru(t),i=new e,o=0;if(t.length-r>4){for(;o<4;++o)if(i.lo=(i.lo|(127&n.get(r))<<7*o)>>>0,n.get(r++)<128)return i;if(i.lo=(i.lo|(127&n.get(r))<<28)>>>0,i.hi=(i.hi|(127&n.get(r))>>4)>>>0,n.get(r++)<128)return i;o=0}else for(;o<4;++o){if(r>=t.length)throw RangeError("index out of range: ".concat(r," > ").concat(t.length));if(i.lo=(i.lo|(127&n.get(r))<<7*o)>>>0,n.get(r++)<128)return i}if(t.length-r>4){for(;o<5;++o)if(i.hi=(i.hi|(127&n.get(r))<<7*o+3)>>>0,n.get(r++)<128)return i}else if(r<t.byteLength)for(;o<5;++o){if(r>=t.length)throw RangeError("index out of range: ".concat(r," > ").concat(t.length));if(i.hi=(i.hi|(127&n.get(r))<<7*o+3)>>>0,n.get(r++)<128)return i}throw RangeError("invalid varint encoding")}}]),e}(),ou=Math.pow(2,7),au=Math.pow(2,14),su=Math.pow(2,21),uu=Math.pow(2,28),cu=Math.pow(2,35),lu=Math.pow(2,42),fu=Math.pow(2,49),hu=Math.pow(2,56),du=Math.pow(2,63),pu={encodingLength:function(e){return e<ou?1:e<au?2:e<su?3:e<uu?4:e<cu?5:e<lu?6:e<fu?7:e<hu?8:e<du?9:10},encode:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(null!=Number.MAX_SAFE_INTEGER&&e>Number.MAX_SAFE_INTEGER)throw new RangeError("Could not encode varint");return null==t&&(t=Nr(pu.encodingLength(e))),iu.fromNumber(e).toBytes(t,r),t},decode:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return iu.fromBytes(e,t).toNumber(!0)}};var vu=function e(t){var r=pu.encodingLength(t),n=function(e){var t;return null!=(null===globalThis||void 0===globalThis||null===(t=globalThis.Buffer)||void 0===t?void 0:t.allocUnsafe)?globalThis.Buffer.allocUnsafe(e):new Uint8Array(e)}(r);return pu.encode(t,n),e.bytes=r,n};function gu(e){var t,r,n=null!==(r=(e=null!==(t=e)&&void 0!==t?t:{}).lengthEncoder)&&void 0!==r?r:vu,i=function(){var e=Gs((0,k.Z)().mark((function e(t){var r,i,o,a,s,u,c;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=!1,i=!1,e.prev=2,a=Js(t);case 4:return e.next=6,Ws(a.next());case 6:if(!(r=!(s=e.sent).done)){e.next=24;break}if(u=s.value,!((c=n(u.byteLength))instanceof Uint8Array)){e.next=14;break}return e.next=12,c;case 12:e.next=15;break;case 14:return e.delegateYield(Qs(Js(c)),"t0",15);case 15:if(!(u instanceof Uint8Array)){e.next=20;break}return e.next=18,u;case 18:e.next=21;break;case 20:return e.delegateYield(Qs(Js(u)),"t1",21);case 21:r=!1,e.next=4;break;case 24:e.next=30;break;case 26:e.prev=26,e.t2=e.catch(2),i=!0,o=e.t2;case 30:if(e.prev=30,e.prev=31,!r||null==a.return){e.next=35;break}return e.next=35,Ws(a.return());case 35:if(e.prev=35,!i){e.next=38;break}throw o;case 38:return e.finish(35);case 39:return e.finish(30);case 40:case"end":return e.stop()}}),e,null,[[2,26,30,40],[31,,35,39]])})));return function(t){return e.apply(this,arguments)}}();return i}vu.bytes=0,gu.single=function(e,t){var r,n,i=null!==(n=(t=null!==(r=t)&&void 0!==r?r:{}).lengthEncoder)&&void 0!==n?n:vu;return new tu(i(e.byteLength),e)};var yu;!function(e){e[e.LENGTH=0]="LENGTH",e[e.DATA=1]="DATA"}(yu||(yu={}));var mu=function e(t){var r=pu.decode(t);return e.bytes=pu.encodingLength(r),r};function bu(e){var t=function(){var t=Gs((0,k.Z)().mark((function t(r){var n,i,o,a,s,u,c,l,f,h,d,p,v,g,y,m,b;return(0,k.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:a=new tu,s=yu.LENGTH,u=-1,c=null!==(n=null===e||void 0===e?void 0:e.lengthDecoder)&&void 0!==n?n:mu,l=null!==(i=null===e||void 0===e?void 0:e.maxLengthLength)&&void 0!==i?i:8,f=null!==(o=null===e||void 0===e?void 0:e.maxDataLength)&&void 0!==o?o:4194304,h=!1,d=!1,t.prev=8,v=Js(r);case 10:return t.next=12,Ws(v.next());case 12:if(!(h=!(g=t.sent).done)){t.next=50;break}y=g.value,a.append(y);case 15:if(!(a.byteLength>0)){t.next=47;break}if(s!==yu.LENGTH){t.next=36;break}if(t.prev=17,!((u=c(a))<0)){t.next=21;break}throw Di(new Error("invalid message length"),"ERR_INVALID_MSG_LENGTH");case 21:if(!(u>f)){t.next=23;break}throw Di(new Error("message length too long"),"ERR_MSG_DATA_TOO_LONG");case 23:m=c.bytes,a.consume(m),null!=(null===e||void 0===e?void 0:e.onLength)&&e.onLength(u),s=yu.DATA,t.next=36;break;case 29:if(t.prev=29,t.t0=t.catch(17),!(t.t0 instanceof RangeError)){t.next=35;break}if(!(a.byteLength>l)){t.next=34;break}throw Di(new Error("message length length too long"),"ERR_MSG_LENGTH_TOO_LONG");case 34:return t.abrupt("break",47);case 35:throw t.t0;case 36:if(s!==yu.DATA){t.next=45;break}if(!(a.byteLength<u)){t.next=39;break}return t.abrupt("break",47);case 39:return b=a.sublist(0,u),a.consume(u),null!=(null===e||void 0===e?void 0:e.onData)&&e.onData(b),t.next=44,b;case 44:s=yu.LENGTH;case 45:t.next=15;break;case 47:h=!1,t.next=10;break;case 50:t.next=56;break;case 52:t.prev=52,t.t1=t.catch(8),d=!0,p=t.t1;case 56:if(t.prev=56,t.prev=57,!h||null==v.return){t.next=61;break}return t.next=61,Ws(v.return());case 61:if(t.prev=61,!d){t.next=64;break}throw p;case 64:return t.finish(61);case 65:return t.finish(56);case 66:if(!(a.byteLength>0)){t.next=68;break}throw Di(new Error("unexpected end of input"),"ERR_UNEXPECTED_EOF");case 68:case"end":return t.stop()}}),t,null,[[8,52,56,66],[17,29],[57,,61,65]])})));return function(e){return t.apply(this,arguments)}}();return t}function wu(e,t){for(var r in t){(o=t[r]).configurable=o.enumerable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,r,o)}if(Object.getOwnPropertySymbols)for(var n=Object.getOwnPropertySymbols(t),i=0;i<n.length;i++){var o,a=n[i];(o=t[a]).configurable=o.enumerable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,a,o)}return e}mu.bytes=0,bu.fromReader=function(e,t){var r=1,n=Gs((0,k.Z)().mark((function t(){var n,i,o;return(0,k.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=1,t.next=4,Ws(e.next(r));case 4:if(n=t.sent,i=n.done,o=n.value,!0!==i){t.next=9;break}return t.abrupt("return");case 9:if(null==o){t.next=12;break}return t.next=12,o;case 12:t.next=19;break;case 14:if(t.prev=14,t.t0=t.catch(1),"ERR_UNDER_READ"!==t.t0.code){t.next=18;break}return t.abrupt("return",{done:!0,value:null});case 18:throw t.t0;case 19:return t.prev=19,r=1,t.finish(19);case 22:t.next=0;break;case 24:case"end":return t.stop()}}),t,null,[[1,14,19,22]])})))();return bu(N(N({},null!==t&&void 0!==t?t:{}),{},{onLength:function(e){r=e}}))(n)};var ku=function(){function e(t){if((0,D.Z)(this,e),!(t>0)||0!==(t-1&t))throw new Error("Max size for a FixedFIFO should be a power of two");this.buffer=new Array(t),this.mask=t-1,this.top=0,this.btm=0,this.next=null}return(0,O.Z)(e,[{key:"push",value:function(e){return void 0===this.buffer[this.top]&&(this.buffer[this.top]=e,this.top=this.top+1&this.mask,!0)}},{key:"shift",value:function(){var e=this.buffer[this.btm];if(void 0!==e)return this.buffer[this.btm]=void 0,this.btm=this.btm+1&this.mask,e}},{key:"isEmpty",value:function(){return void 0===this.buffer[this.btm]}}]),e}(),Eu=function(){function e(){var t,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,D.Z)(this,e),this.hwm=null!==(t=r.splitLimit)&&void 0!==t?t:16,this.head=new ku(this.hwm),this.tail=this.head,this.size=0}return(0,O.Z)(e,[{key:"calculateSize",value:function(e){return null!=(null===e||void 0===e?void 0:e.byteLength)?e.byteLength:1}},{key:"push",value:function(e){if(null!=(null===e||void 0===e?void 0:e.value)&&(this.size+=this.calculateSize(e.value)),!this.head.push(e)){var t=this.head;this.head=t.next=new ku(2*this.head.buffer.length),this.head.push(e)}}},{key:"shift",value:function(){var e,t=this.tail.shift();if(void 0===t&&null!=this.tail.next){var r=this.tail.next;this.tail.next=null,this.tail=r,t=this.tail.shift()}return null!=(null===(e=t)||void 0===e?void 0:e.value)&&(this.size-=this.calculateSize(t.value)),t}},{key:"isEmpty",value:function(){return this.head.isEmpty()}}]),e}();function xu(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=function(e){var t=e.shift();if(null==t)return{done:!0};if(null!=t.error)throw t.error;return{done:!0===t.done,value:t.value}};return Su(t,e)}function Su(e,t){var r,n,i,o,a,s,u,c,l=(t=null!==(r=t)&&void 0!==r?r:{}).onEnd,f=new Eu,h=function(){var t=(0,E.Z)((0,k.Z)().mark((function t(){return(0,k.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(f.isEmpty()){t.next=2;break}return t.abrupt("return",e(f));case 2:if(!c){t.next=4;break}return t.abrupt("return",{done:!0});case 4:return t.next=6,new Promise((function(t,r){u=function(n){u=null,f.push(n);try{t(e(f))}catch(i){r(i)}return s}}));case 6:return t.abrupt("return",t.sent);case 7:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),d=function(e){return null!=u?u(e):(f.push(e),s)},p=function(e){var r;if(c)return s;if(!0!==(null===(r=t)||void 0===r?void 0:r.objectMode)&&null==(null===e||void 0===e?void 0:e.byteLength))throw new Error("objectMode was not true but tried to push non-Uint8Array value");return d({done:!1,value:e})},v=function(e){return c?s:(c=!0,null!=e?function(e){return f=new Eu,null!=u?u({error:e}):(f.push({error:e}),s)}(e):d({done:!0}))};if(B(n={},Symbol.asyncIterator,(function(){return this})),B(n,"next",h),B(n,"return",(function(){return f=new Eu,v(),{done:!0}})),B(n,"throw",(function(e){return v(e),{done:!0}})),B(n,"push",p),B(n,"end",v),"readableLength",(i={}).readableLength=i.readableLength||{},i.readableLength.get=function(){return f.size},wu(n,i),s=n,null==l)return s;var g=s;return B(o={},Symbol.asyncIterator,(function(){return this})),B(o,"next",(function(){return g.next()})),B(o,"throw",(function(e){return g.throw(e),null!=l&&(l(e),l=void 0),{done:!0}})),B(o,"return",(function(){return g.return(),null!=l&&(l(),l=void 0),{done:!0}})),B(o,"push",p),B(o,"end",(function(e){return g.end(e),null!=l&&(l(e),l=void 0),s})),"readableLength",(a={}).readableLength=a.readableLength||{},a.readableLength.get=function(){return g.readableLength},wu(o,a),s=o}var _u=__webpack_require__(8315),Au=function(){for(var e,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];for(;r.length>0;)e=r.shift()(e);return e},Iu=function(e){return null!=e&&("function"===typeof e[Symbol.asyncIterator]||"function"===typeof e[Symbol.iterator]||"function"===typeof e.next)},Cu=function(e){return null!=e&&"function"===typeof e.sink&&Iu(e.source)},Tu=function(e){return function(t){var r=e.sink(t);if(null!=r.then){var n=xu({objectMode:!0});r.then((function(){n.end()}),(function(e){n.end(e)}));var i=function(){var t=Gs((0,k.Z)().mark((function t(){return(0,k.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.delegateYield(Qs(Js(e.source)),"t0",1);case 1:n.end();case 2:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}();return _u(n,i())}return e.source}};function Pu(e){if(Cu(e)){var t=e;e=function(){return t.source}}else if(Iu(e)){var r=e;e=function(){return r}}for(var n=arguments.length,i=new Array(n>1?n-1:0),o=1;o<n;o++)i[o-1]=arguments[o];var a=[e].concat(i);if(a.length>1&&Cu(a[a.length-1])&&(a[a.length-1]=a[a.length-1].sink),a.length>2)for(var s=1;s<a.length-1;s++)Cu(a[s])&&(a[s]=Tu(a[s]));return Au.apply(void 0,Jr(a))}var Ru,Bu,Mu,Nu;wi("waku:select-peer");!function(e){var t;!function(e){var t;e.codec=function(){return null==t&&(t=Ni((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};!1!==r.lengthDelimited&&t.fork(),null!=e.contentTopic&&(t.uint32(10),t.string(e.contentTopic)),!1!==r.lengthDelimited&&t.ldelim()}),(function(e,t){for(var r={},n=null==t?e.len:e.pos+t;e.pos<n;){var i=e.uint32();if(i>>>3===1)r.contentTopic=e.string();else e.skipType(7&i)}return r}))),t},e.encode=function(t){return Ri(t,e.codec())},e.decode=function(t){return Si(t,e.codec())}}(e.ContentFilter||(e.ContentFilter={})),e.codec=function(){return null==t&&(t=Ni((function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!1!==n.lengthDelimited&&r.fork(),null!=t.subscribe&&(r.uint32(8),r.bool(t.subscribe)),null!=t.topic&&(r.uint32(18),r.string(t.topic)),null==t.contentFilters)throw new Error('Protocol error: required field "contentFilters" was not found in object');var i,o=$e(t.contentFilters);try{for(o.s();!(i=o.n()).done;){var a=i.value;r.uint32(26),e.ContentFilter.codec().encode(a,r)}}catch(s){o.e(s)}finally{o.f()}!1!==n.lengthDelimited&&r.ldelim()}),(function(t,r){for(var n={contentFilters:[]},i=null==r?t.len:t.pos+r;t.pos<i;){var o=t.uint32();switch(o>>>3){case 1:n.subscribe=t.bool();break;case 2:n.topic=t.string();break;case 3:n.contentFilters.push(e.ContentFilter.codec().decode(t,t.uint32()));break;default:t.skipType(7&o)}}return n}))),t},e.encode=function(t){return Ri(t,e.codec())},e.decode=function(t){return Si(t,e.codec())}}(Ru||(Ru={})),function(e){var t;e.codec=function(){return null==t&&(t=Ni((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!1!==r.lengthDelimited&&t.fork(),null==e.messages)throw new Error('Protocol error: required field "messages" was not found in object');var n,i=$e(e.messages);try{for(i.s();!(n=i.n()).done;){var o=n.value;t.uint32(10),Nu.codec().encode(o,t)}}catch(a){i.e(a)}finally{i.f()}!1!==r.lengthDelimited&&t.ldelim()}),(function(e,t){for(var r={messages:[]},n=null==t?e.len:e.pos+t;e.pos<n;){var i=e.uint32();if(i>>>3===1)r.messages.push(Nu.codec().decode(e,e.uint32()));else e.skipType(7&i)}return r}))),t},e.encode=function(t){return Ri(t,e.codec())},e.decode=function(t){return Si(t,e.codec())}}(Bu||(Bu={})),function(e){var t;e.codec=function(){return null==t&&(t=Ni((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};!1!==r.lengthDelimited&&t.fork(),null!=e.requestId&&(t.uint32(10),t.string(e.requestId)),null!=e.request&&(t.uint32(18),Ru.codec().encode(e.request,t)),null!=e.push&&(t.uint32(26),Bu.codec().encode(e.push,t)),!1!==r.lengthDelimited&&t.ldelim()}),(function(e,t){for(var r={},n=null==t?e.len:e.pos+t;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.requestId=e.string();break;case 2:r.request=Ru.codec().decode(e,e.uint32());break;case 3:r.push=Bu.codec().decode(e,e.uint32());break;default:e.skipType(7&i)}}return r}))),t},e.encode=function(t){return Ri(t,e.codec())},e.decode=function(t){return Si(t,e.codec())}}(Mu||(Mu={})),function(e){var t;e.codec=function(){return null==t&&(t=Ni((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};!1!==r.lengthDelimited&&t.fork(),null!=e.payload&&(t.uint32(10),t.bytes(e.payload)),null!=e.contentTopic&&(t.uint32(18),t.string(e.contentTopic)),null!=e.version&&(t.uint32(24),t.uint32(e.version)),null!=e.timestampDeprecated&&(t.uint32(33),t.double(e.timestampDeprecated)),null!=e.timestamp&&(t.uint32(80),t.sint64(e.timestamp)),!1!==r.lengthDelimited&&t.ldelim()}),(function(e,t){for(var r={},n=null==t?e.len:e.pos+t;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.payload=e.bytes();break;case 2:r.contentTopic=e.string();break;case 3:r.version=e.uint32();break;case 4:r.timestampDeprecated=e.double();break;case 10:r.timestamp=e.sint64();break;default:e.skipType(7&i)}}return r}))),t},e.encode=function(t){return Ri(t,e.codec())},e.decode=function(t){return Si(t,e.codec())}}(Nu||(Nu={}));var Ou,Du,Lu,Uu;wi("waku:filter");!function(e){var t;e.codec=function(){return null==t&&(t=Ni((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};!1!==r.lengthDelimited&&t.fork(),null!=e.pubSubTopic&&(t.uint32(10),t.string(e.pubSubTopic)),null!=e.message&&(t.uint32(18),Uu.codec().encode(e.message,t)),!1!==r.lengthDelimited&&t.ldelim()}),(function(e,t){for(var r={},n=null==t?e.len:e.pos+t;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.pubSubTopic=e.string();break;case 2:r.message=Uu.codec().decode(e,e.uint32());break;default:e.skipType(7&i)}}return r}))),t},e.encode=function(t){return Ri(t,e.codec())},e.decode=function(t){return Si(t,e.codec())}}(Ou||(Ou={})),function(e){var t;e.codec=function(){return null==t&&(t=Ni((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};!1!==r.lengthDelimited&&t.fork(),null!=e.isSuccess&&(t.uint32(8),t.bool(e.isSuccess)),null!=e.info&&(t.uint32(18),t.string(e.info)),!1!==r.lengthDelimited&&t.ldelim()}),(function(e,t){for(var r={},n=null==t?e.len:e.pos+t;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.isSuccess=e.bool();break;case 2:r.info=e.string();break;default:e.skipType(7&i)}}return r}))),t},e.encode=function(t){return Ri(t,e.codec())},e.decode=function(t){return Si(t,e.codec())}}(Du||(Du={})),function(e){var t;e.codec=function(){return null==t&&(t=Ni((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};!1!==r.lengthDelimited&&t.fork(),null!=e.requestId&&(t.uint32(10),t.string(e.requestId)),null!=e.request&&(t.uint32(18),Ou.codec().encode(e.request,t)),null!=e.response&&(t.uint32(26),Du.codec().encode(e.response,t)),!1!==r.lengthDelimited&&t.ldelim()}),(function(e,t){for(var r={},n=null==t?e.len:e.pos+t;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.requestId=e.string();break;case 2:r.request=Ou.codec().decode(e,e.uint32());break;case 3:r.response=Du.codec().decode(e,e.uint32());break;default:e.skipType(7&i)}}return r}))),t},e.encode=function(t){return Ri(t,e.codec())},e.decode=function(t){return Si(t,e.codec())}}(Lu||(Lu={})),function(e){var t;e.codec=function(){return null==t&&(t=Ni((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};!1!==r.lengthDelimited&&t.fork(),null!=e.payload&&(t.uint32(10),t.bytes(e.payload)),null!=e.contentTopic&&(t.uint32(18),t.string(e.contentTopic)),null!=e.version&&(t.uint32(24),t.uint32(e.version)),null!=e.timestampDeprecated&&(t.uint32(33),t.double(e.timestampDeprecated)),null!=e.timestamp&&(t.uint32(80),t.sint64(e.timestamp)),!1!==r.lengthDelimited&&t.ldelim()}),(function(e,t){for(var r={},n=null==t?e.len:e.pos+t;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.payload=e.bytes();break;case 2:r.contentTopic=e.string();break;case 3:r.version=e.uint32();break;case 4:r.timestampDeprecated=e.double();break;case 10:r.timestamp=e.sint64();break;default:e.skipType(7&i)}}return r}))),t},e.encode=function(t){return Ri(t,e.codec())},e.decode=function(t){return Si(t,e.codec())}}(Uu||(Uu={}));wi("waku:light-push"),wi("waku:message:version-0"),BigInt(1e6);var Fu,zu,Zu,ju,qu,Ku,Vu,Hu,Gu,Wu,Qu,Ju,Yu,Xu,$u,ec=["/vac/waku/relay/2.0.0-beta2","/vac/waku/relay/2.0.0"];!function(e){var t;e.codec=function(){return null==t&&(t=Ni((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};!1!==r.lengthDelimited&&t.fork(),null!=e.digest&&(t.uint32(10),t.bytes(e.digest)),null!=e.receivedTime&&(t.uint32(16),t.sint64(e.receivedTime)),null!=e.senderTime&&(t.uint32(24),t.sint64(e.senderTime)),null!=e.pubsubTopic&&(t.uint32(34),t.string(e.pubsubTopic)),!1!==r.lengthDelimited&&t.ldelim()}),(function(e,t){for(var r={},n=null==t?e.len:e.pos+t;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.digest=e.bytes();break;case 2:r.receivedTime=e.sint64();break;case 3:r.senderTime=e.sint64();break;case 4:r.pubsubTopic=e.string();break;default:e.skipType(7&i)}}return r}))),t},e.encode=function(t){return Ri(t,e.codec())},e.decode=function(t){return Si(t,e.codec())}}(Fu||(Fu={})),function(e){var t,r;!function(e){e.DIRECTION_BACKWARD_UNSPECIFIED="DIRECTION_BACKWARD_UNSPECIFIED",e.DIRECTION_FORWARD="DIRECTION_FORWARD"}(e.Direction||(e.Direction={})),function(e){e[e.DIRECTION_BACKWARD_UNSPECIFIED=0]="DIRECTION_BACKWARD_UNSPECIFIED",e[e.DIRECTION_FORWARD=1]="DIRECTION_FORWARD"}(t||(t={})),function(e){e.codec=function(){return Mi(t)}}(e.Direction||(e.Direction={})),e.codec=function(){return null==r&&(r=Ni((function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};!1!==n.lengthDelimited&&r.fork(),null!=t.pageSize&&(r.uint32(8),r.uint64(t.pageSize)),null!=t.cursor&&(r.uint32(18),Fu.codec().encode(t.cursor,r)),null!=t.direction&&(r.uint32(24),e.Direction.codec().encode(t.direction,r)),!1!==n.lengthDelimited&&r.ldelim()}),(function(t,r){for(var n={},i=null==r?t.len:t.pos+r;t.pos<i;){var o=t.uint32();switch(o>>>3){case 1:n.pageSize=t.uint64();break;case 2:n.cursor=Fu.codec().decode(t,t.uint32());break;case 3:n.direction=e.Direction.codec().decode(t);break;default:t.skipType(7&o)}}return n}))),r},e.encode=function(t){return Ri(t,e.codec())},e.decode=function(t){return Si(t,e.codec())}}(zu||(zu={})),function(e){var t;e.codec=function(){return null==t&&(t=Ni((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};!1!==r.lengthDelimited&&t.fork(),null!=e.contentTopic&&(t.uint32(10),t.string(e.contentTopic)),!1!==r.lengthDelimited&&t.ldelim()}),(function(e,t){for(var r={},n=null==t?e.len:e.pos+t;e.pos<n;){var i=e.uint32();if(i>>>3===1)r.contentTopic=e.string();else e.skipType(7&i)}return r}))),t},e.encode=function(t){return Ri(t,e.codec())},e.decode=function(t){return Si(t,e.codec())}}(Zu||(Zu={})),function(e){var t;e.codec=function(){return null==t&&(t=Ni((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!1!==r.lengthDelimited&&t.fork(),null!=e.pubSubTopic&&(t.uint32(18),t.string(e.pubSubTopic)),null==e.contentFilters)throw new Error('Protocol error: required field "contentFilters" was not found in object');var n,i=$e(e.contentFilters);try{for(i.s();!(n=i.n()).done;){var o=n.value;t.uint32(26),Zu.codec().encode(o,t)}}catch(a){i.e(a)}finally{i.f()}null!=e.pagingInfo&&(t.uint32(34),zu.codec().encode(e.pagingInfo,t)),null!=e.startTime&&(t.uint32(40),t.sint64(e.startTime)),null!=e.endTime&&(t.uint32(48),t.sint64(e.endTime)),!1!==r.lengthDelimited&&t.ldelim()}),(function(e,t){for(var r={contentFilters:[]},n=null==t?e.len:e.pos+t;e.pos<n;){var i=e.uint32();switch(i>>>3){case 2:r.pubSubTopic=e.string();break;case 3:r.contentFilters.push(Zu.codec().decode(e,e.uint32()));break;case 4:r.pagingInfo=zu.codec().decode(e,e.uint32());break;case 5:r.startTime=e.sint64();break;case 6:r.endTime=e.sint64();break;default:e.skipType(7&i)}}return r}))),t},e.encode=function(t){return Ri(t,e.codec())},e.decode=function(t){return Si(t,e.codec())}}(ju||(ju={})),function(e){var t,r;!function(e){e.ERROR_NONE_UNSPECIFIED="ERROR_NONE_UNSPECIFIED",e.ERROR_INVALID_CURSOR="ERROR_INVALID_CURSOR"}(e.HistoryError||(e.HistoryError={})),function(e){e[e.ERROR_NONE_UNSPECIFIED=0]="ERROR_NONE_UNSPECIFIED",e[e.ERROR_INVALID_CURSOR=1]="ERROR_INVALID_CURSOR"}(t||(t={})),function(e){e.codec=function(){return Mi(t)}}(e.HistoryError||(e.HistoryError={})),e.codec=function(){return null==r&&(r=Ni((function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!1!==n.lengthDelimited&&r.fork(),null==t.messages)throw new Error('Protocol error: required field "messages" was not found in object');var i,o=$e(t.messages);try{for(o.s();!(i=o.n()).done;){var a=i.value;r.uint32(18),Vu.codec().encode(a,r)}}catch(s){o.e(s)}finally{o.f()}null!=t.pagingInfo&&(r.uint32(26),zu.codec().encode(t.pagingInfo,r)),null!=t.error&&(r.uint32(32),e.HistoryError.codec().encode(t.error,r)),!1!==n.lengthDelimited&&r.ldelim()}),(function(t,r){for(var n={messages:[]},i=null==r?t.len:t.pos+r;t.pos<i;){var o=t.uint32();switch(o>>>3){case 2:n.messages.push(Vu.codec().decode(t,t.uint32()));break;case 3:n.pagingInfo=zu.codec().decode(t,t.uint32());break;case 4:n.error=e.HistoryError.codec().decode(t);break;default:t.skipType(7&o)}}return n}))),r},e.encode=function(t){return Ri(t,e.codec())},e.decode=function(t){return Si(t,e.codec())}}(qu||(qu={})),function(e){var t;e.codec=function(){return null==t&&(t=Ni((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};!1!==r.lengthDelimited&&t.fork(),null!=e.requestId&&(t.uint32(10),t.string(e.requestId)),null!=e.query&&(t.uint32(18),ju.codec().encode(e.query,t)),null!=e.response&&(t.uint32(26),qu.codec().encode(e.response,t)),!1!==r.lengthDelimited&&t.ldelim()}),(function(e,t){for(var r={},n=null==t?e.len:e.pos+t;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.requestId=e.string();break;case 2:r.query=ju.codec().decode(e,e.uint32());break;case 3:r.response=qu.codec().decode(e,e.uint32());break;default:e.skipType(7&i)}}return r}))),t},e.encode=function(t){return Ri(t,e.codec())},e.decode=function(t){return Si(t,e.codec())}}(Ku||(Ku={})),function(e){var t;e.codec=function(){return null==t&&(t=Ni((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};!1!==r.lengthDelimited&&t.fork(),null!=e.payload&&(t.uint32(10),t.bytes(e.payload)),null!=e.contentTopic&&(t.uint32(18),t.string(e.contentTopic)),null!=e.version&&(t.uint32(24),t.uint32(e.version)),null!=e.timestampDeprecated&&(t.uint32(33),t.double(e.timestampDeprecated)),null!=e.timestamp&&(t.uint32(80),t.sint64(e.timestamp)),!1!==r.lengthDelimited&&t.ldelim()}),(function(e,t){for(var r={},n=null==t?e.len:e.pos+t;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.payload=e.bytes();break;case 2:r.contentTopic=e.string();break;case 3:r.version=e.uint32();break;case 4:r.timestampDeprecated=e.double();break;case 10:r.timestamp=e.sint64();break;default:e.skipType(7&i)}}return r}))),t},e.encode=function(t){return Ri(t,e.codec())},e.decode=function(t){return Si(t,e.codec())}}(Vu||(Vu={})),function(e){var t;e.codec=function(){return null==t&&(t=Ni((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};!1!==r.lengthDelimited&&t.fork(),null!=e.digest&&(t.uint32(10),t.bytes(e.digest)),null!=e.receivedTime&&(t.uint32(17),t.double(e.receivedTime)),null!=e.senderTime&&(t.uint32(25),t.double(e.senderTime)),!1!==r.lengthDelimited&&t.ldelim()}),(function(e,t){for(var r={},n=null==t?e.len:e.pos+t;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.digest=e.bytes();break;case 2:r.receivedTime=e.double();break;case 3:r.senderTime=e.double();break;default:e.skipType(7&i)}}return r}))),t},e.encode=function(t){return Ri(t,e.codec())},e.decode=function(t){return Si(t,e.codec())}}(Hu||(Hu={})),function(e){var t,r;!function(e){e.DIRECTION_BACKWARD_UNSPECIFIED="DIRECTION_BACKWARD_UNSPECIFIED",e.DIRECTION_FORWARD="DIRECTION_FORWARD"}(e.Direction||(e.Direction={})),function(e){e[e.DIRECTION_BACKWARD_UNSPECIFIED=0]="DIRECTION_BACKWARD_UNSPECIFIED",e[e.DIRECTION_FORWARD=1]="DIRECTION_FORWARD"}(t||(t={})),function(e){e.codec=function(){return Mi(t)}}(e.Direction||(e.Direction={})),e.codec=function(){return null==r&&(r=Ni((function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};!1!==n.lengthDelimited&&r.fork(),null!=t.pageSize&&(r.uint32(8),r.uint64(t.pageSize)),null!=t.cursor&&(r.uint32(18),Hu.codec().encode(t.cursor,r)),null!=t.direction&&(r.uint32(24),e.Direction.codec().encode(t.direction,r)),!1!==n.lengthDelimited&&r.ldelim()}),(function(t,r){for(var n={},i=null==r?t.len:t.pos+r;t.pos<i;){var o=t.uint32();switch(o>>>3){case 1:n.pageSize=t.uint64();break;case 2:n.cursor=Hu.codec().decode(t,t.uint32());break;case 3:n.direction=e.Direction.codec().decode(t);break;default:t.skipType(7&o)}}return n}))),r},e.encode=function(t){return Ri(t,e.codec())},e.decode=function(t){return Si(t,e.codec())}}(Gu||(Gu={})),function(e){var t;e.codec=function(){return null==t&&(t=Ni((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};!1!==r.lengthDelimited&&t.fork(),null!=e.contentTopic&&(t.uint32(10),t.string(e.contentTopic)),!1!==r.lengthDelimited&&t.ldelim()}),(function(e,t){for(var r={},n=null==t?e.len:e.pos+t;e.pos<n;){var i=e.uint32();if(i>>>3===1)r.contentTopic=e.string();else e.skipType(7&i)}return r}))),t},e.encode=function(t){return Ri(t,e.codec())},e.decode=function(t){return Si(t,e.codec())}}(Wu||(Wu={})),function(e){var t;e.codec=function(){return null==t&&(t=Ni((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!1!==r.lengthDelimited&&t.fork(),null!=e.pubSubTopic&&(t.uint32(18),t.string(e.pubSubTopic)),null==e.contentFilters)throw new Error('Protocol error: required field "contentFilters" was not found in object');var n,i=$e(e.contentFilters);try{for(i.s();!(n=i.n()).done;){var o=n.value;t.uint32(26),Wu.codec().encode(o,t)}}catch(a){i.e(a)}finally{i.f()}null!=e.pagingInfo&&(t.uint32(34),Gu.codec().encode(e.pagingInfo,t)),null!=e.startTime&&(t.uint32(41),t.double(e.startTime)),null!=e.endTime&&(t.uint32(49),t.double(e.endTime)),!1!==r.lengthDelimited&&t.ldelim()}),(function(e,t){for(var r={contentFilters:[]},n=null==t?e.len:e.pos+t;e.pos<n;){var i=e.uint32();switch(i>>>3){case 2:r.pubSubTopic=e.string();break;case 3:r.contentFilters.push(Wu.codec().decode(e,e.uint32()));break;case 4:r.pagingInfo=Gu.codec().decode(e,e.uint32());break;case 5:r.startTime=e.double();break;case 6:r.endTime=e.double();break;default:e.skipType(7&i)}}return r}))),t},e.encode=function(t){return Ri(t,e.codec())},e.decode=function(t){return Si(t,e.codec())}}(Qu||(Qu={})),function(e){var t,r;!function(e){e.ERROR_NONE_UNSPECIFIED="ERROR_NONE_UNSPECIFIED",e.ERROR_INVALID_CURSOR="ERROR_INVALID_CURSOR"}(e.HistoryError||(e.HistoryError={})),function(e){e[e.ERROR_NONE_UNSPECIFIED=0]="ERROR_NONE_UNSPECIFIED",e[e.ERROR_INVALID_CURSOR=1]="ERROR_INVALID_CURSOR"}(t||(t={})),function(e){e.codec=function(){return Mi(t)}}(e.HistoryError||(e.HistoryError={})),e.codec=function(){return null==r&&(r=Ni((function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!1!==n.lengthDelimited&&r.fork(),null==t.messages)throw new Error('Protocol error: required field "messages" was not found in object');var i,o=$e(t.messages);try{for(o.s();!(i=o.n()).done;){var a=i.value;r.uint32(18),Xu.codec().encode(a,r)}}catch(s){o.e(s)}finally{o.f()}null!=t.pagingInfo&&(r.uint32(26),Gu.codec().encode(t.pagingInfo,r)),null!=t.error&&(r.uint32(32),e.HistoryError.codec().encode(t.error,r)),!1!==n.lengthDelimited&&r.ldelim()}),(function(t,r){for(var n={messages:[]},i=null==r?t.len:t.pos+r;t.pos<i;){var o=t.uint32();switch(o>>>3){case 2:n.messages.push(Xu.codec().decode(t,t.uint32()));break;case 3:n.pagingInfo=Gu.codec().decode(t,t.uint32());break;case 4:n.error=e.HistoryError.codec().decode(t);break;default:t.skipType(7&o)}}return n}))),r},e.encode=function(t){return Ri(t,e.codec())},e.decode=function(t){return Si(t,e.codec())}}(Ju||(Ju={})),function(e){var t;e.codec=function(){return null==t&&(t=Ni((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};!1!==r.lengthDelimited&&t.fork(),null!=e.requestId&&(t.uint32(10),t.string(e.requestId)),null!=e.query&&(t.uint32(18),Qu.codec().encode(e.query,t)),null!=e.response&&(t.uint32(26),Ju.codec().encode(e.response,t)),!1!==r.lengthDelimited&&t.ldelim()}),(function(e,t){for(var r={},n=null==t?e.len:e.pos+t;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.requestId=e.string();break;case 2:r.query=Qu.codec().decode(e,e.uint32());break;case 3:r.response=Ju.codec().decode(e,e.uint32());break;default:e.skipType(7&i)}}return r}))),t},e.encode=function(t){return Ri(t,e.codec())},e.decode=function(t){return Si(t,e.codec())}}(Yu||(Yu={})),function(e){var t;e.codec=function(){return null==t&&(t=Ni((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};!1!==r.lengthDelimited&&t.fork(),null!=e.payload&&(t.uint32(10),t.bytes(e.payload)),null!=e.contentTopic&&(t.uint32(18),t.string(e.contentTopic)),null!=e.version&&(t.uint32(24),t.uint32(e.version)),null!=e.timestampDeprecated&&(t.uint32(33),t.double(e.timestampDeprecated)),null!=e.timestamp&&(t.uint32(80),t.sint64(e.timestamp)),!1!==r.lengthDelimited&&t.ldelim()}),(function(e,t){for(var r={},n=null==t?e.len:e.pos+t;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.payload=e.bytes();break;case 2:r.contentTopic=e.string();break;case 3:r.version=e.uint32();break;case 4:r.timestampDeprecated=e.double();break;case 10:r.timestamp=e.sint64();break;default:e.skipType(7&i)}}return r}))),t},e.encode=function(t){return Ri(t,e.codec())},e.decode=function(t){return Si(t,e.codec())}}(Xu||(Xu={})),function(e){e.V2Beta3="/vac/waku/store/2.0.0-beta3",e.V2Beta4="/vac/waku/store/2.0.0-beta4"}($u||($u={}));var tc;BigInt(1e6);!function(e){e.BACKWARD="backward",e.FORWARD="forward"}(tc||(tc={}));qu.HistoryError,wi("waku:store");var rc;wi("waku:waku");!function(e){e.Relay="relay",e.Store="store",e.LightPush="lightpush",e.Filter="filter"}(rc||(rc={}));var nc,ic="ERR_SIGNATURE_NOT_VALID";!function(e){var t;e.codec=function(){return null==t&&(t=Ni((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!1!==r.lengthDelimited&&t.fork(),null==e.publicKey)throw new Error('Protocol error: required field "publicKey" was not found in object');if(t.uint32(10),t.bytes(e.publicKey),null==e.payloadType)throw new Error('Protocol error: required field "payloadType" was not found in object');if(t.uint32(18),t.bytes(e.payloadType),null==e.payload)throw new Error('Protocol error: required field "payload" was not found in object');if(t.uint32(26),t.bytes(e.payload),null==e.signature)throw new Error('Protocol error: required field "signature" was not found in object');t.uint32(42),t.bytes(e.signature),!1!==r.lengthDelimited&&t.ldelim()}),(function(e,t){for(var r={publicKey:new Uint8Array(0),payloadType:new Uint8Array(0),payload:new Uint8Array(0),signature:new Uint8Array(0)},n=null==t?e.len:e.pos+t;e.pos<n;){var i=e.uint32();switch(i>>>3){case 1:r.publicKey=e.bytes();break;case 2:r.payloadType=e.bytes();break;case 3:r.payload=e.bytes();break;case 5:r.signature=e.bytes();break;default:e.skipType(7&i)}}if(null==r.publicKey)throw new Error('Protocol error: value for required field "publicKey" was not found in protobuf');if(null==r.payloadType)throw new Error('Protocol error: value for required field "payloadType" was not found in protobuf');if(null==r.payload)throw new Error('Protocol error: value for required field "payload" was not found in protobuf');if(null==r.signature)throw new Error('Protocol error: value for required field "signature" was not found in protobuf');return r}))),t},e.encode=function(t){return Ri(t,e.codec())},e.decode=function(t){return Si(t,e.codec())}}(nc||(nc={}));var oc=function(){function e(t){(0,D.Z)(this,e);var r=t.peerId,n=t.payloadType,i=t.payload,o=t.signature;this.peerId=r,this.payloadType=n,this.payload=i,this.signature=o}return(0,O.Z)(e,[{key:"marshal",value:function(){if(null==this.peerId.publicKey)throw new Error("Missing public key");return null==this.marshaled&&(this.marshaled=nc.encode({publicKey:this.peerId.publicKey,payloadType:this.payloadType,payload:this.payload.subarray(),signature:this.signature})),this.marshaled}},{key:"equals",value:function(e){return ji(this.marshal(),e.marshal())}},{key:"validate",value:function(){var e=(0,E.Z)((0,k.Z)().mark((function e(t){var r,n;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=ac(t,this.payloadType,this.payload),null!=this.peerId.publicKey){e.next=3;break}throw new Error("Missing public key");case 3:return n=es(this.peerId.publicKey),e.next=6,n.verify(r.subarray(),this.signature);case 6:return e.abrupt("return",e.sent);case 7:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()}]),e}();oc.createFromProtobuf=function(){var e=(0,E.Z)((0,k.Z)().mark((function e(t){var r,n;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=nc.decode(t),e.next=3,ds(r.publicKey);case 3:return n=e.sent,e.abrupt("return",new oc({peerId:n,payloadType:r.payloadType,payload:r.payload,signature:r.signature}));case 5:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}(),oc.seal=function(){var e=(0,E.Z)((0,k.Z)().mark((function e(t,r){var n,i,o,a,s,u;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=r.privateKey){e.next=2;break}throw new Error("Missing private key");case 2:return n=t.domain,i=t.codec,o=t.marshal(),a=ac(n,i,o),e.next=8,rs(r.privateKey);case 8:return s=e.sent,e.next=11,s.sign(a.subarray());case 11:return u=e.sent,e.abrupt("return",new oc({peerId:r,payloadType:i,payload:o,signature:u}));case 13:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),oc.openAndCertify=function(){var e=(0,E.Z)((0,k.Z)().mark((function e(t,r){var n;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,oc.createFromProtobuf(t);case 2:return n=e.sent,e.next=5,n.validate(r);case 5:if(e.sent){e.next=8;break}throw Di(new Error("envelope signature is not valid for the given domain"),ic);case 8:return e.abrupt("return",n);case 9:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}();var ac=function(e,t,r){var n=Fr(e),i=pu.encode(n.byteLength),o=pu.encode(t.length),a=pu.encode(r.length);return new tu(i,n,o,t,a,r)},sc=ti,uc=ei,cc=function e(t){var r=0;if(t=t.toString().trim(),sc(t)){var n=new Uint8Array(r+4);return t.split(/\./g).forEach((function(e){n[r++]=255&parseInt(e,10)})),n}if(uc(t)){var i,o=t.split(":",8);for(i=0;i<o.length;i++){var a=void 0;sc(o[i])&&(a=e(o[i]),o[i]=zr(a.slice(0,2),"base16")),null!=a&&++i<8&&o.splice(i,0,zr(a.slice(2,4),"base16"))}if(""===o[0])for(;o.length<8;)o.unshift("0");else if(""===o[o.length-1])for(;o.length<8;)o.push("0");else if(o.length<8){for(i=0;i<o.length&&""!==o[i];i++);var s=[i,1];for(i=9-o.length;i>0;i--)s.push("0");o.splice.apply(o,s)}var u=new Uint8Array(r+16);for(i=0;i<o.length;i++){var c=parseInt(o[i],16);u[r++]=c>>8&255,u[r++]=255&c}return u}throw new Error("invalid ip address")},lc=-1,fc={},hc={};function dc(e,t,r,n,i){return{code:e,size:t,name:r,resolvable:Boolean(n),path:Boolean(i)}}function pc(e){if("number"===typeof e){if(null!=hc[e])return hc[e];throw new Error("no protocol with code: ".concat(e))}if("string"===typeof e){if(null!=fc[e])return fc[e];throw new Error("no protocol with name: ".concat(e))}throw new Error("invalid protocol id type: ".concat(typeof e))}function vc(e,t){switch(pc(e).code){case 4:case 41:return function(e){var t=function(e){var t,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,n=arguments.length>2?arguments[2]:void 0;r=~~r,n=null!==(t=n)&&void 0!==t?t:e.length-r;var i=new DataView(e.buffer);if(4===n){for(var o=[],a=0;a<n;a++)o.push(e[r+a]);return o.join(".")}if(16===n){for(var s=[],u=0;u<n;u+=2)s.push(i.getUint16(r+u).toString(16));return s.join(":").replace(/(^|:)0(:0)*:0(:|$)/,"$1::$3").replace(/:{3,4}/,"::")}return""}(e,0,e.length);if(null==t)throw new Error("ipBuff is required");if(!$n(t))throw new Error("invalid ip address");return t}(t);case 6:case 273:case 33:case 132:return Ec(t).toString();case 53:case 54:case 55:case 56:case 400:case 777:return function(e){var t=li.decode(e);if((e=e.slice(li.decode.bytes)).length!==t)throw new Error("inconsistent lengths");return zr(e)}(t);case 421:return function(e){var t=li.decode(e),r=e.slice(li.decode.bytes);if(r.length!==t)throw new Error("inconsistent lengths");return zr(r,"base58btc")}(t);case 444:case 445:return xc(t);case 466:return function(e){var t=li.decode(e),r=e.slice(li.decode.bytes);if(r.length!==t)throw new Error("inconsistent lengths");return"u"+zr(r,"base64url")}(t);default:return zr(t,"base16")}}function gc(e,t){switch(pc(e).code){case 4:case 41:return wc(t);case 6:case 273:case 33:case 132:return kc(parseInt(t,10));case 53:case 54:case 55:case 56:case 400:case 777:return function(e){var t=Fr(e),r=Uint8Array.from(li.encode(t.length));return fi([r,t],r.length+t.length)}(t);case 421:return function(e){var t;t="Q"===e[0]||"1"===e[0]?tr(Ct.decode("z".concat(e))).bytes:wr.parse(e).multihash.bytes;var r=Uint8Array.from(li.encode(t.length));return fi([r,t],r.length+t.length)}(t);case 444:return function(e){var t=e.split(":");if(2!==t.length)throw new Error("failed to parse onion addr: [\"'".concat(t.join('", "'),"'\"]' does not contain a port number"));if(16!==t[0].length)throw new Error("failed to parse onion addr: ".concat(t[0]," not a Tor onion address."));var r=yt.decode("b"+t[0]),n=parseInt(t[1],10);if(n<1||n>65536)throw new Error("Port number is not in range(1, 65536)");var i=kc(n);return fi([r,i],r.length+i.length)}(t);case 445:return function(e){var t=e.split(":");if(2!==t.length)throw new Error("failed to parse onion addr: [\"'".concat(t.join('", "'),"'\"]' does not contain a port number"));if(56!==t[0].length)throw new Error("failed to parse onion addr: ".concat(t[0]," not a Tor onion3 address."));var r=yt.decode("b".concat(t[0])),n=parseInt(t[1],10);if(n<1||n>65536)throw new Error("Port number is not in range(1, 65536)");var i=kc(n);return fi([r,i],r.length+i.length)}(t);case 466:return function(e){var t=bc.decode(e),r=Uint8Array.from(li.encode(t.length));return fi([r,t],r.length+t.length)}(t);default:return Fr(t,"base16")}}[[4,32,"ip4"],[6,16,"tcp"],[33,16,"dccp"],[41,128,"ip6"],[42,lc,"ip6zone"],[53,lc,"dns",!0],[54,lc,"dns4",!0],[55,lc,"dns6",!0],[56,lc,"dnsaddr",!0],[132,16,"sctp"],[273,16,"udp"],[275,0,"p2p-webrtc-star"],[276,0,"p2p-webrtc-direct"],[277,0,"p2p-stardust"],[280,0,"webrtc"],[290,0,"p2p-circuit"],[301,0,"udt"],[302,0,"utp"],[400,lc,"unix",!1,!0],[421,lc,"ipfs"],[421,lc,"p2p"],[443,0,"https"],[444,96,"onion"],[445,296,"onion3"],[446,lc,"garlic64"],[460,0,"quic"],[465,0,"webtransport"],[466,lc,"certhash"],[477,0,"ws"],[478,0,"wss"],[479,0,"p2p-websocket-star"],[480,0,"http"],[777,lc,"memory"]].forEach((function(e){var t=dc.apply(void 0,Jr(e));hc[t.code]=t,fc[t.name]=t}));var yc,mc=Object.values(Br).map((function(e){return e.decoder})),bc=function(){var e=mc[0].or(mc[1]);return mc.slice(2).forEach((function(t){return e=e.or(t)})),e}();function wc(e){if(!$n(e))throw new Error("invalid ip address");return cc(e)}function kc(e){var t=new ArrayBuffer(2);return new DataView(t).setUint16(0,e),new Uint8Array(t)}function Ec(e){return new DataView(e.buffer).getUint16(e.byteOffset)}function xc(e){var t=e.slice(0,e.length-2),r=e.slice(e.length-2),n=zr(t,"base32"),i=Ec(r);return"".concat(n,":").concat(i)}function Sc(e){return e.map((function(e){var t=Nc(e);return null!=e[1]?[t.code,vc(t.code,e[1])]:[t.code]}))}function _c(e){return Pc(fi(e.map((function(e){var t=Nc(e),r=Uint8Array.from(li.encode(t.code));return e.length>1&&null!=e[1]&&(r=fi([r,e[1]])),r}))))}function Ac(e,t){return e.size>0?e.size/8:0===e.size?0:li.decode(t)+li.decode.bytes}function Ic(e){for(var t=[],r=0;r<e.length;){var n=li.decode(e,r),i=li.decode.bytes,o=Ac(pc(n),e.slice(r+i));if(0!==o){var a=e.slice(r+i,r+i+o);if((r+=o+i)>e.length)throw Mc("Invalid address Uint8Array: "+zr(e,"base16"));t.push([n,a])}else t.push([n]),r+=i}return t}function Cc(e){return function(e){var t=[];return e.map((function(e){var r=Nc(e);return t.push(r.name),e.length>1&&null!=e[1]&&t.push(e[1]),null})),Bc(t.join("/"))}(Sc(Ic(e)))}function Tc(e){var t=function(e){var t=[],r=e.split("/").slice(1);if(1===r.length&&""===r[0])return[];for(var n=0;n<r.length;n++){var i=r[n],o=pc(i);if(0!==o.size){if(++n>=r.length)throw Mc("invalid address: "+e);if(!0===o.path){t.push([i,Bc(r.slice(n).join("/"))]);break}t.push([i,r[n]])}else t.push([i])}return t}(e=Bc(e));return _c(t.map((function(e){Array.isArray(e)||(e=[e]);var t=Nc(e);return e.length>1?[t.code,gc(t.code,e[1])]:[t.code]})))}function Pc(e){var t=Rc(e);if(null!=t)throw t;return Uint8Array.from(e)}function Rc(e){try{Ic(e)}catch(t){return t}}function Bc(e){return"/"+e.trim().split("/").filter((function(e){return e})).join("/")}function Mc(e){return new Error("Error parsing address: "+e)}function Nc(e){return pc(e[0])}var Oc=Symbol.for("nodejs.util.inspect.custom"),Dc=[pc("dns").code,pc("dns4").code,pc("dns6").code,pc("dnsaddr").code],Lc=[pc("p2p").code,pc("ipfs").code],Uc=new Map,Fc=Symbol.for("@multiformats/js-multiaddr/multiaddr");function zc(e){return Boolean(null===e||void 0===e?void 0:e[Fc])}var Zc,jc=function(e){function t(e){if((0,D.Z)(this,t),this[yc]=!0,null==e&&(e=""),e instanceof Uint8Array)this.bytes=Pc(e);else if("string"===typeof e){if(e.length>0&&"/"!==e.charAt(0))throw new Error('multiaddr "'.concat(e,'" must start with a "/"'));this.bytes=Tc(e)}else{if(!zc(e))throw new Error("addr must be a string, Buffer, or another Multiaddr");this.bytes=Pc(e.bytes)}}return(0,O.Z)(t,[{key:"toString",value:function(){return Cc(this.bytes)}},{key:"toJSON",value:function(){return this.toString()}},{key:"toOptions",value:function(){var e,t,r=this.protoCodes(),n=this.toString().split("/").slice(1);if(n.length>2)Dc.includes(r[0])&&Lc.includes(r[1])?(e=pc("tcp").name,t=443):(e=pc(n[2]).name,t=parseInt(n[3]));else{if(!Dc.includes(r[0]))throw new Error('multiaddr must have a valid format: "/{ip4, ip6, dns4, dns6, dnsaddr}/{address}/{tcp, udp}/{port}".');e=pc("tcp").name,t=443}return{family:41===r[0]||55===r[0]?6:4,host:n[1],transport:e,port:t}}},{key:"protos",value:function(){return this.protoCodes().map((function(e){return Object.assign({},pc(e))}))}},{key:"protoCodes",value:function(){for(var e=[],t=this.bytes,r=0;r<t.length;){var n=li.decode(t,r),i=li.decode.bytes;r+=Ac(pc(n),t.slice(r+i))+i,e.push(n)}return e}},{key:"protoNames",value:function(){return this.protos().map((function(e){return e.name}))}},{key:"tuples",value:function(){return Ic(this.bytes)}},{key:"stringTuples",value:function(){return Sc(Ic(this.bytes))}},{key:"encapsulate",value:function(e){return e=new t(e),new t(this.toString()+e.toString())}},{key:"decapsulate",value:function(e){var r=e.toString(),n=this.toString(),i=n.lastIndexOf(r);if(i<0)throw new Error("Address ".concat(this.toString()," does not contain subaddress: ").concat(e.toString()));return new t(n.slice(0,i))}},{key:"decapsulateCode",value:function(e){for(var r=this.tuples(),n=r.length-1;n>=0;n--)if(r[n][0]===e)return new t(_c(r.slice(0,n)));return this}},{key:"getPeerId",value:function(){try{var e=this.stringTuples().filter((function(e){return e[0]===fc.ipfs.code})),t=e.pop();if(null!=(null===t||void 0===t?void 0:t[1])){var r=t[1];return"Q"===r[0]||"1"===r[0]?zr(Ct.decode("z".concat(r)),"base58btc"):zr(wr.parse(r).multihash.bytes,"base58btc")}return null}catch(n){return null}}},{key:"getPath",value:function(){var e=null;try{null==(e=this.stringTuples().filter((function(e){return!0===pc(e[0]).path}))[0][1])&&(e=null)}catch(t){e=null}return e}},{key:"equals",value:function(e){return ji(this.bytes,e.bytes)}},{key:"resolve",value:function(){var e=(0,E.Z)((0,k.Z)().mark((function e(r){var n,i,o;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=(n=this.protos().find((function(e){return e.resolvable})))){e.next=3;break}return e.abrupt("return",[this]);case 3:if(null!=(i=Uc.get(n.name))){e.next=6;break}throw Di(new Error("no available resolver for ".concat(n.name)),"ERR_NO_AVAILABLE_RESOLVER");case 6:return e.next=8,i(this,r);case 8:return o=e.sent,e.abrupt("return",o.map((function(e){return new t(e)})));case 10:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"nodeAddress",value:function(){var e=this.toOptions();if("tcp"!==e.transport&&"udp"!==e.transport)throw new Error('multiaddr must have a valid format - no protocol with name: "'.concat(e.transport,'". Must have a valid transport protocol: "{tcp, udp}"'));return{family:e.family,address:e.host,port:e.port}}},{key:"isThinWaistAddress",value:function(e){var t=(null!==e&&void 0!==e?e:this).protos();return 2===t.length&&((4===t[0].code||41===t[0].code)&&(6===t[1].code||273===t[1].code))}},{key:e,value:function(){return this.inspect()}},{key:"inspect",value:function(){return"<Multiaddr "+zr(this.bytes,"base16")+" - "+Cc(this.bytes)+">"}}]),t}((yc=Fc,Oc));!function(e){var t;!function(e){var t;e.codec=function(){return null==t&&(t=Ni((function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!1!==r.lengthDelimited&&t.fork(),null==e.multiaddr)throw new Error('Protocol error: required field "multiaddr" was not found in object');t.uint32(10),t.bytes(e.multiaddr),!1!==r.lengthDelimited&&t.ldelim()}),(function(e,t){for(var r={multiaddr:new Uint8Array(0)},n=null==t?e.len:e.pos+t;e.pos<n;){var i=e.uint32();if(i>>>3===1)r.multiaddr=e.bytes();else e.skipType(7&i)}if(null==r.multiaddr)throw new Error('Protocol error: value for required field "multiaddr" was not found in protobuf');return r}))),t},e.encode=function(t){return Ri(t,e.codec())},e.decode=function(t){return Si(t,e.codec())}}(e.AddressInfo||(e.AddressInfo={})),e.codec=function(){return null==t&&(t=Ni((function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!1!==n.lengthDelimited&&r.fork(),null==t.peerId)throw new Error('Protocol error: required field "peerId" was not found in object');if(r.uint32(10),r.bytes(t.peerId),null==t.seq)throw new Error('Protocol error: required field "seq" was not found in object');if(r.uint32(16),r.uint64(t.seq),null==t.addresses)throw new Error('Protocol error: required field "addresses" was not found in object');var i,o=$e(t.addresses);try{for(o.s();!(i=o.n()).done;){var a=i.value;r.uint32(26),e.AddressInfo.codec().encode(a,r)}}catch(s){o.e(s)}finally{o.f()}!1!==n.lengthDelimited&&r.ldelim()}),(function(t,r){for(var n={peerId:new Uint8Array(0),seq:0n,addresses:[]},i=null==r?t.len:t.pos+r;t.pos<i;){var o=t.uint32();switch(o>>>3){case 1:n.peerId=t.bytes();break;case 2:n.seq=t.uint64();break;case 3:n.addresses.push(e.AddressInfo.codec().decode(t,t.uint32()));break;default:t.skipType(7&o)}}if(null==n.peerId)throw new Error('Protocol error: value for required field "peerId" was not found in protobuf');if(null==n.seq)throw new Error('Protocol error: value for required field "seq" was not found in protobuf');return n}))),t},e.encode=function(t){return Ri(t,e.codec())},e.decode=function(t){return Si(t,e.codec())}}(Zc||(Zc={}));var qc=Uint8Array.from([3,1]),Kc=function(){function e(t){(0,D.Z)(this,e),this.domain=e.DOMAIN,this.codec=e.CODEC;var r=t.peerId,n=t.multiaddrs,i=t.seqNumber;this.peerId=r,this.multiaddrs=null!==n&&void 0!==n?n:[],this.seqNumber=null!==i&&void 0!==i?i:BigInt(Date.now())}return(0,O.Z)(e,[{key:"marshal",value:function(){return null==this.marshaled&&(this.marshaled=Zc.encode({peerId:this.peerId.toBytes(),seq:BigInt(this.seqNumber),addresses:this.multiaddrs.map((function(e){return{multiaddr:e.bytes}}))})),this.marshaled}},{key:"equals",value:function(t){return t instanceof e&&(!!this.peerId.equals(t.peerId)&&(this.seqNumber===t.seqNumber&&!!function(e,t){var r=function(e,t){return e.toString().localeCompare(t.toString())};return e.length===t.length&&(t.sort(r),e.sort(r).every((function(e,r){return t[r].equals(e)})))}(this.multiaddrs,t.multiaddrs)))}}]),e}();function Vc(e){return Object.assign(wi(e),{error:wi("".concat(e,":error")),trace:wi("".concat(e,":trace"))})}Kc.createFromProtobuf=function(e){var t,r=Zc.decode(e),n=hs(r.peerId),i=(null!==(t=r.addresses)&&void 0!==t?t:[]).map((function(e){return t=e.multiaddr,new jc(t);var t})),o=r.seq;return new Kc({peerId:n,multiaddrs:i,seqNumber:o})},Kc.DOMAIN="libp2p-peer-record",Kc.CODEC=qc,wi.formatters.b=function(e){return null==e?"undefined":Ct.baseEncode(e)},wi.formatters.t=function(e){return null==e?"undefined":yt.baseEncode(e)},wi.formatters.m=function(e){return null==e?"undefined":Pt.baseEncode(e)},wi.formatters.p=function(e){return null==e?"undefined":e.toString()},wi.formatters.c=function(e){return null==e?"undefined":e.toString()},wi.formatters.k=function(e){return null==e?"undefined":e.toString()};var Hc=Symbol.for("@libp2p/topology");var Gc,Wc=function(){},Qc=function(e){function t(e){var r,n,i,o;(0,D.Z)(this,t),this.min=null!==(r=e.min)&&void 0!==r?r:0,this.max=null!==(n=e.max)&&void 0!==n?n:1/0,this.peers=new Set,this.onConnect=null!==(i=e.onConnect)&&void 0!==i?i:Wc,this.onDisconnect=null!==(o=e.onDisconnect)&&void 0!==o?o:Wc}return(0,O.Z)(t,[{key:e,get:function(){return Hc.toString()}},{key:Hc,get:function(){return!0}},{key:"setRegistrar",value:function(){var e=(0,E.Z)((0,k.Z)().mark((function e(t){return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.registrar=t;case 1:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"disconnect",value:function(e){this.onDisconnect(e)}}]),t}(Symbol.toStringTag);var Jc,Yc=function(e,t,r,n){if("a"===r&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"===typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===r?n:"a"===r?n.call(e):n?n.value:t.get(e)},Xc=function(e){U(r,e);var t=K(r);function r(){var e;return(0,D.Z)(this,r),e=t.apply(this,arguments),Jc.set(j(e),new Map),e}return(0,O.Z)(r,[{key:"listenerCount",value:function(e){var t=Yc(this,Jc,"f").get(e);return null==t?0:t.length}},{key:"addEventListener",value:function(e,t,n){var i;Xr(F(r.prototype),"addEventListener",this).call(this,e,t,n);var o=Yc(this,Jc,"f").get(e);null==o&&(o=[],Yc(this,Jc,"f").set(e,o)),o.push({callback:t,once:null!==(i=!0!==n&&!1!==n&&(null===n||void 0===n?void 0:n.once))&&void 0!==i&&i})}},{key:"removeEventListener",value:function(e,t,n){Xr(F(r.prototype),"removeEventListener",this).call(this,e.toString(),null!==t&&void 0!==t?t:null,n);var i=Yc(this,Jc,"f").get(e);null!=i&&(i=i.filter((function(e){return e.callback!==t})),Yc(this,Jc,"f").set(e,i))}},{key:"dispatchEvent",value:function(e){var t=Xr(F(r.prototype),"dispatchEvent",this).call(this,e),n=Yc(this,Jc,"f").get(e.type);return null==n||(n=n.filter((function(e){return!e.once})),Yc(this,Jc,"f").set(e.type,n)),t}}]),r}(H(EventTarget));Jc=new WeakMap;var $c=function(e){U(r,e);var t=K(r);function r(e,n){var i;return(0,D.Z)(this,r),(i=t.call(this,e,n)).detail=null===n||void 0===n?void 0:n.detail,i}return(0,O.Z)(r)}(H(Event)),el=null!==(Gc=globalThis.CustomEvent)&&void 0!==Gc?Gc:$c,tl=function(){function e(t,r,n){(0,D.Z)(this,e),this.gossip=t,this.msgs=new Map,this.history=[],this.msgIdToStrFn=n;for(var i=0;i<r;i++)this.history[i]=[]}return(0,O.Z)(e,[{key:"size",get:function(){return this.msgs.size}},{key:"put",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=e.msgIdStr;return!this.msgs.has(n)&&(this.msgs.set(n,{message:t,validated:r,originatingPeers:new Set,iwantCounts:new Map}),this.history[0].push(N(N({},e),{},{topic:t.topic})),!0)}},{key:"observeDuplicate",value:function(e,t){var r=this.msgs.get(e);r&&!r.validated&&r.originatingPeers.add(t)}},{key:"get",value:function(e){var t;return null===(t=this.msgs.get(this.msgIdToStrFn(e)))||void 0===t?void 0:t.message}},{key:"getWithIWantCount",value:function(e,t){var r,n=this.msgs.get(e);if(!n)return null;var i=(null!==(r=n.iwantCounts.get(t))&&void 0!==r?r:0)+1;return n.iwantCounts.set(t,i),{msg:n.message,count:i}}},{key:"getGossipIDs",value:function(e){for(var t=this,r=new Map,n=0;n<this.gossip;n++)this.history[n].forEach((function(n){var i=t.msgs.get(n.msgIdStr);if(i&&i.validated&&e.has(n.topic)){var o=r.get(n.topic);o||(o=[],r.set(n.topic,o)),o.push(n.msgId)}}));return r}},{key:"validate",value:function(e){var t=this.msgs.get(e);if(!t)return null;var r=t.message,n=t.originatingPeers;return t.validated=!0,t.originatingPeers=new Set,{message:r,originatingPeers:n}}},{key:"shift",value:function(){var e=this;this.history[this.history.length-1].forEach((function(t){e.msgs.delete(t.msgIdStr)})),this.history.pop(),this.history.unshift([])}},{key:"remove",value:function(e){var t=this.msgs.get(e);return t?(this.msgs.delete(e),t):null}}]),e}(),rl=(__webpack_require__.p+"static/media/rpc.93e8f6196bd2c425bf03.cjs").RPC,nl="/floodsub/1.0.0",il="/meshsub/1.0.0",ol="/meshsub/1.1.0",al=5e3,sl=12e4;function ul(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1?arguments[1]:void 0;return{subscriptions:[],messages:e,control:t?{graft:t.graft||[],prune:t.prune||[],ihave:t.ihave||[],iwant:t.iwant||[]}:void 0}}function cl(e){if(e.length<=1)return e;for(var t=0;t<e.length;t++){var r=Math.floor(Math.random()*Math.floor(e.length)),n=e[t];e[t]=e[r],e[r]=n}return e}function ll(e){return zr(e,"base64")}var fl,hl,dl,pl,vl,gl,yl="StrictSign",ml="StrictNoSign";function bl(e){switch(e){case dl.Ignore:return pl.Ignore;case dl.Reject:return pl.Reject}}function wl(e,t){return kl.apply(this,arguments)}function kl(){return(kl=(0,E.Z)((0,k.Z)().mark((function e(t,r){var n;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=t,e.next=e.t0===yl?3:e.t0===ml?13:14;break;case 3:if(r){e.next=5;break}throw Error("Must provide PeerId");case 5:if(null!=r.privateKey){e.next=7;break}throw Error("Cannot sign message, no private key present");case 7:if(null!=r.publicKey){e.next=9;break}throw Error("Cannot sign message, no public key present");case 9:return e.next=11,rs(r.privateKey);case 11:return n=e.sent,e.abrupt("return",{type:hl.Signing,author:r,key:r.publicKey,privateKey:n});case 13:return e.abrupt("return",{type:hl.Anonymous});case 14:throw new Error('Unknown signature policy "'.concat(t,'"'));case 15:case"end":return e.stop()}}),e)})))).apply(this,arguments)}!function(e){e.StrictSign="StrictSign",e.StrictNoSign="StrictNoSign"}(fl||(fl={})),function(e){e[e.Signing=0]="Signing",e[e.Anonymous=1]="Anonymous"}(hl||(hl={})),function(e){e.Accept="accept",e.Ignore="ignore",e.Reject="reject"}(dl||(dl={})),function(e){e.Error="error",e.Ignore="ignore",e.Reject="reject",e.Blacklisted="blacklisted"}(pl||(pl={})),function(e){e.InvalidSignature="invalid_signature",e.InvalidSeqno="invalid_seqno",e.InvalidPeerId="invalid_peerid",e.SignaturePresent="signature_present",e.SeqnoPresent="seqno_present",e.FromPresent="from_present",e.TransformFailed="transform_failed"}(vl||(vl={})),function(e){e.duplicate="duplicate",e.invalid="invalid",e.valid="valid"}(gl||(gl={}));var El="ERR_INVALID_PEER_SCORE_PARAMS",xl={topics:{},topicScoreCap:10,appSpecificScore:function(){return 0},appSpecificWeight:10,IPColocationFactorWeight:-5,IPColocationFactorThreshold:10,IPColocationFactorWhitelist:new Set,behaviourPenaltyWeight:-10,behaviourPenaltyThreshold:0,behaviourPenaltyDecay:.2,decayInterval:1e3,decayToZero:.1,retainScore:36e5},Sl={topicWeight:.5,timeInMeshWeight:1,timeInMeshQuantum:1,timeInMeshCap:3600,firstMessageDeliveriesWeight:1,firstMessageDeliveriesDecay:.5,firstMessageDeliveriesCap:2e3,meshMessageDeliveriesWeight:-1,meshMessageDeliveriesDecay:.5,meshMessageDeliveriesCap:100,meshMessageDeliveriesThreshold:20,meshMessageDeliveriesWindow:10,meshMessageDeliveriesActivation:5e3,meshFailurePenaltyWeight:-1,meshFailurePenaltyDecay:.5,invalidMessageDeliveriesWeight:-1,invalidMessageDeliveriesDecay:.3};function _l(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return N(N(N({},xl),e),{},{topics:e.topics?Object.entries(e.topics).reduce((function(e,t){var r=I(t,2),n=r[0],i=r[1];return e[n]=Al(i),e}),{}):{}})}function Al(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return N(N({},Sl),e)}function Il(e){if(e.topicWeight<0)throw Di(new Error("invalid topic weight; must be >= 0"),El);if(0===e.timeInMeshQuantum)throw Di(new Error("invalid TimeInMeshQuantum; must be non zero"),El);if(e.timeInMeshWeight<0)throw Di(new Error("invalid TimeInMeshWeight; must be positive (or 0 to disable)"),El);if(0!==e.timeInMeshWeight&&e.timeInMeshQuantum<=0)throw Di(new Error("invalid TimeInMeshQuantum; must be positive"),El);if(0!==e.timeInMeshWeight&&e.timeInMeshCap<=0)throw Di(new Error("invalid TimeInMeshCap; must be positive"),El);if(e.firstMessageDeliveriesWeight<0)throw Di(new Error("invallid FirstMessageDeliveriesWeight; must be positive (or 0 to disable)"),El);if(0!==e.firstMessageDeliveriesWeight&&(e.firstMessageDeliveriesDecay<=0||e.firstMessageDeliveriesDecay>=1))throw Di(new Error("invalid FirstMessageDeliveriesDecay; must be between 0 and 1"),El);if(0!==e.firstMessageDeliveriesWeight&&e.firstMessageDeliveriesCap<=0)throw Di(new Error("invalid FirstMessageDeliveriesCap; must be positive"),El);if(e.meshMessageDeliveriesWeight>0)throw Di(new Error("invalid MeshMessageDeliveriesWeight; must be negative (or 0 to disable)"),El);if(0!==e.meshMessageDeliveriesWeight&&(e.meshMessageDeliveriesDecay<=0||e.meshMessageDeliveriesDecay>=1))throw Di(new Error("invalid MeshMessageDeliveriesDecay; must be between 0 and 1"),El);if(0!==e.meshMessageDeliveriesWeight&&e.meshMessageDeliveriesCap<=0)throw Di(new Error("invalid MeshMessageDeliveriesCap; must be positive"),El);if(0!==e.meshMessageDeliveriesWeight&&e.meshMessageDeliveriesThreshold<=0)throw Di(new Error("invalid MeshMessageDeliveriesThreshold; must be positive"),El);if(e.meshMessageDeliveriesWindow<0)throw Di(new Error("invalid MeshMessageDeliveriesWindow; must be non-negative"),El);if(0!==e.meshMessageDeliveriesWeight&&e.meshMessageDeliveriesActivation<1e3)throw Di(new Error("invalid MeshMessageDeliveriesActivation; must be at least 1s"),El);if(e.meshFailurePenaltyWeight>0)throw Di(new Error("invalid MeshFailurePenaltyWeight; must be negative (or 0 to disable)"),El);if(0!==e.meshFailurePenaltyWeight&&(e.meshFailurePenaltyDecay<=0||e.meshFailurePenaltyDecay>=1))throw Di(new Error("invalid MeshFailurePenaltyDecay; must be between 0 and 1"),El);if(e.invalidMessageDeliveriesWeight>0)throw Di(new Error("invalid InvalidMessageDeliveriesWeight; must be negative (or 0 to disable)"),El);if(e.invalidMessageDeliveriesDecay<=0||e.invalidMessageDeliveriesDecay>=1)throw Di(new Error("invalid InvalidMessageDeliveriesDecay; must be between 0 and 1"),El)}var Cl={gossipThreshold:-10,publishThreshold:-50,graylistThreshold:-80,acceptPXThreshold:10,opportunisticGraftThreshold:20};function Tl(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return N(N({},Cl),e)}function Pl(e,t,r,n){var i=0;Object.entries(t.topics).forEach((function(e){var t=I(e,2),n=t[0],o=t[1],a=r.topics[n];if(void 0!==a){var s=0;if(o.inMesh){var u=o.meshTime/a.timeInMeshQuantum;u>a.timeInMeshCap&&(u=a.timeInMeshCap),s+=u*a.timeInMeshWeight}var c=o.firstMessageDeliveries;if(c>a.firstMessageDeliveriesCap&&(c=a.firstMessageDeliveriesCap),s+=c*a.firstMessageDeliveriesWeight,o.meshMessageDeliveriesActive&&o.meshMessageDeliveries<a.meshMessageDeliveriesThreshold){var l=a.meshMessageDeliveriesThreshold-o.meshMessageDeliveries;s+=l*l*a.meshMessageDeliveriesWeight}s+=o.meshFailurePenalty*a.meshFailurePenaltyWeight,s+=o.invalidMessageDeliveries*o.invalidMessageDeliveries*a.invalidMessageDeliveriesWeight,i+=s*a.topicWeight}})),r.topicScoreCap>0&&i>r.topicScoreCap&&(i=r.topicScoreCap);var o=r.appSpecificScore(e);if(i+=o*r.appSpecificWeight,t.ips.forEach((function(e){if(!r.IPColocationFactorWhitelist.has(e)){var t=n.get(e),o=t?t.size:0;if(o>r.IPColocationFactorThreshold){var a=o-r.IPColocationFactorThreshold;i+=a*a*r.IPColocationFactorWeight}}})),t.behaviourPenalty>r.behaviourPenaltyThreshold){var a=t.behaviourPenalty-r.behaviourPenaltyThreshold;i+=a*a*r.behaviourPenaltyWeight}return i}var Rl,Bl=__webpack_require__(6167);!function(e){e[e.unknown=0]="unknown",e[e.valid=1]="valid",e[e.invalid=2]="invalid",e[e.ignored=3]="ignored"}(Rl||(Rl={}));var Ml=function(){function e(){(0,D.Z)(this,e),this.records=new Map,this.queue=new Bl}return(0,O.Z)(e,[{key:"ensureRecord",value:function(e){var t=this.records.get(e);if(t)return t;t={status:Rl.unknown,firstSeen:Date.now(),validated:0,peers:new Set},this.records.set(e,t);var r={msgId:e,expire:Date.now()+12e4};return this.queue.push(r),t}},{key:"gc",value:function(){for(var e=Date.now(),t=this.queue.peekFront();t&&t.expire<e;)this.records.delete(t.msgId),this.queue.shift(),t=this.queue.peekFront()}},{key:"clear",value:function(){this.records.clear(),this.queue.clear()}}]),e}();function Nl(e){return null!=e&&"function"===typeof e.start&&"function"===typeof e.stop}function Ol(e){return null!=e&&"function"===typeof e.init}var Dl,Ll,Ul,Fl,zl,Zl,jl=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,D.Z)(this,e),this.started=!1,null!=t.peerId&&this.setPeerId(t.peerId),null!=t.addressManager&&this.setAddressManager(t.addressManager),null!=t.peerStore&&this.setPeerStore(t.peerStore),null!=t.upgrader&&this.setUpgrader(t.upgrader),null!=t.metrics&&this.setMetrics(t.metrics),null!=t.registrar&&this.setRegistrar(t.registrar),null!=t.connectionManager&&this.setConnectionManager(t.connectionManager),null!=t.transportManager&&this.setTransportManager(t.transportManager),null!=t.connectionGater&&this.setConnectionGater(t.connectionGater),null!=t.contentRouting&&this.setContentRouting(t.contentRouting),null!=t.peerRouting&&this.setPeerRouting(t.peerRouting),null!=t.datastore&&this.setDatastore(t.datastore),null!=t.connectionProtector&&this.setConnectionProtector(t.connectionProtector),null!=t.dht&&this.setDHT(t.dht),null!=t.pubsub&&this.setPubSub(t.pubsub)}return(0,O.Z)(e,[{key:"isStarted",value:function(){return this.started}},{key:"beforeStart",value:function(){var e=(0,E.Z)((0,k.Z)().mark((function e(){return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all(Object.values(this).filter((function(e){return Nl(e)})).map(function(){var e=(0,E.Z)((0,k.Z)().mark((function e(t){return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null==t.beforeStart){e.next=3;break}return e.next=3,t.beforeStart();case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 2:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"start",value:function(){var e=(0,E.Z)((0,k.Z)().mark((function e(){return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all(Object.values(this).filter((function(e){return Nl(e)})).map(function(){var e=(0,E.Z)((0,k.Z)().mark((function e(t){return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.start();case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 2:this.started=!0;case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"afterStart",value:function(){var e=(0,E.Z)((0,k.Z)().mark((function e(){return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all(Object.values(this).filter((function(e){return Nl(e)})).map(function(){var e=(0,E.Z)((0,k.Z)().mark((function e(t){return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null==t.afterStart){e.next=3;break}return e.next=3,t.afterStart();case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 2:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"beforeStop",value:function(){var e=(0,E.Z)((0,k.Z)().mark((function e(){return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all(Object.values(this).filter((function(e){return Nl(e)})).map(function(){var e=(0,E.Z)((0,k.Z)().mark((function e(t){return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null==t.beforeStop){e.next=3;break}return e.next=3,t.beforeStop();case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 2:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"stop",value:function(){var e=(0,E.Z)((0,k.Z)().mark((function e(){return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all(Object.values(this).filter((function(e){return Nl(e)})).map(function(){var e=(0,E.Z)((0,k.Z)().mark((function e(t){return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.stop();case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 2:this.started=!1;case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"afterStop",value:function(){var e=(0,E.Z)((0,k.Z)().mark((function e(){return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all(Object.values(this).filter((function(e){return Nl(e)})).map(function(){var e=(0,E.Z)((0,k.Z)().mark((function e(t){return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null==t.afterStop){e.next=3;break}return e.next=3,t.afterStop();case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 2:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"setPeerId",value:function(e){return this.peerId=e,e}},{key:"getPeerId",value:function(){if(null==this.peerId)throw Di(new Error("peerId not set"),"ERR_SERVICE_MISSING");return this.peerId}},{key:"setMetrics",value:function(e){return this.metrics=e,Ol(e)&&e.init(this),e}},{key:"getMetrics",value:function(){return this.metrics}},{key:"setAddressManager",value:function(e){return this.addressManager=e,Ol(e)&&e.init(this),e}},{key:"getAddressManager",value:function(){if(null==this.addressManager)throw Di(new Error("addressManager not set"),"ERR_SERVICE_MISSING");return this.addressManager}},{key:"setPeerStore",value:function(e){return this.peerStore=e,Ol(e)&&e.init(this),e}},{key:"getPeerStore",value:function(){if(null==this.peerStore)throw Di(new Error("peerStore not set"),"ERR_SERVICE_MISSING");return this.peerStore}},{key:"setUpgrader",value:function(e){return this.upgrader=e,Ol(e)&&e.init(this),e}},{key:"getUpgrader",value:function(){if(null==this.upgrader)throw Di(new Error("upgrader not set"),"ERR_SERVICE_MISSING");return this.upgrader}},{key:"setRegistrar",value:function(e){return this.registrar=e,Ol(e)&&e.init(this),e}},{key:"getRegistrar",value:function(){if(null==this.registrar)throw Di(new Error("registrar not set"),"ERR_SERVICE_MISSING");return this.registrar}},{key:"setConnectionManager",value:function(e){return this.connectionManager=e,Ol(e)&&e.init(this),e}},{key:"getConnectionManager",value:function(){if(null==this.connectionManager)throw Di(new Error("connectionManager not set"),"ERR_SERVICE_MISSING");return this.connectionManager}},{key:"setTransportManager",value:function(e){return this.transportManager=e,Ol(e)&&e.init(this),e}},{key:"getTransportManager",value:function(){if(null==this.transportManager)throw Di(new Error("transportManager not set"),"ERR_SERVICE_MISSING");return this.transportManager}},{key:"setConnectionGater",value:function(e){return this.connectionGater=e,Ol(e)&&e.init(this),e}},{key:"getConnectionGater",value:function(){if(null==this.connectionGater)throw Di(new Error("connectionGater not set"),"ERR_SERVICE_MISSING");return this.connectionGater}},{key:"setContentRouting",value:function(e){return this.contentRouting=e,Ol(e)&&e.init(this),e}},{key:"getContentRouting",value:function(){if(null==this.contentRouting)throw Di(new Error("contentRouting not set"),"ERR_SERVICE_MISSING");return this.contentRouting}},{key:"setPeerRouting",value:function(e){return this.peerRouting=e,Ol(e)&&e.init(this),e}},{key:"getPeerRouting",value:function(){if(null==this.peerRouting)throw Di(new Error("peerRouting not set"),"ERR_SERVICE_MISSING");return this.peerRouting}},{key:"setDatastore",value:function(e){return this.datastore=e,Ol(e)&&e.init(this),e}},{key:"getDatastore",value:function(){if(null==this.datastore)throw Di(new Error("datastore not set"),"ERR_SERVICE_MISSING");return this.datastore}},{key:"setConnectionProtector",value:function(e){return this.connectionProtector=e,Ol(e)&&e.init(this),e}},{key:"getConnectionProtector",value:function(){return this.connectionProtector}},{key:"setDHT",value:function(e){return this.dht=e,Ol(e)&&e.init(this),e}},{key:"getDHT",value:function(){if(null==this.dht)throw Di(new Error("dht not set"),"ERR_SERVICE_MISSING");return this.dht}},{key:"setPubSub",value:function(e){return this.pubsub=e,Ol(e)&&e.init(this),e}},{key:"getPubSub",value:function(){if(null==this.pubsub)throw Di(new Error("pubsub not set"),"ERR_SERVICE_MISSING");return this.pubsub}},{key:"setDialer",value:function(e){return this.dialer=e,Ol(e)&&e.init(this),e}},{key:"getDialer",value:function(){if(null==this.dialer)throw Di(new Error("dialer not set"),"ERR_SERVICE_MISSING");return this.dialer}}]),e}(),ql=Vc("libp2p:gossipsub:score"),Kl=function(){function e(t,r,n){var i;(0,D.Z)(this,e),this.params=t,this.metrics=r,this.peerStats=new Map,this.peerIPs=new Map,this.scoreCache=new Map,this.deliveryRecords=new Ml,this.components=new jl,function(e){for(var t=0,r=Object.entries(e.topics);t<r.length;t++){var n=I(r[t],2),i=n[0],o=n[1];try{Il(o)}catch(a){throw Di(new Error("invalid score parameters for topic ".concat(i,": ").concat(a.message)),El)}}if(e.topicScoreCap<0)throw Di(new Error("invalid topic score cap; must be positive (or 0 for no cap)"),El);if(null===e.appSpecificScore||void 0===e.appSpecificScore)throw Di(new Error("missing application specific score function"),El);if(e.IPColocationFactorWeight>0)throw Di(new Error("invalid IPColocationFactorWeight; must be negative (or 0 to disable)"),El);if(0!==e.IPColocationFactorWeight&&e.IPColocationFactorThreshold<1)throw Di(new Error("invalid IPColocationFactorThreshold; must be at least 1"),El);if(e.behaviourPenaltyWeight>0)throw Di(new Error("invalid BehaviourPenaltyWeight; must be negative (or 0 to disable)"),El);if(0!==e.behaviourPenaltyWeight&&(e.behaviourPenaltyDecay<=0||e.behaviourPenaltyDecay>=1))throw Di(new Error("invalid BehaviourPenaltyDecay; must be between 0 and 1"),El);if(e.decayInterval<1e3)throw Di(new Error("invalid DecayInterval; must be at least 1s"),El);if(e.decayToZero<=0||e.decayToZero>=1)throw Di(new Error("invalid DecayToZero; must be between 0 and 1"),El)}(t),this.scoreCacheValidityMs=n.scoreCacheValidityMs,this.computeScore=null!==(i=n.computeScore)&&void 0!==i?i:Pl}return(0,O.Z)(e,[{key:"init",value:function(e){this.components=e}},{key:"size",get:function(){return this.peerStats.size}},{key:"start",value:function(){var e=this;this._backgroundInterval?ql("Peer score already running"):(this._backgroundInterval=setInterval((function(){return e.background()}),this.params.decayInterval),ql("started"))}},{key:"stop",value:function(){this._backgroundInterval?(clearInterval(this._backgroundInterval),delete this._backgroundInterval,this.peerIPs.clear(),this.peerStats.clear(),this.deliveryRecords.clear(),ql("stopped")):ql("Peer score already stopped")}},{key:"background",value:function(){this.refreshScores(),this.updateIPs(),this.deliveryRecords.gc()}},{key:"dumpPeerScoreStats",value:function(){return Object.fromEntries(Array.from(this.peerStats.entries()).map((function(e){var t=I(e,2);return[t[0],t[1]]})))}},{key:"refreshScores",value:function(){var e=this,t=Date.now(),r=this.params.decayToZero;this.peerStats.forEach((function(n,i){n.connected?(Object.entries(n.topics).forEach((function(n){var i=I(n,2),o=i[0],a=i[1],s=e.params.topics[o];void 0!==s&&(a.firstMessageDeliveries*=s.firstMessageDeliveriesDecay,a.firstMessageDeliveries<r&&(a.firstMessageDeliveries=0),a.meshMessageDeliveries*=s.meshMessageDeliveriesDecay,a.meshMessageDeliveries<r&&(a.meshMessageDeliveries=0),a.meshFailurePenalty*=s.meshFailurePenaltyDecay,a.meshFailurePenalty<r&&(a.meshFailurePenalty=0),a.invalidMessageDeliveries*=s.invalidMessageDeliveriesDecay,a.invalidMessageDeliveries<r&&(a.invalidMessageDeliveries=0),a.inMesh&&(a.meshTime=t-a.graftTime,a.meshTime>s.meshMessageDeliveriesActivation&&(a.meshMessageDeliveriesActive=!0)))})),n.behaviourPenalty*=e.params.behaviourPenaltyDecay,n.behaviourPenalty<r&&(n.behaviourPenalty=0)):t>n.expire&&(e.removeIPs(i,n.ips),e.peerStats.delete(i),e.scoreCache.delete(i))}))}},{key:"score",value:function(e){var t,r;null===(t=this.metrics)||void 0===t||t.scoreFnCalls.inc();var n=this.peerStats.get(e);if(!n)return 0;var i=Date.now(),o=this.scoreCache.get(e);if(o&&o.cacheUntil>i)return o.score;null===(r=this.metrics)||void 0===r||r.scoreFnRuns.inc();var a,s=this.computeScore(e,n,this.params,this.peerIPs),u=i+this.scoreCacheValidityMs;o?(null===(a=this.metrics)||void 0===a||a.scoreCachedDelta.observe(Math.abs(s-o.score)),o.score=s,o.cacheUntil=u):this.scoreCache.set(e,{score:s,cacheUntil:u});return s}},{key:"addPenalty",value:function(e,t,r){var n,i=this.peerStats.get(e);i&&(i.behaviourPenalty+=t,null===(n=this.metrics)||void 0===n||n.onScorePenalty(r))}},{key:"addPeer",value:function(e){var t={connected:!0,expire:0,topics:{},ips:[],behaviourPenalty:0};this.peerStats.set(e,t);var r=this.getIPs(e);this.setIPs(e,r,t.ips),t.ips=r}},{key:"removePeer",value:function(e){var t=this,r=this.peerStats.get(e);if(r){if(this.score(e)>0)return this.removeIPs(e,r.ips),void this.peerStats.delete(e);Object.entries(r.topics).forEach((function(e){var r=I(e,2),n=r[0],i=r[1];i.firstMessageDeliveries=0;var o=t.params.topics[n].meshMessageDeliveriesThreshold;if(i.inMesh&&i.meshMessageDeliveriesActive&&i.meshMessageDeliveries<o){var a=o-i.meshMessageDeliveries;i.meshFailurePenalty+=a*a}i.inMesh=!1,i.meshMessageDeliveriesActive=!1})),r.connected=!1,r.expire=Date.now()+this.params.retainScore}}},{key:"graft",value:function(e,t){var r=this.peerStats.get(e);if(r){var n=this.getPtopicStats(r,t);n&&(n.inMesh=!0,n.graftTime=Date.now(),n.meshTime=0,n.meshMessageDeliveriesActive=!1)}}},{key:"prune",value:function(e,t){var r=this.peerStats.get(e);if(r){var n=this.getPtopicStats(r,t);if(n){var i=this.params.topics[t].meshMessageDeliveriesThreshold;if(n.meshMessageDeliveriesActive&&n.meshMessageDeliveries<i){var o=i-n.meshMessageDeliveries;n.meshFailurePenalty+=o*o}n.meshMessageDeliveriesActive=!1,n.inMesh=!1}}}},{key:"validateMessage",value:function(e){this.deliveryRecords.ensureRecord(e)}},{key:"deliverMessage",value:function(e,t,r){var n=this;this.markFirstMessageDelivery(e,r);var i=this.deliveryRecords.ensureRecord(t),o=Date.now();i.status===Rl.unknown?(i.status=Rl.valid,i.validated=o,i.peers.forEach((function(t){t!==e.toString()&&n.markDuplicateMessageDelivery(t,r)}))):ql("unexpected delivery: message from %s was first seen %s ago and has delivery status %s",e,o-i.firstSeen,Rl[i.status])}},{key:"rejectInvalidMessage",value:function(e,t){this.markInvalidMessageDelivery(e,t)}},{key:"rejectMessage",value:function(e,t,r,n){var i=this;switch(n){case pl.Error:return void this.markInvalidMessageDelivery(e,r);case pl.Blacklisted:return}var o=this.deliveryRecords.ensureRecord(t);if(o.status===Rl.unknown){if(n===pl.Ignore)return o.status=Rl.ignored,void o.peers.clear();o.status=Rl.invalid,this.markInvalidMessageDelivery(e,r),o.peers.forEach((function(e){i.markInvalidMessageDelivery(e,r)})),o.peers.clear()}else ql("unexpected rejection: message from %s was first seen %s ago and has delivery status %d",e,Date.now()-o.firstSeen,Rl[o.status])}},{key:"duplicateMessage",value:function(e,t,r){var n=this.deliveryRecords.ensureRecord(t);if(!n.peers.has(e))switch(n.status){case Rl.unknown:n.peers.add(e);break;case Rl.valid:n.peers.add(e),this.markDuplicateMessageDelivery(e,r,n.validated);break;case Rl.invalid:this.markInvalidMessageDelivery(e,r);case Rl.ignored:}}},{key:"markInvalidMessageDelivery",value:function(e,t){var r=this.peerStats.get(e);if(r){var n=this.getPtopicStats(r,t);n&&(n.invalidMessageDeliveries+=1)}}},{key:"markFirstMessageDelivery",value:function(e,t){var r=this.peerStats.get(e);if(r){var n=this.getPtopicStats(r,t);if(n){var i=this.params.topics[t].firstMessageDeliveriesCap;n.firstMessageDeliveries=Math.min(i,n.firstMessageDeliveries+1),n.inMesh&&(i=this.params.topics[t].meshMessageDeliveriesCap,n.meshMessageDeliveries=Math.min(i,n.meshMessageDeliveries+1))}}}},{key:"markDuplicateMessageDelivery",value:function(e,t,r){var n=this.peerStats.get(e);if(n){var i=void 0!==r?Date.now():0,o=this.getPtopicStats(n,t);if(o&&o.inMesh){var a=this.params.topics[t];if(void 0!==r){var s,u=i-r,c=u>a.meshMessageDeliveriesWindow;if(null===(s=this.metrics)||void 0===s||s.onDuplicateMsgDelivery(t,u,c),c)return}var l=a.meshMessageDeliveriesCap;o.meshMessageDeliveries=Math.min(l,o.meshMessageDeliveries+1)}}}},{key:"getIPs",value:function(e){return this.components.getConnectionManager().getConnections(fs(e)).map((function(e){return e.remoteAddr.toOptions().host}))}},{key:"setIPs",value:function(e,t,r){var n,i=$e(t);try{e:for(i.s();!(n=i.n()).done;){var o,a=n.value,s=$e(r);try{for(s.s();!(o=s.n()).done;){if(a===o.value)continue e}}catch(v){s.e(v)}finally{s.f()}var u=this.peerIPs.get(a);u||(u=new Set,this.peerIPs.set(a,u)),u.add(e)}}catch(v){i.e(v)}finally{i.f()}var c,l=$e(r);try{e:for(l.s();!(c=l.n()).done;){var f,h=c.value,d=$e(t);try{for(d.s();!(f=d.n()).done;){if(h===f.value)continue e}}catch(v){d.e(v)}finally{d.f()}var p=this.peerIPs.get(h);p&&(p.delete(e),p.size||this.peerIPs.delete(h))}}catch(v){l.e(v)}finally{l.f()}}},{key:"removeIPs",value:function(e,t){var r=this;t.forEach((function(t){var n=r.peerIPs.get(t);n&&(n.delete(e),n.size||r.peerIPs.delete(t))}))}},{key:"updateIPs",value:function(){var e=this;this.peerStats.forEach((function(t,r){var n=e.getIPs(r);e.setIPs(r,n,t.ips),t.ips=n}))}},{key:"getPtopicStats",value:function(e,t){var r=e.topics[t];return void 0!==r?r:void 0!==this.params.topics[t]?(r={inMesh:!1,graftTime:0,meshTime:0,firstMessageDeliveries:0,meshMessageDeliveries:0,meshMessageDeliveriesActive:!1,meshFailurePenalty:0,invalidMessageDeliveries:0},e.topics[t]=r,r):null}}]),e}(),Vl=function(){function e(t,r,n){(0,D.Z)(this,e),this.gossipsubIWantFollowupMs=t,this.msgIdToStrFn=r,this.metrics=n,this.promises=new Map,this.requestMsByMsg=new Map,this.requestMsByMsgExpire=10*t}return(0,O.Z)(e,[{key:"size",get:function(){return this.promises.size}},{key:"requestMsByMsgSize",get:function(){return this.requestMsByMsg.size}},{key:"addPromise",value:function(e,t){var r=t[Math.floor(Math.random()*t.length)],n=this.msgIdToStrFn(r),i=this.promises.get(n);i||(i=new Map,this.promises.set(n,i));var o=Date.now();i.has(e)||(i.set(e,o+this.gossipsubIWantFollowupMs),this.metrics&&(this.metrics.iwantPromiseStarted.inc(1),this.requestMsByMsg.has(n)||this.requestMsByMsg.set(n,o)))}},{key:"getBrokenPromises",value:function(){var e,t=this,r=Date.now(),n=new Map,i=0;return this.promises.forEach((function(e,o){e.forEach((function(t,o){var a;t<r&&(n.set(o,(null!==(a=n.get(o))&&void 0!==a?a:0)+1),e.delete(o),i++)})),e.size||t.promises.delete(o)})),null===(e=this.metrics)||void 0===e||e.iwantPromiseBroken.inc(i),n}},{key:"deliverMessage",value:function(e){this.trackMessage(e);var t=this.promises.get(e);t&&(this.promises.delete(e),this.metrics&&(this.metrics.iwantPromiseResolved.inc(1),this.metrics.iwantPromiseResolvedPeers.inc(t.size)))}},{key:"rejectMessage",value:function(e,t){this.trackMessage(e),t!==pl.Error&&this.promises.delete(e)}},{key:"clear",value:function(){this.promises.clear()}},{key:"prune",value:function(){var e,t=Date.now()-this.requestMsByMsgExpire,r=$e(this.requestMsByMsg.entries());try{for(r.s();!(e=r.n()).done;){var n=I(e.value,2),i=n[0];if(!(n[1]<t))break;this.requestMsByMsg.delete(i)}}catch(o){r.e(o)}finally{r.f()}}},{key:"trackMessage",value:function(e){if(this.metrics){var t=this.requestMsByMsg.get(e);void 0!==t&&(this.metrics.iwantPromiseDeliveryTime.observe((Date.now()-t)/1e3),this.requestMsByMsg.delete(e))}}}]),e}(),Hl=function(){function e(t){(0,D.Z)(this,e),this.entries=new Map,this.validityMs=t.validityMs}return(0,O.Z)(e,[{key:"size",get:function(){return this.entries.size}},{key:"put",value:function(e,t){this.entries.set(e,{value:t,validUntilMs:Date.now()+this.validityMs})}},{key:"prune",value:function(){var e,t=Date.now(),r=$e(this.entries.entries());try{for(r.s();!(e=r.n()).done;){var n=I(e.value,2),i=n[0];if(!(n[1].validUntilMs<t))break;this.entries.delete(i)}}catch(o){r.e(o)}finally{r.f()}}},{key:"has",value:function(e){return this.entries.has(e)}},{key:"get",value:function(e){var t=this.entries.get(e);return t&&t.validUntilMs>=Date.now()?t.value:void 0}},{key:"clear",value:function(){this.entries.clear()}}]),e}();function Gl(e,t,r){return{protocolsEnabled:e.gauge({name:"gossipsub_protocol",help:"Status of enabled protocols",labelNames:["protocol"]}),topicSubscriptionStatus:e.gauge({name:"gossipsub_topic_subscription_status",help:"Status of our subscription to this topic",labelNames:["topicStr"]}),topicPeersCount:e.gauge({name:"gossipsub_topic_peer_count",help:"Number of peers subscribed to each topic",labelNames:["topicStr"]}),meshPeerCounts:e.gauge({name:"gossipsub_mesh_peer_count",help:"Number of peers in our mesh",labelNames:["topicStr"]}),meshPeerInclusionEvents:e.gauge({name:"gossipsub_mesh_peer_inclusion_events_total",help:"Number of times we include peers in a topic mesh for different reasons",labelNames:["topic","reason"]}),meshPeerChurnEvents:e.gauge({name:"gossipsub_peer_churn_events_total",help:"Number of times we remove peers in a topic mesh for different reasons",labelNames:["topic","reason"]}),peersPerProtocol:e.gauge({name:"gossipsub_peers_per_protocol_count",help:"Peers connected for each topic",labelNames:["protocol"]}),heartbeatDuration:e.histogram({name:"gossipsub_heartbeat_duration_seconds",help:"The time it takes to complete one iteration of the heartbeat",buckets:[.01,.1,1]}),heartbeatSkipped:e.gauge({name:"gossipsub_heartbeat_skipped",help:"Heartbeat run took longer than heartbeat interval so next is skipped"}),asyncValidationResult:e.gauge({name:"gossipsub_async_validation_result_total",help:"Message validation result for each topic",labelNames:["topic","acceptance"]}),asyncValidationMcacheHit:e.gauge({name:"gossipsub_async_validation_mcache_hit_total",help:"Async validation result reported by the user layer",labelNames:["hit"]}),rpcRecvBytes:e.gauge({name:"gossipsub_rpc_recv_bytes_total",help:"RPC recv"}),rpcRecvCount:e.gauge({name:"gossipsub_rpc_recv_count_total",help:"RPC recv"}),rpcRecvSubscription:e.gauge({name:"gossipsub_rpc_recv_subscription_total",help:"RPC recv"}),rpcRecvMessage:e.gauge({name:"gossipsub_rpc_recv_message_total",help:"RPC recv"}),rpcRecvControl:e.gauge({name:"gossipsub_rpc_recv_control_total",help:"RPC recv"}),rpcRecvIHave:e.gauge({name:"gossipsub_rpc_recv_ihave_total",help:"RPC recv"}),rpcRecvIWant:e.gauge({name:"gossipsub_rpc_recv_iwant_total",help:"RPC recv"}),rpcRecvGraft:e.gauge({name:"gossipsub_rpc_recv_graft_total",help:"RPC recv"}),rpcRecvPrune:e.gauge({name:"gossipsub_rpc_recv_prune_total",help:"RPC recv"}),rpcRecvNotAccepted:e.gauge({name:"gossipsub_rpc_rcv_not_accepted_total",help:"Total count of RPC dropped because acceptFrom() == false"}),rpcSentBytes:e.gauge({name:"gossipsub_rpc_sent_bytes_total",help:"RPC sent"}),rpcSentCount:e.gauge({name:"gossipsub_rpc_sent_count_total",help:"RPC sent"}),rpcSentSubscription:e.gauge({name:"gossipsub_rpc_sent_subscription_total",help:"RPC sent"}),rpcSentMessage:e.gauge({name:"gossipsub_rpc_sent_message_total",help:"RPC sent"}),rpcSentControl:e.gauge({name:"gossipsub_rpc_sent_control_total",help:"RPC sent"}),rpcSentIHave:e.gauge({name:"gossipsub_rpc_sent_ihave_total",help:"RPC sent"}),rpcSentIWant:e.gauge({name:"gossipsub_rpc_sent_iwant_total",help:"RPC sent"}),rpcSentGraft:e.gauge({name:"gossipsub_rpc_sent_graft_total",help:"RPC sent"}),rpcSentPrune:e.gauge({name:"gossipsub_rpc_sent_prune_total",help:"RPC sent"}),msgPublishCount:e.gauge({name:"gossipsub_msg_publish_count_total",help:"Total count of msg published by topic",labelNames:["topic"]}),msgPublishPeers:e.gauge({name:"gossipsub_msg_publish_peers_total",help:"Total count of peers that we publish a msg to",labelNames:["topic"]}),msgPublishPeersByGroup:e.gauge({name:"gossipsub_msg_publish_peers_by_group",help:"Total count of peers (by group) that we publish a msg to",labelNames:["topic","peerGroup"]}),msgPublishBytes:e.gauge({name:"gossipsub_msg_publish_bytes_total",help:"Total count of msg publish data.length bytes",labelNames:["topic"]}),msgForwardCount:e.gauge({name:"gossipsub_msg_forward_count_total",help:"Total count of msg forwarded by topic",labelNames:["topic"]}),msgForwardPeers:e.gauge({name:"gossipsub_msg_forward_peers_total",help:"Total count of peers that we forward a msg to",labelNames:["topic"]}),msgReceivedPreValidation:e.gauge({name:"gossipsub_msg_received_prevalidation_total",help:"Total count of recv msgs before any validation",labelNames:["topic"]}),msgReceivedStatus:e.gauge({name:"gossipsub_msg_received_status_total",help:"Tracks distribution of recv msgs by duplicate, invalid, valid",labelNames:["topic","status"]}),msgReceivedInvalid:e.gauge({name:"gossipsub_msg_received_invalid_total",help:"Tracks specific reason of invalid",labelNames:["topic","error"]}),duplicateMsgDeliveryDelay:e.histogram({name:"gossisub_duplicate_msg_delivery_delay_seconds",help:"Time since the 1st duplicated message validated",labelNames:["topic"],buckets:[.25*r.maxMeshMessageDeliveriesWindowSec,.5*r.maxMeshMessageDeliveriesWindowSec,1*r.maxMeshMessageDeliveriesWindowSec,2*r.maxMeshMessageDeliveriesWindowSec,4*r.maxMeshMessageDeliveriesWindowSec]}),duplicateMsgLateDelivery:e.gauge({name:"gossisub_duplicate_msg_late_delivery_total",help:"Total count of late duplicate message delivery by topic, which triggers P3 penalty",labelNames:["topic"]}),scoreFnCalls:e.gauge({name:"gossipsub_score_fn_calls_total",help:"Total times score() is called"}),scoreFnRuns:e.gauge({name:"gossipsub_score_fn_runs_total",help:"Total times score() call actually computed computeScore(), no cache"}),scoreCachedDelta:e.histogram({name:"gossipsub_score_cache_delta",help:"Delta of score between cached values that expired",buckets:[10,100,1e3]}),peersByScoreThreshold:e.gauge({name:"gossipsub_peers_by_score_threshold_count",help:"Current count of peers by score threshold",labelNames:["threshold"]}),score:e.avgMinMax({name:"gossipsub_score",help:"Avg min max of gossip scores",labelNames:["topic","p"]}),scoreWeights:e.avgMinMax({name:"gossipsub_score_weights",help:"Separate score weights",labelNames:["topic","p"]}),scorePerMesh:e.avgMinMax({name:"gossipsub_score_per_mesh",help:"Histogram of the scores for each mesh topic",labelNames:["topic"]}),scoringPenalties:e.gauge({name:"gossipsub_scoring_penalties_total",help:"A counter of the kind of penalties being applied to peers",labelNames:["penalty"]}),behaviourPenalty:e.histogram({name:"gossipsub_peer_stat_behaviour_penalty",help:"Current peer stat behaviour_penalty at each scrape",buckets:[.25*r.behaviourPenaltyThreshold,.5*r.behaviourPenaltyThreshold,1*r.behaviourPenaltyThreshold,2*r.behaviourPenaltyThreshold,4*r.behaviourPenaltyThreshold]}),ihaveRcvIgnored:e.gauge({name:"gossipsub_ihave_rcv_ignored_total",help:"Total received IHAVE messages that we ignore for some reason",labelNames:["reason"]}),ihaveRcvMsgids:e.gauge({name:"gossipsub_ihave_rcv_msgids_total",help:"Total received IHAVE messages by topic",labelNames:["topic"]}),ihaveRcvNotSeenMsgids:e.gauge({name:"gossipsub_ihave_rcv_not_seen_msgids_total",help:"Total messages per topic we do not have, not actual requests",labelNames:["topic"]}),iwantRcvMsgids:e.gauge({name:"gossipsub_iwant_rcv_msgids_total",help:"Total received IWANT messages by topic",labelNames:["topic"]}),iwantRcvDonthaveMsgids:e.gauge({name:"gossipsub_iwant_rcv_dont_have_msgids_total",help:"Total requested messageIDs that we do not have"}),iwantPromiseStarted:e.gauge({name:"gossipsub_iwant_promise_sent_total",help:"Total count of started IWANT promises"}),iwantPromiseResolved:e.gauge({name:"gossipsub_iwant_promise_resolved_total",help:"Total count of resolved IWANT promises"}),iwantPromiseResolvedPeers:e.gauge({name:"gossipsub_iwant_promise_resolved_peers",help:"Total count of peers we have asked IWANT promises that are resolved"}),iwantPromiseBroken:e.gauge({name:"gossipsub_iwant_promise_broken",help:"Total count of broken IWANT promises"}),iwantPromiseDeliveryTime:e.histogram({name:"gossipsub_iwant_promise_delivery_seconds",help:"Histogram of delivery time of resolved IWANT promises",buckets:[.5*r.gossipPromiseExpireSec,1*r.gossipPromiseExpireSec,2*r.gossipPromiseExpireSec,4*r.gossipPromiseExpireSec]}),cacheSize:e.gauge({name:"gossipsub_cache_size",help:"Unbounded cache sizes",labelNames:["cache"]}),mcacheSize:e.gauge({name:"gossipsub_mcache_size",help:"Current mcache msg count"}),topicStrToLabel:t,toTopic:function(e){var t;return null!==(t=this.topicStrToLabel.get(e))&&void 0!==t?t:e},onJoin:function(e){this.topicSubscriptionStatus.set({topicStr:e},1),this.meshPeerCounts.set({topicStr:e},0)},onLeave:function(e){this.topicSubscriptionStatus.set({topicStr:e},0),this.meshPeerCounts.set({topicStr:e},0)},onAddToMesh:function(e,t,r){var n=this.toTopic(e);this.meshPeerInclusionEvents.inc({topic:n,reason:t},r)},onRemoveFromMesh:function(e,t,r){var n=this.toTopic(e);this.meshPeerChurnEvents.inc({topic:n,reason:t},r)},onReportValidationMcacheHit:function(e){this.asyncValidationMcacheHit.inc({hit:e?"hit":"miss"})},onReportValidation:function(e,t){var r=this.toTopic(e);this.asyncValidationResult.inc({topic:r,acceptance:t})},onScorePenalty:function(e){this.scoringPenalties.inc({penalty:e},1)},onIhaveRcv:function(e,t,r){var n=this.toTopic(e);this.ihaveRcvMsgids.inc({topic:n},t),this.ihaveRcvNotSeenMsgids.inc({topic:n},r)},onIwantRcv:function(e,t){var r,n=$e(e);try{for(n.s();!(r=n.n()).done;){var i=I(r.value,2),o=i[0],a=i[1],s=this.toTopic(o);this.iwantRcvMsgids.inc({topic:s},a)}}catch(u){n.e(u)}finally{n.f()}this.iwantRcvDonthaveMsgids.inc(t)},onForwardMsg:function(e,t){var r=this.toTopic(e);this.msgForwardCount.inc({topic:r},1),this.msgForwardPeers.inc({topic:r},t)},onPublishMsg:function(e,t,r,n){var i=this.toTopic(e);this.msgPublishCount.inc({topic:i},1),this.msgPublishBytes.inc({topic:i},r*n),this.msgPublishPeers.inc({topic:i},r),this.msgPublishPeersByGroup.inc({topic:i,peerGroup:"direct"},t.direct),this.msgPublishPeersByGroup.inc({topic:i,peerGroup:"floodsub"},t.floodsub),this.msgPublishPeersByGroup.inc({topic:i,peerGroup:"mesh"},t.mesh),this.msgPublishPeersByGroup.inc({topic:i,peerGroup:"fanout"},t.fanout)},onMsgRecvPreValidation:function(e){var t=this.toTopic(e);this.msgReceivedPreValidation.inc({topic:t},1)},onMsgRecvResult:function(e,t){var r=this.toTopic(e);this.msgReceivedStatus.inc({topic:r,status:t})},onMsgRecvInvalid:function(e,t){var r=this.toTopic(e),n=t.reason===pl.Error?t.error:t.reason;this.msgReceivedInvalid.inc({topic:r,error:n},1)},onDuplicateMsgDelivery:function(e,t,r){if(this.duplicateMsgDeliveryDelay.observe(t/1e3),r){var n=this.toTopic(e);this.duplicateMsgLateDelivery.inc({topic:n},1)}},onRpcRecv:function(e,t){this.rpcRecvBytes.inc(t),this.rpcRecvCount.inc(1),e.subscriptions&&this.rpcRecvSubscription.inc(e.subscriptions.length),e.messages&&this.rpcRecvMessage.inc(e.messages.length),e.control&&(this.rpcRecvControl.inc(1),e.control.ihave&&this.rpcRecvIHave.inc(e.control.ihave.length),e.control.iwant&&this.rpcRecvIWant.inc(e.control.iwant.length),e.control.graft&&this.rpcRecvGraft.inc(e.control.graft.length),e.control.prune&&this.rpcRecvPrune.inc(e.control.prune.length))},onRpcSent:function(e,t){if(this.rpcSentBytes.inc(t),this.rpcSentCount.inc(1),e.subscriptions&&this.rpcSentSubscription.inc(e.subscriptions.length),e.messages&&this.rpcSentMessage.inc(e.messages.length),e.control){var r,n,i,o,a,s,u,c,l=null!==(r=null===(n=e.control.ihave)||void 0===n?void 0:n.length)&&void 0!==r?r:0,f=null!==(i=null===(o=e.control.iwant)||void 0===o?void 0:o.length)&&void 0!==i?i:0,h=null!==(a=null===(s=e.control.graft)||void 0===s?void 0:s.length)&&void 0!==a?a:0,d=null!==(u=null===(c=e.control.prune)||void 0===c?void 0:c.length)&&void 0!==u?u:0;l>0&&this.rpcSentIHave.inc(l),f>0&&this.rpcSentIWant.inc(f),h>0&&this.rpcSentGraft.inc(h),d>0&&this.rpcSentPrune.inc(d),(l>0||f>0||h>0||d>0)&&this.rpcSentControl.inc(1)}},registerScores:function(e,t){var r,n=0,i=0,o=0,a=0,s=$e(e);try{for(s.s();!(r=s.n()).done;){var u=r.value;u>=t.graylistThreshold&&n++,u>=t.publishThreshold&&i++,u>=t.gossipThreshold&&o++,u>=0&&a++}}catch(c){s.e(c)}finally{s.f()}this.peersByScoreThreshold.set({threshold:Zl.graylist},n),this.peersByScoreThreshold.set({threshold:Zl.publish},i),this.peersByScoreThreshold.set({threshold:Zl.gossip},o),this.peersByScoreThreshold.set({threshold:Zl.mesh},a),this.score.set(e)},registerScoreWeights:function(e){var t,r=$e(e.byTopic);try{for(r.s();!(t=r.n()).done;){var n=I(t.value,2),i=n[0],o=n[1];this.scoreWeights.set({topic:i,p:"p1"},o.p1w),this.scoreWeights.set({topic:i,p:"p2"},o.p2w),this.scoreWeights.set({topic:i,p:"p3"},o.p3w),this.scoreWeights.set({topic:i,p:"p3b"},o.p3bw),this.scoreWeights.set({topic:i,p:"p4"},o.p4w)}}catch(a){r.e(a)}finally{r.f()}this.scoreWeights.set({p:"p5"},e.p5w),this.scoreWeights.set({p:"p6"},e.p6w),this.scoreWeights.set({p:"p7"},e.p7w)},registerScorePerMesh:function(e,t){var r=this,n=new Map;e.forEach((function(e,t){var i,o=null!==(i=r.topicStrToLabel.get(t))&&void 0!==i?i:"unknown",a=n.get(o);a||(a=new Set,n.set(o,a)),e.forEach((function(e){var t;return null===(t=a)||void 0===t?void 0:t.add(e)}))}));var i,o=$e(n);try{var a=function(){var e=I(i.value,2),n=e[0],o=e[1],a=[];o.forEach((function(e){var r;a.push(null!==(r=t.get(e))&&void 0!==r?r:0)})),r.scorePerMesh.set({topic:n},a)};for(o.s();!(i=o.n()).done;)a()}catch(s){o.e(s)}finally{o.f()}}}}!function(e){e.forward="forward",e.publish="publish"}(Dl||(Dl={})),function(e){e.Fanout="fanout",e.Random="random",e.Subscribed="subscribed",e.Outbound="outbound",e.NotEnough="not_enough",e.Opportunistic="opportunistic"}(Ll||(Ll={})),function(e){e.Dc="disconnected",e.BadScore="bad_score",e.Prune="prune",e.Unsub="unsubscribed",e.Excess="excess"}(Ul||(Ul={})),function(e){e.GraftBackoff="graft_backoff",e.BrokenPromise="broken_promise",e.MessageDeficit="message_deficit",e.IPColocation="IP_colocation"}(Fl||(Fl={})),function(e){e.LowScore="low_score",e.MaxIhave="max_ihave",e.MaxIasked="max_iasked"}(zl||(zl={})),function(e){e.graylist="graylist",e.publish="publish",e.gossip="gossip",e.mesh="mesh"}(Zl||(Zl={}));__webpack_require__(9521);__webpack_require__(3611);var Wl=Fr("libp2p-pubsub:");function Ql(e,t,r,n){return Jl.apply(this,arguments)}function Jl(){return(Jl=(0,E.Z)((0,k.Z)().mark((function e(t,r,n,i){var o,a,s;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=t.type,e.next=e.t0===hl.Signing?3:e.t0===hl.Anonymous?11:12;break;case 3:return o={from:t.author.toBytes(),data:i,seqno:qi(8),topic:r,signature:void 0,key:void 0},a=fi([Wl,rl.Message.encode(o).finish()]),e.next=7,t.privateKey.sign(a);case 7:return o.signature=e.sent,o.key=t.key,s={type:"signed",from:t.author,data:n,sequenceNumber:BigInt("0x".concat(zr(o.seqno,"base16"))),topic:r,signature:o.signature,key:o.key},e.abrupt("return",{raw:o,msg:s});case 11:return e.abrupt("return",{raw:{from:void 0,data:i,seqno:void 0,topic:r,signature:void 0,key:void 0},msg:{type:"unsigned",data:n,topic:r}});case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function Yl(e,t){return Xl.apply(this,arguments)}function Xl(){return(Xl=(0,E.Z)((0,k.Z)().mark((function e(t,r){var n,i,o,a,s,u,c;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=t,e.next=e.t0===ml?3:e.t0===yl?10:41;break;case 3:if(null==r.signature){e.next=5;break}return e.abrupt("return",{valid:!1,error:vl.SignaturePresent});case 5:if(null==r.seqno){e.next=7;break}return e.abrupt("return",{valid:!1,error:vl.SeqnoPresent});case 7:if(null==r.key){e.next=9;break}return e.abrupt("return",{valid:!1,error:vl.FromPresent});case 9:return e.abrupt("return",{valid:!0,message:{type:"unsigned",topic:r.topic,data:null!==(n=r.data)&&void 0!==n?n:new Uint8Array(0)}});case 10:if(null!=r.seqno){e.next=12;break}return e.abrupt("return",{valid:!1,error:vl.InvalidSeqno});case 12:if(8===r.seqno.length){e.next=14;break}return e.abrupt("return",{valid:!1,error:vl.InvalidSeqno});case 14:if(null!=r.signature){e.next=16;break}return e.abrupt("return",{valid:!1,error:vl.InvalidSignature});case 16:if(null!=r.from){e.next=18;break}return e.abrupt("return",{valid:!1,error:vl.InvalidPeerId});case 18:e.prev=18,a=hs(r.from),e.next=25;break;case 22:return e.prev=22,e.t1=e.catch(18),e.abrupt("return",{valid:!1,error:vl.InvalidPeerId});case 25:if(!r.key){e.next=31;break}if(s=es(r.key),void 0===a.publicKey||ji(s.bytes,a.publicKey)){e.next=29;break}return e.abrupt("return",{valid:!1,error:vl.InvalidPeerId});case 29:e.next=34;break;case 31:if(null!=a.publicKey){e.next=33;break}return e.abrupt("return",{valid:!1,error:vl.InvalidPeerId});case 33:s=es(a.publicKey);case 34:return u={from:r.from,data:r.data,seqno:r.seqno,topic:r.topic,signature:void 0,key:void 0},c=fi([Wl,rl.Message.encode(u).finish()]),e.next=38,s.verify(c,r.signature);case 38:if(e.sent){e.next=40;break}return e.abrupt("return",{valid:!1,error:vl.InvalidSignature});case 40:return e.abrupt("return",{valid:!0,message:{type:"signed",from:a,data:null!==(i=r.data)&&void 0!==i?i:new Uint8Array(0),sequenceNumber:BigInt("0x".concat(zr(r.seqno,"base16"))),topic:r.topic,signature:r.signature,key:null!==(o=r.key)&&void 0!==o?o:ts(s)}});case 41:case"end":return e.stop()}}),e,null,[[18,22]])})))).apply(this,arguments)}function $l(e){if("signed"!==e.type)throw new Error("expected signed message type");if(null==e.sequenceNumber)throw Error("missing seqno field");return function(e,t){var r=Fr(t.toString(16).padStart(16,"0"),"base16"),n=new Uint8Array(e.length+r.length);return n.set(e,0),n.set(r,e.length),n}(e.from.toBytes(),e.sequenceNumber)}function ef(e){return tf.apply(this,arguments)}function tf(){return(tf=(0,E.Z)((0,k.Z)().mark((function e(t){return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,ar.encode(t.data);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function rf(e,t,r,n,i){var o=0,a=new Map;if(Object.entries(t.topics).forEach((function(e){var t,n=I(e,2),s=n[0],u=n[1],c=null!==(t=i.get(s))&&void 0!==t?t:"unknown",l=r.topics[s];if(void 0!==l){var f=a.get(c);f||(f={p1w:0,p2w:0,p3w:0,p3bw:0,p4w:0},a.set(c,f));var h=0,d=0,p=0,v=0,g=0;if(u.inMesh)h+=Math.max(u.meshTime/l.timeInMeshQuantum,l.timeInMeshCap)*l.timeInMeshWeight;var y=u.firstMessageDeliveries;if(y>l.firstMessageDeliveriesCap&&(y=l.firstMessageDeliveriesCap),d+=y*l.firstMessageDeliveriesWeight,u.meshMessageDeliveriesActive&&u.meshMessageDeliveries<l.meshMessageDeliveriesThreshold){var m=l.meshMessageDeliveriesThreshold-u.meshMessageDeliveries;p+=m*m*l.meshMessageDeliveriesWeight}v+=u.meshFailurePenalty*l.meshFailurePenaltyWeight,g+=u.invalidMessageDeliveries*u.invalidMessageDeliveries*l.invalidMessageDeliveriesWeight,o+=(h+d+p+v+g)*l.topicWeight,f.p1w+=h,f.p2w+=d,f.p3w+=p,f.p3bw+=v,f.p4w+=g}})),r.topicScoreCap>0&&o>r.topicScoreCap){o=r.topicScoreCap;var s,u=r.topicScoreCap/o,c=$e(a.values());try{for(c.s();!(s=c.n()).done;){var l=s.value;l.p1w*=u,l.p2w*=u,l.p3w*=u,l.p3bw*=u,l.p4w*=u}}catch(p){c.e(p)}finally{c.f()}}var f=0,h=0,d=0;return f+=r.appSpecificScore(e)*r.appSpecificWeight,t.ips.forEach((function(e){if(!r.IPColocationFactorWhitelist.has(e)){var t=n.get(e),i=t?t.size:0;if(i>r.IPColocationFactorThreshold){var o=i-r.IPColocationFactorThreshold;h+=o*o*r.IPColocationFactorWeight}}})),d+=t.behaviourPenalty*t.behaviourPenalty*r.behaviourPenaltyWeight,{byTopic:a,p5w:f,p6w:h,p7w:d,score:o+=f+h+d}}function nf(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){return!0},n=new Set;if(t<=0)return n;var i,o=$e(e);try{for(o.s();!(i=o.n()).done;){var a=i.value;if(n.size>=t)break;r(a)&&(n.add(a),e.delete(a))}}catch(s){o.e(s)}finally{o.f()}return n}function of(e,t){return nf(e,t,(function(){return!0}))}var af=function(e){U(r,e);var t=K(r);function r(e,n){var i;return(0,D.Z)(this,r),(i=t.call(this,null!==e&&void 0!==e?e:"The operation was aborted")).type="aborted",i.code=null!==n&&void 0!==n?n:"ABORT_ERR",i}return(0,O.Z)(r)}(H(Error));function sf(e,t,r){var n=null!==r&&void 0!==r?r:{},i=function(e){if(null!=e){if("function"===typeof e[Symbol.iterator])return e[Symbol.iterator]();if("function"===typeof e[Symbol.asyncIterator])return e[Symbol.asyncIterator]();if("function"===typeof e.next)return e}throw new Error("argument is not an iterator or iterable")}(e);function o(){return(o=Gs((0,k.Z)().mark((function r(){var o,a,s,u,c,l,f,h;return(0,k.Z)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:a=function(){null!=o&&o()},t.addEventListener("abort",a);case 2:if(s=void 0,r.prev=4,!t.aborted){r.next=8;break}throw u=n.abortMessage,c=n.abortCode,new af(u,c);case 8:return l=new Promise((function(e,t){o=function(){var e=n.abortMessage,r=n.abortCode;t(new af(e,r))}})),r.next=11,Ws(Promise.race([l,i.next()]));case 11:s=r.sent,o=null,r.next=26;break;case 15:if(r.prev=15,r.t0=r.catch(4),t.removeEventListener("abort",a),!(f="aborted"===r.t0.type&&t.aborted)||null==n.onAbort){r.next=22;break}return r.next=22,Ws(n.onAbort(e));case 22:if("function"===typeof i.return)try{(h=i.return())instanceof Promise&&h.catch((function(e){null!=n.onReturnError&&n.onReturnError(e)}))}catch(d){null!=n.onReturnError&&n.onReturnError(d)}if(!f||!0!==n.returnOnAbort){r.next=25;break}return r.abrupt("return");case 25:throw r.t0;case 26:if(!0!==s.done){r.next=28;break}return r.abrupt("break",32);case 28:return r.next=30,s.value;case 30:r.next=2;break;case 32:t.removeEventListener("abort",a);case 33:case"end":return r.stop()}}),r,null,[[4,15]])})))).apply(this,arguments)}return function(){return o.apply(this,arguments)}()}var uf,cf=function(){function e(t,r,n){var i;(0,D.Z)(this,e),this.rawStream=t,this.pushable=xu({objectMode:!1}),this.closeController=new AbortController,this.maxBufferSize=null!==(i=n.maxBufferSize)&&void 0!==i?i:1/0,Pu(sf(this.pushable,this.closeController.signal,{returnOnAbort:!0}),gu(),this.rawStream).catch(r)}return(0,O.Z)(e,[{key:"protocol",get:function(){return this.rawStream.stat.protocol}},{key:"push",value:function(e){if(this.pushable.readableLength>this.maxBufferSize)throw Error("OutboundStream buffer full, size > ".concat(this.maxBufferSize));this.pushable.push(e)}},{key:"close",value:function(){this.closeController.abort(),this.pushable.return(),this.rawStream.close()}}]),e}(),lf=function(){function e(t){(0,D.Z)(this,e),this.rawStream=t,this.closeController=new AbortController,this.source=sf(Pu(this.rawStream,bu()),this.closeController.signal,{returnOnAbort:!0})}return(0,O.Z)(e,[{key:"close",value:function(){this.closeController.abort(),this.rawStream.close()}}]),e}();!function(e){e[e.started=0]="started",e[e.stopped=1]="stopped"}(uf||(uf={}));var ff=function(e){U(r,e);var t=K(r);function r(){var e,n,i,o,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};(0,D.Z)(this,r),(o=t.call(this)).multicodecs=[ol,il],o.peers=new Set,o.streamsInbound=new Map,o.streamsOutbound=new Map,o.outboundInflightQueue=xu({objectMode:!0}),o.direct=new Set,o.floodsubPeers=new Set,o.acceptFromWhitelist=new Map,o.topics=new Map,o.subscriptions=new Set,o.mesh=new Map,o.fanout=new Map,o.fanoutLastpub=new Map,o.gossip=new Map,o.control=new Map,o.peerhave=new Map,o.iasked=new Map,o.backoff=new Map,o.outbound=new Map,o.topicValidators=new Map,o.heartbeatTicks=0,o.components=new jl,o.directPeerInitial=null,o.status={code:uf.stopped},o.heartbeatTimer=null,o.runHeartbeat=function(){var e,t=null===(e=o.metrics)||void 0===e?void 0:e.heartbeatDuration.startTimer();o.heartbeat().catch((function(e){o.log("Error running heartbeat",e)})).finally((function(){if(null!=t&&t(),o.status.code===uf.started){clearTimeout(o.status.heartbeatTimeout);var e,r=o.opts.heartbeatInterval-(Date.now()-o.status.hearbeatStartMs)%o.opts.heartbeatInterval;if(r<.25*o.opts.heartbeatInterval)r+=o.opts.heartbeatInterval,null===(e=o.metrics)||void 0===e||e.heartbeatSkipped.inc();o.status.heartbeatTimeout=setTimeout(o.runHeartbeat,r)}}))};var s=N(N({fallbackToFloodsub:!0,floodPublish:!0,doPX:!1,directPeers:[],D:6,Dlo:4,Dhi:12,Dscore:4,Dout:2,Dlazy:6,heartbeatInterval:1e3,fanoutTTL:6e4,mcacheLength:5,mcacheGossip:3,seenTTL:sl,gossipsubIWantFollowupMs:3e3,prunePeers:16,pruneBackoff:6e4,graftFloodThreshold:1e4,opportunisticGraftPeers:2,opportunisticGraftTicks:60,directConnectTicks:300},a),{},{scoreParams:_l(a.scoreParams),scoreThresholds:Tl(a.scoreThresholds)});if(o.globalSignaturePolicy=null!==(e=s.globalSignaturePolicy)&&void 0!==e?e:yl,s.fallbackToFloodsub&&o.multicodecs.push(nl),o.log=Vc(null!==(n=s.debugName)&&void 0!==n?n:"libp2p:gossipsub"),o.opts=s,o.direct=new Set(s.directPeers.map((function(e){return e.id.toString()}))),o.seenCache=new Hl({validityMs:s.seenTTL}),o.publishedMessageIds=new Hl({validityMs:s.seenTTL}),a.msgIdFn)o.msgIdFn=a.msgIdFn;else switch(o.globalSignaturePolicy){case yl:o.msgIdFn=$l;break;case ml:o.msgIdFn=ef}if(a.fastMsgIdFn&&(o.fastMsgIdFn=a.fastMsgIdFn,o.fastMsgIdCache=new Hl({validityMs:s.seenTTL})),o.msgIdToStrFn=null!==(i=a.msgIdToStrFn)&&void 0!==i?i:ll,o.mcache=a.messageCache||new tl(s.mcacheGossip,s.mcacheLength,o.msgIdToStrFn),a.dataTransform&&(o.dataTransform=a.dataTransform),a.metricsRegister){if(!a.metricsTopicStrToLabel)throw Error("Must set metricsTopicStrToLabel with metrics");var u=Math.max.apply(Math,Jr(Object.values(s.scoreParams.topics).map((function(e){return e.meshMessageDeliveriesWindow}))).concat([1e3])),c=Gl(a.metricsRegister,a.metricsTopicStrToLabel,{gossipPromiseExpireSec:o.opts.gossipsubIWantFollowupMs/1e3,behaviourPenaltyThreshold:s.scoreParams.behaviourPenaltyThreshold,maxMeshMessageDeliveriesWindowSec:u/1e3});c.mcacheSize.addCollect((function(){return o.onScrapeMetrics(c)}));var l,f=$e(o.multicodecs);try{for(f.s();!(l=f.n()).done;){var h=l.value;c.protocolsEnabled.set({protocol:h},1)}}catch(d){f.e(d)}finally{f.f()}o.metrics=c}else o.metrics=null;return o.gossipTracer=new Vl(o.opts.gossipsubIWantFollowupMs,o.msgIdToStrFn,o.metrics),o.score=new Kl(o.opts.scoreParams,o.metrics,{scoreCacheValidityMs:s.heartbeatInterval}),o.maxInboundStreams=a.maxInboundStreams,o.maxOutboundStreams=a.maxOutboundStreams,o}return(0,O.Z)(r,[{key:"getPeers",value:function(){return Jr(this.peers.keys()).map((function(e){return fs(e)}))}},{key:"isStarted",value:function(){return this.status.code===uf.started}},{key:"init",value:function(){var e=(0,E.Z)((0,k.Z)().mark((function e(t){return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.components=t,this.score.init(t);case 2:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"start",value:function(){var e=(0,E.Z)((0,k.Z)().mark((function e(){var t,r,n,i,o=this;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.isStarted()){e.next=2;break}return e.abrupt("return");case 2:return this.log("starting"),e.next=5,wl(this.globalSignaturePolicy,this.components.getPeerId());case 5:return this.publishConfig=e.sent,this.outboundInflightQueue=xu({objectMode:!0}),Pu(this.outboundInflightQueue,function(){var e=(0,E.Z)((0,k.Z)().mark((function e(t){var r,n,i,a,s,u,c,l;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=!1,n=!1,e.prev=2,a=Js(t);case 4:return e.next=6,a.next();case 6:if(!(r=!(s=e.sent).done)){e.next=13;break}return u=s.value,c=u.peerId,l=u.connection,e.next=10,o.createOutboundStream(c,l);case 10:r=!1,e.next=4;break;case 13:e.next=19;break;case 15:e.prev=15,e.t0=e.catch(2),n=!0,i=e.t0;case 19:if(e.prev=19,e.prev=20,!r||null==a.return){e.next=24;break}return e.next=24,a.return();case 24:if(e.prev=24,!n){e.next=27;break}throw i;case 27:return e.finish(24);case 28:return e.finish(19);case 29:case"end":return e.stop()}}),e,null,[[2,15,19,29],[20,,24,28]])})));return function(t){return e.apply(this,arguments)}}()).catch((function(e){return o.log.error("outbound inflight queue error",e)})),e.next=10,Promise.all(this.opts.directPeers.map(function(){var e=(0,E.Z)((0,k.Z)().mark((function e(t){return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o.components.getPeerStore().addressBook.add(t.id,t.addrs);case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 10:return t=this.components.getRegistrar(),e.next=13,Promise.all(this.multicodecs.map((function(e){return t.handle(e,o.onIncomingStream.bind(o),{maxInboundStreams:o.maxInboundStreams,maxOutboundStreams:o.maxOutboundStreams})})));case 13:return a={onConnect:this.onPeerConnected.bind(this),onDisconnect:this.onPeerDisconnected.bind(this)},r=new Qc(a),e.next=16,Promise.all(this.multicodecs.map((function(e){return t.register(e,r)})));case 16:n=e.sent,i=setTimeout(this.runHeartbeat,100),this.status={code:uf.started,registrarTopologyIds:n,heartbeatTimeout:i,hearbeatStartMs:Date.now()+100},this.score.start(),this.directPeerInitial=setTimeout((function(){Promise.resolve().then((0,E.Z)((0,k.Z)().mark((function e(){return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all(Array.from(o.direct).map(function(){var e=(0,E.Z)((0,k.Z)().mark((function e(t){return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o.connect(t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 2:case"end":return e.stop()}}),e)})))).catch((function(e){o.log(e)}))}),1e3),this.log("started");case 22:case"end":return e.stop()}var a}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"stop",value:function(){var e=(0,E.Z)((0,k.Z)().mark((function e(){var t,r,n,i,o,a;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.log("stopping"),this.status.code===uf.started){e.next=3;break}return e.abrupt("return");case 3:t=this.status.registrarTopologyIds,this.status={code:uf.stopped},r=this.components.getRegistrar(),t.forEach((function(e){return r.unregister(e)})),this.outboundInflightQueue.end(),n=$e(this.streamsOutbound.values());try{for(n.s();!(i=n.n()).done;)i.value.close()}catch(s){n.e(s)}finally{n.f()}this.streamsOutbound.clear(),o=$e(this.streamsInbound.values());try{for(o.s();!(a=o.n()).done;)a.value.close()}catch(s){o.e(s)}finally{o.f()}this.streamsInbound.clear(),this.peers.clear(),this.subscriptions.clear(),this.heartbeatTimer&&(this.heartbeatTimer.cancel(),this.heartbeatTimer=null),this.score.stop(),this.mesh.clear(),this.fanout.clear(),this.fanoutLastpub.clear(),this.gossip.clear(),this.control.clear(),this.peerhave.clear(),this.iasked.clear(),this.backoff.clear(),this.outbound.clear(),this.gossipTracer.clear(),this.seenCache.clear(),this.fastMsgIdCache&&this.fastMsgIdCache.clear(),this.directPeerInitial&&clearTimeout(this.directPeerInitial),this.log("stopped");case 32:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"dumpPeerScoreStats",value:function(){return this.score.dumpPeerScoreStats()}},{key:"onIncomingStream",value:function(e){var t=e.stream,r=e.connection;if(this.isStarted()){var n=r.remotePeer;this.addPeer(n,r.stat.direction),this.createInboundStream(n,t),this.outboundInflightQueue.push({peerId:n,connection:r})}}},{key:"onPeerConnected",value:function(e,t){this.isStarted()&&(this.addPeer(e,t.stat.direction),this.outboundInflightQueue.push({peerId:e,connection:t}))}},{key:"onPeerDisconnected",value:function(e){this.log("connection ended %p",e),this.removePeer(e)}},{key:"createOutboundStream",value:function(){var e=(0,E.Z)((0,k.Z)().mark((function e(t,r){var n,i,o,a,s=this;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.isStarted()){e.next=2;break}return e.abrupt("return");case 2:if(n=t.toString(),this.peers.has(n)){e.next=5;break}return e.abrupt("return");case 5:if(!this.streamsOutbound.has(n)){e.next=7;break}return e.abrupt("return");case 7:return e.prev=7,e.t0=cf,e.next=11,r.newStream(this.multicodecs);case 11:e.t1=e.sent,e.t2=function(e){return s.log.error("outbound pipe error",e)},e.t3={maxBufferSize:this.opts.maxOutboundBufferSize},o=new e.t0(e.t1,e.t2,e.t3),this.log("create outbound stream %p",t),this.streamsOutbound.set(n,o),(a=o.protocol)===nl&&this.floodsubPeers.add(n),null===(i=this.metrics)||void 0===i||i.peersPerProtocol.inc({protocol:a},1),this.subscriptions.size>0&&(this.log("send subscriptions to",n),this.sendSubscriptions(n,Array.from(this.subscriptions),!0)),e.next=26;break;case 23:e.prev=23,e.t4=e.catch(7),this.log.error("createOutboundStream error",e.t4);case 26:case"end":return e.stop()}}),e,this,[[7,23]])})));return function(t,r){return e.apply(this,arguments)}}()},{key:"createInboundStream",value:function(){var e=(0,E.Z)((0,k.Z)().mark((function e(t,r){var n,i,o,a=this;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.isStarted()){e.next=2;break}return e.abrupt("return");case 2:if(n=t.toString(),this.peers.has(n)){e.next=5;break}return e.abrupt("return");case 5:void 0!==(i=this.streamsInbound.get(n))&&(this.log("replacing existing inbound steam %s",n),i.close()),this.log("create inbound stream %s",n),o=new lf(r),this.streamsInbound.set(n,o),this.pipePeerReadStream(t,o.source).catch((function(e){return a.log(e)}));case 11:case"end":return e.stop()}}),e,this)})));return function(t,r){return e.apply(this,arguments)}}()},{key:"addPeer",value:function(e,t){var r=e.toString();this.peers.has(r)||(this.log("new peer %p",e),this.peers.add(r),this.score.addPeer(r),this.outbound.has(r)||this.outbound.set(r,"outbound"===t))}},{key:"removePeer",value:function(e){var t=e.toString();if(this.peers.has(t)){this.log("delete peer %p",e),this.peers.delete(t);var r,n=this.streamsOutbound.get(t),i=this.streamsInbound.get(t);if(n)null===(r=this.metrics)||void 0===r||r.peersPerProtocol.inc({protocol:n.protocol},-1);null===n||void 0===n||n.close(),null===i||void 0===i||i.close(),this.streamsOutbound.delete(t),this.streamsInbound.delete(t);var o,a=$e(this.topics.values());try{for(a.s();!(o=a.n()).done;){o.value.delete(t)}}catch(p){a.e(p)}finally{a.f()}var s,u=$e(this.mesh);try{for(u.s();!(s=u.n()).done;){var c,l=I(s.value,2),f=l[0];if(!0===l[1].delete(t))null===(c=this.metrics)||void 0===c||c.onRemoveFromMesh(f,Ul.Dc,1)}}catch(p){u.e(p)}finally{u.f()}var h,d=$e(this.fanout.values());try{for(d.s();!(h=d.n()).done;){h.value.delete(t)}}catch(p){d.e(p)}finally{d.f()}this.floodsubPeers.delete(t),this.gossip.delete(t),this.control.delete(t),this.outbound.delete(t),this.score.removePeer(t),this.acceptFromWhitelist.delete(t)}}},{key:"started",get:function(){return this.status.code===uf.started}},{key:"getMeshPeers",value:function(e){var t=this.mesh.get(e);return t?Array.from(t):[]}},{key:"getSubscribers",value:function(e){var t=this.topics.get(e);return(t?Array.from(t):[]).map((function(e){return fs(e)}))}},{key:"getTopics",value:function(){return Array.from(this.subscriptions)}},{key:"pipePeerReadStream",value:function(){var e=(0,E.Z)((0,k.Z)().mark((function e(t,r){var n=this;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Pu(r,function(){var e=(0,E.Z)((0,k.Z)().mark((function e(r){var i,o,a,s,u,c,l,f,h;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=!1,o=!1,e.prev=2,s=Js(r);case 4:return e.next=6,s.next();case 6:if(!(i=!(u=e.sent).done)){e.next=26;break}if(c=u.value,e.prev=8,f=c.subarray(),h=rl.decode(f),null===(l=n.metrics)||void 0===l||l.onRpcRecv(h,f.length),!n.opts.awaitRpcHandler){e.next=17;break}return e.next=15,n.handleReceivedRpc(t,h);case 15:e.next=18;break;case 17:n.handleReceivedRpc(t,h).catch((function(e){return n.log(e)}));case 18:e.next=23;break;case 20:e.prev=20,e.t0=e.catch(8),n.log(e.t0);case 23:i=!1,e.next=4;break;case 26:e.next=32;break;case 28:e.prev=28,e.t1=e.catch(2),o=!0,a=e.t1;case 32:if(e.prev=32,e.prev=33,!i||null==s.return){e.next=37;break}return e.next=37,s.return();case 37:if(e.prev=37,!o){e.next=40;break}throw a;case 40:return e.finish(37);case 41:return e.finish(32);case 42:case"end":return e.stop()}}),e,null,[[2,28,32,42],[8,20],[33,,37,41]])})));return function(t){return e.apply(this,arguments)}}());case 3:e.next=9;break;case 5:e.prev=5,e.t0=e.catch(0),this.log.error(e.t0),this.onPeerDisconnected(t);case 9:case"end":return e.stop()}}),e,this,[[0,5]])})));return function(t,r){return e.apply(this,arguments)}}()},{key:"handleReceivedRpc",value:function(){var e=(0,E.Z)((0,k.Z)().mark((function e(t,r){var n,i,o,a,s,u=this;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.acceptFrom(t.toString())){e.next=4;break}return this.log("received message from unacceptable peer %p",t),null===(n=this.metrics)||void 0===n||n.rpcRecvNotAccepted.inc(),e.abrupt("return");case 4:if(this.log("rpc from %p",t),r.subscriptions&&r.subscriptions.length>0&&(r.subscriptions.forEach((function(e){u.handleReceivedSubscription(t,e)})),this.dispatchEvent(new el("subscription-change",{detail:{peerId:t,subscriptions:r.subscriptions.filter((function(e){return null!==e.topic})).map((function(e){var t;return{topic:null!==(t=e.topic)&&void 0!==t?t:"",subscribe:Boolean(e.subscribe)}}))}}))),!r.messages){e.next=26;break}i=$e(r.messages),e.prev=8,i.s();case 10:if((o=i.n()).done){e.next=18;break}if(a=o.value,s=this.handleReceivedMessage(t,a).catch((function(e){return u.log(e)})),!this.opts.awaitRpcMessageHandler){e.next=16;break}return e.next=16,s;case 16:e.next=10;break;case 18:e.next=23;break;case 20:e.prev=20,e.t0=e.catch(8),i.e(e.t0);case 23:return e.prev=23,i.f(),e.finish(23);case 26:if(!r.control){e.next=29;break}return e.next=29,this.handleControlMessage(t.toString(),r.control);case 29:case"end":return e.stop()}}),e,this,[[8,20,23,26]])})));return function(t,r){return e.apply(this,arguments)}}()},{key:"handleReceivedSubscription",value:function(e,t){if(null!=t.topic){this.log("subscription update from %p topic %s",e,t.topic);var r=this.topics.get(t.topic);null==r&&(r=new Set,this.topics.set(t.topic,r)),t.subscribe?r.add(e.toString()):r.delete(e.toString())}}},{key:"handleReceivedMessage",value:function(){var e=(0,E.Z)((0,k.Z)().mark((function e(t,n){var i,o,a,s,u;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return null===(i=this.metrics)||void 0===i||i.onMsgRecvPreValidation(n.topic),e.next=3,this.validateReceivedMessage(t,n);case 3:s=e.sent,null===(o=this.metrics)||void 0===o||o.onMsgRecvResult(n.topic,s.code),e.t0=s.code,e.next=e.t0===gl.duplicate?8:e.t0===gl.invalid?11:e.t0===gl.valid?14:19;break;case 8:return this.score.duplicateMessage(t.toString(),s.msgIdStr,n.topic),this.mcache.observeDuplicate(s.msgIdStr,t.toString()),e.abrupt("return");case 11:return s.msgIdStr?(u=s.msgIdStr,this.score.rejectMessage(t.toString(),u,n.topic,s.reason),this.gossipTracer.rejectMessage(u,s.reason)):this.score.rejectInvalidMessage(t.toString(),n.topic),null===(a=this.metrics)||void 0===a||a.onMsgRecvInvalid(n.topic,s),e.abrupt("return");case 14:this.score.validateMessage(s.messageId.msgIdStr),this.gossipTracer.deliverMessage(s.messageId.msgIdStr),this.mcache.put(s.messageId,n,!this.opts.asyncValidation),this.subscriptions.has(n.topic)&&(this.components.getPeerId().equals(t)&&!this.opts.emitSelf||(Xr(F(r.prototype),"dispatchEvent",this).call(this,new el("gossipsub:message",{detail:{propagationSource:t,msgId:s.messageId.msgIdStr,msg:s.msg}})),Xr(F(r.prototype),"dispatchEvent",this).call(this,new el("message",{detail:s.msg})))),this.opts.asyncValidation||this.forwardMessage(s.messageId.msgIdStr,n,t.toString());case 19:case"end":return e.stop()}}),e,this)})));return function(t,r){return e.apply(this,arguments)}}()},{key:"validateReceivedMessage",value:function(){var e=(0,E.Z)((0,k.Z)().mark((function e(t,r){var n,i,o,a,s,u,c,l,f,h,d,p,v;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=null===(n=this.fastMsgIdFn)||void 0===n?void 0:n.call(this,r),!(s=a?null===(i=this.fastMsgIdCache)||void 0===i?void 0:i.get(a):void 0)){e.next=4;break}return e.abrupt("return",{code:gl.duplicate,msgIdStr:s});case 4:return e.next=6,Yl(this.globalSignaturePolicy,r);case 6:if((u=e.sent).valid){e.next=9;break}return e.abrupt("return",{code:gl.invalid,reason:pl.Error,error:u.error});case 9:c=u.message,e.prev=10,this.dataTransform&&(c.data=this.dataTransform.inboundTransform(r.topic,c.data)),e.next=18;break;case 14:return e.prev=14,e.t0=e.catch(10),this.log("Invalid message, transform failed",e.t0),e.abrupt("return",{code:gl.invalid,reason:pl.Error,error:vl.TransformFailed});case 18:return e.next=20,this.msgIdFn(c);case 20:if(l=e.sent,f=this.msgIdToStrFn(l),h={msgId:l,msgIdStr:f},a&&(null===(o=this.fastMsgIdCache)||void 0===o||o.put(a,f)),!this.seenCache.has(f)){e.next=28;break}return e.abrupt("return",{code:gl.duplicate,msgIdStr:f});case 28:this.seenCache.put(f);case 29:if(null==(d=this.topicValidators.get(r.topic))){e.next=44;break}return e.prev=31,e.next=34,d(c.topic,c,t);case 34:p=e.sent,e.next=42;break;case 37:e.prev=37,e.t1=e.catch(31),"ERR_TOPIC_VALIDATOR_IGNORE"===(v=e.t1.code)&&(p=dl.Ignore),p="ERR_TOPIC_VALIDATOR_REJECT"===v?dl.Reject:dl.Ignore;case 42:if(p===dl.Accept){e.next=44;break}return e.abrupt("return",{code:gl.invalid,reason:bl(p),msgIdStr:f});case 44:return e.abrupt("return",{code:gl.valid,messageId:h,msg:c});case 45:case"end":return e.stop()}}),e,this,[[10,14],[31,37]])})));return function(t,r){return e.apply(this,arguments)}}()},{key:"getScore",value:function(e){return this.score.score(e)}},{key:"sendSubscriptions",value:function(e,t,r){this.sendRpc(e,{subscriptions:t.map((function(e){return{topic:e,subscribe:r}})),messages:[]})}},{key:"handleControlMessage",value:function(){var e=(0,E.Z)((0,k.Z)().mark((function e(t,r){var n,i,o;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(void 0!==r){e.next=2;break}return e.abrupt("return");case 2:if(n=r.ihave?this.handleIHave(t,r.ihave):[],i=r.iwant?this.handleIWant(t,r.iwant):[],!r.graft){e.next=10;break}return e.next=7,this.handleGraft(t,r.graft);case 7:e.t0=e.sent,e.next=11;break;case 10:e.t0=[];case 11:if(o=e.t0,e.t1=r.prune,!e.t1){e.next=16;break}return e.next=16,this.handlePrune(t,r.prune);case 16:if(n.length||i.length||o.length){e.next=18;break}return e.abrupt("return");case 18:this.sendRpc(t,ul(i,{iwant:n,prune:o}));case 19:case"end":return e.stop()}}),e,this)})));return function(t,r){return e.apply(this,arguments)}}()},{key:"acceptFrom",value:function(e){if(this.direct.has(e))return!0;var t=Date.now(),r=this.acceptFromWhitelist.get(e);if(r&&r.messagesAccepted<128&&r.acceptUntil>=t)return r.messagesAccepted+=1,!0;var n=this.score.score(e);return n>=0?this.acceptFromWhitelist.set(e,{messagesAccepted:0,acceptUntil:t+1e3}):this.acceptFromWhitelist.delete(e),n>=this.opts.scoreThresholds.graylistThreshold}},{key:"handleIHave",value:function(e,t){var r,n,i=this;if(!t.length)return[];var o,a=this.score.score(e);if(a<this.opts.scoreThresholds.gossipThreshold)return this.log("IHAVE: ignoring peer %s with score below threshold [ score = %d ]",e,a),null===(o=this.metrics)||void 0===o||o.ihaveRcvIgnored.inc({reason:zl.LowScore}),[];var s,u=(null!==(r=this.peerhave.get(e))&&void 0!==r?r:0)+1;if(this.peerhave.set(e,u),u>10)return this.log("IHAVE: peer %s has advertised too many times (%d) within this heartbeat interval; ignoring",e,u),null===(s=this.metrics)||void 0===s||s.ihaveRcvIgnored.inc({reason:zl.MaxIhave}),[];var c,l=null!==(n=this.iasked.get(e))&&void 0!==n?n:0;if(l>=al)return this.log("IHAVE: peer %s has already advertised too many messages (%d); ignoring",e,l),null===(c=this.metrics)||void 0===c||c.ihaveRcvIgnored.inc({reason:zl.MaxIasked}),[];var f=new Map;if(t.forEach((function(e){var t,r=e.topicID,n=e.messageIDs;if(r&&n&&i.mesh.has(r)){var o=0;n.forEach((function(e){var t=i.msgIdToStrFn(e);i.seenCache.has(t)||(f.set(t,e),o++)})),null===(t=i.metrics)||void 0===t||t.onIhaveRcv(r,n.length,o)}})),!f.size)return[];var h=f.size;h+l>al&&(h=al-l),this.log("IHAVE: Asking for %d out of %d messages from %s",h,f.size,e);var d=Array.from(f.values());return cl(d),d=d.slice(0,h),this.iasked.set(e,l+h),this.gossipTracer.addPromise(e,d),[{messageIDs:d}]}},{key:"handleIWant",value:function(e,t){var r,n=this;if(!t.length)return[];var i=this.score.score(e);if(i<this.opts.scoreThresholds.gossipThreshold)return this.log("IWANT: ignoring peer %s with score below threshold [score = %d]",e,i),[];var o=new Map,a=new Map,s=0;return t.forEach((function(t){var r=t.messageIDs;r&&r.forEach((function(t){var r,i=n.msgIdToStrFn(t),u=n.mcache.getWithIWantCount(i,e);null!=u?(a.set(u.msg.topic,1+(null!==(r=a.get(u.msg.topic))&&void 0!==r?r:0)),u.count>3?n.log("IWANT: Peer %s has asked for message %s too many times: ignoring request",e,t):o.set(i,u.msg)):s++}))})),null===(r=this.metrics)||void 0===r||r.onIwantRcv(a,s),o.size?(this.log("IWANT: Sending %d messages to %s",o.size,e),Array.from(o.values())):(this.log("IWANT: Could not provide any wanted messages to %s",e),[])}},{key:"handleGraft",value:function(){var e=(0,E.Z)((0,k.Z)().mark((function e(t,r){var n,i,o,a,s=this;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=[],i=this.score.score(t),o=Date.now(),a=this.opts.doPX,r.forEach((function(e){var r,u,c=e.topicID;if(c){var l=s.mesh.get(c);if(l){if(!l.has(t)){if(s.direct.has(t))return s.log("GRAFT: ignoring request from direct peer %s",t),n.push(c),void(a=!1);var f=null===(r=s.backoff.get(c))||void 0===r?void 0:r.get(t);if("number"===typeof f&&o<f){s.log("GRAFT: ignoring backed off peer %s",t),s.score.addPenalty(t,1,Fl.GraftBackoff),a=!1;var h=f+s.opts.graftFloodThreshold-s.opts.pruneBackoff;return o<h&&s.score.addPenalty(t,1,Fl.GraftBackoff),s.addBackoff(t,c),void n.push(c)}if(i<0)return s.log("GRAFT: ignoring peer %s with negative score: score=%d, topic=%s",t,i,c),n.push(c),a=!1,void s.addBackoff(t,c);if(l.size>=s.opts.Dhi&&!s.outbound.get(t))return n.push(c),void s.addBackoff(t,c);s.log("GRAFT: Add mesh link from %s in %s",t,c),s.score.graft(t,c),l.add(t),null===(u=s.metrics)||void 0===u||u.onAddToMesh(c,Ll.Subscribed,1)}}else a=!1}})),n.length){e.next=7;break}return e.abrupt("return",[]);case 7:return e.next=9,Promise.all(n.map((function(e){return s.makePrune(t,e,a)})));case 9:return e.abrupt("return",e.sent);case 10:case"end":return e.stop()}}),e,this)})));return function(t,r){return e.apply(this,arguments)}}()},{key:"handlePrune",value:function(){var e=(0,E.Z)((0,k.Z)().mark((function e(t,r){var n,i,o,a,s,u,c,l,f;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=this.score.score(t),i=$e(r),e.prev=2,i.s();case 4:if((o=i.n()).done){e.next=23;break}if(a=o.value,s=a.topicID,u=a.backoff,c=a.peers,null!=s){e.next=8;break}return e.abrupt("continue",21);case 8:if(l=this.mesh.get(s)){e.next=11;break}return e.abrupt("return");case 11:if(this.log("PRUNE: Remove mesh link to %s in %s",t,s),this.score.prune(t,s),l.has(t)&&(l.delete(t),null===(f=this.metrics)||void 0===f||f.onRemoveFromMesh(s,Ul.Unsub,1)),"number"===typeof u&&u>0?this.doAddBackoff(t,s,1e3*u):this.addBackoff(t,s),!c||!c.length){e.next=21;break}if(!(n<this.opts.scoreThresholds.acceptPXThreshold)){e.next=19;break}return this.log("PRUNE: ignoring PX from peer %s with insufficient score [score = %d, topic = %s]",t,n,s),e.abrupt("continue",21);case 19:return e.next=21,this.pxConnect(c);case 21:e.next=4;break;case 23:e.next=28;break;case 25:e.prev=25,e.t0=e.catch(2),i.e(e.t0);case 28:return e.prev=28,i.f(),e.finish(28);case 31:case"end":return e.stop()}}),e,this,[[2,25,28,31]])})));return function(t,r){return e.apply(this,arguments)}}()},{key:"addBackoff",value:function(e,t){this.doAddBackoff(e,t,this.opts.pruneBackoff)}},{key:"doAddBackoff",value:function(e,t,r){var n,i=this.backoff.get(t);i||(i=new Map,this.backoff.set(t,i));var o=Date.now()+r;(null!==(n=i.get(e))&&void 0!==n?n:0)<o&&i.set(e,o)}},{key:"applyIwantPenalties",value:function(){var e=this;this.gossipTracer.getBrokenPromises().forEach((function(t,r){e.log("peer %s didn't follow up in %d IWANT requests; adding penalty",r,t),e.score.addPenalty(r,t,Fl.BrokenPromise)}))}},{key:"clearBackoff",value:function(){var e=this;if(this.heartbeatTicks%15===0){var t=Date.now();this.backoff.forEach((function(r,n){r.forEach((function(e,n){e<t&&r.delete(n)})),0===r.size&&e.backoff.delete(n)}))}}},{key:"directConnect",value:function(){var e=(0,E.Z)((0,k.Z)().mark((function e(){var t,r=this;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=[],this.direct.forEach((function(e){r.streamsOutbound.has(e)||t.push(e)})),e.next=4,Promise.all(t.map(function(){var e=(0,E.Z)((0,k.Z)().mark((function e(t){return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.connect(t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 4:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"pxConnect",value:function(){var e=(0,E.Z)((0,k.Z)().mark((function e(t){var r,n=this;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t.length>this.opts.prunePeers&&(cl(t),t=t.slice(0,this.opts.prunePeers)),r=[],e.next=4,Promise.all(t.map(function(){var e=(0,E.Z)((0,k.Z)().mark((function e(t){var i,o,a;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t.peerID){e.next=2;break}return e.abrupt("return");case 2:if(i=hs(t.peerID).toString(),!n.peers.has(i)){e.next=5;break}return e.abrupt("return");case 5:if(t.signedPeerRecord){e.next=8;break}return r.push(i),e.abrupt("return");case 8:return e.prev=8,e.next=11,oc.openAndCertify(t.signedPeerRecord,"libp2p-peer-record");case 11:if(o=e.sent,a=o.peerId,o.peerId.equals(i)){e.next=16;break}return n.log("bogus peer record obtained through px: peer ID %p doesn't match expected peer %p",a,i),e.abrupt("return");case 16:return e.next=18,n.components.getPeerStore().addressBook.consumePeerRecord(o);case 18:if(e.sent){e.next=21;break}return n.log("bogus peer record obtained through px: could not add peer record to address book"),e.abrupt("return");case 21:r.push(i),e.next=27;break;case 24:e.prev=24,e.t0=e.catch(8),n.log("bogus peer record obtained through px: invalid signature or not a peer record");case 27:case"end":return e.stop()}}),e,null,[[8,24]])})));return function(t){return e.apply(this,arguments)}}()));case 4:if(r.length){e.next=6;break}return e.abrupt("return");case 6:return e.next=8,Promise.all(r.map(function(){var e=(0,E.Z)((0,k.Z)().mark((function e(t){return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n.connect(t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 8:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"connect",value:function(){var e=(0,E.Z)((0,k.Z)().mark((function e(t){var r,n,i,o,a,s,u;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.log("Initiating connection with %s",t),r=fs(t),e.next=4,this.components.getConnectionManager().openConnection(r);case 4:n=e.sent,i=$e(this.multicodecs);try{for(i.s();!(o=i.n()).done;){a=o.value,s=$e(this.components.getRegistrar().getTopologies(a));try{for(s.s();!(u=s.n()).done;)u.value.onConnect(r,n)}catch(c){s.e(c)}finally{s.f()}}}catch(c){i.e(c)}finally{i.f()}case 7:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"subscribe",value:function(e){if(this.status.code!==uf.started)throw new Error("Pubsub has not started");if(!this.subscriptions.has(e)){this.subscriptions.add(e);var t,r=$e(this.peers.keys());try{for(r.s();!(t=r.n()).done;){var n=t.value;this.sendSubscriptions(n,[e],!0)}}catch(i){r.e(i)}finally{r.f()}}this.join(e)}},{key:"unsubscribe",value:function(e){var t=this;if(this.status.code!==uf.started)throw new Error("Pubsub is not started");var r=this.subscriptions.delete(e);if(this.log("unsubscribe from %s - am subscribed %s",e,r),r){var n,i=$e(this.peers.keys());try{for(i.s();!(n=i.n()).done;){var o=n.value;this.sendSubscriptions(o,[e],!1)}}catch(a){i.e(a)}finally{i.f()}}this.leave(e).catch((function(e){t.log(e)}))}},{key:"join",value:function(e){var t,r=this;if(this.status.code!==uf.started)throw new Error("Gossipsub has not started");if(!this.mesh.has(e)){this.log("JOIN %s",e),null===(t=this.metrics)||void 0===t||t.onJoin(e);var n,i=new Set,o=this.fanout.get(e);if(o)this.fanout.delete(e),this.fanoutLastpub.delete(e),o.forEach((function(e){!r.direct.has(e)&&r.score.score(e)>=0&&i.add(e)})),null===(n=this.metrics)||void 0===n||n.onAddToMesh(e,Ll.Fanout,i.size);if(i.size<this.opts.D){var a,s=i.size,u=this.getRandomGossipPeers(e,this.opts.D,(function(e){return!i.has(e)&&!r.direct.has(e)&&r.score.score(e)>=0}));u.forEach((function(e){i.add(e)})),null===(a=this.metrics)||void 0===a||a.onAddToMesh(e,Ll.Random,i.size-s)}this.mesh.set(e,i),i.forEach((function(t){r.log("JOIN: Add mesh link to %s in %s",t,e),r.sendGraft(t,e)}))}}},{key:"leave",value:function(){var e=(0,E.Z)((0,k.Z)().mark((function e(t){var r,n,i=this;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.status.code===uf.started){e.next=2;break}throw new Error("Gossipsub has not started");case 2:if(this.log("LEAVE %s",t),null===(r=this.metrics)||void 0===r||r.onLeave(t),!(n=this.mesh.get(t))){e.next=9;break}return e.next=8,Promise.all(Array.from(n).map(function(){var e=(0,E.Z)((0,k.Z)().mark((function e(r){return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i.log("LEAVE: Remove mesh link to %s in %s",r,t),e.next=3,i.sendPrune(r,t);case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 8:this.mesh.delete(t);case 9:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},{key:"selectPeersToForward",value:function(e,t,r){var n=this,i=new Set,o=this.topics.get(e);o&&(this.direct.forEach((function(e){!o.has(e)||t===e||null!==r&&void 0!==r&&r.has(e)||i.add(e)})),this.floodsubPeers.forEach((function(e){o.has(e)&&t!==e&&(null===r||void 0===r||!r.has(e))&&n.score.score(e)>=n.opts.scoreThresholds.publishThreshold&&i.add(e)})));var a=this.mesh.get(e);return a&&a.size>0&&a.forEach((function(e){t===e||null!==r&&void 0!==r&&r.has(e)||i.add(e)})),i}},{key:"selectPeersToPublish",value:function(e){var t=this,r=new Set,n={direct:0,floodsub:0,mesh:0,fanout:0},i=this.topics.get(e);if(i)if(this.opts.floodPublish)i.forEach((function(e){t.direct.has(e)?(r.add(e),n.direct++):t.score.score(e)>=t.opts.scoreThresholds.publishThreshold&&(r.add(e),n.floodsub++)}));else{this.direct.forEach((function(e){i.has(e)&&(r.add(e),n.direct++)})),this.floodsubPeers.forEach((function(e){i.has(e)&&t.score.score(e)>=t.opts.scoreThresholds.publishThreshold&&(r.add(e),n.floodsub++)}));var o=this.mesh.get(e);if(o&&o.size>0)o.forEach((function(e){r.add(e),n.mesh++}));else{var a=this.fanout.get(e);if(a&&a.size>0)a.forEach((function(e){r.add(e),n.fanout++}));else{var s=this.getRandomGossipPeers(e,this.opts.D,(function(e){return t.score.score(e)>=t.opts.scoreThresholds.publishThreshold}));s.size>0&&(this.fanout.set(e,s),s.forEach((function(e){r.add(e),n.fanout++})))}this.fanoutLastpub.set(e,Date.now())}}return{tosend:r,tosendCount:n}}},{key:"forwardMessage",value:function(e,t,r,n){var i,o=this;r&&this.score.deliverMessage(r,e,t.topic);var a=this.selectPeersToForward(t.topic,r,n),s=ul([t]);a.forEach((function(e){o.sendRpc(e,s)})),null===(i=this.metrics)||void 0===i||i.onForwardMsg(t.topic,a.size)}},{key:"publish",value:function(){var e=(0,E.Z)((0,k.Z)().mark((function e(t,n){var i,o,a,s,u,c,l,f,h,d,p,v,g,y,m;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=this.dataTransform?this.dataTransform.outboundTransform(t,n):n,null!=this.publishConfig){e.next=3;break}throw Error("PublishError.Uninitialized");case 3:return e.next=5,Ql(this.publishConfig,t,n,o);case 5:return a=e.sent,s=a.raw,u=a.msg,e.next=10,this.msgIdFn(u);case 10:if(c=e.sent,l=this.msgIdToStrFn(c),!this.seenCache.has(l)){e.next=14;break}throw Error("PublishError.Duplicate");case 14:if(f=this.selectPeersToPublish(t),h=f.tosend,d=f.tosendCount,p=!0===this.opts.emitSelf&&this.subscriptions.has(t),0!==h.size||this.opts.allowPublishToZeroPeers||p){e.next=18;break}throw Error("PublishError.InsufficientPeers");case 18:this.seenCache.put(l),this.mcache.put({msgId:c,msgIdStr:l},s,!0),this.publishedMessageIds.put(l),v=ul([s]),g=$e(h);try{for(g.s();!(y=g.n()).done;)m=y.value,this.sendRpc(m,v)||h.delete(m)}catch(b){g.e(b)}finally{g.f()}return null===(i=this.metrics)||void 0===i||i.onPublishMsg(t,d,h.size,null!=s.data?s.data.length:0),p&&(h.add(this.components.getPeerId().toString()),Xr(F(r.prototype),"dispatchEvent",this).call(this,new el("gossipsub:message",{detail:{propagationSource:this.components.getPeerId(),msgId:l,msg:u}})),Xr(F(r.prototype),"dispatchEvent",this).call(this,new el("message",{detail:u}))),e.abrupt("return",{recipients:Array.from(h.values()).map((function(e){return fs(e)}))});case 27:case"end":return e.stop()}}),e,this)})));return function(t,r){return e.apply(this,arguments)}}()},{key:"reportMessageValidationResult",value:function(e,t,r){if(r===dl.Accept){var n,i=this.mcache.validate(e);if(null===(n=this.metrics)||void 0===n||n.onReportValidationMcacheHit(null!==i),null!=i){var o,a=i.message,s=i.originatingPeers;this.score.deliverMessage(t.toString(),e,a.topic),this.forwardMessage(e,i.message,t.toString(),s),null===(o=this.metrics)||void 0===o||o.onReportValidation(a.topic,r)}}else{var u,c=this.mcache.remove(e);if(null===(u=this.metrics)||void 0===u||u.onReportValidationMcacheHit(null!==c),c){var l,f=bl(r),h=c.message,d=c.originatingPeers;this.score.rejectMessage(t.toString(),e,h.topic,f);var p,v=$e(d);try{for(v.s();!(p=v.n()).done;){var g=p.value;this.score.rejectMessage(g,e,h.topic,f)}}catch(y){v.e(y)}finally{v.f()}null===(l=this.metrics)||void 0===l||l.onReportValidation(h.topic,r)}}}},{key:"sendGraft",value:function(e,t){var r=ul([],{graft:[{topicID:t}]});this.sendRpc(e,r)}},{key:"sendPrune",value:function(){var e=(0,E.Z)((0,k.Z)().mark((function e(t,r){var n,i;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.makePrune(t,r,this.opts.doPX);case 2:e.t0=e.sent,n=[e.t0],i=ul([],{prune:n}),this.sendRpc(t,i);case 6:case"end":return e.stop()}}),e,this)})));return function(t,r){return e.apply(this,arguments)}}()},{key:"sendRpc",value:function(e,t){var r,n=this.streamsOutbound.get(e);if(!n)return this.log("Cannot send RPC to ".concat(e," as there is no open stream to it available")),!1;var i=this.control.get(e);i&&(this.piggybackControl(e,t,i),this.control.delete(e));var o=this.gossip.get(e);o&&(this.piggybackGossip(e,t,o),this.gossip.delete(e));var a=rl.encode(t).finish();try{n.push(a)}catch(s){return this.log.error("Cannot send rpc to ".concat(e),s),i&&this.control.set(e,i),o&&this.gossip.set(e,o),!1}return null===(r=this.metrics)||void 0===r||r.onRpcSent(t,a.length),!0}},{key:"piggybackControl",value:function(e,t,r){var n=this,i=(r.graft||[]).filter((function(t){var r=t.topicID;return(r&&n.mesh.get(r)||new Set).has(e)})),o=(r.prune||[]).filter((function(t){var r=t.topicID;return!(r&&n.mesh.get(r)||new Set).has(e)}));(i.length||o.length)&&(t.control?(t.control.graft=t.control.graft&&t.control.graft.concat(i),t.control.prune=t.control.prune&&t.control.prune.concat(o)):t.control={graft:i,prune:o,ihave:[],iwant:[]})}},{key:"piggybackGossip",value:function(e,t,r){t.control||(t.control={ihave:[],iwant:[],graft:[],prune:[]}),t.control.ihave=r}},{key:"sendGraftPrune",value:function(){var e=(0,E.Z)((0,k.Z)().mark((function e(t,r,n){var i,o,a,s,u,c,l,f=this;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:i=this.opts.doPX,o=$e(t),e.prev=2,s=(0,k.Z)().mark((function e(){var t,o,s,u,c,l,h;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=I(a.value,2),o=t[0],s=t[1],u=s.map((function(e){return{topicID:e}})),c=[],!(l=r.get(o))){e.next=9;break}return e.next=7,Promise.all(l.map(function(){var e=(0,E.Z)((0,k.Z)().mark((function e(t){var r;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,f.makePrune(o,t,i&&!(null!==(r=n.get(o))&&void 0!==r&&r));case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 7:c=e.sent,r.delete(o);case 9:h=ul([],{graft:u,prune:c}),f.sendRpc(o,h);case 11:case"end":return e.stop()}}),e)})),o.s();case 5:if((a=o.n()).done){e.next=9;break}return e.delegateYield(s(),"t0",7);case 7:e.next=5;break;case 9:e.next=14;break;case 11:e.prev=11,e.t1=e.catch(2),o.e(e.t1);case 14:return e.prev=14,o.f(),e.finish(14);case 17:u=$e(r),e.prev=18,l=(0,k.Z)().mark((function e(){var t,r,o,a,s;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=I(c.value,2),r=t[0],o=t[1],e.next=3,Promise.all(o.map(function(){var e=(0,E.Z)((0,k.Z)().mark((function e(t){var o;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,f.makePrune(r,t,i&&!(null!==(o=n.get(r))&&void 0!==o&&o));case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 3:a=e.sent,s=ul([],{prune:a}),f.sendRpc(r,s);case 6:case"end":return e.stop()}}),e)})),u.s();case 21:if((c=u.n()).done){e.next=25;break}return e.delegateYield(l(),"t2",23);case 23:e.next=21;break;case 25:e.next=30;break;case 27:e.prev=27,e.t3=e.catch(18),u.e(e.t3);case 30:return e.prev=30,u.f(),e.finish(30);case 33:case"end":return e.stop()}}),e,this,[[2,11,14,17],[18,27,30,33]])})));return function(t,r,n){return e.apply(this,arguments)}}()},{key:"emitGossip",value:function(e){var t,r=this.mcache.getGossipIDs(new Set(e.keys())),n=$e(e);try{for(n.s();!(t=n.n()).done;){var i,o=I(t.value,2),a=o[0],s=o[1];this.doEmitGossip(a,s,null!==(i=r.get(a))&&void 0!==i?i:[])}}catch(u){n.e(u)}finally{n.f()}}},{key:"doEmitGossip",value:function(e,t,r){var n=this;if(r.length&&(cl(r),r.length>al&&this.log("too many messages for gossip; will truncate IHAVE list (%d messages)",r.length),t.size)){var i=this.opts.Dlazy,o=.25*t.size,a=t;o>i&&(i=o),i>a.size?i=a.size:a=cl(Array.from(a)).slice(0,i),a.forEach((function(t){var i=r;r.length>al&&(i=cl(i.slice()).slice(0,al)),n.pushGossip(t,{topicID:e,messageIDs:i})}))}}},{key:"flush",value:function(){var e,t=$e(this.gossip.entries());try{for(t.s();!(e=t.n()).done;){var r=I(e.value,2),n=r[0],i=r[1];this.gossip.delete(n),this.sendRpc(n,ul([],{ihave:i}))}}catch(l){t.e(l)}finally{t.f()}var o,a=$e(this.control.entries());try{for(a.s();!(o=a.n()).done;){var s=I(o.value,2),u=s[0],c=s[1];this.control.delete(u),this.sendRpc(u,ul([],{graft:c.graft,prune:c.prune}))}}catch(l){a.e(l)}finally{a.f()}}},{key:"pushGossip",value:function(e,t){this.log("Add gossip to %s",e);var r=this.gossip.get(e)||[];this.gossip.set(e,r.concat(t))}},{key:"makePrune",value:function(){var e=(0,E.Z)((0,k.Z)().mark((function e(t,r,n){var i,o,a,s=this;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.score.prune(t,r),this.streamsOutbound.get(t).protocol!==il){e.next=3;break}return e.abrupt("return",{topicID:r,peers:[]});case 3:if(i=this.opts.pruneBackoff/1e3,n){e.next=6;break}return e.abrupt("return",{topicID:r,peers:[],backoff:i});case 6:return o=this.getRandomGossipPeers(r,this.opts.prunePeers,(function(e){return e!==t&&s.score.score(e)>=0})),e.next=9,Promise.all(Array.from(o).map(function(){var e=(0,E.Z)((0,k.Z)().mark((function e(t){var r;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=fs(t),e.t0=r.toBytes(),e.next=4,s.components.getPeerStore().addressBook.getRawEnvelope(r);case 4:return e.t1=e.sent,e.abrupt("return",{peerID:e.t0,signedPeerRecord:e.t1});case 6:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 9:return a=e.sent,e.abrupt("return",{topicID:r,peers:a,backoff:i});case 11:case"end":return e.stop()}}),e,this)})));return function(t,r,n){return e.apply(this,arguments)}}()},{key:"heartbeat",value:function(){var e=(0,E.Z)((0,k.Z)().mark((function e(){var t,r,n,i,o,a,s,u,c,l,f,h,d,p,v,g,y=this;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.opts,i=n.D,o=n.Dlo,a=n.Dhi,s=n.Dscore,u=n.Dout,c=n.fanoutTTL,this.heartbeatTicks++,l=new Map,f=function(e){var t=l.get(e);return void 0===t&&(t=y.score.score(e),l.set(e,t)),t},h=new Map,d=new Map,p=new Map,this.clearBackoff(),this.peerhave.clear(),null===(t=this.metrics)||void 0===t||t.cacheSize.set({cache:"iasked"},this.iasked.size),this.iasked.clear(),this.applyIwantPenalties(),this.heartbeatTicks%this.opts.directConnectTicks!==0){e.next=15;break}return e.next=15,this.directConnect();case 15:return null===(r=this.fastMsgIdCache)||void 0===r||r.prune(),this.seenCache.prune(),this.gossipTracer.prune(),this.publishedMessageIds.prune(),v=new Map,this.mesh.forEach((function(e,t){var r=y.topics.get(t),n=new Set,c=new Set;if(v.set(t,c),r){var l,g=cl(Array.from(r)),m=y.backoff.get(t),b=$e(g);try{for(b.s();!(l=b.n()).done;){var w=l.value,k=y.streamsOutbound.get(w);if(k&&y.multicodecs.includes(k.protocol)&&!e.has(w)&&!y.direct.has(w)){var E=f(w);m&&m.has(w)||!(E>=0)||n.add(w),E>=y.opts.scoreThresholds.gossipThreshold&&c.add(w)}}}catch(Z){b.e(Z)}finally{b.f()}}var x=function(r,n){var i;y.log("HEARTBEAT: Remove mesh link to %s in %s",r,t),y.addBackoff(r,t),e.delete(r),f(r)>=y.opts.scoreThresholds.gossipThreshold&&c.add(r),null===(i=y.metrics)||void 0===i||i.onRemoveFromMesh(t,n,1);var o=d.get(r);o?o.push(t):d.set(r,[t])},S=function(r,n){var i;y.log("HEARTBEAT: Add mesh link to %s in %s",r,t),y.score.graft(r,t),e.add(r),c.delete(r),null===(i=y.metrics)||void 0===i||i.onAddToMesh(t,n,1);var o=h.get(r);o?o.push(t):h.set(r,[t])};(e.forEach((function(e){var r=f(e);r<0&&(y.log("HEARTBEAT: Prune peer %s with negative score: score=%d, topic=%s",e,r,t),x(e,Ul.BadScore),p.set(e,!0))})),e.size<o)&&of(n,i-e.size).forEach((function(e){S(e,Ll.NotEnough)}));if(e.size>a){var _=Array.from(e);_.sort((function(e,t){return f(t)-f(e)})),_=_.slice(0,s).concat(cl(_.slice(s)));var A=0;if(_.slice(0,i).forEach((function(e){y.outbound.get(e)&&A++})),A<u){var I=function(e){for(var t=_[e],r=e;r>0;r--)_[r]=_[r-1];_[0]=t};if(A>0)for(var C=A,T=1;T<i&&C>0;T++)y.outbound.get(_[T])&&(I(T),C--);for(var P=i-A,R=i;R<_.length&&P>0;R++)y.outbound.get(_[R])&&(I(R),P--)}_.slice(i).forEach((function(e){x(e,Ul.Excess)}))}if(e.size>=o){var B=0;if(e.forEach((function(e){y.outbound.get(e)&&B++})),B<u){var M=nf(n,u-B,(function(e){return!0===y.outbound.get(e)}));M.forEach((function(e){S(e,Ll.Outbound)}))}}if(y.heartbeatTicks%y.opts.opportunisticGraftTicks===0&&e.size>1){var N=Array.from(e).sort((function(e,t){return f(e)-f(t)})),O=Math.floor(e.size/2),D=f(N[O]);if(D<y.opts.scoreThresholds.opportunisticGraftThreshold){var L,U=nf(n,y.opts.opportunisticGraftPeers,(function(e){return f(e)>D})),F=$e(U);try{for(F.s();!(L=F.n()).done;){var z=L.value;y.log("HEARTBEAT: Opportunistically graft peer %s on topic %s",z,t),S(z,Ll.Opportunistic)}}catch(Z){F.e(Z)}finally{F.f()}}}})),g=Date.now(),this.fanoutLastpub.forEach((function(e,t){e+c<g&&(y.fanout.delete(t),y.fanoutLastpub.delete(t))})),this.fanout.forEach((function(e,t){var r=y.topics.get(t);e.forEach((function(t){(!r.has(t)||f(t)<y.opts.scoreThresholds.publishThreshold)&&e.delete(t)}));var n=y.topics.get(t),o=[],a=new Set;if(v.set(t,a),n){var s,u=$e(cl(Array.from(n)));try{for(u.s();!(s=u.n()).done;){var c=s.value,l=y.streamsOutbound.get(c);if(l&&y.multicodecs.includes(l.protocol)&&!e.has(c)&&!y.direct.has(c)){var h=f(c);h>=y.opts.scoreThresholds.publishThreshold&&o.push(c),h>=y.opts.scoreThresholds.gossipThreshold&&a.add(c)}}}catch(p){u.e(p)}finally{u.f()}}if(e.size<i){var d=i-e.size;o.slice(0,d).forEach((function(t){e.add(t),null===a||void 0===a||a.delete(t)}))}})),this.emitGossip(v),e.next=27,this.sendGraftPrune(h,d,p);case 27:this.flush(),this.mcache.shift(),this.dispatchEvent(new el("gossipsub:heartbeat"));case 30:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"getRandomGossipPeers",value:function(e,t){var r=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){return!0},i=this.topics.get(e);if(!i)return new Set;var o=[];return i.forEach((function(e){var t=r.streamsOutbound.get(e);t&&r.multicodecs.includes(t.protocol)&&n(e)&&o.push(e)})),o=cl(o),t>0&&o.length>t&&(o=o.slice(0,t)),new Set(o)}},{key:"onScrapeMetrics",value:function(e){var t,r;e.mcacheSize.set(this.mcache.size),e.cacheSize.set({cache:"direct"},this.direct.size),e.cacheSize.set({cache:"seenCache"},this.seenCache.size),e.cacheSize.set({cache:"fastMsgIdCache"},null!==(t=null===(r=this.fastMsgIdCache)||void 0===r?void 0:r.size)&&void 0!==t?t:0),e.cacheSize.set({cache:"publishedMessageIds"},this.publishedMessageIds.size),e.cacheSize.set({cache:"mcache"},this.mcache.size),e.cacheSize.set({cache:"score"},this.score.size),e.cacheSize.set({cache:"gossipTracer.promises"},this.gossipTracer.size),e.cacheSize.set({cache:"gossipTracer.requests"},this.gossipTracer.requestMsByMsgSize),e.cacheSize.set({cache:"topics"},this.topics.size),e.cacheSize.set({cache:"subscriptions"},this.subscriptions.size),e.cacheSize.set({cache:"mesh"},this.mesh.size),e.cacheSize.set({cache:"fanout"},this.fanout.size),e.cacheSize.set({cache:"peers"},this.peers.size),e.cacheSize.set({cache:"streamsOutbound"},this.streamsOutbound.size),e.cacheSize.set({cache:"streamsInbound"},this.streamsInbound.size),e.cacheSize.set({cache:"acceptFromWhitelist"},this.acceptFromWhitelist.size),e.cacheSize.set({cache:"gossip"},this.gossip.size),e.cacheSize.set({cache:"control"},this.control.size),e.cacheSize.set({cache:"peerhave"},this.peerhave.size),e.cacheSize.set({cache:"outbound"},this.outbound.size);var n,i=0,o=$e(this.backoff.values());try{for(o.s();!(n=o.n()).done;){i+=n.value.size}}catch(_){o.e(_)}finally{o.f()}e.cacheSize.set({cache:"backoff"},i);var a,s=$e(this.topics);try{for(s.s();!(a=s.n()).done;){var u=I(a.value,2),c=u[0],l=u[1];e.topicPeersCount.set({topicStr:c},l.size)}}catch(_){s.e(_)}finally{s.f()}var f,h=$e(this.mesh);try{for(h.s();!(f=h.n()).done;){var d=I(f.value,2),p=d[0],v=d[1];e.meshPeerCounts.set({topicStr:p},v.size)}}catch(_){h.e(_)}finally{h.f()}var g=[],y=new Map;e.behaviourPenalty.reset();var m,b=$e(this.peers.keys());try{for(b.s();!(m=b.n()).done;){var w,k,E=m.value,x=this.score.score(E);g.push(x),y.set(E,x),e.behaviourPenalty.observe(null!==(w=null===(k=this.score.peerStats.get(E))||void 0===k?void 0:k.behaviourPenalty)&&void 0!==w?w:0)}}catch(_){b.e(_)}finally{b.f()}e.registerScores(g,this.opts.scoreThresholds),e.registerScorePerMesh(this.mesh,y);var S=function(e,t,r,n,i){var o,a={byTopic:new Map,p5w:[],p6w:[],p7w:[],score:[]},s=$e(e);try{for(s.s();!(o=s.n()).done;){var u=o.value,c=t.get(u);if(c){var l,f=rf(u,c,r,n,i),h=$e(f.byTopic);try{for(h.s();!(l=h.n()).done;){var d=I(l.value,2),p=d[0],v=d[1],g=a.byTopic.get(p);g||(g={p1w:[],p2w:[],p3w:[],p3bw:[],p4w:[]},a.byTopic.set(p,g)),g.p1w.push(v.p1w),g.p2w.push(v.p2w),g.p3w.push(v.p3w),g.p3bw.push(v.p3bw),g.p4w.push(v.p4w)}}catch(_){h.e(_)}finally{h.f()}a.p5w.push(f.p5w),a.p6w.push(f.p6w),a.p7w.push(f.p7w),a.score.push(f.score)}else a.p5w.push(0),a.p6w.push(0),a.p7w.push(0),a.score.push(0)}}catch(_){s.e(_)}finally{s.f()}return a}(this.peers.keys(),this.score.peerStats,this.score.params,this.score.peerIPs,e.topicStrToLabel);e.registerScoreWeights(S)}}]),r}(Xc);ff.multicodec=ol;var hf=wi("waku:message:topic-only"),df=function(){function e(t){(0,D.Z)(this,e),this.proto=t}return(0,O.Z)(e,[{key:"contentTopic",get:function(){var e;return null!==(e=this.proto.contentTopic)&&void 0!==e?e:""}}]),e}(),pf=function(){function e(){(0,D.Z)(this,e),this.contentTopic=""}return(0,O.Z)(e,[{key:"decodeProto",value:function(e){var t=js.decode(e);return hf("Message decoded",t),Promise.resolve(t)}},{key:"decode",value:function(){var e=(0,E.Z)((0,k.Z)().mark((function e(t){return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new df(t));case 1:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()}]),e}(),vf=wi("waku:relay"),gf=function(e){U(r,e);var t=K(r);function r(e){var n,i,o,a;return(0,D.Z)(this,r),e=Object.assign(null!==(n=e)&&void 0!==n?n:{},{globalSignaturePolicy:fl.StrictNoSign,fallbackToFloodsub:!1}),(a=t.call(this,e)).multicodecs=ec,a.observers=new Map,a.pubSubTopic=null!==(i=null===(o=e)||void 0===o?void 0:o.pubSubTopic)&&void 0!==i?i:"/waku/2/default-waku/proto",a.defaultDecoder=new pf,a}return(0,O.Z)(r,[{key:"start",value:function(){var e=(0,E.Z)((0,k.Z)().mark((function e(){return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Xr(F(r.prototype),"start",this).call(this);case 2:this.subscribe(this.pubSubTopic);case 3:case"end":return e.stop()}}),e,this)})));return function(){return e.apply(this,arguments)}}()},{key:"send",value:function(){var e=(0,E.Z)((0,k.Z)().mark((function e(t,r){var n;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.encode(r);case 2:if(n=e.sent){e.next=6;break}return vf("Failed to encode message, aborting publish"),e.abrupt("return",{recipients:[]});case 6:return e.abrupt("return",this.publish(this.pubSubTopic,n));case 7:case"end":return e.stop()}}),e,this)})));return function(t,r){return e.apply(this,arguments)}}()},{key:"addObserver",value:function(e,t){var r=this,n={decoder:e,callback:t};return function(e,t,r){var n=e.get(t);"undefined"===typeof n&&(e.set(t,new Set),n=e.get(t)),n.add(r)}(this.observers,e.contentTopic,n),function(){var t=r.observers.get(e.contentTopic);t&&t.delete(n)}}},{key:"subscribe",value:function(e){var t=this;this.addEventListener("gossipsub:message",function(){var r=(0,E.Z)((0,k.Z)().mark((function r(n){var i,o;return(0,k.Z)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(n.detail.msg.topic===e){r.next=2;break}return r.abrupt("return");case 2:return vf("Message received on ".concat(e)),r.next=5,t.defaultDecoder.decodeProto(n.detail.msg.data);case 5:if((i=r.sent)&&i.contentTopic){r.next=9;break}return vf("Message does not have a content topic, skipping"),r.abrupt("return");case 9:if(o=t.observers.get(i.contentTopic)){r.next=12;break}return r.abrupt("return");case 12:return r.next=14,Promise.all(Array.from(o).map(function(){var e=(0,E.Z)((0,k.Z)().mark((function e(t){var r,o,a,s;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.decoder,o=t.callback,e.next=3,r.decodeProto(n.detail.msg.data);case 3:if(a=e.sent){e.next=7;break}return vf("Internal error: message previously decoded failed on 2nd pass."),e.abrupt("return");case 7:return e.next=9,r.decode(a);case 9:(s=e.sent)?o(s):vf("Failed to decode messages on",i.contentTopic);case 11:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 14:case"end":return r.stop()}}),r)})));return function(e){return r.apply(this,arguments)}}()),Xr(F(r.prototype),"subscribe",this).call(this,e)}},{key:"getMeshPeers",value:function(e){return Xr(F(r.prototype),"getMeshPeers",this).call(this,null!==e&&void 0!==e?e:this.pubSubTopic)}}]),r}(ff);function yf(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}function mf(){return mf=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},mf.apply(this,arguments)}function bf(e){var t,r,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(r=bf(e[t]))&&(n&&(n+=" "),n+=r);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}gf.multicodec=ec[0],gf.multicodec=ec[ec.length-1];var wf=function(){for(var e,t,r=0,n="";r<arguments.length;)(e=arguments[r++])&&(t=bf(e))&&(n&&(n+=" "),n+=t);return n};function kf(e,t){var r=mf({},t);return Object.keys(e).forEach((function(t){void 0===r[t]&&(r[t]=e[t])})),r}function Ef(e,t,r){var n={};return Object.keys(e).forEach((function(i){n[i]=e[i].reduce((function(e,n){return n&&(e.push(t(n)),r&&r[n]&&e.push(r[n])),e}),[]).join(" ")})),n}function xf(e){for(var t="https://mui.com/production-error/?code="+e,r=1;r<arguments.length;r+=1)t+="&args[]="+encodeURIComponent(arguments[r]);return"Minified MUI error #"+e+"; visit "+t+" for the full message."}function Sf(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;return Math.min(Math.max(t,e),r)}function _f(e){if(e.type)return e;if("#"===e.charAt(0))return _f(function(e){e=e.slice(1);var t=new RegExp(".{1,".concat(e.length>=6?2:1,"}"),"g"),r=e.match(t);return r&&1===r[0].length&&(r=r.map((function(e){return e+e}))),r?"rgb".concat(4===r.length?"a":"","(").concat(r.map((function(e,t){return t<3?parseInt(e,16):Math.round(parseInt(e,16)/255*1e3)/1e3})).join(", "),")"):""}(e));var t=e.indexOf("("),r=e.substring(0,t);if(-1===["rgb","rgba","hsl","hsla","color"].indexOf(r))throw new Error(xf(9,e));var n,i=e.substring(t+1,e.length-1);if("color"===r){if(n=(i=i.split(" ")).shift(),4===i.length&&"/"===i[3].charAt(0)&&(i[3]=i[3].slice(1)),-1===["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].indexOf(n))throw new Error(xf(10,n))}else i=i.split(",");return{type:r,values:i=i.map((function(e){return parseFloat(e)})),colorSpace:n}}function Af(e){var t=e.type,r=e.colorSpace,n=e.values;return-1!==t.indexOf("rgb")?n=n.map((function(e,t){return t<3?parseInt(e,10):e})):-1!==t.indexOf("hsl")&&(n[1]="".concat(n[1],"%"),n[2]="".concat(n[2],"%")),n=-1!==t.indexOf("color")?"".concat(r," ").concat(n.join(" ")):"".concat(n.join(", ")),"".concat(t,"(").concat(n,")")}function If(e){var t="hsl"===(e=_f(e)).type?_f(function(e){var t=(e=_f(e)).values,r=t[0],n=t[1]/100,i=t[2]/100,o=n*Math.min(i,1-i),a=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:(e+r/30)%12;return i-o*Math.max(Math.min(t-3,9-t,1),-1)},s="rgb",u=[Math.round(255*a(0)),Math.round(255*a(8)),Math.round(255*a(4))];return"hsla"===e.type&&(s+="a",u.push(t[3])),Af({type:s,values:u})}(e)).values:e.values;return t=t.map((function(t){return"color"!==e.type&&(t/=255),t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4)})),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function Cf(e,t){return e=_f(e),t=Sf(t),"rgb"!==e.type&&"hsl"!==e.type||(e.type+="a"),"color"===e.type?e.values[3]="/".concat(t):e.values[3]=t,Af(e)}function Tf(e,t){if(e=_f(e),t=Sf(t),-1!==e.type.indexOf("hsl"))e.values[2]*=1-t;else if(-1!==e.type.indexOf("rgb")||-1!==e.type.indexOf("color"))for(var r=0;r<3;r+=1)e.values[r]*=1-t;return Af(e)}function Pf(e,t){if(e=_f(e),t=Sf(t),-1!==e.type.indexOf("hsl"))e.values[2]+=(100-e.values[2])*t;else if(-1!==e.type.indexOf("rgb"))for(var r=0;r<3;r+=1)e.values[r]+=(255-e.values[r])*t;else if(-1!==e.type.indexOf("color"))for(var n=0;n<3;n+=1)e.values[n]+=(1-e.values[n])*t;return Af(e)}var Rf=function(e){var t=Object.create(null);return function(r){return void 0===t[r]&&(t[r]=e(r)),t[r]}},Bf=/^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/,Mf=Rf((function(e){return Bf.test(e)||111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)<91}));var Nf=function(){function e(e){var t=this;this._insertTag=function(e){var r;r=0===t.tags.length?t.insertionPoint?t.insertionPoint.nextSibling:t.prepend?t.container.firstChild:t.before:t.tags[t.tags.length-1].nextSibling,t.container.insertBefore(e,r),t.tags.push(e)},this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.prepend=e.prepend,this.insertionPoint=e.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(e){e.forEach(this._insertTag)},t.insert=function(e){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(function(e){var t=document.createElement("style");return t.setAttribute("data-emotion",e.key),void 0!==e.nonce&&t.setAttribute("nonce",e.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t}(this));var t=this.tags[this.tags.length-1];if(this.isSpeedy){var r=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}(t);try{r.insertRule(e,r.cssRules.length)}catch(n){0}}else t.appendChild(document.createTextNode(e));this.ctr++},t.flush=function(){this.tags.forEach((function(e){return e.parentNode&&e.parentNode.removeChild(e)})),this.tags=[],this.ctr=0},e}(),Of=Math.abs,Df=String.fromCharCode,Lf=Object.assign;function Uf(e){return e.trim()}function Ff(e,t,r){return e.replace(t,r)}function zf(e,t){return e.indexOf(t)}function Zf(e,t){return 0|e.charCodeAt(t)}function jf(e,t,r){return e.slice(t,r)}function qf(e){return e.length}function Kf(e){return e.length}function Vf(e,t){return t.push(e),e}var Hf=1,Gf=1,Wf=0,Qf=0,Jf=0,Yf="";function Xf(e,t,r,n,i,o,a){return{value:e,root:t,parent:r,type:n,props:i,children:o,line:Hf,column:Gf,length:a,return:""}}function $f(e,t){return Lf(Xf("",null,null,"",null,null,0),e,{length:-e.length},t)}function eh(){return Jf=Qf>0?Zf(Yf,--Qf):0,Gf--,10===Jf&&(Gf=1,Hf--),Jf}function th(){return Jf=Qf<Wf?Zf(Yf,Qf++):0,Gf++,10===Jf&&(Gf=1,Hf++),Jf}function rh(){return Zf(Yf,Qf)}function nh(){return Qf}function ih(e,t){return jf(Yf,e,t)}function oh(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function ah(e){return Hf=Gf=1,Wf=qf(Yf=e),Qf=0,[]}function sh(e){return Yf="",e}function uh(e){return Uf(ih(Qf-1,fh(91===e?e+2:40===e?e+1:e)))}function ch(e){for(;(Jf=rh())&&Jf<33;)th();return oh(e)>2||oh(Jf)>3?"":" "}function lh(e,t){for(;--t&&th()&&!(Jf<48||Jf>102||Jf>57&&Jf<65||Jf>70&&Jf<97););return ih(e,nh()+(t<6&&32==rh()&&32==th()))}function fh(e){for(;th();)switch(Jf){case e:return Qf;case 34:case 39:34!==e&&39!==e&&fh(Jf);break;case 40:41===e&&fh(e);break;case 92:th()}return Qf}function hh(e,t){for(;th()&&e+Jf!==57&&(e+Jf!==84||47!==rh()););return"/*"+ih(t,Qf-1)+"*"+Df(47===e?e:th())}function dh(e){for(;!oh(rh());)th();return ih(e,Qf)}var ph="-ms-",vh="-moz-",gh="-webkit-",yh="comm",mh="rule",bh="decl",wh="@keyframes";function kh(e,t){for(var r="",n=Kf(e),i=0;i<n;i++)r+=t(e[i],i,e,t)||"";return r}function Eh(e,t,r,n){switch(e.type){case"@import":case bh:return e.return=e.return||e.value;case yh:return"";case wh:return e.return=e.value+"{"+kh(e.children,n)+"}";case mh:e.value=e.props.join(",")}return qf(r=kh(e.children,n))?e.return=e.value+"{"+r+"}":""}function xh(e,t){switch(function(e,t){return(((t<<2^Zf(e,0))<<2^Zf(e,1))<<2^Zf(e,2))<<2^Zf(e,3)}(e,t)){case 5103:return gh+"print-"+e+e;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return gh+e+e;case 5349:case 4246:case 4810:case 6968:case 2756:return gh+e+vh+e+ph+e+e;case 6828:case 4268:return gh+e+ph+e+e;case 6165:return gh+e+ph+"flex-"+e+e;case 5187:return gh+e+Ff(e,/(\w+).+(:[^]+)/,"-webkit-box-$1$2-ms-flex-$1$2")+e;case 5443:return gh+e+ph+"flex-item-"+Ff(e,/flex-|-self/,"")+e;case 4675:return gh+e+ph+"flex-line-pack"+Ff(e,/align-content|flex-|-self/,"")+e;case 5548:return gh+e+ph+Ff(e,"shrink","negative")+e;case 5292:return gh+e+ph+Ff(e,"basis","preferred-size")+e;case 6060:return gh+"box-"+Ff(e,"-grow","")+gh+e+ph+Ff(e,"grow","positive")+e;case 4554:return gh+Ff(e,/([^-])(transform)/g,"$1-webkit-$2")+e;case 6187:return Ff(Ff(Ff(e,/(zoom-|grab)/,gh+"$1"),/(image-set)/,gh+"$1"),e,"")+e;case 5495:case 3959:return Ff(e,/(image-set\([^]*)/,gh+"$1$`$1");case 4968:return Ff(Ff(e,/(.+:)(flex-)?(.*)/,"-webkit-box-pack:$3-ms-flex-pack:$3"),/s.+-b[^;]+/,"justify")+gh+e+e;case 4095:case 3583:case 4068:case 2532:return Ff(e,/(.+)-inline(.+)/,gh+"$1$2")+e;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(qf(e)-1-t>6)switch(Zf(e,t+1)){case 109:if(45!==Zf(e,t+4))break;case 102:return Ff(e,/(.+:)(.+)-([^]+)/,"$1-webkit-$2-$3$1"+vh+(108==Zf(e,t+3)?"$3":"$2-$3"))+e;case 115:return~zf(e,"stretch")?xh(Ff(e,"stretch","fill-available"),t)+e:e}break;case 4949:if(115!==Zf(e,t+1))break;case 6444:switch(Zf(e,qf(e)-3-(~zf(e,"!important")&&10))){case 107:return Ff(e,":",":"+gh)+e;case 101:return Ff(e,/(.+:)([^;!]+)(;|!.+)?/,"$1"+gh+(45===Zf(e,14)?"inline-":"")+"box$3$1"+gh+"$2$3$1"+ph+"$2box$3")+e}break;case 5936:switch(Zf(e,t+11)){case 114:return gh+e+ph+Ff(e,/[svh]\w+-[tblr]{2}/,"tb")+e;case 108:return gh+e+ph+Ff(e,/[svh]\w+-[tblr]{2}/,"tb-rl")+e;case 45:return gh+e+ph+Ff(e,/[svh]\w+-[tblr]{2}/,"lr")+e}return gh+e+ph+e+e}return e}function Sh(e){return sh(_h("",null,null,null,[""],e=ah(e),0,[0],e))}function _h(e,t,r,n,i,o,a,s,u){for(var c=0,l=0,f=a,h=0,d=0,p=0,v=1,g=1,y=1,m=0,b="",w=i,k=o,E=n,x=b;g;)switch(p=m,m=th()){case 40:if(108!=p&&58==x.charCodeAt(f-1)){-1!=zf(x+=Ff(uh(m),"&","&\f"),"&\f")&&(y=-1);break}case 34:case 39:case 91:x+=uh(m);break;case 9:case 10:case 13:case 32:x+=ch(p);break;case 92:x+=lh(nh()-1,7);continue;case 47:switch(rh()){case 42:case 47:Vf(Ih(hh(th(),nh()),t,r),u);break;default:x+="/"}break;case 123*v:s[c++]=qf(x)*y;case 125*v:case 59:case 0:switch(m){case 0:case 125:g=0;case 59+l:d>0&&qf(x)-f&&Vf(d>32?Ch(x+";",n,r,f-1):Ch(Ff(x," ","")+";",n,r,f-2),u);break;case 59:x+=";";default:if(Vf(E=Ah(x,t,r,c,l,i,s,b,w=[],k=[],f),o),123===m)if(0===l)_h(x,t,E,E,w,o,f,s,k);else switch(h){case 100:case 109:case 115:_h(e,E,E,n&&Vf(Ah(e,E,E,0,0,i,s,b,i,w=[],f),k),i,k,f,s,n?w:k);break;default:_h(x,E,E,E,[""],k,0,s,k)}}c=l=d=0,v=y=1,b=x="",f=a;break;case 58:f=1+qf(x),d=p;default:if(v<1)if(123==m)--v;else if(125==m&&0==v++&&125==eh())continue;switch(x+=Df(m),m*v){case 38:y=l>0?1:(x+="\f",-1);break;case 44:s[c++]=(qf(x)-1)*y,y=1;break;case 64:45===rh()&&(x+=uh(th())),h=rh(),l=f=qf(b=x+=dh(nh())),m++;break;case 45:45===p&&2==qf(x)&&(v=0)}}return o}function Ah(e,t,r,n,i,o,a,s,u,c,l){for(var f=i-1,h=0===i?o:[""],d=Kf(h),p=0,v=0,g=0;p<n;++p)for(var y=0,m=jf(e,f+1,f=Of(v=a[p])),b=e;y<d;++y)(b=Uf(v>0?h[y]+" "+m:Ff(m,/&\f/g,h[y])))&&(u[g++]=b);return Xf(e,t,r,0===i?mh:s,u,c,l)}function Ih(e,t,r){return Xf(e,t,r,yh,Df(Jf),jf(e,2,-2),0)}function Ch(e,t,r,n){return Xf(e,t,r,bh,jf(e,0,n),jf(e,n+1,-1),n)}var Th=function(e,t,r){for(var n=0,i=0;n=i,i=rh(),38===n&&12===i&&(t[r]=1),!oh(i);)th();return ih(e,Qf)},Ph=function(e,t){return sh(function(e,t){var r=-1,n=44;do{switch(oh(n)){case 0:38===n&&12===rh()&&(t[r]=1),e[r]+=Th(Qf-1,t,r);break;case 2:e[r]+=uh(n);break;case 4:if(44===n){e[++r]=58===rh()?"&\f":"",t[r]=e[r].length;break}default:e[r]+=Df(n)}}while(n=th());return e}(ah(e),t))},Rh=new WeakMap,Bh=function(e){if("rule"===e.type&&e.parent&&!(e.length<1)){for(var t=e.value,r=e.parent,n=e.column===r.column&&e.line===r.line;"rule"!==r.type;)if(!(r=r.parent))return;if((1!==e.props.length||58===t.charCodeAt(0)||Rh.get(r))&&!n){Rh.set(e,!0);for(var i=[],o=Ph(t,i),a=r.props,s=0,u=0;s<o.length;s++)for(var c=0;c<a.length;c++,u++)e.props[u]=i[s]?o[s].replace(/&\f/g,a[c]):a[c]+" "+o[s]}}},Mh=function(e){if("decl"===e.type){var t=e.value;108===t.charCodeAt(0)&&98===t.charCodeAt(2)&&(e.return="",e.value="")}},Nh=[function(e,t,r,n){if(e.length>-1&&!e.return)switch(e.type){case bh:e.return=xh(e.value,e.length);break;case wh:return kh([$f(e,{value:Ff(e.value,"@","@"+gh)})],n);case mh:if(e.length)return function(e,t){return e.map(t).join("")}(e.props,(function(t){switch(function(e,t){return(e=t.exec(e))?e[0]:e}(t,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return kh([$f(e,{props:[Ff(t,/:(read-\w+)/,":-moz-$1")]})],n);case"::placeholder":return kh([$f(e,{props:[Ff(t,/:(plac\w+)/,":-webkit-input-$1")]}),$f(e,{props:[Ff(t,/:(plac\w+)/,":-moz-$1")]}),$f(e,{props:[Ff(t,/:(plac\w+)/,ph+"input-$1")]})],n)}return""}))}}],Oh=function(e){var t=e.key;if("css"===t){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,(function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))}))}var n=e.stylisPlugins||Nh;var i,o,a={},s=[];i=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),(function(e){for(var t=e.getAttribute("data-emotion").split(" "),r=1;r<t.length;r++)a[t[r]]=!0;s.push(e)}));var u,c,l=[Eh,(c=function(e){u.insert(e)},function(e){e.root||(e=e.return)&&c(e)})],f=function(e){var t=Kf(e);return function(r,n,i,o){for(var a="",s=0;s<t;s++)a+=e[s](r,n,i,o)||"";return a}}([Bh,Mh].concat(n,l));o=function(e,t,r,n){u=r,kh(Sh(e?e+"{"+t.styles+"}":t.styles),f),n&&(h.inserted[t.name]=!0)};var h={key:t,sheet:new Nf({key:t,container:i,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:a,registered:{},insert:o};return h.sheet.hydrate(s),h};var Dh=function(e){for(var t,r=0,n=0,i=e.length;i>=4;++n,i-=4)t=1540483477*(65535&(t=255&e.charCodeAt(n)|(255&e.charCodeAt(++n))<<8|(255&e.charCodeAt(++n))<<16|(255&e.charCodeAt(++n))<<24))+(59797*(t>>>16)<<16),r=1540483477*(65535&(t^=t>>>24))+(59797*(t>>>16)<<16)^1540483477*(65535&r)+(59797*(r>>>16)<<16);switch(i){case 3:r^=(255&e.charCodeAt(n+2))<<16;case 2:r^=(255&e.charCodeAt(n+1))<<8;case 1:r=1540483477*(65535&(r^=255&e.charCodeAt(n)))+(59797*(r>>>16)<<16)}return(((r=1540483477*(65535&(r^=r>>>13))+(59797*(r>>>16)<<16))^r>>>15)>>>0).toString(36)},Lh={animationIterationCount:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},Uh=/[A-Z]|^ms/g,Fh=/_EMO_([^_]+?)_([^]*?)_EMO_/g,zh=function(e){return 45===e.charCodeAt(1)},Zh=function(e){return null!=e&&"boolean"!==typeof e},jh=Rf((function(e){return zh(e)?e:e.replace(Uh,"-$&").toLowerCase()})),qh=function(e,t){switch(e){case"animation":case"animationName":if("string"===typeof t)return t.replace(Fh,(function(e,t,r){return Vh={name:t,styles:r,next:Vh},t}))}return 1===Lh[e]||zh(e)||"number"!==typeof t||0===t?t:t+"px"};function Kh(e,t,r){if(null==r)return"";if(void 0!==r.__emotion_styles)return r;switch(typeof r){case"boolean":return"";case"object":if(1===r.anim)return Vh={name:r.name,styles:r.styles,next:Vh},r.name;if(void 0!==r.styles){var n=r.next;if(void 0!==n)for(;void 0!==n;)Vh={name:n.name,styles:n.styles,next:Vh},n=n.next;return r.styles+";"}return function(e,t,r){var n="";if(Array.isArray(r))for(var i=0;i<r.length;i++)n+=Kh(e,t,r[i])+";";else for(var o in r){var a=r[o];if("object"!==typeof a)null!=t&&void 0!==t[a]?n+=o+"{"+t[a]+"}":Zh(a)&&(n+=jh(o)+":"+qh(o,a)+";");else if(!Array.isArray(a)||"string"!==typeof a[0]||null!=t&&void 0!==t[a[0]]){var s=Kh(e,t,a);switch(o){case"animation":case"animationName":n+=jh(o)+":"+s+";";break;default:n+=o+"{"+s+"}"}}else for(var u=0;u<a.length;u++)Zh(a[u])&&(n+=jh(o)+":"+qh(o,a[u])+";")}return n}(e,t,r);case"function":if(void 0!==e){var i=Vh,o=r(e);return Vh=i,Kh(e,t,o)}}if(null==t)return r;var a=t[r];return void 0!==a?a:r}var Vh,Hh=/label:\s*([^\s;\n{]+)\s*(;|$)/g;var Gh=function(e,t,r){if(1===e.length&&"object"===typeof e[0]&&null!==e[0]&&void 0!==e[0].styles)return e[0];var n=!0,i="";Vh=void 0;var o=e[0];null==o||void 0===o.raw?(n=!1,i+=Kh(r,t,o)):i+=o[0];for(var a=1;a<e.length;a++)i+=Kh(r,t,e[a]),n&&(i+=o[a]);Hh.lastIndex=0;for(var s,u="";null!==(s=Hh.exec(i));)u+="-"+s[1];return{name:Dh(i)+u,styles:i,next:Vh}},Wh=!!b.useInsertionEffect&&b.useInsertionEffect,Qh=Wh||function(e){return e()},Jh=(Wh||m.useLayoutEffect,(0,m.createContext)("undefined"!==typeof HTMLElement?Oh({key:"css"}):null));Jh.Provider;var Yh=function(e){return(0,m.forwardRef)((function(t,r){var n=(0,m.useContext)(Jh);return e(t,n,r)}))},Xh=(0,m.createContext)({});function $h(e,t,r){var n="";return r.split(" ").forEach((function(r){void 0!==e[r]?t.push(e[r]+";"):n+=r+" "})),n}var ed=function(e,t,r){var n=e.key+"-"+t.name;!1===r&&void 0===e.registered[n]&&(e.registered[n]=t.styles)},td=Mf,rd=function(e){return"theme"!==e},nd=function(e){return"string"===typeof e&&e.charCodeAt(0)>96?td:rd},id=function(e,t,r){var n;if(t){var i=t.shouldForwardProp;n=e.__emotion_forwardProp&&i?function(t){return e.__emotion_forwardProp(t)&&i(t)}:i}return"function"!==typeof n&&r&&(n=e.__emotion_forwardProp),n},od=function(e){var t=e.cache,r=e.serialized,n=e.isStringTag;ed(t,r,n);Qh((function(){return function(e,t,r){ed(e,t,r);var n=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var i=t;do{e.insert(t===i?"."+n:"",i,e.sheet,!0),i=i.next}while(void 0!==i)}}(t,r,n)}));return null},ad=function e(t,r){var n,i,o=t.__emotion_real===t,a=o&&t.__emotion_base||t;void 0!==r&&(n=r.label,i=r.target);var s=id(t,r,o),u=s||nd(a),c=!u("as");return function(){var l=arguments,f=o&&void 0!==t.__emotion_styles?t.__emotion_styles.slice(0):[];if(void 0!==n&&f.push("label:"+n+";"),null==l[0]||void 0===l[0].raw)f.push.apply(f,l);else{0,f.push(l[0][0]);for(var h=l.length,d=1;d<h;d++)f.push(l[d],l[0][d])}var p=Yh((function(e,t,r){var n=c&&e.as||a,o="",l=[],h=e;if(null==e.theme){for(var d in h={},e)h[d]=e[d];h.theme=(0,m.useContext)(Xh)}"string"===typeof e.className?o=$h(t.registered,l,e.className):null!=e.className&&(o=e.className+" ");var p=Gh(f.concat(l),t.registered,h);o+=t.key+"-"+p.name,void 0!==i&&(o+=" "+i);var v=c&&void 0===s?nd(n):u,g={};for(var y in e)c&&"as"===y||v(y)&&(g[y]=e[y]);return g.className=o,g.ref=r,(0,m.createElement)(m.Fragment,null,(0,m.createElement)(od,{cache:t,serialized:p,isStringTag:"string"===typeof n}),(0,m.createElement)(n,g))}));return p.displayName=void 0!==n?n:"Styled("+("string"===typeof a?a:a.displayName||a.name||"Component")+")",p.defaultProps=t.defaultProps,p.__emotion_real=p,p.__emotion_base=a,p.__emotion_styles=f,p.__emotion_forwardProp=s,Object.defineProperty(p,"toString",{value:function(){return"."+i}}),p.withComponent=function(t,n){return e(t,mf({},r,n,{shouldForwardProp:id(p,n,!0)})).apply(void 0,f)},p}},sd=ad.bind();["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","marquee","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"].forEach((function(e){sd[e]=sd(e)}));var ud=sd;function cd(e,t){return ud(e,t)}var ld=function(e,t){Array.isArray(e.__emotion_styles)&&(e.__emotion_styles=t(e.__emotion_styles))};function fd(e){return null!==e&&"object"===typeof e&&e.constructor===Object}function hd(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{clone:!0},n=r.clone?mf({},e):e;return fd(e)&&fd(t)&&Object.keys(t).forEach((function(i){"__proto__"!==i&&(fd(t[i])&&i in e&&fd(e[i])?n[i]=hd(e[i],t[i],r):n[i]=t[i])})),n}var dd=["values","unit","step"];function pd(e){var t=e.values,r=void 0===t?{xs:0,sm:600,md:900,lg:1200,xl:1536}:t,n=e.unit,i=void 0===n?"px":n,o=e.step,a=void 0===o?5:o,s=yf(e,dd),u=function(e){var t=Object.keys(e).map((function(t){return{key:t,val:e[t]}}))||[];return t.sort((function(e,t){return e.val-t.val})),t.reduce((function(e,t){return mf({},e,B({},t.key,t.val))}),{})}(r),c=Object.keys(u);function l(e){var t="number"===typeof r[e]?r[e]:e;return"@media (min-width:".concat(t).concat(i,")")}function f(e){var t="number"===typeof r[e]?r[e]:e;return"@media (max-width:".concat(t-a/100).concat(i,")")}function h(e,t){var n=c.indexOf(t);return"@media (min-width:".concat("number"===typeof r[e]?r[e]:e).concat(i,") and ")+"(max-width:".concat((-1!==n&&"number"===typeof r[c[n]]?r[c[n]]:t)-a/100).concat(i,")")}return mf({keys:c,values:u,up:l,down:f,between:h,only:function(e){return c.indexOf(e)+1<c.length?h(e,c[c.indexOf(e)+1]):l(e)},not:function(e){var t=c.indexOf(e);return 0===t?l(c[1]):t===c.length-1?f(c[t]):h(e,c[c.indexOf(e)+1]).replace("@media","@media not all and")},unit:i},s)}var vd={borderRadius:4},gd={xs:0,sm:600,md:900,lg:1200,xl:1536},yd={keys:["xs","sm","md","lg","xl"],up:function(e){return"@media (min-width:".concat(gd[e],"px)")}};function md(e,t,r){var n=e.theme||{};if(Array.isArray(t)){var i=n.breakpoints||yd;return t.reduce((function(e,n,o){return e[i.up(i.keys[o])]=r(t[o]),e}),{})}if("object"===typeof t){var o=n.breakpoints||yd;return Object.keys(t).reduce((function(e,n){if(-1!==Object.keys(o.values||gd).indexOf(n)){e[o.up(n)]=r(t[n],n)}else{var i=n;e[i]=t[i]}return e}),{})}return r(t)}function bd(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=null==(e=t.keys)?void 0:e.reduce((function(e,r){return e[t.up(r)]={},e}),{});return r||{}}function wd(e,t){return e.reduce((function(e,t){var r=e[t];return(!r||0===Object.keys(r).length)&&delete e[t],e}),t)}function kd(e){if("string"!==typeof e)throw new Error(xf(7));return e.charAt(0).toUpperCase()+e.slice(1)}function Ed(e,t){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(!t||"string"!==typeof t)return null;if(e&&e.vars&&r){var n="vars.".concat(t).split(".").reduce((function(e,t){return e&&e[t]?e[t]:null}),e);if(null!=n)return n}return t.split(".").reduce((function(e,t){return e&&null!=e[t]?e[t]:null}),e)}function xd(e,t,r){var n,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:r;return n="function"===typeof e?e(r):Array.isArray(e)?e[r]||i:Ed(e,r)||i,t&&(n=t(n)),n}var Sd=function(e){var t=e.prop,r=e.cssProperty,n=void 0===r?e.prop:r,i=e.themeKey,o=e.transform,a=function(e){if(null==e[t])return null;var r=e[t],a=Ed(e.theme,i)||{};return md(e,r,(function(e){var r=xd(a,o,e);return e===r&&"string"===typeof e&&(r=xd(a,o,"".concat(t).concat("default"===e?"":kd(e)),e)),!1===n?r:B({},n,r)}))};return a.propTypes={},a.filterProps=[t],a};var _d=function(e,t){return t?hd(e,t,{clone:!1}):e};var Ad={m:"margin",p:"padding"},Id={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},Cd={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},Td=function(e){var t={};return function(r){return void 0===t[r]&&(t[r]=e(r)),t[r]}}((function(e){if(e.length>2){if(!Cd[e])return[e];e=Cd[e]}var t=I(e.split(""),2),r=t[0],n=t[1],i=Ad[r],o=Id[n]||"";return Array.isArray(o)?o.map((function(e){return i+e})):[i+o]})),Pd=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],Rd=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"],Bd=[].concat(Pd,Rd);function Md(e,t,r,n){var i,o=null!=(i=Ed(e,t,!1))?i:r;return"number"===typeof o?function(e){return"string"===typeof e?e:o*e}:Array.isArray(o)?function(e){return"string"===typeof e?e:o[e]}:"function"===typeof o?o:function(){}}function Nd(e){return Md(e,"spacing",8)}function Od(e,t){if("string"===typeof t||null==t)return t;var r=e(Math.abs(t));return t>=0?r:"number"===typeof r?-r:"-".concat(r)}function Dd(e,t,r,n){if(-1===t.indexOf(r))return null;var i=function(e,t){return function(r){return e.reduce((function(e,n){return e[n]=Od(t,r),e}),{})}}(Td(r),n);return md(e,e[r],i)}function Ld(e,t){var r=Nd(e.theme);return Object.keys(e).map((function(n){return Dd(e,t,n,r)})).reduce(_d,{})}function Ud(e){return Ld(e,Pd)}function Fd(e){return Ld(e,Rd)}function zd(e){return Ld(e,Bd)}Ud.propTypes={},Ud.filterProps=Pd,Fd.propTypes={},Fd.filterProps=Rd,zd.propTypes={},zd.filterProps=Bd;var Zd=zd;function jd(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:8;if(e.mui)return e;var t=Nd({spacing:e}),r=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];var i=0===r.length?[1]:r;return i.map((function(e){var r=t(e);return"number"===typeof r?"".concat(r,"px"):r})).join(" ")};return r.mui=!0,r}var qd=["breakpoints","palette","spacing","shape"];var Kd=function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.breakpoints,r=void 0===t?{}:t,n=e.palette,i=void 0===n?{}:n,o=e.spacing,a=e.shape,s=void 0===a?{}:a,u=yf(e,qd),c=pd(r),l=jd(o),f=hd({breakpoints:c,direction:"ltr",components:{},palette:mf({mode:"light"},i),spacing:l,shape:mf({},vd,s)},u),h=arguments.length,d=new Array(h>1?h-1:0),p=1;p<h;p++)d[p-1]=arguments[p];return f=d.reduce((function(e,t){return hd(e,t)}),f)},Vd=["variant"];function Hd(e){return 0===e.length}function Gd(e){var t=e.variant,r=yf(e,Vd),n=t||"";return Object.keys(r).sort().forEach((function(t){n+="color"===t?Hd(n)?e[t]:kd(e[t]):"".concat(Hd(n)?t:kd(t)).concat(kd(e[t].toString()))})),n}var Wd=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=t.reduce((function(e,t){return t.filterProps.forEach((function(r){e[r]=t})),e}),{}),i=function(e){return Object.keys(e).reduce((function(t,r){return n[r]?_d(t,n[r](e)):t}),{})};return i.propTypes={},i.filterProps=t.reduce((function(e,t){return e.concat(t.filterProps)}),[]),i};function Qd(e){return"number"!==typeof e?e:"".concat(e,"px solid")}var Jd=Sd({prop:"border",themeKey:"borders",transform:Qd}),Yd=Sd({prop:"borderTop",themeKey:"borders",transform:Qd}),Xd=Sd({prop:"borderRight",themeKey:"borders",transform:Qd}),$d=Sd({prop:"borderBottom",themeKey:"borders",transform:Qd}),ep=Sd({prop:"borderLeft",themeKey:"borders",transform:Qd}),tp=Sd({prop:"borderColor",themeKey:"palette"}),rp=Sd({prop:"borderTopColor",themeKey:"palette"}),np=Sd({prop:"borderRightColor",themeKey:"palette"}),ip=Sd({prop:"borderBottomColor",themeKey:"palette"}),op=Sd({prop:"borderLeftColor",themeKey:"palette"}),ap=function(e){if(void 0!==e.borderRadius&&null!==e.borderRadius){var t=Md(e.theme,"shape.borderRadius",4);return md(e,e.borderRadius,(function(e){return{borderRadius:Od(t,e)}}))}return null};ap.propTypes={},ap.filterProps=["borderRadius"];var sp=Wd(Jd,Yd,Xd,$d,ep,tp,rp,np,ip,op,ap),up=Wd(Sd({prop:"displayPrint",cssProperty:!1,transform:function(e){return{"@media print":{display:e}}}}),Sd({prop:"display"}),Sd({prop:"overflow"}),Sd({prop:"textOverflow"}),Sd({prop:"visibility"}),Sd({prop:"whiteSpace"})),cp=Wd(Sd({prop:"flexBasis"}),Sd({prop:"flexDirection"}),Sd({prop:"flexWrap"}),Sd({prop:"justifyContent"}),Sd({prop:"alignItems"}),Sd({prop:"alignContent"}),Sd({prop:"order"}),Sd({prop:"flex"}),Sd({prop:"flexGrow"}),Sd({prop:"flexShrink"}),Sd({prop:"alignSelf"}),Sd({prop:"justifyItems"}),Sd({prop:"justifySelf"})),lp=function(e){if(void 0!==e.gap&&null!==e.gap){var t=Md(e.theme,"spacing",8);return md(e,e.gap,(function(e){return{gap:Od(t,e)}}))}return null};lp.propTypes={},lp.filterProps=["gap"];var fp=function(e){if(void 0!==e.columnGap&&null!==e.columnGap){var t=Md(e.theme,"spacing",8);return md(e,e.columnGap,(function(e){return{columnGap:Od(t,e)}}))}return null};fp.propTypes={},fp.filterProps=["columnGap"];var hp=function(e){if(void 0!==e.rowGap&&null!==e.rowGap){var t=Md(e.theme,"spacing",8);return md(e,e.rowGap,(function(e){return{rowGap:Od(t,e)}}))}return null};hp.propTypes={},hp.filterProps=["rowGap"];var dp=Wd(lp,fp,hp,Sd({prop:"gridColumn"}),Sd({prop:"gridRow"}),Sd({prop:"gridAutoFlow"}),Sd({prop:"gridAutoColumns"}),Sd({prop:"gridAutoRows"}),Sd({prop:"gridTemplateColumns"}),Sd({prop:"gridTemplateRows"}),Sd({prop:"gridTemplateAreas"}),Sd({prop:"gridArea"})),pp=Wd(Sd({prop:"position"}),Sd({prop:"zIndex",themeKey:"zIndex"}),Sd({prop:"top"}),Sd({prop:"right"}),Sd({prop:"bottom"}),Sd({prop:"left"})),vp=Wd(Sd({prop:"color",themeKey:"palette"}),Sd({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette"}),Sd({prop:"backgroundColor",themeKey:"palette"})),gp=Sd({prop:"boxShadow",themeKey:"shadows"});function yp(e){return e<=1&&0!==e?"".concat(100*e,"%"):e}var mp=Sd({prop:"width",transform:yp}),bp=function(e){if(void 0!==e.maxWidth&&null!==e.maxWidth){return md(e,e.maxWidth,(function(t){var r,n,i;return{maxWidth:(null==(r=e.theme)||null==(n=r.breakpoints)||null==(i=n.values)?void 0:i[t])||gd[t]||yp(t)}}))}return null};bp.filterProps=["maxWidth"];var wp=Sd({prop:"minWidth",transform:yp}),kp=Sd({prop:"height",transform:yp}),Ep=Sd({prop:"maxHeight",transform:yp}),xp=Sd({prop:"minHeight",transform:yp}),Sp=(Sd({prop:"size",cssProperty:"width",transform:yp}),Sd({prop:"size",cssProperty:"height",transform:yp}),Wd(mp,bp,wp,kp,Ep,xp,Sd({prop:"boxSizing"}))),_p=Sd({prop:"fontFamily",themeKey:"typography"}),Ap=Sd({prop:"fontSize",themeKey:"typography"}),Ip=Sd({prop:"fontStyle",themeKey:"typography"}),Cp=Sd({prop:"fontWeight",themeKey:"typography"}),Tp=Sd({prop:"letterSpacing"}),Pp=Sd({prop:"textTransform"}),Rp=Sd({prop:"lineHeight"}),Bp=Sd({prop:"textAlign"}),Mp=Wd(Sd({prop:"typography",cssProperty:!1,themeKey:"typography"}),_p,Ap,Ip,Cp,Tp,Rp,Bp,Pp),Np={borders:sp.filterProps,display:up.filterProps,flexbox:cp.filterProps,grid:dp.filterProps,positions:pp.filterProps,palette:vp.filterProps,shadows:gp.filterProps,sizing:Sp.filterProps,spacing:Zd.filterProps,typography:Mp.filterProps},Op={borders:sp,display:up,flexbox:cp,grid:dp,positions:pp,palette:vp,shadows:gp,sizing:Sp,spacing:Zd,typography:Mp};Object.keys(Np).reduce((function(e,t){return Np[t].forEach((function(r){e[r]=Op[t]})),e}),{});function Dp(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=t.reduce((function(e,t){return e.concat(Object.keys(t))}),[]),i=new Set(n);return t.every((function(e){return i.size===Object.keys(e).length}))}function Lp(e,t){return"function"===typeof e?e(t):e}var Up=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Op,t=Object.keys(e).reduce((function(t,r){return e[r].filterProps.forEach((function(n){t[n]=e[r]})),t}),{});function r(e,r,n){var i,o=(B(i={},e,r),B(i,"theme",n),i),a=t[e];return a?a(o):B({},e,r)}function n(e){var i=e||{},o=i.sx,a=i.theme,s=void 0===a?{}:a;if(!o)return null;function u(e){var i=e;if("function"===typeof e)i=e(s);else if("object"!==typeof e)return e;if(!i)return null;var o=bd(s.breakpoints),a=Object.keys(o),u=o;return Object.keys(i).forEach((function(e){var o=Lp(i[e],s);if(null!==o&&void 0!==o)if("object"===typeof o)if(t[e])u=_d(u,r(e,o,s));else{var a=md({theme:s},o,(function(t){return B({},e,t)}));Dp(a,o)?u[e]=n({sx:o,theme:s}):u=_d(u,a)}else u=_d(u,r(e,o,s))})),wd(a,u)}return Array.isArray(o)?o.map(u):u(o)}return n}();Up.filterProps=["sx"];var Fp=Up,zp=["name","slot","skipVariantsResolver","skipSx","overridesResolver"],Zp=["theme"],jp=["theme"];function qp(e){return 0===Object.keys(e).length}function Kp(e){return"string"===typeof e&&e.charCodeAt(0)>96}var Vp=function(e,t){return t.components&&t.components[e]&&t.components[e].styleOverrides?t.components[e].styleOverrides:null},Hp=function(e,t){var r=[];t&&t.components&&t.components[e]&&t.components[e].variants&&(r=t.components[e].variants);var n={};return r.forEach((function(e){var t=Gd(e.props);n[t]=e.style})),n},Gp=function(e,t,r,n){var i,o,a=e.ownerState,s=void 0===a?{}:a,u=[],c=null==r||null==(i=r.components)||null==(o=i[n])?void 0:o.variants;return c&&c.forEach((function(r){var n=!0;Object.keys(r.props).forEach((function(t){s[t]!==r.props[t]&&e[t]!==r.props[t]&&(n=!1)})),n&&u.push(t[Gd(r.props)])})),u};function Wp(e){return"ownerState"!==e&&"theme"!==e&&"sx"!==e&&"as"!==e}var Qp=Kd();function Jp(e,t){var r;return mf({toolbar:(r={minHeight:56},B(r,e.up("xs"),{"@media (orientation: landscape)":{minHeight:48}}),B(r,e.up("sm"),{minHeight:64}),r)},t)}var Yp={black:"#000",white:"#fff"},Xp={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"},$p={50:"#f3e5f5",100:"#e1bee7",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",600:"#8e24aa",700:"#7b1fa2",800:"#6a1b9a",900:"#4a148c",A100:"#ea80fc",A200:"#e040fb",A400:"#d500f9",A700:"#aa00ff"},ev={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"},tv={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00"},rv={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff"},nv={50:"#e1f5fe",100:"#b3e5fc",200:"#81d4fa",300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",600:"#039be5",700:"#0288d1",800:"#0277bd",900:"#01579b",A100:"#80d8ff",A200:"#40c4ff",A400:"#00b0ff",A700:"#0091ea"},iv={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"},ov=["mode","contrastThreshold","tonalOffset"],av={text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:Yp.white,default:Yp.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}},sv={text:{primary:Yp.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:Yp.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}};function uv(e,t,r,n){var i=n.light||n,o=n.dark||1.5*n;e[t]||(e.hasOwnProperty(r)?e[t]=e[r]:"light"===t?e.light=Pf(e.main,i):"dark"===t&&(e.dark=Tf(e.main,o)))}function cv(e){var t=e.mode,r=void 0===t?"light":t,n=e.contrastThreshold,i=void 0===n?3:n,o=e.tonalOffset,a=void 0===o?.2:o,s=yf(e,ov),u=e.primary||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:rv[200],light:rv[50],dark:rv[400]}:{main:rv[700],light:rv[400],dark:rv[800]}}(r),c=e.secondary||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:$p[200],light:$p[50],dark:$p[400]}:{main:$p[500],light:$p[300],dark:$p[700]}}(r),l=e.error||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:ev[500],light:ev[300],dark:ev[700]}:{main:ev[700],light:ev[400],dark:ev[800]}}(r),f=e.info||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:nv[400],light:nv[300],dark:nv[700]}:{main:nv[700],light:nv[500],dark:nv[900]}}(r),h=e.success||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:iv[400],light:iv[300],dark:iv[700]}:{main:iv[800],light:iv[500],dark:iv[900]}}(r),d=e.warning||function(){return"dark"===(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"light")?{main:tv[400],light:tv[300],dark:tv[700]}:{main:"#ed6c02",light:tv[500],dark:tv[900]}}(r);function p(e){var t=function(e,t){var r=If(e),n=If(t);return(Math.max(r,n)+.05)/(Math.min(r,n)+.05)}(e,sv.text.primary)>=i?sv.text.primary:av.text.primary;return t}var v=function(e){var t=e.color,r=e.name,n=e.mainShade,i=void 0===n?500:n,o=e.lightShade,s=void 0===o?300:o,u=e.darkShade,c=void 0===u?700:u;if(!(t=mf({},t)).main&&t[i]&&(t.main=t[i]),!t.hasOwnProperty("main"))throw new Error(xf(11,r?" (".concat(r,")"):"",i));if("string"!==typeof t.main)throw new Error(xf(12,r?" (".concat(r,")"):"",JSON.stringify(t.main)));return uv(t,"light",s,a),uv(t,"dark",c,a),t.contrastText||(t.contrastText=p(t.main)),t},g={dark:sv,light:av};return hd(mf({common:mf({},Yp),mode:r,primary:v({color:u,name:"primary"}),secondary:v({color:c,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:v({color:l,name:"error"}),warning:v({color:d,name:"warning"}),info:v({color:f,name:"info"}),success:v({color:h,name:"success"}),grey:Xp,contrastThreshold:i,getContrastText:p,augmentColor:v,tonalOffset:a},g[r]),s)}var lv=["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"];var fv={textTransform:"uppercase"},hv='"Roboto", "Helvetica", "Arial", sans-serif';function dv(e,t){var r="function"===typeof t?t(e):t,n=r.fontFamily,i=void 0===n?hv:n,o=r.fontSize,a=void 0===o?14:o,s=r.fontWeightLight,u=void 0===s?300:s,c=r.fontWeightRegular,l=void 0===c?400:c,f=r.fontWeightMedium,h=void 0===f?500:f,d=r.fontWeightBold,p=void 0===d?700:d,v=r.htmlFontSize,g=void 0===v?16:v,y=r.allVariants,m=r.pxToRem,b=yf(r,lv);var w=a/14,k=m||function(e){return"".concat(e/g*w,"rem")},E=function(e,t,r,n,o){return mf({fontFamily:i,fontWeight:e,fontSize:k(t),lineHeight:r},i===hv?{letterSpacing:"".concat((a=n/t,Math.round(1e5*a)/1e5),"em")}:{},o,y);var a},x={h1:E(u,96,1.167,-1.5),h2:E(u,60,1.2,-.5),h3:E(l,48,1.167,0),h4:E(l,34,1.235,.25),h5:E(l,24,1.334,0),h6:E(h,20,1.6,.15),subtitle1:E(l,16,1.75,.15),subtitle2:E(h,14,1.57,.1),body1:E(l,16,1.5,.15),body2:E(l,14,1.43,.15),button:E(h,14,1.75,.4,fv),caption:E(l,12,1.66,.4),overline:E(l,12,2.66,1,fv)};return hd(mf({htmlFontSize:g,pxToRem:k,fontFamily:i,fontSize:a,fontWeightLight:u,fontWeightRegular:l,fontWeightMedium:h,fontWeightBold:p},x),b,{clone:!1})}function pv(){return["".concat(arguments.length<=0?void 0:arguments[0],"px ").concat(arguments.length<=1?void 0:arguments[1],"px ").concat(arguments.length<=2?void 0:arguments[2],"px ").concat(arguments.length<=3?void 0:arguments[3],"px rgba(0,0,0,").concat(.2,")"),"".concat(arguments.length<=4?void 0:arguments[4],"px ").concat(arguments.length<=5?void 0:arguments[5],"px ").concat(arguments.length<=6?void 0:arguments[6],"px ").concat(arguments.length<=7?void 0:arguments[7],"px rgba(0,0,0,").concat(.14,")"),"".concat(arguments.length<=8?void 0:arguments[8],"px ").concat(arguments.length<=9?void 0:arguments[9],"px ").concat(arguments.length<=10?void 0:arguments[10],"px ").concat(arguments.length<=11?void 0:arguments[11],"px rgba(0,0,0,").concat(.12,")")].join(",")}var vv=["none",pv(0,2,1,-1,0,1,1,0,0,1,3,0),pv(0,3,1,-2,0,2,2,0,0,1,5,0),pv(0,3,3,-2,0,3,4,0,0,1,8,0),pv(0,2,4,-1,0,4,5,0,0,1,10,0),pv(0,3,5,-1,0,5,8,0,0,1,14,0),pv(0,3,5,-1,0,6,10,0,0,1,18,0),pv(0,4,5,-2,0,7,10,1,0,2,16,1),pv(0,5,5,-3,0,8,10,1,0,3,14,2),pv(0,5,6,-3,0,9,12,1,0,3,16,2),pv(0,6,6,-3,0,10,14,1,0,4,18,3),pv(0,6,7,-4,0,11,15,1,0,4,20,3),pv(0,7,8,-4,0,12,17,2,0,5,22,4),pv(0,7,8,-4,0,13,19,2,0,5,24,4),pv(0,7,9,-4,0,14,21,2,0,5,26,4),pv(0,8,9,-5,0,15,22,2,0,6,28,5),pv(0,8,10,-5,0,16,24,2,0,6,30,5),pv(0,8,11,-5,0,17,26,2,0,6,32,5),pv(0,9,11,-5,0,18,28,2,0,7,34,6),pv(0,9,12,-6,0,19,29,2,0,7,36,6),pv(0,10,13,-6,0,20,31,3,0,8,38,7),pv(0,10,13,-6,0,21,33,3,0,8,40,7),pv(0,10,14,-6,0,22,35,3,0,8,42,7),pv(0,11,14,-7,0,23,36,3,0,9,44,8),pv(0,11,15,-7,0,24,38,3,0,9,46,8)],gv=["duration","easing","delay"],yv={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},mv={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function bv(e){return"".concat(Math.round(e),"ms")}function wv(e){if(!e)return 0;var t=e/36;return Math.round(10*(4+15*Math.pow(t,.25)+t/5))}function kv(e){var t=mf({},yv,e.easing),r=mf({},mv,e.duration);return mf({getAutoHeightDuration:wv,create:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["all"],n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},i=n.duration,o=void 0===i?r.standard:i,a=n.easing,s=void 0===a?t.easeInOut:a,u=n.delay,c=void 0===u?0:u;yf(n,gv);return(Array.isArray(e)?e:[e]).map((function(e){return"".concat(e," ").concat("string"===typeof o?o:bv(o)," ").concat(s," ").concat("string"===typeof c?c:bv(c))})).join(",")}},e,{easing:t,duration:r})}var Ev={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500},xv=["breakpoints","mixins","spacing","palette","transitions","typography","shape"];function Sv(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.mixins,r=void 0===t?{}:t,n=e.palette,i=void 0===n?{}:n,o=e.transitions,a=void 0===o?{}:o,s=e.typography,u=void 0===s?{}:s,c=yf(e,xv);if(e.vars)throw new Error(xf(18));var l=cv(i),f=Kd(e),h=hd(f,{mixins:Jp(f.breakpoints,r),palette:l,shadows:vv.slice(),typography:dv(l,u),transitions:kv(a),zIndex:mf({},Ev)});h=hd(h,c);for(var d=arguments.length,p=new Array(d>1?d-1:0),v=1;v<d;v++)p[v-1]=arguments[v];return h=p.reduce((function(e,t){return hd(e,t)}),h)}var _v=Sv(),Av=function(e){return Wp(e)&&"classes"!==e},Iv=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.defaultTheme,r=void 0===t?Qp:t,n=e.rootShouldForwardProp,i=void 0===n?Wp:n,o=e.slotShouldForwardProp,a=void 0===o?Wp:o,s=e.styleFunctionSx,u=void 0===s?Fp:s,c=function(e){var t=qp(e.theme)?r:e.theme;return u(mf({},e,{theme:t}))};return c.__mui_systemSx=!0,function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};ld(e,(function(e){return e.filter((function(e){return!(null!=e&&e.__mui_systemSx)}))}));var n,o=t.name,s=t.slot,u=t.skipVariantsResolver,l=t.skipSx,f=t.overridesResolver,h=yf(t,zp),d=void 0!==u?u:s&&"Root"!==s||!1,p=l||!1;var v=Wp;"Root"===s?v=i:s?v=a:Kp(e)&&(v=void 0);var g=cd(e,mf({shouldForwardProp:v,label:n},h)),y=function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),i=1;i<t;i++)n[i-1]=arguments[i];var a=n?n.map((function(e){return"function"===typeof e&&e.__emotion_real!==e?function(t){var n=t.theme,i=yf(t,Zp);return e(mf({theme:qp(n)?r:n},i))}:e})):[],s=e;o&&f&&a.push((function(e){var t=qp(e.theme)?r:e.theme,n=Vp(o,t);if(n){var i={};return Object.entries(n).forEach((function(r){var n=I(r,2),o=n[0],a=n[1];i[o]="function"===typeof a?a(mf({},e,{theme:t})):a})),f(e,i)}return null})),o&&!d&&a.push((function(e){var t=qp(e.theme)?r:e.theme;return Gp(e,Hp(o,t),t,o)})),p||a.push(c);var u=a.length-n.length;if(Array.isArray(e)&&u>0){var l=new Array(u).fill("");(s=[].concat(Jr(e),Jr(l))).raw=[].concat(Jr(e.raw),Jr(l))}else"function"===typeof e&&e.__emotion_real!==e&&(s=function(t){var n=t.theme,i=yf(t,jp);return e(mf({theme:qp(n)?r:n},i))});var h=g.apply(void 0,[s].concat(Jr(a)));return h};return g.withConfig&&(y.withConfig=g.withConfig),y}}({defaultTheme:_v,rootShouldForwardProp:Av}),Cv=Iv;var Tv=m.createContext(null);function Pv(){return m.useContext(Tv)}function Rv(e){return 0===Object.keys(e).length}var Bv=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null,t=Pv();return!t||Rv(t)?e:t},Mv=Kd();var Nv=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:Mv;return Bv(e)};function Ov(e){var t=e.props,r=e.name,n=e.defaultTheme,i=function(e){var t=e.theme,r=e.name,n=e.props;return t&&t.components&&t.components[r]&&t.components[r].defaultProps?kf(t.components[r].defaultProps,n):n}({theme:Nv(n),name:r,props:t});return i}function Dv(e){return Ov({props:e.props,name:e.name,defaultTheme:_v})}function Lv(e,t){"function"===typeof e?e(t):e&&(e.current=t)}var Uv=function(e,t){return m.useMemo((function(){return null==e&&null==t?null:function(r){Lv(e,r),Lv(t,r)}}),[e,t])},Fv="undefined"!==typeof window?m.useLayoutEffect:m.useEffect;var zv,Zv=function(e){var t=m.useRef(e);return Fv((function(){t.current=e})),m.useCallback((function(){return t.current.apply(void 0,arguments)}),[])},jv=!0,qv=!1,Kv={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function Vv(e){e.metaKey||e.altKey||e.ctrlKey||(jv=!0)}function Hv(){jv=!1}function Gv(){"hidden"===this.visibilityState&&qv&&(jv=!0)}function Wv(e){var t=e.target;try{return t.matches(":focus-visible")}catch(r){}return jv||function(e){var t=e.type,r=e.tagName;return!("INPUT"!==r||!Kv[t]||e.readOnly)||"TEXTAREA"===r&&!e.readOnly||!!e.isContentEditable}(t)}var Qv=function(){var e=m.useCallback((function(e){var t;null!=e&&((t=e.ownerDocument).addEventListener("keydown",Vv,!0),t.addEventListener("mousedown",Hv,!0),t.addEventListener("pointerdown",Hv,!0),t.addEventListener("touchstart",Hv,!0),t.addEventListener("visibilitychange",Gv,!0))}),[]),t=m.useRef(!1);return{isFocusVisibleRef:t,onFocus:function(e){return!!Wv(e)&&(t.current=!0,!0)},onBlur:function(){return!!t.current&&(qv=!0,window.clearTimeout(zv),zv=window.setTimeout((function(){qv=!1}),100),t.current=!1,!0)},ref:e}};function Jv(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var Yv=m.createContext(null);function Xv(e,t){var r=Object.create(null);return e&&m.Children.map(e,(function(e){return e})).forEach((function(e){r[e.key]=function(e){return t&&(0,m.isValidElement)(e)?t(e):e}(e)})),r}function $v(e,t,r){return null!=r[t]?r[t]:e.props[t]}function eg(e,t,r){var n=Xv(e.children),i=function(e,t){function r(r){return r in t?t[r]:e[r]}e=e||{},t=t||{};var n,i=Object.create(null),o=[];for(var a in e)a in t?o.length&&(i[a]=o,o=[]):o.push(a);var s={};for(var u in t){if(i[u])for(n=0;n<i[u].length;n++){var c=i[u][n];s[i[u][n]]=r(c)}s[u]=r(u)}for(n=0;n<o.length;n++)s[o[n]]=r(o[n]);return s}(t,n);return Object.keys(i).forEach((function(o){var a=i[o];if((0,m.isValidElement)(a)){var s=o in t,u=o in n,c=t[o],l=(0,m.isValidElement)(c)&&!c.props.in;!u||s&&!l?u||!s||l?u&&s&&(0,m.isValidElement)(c)&&(i[o]=(0,m.cloneElement)(a,{onExited:r.bind(null,a),in:c.props.in,exit:$v(a,"exit",e),enter:$v(a,"enter",e)})):i[o]=(0,m.cloneElement)(a,{in:!1}):i[o]=(0,m.cloneElement)(a,{onExited:r.bind(null,a),in:!0,exit:$v(a,"exit",e),enter:$v(a,"enter",e)})}})),i}var tg=Object.values||function(e){return Object.keys(e).map((function(t){return e[t]}))},rg=function(e){var t,r;function n(t,r){var n,i=(n=e.call(this,t,r)||this).handleExited.bind(j(n));return n.state={contextValue:{isMounting:!0},handleExited:i,firstRender:!0},n}r=e,(t=n).prototype=Object.create(r.prototype),t.prototype.constructor=t,L(t,r);var i=n.prototype;return i.componentDidMount=function(){this.mounted=!0,this.setState({contextValue:{isMounting:!1}})},i.componentWillUnmount=function(){this.mounted=!1},n.getDerivedStateFromProps=function(e,t){var r,n,i=t.children,o=t.handleExited;return{children:t.firstRender?(r=e,n=o,Xv(r.children,(function(e){return(0,m.cloneElement)(e,{onExited:n.bind(null,e),in:!0,appear:$v(e,"appear",r),enter:$v(e,"enter",r),exit:$v(e,"exit",r)})}))):eg(e,i,o),firstRender:!1}},i.handleExited=function(e,t){var r=Xv(this.props.children);e.key in r||(e.props.onExited&&e.props.onExited(t),this.mounted&&this.setState((function(t){var r=mf({},t.children);return delete r[e.key],{children:r}})))},i.render=function(){var e=this.props,t=e.component,r=e.childFactory,n=yf(e,["component","childFactory"]),i=this.state.contextValue,o=tg(this.state.children).map(r);return delete n.appear,delete n.enter,delete n.exit,null===t?m.createElement(Yv.Provider,{value:i},o):m.createElement(Yv.Provider,{value:i},m.createElement(t,n,o))},n}(m.Component);rg.propTypes={},rg.defaultProps={component:"div",childFactory:function(e){return e}};var ng=rg;__webpack_require__(2990);function ig(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return Gh(t)}var og=function(){var e=ig.apply(void 0,arguments),t="animation-"+e.name;return{name:t,styles:"@keyframes "+t+"{"+e.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}};var ag=__webpack_require__(2075);var sg=function(e){var t=e.className,r=e.classes,n=e.pulsate,i=void 0!==n&&n,o=e.rippleX,a=e.rippleY,s=e.rippleSize,u=e.in,c=e.onExited,l=e.timeout,f=I(m.useState(!1),2),h=f[0],d=f[1],p=wf(t,r.ripple,r.rippleVisible,i&&r.ripplePulsate),v={width:s,height:s,top:-s/2+a,left:-s/2+o},g=wf(r.child,h&&r.childLeaving,i&&r.childPulsate);return u||h||d(!0),m.useEffect((function(){if(!u&&null!=c){var e=setTimeout(c,l);return function(){clearTimeout(e)}}}),[c,u,l]),(0,ag.jsx)("span",{className:p,style:v,children:(0,ag.jsx)("span",{className:g})})},ug=function(e){return e},cg=function(){var e=ug;return{configure:function(t){e=t},generate:function(t){return e(t)},reset:function(){e=ug}}}(),lg={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",required:"required",selected:"selected"};function fg(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"Mui",n=lg[t];return n?"".concat(r,"-").concat(n):"".concat(cg.generate(e),"-").concat(t)}function hg(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"Mui",n={};return t.forEach((function(t){n[t]=fg(e,t,r)})),n}var dg,pg,vg,gg,yg,mg,bg,wg,kg=hg("MuiTouchRipple",["root","ripple","rippleVisible","ripplePulsate","child","childLeaving","childPulsate"]),Eg=["center","classes","className"],xg=og(yg||(yg=dg||(dg=Jv(["\n 0% {\n transform: scale(0);\n opacity: 0.1;\n }\n\n 100% {\n transform: scale(1);\n opacity: 0.3;\n }\n"])))),Sg=og(mg||(mg=pg||(pg=Jv(["\n 0% {\n opacity: 1;\n }\n\n 100% {\n opacity: 0;\n }\n"])))),_g=og(bg||(bg=vg||(vg=Jv(["\n 0% {\n transform: scale(1);\n }\n\n 50% {\n transform: scale(0.92);\n }\n\n 100% {\n transform: scale(1);\n }\n"])))),Ag=Cv("span",{name:"MuiTouchRipple",slot:"Root"})({overflow:"hidden",pointerEvents:"none",position:"absolute",zIndex:0,top:0,right:0,bottom:0,left:0,borderRadius:"inherit"}),Ig=Cv(sg,{name:"MuiTouchRipple",slot:"Ripple"})(wg||(wg=gg||(gg=Jv(["\n opacity: 0;\n position: absolute;\n\n &."," {\n opacity: 0.3;\n transform: scale(1);\n animation-name: ",";\n animation-duration: ","ms;\n animation-timing-function: ",";\n }\n\n &."," {\n animation-duration: ","ms;\n }\n\n & ."," {\n opacity: 1;\n display: block;\n width: 100%;\n height: 100%;\n border-radius: 50%;\n background-color: currentColor;\n }\n\n & ."," {\n opacity: 0;\n animation-name: ",";\n animation-duration: ","ms;\n animation-timing-function: ",";\n }\n\n & ."," {\n position: absolute;\n /* @noflip */\n left: 0px;\n top: 0;\n animation-name: ",";\n animation-duration: 2500ms;\n animation-timing-function: ",";\n animation-iteration-count: infinite;\n animation-delay: 200ms;\n }\n"]))),kg.rippleVisible,xg,550,(function(e){return e.theme.transitions.easing.easeInOut}),kg.ripplePulsate,(function(e){return e.theme.transitions.duration.shorter}),kg.child,kg.childLeaving,Sg,550,(function(e){return e.theme.transitions.easing.easeInOut}),kg.childPulsate,_g,(function(e){return e.theme.transitions.easing.easeInOut})),Cg=m.forwardRef((function(e,t){var r=Dv({props:e,name:"MuiTouchRipple"}),n=r.center,i=void 0!==n&&n,o=r.classes,a=void 0===o?{}:o,s=r.className,u=yf(r,Eg),c=I(m.useState([]),2),l=c[0],f=c[1],h=m.useRef(0),d=m.useRef(null);m.useEffect((function(){d.current&&(d.current(),d.current=null)}),[l]);var p=m.useRef(!1),v=m.useRef(null),g=m.useRef(null),y=m.useRef(null);m.useEffect((function(){return function(){clearTimeout(v.current)}}),[]);var b=m.useCallback((function(e){var t=e.pulsate,r=e.rippleX,n=e.rippleY,i=e.rippleSize,o=e.cb;f((function(e){return[].concat(Jr(e),[(0,ag.jsx)(Ig,{classes:{ripple:wf(a.ripple,kg.ripple),rippleVisible:wf(a.rippleVisible,kg.rippleVisible),ripplePulsate:wf(a.ripplePulsate,kg.ripplePulsate),child:wf(a.child,kg.child),childLeaving:wf(a.childLeaving,kg.childLeaving),childPulsate:wf(a.childPulsate,kg.childPulsate)},timeout:550,pulsate:t,rippleX:r,rippleY:n,rippleSize:i},h.current)])})),h.current+=1,d.current=o}),[a]),w=m.useCallback((function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2?arguments[2]:void 0,n=t.pulsate,o=void 0!==n&&n,a=t.center,s=void 0===a?i||t.pulsate:a,u=t.fakeElement,c=void 0!==u&&u;if("mousedown"===(null==e?void 0:e.type)&&p.current)p.current=!1;else{"touchstart"===(null==e?void 0:e.type)&&(p.current=!0);var l,f,h,d=c?null:y.current,m=d?d.getBoundingClientRect():{width:0,height:0,left:0,top:0};if(s||void 0===e||0===e.clientX&&0===e.clientY||!e.clientX&&!e.touches)l=Math.round(m.width/2),f=Math.round(m.height/2);else{var w=e.touches&&e.touches.length>0?e.touches[0]:e,k=w.clientX,E=w.clientY;l=Math.round(k-m.left),f=Math.round(E-m.top)}if(s)(h=Math.sqrt((2*Math.pow(m.width,2)+Math.pow(m.height,2))/3))%2===0&&(h+=1);else{var x=2*Math.max(Math.abs((d?d.clientWidth:0)-l),l)+2,S=2*Math.max(Math.abs((d?d.clientHeight:0)-f),f)+2;h=Math.sqrt(Math.pow(x,2)+Math.pow(S,2))}null!=e&&e.touches?null===g.current&&(g.current=function(){b({pulsate:o,rippleX:l,rippleY:f,rippleSize:h,cb:r})},v.current=setTimeout((function(){g.current&&(g.current(),g.current=null)}),80)):b({pulsate:o,rippleX:l,rippleY:f,rippleSize:h,cb:r})}}),[i,b]),k=m.useCallback((function(){w({},{pulsate:!0})}),[w]),E=m.useCallback((function(e,t){if(clearTimeout(v.current),"touchend"===(null==e?void 0:e.type)&&g.current)return g.current(),g.current=null,void(v.current=setTimeout((function(){E(e,t)})));g.current=null,f((function(e){return e.length>0?e.slice(1):e})),d.current=t}),[]);return m.useImperativeHandle(t,(function(){return{pulsate:k,start:w,stop:E}}),[k,w,E]),(0,ag.jsx)(Ag,mf({className:wf(kg.root,a.root,s),ref:y},u,{children:(0,ag.jsx)(ng,{component:null,exit:!0,children:l})}))})),Tg=Cg;function Pg(e){return fg("MuiButtonBase",e)}var Rg,Bg=hg("MuiButtonBase",["root","disabled","focusVisible"]),Mg=["action","centerRipple","children","className","component","disabled","disableRipple","disableTouchRipple","focusRipple","focusVisibleClassName","LinkComponent","onBlur","onClick","onContextMenu","onDragLeave","onFocus","onFocusVisible","onKeyDown","onKeyUp","onMouseDown","onMouseLeave","onMouseUp","onTouchEnd","onTouchMove","onTouchStart","tabIndex","TouchRippleProps","touchRippleRef","type"],Ng=Cv("button",{name:"MuiButtonBase",slot:"Root",overridesResolver:function(e,t){return t.root}})((B(Rg={display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",boxSizing:"border-box",WebkitTapHighlightColor:"transparent",backgroundColor:"transparent",outline:0,border:0,margin:0,borderRadius:0,padding:0,cursor:"pointer",userSelect:"none",verticalAlign:"middle",MozAppearance:"none",WebkitAppearance:"none",textDecoration:"none",color:"inherit","&::-moz-focus-inner":{borderStyle:"none"}},"&.".concat(Bg.disabled),{pointerEvents:"none",cursor:"default"}),B(Rg,"@media print",{colorAdjust:"exact"}),Rg)),Og=m.forwardRef((function(e,t){var r=Dv({props:e,name:"MuiButtonBase"}),n=r.action,i=r.centerRipple,o=void 0!==i&&i,a=r.children,s=r.className,u=r.component,c=void 0===u?"button":u,l=r.disabled,f=void 0!==l&&l,h=r.disableRipple,d=void 0!==h&&h,p=r.disableTouchRipple,v=void 0!==p&&p,g=r.focusRipple,y=void 0!==g&&g,b=r.LinkComponent,w=void 0===b?"a":b,k=r.onBlur,E=r.onClick,x=r.onContextMenu,S=r.onDragLeave,_=r.onFocus,A=r.onFocusVisible,C=r.onKeyDown,T=r.onKeyUp,P=r.onMouseDown,R=r.onMouseLeave,B=r.onMouseUp,M=r.onTouchEnd,N=r.onTouchMove,O=r.onTouchStart,D=r.tabIndex,L=void 0===D?0:D,U=r.TouchRippleProps,F=r.touchRippleRef,z=r.type,Z=yf(r,Mg),j=m.useRef(null),q=m.useRef(null),K=Uv(q,F),V=Qv(),H=V.isFocusVisibleRef,G=V.onFocus,W=V.onBlur,Q=V.ref,J=I(m.useState(!1),2),Y=J[0],X=J[1];f&&Y&&X(!1),m.useImperativeHandle(n,(function(){return{focusVisible:function(){X(!0),j.current.focus()}}}),[]);var $=I(m.useState(!1),2),ee=$[0],te=$[1];m.useEffect((function(){te(!0)}),[]);var re=ee&&!d&&!f;function ne(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:v;return Zv((function(n){return t&&t(n),!r&&q.current&&q.current[e](n),!0}))}m.useEffect((function(){Y&&y&&!d&&ee&&q.current.pulsate()}),[d,y,Y,ee]);var ie=ne("start",P),oe=ne("stop",x),ae=ne("stop",S),se=ne("stop",B),ue=ne("stop",(function(e){Y&&e.preventDefault(),R&&R(e)})),ce=ne("start",O),le=ne("stop",M),fe=ne("stop",N),he=ne("stop",(function(e){W(e),!1===H.current&&X(!1),k&&k(e)}),!1),de=Zv((function(e){j.current||(j.current=e.currentTarget),G(e),!0===H.current&&(X(!0),A&&A(e)),_&&_(e)})),pe=function(){var e=j.current;return c&&"button"!==c&&!("A"===e.tagName&&e.href)},ve=m.useRef(!1),ge=Zv((function(e){y&&!ve.current&&Y&&q.current&&" "===e.key&&(ve.current=!0,q.current.stop(e,(function(){q.current.start(e)}))),e.target===e.currentTarget&&pe()&&" "===e.key&&e.preventDefault(),C&&C(e),e.target===e.currentTarget&&pe()&&"Enter"===e.key&&!f&&(e.preventDefault(),E&&E(e))})),ye=Zv((function(e){y&&" "===e.key&&q.current&&Y&&!e.defaultPrevented&&(ve.current=!1,q.current.stop(e,(function(){q.current.pulsate(e)}))),T&&T(e),E&&e.target===e.currentTarget&&pe()&&" "===e.key&&!e.defaultPrevented&&E(e)})),me=c;"button"===me&&(Z.href||Z.to)&&(me=w);var be={};"button"===me?(be.type=void 0===z?"button":z,be.disabled=f):(Z.href||Z.to||(be.role="button"),f&&(be["aria-disabled"]=f));var we=Uv(Q,j),ke=Uv(t,we);var Ee=mf({},r,{centerRipple:o,component:c,disabled:f,disableRipple:d,disableTouchRipple:v,focusRipple:y,tabIndex:L,focusVisible:Y}),xe=function(e){var t=e.disabled,r=e.focusVisible,n=e.focusVisibleClassName,i=Ef({root:["root",t&&"disabled",r&&"focusVisible"]},Pg,e.classes);return r&&n&&(i.root+=" ".concat(n)),i}(Ee);return(0,ag.jsxs)(Ng,mf({as:me,className:wf(xe.root,s),ownerState:Ee,onBlur:he,onClick:E,onContextMenu:oe,onFocus:de,onKeyDown:ge,onKeyUp:ye,onMouseDown:ie,onMouseLeave:ue,onMouseUp:se,onDragLeave:ae,onTouchEnd:le,onTouchMove:fe,onTouchStart:ce,ref:ke,tabIndex:f?-1:L,type:z},be,Z,{children:[a,re?(0,ag.jsx)(Tg,mf({ref:K,center:o},U)):null]}))})),Dg=Og,Lg=kd;function Ug(e){return fg("MuiButton",e)}var Fg=hg("MuiButton",["root","text","textInherit","textPrimary","textSecondary","textSuccess","textError","textInfo","textWarning","outlined","outlinedInherit","outlinedPrimary","outlinedSecondary","outlinedSuccess","outlinedError","outlinedInfo","outlinedWarning","contained","containedInherit","containedPrimary","containedSecondary","containedSuccess","containedError","containedInfo","containedWarning","disableElevation","focusVisible","disabled","colorInherit","textSizeSmall","textSizeMedium","textSizeLarge","outlinedSizeSmall","outlinedSizeMedium","outlinedSizeLarge","containedSizeSmall","containedSizeMedium","containedSizeLarge","sizeMedium","sizeSmall","sizeLarge","fullWidth","startIcon","endIcon","iconSizeSmall","iconSizeMedium","iconSizeLarge"]);var zg=m.createContext({}),Zg=["children","color","component","className","disabled","disableElevation","disableFocusRipple","endIcon","focusVisibleClassName","fullWidth","size","startIcon","type","variant"],jg=["root"],qg=function(e){return mf({},"small"===e.size&&{"& > *:nth-of-type(1)":{fontSize:18}},"medium"===e.size&&{"& > *:nth-of-type(1)":{fontSize:20}},"large"===e.size&&{"& > *:nth-of-type(1)":{fontSize:22}})},Kg=Cv(Dg,{shouldForwardProp:function(e){return Av(e)||"classes"===e},name:"MuiButton",slot:"Root",overridesResolver:function(e,t){var r=e.ownerState;return[t.root,t[r.variant],t["".concat(r.variant).concat(Lg(r.color))],t["size".concat(Lg(r.size))],t["".concat(r.variant,"Size").concat(Lg(r.size))],"inherit"===r.color&&t.colorInherit,r.disableElevation&&t.disableElevation,r.fullWidth&&t.fullWidth]}})((function(e){var t,r,n,i=e.theme,o=e.ownerState;return mf({},i.typography.button,(B(t={minWidth:64,padding:"6px 16px",borderRadius:(i.vars||i).shape.borderRadius,transition:i.transitions.create(["background-color","box-shadow","border-color","color"],{duration:i.transitions.duration.short}),"&:hover":mf({textDecoration:"none",backgroundColor:i.vars?"rgba(".concat(i.vars.palette.text.primaryChannel," / ").concat(i.vars.palette.action.hoverOpacity,")"):Cf(i.palette.text.primary,i.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},"text"===o.variant&&"inherit"!==o.color&&{backgroundColor:i.vars?"rgba(".concat(i.vars.palette[o.color].mainChannel," / ").concat(i.vars.palette.action.hoverOpacity,")"):Cf(i.palette[o.color].main,i.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},"outlined"===o.variant&&"inherit"!==o.color&&{border:"1px solid ".concat((i.vars||i).palette[o.color].main),backgroundColor:i.vars?"rgba(".concat(i.vars.palette[o.color].mainChannel," / ").concat(i.vars.palette.action.hoverOpacity,")"):Cf(i.palette[o.color].main,i.palette.action.hoverOpacity),"@media (hover: none)":{backgroundColor:"transparent"}},"contained"===o.variant&&{backgroundColor:(i.vars||i).palette.grey.A100,boxShadow:(i.vars||i).shadows[4],"@media (hover: none)":{boxShadow:(i.vars||i).shadows[2],backgroundColor:(i.vars||i).palette.grey[300]}},"contained"===o.variant&&"inherit"!==o.color&&{backgroundColor:(i.vars||i).palette[o.color].dark,"@media (hover: none)":{backgroundColor:(i.vars||i).palette[o.color].main}}),"&:active":mf({},"contained"===o.variant&&{boxShadow:(i.vars||i).shadows[8]})},"&.".concat(Fg.focusVisible),mf({},"contained"===o.variant&&{boxShadow:(i.vars||i).shadows[6]})),B(t,"&.".concat(Fg.disabled),mf({color:(i.vars||i).palette.action.disabled},"outlined"===o.variant&&{border:"1px solid ".concat((i.vars||i).palette.action.disabledBackground)},"outlined"===o.variant&&"secondary"===o.color&&{border:"1px solid ".concat((i.vars||i).palette.action.disabled)},"contained"===o.variant&&{color:(i.vars||i).palette.action.disabled,boxShadow:(i.vars||i).shadows[0],backgroundColor:(i.vars||i).palette.action.disabledBackground})),t),"text"===o.variant&&{padding:"6px 8px"},"text"===o.variant&&"inherit"!==o.color&&{color:(i.vars||i).palette[o.color].main},"outlined"===o.variant&&{padding:"5px 15px",border:"1px solid currentColor"},"outlined"===o.variant&&"inherit"!==o.color&&{color:(i.vars||i).palette[o.color].main,border:i.vars?"1px solid rgba(".concat(i.vars.palette[o.color].mainChannel," / 0.5)"):"1px solid ".concat(Cf(i.palette[o.color].main,.5))},"contained"===o.variant&&{color:i.vars?i.vars.palette.text.primary:null==(r=(n=i.palette).getContrastText)?void 0:r.call(n,i.palette.grey[300]),backgroundColor:(i.vars||i).palette.grey[300],boxShadow:(i.vars||i).shadows[2]},"contained"===o.variant&&"inherit"!==o.color&&{color:(i.vars||i).palette[o.color].contrastText,backgroundColor:(i.vars||i).palette[o.color].main},"inherit"===o.color&&{color:"inherit",borderColor:"currentColor"},"small"===o.size&&"text"===o.variant&&{padding:"4px 5px",fontSize:i.typography.pxToRem(13)},"large"===o.size&&"text"===o.variant&&{padding:"8px 11px",fontSize:i.typography.pxToRem(15)},"small"===o.size&&"outlined"===o.variant&&{padding:"3px 9px",fontSize:i.typography.pxToRem(13)},"large"===o.size&&"outlined"===o.variant&&{padding:"7px 21px",fontSize:i.typography.pxToRem(15)},"small"===o.size&&"contained"===o.variant&&{padding:"4px 10px",fontSize:i.typography.pxToRem(13)},"large"===o.size&&"contained"===o.variant&&{padding:"8px 22px",fontSize:i.typography.pxToRem(15)},o.fullWidth&&{width:"100%"})}),(function(e){var t;return e.ownerState.disableElevation&&(B(t={boxShadow:"none","&:hover":{boxShadow:"none"}},"&.".concat(Fg.focusVisible),{boxShadow:"none"}),B(t,"&:active",{boxShadow:"none"}),B(t,"&.".concat(Fg.disabled),{boxShadow:"none"}),t)})),Vg=Cv("span",{name:"MuiButton",slot:"StartIcon",overridesResolver:function(e,t){var r=e.ownerState;return[t.startIcon,t["iconSize".concat(Lg(r.size))]]}})((function(e){var t=e.ownerState;return mf({display:"inherit",marginRight:8,marginLeft:-4},"small"===t.size&&{marginLeft:-2},qg(t))})),Hg=Cv("span",{name:"MuiButton",slot:"EndIcon",overridesResolver:function(e,t){var r=e.ownerState;return[t.endIcon,t["iconSize".concat(Lg(r.size))]]}})((function(e){var t=e.ownerState;return mf({display:"inherit",marginRight:-4,marginLeft:8},"small"===t.size&&{marginRight:-2},qg(t))})),Gg=m.forwardRef((function(e,t){var r=m.useContext(zg),n=Dv({props:kf(r,e),name:"MuiButton"}),i=n.children,o=n.color,a=void 0===o?"primary":o,s=n.component,u=void 0===s?"button":s,c=n.className,l=n.disabled,f=void 0!==l&&l,h=n.disableElevation,d=void 0!==h&&h,p=n.disableFocusRipple,v=void 0!==p&&p,g=n.endIcon,y=n.focusVisibleClassName,b=n.fullWidth,w=void 0!==b&&b,k=n.size,E=void 0===k?"medium":k,x=n.startIcon,S=n.type,_=n.variant,A=void 0===_?"text":_,I=yf(n,Zg),C=mf({},n,{color:a,component:u,disabled:f,disableElevation:d,disableFocusRipple:v,fullWidth:w,size:E,type:S,variant:A}),T=function(e){var t=e.color,r=e.disableElevation,n=e.fullWidth,i=e.size,o=e.variant,a=e.classes;return mf({},a,Ef({root:["root",o,"".concat(o).concat(Lg(t)),"size".concat(Lg(i)),"".concat(o,"Size").concat(Lg(i)),"inherit"===t&&"colorInherit",r&&"disableElevation",n&&"fullWidth"],label:["label"],startIcon:["startIcon","iconSize".concat(Lg(i))],endIcon:["endIcon","iconSize".concat(Lg(i))]},Ug,a))}(C),P=T.root,R=yf(T,jg),B=x&&(0,ag.jsx)(Vg,{className:R.startIcon,ownerState:C,children:x}),M=g&&(0,ag.jsx)(Hg,{className:R.endIcon,ownerState:C,children:g});return(0,ag.jsxs)(Kg,mf({ownerState:C,className:wf(r.className,P,c),component:u,disabled:f,focusRipple:!v,focusVisibleClassName:wf(R.focusVisible,y),ref:t,type:S},I,{classes:R,children:[B,i,M]}))})),Wg=Gg,Qg=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(t){o(t)}}function s(e){try{u(n.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},Jg=new cn("properties/5.7.0");function Yg(e,t,r){Object.defineProperty(e,t,{enumerable:!0,value:r,writable:!1})}function Xg(e,t){for(var r=0;r<32;r++){if(e[t])return e[t];if(!e.prototype||"object"!==typeof e.prototype)break;e=Object.getPrototypeOf(e.prototype).constructor}return null}function $g(e){return Qg(this,void 0,void 0,(0,k.Z)().mark((function t(){var r,n;return(0,k.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=Object.keys(e).map((function(t){var r=e[t];return Promise.resolve(r).then((function(e){return{key:t,value:e}}))})),t.next=3,Promise.all(r);case 3:return n=t.sent,t.abrupt("return",n.reduce((function(e,t){return e[t.key]=t.value,e}),{}));case 5:case"end":return t.stop()}}),t)})))}function ey(e){var t={};for(var r in e)t[r]=e[r];return t}var ty={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function ry(e){if(void 0===e||null===e||ty[typeof e])return!0;if(Array.isArray(e)||"object"===typeof e){if(!Object.isFrozen(e))return!1;for(var t=Object.keys(e),r=0;r<t.length;r++){var n=null;try{n=e[t[r]]}catch(i){continue}if(!ry(n))return!1}return!0}return Jg.throwArgumentError("Cannot deepCopy ".concat(typeof e),"object",e)}function ny(e){if(ry(e))return e;if(Array.isArray(e))return Object.freeze(e.map((function(e){return iy(e)})));if("object"===typeof e){var t={};for(var r in e){var n=e[r];void 0!==n&&Yg(t,r,iy(n))}return t}return Jg.throwArgumentError("Cannot deepCopy ".concat(typeof e),"object",e)}function iy(e){return ny(e)}var oy=(0,O.Z)((function e(t){for(var r in(0,D.Z)(this,e),t)this[r]=iy(t[r])})),ay="providers/5.7.1",sy=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(t){o(t)}}function s(e){try{u(n.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},uy=new cn("abstract-signer/5.7.0"),cy=["accessList","ccipReadEnabled","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],ly=[cn.errors.INSUFFICIENT_FUNDS,cn.errors.NONCE_EXPIRED,cn.errors.REPLACEMENT_UNDERPRICED],fy=function(){function e(){(0,D.Z)(this,e),uy.checkAbstract(this instanceof e?this.constructor:void 0,e),Yg(this,"_isSigner",!0)}return(0,O.Z)(e,[{key:"getBalance",value:function(e){return sy(this,void 0,void 0,(0,k.Z)().mark((function t(){return(0,k.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._checkProvider("getBalance"),t.next=3,this.provider.getBalance(this.getAddress(),e);case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}),t,this)})))}},{key:"getTransactionCount",value:function(e){return sy(this,void 0,void 0,(0,k.Z)().mark((function t(){return(0,k.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._checkProvider("getTransactionCount"),t.next=3,this.provider.getTransactionCount(this.getAddress(),e);case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}),t,this)})))}},{key:"estimateGas",value:function(e){return sy(this,void 0,void 0,(0,k.Z)().mark((function t(){var r;return(0,k.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._checkProvider("estimateGas"),t.next=3,$g(this.checkTransaction(e));case 3:return r=t.sent,t.next=6,this.provider.estimateGas(r);case 6:return t.abrupt("return",t.sent);case 7:case"end":return t.stop()}}),t,this)})))}},{key:"call",value:function(e,t){return sy(this,void 0,void 0,(0,k.Z)().mark((function r(){var n;return(0,k.Z)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return this._checkProvider("call"),r.next=3,$g(this.checkTransaction(e));case 3:return n=r.sent,r.next=6,this.provider.call(n,t);case 6:return r.abrupt("return",r.sent);case 7:case"end":return r.stop()}}),r,this)})))}},{key:"sendTransaction",value:function(e){return sy(this,void 0,void 0,(0,k.Z)().mark((function t(){var r,n;return(0,k.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._checkProvider("sendTransaction"),t.next=3,this.populateTransaction(e);case 3:return r=t.sent,t.next=6,this.signTransaction(r);case 6:return n=t.sent,t.next=9,this.provider.sendTransaction(n);case 9:return t.abrupt("return",t.sent);case 10:case"end":return t.stop()}}),t,this)})))}},{key:"getChainId",value:function(){return sy(this,void 0,void 0,(0,k.Z)().mark((function e(){var t;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._checkProvider("getChainId"),e.next=3,this.provider.getNetwork();case 3:return t=e.sent,e.abrupt("return",t.chainId);case 5:case"end":return e.stop()}}),e,this)})))}},{key:"getGasPrice",value:function(){return sy(this,void 0,void 0,(0,k.Z)().mark((function e(){return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._checkProvider("getGasPrice"),e.next=3,this.provider.getGasPrice();case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e,this)})))}},{key:"getFeeData",value:function(){return sy(this,void 0,void 0,(0,k.Z)().mark((function e(){return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._checkProvider("getFeeData"),e.next=3,this.provider.getFeeData();case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e,this)})))}},{key:"resolveName",value:function(e){return sy(this,void 0,void 0,(0,k.Z)().mark((function t(){return(0,k.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._checkProvider("resolveName"),t.next=3,this.provider.resolveName(e);case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}),t,this)})))}},{key:"checkTransaction",value:function(e){for(var t in e)-1===cy.indexOf(t)&&uy.throwArgumentError("invalid transaction key: "+t,"transaction",e);var r=ey(e);return null==r.from?r.from=this.getAddress():r.from=Promise.all([Promise.resolve(r.from),this.getAddress()]).then((function(t){return t[0].toLowerCase()!==t[1].toLowerCase()&&uy.throwArgumentError("from address mismatch","transaction",e),t[0]})),r}},{key:"populateTransaction",value:function(e){return sy(this,void 0,void 0,(0,k.Z)().mark((function t(){var r,n,i,o,a=this;return(0,k.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,$g(this.checkTransaction(e));case 2:if(null!=(r=t.sent).to&&(r.to=Promise.resolve(r.to).then((function(e){return sy(a,void 0,void 0,(0,k.Z)().mark((function t(){var r;return(0,k.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null!=e){t.next=2;break}return t.abrupt("return",null);case 2:return t.next=4,this.resolveName(e);case 4:return null==(r=t.sent)&&uy.throwArgumentError("provided ENS name resolves to null","tx.to",e),t.abrupt("return",r);case 7:case"end":return t.stop()}}),t,this)})))})),r.to.catch((function(e){}))),n=null!=r.maxFeePerGas||null!=r.maxPriorityFeePerGas,null==r.gasPrice||2!==r.type&&!n?0!==r.type&&1!==r.type||!n||uy.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",e):uy.throwArgumentError("eip-1559 transaction do not support gasPrice","transaction",e),2!==r.type&&null!=r.type||null==r.maxFeePerGas||null==r.maxPriorityFeePerGas){t.next=10;break}r.type=2,t.next=18;break;case 10:if(0!==r.type&&1!==r.type){t.next=14;break}null==r.gasPrice&&(r.gasPrice=this.getGasPrice()),t.next=18;break;case 14:return t.next=16,this.getFeeData();case 16:i=t.sent,null==r.type?null!=i.maxFeePerGas&&null!=i.maxPriorityFeePerGas?(r.type=2,null!=r.gasPrice?(o=r.gasPrice,delete r.gasPrice,r.maxFeePerGas=o,r.maxPriorityFeePerGas=o):(null==r.maxFeePerGas&&(r.maxFeePerGas=i.maxFeePerGas),null==r.maxPriorityFeePerGas&&(r.maxPriorityFeePerGas=i.maxPriorityFeePerGas))):null!=i.gasPrice?(n&&uy.throwError("network does not support EIP-1559",cn.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),null==r.gasPrice&&(r.gasPrice=i.gasPrice),r.type=0):uy.throwError("failed to get consistent fee data",cn.errors.UNSUPPORTED_OPERATION,{operation:"signer.getFeeData"}):2===r.type&&(null==r.maxFeePerGas&&(r.maxFeePerGas=i.maxFeePerGas),null==r.maxPriorityFeePerGas&&(r.maxPriorityFeePerGas=i.maxPriorityFeePerGas));case 18:return null==r.nonce&&(r.nonce=this.getTransactionCount("pending")),null==r.gasLimit&&(r.gasLimit=this.estimateGas(r).catch((function(e){if(ly.indexOf(e.code)>=0)throw e;return uy.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",cn.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,tx:r})}))),null==r.chainId?r.chainId=this.getChainId():r.chainId=Promise.all([Promise.resolve(r.chainId),this.getChainId()]).then((function(t){return 0!==t[1]&&t[0]!==t[1]&&uy.throwArgumentError("chainId address mismatch","transaction",e),t[0]})),t.next=23,$g(r);case 23:return t.abrupt("return",t.sent);case 24:case"end":return t.stop()}}),t,this)})))}},{key:"_checkProvider",value:function(e){this.provider||uy.throwError("missing provider",cn.errors.UNSUPPORTED_OPERATION,{operation:e||"_checkProvider"})}}],[{key:"isSigner",value:function(e){return!(!e||!e._isSigner)}}]),e}(),hy=__webpack_require__(9867),dy=__webpack_require__.n(hy),py=dy().BN,vy=new cn("bignumber/5.7.0"),gy={},yy=9007199254740991;var my=!1,by=function(){function e(t,r){(0,D.Z)(this,e),t!==gy&&vy.throwError("cannot call constructor directly; use BigNumber.from",cn.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=r,this._isBigNumber=!0,Object.freeze(this)}return(0,O.Z)(e,[{key:"fromTwos",value:function(e){return ky(Ey(this).fromTwos(e))}},{key:"toTwos",value:function(e){return ky(Ey(this).toTwos(e))}},{key:"abs",value:function(){return"-"===this._hex[0]?e.from(this._hex.substring(1)):this}},{key:"add",value:function(e){return ky(Ey(this).add(Ey(e)))}},{key:"sub",value:function(e){return ky(Ey(this).sub(Ey(e)))}},{key:"div",value:function(t){return e.from(t).isZero()&&xy("division-by-zero","div"),ky(Ey(this).div(Ey(t)))}},{key:"mul",value:function(e){return ky(Ey(this).mul(Ey(e)))}},{key:"mod",value:function(e){var t=Ey(e);return t.isNeg()&&xy("division-by-zero","mod"),ky(Ey(this).umod(t))}},{key:"pow",value:function(e){var t=Ey(e);return t.isNeg()&&xy("negative-power","pow"),ky(Ey(this).pow(t))}},{key:"and",value:function(e){var t=Ey(e);return(this.isNegative()||t.isNeg())&&xy("unbound-bitwise-result","and"),ky(Ey(this).and(t))}},{key:"or",value:function(e){var t=Ey(e);return(this.isNegative()||t.isNeg())&&xy("unbound-bitwise-result","or"),ky(Ey(this).or(t))}},{key:"xor",value:function(e){var t=Ey(e);return(this.isNegative()||t.isNeg())&&xy("unbound-bitwise-result","xor"),ky(Ey(this).xor(t))}},{key:"mask",value:function(e){return(this.isNegative()||e<0)&&xy("negative-width","mask"),ky(Ey(this).maskn(e))}},{key:"shl",value:function(e){return(this.isNegative()||e<0)&&xy("negative-width","shl"),ky(Ey(this).shln(e))}},{key:"shr",value:function(e){return(this.isNegative()||e<0)&&xy("negative-width","shr"),ky(Ey(this).shrn(e))}},{key:"eq",value:function(e){return Ey(this).eq(Ey(e))}},{key:"lt",value:function(e){return Ey(this).lt(Ey(e))}},{key:"lte",value:function(e){return Ey(this).lte(Ey(e))}},{key:"gt",value:function(e){return Ey(this).gt(Ey(e))}},{key:"gte",value:function(e){return Ey(this).gte(Ey(e))}},{key:"isNegative",value:function(){return"-"===this._hex[0]}},{key:"isZero",value:function(){return Ey(this).isZero()}},{key:"toNumber",value:function(){try{return Ey(this).toNumber()}catch(e){xy("overflow","toNumber",this.toString())}return null}},{key:"toBigInt",value:function(){try{return BigInt(this.toString())}catch(e){}return vy.throwError("this platform does not support BigInt",cn.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}},{key:"toString",value:function(){return arguments.length>0&&(10===arguments[0]?my||(my=!0,vy.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?vy.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",cn.errors.UNEXPECTED_ARGUMENT,{}):vy.throwError("BigNumber.toString does not accept parameters",cn.errors.UNEXPECTED_ARGUMENT,{})),Ey(this).toString(10)}},{key:"toHexString",value:function(){return this._hex}},{key:"toJSON",value:function(e){return{type:"BigNumber",hex:this.toHexString()}}}],[{key:"from",value:function(t){if(t instanceof e)return t;if("string"===typeof t)return t.match(/^-?0x[0-9a-f]+$/i)?new e(gy,wy(t)):t.match(/^-?[0-9]+$/)?new e(gy,wy(new py(t))):vy.throwArgumentError("invalid BigNumber string","value",t);if("number"===typeof t)return t%1&&xy("underflow","BigNumber.from",t),(t>=yy||t<=-yy)&&xy("overflow","BigNumber.from",t),e.from(String(t));var r=t;if("bigint"===typeof r)return e.from(r.toString());if(vn(r))return e.from(kn(r));if(r)if(r.toHexString){var n=r.toHexString();if("string"===typeof n)return e.from(n)}else{var i=r._hex;if(null==i&&"BigNumber"===r.type&&(i=r.hex),"string"===typeof i&&(bn(i)||"-"===i[0]&&bn(i.substring(1))))return e.from(i)}return vy.throwArgumentError("invalid BigNumber value","value",t)}},{key:"isBigNumber",value:function(e){return!(!e||!e._isBigNumber)}}]),e}();function wy(e){if("string"!==typeof e)return wy(e.toString(16));if("-"===e[0])return"-"===(e=e.substring(1))[0]&&vy.throwArgumentError("invalid hex","value",e),"0x00"===(e=wy(e))?e:"-"+e;if("0x"!==e.substring(0,2)&&(e="0x"+e),"0x"===e)return"0x00";for(e.length%2&&(e="0x0"+e.substring(2));e.length>4&&"0x00"===e.substring(0,4);)e="0x"+e.substring(4);return e}function ky(e){return by.from(wy(e))}function Ey(e){var t=by.from(e).toHexString();return"-"===t[0]?new py("-"+t.substring(3),16):new py(t.substring(2),16)}function xy(e,t,r){var n={fault:e,operation:t};return null!=r&&(n.value=r),vy.throwError(e,cn.errors.NUMERIC_FAULT,n)}function Sy(e){return"0x"+Xe().keccak_256(gn(e))}var _y=new cn("address/5.7.0");function Ay(e){bn(e,20)||_y.throwArgumentError("invalid address","address",e);for(var t=(e=e.toLowerCase()).substring(2).split(""),r=new Uint8Array(40),n=0;n<40;n++)r[n]=t[n].charCodeAt(0);for(var i=gn(Sy(r)),o=0;o<40;o+=2)i[o>>1]>>4>=8&&(t[o]=t[o].toUpperCase()),(15&i[o>>1])>=8&&(t[o+1]=t[o+1].toUpperCase());return"0x"+t.join("")}for(var Iy={},Cy=0;Cy<10;Cy++)Iy[String(Cy)]=String(Cy);for(var Ty=0;Ty<26;Ty++)Iy[String.fromCharCode(65+Ty)]=String(10+Ty);var Py,Ry=Math.floor((Py=9007199254740991,Math.log10?Math.log10(Py):Math.log(Py)/Math.LN10));function By(e){for(var t=(e=(e=e.toUpperCase()).substring(4)+e.substring(0,2)+"00").split("").map((function(e){return Iy[e]})).join("");t.length>=Ry;){var r=t.substring(0,Ry);t=parseInt(r,10)%97+t.substring(r.length)}for(var n=String(98-parseInt(t,10)%97);n.length<2;)n="0"+n;return n}function My(e){var t,r=null;if("string"!==typeof e&&_y.throwArgumentError("invalid address","address",e),e.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==e.substring(0,2)&&(e="0x"+e),r=Ay(e),e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&r!==e&&_y.throwArgumentError("bad address checksum","address",e);else if(e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(e.substring(2,4)!==By(e)&&_y.throwArgumentError("bad icap checksum","address",e),t=e.substring(4),r=new py(t,36).toString(16);r.length<40;)r="0"+r;r=Ay("0x"+r)}else _y.throwArgumentError("invalid address","address",e);return r}var Ny,Oy,Dy="hash/5.7.0",Ly=new cn("strings/5.7.0");function Uy(e,t,r,n,i){if(e===Oy.BAD_PREFIX||e===Oy.UNEXPECTED_CONTINUE){for(var o=0,a=t+1;a<r.length&&r[a]>>6===2;a++)o++;return o}return e===Oy.OVERRUN?r.length-t-1:0}!function(e){e.current="",e.NFC="NFC",e.NFD="NFD",e.NFKC="NFKC",e.NFKD="NFKD"}(Ny||(Ny={})),function(e){e.UNEXPECTED_CONTINUE="unexpected continuation byte",e.BAD_PREFIX="bad codepoint prefix",e.OVERRUN="string overrun",e.MISSING_CONTINUE="missing continuation byte",e.OUT_OF_RANGE="out of UTF-8 range",e.UTF16_SURROGATE="UTF-16 surrogate",e.OVERLONG="overlong representation"}(Oy||(Oy={}));var Fy=Object.freeze({error:function(e,t,r,n,i){return Ly.throwArgumentError("invalid codepoint at offset ".concat(t,"; ").concat(e),"bytes",r)},ignore:Uy,replace:function(e,t,r,n,i){return e===Oy.OVERLONG?(n.push(i),0):(n.push(65533),Uy(e,t,r))}});function zy(e,t){null==t&&(t=Fy.error),e=gn(e);for(var r=[],n=0;n<e.length;){var i=e[n++];if(i>>7!==0){var o=null,a=null;if(192===(224&i))o=1,a=127;else if(224===(240&i))o=2,a=2047;else{if(240!==(248&i)){n+=t(128===(192&i)?Oy.UNEXPECTED_CONTINUE:Oy.BAD_PREFIX,n-1,e,r);continue}o=3,a=65535}if(n-1+o>=e.length)n+=t(Oy.OVERRUN,n-1,e,r);else{for(var s=i&(1<<8-o-1)-1,u=0;u<o;u++){var c=e[n];if(128!=(192&c)){n+=t(Oy.MISSING_CONTINUE,n,e,r),s=null;break}s=s<<6|63&c,n++}null!==s&&(s>1114111?n+=t(Oy.OUT_OF_RANGE,n-1-o,e,r,s):s>=55296&&s<=57343?n+=t(Oy.UTF16_SURROGATE,n-1-o,e,r,s):s<=a?n+=t(Oy.OVERLONG,n-1-o,e,r,s):r.push(s))}}else r.push(i)}return r}function Zy(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ny.current;t!=Ny.current&&(Ly.checkNormalize(),e=e.normalize(t));for(var r=[],n=0;n<e.length;n++){var i=e.charCodeAt(n);if(i<128)r.push(i);else if(i<2048)r.push(i>>6|192),r.push(63&i|128);else if(55296==(64512&i)){n++;var o=e.charCodeAt(n);if(n>=e.length||56320!==(64512&o))throw new Error("invalid utf-8 string");var a=65536+((1023&i)<<10)+(1023&o);r.push(a>>18|240),r.push(a>>12&63|128),r.push(a>>6&63|128),r.push(63&a|128)}else r.push(i>>12|224),r.push(i>>6&63|128),r.push(63&i|128)}return gn(r)}function jy(e,t){return zy(e,t).map((function(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10&1023),56320+(1023&e)))})).join("")}function qy(e){return Sy(Zy(e))}var Ky=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(t){o(t)}}function s(e){try{u(n.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},Vy=new cn(Dy),Hy=new Uint8Array(32);Hy.fill(0);var Gy=by.from(-1),Wy=by.from(0),Qy=by.from(1),Jy=by.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");var Yy=An(Qy.toHexString(),32),Xy=An(Wy.toHexString(),32),$y={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},em=["name","version","chainId","verifyingContract","salt"];function tm(e){return function(t){return"string"!==typeof t&&Vy.throwArgumentError("invalid domain value for ".concat(JSON.stringify(e)),"domain.".concat(e),t),t}}var rm={name:tm("name"),version:tm("version"),chainId:function(e){try{return by.from(e).toString()}catch(t){}return Vy.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",e)},verifyingContract:function(e){try{return My(e).toLowerCase()}catch(t){}return Vy.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",e)},salt:function(e){try{var t=gn(e);if(32!==t.length)throw new Error("bad length");return kn(t)}catch(r){}return Vy.throwArgumentError('invalid domain value "salt"',"domain.salt",e)}};function nm(e){var t=e.match(/^(u?)int(\d*)$/);if(t){var r=""===t[1],n=parseInt(t[2]||"256");(n%8!==0||n>256||t[2]&&t[2]!==String(n))&&Vy.throwArgumentError("invalid numeric width","type",e);var i=Jy.mask(r?n-1:n),o=r?i.add(Qy).mul(Gy):Wy;return function(t){var r=by.from(t);return(r.lt(o)||r.gt(i))&&Vy.throwArgumentError("value out-of-bounds for ".concat(e),"value",t),An(r.toTwos(256).toHexString(),32)}}var a=e.match(/^bytes(\d+)$/);if(a){var s=parseInt(a[1]);return(0===s||s>32||a[1]!==String(s))&&Vy.throwArgumentError("invalid bytes width","type",e),function(t){return gn(t).length!==s&&Vy.throwArgumentError("invalid length for ".concat(e),"value",t),function(e){var t=gn(e),r=t.length%32;return r?Sn([t,Hy.slice(r)]):kn(t)}(t)}}switch(e){case"address":return function(e){return An(My(e),32)};case"bool":return function(e){return e?Yy:Xy};case"bytes":return function(e){return Sy(e)};case"string":return function(e){return qy(e)}}return null}function im(e,t){return"".concat(e,"(").concat(t.map((function(e){var t=e.name;return e.type+" "+t})).join(","),")")}var om=function(){function e(t){(0,D.Z)(this,e),Yg(this,"types",Object.freeze(iy(t))),Yg(this,"_encoderCache",{}),Yg(this,"_types",{});var r={},n={},i={};Object.keys(t).forEach((function(e){r[e]={},n[e]=[],i[e]={}}));var o=function(e){var i={};t[e].forEach((function(o){i[o.name]&&Vy.throwArgumentError("duplicate variable name ".concat(JSON.stringify(o.name)," in ").concat(JSON.stringify(e)),"types",t),i[o.name]=!0;var a=o.type.match(/^([^\x5b]*)(\x5b|$)/)[1];a===e&&Vy.throwArgumentError("circular type reference to ".concat(JSON.stringify(a)),"types",t),nm(a)||(n[a]||Vy.throwArgumentError("unknown type ".concat(JSON.stringify(a)),"types",t),n[a].push(e),r[e][a]=!0)}))};for(var a in t)o(a);var s=Object.keys(n).filter((function(e){return 0===n[e].length}));for(var u in 0===s.length?Vy.throwArgumentError("missing primary type","types",t):s.length>1&&Vy.throwArgumentError("ambiguous primary types or unused types: ".concat(s.map((function(e){return JSON.stringify(e)})).join(", ")),"types",t),Yg(this,"primaryType",s[0]),function e(o,a){a[o]&&Vy.throwArgumentError("circular type reference to ".concat(JSON.stringify(o)),"types",t),a[o]=!0,Object.keys(r[o]).forEach((function(t){n[t]&&(e(t,a),Object.keys(a).forEach((function(e){i[e][t]=!0})))})),delete a[o]}(this.primaryType,{}),i){var c=Object.keys(i[u]);c.sort(),this._types[u]=im(u,t[u])+c.map((function(e){return im(e,t[e])})).join("")}}return(0,O.Z)(e,[{key:"getEncoder",value:function(e){var t=this._encoderCache[e];return t||(t=this._encoderCache[e]=this._getEncoder(e)),t}},{key:"_getEncoder",value:function(e){var t=this,r=nm(e);if(r)return r;var n=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(n){var i=n[1],o=this.getEncoder(i),a=parseInt(n[3]);return function(e){a>=0&&e.length!==a&&Vy.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",e);var r=e.map(o);return t._types[i]&&(r=r.map(Sy)),Sy(Sn(r))}}var s=this.types[e];if(s){var u=qy(this._types[e]);return function(e){var r=s.map((function(r){var n=r.name,i=r.type,o=t.getEncoder(i)(e[n]);return t._types[i]?Sy(o):o}));return r.unshift(u),Sn(r)}}return Vy.throwArgumentError("unknown type: ".concat(e),"type",e)}},{key:"encodeType",value:function(e){var t=this._types[e];return t||Vy.throwArgumentError("unknown type: ".concat(JSON.stringify(e)),"name",e),t}},{key:"encodeData",value:function(e,t){return this.getEncoder(e)(t)}},{key:"hashStruct",value:function(e,t){return Sy(this.encodeData(e,t))}},{key:"encode",value:function(e){return this.encodeData(this.primaryType,e)}},{key:"hash",value:function(e){return this.hashStruct(this.primaryType,e)}},{key:"_visit",value:function(e,t,r){var n=this;if(nm(e))return r(e,t);var i=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(i){var o=i[1],a=parseInt(i[3]);return a>=0&&t.length!==a&&Vy.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",t),t.map((function(e){return n._visit(o,e,r)}))}var s=this.types[e];return s?s.reduce((function(e,i){var o=i.name,a=i.type;return e[o]=n._visit(a,t[o],r),e}),{}):Vy.throwArgumentError("unknown type: ".concat(e),"type",e)}},{key:"visit",value:function(e,t){return this._visit(this.primaryType,e,t)}}],[{key:"from",value:function(t){return new e(t)}},{key:"getPrimaryType",value:function(t){return e.from(t).primaryType}},{key:"hashStruct",value:function(t,r,n){return e.from(r).hashStruct(t,n)}},{key:"hashDomain",value:function(t){var r=[];for(var n in t){var i=$y[n];i||Vy.throwArgumentError("invalid typed-data domain key: ".concat(JSON.stringify(n)),"domain",t),r.push({name:n,type:i})}return r.sort((function(e,t){return em.indexOf(e.name)-em.indexOf(t.name)})),e.hashStruct("EIP712Domain",{EIP712Domain:r},t)}},{key:"encode",value:function(t,r,n){return Sn(["0x1901",e.hashDomain(t),e.from(r).hash(n)])}},{key:"hash",value:function(t,r,n){return Sy(e.encode(t,r,n))}},{key:"resolveNames",value:function(t,r,n,i){return Ky(this,void 0,void 0,(0,k.Z)().mark((function o(){var a,s,u;return(0,k.Z)().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:t=ey(t),a={},t.verifyingContract&&!bn(t.verifyingContract,20)&&(a[t.verifyingContract]="0x"),(s=e.from(r)).visit(n,(function(e,t){return"address"!==e||bn(t,20)||(a[t]="0x"),t})),o.t0=(0,k.Z)().keys(a);case 6:if((o.t1=o.t0()).done){o.next=13;break}return u=o.t1.value,o.next=10,i(u);case 10:a[u]=o.sent,o.next=6;break;case 13:return t.verifyingContract&&a[t.verifyingContract]&&(t.verifyingContract=a[t.verifyingContract]),n=s.visit(n,(function(e,t){return"address"===e&&a[t]?a[t]:t})),o.abrupt("return",{domain:t,value:n});case 16:case"end":return o.stop()}}),o)})))}},{key:"getPayload",value:function(t,r,n){e.hashDomain(t);var i={},o=[];em.forEach((function(e){var r=t[e];null!=r&&(i[e]=rm[e](r),o.push({name:e,type:$y[e]}))}));var a=e.from(r),s=ey(r);return s.EIP712Domain?Vy.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",r):s.EIP712Domain=o,a.encode(n),{types:s,domain:i,primaryType:a.primaryType,message:a.visit(n,(function(e,t){if(e.match(/^bytes(\d*)/))return kn(gn(t));if(e.match(/^u?int/))return by.from(t).toString();switch(e){case"address":return t.toLowerCase();case"bool":return!!t;case"string":return"string"!==typeof t&&Vy.throwArgumentError("invalid string","value",t),t}return Vy.throwArgumentError("unsupported type","type",e)}))}}}]),e}(),am=by.from(0),sm=__webpack_require__(7185),um=__webpack_require__.n(sm);"undefined"!==typeof globalThis?globalThis:"undefined"!==typeof window?window:"undefined"!==typeof __webpack_require__.g?__webpack_require__.g:"undefined"!==typeof self&&self;function cm(e,t,r){return r={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}((void 0===t||null===t)&&r.path)}},e(r,r.exports),r.exports}var lm=fm;function fm(e,t){if(!e)throw new Error(t||"Assertion failed")}fm.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)};var hm=cm((function(e,t){var r=t;function n(e){return 1===e.length?"0"+e:e}function i(e){for(var t="",r=0;r<e.length;r++)t+=n(e[r].toString(16));return t}r.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"!==typeof e){for(var n=0;n<e.length;n++)r[n]=0|e[n];return r}if("hex"===t){(e=e.replace(/[^a-z0-9]+/gi,"")).length%2!==0&&(e="0"+e);for(n=0;n<e.length;n+=2)r.push(parseInt(e[n]+e[n+1],16))}else for(n=0;n<e.length;n++){var i=e.charCodeAt(n),o=i>>8,a=255&i;o?r.push(o,a):r.push(a)}return r},r.zero2=n,r.toHex=i,r.encode=function(e,t){return"hex"===t?i(e):e}})),dm=cm((function(e,t){var r=t;r.assert=lm,r.toArray=hm.toArray,r.zero2=hm.zero2,r.toHex=hm.toHex,r.encode=hm.encode,r.getNAF=function(e,t,r){var n=new Array(Math.max(e.bitLength(),r)+1);n.fill(0);for(var i=1<<t+1,o=e.clone(),a=0;a<n.length;a++){var s,u=o.andln(i-1);o.isOdd()?(s=u>(i>>1)-1?(i>>1)-u:u,o.isubn(s)):s=0,n[a]=s,o.iushrn(1)}return n},r.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var n,i=0,o=0;e.cmpn(-i)>0||t.cmpn(-o)>0;){var a,s,u=e.andln(3)+i&3,c=t.andln(3)+o&3;3===u&&(u=-1),3===c&&(c=-1),a=0===(1&u)?0:3!==(n=e.andln(7)+i&7)&&5!==n||2!==c?u:-u,r[0].push(a),s=0===(1&c)?0:3!==(n=t.andln(7)+o&7)&&5!==n||2!==u?c:-c,r[1].push(s),2*i===a+1&&(i=1-i),2*o===s+1&&(o=1-o),e.iushrn(1),t.iushrn(1)}return r},r.cachedProperty=function(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},r.parseBytes=function(e){return"string"===typeof e?r.toArray(e,"hex"):e},r.intFromLE=function(e){return new(dy())(e,"hex","le")}})),pm=dm.getNAF,vm=dm.getJSF,gm=dm.assert;function ym(e,t){this.type=e,this.p=new(dy())(t.p,16),this.red=t.prime?dy().red(t.prime):dy().mont(this.p),this.zero=new(dy())(0).toRed(this.red),this.one=new(dy())(1).toRed(this.red),this.two=new(dy())(2).toRed(this.red),this.n=t.n&&new(dy())(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var mm=ym;function bm(e,t){this.curve=e,this.type=t,this.precomputed=null}ym.prototype.point=function(){throw new Error("Not implemented")},ym.prototype.validate=function(){throw new Error("Not implemented")},ym.prototype._fixedNafMul=function(e,t){gm(e.precomputed);var r=e._getDoubles(),n=pm(t,1,this._bitLength),i=(1<<r.step+1)-(r.step%2===0?2:1);i/=3;var o,a,s=[];for(o=0;o<n.length;o+=r.step){a=0;for(var u=o+r.step-1;u>=o;u--)a=(a<<1)+n[u];s.push(a)}for(var c=this.jpoint(null,null,null),l=this.jpoint(null,null,null),f=i;f>0;f--){for(o=0;o<s.length;o++)(a=s[o])===f?l=l.mixedAdd(r.points[o]):a===-f&&(l=l.mixedAdd(r.points[o].neg()));c=c.add(l)}return c.toP()},ym.prototype._wnafMul=function(e,t){var r=4,n=e._getNAFPoints(r);r=n.wnd;for(var i=n.points,o=pm(t,r,this._bitLength),a=this.jpoint(null,null,null),s=o.length-1;s>=0;s--){for(var u=0;s>=0&&0===o[s];s--)u++;if(s>=0&&u++,a=a.dblp(u),s<0)break;var c=o[s];gm(0!==c),a="affine"===e.type?c>0?a.mixedAdd(i[c-1>>1]):a.mixedAdd(i[-c-1>>1].neg()):c>0?a.add(i[c-1>>1]):a.add(i[-c-1>>1].neg())}return"affine"===e.type?a.toP():a},ym.prototype._wnafMulAdd=function(e,t,r,n,i){var o,a,s,u=this._wnafT1,c=this._wnafT2,l=this._wnafT3,f=0;for(o=0;o<n;o++){var h=(s=t[o])._getNAFPoints(e);u[o]=h.wnd,c[o]=h.points}for(o=n-1;o>=1;o-=2){var d=o-1,p=o;if(1===u[d]&&1===u[p]){var v=[t[d],null,null,t[p]];0===t[d].y.cmp(t[p].y)?(v[1]=t[d].add(t[p]),v[2]=t[d].toJ().mixedAdd(t[p].neg())):0===t[d].y.cmp(t[p].y.redNeg())?(v[1]=t[d].toJ().mixedAdd(t[p]),v[2]=t[d].add(t[p].neg())):(v[1]=t[d].toJ().mixedAdd(t[p]),v[2]=t[d].toJ().mixedAdd(t[p].neg()));var g=[-3,-1,-5,-7,0,7,5,1,3],y=vm(r[d],r[p]);for(f=Math.max(y[0].length,f),l[d]=new Array(f),l[p]=new Array(f),a=0;a<f;a++){var m=0|y[0][a],b=0|y[1][a];l[d][a]=g[3*(m+1)+(b+1)],l[p][a]=0,c[d]=v}}else l[d]=pm(r[d],u[d],this._bitLength),l[p]=pm(r[p],u[p],this._bitLength),f=Math.max(l[d].length,f),f=Math.max(l[p].length,f)}var w=this.jpoint(null,null,null),k=this._wnafT4;for(o=f;o>=0;o--){for(var E=0;o>=0;){var x=!0;for(a=0;a<n;a++)k[a]=0|l[a][o],0!==k[a]&&(x=!1);if(!x)break;E++,o--}if(o>=0&&E++,w=w.dblp(E),o<0)break;for(a=0;a<n;a++){var S=k[a];0!==S&&(S>0?s=c[a][S-1>>1]:S<0&&(s=c[a][-S-1>>1].neg()),w="affine"===s.type?w.mixedAdd(s):w.add(s))}}for(o=0;o<n;o++)c[o]=null;return i?w:w.toP()},ym.BasePoint=bm,bm.prototype.eq=function(){throw new Error("Not implemented")},bm.prototype.validate=function(){return this.curve.validate(this)},ym.prototype.decodePoint=function(e,t){e=dm.toArray(e,t);var r=this.p.byteLength();if((4===e[0]||6===e[0]||7===e[0])&&e.length-1===2*r)return 6===e[0]?gm(e[e.length-1]%2===0):7===e[0]&&gm(e[e.length-1]%2===1),this.point(e.slice(1,1+r),e.slice(1+r,1+2*r));if((2===e[0]||3===e[0])&&e.length-1===r)return this.pointFromX(e.slice(1,1+r),3===e[0]);throw new Error("Unknown point format")},bm.prototype.encodeCompressed=function(e){return this.encode(e,!0)},bm.prototype._encode=function(e){var t=this.curve.p.byteLength(),r=this.getX().toArray("be",t);return e?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",t))},bm.prototype.encode=function(e,t){return dm.encode(this._encode(t),e)},bm.prototype.precompute=function(e){if(this.precomputed)return this;var t={doubles:null,naf:null,beta:null};return t.naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,e),t.beta=this._getBeta(),this.precomputed=t,this},bm.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var t=this.precomputed.doubles;return!!t&&t.points.length>=Math.ceil((e.bitLength()+1)/t.step)},bm.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i<t;i+=e){for(var o=0;o<e;o++)n=n.dbl();r.push(n)}return{step:e,points:r}},bm.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],r=(1<<e)-1,n=1===r?null:this.dbl(),i=1;i<r;i++)t[i]=t[i-1].add(n);return{wnd:e,points:t}},bm.prototype._getBeta=function(){return null},bm.prototype.dblp=function(e){for(var t=this,r=0;r<e;r++)t=t.dbl();return t};var wm=cm((function(e){"function"===typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}})),km=dm.assert;function Em(e){mm.call(this,"short",e),this.a=new(dy())(e.a,16).toRed(this.red),this.b=new(dy())(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=new Array(4),this._endoWnafT2=new Array(4)}wm(Em,mm);var xm=Em;function Sm(e,t,r,n){mm.BasePoint.call(this,e,"affine"),null===t&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new(dy())(t,16),this.y=new(dy())(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 _m(e,t,r,n){mm.BasePoint.call(this,e,"jacobian"),null===t&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new(dy())(0)):(this.x=new(dy())(t,16),this.y=new(dy())(r,16),this.z=new(dy())(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}Em.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new(dy())(e.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);t=(t=n[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red)}if(e.lambda)r=new(dy())(e.lambda,16);else{var i=this._getEndoRoots(this.n);0===this.g.mul(i[0]).x.cmp(this.g.x.redMul(t))?r=i[0]:(r=i[1],km(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map((function(e){return{a:new(dy())(e.a,16),b:new(dy())(e.b,16)}})):this._getEndoBasis(r)}}},Em.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:dy().mont(e),r=new(dy())(2).toRed(t).redInvm(),n=r.redNeg(),i=new(dy())(3).toRed(t).redNeg().redSqrt().redMul(r);return[n.redAdd(i).fromRed(),n.redSub(i).fromRed()]},Em.prototype._getEndoBasis=function(e){for(var t,r,n,i,o,a,s,u,c,l=this.n.ushrn(Math.floor(this.n.bitLength()/2)),f=e,h=this.n.clone(),d=new(dy())(1),p=new(dy())(0),v=new(dy())(0),g=new(dy())(1),y=0;0!==f.cmpn(0);){var m=h.div(f);u=h.sub(m.mul(f)),c=v.sub(m.mul(d));var b=g.sub(m.mul(p));if(!n&&u.cmp(l)<0)t=s.neg(),r=d,n=u.neg(),i=c;else if(n&&2===++y)break;s=u,h=f,f=u,v=d,d=c,g=p,p=b}o=u.neg(),a=c;var w=n.sqr().add(i.sqr());return o.sqr().add(a.sqr()).cmp(w)>=0&&(o=t,a=r),n.negative&&(n=n.neg(),i=i.neg()),o.negative&&(o=o.neg(),a=a.neg()),[{a:n,b:i},{a:o,b:a}]},Em.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],i=n.b.mul(e).divRound(this.n),o=r.b.neg().mul(e).divRound(this.n),a=i.mul(r.a),s=o.mul(n.a),u=i.mul(r.b),c=o.mul(n.b);return{k1:e.sub(a).sub(s),k2:u.add(c).neg()}},Em.prototype.pointFromX=function(e,t){(e=new(dy())(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 new Error("invalid point");var i=n.fromRed().isOdd();return(t&&!i||!t&&i)&&(n=n.redNeg()),this.point(e,n)},Em.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},Em.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o<e.length;o++){var a=this._endoSplit(t[o]),s=e[o],u=s._getBeta();a.k1.negative&&(a.k1.ineg(),s=s.neg(!0)),a.k2.negative&&(a.k2.ineg(),u=u.neg(!0)),n[2*o]=s,n[2*o+1]=u,i[2*o]=a.k1,i[2*o+1]=a.k2}for(var c=this._wnafMulAdd(1,n,i,2*o,r),l=0;l<2*o;l++)n[l]=null,i[l]=null;return c},wm(Sm,mm.BasePoint),Em.prototype.point=function(e,t,r){return new Sm(this,e,t,r)},Em.prototype.pointFromJSON=function(e,t){return Sm.fromJSON(this,e,t)},Sm.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var r=this.curve,n=function(e){return r.point(e.x.redMul(r.endo.beta),e.y)};e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(n)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(n)}}}return t}},Sm.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},Sm.fromJSON=function(e,t,r){"string"===typeof t&&(t=JSON.parse(t));var n=e.point(t[0],t[1],r);if(!t[2])return n;function i(t){return e.point(t[0],t[1],r)}var o=t[2];return n.precomputed={beta:null,doubles:o.doubles&&{step:o.doubles.step,points:[n].concat(o.doubles.points.map(i))},naf:o.naf&&{wnd:o.naf.wnd,points:[n].concat(o.naf.points.map(i))}},n},Sm.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},Sm.prototype.isInfinity=function(){return this.inf},Sm.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(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),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},Sm.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(),n=e.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),a=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)},Sm.prototype.getX=function(){return this.x.fromRed()},Sm.prototype.getY=function(){return this.y.fromRed()},Sm.prototype.mul=function(e){return e=new(dy())(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)},Sm.prototype.mulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},Sm.prototype.jmulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},Sm.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))},Sm.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,n=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return t},Sm.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},wm(_m,mm.BasePoint),Em.prototype.jpoint=function(e,t,r){return new _m(this,e,t,r)},_m.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),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)},_m.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},_m.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),i=e.x.redMul(r),o=this.y.redMul(t.redMul(e.z)),a=e.y.redMul(r.redMul(this.z)),s=n.redSub(i),u=o.redSub(a);if(0===s.cmpn(0))return 0!==u.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=s.redSqr(),l=c.redMul(s),f=n.redMul(c),h=u.redSqr().redIAdd(l).redISub(f).redISub(f),d=u.redMul(f.redISub(h)).redISub(o.redMul(l)),p=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(h,d,p)},_m.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),i=this.y,o=e.y.redMul(t).redMul(this.z),a=r.redSub(n),s=i.redSub(o);if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),c=u.redMul(a),l=r.redMul(u),f=s.redSqr().redIAdd(c).redISub(l).redISub(l),h=s.redMul(l.redISub(f)).redISub(i.redMul(c)),d=this.z.redMul(a);return this.curve.jpoint(f,h,d)},_m.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var r=this;for(t=0;t<e;t++)r=r.dbl();return r}var n=this.curve.a,i=this.curve.tinv,o=this.x,a=this.y,s=this.z,u=s.redSqr().redSqr(),c=a.redAdd(a);for(t=0;t<e;t++){var l=o.redSqr(),f=c.redSqr(),h=f.redSqr(),d=l.redAdd(l).redIAdd(l).redIAdd(n.redMul(u)),p=o.redMul(f),v=d.redSqr().redISub(p.redAdd(p)),g=p.redISub(v),y=d.redMul(g);y=y.redIAdd(y).redISub(h);var m=c.redMul(s);t+1<e&&(u=u.redMul(h)),o=v,s=m,c=y}return this.curve.jpoint(o,c.redMul(i),s)},_m.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},_m.prototype._zeroDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),a=this.x.redAdd(i).redSqr().redISub(n).redISub(o);a=a.redIAdd(a);var s=n.redAdd(n).redIAdd(n),u=s.redSqr().redISub(a).redISub(a),c=o.redIAdd(o);c=(c=c.redIAdd(c)).redIAdd(c),e=u,t=s.redMul(a.redISub(u)).redISub(c),r=this.y.redAdd(this.y)}else{var l=this.x.redSqr(),f=this.y.redSqr(),h=f.redSqr(),d=this.x.redAdd(f).redSqr().redISub(l).redISub(h);d=d.redIAdd(d);var p=l.redAdd(l).redIAdd(l),v=p.redSqr(),g=h.redIAdd(h);g=(g=g.redIAdd(g)).redIAdd(g),e=v.redISub(d).redISub(d),t=p.redMul(d.redISub(e)).redISub(g),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(e,t,r)},_m.prototype._threeDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),a=this.x.redAdd(i).redSqr().redISub(n).redISub(o);a=a.redIAdd(a);var s=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),u=s.redSqr().redISub(a).redISub(a);e=u;var c=o.redIAdd(o);c=(c=c.redIAdd(c)).redIAdd(c),t=s.redMul(a.redISub(u)).redISub(c),r=this.y.redAdd(this.y)}else{var l=this.z.redSqr(),f=this.y.redSqr(),h=this.x.redMul(f),d=this.x.redSub(l).redMul(this.x.redAdd(l));d=d.redAdd(d).redIAdd(d);var p=h.redIAdd(h),v=(p=p.redIAdd(p)).redAdd(p);e=d.redSqr().redISub(v),r=this.y.redAdd(this.z).redSqr().redISub(f).redISub(l);var g=f.redSqr();g=(g=(g=g.redIAdd(g)).redIAdd(g)).redIAdd(g),t=d.redMul(p.redISub(e)).redISub(g)}return this.curve.jpoint(e,t,r)},_m.prototype._dbl=function(){var e=this.curve.a,t=this.x,r=this.y,n=this.z,i=n.redSqr().redSqr(),o=t.redSqr(),a=r.redSqr(),s=o.redAdd(o).redIAdd(o).redIAdd(e.redMul(i)),u=t.redAdd(t),c=(u=u.redIAdd(u)).redMul(a),l=s.redSqr().redISub(c.redAdd(c)),f=c.redISub(l),h=a.redSqr();h=(h=(h=h.redIAdd(h)).redIAdd(h)).redIAdd(h);var d=s.redMul(f).redISub(h),p=r.redAdd(r).redMul(n);return this.curve.jpoint(l,d,p)},_m.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr(),n=t.redSqr(),i=e.redAdd(e).redIAdd(e),o=i.redSqr(),a=this.x.redAdd(t).redSqr().redISub(e).redISub(n),s=(a=(a=(a=a.redIAdd(a)).redAdd(a).redIAdd(a)).redISub(o)).redSqr(),u=n.redIAdd(n);u=(u=(u=u.redIAdd(u)).redIAdd(u)).redIAdd(u);var c=i.redIAdd(a).redSqr().redISub(o).redISub(s).redISub(u),l=t.redMul(c);l=(l=l.redIAdd(l)).redIAdd(l);var f=this.x.redMul(s).redISub(l);f=(f=f.redIAdd(f)).redIAdd(f);var h=this.y.redMul(c.redMul(u.redISub(c)).redISub(a.redMul(s)));h=(h=(h=h.redIAdd(h)).redIAdd(h)).redIAdd(h);var d=this.z.redAdd(a).redSqr().redISub(r).redISub(s);return this.curve.jpoint(f,h,d)},_m.prototype.mul=function(e,t){return e=new(dy())(e,t),this.curve._wnafMul(this,e)},_m.prototype.eq=function(e){if("affine"===e.type)return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),r=e.z.redSqr();if(0!==this.x.redMul(r).redISub(e.x.redMul(t)).cmpn(0))return!1;var n=t.redMul(this.z),i=r.redMul(e.z);return 0===this.y.redMul(i).redISub(e.y.redMul(n)).cmpn(0)},_m.prototype.eqXToP=function(e){var t=this.z.redSqr(),r=e.toRed(this.curve.red).redMul(t);if(0===this.x.cmp(r))return!0;for(var n=e.clone(),i=this.curve.redN.redMul(t);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},_m.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},_m.prototype.isInfinity=function(){return 0===this.z.cmpn(0)};var Am=cm((function(e,t){var r=t;r.base=mm,r.short=xm,r.mont=null,r.edwards=null})),Im=cm((function(e,t){var r,n=t,i=dm.assert;function o(e){"short"===e.type?this.curve=new Am.short(e):"edwards"===e.type?this.curve=new Am.edwards(e):this.curve=new Am.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,i(this.g.validate(),"Invalid curve"),i(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function a(e,t){Object.defineProperty(n,e,{configurable:!0,enumerable:!0,get:function(){var r=new o(t);return Object.defineProperty(n,e,{configurable:!0,enumerable:!0,value:r}),r}})}n.PresetCurve=o,a("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:um().sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),a("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:um().sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),a("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:um().sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),a("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:um().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"]}),a("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:um().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"]}),a("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:um().sha256,gRed:!1,g:["9"]}),a("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:um().sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{r=null.crash()}catch(s){r=void 0}a("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:um().sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",r]})}));function Cm(e){if(!(this instanceof Cm))return new Cm(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=hm.toArray(e.entropy,e.entropyEnc||"hex"),r=hm.toArray(e.nonce,e.nonceEnc||"hex"),n=hm.toArray(e.pers,e.persEnc||"hex");lm(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}var Tm=Cm;Cm.prototype._init=function(e,t,r){var n=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i<this.V.length;i++)this.K[i]=0,this.V[i]=1;this._update(n),this._reseed=1,this.reseedInterval=281474976710656},Cm.prototype._hmac=function(){return new(um().hmac)(this.hash,this.K)},Cm.prototype._update=function(e){var t=this._hmac().update(this.V).update([0]);e&&(t=t.update(e)),this.K=t.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())},Cm.prototype.reseed=function(e,t,r,n){"string"!==typeof t&&(n=r,r=t,t=null),e=hm.toArray(e,t),r=hm.toArray(r,n),lm(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},Cm.prototype.generate=function(e,t,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!==typeof t&&(n=r,r=t,t=null),r&&(r=hm.toArray(r,n||"hex"),this._update(r));for(var i=[];i.length<e;)this.V=this._hmac().update(this.V).digest(),i=i.concat(this.V);var o=i.slice(0,e);return this._update(r),this._reseed++,hm.encode(o,t)};var Pm=dm.assert;function Rm(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)}var Bm=Rm;Rm.fromPublic=function(e,t,r){return t instanceof Rm?t:new Rm(e,{pub:t,pubEnc:r})},Rm.fromPrivate=function(e,t,r){return t instanceof Rm?t:new Rm(e,{priv:t,privEnc:r})},Rm.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"}},Rm.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},Rm.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},Rm.prototype._importPrivate=function(e,t){this.priv=new(dy())(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},Rm.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?Pm(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||Pm(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},Rm.prototype.derive=function(e){return e.validate()||Pm(e.validate(),"public point not validated"),e.mul(this.priv).getX()},Rm.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},Rm.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},Rm.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var Mm=dm.assert;function Nm(e,t){if(e instanceof Nm)return e;this._importDER(e,t)||(Mm(e.r&&e.s,"Signature without r or s"),this.r=new(dy())(e.r,16),this.s=new(dy())(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}var Om=Nm;function Dm(){this.place=0}function Lm(e,t){var r=e[t.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var i=0,o=0,a=t.place;o<n;o++,a++)i<<=8,i|=e[a],i>>>=0;return!(i<=127)&&(t.place=a,i)}function Um(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t<r;)t++;return 0===t?e:e.slice(t)}function Fm(e,t){if(t<128)e.push(t);else{var r=1+(Math.log(t)/Math.LN2>>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}Nm.prototype._importDER=function(e,t){e=dm.toArray(e,t);var r=new Dm;if(48!==e[r.place++])return!1;var n=Lm(e,r);if(!1===n)return!1;if(n+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var i=Lm(e,r);if(!1===i)return!1;var o=e.slice(r.place,i+r.place);if(r.place+=i,2!==e[r.place++])return!1;var a=Lm(e,r);if(!1===a)return!1;if(e.length!==a+r.place)return!1;var s=e.slice(r.place,a+r.place);if(0===o[0]){if(!(128&o[1]))return!1;o=o.slice(1)}if(0===s[0]){if(!(128&s[1]))return!1;s=s.slice(1)}return this.r=new(dy())(o),this.s=new(dy())(s),this.recoveryParam=null,!0},Nm.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=Um(t),r=Um(r);!r[0]&&!(128&r[1]);)r=r.slice(1);var n=[2];Fm(n,t.length),(n=n.concat(t)).push(2),Fm(n,r.length);var i=n.concat(r),o=[48];return Fm(o,i.length),o=o.concat(i),dm.encode(o,e)};var zm=function(){throw new Error("unsupported")},Zm=dm.assert;function jm(e){if(!(this instanceof jm))return new jm(e);"string"===typeof e&&(Zm(Object.prototype.hasOwnProperty.call(Im,e),"Unknown curve "+e),e=Im[e]),e instanceof Im.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}var qm=jm;jm.prototype.keyPair=function(e){return new Bm(this,e)},jm.prototype.keyFromPrivate=function(e,t){return Bm.fromPrivate(this,e,t)},jm.prototype.keyFromPublic=function(e,t){return Bm.fromPublic(this,e,t)},jm.prototype.genKeyPair=function(e){e||(e={});for(var t=new Tm({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||zm(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),n=this.n.sub(new(dy())(2));;){var i=new(dy())(t.generate(r));if(!(i.cmp(n)>0))return i.iaddn(1),this.keyFromPrivate(i)}},jm.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},jm.prototype.sign=function(e,t,r,n){"object"===typeof r&&(n=r,r=null),n||(n={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new(dy())(e,16));for(var i=this.n.byteLength(),o=t.getPrivate().toArray("be",i),a=e.toArray("be",i),s=new Tm({hash:this.hash,entropy:o,nonce:a,pers:n.pers,persEnc:n.persEnc||"utf8"}),u=this.n.sub(new(dy())(1)),c=0;;c++){var l=n.k?n.k(c):new(dy())(s.generate(this.n.byteLength()));if(!((l=this._truncateToN(l,!0)).cmpn(1)<=0||l.cmp(u)>=0)){var f=this.g.mul(l);if(!f.isInfinity()){var h=f.getX(),d=h.umod(this.n);if(0!==d.cmpn(0)){var p=l.invm(this.n).mul(d.mul(t.getPrivate()).iadd(e));if(0!==(p=p.umod(this.n)).cmpn(0)){var v=(f.getY().isOdd()?1:0)|(0!==h.cmp(d)?2:0);return n.canonical&&p.cmp(this.nh)>0&&(p=this.n.sub(p),v^=1),new Om({r:d,s:p,recoveryParam:v})}}}}}},jm.prototype.verify=function(e,t,r,n){e=this._truncateToN(new(dy())(e,16)),r=this.keyFromPublic(r,n);var i=(t=new Om(t,"hex")).r,o=t.s;if(i.cmpn(1)<0||i.cmp(this.n)>=0)return!1;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var a,s=o.invm(this.n),u=s.mul(e).umod(this.n),c=s.mul(i).umod(this.n);return this.curve._maxwellTrick?!(a=this.g.jmulAdd(u,r.getPublic(),c)).isInfinity()&&a.eqXToP(i):!(a=this.g.mulAdd(u,r.getPublic(),c)).isInfinity()&&0===a.getX().umod(this.n).cmp(i)},jm.prototype.recoverPubKey=function(e,t,r,n){Zm((3&r)===r,"The recovery param is more than two bits"),t=new Om(t,n);var i=this.n,o=new(dy())(e),a=t.r,s=t.s,u=1&r,c=r>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&c)throw new Error("Unable to find sencond key candinate");a=c?this.curve.pointFromX(a.add(this.curve.n),u):this.curve.pointFromX(a,u);var l=t.r.invm(i),f=i.sub(o).mul(l).umod(i),h=s.mul(l).umod(i);return this.g.mulAdd(f,a,h)},jm.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new Om(t,n)).recoveryParam)return t.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(e,t,i)}catch(e){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")};var Km=cm((function(e,t){var r=t;r.version="6.5.4",r.utils=dm,r.rand=function(){throw new Error("unsupported")},r.curve=Am,r.curves=Im,r.ec=qm,r.eddsa=null})).ec,Vm=new cn("signing-key/5.7.0"),Hm=null;function Gm(){return Hm||(Hm=new Km("secp256k1")),Hm}var Wm=function(){function e(t){(0,D.Z)(this,e),Yg(this,"curve","secp256k1"),Yg(this,"privateKey",kn(t)),32!==En(this.privateKey)&&Vm.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");var r=Gm().keyFromPrivate(gn(this.privateKey));Yg(this,"publicKey","0x"+r.getPublic(!1,"hex")),Yg(this,"compressedPublicKey","0x"+r.getPublic(!0,"hex")),Yg(this,"_isSigningKey",!0)}return(0,O.Z)(e,[{key:"_addPoint",value:function(e){var t=Gm().keyFromPublic(gn(this.publicKey)),r=Gm().keyFromPublic(gn(e));return"0x"+t.pub.add(r.pub).encodeCompressed("hex")}},{key:"signDigest",value:function(e){var t=Gm().keyFromPrivate(gn(this.privateKey)),r=gn(e);32!==r.length&&Vm.throwArgumentError("bad digest length","digest",e);var n=t.sign(r,{canonical:!0});return In({recoveryParam:n.recoveryParam,r:An("0x"+n.r.toString(16),32),s:An("0x"+n.s.toString(16),32)})}},{key:"computeSharedSecret",value:function(e){var t=Gm().keyFromPrivate(gn(this.privateKey)),r=Gm().keyFromPublic(gn(Qm(e)));return An("0x"+t.derive(r.getPublic()).toString(16),32)}}],[{key:"isSigningKey",value:function(e){return!(!e||!e._isSigningKey)}}]),e}();function Qm(e,t){var r=gn(e);if(32===r.length){var n=new Wm(r);return t?"0x"+Gm().keyFromPrivate(r).getPublic(!0,"hex"):n.publicKey}return 33===r.length?t?kn(r):"0x"+Gm().keyFromPublic(r).getPublic(!1,"hex"):65===r.length?t?"0x"+Gm().keyFromPublic(r).getPublic(!0,"hex"):kn(r):Vm.throwArgumentError("invalid public or private key","key","[REDACTED]")}var Jm,Ym=new cn("transactions/5.7.0");function Xm(e){return"0x"===e?null:My(e)}function $m(e){return"0x"===e?am:by.from(e)}!function(e){e[e.legacy=0]="legacy",e[e.eip2930=1]="eip2930",e[e.eip1559=2]="eip1559"}(Jm||(Jm={}));function eb(e,t){return function(e){return My(xn(Sy(xn(Qm(e),1)),12))}(function(e,t){var r=In(t),n={r:gn(r.r),s:gn(r.s)};return"0x"+Gm().recoverPubKey(gn(e),n,r.recoveryParam).encode("hex",!1)}(gn(e),t))}function tb(e,t){var r=mn(by.from(e).toHexString());return r.length>32&&Ym.throwArgumentError("invalid length for "+t,"transaction:"+t,e),r}function rb(e,t){return{address:My(e),storageKeys:(t||[]).map((function(t,r){return 32!==En(t)&&Ym.throwArgumentError("invalid access list storageKey","accessList[".concat(e,":").concat(r,"]"),t),t.toLowerCase()}))}}function nb(e){if(Array.isArray(e))return e.map((function(e,t){return Array.isArray(e)?(e.length>2&&Ym.throwArgumentError("access list expected to be [ address, storageKeys[] ]","value[".concat(t,"]"),e),rb(e[0],e[1])):rb(e.address,e.storageKeys)}));var t=Object.keys(e).map((function(t){var r=e[t].reduce((function(e,t){return e[t]=!0,e}),{});return rb(t,Object.keys(r).sort())}));return t.sort((function(e,t){return e.address.localeCompare(t.address)})),t}function ib(e){return nb(e).map((function(e){return[e.address,e.storageKeys]}))}function ob(e,t){if(null!=e.gasPrice){var r=by.from(e.gasPrice),n=by.from(e.maxFeePerGas||0);r.eq(n)||Ym.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:r,maxFeePerGas:n})}var i=[tb(e.chainId||0,"chainId"),tb(e.nonce||0,"nonce"),tb(e.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),tb(e.maxFeePerGas||0,"maxFeePerGas"),tb(e.gasLimit||0,"gasLimit"),null!=e.to?My(e.to):"0x",tb(e.value||0,"value"),e.data||"0x",ib(e.accessList||[])];if(t){var o=In(t);i.push(tb(o.recoveryParam,"recoveryParam")),i.push(mn(o.r)),i.push(mn(o.s))}return Sn(["0x02",Bn(i)])}function ab(e,t){var r=[tb(e.chainId||0,"chainId"),tb(e.nonce||0,"nonce"),tb(e.gasPrice||0,"gasPrice"),tb(e.gasLimit||0,"gasLimit"),null!=e.to?My(e.to):"0x",tb(e.value||0,"value"),e.data||"0x",ib(e.accessList||[])];if(t){var n=In(t);r.push(tb(n.recoveryParam,"recoveryParam")),r.push(mn(n.r)),r.push(mn(n.s))}return Sn(["0x01",Bn(r)])}function sb(e,t,r){try{var n=$m(t[0]).toNumber();if(0!==n&&1!==n)throw new Error("bad recid");e.v=n}catch(o){Ym.throwArgumentError("invalid v for transaction type: 1","v",t[0])}e.r=An(t[1],32),e.s=An(t[2],32);try{var i=Sy(r(e));e.from=eb(i,{r:e.r,s:e.s,recoveryParam:e.v})}catch(o){}}function ub(e){var t=gn(e);if(t[0]>127)return function(e){var t=On(e);9!==t.length&&6!==t.length&&Ym.throwArgumentError("invalid raw transaction","rawTransaction",e);var r={nonce:$m(t[0]).toNumber(),gasPrice:$m(t[1]),gasLimit:$m(t[2]),to:Xm(t[3]),value:$m(t[4]),data:t[5],chainId:0};if(6===t.length)return r;try{r.v=by.from(t[6]).toNumber()}catch(a){return r}if(r.r=An(t[7],32),r.s=An(t[8],32),by.from(r.r).isZero()&&by.from(r.s).isZero())r.chainId=r.v,r.v=0;else{r.chainId=Math.floor((r.v-35)/2),r.chainId<0&&(r.chainId=0);var n=r.v-27,i=t.slice(0,6);0!==r.chainId&&(i.push(kn(r.chainId)),i.push("0x"),i.push("0x"),n-=2*r.chainId+8);var o=Sy(Bn(i));try{r.from=eb(o,{r:kn(r.r),s:kn(r.s),recoveryParam:n})}catch(a){}r.hash=Sy(e)}return r.type=null,r}(t);switch(t[0]){case 1:return function(e){var t=On(e.slice(1));8!==t.length&&11!==t.length&&Ym.throwArgumentError("invalid component count for transaction type: 1","payload",kn(e));var r={type:1,chainId:$m(t[0]).toNumber(),nonce:$m(t[1]).toNumber(),gasPrice:$m(t[2]),gasLimit:$m(t[3]),to:Xm(t[4]),value:$m(t[5]),data:t[6],accessList:nb(t[7])};return 8===t.length||(r.hash=Sy(e),sb(r,t.slice(8),ab)),r}(t);case 2:return function(e){var t=On(e.slice(1));9!==t.length&&12!==t.length&&Ym.throwArgumentError("invalid component count for transaction type: 2","payload",kn(e));var r=$m(t[2]),n=$m(t[3]),i={type:2,chainId:$m(t[0]).toNumber(),nonce:$m(t[1]).toNumber(),maxPriorityFeePerGas:r,maxFeePerGas:n,gasPrice:null,gasLimit:$m(t[4]),to:Xm(t[5]),value:$m(t[6]),data:t[7],accessList:nb(t[8])};return 9===t.length||(i.hash=Sy(e),sb(i,t.slice(9),ob)),i}(t)}return Ym.throwError("unsupported transaction type: ".concat(t[0]),cn.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:t[0]})}function cb(e){e=atob(e);for(var t=[],r=0;r<e.length;r++)t.push(e.charCodeAt(r));return gn(t)}function lb(e){e=gn(e);for(var t="",r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}var fb=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(t){o(t)}}function s(e){try{u(n.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))};function hb(e,t){return fb(this,void 0,void 0,(0,k.Z)().mark((function r(){var n,i,o,a,s;return(0,k.Z)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return null==t&&(t={}),n={method:t.method||"GET",headers:t.headers||{},body:t.body||void 0},!0!==t.skipFetchSetup&&(n.mode="cors",n.cache="no-cache",n.credentials="same-origin",n.redirect="follow",n.referrer="client"),null!=t.fetchOptions&&((i=t.fetchOptions).mode&&(n.mode=i.mode),i.cache&&(n.cache=i.cache),i.credentials&&(n.credentials=i.credentials),i.redirect&&(n.redirect=i.redirect),i.referrer&&(n.referrer=i.referrer)),r.next=7,fetch(e,n);case 7:return o=r.sent,r.next=10,o.arrayBuffer();case 10:return a=r.sent,s={},o.headers.forEach?o.headers.forEach((function(e,t){s[t.toLowerCase()]=e})):o.headers.keys().forEach((function(e){s[e.toLowerCase()]=o.headers.get(e)})),r.abrupt("return",{headers:s,statusCode:o.status,statusMessage:o.statusText,body:gn(new Uint8Array(a))});case 14:case"end":return r.stop()}}),r)})))}var db=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(t){o(t)}}function s(e){try{u(n.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},pb=new cn("web/5.7.1");function vb(e){return new Promise((function(t){setTimeout(t,e)}))}function gb(e,t){if(null==e)return null;if("string"===typeof e)return e;if(dn(e)){if(t&&("text"===t.split("/")[0]||"application/json"===t.split(";")[0].trim()))try{return jy(e)}catch(r){}return kn(e)}return e}function yb(e,t,r){var n=null;if(null!=t){n=Zy(t);var i="string"===typeof e?{url:e}:ey(e);if(i.headers)0!==Object.keys(i.headers).filter((function(e){return"content-type"===e.toLowerCase()})).length||(i.headers=ey(i.headers),i.headers["content-type"]="application/json");else i.headers={"content-type":"application/json"};e=i}return function(e,t,r){var n="object"===typeof e&&null!=e.throttleLimit?e.throttleLimit:12;pb.assertArgument(n>0&&n%1===0,"invalid connection throttle limit","connection.throttleLimit",n);var i="object"===typeof e?e.throttleCallback:null,o="object"===typeof e&&"number"===typeof e.throttleSlotInterval?e.throttleSlotInterval:100;pb.assertArgument(o>0&&o%1===0,"invalid connection throttle slot interval","connection.throttleSlotInterval",o);var a="object"===typeof e&&!!e.errorPassThrough,s={},u=null,c={method:"GET"},l=!1,f=12e4;if("string"===typeof e)u=e;else if("object"===typeof e){if(null!=e&&null!=e.url||pb.throwArgumentError("missing URL","connection.url",e),u=e.url,"number"===typeof e.timeout&&e.timeout>0&&(f=e.timeout),e.headers)for(var h in e.headers)s[h.toLowerCase()]={key:h,value:String(e.headers[h])},["if-none-match","if-modified-since"].indexOf(h.toLowerCase())>=0&&(l=!0);if(c.allowGzip=!!e.allowGzip,null!=e.user&&null!=e.password){"https:"!==u.substring(0,6)&&!0!==e.allowInsecureAuthentication&&pb.throwError("basic authentication requires a secure https url",cn.errors.INVALID_ARGUMENT,{argument:"url",url:u,user:e.user,password:"[REDACTED]"});var d=e.user+":"+e.password;s.authorization={key:"Authorization",value:"Basic "+lb(Zy(d))}}null!=e.skipFetchSetup&&(c.skipFetchSetup=!!e.skipFetchSetup),null!=e.fetchOptions&&(c.fetchOptions=ey(e.fetchOptions))}var p,v=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),g=u?u.match(v):null;if(g)try{var y={statusCode:200,statusMessage:"OK",headers:{"content-type":g[1]||"text/plain"},body:g[2]?cb(g[3]):(p=g[3],Zy(p.replace(/%([0-9a-f][0-9a-f])/gi,(function(e,t){return String.fromCharCode(parseInt(t,16))}))))},m=y.body;return r&&(m=r(y.body,y)),Promise.resolve(m)}catch(x){pb.throwError("processing response error",cn.errors.SERVER_ERROR,{body:gb(g[1],g[2]),error:x,requestBody:null,requestMethod:"GET",url:u})}t&&(c.method="POST",c.body=t,null==s["content-type"]&&(s["content-type"]={key:"Content-Type",value:"application/octet-stream"}),null==s["content-length"]&&(s["content-length"]={key:"Content-Length",value:String(t.length)}));var b={};Object.keys(s).forEach((function(e){var t=s[e];b[t.key]=t.value})),c.headers=b;var w=function(){var e=null;return{promise:new Promise((function(t,r){f&&(e=setTimeout((function(){null!=e&&(e=null,r(pb.makeError("timeout",cn.errors.TIMEOUT,{requestBody:gb(c.body,b["content-type"]),requestMethod:c.method,timeout:f,url:u})))}),f))})),cancel:function(){null!=e&&(clearTimeout(e),e=null)}}}(),E=function(){return db(this,void 0,void 0,(0,k.Z)().mark((function e(){var t,s,f,h,d,p,v,g,y,m;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=0;case 1:if(!(t<n)){e.next=65;break}return s=null,e.prev=3,e.next=6,hb(u,c);case 6:if(s=e.sent,!(t<n)){e.next=28;break}if(301!==s.statusCode&&302!==s.statusCode){e.next=15;break}if(f=s.headers.location||"","GET"!==c.method||!f.match(/^https:/)){e.next=13;break}return u=s.headers.location,e.abrupt("continue",62);case 13:e.next=28;break;case 15:if(429!==s.statusCode){e.next=28;break}if(h=!0,!i){e.next=21;break}return e.next=20,i(t,u);case 20:h=e.sent;case 21:if(!h){e.next=28;break}return d=0,p=s.headers["retry-after"],d="string"===typeof p&&p.match(/^[1-9][0-9]*$/)?1e3*parseInt(p):o*parseInt(String(Math.random()*Math.pow(2,t))),e.next=27,vb(d);case 27:return e.abrupt("continue",62);case 28:e.next=34;break;case 30:e.prev=30,e.t0=e.catch(3),null==(s=e.t0.response)&&(w.cancel(),pb.throwError("missing response",cn.errors.SERVER_ERROR,{requestBody:gb(c.body,b["content-type"]),requestMethod:c.method,serverError:e.t0,url:u}));case 34:if(v=s.body,l&&304===s.statusCode?v=null:!a&&(s.statusCode<200||s.statusCode>=300)&&(w.cancel(),pb.throwError("bad response",cn.errors.SERVER_ERROR,{status:s.statusCode,headers:s.headers,body:gb(v,s.headers?s.headers["content-type"]:null),requestBody:gb(c.body,b["content-type"]),requestMethod:c.method,url:u})),!r){e.next=60;break}return e.prev=37,e.next=40,r(v,s);case 40:return g=e.sent,w.cancel(),e.abrupt("return",g);case 45:if(e.prev=45,e.t1=e.catch(37),!(e.t1.throttleRetry&&t<n)){e.next=58;break}if(y=!0,!i){e.next=53;break}return e.next=52,i(t,u);case 52:y=e.sent;case 53:if(!y){e.next=58;break}return m=o*parseInt(String(Math.random()*Math.pow(2,t))),e.next=57,vb(m);case 57:return e.abrupt("continue",62);case 58:w.cancel(),pb.throwError("processing response error",cn.errors.SERVER_ERROR,{body:gb(v,s.headers?s.headers["content-type"]:null),error:e.t1,requestBody:gb(c.body,b["content-type"]),requestMethod:c.method,url:u});case 60:return w.cancel(),e.abrupt("return",v);case 62:t++,e.next=1;break;case 65:return e.abrupt("return",pb.throwError("failed response",cn.errors.SERVER_ERROR,{requestBody:gb(c.body,b["content-type"]),requestMethod:c.method,url:u}));case 66:case"end":return e.stop()}}),e,null,[[3,30],[37,45]])})))}();return Promise.race([w.promise,E])}(e,n,(function(e,t){var n=null;if(null!=e)try{n=JSON.parse(jy(e))}catch(i){pb.throwError("invalid JSON",cn.errors.SERVER_ERROR,{body:e,error:i})}return r&&(n=r(n,t)),n}))}function mb(e,t){return t||(t={}),null==(t=ey(t)).floor&&(t.floor=0),null==t.ceiling&&(t.ceiling=1e4),null==t.interval&&(t.interval=250),new Promise((function(r,n){var i=null,o=!1,a=function(){return!o&&(o=!0,i&&clearTimeout(i),!0)};t.timeout&&(i=setTimeout((function(){a()&&n(new Error("timeout"))}),t.timeout));var s=t.retryLimit,u=0;!function i(){return e().then((function(e){if(void 0!==e)a()&&r(e);else if(t.oncePoll)t.oncePoll.once("poll",i);else if(t.onceBlock)t.onceBlock.once("block",i);else if(!o){if(++u>s)return void(a()&&n(new Error("retry limit reached")));var c=t.interval*parseInt(String(Math.random()*Math.pow(2,u)));c<t.floor&&(c=t.floor),c>t.ceiling&&(c=t.ceiling),setTimeout(i,c)}return null}),(function(e){a()&&n(e)}))}()}))}var bb=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(t){o(t)}}function s(e){try{u(n.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},wb=new cn("abstract-provider/5.7.0"),kb=function(e){U(r,e);var t=K(r);function r(){return(0,D.Z)(this,r),t.apply(this,arguments)}return(0,O.Z)(r,null,[{key:"isForkEvent",value:function(e){return!(!e||!e._isForkEvent)}}]),r}(oy),Eb=function(){function e(){(0,D.Z)(this,e),wb.checkAbstract(this instanceof e?this.constructor:void 0,e),Yg(this,"_isProvider",!0)}return(0,O.Z)(e,[{key:"getFeeData",value:function(){return bb(this,void 0,void 0,(0,k.Z)().mark((function e(){var t,r,n,i,o,a;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,$g({block:this.getBlock("latest"),gasPrice:this.getGasPrice().catch((function(e){return null}))});case 2:return t=e.sent,r=t.block,n=t.gasPrice,i=null,o=null,a=null,r&&r.baseFeePerGas&&(i=r.baseFeePerGas,a=by.from("1500000000"),o=r.baseFeePerGas.mul(2).add(a)),e.abrupt("return",{lastBaseFeePerGas:i,maxFeePerGas:o,maxPriorityFeePerGas:a,gasPrice:n});case 8:case"end":return e.stop()}}),e,this)})))}},{key:"addListener",value:function(e,t){return this.on(e,t)}},{key:"removeListener",value:function(e,t){return this.off(e,t)}}],[{key:"isProvider",value:function(e){return!(!e||!e._isProvider)}}]),e}(),xb=function(){function e(t){(0,D.Z)(this,e),Yg(this,"alphabet",t),Yg(this,"base",t.length),Yg(this,"_alphabetMap",{}),Yg(this,"_leader",t.charAt(0));for(var r=0;r<t.length;r++)this._alphabetMap[t.charAt(r)]=r}return(0,O.Z)(e,[{key:"encode",value:function(e){var t=gn(e);if(0===t.length)return"";for(var r=[0],n=0;n<t.length;++n){for(var i=t[n],o=0;o<r.length;++o)i+=r[o]<<8,r[o]=i%this.base,i=i/this.base|0;for(;i>0;)r.push(i%this.base),i=i/this.base|0}for(var a="",s=0;0===t[s]&&s<t.length-1;++s)a+=this._leader;for(var u=r.length-1;u>=0;--u)a+=this.alphabet[r[u]];return a}},{key:"decode",value:function(e){if("string"!==typeof e)throw new TypeError("Expected String");var t=[];if(0===e.length)return new Uint8Array(t);t.push(0);for(var r=0;r<e.length;r++){var n=this._alphabetMap[e[r]];if(void 0===n)throw new Error("Non-base"+this.base+" character");for(var i=n,o=0;o<t.length;++o)i+=t[o]*this.base,t[o]=255&i,i>>=8;for(;i>0;)t.push(255&i),i>>=8}for(var a=0;e[a]===this._leader&&a<e.length-1;++a)t.push(0);return gn(new Uint8Array(t.reverse()))}}]),e}(),Sb=(new xb("abcdefghijklmnopqrstuvwxyz234567"),new xb("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"));function _b(e,t){null==t&&(t=1);var r=[],n=r.forEach;return function e(t,i){n.call(t,(function(t){i>0&&Array.isArray(t)?e(t,i-1):r.push(t)}))}(e,t),r}function Ab(e){return function(e){var t=0;return function(){return e[t++]}}(function(e){var t=0;function r(){return e[t++]<<8|e[t++]}for(var n=r(),i=1,o=[0,1],a=1;a<n;a++)o.push(i+=r());var s=r(),u=t;t+=s;var c=0,l=0;function f(){return 0==c&&(l=l<<8|e[t++],c=8),l>>--c&1}for(var h=Math.pow(2,31),d=h>>>1,p=d>>1,v=h-1,g=0,y=0;y<31;y++)g=g<<1|f();for(var m=[],b=0,w=h;;){for(var k=Math.floor(((g-b+1)*i-1)/w),E=0,x=n;x-E>1;){var S=E+x>>>1;k<o[S]?x=S:E=S}if(0==E)break;m.push(E);for(var _=b+Math.floor(w*o[E]/i),A=b+Math.floor(w*o[E+1]/i)-1;0==((_^A)&d);)g=g<<1&v|f(),_=_<<1&v,A=A<<1&v|1;for(;_&~A&p;)g=g&d|g<<1&v>>>1|f(),_=_<<1^d,A=(A^d)<<1|d|1;b=_,w=1+A-_}var I=n-4;return m.map((function(t){switch(t-I){case 3:return I+65792+(e[u++]<<16|e[u++]<<8|e[u++]);case 2:return I+256+(e[u++]<<8|e[u++]);case 1:return I+e[u++];default:return t-1}}))}(e))}function Ib(e){return 1&e?~e>>1:e>>1}function Cb(e,t){for(var r=Array(e),n=0,i=-1;n<e;n++)r[n]=i+=1+t();return r}function Tb(e,t){for(var r=Array(e),n=0,i=0;n<e;n++)r[n]=i+=Ib(t());return r}function Pb(e,t){for(var r=Cb(e(),e),n=e(),i=Cb(n,e),o=function(e,t){for(var r=Array(e),n=0;n<e;n++)r[n]=1+t();return r}(n,e),a=0;a<n;a++)for(var s=0;s<o[a];s++)r.push(i[a]+s);return t?r.map((function(e){return t[e]})):r}function Rb(e,t,r){for(var n=Array(e).fill(void 0).map((function(){return[]})),i=0;i<t;i++)Tb(e,r).forEach((function(e,t){return n[t].push(e)}));return n}function Bb(e,t){var r=1+t(),n=t(),i=function(e){for(var t=[];;){var r=e();if(0==r)break;t.push(r)}return t}(t);return _b(Rb(i.length,1+e,t).map((function(e,t){var o=e[0],a=e.slice(1);return Array(i[t]).fill(void 0).map((function(e,t){var i=t*n;return[o+t*r,a.map((function(e){return e+i}))]}))})))}function Mb(e,t){return Rb(1+t(),1+e,t).map((function(e){return[e[0],e.slice(1)]}))}var Nb=Ab(cb("AEQF2AO2DEsA2wIrAGsBRABxAN8AZwCcAEwAqgA0AGwAUgByADcATAAVAFYAIQAyACEAKAAYAFgAGwAjABQAMAAmADIAFAAfABQAKwATACoADgAbAA8AHQAYABoAGQAxADgALAAoADwAEwA9ABMAGgARAA4ADwAWABMAFgAIAA8AHgQXBYMA5BHJAS8JtAYoAe4AExozi0UAH21tAaMnBT8CrnIyhrMDhRgDygIBUAEHcoFHUPe8AXBjAewCjgDQR8IICIcEcQLwATXCDgzvHwBmBoHNAqsBdBcUAykgDhAMShskMgo8AY8jqAQfAUAfHw8BDw87MioGlCIPBwZCa4ELatMAAMspJVgsDl8AIhckSg8XAHdvTwBcIQEiDT4OPhUqbyECAEoAS34Aej8Ybx83JgT/Xw8gHxZ/7w8RICxPHA9vBw+Pfw8PHwAPFv+fAsAvCc8vEr8ivwD/EQ8Bol8OEBa/A78hrwAPCU8vESNvvwWfHwNfAVoDHr+ZAAED34YaAdJPAK7PLwSEgDLHAGo1Pz8Pvx9fUwMrpb8O/58VTzAPIBoXIyQJNF8hpwIVAT8YGAUADDNBaX3RAMomJCg9EhUeA29MABsZBTMNJipjOhc19gcIDR8bBwQHEggCWi6DIgLuAQYA+BAFCha3A5XiAEsqM7UFFgFLhAMjFTMYE1Klnw74nRVBG/ASCm0BYRN/BrsU3VoWy+S0vV8LQx+vN8gF2AC2AK5EAWwApgYDKmAAroQ0NDQ0AT+OCg7wAAIHRAbpNgVcBV0APTA5BfbPFgMLzcYL/QqqA82eBALKCjQCjqYCht0/k2+OAsXQAoP3ASTKDgDw6ACKAUYCMpIKJpRaAE4A5womABzZvs0REEKiACIQAd5QdAECAj4Ywg/wGqY2AVgAYADYvAoCGAEubA0gvAY2ALAAbpbvqpyEAGAEpgQAJgAG7gAgAEACmghUFwCqAMpAINQIwC4DthRAAPcycKgApoIdABwBfCisABoATwBqASIAvhnSBP8aH/ECeAKXAq40NjgDBTwFYQU6AXs3oABgAD4XNgmcCY1eCl5tIFZeUqGgyoNHABgAEQAaABNwWQAmABMATPMa3T34ADldyprmM1M2XociUQgLzvwAXT3xABgAEQAaABNwIGFAnADD8AAgAD4BBJWzaCcIAIEBFMAWwKoAAdq9BWAF5wLQpALEtQAKUSGkahR4GnJM+gsAwCgeFAiUAECQ0BQuL8AAIAAAADKeIheclvFqQAAETr4iAMxIARMgAMIoHhQIAn0E0pDQFC4HhznoAAAAIAI2C0/4lvFqQAAETgBJJwYCAy4ABgYAFAA8MBKYEH4eRhTkAjYeFcgACAYAeABsOqyQ5gRwDayqugEgaIIAtgoACgDmEABmBAWGme5OBJJA2m4cDeoAmITWAXwrMgOgAGwBCh6CBXYF1Tzg1wKAAFdiuABRAFwAXQBsAG8AdgBrAHYAbwCEAHEwfxQBVE5TEQADVFhTBwBDANILAqcCzgLTApQCrQL6vAAMAL8APLhNBKkE6glGKTAU4Dr4N2EYEwBCkABKk8rHAbYBmwIoAiU4Ajf/Aq4CowCAANIChzgaNBsCsTgeODcFXrgClQKdAqQBiQGYAqsCsjTsNHsfNPA0ixsAWTWiOAMFPDQSNCk2BDZHNow2TTZUNhk28Jk9VzI3QkEoAoICoQKwAqcAQAAxBV4FXbS9BW47YkIXP1ciUqs05DS/FwABUwJW11e6nHuYZmSh/RAYA8oMKvZ8KASoUAJYWAJ6ILAsAZSoqjpgA0ocBIhmDgDWAAawRDQoAAcuAj5iAHABZiR2AIgiHgCaAU68ACxuHAG0ygM8MiZIAlgBdF4GagJqAPZOHAMuBgoATkYAsABiAHgAMLoGDPj0HpKEBAAOJgAuALggTAHWAeAMEDbd20Uege0ADwAWADkAQgA9OHd+2MUQZBBhBgNNDkxxPxUQArEPqwvqERoM1irQ090ANK4H8ANYB/ADWANYB/AH8ANYB/ADWANYA1gDWBwP8B/YxRBkD00EcgWTBZAE2wiIJk4RhgctCNdUEnQjHEwDSgEBIypJITuYMxAlR0wRTQgIATZHbKx9PQNMMbBU+pCnA9AyVDlxBgMedhKlAC8PeCE1uk6DekxxpQpQT7NX9wBFBgASqwAS5gBJDSgAUCwGPQBI4zTYABNGAE2bAE3KAExdGABKaAbgAFBXAFCOAFBJABI2SWdObALDOq0//QomCZhvwHdTBkIQHCemEPgMNAG2ATwN7kvZBPIGPATKH34ZGg/OlZ0Ipi3eDO4m5C6igFsj9iqEBe5L9TzeC05RaQ9aC2YJ5DpkgU8DIgEOIowK3g06CG4Q9ArKbA3mEUYHOgPWSZsApgcCCxIdNhW2JhFirQsKOXgG/Br3C5AmsBMqev0F1BoiBk4BKhsAANAu6IWxWjJcHU9gBgQLJiPIFKlQIQ0mQLh4SRocBxYlqgKSQ3FKiFE3HpQh9zw+DWcuFFF9B/Y8BhlQC4I8n0asRQ8R0z6OPUkiSkwtBDaALDAnjAnQD4YMunxzAVoJIgmyDHITMhEYN8YIOgcaLpclJxYIIkaWYJsE+KAD9BPSAwwFQAlCBxQDthwuEy8VKgUOgSXYAvQ21i60ApBWgQEYBcwPJh/gEFFH4Q7qCJwCZgOEJewALhUiABginAhEZABgj9lTBi7MCMhqbSN1A2gU6GIRdAeSDlgHqBw0FcAc4nDJXgyGCSiksAlcAXYJmgFgBOQICjVcjKEgQmdUi1kYnCBiQUBd/QIyDGYVoES+h3kCjA9sEhwBNgF0BzoNAgJ4Ee4RbBCWCOyGBTW2M/k6JgRQIYQgEgooA1BszwsoJvoM+WoBpBJjAw00PnfvZ6xgtyUX/gcaMsZBYSHyC5NPzgydGsIYQ1QvGeUHwAP0GvQn60FYBgADpAQUOk4z7wS+C2oIjAlAAEoOpBgH2BhrCnKM0QEyjAG4mgNYkoQCcJAGOAcMAGgMiAV65gAeAqgIpAAGANADWAA6Aq4HngAaAIZCAT4DKDABIuYCkAOUCDLMAZYwAfQqBBzEDBYA+DhuSwLDsgKAa2ajBd5ZAo8CSjYBTiYEBk9IUgOwcuIA3ABMBhTgSAEWrEvMG+REAeBwLADIAPwABjYHBkIBzgH0bgC4AWALMgmjtLYBTuoqAIQAFmwB2AKKAN4ANgCA8gFUAE4FWvoF1AJQSgESMhksWGIBvAMgATQBDgB6BsyOpsoIIARuB9QCEBwV4gLvLwe2AgMi4BPOQsYCvd9WADIXUu5eZwqoCqdeaAC0YTQHMnM9UQAPH6k+yAdy/BZIiQImSwBQ5gBQQzSaNTFWSTYBpwGqKQK38AFtqwBI/wK37gK3rQK3sAK6280C0gK33AK3zxAAUEIAUD9SklKDArekArw5AEQAzAHCO147WTteO1k7XjtZO147WTteO1kDmChYI03AVU0oJqkKbV9GYewMpw3VRMk6ShPcYFJgMxPJLbgUwhXPJVcZPhq9JwYl5VUKDwUt1GYxCC00dhe9AEApaYNCY4ceMQpMHOhTklT5LRwAskujM7ANrRsWREEFSHXuYisWDwojAmSCAmJDXE6wXDchAqH4AmiZAmYKAp+FOBwMAmY8AmYnBG8EgAN/FAN+kzkHOXgYOYM6JCQCbB4CMjc4CwJtyAJtr/CLADRoRiwBaADfAOIASwYHmQyOAP8MwwAOtgJ3MAJ2o0ACeUxEAni7Hl3cRa9G9AJ8QAJ6yQJ9CgJ88UgBSH5kJQAsFklZSlwWGErNAtECAtDNSygDiFADh+dExpEzAvKiXQQDA69Lz0wuJgTQTU1NsAKLQAKK2cIcCB5EaAa4Ao44Ao5dQZiCAo7aAo5deVG1UzYLUtVUhgKT/AKTDQDqAB1VH1WwVdEHLBwplocy4nhnRTw6ApegAu+zWCKpAFomApaQApZ9nQCqWa1aCoJOADwClrYClk9cRVzSApnMApllXMtdCBoCnJw5wzqeApwXAp+cAp65iwAeEDIrEAKd8gKekwC2PmE1YfACntQCoG8BqgKeoCACnk+mY8lkKCYsAiewAiZ/AqD8AqBN2AKmMAKlzwKoAAB+AqfzaH1osgAESmodatICrOQCrK8CrWgCrQMCVx4CVd0CseLYAx9PbJgCsr4OArLpGGzhbWRtSWADJc4Ctl08QG6RAylGArhfArlIFgK5K3hwN3DiAr0aAy2zAzISAr6JcgMDM3ICvhtzI3NQAsPMAsMFc4N0TDZGdOEDPKgDPJsDPcACxX0CxkgCxhGKAshqUgLIRQLJUALJLwJkngLd03h6YniveSZL0QMYpGcDAmH1GfSVJXsMXpNevBICz2wCz20wTFTT9BSgAMeuAs90ASrrA04TfkwGAtwoAtuLAtJQA1JdA1NgAQIDVY2AikABzBfuYUZ2AILPg44C2sgC2d+EEYRKpz0DhqYAMANkD4ZyWvoAVgLfZgLeuXR4AuIw7RUB8zEoAfScAfLTiALr9ALpcXoAAur6AurlAPpIAboC7ooC652Wq5cEAu5AA4XhmHpw4XGiAvMEAGoDjheZlAL3FAORbwOSiAL3mQL52gL4Z5odmqy8OJsfA52EAv77ARwAOp8dn7QDBY4DpmsDptoA0sYDBmuhiaIGCgMMSgFgASACtgNGAJwEgLpoBgC8BGzAEowcggCEDC6kdjoAJAM0C5IKRoABZCgiAIzw3AYBLACkfng9ogigkgNmWAN6AEQCvrkEVqTGAwCsBRbAA+4iQkMCHR072jI2PTbUNsk2RjY5NvA23TZKNiU3EDcZN5I+RTxDRTBCJkK5VBYKFhZfwQCWygU3AJBRHpu+OytgNxa61A40GMsYjsn7BVwFXQVcBV0FaAVdBVwFXQVcBV0FXAVdBVwFXUsaCNyKAK4AAQUHBwKU7oICoW1e7jAEzgPxA+YDwgCkBFDAwADABKzAAOxFLhitA1UFTDeyPkM+bj51QkRCuwTQWWQ8X+0AWBYzsACNA8xwzAGm7EZ/QisoCTAbLDs6fnLfb8H2GccsbgFw13M1HAVkBW/Jxsm9CNRO8E8FDD0FBQw9FkcClOYCoMFegpDfADgcMiA2AJQACB8AsigKAIzIEAJKeBIApY5yPZQIAKQiHb4fvj5BKSRPQrZCOz0oXyxgOywfKAnGbgMClQaCAkILXgdeCD9IIGUgQj5fPoY+dT52Ao5CM0dAX9BTVG9SDzFwWTQAbxBzJF/lOEIQQglCCkKJIAls5AcClQICoKPMODEFxhi6KSAbiyfIRrMjtCgdWCAkPlFBIitCsEJRzAbMAV/OEyQzDg0OAQQEJ36i328/Mk9AybDJsQlq3tDRApUKAkFzXf1d/j9uALYP6hCoFgCTGD8kPsFKQiobrm0+zj0KSD8kPnVCRBwMDyJRTHFgMTJa5rwXQiQ2YfI/JD7BMEJEHGINTw4TOFlIRzwJO0icMQpyPyQ+wzJCRBv6DVgnKB01NgUKj2bwYzMqCoBkznBgEF+zYDIocwRIX+NgHj4HICNfh2C4CwdwFWpTG/lgUhYGAwRfv2Ts8mAaXzVgml/XYIJfuWC4HI1gUF9pYJZgMR6ilQHMAOwLAlDRefC0in4AXAEJA6PjCwc0IamOANMMCAECRQDFNRTZBgd+CwQlRA+r6+gLBDEFBnwUBXgKATIArwAGRAAHA3cDdAN2A3kDdwN9A3oDdQN7A30DfAN4A3oDfQAYEAAlAtYASwMAUAFsAHcKAHcAmgB3AHUAdQB2AHVu8UgAygDAAHcAdQB1AHYAdQALCgB3AAsAmgB3AAsCOwB3AAtu8UgAygDAAHgKAJoAdwB3AHUAdQB2AHUAeAB1AHUAdgB1bvFIAMoAwAALCgCaAHcACwB3AAsCOwB3AAtu8UgAygDAAH4ACwGgALcBpwC6AahdAu0COwLtbvFIAMoAwAALCgCaAu0ACwLtAAsCOwLtAAtu8UgAygDAA24ACwNvAAu0VsQAAzsAABCkjUIpAAsAUIusOggWcgMeBxVsGwL67U/2HlzmWOEeOgALASvuAAseAfpKUpnpGgYJDCIZM6YyARUE9ThqAD5iXQgnAJYJPnOzw0ZAEZxEKsIAkA4DhAHnTAIDxxUDK0lxCQlPYgIvIQVYJQBVqE1GakUAKGYiDToSBA1EtAYAXQJYAIF8GgMHRyAAIAjOe9YncekRAA0KACUrjwE7Ayc6AAYWAqaiKG4McEcqANoN3+Mg9TwCBhIkuCny+JwUQ29L008JluRxu3K+oAdqiHOqFH0AG5SUIfUJ5SxCGfxdipRzqTmT4V5Zb+r1Uo4Vm+NqSSEl2mNvR2JhIa8SpYO6ntdwFXHCWTCK8f2+Hxo7uiG3drDycAuKIMP5bhi06ACnqArH1rz4Rqg//lm6SgJGEVbF9xJHISaR6HxqxSnkw6shDnelHKNEfGUXSJRJ1GcsmtJw25xrZMDK9gXSm1/YMkdX4/6NKYOdtk/NQ3/NnDASjTc3fPjIjW/5sVfVObX2oTDWkr1dF9f3kxBsD3/3aQO8hPfRz+e0uEiJqt1161griu7gz8hDDwtpy+F+BWtefnKHZPAxcZoWbnznhJpy0e842j36bcNzGnIEusgGX0a8ZxsnjcSsPDZ09yZ36fCQbriHeQ72JRMILNl6ePPf2HWoVwgWAm1fb3V2sAY0+B6rAXqSwPBgseVmoqsBTSrm91+XasMYYySI8eeRxH3ZvHkMz3BQ5aJ3iUVbYPNM3/7emRtjlsMgv/9VyTsyt/mK+8fgWeT6SoFaclXqn42dAIsvAarF5vNNWHzKSkKQ/8Hfk5ZWK7r9yliOsooyBjRhfkHP4Q2DkWXQi6FG/9r/IwbmkV5T7JSopHKn1pJwm9tb5Ot0oyN1Z2mPpKXHTxx2nlK08fKk1hEYA8WgVVWL5lgx0iTv+KdojJeU23ZDjmiubXOxVXJKKi2Wjuh2HLZOFLiSC7Tls5SMh4f+Pj6xUSrNjFqLGehRNB8lC0QSLNmkJJx/wSG3MnjE9T1CkPwJI0wH2lfzwETIiVqUxg0dfu5q39Gt+hwdcxkhhNvQ4TyrBceof3Mhs/IxFci1HmHr4FMZgXEEczPiGCx0HRwzAqDq2j9AVm1kwN0mRVLWLylgtoPNapF5cY4Y1wJh/e0BBwZj44YgZrDNqvD/9Hv7GFYdUQeDJuQ3EWI4HaKqavU1XjC/n41kT4L79kqGq0kLhdTZvgP3TA3fS0ozVz+5piZsoOtIvBUFoMKbNcmBL6YxxaUAusHB38XrS8dQMnQwJfUUkpRoGr5AUeWicvBTzyK9g77+yCkf5PAysL7r/JjcZgrbvRpMW9iyaxZvKO6ceZN2EwIxKwVFPuvFuiEPGCoagbMo+SpydLrXqBzNCDGFCrO/rkcwa2xhokQZ5CdZ0AsU3JfSqJ6n5I14YA+P/uAgfhPU84Tlw7cEFfp7AEE8ey4sP12PTt4Cods1GRgDOB5xvyiR5m+Bx8O5nBCNctU8BevfV5A08x6RHd5jcwPTMDSZJOedIZ1cGQ704lxbAzqZOP05ZxaOghzSdvFBHYqomATARyAADK4elP8Ly3IrUZKfWh23Xy20uBUmLS4Pfagu9+oyVa2iPgqRP3F2CTUsvJ7+RYnN8fFZbU/HVvxvcFFDKkiTqV5UBZ3Gz54JAKByi9hkKMZJvuGgcSYXFmw08UyoQyVdfTD1/dMkCHXcTGAKeROgArsvmRrQTLUOXioOHGK2QkjHuoYFgXciZoTJd6Fs5q1QX1G+p/e26hYsEf7QZD1nnIyl/SFkNtYYmmBhpBrxl9WbY0YpHWRuw2Ll/tj9mD8P4snVzJl4F9J+1arVeTb9E5r2ILH04qStjxQNwn3m4YNqxmaNbLAqW2TN6LidwuJRqS+NXbtqxoeDXpxeGWmxzSkWxjkyCkX4NQRme6q5SAcC+M7+9ETfA/EwrzQajKakCwYyeunP6ZFlxU2oMEn1Pz31zeStW74G406ZJFCl1wAXIoUKkWotYEpOuXB1uVNxJ63dpJEqfxBeptwIHNrPz8BllZoIcBoXwgfJ+8VAUnVPvRvexnw0Ma/WiGYuJO5y8QTvEYBigFmhUxY5RqzE8OcywN/8m4UYrlaniJO75XQ6KSo9+tWHlu+hMi0UVdiKQp7NelnoZUzNaIyBPVeOwK6GNp+FfHuPOoyhaWuNvTYFkvxscMQWDh+zeFCFkgwbXftiV23ywJ4+uwRqmg9k3KzwIQpzppt8DBBOMbrqwQM5Gb05sEwdKzMiAqOloaA/lr0KA+1pr0/+HiWoiIjHA/wir2nIuS3PeU/ji3O6ZwoxcR1SZ9FhtLC5S0FIzFhbBWcGVP/KpxOPSiUoAdWUpqKH++6Scz507iCcxYI6rdMBICPJZea7OcmeFw5mObJSiqpjg2UoWNIs+cFhyDSt6geV5qgi3FunmwwDoGSMgerFOZGX1m0dMCYo5XOruxO063dwENK9DbnVM9wYFREzh4vyU1WYYJ/LRRp6oxgjqP/X5a8/4Af6p6NWkQferzBmXme0zY/4nwMJm/wd1tIqSwGz+E3xPEAOoZlJit3XddD7/BT1pllzOx+8bmQtANQ/S6fZexc6qi3W+Q2xcmXTUhuS5mpHQRvcxZUN0S5+PL9lXWUAaRZhEH8hTdAcuNMMCuVNKTEGtSUKNi3O6KhSaTzck8csZ2vWRZ+d7mW8c4IKwXIYd25S/zIftPkwPzufjEvOHWVD1m+FjpDVUTV0DGDuHj6QnaEwLu/dEgdLQOg9E1Sro9XHJ8ykLAwtPu+pxqKDuFexqON1sKQm7rwbE1E68UCfA/erovrTCG+DBSNg0l4goDQvZN6uNlbyLpcZAwj2UclycvLpIZMgv4yRlpb3YuMftozorbcGVHt/VeDV3+Fdf1TP0iuaCsPi2G4XeGhsyF1ubVDxkoJhmniQ0/jSg/eYML9KLfnCFgISWkp91eauR3IQvED0nAPXK+6hPCYs+n3+hCZbiskmVMG2da+0EsZPonUeIY8EbfusQXjsK/eFDaosbPjEfQS0RKG7yj5GG69M7MeO1HmiUYocgygJHL6M1qzUDDwUSmr99V7Sdr2F3JjQAJY+F0yH33Iv3+C9M38eML7gTgmNu/r2bUMiPvpYbZ6v1/IaESirBHNa7mPKn4dEmYg7v/+HQgPN1G79jBQ1+soydfDC2r+h2Bl/KIc5KjMK7OH6nb1jLsNf0EHVe2KBiE51ox636uyG6Lho0t3J34L5QY/ilE3mikaF4HKXG1mG1rCevT1Vv6GavltxoQe/bMrpZvRggnBxSEPEeEzkEdOxTnPXHVjUYdw8JYvjB/o7Eegc3Ma+NUxLLnsK0kJlinPmUHzHGtrk5+CAbVzFOBqpyy3QVUnzTDfC/0XD94/okH+OB+i7g9lolhWIjSnfIb+Eq43ZXOWmwvjyV/qqD+t0e+7mTEM74qP/Ozt8nmC7mRpyu63OB4KnUzFc074SqoyPUAgM+/TJGFo6T44EHnQU4X4z6qannVqgw/U7zCpwcmXV1AubIrvOmkKHazJAR55ePjp5tLBsN8vAqs3NAHdcEHOR2xQ0lsNAFzSUuxFQCFYvXLZJdOj9p4fNq6p0HBGUik2YzaI4xySy91KzhQ0+q1hjxvImRwPRf76tChlRkhRCi74NXZ9qUNeIwP+s5p+3m5nwPdNOHgSLD79n7O9m1n1uDHiMntq4nkYwV5OZ1ENbXxFd4PgrlvavZsyUO4MqYlqqn1O8W/I1dEZq5dXhrbETLaZIbC2Kj/Aa/QM+fqUOHdf0tXAQ1huZ3cmWECWSXy/43j35+Mvq9xws7JKseriZ1pEWKc8qlzNrGPUGcVgOa9cPJYIJsGnJTAUsEcDOEVULO5x0rXBijc1lgXEzQQKhROf8zIV82w8eswc78YX11KYLWQRcgHNJElBxfXr72lS2RBSl07qTKorO2uUDZr3sFhYsvnhLZn0A94KRzJ/7DEGIAhW5ZWFpL8gEwu1aLA9MuWZzNwl8Oze9Y+bX+v9gywRVnoB5I/8kXTXU3141yRLYrIOOz6SOnyHNy4SieqzkBXharjfjqq1q6tklaEbA8Qfm2DaIPs7OTq/nvJBjKfO2H9bH2cCMh1+5gspfycu8f/cuuRmtDjyqZ7uCIMyjdV3a+p3fqmXsRx4C8lujezIFHnQiVTXLXuI1XrwN3+siYYj2HHTvESUx8DlOTXpak9qFRK+L3mgJ1WsD7F4cu1aJoFoYQnu+wGDMOjJM3kiBQWHCcvhJ/HRdxodOQp45YZaOTA22Nb4XKCVxqkbwMYFhzYQYIAnCW8FW14uf98jhUG2zrKhQQ0q0CEq0t5nXyvUyvR8DvD69LU+g3i+HFWQMQ8PqZuHD+sNKAV0+M6EJC0szq7rEr7B5bQ8BcNHzvDMc9eqB5ZCQdTf80Obn4uzjwpYU7SISdtV0QGa9D3Wrh2BDQtpBKxaNFV+/Cy2P/Sv+8s7Ud0Fd74X4+o/TNztWgETUapy+majNQ68Lq3ee0ZO48VEbTZYiH1Co4OlfWef82RWeyUXo7woM03PyapGfikTnQinoNq5z5veLpeMV3HCAMTaZmA1oGLAn7XS3XYsz+XK7VMQsc4XKrmDXOLU/pSXVNUq8dIqTba///3x6LiLS6xs1xuCAYSfcQ3+rQgmu7uvf3THKt5Ooo97TqcbRqxx7EASizaQCBQllG/rYxVapMLgtLbZS64w1MDBMXX+PQpBKNwqUKOf2DDRDUXQf9EhOS0Qj4nTmlA8dzSLz/G1d+Ud8MTy/6ghhdiLpeerGY/UlDOfiuqFsMUU5/UYlP+BAmgRLuNpvrUaLlVkrqDievNVEAwF+4CoM1MZTmjxjJMsKJq+u8Zd7tNCUFy6LiyYXRJQ4VyvEQFFaCGKsxIwQkk7EzZ6LTJq2hUuPhvAW+gQnSG6J+MszC+7QCRHcnqDdyNRJ6T9xyS87A6MDutbzKGvGktpbXqtzWtXb9HsfK2cBMomjN9a4y+TaJLnXxAeX/HWzmf4cR4vALt/P4w4qgKY04ml4ZdLOinFYS6cup3G/1ie4+t1eOnpBNlqGqs75ilzkT4+DsZQxNvaSKJ//6zIbbk/M7LOhFmRc/1R+kBtz7JFGdZm/COotIdvQoXpTqP/1uqEUmCb/QWoGLMwO5ANcHzxdY48IGP5+J+zKOTBFZ4Pid+GTM+Wq12MV/H86xEJptBa6T+p3kgpwLedManBHC2GgNrFpoN2xnrMz9WFWX/8/ygSBkavq2Uv7FdCsLEYLu9LLIvAU0bNRDtzYl+/vXmjpIvuJFYjmI0im6QEYqnIeMsNjXG4vIutIGHijeAG/9EDBozKV5cldkHbLxHh25vT+ZEzbhXlqvpzKJwcEgfNwLAKFeo0/pvEE10XDB+EXRTXtSzJozQKFFAJhMxYkVaCW+E9AL7tMeU8acxidHqzb6lX4691UsDpy/LLRmT+epgW56+5Cw8tB4kMUv6s9lh3eRKbyGs+H/4mQMaYzPTf2OOdokEn+zzgvoD3FqNKk8QqGAXVsqcGdXrT62fSPkR2vROFi68A6se86UxRUk4cajfPyCC4G5wDhD+zNq4jodQ4u4n/m37Lr36n4LIAAsVr02dFi9AiwA81MYs2rm4eDlDNmdMRvEKRHfBwW5DdMNp0jPFZMeARqF/wL4XBfd+EMLBfMzpH5GH6NaW+1vrvMdg+VxDzatk3MXgO3ro3P/DpcC6+Mo4MySJhKJhSR01SGGGp5hPWmrrUgrv3lDnP+HhcI3nt3YqBoVAVTBAQT5iuhTg8nvPtd8ZeYj6w1x6RqGUBrSku7+N1+BaasZvjTk64RoIDlL8brpEcJx3OmY7jLoZsswdtmhfC/G21llXhITOwmvRDDeTTPbyASOa16cF5/A1fZAidJpqju3wYAy9avPR1ya6eNp9K8XYrrtuxlqi+bDKwlfrYdR0RRiKRVTLOH85+ZY7XSmzRpfZBJjaTa81VDcJHpZnZnSQLASGYW9l51ZV/h7eVzTi3Hv6hUsgc/51AqJRTkpbFVLXXszoBL8nBX0u/0jBLT8nH+fJePbrwURT58OY+UieRjd1vs04w0VG5VN2U6MoGZkQzKN/ptz0Q366dxoTGmj7i1NQGHi9GgnquXFYdrCfZBmeb7s0T6yrdlZH5cZuwHFyIJ/kAtGsTg0xH5taAAq44BAk1CPk9KVVbqQzrCUiFdF/6gtlPQ8bHHc1G1W92MXGZ5HEHftyLYs8mbD/9xYRUWkHmlM0zC2ilJlnNgV4bfALpQghxOUoZL7VTqtCHIaQSXm+YUMnpkXybnV+A6xlm2CVy8fn0Xlm2XRa0+zzOa21JWWmixfiPMSCZ7qA4rS93VN3pkpF1s5TonQjisHf7iU9ZGvUPOAKZcR1pbeVf/Ul7OhepGCaId9wOtqo7pJ7yLcBZ0pFkOF28y4zEI/kcUNmutBHaQpBdNM8vjCS6HZRokkeo88TBAjGyG7SR+6vUgTcyK9Imalj0kuxz0wmK+byQU11AiJFk/ya5dNduRClcnU64yGu/ieWSeOos1t3ep+RPIWQ2pyTYVbZltTbsb7NiwSi3AV+8KLWk7LxCnfZUetEM8ThnsSoGH38/nyAwFguJp8FjvlHtcWZuU4hPva0rHfr0UhOOJ/F6vS62FW7KzkmRll2HEc7oUq4fyi5T70Vl7YVIfsPHUCdHesf9Lk7WNVWO75JDkYbMI8TOW8JKVtLY9d6UJRITO8oKo0xS+o99Yy04iniGHAaGj88kEWgwv0OrHdY/nr76DOGNS59hXCGXzTKUvDl9iKpLSWYN1lxIeyywdNpTkhay74w2jFT6NS8qkjo5CxA1yfSYwp6AJIZNKIeEK5PJAW7ORgWgwp0VgzYpqovMrWxbu+DGZ6Lhie1RAqpzm8VUzKJOH3mCzWuTOLsN3VT/dv2eeYe9UjbR8YTBsLz7q60VN1sU51k+um1f8JxD5pPhbhSC8rRaB454tmh6YUWrJI3+GWY0qeWioj/tbkYITOkJaeuGt4JrJvHA+l0Gu7kY7XOaa05alMnRWVCXqFgLIwSY4uF59Ue5SU4QKuc/HamDxbr0x6csCetXGoP7Qn1Bk/J9DsynO/UD6iZ1Hyrz+jit0hDCwi/E9OjgKTbB3ZQKQ/0ZOvevfNHG0NK4Aj3Cp7NpRk07RT1i/S0EL93Ag8GRgKI9CfpajKyK6+Jj/PI1KO5/85VAwz2AwzP8FTBb075IxCXv6T9RVvWT2tUaqxDS92zrGUbWzUYk9mSs82pECH+fkqsDt93VW++4YsR/dHCYcQSYTO/KaBMDj9LSD/J/+z20Kq8XvZUAIHtm9hRPP3ItbuAu2Hm5lkPs92pd7kCxgRs0xOVBnZ13ccdA0aunrwv9SdqElJRC3g+oCu+nXyCgmXUs9yMjTMAIHfxZV+aPKcZeUBWt057Xo85Ks1Ir5gzEHCWqZEhrLZMuF11ziGtFQUds/EESajhagzcKsxamcSZxGth4UII+adPhQkUnx2WyN+4YWR+r3f8MnkyGFuR4zjzxJS8WsQYR5PTyRaD9ixa6Mh741nBHbzfjXHskGDq179xaRNrCIB1z1xRfWfjqw2pHc1zk9xlPpL8sQWAIuETZZhbnmL54rceXVNRvUiKrrqIkeogsl0XXb17ylNb0f4GA9Wd44vffEG8FSZGHEL2fbaTGRcSiCeA8PmA/f6Hz8HCS76fXUHwgwkzSwlI71ekZ7Fapmlk/KC+Hs8hUcw3N2LN5LhkVYyizYFl/uPeVP5lsoJHhhfWvvSWruCUW1ZcJOeuTbrDgywJ/qG07gZJplnTvLcYdNaH0KMYOYMGX+rB4NGPFmQsNaIwlWrfCezxre8zXBrsMT+edVLbLqN1BqB76JH4BvZTqUIMfGwPGEn+EnmTV86fPBaYbFL3DFEhjB45CewkXEAtJxk4/Ms2pPXnaRqdky0HOYdcUcE2zcXq4vaIvW2/v0nHFJH2XXe22ueDmq/18XGtELSq85j9X8q0tcNSSKJIX8FTuJF/Pf8j5PhqG2u+osvsLxYrvvfeVJL+4tkcXcr9JV7v0ERmj/X6fM3NC4j6dS1+9Umr2oPavqiAydTZPLMNRGY23LO9zAVDly7jD+70G5TPPLdhRIl4WxcYjLnM+SNcJ26FOrkrISUtPObIz5Zb3AG612krnpy15RMW+1cQjlnWFI6538qky9axd2oJmHIHP08KyP0ubGO+TQNOYuv2uh17yCIvR8VcStw7o1g0NM60sk+8Tq7YfIBJrtp53GkvzXH7OA0p8/n/u1satf/VJhtR1l8Wa6Gmaug7haSpaCaYQax6ta0mkutlb+eAOSG1aobM81D9A4iS1RRlzBBoVX6tU1S6WE2N9ORY6DfeLRC4l9Rvr5h95XDWB2mR1d4WFudpsgVYwiTwT31ljskD8ZyDOlm5DkGh9N/UB/0AI5Xvb8ZBmai2hQ4BWMqFwYnzxwB26YHSOv9WgY3JXnvoN+2R4rqGVh/LLDMtpFP+SpMGJNWvbIl5SOodbCczW2RKleksPoUeGEzrjtKHVdtZA+kfqO+rVx/iclCqwoopepvJpSTDjT+b9GWylGRF8EDbGlw6eUzmJM95Ovoz+kwLX3c2fTjFeYEsE7vUZm3mqdGJuKh2w9/QGSaqRHs99aScGOdDqkFcACoqdbBoQqqjamhH6Q9ng39JCg3lrGJwd50Qk9ovnqBTr8MME7Ps2wiVfygUmPoUBJJfJWX5Nda0nuncbFkA==")),Ob=new Set(Pb(Nb)),Db=new Set(Pb(Nb)),Lb=function(e){for(var t=[];;){var r=e();if(0==r)break;t.push(Bb(r,e))}for(;;){var n=e()-1;if(n<0)break;t.push(Mb(n,e))}return function(e){for(var t={},r=0;r<e.length;r++){var n=e[r];t[n[0]]=n[1]}return t}(_b(t))}(Nb),Ub=function(e){var t=Pb(e).sort((function(e,t){return e-t}));return function r(){var n=[];for(;;){var i=Pb(e,t);if(0==i.length)break;n.push({set:new Set(i),node:r()})}n.sort((function(e,t){return t.set.size-e.set.size}));var o=e();return{branches:n,valid:o%3,fe0f:!!(1&(o=o/3|0)),save:1==(o>>=1),check:2==o}}()}(Nb);function Fb(e){return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ny.current;return zy(Zy(e,t))}(e)}function zb(e){return e.filter((function(e){return 65039!=e}))}function Zb(e){var t,r=$e(e.split("."));try{for(r.s();!(t=r.n()).done;){var n=t.value,i=Fb(n);try{for(var o=i.lastIndexOf(95)-1;o>=0;o--)if(95!==i[o])throw new Error("underscore only allowed at start");if(i.length>=4&&i.every((function(e){return e<128}))&&45===i[2]&&45===i[3])throw new Error("invalid label extension")}catch(a){throw new Error('Invalid label "'.concat(n,'": ').concat(a.message))}}}catch(a){r.e(a)}finally{r.f()}return e}function jb(e){return Zb(function(e,t){var r=Fb(e).reverse(),n=[];for(;r.length;){var i=qb(r);if(i)n.push.apply(n,Jr(t(i)));else{var o=r.pop();if(Ob.has(o))n.push(o);else if(!Db.has(o)){var a=Lb[o];if(!a)throw new Error("Disallowed codepoint: 0x".concat(o.toString(16).toUpperCase()));n.push.apply(n,Jr(a))}}}return Zb((s=String.fromCodePoint.apply(String,n),s.normalize("NFC")));var s}(e,zb))}function qb(e,t){var r,n,i,o=Ub,a=[],s=e.length;t&&(t.length=0);for(var u=function(){var u=e[--s];if(o=null===(r=o.branches.find((function(e){return e.set.has(u)})))||void 0===r?void 0:r.node,!o)return"break";if(o.save)i=u;else if(o.check&&u===i)return"break";a.push(u),o.fe0f&&(a.push(65039),s>0&&65039==e[s-1]&&s--),o.valid&&(n=a.slice(),2==o.valid&&n.splice(1,1),t&&t.push.apply(t,Jr(e.slice(s).reverse())),e.length=s)};s;){if("break"===u())break}return n}var Kb=new cn(Dy),Vb=new Uint8Array(32);function Hb(e){if(0===e.length)throw new Error("invalid ENS name; empty component");return e}function Gb(e){var t=Zy(jb(e)),r=[];if(0===e.length)return r;for(var n=0,i=0;i<t.length;i++){46===t[i]&&(r.push(Hb(t.slice(n,i))),n=i+1)}if(n>=t.length)throw new Error("invalid ENS name; empty component");return r.push(Hb(t.slice(n))),r}function Wb(e){"string"!==typeof e&&Kb.throwArgumentError("invalid ENS name; not a string","name",e);for(var t=Vb,r=Gb(e);r.length;)t=Sy(yn([t,Sy(r.pop())]));return kn(t)}Vb.fill(0);var Qb=new cn("networks/5.7.1");function Jb(e){var t=function(t,r){null==r&&(r={});var n=[];if(t.InfuraProvider&&"-"!==r.infura)try{n.push(new t.InfuraProvider(e,r.infura))}catch(s){}if(t.EtherscanProvider&&"-"!==r.etherscan)try{n.push(new t.EtherscanProvider(e,r.etherscan))}catch(s){}if(t.AlchemyProvider&&"-"!==r.alchemy)try{n.push(new t.AlchemyProvider(e,r.alchemy))}catch(s){}if(t.PocketProvider&&"-"!==r.pocket){try{var i=new t.PocketProvider(e,r.pocket);i.network&&-1===["goerli","ropsten","rinkeby","sepolia"].indexOf(i.network.name)&&n.push(i)}catch(s){}}if(t.CloudflareProvider&&"-"!==r.cloudflare)try{n.push(new t.CloudflareProvider(e))}catch(s){}if(t.AnkrProvider&&"-"!==r.ankr)try{var o=new t.AnkrProvider(e,r.ankr);o.network&&-1===["ropsten"].indexOf(o.network.name)&&n.push(o)}catch(s){}if(0===n.length)return null;if(t.FallbackProvider){var a=1;return null!=r.quorum?a=r.quorum:"homestead"===e&&(a=2),new t.FallbackProvider(n,a)}return n[0]};return t.renetwork=function(e){return Jb(e)},t}function Yb(e,t){var r=function(r,n){return r.JsonRpcProvider?new r.JsonRpcProvider(e,t):null};return r.renetwork=function(t){return Yb(e,t)},r}var Xb={chainId:1,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"homestead",_defaultProvider:Jb("homestead")},$b={chainId:3,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"ropsten",_defaultProvider:Jb("ropsten")},ew={chainId:63,name:"classicMordor",_defaultProvider:Yb("https://www.ethercluster.com/mordor","classicMordor")},tw={unspecified:{chainId:0,name:"unspecified"},homestead:Xb,mainnet:Xb,morden:{chainId:2,name:"morden"},ropsten:$b,testnet:$b,rinkeby:{chainId:4,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"rinkeby",_defaultProvider:Jb("rinkeby")},kovan:{chainId:42,name:"kovan",_defaultProvider:Jb("kovan")},goerli:{chainId:5,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"goerli",_defaultProvider:Jb("goerli")},kintsugi:{chainId:1337702,name:"kintsugi"},sepolia:{chainId:11155111,name:"sepolia",_defaultProvider:Jb("sepolia")},classic:{chainId:61,name:"classic",_defaultProvider:Yb("https://www.ethercluster.com/etc","classic")},classicMorden:{chainId:62,name:"classicMorden"},classicMordor:ew,classicTestnet:ew,classicKotti:{chainId:6,name:"classicKotti",_defaultProvider:Yb("https://www.ethercluster.com/kotti","classicKotti")},xdai:{chainId:100,name:"xdai"},matic:{chainId:137,name:"matic",_defaultProvider:Jb("matic")},maticmum:{chainId:80001,name:"maticmum"},optimism:{chainId:10,name:"optimism",_defaultProvider:Jb("optimism")},"optimism-kovan":{chainId:69,name:"optimism-kovan"},"optimism-goerli":{chainId:420,name:"optimism-goerli"},arbitrum:{chainId:42161,name:"arbitrum"},"arbitrum-rinkeby":{chainId:421611,name:"arbitrum-rinkeby"},"arbitrum-goerli":{chainId:421613,name:"arbitrum-goerli"},bnb:{chainId:56,name:"bnb"},bnbt:{chainId:97,name:"bnbt"}};new cn("sha2/5.7.0");function rw(e){return"0x"+um().sha256().update(gn(e)).digest("hex")}var nw=__webpack_require__(2571),iw=__webpack_require__.n(nw),ow=new cn(ay),aw=function(){function e(){(0,D.Z)(this,e),this.formats=this.getDefaultFormats()}return(0,O.Z)(e,[{key:"getDefaultFormats",value:function(){var t=this,r={},n=this.address.bind(this),i=this.bigNumber.bind(this),o=this.blockTag.bind(this),a=this.data.bind(this),s=this.hash.bind(this),u=this.hex.bind(this),c=this.number.bind(this),l=this.type.bind(this);return r.transaction={hash:s,type:l,accessList:e.allowNull(this.accessList.bind(this),null),blockHash:e.allowNull(s,null),blockNumber:e.allowNull(c,null),transactionIndex:e.allowNull(c,null),confirmations:e.allowNull(c,null),from:n,gasPrice:e.allowNull(i),maxPriorityFeePerGas:e.allowNull(i),maxFeePerGas:e.allowNull(i),gasLimit:i,to:e.allowNull(n,null),value:i,nonce:c,data:a,r:e.allowNull(this.uint256),s:e.allowNull(this.uint256),v:e.allowNull(c),creates:e.allowNull(n,null),raw:e.allowNull(a)},r.transactionRequest={from:e.allowNull(n),nonce:e.allowNull(c),gasLimit:e.allowNull(i),gasPrice:e.allowNull(i),maxPriorityFeePerGas:e.allowNull(i),maxFeePerGas:e.allowNull(i),to:e.allowNull(n),value:e.allowNull(i),data:e.allowNull((function(e){return t.data(e,!0)})),type:e.allowNull(c),accessList:e.allowNull(this.accessList.bind(this),null)},r.receiptLog={transactionIndex:c,blockNumber:c,transactionHash:s,address:n,topics:e.arrayOf(s),data:a,logIndex:c,blockHash:s},r.receipt={to:e.allowNull(this.address,null),from:e.allowNull(this.address,null),contractAddress:e.allowNull(n,null),transactionIndex:c,root:e.allowNull(u),gasUsed:i,logsBloom:e.allowNull(a),blockHash:s,transactionHash:s,logs:e.arrayOf(this.receiptLog.bind(this)),blockNumber:c,confirmations:e.allowNull(c,null),cumulativeGasUsed:i,effectiveGasPrice:e.allowNull(i),status:e.allowNull(c),type:l},r.block={hash:e.allowNull(s),parentHash:s,number:c,timestamp:c,nonce:e.allowNull(u),difficulty:this.difficulty.bind(this),gasLimit:i,gasUsed:i,miner:e.allowNull(n),extraData:a,transactions:e.allowNull(e.arrayOf(s)),baseFeePerGas:e.allowNull(i)},r.blockWithTransactions=ey(r.block),r.blockWithTransactions.transactions=e.allowNull(e.arrayOf(this.transactionResponse.bind(this))),r.filter={fromBlock:e.allowNull(o,void 0),toBlock:e.allowNull(o,void 0),blockHash:e.allowNull(s,void 0),address:e.allowNull(n,void 0),topics:e.allowNull(this.topics.bind(this),void 0)},r.filterLog={blockNumber:e.allowNull(c),blockHash:e.allowNull(s),transactionIndex:c,removed:e.allowNull(this.boolean.bind(this)),address:n,data:e.allowFalsish(a,"0x"),topics:e.arrayOf(s),transactionHash:s,logIndex:c},r}},{key:"accessList",value:function(e){return nb(e||[])}},{key:"number",value:function(e){return"0x"===e?0:by.from(e).toNumber()}},{key:"type",value:function(e){return"0x"===e||null==e?0:by.from(e).toNumber()}},{key:"bigNumber",value:function(e){return by.from(e)}},{key:"boolean",value:function(e){if("boolean"===typeof e)return e;if("string"===typeof e){if("true"===(e=e.toLowerCase()))return!0;if("false"===e)return!1}throw new Error("invalid boolean - "+e)}},{key:"hex",value:function(e,t){return"string"===typeof e&&(t||"0x"===e.substring(0,2)||(e="0x"+e),bn(e))?e.toLowerCase():ow.throwArgumentError("invalid hash","value",e)}},{key:"data",value:function(e,t){var r=this.hex(e,t);if(r.length%2!==0)throw new Error("invalid data; odd-length - "+e);return r}},{key:"address",value:function(e){return My(e)}},{key:"callAddress",value:function(e){if(!bn(e,32))return null;var t=My(xn(e,12));return"0x0000000000000000000000000000000000000000"===t?null:t}},{key:"contractAddress",value:function(e){return function(e){var t=null;try{t=My(e.from)}catch(r){_y.throwArgumentError("missing from address","transaction",e)}return My(xn(Sy(Bn([t,mn(gn(by.from(e.nonce).toHexString()))])),12))}(e)}},{key:"blockTag",value:function(e){if(null==e)return"latest";if("earliest"===e)return"0x0";switch(e){case"earliest":return"0x0";case"latest":case"pending":case"safe":case"finalized":return e}if("number"===typeof e||bn(e))return _n(e);throw new Error("invalid blockTag")}},{key:"hash",value:function(e,t){var r=this.hex(e,t);return 32!==En(r)?ow.throwArgumentError("invalid hash","value",e):r}},{key:"difficulty",value:function(e){if(null==e)return null;var t=by.from(e);try{return t.toNumber()}catch(r){}return null}},{key:"uint256",value:function(e){if(!bn(e))throw new Error("invalid uint256");return An(e,32)}},{key:"_block",value:function(t,r){null!=t.author&&null==t.miner&&(t.miner=t.author);var n=null!=t._difficulty?t._difficulty:t.difficulty,i=e.check(r,t);return i._difficulty=null==n?null:by.from(n),i}},{key:"block",value:function(e){return this._block(e,this.formats.block)}},{key:"blockWithTransactions",value:function(e){return this._block(e,this.formats.blockWithTransactions)}},{key:"transactionRequest",value:function(t){return e.check(this.formats.transactionRequest,t)}},{key:"transactionResponse",value:function(t){null!=t.gas&&null==t.gasLimit&&(t.gasLimit=t.gas),t.to&&by.from(t.to).isZero()&&(t.to="0x0000000000000000000000000000000000000000"),null!=t.input&&null==t.data&&(t.data=t.input),null==t.to&&null==t.creates&&(t.creates=this.contractAddress(t)),1!==t.type&&2!==t.type||null!=t.accessList||(t.accessList=[]);var r=e.check(this.formats.transaction,t);if(null!=t.chainId){var n=t.chainId;bn(n)&&(n=by.from(n).toNumber()),r.chainId=n}else{var i=t.networkId;null==i&&null==r.v&&(i=t.chainId),bn(i)&&(i=by.from(i).toNumber()),"number"!==typeof i&&null!=r.v&&((i=(r.v-35)/2)<0&&(i=0),i=parseInt(i)),"number"!==typeof i&&(i=0),r.chainId=i}return r.blockHash&&"x"===r.blockHash.replace(/0/g,"")&&(r.blockHash=null),r}},{key:"transaction",value:function(e){return ub(e)}},{key:"receiptLog",value:function(t){return e.check(this.formats.receiptLog,t)}},{key:"receipt",value:function(t){var r=e.check(this.formats.receipt,t);if(null!=r.root)if(r.root.length<=4){var n=by.from(r.root).toNumber();0===n||1===n?(null!=r.status&&r.status!==n&&ow.throwArgumentError("alt-root-status/status mismatch","value",{root:r.root,status:r.status}),r.status=n,delete r.root):ow.throwArgumentError("invalid alt-root-status","value.root",r.root)}else 66!==r.root.length&&ow.throwArgumentError("invalid root hash","value.root",r.root);return null!=r.status&&(r.byzantium=!0),r}},{key:"topics",value:function(e){var t=this;return Array.isArray(e)?e.map((function(e){return t.topics(e)})):null!=e?this.hash(e,!0):null}},{key:"filter",value:function(t){return e.check(this.formats.filter,t)}},{key:"filterLog",value:function(t){return e.check(this.formats.filterLog,t)}}],[{key:"check",value:function(e,t){var r={};for(var n in e)try{var i=e[n](t[n]);void 0!==i&&(r[n]=i)}catch(o){throw o.checkKey=n,o.checkValue=t[n],o}return r}},{key:"allowNull",value:function(e,t){return function(r){return null==r?t:e(r)}}},{key:"allowFalsish",value:function(e,t){return function(r){return r?e(r):t}}},{key:"arrayOf",value:function(e){return function(t){if(!Array.isArray(t))throw new Error("not an array");var r=[];return t.forEach((function(t){r.push(e(t))})),r}}}]),e}();var sw=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(t){o(t)}}function s(e){try{u(n.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},uw=new cn(ay);function cw(e){return null==e?"null":(32!==En(e)&&uw.throwArgumentError("invalid topic","topic",e),e.toLowerCase())}function lw(e){for(e=e.slice();e.length>0&&null==e[e.length-1];)e.pop();return e.map((function(e){if(Array.isArray(e)){var t={};e.forEach((function(e){t[cw(e)]=!0}));var r=Object.keys(t);return r.sort(),r.join("|")}return cw(e)})).join("&")}function fw(e){if("string"===typeof e){if(32===En(e=e.toLowerCase()))return"tx:"+e;if(-1===e.indexOf(":"))return e}else{if(Array.isArray(e))return"filter:*:"+lw(e);if(kb.isForkEvent(e))throw uw.warn("not implemented"),new Error("not implemented");if(e&&"object"===typeof e)return"filter:"+(e.address||"*")+":"+lw(e.topics||[])}throw new Error("invalid event - "+e)}function hw(){return(new Date).getTime()}function dw(e){return new Promise((function(t){setTimeout(t,e)}))}var pw=["block","network","pending","poll"],vw=function(){function e(t,r,n){(0,D.Z)(this,e),Yg(this,"tag",t),Yg(this,"listener",r),Yg(this,"once",n),this._lastBlockNumber=-2,this._inflight=!1}return(0,O.Z)(e,[{key:"event",get:function(){switch(this.type){case"tx":return this.hash;case"filter":return this.filter}return this.tag}},{key:"type",get:function(){return this.tag.split(":")[0]}},{key:"hash",get:function(){var e=this.tag.split(":");return"tx"!==e[0]?null:e[1]}},{key:"filter",get:function(){var e=this.tag.split(":");if("filter"!==e[0])return null;var t,r=e[1],n=""===(t=e[2])?[]:t.split(/&/g).map((function(e){if(""===e)return[];var t=e.split("|").map((function(e){return"null"===e?null:e}));return 1===t.length?t[0]:t})),i={};return n.length>0&&(i.topics=n),r&&"*"!==r&&(i.address=r),i}},{key:"pollable",value:function(){return this.tag.indexOf(":")>=0||pw.indexOf(this.tag)>=0}}]),e}(),gw={0:{symbol:"btc",p2pkh:0,p2sh:5,prefix:"bc"},2:{symbol:"ltc",p2pkh:48,p2sh:50,prefix:"ltc"},3:{symbol:"doge",p2pkh:30,p2sh:22},60:{symbol:"eth",ilk:"eth"},61:{symbol:"etc",ilk:"eth"},700:{symbol:"xdai",ilk:"eth"}};function yw(e){return An(by.from(e).toHexString(),32)}function mw(e){return Sb.encode(yn([e,xn(rw(rw(e)),0,4)]))}var bw=new RegExp("^(ipfs)://(.*)$","i"),ww=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),bw,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function kw(e,t){try{return jy(Ew(e,t))}catch(r){}return null}function Ew(e,t){if("0x"===e)return null;var r=by.from(xn(e,t,t+32)).toNumber(),n=by.from(xn(e,r,r+32)).toNumber();return xn(e,r+32,r+32+n)}function xw(e){return e.match(/^ipfs:\/\/ipfs\//i)?e=e.substring(12):e.match(/^ipfs:\/\//i)?e=e.substring(7):uw.throwArgumentError("unsupported IPFS format","link",e),"https://gateway.ipfs.io/ipfs/".concat(e)}function Sw(e){var t=gn(e);if(t.length>32)throw new Error("internal; should not happen");var r=new Uint8Array(32);return r.set(t,32-t.length),r}function _w(e){if(e.length%32===0)return e;var t=new Uint8Array(32*Math.ceil(e.length/32));return t.set(e),t}function Aw(e){for(var t=[],r=0,n=0;n<e.length;n++)t.push(null),r+=32;for(var i=0;i<e.length;i++){var o=gn(e[i]);t[i]=Sw(r),t.push(Sw(o.length)),t.push(_w(o)),r+=32+32*Math.ceil(o.length/32)}return Sn(t)}var Iw=function(){function e(t,r,n,i){(0,D.Z)(this,e),Yg(this,"provider",t),Yg(this,"name",n),Yg(this,"address",t.formatter.address(r)),Yg(this,"_resolvedAddress",i)}return(0,O.Z)(e,[{key:"supportsWildcard",value:function(){var e=this;return this._supportsEip2544||(this._supportsEip2544=this.provider.call({to:this.address,data:"0x01ffc9a79061b92300000000000000000000000000000000000000000000000000000000"}).then((function(e){return by.from(e).eq(1)})).catch((function(t){if(t.code===cn.errors.CALL_EXCEPTION)return!1;throw e._supportsEip2544=null,t}))),this._supportsEip2544}},{key:"_fetch",value:function(e,t){return sw(this,void 0,void 0,(0,k.Z)().mark((function r(){var n,i,o;return(0,k.Z)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return n={to:this.address,ccipReadEnabled:!0,data:Sn([e,Wb(this.name),t||"0x"])},i=!1,r.next=4,this.supportsWildcard();case 4:if(!r.sent){r.next=7;break}i=!0,n.data=Sn(["0x9061b923",Aw([(a=this.name,kn(yn(Gb(a).map((function(e){if(e.length>63)throw new Error("invalid DNS encoded entry; length exceeds 63 bytes");var t=new Uint8Array(e.length+1);return t.set(e,1),t[0]=t.length-1,t}))))+"00"),n.data])]);case 7:return r.prev=7,r.next=10,this.provider.call(n);case 10:return gn(o=r.sent).length%32===4&&uw.throwError("resolver threw error",cn.errors.CALL_EXCEPTION,{transaction:n,data:o}),i&&(o=Ew(o,0)),r.abrupt("return",o);case 16:if(r.prev=16,r.t0=r.catch(7),r.t0.code!==cn.errors.CALL_EXCEPTION){r.next=20;break}return r.abrupt("return",null);case 20:throw r.t0;case 21:case"end":return r.stop()}var a}),r,this,[[7,16]])})))}},{key:"_fetchBytes",value:function(e,t){return sw(this,void 0,void 0,(0,k.Z)().mark((function r(){var n;return(0,k.Z)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this._fetch(e,t);case 2:if(null==(n=r.sent)){r.next=5;break}return r.abrupt("return",Ew(n,0));case 5:return r.abrupt("return",null);case 6:case"end":return r.stop()}}),r,this)})))}},{key:"_getAddress",value:function(e,t){var r=gw[String(e)];if(null==r&&uw.throwError("unsupported coin type: ".concat(e),cn.errors.UNSUPPORTED_OPERATION,{operation:"getAddress(".concat(e,")")}),"eth"===r.ilk)return this.provider.formatter.address(t);var n=gn(t);if(null!=r.p2pkh){var i=t.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);if(i){var o=parseInt(i[1],16);if(i[2].length===2*o&&o>=1&&o<=75)return mw(yn([[r.p2pkh],"0x"+i[2]]))}}if(null!=r.p2sh){var a=t.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);if(a){var s=parseInt(a[1],16);if(a[2].length===2*s&&s>=1&&s<=75)return mw(yn([[r.p2sh],"0x"+a[2]]))}}if(null!=r.prefix){var u=n[1],c=n[0];if(0===c?20!==u&&32!==u&&(c=-1):c=-1,c>=0&&n.length===2+u&&u>=1&&u<=75){var l=iw().toWords(n.slice(2));return l.unshift(c),iw().encode(r.prefix,l)}}return null}},{key:"getAddress",value:function(e){return sw(this,void 0,void 0,(0,k.Z)().mark((function t(){var r,n,i;return(0,k.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null==e&&(e=60),60!==e){t.next=16;break}return t.prev=2,t.next=5,this._fetch("0x3b3b57de");case 5:if("0x"!==(r=t.sent)&&"0x0000000000000000000000000000000000000000000000000000000000000000"!==r){t.next=8;break}return t.abrupt("return",null);case 8:return t.abrupt("return",this.provider.formatter.callAddress(r));case 11:if(t.prev=11,t.t0=t.catch(2),t.t0.code!==cn.errors.CALL_EXCEPTION){t.next=15;break}return t.abrupt("return",null);case 15:throw t.t0;case 16:return t.next=18,this._fetchBytes("0xf1cb7e06",yw(e));case 18:if(null!=(n=t.sent)&&"0x"!==n){t.next=21;break}return t.abrupt("return",null);case 21:return null==(i=this._getAddress(e,n))&&uw.throwError("invalid or unsupported coin data",cn.errors.UNSUPPORTED_OPERATION,{operation:"getAddress(".concat(e,")"),coinType:e,data:n}),t.abrupt("return",i);case 24:case"end":return t.stop()}}),t,this,[[2,11]])})))}},{key:"getAvatar",value:function(){return sw(this,void 0,void 0,(0,k.Z)().mark((function e(){var t,r,n,i,o,a,s,u,c,l,f,h,d,p,v,g;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=[{type:"name",content:this.name}],e.prev=1,e.next=4,this.getText("avatar");case 4:if(null!=(r=e.sent)){e.next=7;break}return e.abrupt("return",null);case 7:n=0;case 8:if(!(n<ww.length)){e.next=91;break}if(null!=(i=r.match(ww[n]))){e.next=12;break}return e.abrupt("continue",88);case 12:o=i[1].toLowerCase(),e.t0=o,e.next="https"===e.t0?16:"data"===e.t0?18:"ipfs"===e.t0?20:"erc721"===e.t0||"erc1155"===e.t0?22:88;break;case 16:return t.push({type:"url",content:r}),e.abrupt("return",{linkage:t,url:r});case 18:return t.push({type:"data",content:r}),e.abrupt("return",{linkage:t,url:r});case 20:return t.push({type:"ipfs",content:r}),e.abrupt("return",{linkage:t,url:xw(r)});case 22:if(a="erc721"===o?"0xc87b56dd":"0x0e89341c",t.push({type:o,content:r}),e.t1=this._resolvedAddress,e.t1){e.next=29;break}return e.next=28,this.getAddress();case 28:e.t1=e.sent;case 29:if(s=e.t1,2===(u=(i[2]||"").split("/")).length){e.next=33;break}return e.abrupt("return",null);case 33:return e.next=35,this.provider.formatter.address(u[0]);case 35:if(c=e.sent,l=An(by.from(u[1]).toHexString(),32),"erc721"!==o){e.next=48;break}return e.t2=this.provider.formatter,e.next=41,this.provider.call({to:c,data:Sn(["0x6352211e",l])});case 41:if(e.t3=e.sent,f=e.t2.callAddress.call(e.t2,e.t3),s===f){e.next=45;break}return e.abrupt("return",null);case 45:t.push({type:"owner",content:f}),e.next=57;break;case 48:if("erc1155"!==o){e.next=57;break}return e.t4=by,e.next=52,this.provider.call({to:c,data:Sn(["0x00fdd58e",An(s,32),l])});case 52:if(e.t5=e.sent,!(h=e.t4.from.call(e.t4,e.t5)).isZero()){e.next=56;break}return e.abrupt("return",null);case 56:t.push({type:"balance",content:h.toString()});case 57:return d={to:this.provider.formatter.address(u[0]),data:Sn([a,l])},e.t6=kw,e.next=61,this.provider.call(d);case 61:if(e.t7=e.sent,null!=(p=(0,e.t6)(e.t7,0))){e.next=65;break}return e.abrupt("return",null);case 65:return t.push({type:"metadata-url-base",content:p}),"erc1155"===o&&(p=p.replace("{id}",l.substring(2)),t.push({type:"metadata-url-expanded",content:p})),p.match(/^ipfs:/i)&&(p=xw(p)),t.push({type:"metadata-url",content:p}),e.next=71,yb(p);case 71:if(v=e.sent){e.next=74;break}return e.abrupt("return",null);case 74:if(t.push({type:"metadata",content:JSON.stringify(v)}),"string"===typeof(g=v.image)){e.next=78;break}return e.abrupt("return",null);case 78:if(!g.match(/^(https:\/\/|data:)/i)){e.next=81;break}e.next=86;break;case 81:if(null!=g.match(bw)){e.next=84;break}return e.abrupt("return",null);case 84:t.push({type:"url-ipfs",content:g}),g=xw(g);case 86:return t.push({type:"url",content:g}),e.abrupt("return",{linkage:t,url:g});case 88:n++,e.next=8;break;case 91:e.next=95;break;case 93:e.prev=93,e.t8=e.catch(1);case 95:return e.abrupt("return",null);case 96:case"end":return e.stop()}}),e,this,[[1,93]])})))}},{key:"getContentHash",value:function(){return sw(this,void 0,void 0,(0,k.Z)().mark((function e(){var t,r,n,i,o,a,s,u,c;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._fetchBytes("0xbc1c58d1");case 2:if(null!=(t=e.sent)&&"0x"!==t){e.next=5;break}return e.abrupt("return",null);case 5:if(!(r=t.match(/^0xe3010170(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/))){e.next=10;break}if(n=parseInt(r[3],16),r[4].length!==2*n){e.next=10;break}return e.abrupt("return","ipfs://"+Sb.encode("0x"+r[1]));case 10:if(!(i=t.match(/^0xe5010172(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/))){e.next=15;break}if(o=parseInt(i[3],16),i[4].length!==2*o){e.next=15;break}return e.abrupt("return","ipns://"+Sb.encode("0x"+i[1]));case 15:if(!(a=t.match(/^0xe40101fa011b20([0-9a-f]*)$/))){e.next=19;break}if(64!==a[1].length){e.next=19;break}return e.abrupt("return","bzz://"+a[1]);case 19:if(!(s=t.match(/^0x90b2c605([0-9a-f]*)$/))){e.next=25;break}if(68!==s[1].length){e.next=25;break}return u={"=":"","+":"-","/":"_"},c=lb("0x"+s[1]).replace(/[=+\/]/g,(function(e){return u[e]})),e.abrupt("return","sia://"+c);case 25:return e.abrupt("return",uw.throwError("invalid or unsupported content hash data",cn.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:t}));case 26:case"end":return e.stop()}}),e,this)})))}},{key:"getText",value:function(e){return sw(this,void 0,void 0,(0,k.Z)().mark((function t(){var r,n;return(0,k.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=Zy(e),(r=yn([yw(64),yw(r.length),r])).length%32!==0&&(r=yn([r,An("0x",32-e.length%32)])),t.next=5,this._fetchBytes("0x59d1d43c",kn(r));case 5:if(null!=(n=t.sent)&&"0x"!==n){t.next=8;break}return t.abrupt("return",null);case 8:return t.abrupt("return",jy(n));case 9:case"end":return t.stop()}}),t,this)})))}}]),e}(),Cw=null,Tw=1,Pw=function(e){U(r,e);var t=K(r);function r(e){var n;if((0,D.Z)(this,r),(n=t.call(this))._events=[],n._emitted={block:-2},n.disableCcipRead=!1,n.formatter=(this instanceof r?this.constructor:void 0).getFormatter(),Yg(j(n),"anyNetwork","any"===e),n.anyNetwork&&(e=n.detectNetwork()),e instanceof Promise)n._networkPromise=e,e.catch((function(e){})),n._ready().catch((function(e){}));else{var i=Xg(this instanceof r?this.constructor:void 0,"getNetwork")(e);i?(Yg(j(n),"_network",i),n.emit("network",i,null)):uw.throwArgumentError("invalid network","network",e)}return n._maxInternalBlockNumber=-1024,n._lastBlockNumber=-2,n._maxFilterBlockRange=10,n._pollingInterval=4e3,n._fastQueryDate=0,n}return(0,O.Z)(r,[{key:"_ready",value:function(){return sw(this,void 0,void 0,(0,k.Z)().mark((function e(){var t;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=this._network){e.next=17;break}if(t=null,!this._networkPromise){e.next=11;break}return e.prev=3,e.next=6,this._networkPromise;case 6:t=e.sent,e.next=11;break;case 9:e.prev=9,e.t0=e.catch(3);case 11:if(null!=t){e.next=15;break}return e.next=14,this.detectNetwork();case 14:t=e.sent;case 15:t||uw.throwError("no network detected",cn.errors.UNKNOWN_ERROR,{}),null==this._network&&(this.anyNetwork?this._network=t:Yg(this,"_network",t),this.emit("network",t,null));case 17:return e.abrupt("return",this._network);case 18:case"end":return e.stop()}}),e,this,[[3,9]])})))}},{key:"ready",get:function(){var e=this;return mb((function(){return e._ready().then((function(e){return e}),(function(e){if(e.code!==cn.errors.NETWORK_ERROR||"noNetwork"!==e.event)throw e}))}))}},{key:"ccipReadFetch",value:function(e,t,r){return sw(this,void 0,void 0,(0,k.Z)().mark((function n(){var i,o,a,s,u,c,l,f,h;return(0,k.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!this.disableCcipRead&&0!==r.length){n.next=2;break}return n.abrupt("return",null);case 2:i=e.to.toLowerCase(),o=t.toLowerCase(),a=[],s=0;case 6:if(!(s<r.length)){n.next=22;break}return u=r[s],c=u.replace("{sender}",i).replace("{data}",o),l=u.indexOf("{data}")>=0?null:JSON.stringify({data:o,sender:i}),n.next=12,yb({url:c,errorPassThrough:!0},l,(function(e,t){return e.status=t.statusCode,e}));case 12:if(!(f=n.sent).data){n.next=15;break}return n.abrupt("return",f.data);case 15:if(h=f.message||"unknown error",!(f.status>=400&&f.status<500)){n.next=18;break}return n.abrupt("return",uw.throwError("response not found during CCIP fetch: ".concat(h),cn.errors.SERVER_ERROR,{url:u,errorMessage:h}));case 18:a.push(h);case 19:s++,n.next=6;break;case 22:return n.abrupt("return",uw.throwError("error encountered during CCIP fetch: ".concat(a.map((function(e){return JSON.stringify(e)})).join(", ")),cn.errors.SERVER_ERROR,{urls:r,errorMessages:a}));case 23:case"end":return n.stop()}}),n,this)})))}},{key:"_getInternalBlockNumber",value:function(e){return sw(this,void 0,void 0,(0,k.Z)().mark((function t(){var r,n,i,o,a=this;return(0,k.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._ready();case 2:if(!(e>0)){t.next=20;break}case 3:if(!this._internalBlockNumber){t.next=20;break}return r=this._internalBlockNumber,t.prev=5,t.next=8,r;case 8:if(n=t.sent,!(hw()-n.respTime<=e)){t.next=11;break}return t.abrupt("return",n.blockNumber);case 11:return t.abrupt("break",20);case 14:if(t.prev=14,t.t0=t.catch(5),this._internalBlockNumber!==r){t.next=18;break}return t.abrupt("break",20);case 18:t.next=3;break;case 20:return i=hw(),o=$g({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then((function(e){return null}),(function(e){return e}))}).then((function(e){var t=e.blockNumber,r=e.networkError;if(r)throw a._internalBlockNumber===o&&(a._internalBlockNumber=null),r;var n=hw();return(t=by.from(t).toNumber())<a._maxInternalBlockNumber&&(t=a._maxInternalBlockNumber),a._maxInternalBlockNumber=t,a._setFastBlockNumber(t),{blockNumber:t,reqTime:i,respTime:n}})),this._internalBlockNumber=o,o.catch((function(e){a._internalBlockNumber===o&&(a._internalBlockNumber=null)})),t.next=26,o;case 26:return t.abrupt("return",t.sent.blockNumber);case 27:case"end":return t.stop()}}),t,this,[[5,14]])})))}},{key:"poll",value:function(){return sw(this,void 0,void 0,(0,k.Z)().mark((function e(){var t,r,n,i,o=this;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=Tw++,r=[],n=null,e.prev=3,e.next=6,this._getInternalBlockNumber(100+this.pollingInterval/2);case 6:n=e.sent,e.next=13;break;case 9:return e.prev=9,e.t0=e.catch(3),this.emit("error",e.t0),e.abrupt("return");case 13:if(this._setFastBlockNumber(n),this.emit("poll",t,n),n!==this._lastBlockNumber){e.next=18;break}return this.emit("didPoll",t),e.abrupt("return");case 18:if(-2===this._emitted.block&&(this._emitted.block=n-1),Math.abs(this._emitted.block-n)>1e3)uw.warn("network block skew detected; skipping block events (emitted=".concat(this._emitted.block," blockNumber").concat(n,")")),this.emit("error",uw.makeError("network block skew detected",cn.errors.NETWORK_ERROR,{blockNumber:n,event:"blockSkew",previousBlockNumber:this._emitted.block})),this.emit("block",n);else for(i=this._emitted.block+1;i<=n;i++)this.emit("block",i);return this._emitted.block!==n&&(this._emitted.block=n,Object.keys(this._emitted).forEach((function(e){if("block"!==e){var t=o._emitted[e];"pending"!==t&&n-t>12&&delete o._emitted[e]}}))),-2===this._lastBlockNumber&&(this._lastBlockNumber=n-1),this._events.forEach((function(e){switch(e.type){case"tx":var t=e.hash,i=o.getTransactionReceipt(t).then((function(e){return e&&null!=e.blockNumber?(o._emitted["t:"+t]=e.blockNumber,o.emit(t,e),null):null})).catch((function(e){o.emit("error",e)}));r.push(i);break;case"filter":if(!e._inflight){e._inflight=!0,-2===e._lastBlockNumber&&(e._lastBlockNumber=n-1);var a=e.filter;a.fromBlock=e._lastBlockNumber+1,a.toBlock=n;var s=a.toBlock-o._maxFilterBlockRange;s>a.fromBlock&&(a.fromBlock=s),a.fromBlock<0&&(a.fromBlock=0);var u=o.getLogs(a).then((function(t){e._inflight=!1,0!==t.length&&t.forEach((function(t){t.blockNumber>e._lastBlockNumber&&(e._lastBlockNumber=t.blockNumber),o._emitted["b:"+t.blockHash]=t.blockNumber,o._emitted["t:"+t.transactionHash]=t.blockNumber,o.emit(a,t)}))})).catch((function(t){o.emit("error",t),e._inflight=!1}));r.push(u)}}})),this._lastBlockNumber=n,Promise.all(r).then((function(){o.emit("didPoll",t)})).catch((function(e){o.emit("error",e)})),e.abrupt("return");case 26:case"end":return e.stop()}}),e,this,[[3,9]])})))}},{key:"resetEventsBlock",value:function(e){this._lastBlockNumber=e-1,this.polling&&this.poll()}},{key:"network",get:function(){return this._network}},{key:"detectNetwork",value:function(){return sw(this,void 0,void 0,(0,k.Z)().mark((function e(){return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",uw.throwError("provider does not support network detection",cn.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"}));case 1:case"end":return e.stop()}}),e)})))}},{key:"getNetwork",value:function(){return sw(this,void 0,void 0,(0,k.Z)().mark((function e(){var t,r,n;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._ready();case 2:return t=e.sent,e.next=5,this.detectNetwork();case 5:if(r=e.sent,t.chainId===r.chainId){e.next=23;break}if(!this.anyNetwork){e.next=20;break}return this._network=r,this._lastBlockNumber=-2,this._fastBlockNumber=null,this._fastBlockNumberPromise=null,this._fastQueryDate=0,this._emitted.block=-2,this._maxInternalBlockNumber=-1024,this._internalBlockNumber=null,this.emit("network",r,t),e.next=19,dw(0);case 19:return e.abrupt("return",this._network);case 20:throw n=uw.makeError("underlying network changed",cn.errors.NETWORK_ERROR,{event:"changed",network:t,detectedNetwork:r}),this.emit("error",n),n;case 23:return e.abrupt("return",t);case 24:case"end":return e.stop()}}),e,this)})))}},{key:"blockNumber",get:function(){var e=this;return this._getInternalBlockNumber(100+this.pollingInterval/2).then((function(t){e._setFastBlockNumber(t)}),(function(e){})),null!=this._fastBlockNumber?this._fastBlockNumber:-1}},{key:"polling",get:function(){return null!=this._poller},set:function(e){var t=this;e&&!this._poller?(this._poller=setInterval((function(){t.poll()}),this.pollingInterval),this._bootstrapPoll||(this._bootstrapPoll=setTimeout((function(){t.poll(),t._bootstrapPoll=setTimeout((function(){t._poller||t.poll(),t._bootstrapPoll=null}),t.pollingInterval)}),0))):!e&&this._poller&&(clearInterval(this._poller),this._poller=null)}},{key:"pollingInterval",get:function(){return this._pollingInterval},set:function(e){var t=this;if("number"!==typeof e||e<=0||parseInt(String(e))!=e)throw new Error("invalid polling interval");this._pollingInterval=e,this._poller&&(clearInterval(this._poller),this._poller=setInterval((function(){t.poll()}),this._pollingInterval))}},{key:"_getFastBlockNumber",value:function(){var e=this,t=hw();return t-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=t,this._fastBlockNumberPromise=this.getBlockNumber().then((function(t){return(null==e._fastBlockNumber||t>e._fastBlockNumber)&&(e._fastBlockNumber=t),e._fastBlockNumber}))),this._fastBlockNumberPromise}},{key:"_setFastBlockNumber",value:function(e){null!=this._fastBlockNumber&&e<this._fastBlockNumber||(this._fastQueryDate=hw(),(null==this._fastBlockNumber||e>this._fastBlockNumber)&&(this._fastBlockNumber=e,this._fastBlockNumberPromise=Promise.resolve(e)))}},{key:"waitForTransaction",value:function(e,t,r){return sw(this,void 0,void 0,(0,k.Z)().mark((function n(){return(0,k.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",this._waitForTransaction(e,null==t?1:t,r||0,null));case 1:case"end":return n.stop()}}),n,this)})))}},{key:"_waitForTransaction",value:function(e,t,r,n){return sw(this,void 0,void 0,(0,k.Z)().mark((function i(){var o,a=this;return(0,k.Z)().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,this.getTransactionReceipt(e);case 2:if(!(((o=i.sent)?o.confirmations:0)>=t)){i.next=5;break}return i.abrupt("return",o);case 5:return i.abrupt("return",new Promise((function(i,o){var s=[],u=!1,c=function(){return!!u||(u=!0,s.forEach((function(e){e()})),!1)},l=function(e){e.confirmations<t||c()||i(e)};if(a.on(e,l),s.push((function(){a.removeListener(e,l)})),n){var f=n.startBlock,h=null,d=function r(i){return sw(a,void 0,void 0,(0,k.Z)().mark((function a(){var s=this;return(0,k.Z)().wrap((function(a){for(;;)switch(a.prev=a.next){case 0:if(!u){a.next=2;break}return a.abrupt("return");case 2:return a.next=4,dw(1e3);case 4:this.getTransactionCount(n.from).then((function(a){return sw(s,void 0,void 0,(0,k.Z)().mark((function s(){var l,d,p,v,g,y;return(0,k.Z)().wrap((function(s){for(;;)switch(s.prev=s.next){case 0:if(!u){s.next=2;break}return s.abrupt("return");case 2:if(!(a<=n.nonce)){s.next=6;break}f=i,s.next=41;break;case 6:return s.next=8,this.getTransaction(e);case 8:if(!(l=s.sent)||null==l.blockNumber){s.next=11;break}return s.abrupt("return");case 11:null==h&&(h=f-3)<n.startBlock&&(h=n.startBlock);case 12:if(!(h<=i)){s.next=41;break}if(!u){s.next=15;break}return s.abrupt("return");case 15:return s.next=17,this.getBlockWithTransactions(h);case 17:d=s.sent,p=0;case 19:if(!(p<d.transactions.length)){s.next=38;break}if((v=d.transactions[p]).hash!==e){s.next=23;break}return s.abrupt("return");case 23:if(v.from!==n.from||v.nonce!==n.nonce){s.next=35;break}if(!u){s.next=26;break}return s.abrupt("return");case 26:return s.next=28,this.waitForTransaction(v.hash,t);case 28:if(g=s.sent,!c()){s.next=31;break}return s.abrupt("return");case 31:return y="replaced",v.data===n.data&&v.to===n.to&&v.value.eq(n.value)?y="repriced":"0x"===v.data&&v.from===v.to&&v.value.isZero()&&(y="cancelled"),o(uw.makeError("transaction was replaced",cn.errors.TRANSACTION_REPLACED,{cancelled:"replaced"===y||"cancelled"===y,reason:y,replacement:this._wrapTransaction(v),hash:e,receipt:g})),s.abrupt("return");case 35:p++,s.next=19;break;case 38:h++,s.next=12;break;case 41:if(!u){s.next=43;break}return s.abrupt("return");case 43:this.once("block",r);case 44:case"end":return s.stop()}}),s,this)})))}),(function(e){u||s.once("block",r)}));case 5:case"end":return a.stop()}}),a,this)})))};if(u)return;a.once("block",d),s.push((function(){a.removeListener("block",d)}))}if("number"===typeof r&&r>0){var p=setTimeout((function(){c()||o(uw.makeError("timeout exceeded",cn.errors.TIMEOUT,{timeout:r}))}),r);p.unref&&p.unref(),s.push((function(){clearTimeout(p)}))}})));case 6:case"end":return i.stop()}}),i,this)})))}},{key:"getBlockNumber",value:function(){return sw(this,void 0,void 0,(0,k.Z)().mark((function e(){return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._getInternalBlockNumber(0));case 1:case"end":return e.stop()}}),e,this)})))}},{key:"getGasPrice",value:function(){return sw(this,void 0,void 0,(0,k.Z)().mark((function e(){var t;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getNetwork();case 2:return e.next=4,this.perform("getGasPrice",{});case 4:return t=e.sent,e.prev=5,e.abrupt("return",by.from(t));case 9:return e.prev=9,e.t0=e.catch(5),e.abrupt("return",uw.throwError("bad result from backend",cn.errors.SERVER_ERROR,{method:"getGasPrice",result:t,error:e.t0}));case 12:case"end":return e.stop()}}),e,this,[[5,9]])})))}},{key:"getBalance",value:function(e,t){return sw(this,void 0,void 0,(0,k.Z)().mark((function r(){var n,i;return(0,k.Z)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.getNetwork();case 2:return r.next=4,$g({address:this._getAddress(e),blockTag:this._getBlockTag(t)});case 4:return n=r.sent,r.next=7,this.perform("getBalance",n);case 7:return i=r.sent,r.prev=8,r.abrupt("return",by.from(i));case 12:return r.prev=12,r.t0=r.catch(8),r.abrupt("return",uw.throwError("bad result from backend",cn.errors.SERVER_ERROR,{method:"getBalance",params:n,result:i,error:r.t0}));case 15:case"end":return r.stop()}}),r,this,[[8,12]])})))}},{key:"getTransactionCount",value:function(e,t){return sw(this,void 0,void 0,(0,k.Z)().mark((function r(){var n,i;return(0,k.Z)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.getNetwork();case 2:return r.next=4,$g({address:this._getAddress(e),blockTag:this._getBlockTag(t)});case 4:return n=r.sent,r.next=7,this.perform("getTransactionCount",n);case 7:return i=r.sent,r.prev=8,r.abrupt("return",by.from(i).toNumber());case 12:return r.prev=12,r.t0=r.catch(8),r.abrupt("return",uw.throwError("bad result from backend",cn.errors.SERVER_ERROR,{method:"getTransactionCount",params:n,result:i,error:r.t0}));case 15:case"end":return r.stop()}}),r,this,[[8,12]])})))}},{key:"getCode",value:function(e,t){return sw(this,void 0,void 0,(0,k.Z)().mark((function r(){var n,i;return(0,k.Z)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.getNetwork();case 2:return r.next=4,$g({address:this._getAddress(e),blockTag:this._getBlockTag(t)});case 4:return n=r.sent,r.next=7,this.perform("getCode",n);case 7:return i=r.sent,r.prev=8,r.abrupt("return",kn(i));case 12:return r.prev=12,r.t0=r.catch(8),r.abrupt("return",uw.throwError("bad result from backend",cn.errors.SERVER_ERROR,{method:"getCode",params:n,result:i,error:r.t0}));case 15:case"end":return r.stop()}}),r,this,[[8,12]])})))}},{key:"getStorageAt",value:function(e,t,r){return sw(this,void 0,void 0,(0,k.Z)().mark((function n(){var i,o;return(0,k.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,this.getNetwork();case 2:return n.next=4,$g({address:this._getAddress(e),blockTag:this._getBlockTag(r),position:Promise.resolve(t).then((function(e){return _n(e)}))});case 4:return i=n.sent,n.next=7,this.perform("getStorageAt",i);case 7:return o=n.sent,n.prev=8,n.abrupt("return",kn(o));case 12:return n.prev=12,n.t0=n.catch(8),n.abrupt("return",uw.throwError("bad result from backend",cn.errors.SERVER_ERROR,{method:"getStorageAt",params:i,result:o,error:n.t0}));case 15:case"end":return n.stop()}}),n,this,[[8,12]])})))}},{key:"_wrapTransaction",value:function(e,t,r){var n=this;if(null!=t&&32!==En(t))throw new Error("invalid response - sendTransaction");var i=e;return null!=t&&e.hash!==t&&uw.throwError("Transaction hash mismatch from Provider.sendTransaction.",cn.errors.UNKNOWN_ERROR,{expectedHash:e.hash,returnedHash:t}),i.wait=function(t,i){return sw(n,void 0,void 0,(0,k.Z)().mark((function n(){var o,a;return(0,k.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return null==t&&(t=1),null==i&&(i=0),o=void 0,0!==t&&null!=r&&(o={data:e.data,from:e.from,nonce:e.nonce,to:e.to,value:e.value,startBlock:r}),n.next=6,this._waitForTransaction(e.hash,t,i,o);case 6:if(null!=(a=n.sent)||0!==t){n.next=9;break}return n.abrupt("return",null);case 9:return this._emitted["t:"+e.hash]=a.blockNumber,0===a.status&&uw.throwError("transaction failed",cn.errors.CALL_EXCEPTION,{transactionHash:e.hash,transaction:e,receipt:a}),n.abrupt("return",a);case 12:case"end":return n.stop()}}),n,this)})))},i}},{key:"sendTransaction",value:function(e){return sw(this,void 0,void 0,(0,k.Z)().mark((function t(){var r,n,i,o;return(0,k.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getNetwork();case 2:return t.next=4,Promise.resolve(e).then((function(e){return kn(e)}));case 4:return r=t.sent,null==(n=this.formatter.transaction(e)).confirmations&&(n.confirmations=0),t.next=9,this._getInternalBlockNumber(100+2*this.pollingInterval);case 9:return i=t.sent,t.prev=10,t.next=13,this.perform("sendTransaction",{signedTransaction:r});case 13:return o=t.sent,t.abrupt("return",this._wrapTransaction(n,o,i));case 17:throw t.prev=17,t.t0=t.catch(10),t.t0.transaction=n,t.t0.transactionHash=n.hash,t.t0;case 22:case"end":return t.stop()}}),t,this,[[10,17]])})))}},{key:"_getTransactionRequest",value:function(e){return sw(this,void 0,void 0,(0,k.Z)().mark((function t(){var r,n,i=this;return(0,k.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e;case 2:return r=t.sent,n={},["from","to"].forEach((function(e){null!=r[e]&&(n[e]=Promise.resolve(r[e]).then((function(e){return e?i._getAddress(e):null})))})),["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","value"].forEach((function(e){null!=r[e]&&(n[e]=Promise.resolve(r[e]).then((function(e){return e?by.from(e):null})))})),["type"].forEach((function(e){null!=r[e]&&(n[e]=Promise.resolve(r[e]).then((function(e){return null!=e?e:null})))})),r.accessList&&(n.accessList=this.formatter.accessList(r.accessList)),["data"].forEach((function(e){null!=r[e]&&(n[e]=Promise.resolve(r[e]).then((function(e){return e?kn(e):null})))})),t.t0=this.formatter,t.next=12,$g(n);case 12:return t.t1=t.sent,t.abrupt("return",t.t0.transactionRequest.call(t.t0,t.t1));case 14:case"end":return t.stop()}}),t,this)})))}},{key:"_getFilter",value:function(e){return sw(this,void 0,void 0,(0,k.Z)().mark((function t(){var r,n=this;return(0,k.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e;case 2:return e=t.sent,r={},null!=e.address&&(r.address=this._getAddress(e.address)),["blockHash","topics"].forEach((function(t){null!=e[t]&&(r[t]=e[t])})),["fromBlock","toBlock"].forEach((function(t){null!=e[t]&&(r[t]=n._getBlockTag(e[t]))})),t.t0=this.formatter,t.next=10,$g(r);case 10:return t.t1=t.sent,t.abrupt("return",t.t0.filter.call(t.t0,t.t1));case 12:case"end":return t.stop()}}),t,this)})))}},{key:"_call",value:function(e,t,r){return sw(this,void 0,void 0,(0,k.Z)().mark((function n(){var i,o,a,s,u,c,l,f,h,d,p,v,g,y,m;return(0,k.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return r>=10&&uw.throwError("CCIP read exceeded maximum redirections",cn.errors.SERVER_ERROR,{redirects:r,transaction:e}),i=e.to,n.next=4,this.perform("call",{transaction:e,blockTag:t});case 4:if(o=n.sent,!(r>=0&&"latest"===t&&null!=i&&"0x556f1830"===o.substring(0,10)&&En(o)%32===4)){n.next=31;break}for(n.prev=6,a=xn(o,4),s=xn(a,0,32),by.from(s).eq(i)||uw.throwError("CCIP Read sender did not match",cn.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:o}),u=[],c=by.from(xn(a,32,64)).toNumber(),l=by.from(xn(a,c,c+32)).toNumber(),f=xn(a,c+32),h=0;h<l;h++)null==(d=kw(f,32*h))&&uw.throwError("CCIP Read contained corrupt URL string",cn.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:o}),u.push(d);return p=Ew(a,64),by.from(xn(a,100,128)).isZero()||uw.throwError("CCIP Read callback selector included junk",cn.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:o}),v=xn(a,96,100),g=Ew(a,128),n.next=21,this.ccipReadFetch(e,p,u);case 21:return null==(y=n.sent)&&uw.throwError("CCIP Read disabled or provided no URLs",cn.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:o}),m={to:i,data:Sn([v,Aw([y,g])])},n.abrupt("return",this._call(m,t,r+1));case 27:if(n.prev=27,n.t0=n.catch(6),n.t0.code!==cn.errors.SERVER_ERROR){n.next=31;break}throw n.t0;case 31:return n.prev=31,n.abrupt("return",kn(o));case 35:return n.prev=35,n.t1=n.catch(31),n.abrupt("return",uw.throwError("bad result from backend",cn.errors.SERVER_ERROR,{method:"call",params:{transaction:e,blockTag:t},result:o,error:n.t1}));case 38:case"end":return n.stop()}}),n,this,[[6,27],[31,35]])})))}},{key:"call",value:function(e,t){return sw(this,void 0,void 0,(0,k.Z)().mark((function r(){var n;return(0,k.Z)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.getNetwork();case 2:return r.next=4,$g({transaction:this._getTransactionRequest(e),blockTag:this._getBlockTag(t),ccipReadEnabled:Promise.resolve(e.ccipReadEnabled)});case 4:return n=r.sent,r.abrupt("return",this._call(n.transaction,n.blockTag,n.ccipReadEnabled?0:-1));case 6:case"end":return r.stop()}}),r,this)})))}},{key:"estimateGas",value:function(e){return sw(this,void 0,void 0,(0,k.Z)().mark((function t(){var r,n;return(0,k.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getNetwork();case 2:return t.next=4,$g({transaction:this._getTransactionRequest(e)});case 4:return r=t.sent,t.next=7,this.perform("estimateGas",r);case 7:return n=t.sent,t.prev=8,t.abrupt("return",by.from(n));case 12:return t.prev=12,t.t0=t.catch(8),t.abrupt("return",uw.throwError("bad result from backend",cn.errors.SERVER_ERROR,{method:"estimateGas",params:r,result:n,error:t.t0}));case 15:case"end":return t.stop()}}),t,this,[[8,12]])})))}},{key:"_getAddress",value:function(e){return sw(this,void 0,void 0,(0,k.Z)().mark((function t(){var r;return(0,k.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e;case 2:return"string"!==typeof(e=t.sent)&&uw.throwArgumentError("invalid address or ENS name","name",e),t.next=6,this.resolveName(e);case 6:return null==(r=t.sent)&&uw.throwError("ENS name not configured",cn.errors.UNSUPPORTED_OPERATION,{operation:"resolveName(".concat(JSON.stringify(e),")")}),t.abrupt("return",r);case 9:case"end":return t.stop()}}),t,this)})))}},{key:"_getBlock",value:function(e,t){return sw(this,void 0,void 0,(0,k.Z)().mark((function r(){var n,i,o=this;return(0,k.Z)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.getNetwork();case 2:return r.next=4,e;case 4:if(e=r.sent,n=-128,i={includeTransactions:!!t},!bn(e,32)){r.next=11;break}i.blockHash=e,r.next=21;break;case 11:return r.prev=11,r.next=14,this._getBlockTag(e);case 14:i.blockTag=r.sent,bn(i.blockTag)&&(n=parseInt(i.blockTag.substring(2),16)),r.next=21;break;case 18:r.prev=18,r.t0=r.catch(11),uw.throwArgumentError("invalid block hash or block tag","blockHashOrBlockTag",e);case 21:return r.abrupt("return",mb((function(){return sw(o,void 0,void 0,(0,k.Z)().mark((function e(){var r,o,a,s,u,c,l=this;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.perform("getBlock",i);case 2:if(null!=(r=e.sent)){e.next=11;break}if(null==i.blockHash){e.next=7;break}if(null!=this._emitted["b:"+i.blockHash]){e.next=7;break}return e.abrupt("return",null);case 7:if(null==i.blockTag){e.next=10;break}if(!(n>this._emitted.block)){e.next=10;break}return e.abrupt("return",null);case 10:return e.abrupt("return",void 0);case 11:if(!t){e.next=34;break}o=null,a=0;case 14:if(!(a<r.transactions.length)){e.next=31;break}if(null!=(s=r.transactions[a]).blockNumber){e.next=20;break}s.confirmations=0,e.next=28;break;case 20:if(null!=s.confirmations){e.next=28;break}if(null!=o){e.next=25;break}return e.next=24,this._getInternalBlockNumber(100+2*this.pollingInterval);case 24:o=e.sent;case 25:(u=o-s.blockNumber+1)<=0&&(u=1),s.confirmations=u;case 28:a++,e.next=14;break;case 31:return(c=this.formatter.blockWithTransactions(r)).transactions=c.transactions.map((function(e){return l._wrapTransaction(e)})),e.abrupt("return",c);case 34:return e.abrupt("return",this.formatter.block(r));case 35:case"end":return e.stop()}}),e,this)})))}),{oncePoll:this}));case 22:case"end":return r.stop()}}),r,this,[[11,18]])})))}},{key:"getBlock",value:function(e){return this._getBlock(e,!1)}},{key:"getBlockWithTransactions",value:function(e){return this._getBlock(e,!0)}},{key:"getTransaction",value:function(e){return sw(this,void 0,void 0,(0,k.Z)().mark((function t(){var r,n=this;return(0,k.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getNetwork();case 2:return t.next=4,e;case 4:return e=t.sent,r={transactionHash:this.formatter.hash(e,!0)},t.abrupt("return",mb((function(){return sw(n,void 0,void 0,(0,k.Z)().mark((function t(){var n,i,o,a;return(0,k.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.perform("getTransaction",r);case 2:if(null!=(n=t.sent)){t.next=7;break}if(null!=this._emitted["t:"+e]){t.next=6;break}return t.abrupt("return",null);case 6:return t.abrupt("return",void 0);case 7:if(null!=(i=this.formatter.transactionResponse(n)).blockNumber){t.next=12;break}i.confirmations=0,t.next=19;break;case 12:if(null!=i.confirmations){t.next=19;break}return t.next=15,this._getInternalBlockNumber(100+2*this.pollingInterval);case 15:o=t.sent,(a=o-i.blockNumber+1)<=0&&(a=1),i.confirmations=a;case 19:return t.abrupt("return",this._wrapTransaction(i));case 20:case"end":return t.stop()}}),t,this)})))}),{oncePoll:this}));case 7:case"end":return t.stop()}}),t,this)})))}},{key:"getTransactionReceipt",value:function(e){return sw(this,void 0,void 0,(0,k.Z)().mark((function t(){var r,n=this;return(0,k.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getNetwork();case 2:return t.next=4,e;case 4:return e=t.sent,r={transactionHash:this.formatter.hash(e,!0)},t.abrupt("return",mb((function(){return sw(n,void 0,void 0,(0,k.Z)().mark((function t(){var n,i,o,a;return(0,k.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.perform("getTransactionReceipt",r);case 2:if(null!=(n=t.sent)){t.next=7;break}if(null!=this._emitted["t:"+e]){t.next=6;break}return t.abrupt("return",null);case 6:return t.abrupt("return",void 0);case 7:if(null!=n.blockHash){t.next=9;break}return t.abrupt("return",void 0);case 9:if(null!=(i=this.formatter.receipt(n)).blockNumber){t.next=14;break}i.confirmations=0,t.next=21;break;case 14:if(null!=i.confirmations){t.next=21;break}return t.next=17,this._getInternalBlockNumber(100+2*this.pollingInterval);case 17:o=t.sent,(a=o-i.blockNumber+1)<=0&&(a=1),i.confirmations=a;case 21:return t.abrupt("return",i);case 22:case"end":return t.stop()}}),t,this)})))}),{oncePoll:this}));case 7:case"end":return t.stop()}}),t,this)})))}},{key:"getLogs",value:function(e){return sw(this,void 0,void 0,(0,k.Z)().mark((function t(){var r,n;return(0,k.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getNetwork();case 2:return t.next=4,$g({filter:this._getFilter(e)});case 4:return r=t.sent,t.next=7,this.perform("getLogs",r);case 7:return(n=t.sent).forEach((function(e){null==e.removed&&(e.removed=!1)})),t.abrupt("return",aw.arrayOf(this.formatter.filterLog.bind(this.formatter))(n));case 10:case"end":return t.stop()}}),t,this)})))}},{key:"getEtherPrice",value:function(){return sw(this,void 0,void 0,(0,k.Z)().mark((function e(){return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getNetwork();case 2:return e.abrupt("return",this.perform("getEtherPrice",{}));case 3:case"end":return e.stop()}}),e,this)})))}},{key:"_getBlockTag",value:function(e){return sw(this,void 0,void 0,(0,k.Z)().mark((function t(){var r;return(0,k.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e;case 2:if(!("number"===typeof(e=t.sent)&&e<0)){t.next=11;break}return e%1&&uw.throwArgumentError("invalid BlockTag","blockTag",e),t.next=7,this._getInternalBlockNumber(100+2*this.pollingInterval);case 7:return r=t.sent,(r+=e)<0&&(r=0),t.abrupt("return",this.formatter.blockTag(r));case 11:return t.abrupt("return",this.formatter.blockTag(e));case 12:case"end":return t.stop()}}),t,this)})))}},{key:"getResolver",value:function(e){return sw(this,void 0,void 0,(0,k.Z)().mark((function t(){var r,n,i;return(0,k.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=e;case 1:if(""!==r&&"."!==r){t.next=4;break}return t.abrupt("return",null);case 4:if("eth"===e||"eth"!==r){t.next=6;break}return t.abrupt("return",null);case 6:return t.next=8,this._getResolver(r,"getResolver");case 8:if(null==(n=t.sent)){t.next=19;break}if(i=new Iw(this,n,e),t.t0=r!==e,!t.t0){t.next=16;break}return t.next=15,i.supportsWildcard();case 15:t.t0=!t.sent;case 16:if(!t.t0){t.next=18;break}return t.abrupt("return",null);case 18:return t.abrupt("return",i);case 19:r=r.split(".").slice(1).join("."),t.next=1;break;case 22:case"end":return t.stop()}}),t,this)})))}},{key:"_getResolver",value:function(e,t){return sw(this,void 0,void 0,(0,k.Z)().mark((function r(){var n,i;return(0,k.Z)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return null==t&&(t="ENS"),r.next=3,this.getNetwork();case 3:return(n=r.sent).ensAddress||uw.throwError("network does not support ENS",cn.errors.UNSUPPORTED_OPERATION,{operation:t,network:n.name}),r.prev=5,r.next=8,this.call({to:n.ensAddress,data:"0x0178b8bf"+Wb(e).substring(2)});case 8:return i=r.sent,r.abrupt("return",this.formatter.callAddress(i));case 12:r.prev=12,r.t0=r.catch(5);case 14:return r.abrupt("return",null);case 15:case"end":return r.stop()}}),r,this,[[5,12]])})))}},{key:"resolveName",value:function(e){return sw(this,void 0,void 0,(0,k.Z)().mark((function t(){var r;return(0,k.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e;case 2:return e=t.sent,t.prev=3,t.abrupt("return",Promise.resolve(this.formatter.address(e)));case 7:if(t.prev=7,t.t0=t.catch(3),!bn(e)){t.next=11;break}throw t.t0;case 11:return"string"!==typeof e&&uw.throwArgumentError("invalid ENS name","name",e),t.next=14,this.getResolver(e);case 14:if(r=t.sent){t.next=17;break}return t.abrupt("return",null);case 17:return t.next=19,r.getAddress();case 19:return t.abrupt("return",t.sent);case 20:case"end":return t.stop()}}),t,this,[[3,7]])})))}},{key:"lookupAddress",value:function(e){return sw(this,void 0,void 0,(0,k.Z)().mark((function t(){var r,n,i;return(0,k.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e;case 2:return e=t.sent,e=this.formatter.address(e),r=e.substring(2).toLowerCase()+".addr.reverse",t.next=7,this._getResolver(r,"lookupAddress");case 7:if(null!=(n=t.sent)){t.next=10;break}return t.abrupt("return",null);case 10:return t.t0=kw,t.next=13,this.call({to:n,data:"0x691f3431"+Wb(r).substring(2)});case 13:return t.t1=t.sent,i=(0,t.t0)(t.t1,0),t.next=17,this.resolveName(i);case 17:if(t.sent==e){t.next=20;break}return t.abrupt("return",null);case 20:return t.abrupt("return",i);case 21:case"end":return t.stop()}}),t,this)})))}},{key:"getAvatar",value:function(e){return sw(this,void 0,void 0,(0,k.Z)().mark((function t(){var r,n,i,o,a,s,u;return(0,k.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=null,!bn(e)){t.next=40;break}return n=this.formatter.address(e),i=n.substring(2).toLowerCase()+".addr.reverse",t.next=6,this._getResolver(i,"getAvatar");case 6:if(o=t.sent){t.next=9;break}return t.abrupt("return",null);case 9:return r=new Iw(this,o,i),t.prev=10,t.next=13,r.getAvatar();case 13:if(!(a=t.sent)){t.next=16;break}return t.abrupt("return",a.url);case 16:t.next=22;break;case 18:if(t.prev=18,t.t0=t.catch(10),t.t0.code===cn.errors.CALL_EXCEPTION){t.next=22;break}throw t.t0;case 22:return t.prev=22,t.t1=kw,t.next=26,this.call({to:o,data:"0x691f3431"+Wb(i).substring(2)});case 26:return t.t2=t.sent,s=(0,t.t1)(t.t2,0),t.next=30,this.getResolver(s);case 30:r=t.sent,t.next=38;break;case 33:if(t.prev=33,t.t3=t.catch(22),t.t3.code===cn.errors.CALL_EXCEPTION){t.next=37;break}throw t.t3;case 37:return t.abrupt("return",null);case 38:t.next=45;break;case 40:return t.next=42,this.getResolver(e);case 42:if(r=t.sent){t.next=45;break}return t.abrupt("return",null);case 45:return t.next=47,r.getAvatar();case 47:if(null!=(u=t.sent)){t.next=50;break}return t.abrupt("return",null);case 50:return t.abrupt("return",u.url);case 51:case"end":return t.stop()}}),t,this,[[10,18],[22,33]])})))}},{key:"perform",value:function(e,t){return uw.throwError(e+" not implemented",cn.errors.NOT_IMPLEMENTED,{operation:e})}},{key:"_startEvent",value:function(e){this.polling=this._events.filter((function(e){return e.pollable()})).length>0}},{key:"_stopEvent",value:function(e){this.polling=this._events.filter((function(e){return e.pollable()})).length>0}},{key:"_addEventListener",value:function(e,t,r){var n=new vw(fw(e),t,r);return this._events.push(n),this._startEvent(n),this}},{key:"on",value:function(e,t){return this._addEventListener(e,t,!1)}},{key:"once",value:function(e,t){return this._addEventListener(e,t,!0)}},{key:"emit",value:function(e){for(var t=this,r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];var o=!1,a=[],s=fw(e);return this._events=this._events.filter((function(e){return e.tag!==s||(setTimeout((function(){e.listener.apply(t,n)}),0),o=!0,!e.once||(a.push(e),!1))})),a.forEach((function(e){t._stopEvent(e)})),o}},{key:"listenerCount",value:function(e){if(!e)return this._events.length;var t=fw(e);return this._events.filter((function(e){return e.tag===t})).length}},{key:"listeners",value:function(e){if(null==e)return this._events.map((function(e){return e.listener}));var t=fw(e);return this._events.filter((function(e){return e.tag===t})).map((function(e){return e.listener}))}},{key:"off",value:function(e,t){var r=this;if(null==t)return this.removeAllListeners(e);var n=[],i=!1,o=fw(e);return this._events=this._events.filter((function(e){return e.tag!==o||e.listener!=t||(!!i||(i=!0,n.push(e),!1))})),n.forEach((function(e){r._stopEvent(e)})),this}},{key:"removeAllListeners",value:function(e){var t=this,r=[];if(null==e)r=this._events,this._events=[];else{var n=fw(e);this._events=this._events.filter((function(e){return e.tag!==n||(r.push(e),!1)}))}return r.forEach((function(e){t._stopEvent(e)})),this}}],[{key:"getFormatter",value:function(){return null==Cw&&(Cw=new aw),Cw}},{key:"getNetwork",value:function(e){return function(e){if(null==e)return null;if("number"===typeof e){for(var t in tw){var r=tw[t];if(r.chainId===e)return{name:r.name,chainId:r.chainId,ensAddress:r.ensAddress||null,_defaultProvider:r._defaultProvider||null}}return{chainId:e,name:"unknown"}}if("string"===typeof e){var n=tw[e];return null==n?null:{name:n.name,chainId:n.chainId,ensAddress:n.ensAddress,_defaultProvider:n._defaultProvider||null}}var i=tw[e.name];if(!i)return"number"!==typeof e.chainId&&Qb.throwArgumentError("invalid network chainId","network",e),e;0!==e.chainId&&e.chainId!==i.chainId&&Qb.throwArgumentError("network chainId mismatch","network",e);var o,a=e._defaultProvider||null;return null==a&&i._defaultProvider&&(a=(o=i._defaultProvider)&&"function"===typeof o.renetwork?i._defaultProvider.renetwork(e):i._defaultProvider),{name:e.name,chainId:i.chainId,ensAddress:e.ensAddress||i.ensAddress||null,_defaultProvider:a}}(null==e?"homestead":e)}}]),r}(Eb),Rw=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{u(n.next(e))}catch(t){o(t)}}function s(e){try{u(n.throw(e))}catch(t){o(t)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((n=n.apply(e,t||[])).next())}))},Bw=new cn(ay),Mw=["call","estimateGas"];function Nw(e,t){if(null==e)return null;if("string"===typeof e.message&&e.message.match("reverted")){var r=bn(e.data)?e.data:null;if(!t||r)return{message:e.message,data:r}}if("object"===typeof e){for(var n in e){var i=Nw(e[n],t);if(i)return i}return null}if("string"===typeof e)try{return Nw(JSON.parse(e),t)}catch(o){}return null}function Ow(e,t,r){var n=r.transaction||r.signedTransaction;if("call"===e){var i=Nw(t,!0);if(i)return i.data;Bw.throwError("missing revert data in call exception; Transaction reverted without a reason string",cn.errors.CALL_EXCEPTION,{data:"0x",transaction:n,error:t})}if("estimateGas"===e){var o=Nw(t.body,!1);null==o&&(o=Nw(t,!1)),o&&Bw.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",cn.errors.UNPREDICTABLE_GAS_LIMIT,{reason:o.message,method:e,transaction:n,error:t})}var a=t.message;throw t.code===cn.errors.SERVER_ERROR&&t.error&&"string"===typeof t.error.message?a=t.error.message:"string"===typeof t.body?a=t.body:"string"===typeof t.responseText&&(a=t.responseText),(a=(a||"").toLowerCase()).match(/insufficient funds|base fee exceeds gas limit/i)&&Bw.throwError("insufficient funds for intrinsic transaction cost",cn.errors.INSUFFICIENT_FUNDS,{error:t,method:e,transaction:n}),a.match(/nonce (is )?too low/i)&&Bw.throwError("nonce has already been used",cn.errors.NONCE_EXPIRED,{error:t,method:e,transaction:n}),a.match(/replacement transaction underpriced|transaction gas price.*too low/i)&&Bw.throwError("replacement fee too low",cn.errors.REPLACEMENT_UNDERPRICED,{error:t,method:e,transaction:n}),a.match(/only replay-protected/i)&&Bw.throwError("legacy pre-eip-155 transactions not supported",cn.errors.UNSUPPORTED_OPERATION,{error:t,method:e,transaction:n}),Mw.indexOf(e)>=0&&a.match(/gas required exceeds allowance|always failing transaction|execution reverted/)&&Bw.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",cn.errors.UNPREDICTABLE_GAS_LIMIT,{error:t,method:e,transaction:n}),t}function Dw(e){return new Promise((function(t){setTimeout(t,e)}))}function Lw(e){if(e.error){var t=new Error(e.error.message);throw t.code=e.error.code,t.data=e.error.data,t}return e.result}function Uw(e){return e?e.toLowerCase():e}var Fw={},zw=function(e){U(r,e);var t=K(r);function r(e,n,i){var o;if((0,D.Z)(this,r),o=t.call(this),e!==Fw)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");return Yg(j(o),"provider",n),null==i&&(i=0),"string"===typeof i?(Yg(j(o),"_address",o.provider.formatter.address(i)),Yg(j(o),"_index",null)):"number"===typeof i?(Yg(j(o),"_index",i),Yg(j(o),"_address",null)):Bw.throwArgumentError("invalid address or index","addressOrIndex",i),o}return(0,O.Z)(r,[{key:"connect",value:function(e){return Bw.throwError("cannot alter JSON-RPC Signer connection",cn.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}},{key:"connectUnchecked",value:function(){return new Zw(Fw,this.provider,this._address||this._index)}},{key:"getAddress",value:function(){var e=this;return this._address?Promise.resolve(this._address):this.provider.send("eth_accounts",[]).then((function(t){return t.length<=e._index&&Bw.throwError("unknown account #"+e._index,cn.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),e.provider.formatter.address(t[e._index])}))}},{key:"sendUncheckedTransaction",value:function(e){var t=this;e=ey(e);var r=this.getAddress().then((function(e){return e&&(e=e.toLowerCase()),e}));if(null==e.gasLimit){var n=ey(e);n.from=r,e.gasLimit=this.provider.estimateGas(n)}return null!=e.to&&(e.to=Promise.resolve(e.to).then((function(e){return Rw(t,void 0,void 0,(0,k.Z)().mark((function t(){var r;return(0,k.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null!=e){t.next=2;break}return t.abrupt("return",null);case 2:return t.next=4,this.provider.resolveName(e);case 4:return null==(r=t.sent)&&Bw.throwArgumentError("provided ENS name resolves to null","tx.to",e),t.abrupt("return",r);case 7:case"end":return t.stop()}}),t,this)})))}))),$g({tx:$g(e),sender:r}).then((function(r){var n=r.tx,i=r.sender;null!=n.from?n.from.toLowerCase()!==i&&Bw.throwArgumentError("from address mismatch","transaction",e):n.from=i;var o=t.provider.constructor.hexlifyTransaction(n,{from:!0});return t.provider.send("eth_sendTransaction",[o]).then((function(e){return e}),(function(e){return"string"===typeof e.message&&e.message.match(/user denied/i)&&Bw.throwError("user rejected transaction",cn.errors.ACTION_REJECTED,{action:"sendTransaction",transaction:n}),Ow("sendTransaction",e,o)}))}))}},{key:"signTransaction",value:function(e){return Bw.throwError("signing transactions is unsupported",cn.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}},{key:"sendTransaction",value:function(e){return Rw(this,void 0,void 0,(0,k.Z)().mark((function t(){var r,n,i=this;return(0,k.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.provider._getInternalBlockNumber(100+2*this.provider.pollingInterval);case 2:return r=t.sent,t.next=5,this.sendUncheckedTransaction(e);case 5:return n=t.sent,t.prev=6,t.next=9,mb((function(){return Rw(i,void 0,void 0,(0,k.Z)().mark((function e(){var t;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.provider.getTransaction(n);case 2:if(null!==(t=e.sent)){e.next=5;break}return e.abrupt("return",void 0);case 5:return e.abrupt("return",this.provider._wrapTransaction(t,n,r));case 6:case"end":return e.stop()}}),e,this)})))}),{oncePoll:this.provider});case 9:return t.abrupt("return",t.sent);case 12:throw t.prev=12,t.t0=t.catch(6),t.t0.transactionHash=n,t.t0;case 16:case"end":return t.stop()}}),t,this,[[6,12]])})))}},{key:"signMessage",value:function(e){return Rw(this,void 0,void 0,(0,k.Z)().mark((function t(){var r,n;return(0,k.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r="string"===typeof e?Zy(e):e,t.next=3,this.getAddress();case 3:return n=t.sent,t.prev=4,t.next=7,this.provider.send("personal_sign",[kn(r),n.toLowerCase()]);case 7:return t.abrupt("return",t.sent);case 10:throw t.prev=10,t.t0=t.catch(4),"string"===typeof t.t0.message&&t.t0.message.match(/user denied/i)&&Bw.throwError("user rejected signing",cn.errors.ACTION_REJECTED,{action:"signMessage",from:n,messageData:e}),t.t0;case 14:case"end":return t.stop()}}),t,this,[[4,10]])})))}},{key:"_legacySignMessage",value:function(e){return Rw(this,void 0,void 0,(0,k.Z)().mark((function t(){var r,n;return(0,k.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r="string"===typeof e?Zy(e):e,t.next=3,this.getAddress();case 3:return n=t.sent,t.prev=4,t.next=7,this.provider.send("eth_sign",[n.toLowerCase(),kn(r)]);case 7:return t.abrupt("return",t.sent);case 10:throw t.prev=10,t.t0=t.catch(4),"string"===typeof t.t0.message&&t.t0.message.match(/user denied/i)&&Bw.throwError("user rejected signing",cn.errors.ACTION_REJECTED,{action:"_legacySignMessage",from:n,messageData:e}),t.t0;case 14:case"end":return t.stop()}}),t,this,[[4,10]])})))}},{key:"_signTypedData",value:function(e,t,r){return Rw(this,void 0,void 0,(0,k.Z)().mark((function n(){var i,o,a=this;return(0,k.Z)().wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,om.resolveNames(e,t,r,(function(e){return a.provider.resolveName(e)}));case 2:return i=n.sent,n.next=5,this.getAddress();case 5:return o=n.sent,n.prev=6,n.next=9,this.provider.send("eth_signTypedData_v4",[o.toLowerCase(),JSON.stringify(om.getPayload(i.domain,t,i.value))]);case 9:return n.abrupt("return",n.sent);case 12:throw n.prev=12,n.t0=n.catch(6),"string"===typeof n.t0.message&&n.t0.message.match(/user denied/i)&&Bw.throwError("user rejected signing",cn.errors.ACTION_REJECTED,{action:"_signTypedData",from:o,messageData:{domain:i.domain,types:t,value:i.value}}),n.t0;case 16:case"end":return n.stop()}}),n,this,[[6,12]])})))}},{key:"unlock",value:function(e){return Rw(this,void 0,void 0,(0,k.Z)().mark((function t(){var r,n;return(0,k.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=this.provider,t.next=3,this.getAddress();case 3:return n=t.sent,t.abrupt("return",r.send("personal_unlockAccount",[n.toLowerCase(),e,null]));case 5:case"end":return t.stop()}}),t,this)})))}}]),r}(fy),Zw=function(e){U(r,e);var t=K(r);function r(){return(0,D.Z)(this,r),t.apply(this,arguments)}return(0,O.Z)(r,[{key:"sendTransaction",value:function(e){var t=this;return this.sendUncheckedTransaction(e).then((function(e){return{hash:e,nonce:null,gasLimit:null,gasPrice:null,data:null,value:null,chainId:null,confirmations:0,from:null,wait:function(r){return t.provider.waitForTransaction(e,r)}}}))}}]),r}(zw),jw={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0},qw=function(e){U(r,e);var t=K(r);function r(e,n){var i;(0,D.Z)(this,r);var o=n;return null==o&&(o=new Promise((function(e,t){setTimeout((function(){i.detectNetwork().then((function(t){e(t)}),(function(e){t(e)}))}),0)}))),i=t.call(this,o),e||(e=Xg(i.constructor,"defaultUrl")()),Yg(j(i),"connection","string"===typeof e?Object.freeze({url:e}):Object.freeze(ey(e))),i._nextId=42,i}return(0,O.Z)(r,[{key:"_cache",get:function(){return null==this._eventLoopCache&&(this._eventLoopCache={}),this._eventLoopCache}},{key:"detectNetwork",value:function(){var e=this;return this._cache.detectNetwork||(this._cache.detectNetwork=this._uncachedDetectNetwork(),setTimeout((function(){e._cache.detectNetwork=null}),0)),this._cache.detectNetwork}},{key:"_uncachedDetectNetwork",value:function(){return Rw(this,void 0,void 0,(0,k.Z)().mark((function e(){var t,r;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Dw(0);case 2:return t=null,e.prev=3,e.next=6,this.send("eth_chainId",[]);case 6:t=e.sent,e.next=19;break;case 9:return e.prev=9,e.t0=e.catch(3),e.prev=11,e.next=14,this.send("net_version",[]);case 14:t=e.sent,e.next=19;break;case 17:e.prev=17,e.t1=e.catch(11);case 19:if(null==t){e.next=28;break}return r=Xg(this.constructor,"getNetwork"),e.prev=21,e.abrupt("return",r(by.from(t).toNumber()));case 25:return e.prev=25,e.t2=e.catch(21),e.abrupt("return",Bw.throwError("could not detect network",cn.errors.NETWORK_ERROR,{chainId:t,event:"invalidNetwork",serverError:e.t2}));case 28:return e.abrupt("return",Bw.throwError("could not detect network",cn.errors.NETWORK_ERROR,{event:"noNetwork"}));case 29:case"end":return e.stop()}}),e,this,[[3,9],[11,17],[21,25]])})))}},{key:"getSigner",value:function(e){return new zw(Fw,this,e)}},{key:"getUncheckedSigner",value:function(e){return this.getSigner(e).connectUnchecked()}},{key:"listAccounts",value:function(){var e=this;return this.send("eth_accounts",[]).then((function(t){return t.map((function(t){return e.formatter.address(t)}))}))}},{key:"send",value:function(e,t){var r=this,n={method:e,params:t,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:iy(n),provider:this});var i=["eth_chainId","eth_blockNumber"].indexOf(e)>=0;if(i&&this._cache[e])return this._cache[e];var o=yb(this.connection,JSON.stringify(n),Lw).then((function(e){return r.emit("debug",{action:"response",request:n,response:e,provider:r}),e}),(function(e){throw r.emit("debug",{action:"response",error:e,request:n,provider:r}),e}));return i&&(this._cache[e]=o,setTimeout((function(){r._cache[e]=null}),0)),o}},{key:"prepareRequest",value:function(e,t){switch(e){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[Uw(t.address),t.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[Uw(t.address),t.blockTag]];case"getCode":return["eth_getCode",[Uw(t.address),t.blockTag]];case"getStorageAt":return["eth_getStorageAt",[Uw(t.address),An(t.position,32),t.blockTag]];case"sendTransaction":return["eth_sendRawTransaction",[t.signedTransaction]];case"getBlock":return t.blockTag?["eth_getBlockByNumber",[t.blockTag,!!t.includeTransactions]]:t.blockHash?["eth_getBlockByHash",[t.blockHash,!!t.includeTransactions]]:null;case"getTransaction":return["eth_getTransactionByHash",[t.transactionHash]];case"getTransactionReceipt":return["eth_getTransactionReceipt",[t.transactionHash]];case"call":return["eth_call",[Xg(this.constructor,"hexlifyTransaction")(t.transaction,{from:!0}),t.blockTag]];case"estimateGas":return["eth_estimateGas",[Xg(this.constructor,"hexlifyTransaction")(t.transaction,{from:!0})]];case"getLogs":return t.filter&&null!=t.filter.address&&(t.filter.address=Uw(t.filter.address)),["eth_getLogs",[t.filter]]}return null}},{key:"perform",value:function(e,t){return Rw(this,void 0,void 0,(0,k.Z)().mark((function r(){var n,i,o;return(0,k.Z)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if("call"!==e&&"estimateGas"!==e){r.next=8;break}if(!(n=t.transaction)||null==n.type||!by.from(n.type).isZero()){r.next=8;break}if(null!=n.maxFeePerGas||null!=n.maxPriorityFeePerGas){r.next=8;break}return r.next=6,this.getFeeData();case 6:null==(i=r.sent).maxFeePerGas&&null==i.maxPriorityFeePerGas&&((t=ey(t)).transaction=ey(n),delete t.transaction.type);case 8:return null==(o=this.prepareRequest(e,t))&&Bw.throwError(e+" not implemented",cn.errors.NOT_IMPLEMENTED,{operation:e}),r.prev=10,r.next=13,this.send(o[0],o[1]);case 13:return r.abrupt("return",r.sent);case 16:return r.prev=16,r.t0=r.catch(10),r.abrupt("return",Ow(e,r.t0,t));case 19:case"end":return r.stop()}}),r,this,[[10,16]])})))}},{key:"_startEvent",value:function(e){"pending"===e.tag&&this._startPending(),Xr(F(r.prototype),"_startEvent",this).call(this,e)}},{key:"_startPending",value:function(){if(null==this._pendingFilter){var e=this,t=this.send("eth_newPendingTransactionFilter",[]);this._pendingFilter=t,t.then((function(r){return function n(){e.send("eth_getFilterChanges",[r]).then((function(r){if(e._pendingFilter!=t)return null;var n=Promise.resolve();return r.forEach((function(t){e._emitted["t:"+t.toLowerCase()]="pending",n=n.then((function(){return e.getTransaction(t).then((function(t){return e.emit("pending",t),null}))}))})),n.then((function(){return Dw(1e3)}))})).then((function(){if(e._pendingFilter==t)return setTimeout((function(){n()}),0),null;e.send("eth_uninstallFilter",[r])})).catch((function(e){}))}(),r})).catch((function(e){}))}}},{key:"_stopEvent",value:function(e){"pending"===e.tag&&0===this.listenerCount("pending")&&(this._pendingFilter=null),Xr(F(r.prototype),"_stopEvent",this).call(this,e)}}],[{key:"defaultUrl",value:function(){return"http://localhost:8545"}},{key:"hexlifyTransaction",value:function(e,t){var r=ey(jw);if(t)for(var n in t)t[n]&&(r[n]=!0);!function(e,t){e&&"object"===typeof e||Jg.throwArgumentError("invalid object","object",e),Object.keys(e).forEach((function(r){t[r]||Jg.throwArgumentError("invalid object key - "+r,"transaction:"+r,e)}))}(e,r);var i={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach((function(t){if(null!=e[t]){var r=_n(by.from(e[t]));"gasLimit"===t&&(t="gas"),i[t]=r}})),["from","to","data"].forEach((function(t){null!=e[t]&&(i[t]=kn(e[t]))})),e.accessList&&(i.accessList=nb(e.accessList)),i}}]),r}(Pw),Kw=new cn(ay),Vw=1;function Hw(e,t){var r="Web3LegacyFetcher";return function(e,n){var i=this,o={method:e,params:n,id:Vw++,jsonrpc:"2.0"};return new Promise((function(e,n){i.emit("debug",{action:"request",fetcher:r,request:iy(o),provider:i}),t(o,(function(t,a){if(t)return i.emit("debug",{action:"response",fetcher:r,error:t,request:o,provider:i}),n(t);if(i.emit("debug",{action:"response",fetcher:r,request:o,response:a,provider:i}),a.error){var s=new Error(a.error.message);return s.code=a.error.code,s.data=a.error.data,n(s)}e(a.result)}))}))}}var Gw=function(e){U(r,e);var t=K(r);function r(e,n){var i;(0,D.Z)(this,r),null==e&&Kw.throwArgumentError("missing provider","provider",e);var o=null,a=null,s=null;return"function"===typeof e?(o="unknown:",a=e):(!(o=e.host||e.path||"")&&e.isMetaMask&&(o="metamask"),s=e,e.request?(""===o&&(o="eip-1193:"),a=function(e){return function(t,r){var n=this;null==r&&(r=[]);var i={method:t,params:r};return this.emit("debug",{action:"request",fetcher:"Eip1193Fetcher",request:iy(i),provider:this}),e.request(i).then((function(e){return n.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:i,response:e,provider:n}),e}),(function(e){throw n.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:i,error:e,provider:n}),e}))}}(e)):e.sendAsync?a=Hw(0,e.sendAsync.bind(e)):e.send?a=Hw(0,e.send.bind(e)):Kw.throwArgumentError("unsupported provider","provider",e),o||(o="unknown:")),Yg(j(i=t.call(this,o,n)),"jsonRpcFetchFunc",a),Yg(j(i),"provider",s),i}return(0,O.Z)(r,[{key:"send",value:function(e,t){return this.jsonRpcFetchFunc(e,t)}}]),r}(qw);function Ww(e){var t=e.setAddress,r=e.setProvider,n=function(){var e=(0,E.Z)((0,k.Z)().mark((function e(){var n,i;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,n=new Gw(window.ethereum),e.next=4,n.send("eth_requestAccounts",[]);case 4:i=e.sent,t(i[0]),r(n),e.next=12;break;case 9:e.prev=9,e.t0=e.catch(0),console.error("No web3 provider available",e.t0);case 12:case"end":return e.stop()}}),e,null,[[0,9]])})));return function(){return e.apply(this,arguments)}}();return(0,ag.jsx)(Wg,{variant:"contained",color:"primary",onClick:n,children:"Connect Wallet"})}var Qw=function(){var e=I((0,m.useState)(),2),t=e[0],r=e[1],n=I((0,m.useState)(),2),i=n[0],o=n[1],a=I((0,m.useState)(),2),s=a[0],u=a[1],c=I((0,m.useState)(),2),l=c[0],f=c[1],h=I((0,m.useState)(),2),d=h[0],p=h[1],v=I((0,m.useState)(),2),g=v[0],y=v[1],b=I((0,m.useState)(),2),w=b[0],x=b[1];return(0,m.useEffect)((function(){t||(0,E.Z)((0,k.Z)().mark((function e(){var t;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,C();case 2:t=e.sent,r(t);case 4:case"end":return e.stop()}}),e)})))()})),(0,m.useEffect)((function(){if(i){var e=jr(i.IDKey),t=jr(i.IDCommitment);u(e),f(t)}}),[i]),(0,m.useEffect)((function(){d&&(0,E.Z)((0,k.Z)().mark((function e(){var t;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,d.detectNetwork();case 2:t=e.sent,x(t.name);case 4:case"end":return e.stop()}}),e)})))()}),[d]),(0,ag.jsxs)("div",{className:"App",children:[(0,ag.jsx)("h2",{children:"RLN Credentials:"}),(0,ag.jsxs)("p",{children:["key: ",s]}),(0,ag.jsxs)("p",{children:["commitment: ",l]}),(0,ag.jsx)(Jw,{rlnInstance:t,setMembershipKey:o}),(0,ag.jsx)("h2",{children:"Wallet"}),(0,ag.jsxs)("p",{children:["network: ",w]}),(0,ag.jsxs)("p",{children:["address: ",g]}),(0,ag.jsx)(Ww,{setAddress:y,setProvider:p})]})};function Jw(e){var t=e.rlnInstance,r=e.setMembershipKey,n=function(){var e=(0,E.Z)((0,k.Z)().mark((function e(){var n;return(0,k.Z)().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=2;break}return e.abrupt("return");case 2:n=t.generateMembershipKey(),r(n);case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return(0,ag.jsx)("div",{children:(0,ag.jsx)(Wg,{variant:"contained",onClick:n,disabled:!t,children:"Generate RLN Credentials"})})}w.createRoot(document.getElementById("root")).render((0,ag.jsx)(m.StrictMode,{children:(0,ag.jsx)(Qw,{})}))}()})();
|
|
//# sourceMappingURL=main.75745ffb.js.map
|